diff --git a/src/views/inm/mioitem.vue b/src/views/inm/mioitem.vue index 8c1e8693..23c6035b 100644 --- a/src/views/inm/mioitem.vue +++ b/src/views/inm/mioitem.vue @@ -84,6 +84,8 @@ hideDo @row-click="rowClick" @selection-change="selectionChange" + :summary-method="getSummaries" + show-summary > @@ -104,7 +106,7 @@ - + @@ -642,6 +644,48 @@ export default { loading.close(); }); }, + getSummaries({ columns, data }) { + const sums = []; + columns.forEach((column, index) => { + if (index === 0) { + sums[index] = "合计"; + return; + } + let propert = ''; + //尺寸检验 + if(index == 6){ + propert = 'count'; + }else if(index == 7){ + propert = 'count_send'; + } + if (propert!=='') { + const values = data.map((item) => + Number(item[propert]) + ); + if (!values.every((value) => Number.isNaN(value))) { + sums[index] = values.reduce((prev, curr) => { + const value = Number(curr); + let sum = Number(Number(prev) + Number(curr)); + if (!isNaN(value)) { + return sum; + } else { + return prev; + } + }, 0); + } + } + if(index==8){ + if(sums[6]){ + if(sums[7]){ + sums[index] = sums[6]-sums[7]; + }else{ + sums[index] = sums[6]; + } + } + } + }); + return sums; + }, }, }; diff --git a/src/views/ofm/vehicle_form.vue b/src/views/ofm/vehicle_form.vue index e2a3624d..d7c41d07 100644 --- a/src/views/ofm/vehicle_form.vue +++ b/src/views/ofm/vehicle_form.vue @@ -72,7 +72,7 @@ - +