From e4e7ab5f735587beed9b53c3bde1cae494467951 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ZR20090193-=E9=99=88=E6=95=AC=E5=8B=87?= Date: Wed, 23 Aug 2023 15:33:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=8D=E5=90=8E=E5=8F=B0=20=E6=98=8E?= =?UTF-8?q?=E7=BB=86=E5=90=88=E8=AE=A1=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wms/wmsclearance/WmsClearanceGoods.vue | 35 ++++- .../views/wms/wmsoutplan/WmsOutPlanGoods.vue | 31 +++- .../wms/wmsclearance/WmsClearanceModal.vue | 138 ++++++++++++++++- .../src/views/wms/wmsindo/WmsInDoGoods.vue | 27 ++++ .../views/wms/wmsinplan/WmsInPlanVxeModal.vue | 139 +++++++++++++++++- .../src/views/wms/wmsoutdo/WmsOutDoGoods.vue | 104 ++++++++----- .../views/wms/wmsoutplan/WmsOutPlanModal.vue | 133 ++++++++++++++++- .../DS.WMS.WebApi/Logs/internal-nlog.txt | 7 + .../DS.WMS.WebApi/Logs/internal-nlog.txt | 7 + 9 files changed, 567 insertions(+), 54 deletions(-) diff --git a/gslk-wms-web-client/src/views/wms/wmsclearance/WmsClearanceGoods.vue b/gslk-wms-web-client/src/views/wms/wmsclearance/WmsClearanceGoods.vue index 386fd5d..1df4453 100644 --- a/gslk-wms-web-client/src/views/wms/wmsclearance/WmsClearanceGoods.vue +++ b/gslk-wms-web-client/src/views/wms/wmsclearance/WmsClearanceGoods.vue @@ -15,6 +15,7 @@ 可用件数:{{ item.pkgs }} 占用件数:{{ item.lockpkgs }} 可用计费数量:{{ item.storageunitcount }} - + @@ -291,6 +293,31 @@ } } } + const sumNum = (list: any[], field: string) => { + let count = 0 + list.forEach((item) => { + count += Number(item[field]) + }) + return count + } + function footerMethod({ columns, data }) { + const footerData = [ + columns.map((column, _columnIndex) => { + if (_columnIndex === 0) { + return '合计' + } + // if (['pkgs'].includes(column.field)) { + // return sumNum(data, 'pkgs') + // } + if (['pkgs', 'storageunitcount', 'minpkgs', 'kgs', 'netweight'].includes(column.field)) { + return sumNum(data, column.field) + } + return null + }), + ] + return footerData + } + const pkgsChangeEvent = ({ row }: any) => { console.log(row) row.minpkgs = row.pkgs * row.coefficient @@ -344,15 +371,15 @@ row.goodsId = obj.goodsId row.goodsname = obj.goodsname row.goodscode = obj.goodscode - row.goodshscode = obj.goodshscode===null?'':obj.goodshscode - row.goodsmodel = obj.goodsmodel===null?'':obj.goodsmodel + row.goodshscode = obj.goodshscode === null ? '' : obj.goodshscode + row.goodsmodel = obj.goodsmodel === null ? '' : obj.goodsmodel row.areacode = obj.areacode row.areaname = obj.areaname row.storehouse = obj.storehouse row.wmsid = obj.wmsid row.wmsphysicsid = obj.wmsphysicsid row.storageunit = obj.storageunit - row.storageunitcount = obj.storageUnitType == '体积'? 0 : obj.storageunitcount + row.storageunitcount = obj.storageUnitType == '体积' ? 0 : obj.storageunitcount row.kgs = obj.kgs row.cbm = obj.cbm row.netweight = obj.netweight diff --git a/gslk-wms-web-client/src/views/wms/wmsoutplan/WmsOutPlanGoods.vue b/gslk-wms-web-client/src/views/wms/wmsoutplan/WmsOutPlanGoods.vue index a96ce5d..c2fbc34 100644 --- a/gslk-wms-web-client/src/views/wms/wmsoutplan/WmsOutPlanGoods.vue +++ b/gslk-wms-web-client/src/views/wms/wmsoutplan/WmsOutPlanGoods.vue @@ -15,6 +15,7 @@ 可用件数:{{ item.pkgs }} 占用件数:{{ item.lockpkgs }} 可用计费数量:{{ item.storageunitcount }} - + @@ -285,7 +287,30 @@ }, } as VxeTablePropTypes.KeyboardConfig, }) - + const sumNum = (list: any[], field: string) => { + let count = 0 + list.forEach((item) => { + count += Number(item[field]) + }) + return count + } + function footerMethod({ columns, data }) { + const footerData = [ + columns.map((column, _columnIndex) => { + if (_columnIndex === 0) { + return '合计' + } + // if (['pkgs'].includes(column.field)) { + // return sumNum(data, 'pkgs') + // } + if (['pkgs', 'storageunitcount', 'minpkgs', 'kgs', 'netweight'].includes(column.field)) { + return sumNum(data, column.field) + } + return null + }), + ] + return footerData + } const pkgsChangeEvent = ({ row }: any) => { console.log(row) // if (row.storageUnitType == '净重') { @@ -403,7 +428,7 @@ row.wmsid = obj.wmsid row.wmsphysicsid = obj.wmsphysicsid row.storageunit = obj.storageunit - row.storageunitcount = obj.storageUnitType == '体积'? 0 : obj.storageunitcount + row.storageunitcount = obj.storageUnitType == '体积' ? 0 : obj.storageunitcount row.kgs = obj.kgs row.cbm = obj.cbm row.netweight = obj.netweight diff --git a/gslk-wms-web-server/src/views/wms/wmsclearance/WmsClearanceModal.vue b/gslk-wms-web-server/src/views/wms/wmsclearance/WmsClearanceModal.vue index 6952a62..94ba9a8 100644 --- a/gslk-wms-web-server/src/views/wms/wmsclearance/WmsClearanceModal.vue +++ b/gslk-wms-web-server/src/views/wms/wmsclearance/WmsClearanceModal.vue @@ -15,7 +15,7 @@ - + @@ -74,7 +74,7 @@ import { BasicForm, useForm } from '/@/components/Form/index' import { formSchema } from './columns' import { useMessage } from '/@/hooks/web/useMessage' - import { VxeGridProps } from 'vxe-table' + import { VxeGridInstance, VxeGridProps, VxeGridPropTypes } from 'vxe-table' const { notification, createConfirm, createMessage } = useMessage() import { editInfo, getInfo, getDetailList, auditInfo } from '/@/api/wms/wmsclearance' import { Divider, TabPane, Tabs } from 'ant-design-vue' @@ -94,6 +94,13 @@ const recordSource = ref([]) const areaList = ref([]) const activeKey = ref('detailTab') + interface RowVO { + [key: string]: any + } + + const gridRef = ref>() + + const footerData = ref([]) const [registerForm, { resetFields, setFieldsValue, validate, updateSchema, getFieldsValue }] = useForm({ labelWidth: 180, @@ -137,13 +144,104 @@ }) const [registerRecordModal, { openModal: openRecordModal }] = useModal() const [registerSelectModal, { openModal }] = useModal() - const gridOptions = reactive({ + let detailColumns: VxeGridPropTypes.Columns = [ + { + title: '序号', + type: 'seq', + fixed: 'left', + width: 50, + align: 'center', + }, + { + title: '商品名称', + field: 'goodsname', + width: 200, + fixed: 'left', + }, + { + title: '规格型号', + field: 'goodsmodel', + width: 100, + }, + { + title: '库位', + field: 'areaname', + width: 100, + }, + { + title: '批次号', + field: 'goodsmodeL2', + width: 100, + }, + { + title: '库位', + field: 'areaname', + width: 100, + }, + { + title: '件数', + field: 'pkgs', + width: 100, + }, + { + title: '小件数', + field: 'minpkgs', + width: 100, + }, + // { + // title: '托盘数', + // field: 'pallets', + // width: 100, + // }, + { + title: '毛重(千克)', + field: 'kgs', + width: 100, + }, + { + title: '净重(千克)', + field: 'netweight', + width: 100, + }, + // { + // title: '体积', + // field: 'cbm', + // width: 100, + // }, + { + title: '承运车号', + field: 'truckno', + width: 200, + }, + { + title: '车辆自重', + field: 'truckWeight', + width: 100, + }, + { + title: '备注', + field: 'remark', + width: 200, + }, + { + title: '计费单位', + field: 'storageunit', + width: 100, + }, + { + title: '计费数量', + field: 'storageunitcount', + width: 100, + }, + ] + const gridOptions = reactive>({ border: true, height: 500, align: null, columnConfig: { resizable: true, }, + showFooter: true, columns: [ { title: '序号', @@ -236,6 +334,9 @@ ], toolbarConfig: {}, data: dataSource, + footerMethod() { + return footerData.value + }, }) const recordOptions = reactive({ @@ -310,6 +411,7 @@ } else { recordSource.value = [] } + init() } const LoadRecord = () => { openRecordModal(true, { @@ -406,4 +508,34 @@ loading.value = false } } + const sumNum = (list: any[], field: string) => { + let count = 0 + list.forEach((item) => { + count += Number(item[field]) + }) + return count + } + const init = async () => { + const $grid = gridRef.value + gridOptions.loading = false + console.log(dataSource.value) + // 计算表尾数据 + const footList: string[][] = [[]] + for (let i = 0; i < detailColumns.length; i++) { + if (i === 0) { + footList[0].push('合计') + } else if ( + ['pkgs', 'storageunitcount', 'minpkgs', 'kgs', 'netweight'].includes(detailColumns[i].field) + ) { + // return sumNum(data, column.field) + footList[0].push(sumNum(dataSource.value, detailColumns[i].field)) + } else { + footList[0].push('') + } + } + footerData.value = footList + if ($grid) { + $grid.updateFooter() + } + } diff --git a/gslk-wms-web-server/src/views/wms/wmsindo/WmsInDoGoods.vue b/gslk-wms-web-server/src/views/wms/wmsindo/WmsInDoGoods.vue index cc41d33..55e850d 100644 --- a/gslk-wms-web-server/src/views/wms/wmsindo/WmsInDoGoods.vue +++ b/gslk-wms-web-server/src/views/wms/wmsindo/WmsInDoGoods.vue @@ -15,6 +15,7 @@ { + let count = 0 + list.forEach((item) => { + count += Number(item[field]) + }) + return count + } + function footerMethod({ columns, data }) { + const footerData = [ + columns.map((column, _columnIndex) => { + if (_columnIndex === 0) { + return '合计' + } + // if (['pkgs'].includes(column.field)) { + // return sumNum(data, 'pkgs') + // } + if (['pkgs', 'storageunitcount', 'minpkgs', 'kgs', 'netweight'].includes(column.field)) { + return sumNum(data, column.field) + } + return null + }), + ] + return footerData + } + const selectChange = (e, opt, row) => { // console.log(`selected ${e}`) // console.log(opt) diff --git a/gslk-wms-web-server/src/views/wms/wmsinplan/WmsInPlanVxeModal.vue b/gslk-wms-web-server/src/views/wms/wmsinplan/WmsInPlanVxeModal.vue index ff177e8..47b39dd 100644 --- a/gslk-wms-web-server/src/views/wms/wmsinplan/WmsInPlanVxeModal.vue +++ b/gslk-wms-web-server/src/views/wms/wmsinplan/WmsInPlanVxeModal.vue @@ -34,7 +34,7 @@ - + @@ -111,7 +111,7 @@ getFeeRateList, } from '/@/api/wms/wmsinplan' import { Divider } from 'ant-design-vue' - import { VxeGridProps } from 'vxe-table' + import { VxeGridInstance, VxeGridProps, VxeGridPropTypes } from 'vxe-table' import { get } from 'lodash-es' import WmsFeeRateModal from './WmsFeeRateModal.vue' import WmsTruckRecord from '/@/views/wms/common/WmsTruckRecord.vue' @@ -128,6 +128,13 @@ const feeSource = ref([]) const activeKey = ref('detailTab') const activeMainKey = ref('mainTab') + interface RowVO { + [key: string]: any + } + + const gridRef = ref>() + + const footerData = ref([]) const [registerForm, { resetFields, setFieldsValue, validate, updateSchema, getFieldsValue }] = useForm({ labelWidth: 180, @@ -220,7 +227,93 @@ } else { recordSource.value = [] } + init() } + let detailColumns: VxeGridPropTypes.Columns = [ + { + title: '序号', + type: 'seq', + fixed: 'left', + width: 50, + align: 'center', + }, + { + title: '商品名称', + field: 'goodsname', + width: 200, + fixed: 'left', + }, + { + title: '规格型号', + field: 'goodsmodel', + width: 100, + }, + { + title: '件数', + field: 'pkgs', + width: 100, + }, + { + title: '小件数', + field: 'minpkgs', + width: 100, + }, + { + title: '托盘数', + field: 'pallets', + width: 100, + }, + { + title: '毛重(千克)', + field: 'kgs', + width: 100, + }, + { + title: '净重(千克)', + field: 'netweight', + width: 100, + }, + // { + // title: '体积', + // field: 'cbm', + // width: 100, + // }, + { + title: '承运车号', + field: 'truckno', + width: 200, + }, + { + title: '车辆自重', + field: 'truckWeight', + width: 100, + }, + { + title: '司机电话', + field: 'drivername', + width: 200, + }, + { + title: '批次号', + field: 'goodsmodeL2', + width: 100, + }, + { + title: '备注', + field: 'remark', + width: 200, + }, + { + title: '计费单位', + field: 'storageunit', + width: 100, + }, + { + title: '计费数量', + field: 'storageunitcount', + width: 100, + }, + ] const recordOptions = reactive({ border: true, height: 500, @@ -275,13 +368,14 @@ toolbarConfig: {}, data: recordSource, }) - const gridOptions = reactive({ + const gridOptions = reactive>({ border: true, height: 500, align: null, columnConfig: { resizable: true, }, + showFooter: true, columns: [ { title: '序号', @@ -369,6 +463,13 @@ ], toolbarConfig: {}, data: dataSource, + footerMethod() { + return footerData.value + // return getfooterMethod(detailColumns.values, dataSource) + // console.log(detailColumns) + // console.log(dataSource) + // return '' + }, // proxyConfig: { // ajax: { // // 接收 Promise @@ -383,6 +484,7 @@ // }, // }, }) + const feeOptions = reactive({ border: true, height: 500, @@ -556,4 +658,35 @@ loading.value = false } } + + const sumNum = (list: any[], field: string) => { + let count = 0 + list.forEach((item) => { + count += Number(item[field]) + }) + return count + } + const init = async () => { + const $grid = gridRef.value + gridOptions.loading = false + console.log(dataSource.value) + // 计算表尾数据 + const footList: string[][] = [[]] + for (let i = 0; i < detailColumns.length; i++) { + if (i === 0) { + footList[0].push('合计') + } else if ( + ['pkgs', 'storageunitcount', 'minpkgs', 'kgs', 'netweight'].includes(detailColumns[i].field) + ) { + // return sumNum(data, column.field) + footList[0].push(sumNum(dataSource.value, detailColumns[i].field)) + } else { + footList[0].push('') + } + } + footerData.value = footList + if ($grid) { + $grid.updateFooter() + } + } diff --git a/gslk-wms-web-server/src/views/wms/wmsoutdo/WmsOutDoGoods.vue b/gslk-wms-web-server/src/views/wms/wmsoutdo/WmsOutDoGoods.vue index 7238d9c..3f79a82 100644 --- a/gslk-wms-web-server/src/views/wms/wmsoutdo/WmsOutDoGoods.vue +++ b/gslk-wms-web-server/src/views/wms/wmsoutdo/WmsOutDoGoods.vue @@ -15,6 +15,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { + let count = 0 + list.forEach((item) => { + count += Number(item[field]) + }) + return count + } + function footerMethod({ columns, data }) { + const footerData = [ + columns.map((column, _columnIndex) => { + if (_columnIndex === 0) { + return '合计' + } + // if (['pkgs'].includes(column.field)) { + // return sumNum(data, 'pkgs') + // } + if (['pkgs', 'storageunitcount', 'minpkgs', 'kgs', 'netweight'].includes(column.field)) { + return sumNum(data, column.field) + } + return null + }), + ] + return footerData + } // await initData() diff --git a/gslk-wms-web-server/src/views/wms/wmsoutplan/WmsOutPlanModal.vue b/gslk-wms-web-server/src/views/wms/wmsoutplan/WmsOutPlanModal.vue index 9528e80..83218b3 100644 --- a/gslk-wms-web-server/src/views/wms/wmsoutplan/WmsOutPlanModal.vue +++ b/gslk-wms-web-server/src/views/wms/wmsoutplan/WmsOutPlanModal.vue @@ -15,7 +15,7 @@ - + @@ -65,7 +65,7 @@ import { BasicForm, useForm } from '/@/components/Form/index' import { formSchema } from './columns' import { useMessage } from '/@/hooks/web/useMessage' - import { VxeGridProps } from 'vxe-table' + import { VxeGridInstance, VxeGridProps, VxeGridPropTypes } from 'vxe-table' const { notification, createConfirm, createMessage } = useMessage() import { editInfo, getInfo, getWmsOutPlanGoodslist, auditInfo } from '/@/api/wms/wmsoutplan' @@ -86,6 +86,13 @@ const recordSource = ref([]) const areaList = ref([]) const activeKey = ref('detailTab') + interface RowVO { + [key: string]: any + } + + const gridRef = ref>() + + const footerData = ref([]) const [registerForm, { resetFields, setFieldsValue, validate, updateSchema, getFieldsValue }] = useForm({ labelWidth: 180, @@ -130,13 +137,99 @@ setModalProps({ loading: false }) }) const [registerSelectModal, { openModal }] = useModal() - const gridOptions = reactive({ + let detailColumns: VxeGridPropTypes.Columns = [ + { + title: '序号', + type: 'seq', + fixed: 'left', + width: 50, + align: 'center', + }, + { + title: '商品名称', + field: 'goodsname', + width: 200, + fixed: 'left', + }, + { + title: '规格型号', + field: 'goodsmodel', + width: 100, + }, + { + title: '库位', + field: 'areaname', + width: 100, + }, + { + title: '批次号', + field: 'goodsmodeL2', + width: 100, + }, + { + title: '件数', + field: 'pkgs', + width: 100, + }, + { + title: '小件数', + field: 'minpkgs', + width: 100, + }, + { + title: '托盘数', + field: 'pallets', + width: 100, + }, + { + title: '毛重(千克)', + field: 'kgs', + width: 100, + }, + { + title: '净重(千克)', + field: 'netweight', + width: 100, + }, + // { + // title: '体积', + // field: 'cbm', + // width: 100, + // }, + { + title: '承运车号', + field: 'truckno', + width: 200, + }, + { + title: '车辆自重', + field: 'truckWeight', + width: 100, + }, + { + title: '备注', + field: 'remark', + width: 200, + }, + { + title: '计费单位', + field: 'storageunit', + width: 100, + }, + { + title: '计费数量', + field: 'storageunitcount', + width: 100, + }, + ] + const gridOptions = reactive>({ border: true, height: 500, align: null, columnConfig: { resizable: true, }, + showFooter: true, columns: [ { title: '序号', @@ -224,6 +317,9 @@ ], toolbarConfig: {}, data: dataSource, + footerMethod() { + return footerData.value + }, }) const recordOptions = reactive({ border: true, @@ -297,6 +393,7 @@ } else { recordSource.value = [] } + init() } const LoadRecord = () => { openRecordModal(true, { @@ -341,4 +438,34 @@ loading.value = false } } + const sumNum = (list: any[], field: string) => { + let count = 0 + list.forEach((item) => { + count += Number(item[field]) + }) + return count + } + const init = async () => { + const $grid = gridRef.value + gridOptions.loading = false + console.log(dataSource.value) + // 计算表尾数据 + const footList: string[][] = [[]] + for (let i = 0; i < detailColumns.length; i++) { + if (i === 0) { + footList[0].push('合计') + } else if ( + ['pkgs', 'storageunitcount', 'minpkgs', 'kgs', 'netweight'].includes(detailColumns[i].field) + ) { + // return sumNum(data, column.field) + footList[0].push(sumNum(dataSource.value, detailColumns[i].field)) + } else { + footList[0].push('') + } + } + footerData.value = footList + if ($grid) { + $grid.updateFooter() + } + } diff --git a/gslk-wmsapi-service-client/DS.WMS.WebApi/Logs/internal-nlog.txt b/gslk-wmsapi-service-client/DS.WMS.WebApi/Logs/internal-nlog.txt index 5e4d589..7ed9a4a 100644 --- a/gslk-wmsapi-service-client/DS.WMS.WebApi/Logs/internal-nlog.txt +++ b/gslk-wmsapi-service-client/DS.WMS.WebApi/Logs/internal-nlog.txt @@ -5725,3 +5725,10 @@ 2023-08-22 17:53:05.7979 Info Adding target ColoredConsoleTarget(Name=console) 2023-08-22 17:53:05.8548 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\sdgslk-wms-solution\gslk-wmsapi-service-client\DS.WMS.WebApi\bin\Debug\net6.0\nlog.config 2023-08-22 17:53:05.8699 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2023-08-23 11:06:36.7370 Info Message Template Auto Format enabled +2023-08-23 11:06:36.7694 Info Loading assembly: NLog.Web.AspNetCore +2023-08-23 11:06:37.0100 Info Adding target FileTarget(Name=allfile) +2023-08-23 11:06:37.0233 Info Adding target FileTarget(Name=ownFile-web) +2023-08-23 11:06:37.0612 Info Adding target ColoredConsoleTarget(Name=console) +2023-08-23 11:06:37.1844 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\sdgslk-wms-solution\gslk-wmsapi-service-client\DS.WMS.WebApi\bin\Debug\net6.0\nlog.config +2023-08-23 11:06:37.2142 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile diff --git a/gslk-wmsapi-service-server/DS.WMS.WebApi/Logs/internal-nlog.txt b/gslk-wmsapi-service-server/DS.WMS.WebApi/Logs/internal-nlog.txt index 7825807..d799e2f 100644 --- a/gslk-wmsapi-service-server/DS.WMS.WebApi/Logs/internal-nlog.txt +++ b/gslk-wmsapi-service-server/DS.WMS.WebApi/Logs/internal-nlog.txt @@ -9016,3 +9016,10 @@ 2023-08-22 16:20:17.8619 Info Adding target ColoredConsoleTarget(Name=console) 2023-08-22 16:20:17.9722 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\sdgslk-wms-solution\gslk-wmsapi-service-server\DS.WMS.WebApi\bin\Debug\net6.0\nlog.config 2023-08-22 16:20:17.9857 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2023-08-23 11:50:28.6481 Info Message Template Auto Format enabled +2023-08-23 11:50:28.6747 Info Loading assembly: NLog.Web.AspNetCore +2023-08-23 11:50:28.8959 Info Adding target FileTarget(Name=allfile) +2023-08-23 11:50:28.9106 Info Adding target FileTarget(Name=ownFile-web) +2023-08-23 11:50:28.9483 Info Adding target ColoredConsoleTarget(Name=console) +2023-08-23 11:50:29.0974 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\sdgslk-wms-solution\gslk-wmsapi-service-server\DS.WMS.WebApi\bin\Debug\net6.0\nlog.config +2023-08-23 11:50:29.1235 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile