diff --git a/src/views/modules/schedule/order_schedule_expand.vue b/src/views/modules/schedule/order_schedule_expand.vue index 56c91e2..cca1980 100644 --- a/src/views/modules/schedule/order_schedule_expand.vue +++ b/src/views/modules/schedule/order_schedule_expand.vue @@ -207,6 +207,39 @@ + + + + + + + + + @@ -216,6 +249,64 @@ 取消 + + + +
+ + + + + + + + + + + + 查询 + + + + + + + + + + + + +
+ + 关闭 + +
@@ -231,6 +322,8 @@ import { batchScheduleOrderWithExpand } from '@/api/schedule/order_schedule_expand.js'; +import { getFixedCarrierList } from '@/api/yieldReport/com_separate_roll.js'; + /*动态表头*/ import { saveTableDefaultList, @@ -271,6 +364,15 @@ export default { specifiedTime: 'N', scheduleTime: '08:30', dataListSelections: [], + // 固定载具相关 + carrierDialogVisible: false, // 固定载具对话框 + carrierList: [], // 固定载具列表 + carrierSearchData: { // 固定载具查询条件 + carrierNo: '', + carrierTypeName: '', + specification: '' + }, + currentEditIndex: -1, // 当前编辑的行索引 scheduleColumnList: [ { userId: this.$store.state.user.name, @@ -1278,7 +1380,10 @@ export default { site: item.site, specifiedTime: this.specifiedTime, username: this.$store.state.user.name, - workCenterNo: item.workCenterNo + workCenterNo: item.workCenterNo, + carrierNo: item.carrierNo || '', + rowCount: item.rowCount || 0, + rollCount: item.rollCount || 0 } newItemList.push(newItem) } @@ -1308,27 +1413,36 @@ export default { handleSelectionChange(val) { // 解析每个工单的可用机台字段 this.dataListSelections = val.map(item => { + // 创建新对象以确保响应式 + let newItem = Object.assign({}, item); + // 解析availResource字段,格式如:ResourceID(ResourceDesc) ResourceID(ResourceDesc) - if (item.availResource && item.availResource.trim()) { + if (newItem.availResource && newItem.availResource.trim()) { // 匹配所有 ResourceID(ResourceDesc) 格式的字符串 const regex = /(\S+)\(([^)]+)\)/g; const matches = []; let match; - while ((match = regex.exec(item.availResource)) !== null) { + while ((match = regex.exec(newItem.availResource)) !== null) { matches.push({ resourceId: match[1], resourceDesc: match[1] + '(' + match[2] + ')' }); } - item.availResourceList = matches; + newItem.availResourceList = matches; // 如果当前没有选中机台,默认选择第一个 - if ((!item.resourceId || item.resourceId === '') && matches.length > 0) { - item.resourceId = matches[0].resourceId; + if ((!newItem.resourceId || newItem.resourceId === '') && matches.length > 0) { + newItem.resourceId = matches[0].resourceId; } } else { - item.availResourceList = []; + newItem.availResourceList = []; } - return item; + + // 初始化新增的字段(确保响应式) + newItem.carrierNo = newItem.carrierNo || ''; + newItem.rowCount = newItem.rowCount || 0; + newItem.rollCount = newItem.rollCount || 0; + + return newItem; }); }, @@ -1337,6 +1451,43 @@ export default { this.getShopOrderList(); }, + /*打开固定载具选择对话框*/ + openCarrierDialog(index) { + this.currentEditIndex = index; + this.queryCarrierList(); + }, + + /*查询固定载具列表*/ + queryCarrierList() { + const params = { + site: this.$store.state.user.site, + carrierNo: this.carrierSearchData.carrierNo, + carrierTypeName: this.carrierSearchData.carrierTypeName, + specification: this.carrierSearchData.specification + } + getFixedCarrierList(params).then(({data}) => { + if (data && data.code === 0) { + this.carrierList = data.data + this.carrierDialogVisible = true + } else { + this.$message.error(data.msg || '获取固定载具列表失败') + } + }).catch(error => { + this.$message.error('获取固定载具列表失败: ' + error.message) + }) + }, + + /*选中固定载具*/ + selectCarrier(row) { + if (this.currentEditIndex >= 0 && this.currentEditIndex < this.dataListSelections.length) { + // 直接赋值 + this.dataListSelections[this.currentEditIndex].carrierNo = row.carrierNo + // 强制刷新视图 + this.$forceUpdate() + this.carrierDialogVisible = false + } + }, + // 每页数 sizeChangeHandle (val) { this.pageSize = val