事项配置重构

This commit is contained in:
aixianling
2023-04-07 11:35:09 +08:00
parent aebf16936c
commit 485a294fb4
3 changed files with 189 additions and 261 deletions

View File

@@ -27,6 +27,7 @@
</template>
<script>
import {mapActions} from "vuex";
import {applyForm, attachmentMaterial, baseInfo, processApproval} from './index'
export default {
@@ -39,8 +40,6 @@ export default {
props: {
instance: Function,
dict: Object,
row: Object,
processType: String
},
components: {baseInfo, applyForm, attachmentMaterial, processApproval},
data() {
@@ -69,11 +68,11 @@ export default {
{title: '审批流程', activeIndex: 3}
]
},
detailTitle() {
return this.detailObj?.id ? "编辑事项" : "添加事项"
}
detailTitle: v => v.detailObj?.id ? "编辑事项" : "添加事项",
processType: v => v.$route.hash == "#add" ? 0 : 2
},
methods: {
...mapActions(['closePage']),
/**
* 上一步
* */
@@ -110,7 +109,6 @@ export default {
handleBaseInfo() {
this.$refs['baseInfo'].banseInfoForm().then(res => {
if (res) {
// this.$refs['applyForm'].getFormList()
this.baseInfo = res
this.activeStep++
}
@@ -121,6 +119,7 @@ export default {
*/
save() {
this.$refs['processApproval'].handleProcessApproval().then(res => {
const {processType} = this
this.instance.post(`/app/approval-process-def/add-update`, {
...this.detailObj,
...this.baseInfo,
@@ -132,18 +131,19 @@ export default {
tableType: 0,
processAnnexDefs: this.annexs.map(e => ({...e, mustFill: Number(e.mustFill)})),
processNodeList: res.processNodeList,
processType: this.processType
processType
}).then(res => {
if (res.code == 0) {
this.$message.success("保存成功")
this.$router.push({query:{}})
this.handleBack()
}
})
}).catch(err => {
console.error(err);
})
},
getDetail(id) {
getDetail() {
const {id} = this.$route.query
this.instance.post(`/app/approval-process-def/info-id`, null, {params: {id}}).then(res => {
if (res?.data) {
this.detailObj = res.data
@@ -163,12 +163,11 @@ export default {
},
handleBack() {
this.$router.push({query: {}})
this.closePage()
}
},
created() {
if (this.row?.id) {
this.getDetail(this.row?.id)
}
this.getDetail()
}
}
</script>
@@ -178,11 +177,11 @@ export default {
height: 100%;
&.formLayout {
:deep( .ai-detail__content--wrapper ){
:deep( .ai-detail__content--wrapper ) {
max-width: 100%;
height: calc(100%)!important;
padding: 0!important;
overflow: hidden!important;
height: calc(100%) !important;
padding: 0 !important;
overflow: hidden !important;
}
}
@@ -198,10 +197,10 @@ export default {
padding: 0 calc(50% - 380px);
:deep( .el-step ){
:deep( .el-step ) {
font-weight: bold;
:deep( .el-step__icon ){
:deep( .el-step__icon ) {
width: 24px;
height: 24px;
background: #fff;
@@ -211,7 +210,7 @@ export default {
}
}
:deep( .el-step__main ){
:deep( .el-step__main ) {
display: flex;
align-items: center;