update 征求意见流程

This commit is contained in:
赵霄
2023-12-07 13:56:01 +08:00
parent 019ccfc363
commit 8aa45a66f5
9 changed files with 864 additions and 16 deletions
+22 -1
View File
@@ -94,6 +94,20 @@ const enStandardStartUseReject = (params) => postAction('/process/es/enable/reje
// 根据id查询流程数据--办理
const enStandardStartUseGetDataById = (taskId, params) => getAction(`/process/es/enable/handle/${taskId}`, params)
/* 标准征求意见流程 */
// 查询流程详情
const queryConsultationProcessDetail = (params) => getAction('/process/fb/processFbStandardConsultation/queryProcessInfoVO', params)
// 提交
const submitConsultationProcess = (params) => postAction('/process/fb/processFbStandardConsultation/submit', params)
// 转办
const transferConsultationProcess = (params) => postAction('/process/fb/processFbStandardConsultation/transfer', params)
// 保存
const saveConsultationProcess = (params) => postAction('/process/fb/processFbStandardConsultation/saveToDraft', params)
// 同意
const agreeConsultationProcess = (params) => postAction('/process/fb/processFbStandardConsultation/agree', params)
// 驳回
const rejectConsultationProcess = (params) => postAction('/process/fb/processFbStandardConsultation/reject', params)
export {
queryPermissionsByUser,
getFormDictTreeList,
@@ -134,5 +148,12 @@ export {
enStandardStartUseTurnTo,
enStandardStartUseAgree,
enStandardStartUseReject,
enStandardStartUseGetDataById
enStandardStartUseGetDataById,
queryConsultationProcessDetail,
submitConsultationProcess,
transferConsultationProcess,
saveConsultationProcess,
agreeConsultationProcess,
rejectConsultationProcess
}
+5
View File
@@ -122,4 +122,9 @@
font-size: 0.24rem;
font-weight: 400;
}
}
/* ant表单样式 */
.ant-form-item {
font-size: 0.24rem;
}
+29 -1
View File
@@ -35,6 +35,8 @@ module.exports = {
standardName: '标准名称',
serialNumber: '序号',
pleaseEnterRemarks: '请填写备注',
dispatchInformation: '业务分派信息',
clickToUpload: '点击上传',
// 标准法规入库/变更流程
standardEntryOrChange: {
source: '来源',
@@ -118,6 +120,32 @@ module.exports = {
standardConsultation: {
standardText: '标准文本',
relevantDocument: '相关文件',
closingDateForComments: '征求意见结束日期'
closingDateForComments: '征求意见结束日期',
senderType: '下发人员类型',
moduleOwner: '模块负责人',
designEngineer: '设计工程师',
solicitationList: '征求意见列表',
chapterNumber: '章节编号',
chapterName: '章节名称',
contentOfRevisedOpinion: '修改意见内容',
beforeModification: '修改前',
afterModification: '修改后',
reasonForModification: '修改理由',
opinion: '意见',
basisDescription: '依据描述',
supportingMaterial: '佐证材料'
},
uploadFile: {
clickUpload: '点击上传',
viewUploadedFiles: '查看已上传文件',
clickOrDragUpload: '将文件拖到此处或点击上传',
uploadFailed: '上传失败',
cannotPreview: '该文件类型不支持预览',
cannotUploadEmpty: '不能上传空文件',
maxSize: '文件大小限制为500M',
onlyUploadPic: '请上传图片',
pleaseUpload: '请上传',
theFollowingDocuments: 'M以下文件',
file: '文件'
}
}
+11 -1
View File
@@ -123,7 +123,17 @@ module.exports = {
closingDateForComments: '征求意见结束日期',
senderType: '下发人员类型',
moduleOwner: '模块负责人',
designEngineer: '设计工程师'
designEngineer: '设计工程师',
solicitationList: '征求意见列表',
chapterNumber: '章节编号',
chapterName: '章节名称',
contentOfRevisedOpinion: '修改意见内容',
beforeModification: '修改前',
afterModification: '修改后',
reasonForModification: '修改理由',
opinion: '意见',
basisDescription: '依据描述',
supportingMaterial: '佐证材料'
},
uploadFile: {
clickUpload: '点击上传',
+291
View File
@@ -0,0 +1,291 @@
<template>
<a-table v-bind="$attrs" v-on="$listeners">
<!-- 如果插槽是作用域插槽将作用域插槽的props包装成对象传递给slot -->
<template v-for="(_, slotName) in $scopedSlots" :slot="slotName" slot-scope="text, record, index">
<slot :name="slotName" v-bind="{text, record, index}" />
</template>
<!-- 如果是普通插槽直接使用$slots渲染 -->
<slot v-for="(_, slotName) in $slots" :name="slotName" :slot="slotName" />
<!-- 表格扩展插槽 -->
<div slot="expandedRowRender" slot-scope="record, index" style="margin: 0">
<!-- 如果表单会依赖某个字段变化就需要加判断循环判断extraForm中的表单 -->
<template v-if="formIsDepend">
<template v-for="(value, key) in extraForm">
<template v-if="record[formIsDepend] === key">
<template v-if="allDisabled">
<div class="form-item" v-for="form in value.formArr" :key="form.dbFieldName">
<label class="form-item-label">{{ form.dbFieldTxt }}</label>
<file-display class="form-item-wrap" :file-ids="record[form.dbFieldName]" v-if="form.fieldShowType === 2" />
<div v-else class="form-item-wrap">{{ record[form.dbFieldName] }}</div>
</div>
</template>
<a-form-model v-else :key="key" :model="record" :rules="value.rules" :ref="`ruleForm${index}`" layout="horizontal">
<a-form-model-item v-for="form in value.formArr"
:key="form.dbFieldName"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
:label="form.dbFieldTxt"
:prop="form.dbFieldName">
<template v-if="form.fieldShowType === 1">
<a-input
autoSize
type="textarea"
:maxLength="500"
:placeholder="$t('pleaseEnter')+form.dbFieldTxt"
:disabled="allDisabled || form.isDisabled || false"
v-model="record[form.dbFieldName]" />
</template>
<template v-else-if="form.fieldShowType === 2">
<file-display :file-ids="record[form.dbFieldName]" />
</template>
<template v-else-if="form.fieldShowType === 3">
{{ record[form.dbFieldName] }}
</template>
<template v-else-if="form.fieldShowType === 4">
<a-input
autoSize
:maxLength="50"
:placeholder="$t('pleaseEnter')+form.dbFieldTxt"
:disabled="allDisabled || form.isDisabled || false"
v-model="record[form.dbFieldName]" />
</template>
</a-form-model-item>
</a-form-model>
</template>
</template>
</template>
<!-- 没有依赖的字段就直接把传入的extraForm数组渲染成表单 -->
<template v-else>
<a-form-model :model="record" :rules="extraForm.rules" :ref="`ruleForm${index}`">
<a-form-model-item v-for="form in extraForm.formArr"
:key="form.dbFieldName"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
:label="form.dbFieldTxt"
:prop="form.dbFieldName">
<template v-if="form.fieldShowType === 1">
<a-input
autoSize
type="textarea"
:maxLength="500"
:disabled="allDisabled || form.isDisabled || false"
:placeholder="$t('pleaseEnter')+form.dbFieldTxt"
v-model="record[form.dbFieldName]" />
</template>
<template v-else-if="form.fieldShowType === 2">
<file-display :file-ids="record[form.dbFieldName]" />
</template>
<template v-else-if="form.fieldShowType === 3">
{{ record[form.dbFieldName] }}
</template>
<template v-else-if="form.fieldShowType === 4">
<a-input
autoSize
:maxLength="50"
:placeholder="$t('pleaseEnter')+form.dbFieldTxt"
:disabled="allDisabled || form.isDisabled || false"
v-model="record[form.dbFieldName]" />
</template>
</a-form-model-item>
</a-form-model>
</template>
</div>
</a-table>
</template>
<!--
使用方法:
html:
<j-expand-table :formIsDepend="formIsDepend" :extraForm="extraForm"></j-expand-table>
1如果扩展中的表单会根据某个字段变化就传formIsDepend=随之变化的字段名extraForm就传
extraForm: {
1: { // 1表示formIsDepend对应的字段值是1
rules: { // formIsDepend对应的字段值是1时的表单验证
desc: { required: true, message: '请输入依据描述', trigger: 'blur' },
...
},
formArr: [// formIsDepend对应的字段值是1时的表单数据
{
fieldShowType: 1,
dbFieldTxt: this.$t(''), // 标签文本
dbFieldName: 'desc', // dataSource中对应的字段名
isDisabled: true // false的话可以不传
},
...
]
},
},
2如果扩展中的表单是固定的extraForm就传
extraForm: {
rules: {
desc: { required: false, message: '请输入依据描述', trigger: 'blur' },
...
},
formArr: [
{
fieldShowType: 1,
dbFieldTxt: this.$t(''), // 标签文本
dbFieldName: 'desc', // dataSource中对应的字段名
isDisabled: true // false的话可以不传
},
...
]
}
3提交时调用该组件中的submit方法获取返回值
返回值为false说明没有通过表单校验为true说明通过了校验直接通过绑定的dataSource获取数据即可示例如下
// 获取表格扩展部分的校验结果
const result = this.$refs.jExpandTable.submit()
if (result) {
// 每个表单校验都通过了
console.log('通过了', this.dataSource)
} else {
// 有表单没有通过
this.$message.warning('请输入必填项')
}
-->
<script>
import FileDisplay from './FileDisplay'
export default {
name: 'ZExpandTable',
components: { FileDisplay },
props: {
/**
* 扩展区表单, 表单需要依赖某个字段判断的就用对象,key是字段对应值,value是字段值对应下的表单数组
* 表单数组格式如下:
* [
* {
* fieldShowType: // 字段类型: 1,多行文本;2, 上传文件; 3, 日期选择; 4, 单行文本,
* dbFieldTxt: // 标签文本,例如:依据描述,
* dbFieldName: // 字段名
* isDisabled: // 是否可编辑
* }
* ]
*/
extraForm: {
type: Object,
default: () => {
return {}
}
},
/**
* 表单是否有依赖,传false或者依赖字段名
*/
formIsDepend: {
type: [Boolean, String],
default: false
},
// 全部禁用
allDisabled: {
type: Boolean,
required: false,
default: false
}
},
data () {
return {
labelCol: {
sm: 4
},
wrapperCol: {
sm: 16
}
}
},
methods: {
submit () {
const arr = []
for (const i in this.dataSource) {
if (this.$refs[`ruleForm${i}`] && this.$refs[`ruleForm${i}`][0]) {
this.$refs[`ruleForm${i}`][0].validate(valid => {
arr[i] = valid
})
} else {
// arr[i] = false
// 表单都没有渲染,说明没有展开过,也就是未填状态
if (this.formIsDepend) {
if (this.dataSource[i][this.formIsDepend]) {
// 需要依赖某个字段,获取当前行该字段时,扩展表单是否有必填项
// console.log(this.dataSource[i])
// console.log(this.extraForm[this.dataSource[i][this.formIsDepend]])
const currRowExtraFormFormArr = this.extraForm[this.dataSource[i][this.formIsDepend]].formArr
const currRowExtraFormRules = this.extraForm[this.dataSource[i][this.formIsDepend]].rules
let isHaveRequired = false
for (const item of currRowExtraFormFormArr) {
if (currRowExtraFormRules[item.dbFieldName].required === true && !this.dataSource[i][item.dbFieldName]) {
// 有必填但没有填内容
isHaveRequired = true
}
}
// for (const item in currRowExtraFormRules) {
// if (currRowExtraFormRules[item].required === true) {
// // 有任意一个字段有必填,但没有内容
// isHaveRequired = true
// }
// }
if (isHaveRequired) {
// 任意一个字段有必填,她又没展开过,校验不通过
arr[i] = false
} else {
arr[i] = true
}
} else {
// 依赖的字段都没有填
arr[i] = false
}
} else {
// 没有依赖的字段
let isHaveRequired = false
for (const item of this.extraForm.formArr) {
if (this.extraForm.rules[item.dbFieldName].required === true && !this.dataSource[i][item.dbFieldName]) {
// 有字段有必填,但没有内容
isHaveRequired = true
}
}
// for (const item in this.extraForm.rules) {
// if (this.extraForm.rules[item].required === true) {
// // 有任意一个字段有必填
// isHaveRequired = true
// }
// }
if (isHaveRequired) {
// 任意一个字段有必填,她又没展开过,校验不通过
arr[i] = false
} else {
arr[i] = true
}
}
}
}
console.log(arr)
if (arr.includes(false)) {
return false
} else {
return true
}
}
}
}
</script>
<style scoped lang="less">
@import '~@/assets/less/common.less';
.form-item {
display: flex;
margin-bottom: 0.24rem;
&-label {
margin-right: 0.2rem;
}
&-wrap {
flex: 1;
word-break: break-word;
width: 0;
}
}
</style>
+12
View File
@@ -108,3 +108,15 @@ export const SenderType = {
moduleOwner: { text: '模块负责人', value: '1' },
designEngineer: { text: '设计工程师', value: '2' }
}
// 标准征求意见流程
export const ConsultationProcess = new EsEnums({
initiate: { text: '法规工程师发起', value: 'engineer_start', btn: ['save', 'submit'] },
distribute: { text: '各部所主管级领导分发', value: 'depart_leader_start', btn: ['return', 'save', 'submit'] },
moduleOwnerDistribution: { text: '模块负责人分发', value: 'module_owner_start', btn: ['return', 'save', 'submit'] },
designEngineerFillIn: { text: '设计工程师填写', value: 'design_engineer', btn: ['return', 'save', 'submit'] },
moduleOwnerSummary: { text: '模块负责人汇总', value: 'module_owner_end', btn: ['return', 'save', 'submit'] },
leaderApproval: { text: '各部所主管级领导审批', value: 'depart_leader_end', btn: ['return', 'agree', 'reject'] },
leaderSummary: { text: '各部所主管级领导汇总', value: 'depart_leader_collect', btn: ['return', 'save', 'submit'] },
regulatoryEngineerApproval: { text: '法规工程师审批', value: 'engineer_end', btn: ['return', 'agree', 'reject'] }
})
+5 -1
View File
@@ -15,7 +15,7 @@ import { ACCESS_TOKEN, USER_INFO } from '@/store/mutation-types'
import './permission'
import './assets/font/iconfont.css'
import { Table } from 'ant-design-vue'
import { Table, FormModel, Input, Row, Col } from 'ant-design-vue'
import 'ant-design-vue/dist/antd.css'
import Viewer from 'v-viewer'
@@ -27,6 +27,10 @@ Vue.use(Vant)
Vue.use(VueI18n)
Vue.prototype.$message = Toast
Vue.use(Table)
Vue.use(FormModel)
Vue.use(Input)
Vue.use(Row)
Vue.use(Col)
Vue.use(Viewer)
Viewer.setDefaults({
@@ -1,5 +1,5 @@
<template>
<process-common-layout class="page-box" :loading="loading">
<process-common-layout class="page-box" :loading="loading" :process-key="ProcessKey.CONSULTATION.value" ref="personInfo">
<template v-slot:process>
<!--流程信息-->
<div class="process-part">
@@ -68,7 +68,7 @@
rows="1"
:placeholder="$t('pleaseEnter')+$t('standardConsultation.standardText')"
:border="false">
<file-display :file-ids="basicInfo.standardTextFileId" />
<file-display slot="input" :file-ids="basicInfo.standardTextFileId" />
</van-field>
<!--相关文件-->
<van-field v-model="basicInfo.relatedFile"
@@ -79,7 +79,7 @@
rows="1"
:placeholder="$t('pleaseEnter')+$t('standardConsultation.relevantDocument')"
:border="false">
<file-display :file-ids="basicInfo.relatedFile" />
<file-display slot="input" :file-ids="basicInfo.relatedFile" />
</van-field>
<!--征求意见结束日期-->
<van-field v-model="basicInfo.consultationDueDate"
@@ -94,11 +94,12 @@
</div>
<!--业务分派信息-->
<div class="process-part">
<div class="process-part" v-if="isDepartLeaderDistribute || isModuleOwnerDistribute">
<div class="process-part-title">{{ $t('dispatchInformation') }}</div>
<van-form input-align="right">
<van-form input-align="right" ref="dispatchInfoForm">
<!--下发人员类型-->
<picker-dict-field
v-if="isDepartLeaderDistribute"
:label="$t('standardConsultation.senderType')"
:placeholder="$t('pleaseSelect') + $t('standardConsultation.senderType')"
dict-code="sender_type"
@@ -107,14 +108,30 @@
<!--模块负责人-->
<select-user-field v-model="dispatchInfo.moduleOwnerId"
:label="$t('standardConsultation.moduleOwner')"
v-if="dispatchInfo.userType === SenderType.moduleOwner.value" />
v-if="isDepartLeaderDistribute && dispatchInfo.userType === SenderType.moduleOwner.value"
:rules="rules.moduleOwnerId" />
<!--设计工程师-->
<select-user-field v-model="dispatchInfo.designEngineerId"
:label="$t('standardConsultation.designEngineer')"
v-if="dispatchInfo.userType === SenderType.designEngineer.value" />
v-if="(isDepartLeaderDistribute && dispatchInfo.userType === SenderType.designEngineer.value) || isModuleOwnerDistribute"
:rules="rules.designEngineerId" />
</van-form>
</div>
<!--征求意见列表-->
<div class="process-part" v-if="isDepartLeaderApproval || isRegulatoryEngineerApproval">
<div class="process-part-title">{{ $t('standardConsultation.solicitationList') }}</div>
<z-expand-table :columns="columns"
:dataSource="dataSource"
bordered
:pagination="false"
:scroll="{x: '100%'}"
form-is-depend="isAdopt"
:extra-form="extraForm"
:all-disabled="true">
</z-expand-table>
</div>
<!--流程审批信息-->
<div class="process-part">
<div class="process-part-title">{{ $t('processApprovalInfo') }}</div>
@@ -136,6 +153,46 @@
</van-form>
</div>
</template>
<template v-slot:operation>
<!--转办-->
<van-button class="operation-common-btn" @click="handleTurnTo" v-if="btnList.includes('return')">
<template #icon>
<van-icon class="iconfont" class-prefix="icon" name="xunhuan" />
</template>
{{ $t('turnTo') }}
</van-button>
<!--保存-->
<van-button class="operation-common-btn light-color-button" @click="handleSave" v-if="btnList.includes('save')">
<template #icon>
<van-icon class="iconfont" class-prefix="icon" name="baocun" />
</template>
{{ $t('save') }}
</van-button>
<!--提交-->
<van-button icon="revoke" class="operation-common-btn" type="primary" @click="handleSubmit" v-if="btnList.includes('submit')">
<template #icon>
<van-icon class="iconfont" class-prefix="icon" name="check" />
</template>
{{ $t('submit') }}
</van-button>
<!--同意-->
<van-button icon="revoke" class="operation-common-btn" type="primary" @click="handleAgree" v-if="btnList.includes('agree')">
<template #icon>
<van-icon class="iconfont" class-prefix="icon" name="check" />
</template>
{{ $t('agree') }}
</van-button>
<!--驳回-->
<van-button icon="revoke" class="operation-common-btn light-color-button" @click="handleReject" v-if="btnList.includes('reject')">
<template #icon>
<van-icon class="iconfont" class-prefix="icon" name="close" />
</template>
{{ $t('reject') }}
</van-button>
</template>
<select-user ref="selectUser" @selected-change="continueTurnTo" />
</process-common-layout>
</template>
@@ -143,16 +200,27 @@
import ProcessCommonLayout from '../../../components/ProcessCommonLayout'
import FileDisplay from '../../../components/FileDisplay'
import PickerDictField from '../../../components/PickerDictField'
import { SenderType } from '../../../enums/commonEnums'
import { SenderType, ProcessKey, ConsultationProcess } from '../../../enums/commonEnums'
import SelectUserField from '../../../components/SelectUserField'
import ZUpload from '../../../components/ZUpload'
import {
queryConsultationProcessDetail,
transferConsultationProcess,
saveConsultationProcess,
submitConsultationProcess,
agreeConsultationProcess,
rejectConsultationProcess
} from '../../../api/api'
import SelectUser from '../../../components/SelectUser'
import ZExpandTable from '../../../components/ZExpandTable'
export default {
name: 'StandardConsultationProcess',
components: { ZUpload, SelectUserField, PickerDictField, ProcessCommonLayout, FileDisplay },
components: { SelectUser, ZUpload, SelectUserField, PickerDictField, ProcessCommonLayout, FileDisplay, ZExpandTable },
data () {
return {
SenderType,
ProcessKey,
loading: false,
processInfo: {}, // 流程信息数据
businessId: null,
@@ -160,11 +228,418 @@ export default {
dispatchInfo: {}, // 业务分派信息数据
approvalInfo: {}, // 流程审批信息数据
rules: {
userType: [{ required: true, message: this.$t('pleaseSelect') + this.$t('standardConsultation.senderType'), trigger: 'onChange' }]
userType: [{ required: true, message: this.$t('pleaseSelect') + this.$t('standardConsultation.senderType'), trigger: 'onChange' }],
moduleOwnerId: [{
required: true,
message: this.$t('pleaseSelect') + this.$t('standardConsultation.moduleOwner'),
trigger: 'onChange'
}],
designEngineerId: [{
required: true,
message: this.$t('pleaseSelect') + this.$t('standardConsultation.designEngineer'),
trigger: 'onChange'
}],
handleText: [{ required: false, message: this.$t('pleaseEnter') + this.$t('remark'), trigger: 'onBlur' }]
},
currentNode: null,
nodeEnumsKey: null, // 当前节点对应枚举的key
btnList: [], // 显示的按钮
columns: [
// 序号
{
title: this.$t('serialNumber'),
dataIndex: '',
key: 'rowIndex',
align: 'center',
width: 80,
customRender: function (t, r, index) {
return parseInt(index) + 1
}
},
{ // 章节编号
title: this.$t('standardConsultation.chapterNumber'),
width: 180,
align: 'center',
dataIndex: 'chapterNumber',
scopedSlots: { customRender: 'text' }
},
{ // 章节名称
title: this.$t('standardConsultation.chapterName'),
width: 180,
align: 'center',
dataIndex: 'chapterName',
scopedSlots: { customRender: 'text' }
},
{ // 修改意见内容
title: this.$t('standardConsultation.contentOfRevisedOpinion'),
children: [
{ // 修改前
title: this.$t('standardConsultation.beforeModification'),
align: 'center',
width: 180,
dataIndex: 'modificationBefore',
scopedSlots: { customRender: 'text' }
},
{ // 修改后
title: this.$t('standardConsultation.afterModification'),
align: 'center',
width: 180,
dataIndex: 'modificationAfter',
scopedSlots: { customRender: 'text' }
},
{ // 修改理由
title: this.$t('standardConsultation.reasonForModification'),
align: 'center',
width: 180,
dataIndex: 'modificationReason',
scopedSlots: { customRender: 'text' }
}
]
},
{ // 设计工程师
title: this.$t('standardConsultation.designEngineer'),
width: 180,
align: 'center',
dataIndex: 'designEngineerName',
scopedSlots: { customRender: 'text' }
},
{ // 意见
title: this.$t('standardConsultation.moduleOwner') + this.$t('standardConsultation.opinion'),
width: 180,
align: 'center',
dataIndex: 'isAdopt_dictText',
scopedSlots: { customRender: 'text' }
}
],
dataSource: [],
extraForm: {
// 采纳
'1': {
rules: {
// 依据描述
basisDescription: {
required: false,
message: this.$t('pleaseEnter') + this.$t('standardConsultation.basisDescription'),
trigger: 'blur'
},
// 佐证材料
basisFile: {
required: false,
message: this.$t('pleaseUpload') + this.$t('standardConsultation.supportingMaterial'),
trigger: 'change'
}
},
formArr: [
{
fieldShowType: 1,
dbFieldTxt: this.$t('standardConsultation.basisDescription'),
dbFieldName: 'basisDescription'
},
{
fieldShowType: 2,
dbFieldTxt: this.$t('standardConsultation.supportingMaterial'),
dbFieldName: 'basisFile',
fileType: 'pdf,doc,docx,pptx,ppt,jpg,jpeg,png,xls,xlsx,bmp'
}
]
},
// 部分采纳
'2': {
rules: {
// 依据描述
basisDescription: {
required: false,
message: this.$t('pleaseEnter') + this.$t('standardConsultation.basisDescription'),
trigger: 'blur'
},
// 佐证材料
basisFile: {
required: false,
message: this.$t('pleaseUpload') + this.$t('standardConsultation.supportingMaterial'),
trigger: 'change'
}
},
formArr: [
{
fieldShowType: 1,
dbFieldTxt: this.$t('standardConsultation.basisDescription'),
dbFieldName: 'basisDescription'
},
{
fieldShowType: 2,
dbFieldTxt: this.$t('standardConsultation.supportingMaterial'),
dbFieldName: 'basisFile',
fileType: 'pdf,doc,docx,pptx,ppt,jpg,jpeg,png,xls,xlsx,bmp'
}
]
},
// 不采纳
'3': {
rules: {
// 依据描述
basisDescription: {
required: true,
message: this.$t('pleaseEnter') + this.$t('standardConsultation.basisDescription'),
trigger: 'blur'
},
// 佐证材料
basisFile: {
required: false,
message: this.$t('pleaseUpload') + this.$t('standardConsultation.supportingMaterial'),
trigger: 'change'
}
},
formArr: [
{
fieldShowType: 1,
dbFieldTxt: this.$t('standardConsultation.basisDescription'),
dbFieldName: 'basisDescription'
},
{
fieldShowType: 2,
dbFieldTxt: this.$t('standardConsultation.supportingMaterial'),
dbFieldName: 'basisFile',
fileType: 'pdf,doc,docx,pptx,ppt,jpg,jpeg,png,xls,xlsx,bmp'
}
]
}
}
}
},
methods: {}
computed: {
// 是否各部所主管级领导分发
isDepartLeaderDistribute () {
return this.currentNode.indexOf(ConsultationProcess.distribute.value) === 0
},
// 是否模块负责人分发
isModuleOwnerDistribute () {
return this.currentNode.indexOf(ConsultationProcess.moduleOwnerDistribution.value) === 0
},
// 是否各部所主管级领导审批
isDepartLeaderApproval () {
return this.currentNode.indexOf(ConsultationProcess.leaderApproval.value) === 0
},
// 是否法规工程师审批
isRegulatoryEngineerApproval () {
return this.currentNode.indexOf(ConsultationProcess.regulatoryEngineerApproval.value) === 0
}
},
created () {
this.currentNode = this.$route.query.nodeId
this.initProcessData()
// 找不到这个节点默认使用审批节点页面及按钮,发起除外
this.nodeEnumsKey = this.currentNode ? ConsultationProcess.keyOfValueByLike(this.currentNode) || 'regulatoryEngineerApproval' : 'initiate'
this.btnList = ConsultationProcess[this.nodeEnumsKey].btn
},
methods: {
initProcessData () {
this.loading = true
const params = {
taskId: this.$route.query.taskId,
processInstanceId: this.$route.query.processInstanceId
}
queryConsultationProcessDetail(params).then(res => {
if (res.success) {
const { result } = res
this.businessId = result.businessId
// 处理流程信息
this.processInfo = Object.assign({}, result.basicProcessInfoDTO || {})
// 流程审批信息
this.approvalInfo = Object.assign({}, result.basicTaskInfoDTO || {})
this.approvalInfo.taskId = this.approvalInfo.taskId || this.$route.query.taskId
// 业务基本信息
this.basicInfo = Object.assign({}, result.businessInfoDTO.processFbStandardConsultation || {})
// 业务分派信息
this.dispatchInfo = Object.assign({}, result.businessInfoDTO.processFbConsultationUserLink || {})
// 征求意见列表
this.dataSource = result.businessInfoDTO.processFbConsultationLists || []
} else {
this.$message(res.message)
}
}).finally(() => {
this.loading = false
})
},
/**
* 转办
*/
handleTurnTo () {
this.$refs.selectUser.open()
},
continueTurnTo (value) {
const params = {
taskId: this.$route.query.taskId,
userId: value
}
this.loading = true
transferConsultationProcess(params).then(res => {
this.$message(res.message)
if (res.success) {
this.goBack()
}
}).finally(() => {
this.loading = false
})
},
async dealFormData (isSave) {
// 提交的表单数据,流程信息,流程审批信息,征求意见列表,业务分派信息,业务基本信息
let formData = {}, processInfo = {}, approvalInfo = {}, consultationListData = [], dispatchInfo = {}, basicServiceInfo = {},
userInfoMap = {}, flag = true
// 流程信息
processInfo = { ...this.processInfo }
// 业务基本信息
basicServiceInfo = { ...this.basicInfo }
// 业务分派信息
if (isSave) {
dispatchInfo = { ...this.dispatchInfo }
} else {
const checkResult = await this.validateForm('dispatchInfoForm')
if (checkResult) {
dispatchInfo = { ...this.dispatchInfo }
} else {
flag = false
}
}
// 流程审批信息
if (isSave) {
approvalInfo = { ...this.approvalInfo }
} else {
const checkResult = await this.validateForm('approvalForm')
if (checkResult) {
approvalInfo = { ...this.approvalInfo }
} else {
flag = false
}
}
// 处理人员信息
const userInfo = this.$refs.personInfo.getDataObjVerify()
if (!userInfo) {
flag = false
} else {
userInfoMap = userInfo
}
// 征求意见列表
consultationListData = this.dataSource || []
if (!flag) {
return false
}
formData = {
businessId: this.businessId,
basicProcessInfoDTO: processInfo,
basicTaskInfoDTO: approvalInfo,
businessInfoDTO: {
processFbStandardConsultation: basicServiceInfo,
processFbConsultationUserLink: dispatchInfo,
processFbConsultationLists: consultationListData
},
userInfoMap
}
return formData
},
validateForm (formName) {
let flag = true
return new Promise(resolve => {
if (this.$refs[formName]) {
this.$refs[formName].validate().then(() => {
}).catch(() => {
flag = false
}).finally(() => {
resolve(flag)
})
} else {
resolve(flag)
}
})
},
/**
* 保存
* @returns {Promise<void>}
*/
async handleSave () {
const formData = await this.dealFormData(true)
if (!formData) {
return
}
this.loading = true
saveConsultationProcess(formData).then(res => {
this.$message(res.message)
if (res.success) {
this.goBack()
}
}).finally(() => {
this.loading = false
})
},
/**
* 提交
* @returns {Promise<void>}
*/
async handleSubmit () {
const formData = await this.dealFormData()
if (!formData) {
return
}
this.loading = true
submitConsultationProcess(formData).then(res => {
this.$message(res.message)
if (res.success) {
this.goBack()
}
}).finally(() => {
this.loading = false
})
},
/**
* 同意
* @returns {Promise<void>}
*/
async handleAgree () {
this.rules.handleText[0].required = false
if (!this.approvalInfo.handleText) {
this.approvalInfo.handleText = '同意'
}
const formData = await this.dealFormData()
if (!formData) {
return
}
this.loading = true
agreeConsultationProcess(formData).then(res => {
this.$message(res.message)
if (res.success) {
this.goBack()
}
}).finally(() => {
this.loading = false
})
},
/**
* 驳回
* @returns {Promise<void>}
*/
async handleReject () {
this.rules.handleText[0].required = true
const formData = await this.dealFormData()
console.log(formData)
if (!formData) {
return
}
rejectConsultationProcess(formData).then(res => {
this.$message(res.message)
if (res.success) {
this.goBack()
}
}).finally(() => {
this.loading = false
})
},
goBack () {
let timer = setTimeout(() => {
clearTimeout(timer)
timer = null
this.$router.go(-1)
}, 700)
}
}
}
</script>
@@ -326,7 +326,9 @@ export default {
*/
handleAgree () {
this.rules.handleText[0].required = false
this.approvalInfo.handleText = '同意'
if (!this.approvalInfo.handleText) {
this.approvalInfo.handleText = '同意'
}
const formData = this.dealFormData()
if (!formData) {
return