This commit is contained in:
yanran200730
2022-04-06 11:59:14 +08:00
parent 7c413fa9b2
commit e67d711db3
6 changed files with 397 additions and 1099 deletions

View File

@@ -14,7 +14,7 @@
</template>
</ai-list>
<component v-else :is="currentComp" :instance="instance" :dict="dict"
:processType="currentTab.value" :row="row"></component>
:processType="currentTab.value" :row="row" @back="back" ></component>
</section>
</template>
@@ -59,6 +59,10 @@ export default {
this.row = params.row
this.currentComp = params.comp
this.$router.push({query: {processType: this.currentTab.value}})
},
back () {
this.$router.push({query: {}})
}
},
created() {

View File

@@ -1,5 +1,5 @@
<template>
<div class="add-config" :class="[activeStep == 1 ? 'formLayout' : '']">
<div class="add-config">
<ai-detail>
<ai-title slot="title" :title="detailTitle" isShowBack isShowBottomBorder @onBackClick="handleBack"/>
<template slot="step">
@@ -11,7 +11,7 @@
</template>
<template #content v-if="refresh">
<baseInfo ref="baseInfo" :instance="instance" :dict="dict" v-show="activeStep==0"/>
<applyForm ref="applyForm" :value="filedList" :instance="instance" :dict="dict" v-show="activeStep==1"/>
<applyForm ref="applyForm" :instance="instance" :dict="dict" v-show="activeStep==1"/>
<attachmentMaterial ref="attachmentMaterial" :instance="instance" v-show="activeStep==2"/>
<processApproval ref="processApproval" :approvalSteps="applyForm.approvalSteps" :instance="instance"
:dict="dict" v-show="activeStep==3"/>
@@ -39,8 +39,7 @@ export default {
props: {
instance: Function,
dict: Object,
row: Object,
processType: String
row: Object
},
components: {baseInfo, applyForm, attachmentMaterial, processApproval},
data() {
@@ -52,12 +51,8 @@ export default {
approvalSteps: "",
},
processAnnexDefs: [],
detailObj: {
tableInfo: {}
},
refresh: true,
filedList: [],
tableFieldInfos: []
detailObj: {},
refresh: true
}
},
computed: {
@@ -89,12 +84,12 @@ export default {
this.handleBaseInfo()
break
case 1:
this.$refs['applyForm'].onConfirm().then(res => {
if (!res.length) {
return this.$message.error('表单配置不能为空')
}
this.tableFieldInfos = res
this.$refs['applyForm'].handleApplyForm().then(ret => {
this.applyForm.tableId = ret.id
this.applyForm.approvalSteps = ret.approvalSteps.toString()
this.activeStep++
}).catch(err => {
console.error(err);
})
break
case 2:
@@ -110,7 +105,7 @@ export default {
handleBaseInfo() {
this.$refs['baseInfo'].banseInfoForm().then(res => {
if (res) {
// this.$refs['applyForm'].getFormList()
this.$refs['applyForm'].getFormList()
this.baseInfo = res
this.activeStep++
}
@@ -121,22 +116,19 @@ export default {
*/
save() {
this.$refs['processApproval'].handleProcessApproval().then(res => {
this.instance.post(`/app/approval-process-def/add-update`, {
this.instance.post(`/approval-process-def/add-update`, {
...this.detailObj,
...this.baseInfo,
processDefStatus: Number(this.baseInfo.processDefStatus),
tableInfo: {
...this.detailObj.tableInfo,
tableFieldInfos: this.tableFieldInfos
},
tableType: 0,
tableId: this.applyForm.tableId,
processType: 0,
tableType: 2,
processAnnexDefs: this.annexs.map(e => ({...e, mustFill: Number(e.mustFill)})),
processNodeList: res.processNodeList,
processType: this.processType
processNodeList: res.processNodeList
}).then(res => {
if (res.code == 0) {
this.$message.success("保存成功")
this.$router.push({query:{}})
this.$emit("back")
}
})
}).catch(err => {
@@ -144,10 +136,9 @@ export default {
})
},
getDetail(id) {
this.instance.post(`/app/approval-process-def/info-id`, null, {params: {id}}).then(res => {
this.instance.post(`/approval-process-def/info-id`, null, {params: {id}}).then(res => {
if (res?.data) {
this.detailObj = res.data
this.filedList = res.data.tableInfo.tableFieldInfos
this.refreshDetail()
}
})
@@ -162,12 +153,13 @@ export default {
this.$nextTick(() => this.refresh = true)
},
handleBack() {
this.$router.push({query: {}})
this.detailObj?.id && this.$router.push({query: {}})
this.$emit('back')
}
},
created() {
if (this.row?.id) {
this.getDetail(this.row?.id)
if (this.$route.query?.id) {
this.getDetail(this.$route.query?.id)
}
}
}
@@ -177,13 +169,8 @@ export default {
.add-config {
height: 100%;
&.formLayout {
::v-deep .ai-detail__content--wrapper {
max-width: 100%;
height: calc(100%)!important;
padding: 0!important;
overflow: hidden!important;
}
::v-deep .step .el-steps {
height: 72px;
}
.step {

View File

@@ -1,11 +1,11 @@
<template>
<div class="attachment-material">
<ai-card title="附件材料">
<template #right>
<ai-title title="附件材料">
<template slot="rightBtn">
<span class="iconfont iconAdd rightBtn"></span>
<span class="rightBtn" style="margin-left: 8px;" @click="dialog=true">新增行数</span>
</template>
<template #content>
</ai-title>
<el-table
:data="materialList"
stripe
@@ -39,9 +39,9 @@
<template slot-scope="scope">
<el-switch
v-model="scope.row.mustFill"
active-value="1" inactive-value="0"
active-color="#5088FF"
inactive-color="#D0D4DC">
active-value="0" inactive-value="1"
active-color="#D0D4DC"
inactive-color="#5088FF">
</el-switch>
</template>
</el-table-column>
@@ -52,8 +52,6 @@
</template>
</el-table-column>
</el-table>
</template>
</ai-card>
<ai-dialog
title="添加附件材料"
:visible.sync="dialog"

View File

@@ -1,7 +1,6 @@
<template>
<section class="base-info">
<ai-card title="基本信息">
<template #content>
<ai-title title="基本信息"/>
<el-form :model="form" :rules="rules" ref="baseInfoForm" label-suffix="" label-width="100px">
<el-form-item label="事项名称" prop="processName">
<el-input v-model.trim="form.processName" size="small" clearable placeholder="请输入事项名称" :maxlength="30"
@@ -21,8 +20,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="所属分类" prop="classificationId">
<el-select placeholder="请选择" size="small" v-model="form.classificationId" clearable
style="width: 100%;">
<el-select placeholder="请选择" size="small" v-model="form.classificationId" clearable style="width: 100%;">
<el-option
v-for="(item,i) in classList" :key="i"
:label="item.name"
@@ -37,18 +35,16 @@
placeholder="请输入天数" style="width: 270px;"/>
</el-form-item>
<el-form-item label="办理须知" prop="needToKnow">
<ai-editor v-model="form.needToKnow" :instance="instance" @validate="v=>valid=!v"/>
<ai-editor v-model.trim="form.needToKnow" :instance="instance"/>
</el-form-item>
<el-form-item label="是否启用" prop="processDefStatus">
<el-switch
v-model="form.processDefStatus"
active-color="#5088FF"
inactive-color="#D0D4DC" active-value="1" inactive-value="0">
active-color="#D0D4DC"
inactive-color="#5088FF" active-value="0" inactive-value="1">
</el-switch>
</el-form-item>
</el-form>
</template>
</ai-card>
</section>
</template>
@@ -79,27 +75,15 @@
classificationId: "",
timeLimit: "",
needToKnow: "",
processDefStatus: "1",
processDefStatus: false,
},
valid:true,
classList: [],
rules:{
processName: [{required: true, message: '请输入事项名称', trigger: 'blur'}],
department: [{required: true, message: '请选择所属部门', trigger: 'change'}],
classificationId: [{required: true, message: '请选择所属分类', trigger: 'change'}],
timeLimit: [{required: true,validator:validTimeLimit ,trigger: 'blur'}],
needToKnow: [
{required: true, message: '请输入办理须知', trigger: 'blur'},
{
validator: (r, v, cb) => {
if (this.valid) {
cb()
} else {
cb('字数超过限制')
}
}
}
],
needToKnow: [{required: true, message: '请输入办理须知', trigger: 'blur'}],
processDefStatus: [{required: true, message: '请选择是否启用', trigger: 'change'}],
}
}
@@ -120,12 +104,9 @@
* 获取分类
*/
getClassification() {
this.instance.post(`/app/zwspapprovalclassification/list`, null, {
params: {
this.instance.post(`/zwspapprovalclassification/list`, null, {
current: 1,
status: 1,
size: 9999
}
}).then(res => {
if (res?.data) {
this.classList = res.data.records
@@ -136,9 +117,7 @@
created() {
this.getClassification()
if (this.config.detailObj?.id) {
this.$nextTick(_=>{
Object.keys(this.form).map(e => this.form[e] = this.config.detailObj[e])
})
}
}
}

View File

@@ -44,10 +44,30 @@
</el-button>
</div>
</div>
<ai-wechat-selecter slot="append" :instance="instance" :props="{id:'wxUserId',label:'name'}"
<!-- <ai-wechat-selecter slot="append" :instance="instance" :props="{id:'wxUserId',label:'name'}"
v-model="item.candidateList" v-if="item.candidateApproverType==1">
<el-button size="mini" type="primary">选择指定人员</el-button>
</ai-wechat-selecter>
</ai-wechat-selecter> -->
<!-- <ai-user-picker :instance="instance" v-model="item.candidateList" v-if="item.candidateApproverType==1"/> -->
<!-- <ai-people :showAiArea="false" customCliker :instance="instance"
unitUrl="/admin/sysunit/getAll2"
:meta="[]" v-model="item.candidateList"
v-if="item.candidateApproverType==1">
<el-button size="mini" type="primary">选择指定人员</el-button>
</ai-people> -->
<!-- <ai-user-picker :instance="instance" v-model="form.portalUserId"/> -->
<ai-person-select
:chooseUserList="item.candidateList"
v-if="item.candidateApproverType==1"
:instance="instance" customRightText url="/user/page"
headerTitle="人员列表" dialogTitle="选择" :isMultiple="true"
@selectPerson="e => changeCharge(e, index)">
<template v-slot:option="{ item }">
<span class="iconfont iconProlife">{{ item.name }}</span>
<span>{{ item.phone }}</span>
</template>
</ai-person-select>
</div>
</el-step>
</el-steps>
@@ -130,6 +150,7 @@ export default {
bomIndex: '',
}
},
computed: {
addRules() {
return {
@@ -161,6 +182,10 @@ export default {
this.form.processNodeList.splice(index, 1)
})
},
changeCharge (e, i) {
this.$set(this.form.processNodeList[i], 'candidateList', e)
},
/**
* 添加流程
* @param index