From c3a22b34f66cacb7fdebe316d8798dc591662e0d Mon Sep 17 00:00:00 2001 From: cwchen <1048842385@qq.com> Date: Fri, 17 Jan 2025 12:39:11 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../child/dispatch_car_edit_form.js | 4 +- .../child/dispatch_input_edit_form.js | 4 +- .../child/dispatch_input_form.js | 4 +- .../child/branch_dispatch_car_detail.js | 14 +- .../child/branch_settlement_detail.js | 8 +- .../child/branch_settlement_pro_detail.js | 14 +- js/car_settlement/child/settlement_detail.js | 52 ++-- js/welcome/data_datail_pro_list.js | 36 +-- js/welcome/pro_list_detail.js | 267 ++++++++++++++++++ .../child/dispatch_car_pro_detail.html | 2 - .../child/branch_settlement_detail.html | 2 - .../child/settlement_detail.html | 4 +- page/welcome/pro_list_detail.html | 96 +++++++ 13 files changed, 434 insertions(+), 73 deletions(-) create mode 100644 js/welcome/pro_list_detail.js create mode 100644 page/welcome/pro_list_detail.html diff --git a/js/car_demand_plan/child/dispatch_car_edit_form.js b/js/car_demand_plan/child/dispatch_car_edit_form.js index 31419a1..ad62b53 100644 --- a/js/car_demand_plan/child/dispatch_car_edit_form.js +++ b/js/car_demand_plan/child/dispatch_car_edit_form.js @@ -55,11 +55,11 @@ function setParams(obj) { for (let i = 0; i <= length - 1; i++) { let layFilterName = $('.formSubmit2').eq(i).attr('lay-filter'); if (i === 0) { - form.on('submit(' + layFilterName + ')', function (data) { + form.on('submit(' + layFilterName + ')', function () { $('.formSubmit2').eq(i + 1).trigger('click') }); } else if (i === length - 1) { - form.on('submit(' + layFilterName + ')', function (data) { + form.on('submit(' + layFilterName + ')', function () { submitApply(data); }); } diff --git a/js/car_demand_plan/child/dispatch_input_edit_form.js b/js/car_demand_plan/child/dispatch_input_edit_form.js index ba696b9..9f7859a 100644 --- a/js/car_demand_plan/child/dispatch_input_edit_form.js +++ b/js/car_demand_plan/child/dispatch_input_edit_form.js @@ -54,11 +54,11 @@ function setParams(obj) { for (let i = 0; i <= length - 1; i++) { let layFilterName = $('.formSubmit2').eq(i).attr('lay-filter'); if (i === 0) { - form.on('submit(' + layFilterName + ')', function (data) { + form.on('submit(' + layFilterName + ')', function () { $('.formSubmit2').eq(i + 1).trigger('click') }); } else if (i === length - 1) { - form.on('submit(' + layFilterName + ')', function (data) { + form.on('submit(' + layFilterName + ')', function () { submitApply(data); }); } diff --git a/js/car_demand_plan/child/dispatch_input_form.js b/js/car_demand_plan/child/dispatch_input_form.js index a0769c6..c7362d6 100644 --- a/js/car_demand_plan/child/dispatch_input_form.js +++ b/js/car_demand_plan/child/dispatch_input_form.js @@ -56,11 +56,11 @@ function setParams(obj) { for (let i = 0; i <= length - 1; i++) { let layFilterName = $('.formSubmit2').eq(i).attr('lay-filter'); if (i === 0) { - form.on('submit(' + layFilterName + ')', function (data) { + form.on('submit(' + layFilterName + ')', function () { $('.formSubmit2').eq(i + 1).trigger('click') }); } else if (i === length - 1) { - form.on('submit(' + layFilterName + ')', function (data) { + form.on('submit(' + layFilterName + ')', function () { submitApply(data); }); } diff --git a/js/car_settlement/child/branch_dispatch_car_detail.js b/js/car_settlement/child/branch_dispatch_car_detail.js index 6214bd7..c271d4a 100644 --- a/js/car_settlement/child/branch_dispatch_car_detail.js +++ b/js/car_settlement/child/branch_dispatch_car_detail.js @@ -29,7 +29,7 @@ function setParams(params) { function getAllOutList() { let params = { encryptedData: JSON.stringify({ - 'planId': objParam.id, + 'planId': objParam.planId, }) }; let url = dataUrl + 'backstage/supDispatchCar/getAllOutList'; // 默认详情所有批次 @@ -48,7 +48,7 @@ function getAllOutList() { }, function (xhr, status, error) { errorFn(xhr, status, error) }, null); - // 详情批次数据/待审核批次数据 + // 详情批次数据 function setBatchData(dataList) { let html = '', id = '', status = '', type = ''; $.each(dataList, function (index, item) { @@ -58,9 +58,6 @@ function getAllOutList() { type = item.type; } let batchName = '第' + numToChinese(index + 1) + '批次'; - if (objParam.type === 2) { // 待审核批次 - batchName = '待审核第' + numToChinese(index + 1) + '批次'; - } html += "
  • " + batchName + "
  • "; }) $('#layui-tab-title').empty().append(html); @@ -400,12 +397,7 @@ function viewFileDetail(obj, type) { title = '操作证/身份证/导航图' } obj.type = type; - openIframeByParamObj("viewFileDetail", title, './view_file_detail.html', "92%", "95%", obj); -} - -function checkData() { - objParam.checkType = '1'; // 派车审核 - openIframeByParamObj("checkData", "审核", "./audit_form.html", "40%", "50%", objParam); + openIframeByParamObj("viewFileDetail", title, '../../car_demand_plan/child/view_file_detail.html', "92%", "95%", obj); } // 打印 diff --git a/js/car_settlement/child/branch_settlement_detail.js b/js/car_settlement/child/branch_settlement_detail.js index 4b42b0e..b0d1d1f 100644 --- a/js/car_settlement/child/branch_settlement_detail.js +++ b/js/car_settlement/child/branch_settlement_detail.js @@ -112,14 +112,14 @@ function initTable() { }, { field: "proName", - width: '9.9%', + width: '14%', title: "工程名称", unresize: true, align: "center", }, { field: "planNum", - width: '8%', + width: '10%', title: "需求计划数量", unresize: true, align: "center", @@ -141,13 +141,13 @@ function initTable() { { field: "dpcNum", title: "待派车数量", - width: '8%', + width: '9%', unresize: true, align: "center", }, { field: "money", - width: '8%', + width: '9%', title: "应付金额", unresize: true, align: "center", diff --git a/js/car_settlement/child/branch_settlement_pro_detail.js b/js/car_settlement/child/branch_settlement_pro_detail.js index 2e22306..6b76d0a 100644 --- a/js/car_settlement/child/branch_settlement_pro_detail.js +++ b/js/car_settlement/child/branch_settlement_pro_detail.js @@ -109,14 +109,14 @@ function initTable() { }, { field: "typeName", - width: '8%', + width: '7%', title: "计划类型", unresize: true, align: "center", }, { field: "code", - width: '8%', + width: '11%', title: "需求计划编号", unresize: true, align: "center", @@ -141,7 +141,7 @@ function initTable() { { field: "dpcNum", title: "待派车数量", - width: '8%', + width: '10%', unresize: true, align: "center", }, @@ -158,7 +158,7 @@ function initTable() { { field: "payMoney", title: "已付金额", - width: '7%', + width: '10%', align: "center", unresize: true, templet: function (d) { @@ -168,7 +168,7 @@ function initTable() { { field: "noPayMoney", title: "待付金额 ", - width: '7%', + width: '10%', align: "center", unresize: true, templet: function (d) { @@ -178,7 +178,7 @@ function initTable() { { field: "supName", title: "供应商", - width: '8%', + width: '10%', align: "center", unresize: true, }, @@ -224,6 +224,8 @@ function viewPlanDetail(obj) { // 详情 function dispatchCarDetail(obj, type) { + console.error(obj); obj.type = type; + obj.typeName = obj.type === '1' ? '车辆':'吊车'; openIframeByParamObj2("dispatchCarDetail", "详情", "../car_settlement/child/branch_dispatch_car_detail.html", "92%", "95%", obj); } \ No newline at end of file diff --git a/js/car_settlement/child/settlement_detail.js b/js/car_settlement/child/settlement_detail.js index 727f7e9..0758dfa 100644 --- a/js/car_settlement/child/settlement_detail.js +++ b/js/car_settlement/child/settlement_detail.js @@ -12,18 +12,20 @@ function setParams(params) { upload = layui.upload; layer = layui.layer; }); - function setPayStatus(){ - if(objParam.status === '未付'){ + function setPayStatus() { + if (objParam.status === '未付') { return "待付款"; - }else{ + } else { return "已付款"; } } + getSltDetailsInfo(); + getPayCarDetails(); } // 供应商付款记录-详情 function getSltDetailsInfo() { - let encryptedData = { 'id': objParam.id }; + let encryptedData = { planId: objParam.planId }; let url = dataUrl + 'backstage/carBalance/getSltDetailsInfo?encryptedData=' + encodeURIComponent(JSON.stringify(encryptedData)); ajaxRequest(url, "GET", null, true, function () { }, function (result) { @@ -44,19 +46,8 @@ function getSltDetailsInfo() { $('#money').html(obj.money); $('#dispatchDay').html(obj.dispatchDay); $('#remark').html(obj.remark); - // 附件文档 setFileTable(obj.fileList); - - // 用车明细 - let carList = list.filter(item => { - return item.type === '车辆'; - }) - let dcList = list.filter(item => { - return item.type === '吊车'; - }) - setDispatchCarTable(carList); - setDispatchCarTable2(dcList); } // 附件文档赋值 @@ -97,6 +88,35 @@ function getSltDetailsInfo() { return '' } + +} + +// 用车明细 +function getPayCarDetails() { + let encryptedData = { planId: objParam.planId }; + let url = dataUrl + 'backstage/carBalance/getPayCarDetails?encryptedData=' + encodeURIComponent(JSON.stringify(encryptedData)); + ajaxRequest(url, "GET", null, true, function () { + }, function (result) { + console.error(result); + if (result.code === 200) { + setData(result.data); + } + }, function (xhr, status, error) { + errorFn(xhr, status, error) + }, null); + + function setData(list) { + // 用车明细 + let carList = list.filter(item => { + return item.type === '车辆'; + }) + let dcList = list.filter(item => { + return item.type === '吊车'; + }) + setDispatchCarTable(carList); + setDispatchCarTable2(dcList); + } + // 派车明细-车辆 function setDispatchCarTable(list) { $('#dispatch-car-table tr:not(:first)').remove(); @@ -227,7 +247,7 @@ function viewFileDetail(obj, type) { // 需求计划详情 function viewPlanDetail(obj) { obj.id = obj.planId; - obj.code = obj.planCode; + obj.code = obj.planCode || 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'; diff --git a/js/welcome/data_datail_pro_list.js b/js/welcome/data_datail_pro_list.js index d284eae..86e5b23 100644 --- a/js/welcome/data_datail_pro_list.js +++ b/js/welcome/data_datail_pro_list.js @@ -103,6 +103,11 @@ function initTable() { title: "工程名称", unresize: true, align: "center", + templet: function (d) { + let html = ""; + html += "" + d.proName + ""; + return html; + }, }, { field: "planNum", @@ -205,28 +210,6 @@ function setStatusColor(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"; - } - //设置页面进度条 - return ( - '
    ' + - '
    ' + - "
    " - ); -} - // 导出 function exportExcel() { let params = getFilterParams(); @@ -234,7 +217,12 @@ function exportExcel() { exportExcelUtil(url, '工程详情', JSON.stringify(params)); } -// 工程详情 -function dispatchCarProDetail(obj) { + +/* function dispatchCarProDetail(obj) { openIframeByParamObj("dispatchCarProDetail", "工程详情", "./child/dispatch_car_pro_detail.html", "92%", "95%", obj, 1); +} */ + +// 工程详情 +function openProDetail(obj){ + openIframeByParamObj2("openProDetail", "工程需求计划详情", "../welcome/pro_list_detail.html", "92%", "95%", obj); } \ No newline at end of file diff --git a/js/welcome/pro_list_detail.js b/js/welcome/pro_list_detail.js new file mode 100644 index 0000000..3b82d25 --- /dev/null +++ b/js/welcome/pro_list_detail.js @@ -0,0 +1,267 @@ +let objParam; +let form, table, tableIns, layer, element; +let pageNum = 1; + +function setParams(params) { + objParam = JSON.parse(params); + console.error(objParam); + $('#proName').html(objParam.proName); + $('#bmname').html(objParam.companyName); + layui.use(["form", "table", 'layer', 'element'], function () { + form = layui.form; + table = layui.table; + element = layui.element; + layer = layui.layer; + getProStatisticsDetails(); + initTable(); + }); +} + +// 数据概览 +function getProStatisticsDetails() { + let params = { + encryptedData: JSON.stringify({ + 'proId': objParam.proId + }) + }; + let url = dataUrl + 'backstage/dispatchCar/getProStatisticsDetails'; + ajaxRequest(url, "POST", params, true, function () { + }, function (result) { + if (result.code === 200) { + setNum(result.data); + } + }, function (xhr, status, error) { + errorFn(xhr, status, error) + }, null); + + // 数据概览赋值 + function setNum(obj) { + $('.layui-progress').remove(); + $('#planNum').html(obj.planNum); + $('#dispatchNum').html(obj.dispatchNum); + $('#noDispatchNum').html(obj.noDispatchNum); + $('.layui-progress').remove(); + $("#progress").after(` +
    +
    +
    + `); + element.render(); + } + +} + +// 查询/重置 +function queryTable(type) { + if (type === 1) { + let code = $('#code').val(); + let flag = checkValue(code); + if (flag) { + $('#code').val(''); + return layer.msg('需求计划编号查询包含特殊字符,请重新输入', { icon: 2 }); + } + reloadTable(1); + } else if (type === 2) { + $('#code').val(''); + $('#status').val(''); + layui.form.render(); + reloadTable(1); + } +} + +// 刷新页面数据 +function reloadData() { + reloadTable(pageNum); +} + +// 重载表格 +function reloadTable(pageNum) { + table.reload("currentTableId", { + page: { + curr: pageNum ? pageNum : 1, + }, + where: { + encryptedData: JSON.stringify({ + 'code': $('#code').val(), + 'status': $('#status').val(), + 'proId': objParam.proId + }), + }, + }, + ); +} + +// 初始化表格 +function initTable() { + tableIns = table.render({ + elem: "#currentTableId", + id: 'currentTableId', + headers: { + authorization: sessionStorage.getItem("gz-token"), + }, + height: "full-250", + url: dataUrl + "backstage/dispatchCar/getNeedPlanList", + where: { + encryptedData: JSON.stringify({ + 'code': $('#code').val(), + 'status': $('#status').val(), + 'proId': objParam.proId + }), + }, + 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.9%', + title: "序号", + align: "center", + templet: function (d) { + return d.LAY_NUM; + }, + }, + { + field: "typeName", + width: '10%', + title: "计划类型", + unresize: true, + align: "center", + }, + { + field: "code", + width: '12%', + title: "需求计划编号", + unresize: true, + align: "center", + templet: function (d) { + return "" + d.code + ""; + }, + }, + { + field: "userName", + width: '10%', + title: "申请人", + unresize: true, + align: "center", + }, + { + field: "appLyTime", + title: "申请时间", + width: '10%', + unresize: true, + align: "center", + }, + { + field: "remark", + title: "备注", + width: '12%', + unresize: true, + align: "center", + templet: function (d) { + if (d.remark) { + if (d.remark.length > 60) { + return '' + d.remark.substring(0, 60) + '...' + } else { + return '' + d.remark + '' + } + } else { + return ''; + } + }, + }, + { + field: "statusName", + title: "派车状态", + width: '10%', + unresize: true, + align: "center", + templet: function (d) { + if (d.statusName === '待派车' || d.statusName === '待审核') { + return '' + d.statusName + ''; + } else if (d.statusName === '已派车') { + return '' + d.statusName + ''; + } else { + return ''; + } + }, + }, + { + field: "dispatchNum", + width: '10%', + title: "派车数量", + unresize: true, + align: "center", + templet: function (d) { + return "" + d.dispatchNum + ""; + }, + }, + { + field: "supName", + title: "采购金额", + width: '10%', + align: "center", + unresize: true, + }, + { + title: "操作", + width: '10%', + align: "center", + unresize: true, + templet: function (d) { + let html = ""; + html += "详情"; + return html; + }, + }, + ], + ], + limits: [10, 15, 20, 25, 50, 100], + limit: 10, + page: true, + done: function (res, curr, count) { + pageNum = tableIns.config.page.curr; + table.resize("currentTableId"); + }, + }); +} + + +// 导出 +function exportExcel() { + let params = { + 'planCode': $('#planCode').val(), + 'status': $('#status').val(), + 'proId': objParam.proId + } + let url = dataUrl + "backstage/purchase/exportDetails"; + exportExcelUtil(url, '需求计划详情', JSON.stringify(params)); +} + +// 详情 +function dispatchCarDetail(obj, type) { + let flag = isExistData(type, obj); + if (!flag && type === 1) { + return layer.msg('暂无派车批次数据', { icon: 7 }); + } else if (!flag && type === 2) { + return layer.msg('暂无待审核批次数据', { icon: 7 }); + } + let title = '详情'; + if (type === 2) { + title = '审核'; + } + obj.type = type; + openIframeByParamObj2("dispatchCarDetail", title, "../car_demand_plan/child/dispatch_car_detail.html", "92%", "95%", obj, 2); +} diff --git a/page/car_demand_plan/child/dispatch_car_pro_detail.html b/page/car_demand_plan/child/dispatch_car_pro_detail.html index bec6ee1..983f7a8 100644 --- a/page/car_demand_plan/child/dispatch_car_pro_detail.html +++ b/page/car_demand_plan/child/dispatch_car_pro_detail.html @@ -60,8 +60,6 @@ - -
    diff --git a/page/car_settlement/child/branch_settlement_detail.html b/page/car_settlement/child/branch_settlement_detail.html index 238c128..855b9a0 100644 --- a/page/car_settlement/child/branch_settlement_detail.html +++ b/page/car_settlement/child/branch_settlement_detail.html @@ -69,8 +69,6 @@ - -
    diff --git a/page/car_settlement/child/settlement_detail.html b/page/car_settlement/child/settlement_detail.html index 1c0b3b5..0b34344 100644 --- a/page/car_settlement/child/settlement_detail.html +++ b/page/car_settlement/child/settlement_detail.html @@ -119,7 +119,7 @@ 单价
    (元/吨*公里) 预估金额 行驶证/挂靠协议
    驾驶证/身份证/导航图 - 供应商 + 需求计划编号 @@ -133,7 +133,7 @@ - +
    diff --git a/page/welcome/pro_list_detail.html b/page/welcome/pro_list_detail.html new file mode 100644 index 0000000..5347151 --- /dev/null +++ b/page/welcome/pro_list_detail.html @@ -0,0 +1,96 @@ + + + + + + + 首页-工程详情-计划详情 + + + + + + + + +
    +
    +
    + +
    +

    +

    +
    +
    +
    +

    需求计划数量

    +

    0

    +
    +
    +

    运输车辆数量

    +

    0

    +
    +
    +

    吊车数量

    +

    0

    +
    +
    +

    金额

    +

    0

    +
    +
    +

    进度

    +
    +
    +
    +
    +
    + 搜索信息 +
    +
    +
    +
    +
    + +
    +
    +
    +
    + +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + \ No newline at end of file