/** * 管理初始化 */ var DriverApplyRefund = { id: "DriverApplyRefundTable", //表格id seItem: null, //选中的条目 table: null, layerIndex: -1 }; /** * 初始化表格的列 */ /** * 关闭此对话框 */ DriverApplyRefund.close = function () { parent.layer.close(window.parent.DriverApplyRefund.layerIndex); }; DriverApplyRefund.audit = function (e) { const data1 = { id:null, state:null, remark:"" }; data1.id = $("#id").val(); var state = $("input[name='areaType']:checked").val(); data1.state = state; if (state==3){ data1.remark = $("#remark").val(); } $.ajax({ url: Feng.ctxPath + "/userAudit/audit", type: "POST", contentType: "application/json", // 设置请求头的 Content-Type data: JSON.stringify(data1), // 将数据转换为 JSON 字符串 success: function(response) { Feng.success("操作成功!"); window.parent.DriverApplyRefund.table.refresh(); DriverApplyRefund.close(); }, error: function(xhr, status, error) { Feng.success("操作成功!"); window.parent.DriverApplyRefund.table.refresh(); DriverApplyRefund.close(); } }); }; DriverApplyRefund.areaTypeClick = function (e) { if (2 == e){ // 通过 $("#remarkP").hide(); } else if (3 == e){ // 驳回 $("#remarkP").show(); } }; DriverApplyRefund.info = function (e) { var index = layer.open({ type: 2, title: '详情', area: ['100%', '100%'], //宽高 fix: false, //不固定 maxmin: true, content: Feng.ctxPath + '/userAudit/auditInfo/'+e }); this.layerIndex = index; }; /** * 检查是否选中 */ DriverApplyRefund.check = function () { var selected = $('#' + this.id).bootstrapTable('getSelections'); if(selected.length == 0){ Feng.info("请先选中表格中的某一记录!"); return false; } DriverApplyRefund.seItem = selected[0]; return true; }; /** * 打开编辑 */ /** * 查询列表 */ DriverApplyRefund.search = function () { var queryData = {}; queryData['code'] = $("#code").val(); queryData['name'] = $("#name").val(); queryData['phone'] = $("#phone").val(); queryData['status'] = $("#status").val(); DriverApplyRefund.table.refresh({query: queryData}); }; DriverApplyRefund.resetSearch = function () { $("#code").val(""); $("#name").val(""); $("#phone").val(""); $("#status").val(""); DriverApplyRefund.search(); }; $(function () { var defaultColunms = DriverApplyRefund.initColumn(); var table = new BSTable(DriverApplyRefund.id, "/driverApplyRefund/list", defaultColunms); table.setPaginationType("server"); DriverApplyRefund.table = table.init(); });