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,59 +1,57 @@
<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>
<el-table
:data="materialList"
stripe
style="width: 100%"
header-cell-class-name="table-header"
align="center"
empty-text="材料列表信息为空点击标题右侧添加按钮进行添加"
>
<el-table-column align="left" prop="annexName" label="材料名称" width="280">
<template slot-scope="scope">
<div class="table-border">{{ scope.row.annexName }}</div>
</template>
</el-table-column>
<el-table-column align="center" prop="exampleFileId" label="样例">
<template slot-scope="{row}">
<el-upload action :on-exceed="list=>handleUpload({file:list[0]}).then(v=>row.exampleFileId=v)"
:http-request="args=>handleUpload(args).then(v=>row.exampleFileId=v)" :limit="1" accept=".jpg,.png">
<el-button style="width: 102px">{{ row.exampleFileId ? '重新选择图片' : '选择图片文件' }}</el-button>
</el-upload>
</template>
</el-table-column>
<el-table-column align="center" prop="emptyFileId" label="空表">
<template slot-scope="{row}">
<el-upload action :on-exceed="list=>handleUpload({file:list[0]}).then(v=>row.emptyFileId=v)"
:http-request="args=>handleUpload(args).then(v=>row.emptyFileId=v)" :limit="1" accept=".doc,.docx">
<el-button style="width: 102px">{{ row.emptyFileId ? '重新选择word' : '选择word文件' }}</el-button>
</el-upload>
</template>
</el-table-column>
<el-table-column align="center" prop="name" label="是否必填">
<template slot-scope="scope">
<el-switch
v-model="scope.row.mustFill"
active-value="1" inactive-value="0"
active-color="#5088FF"
inactive-color="#D0D4DC">
</el-switch>
</template>
</el-table-column>
<el-table-column align="center" label="操作">
<template slot-scope="scope">
<span class="iconfont iconEdit icon-color89B" title="编辑" @click="editInfo(scope.$index)" style="margin-right: 10px;"/>
<span class="iconfont iconDelete icon-color89B" title="删除" @click="deleteInfo(scope.$index)"/>
</template>
</el-table-column>
</el-table>
</template>
</ai-card>
</ai-title>
<el-table
:data="materialList"
stripe
style="width: 100%"
header-cell-class-name="table-header"
align="center"
empty-text="材料列表信息为空点击标题右侧添加按钮进行添加"
>
<el-table-column align="left" prop="annexName" label="材料名称" width="280">
<template slot-scope="scope">
<div class="table-border">{{ scope.row.annexName }}</div>
</template>
</el-table-column>
<el-table-column align="center" prop="exampleFileId" label="样例">
<template slot-scope="{row}">
<el-upload action :on-exceed="list=>handleUpload({file:list[0]}).then(v=>row.exampleFileId=v)"
:http-request="args=>handleUpload(args).then(v=>row.exampleFileId=v)" :limit="1" accept=".jpg,.png">
<el-button style="width: 102px">{{ row.exampleFileId ? '重新选择图片' : '选择图片文件' }}</el-button>
</el-upload>
</template>
</el-table-column>
<el-table-column align="center" prop="emptyFileId" label="空表">
<template slot-scope="{row}">
<el-upload action :on-exceed="list=>handleUpload({file:list[0]}).then(v=>row.emptyFileId=v)"
:http-request="args=>handleUpload(args).then(v=>row.emptyFileId=v)" :limit="1" accept=".doc,.docx">
<el-button style="width: 102px">{{ row.emptyFileId ? '重新选择word' : '选择word文件' }}</el-button>
</el-upload>
</template>
</el-table-column>
<el-table-column align="center" prop="name" label="是否必填">
<template slot-scope="scope">
<el-switch
v-model="scope.row.mustFill"
active-value="0" inactive-value="1"
active-color="#D0D4DC"
inactive-color="#5088FF">
</el-switch>
</template>
</el-table-column>
<el-table-column align="center" label="操作">
<template slot-scope="scope">
<span class="iconfont iconEdit icon-color89B" title="编辑" @click="editInfo(scope.$index)" style="margin-right: 10px;"/>
<span class="iconfont iconDelete icon-color89B" title="删除" @click="deleteInfo(scope.$index)"/>
</template>
</el-table-column>
</el-table>
<ai-dialog
title="添加附件材料"
:visible.sync="dialog"

View File

