|
|
|
@ -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 => { |
|
|
|
// 解析availResource字段,格式如:ResourceID(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*/ |
|
|
|
|