| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- $(function() {
- initTable()
- })
- $('#sc_btns').click(function(){
- initTable()
- })
- function initTable() {
- var $tableLeft = $('#table_all');
- $tableLeft.bootstrapTable('destroy');
- //先销毁表格
- $tableLeft.bootstrapTable({
- method: "get", //使用get请求到服务器获取数据
- url: huayi.config.callcenter_url + "testusertypeapi/api/Test/getorder",
- contentType: "application/x-www-form-urlencoded",
- striped: true, //表格显示条纹
- pagination: true, //启动分页
- pageSize: 10, //每页显示的记录数
- pageNumber: 1, //当前第几页
- fixedColumns: true,
- fixedNumber: 3,
- pageList: [5, 10, 20, 50, 100], //记录数可选列表
- search: false, //是否启用查询
- showColumns: false, //显示下拉框勾选要显示的列
- showRefresh: false, //显示刷新按钮
- sidePagination: "server", //表示服务端请求
- //设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
- //设置为limit可以获取limit, offset, search, sort, order
- queryParamsType: "undefined",
- queryParams: function queryParams(params) { //设置查询参数
- console.log(params)
- var param = {
- PageIndex: params.pageNumber,
- PageSize: params.pageSize,
- userIdCard:$('#userIdCard').val(),
- userName:$('#userName').val(),
- userMobile:$('#userMobile').val(),
- deptname:$('#deptname').val(),
- docorname:$('#docorname').val()
- };
- return param;
- },
- onLoadSuccess: function(data) { //加载成功时执行
- var newDataL = {};
- newDataL.state = data.state;
- newDataL.message = data.message;
- newDataL.rows = data.data.rows;
- newDataL.total = data.data.total;
- $tableLeft.bootstrapTable('load', newDataL);
- $('.tool_downs').authorizeOperateButton();
- },
- onLoadError: function() { //加载失败时执行
- layer.msg("加载数据失败", {
- time: 1500,
- icon: 2
- });
- }
- });
- }
- //格式化操作
- //格式化操作
- function formatterOperate(val, row) {
- console.log(typeof(row.orderstate))
- if(row.orderstate=='0'){
- var str = '<ul class="tool_downs">' +
- '<li><a class="aBtn" id="HY_delete_' + row.orderId + '" onclick="btn_delete(\'' + row.orderIdHIS + '\',\'' +row.orderTime+
- '\')">取消预约</a><li>'
- '</ul>';
- return str
- }else{
- return ''
- }
-
- }
- function getGender(val){
- if(val=='M'){
- return '男'
- }else{
- return '女'
- }
- }
- function getState(val){
- if(val==0){
- return '预约成功'
- }else if(val==1){
- return '预约失败'
- }else{
- return '已取消'
- }
- }
- function getTimeFlag(val){
- if(val=='1'){
- return '上午'
- }else if(val=='2'){
- return '下午'
- }else if(val=='3'){
- return '晚上'
- }else if(val=='4'){
- return '白天'
- }else{
- return '昼夜'
- }
- }
- function btn_add() {
- layer.open({
- type: 2,
- content: "./addAcessppoint.html", //iframe的url,no代表不显示滚动条
- title: '添加预约信息',
- area: ['75%', '95%'], //宽高
- });
- }
- // function btn_edit(edit_id) {
- // layer.open({
- // type: 2,
- // content: "./addRiskLevel.html?edit_id=" + edit_id, //iframe的url,no代表不显示滚动条
- // title: '修改风险等级信息',
- // area: ['50%', '30%'], //宽高
- // });
- // }
- function btn_delete(ids,orderTime) {
- layer.confirm('确定取消当前预约?', {
- btn: ['是', '否'] //按钮
- }, function() {
- /*发送请求*/
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "testusertypeapi/api/Test/uporder",
- async: true,
- dataType: 'json',
- data: {
- orderIdHIS: ids,
- cancelTime:orderTime
- },
- success: function(data) {
- if (data.state.toLowerCase() == 'success') {
- layer.msg("预约取消成功!");
- initTable();
- }
- }
- });
- });
- }
|