|
@@ -37,6 +37,9 @@
|
|
ref="yawnReport"
|
|
ref="yawnReport"
|
|
style="width:100%;height:500px;float:left;margin-left:5px"
|
|
style="width:100%;height:500px;float:left;margin-left:5px"
|
|
>
|
|
>
|
|
|
|
+ <table class="title">
|
|
|
|
+ <th>{{ titleTXT }}钢材欠运力统计表</th>
|
|
|
|
+ </table>
|
|
<div class="table">
|
|
<div class="table">
|
|
<el-table
|
|
<el-table
|
|
ref="yawnReportData"
|
|
ref="yawnReportData"
|
|
@@ -167,18 +170,25 @@
|
|
width="110px"
|
|
width="110px"
|
|
>
|
|
>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ align="center"
|
|
|
|
+ prop="unloadThoWeight"
|
|
|
|
+ label="未装(理计)"
|
|
|
|
+ width="110px"
|
|
|
|
+ >
|
|
|
|
+ </el-table-column>
|
|
<el-table-column
|
|
<el-table-column
|
|
align="center"
|
|
align="center"
|
|
prop="trainWeight"
|
|
prop="trainWeight"
|
|
label="车皮(磅重)"
|
|
label="车皮(磅重)"
|
|
- width="80px"
|
|
|
|
|
|
+ width="100px"
|
|
>
|
|
>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column
|
|
<el-table-column
|
|
align="center"
|
|
align="center"
|
|
prop="trainThoWeight"
|
|
prop="trainThoWeight"
|
|
label="车皮(理重)"
|
|
label="车皮(理重)"
|
|
- width="80px"
|
|
|
|
|
|
+ width="100px"
|
|
>
|
|
>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
@@ -205,7 +215,9 @@ export default {
|
|
endTime: null
|
|
endTime: null
|
|
},
|
|
},
|
|
spanArr: [], // 用于存放需要合并的行的个数
|
|
spanArr: [], // 用于存放需要合并的行的个数
|
|
- spanIndex: 0 // 记录spanArr数组的下标
|
|
|
|
|
|
+ spanIndex: 0, // 记录spanArr数组的下标
|
|
|
|
+ titleTXT: '',
|
|
|
|
+ startTime: new Date()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -216,10 +228,29 @@ export default {
|
|
let startTime = new Date(endTime.getTime())
|
|
let startTime = new Date(endTime.getTime())
|
|
this.map.startTime = startTime
|
|
this.map.startTime = startTime
|
|
this.map.endTime = endTime
|
|
this.map.endTime = endTime
|
|
|
|
+ this.startTime = startTime
|
|
|
|
+ this.titleTXT = `${this.startTime.getFullYear()}年${this.startTime.getMonth() +
|
|
|
|
+ 1}月${this.startTime.getDate()}日08:00 - ${new Date(
|
|
|
|
+ sjTime(this.startTime) + 86400000
|
|
|
|
+ ).getFullYear()}年${new Date(sjTime(this.startTime) + 86400000).getMonth() +
|
|
|
|
+ 1}月${new Date(sjTime(this.startTime) + 86400000).getDate()}日08:00`
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
this.search()
|
|
this.search()
|
|
},
|
|
},
|
|
|
|
+ watch: {
|
|
|
|
+ startTime() {
|
|
|
|
+ console.log(this.startTime, 'this.startTime')
|
|
|
|
+ this.titleTXT = `${this.startTime.getFullYear()}年${this.startTime.getMonth() +
|
|
|
|
+ 1}月${this.startTime.getDate()}日08:00 - ${new Date(
|
|
|
|
+ sjTime(this.startTime) + 86400000
|
|
|
|
+ ).getFullYear()}年${new Date(
|
|
|
|
+ sjTime(this.startTime) + 86400000
|
|
|
|
+ ).getMonth() + 1}月${new Date(
|
|
|
|
+ sjTime(this.startTime) + 86400000
|
|
|
|
+ ).getDate()}日08:00`
|
|
|
|
+ }
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
//查询装车数据
|
|
//查询装车数据
|
|
search() {
|
|
search() {
|
|
@@ -233,6 +264,7 @@ export default {
|
|
// })
|
|
// })
|
|
// return
|
|
// return
|
|
// }
|
|
// }
|
|
|
|
+ this.startTime = this.map.startTime
|
|
this.map.startTime = sjTime(this.map.startTime)
|
|
this.map.startTime = sjTime(this.map.startTime)
|
|
this.map.endTime = sjTime(this.map.endTime)
|
|
this.map.endTime = sjTime(this.map.endTime)
|
|
} else {
|
|
} else {
|
|
@@ -243,6 +275,12 @@ export default {
|
|
})
|
|
})
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+ const loading = this.$loading({
|
|
|
|
+ lock: true,
|
|
|
|
+ text: '正在获取数据',
|
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
|
+ })
|
|
this.axios.post('/api/v1/tms/yawnReport', this.map).then(res => {
|
|
this.axios.post('/api/v1/tms/yawnReport', this.map).then(res => {
|
|
if (res.data.code == '200') {
|
|
if (res.data.code == '200') {
|
|
let countRow = {
|
|
let countRow = {
|
|
@@ -265,6 +303,7 @@ export default {
|
|
materialThoWeight: 0,
|
|
materialThoWeight: 0,
|
|
trainWeight: 0,
|
|
trainWeight: 0,
|
|
trainThoWeight: 0,
|
|
trainThoWeight: 0,
|
|
|
|
+ unloadThoWeight: 0,
|
|
target: '合计'
|
|
target: '合计'
|
|
}
|
|
}
|
|
res.data.data.forEach(item => {
|
|
res.data.data.forEach(item => {
|
|
@@ -287,6 +326,11 @@ export default {
|
|
(countRow.materialThoWeight * 1000 +
|
|
(countRow.materialThoWeight * 1000 +
|
|
item.materialThoWeight * 1000) /
|
|
item.materialThoWeight * 1000) /
|
|
1000
|
|
1000
|
|
|
|
+
|
|
|
|
+ countRow.unloadThoWeight =
|
|
|
|
+ (countRow.unloadThoWeight * 1000 +
|
|
|
|
+ item.unloadThoWeight * 1000) /
|
|
|
|
+ 1000
|
|
countRow.trainWeight += item.trainWeight
|
|
countRow.trainWeight += item.trainWeight
|
|
countRow.trainThoWeight += item.trainThoWeight
|
|
countRow.trainThoWeight += item.trainThoWeight
|
|
}
|
|
}
|
|
@@ -301,14 +345,88 @@ export default {
|
|
countRow.percent = 'NAL'
|
|
countRow.percent = 'NAL'
|
|
}
|
|
}
|
|
res.data.data.splice(res.data.data.length - 1, 0, countRow)
|
|
res.data.data.splice(res.data.data.length - 1, 0, countRow)
|
|
|
|
+ const map1 = res.data.data.reduce((result, item) => {
|
|
|
|
+ result[item.target] = result[item.target] || []
|
|
|
|
+ result[item.target].push(item)
|
|
|
|
+ return result
|
|
|
|
+ }, {})
|
|
|
|
+ let result = Object.values(map1)
|
|
|
|
+ result.forEach(arrayList => {
|
|
|
|
+ if (arrayList.length > 1) {
|
|
|
|
+ let countRow1 = {
|
|
|
|
+ EnNum: 0,
|
|
|
|
+ carrierName: '',
|
|
|
|
+ no: -1,
|
|
|
|
+ notEnNum: 0,
|
|
|
|
+ notSendNum: 0,
|
|
|
|
+ numCang: 0,
|
|
|
|
+ numGong: 0,
|
|
|
|
+ orderNum: 0,
|
|
|
|
+ percent: '',
|
|
|
|
+ planNum: 0,
|
|
|
|
+ quxiaoNum: 0,
|
|
|
|
+ unReceiveNum: 0,
|
|
|
|
+ receivedNum: 0,
|
|
|
|
+ queueNum: 0,
|
|
|
|
+ enFactoryNum: 0,
|
|
|
|
+ totalNet: 0,
|
|
|
|
+ materialThoWeight: 0,
|
|
|
|
+ trainWeight: 0,
|
|
|
|
+ trainThoWeight: 0,
|
|
|
|
+ unloadThoWeight: 0,
|
|
|
|
+ carrierName: '合计',
|
|
|
|
+ target: arrayList[0].target
|
|
|
|
+ }
|
|
|
|
+ arrayList.forEach(item => {
|
|
|
|
+ if (!item.target.includes('合计')) {
|
|
|
|
+ countRow1.EnNum += item.EnNum
|
|
|
|
+ countRow1.notEnNum += item.notEnNum
|
|
|
|
+ countRow1.notSendNum += item.notSendNum
|
|
|
|
+ countRow1.numCang += item.numCang
|
|
|
|
+ countRow1.numGong += item.numGong
|
|
|
|
+ countRow1.orderNum += item.orderNum
|
|
|
|
+ countRow1.planNum += item.planNum
|
|
|
|
+ countRow1.quxiaoNum += item.quxiaoNum
|
|
|
|
+ countRow1.unReceiveNum += item.unReceiveNum
|
|
|
|
+ countRow1.receivedNum += item.receivedNum
|
|
|
|
+ countRow1.queueNum += item.queueNum
|
|
|
|
+ countRow1.enFactoryNum += item.enFactoryNum
|
|
|
|
+ countRow1.totalNet =
|
|
|
|
+ (countRow1.totalNet * 1000 + item.totalNet * 1000) / 1000
|
|
|
|
+ countRow1.materialThoWeight =
|
|
|
|
+ (countRow1.materialThoWeight * 1000 +
|
|
|
|
+ item.materialThoWeight * 1000) /
|
|
|
|
+ 1000
|
|
|
|
+ countRow1.unloadThoWeight =
|
|
|
|
+ (countRow1.unloadThoWeight * 1000 +
|
|
|
|
+ item.unloadThoWeight * 1000) /
|
|
|
|
+ 1000
|
|
|
|
+ countRow1.trainWeight += item.trainWeight
|
|
|
|
+ countRow1.trainThoWeight += item.trainThoWeight
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ countRow1.percent =
|
|
|
|
+ (
|
|
|
|
+ (countRow1.orderNum /
|
|
|
|
+ (countRow1.planNum - countRow1.quxiaoNum)) *
|
|
|
|
+ 100
|
|
|
|
+ ).toFixed(2) + '%'
|
|
|
|
+ console.log(countRow1, 'countRow1')
|
|
|
|
+ arrayList.push(countRow1)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ // console.log(result, 'result')
|
|
|
|
+ res.data.data = result.flat(1)
|
|
// res.data.data.push(countRow)
|
|
// res.data.data.push(countRow)
|
|
this.getSpanArr(res.data.data)
|
|
this.getSpanArr(res.data.data)
|
|
this.yawnReportData = res.data.data
|
|
this.yawnReportData = res.data.data
|
|
|
|
+ loading.close()
|
|
} else {
|
|
} else {
|
|
this.$message({
|
|
this.$message({
|
|
type: 'error',
|
|
type: 'error',
|
|
message: res.data.data
|
|
message: res.data.data
|
|
})
|
|
})
|
|
|
|
+ loading.close()
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -401,4 +519,13 @@ export default {
|
|
border: 1px, solid, #000 !important;
|
|
border: 1px, solid, #000 !important;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+.title {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: left;
|
|
|
|
+ align-items: center;
|
|
|
|
+ margin-left: 40px;
|
|
|
|
+ font-size: 30px;
|
|
|
|
+ font-weight: 700;
|
|
|
|
+ color: #000;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|