feat(报表): 优化各工序报表的损耗数据获取逻辑

将getLossList方法改为异步方式,同时获取酸轧/镀锌和分条工序的数据
合并两个工序的数据后再查询钢卷信息,提高数据完整性和准确性
添加updateBy参数区分不同工序的管理员
This commit is contained in:
砂糖
2026-03-02 10:50:47 +08:00
parent 2aeb19a685
commit 141d39263f
10 changed files with 389 additions and 287 deletions

View File

@@ -63,9 +63,10 @@
<el-descriptions-item label="异常率">{{ summary.abRate }}</el-descriptions-item> <el-descriptions-item label="异常率">{{ summary.abRate }}</el-descriptions-item>
</el-descriptions> </el-descriptions>
<!-- 异常统计 --> <!-- 异常统计 -->
<el-descriptions title="异常统计" :column="4" border> <el-descriptions title="异常统计" :column="4" border>
<el-descriptions-item v-for="item in abSummary" :key="item.label" :label="item.label">{{ item.value }}</el-descriptions-item> <el-descriptions-item v-for="item in abSummary" :key="item.label" :label="item.label">{{ item.value
}}</el-descriptions-item>
</el-descriptions> </el-descriptions>
<el-descriptions title="明细信息" :column="3" border> <el-descriptions title="明细信息" :column="3" border>
@@ -268,7 +269,7 @@ export default {
summary() { summary() {
return calcSummary(this.list, this.lossList) return calcSummary(this.list, this.lossList)
}, },
abSummary() { abSummary() {
return calcAbSummary(this.list) return calcAbSummary(this.list)
} }
}, },
@@ -312,36 +313,46 @@ export default {
this.loading = false this.loading = false
}) })
}, },
getLossList() { async getLossList() {
this.loading = true this.loading = true
listPendingAction({ const res1 = await listPendingAction({
actionType: 11, // 酸轧工序 actionType: 11, // 酸轧工序
pageSize: 999, pageSize: 999,
pageNum: 1, pageNum: 1,
startTime: this.queryParams.byCreateTimeStart, startTime: this.queryParams.byCreateTimeStart,
endTime: this.queryParams.byCreateTimeEnd, endTime: this.queryParams.byCreateTimeEnd,
}).then(res => { })
const actions = res.rows const res2 = await listPendingAction({
const coilIds = actions.map(item => item.coilId).join(',') // actionStatus: 2,
console.log(coilIds) warehouseId: this.queryParams.planId,
if (!coilIds) { // actionType: 401,
this.$message({ actionType: 200, // 分条工序
message: '暂无数据', pageSize: 999,
type: 'warning', pageNum: 1,
}) startTime: this.queryParams.byCreateTimeStart,
this.lossList = [] endTime: this.queryParams.byCreateTimeEnd,
this.loading = false updateBy: 'suanzhakuguan',
return })
} const actions = res1.rows.concat(res2.rows)
listCoilWithIds({ const coilIds = actions.map(item => item.coilId).join(',')
...this.queryParams, console.log(coilIds)
byCreateTimeStart: undefined, if (!coilIds) {
byCreateTimeEnd: undefined, this.$message({
coilIds: coilIds, message: '暂无数据',
}).then(res => { type: 'warning',
this.lossList = res.rows
this.loading = false
}) })
this.lossList = []
this.loading = false
return
}
listCoilWithIds({
...this.queryParams,
byCreateTimeStart: undefined,
byCreateTimeEnd: undefined,
coilIds: coilIds,
}).then(res => {
this.lossList = res.rows
this.loading = false
}) })
}, },
// 导出 // 导出

View File

