Commit e602307d authored by jingnan's avatar jingnan 👀

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

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