@@ -1,154 +1,133 @@
<template>
<section class="base-info">
<ai-card title="基本信息">
<template #content>
<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"
show-word-limit/>
<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"
show-word-limit/>
</el-form-item>
<el-row type="type" justify="space-between" :gutter="20">
<el-col :span="12">
<el-form-item label="所属部门" prop="department">
<el-select placeholder="请选择" size="small" v-model="form.department" clearable style="width: 100%;">
<el-option
v-for="(item,i) in dict.getDict('hbDepartment')" :key="i"
:label="item.dictName"
:value="item.dictValue">
</el-option>
</el-select>
</el-form-item>
<el-row type="type" justify="space-between" :gutter="20">
<el-col :span="12">
<el-form-item label="所属部门" prop="department">
<el-select placeholder="请选择" size="small" v-model="form.department" clearable style="width: 100%;">
<el-option
v-for="(item,i) in dict.getDict('hbDepartment')" :key="i"
:label="item.dictName"
:value="item.dictValue">
</el-option>
</el-select>
</el-form-item>
</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-option
v-for="(item,i) in classList" :key="i"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="办结时限" prop="timeLimit">
<el-input v-model.trim="form.timeLimit" oninput="value=value.replace(/[^\d]/g,'')" size="small" clearable
placeholder="请输入天数" style="width: 270px;"/>
</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-option
v-for="(item,i) in classList" :key="i"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="办理须知" prop="needToKnow">
<ai-editor v-model="form.needToKnow" :instance="instance" @validate="v=>valid=!v"/>
</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">
</el-switch>
</el-form-item>
</el-form>
</template>
</ai-card>
</el-col>
</el-row>
<el-form-item label="办结时限" prop="timeLimit">
<el-input v-model.trim="form.timeLimit" oninput="value=value.replace(/[^\d]/g,'')" size="small" clearable
placeholder="请输入天数" style="width: 270px;"/>
</el-form-item>
<el-form-item label="办理须知" prop="needToKnow">
<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="#D0D4DC"
inactive-color="#5088FF" active-value="0" inactive-value="1">
</el-switch>
</el-form-item>
</el-form>
</section>
</template>
<script>
export default {
name: "baseInfo",
inject: ['config'],
props: {
instance: Function,
dict: Object,
},
data() {
const validTimeLimit = (rule, value, callback) => {
if (!value) {
return callback(new Error('请输入办结时限'));
} else {
if (+value <= 0) {
return callback(new Error('最小值为1'));
}
callback();
export default {
name: "baseInfo",
inject: ['config'],
props: {
instance: Function,
dict: Object,
},
data() {
const validTimeLimit = (rule, value, callback) =>{
if(!value){
return callback(new Error('请输入办结时限'));
}else {
if(+value<=0){
return callback(new Error('最小值为1'));
}
}
return {
form: {
processName: "",
department: "",
classificationId: "",
timeLimit: "",
needToKnow: "",
processDefStatus: "1",
},
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('字数超过限制')
}
}
}
],
processDefStatus: [{required: true, message: '请选择是否启用', trigger: 'change'}],
}
}
},
methods: {
banseInfoForm() {
return new Promise((resolve, reject) => {
this.$refs['baseInfoForm'].validate(valid => {
if (valid) {
resolve(this.form)
} else {
reject(false)
}
})
})
},
/**
* 获取分类
*/
getClassification() {
this.instance.post(`/app/zwspapprovalclassification/list`, null, {
params: {
current: 1,
status: 1,
size: 9999
}
}).then(res => {
if (res?.data) {
this.classList = res.data.records
}
})
}
},
created() {
this.getClassification()
if (this.config.detailObj?.id) {
this.$nextTick(_=>{
Object.keys(this.form).map(e => this.form[e] = this.config.detailObj[e])
})
callback();
}
}
return {
form: {
processName: "",
department: "",
classificationId: "",
timeLimit: "",
needToKnow: "",
processDefStatus: false,
},
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'}],
processDefStatus: [{required: true, message: '请选择是否启用', trigger: 'change'}],
}
}
},
methods: {
banseInfoForm() {
return new Promise((resolve, reject) => {
this.$refs['baseInfoForm'].validate(valid => {
if (valid) {
resolve(this.form)
} else {
reject(false)
}
})
})
},
/**
* 获取分类
*/
getClassification() {
this.instance.post(`/zwspapprovalclassification/list`, null, {
current: 1,
size: 9999
}).then(res => {
if (res?.data) {
this.classList = res.data.records
}
})
}
},
created() {
this.getClassification()
if (this.config.detailObj?.id) {
Object.keys(this.form).map(e => this.form[e] = this.config.detailObj[e])
}
}
}
</script>
<style lang="scss" scoped>
.base-info {
.iconAudit {
font-size: 36px;
color: #3D94FB;
}
.base-info {
.iconAudit {
font-size: 36px;
color: #3D94FB;
}
}
</style>

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