@@ -334,36 +334,46 @@ export default {
this.loading = false this.loading = false
}) })
}, },
getLossList() { async getLossList() {
this.loading = true this.loading = true
listPendingAction({ const res1 = await listPendingAction({
actionType: 11, // 酸轧工序 actionType: 11, // 酸轧工序
pageSize: 999, pageSize: 999,
pageNum: 1, pageNum: 1,
startTime: this.queryParams.byCreateTimeStart, startTime: this.queryParams.byCreateTimeStart,
endTime: this.queryParams.byCreateTimeEnd, endTime: this.queryParams.byCreateTimeEnd,
}).then(res => { })
const actions = res.rows const res2 = await listPendingAction({
const coilIds = actions.map(item => item.coilId).join(',') // actionStatus: 2,
console.log(coilIds) warehouseId: this.queryParams.planId,
if (!coilIds) { // actionType: 401,
this.$message({ actionType: 200, // 分条工序
message: '暂无数据', pageSize: 999,
type: 'warning', pageNum: 1,
}) startTime: this.queryParams.byCreateTimeStart,
this.lossList = [] endTime: this.queryParams.byCreateTimeEnd,
this.loading = false updateBy: 'suanzhakuguan',
return })
} const actions = res1.rows.concat(res2.rows)
listCoilWithIds({ const coilIds = actions.map(item => item.coilId).join(',')
...this.queryParams, console.log(coilIds)
byCreateTimeStart: undefined, if (!coilIds) {
byCreateTimeEnd: undefined, this.$message({
coilIds: coilIds, message: '暂无数据',
}).then(res => { type: 'warning',
this.lossList = res.rows
this.loading = false
}) })
this.lossList = []
this.loading = false
return
}
listCoilWithIds({
...this.queryParams,
byCreateTimeStart: undefined,
byCreateTimeEnd: undefined,
coilIds: coilIds,
}).then(res => {
this.lossList = res.rows
this.loading = false
}) })
}, },
// 导出 // 导出

View File

@@ -389,36 +389,46 @@ export default {
this.loading = false this.loading = false
}) })
}, },
getLossList() { async getLossList() {
this.loading = true this.loading = true
listPendingAction({ const res1 = await listPendingAction({
actionType: 11, // 酸轧工序 actionType: 11, // 酸轧工序
pageSize: 999, pageSize: 999,
pageNum: 1, pageNum: 1,
startTime: this.queryParams.byCreateTimeStart, startTime: this.queryParams.byCreateTimeStart,
endTime: this.queryParams.byCreateTimeEnd, endTime: this.queryParams.byCreateTimeEnd,
}).then(res => { })
const actions = res.rows const res2 = await listPendingAction({
const coilIds = actions.map(item => item.coilId).join(',') // actionStatus: 2,
console.log(coilIds) warehouseId: this.queryParams.planId,
if (!coilIds) { // actionType: 401,
this.$message({ actionType: 200, // 分条工序
message: '暂无数据', pageSize: 999,
type: 'warning', pageNum: 1,
}) startTime: this.queryParams.byCreateTimeStart,
this.list = [] endTime: this.queryParams.byCreateTimeEnd,
this.loading = false updateBy: 'suanzhakuguan',
return })
} const actions = res1.rows.concat(res2.rows)
listCoilWithIds({ const coilIds = actions.map(item => item.coilId).join(',')
...this.queryParams, console.log(coilIds)
byCreateTimeStart: undefined, if (!coilIds) {
byCreateTimeEnd: undefined, this.$message({
coilIds: coilIds, message: '暂无数据',
}).then(res => { type: 'warning',
this.lossList = res.rows
this.loading = false
}) })
this.lossList = []
this.loading = false
return
}
listCoilWithIds({
...this.queryParams,
byCreateTimeStart: undefined,
byCreateTimeEnd: undefined,
coilIds: coilIds,
}).then(res => {
this.lossList = res.rows
this.loading = false
}) })
}, },
// 导出 // 导出

View File

@@ -318,36 +318,46 @@ export default {
this.loading = false this.loading = false
}) })
}, },
getLossList() { async getLossList() {
this.loading = true this.loading = true
listPendingAction({ const res1 = await listPendingAction({
actionType: 11, // 酸轧工序 actionType: 11, // 酸轧工序
pageSize: 9999, pageSize: 999,
pageNum: 1, pageNum: 1,
startTime: this.queryParams.byCreateTimeStart, startTime: this.queryParams.byCreateTimeStart,
endTime: this.queryParams.byCreateTimeEnd, endTime: this.queryParams.byCreateTimeEnd,
}).then(res => { })
const actions = res.rows const res2 = await listPendingAction({
const coilIds = actions.map(item => item.coilId).join(',') // actionStatus: 2,
console.log(coilIds) warehouseId: this.queryParams.planId,
if (!coilIds) { // actionType: 401,
this.$message({ actionType: 200, // 分条工序
message: '暂无数据', pageSize: 999,
type: 'warning', pageNum: 1,
}) startTime: this.queryParams.byCreateTimeStart,
this.lossList = [] endTime: this.queryParams.byCreateTimeEnd,
this.loading = false updateBy: 'suanzhakuguan',
return })
} const actions = res1.rows.concat(res2.rows)
listCoilWithIds({ const coilIds = actions.map(item => item.coilId).join(',')
...this.queryParams, console.log(coilIds)
byCreateTimeStart: undefined, if (!coilIds) {
byCreateTimeEnd: undefined, this.$message({
coilIds: coilIds, message: '暂无数据',
}).then(res => { type: 'warning',
this.lossList = res.rows
this.loading = false
}) })
this.lossList = []
this.loading = false
return
}
listCoilWithIds({
...this.queryParams,
byCreateTimeStart: undefined,
byCreateTimeEnd: undefined,
coilIds: coilIds,
}).then(res => {
this.lossList = res.rows
this.loading = false
}) })
}, },
// 导出 // 导出

