From b73198ad6f771ea4ecc70236aed3c3b5196c1857 Mon Sep 17 00:00:00 2001 From: cwchen <1048842385@qq.com> Date: Thu, 14 Nov 2024 14:51:26 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9C=80=E6=B1=82=E8=AE=A1=E5=88=92=E7=94=B3?= =?UTF-8?q?=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/accessory/child/audit_form.js | 3 + js/demandPlan/child/apply_plan_detail.js | 18 ++- js/demandPlan/plan_check_list.js | 139 ++++++++++--------- page/demandPlan/child/apply_plan_detail.html | 3 +- page/demandPlan/plan_check_list.html | 40 ++++-- 5 files changed, 125 insertions(+), 78 deletions(-) diff --git a/js/accessory/child/audit_form.js b/js/accessory/child/audit_form.js index f55981d..7436d75 100644 --- a/js/accessory/child/audit_form.js +++ b/js/accessory/child/audit_form.js @@ -39,6 +39,9 @@ function submitApply(data) { if (objParam.checkType === '1') { url = ''; data.field.id = idParam; + } else if (objParam.checkType === '2') { // 需求计划审核 + url = dataUrl + 'backstage/planAudit/planAudit'; + data.field.id = idParam; } console.log(JSON.stringify(data.field)); $.ajax({ diff --git a/js/demandPlan/child/apply_plan_detail.js b/js/demandPlan/child/apply_plan_detail.js index dac5d6a..3843e6f 100644 --- a/js/demandPlan/child/apply_plan_detail.js +++ b/js/demandPlan/child/apply_plan_detail.js @@ -3,8 +3,10 @@ let details; let form, layer, laydate; function setParams(obj) { objParam = JSON.parse(obj); - // console.log(objParam); - + console.log(objParam.checkType); + if (objParam.checkType === 2) { + $('#print').before(''); + } idParam = objParam.id; layui.use(['form', 'layer', 'laydate'], function () { form = layui.form; @@ -223,4 +225,16 @@ function print() { console.log('onEnd', new Date()) } }) +} + +// 需求计划申请审核 +function check() { + objParam.checkType = '2'; // 需求计划申请审核 + openIframeByParamObj("check", "审核", "../../accessory/child/audit_form.html", "40%", "50%", objParam); +} + +function closePage() { + let index = parent.layer.getFrameIndex(window.name); // 先得到当前 iframe层的索引 + parent.layer.close(index); // 再执行关闭 + window.parent.queryTable(1); } \ No newline at end of file diff --git a/js/demandPlan/plan_check_list.js b/js/demandPlan/plan_check_list.js index 8cc0154..d42d5d2 100644 --- a/js/demandPlan/plan_check_list.js +++ b/js/demandPlan/plan_check_list.js @@ -1,14 +1,15 @@ -let form, table, laydate; +let form, table, element; let tableIns; let pageNum = 1; // 定义分页 -layui.use(["form", "table", 'laydate'], function () { +layui.use(["form", "table", 'element'], function () { form = layui.form; table = layui.table; - laydate = layui.laydate; - laydate.render({ - elem: '#ID-laydate-rangeLinked', - range: ['#startDay', '#endDay'], - rangeLinked: true + element = layui.element; + // tab 切换事件 + element.on('tab(demo-filter-tab)', function (data) { + let auditStatus = $(this).attr('value'); + $('#auditStatus').val(auditStatus); + queryTable(1); }); initTable(); }); @@ -19,8 +20,6 @@ function queryTable(type) { reloadTable(1); } else if (type === 2) { $('#keyWord').val(''); - $('#startDate').val(''); - $('#endDate').val(''); layui.form.render(); reloadTable(1); } @@ -40,8 +39,7 @@ function reloadTable(pageNum) { where: { encryptedData: JSON.stringify({ 'keyWord': $('#keyWord').val(), - 'startDate': $('#startDate').val(), - 'endDate': $('#endDate').val() + 'auditStatus': $('#auditStatus').val(), }), }, }, @@ -56,13 +54,12 @@ function initTable() { headers: { authorization: sessionStorage.getItem("gz-token"), }, - height: "full-170", - url: dataUrl + "backstage/partInput/findByPage", + height: "full-220", + url: dataUrl + "backstage/planAudit/findByPage", where: { encryptedData: JSON.stringify({ 'keyWord': $('#keyWord').val(), - 'startDate': $('#startDate').val(), - 'endDate': $('#endDate').val() + 'auditStatus': $('#auditStatus').val(), }), }, request: { @@ -89,73 +86,58 @@ function initTable() { }, { field: "code", - width: '15%', + width: '10%', + title: "计划单号", + unresize: true, + align: "center", + }, + { + field: "proName", + width: '14%', title: "工程名称", unresize: true, align: "center", }, { - field: "inputUser", - width: '8%', - title: "工程状态", - unresize: true, - align: "center", - templet: function (d) { - return setProStatus('1'); - }, - }, - { - field: "inputNum", + field: "projectPart", width: '10%', - title: "维修单数量", + title: "项目部分", unresize: true, align: "center", - templet: function (d) { - return '1'; - }, + }, { field: "allPrice", width: '10%', - title: "配件领料单数量", + title: "审核状态", unresize: true, align: "center", templet: function (d) { - return '1'; + return getCheckStatus(d.statusType, d.status); + ; }, }, { - field: "allPrice", + field: "creator", width: '10%', - title: "配件退回单数量", + title: "提交人", + unresize: true, + align: "center", + + }, + { + field: "createTime", + width: '15%', + title: "提交时间", unresize: true, align: "center", - templet: function (d) { - return '1'; - }, }, { field: "remark", - width: '15%', - title: "领用/使用/退回配件数量", + width: '14%', + title: "备注", unresize: true, align: "center", - templet: function (d) { - return '
领:2,563
'; - // return '领:2,563
用:2,000
退:563
'; - }, - - }, - { - field: "remark", - width: '15%', - title: "领用/使用/退回配件金额", - unresize: true, - align: "center", - templet: function (d) { - return '领:2,563
'; - // return '领:2,563
用:2,000
退:563
'; - }, }, { title: "操作", @@ -164,7 +146,11 @@ function initTable() { unresize: true, templet: function (d) { let html = ""; - html += "详情"; + html += "详情"; + let content = getCheckStatus(d.statusType, d.status); + if (!(content.indexOf('驳回') > -1 || content.indexOf('通过') > -1)) { + html += "