Commit 196b571b authored by jingnan's avatar jingnan 👀

添加AO保留弹框修改

parent 257603fb
......@@ -41,12 +41,16 @@ export default {
layConfig: { typeName: 'ExtProcessPlan', layKey: 'addExtRetentionLists' }
}
},
computed: {},
computed: {
isAddAO() {
return this.componentProp.name === '添加AO保留'
}
},
watch: {
'componentProp.name': {
isAddAO: {
immediate: true,
handler(val) {
if (val === '添加AO保留') {
if (val) {
this.layConfig = { typeName: 'ExtProcessPlan', layKey: 'addExtRetentionLists' }
} else {
this.layConfig = { typeName: 'ExtProcessPlan', layKey: 'addOtherExtRetentionLists' }
......@@ -84,15 +88,23 @@ export default {
if (this.selection.length) {
const showData = this.findByNameVnode(this, 'DeeAsTable').showData
if (showData.length) {
const validId = this.componentProp.name === '添加AO保留' ? 'id' : 'targetId'
const validId = this.isAddAO ? 'id' : 'targetId'
this.selection = this.selection.filter(item => !showData.some(x => x.targetId === item[validId]))
}
const data = this.selection.map(row => {
const item = this.componentProp.name === '添加AO保留' ? row : row.target
let item = ''
let assemblyUnit = ''
if (this.isAddAO) {
item = row
assemblyUnit = this.getCaNo(item.targetExtProcessUsageLink && item.targetExtProcessUsageLink[0] && item.targetExtProcessUsageLink[0].source)
} else {
item = row.target
assemblyUnit = row.assemblyUnit
}
return {
operator: 'ADD',
dictOptions: this.dictOptions,
assemblyUnit: this.getCaNo(item.targetExtProcessUsageLink && item.targetExtProcessUsageLink[0] && item.targetExtProcessUsageLink[0].source),
assemblyUnit: assemblyUnit,
target: item,
targetId: item.id,
targetIdType: 'ExtProcessPlan',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment