+
{{ $t('dispatchInformation') }}
-
+
+ v-if="isDepartLeaderDistribute && dispatchInfo.userType === SenderType.moduleOwner.value"
+ :rules="rules.moduleOwnerId" />
+ v-if="(isDepartLeaderDistribute && dispatchInfo.userType === SenderType.designEngineer.value) || isModuleOwnerDistribute"
+ :rules="rules.designEngineerId" />
+
+
+
{{ $t('standardConsultation.solicitationList') }}
+
+
+
+
{{ $t('processApprovalInfo') }}
@@ -136,6 +153,46 @@
+
+
+
+
+
+
+
+ {{ $t('turnTo') }}
+
+
+
+
+
+
+ {{ $t('save') }}
+
+
+
+
+
+
+ {{ $t('submit') }}
+
+
+
+
+
+
+ {{ $t('agree') }}
+
+
+
+
+
+
+ {{ $t('reject') }}
+
+
+
+
@@ -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