修复结算单管理问题

This commit is contained in:
hr121 2025-08-01 14:04:34 +08:00
parent 79bd6b57dd
commit b5b1d4ce5b
2 changed files with 35 additions and 19 deletions

View File

@ -232,19 +232,20 @@ export default {
} }
// //
this.flightTaskData = res.orderTaskDetailList.map(task => ({ if (res.orderTaskDetailList && res.orderTaskDetailList.length > 0) {
operator: task.operatorName, this.flightTaskData = res.orderTaskDetailList.map(task => ({
device: task.deviceName, operator: task.operatorName,
cargoImage: task.attachmentMaterialList && task.attachmentMaterialList.length > 0 device: task.deviceName,
? task.attachmentMaterialList[0].fileFullPath cargoImage: task.attachmentMaterialList && task.attachmentMaterialList.length > 0
: '', ? task.attachmentMaterialList[0].fileFullPath
weight: task.cargoWeight + 'kg', : '',
status: task.orderItemStatus, weight: task.cargoWeight + 'kg',
videoUrl: '' status: task.orderItemStatus,
})) videoUrl: ''
}))
// //
this.taskPage.total = res.orderTaskDetailList.length this.taskPage.total = res.orderTaskDetailList.length
}
this.taskPage.page = 1 this.taskPage.page = 1
}) })
}, },

View File

@ -346,13 +346,27 @@ export default {
})) }))
// //
getGenerateSettleOrderConfirmList({ getGenerateSettleOrderConfirmList(this.selection.map(order => order.id))
orders: this.selection.map(order => order.id)
})
.then(response => { .then(response => {
if (response.success) { if (response.success) {
// //
this.settlementList = response.data || [] this.settlementList = response.data || []
// attractionId,cargoWeight,totalAmount,
// attractionId
this.settlementList = this.settlementList.map(item => {
const scenic = this.scenicAreaOptions.find(s => s.id === item.attractionId)
return {
scenicArea: scenic ? scenic.name : '未知景区',
weight: item.cargoWeight,
amount: item.totalAmount
}
})
//
if (this.settlementList.length === 0) {
this.$message.warning('没有可生成结算单的订单')
this.dialogVisible = false
return
}
} else { } else {
this.$message.error('获取结算确认列表失败: ' + response.message) this.$message.error('获取结算确认列表失败: ' + response.message)
} }
@ -367,10 +381,11 @@ export default {
}, },
handleConfirm() { handleConfirm() {
console.log('确认生成结算单:', this.selection.map(order => order.id))
// //
generateSettlementOrder({ generateSettlementOrder(
orders: this.selection.map(order => order.id) this.selection.map(order => order.id)
}) )
.then(response => { .then(response => {
if (response.success) { if (response.success) {
this.$message.success('结算单生成成功') this.$message.success('结算单生成成功')