[update 查看详情] 稽查整改流程

This commit is contained in:
danshihao
2024-07-25 18:04:54 +08:00
parent 8877654419
commit 9f5c1da7e6
4 changed files with 134 additions and 39 deletions
@@ -244,15 +244,15 @@ export default {
// 同意按钮 // 同意按钮
this.btn = ['agree'] this.btn = ['agree']
} }
// 查询人员信息
this.getPersonInfoStructure(this.processKey, () => {
this.initPersonInfoData(this.isInitiate)
})
// 快照回显 // 快照回显
if (this.$route.query.snapshotId) { if (this.$route.query.snapshotId) {
this.loadSnapshotPage() this.loadSnapshotPage()
return return
} }
// 查询人员信息
this.getPersonInfoStructure(this.processKey, () => {
this.initPersonInfoData(this.isInitiate)
})
// 如果是待办或草稿进来,就获取详情数据 // 如果是待办或草稿进来,就获取详情数据
if (this.$route.query.projectId) { if (this.$route.query.projectId) {
this.loadPage() this.loadPage()
@@ -472,7 +472,7 @@ export default {
saveSnapShotInfo (prcParams) { saveSnapShotInfo (prcParams) {
// 没有taskId就不保存 // 没有taskId就不保存
if (!this.$route.query.taskId) { if (!this.$route.query.taskId) {
return Promise.resolve() return Promise.resolve({ success: true })
} }
const { processAll = {}, processApprovalRecord = {} } = prcParams const { processAll = {}, processApprovalRecord = {} } = prcParams
const params = Object.assign({}, { const params = Object.assign({}, {
@@ -215,15 +215,15 @@ export default {
// 同意按钮 // 同意按钮
this.btn = ['agree'] this.btn = ['agree']
} }
// 查询人员信息
this.getPersonInfoStructure(this.processKey, () => {
this.initPersonInfoData(this.isInitiate)
})
// 快照回显 // 快照回显
if (this.$route.query.snapshotId) { if (this.$route.query.snapshotId) {
this.loadSnapshotPage() this.loadSnapshotPage()
return return
} }
// 查询人员信息
this.getPersonInfoStructure(this.processKey, () => {
this.initPersonInfoData(this.isInitiate)
})
// 如果是待办或草稿进来,就获取详情数据 // 如果是待办或草稿进来,就获取详情数据
if (this.$route.query.projectId) { if (this.$route.query.projectId) {
this.loadPage() this.loadPage()
@@ -442,7 +442,7 @@ export default {
saveSnapShotInfo (prcParams) { saveSnapShotInfo (prcParams) {
// 没有taskId就不保存 // 没有taskId就不保存
if (!this.$route.query.taskId) { if (!this.$route.query.taskId) {
return Promise.resolve() return Promise.resolve({ success: true })
} }
const { processAll = {}, processApprovalRecord = {} } = prcParams const { processAll = {}, processApprovalRecord = {} } = prcParams
const params = Object.assign({}, { const params = Object.assign({}, {
@@ -1,7 +1,7 @@
<template> <template>
<internal-detail-page :title="pageTitle" :content-padding="0" :loading="loading"> <internal-detail-page :title="pageTitle" :content-padding="0" :loading="loading">
<!-- 标题右侧tab --> <!-- 标题右侧tab -->
<template v-slot:titleRightCustom> <template v-slot:titleRightCustom v-if="!disabled">
<div class="table-operator-tab"> <div class="table-operator-tab">
<!-- 基础信息 --> <!-- 基础信息 -->
<a class="switch-item" :class="switchValue === 'base' ? 'table-operator-tab-active' : ''" <a class="switch-item" :class="switchValue === 'base' ? 'table-operator-tab-active' : ''"
@@ -55,7 +55,7 @@
<!-- 业务基本信息 --> <!-- 业务基本信息 -->
<div class="process-part-title">{{ $t('basicServiceInformation') }}</div> <div class="process-part-title">{{ $t('basicServiceInformation') }}</div>
<!-- 基本信息 --> <!-- 基本信息 -->
<base-info-form ref="baseInfoForm" :disabled="processDisabled"/> <base-info-form ref="baseInfoForm" :disabled="disabled || processDisabled"/>
<!-- 流程审批信息 --> <!-- 流程审批信息 -->
<div class="process-part-title">{{ $t('processApprovalInformation') }}</div> <div class="process-part-title">{{ $t('processApprovalInformation') }}</div>
@@ -64,12 +64,13 @@
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('remarks')"> <a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('remarks')">
<a-textarea :placeholder="$t('pleaseEnter') + $t('remarks')" <a-textarea :placeholder="$t('pleaseEnter') + $t('remarks')"
:maxLength="500" :maxLength="500"
:disabled="disabled"
:rows="4" :rows="4"
v-decorator="['commitText', validatorRules.remarks]" /> v-decorator="['commitText', validatorRules.remarks]" />
</a-form-item> </a-form-item>
<!--附件--> <!--附件-->
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('businessSupport.questionAnswer.attach')"> <a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('businessSupport.questionAnswer.attach')">
<j-upload v-decorator="['commitFile']" return-id multiple /> <j-upload v-decorator="['commitFile']" return-id multiple :disabled="disabled" />
</a-form-item> </a-form-item>
</a-form> </a-form>
</div> </div>
@@ -82,7 +83,7 @@
</process-detail-list> </process-detail-list>
</div> </div>
<div class="detail-page-bottom-operate-box"> <div class="detail-page-bottom-operate-box" v-if="!disabled">
<!--转办--> <!--转办-->
<a-button v-if="btn.includes('transfer')" type="primary" :loading="loading" @click="handleTurnTo" ghost icon="arrow-up">{{ $t('turnTo') }}</a-button> <a-button v-if="btn.includes('transfer')" type="primary" :loading="loading" @click="handleTurnTo" ghost icon="arrow-up">{{ $t('turnTo') }}</a-button>
<!--保存--> <!--保存-->
@@ -108,10 +109,16 @@ import BaseInfoForm from '@views/workCenter/enterpriseStandardInspectionRectific
import UserSelectModal from '@comp/selection/UserSelectModal' import UserSelectModal from '@comp/selection/UserSelectModal'
import { WorkCenterMixin } from '@/mixins/WorkCenterMixin' import { WorkCenterMixin } from '@/mixins/WorkCenterMixin'
import { import {
approvalInspectRectify, getInspectRectifyDataById, approvalInspectRectify,
getInspectRectifyDetail, rejectInspectRectify, saveInspectRectify, startInspectRectify, transferInspectRectify getInspectRectifyDataById,
getInspectRectifyDetail, getLookData,
rejectInspectRectify,
saveInspectRectify,
saveSnapShot,
startInspectRectify,
transferInspectRectify
} from '@api/workCenter' } from '@api/workCenter'
import { ApprovalOpinions, EsInspectionRectification, ProcessKey } from '@/enums/commonEnums' import { ApprovalOpinions, EsInspectionRectification, ProcessKey, ProcessType } from '@/enums/commonEnums'
const tabList = ['base', 'user'] const tabList = ['base', 'user']
export default { export default {
@@ -197,7 +204,8 @@ export default {
} }
}, },
created () { created () {
const { projectId, nodeId, taskName } = this.$route.query const { projectId, nodeId, taskName, isLook } = this.$route.query
this.disabled = isLook === '1'
// 自动发起流程: 没有默认节点 // 自动发起流程: 没有默认节点
this.currentNode = nodeId || '' this.currentNode = nodeId || ''
this.currentNodeName = taskName || '' this.currentNodeName = taskName || ''
@@ -212,6 +220,11 @@ export default {
// 同意按钮 // 同意按钮
this.btn = ['agree'] this.btn = ['agree']
} }
// 快照回显
if (this.$route.query.snapshotId) {
this.loadSnapshotPage()
return
}
// 查询人员信息 // 查询人员信息
this.getPersonInfoStructure(this.processKey, () => { this.getPersonInfoStructure(this.processKey, () => {
this.personnelInfoData = this.personnelInfoData.map(item => { this.personnelInfoData = this.personnelInfoData.map(item => {
@@ -348,6 +361,8 @@ export default {
// 保存清空校验 // 保存清空校验
this.approvalInfoForm.validateFields(['commitText'], { force: true }, () => {}) this.approvalInfoForm.validateFields(['commitText'], { force: true }, () => {})
} }
// 保存一下所有表单收集的数据用于快照回显
params.formDataList = formDataList
// 收集人员信息 // 收集人员信息
const personInfo = this.getPersonInfo(isValidate && !flag) const personInfo = this.getPersonInfo(isValidate && !flag)
if (!personInfo) { if (!personInfo) {
@@ -389,7 +404,9 @@ export default {
// 人员信息(要重新获取,流程里的信息不能直接用,后端需要多选人员处理成数组了) // 人员信息(要重新获取,流程里的信息不能直接用,后端需要多选人员处理成数组了)
personInfo: this.$refs.personnelInfo.getDataObj(), personInfo: this.$refs.personnelInfo.getDataObj(),
// 业务表格数据,用于强制撤回后回显 // 业务表格数据,用于强制撤回后回显
draftData draftData,
// 将流程数据保存json,后续进行快照回显
prcData: params
}) })
} }
@@ -399,6 +416,63 @@ export default {
} }
return params return params
}, },
/**
* 保存快照信息
*/
saveSnapShotInfo (prcParams) {
// 没有taskId就不保存
if (!this.$route.query.taskId) {
return Promise.resolve({ success: true })
}
const { processAll = {}, processApprovalRecord = {} } = prcParams
const params = Object.assign({}, {
taskId: this.$route.query.taskId,
pcrType: ProcessType.ES_INSPECTION_RECTIFICATION.value,
// 流程信息
prcName: processAll.prcName,
processDueDate: processAll.dueTime,
processDescription: processAll.prcMes,
// 流程审批信息
handleText: processApprovalRecord.commitText,
handleFile: processApprovalRecord.commitFile,
// 流程json字符串存储全部信息
infoJsonStr: JSON.stringify({
// 人员信息
personInfo: this.$refs.personnelInfo.getDataObj(),
// 流程信息
prcData: prcParams
})
})
return saveSnapShot(params)
},
// 回显快照页面
loadSnapshotPage () {
const { snapshotId } = this.$route.query
if (!snapshotId) {
return
}
this.loading = true
getLookData({ snapshotId }).then(res => {
const result = res.result || {}
const jsonData = JSON.parse(result.infoJsonStr || '{}')
const prcData = jsonData.prcData || {}
this.info = prcData
this.processInfoForm && this.processInfoForm.setFieldsValue({
prcName: prcData.processAll.prcName,
dueTime: prcData.processAll.dueTime,
prcMes: prcData.processAll.prcMes
})
this.approvalInfoForm && this.approvalInfoForm.setFieldsValue({
commitText: prcData.processApprovalRecord.commitText,
commitFile: prcData.processApprovalRecord.commitFile
})
this.$nextTick(() => {
this.$refs.baseInfoForm.initData(prcData.processEsInspectRectify)
})
}).finally(() => {
this.loading = false
})
},
/** /**
* 转办弹框 * 转办弹框
*/ */
@@ -463,17 +537,24 @@ export default {
handleSubmit () { handleSubmit () {
if (this.loading) return if (this.loading) return
this.loading = true this.loading = true
this.getPageParams().then(res => { this.getPageParams().then(params => {
console.log(res) console.log(params)
res.map.pass = true params.map.pass = true
let fn = approvalInspectRectify let fn = approvalInspectRectify
// 是否强制撤回(强制撤回的话,就发起接口) // 是否强制撤回(强制撤回的话,就发起接口)
if (this.isForceRevoke) { if (this.isForceRevoke) {
fn = startInspectRectify fn = startInspectRectify
// 重新发起置空业务id // 重新发起置空业务id
delete res.processEsInspectRectify.id delete params.processEsInspectRectify.id
} }
return fn(res) // 保存快照,成功了就调接口,失败了就提示
return this.saveSnapShotInfo(params).then(res => {
if (res.success) {
return fn(params)
} else {
return res
}
})
}).then(res => { }).then(res => {
if (res.success) { if (res.success) {
this.$message.success(res.message) this.$message.success(res.message)
@@ -499,19 +580,26 @@ export default {
handleAgree (isSubmitBtn) { handleAgree (isSubmitBtn) {
if (this.loading) return if (this.loading) return
this.loading = true this.loading = true
this.getPageParams().then(res => { this.getPageParams().then(params => {
// 同意和提交一直传true // 同意和提交一直传true
res.map.pass = true params.map.pass = true
// 不是提交按钮 // 不是提交按钮
if (isSubmitBtn !== true) { if (isSubmitBtn !== true) {
// 没有填写注释,就默认同意 // 没有填写注释,就默认同意
if (!res.processApprovalRecord.commitText) { if (!params.processApprovalRecord.commitText) {
res.processApprovalRecord.commitText = '同意' params.processApprovalRecord.commitText = '同意'
} }
// 审批意见 // 审批意见
res.processApprovalRecord.commitFlag = ApprovalOpinions.AGREE.value params.processApprovalRecord.commitFlag = ApprovalOpinions.AGREE.value
} }
return approvalInspectRectify(res) // 保存快照,成功了就调接口,失败了就提示
return this.saveSnapShotInfo(params).then(res => {
if (res.success) {
return approvalInspectRectify(params)
} else {
return res
}
})
}).then(res => { }).then(res => {
if (res.success) { if (res.success) {
this.$message.success(res.message) this.$message.success(res.message)
@@ -550,11 +638,18 @@ export default {
return return
} }
this.loading = true this.loading = true
this.getPageParams().then(res => { this.getPageParams().then(params => {
res.map.pass = false params.map.pass = false
// 审批意见 // 审批意见
res.processApprovalRecord.commitFlag = ApprovalOpinions.REJECT.value params.processApprovalRecord.commitFlag = ApprovalOpinions.REJECT.value
return rejectInspectRectify(res) // 保存快照,成功了就调接口,失败了就提示
return this.saveSnapShotInfo(params).then(res => {
if (res.success) {
return rejectInspectRectify(params)
} else {
return res
}
})
}).then(res => { }).then(res => {
if (res.success) { if (res.success) {
this.$message.success(res.message) this.$message.success(res.message)
@@ -208,15 +208,15 @@ export default {
// 同意按钮 // 同意按钮
this.btn = ['agree'] this.btn = ['agree']
} }
// 查询人员信息
this.getPersonInfoStructure(this.processKey, () => {
this.initPersonInfoData(this.isInitiate)
})
// 快照回显 // 快照回显
if (this.$route.query.snapshotId) { if (this.$route.query.snapshotId) {
this.loadSnapshotPage() this.loadSnapshotPage()
return return
} }
// 查询人员信息
this.getPersonInfoStructure(this.processKey, () => {
this.initPersonInfoData(this.isInitiate)
})
// 如果是待办或草稿进来,就获取详情数据 // 如果是待办或草稿进来,就获取详情数据
if (this.$route.query.projectId) { if (this.$route.query.projectId) {
this.loadPage() this.loadPage()
@@ -395,7 +395,7 @@ export default {
saveSnapShotInfo (prcParams) { saveSnapShotInfo (prcParams) {
// 没有taskId就不保存 // 没有taskId就不保存
if (!this.$route.query.taskId) { if (!this.$route.query.taskId) {
return Promise.resolve() return Promise.resolve({ success: true })
} }
const { processAll = {}, processApprovalRecord = {} } = prcParams const { processAll = {}, processApprovalRecord = {} } = prcParams
const params = Object.assign({}, { const params = Object.assign({}, {