|
@@ -45,7 +45,7 @@
|
|
|
</template>
|
|
|
</BaseHeaderLayout>
|
|
|
<div v-show="this.warehouseType == '1'" class="main_css">
|
|
|
- <el-table class="wenzi" :data="warehouseList" style="width: 100%; margin-top: 20px;" height="calc(100vh - 10vh)">
|
|
|
+ <el-table show-summary :summary-method="getSummaries" class="wenzi" :data="warehouseList" style="width: 100%; margin-top: 20px" height="100%">
|
|
|
<el-table-column prop="warehouseName" label="仓库名">
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="binNumber" label="仓位编号">
|
|
@@ -345,6 +345,70 @@
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
+ getSummaries(param) {
|
|
|
+ const { columns, data } = param
|
|
|
+ const sums = []
|
|
|
+ columns.forEach((column, index) => {
|
|
|
+ if (index === 0) {
|
|
|
+ sums[index] = '合计'
|
|
|
+ } else if (
|
|
|
+ index === 4 ||
|
|
|
+ index === 5 ||
|
|
|
+ index === 6
|
|
|
+ ) {
|
|
|
+ const values = data.map((item) => {
|
|
|
+ var val=item.warehouseNumViewList.map((items) => {
|
|
|
+ if(column.label=='入库量(吨)'){
|
|
|
+ return items.inNetWeight
|
|
|
+ }else if(column.label=='出库量(吨)'){
|
|
|
+ return items.outNetWeight
|
|
|
+ }else if(column.label=='应余量(吨)'){
|
|
|
+ return items.storage
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return val
|
|
|
+ })
|
|
|
+ if (!values.every((value) => isNaN(value))) {
|
|
|
+ sums[index] = values.reduce((prev, curr) => {
|
|
|
+ if(curr.length>1){
|
|
|
+ var num=0
|
|
|
+ for (let i = 0; i < curr.length; i++) {
|
|
|
+ num+=Number(curr[i])
|
|
|
+ }
|
|
|
+ return Number(prev) +num
|
|
|
+ }else{
|
|
|
+ const value = Number(curr)
|
|
|
+ if (!isNaN(value)) {
|
|
|
+ return Number(prev) + Number(curr)
|
|
|
+ } else {
|
|
|
+ return Number(prev)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }, 0)
|
|
|
+ } else {
|
|
|
+ sums[index] = '--'
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ sums[index] = '--'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if(typeof sums[4] =='number'){
|
|
|
+ sums[4]=sums[4].toFixed(3)
|
|
|
+ }
|
|
|
+ if(typeof sums[5] =='number'){
|
|
|
+ sums[5]=sums[5].toFixed(3)
|
|
|
+ }
|
|
|
+ if(typeof sums[6] =='number'){
|
|
|
+ sums[6]=sums[6].toFixed(3)
|
|
|
+ }
|
|
|
+ // sums[5]=sums[5].toFixed(2)
|
|
|
+ // sums[6]=sums[6].toFixed(2)
|
|
|
+ // sums[sums.length-7]=sums[sums.length-7].toFixed(2)
|
|
|
+ // sums[sums.length-9]=sums[sums.length-9].toFixed(2)
|
|
|
+ // sums[sums.length-12]=sums[sums.length-12].toFixed(2)
|
|
|
+ // sums[sums.length-13]=sums[sums.length-13].toFixed(2)
|
|
|
+ return sums
|
|
|
+ },
|
|
|
//导出、打印
|
|
|
outData(index) {
|
|
|
if (index == 1) {
|
|
@@ -436,7 +500,7 @@
|
|
|
}
|
|
|
|
|
|
} else if (this.headerText == '打印记录') {
|
|
|
- console.log(this.parameter.startDate)
|
|
|
+ // console.log(this.parameter.startDate)
|
|
|
addselectinfoList({
|
|
|
compId: localStorage.getItem('ws-pf_compId'),
|
|
|
startDate: this.parameter.startDate,
|
|
@@ -517,11 +581,11 @@
|
|
|
}
|
|
|
},
|
|
|
startChane(e) {
|
|
|
- console.log(e)
|
|
|
+ // console.log(e)
|
|
|
},
|
|
|
//清仓
|
|
|
clearance(row) {
|
|
|
- console.log(row.outNumber)
|
|
|
+ // console.log(row.outNumber)
|
|
|
if (row.outNumber > 0) {
|
|
|
this.$confirm(`你还有未完善的出库记录,请完善提交后再进行操作`, {
|
|
|
cancelButtonText: '关闭',
|
|
@@ -758,7 +822,7 @@
|
|
|
//任务
|
|
|
handlTask() {
|
|
|
var arr = []
|
|
|
- console.log(this.list)
|
|
|
+ // console.log(this.list)
|
|
|
for (let i = 0; i < this.list.length; i++) {
|
|
|
arr.push(this.list[i].warehouseName)
|
|
|
}
|
|
@@ -817,7 +881,7 @@
|
|
|
for (let i = 0; i < response.length; i++) {
|
|
|
if (response[i].warehouseNumViewList) {
|
|
|
for (let q = 0; q < response[i].warehouseNumViewList.length; q++) {
|
|
|
- console.log(response[i].warehouseNumViewList[q])
|
|
|
+ // console.log(response[i].warehouseNumViewList[q])
|
|
|
if (response[i].warehouseNumViewList[q].inNetWeight) {
|
|
|
response[i].warehouseNumViewList[q].inNetWeight = Number(response[i].warehouseNumViewList[q]
|
|
|
.inNetWeight).toFixed(3)
|