diff --git a/js/car_settlement/child/choose_plan_code_list.js b/js/car_settlement/child/choose_plan_code_list.js index 14c7a96..b609fd6 100644 --- a/js/car_settlement/child/choose_plan_code_list.js +++ b/js/car_settlement/child/choose_plan_code_list.js @@ -31,16 +31,16 @@ function queryTable(type) { $('#proName').val(''); return layer.msg('工程名称查询包含特殊字符,请重新输入', { icon: 2 }); } - let planCode = $('#planCode').val(); - let flag2 = checkValue(planCode); + let code = $('#code').val(); + let flag2 = checkValue(code); if (flag2) { - $('#planCode').val(''); + $('#code').val(''); return layer.msg('需求计划编号查询包含特殊字符,请重新输入', { icon: 2 }); } reloadTable(1); } else if (type === 2) { $('#proName').val(''); - $('#planCode').val(''); + $('#code').val(''); layui.form.render(); reloadTable(1); } @@ -55,7 +55,7 @@ function reloadTable(pageNum) { where: { encryptedData: JSON.stringify({ 'proName': $('#proName').val(), - 'planCode': $('#planCode').val(), + 'code': $('#code').val(), 'contractId': objParam.contractId, 'supId': objParam.supId }), @@ -78,7 +78,7 @@ function initTable() { where: { encryptedData: JSON.stringify({ 'proName': $('#proName').val(), - 'planCode': $('#planCode').val(), + 'code': $('#code').val(), 'contractId': objParam.contractId, 'supId': objParam.supId }), diff --git a/js/welcome/data_datail_plan_list.js b/js/welcome/data_datail_plan_list.js index ed4a713..b3e6b6f 100644 --- a/js/welcome/data_datail_plan_list.js +++ b/js/welcome/data_datail_plan_list.js @@ -1,233 +1,239 @@ 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 code = $('#code').val(); + let flag = checkValue(code); + if (flag) { + $('#code').val(''); + return layer.msg('计划编号查询包含特殊字符,请重新输入', { icon: 2 }); + } + let supName = $('#supName').val(); + let flag2 = checkValue(supName); + if (flag2) { + $('#supName').val(''); + return layer.msg('供应商查询包含特殊字符,请重新输入', { icon: 2 }); + } + let proName = $('#proName').val(); + let flag3 = checkValue(proName); + if (flag3) { $('#proName').val(''); - $('#planStatus').val(''); - layui.form.render(); - reloadTable(1); + return layer.msg('工程名称查询包含特殊字符,请重新输入', { icon: 2 }); } - } - - // 刷新页面数据 - function reloadData() { reloadTable(1); - getProStatisticsDetails(); + } else if (type === 2) { + $('#code').val(''); + $('#supName').val(''); + $('#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 reloadData() { + reloadTable(1); + getProStatisticsDetails(); +} + +// 获取筛选条件 +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]; + } else if (strArr[0] === 'pay') { + filterParams.payStatus = strArr[1]; + } + }) + filterParams.code = $('#code').val(); + filterParams.supName = $('#supName').val(); + filterParams.proName = $('#proName').val(); + return filterParams; +} + +// 重载表格 +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-450", - 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: '6.9%', - title: "序号", - align: "center", - templet: function (d) { - return d.LAY_NUM; - }, + where: { + encryptedData: JSON.stringify(params), + }, + }, + ); +} + +// 初始化表格 +function initTable() { + let params = getFilterParams(); + tableIns = table.render({ + elem: "#currentTableId", + id: 'currentTableId', + headers: { + authorization: sessionStorage.getItem("gz-token"), + }, + height: "full-450", + url: dataUrl + "backstage/homeIndex/getPlanDetails", + 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: '6.9%', + title: "序号", + align: "center", + templet: function (d) { + return d.LAY_NUM; }, - { - field: "code", - width: '10%', - title: "需求计划编号", - unresize: true, - align: "center", - templet: function (d) { - let html = ""; - html += "" + d.code + ""; - return html; - }, }, - { - field: "proName", - width: '13%', - title: "工程名称", - unresize: true, - align: "center", + { + field: "code", + width: '10%', + title: "需求计划编号", + unresize: true, + align: "center", + templet: function (d) { + let html = ""; + html += "" + d.code + ""; + return html; }, - { - field: "planNum", - width: '10%', - title: "派车状态", - unresize: true, - align: "center", - templet: function (d) { - return '' + d.planNum + ''; - }, + }, + { + field: "proName", + width: '13%', + title: "工程名称", + unresize: true, + align: "center", + }, + { + field: "dispatchStatus", + width: '10%', + title: "派车状态", + unresize: true, + align: "center", + templet: function (d) { + return setStatusColor(d.dispatchStatus); }, - { - field: "ypcNum", - width: '10%', - title: "车辆数量", - unresize: true, - align: "center", - templet: function (d) { - return '' + d.ypcNum + ''; - }, + }, + { + field: "carNum", + width: '10%', + title: "车辆数量", + unresize: true, + align: "center", + }, + { + field: "craneNum", + width: '10%', + title: "吊车数量", + unresize: true, + align: "center", + }, + { + field: "money", + title: "金额", + width: '10%', + unresize: true, + align: "center", + templet: function (d) { + return '¥ ' + d.money + '' }, - { - field: "dpcNum", - width: '10%', - title: "吊车数量", - unresize: true, - align: "center", - templet: function (d) { - return '' + d.dpcNum + ''; - }, - }, - { - field: "planStatus", - title: "金额", - width: '10%', - unresize: true, - align: "center", - templet: function (d) { - return setStatusColor(d.planStatus); - }, - }, - { - field: "lastDay", - width: '10%', - title: "供应商", - unresize: true, - align: "center", - }, - { - field: "progress", - width: '10%', - title: "付款状态", - unresize: true, - align: "center", - }, - { - field: "needNum", - title: "所属分公司", - width: '10%', - unresize: true, - align: "center", - }, - ], + }, + { + field: "supName", + width: '10%', + title: "供应商", + unresize: true, + align: "center", + }, + { + field: "payStatus", + width: '10%', + title: "付款状态", + 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 === '1') { + color = "#f56c6c"; + name = '未派车'; + } else if (value === '2') { + color = "#19be6b"; + name = '已派车' } - - // 数量颜色 - function setNumColor(value) { - return '' + value + ""; + return ' ● ' + name + ""; +} + +// 导出 +function exportExcel() { + let params = getFilterParams(); + let url = dataUrl + "backstage/homeIndex/exportPlanDetails"; + exportExcelUtil(url, '需求计划详情', JSON.stringify(params)); +} + +// 需求计划详情 +function openPlanDetail(obj) { + obj.id = obj.planId; + obj.code = obj.code; + let content = '../car_demand_plan/child/apply_plan_detail.html'; + if (obj.code.indexOf('spec-') > -1) { + content = '../car_demand_plan/child/emerg_internal_car_detail.html'; } - - // 发货状态颜色 - 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 ( - '
' + - '
' + - "
" - ); - } - - // 导出 - function exportExcel() { - let params = { - 'proName': $('#proName').val(), - 'planStatus': $('#planStatus').val() - } - let url = dataUrl + "backstage/dispatchCar/export"; - exportExcelUtil(url, '派车管理', JSON.stringify(params)); - } - - // 工程详情 - function dispatchCarProDetail(obj) { - openIframeByParamObj("dispatchCarProDetail", "工程详情", "./child/dispatch_car_pro_detail.html", "92%", "95%", obj, 1); - } \ No newline at end of file + openIframeByParamObj2("homePlanDetail", "需求计划", content, "92%", "95%", obj); +} \ No newline at end of file diff --git a/js/welcome/data_datail_pro_list.js b/js/welcome/data_datail_pro_list.js index 86e5b23..9d5db21 100644 --- a/js/welcome/data_datail_pro_list.js +++ b/js/welcome/data_datail_pro_list.js @@ -59,8 +59,6 @@ function reloadTable(pageNum) { // 初始化表格 function initTable() { let params = getFilterParams(); - console.error(params); - tableIns = table.render({ elem: "#currentTableId", id: 'currentTableId', @@ -193,7 +191,7 @@ function setNumColor(value) { return '' + value + ""; } -// 发货状态颜色 +// 派车状态颜色 function setStatusColor(value) { let color = "#409Eff"; let name = '' diff --git a/js/welcome/data_detail_common.js b/js/welcome/data_detail_common.js index 0866241..0d7c807 100644 --- a/js/welcome/data_detail_common.js +++ b/js/welcome/data_detail_common.js @@ -22,8 +22,11 @@ function loadCompanyData() { } // 派车状态 -function loadDispatchStatusData() { - const list = [{ id: 'dispatch-0', labelName: '全部' }, { id: 'dispatch-1', labelName: '部分派车' }, { id: 'dispatch-2', labelName: '未派车' }, { id: 'dispatch-3', labelName: '全部派车' }]; +function loadDispatchStatusData(type) { + let list = [{ id: 'dispatch-0', labelName: '全部' }, { id: 'dispatch-1', labelName: '部分派车' }, { id: 'dispatch-2', labelName: '未派车' }, { id: 'dispatch-3', labelName: '全部派车' }]; + if(type){ + list = [{ id: 'dispatch-0', labelName: '全部' }, { id: 'dispatch-1', labelName: '未派车' }, { id: 'dispatch-2', labelName: '已派车' }]; + } setTagData(list, 'demo2'); } diff --git a/js/welcome/data_detail_list.js b/js/welcome/data_detail_list.js index 915b786..d716e14 100644 --- a/js/welcome/data_detail_list.js +++ b/js/welcome/data_detail_list.js @@ -259,7 +259,7 @@ function setFilterData(type) { loadMonthData(); // 月份 } else if (type === 2) { // 需求计划详情 loadCompanyData(); // 分公司 - loadDispatchStatusData(); // 派车状态 + loadDispatchStatusData(1); // 派车状态 loadPayStatusData(); // 付款状态 loadYearsData(); // 年份 loadMonthData(); // 月份 diff --git a/page/car_settlement/child/choose_plan_code_list.html b/page/car_settlement/child/choose_plan_code_list.html index 4bb3882..624aaa7 100644 --- a/page/car_settlement/child/choose_plan_code_list.html +++ b/page/car_settlement/child/choose_plan_code_list.html @@ -49,7 +49,7 @@
-