From 13a347a4612f21049c2dd9100f3ffa62cd2e848a Mon Sep 17 00:00:00 2001 From: cwchen <1048842385@qq.com> Date: Fri, 17 Jan 2025 10:48:00 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/car_settlement/child/payment_form.js | 2 +- js/welcome/data_datail_pro_list.js | 449 ++++++++++++------------ js/welcome/data_detail_common.js | 2 +- 3 files changed, 229 insertions(+), 224 deletions(-) diff --git a/js/car_settlement/child/payment_form.js b/js/car_settlement/child/payment_form.js index 91cdac4..cff418f 100644 --- a/js/car_settlement/child/payment_form.js +++ b/js/car_settlement/child/payment_form.js @@ -139,7 +139,7 @@ function submitApply(data) { supId: item.supId, proId: item.proId, money: item.cost, - outId: item.carOutId + outId: item.outId }; detailsList.push(obj); }) diff --git a/js/welcome/data_datail_pro_list.js b/js/welcome/data_datail_pro_list.js index ae75d3b..d284eae 100644 --- a/js/welcome/data_datail_pro_list.js +++ b/js/welcome/data_datail_pro_list.js @@ -1,235 +1,240 @@ initTable(); // 查询/重置 function queryTable(type) { - if (type === 1) { - let proName = $('#proName').val(); - let flag = checkValue(proName); - if (flag) { - $('#proName').val(''); - return layer.msg('工程名称查询包含特殊字符,请重新输入', { icon: 2 }); - } - reloadTable(1); - } else if (type === 2) { + if (type === 1) { + let proName = $('#proName').val(); + let flag = checkValue(proName); + if (flag) { $('#proName').val(''); - $('#planStatus').val(''); - layui.form.render(); - reloadTable(1); + return layer.msg('工程名称查询包含特殊字符,请重新输入', { icon: 2 }); } - } - - // 刷新页面数据 - function reloadData() { reloadTable(1); - getProStatisticsDetails(); + } else if (type === 2) { + $('#proName').val(''); + layui.form.render(); + reloadTable(1); } - - // 重载表格 - function reloadTable(pageNum) { - table.reload("currentTableId", { - page: { - curr: pageNum ? pageNum : 1, - }, - where: { - encryptedData: JSON.stringify({ - 'proName': $('#proName').val(), - 'planStatus': $('#planStatus').val() - }), - }, +} + +// 获取筛选条件 +function getFilterParams() { + let filterParams = {}; + $('#delDemo .tag-item').each(function () { + let layId = $(this).attr('lay-id'); + let strArr = layId.split('-'); + if (strArr[0] === 'company') { + let name = replaceChinese($(this).html()); + filterParams.companyName = name; + } else if (strArr[0] === 'dispatch') { + filterParams.dispatchStatus = strArr[1]; + } else if (strArr[0] === 'year') { + filterParams.year = strArr[1]; + } else if (strArr[0] === 'month') { + filterParams.month = strArr[1]; + } + }) + filterParams.proName = $('#proName').val(); + return filterParams; +} + +// 刷新页面数据 +function reloadData() { + reloadTable(1); +} + +// 重载表格 +function reloadTable(pageNum) { + let params = getFilterParams(); + table.reload("currentTableId", { + page: { + curr: pageNum ? pageNum : 1, }, - ); - } - - // 初始化表格 - function initTable() { - tableIns = table.render({ - elem: "#currentTableId", - id: 'currentTableId', - headers: { - authorization: sessionStorage.getItem("gz-token"), - }, - height: "full-400", - url: dataUrl + "backstage/dispatchCar/getProStatisticsList", - where: { - encryptedData: JSON.stringify({ - 'proName': $('#proName').val(), - 'planStatus': $('#planStatus').val() - }), - }, - request: { - pageName: 'pageNum', - limitName: 'pageSize' - }, - parseData: function (res) { // res 即为原始返回的数据 - if (res.code === 401) { - closeWindowOpen(); - } - return { - "code": 0, // 解析接口状态 - "msg": '获取成功', // 解析提示文本 - "count": res.total, // 解析数据长度 - "data": res.list // 解析数据列表 - }; - }, - cols: [ - [ - { - width: '5%', - title: "序号", - align: "center", - templet: function (d) { - return d.LAY_NUM; - }, + where: { + encryptedData: JSON.stringify(params), + }, + }, + ); +} + +// 初始化表格 +function initTable() { + let params = getFilterParams(); + console.error(params); + + tableIns = table.render({ + elem: "#currentTableId", + id: 'currentTableId', + headers: { + authorization: sessionStorage.getItem("gz-token"), + }, + height: "full-400", + url: dataUrl + "backstage/homeIndex/getProDetails", + where: { + encryptedData: JSON.stringify(params), + }, + request: { + pageName: 'pageNum', + limitName: 'pageSize' + }, + parseData: function (res) { // res 即为原始返回的数据 + if (res.code === 401) { + closeWindowOpen(); + } + return { + "code": 0, // 解析接口状态 + "msg": '获取成功', // 解析提示文本 + "count": res.total, // 解析数据长度 + "data": res.list // 解析数据列表 + }; + }, + cols: [ + [ + { + width: '5%', + title: "序号", + align: "center", + templet: function (d) { + return d.LAY_NUM; }, - { - field: "proName", - width: '11%', - title: "工程名称", - unresize: true, - align: "center", + }, + { + field: "proName", + width: '11%', + title: "工程名称", + unresize: true, + align: "center", + }, + { + field: "planNum", + width: '6%', + title: "计划数", + unresize: true, + align: "center", + }, + { + field: "dispatchPlanNum", + width: '9%', + title: "已派车计划", + unresize: true, + align: "center", + }, + { + field: "noDispatchPlanNum", + width: '9%', + title: "待派车计划", + unresize: true, + align: "center", + }, + { + field: "dispatchStatus", + title: "派车状态", + width: '8%', + unresize: true, + align: "center", + templet: function (d) { + return setStatusColor(d.dispatchStatus); }, - { - field: "planNum", - width: '6%', - title: "计划数", - unresize: true, - align: "center", - templet: function (d) { - return '' + d.planNum + ''; - }, - }, - { - field: "ypcNum", - width: '9%', - title: "已派车计划", - unresize: true, - align: "center", - templet: function (d) { - return '' + d.ypcNum + ''; - }, - }, - { - field: "dpcNum", - width: '9%', - title: "待派车计划", - unresize: true, - align: "center", - templet: function (d) { - return '' + d.dpcNum + ''; - }, - }, - { - field: "planStatus", - title: "派车状态", - width: '8%', - unresize: true, - align: "center", - templet: function (d) { - return setStatusColor(d.planStatus); - }, - }, - { - field: "lastDay", - width: '10%', - title: "应派车数量", - unresize: true, - align: "center", - }, - { - field: "progress", - width: '11.9%', - title: "已派车数量", - unresize: true, - align: "center", - }, - { - field: "needNum", - title: "待派车数量", - width: '10%', - unresize: true, - align: "center", - }, - { - field: "dispatchNum", - title: "已派车金额", - width: '10%', - unresize: true, - align: "center", - }, - { - field: "noDispatchNum", - title: "所属分公司", - width: '10%', - unresize: true, - align: "center", - }, - ], + }, + { + field: "shouldDispatchNum", + width: '10%', + title: "应派车数量", + unresize: true, + align: "center", + }, + { + field: "dispatchNum", + width: '11.9%', + title: "已派车数量", + unresize: true, + align: "center", + }, + { + field: "noDispatchNum", + title: "待派车数量", + width: '10%', + unresize: true, + align: "center", + }, + { + field: "money", + title: "已派车金额", + width: '10%', + unresize: true, + align: "center", + }, + { + field: "companyName", + title: "所属分公司", + width: '10%', + unresize: true, + align: "center", + }, ], - limits: [10, 15, 20, 25, 50, 100], - limit: 10, - page: true, - done: function (res, curr, count) { - pageNum = tableIns.config.page.curr; - element.render(); - table.resize("currentTableId"); - }, - }); + ], + limits: [10, 15, 20, 25, 50, 100], + limit: 10, + page: true, + done: function (res, curr, count) { + pageNum = tableIns.config.page.curr; + element.render(); + table.resize("currentTableId"); + }, + }); +} + +// 数量颜色 +function setNumColor(value) { + return '' + value + ""; +} + +// 发货状态颜色 +function setStatusColor(value) { + let color = "#409Eff"; + let name = '' + if (value === '2') { + color = "#f56c6c"; + name = '未派车'; + } else if (value === '1') { + color = "#ff9900"; + name = '部分派车' + } else if (value === '3') { + color = "#19be6b"; + name = '全部派车' } - - // 数量颜色 - function setNumColor(value) { - return '' + value + ""; + return ' ● ' + name + ""; +} + +// 设置进度值 +function schedule(d) { + d.progress = d.process; + d.progress = parseFloat(d.progress ? d.progress : 0); + d.filter == undefined ? (d.filter = d.LAY_NUM) : d.filter; + d.progress == undefined ? (d.progress = 100) : d.progress; + var color = "layui-bg-orange"; + if (d.progress < 100) { + color = "layui-bg-orange"; + } else if (d.progress === 100) { + color = "layui-bg-primary"; + } else if (d.progress > 100) { + color = "layui-bg-blue"; } - - // 发货状态颜色 - function setStatusColor(value) { - let color = "#409Eff"; - let name = '' - if (value === '未派车') { - color = "#f56c6c"; - name = '未派车'; - } else if (value === '部分派车') { - color = "#ff9900"; - name = '部分派车' - } else if (value === '全部派车') { - color = "#19be6b"; - name = '全部派车' - } - return '' + name + ""; - } - - // 设置进度值 - function schedule(d) { - d.progress = d.process; - d.progress = parseFloat(d.progress ? d.progress : 0); - d.filter == undefined ? (d.filter = d.LAY_NUM) : d.filter; - d.progress == undefined ? (d.progress = 100) : d.progress; - var color = "layui-bg-orange"; - if (d.progress < 100) { - color = "layui-bg-orange"; - } else if (d.progress === 100) { - color = "layui-bg-primary"; - } else if (d.progress > 100) { - color = "layui-bg-blue"; - } - //设置页面进度条 - return ( - '