Commit 16f95723 authored by jingnan's avatar jingnan 👀

添加AO保留弹框增加AO续保留逻辑

parent 0403aa26
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
ref="tableCom" ref="tableCom"
:basic-data="{...basicData,dictOptions}" :basic-data="{...basicData,dictOptions}"
class="list-table" class="list-table"
:lay-config="{ typeName: 'ExtProcessPlan', layKey: 'addExtRetentionLists'}" :lay-config="layConfig"
@selectionChange="selectionChange" @selectionChange="selectionChange"
/> />
<div slot="footer" class="foot-btn-box"> <div slot="footer" class="foot-btn-box">
...@@ -29,7 +29,7 @@ export default { ...@@ -29,7 +29,7 @@ export default {
type: Object, type: Object,
default: () => {} default: () => {}
}, },
parentTableData: { componentProp: {
type: Object, type: Object,
default: () => {} default: () => {}
} }
...@@ -37,11 +37,23 @@ export default { ...@@ -37,11 +37,23 @@ export default {
data() { data() {
return { return {
selection: [], selection: [],
dictOptions: [] dictOptions: [],
layConfig: { typeName: 'ExtProcessPlan', layKey: 'addExtRetentionLists' }
} }
}, },
computed: {}, computed: {},
watch: {}, watch: {
'componentProp.name': {
immediate: true,
handler(val) {
if (val === '添加AO保留') {
this.layConfig = { typeName: 'ExtProcessPlan', layKey: 'addExtRetentionLists' }
} else {
this.layConfig = { typeName: 'ExtProcessPlan', layKey: 'addOtherExtRetentionLists' }
}
}
}
},
created() { created() {
this.getDictData() this.getDictData()
}, },
...@@ -72,9 +84,11 @@ export default { ...@@ -72,9 +84,11 @@ export default {
if (this.selection.length) { if (this.selection.length) {
const showData = this.findByNameVnode(this, 'DeeAsTable').showData const showData = this.findByNameVnode(this, 'DeeAsTable').showData
if (showData.length) { if (showData.length) {
this.selection = this.selection.filter(item => !showData.some(x => x.targetId === item.id)) const validId = this.componentProp.name === '添加AO保留' ? 'id' : 'targetId'
this.selection = this.selection.filter(item => !showData.some(x => x.targetId === item[validId]))
} }
const data = this.selection.map(item => { const data = this.selection.map(row => {
const item = this.componentProp.name === '添加AO保留' ? row : row.target
return { return {
operator: 'ADD', operator: 'ADD',
dictOptions: this.dictOptions, dictOptions: this.dictOptions,
......
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