let objParam; let form, table, tableIns, layer; let oneList = [], twoList = [], threeList = []; function setParams(params) { objParam = JSON.parse(params); layui.use(["form", 'layer'], function () { form = layui.form; layer = layui.layer; getAuditConfig(); }); } // 获取详情 function getAuditConfig() { let params = { encryptedData: JSON.stringify({ id: objParam.id }) }; let url = dataUrl + 'sys/auditConfig/getAuditConfig'; ajaxRequest(url, "POST", params, true, function () { }, function (result) { console.error(result); if (result.code === 200) { setAuditUserData(result.data); } }, function (xhr, status, error) { errorFn(xhr, status, error) }, null); // 各审核节点审核人员赋值 function setAuditUserData(obj) { let one = obj.one; let two = obj.two; let three = obj.three; oneList = one, twoList = two, threeList = three; setData(one, 'one'); setData(two, 'two'); setData(three, 'three'); } function setData(list, name) { let html = ''; $.each(list, function (idx, item) { html += '
' + '' + setNullValue(item.comName) + '' + '' + item.userName + '' + '
'; }) $('#' + name).empty().append(html); } } // 刷新数据 function reloadData() { getAuditConfig(); } // 设置审批人 function setAuditUser(type) { objParam.type = type; if (type === 1) { objParam.list = oneList; objParam.typeName = '分公司'; } else if (type === 2) { objParam.list = twoList; objParam.typeName = '项管中心'; } else if (type === 3) { objParam.list = threeList; objParam.typeName = '机具公司'; } openIframeByParamObj("setAuditUserForm", "选择审批人", "./audit_user_set_form.html", "80%", "90%", objParam); }