From 8aa45a66f5a5e5a31fc584296b16027a3d837722 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=9C=84?= Date: Thu, 7 Dec 2023 13:56:01 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E5=BE=81=E6=B1=82=E6=84=8F=E8=A7=81?= =?UTF-8?q?=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/api.js | 23 +- src/assets/less/common.less | 5 + src/common/lang/en-us.js | 30 +- src/common/lang/zh-cn.js | 12 +- src/components/ZExpandTable.vue | 291 ++++++++++ src/enums/commonEnums.js | 12 + src/main.js | 6 +- .../StandardConsultationProcess.vue | 497 +++++++++++++++++- .../StandardEntryOrChangeProcess.vue | 4 +- 9 files changed, 864 insertions(+), 16 deletions(-) create mode 100644 src/components/ZExpandTable.vue diff --git a/src/api/api.js b/src/api/api.js index 9127aa4..a3ffbd0 100644 --- a/src/api/api.js +++ b/src/api/api.js @@ -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 } diff --git a/src/assets/less/common.less b/src/assets/less/common.less index c92f1c2..c49a2fb 100644 --- a/src/assets/less/common.less +++ b/src/assets/less/common.less @@ -122,4 +122,9 @@ font-size: 0.24rem; font-weight: 400; } +} + +/* ant表单样式 */ +.ant-form-item { + font-size: 0.24rem; } \ No newline at end of file diff --git a/src/common/lang/en-us.js b/src/common/lang/en-us.js index b89c706..901e5a5 100644 --- a/src/common/lang/en-us.js +++ b/src/common/lang/en-us.js @@ -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: '文件' } } diff --git a/src/common/lang/zh-cn.js b/src/common/lang/zh-cn.js index 994842c..942e4e5 100644 --- a/src/common/lang/zh-cn.js +++ b/src/common/lang/zh-cn.js @@ -123,7 +123,17 @@ module.exports = { closingDateForComments: '征求意见结束日期', senderType: '下发人员类型', moduleOwner: '模块负责人', - designEngineer: '设计工程师' + designEngineer: '设计工程师', + solicitationList: '征求意见列表', + chapterNumber: '章节编号', + chapterName: '章节名称', + contentOfRevisedOpinion: '修改意见内容', + beforeModification: '修改前', + afterModification: '修改后', + reasonForModification: '修改理由', + opinion: '意见', + basisDescription: '依据描述', + supportingMaterial: '佐证材料' }, uploadFile: { clickUpload: '点击上传', diff --git a/src/components/ZExpandTable.vue b/src/components/ZExpandTable.vue new file mode 100644 index 0000000..09c4610 --- /dev/null +++ b/src/components/ZExpandTable.vue @@ -0,0 +1,291 @@ + + + + + + + \ No newline at end of file diff --git a/src/enums/commonEnums.js b/src/enums/commonEnums.js index 70c3bcb..2bcdd24 100644 --- a/src/enums/commonEnums.js +++ b/src/enums/commonEnums.js @@ -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'] } +}) diff --git a/src/main.js b/src/main.js index 75b7e25..86c6fa8 100644 --- a/src/main.js +++ b/src/main.js @@ -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({ diff --git a/src/views/workCenter/standardConsultation/StandardConsultationProcess.vue b/src/views/workCenter/standardConsultation/StandardConsultationProcess.vue index e0f420a..dc018d6 100644 --- a/src/views/workCenter/standardConsultation/StandardConsultationProcess.vue +++ b/src/views/workCenter/standardConsultation/StandardConsultationProcess.vue @@ -1,5 +1,5 @@ @@ -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} + */ + 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} + */ + 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} + */ + 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} + */ + 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) + } + } } diff --git a/src/views/workCenter/standardEntryOrChangeProcess/StandardEntryOrChangeProcess.vue b/src/views/workCenter/standardEntryOrChangeProcess/StandardEntryOrChangeProcess.vue index 71b0f38..35f2370 100644 --- a/src/views/workCenter/standardEntryOrChangeProcess/StandardEntryOrChangeProcess.vue +++ b/src/views/workCenter/standardEntryOrChangeProcess/StandardEntryOrChangeProcess.vue @@ -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