[update 查看详情] 稽查延期申请流程

This commit is contained in:
danshihao
2024-07-25 16:46:20 +08:00
parent 199b5f367f
commit 9e9ab35597
4 changed files with 117 additions and 30 deletions
@@ -41,16 +41,16 @@
<!-- 操作 -->
<template slot="action" slot-scope="{text, record, index}">
<!-- (没有被禁用)编辑 and 删除:节点1 节点3 节点2且当前登录人是创建人 -->
<template v-if="!disabled && (isInitiateOrLiaisonCollect || (currentNode === EsInspectionPlan.fillInComments.value && currentUserName === record.createBy))">
<a @click="handleEdit(record, index)" >{{ $t('edit') }}</a>
<!-- 编辑 and 删除:节点1 节点3 节点2且当前登录人是创建人 -->
<template v-if="isInitiateOrLiaisonCollect || (currentNode === EsInspectionPlan.fillInComments.value && currentUserName === record.createBy)">
<a :disabled="disabled" @click="handleEdit(record, index)" >{{ $t('edit') }}</a>
<a-divider type="vertical" />
<a @click="handleDelete(index)" >{{ $t('delete') }}</a>
<a :disabled="disabled" @click="handleDelete(index)" >{{ $t('delete') }}</a>
</template>
<!-- (被禁用只能查看意见)意见 or 填写意见节点2非自己创建的就是意见和填写意见 -->
<template v-else-if="currentNode === EsInspectionPlan.fillInComments.value">
<a v-if="isShowOpinion(record)" @click="handleWriteOpinion(record, index)" >{{ $t('workCenter.esInspectionPlan.opinion') }}</a>
<a v-else-if="!disabled" @click="handleWriteOpinion(record, index)" >{{ $t('workCenter.esInspectionPlan.writeOpinion') }}</a>
<a :disabled="disabled" v-else @click="handleWriteOpinion(record, index)" >{{ $t('workCenter.esInspectionPlan.writeOpinion') }}</a>
</template>
</template>
@@ -68,8 +68,8 @@
<!-- 节点1显示稽查内容和删除节点2显示稽查内容只读 -->
<template v-if="isInitiate || isDirectorLeaderApprovalOne">
<a @click="handleInspectionContent(record, index)" >{{ $t('workCenter.esInspectionProcess.inspectionContent') + `(${record.standardInspectContentCount || 0}${$t('strip')})` }}</a>
<a-divider v-if="isInitiate && !disabled" type="vertical" />
<a v-if="isInitiate && !disabled" @click="handleDelete(index)" >{{ $t('delete') }}</a>
<a-divider v-if="isInitiate" type="vertical" />
<a v-if="isInitiate" @click="handleDelete(index)" :disabled="disabled">{{ $t('delete') }}</a>
</template>
<!-- 后续节点都显示稽查报告和整改计划 -->
<template v-else>
@@ -1,7 +1,7 @@
<template>
<internal-detail-page :title="pageTitle" :content-padding="0" :loading="loading">
<!-- 标题右侧tab -->
<template v-slot:titleRightCustom>
<template v-slot:titleRightCustom v-if="!disabled">
<div class="table-operator-tab">
<!-- 基础信息 -->
<a class="switch-item" :class="switchValue === 'base' ? 'table-operator-tab-active' : ''"
@@ -55,7 +55,7 @@
<!-- 业务基本信息 -->
<div class="process-part-title">{{ $t('basicServiceInformation') }}</div>
<!-- 流程表格 -->
<extension-request-table ref="extensionRequestTable" :current-node="currentNode" :project-id="projectId"/>
<extension-request-table ref="extensionRequestTable" :current-node="currentNode" :project-id="projectId" :disabled="disabled"/>
<!-- 流程审批信息 -->
<div class="process-part-title">{{ $t('processApprovalInformation') }}</div>
@@ -65,11 +65,12 @@
<a-textarea :placeholder="$t('pleaseEnter') + $t('remarks')"
:maxLength="500"
:rows="4"
:disabled="disabled"
v-decorator="['commitText', validatorRules.remarks]" />
</a-form-item>
<!--附件-->
<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>
</div>
@@ -82,7 +83,7 @@
</process-detail-list>
</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>
<!--保存-->
@@ -106,14 +107,14 @@ import PersonnelInfo from '@comp/PersonnelInfo'
import ProcessDetailList from '@comp/ProcessDetailList'
import ExtensionRequestTable from '@views/workCenter/inspectionExtensionRequestProcess/modules/ExtensionRequestTable'
import UserSelectModal from '@comp/selection/UserSelectModal'
import { ApprovalOpinions, InspectionExtensionRequestProcess, ProcessKey } from '@/enums/commonEnums'
import { ApprovalOpinions, InspectionExtensionRequestProcess, ProcessKey, ProcessType } from '@/enums/commonEnums'
import { WorkCenterMixin } from '@/mixins/WorkCenterMixin'
import {
approvalInspectExtension,
getInspectExtensionDetail,
getInspectExtensionProjectId,
getInspectExtensionProjectId, getLookData,
rejectInspectExtension,
saveInspectExtension,
saveInspectExtension, saveSnapShot,
startInspectExtension,
transferInspectExtension
} from '@api/workCenter'
@@ -127,7 +128,7 @@ export default {
return {
loading: false,
switchValue: 'base',
disabled: false,
disabled: false, // 全部禁用
labelCol: {
xs: { span: 24 },
sm: { span: 4 }
@@ -195,7 +196,8 @@ export default {
}
},
created () {
const { projectId, nodeId, taskName } = this.$route.query
const { projectId, nodeId, taskName, isLook } = this.$route.query
this.disabled = isLook === '1'
// 发起、草稿进来没有nodeId,就默认发起节点
this.currentNode = nodeId || InspectionExtensionRequestProcess.initiate.value
this.currentNodeName = taskName || InspectionExtensionRequestProcess.initiate.text
@@ -210,6 +212,11 @@ export default {
this.getPersonInfoStructure(this.processKey, () => {
this.initPersonInfoData(this.isInitiate)
})
// 快照回显
if (this.$route.query.snapshotId) {
this.loadSnapshotPage()
return
}
// 如果是待办或草稿进来,就获取详情数据
if (this.$route.query.projectId) {
this.loadPage()
@@ -339,6 +346,8 @@ export default {
// 保存清空校验
this.approvalInfoForm.validateFields(['commitText'], { force: true }, () => {})
}
// 保存一下所有表单收集的数据用于快照回显
params.formDataList = formDataList
// 收集人员信息
const personInfo = this.getPersonInfo(isValidate && !flag)
if (!personInfo) {
@@ -368,7 +377,9 @@ export default {
// 人员信息(要重新获取,流程里的信息不能直接用,后端需要多选人员处理成数组了)
personInfo: this.$refs.personnelInfo.getDataObj(),
// 业务表格数据,用于强制撤回后回显
draftData: params.processEsInspectDelayApplyList
draftData: params.processEsInspectDelayApplyList,
// 将流程数据保存json,后续进行快照回显
prcData: params
})
}
@@ -378,6 +389,61 @@ export default {
}
return params
},
/**
* 保存快照信息
*/
saveSnapShotInfo (prcParams) {
// 没有taskId就不保存
if (!this.$route.query.taskId) {
return Promise.resolve()
}
const { processAll = {}, processApprovalRecord = {} } = prcParams
const params = Object.assign({}, {
taskId: this.$route.query.taskId,
pcrType: ProcessType.INSPECTION_EXTENSION_REQUEST_PROCESS.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.$refs.extensionRequestTable.setData(prcData.processEsInspectDelayApplyList || [])
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
})
}).finally(() => {
this.loading = false
})
},
/**
* 转办弹框
*/
@@ -487,19 +553,26 @@ export default {
handleAgree (isSubmitBtn) {
if (this.loading) return
this.loading = true
this.getPageParams().then(res => {
this.getPageParams().then(params => {
// 同意和提交一直传true
res.map.pass = true
params.map.pass = true
// 不是提交按钮
if (isSubmitBtn !== true) {
// 没有填写注释,就默认同意
if (!res.processApprovalRecord.commitText) {
res.processApprovalRecord.commitText = '同意'
if (!params.processApprovalRecord.commitText) {
params.processApprovalRecord.commitText = '同意'
}
// 审批意见
res.processApprovalRecord.commitFlag = ApprovalOpinions.AGREE.value
params.processApprovalRecord.commitFlag = ApprovalOpinions.AGREE.value
}
return approvalInspectExtension(res)
// 保存快照,成功了就调接口,失败了就提示
return this.saveSnapShotInfo(params).then(res => {
if (res.success) {
return approvalInspectExtension(params)
} else {
return res
}
})
}).then(res => {
if (res.success) {
this.$message.success(res.message)
@@ -538,11 +611,18 @@ export default {
return
}
this.loading = true
this.getPageParams().then(res => {
res.map.pass = false
this.getPageParams().then(params => {
params.map.pass = false
// 审批意见
res.processApprovalRecord.commitFlag = ApprovalOpinions.REJECT.value
return rejectInspectExtension(res)
params.processApprovalRecord.commitFlag = ApprovalOpinions.REJECT.value
// 保存快照,成功了就调接口,失败了就提示
return this.saveSnapShotInfo(params).then(res => {
if (res.success) {
return rejectInspectExtension(params)
} else {
return res
}
})
}).then(res => {
if (res.success) {
this.$message.success(res.message)
@@ -1,6 +1,6 @@
<template>
<div>
<div class="table-operator" v-if="isInitiate">
<div class="table-operator" v-if="isInitiate && !disabled">
<!-- 新增 -->
<a-button icon="plus" type="primary" @click="handleAdd">{{ $t('newlyAdded') }}</a-button>
</div>
@@ -35,6 +35,7 @@
v-model="record.liaisons"
:name-str="record.liaisons_dictText"
:showBtn="false"
:disabled="disabled"
:placeholder="$t('pleaseSelect')+$t('workCenter.incExtensionRequest.inspectionContactPerson')"
@nameChange="nameChange($event, record)" />
</div>
@@ -48,9 +49,9 @@
<!-- 操作 -->
<template slot="action" slot-scope="{text, record, index}">
<!-- 节点1显示申请延期和删除后续不显示操作列 -->
<a @click="handleRequestExtension(record, index)" >{{ $t('workCenter.incExtensionRequest.requestExtension') }}</a>
<a @click="handleRequestExtension(record, index)" :disabled="disabled">{{ $t('workCenter.incExtensionRequest.requestExtension') }}</a>
<a-divider type="vertical" />
<a @click="handleDelete(index)" >{{ $t('delete') }}</a>
<a @click="handleDelete(index)" :disabled="disabled">{{ $t('delete') }}</a>
</template>
</j-table>
</div>
@@ -75,6 +76,12 @@ export default {
components: { UserSelectByContact, RequestExtensionModal, ExtensionRequestTableModal, JTable },
mixins: [JeroListMixin],
props: {
// 禁用
disabled: {
type: Boolean,
default: false,
required: false
},
// 当前节点
currentNode: {
type: String,