正在显示
1 个修改的文件
包含
39 行增加
和
2 行删除
| @@ -347,6 +347,8 @@ | @@ -347,6 +347,8 @@ | ||
| 347 | @selection-change="trnSelectionChange" | 347 | @selection-change="trnSelectionChange" |
| 348 | :cell-style="{textAlign:'center'}" | 348 | :cell-style="{textAlign:'center'}" |
| 349 | style="border-radius: 10px 10px 0px 0px;line-height: 25px" | 349 | style="border-radius: 10px 10px 0px 0px;line-height: 25px" |
| 350 | + show-summary | ||
| 351 | + :summary-method="getSummaries" | ||
| 350 | :header-cell-style="{background:'#6F8294',color:'#FFFFFF'}" | 352 | :header-cell-style="{background:'#6F8294',color:'#FFFFFF'}" |
| 351 | > | 353 | > |
| 352 | <el-table-column | 354 | <el-table-column |
| @@ -399,6 +401,11 @@ | @@ -399,6 +401,11 @@ | ||
| 399 | label="尺寸" | 401 | label="尺寸" |
| 400 | width="60"> | 402 | width="60"> |
| 401 | </el-table-column> | 403 | </el-table-column> |
| 404 | + <el-table-column | ||
| 405 | + prop="goodsvol" | ||
| 406 | + label="入库体积" | ||
| 407 | + width="60"> | ||
| 408 | + </el-table-column> | ||
| 402 | <!-- <el-table-column--> | 409 | <!-- <el-table-column--> |
| 403 | <!-- prop="area"--> | 410 | <!-- prop="area"--> |
| 404 | <!-- label="库区"--> | 411 | <!-- label="库区"--> |
| @@ -624,8 +631,6 @@ | @@ -624,8 +631,6 @@ | ||
| 624 | <script> | 631 | <script> |
| 625 | import { | 632 | import { |
| 626 | selectInventroyrecords, | 633 | selectInventroyrecords, |
| 627 | - delInventoryrecord, | ||
| 628 | - addInventoryrecord, | ||
| 629 | batchImpNewinventroyrecord, | 634 | batchImpNewinventroyrecord, |
| 630 | ediInventroyrecord, | 635 | ediInventroyrecord, |
| 631 | selectAreas, | 636 | selectAreas, |
| @@ -1220,6 +1225,38 @@ | @@ -1220,6 +1225,38 @@ | ||
| 1220 | }else{ | 1225 | }else{ |
| 1221 | this.$message.error("合并体积录入数据出错") | 1226 | this.$message.error("合并体积录入数据出错") |
| 1222 | } | 1227 | } |
| 1228 | + }, | ||
| 1229 | + getSummaries(param) { | ||
| 1230 | + const { columns, data } = param; | ||
| 1231 | + const sums = []; | ||
| 1232 | + columns.forEach((column, index) => { | ||
| 1233 | + if (index === 0) { | ||
| 1234 | + sums[index] = '合计'; | ||
| 1235 | + return; | ||
| 1236 | + } | ||
| 1237 | + const values = data.map(item => { | ||
| 1238 | + if (column.property==='billweight' || column.property==='feeweight' || column.property==='pcs' || column.property==='goodsvol'){ | ||
| 1239 | + return Number(item[column.property]) | ||
| 1240 | + }else { | ||
| 1241 | + return undefined | ||
| 1242 | + } | ||
| 1243 | + }); | ||
| 1244 | + if (!values.every(value => isNaN(value))) { | ||
| 1245 | + sums[index] = values.reduce((prev, curr) => { | ||
| 1246 | + const value = Number(curr); | ||
| 1247 | + if (!isNaN(value)) { | ||
| 1248 | + return prev + curr; | ||
| 1249 | + } else { | ||
| 1250 | + return prev; | ||
| 1251 | + } | ||
| 1252 | + }, 0); | ||
| 1253 | + sums[index] += ''; | ||
| 1254 | + } else { | ||
| 1255 | + sums[index] = ''; | ||
| 1256 | + } | ||
| 1257 | + }); | ||
| 1258 | + | ||
| 1259 | + return sums; | ||
| 1223 | } | 1260 | } |
| 1224 | }, | 1261 | }, |
| 1225 | mounted() { | 1262 | mounted() { |
-
请 注册 或 登录 后发表评论