From d67c60654eadaa30716d1ed64c10aa519708ce26 Mon Sep 17 00:00:00 2001 From: xzg <4727863@qq.com> Date: Wed, 4 Dec 2024 11:45:57 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B7=B2=E7=9F=A5bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/desk/DataBoard.vue | 471 +++++++++++++++++++++++++---------- 1 file changed, 337 insertions(+), 134 deletions(-) diff --git a/src/views/desk/DataBoard.vue b/src/views/desk/DataBoard.vue index edf5aa2e..6506873a 100644 --- a/src/views/desk/DataBoard.vue +++ b/src/views/desk/DataBoard.vue @@ -772,14 +772,14 @@
当天
当月
@@ -793,7 +793,17 @@ 发起数
- {{ abnormal_Info.sendNum }} + {{ abnormal_Info.sendNum }}
@@ -808,9 +818,9 @@ class="data mr5px underline" @click=" () => - handleShowAbnormalData('异常数据', noDealNum, { - tip: '总单数', - prop: 'noDealNum', + handleShowAbnormalData('异常数据', abnormal_status, { + tip: '待处理', + prop: 'unCompleteNum', }) " >{{ abnormal_Info.noDealNum }}
- - 异常率 + + 处理率
- {{ abnormal_Info.abnormalRate }} + {{ abnormal_Info.abnormalRate }} %
@@ -1044,14 +1064,14 @@ -
+
@@ -1086,8 +1106,8 @@
{{ signforData.clerkSignforScale || 0 }}
-
%
+
- 文员签收率 + 文员签收件
@@ -1129,7 +1149,7 @@ handleShowSignDetail('签收数据 - 签收超时率 - %', signforData_status, { tip: '签收超时率', prop: 'clerkOverTimeScale', - }) + },'bar') " >
@@ -1327,14 +1347,14 @@
-
+
@@ -1369,7 +1389,7 @@
{{ billSignforData.clerkSignforScale ? billSignforData.clerkSignforScale : 0 }}
-
%
+
- 文员签收率 + 文员签收数
@@ -1412,7 +1432,7 @@ handleShowSignDetail('自提签收数据 - 超时签收任务 - %', billSignforData_status, { tip: '超时签收任务', prop: 'clerkOverTimeScale', - }) + },'bar') " >
@@ -1580,16 +1600,28 @@ const details = reactive({ }, /** 异常卸车数据 */ unloadAbnormalDataInfo: { - abnormalDayRate: 0, - abnormalMonthRate: 0, - noDealDayNum: 0, - noDealMonthNum: 0, - sendDayNum: 0, - sendMonthNum: 0, - unloadDayNum: 0, - unloadMonthNum: 0, - dayData: [], - monthData: [], + dayData: { + abnormalDayRate: 0, + abnormalMonthRate: 0, + noDealDayNum: 0, + noDealMonthNum: 0, + sendDayNum: 0, + sendMonthNum: 0, + unloadDayNum: 0, + unloadMonthNum: 0, + data: [], + }, + monthData: { + abnormalDayRate: 0, + abnormalMonthRate: 0, + noDealDayNum: 0, + noDealMonthNum: 0, + sendDayNum: 0, + sendMonthNum: 0, + unloadDayNum: 0, + unloadMonthNum: 0, + data: [], + }, }, /** 配送数据 */ deliveryDataInfo: {}, @@ -1670,7 +1702,7 @@ const delivery_status = ref< >('tradeMatching'); /** 异常数据状态 */ -const abnormal_status = ref<'day' | 'month'>('day'); +const abnormal_status = ref<'dayData' | 'monthData'>('dayData'); /** 签收数据状态 */ const signforData_status = ref<'daySignData' | 'monthSignData'>('daySignData'); @@ -1770,6 +1802,8 @@ const initTrunklineCarsData = async () => { } }; function accumulateData(targetInfo, dataArray, isMonthly) { + console.log('targetInfo :>> ', targetInfo); + for (let i = 0; i < dataArray.length; i++) { const item = dataArray[i]; if (isMonthly) { @@ -1786,7 +1820,6 @@ function accumulateData(targetInfo, dataArray, isMonthly) { /**异常数据 */ const initUnloadAbnormalData = async () => { - return try { details.loadingObj.unloadAbnormalData = true; const res = await $_aftersalesData({}); @@ -1795,22 +1828,24 @@ const initUnloadAbnormalData = async () => { const { code, data } = res.data; if (code !== 200) return; console.log(data, '异常数据'); - + details.unloadAbnormalDataInfo.dayData.data = data.dayData; + details.unloadAbnormalDataInfo.monthData.data = data.monthData; // 处理 dayData - await accumulateData(details.unloadAbnormalDataInfo, data.dayData, false); - + await accumulateData(details.unloadAbnormalDataInfo.dayData, data.dayData, false); // 处理 monthData - await accumulateData(details.unloadAbnormalDataInfo, data.monthData, true); - + await accumulateData(details.unloadAbnormalDataInfo.monthData, data.monthData, true); // 计算异常率 - details.unloadAbnormalDataInfo.abnormalMonthRate = - (details.unloadAbnormalDataInfo.abnormalMonthRate / - details.unloadAbnormalDataInfo.sendMonthNum) * - 100; - - details.unloadAbnormalDataInfo.abnormalDayRate = - (details.unloadAbnormalDataInfo.abnormalDayRate / details.unloadAbnormalDataInfo.sendDayNum) * - 100; + details.unloadAbnormalDataInfo.dayData.abnormalMonthRate = + (details.unloadAbnormalDataInfo.dayData.abnormalMonthRate / + details.unloadAbnormalDataInfo.dayData.sendMonthNum) * + 100 || 0; + + details.unloadAbnormalDataInfo.monthData.abnormalDayRate = + (details.unloadAbnormalDataInfo.monthData.abnormalDayRate / + details.unloadAbnormalDataInfo.monthData.sendDayNum) * + 100 || 0; + // details.unloadAbnormalDataInfo.dayData.data[0].noDealNum=10 + // details.unloadAbnormalDataInfo.dayData.data[2].noDealNum=15 } catch (error) { console.log('error :>> ', error); } finally { @@ -2089,16 +2124,16 @@ handleRefresh(); /** 异常数据 */ const abnormal_Info = computed(() => { const _obj = - abnormal_status.value === 'day' + abnormal_status.value === 'dayData' ? { - sendNum: details.unloadAbnormalDataInfo.sendDayNum, - noDealNum: details.unloadAbnormalDataInfo.noDealDayNum, - abnormalRate: details.unloadAbnormalDataInfo.abnormalDayRate, + sendNum: details.unloadAbnormalDataInfo.dayData.sendDayNum, + noDealNum: details.unloadAbnormalDataInfo.dayData.noDealDayNum, + abnormalRate: details.unloadAbnormalDataInfo.dayData.abnormalDayRate, } : { - sendNum: details.unloadAbnormalDataInfo.sendMonthNum, - noDealNum: details.unloadAbnormalDataInfo.noDealMonthNum, - abnormalRate: details.unloadAbnormalDataInfo.abnormalMonthRate, + sendNum: details.unloadAbnormalDataInfo.monthData.sendMonthNum, + noDealNum: details.unloadAbnormalDataInfo.monthData.noDealMonthNum, + abnormalRate: details.unloadAbnormalDataInfo.monthData.abnormalMonthRate, }; return _obj; @@ -2121,6 +2156,7 @@ const delivery_bill_info = computed(() => { /** 签收数据 */ const signforData = computed(() => { const _obj: any = details.signforDataInfo[signforData_status.value] || {}; + console.log('_obj :>> ', _obj); _obj.signScaleNum ? _obj.signScaleNum : (_obj.signScaleNum = _obj.signScale || 0); _obj.clerkSignforScaleNum @@ -2166,109 +2202,275 @@ const billSignforData = computed(() => { type OptionObjType = { prop: string; tip: string }; + +// 定义两种颜色 +const colors = ['#008CBA', '#808080']; // 蓝色和灰色 +// /** 获取百分比 */ +// const getProportion = (value: number, total: number) => { +// if (total === 0) return '0%'; +// if (!isNumber(value)) return '0%'; +// return computeNumber(Number(value), '/', total).next('*', 100).result.toFixed(2) + '%'; +// }; /** 获取百分比 */ -const getProportion = (value: number, total: number) => { - if (total === 0) return '0%'; +const getProportion = (value: number) => { if (!isNumber(value)) return '0%'; - return computeNumber(Number(value), '/', total).next('*', 100).result.toFixed(2) + '%'; + return (value * 100).toFixed(2) + '%'; }; - -/** 显示图表 */ -const handleShowEcharts = (data: any[], title: string, optionObj: OptionObjType) => { - if (getObjType(data) !== 'array') return; - - const _arr = []; - - let _total = 0; - +// /** 显示图表 */ +// const handleShowEcharts = (data: any[], title: string, optionObj: OptionObjType) => { +// console.log('data :>> ', data); +// console.log('title :>> ', title); + +// console.log('optionObj :>> ', optionObj); + +// if (getObjType(data) !== 'array') return; + +// const _arr = []; + +// let _total = 0; + +// for (let i = 0; i < data.length; i++) { +// const value = data[i]; + +// value[optionObj.prop] = isNumber(value[optionObj.prop]) ? Number(value[optionObj.prop]) : 0; + +// _total = computeNumber(_total, '+', value[optionObj.prop]).result; +// } + +// for (let i = 0; i < data.length; i++) { +// const value = data[i]; + +// let isContinue = false; + +// for (let j = 0; j < _arr.length; j++) { +// const item = _arr[j]; +// if (item.value > value[optionObj.prop]) continue; + +// _arr.splice(j, 0, { +// name: value.warehouseName + ' - ' + getProportion(value[optionObj.prop], _total), +// value: value[optionObj.prop], +// }); +// isContinue = true; +// break; +// } +// if (isContinue) continue; + +// _arr.push({ +// name: value.warehouseName + ' - ' + getProportion(value[optionObj.prop], _total), +// value: value[optionObj.prop], +// }); +// } + +// nextTick(() => { +// // 初始化Echarts +// const chartDom = document.getElementById('echartBox'); +// const myChart = echarts.init(chartDom); + +// const option = { +// title: { +// text: title, +// // subtext: 'Fake Data', +// left: 'right', +// }, +// tooltip: { +// trigger: 'item', +// }, +// legend: { +// orient: 'vertical', +// left: 'left', +// }, +// series: [ +// { +// name: optionObj.tip, +// // 数据显示类型 -- 扇形 +// type: 'bar', +// // radius: '50%', +// // 数据 +// data: _arr, +// // 激活样式 +// emphasis: { +// itemStyle: { +// shadowBlur: 10, +// shadowOffsetX: 0, +// shadowColor: 'rgba(0, 0, 0, 0.5)', +// }, +// label: { +// show: true, +// fontSize: 20, +// fontWeight: 'bold', +// }, +// }, +// // 扇区显示 +// radius: ['30%', '70%'], +// // avoidLabelOverlap: false, +// // 扇区间隔 +// // padAngle: 2, +// // 最小显示角度 +// // minShowLabelAngle: 5, +// // 距离左侧的距离 +// left: '20%', +// }, +// ], +// }; + +// option && myChart.setOption(option); +// }); +// }; +// 定义显示图表的函数,接受数据、标题、选项对象和图表类型(默认为饼图) +const handleShowEcharts = (data: any[], title: string, optionObj: OptionObjType, chartType: string = 'pie') => { + console.log('data :>> ', data); + console.log('title :>> ', title); + console.log('optionObj :>> ', optionObj); + + if (getObjType(data) !== 'array') return; // 检查传入的数据是否为数组,如果不是则返回 + + const _arr = []; // 初始化一个空数组,用于存储处理后的数据 + let _total = 0; // 初始化一个变量,用于存储数据的总和 + + // 遍历传入的数据数组,计算总和并转换数值 for (let i = 0; i < data.length; i++) { - const value = data[i]; - - value[optionObj.prop] = isNumber(value[optionObj.prop]) ? Number(value[optionObj.prop]) : 0; - - _total = computeNumber(_total, '+', value[optionObj.prop]).result; + const value = data[i]; // 获取当前数据项 + value[optionObj.prop] = isNumber(value[optionObj.prop]) ? Number(value[optionObj.prop]) : 0; // 确保当前数据项的值为数字,如果不是则设为 0 + _total = computeNumber(_total, '+', value[optionObj.prop]).result; // 累加当前数据项的值到总和 } + // 遍历传入的数据数组,对数据进行排序 for (let i = 0; i < data.length; i++) { - const value = data[i]; - - let isContinue = false; + const value = data[i]; // 获取当前数据项 + let isContinue = false; // 初始化一个标志变量,用于判断是否已插入当前数据项 + // 遍历 _arr 数组,找到合适的位置插入当前数据项 for (let j = 0; j < _arr.length; j++) { - const item = _arr[j]; - if (item.value > value[optionObj.prop]) continue; + const item = _arr[j]; // 获取当前 _arr 中的数据项 + if (item.value > value[optionObj.prop]) continue; // 如果当前 _arr 中的数据项值大于当前数据项的值,继续下一个循环 - _arr.splice(j, 0, { - name: value.warehouseName + ' - ' + getProportion(value[optionObj.prop], _total), - value: value[optionObj.prop], + _arr.splice(j, 0, { // 在当前位置插入当前数据项 + name: value.warehouseName, // 数据项的名称 + value: value[optionObj.prop], // 数据项的值 }); - isContinue = true; - break; + isContinue = true; // 设置标志变量为 true,表示已插入当前数据项 + break; // 跳出内层循环 } - if (isContinue) continue; + if (isContinue) continue; // 如果已插入当前数据项,跳过插入到数组末尾的操作 - _arr.push({ - name: value.warehouseName + ' - ' + getProportion(value[optionObj.prop], _total), - value: value[optionObj.prop], + _arr.push({ // 如果未插入,将当前数据项添加到数组末尾 + name: value.warehouseName, // 数据项的名称 + value: value[optionObj.prop], // 数据项的值 }); } - nextTick(() => { - // 初始化Echarts + nextTick(() => { // 确保 DOM 更新完成后再进行图表初始化 + // 获取图表容器元素 const chartDom = document.getElementById('echartBox'); - const myChart = echarts.init(chartDom); + if (!chartDom) return; // 如果未找到图表容器元素,则返回 + + const myChart = echarts.init(chartDom); // 初始化 ECharts 实例 const option = { title: { - text: title, - // subtext: 'Fake Data', - left: 'right', + text: title, // 设置图表标题 + left: 'right', // 标题位置 }, tooltip: { - trigger: 'item', + trigger: 'item', // 设置提示框触发方式为数据项 + formatter: (params) => { + if (chartType === 'pie') { + return `${params.name}: ${params.value} (${params.percent}%)`; // 如果是饼图,格式化提示信息为名称、值和百分比 + } else { + return `${params.name}: ${getProportion(params.value)}`; // 如果是柱状图,格式化提示信息为名称和值的百分比形式 + } + }, }, legend: { - orient: 'vertical', - left: 'left', + orient: 'vertical', // 图例布局方向 + left: 'left', // 图例位置 }, - series: [ - { - name: optionObj.tip, - // 数据显示类型 -- 扇形 - type: 'pie', - // radius: '50%', - // 数据 - data: _arr, - // 激活样式 - emphasis: { + ...(chartType === 'bar' && { // 如果是柱状图,添加柱状图的配置 + xAxis: { + type: 'category', // x 轴类型为类别 + data: _arr.map(item => item.name), // x 轴数据为类别名称 + axisLabel: { + interval: 0, // 确保所有标签都显示 + rotate: 45, // 旋转标签以避免重叠 + }, + }, + yAxis: { + type: 'value', // y 轴类型为数值 + axisLabel: { + formatter: (value) => { + return getProportion(value); // 将 y 轴标签格式化为百分比形式 + } + }, + }, + series: [ + { + name: optionObj.tip, // 系列名称 + type: 'bar', // 系列类型为柱状图 + data: _arr.map(item => ({ // 系列数据 + name: item.name, // 数据项名称 + value: item.value, // 数据项值 + })), itemStyle: { - shadowBlur: 10, - shadowOffsetX: 0, - shadowColor: 'rgba(0, 0, 0, 0.5)', + color: (params) => { + // 根据数据项的索引选择颜色 + return colors[params.dataIndex % 2]; + } }, - label: { - show: true, - fontSize: 20, - fontWeight: 'bold', + emphasis: { + itemStyle: { + shadowBlur: 10, // 高亮时的阴影模糊度 + shadowOffsetX: 0, // 高亮时的阴影水平偏移 + shadowColor: 'rgba(0, 0, 0, 0.5)', // 高亮时的阴影颜色 + }, + label: { + show: true, // 显示高亮标签 + fontSize: 20, // 高亮标签字体大小 + fontWeight: 'bold', // 高亮标签字体粗细 + formatter: (params) => { + return getProportion(params.value); // 高亮标签格式化为百分比形式 + } + }, }, + barGap: '30%', // 柱子之间的间隔 + barWidth: '40%', // 柱子的宽度 + left: '20%', // 柱状图的左偏移 }, - // 扇区显示 - radius: ['30%', '70%'], - // avoidLabelOverlap: false, - // 扇区间隔 - // padAngle: 2, - // 最小显示角度 - // minShowLabelAngle: 5, - // 距离左侧的距离 - left: '20%', - }, - ], + ], + }), + ...(chartType === 'pie' && { // 如果是饼图,添加饼图的配置 + series: [ + { + name: optionObj.tip, // 系列名称 + type: 'pie', // 系列类型为饼图 + data: _arr.map((item) => ({ // 系列数据 + name: item.name + ' - ' + getProportion(item.value / _total), // 数据项名称,附加百分比 + value: item.value, // 数据项值 + })), + emphasis: { + itemStyle: { + shadowBlur: 10, // 高亮时的阴影模糊度 + shadowOffsetX: 0, // 高亮时的阴影水平偏移 + shadowColor: 'rgba(0, 0, 0, 0.5)', // 高亮时的阴影颜色 + }, + label: { + show: true, // 显示高亮标签 + fontSize: 20, // 高亮标签字体大小 + fontWeight: 'bold', // 高亮标签字体粗细 + }, + }, + radius: ['30%', '70%'], // 饼图的内半径和外半径 + left: '20%', // 饼图的左偏移 + }, + ], + }), }; - option && myChart.setOption(option); + option && myChart.setOption(option); // 如果 option 存在,设置图表配置 }); }; + + /** 请求详情 */ const handleDetails = async (type, title, optionObj: OptionObjType) => { details.popUpShow.isShow = true; @@ -2332,8 +2534,7 @@ const handleShowDeliveryDetail = ( handleShowEcharts(data, title, optionObj); }; /** 显示售后异常数据 */ - -const handleShowAbnormalData = (title, type: 'noDealNum', optionObj: any = {}) => { +const handleShowAbnormalData = (title, type: 'dayData' | 'monthData', optionObj: any = {},chartType) => { details.popUpShow.isShow = true; details.title = title; console.log(optionObj, 'optionObj'); @@ -2342,21 +2543,23 @@ const handleShowAbnormalData = (title, type: 'noDealNum', optionObj: any = {}) = if (getObjType(details.unloadAbnormalDataInfo[type]) !== 'object') return; - - const { data } = details.deliveryDataInfo[type]; - - - handleShowEcharts(data, title, optionObj); + const { data } = details.unloadAbnormalDataInfo[type]; + handleShowEcharts(data, title, optionObj,chartType); }; /** 显示签收详情 */ const handleShowSignDetail = ( title, type: 'daySignData' | 'monthSignData' | 'dayBillLadingSignData' | 'monthBillLadingSignData', - optionObj: any = {} + optionObj: any = {}, + chartType ) => { details.popUpShow.isShow = true; details.title = title; + console.log(type, 'typeaaa'); + console.log(title, 'titleaaa'); + console.log(optionObj, 'optionObjaaa'); + console.log(details.signforDataInfo[type], 'details.signforDataInfo[type]'); if (getObjType(details.signforDataInfo[type]) !== 'object') return; @@ -2364,7 +2567,7 @@ const handleShowSignDetail = ( console.log('data :>> ', data); - handleShowEcharts(data, title, optionObj); + handleShowEcharts(data, title, optionObj,chartType); }; /** 导出 */ From 3ef74462654b941013f19d72c129e87702f1646e Mon Sep 17 00:00:00 2001 From: qb <1191961160@qq.com> Date: Wed, 4 Dec 2024 15:31:45 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E5=BC=80=E5=8D=95=E5=BD=95=E5=8D=95?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/option/finance/WaybillAudit.js | 10 ++++ src/option/waybill/WaybillOrderList.js | 12 ++++- .../distribution/inventory/CreateOrder.vue | 49 ++++++++++-------- src/views/waybill/CreateZeroOrder.vue | 51 +++++++++++-------- src/views/waybill/WaybillOrderList.vue | 4 +- 5 files changed, 80 insertions(+), 46 deletions(-) diff --git a/src/option/finance/WaybillAudit.js b/src/option/finance/WaybillAudit.js index 04315da1..b73dbb31 100644 --- a/src/option/finance/WaybillAudit.js +++ b/src/option/finance/WaybillAudit.js @@ -580,6 +580,16 @@ export const columnList = [ sortable: true, head: false, }, + { + prop: 'completeDestination', + label: '到站全称', + type: 2, + values: '', + width: '120', + checkarr: [], + fixed: false, + sortable: true, + }, { prop: 'destinationWarehouseName', label: '目的仓', diff --git a/src/option/waybill/WaybillOrderList.js b/src/option/waybill/WaybillOrderList.js index 6f8e99a9..ea7af6bf 100644 --- a/src/option/waybill/WaybillOrderList.js +++ b/src/option/waybill/WaybillOrderList.js @@ -60,7 +60,7 @@ export const columnList = [ label: '运单状态', type: 3, values: '', - width: '100', + width: '120', checkarr: [ { label: '未入库', value: '0' }, { label: '部分入库', value: '10' }, @@ -198,6 +198,16 @@ export const columnList = [ fixed: false, sortable: true, }, + { + prop: 'completeDestination', + label: '到站全称', + type: 2, + values: '', + width: '120', + checkarr: [], + fixed: false, + sortable: true, + }, { prop: 'goodsName', label: '货物名称', diff --git a/src/views/distribution/inventory/CreateOrder.vue b/src/views/distribution/inventory/CreateOrder.vue index 3fdc870d..cde06239 100644 --- a/src/views/distribution/inventory/CreateOrder.vue +++ b/src/views/distribution/inventory/CreateOrder.vue @@ -3717,6 +3717,27 @@ const handleComputedPlanPrice = submitData => { } }; +const getTranslationArr = codeArr => { + const _nameArr = []; + let _item = {}; + + _nameArr[0] = details.regionOptione.find(val => val.value === codeArr[0]); + + _nameArr[1] = _nameArr[0].children.find(val => val.value === codeArr[1]); + + if (codeArr.length === 2) { + _item = _nameArr[1]; + } else { + _nameArr[2] = _nameArr[1].children.find(val => val.value === codeArr[2]); + _item = _nameArr[2]; + } + + return { + locationItem: _item, + nameArr: _nameArr, + }; +}; + /** 提交 */ const handleSubmit = (formEl: FormInstance | undefined) => { if (!formEl) return; @@ -3785,33 +3806,19 @@ const handleSubmit = (formEl: FormInstance | undefined) => { } // 筛选到站 - const _findeLocation = details.regionOptione - .find(val => val.value === destination[0]) - .children.find(val => val.value === destination[1]); + const { locationItem: _itemDestination, nameArr: dest_nameArr } = + getTranslationArr(destination); - let _item: any = {}; - if (destination.length === 2) { - _item = _findeLocation; - } else { - _item = _findeLocation.children.find(val => val.value === destination[2]); - } - submitData.destination = _item.label; - submitData.destinationCode = _item.value; + submitData.destination = _itemDestination.label; + submitData.destinationCode = _itemDestination.value; + submitData.completeDestination = dest_nameArr.map(val => val.label).join('/'); // 筛选发站 - const _findeDeparture = details.regionOptione - .find(val => val.value === departure[0]) - .children.find(val => val.value === departure[1]); - - let _itemDeparture: any = {}; - if (departure.length === 2) { - _itemDeparture = _findeDeparture; - } else { - _itemDeparture = _findeDeparture.children.find(val => val.value === departure[2]); - } + const { locationItem: _itemDeparture, nameArr: de_nameArr } = getTranslationArr(departure); submitData.departure = _itemDeparture.label; submitData.departureCode = _itemDeparture.value; + submitData.completeDeparture = de_nameArr.map(val => val.label).join('/'); console.log('submitData :>> ', submitData); diff --git a/src/views/waybill/CreateZeroOrder.vue b/src/views/waybill/CreateZeroOrder.vue index dc5ed6db..276c23ee 100644 --- a/src/views/waybill/CreateZeroOrder.vue +++ b/src/views/waybill/CreateZeroOrder.vue @@ -2884,6 +2884,27 @@ const handleComputedPlanPrice = submitData => { } }; +const getTranslationArr = codeArr => { + const _nameArr = []; + let _item = {}; + + _nameArr[0] = details.regionOptione.find(val => val.value === codeArr[0]); + + _nameArr[1] = _nameArr[0].children.find(val => val.value === codeArr[1]); + + if (codeArr.length === 2) { + _item = _nameArr[1]; + } else { + _nameArr[2] = _nameArr[1].children.find(val => val.value === codeArr[2]); + _item = _nameArr[2]; + } + + return { + locationItem: _item, + nameArr: _nameArr, + }; +}; + /** 提交 */ const handleSubmit = async (formEl: FormInstance | undefined) => { await nextTick(); @@ -2956,34 +2977,20 @@ const handleSubmit = async (formEl: FormInstance | undefined) => { return ElMessage({ message: '请选择正确发站地址', type: 'warning' }); // 筛选到站 - const _findeLocation = details.regionOptione - .find(val => val.value === destination[0]) - .children.find(val => val.value === destination[1]); - - let _item: any = {}; - if (destination.length === 2) { - _item = _findeLocation; - } else { - _item = _findeLocation.children.find(val => val.value === destination[2]); - } + const { locationItem: _itemDestination, nameArr: dest_nameArr } = + getTranslationArr(destination); - submitData.destination = _item.label; - submitData.destinationCode = _item.value; + submitData.destination = _itemDestination.label; + submitData.destinationCode = _itemDestination.value; + submitData.completeDestination = dest_nameArr.map(val => val.label).join('/'); // 筛选发站 - const _findeDeparture = details.regionOptione - .find(val => val.value === departure[0]) - .children.find(val => val.value === departure[1]); - - let _itemDeparture: any = {}; - if (departure.length === 2) { - _itemDeparture = _findeDeparture; - } else { - _itemDeparture = _findeDeparture.children.find(val => val.value === departure[2]); - } + const { locationItem: _itemDeparture, nameArr: de_nameArr } = + getTranslationArr(departure); submitData.departure = _itemDeparture.label; submitData.departureCode = _itemDeparture.value; + submitData.completeDeparture = de_nameArr.map(val => val.label).join('/'); // let numFlag = false; diff --git a/src/views/waybill/WaybillOrderList.vue b/src/views/waybill/WaybillOrderList.vue index 5370a1b1..b587f465 100644 --- a/src/views/waybill/WaybillOrderList.vue +++ b/src/views/waybill/WaybillOrderList.vue @@ -190,7 +190,7 @@ background @size-change="sizeChange" @current-change="currentChange" - :current-page="page.currentPage" + :current-page="page.pageNum" :page-sizes="[30, 50, 80, 120]" :page-size="page.pageSize" layout="total, sizes, prev, pager, next, jumper" @@ -572,7 +572,7 @@ const searchChange = () => { /** 清空表单 */ const searchReset = () => { details.query = {}; - details.page.currentPage = 1; + details.page.pageNum = 1; handleClearTableQuery(details.columnList); onLoad(details.page); }; From ef13bfa1a9193e8df2eb10f40138beeea87c3584 Mon Sep 17 00:00:00 2001 From: qb <1191961160@qq.com> Date: Wed, 4 Dec 2024 15:57:47 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E5=85=B3=E9=97=AD=E9=83=A8=E5=88=86?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/option/finance/WaybillAudit.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/option/finance/WaybillAudit.js b/src/option/finance/WaybillAudit.js index b73dbb31..fe1f7a97 100644 --- a/src/option/finance/WaybillAudit.js +++ b/src/option/finance/WaybillAudit.js @@ -58,16 +58,16 @@ export const columnList = [ sortable: true, head: false, }, - { - prop: 'consigneeCode', - label: '收货单位编码', - type: 2, - values: '', - width: '130', - checkarr: [], - fixed: false, - sortable: true, - }, + // { + // prop: 'consigneeCode', + // label: '收货单位编码', + // type: 2, + // values: '', + // width: '130', + // checkarr: [], + // fixed: false, + // sortable: true, + // }, { prop: 'consignee', label: '收货单位', From faccd7e3c85cd8030953cc82085c041c18375edf Mon Sep 17 00:00:00 2001 From: xzg <4727863@qq.com> Date: Wed, 4 Dec 2024 17:50:38 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E9=85=8D=E9=80=81=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E5=A4=8D=E5=B7=B2=E7=9F=A5bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/storagecost/index.js | 26 ++ src/option/storagecost/Traincostbreakdown.js | 242 +++++++++---- .../Traincostbreakdown.vue | 326 ++++++++++++++++-- src/views/desk/DataBoard.vue | 5 +- 4 files changed, 501 insertions(+), 98 deletions(-) diff --git a/src/api/storagecost/index.js b/src/api/storagecost/index.js index 7cd55139..222d7820 100644 --- a/src/api/storagecost/index.js +++ b/src/api/storagecost/index.js @@ -1,4 +1,5 @@ import request from '@/axios'; +import { p } from '@antfu/utils'; // 月度仓储成本统计表接口 export const $_Getlist = params => { return request({ @@ -138,6 +139,30 @@ export const $_expenseDispatchFinancialReview = params => { export const $_Traincostbreakdown = params => { return request({ url: '/api/logpm-statisticsdata/expenseDispatchTrainDetail/page', + method: 'get', + params, + }); +}; +// 配送成本-车辆成本结算表异动调整 +export const $_Traincostbreakdownchange = data => { + return request({ + url: '/api/logpm-statisticsdata/expenseDispatchTrainDetail/change', + method: 'post', + data, + }); +}; +// 配送成本-车辆成本结算表结算 +export const $_Traincostbreakdownsubmit = data => { + return request({ + url: '/api/logpm-statisticsdata/expenseDispatchTrainDetail/submit', + method: 'post', + data, + }); +}; +// 配送成本-车辆成本结算表结算-异动记录 +export const $_Traincostbreakdownsubmitpage = params => { + return request({ + url: '/api/logpm-statisticsdata/expenseDispatchTrainDetailChange/page', method: 'get', params, }); @@ -404,3 +429,4 @@ export const $_Warehouserentalmanagementremove = params => { params, }); }; + diff --git a/src/option/storagecost/Traincostbreakdown.js b/src/option/storagecost/Traincostbreakdown.js index e7c7e9e5..c66f57cf 100644 --- a/src/option/storagecost/Traincostbreakdown.js +++ b/src/option/storagecost/Traincostbreakdown.js @@ -15,9 +15,9 @@ export const columnList = [ fixed: true, }, { - prop: 'trainNumber', - label: '车次号', - type: 2, + prop: 'deliveryVehicle', + label: '配送车辆', + type: 1, values: '', width: '150', checkarr: [], @@ -26,8 +26,8 @@ export const columnList = [ head: false, }, { - prop: 'deliveryDate', - label: '配送日期', + prop: 'distributionModel', + label: '配送车型', type: 1, values: '', width: '150', @@ -37,8 +37,8 @@ export const columnList = [ head: false, }, { - prop: 'destinationWarehouse', - label: '目的仓', + prop: 'trainNumber', + label: '车次号', type: 1, values: '', width: '150', @@ -48,9 +48,9 @@ export const columnList = [ head: false, }, { - prop: 'customerName', - label: '客户名称', - type: 3, + prop: 'settlementStatus', + label: '结算状态', + type: 1, values: '', width: '150', checkarr: [], @@ -59,8 +59,8 @@ export const columnList = [ head: false, }, { - prop: 'orderCode', - label: '订单自编号', + prop: 'deliveryDate', + label: '配送日期', type: 1, values: '', width: '200', @@ -70,28 +70,30 @@ export const columnList = [ head: false, }, { - prop: 'distributionType ', + prop: 'destinationWarehouse', + label: '目的仓', + type: 1, + values: '', + width: '150', + checkarr: [], + fixed: false, + sortable: true, + head: false, + }, + { + prop: 'distributionType', label: '配送类型', type: 1, values: '', width: '150', - checkarr: [ - { - label: '商配', - value: '商配', - }, - { - label: '市配', - value: '市配', - }, - ], + checkarr: [], fixed: false, sortable: true, head: false, }, { - prop: 'deliveryVehicle', - label: '配送车辆', + prop: 'carrierName', + label: '承运方名称', type: 1, values: '', width: '150', @@ -101,8 +103,8 @@ export const columnList = [ head: false, }, { - prop: 'distributionModel', - label: '配送车型', + prop: 'plannedTotalQuantity', + label: '计划总件数', type: 1, values: '', width: '150', @@ -110,10 +112,11 @@ export const columnList = [ fixed: false, sortable: true, head: false, + isshowSummary: true, }, { - prop: 'carrierName', - label: '承运方名称', + prop: 'totalOrderQuantity', + label: '订单总数', type: 1, values: '', width: '150', @@ -121,10 +124,11 @@ export const columnList = [ fixed: false, sortable: true, head: false, + isshowSummary: true, }, { - prop: 'carrierType', - label: '承运方类型', + prop: 'inventoryItemCount', + label: '库存品件数', type: 1, values: '', width: '150', @@ -132,10 +136,11 @@ export const columnList = [ fixed: false, sortable: true, head: false, + isshowSummary: true, }, { - prop: 'deliveryDriver', - label: '配送司机', + prop: 'totalLoadedPieces', + label: '装车总件数', type: 1, values: '', width: '150', @@ -143,10 +148,11 @@ export const columnList = [ fixed: false, sortable: true, head: false, + isshowSummary: true, }, { - prop: 'plannedTotalQuantity', - label: '计划总件数', + prop: 'totalReceiptCost', + label: '签收总件数', type: 1, values: '', width: '150', @@ -154,10 +160,11 @@ export const columnList = [ fixed: false, sortable: true, head: false, + isshowSummary: true, }, { - prop: 'totalOrderQuantity', - label: '订单总数', + prop: 'totalDistributionCost', + label: '配送总成本', type: 1, values: '', width: '150', @@ -165,10 +172,11 @@ export const columnList = [ fixed: false, sortable: true, head: false, + isshowSummary: true, }, { - prop: 'inventoryItemCount', - label: '库存品件数', + prop: 'distributionCost', + label: '配送成本', type: 1, values: '', width: '150', @@ -176,10 +184,11 @@ export const columnList = [ fixed: false, sortable: true, head: false, + isshowSummary: true, }, { - prop: 'totalLoadedPieces', - label: '装车总件数', + prop: 'stairCarryingFee', + label: '上楼费成本', type: 1, values: '', width: '150', @@ -187,10 +196,11 @@ export const columnList = [ fixed: false, sortable: true, head: false, + isshowSummary: true, }, { - prop: 'totalReceiptCost', - label: '签收总件数', + prop: 'goodsAllocationCost', + label: '分货费成本', type: 1, values: '', width: '150', @@ -198,10 +208,11 @@ export const columnList = [ fixed: false, sortable: true, head: false, + isshowSummary: true, }, { - prop: 'totalDistributionCost', - label: '配送总成本', + prop: 'repositioningCost', + label: '平移费成本', type: 1, values: '', width: '150', @@ -209,10 +220,11 @@ export const columnList = [ fixed: false, sortable: true, head: false, + isshowSummary: true, }, { - prop: 'distributionCost', - label: '配送成本', + prop: 'handlingCost', + label: '装卸费成本', type: 1, values: '', width: '150', @@ -220,10 +232,11 @@ export const columnList = [ fixed: false, sortable: true, head: false, + isshowSummary: true, }, { - prop: 'inventoryDistributionCost', - label: '库存品配送成本', + prop: 'mileageCost', + label: '公里数成本', type: 1, values: '', width: '150', @@ -231,10 +244,11 @@ export const columnList = [ fixed: false, sortable: true, head: false, + isshowSummary: true, }, { - prop: 'tagRemovalCost', - label: '撕标签成本', + prop: 'subsidizedKilometerCost', + label: '补贴公里数成本', type: 1, values: '', width: '150', @@ -242,10 +256,11 @@ export const columnList = [ fixed: false, sortable: true, head: false, + isshowSummary: true, }, { - prop: 'stairCarryingFee', - label: '上楼费成本', + prop: 'excessZoneMileageCost', + label: '超区公里费成本', type: 1, values: '', width: '150', @@ -253,10 +268,11 @@ export const columnList = [ fixed: false, sortable: true, head: false, + isshowSummary: true, }, { - prop: 'goodsAllocationCost', - label: '分货费成本', + prop: 'locationSubsidyCost', + label: '点位补贴费成本', type: 1, values: '', width: '150', @@ -264,10 +280,11 @@ export const columnList = [ fixed: false, sortable: true, head: false, + isshowSummary: true, }, { - prop: 'repositioningCost', - label: '平移费成本', + prop: 'minimumGuaranteeCost', + label: '保底费成本', type: 1, values: '', width: '150', @@ -275,10 +292,11 @@ export const columnList = [ fixed: false, sortable: true, head: false, + isshowSummary: true, }, { - prop: 'handlingCost', - label: '装卸费成本', + prop: 'fuelCost', + label: '油费成本', type: 1, values: '', width: '150', @@ -286,10 +304,11 @@ export const columnList = [ fixed: false, sortable: true, head: false, + isshowSummary: true, }, { - prop: 'mileageCost', - label: '公里数成本', + prop: 'otherCosts', + label: '其他成本', type: 1, values: '', width: '150', @@ -297,10 +316,11 @@ export const columnList = [ fixed: false, sortable: true, head: false, + isshowSummary: true, }, { - prop: 'subsidizedKilometerCost', - label: '补贴公里数成本', + prop: 'changeAmount', + label: '异动金额', type: 1, values: '', width: '150', @@ -308,10 +328,11 @@ export const columnList = [ fixed: false, sortable: true, head: false, + isshowSummary: true, }, { - prop: 'excessZoneMileageCost', - label: '超区公里费成本', + prop: 'changeTime', + label: '异动时间', type: 1, values: '', width: '150', @@ -321,8 +342,8 @@ export const columnList = [ head: false, }, { - prop: 'locationSubsidyCost', - label: '点位补贴费成本', + prop: 'changeOperator', + label: '异动操作人', type: 1, values: '', width: '150', @@ -332,8 +353,8 @@ export const columnList = [ head: false, }, { - prop: 'minimumGuaranteeCost', - label: '保底费成本', + prop: 'settlementAmount', + label: '结算金额', type: 1, values: '', width: '150', @@ -341,10 +362,11 @@ export const columnList = [ fixed: false, sortable: true, head: false, + isshowSummary: true, }, { - prop: 'fuelCost', - label: '油费成本', + prop: 'settlementTime', + label: '结算时间', type: 1, values: '', width: '150', @@ -354,8 +376,19 @@ export const columnList = [ head: false, }, { - prop: 'otherCosts', - label: '其他成本', + prop: 'settlementNote', + label: '结算备注', + type: 1, + values: '', + width: '150', + checkarr: [], + fixed: false, + sortable: true, + head: false, + }, + { + prop: 'settlementUser', + label: '结算人', type: 1, values: '', width: '150', @@ -364,7 +397,6 @@ export const columnList = [ sortable: true, head: false, }, - { prop: 'createUserName', label: '操作', @@ -376,3 +408,65 @@ export const columnList = [ sortable: false, }, ]; +export const AbnormalrecordcolumnList = [ + { + prop: 'checkbox', + label: '复选框', + type: 0, + width: 55, + fixed: true, + }, + { + prop: 'xh', + label: '序号', + type: 12, + values: '', + width: 55, + fixed: true, + }, + { + prop: 'changeAmount', + label: '异动金额', + type: 1, + values: '', + width: '150', + checkarr: [], + fixed: false, + sortable: true, + head: false, + isshowSummary: true, + }, + { + prop: 'changeNote', + label: '异动备注', + type: 1, + values: '', + width: '150', + checkarr: [], + fixed: false, + sortable: true, + head: false, + }, + { + prop: 'changeOperator', + label: '操作人', + type: 1, + values: '', + width: '150', + checkarr: [], + fixed: false, + sortable: true, + head: false, + }, + { + prop: 'changeTime', + label: '异动操作时间', + type: 1, + values: '', + width: '150', + checkarr: [], + fixed: false, + sortable: true, + head: false, + }, +]; diff --git a/src/views/cost/Deliverycostmanagement/Traincostbreakdown.vue b/src/views/cost/Deliverycostmanagement/Traincostbreakdown.vue index a2c31dd5..badc0b6f 100644 --- a/src/views/cost/Deliverycostmanagement/Traincostbreakdown.vue +++ b/src/views/cost/Deliverycostmanagement/Traincostbreakdown.vue @@ -19,9 +19,9 @@
- 导出 + > -->
@@ -49,9 +49,21 @@ @@ -77,6 +89,120 @@
+ + + +
+ + + + + + + + +
+ +
+ + + +
+ + + + + +
+ +
+ + + + +
+ +
+ +
+ + +
+
+
+ + + + + + +
+
+ + +
+
+
import { ref, reactive, toRefs, computed, onMounted, nextTick, watch } from 'vue'; -import { columnList } from '@/option/storagecost/Traincostbreakdown.js'; +import { columnList, AbnormalrecordcolumnList } from '@/option/storagecost/Traincostbreakdown.js'; import { getDictionaryBiz } from '@/api/system/dict'; //字典 import { processRowProperty, setNodeHeight } from '@/utils/util'; -import { $_getMyWarehouseList,$_Traincostbreakdown ,$_expenseDispatchTrainDetail} from '@/api/storagecost/index.js'; +import { + $_getMyWarehouseList, + $_Traincostbreakdown, + $_expenseDispatchTrainDetail, + $_Traincostbreakdownchange, + $_Traincostbreakdownsubmit, + $_Traincostbreakdownsubmitpage, +} from '@/api/storagecost/index.js'; import { ElMessageBox, ElMessage } from 'element-plus'; import { downloadXls } from '@/utils/util'; import { useStore } from 'vuex'; @@ -100,6 +233,26 @@ import dayjs from 'dayjs'; const $router = useRouter(); //跳转 const $useStore = useStore(); //权限 const $route = useRoute(); //获取地址栏参数 +// 异动跳转 +const Abnormaladjustment = ref({ + dialogVisible: false, + loading: false, + form: { + changeAmount: 0, + changeNote: '', + }, +}); +const Confirmsettlement = ref({ + dialogVisible: false, + loading: false, + form: { + settlementNote: '', + }, +}); +const viewAbnormalrecord = ref({ + dialogVisible: false, + list: false, +}); const details = reactive({ /** 是否开启搜索 */ search: false, @@ -137,9 +290,10 @@ const details = reactive({ ], /** 列表 */ columnList, - + AbnormalrecordcolumnList, /** 列表数据 */ data: [], + Abnormalrecordcdata: [], /** 页面loading */ loadingObj: { /** 列表加载loading */ @@ -156,7 +310,11 @@ const details = reactive({ pageSize: 50, total: 0, }, - + pageyd: { + currentPage: 1, + pageSize: 50, + total: 0, + }, /** 弹出层显示 */ popUpShow: { /** 包件明细 */ @@ -181,10 +339,12 @@ const { query, shortcuts, data, + Abnormalrecordcdata, loadingObj, selectionList, drawerShow, page, + pageyd, trickleLoadingPage, zeroAdditionalRecordingInfo, popUpShow, @@ -237,14 +397,23 @@ const sizeChange = val => { details.page.pageSize = val; onLoad(); }; +// 每页多少条 +const sizeChangeyd = val => { + details.pageyd.pageSize = val; + onLoad(); +}; /** 页码改变执行的回调 */ const currentChange = val => { details.page.currentPage = val; onLoad(); }; +const currentChangeyd = val => { + details.pageyd.currentPage = val; + onLoad(); +}; // 刷新按钮 const searchChangeS = () => { - details.search = false; //关闭搜索 + onLoad(); }; // 顶部搜索 const searchHide = () => { @@ -273,18 +442,21 @@ const onLoad = value => { ...details.query, ...value, }; - details.loadingObj.list=true; - $_Traincostbreakdown(data).then(res => { - console.log(res,'初始化数据'); - if (res.data.code == 200) { - details.data = res.data.data.records || []; - details.page.total = res.data.data.total; //页码 - } - }).catch((error)=>{ - console.log(error); - }).finally(()=>{ - details.loadingObj.list=false; - }); + details.loadingObj.list = true; + $_Traincostbreakdown(data) + .then(res => { + console.log(res, '初始化数据'); + if (res.data.code == 200) { + details.data = res.data.data.records || []; + details.page.total = res.data.data.total; //页码 + } + }) + .catch(error => { + console.log(error); + }) + .finally(() => { + details.loadingObj.list = false; + }); }; // 页面初始化方法 @@ -318,6 +490,116 @@ const exportExcel = () => { }) .catch(() => {}); }; +// 异动调整 +const AbnormaladjustmentClick = row => { + const { id, changeAmount, changeNote } = row; + Abnormaladjustment.value.dialogVisible = true; + Abnormaladjustment.value.form = { id, changeAmount, changeNote }; +}; +// 异动调整提交 +const AbnormaladjustmentSubmit = async () => { + if (!Abnormaladjustment.value.form.changeNote) { + ElMessage({ + message: '请填写异动备注', + type: 'warning', + }); + return; + } + try { + Abnormaladjustment.value.loading = true; + let Submit = { + ...Abnormaladjustment.value.form, + }; + let res = await $_Traincostbreakdownchange(Submit); + const { code, msg } = res.data; + if (code == 200) { + ElMessage({ + message: msg, + type: 'success', + }); + Abnormaladjustment.value.dialogVisible = false; + onLoad(); + } + + console.log(res); + } catch (e) { + console.log(e); + } finally { + Abnormaladjustment.value.loading = false; + } +}; +const confirmation = row => { + const { id, settlementNote } = row; + Confirmsettlement.value.dialogVisible = true; + Confirmsettlement.value.form = { id, settlementNote }; +}; +// 结算确定 +const SettlementconfirmationSubmit = async row => { + if (!Confirmsettlement.value.form.settlementNote) { + ElMessage({ + message: '请填写结算备注', + type: 'warning', + }); + return; + } + try { + Confirmsettlement.value.loading = true; + let Submit = { + ...Confirmsettlement.value.form, + }; + let res = await $_Traincostbreakdownsubmit(Submit); + const { code, msg } = res.data; + if (code == 200) { + ElMessage({ + message: msg, + type: 'success', + }); + Confirmsettlement.value.dialogVisible = false; + onLoad(); + } + + console.log(res); + } catch (e) { + console.log(e); + } finally { + Confirmsettlement.value.loading = false; + } +}; +const getAbnormalrecord = async () => { + try { + viewAbnormalrecord.value.list = true; + let submit = { + current: details.pageyd.currentPage, + size: details.pageyd.pageSize, + detailId: viewAbnormalrecord.value.detailId, + }; + let res = await $_Traincostbreakdownsubmitpage(submit); + console.log(res); + + const { code, data } = res.data; + if (code == 200) { + Abnormalrecordcdata.value = data.records; + details.pageyd.total = data.total; + } + } catch (e) { + console.log(e); + } finally { + viewAbnormalrecord.value.list = false; + } +}; +// 异动记录 +const Abnormalrecord = async row => { + viewAbnormalrecord.value.id = row.id; + viewAbnormalrecord.value.dialogVisible = true; + nextTick(() => { + const _node = document.querySelector('.viewAbnormalrecord'); + setNodeHeight(_node, '', true); + }); + getAbnormalrecord(); +}; +const searchChangeSyd = () => { + getAbnormalrecord(); +};