740 lines
31 KiB
Vue
740 lines
31 KiB
Vue
<template>
|
||
<internal-detail-page :title="pageTitle" :content-padding="0" :loading="loading">
|
||
<!-- 标题右侧tab -->
|
||
<template v-slot:titleRightCustom>
|
||
<div class="table-operator-tab">
|
||
<!-- 基础信息 -->
|
||
<a class="switch-item" :class="switchValue === 'base' ? 'table-operator-tab-active' : ''"
|
||
@click="switchChange('base')">{{ $t('basicInformation') }}
|
||
</a>
|
||
<!-- 人员信息 -->
|
||
<a class="switch-item" :class="switchValue === 'user' ? 'table-operator-tab-active' : ''"
|
||
@click="switchChange('user')">{{ $t('personalInformation') }}
|
||
</a>
|
||
</div>
|
||
</template>
|
||
<!-- 基础信息 -->
|
||
<div v-show="switchValue === 'base'" class="detail-page-scroll-content">
|
||
<!-- 流程信息 -->
|
||
<div class="process-part-title">{{ $t('processInformation') }}</div>
|
||
<a-form :form="processInfoForm">
|
||
<a-row>
|
||
<a-col :span="12">
|
||
<!-- 流程名称 -->
|
||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('processName')" :colon="formItemColon">
|
||
<a-input :placeholder="$t('pleaseEnter') + $t('processName')"
|
||
disabled
|
||
:maxLength="50"
|
||
v-decorator="['prcName', validatorRules.prcName]" />
|
||
</a-form-item>
|
||
</a-col>
|
||
<a-col :span="12">
|
||
<!-- 截止日期 -->
|
||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('expirationDate')" :colon="formItemColon">
|
||
<a-date-picker :placeholder="$t('pleaseSelect') + $t('expirationDate')"
|
||
style="width: 100%"
|
||
:disabled="disabled"
|
||
value-format="YYYY-MM-DD"
|
||
v-decorator="['dueTime']" />
|
||
</a-form-item>
|
||
</a-col>
|
||
<a-col :span="24">
|
||
<!-- 流程说明 -->
|
||
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('processExplain')" :colon="formItemColon">
|
||
<a-textarea :placeholder="$t('pleaseEnter') + $t('processExplain')"
|
||
:maxLength="500"
|
||
:rows="4"
|
||
:disabled="disabled"
|
||
v-decorator="['prcMes']" />
|
||
</a-form-item>
|
||
</a-col>
|
||
</a-row>
|
||
</a-form>
|
||
|
||
<!-- 业务基本信息 -->
|
||
<div class="process-part-title">{{ $t('basicServiceInformation') }}</div>
|
||
<!-- 节点1、主起草人起草分发 -->
|
||
<main-drafter-sent-base-info v-if="currentNode === 1" :flowInitType="flowInitType" ref="baseInfoRef" @processNameChange="processNameChange" @save="handleSave(true)"></main-drafter-sent-base-info>
|
||
<!-- 节点2、其他起草人上传企标 -->
|
||
<other-drafter-upload-standard-base-info v-if="currentNode === 2" ref="baseInfoRef" @onlineEditView="onlineEditView"></other-drafter-upload-standard-base-info>
|
||
<!-- 节点3、主起草人汇总上传会议纪要 -->
|
||
<main-drafter-collect-upload-minute-base-info v-if="currentNode === 3" ref="baseInfoRef" @save="handleSave(true)"></main-drafter-collect-upload-minute-base-info>
|
||
<!-- 节点4、标准化审核 -->
|
||
<standardization-audit-base-info
|
||
v-if="currentNode === 4" ref="baseInfoRef"
|
||
@standardizationAuditIsMeeting="standardizationAuditIsMeeting"
|
||
@onlineEditView="onlineEditView"></standardization-audit-base-info>
|
||
<!-- 节点5、评分人打分 -->
|
||
<scorer-mark-base-info v-if="currentNode === 5" ref="baseInfoRef" @onlineEditView="onlineEditView"></scorer-mark-base-info>
|
||
<!-- 节点6、标准化确认是否开启征求意见 -->
|
||
<confirm-whether-comment-base-info v-if="currentNode === 6" ref="baseInfoRef" @onlineEditView="onlineEditView"></confirm-whether-comment-base-info>
|
||
<!-- 节点7、部所联络人下发 -->
|
||
<depart-liaison-issue-base-info v-if="currentNode === 7" ref="baseInfoRef" @onlineEditView="onlineEditView"></depart-liaison-issue-base-info>
|
||
<!-- 节点8、征求意见对象填写意见 -->
|
||
<comment-object-enter-base-info v-if="currentNode === 8" ref="baseInfoRef" @onlineEditView="onlineEditView"></comment-object-enter-base-info>
|
||
<!-- 节点9、部所联络人汇总数据 -->
|
||
<depart-liaison-collect-base-info v-if="currentNode === 9" ref="baseInfoRef" @onlineEditView="onlineEditView"></depart-liaison-collect-base-info>
|
||
<!-- 节点10、部所联络人主管级领导审批 -->
|
||
<depart-liaison-leader-approve-base-info v-if="currentNode === 10" ref="baseInfoRef" @onlineEditView="onlineEditView"></depart-liaison-leader-approve-base-info>
|
||
<!-- 节点11、主起草人汇总 -->
|
||
<main-drafter-collect-base-info v-if="currentNode === 11" ref="baseInfoRef" @save="handleSave(true)"></main-drafter-collect-base-info>
|
||
<!-- 节点12、主起草人上传会议纪要 -->
|
||
<main-drafter-upload-minute-base-info v-if="currentNode === 12" ref="baseInfoRef" @save="handleSave(true)"></main-drafter-upload-minute-base-info>
|
||
<!-- 节点13、其他起草人校对 -->
|
||
<!-- 节点14、主管级领导审批 -->
|
||
<!-- 节点15、标准化审批 -->
|
||
<!-- 节点16、相关部门领导会签 -->
|
||
<!-- 节点17、总工程师审批 -->
|
||
<!-- 只有标准文本 -->
|
||
<other-drafter-proofread-base-info v-if="[13, 14, 15, 16, 17].includes(currentNode)" ref="baseInfoRef" @onlineEditView="onlineEditView"></other-drafter-proofread-base-info>
|
||
<!-- 节点18、主起草人发布 -->
|
||
<main-drafter-publish-base-info v-if="currentNode === 18" ref="baseInfoRef" @save="handleSave(true)"></main-drafter-publish-base-info>
|
||
|
||
<!-- 流程审批信息 -->
|
||
<div class="process-part-title">{{ $t('processApprovalInformation') }}</div>
|
||
<a-form :form="approvalInfoForm">
|
||
<!--备注-->
|
||
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('remarks')" :colon="formItemColon">
|
||
<a-textarea :placeholder="$t('pleaseEnter') + $t('remarks')"
|
||
:maxLength="500"
|
||
:rows="4"
|
||
v-decorator="['commitText', validatorRules.commitText]" />
|
||
</a-form-item>
|
||
<!--附件-->
|
||
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('attach')" :colon="formItemColon">
|
||
<j-upload v-decorator="['commitFile']" return-id />
|
||
</a-form-item>
|
||
</a-form>
|
||
</div>
|
||
|
||
<!-- 人员信息 -->
|
||
<div v-show="switchValue === 'user'" class="detail-page-scroll-content p-0">
|
||
<process-detail-list :processKey="ProcessKey.ES_EDIT.value">
|
||
<personnel-info slot="personnelInfo" ref="personnelInfo" :data="personnelInfoData" :currentNode="currentNodeId"></personnel-info>
|
||
</process-detail-list>
|
||
</div>
|
||
|
||
<!-- 操作按钮 -->
|
||
<div class="detail-page-bottom-operate-box">
|
||
<!-- 发起节点 -->
|
||
<template v-if="currentNode === 1">
|
||
<!-- 保存 -->
|
||
<a-button type="primary" ghost :loading="loading" @click="handleSave"><i class="iconfont icon-save"></i> {{ $t('preservation') }}</a-button>
|
||
<!-- 提交 -->
|
||
<a-button type="primary" :loading="loading" @click="handleStart" icon="upload">{{ $t('submit') }}</a-button>
|
||
</template>
|
||
<!-- 各部所联络人填写/下发任务 -->
|
||
<template v-else-if="[2, 3, 5, 6, 7, 8, 9, 11, 12].includes(currentNode)">
|
||
<!-- 转办 -->
|
||
<a-button type="primary" ghost :loading="loading" @click="handleTurnTo" icon="arrow-up">{{ $t('turnTo') }}</a-button>
|
||
<!-- 保存 -->
|
||
<a-button type="primary" ghost :loading="loading" @click="handleSave"><i class="iconfont icon-save"></i> {{ $t('preservation') }}</a-button>
|
||
<!-- 提交 -->
|
||
<a-button type="primary" :loading="loading" @click="handleSubmit" icon="upload">{{ $t('submit') }}</a-button>
|
||
</template>
|
||
<template v-else-if="currentNode === 18">
|
||
<!-- 提交 -->
|
||
<a-button type="primary" :loading="loading" @click="handleSubmit" icon="upload">{{ $t('submit') }}</a-button>
|
||
</template>
|
||
<template v-else>
|
||
<!-- 转办 -->
|
||
<a-button type="primary" ghost :loading="loading" @click="handleTurnTo" icon="arrow-up">{{ $t('turnTo') }}</a-button>
|
||
<!-- 保存 -->
|
||
<a-button type="primary" ghost :loading="loading" @click="handleSave"><i class="iconfont icon-save"></i> {{ $t('preservation') }}</a-button>
|
||
<!-- 同意 -->
|
||
<a-button type="primary" :loading="loading" @click="handleAgree" icon="check-circle" :disabled="agreeBtnDisabled">{{ $t('agree') }}</a-button>
|
||
<!-- 驳回 -->
|
||
<a-button type="primary" :loading="loading" @click="handleReject" icon="close-circle" :disabled="rejectBtnDisabled">{{ $t('reject') }}</a-button>
|
||
</template>
|
||
</div>
|
||
|
||
<!-- 选人弹框 -->
|
||
<user-select-modal ref="userSelectModal" type="radio" @change="userSelectModalChange"></user-select-modal>
|
||
</internal-detail-page>
|
||
</template>
|
||
|
||
<script>
|
||
import pick from 'lodash.pick'
|
||
import InternalDetailPage from '@/components/InternalDetailPage'
|
||
import UserSelectModal from '@/components/selection/UserSelectModal'
|
||
import ProcessDetailList from '@/components/ProcessDetailList'
|
||
import PersonnelInfo from '@/components/PersonnelInfo'
|
||
import MainDrafterSentBaseInfo from './modules/MainDrafterSentBaseInfo'
|
||
import OtherDrafterUploadStandardBaseInfo from './modules/OtherDrafterUploadStandardBaseInfo'
|
||
import StandardizationAuditBaseInfo from './modules/StandardizationAuditBaseInfo'
|
||
import ScorerMarkBaseInfo from './modules/ScorerMarkBaseInfo'
|
||
import ConfirmWhetherCommentBaseInfo from './modules/ConfirmWhetherCommentBaseInfo'
|
||
import DepartLiaisonIssueBaseInfo from './modules/DepartLiaisonIssueBaseInfo'
|
||
import CommentObjectEnterBaseInfo from './modules/CommentObjectEnterBaseInfo'
|
||
import DepartLiaisonCollectBaseInfo from './modules/DepartLiaisonCollectBaseInfo'
|
||
import DepartLiaisonLeaderApproveBaseInfo from './modules/DepartLiaisonLeaderApproveBaseInfo'
|
||
import MainDrafterCollectBaseInfo from './modules/MainDrafterCollectBaseInfo'
|
||
import MainDrafterCollectUploadMinuteBaseInfo from './modules/MainDrafterCollectUploadMinuteBaseInfo'
|
||
import MainDrafterUploadMinuteBaseInfo from './modules/MainDrafterUploadMinuteBaseInfo'
|
||
import OtherDrafterProofreadBaseInfo from './modules/OtherDrafterProofreadBaseInfo'
|
||
import MainDrafterPublishBaseInfo from './modules/MainDrafterPublishBaseInfo'
|
||
import { ProcessKey, EsRevisionNodes } from '../../../enums/commonEnums'
|
||
import {
|
||
enStandardEditAgree,
|
||
enStandardEditApproval,
|
||
enStandardEditGetDataById,
|
||
enStandardEditGetDataDraft,
|
||
enStandardEditReject,
|
||
enStandardEditSave,
|
||
enStandardEditTurnTo
|
||
} from '@/api/workCenter'
|
||
import { WorkCenterMixin } from '@/mixins/WorkCenterMixin'
|
||
import { queryFileInfoByEditId } from '../../../api/workCenter'
|
||
import { Base64 } from 'js-base64'
|
||
|
||
export default {
|
||
name: 'EnterpriseStandardRevisionFlow',
|
||
components: {
|
||
MainDrafterPublishBaseInfo,
|
||
OtherDrafterProofreadBaseInfo,
|
||
MainDrafterUploadMinuteBaseInfo,
|
||
MainDrafterCollectUploadMinuteBaseInfo,
|
||
MainDrafterCollectBaseInfo,
|
||
DepartLiaisonLeaderApproveBaseInfo,
|
||
DepartLiaisonCollectBaseInfo,
|
||
CommentObjectEnterBaseInfo,
|
||
DepartLiaisonIssueBaseInfo,
|
||
ConfirmWhetherCommentBaseInfo,
|
||
ScorerMarkBaseInfo,
|
||
StandardizationAuditBaseInfo,
|
||
OtherDrafterUploadStandardBaseInfo,
|
||
MainDrafterSentBaseInfo,
|
||
InternalDetailPage,
|
||
UserSelectModal,
|
||
ProcessDetailList,
|
||
PersonnelInfo
|
||
},
|
||
mixins: [WorkCenterMixin],
|
||
computed: {
|
||
pageTitle () {
|
||
return this.$t('flowCenter') + this.$route.meta.title + '(' + this.currentNodeName + ')'
|
||
}
|
||
},
|
||
mounted () {
|
||
// 初始化节点
|
||
const nodeId = this.$route.query.nodeId
|
||
if (nodeId) {
|
||
this.currentNodeId = nodeId
|
||
if (nodeId === EsRevisionNodes.mainDrafterSend.value) {
|
||
// 主起草人起草分发
|
||
this.currentNode = 1
|
||
} else if (nodeId === EsRevisionNodes.otherDrafterUploadStandard.value) {
|
||
// 其他起草人上传企标
|
||
this.currentNode = 2
|
||
} else if (nodeId === EsRevisionNodes.mainDrafterAllUploadMinute.value) {
|
||
// 主起草人汇总上传会议纪要
|
||
this.currentNode = 3
|
||
} else if (nodeId === EsRevisionNodes.standardizationAudit.value) {
|
||
// 标准化审核
|
||
this.currentNode = 4
|
||
} else if (nodeId === EsRevisionNodes.scorerMark.value) {
|
||
// 评分人打分
|
||
this.currentNode = 5
|
||
} else if (nodeId === EsRevisionNodes.standardizationConfirmIsStartAdvice.value) {
|
||
// 标准化确认是否开启征求意见
|
||
this.currentNode = 6
|
||
} else if (nodeId === EsRevisionNodes.contactSend.value) {
|
||
// 部所联络人下发
|
||
this.currentNode = 7
|
||
} else if (nodeId === EsRevisionNodes.takeAdviceObjectEnterAdvice.value) {
|
||
// 征求意见对象填写意见
|
||
this.currentNode = 8
|
||
} else if (nodeId === EsRevisionNodes.contactAll.value) {
|
||
// 部所联络人汇总数据
|
||
this.currentNode = 9
|
||
} else if (nodeId === EsRevisionNodes.contactLeaderApproval.value) {
|
||
// 部门联络人主管级领导审批
|
||
this.currentNode = 10
|
||
} else if (nodeId === EsRevisionNodes.mainDrafterAll.value) {
|
||
// 主起草人汇总
|
||
this.currentNode = 11
|
||
} else if (nodeId === EsRevisionNodes.mainDrafterUploadMinute.value) {
|
||
// 主起草人上传会议纪要
|
||
this.currentNode = 12
|
||
} else if (nodeId === EsRevisionNodes.otherDrafterProofread.value) {
|
||
// 其他起草人校对
|
||
this.currentNode = 13
|
||
} else if (nodeId === EsRevisionNodes.leaderApproval.value) {
|
||
// 主管级领导审批
|
||
this.currentNode = 14
|
||
} else if (nodeId === EsRevisionNodes.standardizationApproval.value) {
|
||
// 标准化审批
|
||
this.currentNode = 15
|
||
} else if (nodeId === EsRevisionNodes.relatedDeptLeaderCountersign.value) {
|
||
// 相关部门领导会签
|
||
this.currentNode = 16
|
||
} else if (nodeId === EsRevisionNodes.allEngineerApproval.value) {
|
||
// 总工程师审批
|
||
this.currentNode = 17
|
||
} else if (nodeId === EsRevisionNodes.mainDrafterPublish.value) {
|
||
// 主起草人发布
|
||
this.currentNode = 18
|
||
} else {
|
||
// 预留加签节点
|
||
this.currentNode = 999
|
||
}
|
||
}
|
||
// 获取人员信息结构
|
||
this.getPersonInfoStructure(ProcessKey.ES_EDIT.value, () => {
|
||
if (this.$route.query.processInstanceId) {
|
||
if (this.currentNode === 1) {
|
||
this.disabled = false
|
||
this.initPersonInfoData(true)
|
||
} else {
|
||
this.disabled = true
|
||
// 如果不是第一个节点,人员信息全部不可选
|
||
this.initPersonInfoData(false)
|
||
}
|
||
}
|
||
})
|
||
if (this.$route.query.taskId && !this.$route.query.draftId) {
|
||
// 有流程id说明是从流程中心来的,需要初始化数据
|
||
this.getProcessData('todo', { taskId: this.$route.query.taskId })
|
||
}
|
||
if (this.$route.query.draftId) {
|
||
// 有草稿id,说明是从流程中心-草稿来的,需要初始化数据
|
||
this.getProcessData('draft', { draftId: this.$route.query.draftId, projectId: this.$route.query.projectId })
|
||
}
|
||
if (this.$route.query.taskName) {
|
||
// 说明是已发起流程
|
||
this.currentNodeName = this.$route.query.taskName
|
||
} else {
|
||
this.currentNodeName = '主起草人起草分发'
|
||
}
|
||
// 需要能判断是自动发起还是手动发起??
|
||
if (this.currentNode === 1 && this.$route.query.processInstanceId) {
|
||
// 有流程id说明是从待办进来的,是自动发起
|
||
this.flowInitType = 'auto'
|
||
}
|
||
},
|
||
data () {
|
||
return {
|
||
ProcessKey,
|
||
loading: false,
|
||
switchValue: 'base',
|
||
processInfoForm: this.$form.createForm(this),
|
||
labelCol: {
|
||
xs: { span: 24 },
|
||
sm: { span: 4 }
|
||
},
|
||
wrapperCol: {
|
||
xs: { span: 24 },
|
||
sm: { span: 20 }
|
||
},
|
||
longLabelCol: {
|
||
xs: { span: 24 },
|
||
sm: { span: 2 }
|
||
},
|
||
longWrapperCol: {
|
||
xs: { span: 24 },
|
||
sm: { span: 22 }
|
||
},
|
||
disabled: false,
|
||
validatorRules: {
|
||
// 流程名称
|
||
prcName: {
|
||
rules: [
|
||
{
|
||
required: true,
|
||
message: this.$t('pleaseEnter') + this.$t('processName')
|
||
}
|
||
],
|
||
validateTrigger: 'blur'
|
||
},
|
||
// 备注
|
||
commitText: {
|
||
rules: [
|
||
{
|
||
required: false,
|
||
message: this.$t('pleaseEnter') + this.$t('remarks')
|
||
}
|
||
],
|
||
validateTrigger: 'blur'
|
||
}
|
||
},
|
||
model: {},
|
||
currentNode: 1,
|
||
currentNodeName: '', // 当前节点名称
|
||
currentNodeId: EsRevisionNodes.mainDrafterSend.value, // 当前节点id
|
||
approvalInfoForm: this.$form.createForm(this), // 审批信息表单
|
||
personnelInfoData: [], // 人员信息数据
|
||
url: {
|
||
list: '' // 人员信息右侧表的分页查询接口
|
||
},
|
||
flowInitType: 'newProcess', // 流程发起类型,是自动发起(auto)的还是从新建流程发起的(newProcess)
|
||
rejectBtnDisabled: false, // 驳回按钮是否置灰
|
||
agreeBtnDisabled: false, // 同意按钮是否置灰
|
||
documentUrl: window._CONFIG.documentUrl
|
||
}
|
||
},
|
||
methods: {
|
||
// 根据流程id获取数据并回显
|
||
getProcessData (type, param) {
|
||
let func
|
||
let params = {}
|
||
if (type === 'todo') {
|
||
func = enStandardEditGetDataById
|
||
params = param.taskId
|
||
} else {
|
||
func = enStandardEditGetDataDraft
|
||
params = param
|
||
}
|
||
this.loading = true
|
||
func(params).then(res => {
|
||
if (res.success) {
|
||
this.model = res.result
|
||
this.$nextTick(() => {
|
||
// 初始化流程信息
|
||
this.processInfoForm.setFieldsValue(pick(this.model.common, 'prcName', 'dueTime', 'prcMes'))
|
||
// 有草稿json按草稿进来的回显
|
||
if (this.model.infoJsonStr) {
|
||
// 初始化流程信息
|
||
const prcObj = Object.assign({}, this.model)
|
||
prcObj.dueTime = this.model.processDueDate
|
||
prcObj.prcMes = this.model.processDescription
|
||
this.processInfoForm.setFieldsValue(pick(prcObj, 'prcName', 'dueTime', 'prcMes'))
|
||
// 初始化流程审批信息
|
||
prcObj.commitText = this.model.handleText
|
||
prcObj.commitFile = this.model.handleFile
|
||
this.approvalInfoForm.setFieldsValue(pick(prcObj, 'commitText', 'commitFile'))
|
||
this.model.data = (JSON.parse(this.model.infoJsonStr)).data
|
||
// 如果是节点1的保存回显人员信息
|
||
if (this.currentNode === 1) {
|
||
console.log(JSON.parse(this.model.infoJsonStr).personnelObj)
|
||
this.draftInitPersonInfo(JSON.parse(this.model.infoJsonStr).personnelObj)
|
||
}
|
||
}
|
||
if (this.$refs.baseInfoRef) {
|
||
this.$refs.baseInfoRef.initData(this.model.data)
|
||
}
|
||
})
|
||
} else {
|
||
this.$message.warning(res.message)
|
||
}
|
||
}).finally(() => {
|
||
setTimeout(() => {
|
||
this.loading = false
|
||
}, 1000)
|
||
})
|
||
},
|
||
switchChange (value) {
|
||
this.switchValue = value
|
||
},
|
||
// 流程名称改变
|
||
processNameChange (value) {
|
||
const param = { prcName: value }
|
||
this.$nextTick(() => {
|
||
this.processInfoForm.setFieldsValue(pick(param, 'prcName'))
|
||
})
|
||
},
|
||
// 标准化审核节点是否可进行评审会修改,需要修改备注的是否必填和同意、驳回按钮是否可用
|
||
standardizationAuditIsMeeting (value) {
|
||
// 选是的话,驳回按钮置灰,不可点击;选否,备注变成必填,内容自动带入“驳回”,下方同意按钮置灰,不可点击
|
||
if (value === '1') {
|
||
// 选了是
|
||
this.validatorRules.commitText.rules[0].required = false
|
||
this.rejectBtnDisabled = true
|
||
this.agreeBtnDisabled = false
|
||
const obj = { commitText: '' }
|
||
this.$nextTick(() => {
|
||
this.approvalInfoForm.setFieldsValue(pick(obj, 'commitText'))
|
||
})
|
||
} else {
|
||
// 选了否
|
||
this.validatorRules.commitText.rules[0].required = true
|
||
this.rejectBtnDisabled = false
|
||
this.agreeBtnDisabled = true
|
||
const obj = { commitText: '驳回' }
|
||
this.$nextTick(() => {
|
||
this.approvalInfoForm.setFieldsValue(pick(obj, 'commitText'))
|
||
})
|
||
}
|
||
},
|
||
// 保存
|
||
handleSave (noReturn) {
|
||
if (this.loading) {
|
||
return
|
||
}
|
||
// 有任意一项填了即可
|
||
// 流程信息表单
|
||
const processInfoForm = this.processInfoForm.getFieldsValue()
|
||
// 流程审批信息
|
||
const approvalInfoForm = this.approvalInfoForm.getFieldsValue()
|
||
// 人员信息的数据, 处理成对象
|
||
const personnelObj = this.$refs.personnelInfo.getDataObj()
|
||
// 需要传给后端的
|
||
const paramObj = {}
|
||
// 流程信息
|
||
paramObj.basicProcessInfoDTO = Object.assign({}, processInfoForm)
|
||
paramObj.basicProcessInfoDTO.processName = paramObj.basicProcessInfoDTO.prcName
|
||
paramObj.basicProcessInfoDTO.processDueDate = paramObj.basicProcessInfoDTO.dueTime
|
||
paramObj.basicProcessInfoDTO.processDescription = paramObj.basicProcessInfoDTO.prcMes
|
||
paramObj.basicProcessInfoDTO.processInstanceId = this.$route.query.processInstanceId
|
||
// 流程审批信息
|
||
paramObj.basicTaskInfoDTO = Object.assign({}, approvalInfoForm)
|
||
paramObj.basicTaskInfoDTO.handleText = paramObj.basicTaskInfoDTO.commitText
|
||
paramObj.basicTaskInfoDTO.handleFile = paramObj.basicTaskInfoDTO.commitFile
|
||
paramObj.basicTaskInfoDTO.taskId = this.$route.query.taskId
|
||
// 草稿id
|
||
if (this.model.infoJsonStr) {
|
||
paramObj.draftId = this.model.id
|
||
}
|
||
// paramObj.common = { ...processInfoForm, ...approvalInfoForm }
|
||
// paramObj.flowUser = personnelObj
|
||
// 业务基本信息
|
||
if (this.$refs.baseInfoRef) {
|
||
// 业务基本信息
|
||
const baseInfo = this.$refs.baseInfoRef.getData()
|
||
const param = { ...processInfoForm, ...approvalInfoForm, ...personnelObj, ...baseInfo }
|
||
const flag = Object.values(param).some(v => !!v || v === 0)
|
||
if (!flag) {
|
||
// 提示至少填写一项
|
||
this.$message.warning(this.$t('pleaseFillInAtLeastOneItem'))
|
||
return
|
||
} else {
|
||
// 业务基本信息和人员信息
|
||
paramObj.infoJsonStr = JSON.stringify({
|
||
data: Object.assign({}, baseInfo, { id: this.model.data ? this.model.data.id : '' }),
|
||
personnelObj: personnelObj
|
||
})
|
||
}
|
||
} else {
|
||
// 需要外层信息至少填了一项
|
||
const param = { ...processInfoForm, ...approvalInfoForm, ...personnelObj }
|
||
const flag = Object.values(param).some(v => !!v || v === 0)
|
||
if (!flag) {
|
||
// 提示至少填写一项
|
||
this.$message.warning(this.$t('pleaseFillInAtLeastOneItem'))
|
||
return
|
||
}
|
||
}
|
||
if (!noReturn) {
|
||
this.loading = true
|
||
}
|
||
// 保存到草稿
|
||
enStandardEditSave(paramObj).then(res => {
|
||
if (!noReturn) {
|
||
if (res.success) {
|
||
this.$message.success(res.message)
|
||
this.goBack()
|
||
} else {
|
||
this.$message.warning(res.message)
|
||
this.loading = false
|
||
}
|
||
}
|
||
})
|
||
},
|
||
// 节点一时候的提交,发起变更
|
||
handleStart () {
|
||
if (this.loading) return
|
||
this.processInfoForm.validateFields((err, values) => {
|
||
this.approvalInfoForm.validateFields(async (approvalErr, approvalValues) => {
|
||
const data = await this.$refs.baseInfoRef.getDataValidate()
|
||
if (!err && !approvalErr && data) {
|
||
// 人员信息的数据, 处理成对象
|
||
const personnelObj = this.$refs.personnelInfo.getDataObjVerify()
|
||
if (!personnelObj) {
|
||
this.switchValue = 'user'
|
||
return
|
||
}
|
||
this.loading = true
|
||
const param = {} // 需要传给后端的数据
|
||
param.common = { ...values, ...approvalValues }
|
||
// 草稿id
|
||
if (this.model.infoJsonStr) {
|
||
param.common.draftId = this.model.id
|
||
}
|
||
param.flowUser = personnelObj
|
||
// 业务基本信息部分表单
|
||
param.data = {}
|
||
// 上方表单
|
||
param.data.businessJson = JSON.stringify(data.formInline)
|
||
// 其他起草人表格数据
|
||
param.data.otherDraftUserVOS = data.otherDraftUserVOS
|
||
// 企标计划id
|
||
param.data.espId = data.formInline.espId
|
||
// 在线编辑的文件id
|
||
param.data.onEditFile = data.onEditFile
|
||
// data的id
|
||
param.data.id = this.model.data ? this.model.data.id : ''
|
||
let func
|
||
if (this.$route.query.taskId) {
|
||
// 有taskId说明是驳回的提交
|
||
func = enStandardEditAgree
|
||
param.common.taskId = this.$route.query.taskId
|
||
} else {
|
||
func = enStandardEditApproval
|
||
}
|
||
func(param).then(res => {
|
||
if (res.success) {
|
||
this.$message.success(res.message)
|
||
this.goBack()
|
||
} else {
|
||
this.$message.warning(res.message)
|
||
this.loading = false
|
||
}
|
||
})
|
||
} else {
|
||
this.switchValue = 'base'
|
||
}
|
||
})
|
||
})
|
||
},
|
||
// 转办
|
||
handleTurnTo () {
|
||
if (this.loading) return
|
||
// 点击显示选人组件
|
||
this.$refs.userSelectModal.open()
|
||
},
|
||
// 转办选完人的回调
|
||
userSelectModalChange (userIds) {
|
||
this.approvalInfoForm.validateFields((err, values) => {
|
||
if (!err) {
|
||
this.loading = true
|
||
const param = Object.assign({}, values)
|
||
param.userId = userIds
|
||
param.taskId = this.$route.query.taskId
|
||
enStandardEditTurnTo(param).then(res => {
|
||
if (res.success) {
|
||
this.$message.success(res.message)
|
||
this.goBack()
|
||
} else {
|
||
this.$message.warning(res.message)
|
||
this.loading = false
|
||
}
|
||
})
|
||
}
|
||
})
|
||
},
|
||
// 提交
|
||
handleSubmit () {
|
||
if (this.loading) return
|
||
this.approvalInfoForm.validateFields(async (approvalErr, approvalValues) => {
|
||
const data = await this.$refs.baseInfoRef.getDataValidate()
|
||
if (!approvalErr && data) {
|
||
const param = {} // 需要传给后端的数据
|
||
param.common = Object.assign({}, approvalValues)
|
||
param.common.taskId = this.$route.query.taskId
|
||
param.data = data
|
||
this.loading = true
|
||
enStandardEditAgree(param).then(res => {
|
||
if (res.success) {
|
||
this.$message.success(res.message)
|
||
this.goBack()
|
||
} else {
|
||
this.$message.warning(res.message)
|
||
this.loading = false
|
||
}
|
||
})
|
||
} else {
|
||
this.switchValue = 'base'
|
||
}
|
||
})
|
||
},
|
||
// 同意
|
||
handleAgree () {
|
||
if (this.loading) return
|
||
this.validatorRules.commitText.rules[0].required = false
|
||
if (!this.approvalInfoForm.getFieldValue('commitText')) {
|
||
this.approvalInfoForm.setFieldsValue({ commitText: '同意' })
|
||
}
|
||
this.approvalInfoForm.validateFields(async (err, values) => {
|
||
if (this.currentNode === 4 || this.currentNode === 10) {
|
||
const data = await this.$refs.baseInfoRef.getDataValidate()
|
||
if (!err && data) {
|
||
this.loading = true
|
||
const param = {}
|
||
param.common = Object.assign({}, values)
|
||
param.common.taskId = this.$route.query.taskId
|
||
param.data = data
|
||
enStandardEditAgree(param).then(res => {
|
||
if (res.success) {
|
||
this.$message.success(res.message)
|
||
this.goBack()
|
||
} else {
|
||
this.$message.warning(res.message)
|
||
this.loading = false
|
||
}
|
||
})
|
||
}
|
||
} else {
|
||
if (!err) {
|
||
this.loading = true
|
||
const param = {}
|
||
param.common = Object.assign({}, values)
|
||
param.common.taskId = this.$route.query.taskId
|
||
enStandardEditAgree(param).then(res => {
|
||
if (res.success) {
|
||
this.$message.success(res.message)
|
||
this.goBack()
|
||
} else {
|
||
this.$message.warning(res.message)
|
||
this.loading = false
|
||
}
|
||
})
|
||
}
|
||
}
|
||
})
|
||
},
|
||
// 驳回
|
||
handleReject () {
|
||
if (this.loading) return
|
||
this.validatorRules.commitText.rules[0].required = true
|
||
if (!this.approvalInfoForm.getFieldValue('commitText')) {
|
||
this.$message.warning(this.$t('pleaseEnterRemarks'))
|
||
this.switchValue = 'base'
|
||
}
|
||
this.$nextTick(() => {
|
||
this.approvalInfoForm.validateFields({ force: true }, (err, values) => {
|
||
if (!err) {
|
||
this.loading = true
|
||
const param = {}
|
||
param.common = Object.assign({}, values)
|
||
param.common.taskId = this.$route.query.taskId
|
||
enStandardEditReject(param).then(res => {
|
||
if (res.success) {
|
||
this.$message.success(res.message)
|
||
this.goBack()
|
||
} else {
|
||
this.$message.warning(res.message)
|
||
this.loading = false
|
||
}
|
||
}).finally(() => {
|
||
this.validatorRules.commitText.rules[0].required = false
|
||
})
|
||
}
|
||
})
|
||
})
|
||
},
|
||
// 在线编辑的查看
|
||
onlineEditView (fileId) {
|
||
if (!fileId) {
|
||
this.$message.warning(this.$t('workCenter.enStandardRevision.noStandardTextLook'))
|
||
return
|
||
}
|
||
queryFileInfoByEditId({ id: fileId }).then(res => {
|
||
if (res.success) {
|
||
const file = res.result
|
||
const filePaths = file.editFilePath.split('/')
|
||
const fileName = filePaths[filePaths.length - 1]
|
||
const url = `${window._CONFIG.onlinePreviewDomainURL}?url=${encodeURIComponent(Base64.encode(this.documentUrl + file.editFilePath + '&fullfilename=' + fileName))}`
|
||
console.log(this.documentUrl + file.editFilePath + '&fullfilename=' + fileName)
|
||
window.open(url, '_blank')
|
||
} else {
|
||
this.$message.warning(res.message)
|
||
}
|
||
})
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style scoped lang="less">
|
||
@import '~@assets/less/common.less';
|
||
</style>
|