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 += "
|
审核"; + } return html; }, }, @@ -190,16 +176,35 @@ function exportExcel() { exportExcelUtil(url, '配件入库数据', JSON.stringify(params)); } -// 配件退料详情 -function proCountDetail(obj) { - openIframeByParamObj("pro_count_detail", "详情", "./child/pro_count_detail.html", "92%", "95%", obj); +//审核状态 +function getCheckStatus(statusType, status) { + var company = ""; + if (statusType === '1') { + return "审核通过"; + } else if (statusType === '2') { + company = "分公司"; + } else if (statusType === '3') { + company = "项目管理中心"; + } else if (statusType === '4') { + company = "机具公司"; + } + if (status === '1') { + return "待" + company + "审核"; + } else if (status === '2') { + return "审核通过"; + } else if (status === '3') { + return "" + company + "审核驳回"; + } + return "待审核"; } -// 工程状态 -function setProStatus(status) { - if (status === '1') { - return "在建"; - } else if (status === '2') { - return "完工"; - } +// 详情 +function planAuditDetail(obj) { + openIframeByParamObj("plan_audit_detail", "详情", "./child/apply_plan_detail.html", "92%", "95%", obj); +} + +// 需求计划申请审核 +function checkDetail(obj) { + obj.checkType = 2; + openIframeByParamObj("check_detail", "审核", "./child/apply_plan_detail.html", "92%", "95%", obj); } \ No newline at end of file diff --git a/page/demandPlan/child/apply_plan_detail.html b/page/demandPlan/child/apply_plan_detail.html index f7b6999..95ca09a 100644 --- a/page/demandPlan/child/apply_plan_detail.html +++ b/page/demandPlan/child/apply_plan_detail.html @@ -25,7 +25,7 @@
- +
@@ -146,5 +146,6 @@ + \ No newline at end of file diff --git a/page/demandPlan/plan_check_list.html b/page/demandPlan/plan_check_list.html index 2019cf8..a7e6354 100644 --- a/page/demandPlan/plan_check_list.html +++ b/page/demandPlan/plan_check_list.html @@ -11,27 +11,51 @@ +
+
+
    +
  • 全部
  • +
  • 待审核
  • +
  • 已通过
  • +
  • 已驳回
  • +
+
搜索信息
+
+ class="layui-input" lay-affix="clear" placeholder="输入关键字" maxlength="30">
-
- -
@@ -52,7 +76,7 @@ - +