From b52d6aceffe5db3f0c472033255e3f06c5e0ed54 Mon Sep 17 00:00:00 2001 From: qb <1191961160@qq.com> Date: Wed, 20 Dec 2023 18:39:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=A1=A8=E6=A0=BC=E5=8B=BE?= =?UTF-8?q?=E9=80=89=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/tablecmt/tablecmt.vue | 45 ++++++-- .../distributionDeliveryListdis.vue | 12 +- .../distributionDeliveryListmar.vue | 5 +- .../distribution/reservation/reservation.vue | 24 ---- .../signfor/distributionSignfortreat.vue | 106 +++++++++--------- src/views/warehouse/warehouseWaybill.vue | 10 +- vite.config.js | 4 +- 7 files changed, 108 insertions(+), 98 deletions(-) diff --git a/src/components/tablecmt/tablecmt.vue b/src/components/tablecmt/tablecmt.vue index 18902e42..ac2a1fbc 100644 --- a/src/components/tablecmt/tablecmt.vue +++ b/src/components/tablecmt/tablecmt.vue @@ -170,6 +170,14 @@ + +
+ 勾选合计: + + {{ item.label + ':' }} + {{ item.value }} + +
@@ -321,6 +329,9 @@ let props = defineProps({ default: null, }, }); +/** 勾选数据统计 */ +const selectCount = ref([]); + // row, column, rowIndex, columnIndex let selectarr = ref([]); /** 设置每行颜色 */ @@ -465,8 +476,17 @@ function timechange(value, column: TableColumnType) { emit('timeCheck', value, column); } const handleSelectionChange = (param: TableDataType[]) => { - // console.log(param) + // 重置数据 + selectCount.value.forEach(item => { + item.value = 0; + }); + selectarr.value = param; + selectarr.value.forEach(val => { + selectCount.value.forEach( + item => (item.value += computeNumber(item.value, '+', val[item.prop]).result) + ); + }); emit('selection', param); }; function inputclear(value, column: TableColumnType) { @@ -480,20 +500,26 @@ function timeclear(value, column: TableColumnType) { } function handleDelete(index: number, row: TableDataType) {} const getSummaries = (param: any) => { + selectCount.value = []; const { columns, data } = param; let newarr = []; let tji = 0; - columns.map((item, index) => { + columns.forEach((item, index) => { if (index == 0) { newarr[index] = '总计'; return; } tji = 0; if (props.columnList[index]?.isshowSummary) { - data.map(ite => { + for (let ite of data) { tji = computeNumber(tji, '+', Number(ite[props.columnList[index]?.prop] || 0)).result; - }); + } newarr[index] = tji; + selectCount.value.push({ + label: props.columnList[index]?.label, + value: 0, + prop: props.columnList[index]?.prop, + }); // shownm.value=true } else { newarr[index] = null; @@ -592,6 +618,11 @@ defineExpose({ handleCheckSelect }); --el-table-row-hover-bg-color: #d3832a; } +// 勾选合计行 +.selection-total-row { + margin: 10px 0 5px; + font-size: 14px; +} // .el-table .warning-row { // --el-table-tr-bg-color: var(--el-color-warning-light-9); // } @@ -600,10 +631,8 @@ defineExpose({ handleCheckSelect }); // } .maboxhi { width: 100%; - // min-height: 950px; - // height: 841px; - // flex:1; - // min-height: 100%; + display: flex; + flex-direction: column; } .on { overflow: hidden; diff --git a/src/views/distribution/deliverylist/distributionDeliveryListdis.vue b/src/views/distribution/deliverylist/distributionDeliveryListdis.vue index 1d802fdb..11d9403e 100644 --- a/src/views/distribution/deliverylist/distributionDeliveryListdis.vue +++ b/src/views/distribution/deliverylist/distributionDeliveryListdis.vue @@ -1468,10 +1468,10 @@ export default { align-items: flex-end; justify-content: flex-end; } -:deep(.maboxhi) { - height: 100% !important; -} -.el_tabBK { - height: 70%; -} +// :deep(.maboxhi) { +// height: 100% !important; +// } +// .el_tabBK { +// // height: 70%; +// } diff --git a/src/views/distribution/deliverylist/distributionDeliveryListmar.vue b/src/views/distribution/deliverylist/distributionDeliveryListmar.vue index 702db95b..572e0ced 100644 --- a/src/views/distribution/deliverylist/distributionDeliveryListmar.vue +++ b/src/views/distribution/deliverylist/distributionDeliveryListmar.vue @@ -162,9 +162,6 @@ - -
-
勾选数量: {{ selectionList.length }} @@ -866,7 +863,7 @@ export default { const elNode = this.$refs.tableNode.$el; // getWinHeight console.log('getWinHeight() :>> ', getWinHeight()); - setNodeHeight(elNode, getWinHeight() - elNode.getBoundingClientRect().top - 80 + 'px'); + setNodeHeight(elNode, getWinHeight() - elNode.getBoundingClientRect().top - 60 + 'px'); }, //tabs切换 diff --git a/src/views/distribution/reservation/reservation.vue b/src/views/distribution/reservation/reservation.vue index 3162adbf..d7b1cea0 100644 --- a/src/views/distribution/reservation/reservation.vue +++ b/src/views/distribution/reservation/reservation.vue @@ -228,14 +228,6 @@ - -
- 勾选合计: - - - 预约包件数: {{ totalObj.checkReservationNum }} - -
@@ -341,7 +333,6 @@ import { patchPrintList, reservationExport, } from '@/api/distribution/distributionReservation'; -import option from '@/option/distribution/distributionReservation'; import { mapGetters } from 'vuex'; import { getDictionaryBiz } from '@/api/system/dict'; import { addAssign, getListUser } from '@/api/distribution/distributionStockup'; @@ -828,8 +819,6 @@ export default { cancel: {}, // 选择行 selectionList: [], - // 表单配置 - option: option, // 表单列表 data: [], /** 全部数据 */ @@ -858,11 +847,6 @@ export default { orderStatus: 'all', unconfirmedList: null, confirmedList: null, - /** 合计 */ - totalObj: { - /** 被选中的预约包件数 */ - checkReservationNum: 0, - }, }; }, watch: { @@ -1462,14 +1446,6 @@ export default { }, selectionChange(list) { this.selectionList = list; - // 重置统计数据 - for (let key in this.totalObj) { - this.totalObj[key] = 0; - } - // 计算合计 - this.selectionList.forEach(val => { - this.totalObj.checkReservationNum += val.reservationNum; - }); }, selectionClear() { this.selectionList = []; diff --git a/src/views/distribution/signfor/distributionSignfortreat.vue b/src/views/distribution/signfor/distributionSignfortreat.vue index e2c163ee..c3801303 100644 --- a/src/views/distribution/signfor/distributionSignfortreat.vue +++ b/src/views/distribution/signfor/distributionSignfortreat.vue @@ -157,7 +157,13 @@ >