[update 查看详情] 企标稽查计划

This commit is contained in:
danshihao
2024-07-25 14:54:17 +08:00
parent 2f1f10423e
commit daaa2bfe0f
4 changed files with 143 additions and 31 deletions
@@ -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' : ''"
@@ -54,7 +54,7 @@
<!-- 业务基本信息 -->
<div class="process-part-title">{{ $t('basicServiceInformation') }}</div>
<inspection-plan-table style="margin-bottom: 40px;" ref="inspectionPlanTable" :current-node="currentNode" :project-id="projectId"/>
<inspection-plan-table style="margin-bottom: 40px;" ref="inspectionPlanTable" :current-node="currentNode" :project-id="projectId" :disabled="disabled"/>
<!-- 会签表单 -->
<a-form :form="countersignForm" v-if="currentNode === EsInspectionPlan.liaisonCollect.value">
<div class="form-flex-box">
@@ -63,6 +63,7 @@
<j-dict-select-tag :placeholder="$t('pleaseSelect') + $t('workCenter.esInspectionPlan.isCountersign')"
type="radio"
dictCode="yn"
:disabled="disabled"
@change="changeIsCountersign"
v-decorator="['countersignTag', validatorRules.isCountersign]" />
</a-form-item>
@@ -71,6 +72,8 @@
<a-form-item v-if="isCountersign" :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('workCenter.esInspectionPlan.countersignRelevantPersonnel')">
<user-selection :placeholder="$t('pleaseSelect') + $t('workCenter.esInspectionPlan.countersignRelevantPersonnel')"
type="checkbox" :nameStr="info.countersignDictText"
@nameChange="involveListNameChange"
:disabled="disabled"
v-decorator="['involveList', validatorRules.countersignRelevantPersonnel]" />
</a-form-item>
</div>
@@ -84,11 +87,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']" :disabled="disabled" return-id multiple />
</a-form-item>
</a-form>
</div>
@@ -101,7 +105,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>
<!--保存-->
@@ -126,12 +130,12 @@ import ProcessDetailList from '@comp/ProcessDetailList'
import InspectionPlanTable from '@views/workCenter/enterpriseStandardInspectionPlan/modules/InspectionPlanTable'
import UserSelection from '@comp/selection/UserSelection'
import { WorkCenterMixin } from '@/mixins/WorkCenterMixin'
import { ApprovalOpinions, EsInspectionPlan, ProcessKey } from '@/enums/commonEnums'
import { ApprovalOpinions, EsInspectionPlan, ProcessKey, ProcessType } from '@/enums/commonEnums'
import {
approvalInspectPlan,
getInspectPlanDetail,
getInspectPlanProjectId, rejectInspectPlan,
saveInspectPlan,
getInspectPlanProjectId, getLookData, rejectInspectPlan,
saveInspectPlan, saveSnapShot,
startInspectPlan, transferInspectPlan
} from '@api/workCenter'
import UserSelectModal from '@comp/selection/UserSelectModal'
@@ -145,7 +149,7 @@ export default {
return {
loading: false,
switchValue: 'base',
disabled: false,
disabled: false, // 快照禁用
labelCol: {
xs: { span: 24 },
sm: { span: 4 }
@@ -228,7 +232,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 || EsInspectionPlan.initiate.value
this.currentNodeName = taskName || EsInspectionPlan.initiate.text
@@ -243,6 +248,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()
@@ -404,6 +414,8 @@ export default {
// 保存清空校验
this.approvalInfoForm.validateFields(['commitText'], { force: true }, () => {})
}
// 保存一下所有表单收集的数据用于快照回显
params.formDataList = formDataList
// 收集人员信息
const personInfo = this.getPersonInfo(isValidate && !flag)
if (!personInfo) {
@@ -428,9 +440,9 @@ export default {
}
if (params.map.involveList && typeof params.map.involveList === 'string') {
params.countersign = params.map.involveList
params.countersignDictText = this.info.countersignDictText
params.map.involveList = params.map.involveList.split(',')
}
// 流程审批信息
params.processApprovalRecord = Object.assign({}, this.info.processApprovalRecord, formDataList[2], {
projectId: this.projectId
@@ -442,7 +454,9 @@ export default {
// 人员信息(要重新获取,流程里的信息不能直接用,后端需要多选人员处理成数组了)
personInfo: this.$refs.personnelInfo.getDataObj(),
// 业务表格数据,用于强制撤回后回显
draftData: params.processEsInspectPlanList
draftData: params.processEsInspectPlanList,
// 将流程数据保存json,后续进行快照回显
prcData: params
})
}
@@ -452,6 +466,71 @@ 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.ES_INSPECTION_PLAN.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 || {}
const countersignForm = prcData.formDataList[1] || {}
this.info = prcData
this.$refs.inspectionPlanTable.setData(prcData.processEsInspectPlanList || [])
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.countersignForm && this.countersignForm.setFieldsValue({
countersignTag: countersignForm.countersignTag,
involveList: countersignForm.countersign
})
})
// 触发会签改变
this.changeIsCountersign(countersignForm.countersignTag)
}).finally(() => {
this.loading = false
})
},
/**
* 转办弹框
*/
@@ -549,25 +628,32 @@ export default {
handleAgree (isSubmitBtn) {
if (this.loading) return
this.loading = true
this.getPageParams().then(res => {
this.getPageParams().then(params => {
// 节点三,pass决定是否跳过会签
if (this.currentNode === EsInspectionPlan.liaisonCollect.value) {
res.map.pass = this.convertPass(res.map.countersignTag)
params.map.pass = this.convertPass(params.map.countersignTag)
} else {
// 其他情况一直传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 approvalInspectPlan(res)
}).then(res => {
// 保存快照,成功了就调接口,失败了就提示
return this.saveSnapShotInfo(params).then(res => {
if (res.success) {
return approvalInspectPlan(params)
} else {
return res
}
})
}).then(async res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
@@ -605,12 +691,19 @@ 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 rejectInspectPlan(res)
}).then(res => {
params.processApprovalRecord.commitFlag = ApprovalOpinions.REJECT.value
// 保存快照,成功了就调接口,失败了就提示
return this.saveSnapShotInfo(params).then(res => {
if (res.success) {
return rejectInspectPlan(params)
} else {
return res
}
})
}).then(async res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
@@ -628,6 +721,10 @@ export default {
}, 1000)
})
},
// 会签人员名改变
involveListNameChange (name) {
this.info.countersignDictText = name
},
// 是否会签改变
changeIsCountersign (val) {
if (val === '1') {
@@ -1,6 +1,6 @@
<template>
<div>
<div class="table-operator" v-if="hasTableOperator">
<div class="table-operator" v-if="!disabled && hasTableOperator">
<!-- 新增 -->
<a-button icon="plus" type="primary" @click="handleAdd">{{ $t('newlyAdded') }}</a-button>
<!-- 下载模板 -->
@@ -41,16 +41,16 @@
<!-- 操作 -->
<template slot="action" slot-scope="{text, record, index}">
<!-- 编辑 and 删除:节点1 节点3 节点2且当前登录人是创建人 -->
<template v-if="isInitiateOrLiaisonCollect || (currentNode === EsInspectionPlan.fillInComments.value && currentUserName === record.createBy)">
<!-- (没有被禁用)编辑 and 删除:节点1 节点3 节点2且当前登录人是创建人 -->
<template v-if="!disabled && (isInitiateOrLiaisonCollect || (currentNode === EsInspectionPlan.fillInComments.value && currentUserName === record.createBy))">
<a @click="handleEdit(record, index)" >{{ $t('edit') }}</a>
<a-divider type="vertical" />
<a @click="handleDelete(index)" >{{ $t('delete') }}</a>
</template>
<!-- 意见 or 填写意见节点2非自己创建的就是意见和填写意见 -->
<!-- (被禁用只能查看意见)意见 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 @click="handleWriteOpinion(record, index)" >{{ $t('workCenter.esInspectionPlan.writeOpinion') }}</a>
<a v-else-if="!disabled" @click="handleWriteOpinion(record, index)" >{{ $t('workCenter.esInspectionPlan.writeOpinion') }}</a>
</template>
</template>
@@ -60,7 +60,7 @@
<!-- 新增/编辑稽查计划 -->
<inspection-plan-drawer ref="modalForm" @ok="handleAddOrEditCallback" :project-id="projectId"/>
<!-- 节点2填写意见意见回显 -->
<write-opinion-modal ref="writeOpinionModal" @ok="handleWriteOpinionCallback"/>
<write-opinion-modal ref="writeOpinionModal" @ok="handleWriteOpinionCallback" :disabled="disabled"/>
<!-- 节点3所属部门意见-查看 -->
<show-opinion-modal ref="showOpinionModal"/>
</div>
@@ -84,6 +84,12 @@ export default {
components: { ShowOpinionModal, WriteOpinionModal, InspectionPlanDrawer, JTable },
mixins: [JeroListMixin],
props: {
// 禁用
disabled: {
type: Boolean,
default: false,
required: false
},
// 当前节点
currentNode: {
type: String,
@@ -5,6 +5,7 @@
:visible="visible"
:confirmLoading="confirmLoading"
switchFullscreen
:footer="null"
@ok="handleOk"
@cancel="handleCancel"
:cancelText="$t('close')">
@@ -5,6 +5,7 @@
:visible="visible"
:confirmLoading="confirmLoading"
switchFullscreen
:okButtonProps="{ props: { disabled } }"
@ok="handleOk"
@cancel="handleCancel"
:cancelText="$t('close')">
@@ -34,7 +35,7 @@
<a-form-model-item
prop="opinion"
:label="$t('workCenter.esInspectionPlan.opinion')">
<a-textarea :max-length="500" :rows="4"
<a-textarea :max-length="500" :rows="4" :disabled="disabled"
:placeholder="$t('pleaseEnter') + $t('workCenter.esInspectionPlan.opinion')" v-model="formData.opinion"/>
</a-form-model-item>
</a-form-model>
@@ -49,6 +50,13 @@ import moment from 'moment'
export default {
name: 'WriteOpinionModal',
components: { JTable },
props: {
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
return {
title: this.$t('workCenter.esInspectionPlan.writeOpinion'),