View File

@@ -179,9 +179,9 @@ export default {
this.planList = res.rows this.planList = res.rows
}) })
}, },
getList() { async getList() {
this.loading = true this.loading = true
listPendingAction({ const res1 = await listPendingAction({
// actionStatus: 2, // actionStatus: 2,
warehouseId: this.queryParams.planId, warehouseId: this.queryParams.planId,
// actionType: 401, // actionType: 401,
@@ -190,28 +190,38 @@ export default {
pageNum: 1, pageNum: 1,
startTime: this.queryParams.byCreateTimeStart, startTime: this.queryParams.byCreateTimeStart,
endTime: this.queryParams.byCreateTimeEnd, endTime: this.queryParams.byCreateTimeEnd,
}).then(res => { })
const actions = res.rows const res2 = await listPendingAction({
const coilIds = actions.map(item => item.coilId).join(',') // actionStatus: 2,
console.log(coilIds) warehouseId: this.queryParams.planId,
if (!coilIds) { // actionType: 401,
this.$message({ actionType: 200, // 分条工序
message: '暂无数据', pageSize: 999,
type: 'warning', pageNum: 1,
}) startTime: this.queryParams.byCreateTimeStart,
this.list = [] endTime: this.queryParams.byCreateTimeEnd,
this.loading = false updateBy: 'suanzhakuguan',
return })
} const actions = res1.rows.concat(res2.rows)
listCoilWithIds({ const coilIds = actions.map(item => item.coilId).join(',')
...this.queryParams, console.log(coilIds)
byCreateTimeStart: undefined, if (!coilIds) {
byCreateTimeEnd: undefined, this.$message({
coilIds: coilIds, message: '暂无数据',
}).then(res => { type: 'warning',
this.list = res.rows
this.loading = false
}) })
this.list = []
this.loading = false
return
}
listCoilWithIds({
...this.queryParams,
byCreateTimeStart: undefined,
byCreateTimeEnd: undefined,
coilIds: coilIds,
}).then(res => {
this.list = res.rows
this.loading = false
}) })
}, },
// 导出 // 导出

View File

@@ -65,7 +65,8 @@
<!-- 异常统计 --> <!-- 异常统计 -->
<el-descriptions title="异常统计" :column="4" border> <el-descriptions title="异常统计" :column="4" border>
<el-descriptions-item v-for="item in abSummary" :key="item.label" :label="item.label">{{ item.value }}</el-descriptions-item> <el-descriptions-item v-for="item in abSummary" :key="item.label" :label="item.label">{{ item.value
}}</el-descriptions-item>
</el-descriptions> </el-descriptions>
<el-descriptions title="明细信息" :column="3" border> <el-descriptions title="明细信息" :column="3" border>
@@ -298,36 +299,46 @@ export default {
this.loading = false this.loading = false
}) })
}, },
getLossList() { async getLossList() {
this.loading = true this.loading = true
listPendingAction({ const res1 = await listPendingAction({
actionType: 501, // 镀锌工序 actionType: 501, // 镀锌工序
pageSize: 999, pageSize: 999,
pageNum: 1, pageNum: 1,
startTime: this.queryParams.byCreateTimeStart, startTime: this.queryParams.byCreateTimeStart,
endTime: this.queryParams.byCreateTimeEnd, endTime: this.queryParams.byCreateTimeEnd,
}).then(res => { })
const actions = res.rows const res2 = await listPendingAction({
const coilIds = actions.map(item => item.coilId).join(',') // actionStatus: 2,
console.log(coilIds) warehouseId: this.queryParams.planId,
if (!coilIds) { // actionType: 401,
this.$message({ actionType: 200, // 分条工序
message: '暂无数据', pageSize: 999,
type: 'warning', pageNum: 1,
}) startTime: this.queryParams.byCreateTimeStart,
this.list = [] endTime: this.queryParams.byCreateTimeEnd,
this.loading = false updateBy: 'duxinkuguan',
return })
} const actions = res1.rows.concat(res2.rows)
listCoilWithIds({ const coilIds = actions.map(item => item.coilId).join(',')
...this.queryParams, console.log(coilIds)
byCreateTimeStart: undefined, if (!coilIds) {
byCreateTimeEnd: undefined, this.$message({
coilIds: coilIds, message: '暂无数据',
}).then(res => { type: 'warning',
this.lossList = res.rows
this.loading = false
}) })
this.list = []
this.loading = false
return
}
listCoilWithIds({
...this.queryParams,
byCreateTimeStart: undefined,
byCreateTimeEnd: undefined,
coilIds: coilIds,
}).then(res => {
this.lossList = res.rows
this.loading = false
}) })
}, },
// 导出 // 导出

