Browse Source

2025-10-30

拣货出库任务通知增加包装功能
master
fengyuan_yang 2 months ago
parent
commit
f73c47c5c1
  1. 73
      src/views/modules/qc/outboundNotification.vue

73
src/views/modules/qc/outboundNotification.vue

@ -53,6 +53,7 @@
</el-form-item> </el-form-item>
<el-form-item :label="' '"> <el-form-item :label="' '">
<el-button @click="exportExcel()" type="primary" style="margin-left: 2px">{{'导出'}}</el-button> <el-button @click="exportExcel()" type="primary" style="margin-left: 2px">{{'导出'}}</el-button>
<el-button @click="packingModal()" type="primary" style="margin-left: 2px">包装</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -1251,6 +1252,78 @@
}, },
//
packingModal () {
//
if (this.outboundSelection.length === 0) {
this.$message.warning('请勾选要包装的单据!')
return
}
// """"
const invalidOrders = this.outboundSelection.filter(item => {
return item.orderType !== '销售出库' || item.orderStatus !== '待出库'
})
if (invalidOrders.length > 0) {
this.$message.warning('只能对"销售出库"类型且状态为"待出库"的单据进行包装操作!')
return
}
//
this.$confirm(`确定将选中的 ${this.outboundSelection.length} 条单据状态更新为"待包装"?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
//
const updateList = this.outboundSelection.map(item => ({
site: item.site,
buNo: item.buNo,
orderNo: item.orderNo,
orderStatus: '待包装'
}))
this.batchUpdateOrderStatus(updateList)
}).catch(() => {
//
})
},
//
batchUpdateOrderStatus (updateList) {
// API使
let successCount = 0
let errorCount = 0
const totalCount = updateList.length
const updatePromises = updateList.map(item => {
return this.$http({
url: this.$http.adornUrl('/outboundNotification/updateOrderStatus'),
method: 'post',
data: this.$http.adornData(item)
}).then(({data}) => {
if (data && data.code === 0) {
successCount++
} else {
errorCount++
}
}).catch(() => {
errorCount++
})
})
Promise.all(updatePromises).then(() => {
if (errorCount === 0) {
this.$message.success(`成功更新 ${successCount} 条单据状态为"待包装"`)
} else {
this.$message.warning(`成功 ${successCount} 条,失败 ${errorCount}`)
}
this.getDataList()
this.outboundSelection = []
})
},
// //
closeModal (row) { closeModal (row) {
if (this.currentRow.orderType === '销售出库') { if (this.currentRow.orderType === '销售出库') {

Loading…
Cancel
Save