Commit 224a15b1 authored by jingnan's avatar jingnan 👀

添加AO保留弹框自定义组件修改

parent 3fed1bf9
......@@ -7,6 +7,7 @@
<div class="AddExtRetentionDetailDialog-dialog">
<dee-as-com
ref="tableCom"
:basic-data="{...basicData,dictOptions}"
class="list-table"
:lay-config="{ typeName: 'ExtProcessPlan', layKey: 'addExtRetentionLists'}"
@selectionChange="selectionChange"
......@@ -36,13 +37,20 @@ export default {
data() {
return {
selection: [],
defaultData: {}
dictOptions: []
}
},
computed: {},
watch: {},
created() {
this.getDictData()
},
mounted() {},
methods: {
// 加载字典数据
async getDictData() {
this.dictOptions = await this.$utils.getDicListByCode('PlanState')
},
findByNameVnode(obj, targetName) {
if (obj && obj.$vnode && obj.$vnode.tag && obj.$vnode.tag.includes(targetName)) {
return obj
......@@ -50,6 +58,13 @@ export default {
return this.findByNameVnode(obj.$parent, targetName)
}
},
getCaNo(data) {
if (data.subTypeName === 'ExtProcessPlanAssemblyUnit') {
return data.serialNumber
} else {
return this.getCaNo(data.targetExtProcessUsageLink && data.targetExtProcessUsageLink[0] && data.targetExtProcessUsageLink[0].source)
}
},
selectionChange(val) {
this.selection = val
},
......@@ -57,12 +72,18 @@ export default {
if (this.selection.length) {
const showData = this.findByNameVnode(this, 'DeeAsTable').showData
if (showData.length) {
this.selection = this.selection.filter(item => !showData.some(x => x.lifecycleTemplateId === item.lifecycleTemplateId))
this.selection = this.selection.filter(item => !showData.some(x => x.targetId === item.id))
}
const data = this.selection.map(item => {
item.operator = 'ADD'
item.id = null
return item
return {
operator: 'ADD',
dictOptions: this.dictOptions,
assemblyUnit: this.getCaNo(item.targetExtProcessUsageLink && item.targetExtProcessUsageLink[0] && item.targetExtProcessUsageLink[0].source),
target: item,
targetId: item.id,
targetIdType: 'ExtProcessPlan',
planStateLabel: this.$utils.getParamsFromLists(this.dictOptions, 'value', item.joExecutePlan[0].planState, 'label')
}
})
this.$emit('submitEvent', { formData: data })
}
......
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