View File

@@ -320,36 +320,46 @@ export default {
this.loading = false this.loading = false
}) })
}, },
getLossList() { async getLossList() {
this.loading = true this.loading = true
listPendingAction({ const res1 = await listPendingAction({
actionType: 501, // 镀锌工序 actionType: 501, // 镀锌工序
pageSize: 999, pageSize: 999,
pageNum: 1, pageNum: 1,
startTime: this.queryParams.byCreateTimeStart, startTime: this.queryParams.byCreateTimeStart,
endTime: this.queryParams.byCreateTimeEnd, endTime: this.queryParams.byCreateTimeEnd,
}).then(res => { })
const actions = res.rows const res2 = await listPendingAction({
const coilIds = actions.map(item => item.coilId).join(',') // actionStatus: 2,
console.log(coilIds) warehouseId: this.queryParams.planId,
if (!coilIds) { // actionType: 401,
this.$message({ actionType: 200, // 分条工序
message: '暂无数据', pageSize: 999,
type: 'warning', pageNum: 1,
}) startTime: this.queryParams.byCreateTimeStart,
this.lossList = [] endTime: this.queryParams.byCreateTimeEnd,
this.loading = false updateBy: 'duxinkuguan',
return })
} const actions = res1.rows.concat(res2.rows)
listCoilWithIds({ const coilIds = actions.map(item => item.coilId).join(',')
...this.queryParams, console.log(coilIds)
byCreateTimeStart: undefined, if (!coilIds) {
byCreateTimeEnd: undefined, this.$message({
coilIds: coilIds, message: '暂无数据',
}).then(res => { type: 'warning',
this.lossList = res.rows
this.loading = false
}) })
this.list = []
this.loading = false
return
}
listCoilWithIds({
...this.queryParams,
byCreateTimeStart: undefined,
byCreateTimeEnd: undefined,
coilIds: coilIds,
}).then(res => {
this.lossList = res.rows
this.loading = false
}) })
}, },
// 导出 // 导出

View File

