diff --git a/klp-ui/src/components/KLPService/Renderer/ProductInfo.vue b/klp-ui/src/components/KLPService/Renderer/ProductInfo.vue index 3f998ec2..5f679b1e 100644 --- a/klp-ui/src/components/KLPService/Renderer/ProductInfo.vue +++ b/klp-ui/src/components/KLPService/Renderer/ProductInfo.vue @@ -2,13 +2,13 @@
- {{ product.productName ? product.productName : '--' }} + {{ product && product.productName ? product.productName : '--' }} @@ -62,6 +62,9 @@ export default { watch: { productId: { handler(newVal) { + if (!newVal) { + this.product = {}; + } const res = this.productMap[this.productId] ? this.productMap[this.productId] : {}; this.product = res; }, diff --git a/klp-ui/src/views/wms/work/schedulePlan/components/MergeSourceSelector.vue b/klp-ui/src/views/wms/work/schedulePlan/components/MergeSourceSelector.vue new file mode 100644 index 00000000..64af9ab7 --- /dev/null +++ b/klp-ui/src/views/wms/work/schedulePlan/components/MergeSourceSelector.vue @@ -0,0 +1,200 @@ + + + + + \ No newline at end of file diff --git a/klp-ui/src/views/wms/work/schedulePlan/detail.vue b/klp-ui/src/views/wms/work/schedulePlan/detail.vue index 0687883b..a6ab0774 100644 --- a/klp-ui/src/views/wms/work/schedulePlan/detail.vue +++ b/klp-ui/src/views/wms/work/schedulePlan/detail.vue @@ -30,11 +30,12 @@ - + + @@ -58,14 +59,17 @@ :value="item.lineId" /> - - + + + + - + { + this.batchList = res.rows || []; + }); + }, fetchDetailList() { this.loading = true; listSchedulePlanDetail({ planId: this.planId }).then(res => { @@ -189,7 +203,8 @@ export default { planId: this.planId, lineId: undefined, productId: undefined, - quantity: 1, + batchId: undefined, + quantity: 0, dateRange: [], startDate: '', endDate: '', @@ -202,6 +217,20 @@ export default { resetDetailForm() { this.$refs.detailForm && this.$refs.detailForm.resetFields(); }, + onBatchChange(batchId) { + if (batchId) { + // 从batchList中查找 + const batch = this.batchList.find(item => item.batchId == batchId); + console.log(batch); + if (batch) { + this.detailForm.quantity = batch.totalQuantity; + this.detailForm.dateRange = [ + batch.estimatedStartTime, + batch.estimatedEndTime + ]; + } + } + }, onLineChange(lineId) { if (!lineId) { this.lineGanttTasks = []; @@ -254,8 +283,8 @@ export default { this.$refs.detailForm.validate(valid => { if (!valid) return; if (this.detailForm.dateRange && this.detailForm.dateRange.length === 2) { - this.detailForm.startDate = this.detailForm.dateRange[0]; - this.detailForm.endDate = this.detailForm.dateRange[1]; + this.detailForm.startDate = this.detailForm.dateRange[0].replace(' ', "T") + '.000Z'; + this.detailForm.endDate = this.detailForm.dateRange[1].replace(' ', "T") + '.000Z'; } else { this.detailForm.startDate = ''; this.detailForm.endDate = ''; diff --git a/klp-ui/src/views/wms/work/schedulePlan/panes/batch.vue b/klp-ui/src/views/wms/work/schedulePlan/panes/batch.vue index 0181f202..63b69654 100644 --- a/klp-ui/src/views/wms/work/schedulePlan/panes/batch.vue +++ b/klp-ui/src/views/wms/work/schedulePlan/panes/batch.vue @@ -3,7 +3,7 @@
- +
@@ -75,7 +75,7 @@ - + @@ -86,7 +86,13 @@ --> - + + !this.batchList.some(batch => batch.mergeSource.split(',').includes(item.taskId))); + }, + allTasks() { + return this.taskList.flat(1); + }, + }, data() { return { // 按钮loading @@ -233,8 +252,14 @@ export default { this.taskList = Object.values(productIdToProcessTaskList); }, getTaskInfo(taskId) { - const task = this.taskList.flat(1).find(item => item.taskId == taskId); - console.log(task, taskId); + const task = this.allTasks.find(item => item.taskId == taskId); + // console.log(task, taskId); + if (!task) { + return { + productId: '', + processId: '' + }; + } return task; }, /** 查询批次(合并相同工艺的任务)列表 */ @@ -276,6 +301,12 @@ export default { this.queryParams.pageNum = 1; this.getList(); }, + // 处理合并来源变化的回调 + handleMergeSourceChange(mergeSource, selectedTasks) { + console.log('合并来源变化:', mergeSource); + console.log('选中的任务:', selectedTasks); + // 可以在这里做一些额外处理,比如计算总数量等 + }, async handleInitBatch() { generateBatch(this.taskList).then(res => { console.log(res) @@ -283,7 +314,7 @@ export default { this.generateBatchList = res.data.map(item => { let totalQuantity = 0; for (const taskId of item.taskIds) { - const task = this.taskList.flat(1).find(item => item.taskId == taskId); + const task = this.allTasks.find(item => item.taskId == taskId); totalQuantity += task.taskQuantity; } return {