fix
This commit is contained in:
@@ -9,12 +9,12 @@
|
||||
</el-steps>
|
||||
</div>
|
||||
</template>
|
||||
<template #content v-if="refresh">
|
||||
<baseInfo ref="baseInfo" :instance="instance" :dict="dict" v-show="activeStep==0"/>
|
||||
<template #content v-if="loaded">
|
||||
<baseInfo ref="baseInfo" :instance="instance" :dict="dict" v-if="activeStep==0"/>
|
||||
<applyForm ref="applyForm" :instance="instance" :dict="dict" v-show="activeStep==1"/>
|
||||
<attachmentMaterial ref="attachmentMaterial" :instance="instance" v-show="activeStep==2"/>
|
||||
<attachmentMaterial ref="attachmentMaterial" :instance="instance" v-if="activeStep==2"/>
|
||||
<processApproval ref="processApproval" :approvalSteps="applyForm.approvalSteps" :instance="instance"
|
||||
:dict="dict" v-show="activeStep==3"/>
|
||||
:dict="dict" v-if="activeStep==3"/>
|
||||
</template>
|
||||
<template #footer>
|
||||
<el-button class="btn" v-if="activeStep==0" @click="handleBack">取消</el-button>
|
||||
@@ -39,12 +39,10 @@ export default {
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
row: Object
|
||||
},
|
||||
components: {baseInfo, applyForm, attachmentMaterial, processApproval},
|
||||
data() {
|
||||
return {
|
||||
activeStep: 0,
|
||||
baseInfo: {},
|
||||
applyForm: {
|
||||
tableId: "",
|
||||
@@ -52,7 +50,8 @@ export default {
|
||||
},
|
||||
processAnnexDefs: [],
|
||||
detailObj: {},
|
||||
refresh: true
|
||||
activeStep: 0,
|
||||
loaded: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -66,7 +65,7 @@ export default {
|
||||
},
|
||||
detailTitle() {
|
||||
return this.detailObj?.id ? "编辑事项" : "添加事项"
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
@@ -103,9 +102,9 @@ export default {
|
||||
}
|
||||
},
|
||||
handleBaseInfo() {
|
||||
this.$refs['baseInfo'].banseInfoForm().then(res => {
|
||||
this.$refs.baseInfo.banseInfoForm().then(res => {
|
||||
if (res) {
|
||||
this.$refs['applyForm'].getFormList()
|
||||
this.$refs.applyForm?.getFormList()
|
||||
this.baseInfo = res
|
||||
this.activeStep++
|
||||
}
|
||||
@@ -115,18 +114,17 @@ export default {
|
||||
* 保存
|
||||
*/
|
||||
save() {
|
||||
this.$refs['processApproval'].handleProcessApproval().then(res => {
|
||||
this.$refs.processApproval?.handleProcessApproval().then(res => {
|
||||
this.instance.post(`/approval-process-def/add-update`, {
|
||||
...this.detailObj,
|
||||
...this.baseInfo,
|
||||
processDefStatus: Number(this.baseInfo.processDefStatus),
|
||||
tableId: this.applyForm.tableId,
|
||||
processType: 0,
|
||||
tableType: 2,
|
||||
processAnnexDefs: this.annexs.map(e => ({...e, mustFill: Number(e.mustFill)})),
|
||||
processAnnexDefs: this.annexs?.map(e => ({...e, mustFill: Number(e.mustFill)})),
|
||||
processNodeList: res.processNodeList
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res?.code == 0) {
|
||||
this.$message.success("保存成功")
|
||||
this.$emit("back")
|
||||
}
|
||||
@@ -139,28 +137,21 @@ export default {
|
||||
this.instance.post(`/approval-process-def/info-id`, null, {params: {id}}).then(res => {
|
||||
if (res?.data) {
|
||||
this.detailObj = res.data
|
||||
this.refreshDetail()
|
||||
}
|
||||
})
|
||||
}).finally(() => this.loaded = true)
|
||||
},
|
||||
getStepIcon(rowIndex) {
|
||||
if (rowIndex < this.activeStep) return "iconfont iconSteps_Finished"
|
||||
else if (this.activeStep == rowIndex) return "iconfont iconSteps_In_Progress"
|
||||
return ""
|
||||
},
|
||||
refreshDetail() {
|
||||
this.refresh = false
|
||||
this.$nextTick(() => this.refresh = true)
|
||||
},
|
||||
handleBack() {
|
||||
this.detailObj?.id && this.$router.push({query: {}})
|
||||
this.$emit('back')
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.row.id) {
|
||||
this.getDetail(this.row.id)
|
||||
}
|
||||
this.getDetail(this.$route.query.id)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user