Browse Source

2025-10-11

订单排产-批量排产的可用机台优化
master
fengyuan_yang 3 months ago
parent
commit
ad268f7a3f
  1. 43
      src/views/modules/schedule/order_schedule_expand.vue

43
src/views/modules/schedule/order_schedule_expand.vue

@ -161,7 +161,7 @@
<column v-if="visible" ref="column" @refreshData="getTableUserColumn" v-drag></column>
<el-dialog
width="702px"
width="800px"
:title="'已选工单'"
:close-on-click-modal="false"
:visible.sync="scheduleVisible">
@ -204,11 +204,21 @@
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed==''?false:item.fixed"
:width="item.columnWidth"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden">
<span v-if="!item.columnHidden && item.columnProp != 'resourceId'">
{{ scope.row[item.columnProp] }}
</span>
<span v-if="!item.columnHidden && item.columnProp == 'resourceId'">
<el-select class="table-select-input" v-model="scope.row.resourceId" style="width: 100%;">
<el-option
v-for="(resItem,resIndex) in scope.row.availResourceList"
:key="resIndex"
:value="resItem.resourceId"
:label="resItem.resourceDesc">
</el-option>
</el-select>
</span>
</template>
</el-table-column>
@ -396,7 +406,7 @@ export default {
headerAlign: "center",
align: "center",
columnLabel: "机台",
columnWidth: 100,
columnWidth: 150,
columnHidden: false,
columnImage: false,
columnSortable: true,
@ -1330,7 +1340,30 @@ export default {
//
handleSelectionChange(val) {
this.dataListSelections = val
//
this.dataListSelections = val.map(item => {
// availResourceResourceID(ResourceDesc) ResourceID(ResourceDesc)
if (item.availResource && item.availResource.trim()) {
// ResourceID(ResourceDesc)
const regex = /(\S+)\(([^)]+)\)/g;
const matches = [];
let match;
while ((match = regex.exec(item.availResource)) !== null) {
matches.push({
resourceId: match[1],
resourceDesc: match[1] + '(' + match[2] + ')'
});
}
item.availResourceList = matches;
//
if ((!item.resourceId || item.resourceId === '') && matches.length > 0) {
item.resourceId = matches[0].resourceId;
}
} else {
item.availResourceList = [];
}
return item;
});
},
/*刷新页面table*/

Loading…
Cancel
Save