@@ -94,62 +94,62 @@
<template slot-scope="scope"> <template slot-scope="scope">
<coil-no :coil-no="scope.row.enterCoilNo"></coil-no> <coil-no :coil-no="scope.row.enterCoilNo"></coil-no>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="当前钢卷号" align="center" prop="currentCoilNo"> <el-table-column label="当前钢卷号" align="center" prop="currentCoilNo">
<template slot-scope="scope"> <template slot-scope="scope">
<coil-no :coil-no="scope.row.currentCoilNo"></coil-no> <coil-no :coil-no="scope.row.currentCoilNo"></coil-no>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" /> <el-table-column label="创建时间" align="center" prop="createTime" />
<el-table-column label="逻辑库位" align="center" prop="warehouseName" /> <el-table-column label="逻辑库位" align="center" prop="warehouseName" />
<el-table-column label="产品类型" align="center" width="250"> <el-table-column label="产品类型" align="center" width="250">
<template slot-scope="scope"> <template slot-scope="scope">
<ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row.product" /> <ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row.product" />
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row.rawMaterial" /> <RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row.rawMaterial" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="重量 (吨)" align="center" prop="netWeight" /> <el-table-column label="重量 (吨)" align="center" prop="netWeight" />
<el-table-column label="长度 (米)" align="center" prop="length" /> <el-table-column label="长度 (米)" align="center" prop="length" />
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip /> <el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
<el-table-column label="更新人" align="center" prop="updateByName" /> <el-table-column label="更新人" align="center" prop="updateByName" />
<el-table-column label="更新时间" align="center" prop="updateTime" /> <el-table-column label="更新时间" align="center" prop="updateTime" />
</el-table> </el-table>
</el-tab-pane> --> </el-tab-pane> -->
<!-- <el-tab-pane label="产出钢卷" name="output"> --> <!-- <el-tab-pane label="产出钢卷" name="output"> -->
<el-table :data="list" border height="calc(100vh - 320px)"> <el-table :data="list" border height="calc(100vh - 320px)">
<el-table-column label="入场钢卷号" align="center" prop="enterCoilNo"> <el-table-column label="入场钢卷号" align="center" prop="enterCoilNo">
<template slot-scope="scope"> <template slot-scope="scope">
<coil-no :coil-no="scope.row.enterCoilNo"></coil-no> <coil-no :coil-no="scope.row.enterCoilNo"></coil-no>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="当前钢卷号" align="center" prop="currentCoilNo"> <el-table-column label="当前钢卷号" align="center" prop="currentCoilNo">
<template slot-scope="scope"> <template slot-scope="scope">
<coil-no :coil-no="scope.row.currentCoilNo"></coil-no> <coil-no :coil-no="scope.row.currentCoilNo"></coil-no>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="班组" align="center" prop="team" /> <el-table-column label="班组" align="center" prop="team" />
<el-table-column label="创建时间" align="center" prop="createTime" /> <el-table-column label="创建时间" align="center" prop="createTime" />
<el-table-column label="逻辑库位" align="center" prop="warehouseName" /> <el-table-column label="逻辑库位" align="center" prop="warehouseName" />
<el-table-column label="实际库区" align="center" prop="actualWarehouseName" /> <el-table-column label="实际库区" align="center" prop="actualWarehouseName" />
<el-table-column label="产品类型" align="center" width="250"> <el-table-column label="产品类型" align="center" width="250">
<template slot-scope="scope"> <template slot-scope="scope">
<ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row.product" /> <ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row.product" />
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row.rawMaterial" /> <RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row.rawMaterial" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="重量 (吨)" align="center" prop="netWeight" /> <el-table-column label="重量 (吨)" align="center" prop="netWeight" />
<el-table-column label="长度 (米)" align="center" prop="length" /> <el-table-column label="长度 (米)" align="center" prop="length" />
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip /> <el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
<el-table-column label="出库状态" align="center" prop="status"> <el-table-column label="出库状态" align="center" prop="status">
<!-- 0在库1已出库 --> <!-- 0在库1已出库 -->
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.status === 0 ? '在库' : '已出库' }} {{ scope.row.status === 0 ? '在库' : '已出库' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="更新人" align="center" prop="updateByName" /> <el-table-column label="更新人" align="center" prop="updateByName" />
<el-table-column label="更新时间" align="center" prop="updateTime" /> <el-table-column label="更新时间" align="center" prop="updateTime" />
</el-table> </el-table>
<!-- </el-tab-pane> --> <!-- </el-tab-pane> -->
<!-- </el-tabs> --> <!-- </el-tabs> -->
</div> </div>
@@ -376,36 +376,46 @@ export default {
this.loading = false this.loading = false
}) })
}, },
getLossList() { async getLossList() {
this.loading = true this.loading = true
listPendingAction({ const res1 = await listPendingAction({
actionType: 501, // 镀锌工序 actionType: 501, // 镀锌工序
pageSize: 999, pageSize: 999,
pageNum: 1, pageNum: 1,
startTime: this.queryParams.byCreateTimeStart, startTime: this.queryParams.byCreateTimeStart,
endTime: this.queryParams.byCreateTimeEnd, endTime: this.queryParams.byCreateTimeEnd,
}).then(res => { })
const actions = res.rows const res2 = await listPendingAction({
const coilIds = actions.map(item => item.coilId).join(',') // actionStatus: 2,
console.log(coilIds) warehouseId: this.queryParams.planId,
if (!coilIds) { // actionType: 401,
this.$message({ actionType: 200, // 分条工序
message: '暂无数据', pageSize: 999,
type: 'warning', pageNum: 1,
}) startTime: this.queryParams.byCreateTimeStart,
this.list = [] endTime: this.queryParams.byCreateTimeEnd,
this.loading = false updateBy: 'duxinkuguan',
return })
} const actions = res1.rows.concat(res2.rows)
listCoilWithIds({ const coilIds = actions.map(item => item.coilId).join(',')
...this.queryParams, console.log(coilIds)
byCreateTimeStart: undefined, if (!coilIds) {
byCreateTimeEnd: undefined, this.$message({
coilIds: coilIds, message: '暂无数据',
}).then(res => { type: 'warning',
this.lossList = res.rows
this.loading = false
}) })
this.list = []
this.loading = false
return
}
listCoilWithIds({
...this.queryParams,
byCreateTimeStart: undefined,
byCreateTimeEnd: undefined,
coilIds: coilIds,
}).then(res => {
this.lossList = res.rows
this.loading = false
}) })
}, },
// 导出 // 导出

View File

@@ -302,36 +302,46 @@ export default {
this.loading = false this.loading = false
}) })
}, },
getLossList() { async getLossList() {
this.loading = true this.loading = true
listPendingAction({ const res1 = await listPendingAction({
actionType: 501, // 镀锌工序 actionType: 501, // 镀锌工序
pageSize: 9999, pageSize: 999,
pageNum: 1, pageNum: 1,
startTime: this.queryParams.byCreateTimeStart, startTime: this.queryParams.byCreateTimeStart,
endTime: this.queryParams.byCreateTimeEnd, endTime: this.queryParams.byCreateTimeEnd,
}).then(res => { })
const actions = res.rows const res2 = await listPendingAction({
const coilIds = actions.map(item => item.coilId).join(',') // actionStatus: 2,
console.log(coilIds) warehouseId: this.queryParams.planId,
if (!coilIds) { // actionType: 401,
this.$message({ actionType: 200, // 分条工序
message: '暂无数据', pageSize: 999,
type: 'warning', pageNum: 1,
}) startTime: this.queryParams.byCreateTimeStart,
this.lossList = [] endTime: this.queryParams.byCreateTimeEnd,
this.loading = false updateBy: 'duxinkuguan',
return })
} const actions = res1.rows.concat(res2.rows)
listCoilWithIds({ const coilIds = actions.map(item => item.coilId).join(',')
...this.queryParams, console.log(coilIds)
byCreateTimeStart: undefined, if (!coilIds) {
byCreateTimeEnd: undefined, this.$message({
coilIds: coilIds, message: '暂无数据',
}).then(res => { type: 'warning',
this.lossList = res.rows
this.loading = false
}) })
this.list = []
this.loading = false
return
}
listCoilWithIds({
...this.queryParams,
byCreateTimeStart: undefined,
byCreateTimeEnd: undefined,
coilIds: coilIds,
}).then(res => {
this.lossList = res.rows
this.loading = false
}) })
}, },
// 导出 // 导出

View File

@@ -179,9 +179,9 @@ export default {
this.planList = res.rows this.planList = res.rows
}) })
}, },
getList() { async getList() {
this.loading = true this.loading = true
listPendingAction({ const res1 = await listPendingAction({
// actionStatus: 2, // actionStatus: 2,
warehouseId: this.queryParams.planId, warehouseId: this.queryParams.planId,
// actionType: 401, // actionType: 401,
@@ -190,28 +190,38 @@ export default {
pageNum: 1, pageNum: 1,
startTime: this.queryParams.byCreateTimeStart, startTime: this.queryParams.byCreateTimeStart,
endTime: this.queryParams.byCreateTimeEnd, endTime: this.queryParams.byCreateTimeEnd,
}).then(res => { })
const actions = res.rows const res2 = await listPendingAction({
const coilIds = actions.map(item => item.coilId).join(',') // actionStatus: 2,
console.log(coilIds) warehouseId: this.queryParams.planId,
if (!coilIds) { // actionType: 401,
this.$message({ actionType: 200, // 分条工序
message: '暂无数据', pageSize: 999,
type: 'warning', pageNum: 1,
}) startTime: this.queryParams.byCreateTimeStart,
this.list = [] endTime: this.queryParams.byCreateTimeEnd,
this.loading = false updateBy: 'duxinkuguan',
return })
} const actions = res1.rows.concat(res2.rows)
listCoilWithIds({ const coilIds = actions.map(item => item.coilId).join(',')
...this.queryParams, console.log(coilIds)
byCreateTimeStart: undefined, if (!coilIds) {
byCreateTimeEnd: undefined, this.$message({
coilIds: coilIds, message: '暂无数据',
}).then(res => { type: 'warning',
this.list = res.rows
this.loading = false
}) })
this.list = []
this.loading = false
return
}
listCoilWithIds({
...this.queryParams,
byCreateTimeStart: undefined,
byCreateTimeEnd: undefined,
coilIds: coilIds,
}).then(res => {
this.list = res.rows
this.loading = false
}) })
}, },
// 导出 // 导出