update 企标稽查所有流程调整

This commit is contained in:
danshihao
2023-11-24 14:26:23 +08:00
parent 0c12db10d9
commit d76cafba17
11 changed files with 1076 additions and 356 deletions
@@ -143,9 +143,6 @@ export default {
mixins: [WorkCenterMixin],
data () {
return {
// 当前流程信息
EsInspectionPlan,
info: {},
loading: false,
switchValue: 'base',
disabled: false,
@@ -165,6 +162,9 @@ export default {
xs: { span: 24 },
sm: { span: 22 }
},
// 当前流程信息
EsInspectionPlan,
info: {},
currentNode: '',
currentNodeName: '',
// 项目id
@@ -199,9 +199,11 @@ export default {
validateTrigger: 'change'
}
},
// 流程基本信息
// 流程表单
processInfoForm: this.$form.createForm(this),
// 会签表单
countersignForm: this.$form.createForm(this),
// 流程审批信息表单
approvalInfoForm: this.$form.createForm(this),
// 是否会签
isCountersign: null,
@@ -212,9 +214,10 @@ export default {
},
computed: {
pageTitle () {
return this.$t('flowCenter') + this.$route.meta.title + '' + this.subTitle + ''
return this.$t('flowCenter') + this.$route.meta.title + '' + this.nodeTitle + ''
},
subTitle () {
// 节点标题
nodeTitle () {
return this.$route.query.taskName || EsInspectionPlan.initiate.text
},
processDisabled () {
@@ -231,8 +234,9 @@ export default {
this.currentNode = nodeId || EsInspectionPlan.initiate.value
this.currentNodeName = taskName || EsInspectionPlan.initiate.text
this.projectId = projectId
this.btn = EsInspectionPlan.propertyOfValue('btn', this.currentNode)
// 查询人员信息
this.getPersonInfoStructure(ProcessKey.ES_Inspection_Plan.value, () => {
this.getPersonInfoStructure(ProcessKey.ES_INSPECTION_PLAN.value, () => {
this.initPersonInfoData(this.currentNode === EsInspectionPlan.initiate.value)
})
// 如果是待办进来,就获取详情数据
@@ -249,8 +253,6 @@ export default {
*/
getProjectId () {
this.loading = true
this.currentNode = EsInspectionPlan.initiate.value
this.btn = EsInspectionPlan.initiate.btn
// 否则就是创建一个新的流程
getInspectPlanProjectId().then(res => {
if (res) {
@@ -265,23 +267,6 @@ export default {
*/
loadPage () {
const { projectId, taskId } = this.$route.query
switch (this.currentNode) {
case EsInspectionPlan.initiate.value:
this.btn = EsInspectionPlan.initiate.btn
break
case EsInspectionPlan.fillInComments.value:
this.btn = EsInspectionPlan.fillInComments.btn
break
case EsInspectionPlan.liaisonCollect.value:
this.btn = EsInspectionPlan.liaisonCollect.btn
break
case EsInspectionPlan.relevantPersonnelCountersign.value:
this.btn = EsInspectionPlan.relevantPersonnelCountersign.btn
break
case EsInspectionPlan.liaisonLeaderApproval.value:
this.btn = EsInspectionPlan.liaisonLeaderApproval.btn
break
}
this.loading = true
getInspectPlanDetail({
projectId,
@@ -332,11 +317,6 @@ export default {
const userList = this.$refs.inspectionPlanTable.dataSource.map(item => item.objectOfConsultation.split(',')).flat(Infinity)
personnelObj.opinionFillList = Array.from(new Set(userList))
}
// else if (this.currentNode === EsInspectionPlan.liaisonCollect.value) {
// // 节点3:只给后端leader
// const map = this.$refs.personnelInfo[funName]()
// personnelObj.leader = map.leader
// }
return personnelObj
},
// 获取页面参数
@@ -445,8 +425,7 @@ export default {
case EsInspectionPlan.initiate.value:
fn = startInspectPlan
break
case EsInspectionPlan.fillInComments.value:
case EsInspectionPlan.liaisonCollect.value:
default:
fn = approvalInspectPlan
break
}
@@ -19,7 +19,7 @@
rowKey="id"
:loading="loading"
:pagination="false"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:row-selection="hasTableOperator ? { selectedRowKeys: selectedRowKeys, onChange: onSelectChange, getCheckboxProps } : null"
:scroll="{x: '100%'}"
@change="tableOnChange">
@@ -271,6 +271,14 @@ export default {
this.filters.taskId = this.$route.query.taskId
},
methods: {
getCheckboxProps (record) {
const obj = { props: { disabled: false } }
// 第二个节点,只有自己的才能勾选删除
if (this.currentNode === EsInspectionPlan.fillInComments.value) {
obj.props.disabled = record.createBy !== this.$store.getters.userInfo.username
}
return obj
},
getData () {
return this.dataSource
},
@@ -1,5 +1,5 @@
<template>
<internal-detail-page :title="pageTitle" :content-padding="0">
<internal-detail-page :title="pageTitle" :content-padding="0" :loading="loading">
<!-- 标题右侧tab -->
<template v-slot:titleRightCustom>
<div class="table-operator-tab">
@@ -27,7 +27,7 @@
@change="event => event.target.value = event.target.value.trim()"
:disabled="disabled || processDisabled"
:maxLength="50"
v-decorator="['processName', validatorRules.processName]" />
v-decorator="['prcName', validatorRules.processName]" />
</a-form-item>
</a-col>
<a-col :span="12">
@@ -36,8 +36,8 @@
<a-date-picker :placeholder="$t('pleaseSelect') + $t('expirationDate')"
style="width: 100%"
:disabled="disabled || processDisabled"
value-format="YYYY-MM-DD"
v-decorator="['expirationDate']" />
value-format="YYYY-MM-DD hh:mm:ss"
v-decorator="['dueTime']" />
</a-form-item>
</a-col>
<a-col :span="24">
@@ -47,7 +47,7 @@
:maxLength="500"
:rows="4"
:disabled="disabled || processDisabled"
v-decorator="['processExplain']" />
v-decorator="['prcMes']" />
</a-form-item>
</a-col>
</a-row>
@@ -56,7 +56,7 @@
<!-- 业务基本信息 -->
<div class="process-part-title">{{ $t('basicServiceInformation') }}</div>
<!-- 流程表格 -->
<inspection-process-table :current-node="currentNode" />
<inspection-process-table ref="inspectionProcessTable" :current-node="currentNode" :project-id="projectId"/>
<!-- 流程审批信息 -->
<div class="process-part-title">{{ $t('processApprovalInformation') }}</div>
@@ -66,86 +66,56 @@
<a-textarea :placeholder="$t('pleaseEnter') + $t('remarks')"
:maxLength="500"
:rows="4"
v-decorator="['remarks', validatorRules.remarks]" />
v-decorator="['commitText', validatorRules.remarks]" />
</a-form-item>
<!--附件-->
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('businessSupport.questionAnswer.attach')">
<j-upload v-decorator="['file']" return-id />
<j-upload v-decorator="['commitFile']" return-id />
</a-form-item>
</a-form>
</div>
<!-- 人员信息 -->
<div v-if="switchValue === 'user'" class="detail-page-scroll-content p-0">
<process-detail-list :url="url">
<personnel-info slot="personnelInfo" :data="personnelInfoData" :currentNode="currentNode"></personnel-info>
<div v-show="switchValue === 'user'" class="detail-page-scroll-content p-0">
<process-detail-list>
<template #personnelInfo>
<personnel-info ref="personnelInfo" :data="personnelInfoData" :current-node="currentNodeName" />
</template>
</process-detail-list>
</div>
<div class="detail-page-bottom-operate-box">
<a-button type="primary" :loading="loading" @click="handleSave" ghost><i class="iconfont icon-save" />{{ $t('preservation') }}</a-button>
<a-button type="primary" :loading="loading" @click="handleSubmit" icon="upload">{{ $t('submit') }}</a-button>
<a-button type="primary" :loading="loading" @click="handleAgree" icon="check-circle">{{ $t('agree') }}</a-button>
<!--转办-->
<a-button v-if="1 & btn" type="primary" :loading="loading" @click="handleTurnTo" ghost icon="arrow-up">{{ $t('turnTo') }}</a-button>
<!--保存-->
<a-button v-if="2 & btn" type="primary" :loading="loading" @click="handleSave" ghost><i class="iconfont icon-save" />{{ $t('preservation') }}</a-button>
<!--提交-->
<a-button v-if="4 & btn" type="primary" :loading="loading" @click="handleSubmit" icon="upload">{{ $t('submit') }}</a-button>
<!--同意-->
<a-button v-if="8 & btn" type="primary" :loading="loading" @click="handleAgree" icon="check-circle">{{ $t('agree') }}</a-button>
<!--驳回-->
<a-button v-if="16 & btn" type="primary" :loading="loading" @click="handleReject" icon="close-circle">{{ $t('reject') }}</a-button>
</div>
<!--转办选人-->
<user-select-modal ref="userSelectModal" check-required @change="continueTurnTo" />
</internal-detail-page>
</template>
<script>
import '@assets/less/common.less'
import InternalDetailPage from '@comp/InternalDetailPage'
import ProcessDetailList from '@comp/ProcessDetailList'
import PersonnelInfo from '@comp/PersonnelInfo'
import ProcessDetailList from '@comp/ProcessDetailList'
import InspectionProcessTable
from '@views/workCenter/enterpriseStandardInspectionProcess/modules/InspectionProcessTable'
// 标准立项的人员信息
const approvalPersonalInfo = [ // 人员信息的数据
{
id: 1,
nodeName: '稽查负责人发起计划',
nodeRoleName: '稽查负责人',
canChoose: false,
userList: `系统管理员`
},
{
id: 2,
nodeName: '负责人主管级领导审批',
nodeRoleName: '负责人主管级领导',
canChoose: true,
chooseType: 'checkbox',
// chooseSource: 'contactManage',
fieldName: 'contactUser'
},
{
id: 3,
nodeName: '稽查负责人上传稽查报告和整改计划',
nodeRoleName: '稽查负责人',
canChoose: false,
chooseType: 'checkbox',
// chooseSource: 'contactManage',
fieldName: 'contactUser'
},
{
id: 4,
nodeName: '负责人主管级领导审批',
nodeRoleName: '负责人主管级领导',
canChoose: false,
chooseType: 'radio',
// chooseSource: 'contactManage',
fieldName: 'contactUser'
},
{
id: 5,
nodeName: '相关人员会签',
nodeRoleName: '相关人员',
canChoose: true,
chooseType: 'checkbox',
// chooseSource: 'contactManage',
fieldName: 'contactUser'
}
]
import UserSelectModal from '@comp/selection/UserSelectModal'
import { EsInspectionProcess, ProcessKey } from '@/enums/commonEnums'
import { WorkCenterMixin } from '@/mixins/WorkCenterMixin'
import { getInspectPlanDetail, getInspectPlanProjectId } from '@api/workCenter'
export default {
name: 'EnterpriseStandardInspectionProcess',
components: { InspectionProcessTable, PersonnelInfo, ProcessDetailList, InternalDetailPage },
components: { UserSelectModal, InspectionProcessTable, PersonnelInfo, ProcessDetailList, InternalDetailPage },
mixins: [WorkCenterMixin],
data () {
return {
loading: false,
@@ -167,8 +137,14 @@ export default {
xs: { span: 24 },
sm: { span: 22 }
},
currentNode: '5',
personnelInfoData: [], // 人员信息数据
// 当前流程信息
EsInspectionProcess,
info: {},
currentNode: '',
currentNodeName: '',
// 项目id
projectId: '',
btn: 0,
validatorRules: {
// 流程名称
processName: {
@@ -185,10 +161,10 @@ export default {
validateTrigger: 'blur'
}
},
// 流程表单
processInfoForm: this.$form.createForm(this),
// 流程审批信息表单
approvalInfoForm: this.$form.createForm(this),
// 是否会签
isCountersign: null,
url: {
list: '' // 人员信息右侧表的分页查询接口
}
@@ -196,41 +172,294 @@ export default {
},
computed: {
pageTitle () {
return this.$t('flowCenter') + this.$route.meta.title
return this.$t('flowCenter') + this.$route.meta.title + '' + this.nodeTitle + ''
},
// 节点标题
nodeTitle () {
return this.$route.query.taskName || EsInspectionProcess.initiate.text
},
processDisabled () {
return +this.currentNode > 1
return this.currentNode !== EsInspectionProcess.initiate.value
}
},
created () {
const { projectId, nodeId, taskName } = this.$route.query
// 发起、草稿进来没有nodeId,就默认发起节点
this.currentNode = nodeId || EsInspectionProcess.initiate.value
this.currentNodeName = taskName || EsInspectionProcess.initiate.text
this.projectId = projectId
this.btn = EsInspectionProcess.propertyOfValue('btn', this.currentNode)
// 查询人员信息
this.getPersonInfoStructure(ProcessKey.ES_INSPECTION_PROCESS.value, () => {
this.initPersonInfoData(this.currentNode === EsInspectionProcess.initiate.value)
})
// 如果是待办进来,就获取详情数据
if (this.$route.query.projectId) {
this.loadPage()
return
}
// 如果是新建进来,就获取项目id
this.getProjectId()
},
methods: {
switchChange (value) {
this.switchValue = value
/**
* 获取项目id
*/
getProjectId () {
this.loading = true
// 否则就是创建一个新的流程
getInspectPlanProjectId().then(res => {
if (res) {
this.projectId = res + ''
}
}).finally(() => {
this.loading = false
})
},
handleSave () {
// if (this.loading) return
/**
* 获取页面详情
*/
loadPage () {
const { projectId, taskId } = this.$route.query
this.btn = EsInspectionProcess.propertyOfValue('btn', this.currentNode)
this.loading = true
getInspectPlanDetail({
projectId,
taskId
}).then(res => {
if (res.success) {
const data = res.result || {}
const processAll = data.processAll || {}
const map = data.map || {}
const processApprovalRecord = data.processApprovalRecord || {}
this.info = data
// 页面回显
this.processInfoForm && this.processInfoForm.setFieldsValue({
prcName: processAll.prcName,
dueTime: processAll.dueTime,
prcMes: processAll.prcMes
})
this.countersignForm && this.countersignForm.setFieldsValue({
pass: this.convertPass(map.pass)
})
this.approvalInfoForm && this.approvalInfoForm.setFieldsValue({
commitText: processApprovalRecord.commitText,
commitFile: processApprovalRecord.commitFile
})
}
}).finally(() => {
this.loading = false
})
},
// 获取人员信息
getPersonInfo (isValidate = true) {
let personnelObj = {}
const funName = isValidate ? 'getDataObjVerify' : 'getDataObj'
// 节点1:所有的人员信息
if (this.currentNode === EsInspectionProcess.initiate.value) {
// 人员信息的数据, 处理成对象
personnelObj = this.$refs.personnelInfo[funName]()
if (!personnelObj) {
return false
}
// List拆成数组
for (const key in personnelObj) {
if (personnelObj[key] && key.includes('List')) {
personnelObj[key] = personnelObj[key].split(',')
}
}
// 通过表格中的所属部门人员获取稽查征求意见对象
const userList = this.$refs.inspectionPlanTable.dataSource.map(item => item.objectOfConsultation.split(',')).flat(Infinity)
personnelObj.opinionFillList = Array.from(new Set(userList))
}
return personnelObj
},
// 获取页面参数
async getPageParams (isValidate = true) {
if (this.$refs.inspectionPlanTable.dataSource.length === 0) {
this.$message.warning(this.$t('addAtLeastOneRowOfData'))
throw new Error('base')
}
const params = {}
// 收集所有表单信息
let formDataList = []
if (isValidate) {
formDataList = await this.validateFormList(this.processInfoForm, this.approvalInfoForm)
} else {
formDataList = [
this.processInfoForm.getFieldsValue(),
this.approvalInfoForm.getFieldsValue()
]
}
// 收集人员信息
const getPersonInfo = this.getPersonInfo(isValidate)
if (!getPersonInfo) {
throw new Error('user')
}
// 开始处理信息
// 流程信息
params.processAll = Object.assign({}, this.info.processAll, formDataList[0], {
projectId: this.projectId,
taskId: this.$route.query.taskId
})
// 处理其他参数
params.map = Object.assign({}, getPersonInfo)
// 流程审批信息
params.processApprovalRecord = Object.assign({}, this.info.processApprovalRecord, formDataList[1], {
projectId: this.projectId
})
return params
},
/**
* 转办弹框
*/
handleTurnTo () {
this.$refs.userSelectModal.open()
},
/**
* 转办
*/
continueTurnTo (userId) {
if (this.loading) return
this.loading = true
const params = {
taskId: this.$route.query.taskId,
userId
}
Promise.resolve(params).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warn(res.message)
}
}).finally(() => {
this.loading = false
})
},
/**
* 保存
*/
handleSave () {
if (this.loading) return
this.loading = true
this.getPageParams(false).then(res => {
console.log(res)
return Promise.resolve(res)
}).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warn(res.message)
}
}).catch((err) => {
console.log(err)
}).finally(() => {
this.loading = false
})
},
/**
* 提交
*/
handleSubmit () {
if (this.loading) return
this.currentNode = +this.currentNode + 1 + ''
this.loading = true
let fn
switch (this.currentNode) {
case EsInspectionProcess.initiate.value:
fn = Promise.resolve
break
default:
fn = Promise.resolve
break
}
this.getPageParams().then(res => {
console.log(res)
return fn && fn(res)
}).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warn(res.message)
}
}).catch((err) => {
this.switchChange(err.message)
}).finally(() => {
this.loading = false
})
},
/**
* 同意
*/
handleAgree () {
if (this.loading) return
this.currentNode = +this.currentNode + 1 + ''
this.loading = true
this.getPageParams().then(res => {
res.map.pass = true
return Promise.resolve(res)
}).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warn(res.message)
}
}).catch((err) => {
this.switchChange(err.message)
}).finally(() => {
this.loading = false
})
},
// 是否会签改变
changeIsCountersign (val) {
if (val === '1') {
this.isCountersign = true
} else if (val === '2') {
this.isCountersign = false
} else {
this.isCountersign = null
/**
* 驳回
*/
handleReject () {
if (this.loading) return
this.loading = true
this.getPageParams().then(res => {
res.map.pass = false
return Promise.resolve(res)
}).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warn(res.message)
}
}).catch((err) => {
this.switchChange(err.message)
}).finally(() => {
this.loading = false
})
},
/**
* 验证所有表单
* @param formList - 多个需要校验的表单实例
*/
validateFormList (...formList) {
const promiseList = []
for (const form of formList) {
promiseList.push(
new Promise((resolve, reject) => {
form.validateFields((err, val) => {
if (!err) {
resolve(val)
} else {
reject(err)
}
})
})
)
}
return Promise.all(promiseList).catch(() => {
throw new Error('base')
})
}
},
mounted () {
this.personnelInfoData = approvalPersonalInfo
}
}
</script>
@@ -91,6 +91,7 @@ export default {
}
]
return {
disableMixinCreated: true,
title: this.$t('workCenter.esInspectionProcess.inspectionContent'),
drawerWidth: 1000,
visible: false,
@@ -105,6 +106,8 @@ export default {
},
methods: {
show (record) {
this.filters = {}
this.loadData()
this.model = Object.assign({}, record)
this.visible = true
},
@@ -139,6 +139,7 @@ export default {
},
methods: {
show (record) {
this.filters = {}
this.loadData()
this.model = Object.assign({}, record)
this.visible = true
@@ -142,6 +142,7 @@ export default {
},
methods: {
show (record) {
this.filters = {}
this.loadData()
this.model = Object.assign({}, record)
this.visible = true
@@ -1,6 +1,6 @@
<template>
<div>
<div class="table-operator" v-if="['1'].includes(currentNode)">
<div class="table-operator" v-if="isInitiate">
<!-- 新增 -->
<a-button icon="plus" type="primary" @click="handleAdd" v-has="'enterpriseStandard:add'">{{ $t('newlyAdded') }}</a-button>
</div>
@@ -11,8 +11,7 @@
:dataSource="dataSource"
:can-drag="true"
rowKey="id"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:pagination="ipagination"
:pagination="false"
:scroll="{x: '100%'}"
@change="tableOnChange">
@@ -27,7 +26,7 @@
</template>
<!-- 实际稽查完成日期 -->
<template v-slot:actualInspectionCompletionDate="{text, record}">
<div class="table-form" v-if="currentNode === '3'">
<div class="table-form" v-if="isInputInspectionReport">
<j-date v-model="record.actualInspectionCompletionDate" :placeholder="$t('pleaseSelect')+$t('date')" showType="day"
style="width: 100%" :getCalendarContainer="(el) => getNumParentNode(el, 5)"></j-date>
</div>
@@ -40,7 +39,7 @@
<!-- 实际稽查人 -->
<template v-slot:actualInspector="{text, record}">
<div class="table-form" v-if="currentNode === '3'">
<div class="table-form" v-if="isInputInspectionReport">
<a-select v-model="record.actualInspector" style="width: 100%" allowClear
:placeholder="$t('pleaseSelect')+$t('workCenter.esInspectionProcess.actualInspector')">
<a-select-option v-for="item in userList" :key="item.id" :value="item.id">{{ item.realname + '(' + item.username + ')' }}</a-select-option>
@@ -56,10 +55,10 @@
<!-- 操作 -->
<template slot="action" slot-scope="{text, record, index}">
<!-- 节点1显示稽查内容和删除节点2显示稽查内容只读 -->
<template v-if="['1', '2'].includes(currentNode)">
<template v-if="isInitiate || isDirectorLeaderApprovalOne">
<a @click="handleInspectionContent(record, index)" >{{ $t('workCenter.esInspectionProcess.inspectionContent') + `(${record.num || 0}${$t('strip')})` }}</a>
<a-divider type="vertical" />
<a v-if="currentNode === '1'" @click="handleDelete(record, index)" >{{ $t('delete') }}</a>
<a v-if="isInitiate" @click="handleDelete(record, index)" >{{ $t('delete') }}</a>
</template>
<!-- 后续节点都显示稽查报告和整改计划 -->
<template v-else>
@@ -74,11 +73,11 @@
<!-- 添加稽查计划 -->
<inspection-process-table-modal ref="inspectionProcessTableModal" @ok="modalFormOk"/>
<!-- 稽查内容节点2只查看后续不显示 -->
<inspection-process-content ref="inspectionProcessContent" @ok="modalFormOk" :disabled="['2'].includes(currentNode)"/>
<inspection-process-content ref="inspectionProcessContent" @ok="modalFormOk" :disabled="!isInitiate"/>
<!-- 稽查报告节点3填写后续只查看 -->
<inspection-process-report v-drag-modal ref="inspectionProcessReport" @ok="modalFormOk" :disabled="['4', '5'].includes(currentNode)"/>
<inspection-process-report ref="inspectionProcessReport" @ok="modalFormOk" :disabled="!isInputInspectionReport"/>
<!-- 整改计划节点3填写后续只查看 -->
<inspection-process-rectification-plan ref="inspectionProcessRectificationPlan" @ok="modalFormOk" :disabled="['4', '5'].includes(currentNode)"/>
<inspection-process-rectification-plan ref="inspectionProcessRectificationPlan" @ok="modalFormOk" :disabled="!isInputInspectionReport"/>
</div>
</template>
@@ -94,6 +93,7 @@ import InspectionProcessReport
from '@views/workCenter/enterpriseStandardInspectionProcess/modules/InspectionProcessReport'
import InspectionProcessRectificationPlan
from '@views/workCenter/enterpriseStandardInspectionProcess/modules/InspectionProcessRectificationPlan'
import { EsInspectionProcess } from '@/enums/commonEnums'
export default {
name: 'InspectionProcessTable',
components: { InspectionProcessRectificationPlan, InspectionProcessReport, InspectionProcessContent, InspectionProcessTableModal, JTable },
@@ -112,34 +112,7 @@ export default {
},
model: {},
userList: [],
dataSource: [
{
id: 1,
inspectionBasisStandardName: '123',
inspectionBasisStandardNumber: '123',
detailFlag: true,
departOpinion: '123',
mainDutyStandardizationGroup: '1699358097292472322'
},
{
id: 3,
inspectionBasisStandardName: 'qaaa',
inspectionBasisStandardNumber: '12asdasdas3',
detailFlag: true,
departOpinion: '123',
opinion: [],
mainDutyStandardizationGroup: '1699358097292472322'
},
{
id: 2,
inspectionBasisStandardName: '123',
inspectionBasisStandardNumber: '123',
detailFlag: true,
departOpinion: '123',
userId: 'e9ca23d68d884d4ebb19d07889727dae'
// mainDutyStandardizationGroup: '1699358097292472322'
}
],
dataSource: [],
allColumns: [
{
title: this.$t('serialNumber'),
@@ -205,7 +178,11 @@ export default {
align: 'center',
width: 200,
dataIndex: 'actualInspectionCompletionDate',
showCodeList: ['3', '4', '5'],
showCodeList: [
EsInspectionProcess.inputInspectionReport.value,
EsInspectionProcess.directorLeaderApprovalTwo.value,
EsInspectionProcess.relevantPersonnelCountersign.value
],
scopedSlots: { customRender: 'actualInspectionCompletionDate' }
},
{ // 实际稽查人
@@ -213,7 +190,11 @@ export default {
align: 'center',
width: 200,
dataIndex: 'actualInspector',
showCodeList: ['3', '4', '5'],
showCodeList: [
EsInspectionProcess.inputInspectionReport.value,
EsInspectionProcess.directorLeaderApprovalTwo.value,
EsInspectionProcess.relevantPersonnelCountersign.value
],
scopedSlots: { customRender: 'actualInspector' }
},
{
@@ -229,6 +210,26 @@ export default {
}
},
computed: {
// 是否第一个节点
isInitiate () {
return this.currentNode === EsInspectionProcess.initiate.value
},
// 是否第二个节点
isDirectorLeaderApprovalOne () {
return this.currentNode === EsInspectionProcess.directorLeaderApprovalOne.value
},
// 是否第三个节点
isInputInspectionReport () {
return this.currentNode === EsInspectionProcess.inputInspectionReport.value
},
// 是否第四个节点
isDirectorLeaderApprovalTwo () {
return this.currentNode === EsInspectionProcess.directorLeaderApprovalTwo.value
},
// 是否第五个节点
isRelevantPersonnelCountersign () {
return this.currentNode === EsInspectionProcess.relevantPersonnelCountersign.value
},
// 按节点进行过滤
columns () {
return this.allColumns.filter(item => {
@@ -242,7 +243,7 @@ export default {
}
},
mounted () {
if (this.currentNode === '3') {
if (this.isInputInspectionReport) {
this.getUserList()
}
},
@@ -1,5 +1,5 @@
<template>
<internal-detail-page :title="pageTitle" :content-padding="0">
<internal-detail-page :title="pageTitle" :content-padding="0" :loading="loading">
<!-- 标题右侧tab -->
<template v-slot:titleRightCustom>
<div class="table-operator-tab">
@@ -27,7 +27,7 @@
@change="event => event.target.value = event.target.value.trim()"
disabled
:maxLength="50"
v-decorator="['processName', validatorRules.processName]" />
v-decorator="['prcName', validatorRules.processName]" />
</a-form-item>
</a-col>
<a-col :span="12">
@@ -36,8 +36,8 @@
<a-date-picker :placeholder="$t('pleaseSelect') + $t('expirationDate')"
style="width: 100%"
:disabled="disabled || processDisabled"
value-format="YYYY-MM-DD"
v-decorator="['expirationDate']" />
value-format="YYYY-MM-DD hh:mm:ss"
v-decorator="['dueTime']" />
</a-form-item>
</a-col>
<a-col :span="24">
@@ -47,7 +47,7 @@
:maxLength="500"
:rows="4"
:disabled="disabled || processDisabled"
v-decorator="['processExplain']" />
v-decorator="['prcMes']" />
</a-form-item>
</a-col>
</a-row>
@@ -55,9 +55,8 @@
<!-- 业务基本信息 -->
<div class="process-part-title">{{ $t('basicServiceInformation') }}</div>
<!-- 基本信息 -->
<base-info-form :disabled="currentNode > 1"/>
<base-info-form ref="baseInfoForm" :disabled="processDisabled"/>
<!-- 流程审批信息 -->
<div class="process-part-title">{{ $t('processApprovalInformation') }}</div>
@@ -67,76 +66,55 @@
<a-textarea :placeholder="$t('pleaseEnter') + $t('remarks')"
:maxLength="500"
:rows="4"
v-decorator="['remarks', validatorRules.remarks]" />
v-decorator="['commitText', validatorRules.remarks]" />
</a-form-item>
<!--附件-->
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('businessSupport.questionAnswer.attach')">
<j-upload v-decorator="['file']" return-id />
<j-upload v-decorator="['commitFile']" return-id />
</a-form-item>
</a-form>
</div>
<!-- 人员信息 -->
<div v-if="switchValue === 'user'" class="detail-page-scroll-content p-0">
<process-detail-list :url="url">
<personnel-info slot="personnelInfo" :data="personnelInfoData" :currentNode="currentNode"></personnel-info>
<div v-show="switchValue === 'user'" class="detail-page-scroll-content p-0">
<process-detail-list>
<template #personnelInfo>
<personnel-info ref="personnelInfo" :data="personnelInfoData" :current-node="currentNodeName" />
</template>
</process-detail-list>
</div>
<div class="detail-page-bottom-operate-box">
<a-button type="primary" :loading="loading" @click="handleSave" ghost><i class="iconfont icon-save" />{{ $t('preservation') }}</a-button>
<a-button type="primary" :loading="loading" @click="handleSubmit" icon="upload">{{ $t('submit') }}</a-button>
<a-button type="primary" :loading="loading" @click="handleAgree" icon="check-circle">{{ $t('agree') }}</a-button>
<!--转办-->
<a-button v-if="1 & btn" type="primary" :loading="loading" @click="handleTurnTo" ghost icon="arrow-up">{{ $t('turnTo') }}</a-button>
<!--保存-->
<a-button v-if="2 & btn" type="primary" :loading="loading" @click="handleSave" ghost><i class="iconfont icon-save" />{{ $t('preservation') }}</a-button>
<!--提交-->
<a-button v-if="4 & btn" type="primary" :loading="loading" @click="handleSubmit" icon="upload">{{ $t('submit') }}</a-button>
<!--同意-->
<a-button v-if="8 & btn" type="primary" :loading="loading" @click="handleAgree" icon="check-circle">{{ $t('agree') }}</a-button>
<!--驳回-->
<a-button v-if="16 & btn" type="primary" :loading="loading" @click="handleReject" icon="close-circle">{{ $t('reject') }}</a-button>
</div>
<!--转办选人-->
<user-select-modal ref="userSelectModal" check-required @change="continueTurnTo" />
</internal-detail-page>
</template>
<script>
import '@assets/less/common.less'
import InternalDetailPage from '@comp/InternalDetailPage'
import ProcessDetailList from '@comp/ProcessDetailList'
import PersonnelInfo from '@comp/PersonnelInfo'
import BaseInfoForm from '@views/workCenter/enterpriseStandardInspectionRectification/modules/BaseInfoForm'
// 标准立项的人员信息
const approvalPersonalInfo = [ // 人员信息的数据
{
id: 1,
nodeName: '稽查负责人申请延期',
nodeRoleName: '稽查负责人',
canChoose: false,
userList: `系统管理员`
},
{
id: 2,
nodeName: '负责人主管级领导审批',
nodeRoleName: '负责人主管级领导',
canChoose: true,
chooseType: 'radio',
// chooseSource: 'contactManage',
fieldName: 'contactUser'
},
{
id: 3,
nodeName: '稽查联络人评估',
nodeRoleName: '稽查联络人',
canChoose: false,
chooseType: 'checkbox',
// chooseSource: 'contactManage',
fieldName: 'contactUser'
},
{
id: 4,
nodeName: '负责人主管级上一级领导审批',
nodeRoleName: '负责人主管级上一级领导',
canChoose: false,
chooseType: 'radio',
// chooseSource: 'contactManage',
fieldName: 'contactUser'
}
]
import UserSelectModal from '@comp/selection/UserSelectModal'
import { WorkCenterMixin } from '@/mixins/WorkCenterMixin'
import { getInspectPlanDetail, getInspectPlanProjectId } from '@api/workCenter'
import { EsInspectionRectification, ProcessKey } from '@/enums/commonEnums'
export default {
name: 'EnterpriseStandardInspectionRectification',
components: { BaseInfoForm, PersonnelInfo, ProcessDetailList, InternalDetailPage },
components: { UserSelectModal, BaseInfoForm, PersonnelInfo, ProcessDetailList, InternalDetailPage },
mixins: [WorkCenterMixin],
data () {
return {
loading: false,
@@ -158,8 +136,14 @@ export default {
xs: { span: 24 },
sm: { span: 22 }
},
currentNode: '2',
personnelInfoData: [], // 人员信息数据
// 当前流程信息
EsInspectionRectification,
info: {},
currentNode: '',
currentNodeName: '',
// 项目id
projectId: '',
btn: 0,
validatorRules: {
// 流程名称
processName: {
@@ -176,10 +160,10 @@ export default {
validateTrigger: 'blur'
}
},
// 流程表单
processInfoForm: this.$form.createForm(this),
// 流程审批信息表单
approvalInfoForm: this.$form.createForm(this),
// 是否会签
isCountersign: null,
url: {
list: '' // 人员信息右侧表的分页查询接口
}
@@ -187,41 +171,294 @@ export default {
},
computed: {
pageTitle () {
return this.$t('flowCenter') + this.$route.meta.title
return this.$t('flowCenter') + this.$route.meta.title + '' + this.nodeTitle + ''
},
// 节点标题
nodeTitle () {
return this.$route.query.taskName || EsInspectionRectification.initiate.text
},
processDisabled () {
return +this.currentNode > 1
return this.currentNode !== EsInspectionRectification.uploadRectificationResult.value
}
},
created () {
const { projectId, nodeId, taskName } = this.$route.query
// 发起、草稿进来没有nodeId,就默认发起节点
this.currentNode = nodeId || EsInspectionRectification.initiate.value
this.currentNodeName = taskName || EsInspectionRectification.initiate.text
this.projectId = projectId
this.btn = EsInspectionRectification.propertyOfValue('btn', this.currentNode)
// 查询人员信息
this.getPersonInfoStructure(ProcessKey.ES_INSPECTION_RECTIFICATION.value, () => {
this.initPersonInfoData(this.currentNode === EsInspectionRectification.initiate.value)
})
// 如果是待办进来,就获取详情数据
if (this.$route.query.projectId) {
this.loadPage()
return
}
// 如果是新建进来,就获取项目id
this.getProjectId()
},
methods: {
switchChange (value) {
this.switchValue = value
/**
* 获取项目id
*/
getProjectId () {
this.loading = true
// 否则就是创建一个新的流程
getInspectPlanProjectId().then(res => {
if (res) {
this.projectId = res + ''
}
}).finally(() => {
this.loading = false
})
},
handleSave () {
// if (this.loading) return
/**
* 获取页面详情
*/
loadPage () {
const { projectId, taskId } = this.$route.query
this.btn = EsInspectionRectification.propertyOfValue('btn', this.currentNode)
this.loading = true
getInspectPlanDetail({
projectId,
taskId
}).then(res => {
if (res.success) {
const data = res.result || {}
const processAll = data.processAll || {}
const map = data.map || {}
const processApprovalRecord = data.processApprovalRecord || {}
this.info = data
// 页面回显
this.processInfoForm && this.processInfoForm.setFieldsValue({
prcName: processAll.prcName,
dueTime: processAll.dueTime,
prcMes: processAll.prcMes
})
this.countersignForm && this.countersignForm.setFieldsValue({
pass: this.convertPass(map.pass)
})
this.approvalInfoForm && this.approvalInfoForm.setFieldsValue({
commitText: processApprovalRecord.commitText,
commitFile: processApprovalRecord.commitFile
})
}
}).finally(() => {
this.loading = false
})
},
// 获取人员信息
getPersonInfo (isValidate = true) {
let personnelObj = {}
const funName = isValidate ? 'getDataObjVerify' : 'getDataObj'
// 节点1:所有的人员信息
if (this.currentNode === EsInspectionRectification.uploadRectificationResult.value) {
// 人员信息的数据, 处理成对象
personnelObj = this.$refs.personnelInfo[funName]()
if (!personnelObj) {
return false
}
// List拆成数组
for (const key in personnelObj) {
if (personnelObj[key] && key.includes('List')) {
personnelObj[key] = personnelObj[key].split(',')
}
}
// 通过表格中的所属部门人员获取稽查征求意见对象
const userList = this.$refs.inspectionPlanTable.dataSource.map(item => item.objectOfConsultation.split(',')).flat(Infinity)
personnelObj.opinionFillList = Array.from(new Set(userList))
}
return personnelObj
},
// 获取页面参数
async getPageParams (isValidate = true) {
if (this.$refs.inspectionPlanTable.dataSource.length === 0) {
this.$message.warning(this.$t('addAtLeastOneRowOfData'))
throw new Error('base')
}
const params = {}
// 收集所有表单信息
let formDataList = []
if (isValidate) {
formDataList = await this.validateFormList(this.processInfoForm, this.approvalInfoForm)
} else {
formDataList = [
this.processInfoForm.getFieldsValue(),
this.approvalInfoForm.getFieldsValue()
]
}
// 收集人员信息
const getPersonInfo = this.getPersonInfo(isValidate)
if (!getPersonInfo) {
throw new Error('user')
}
// 开始处理信息
// 流程信息
params.processAll = Object.assign({}, this.info.processAll, formDataList[0], {
projectId: this.projectId,
taskId: this.$route.query.taskId
})
// 处理其他参数
params.map = Object.assign({}, getPersonInfo)
// 流程审批信息
params.processApprovalRecord = Object.assign({}, this.info.processApprovalRecord, formDataList[1], {
projectId: this.projectId
})
return params
},
/**
* 转办弹框
*/
handleTurnTo () {
this.$refs.userSelectModal.open()
},
/**
* 转办
*/
continueTurnTo (userId) {
if (this.loading) return
this.loading = true
const params = {
taskId: this.$route.query.taskId,
userId
}
Promise.resolve(params).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warn(res.message)
}
}).finally(() => {
this.loading = false
})
},
/**
* 保存
*/
handleSave () {
if (this.loading) return
this.loading = true
this.getPageParams(false).then(res => {
console.log(res)
return Promise.resolve(res)
}).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warn(res.message)
}
}).catch((err) => {
console.log(err)
}).finally(() => {
this.loading = false
})
},
/**
* 提交
*/
handleSubmit () {
if (this.loading) return
this.currentNode = +this.currentNode + 1 + ''
this.loading = true
let fn
switch (this.currentNode) {
case EsInspectionRectification.uploadRectificationResult.value:
fn = Promise.resolve
break
default:
fn = Promise.resolve
break
}
this.getPageParams().then(res => {
console.log(res)
return fn && fn(res)
}).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warn(res.message)
}
}).catch((err) => {
this.switchChange(err.message)
}).finally(() => {
this.loading = false
})
},
/**
* 同意
*/
handleAgree () {
if (this.loading) return
this.currentNode = +this.currentNode + 1 + ''
this.loading = true
this.getPageParams().then(res => {
res.map.pass = true
return Promise.resolve(res)
}).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warn(res.message)
}
}).catch((err) => {
this.switchChange(err.message)
}).finally(() => {
this.loading = false
})
},
// 是否会签改变
changeIsCountersign (val) {
if (val === '1') {
this.isCountersign = true
} else if (val === '2') {
this.isCountersign = false
} else {
this.isCountersign = null
/**
* 驳回
*/
handleReject () {
if (this.loading) return
this.loading = true
this.getPageParams().then(res => {
res.map.pass = false
return Promise.resolve(res)
}).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warn(res.message)
}
}).catch((err) => {
this.switchChange(err.message)
}).finally(() => {
this.loading = false
})
},
/**
* 验证所有表单
* @param formList - 多个需要校验的表单实例
*/
validateFormList (...formList) {
const promiseList = []
for (const form of formList) {
promiseList.push(
new Promise((resolve, reject) => {
form.validateFields((err, val) => {
if (!err) {
resolve(val)
} else {
reject(err)
}
})
})
)
}
return Promise.all(promiseList).catch(() => {
throw new Error('base')
})
}
},
mounted () {
this.personnelInfoData = approvalPersonalInfo
}
}
</script>
@@ -1,5 +1,5 @@
<template>
<internal-detail-page :title="pageTitle" :content-padding="0">
<internal-detail-page :title="pageTitle" :content-padding="0" :loading="loading">
<!-- 标题右侧tab -->
<template v-slot:titleRightCustom>
<div class="table-operator-tab">
@@ -27,7 +27,7 @@
@change="event => event.target.value = event.target.value.trim()"
:disabled="disabled || processDisabled"
:maxLength="50"
v-decorator="['processName', validatorRules.processName]" />
v-decorator="['prcName', validatorRules.processName]" />
</a-form-item>
</a-col>
<a-col :span="12">
@@ -36,8 +36,8 @@
<a-date-picker :placeholder="$t('pleaseSelect') + $t('expirationDate')"
style="width: 100%"
:disabled="disabled || processDisabled"
value-format="YYYY-MM-DD"
v-decorator="['expirationDate']" />
value-format="YYYY-MM-DD hh:mm:ss"
v-decorator="['dueTime']" />
</a-form-item>
</a-col>
<a-col :span="24">
@@ -47,7 +47,7 @@
:maxLength="500"
:rows="4"
:disabled="disabled || processDisabled"
v-decorator="['processExplain']" />
v-decorator="['prcMes']" />
</a-form-item>
</a-col>
</a-row>
@@ -56,7 +56,7 @@
<!-- 业务基本信息 -->
<div class="process-part-title">{{ $t('basicServiceInformation') }}</div>
<!-- 流程表格 -->
<extension-request-table :current-node="currentNode"/>
<extension-request-table ref="extensionRequestTable" :current-node="currentNode" :project-id="projectId"/>
<!-- 流程审批信息 -->
<div class="process-part-title">{{ $t('processApprovalInformation') }}</div>
@@ -66,76 +66,55 @@
<a-textarea :placeholder="$t('pleaseEnter') + $t('remarks')"
:maxLength="500"
:rows="4"
v-decorator="['remarks', validatorRules.remarks]" />
v-decorator="['commitText', validatorRules.remarks]" />
</a-form-item>
<!--附件-->
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('businessSupport.questionAnswer.attach')">
<j-upload v-decorator="['file']" return-id />
<j-upload v-decorator="['commitFile']" return-id />
</a-form-item>
</a-form>
</div>
<!-- 人员信息 -->
<div v-if="switchValue === 'user'" class="detail-page-scroll-content p-0">
<process-detail-list :url="url">
<personnel-info slot="personnelInfo" :data="personnelInfoData" :currentNode="currentNode"></personnel-info>
<div v-show="switchValue === 'user'" class="detail-page-scroll-content p-0">
<process-detail-list>
<template #personnelInfo>
<personnel-info ref="personnelInfo" :data="personnelInfoData" :current-node="currentNodeName" />
</template>
</process-detail-list>
</div>
<div class="detail-page-bottom-operate-box">
<a-button type="primary" :loading="loading" @click="handleSave" ghost><i class="iconfont icon-save" />{{ $t('preservation') }}</a-button>
<a-button type="primary" :loading="loading" @click="handleSubmit" icon="upload">{{ $t('submit') }}</a-button>
<a-button type="primary" :loading="loading" @click="handleAgree" icon="check-circle">{{ $t('agree') }}</a-button>
<!--转办-->
<a-button v-if="1 & btn" type="primary" :loading="loading" @click="handleTurnTo" ghost icon="arrow-up">{{ $t('turnTo') }}</a-button>
<!--保存-->
<a-button v-if="2 & btn" type="primary" :loading="loading" @click="handleSave" ghost><i class="iconfont icon-save" />{{ $t('preservation') }}</a-button>
<!--提交-->
<a-button v-if="4 & btn" type="primary" :loading="loading" @click="handleSubmit" icon="upload">{{ $t('submit') }}</a-button>
<!--同意-->
<a-button v-if="8 & btn" type="primary" :loading="loading" @click="handleAgree" icon="check-circle">{{ $t('agree') }}</a-button>
<!--驳回-->
<a-button v-if="16 & btn" type="primary" :loading="loading" @click="handleReject" icon="close-circle">{{ $t('reject') }}</a-button>
</div>
<!--转办选人-->
<user-select-modal ref="userSelectModal" check-required @change="continueTurnTo" />
</internal-detail-page>
</template>
<script>
import '@assets/less/common.less'
import InternalDetailPage from '@comp/InternalDetailPage'
import ProcessDetailList from '@comp/ProcessDetailList'
import PersonnelInfo from '@comp/PersonnelInfo'
import ProcessDetailList from '@comp/ProcessDetailList'
import ExtensionRequestTable from '@views/workCenter/inspectionExtensionRequestProcess/modules/ExtensionRequestTable'
// 标准立项的人员信息
const approvalPersonalInfo = [ // 人员信息的数据
{
id: 1,
nodeName: '稽查负责人申请延期',
nodeRoleName: '稽查负责人',
canChoose: false,
userList: `系统管理员`
},
{
id: 2,
nodeName: '负责人主管级领导审批',
nodeRoleName: '负责人主管级领导',
canChoose: true,
chooseType: 'radio',
// chooseSource: 'contactManage',
fieldName: 'contactUser'
},
{
id: 3,
nodeName: '稽查联络人评估',
nodeRoleName: '稽查联络人',
canChoose: false,
chooseType: 'checkbox',
// chooseSource: 'contactManage',
fieldName: 'contactUser'
},
{
id: 4,
nodeName: '负责人主管级上一级领导审批',
nodeRoleName: '负责人主管级上一级领导',
canChoose: false,
chooseType: 'radio',
// chooseSource: 'contactManage',
fieldName: 'contactUser'
}
]
import UserSelectModal from '@comp/selection/UserSelectModal'
import { InspectionExtensionRequestProcess, ProcessKey } from '@/enums/commonEnums'
import { WorkCenterMixin } from '@/mixins/WorkCenterMixin'
import { getInspectPlanDetail, getInspectPlanProjectId } from '@api/workCenter'
export default {
name: 'InspectionExtensionRequestProcess',
components: { ExtensionRequestTable, PersonnelInfo, ProcessDetailList, InternalDetailPage },
components: { UserSelectModal, ExtensionRequestTable, PersonnelInfo, ProcessDetailList, InternalDetailPage },
mixins: [WorkCenterMixin],
data () {
return {
loading: false,
@@ -157,8 +136,14 @@ export default {
xs: { span: 24 },
sm: { span: 22 }
},
currentNode: '4',
personnelInfoData: [], // 人员信息数据
// 当前流程信息
InspectionExtensionRequestProcess,
info: {},
currentNode: '',
currentNodeName: '',
// 项目id
projectId: '',
btn: 0,
validatorRules: {
// 流程名称
processName: {
@@ -175,10 +160,10 @@ export default {
validateTrigger: 'blur'
}
},
// 流程表单
processInfoForm: this.$form.createForm(this),
// 流程审批信息表单
approvalInfoForm: this.$form.createForm(this),
// 是否会签
isCountersign: null,
url: {
list: '' // 人员信息右侧表的分页查询接口
}
@@ -186,41 +171,294 @@ export default {
},
computed: {
pageTitle () {
return this.$t('flowCenter') + this.$route.meta.title
return this.$t('flowCenter') + this.$route.meta.title + '' + this.nodeTitle + ''
},
// 节点标题
nodeTitle () {
return this.$route.query.taskName || InspectionExtensionRequestProcess.initiate.text
},
processDisabled () {
return +this.currentNode > 1
return this.currentNode !== InspectionExtensionRequestProcess.initiate.value
}
},
created () {
const { projectId, nodeId, taskName } = this.$route.query
// 发起、草稿进来没有nodeId,就默认发起节点
this.currentNode = nodeId || InspectionExtensionRequestProcess.initiate.value
this.currentNodeName = taskName || InspectionExtensionRequestProcess.initiate.text
this.projectId = projectId
this.btn = InspectionExtensionRequestProcess.propertyOfValue('btn', this.currentNode)
// 查询人员信息
this.getPersonInfoStructure(ProcessKey.INSPECTION_EXTENSION_REQUEST_PROCESS.value, () => {
this.initPersonInfoData(this.currentNode === InspectionExtensionRequestProcess.initiate.value)
})
// 如果是待办进来,就获取详情数据
if (this.$route.query.projectId) {
this.loadPage()
return
}
// 如果是新建进来,就获取项目id
this.getProjectId()
},
methods: {
switchChange (value) {
this.switchValue = value
/**
* 获取项目id
*/
getProjectId () {
this.loading = true
// 否则就是创建一个新的流程
getInspectPlanProjectId().then(res => {
if (res) {
this.projectId = res + ''
}
}).finally(() => {
this.loading = false
})
},
handleSave () {
// if (this.loading) return
/**
* 获取页面详情
*/
loadPage () {
const { projectId, taskId } = this.$route.query
this.btn = InspectionExtensionRequestProcess.propertyOfValue('btn', this.currentNode)
this.loading = true
getInspectPlanDetail({
projectId,
taskId
}).then(res => {
if (res.success) {
const data = res.result || {}
const processAll = data.processAll || {}
const map = data.map || {}
const processApprovalRecord = data.processApprovalRecord || {}
this.info = data
// 页面回显
this.processInfoForm && this.processInfoForm.setFieldsValue({
prcName: processAll.prcName,
dueTime: processAll.dueTime,
prcMes: processAll.prcMes
})
this.countersignForm && this.countersignForm.setFieldsValue({
pass: this.convertPass(map.pass)
})
this.approvalInfoForm && this.approvalInfoForm.setFieldsValue({
commitText: processApprovalRecord.commitText,
commitFile: processApprovalRecord.commitFile
})
}
}).finally(() => {
this.loading = false
})
},
// 获取人员信息
getPersonInfo (isValidate = true) {
let personnelObj = {}
const funName = isValidate ? 'getDataObjVerify' : 'getDataObj'
// 节点1:所有的人员信息
if (this.currentNode === InspectionExtensionRequestProcess.initiate.value) {
// 人员信息的数据, 处理成对象
personnelObj = this.$refs.personnelInfo[funName]()
if (!personnelObj) {
return false
}
// List拆成数组
for (const key in personnelObj) {
if (personnelObj[key] && key.includes('List')) {
personnelObj[key] = personnelObj[key].split(',')
}
}
// 通过表格中的所属部门人员获取稽查征求意见对象
const userList = this.$refs.inspectionPlanTable.dataSource.map(item => item.objectOfConsultation.split(',')).flat(Infinity)
personnelObj.opinionFillList = Array.from(new Set(userList))
}
return personnelObj
},
// 获取页面参数
async getPageParams (isValidate = true) {
if (this.$refs.inspectionPlanTable.dataSource.length === 0) {
this.$message.warning(this.$t('addAtLeastOneRowOfData'))
throw new Error('base')
}
const params = {}
// 收集所有表单信息
let formDataList = []
if (isValidate) {
formDataList = await this.validateFormList(this.processInfoForm, this.approvalInfoForm)
} else {
formDataList = [
this.processInfoForm.getFieldsValue(),
this.approvalInfoForm.getFieldsValue()
]
}
// 收集人员信息
const getPersonInfo = this.getPersonInfo(isValidate)
if (!getPersonInfo) {
throw new Error('user')
}
// 开始处理信息
// 流程信息
params.processAll = Object.assign({}, this.info.processAll, formDataList[0], {
projectId: this.projectId,
taskId: this.$route.query.taskId
})
// 处理其他参数
params.map = Object.assign({}, getPersonInfo)
// 流程审批信息
params.processApprovalRecord = Object.assign({}, this.info.processApprovalRecord, formDataList[1], {
projectId: this.projectId
})
return params
},
/**
* 转办弹框
*/
handleTurnTo () {
this.$refs.userSelectModal.open()
},
/**
* 转办
*/
continueTurnTo (userId) {
if (this.loading) return
this.loading = true
const params = {
taskId: this.$route.query.taskId,
userId
}
Promise.resolve(params).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warn(res.message)
}
}).finally(() => {
this.loading = false
})
},
/**
* 保存
*/
handleSave () {
if (this.loading) return
this.loading = true
this.getPageParams(false).then(res => {
console.log(res)
return Promise.resolve(res)
}).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warn(res.message)
}
}).catch((err) => {
console.log(err)
}).finally(() => {
this.loading = false
})
},
/**
* 提交
*/
handleSubmit () {
if (this.loading) return
this.currentNode = +this.currentNode + 1 + ''
this.loading = true
let fn
switch (this.currentNode) {
case InspectionExtensionRequestProcess.initiate.value:
fn = Promise.resolve
break
default:
fn = Promise.resolve
break
}
this.getPageParams().then(res => {
console.log(res)
return fn && fn(res)
}).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warn(res.message)
}
}).catch((err) => {
this.switchChange(err.message)
}).finally(() => {
this.loading = false
})
},
/**
* 同意
*/
handleAgree () {
if (this.loading) return
this.currentNode = +this.currentNode + 1 + ''
this.loading = true
this.getPageParams().then(res => {
res.map.pass = true
return Promise.resolve(res)
}).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warn(res.message)
}
}).catch((err) => {
this.switchChange(err.message)
}).finally(() => {
this.loading = false
})
},
// 是否会签改变
changeIsCountersign (val) {
if (val === '1') {
this.isCountersign = true
} else if (val === '2') {
this.isCountersign = false
} else {
this.isCountersign = null
/**
* 驳回
*/
handleReject () {
if (this.loading) return
this.loading = true
this.getPageParams().then(res => {
res.map.pass = false
return Promise.resolve(res)
}).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warn(res.message)
}
}).catch((err) => {
this.switchChange(err.message)
}).finally(() => {
this.loading = false
})
},
/**
* 验证所有表单
* @param formList - 多个需要校验的表单实例
*/
validateFormList (...formList) {
const promiseList = []
for (const form of formList) {
promiseList.push(
new Promise((resolve, reject) => {
form.validateFields((err, val) => {
if (!err) {
resolve(val)
} else {
reject(err)
}
})
})
)
}
return Promise.all(promiseList).catch(() => {
throw new Error('base')
})
}
},
mounted () {
this.personnelInfoData = approvalPersonalInfo
}
}
</script>
@@ -1,6 +1,6 @@
<template>
<div>
<div class="table-operator" v-if="['1'].includes(currentNode)">
<div class="table-operator" v-if="isInitiate">
<!-- 新增 -->
<a-button icon="plus" type="primary" @click="handleAdd" v-has="'enterpriseStandard:add'">{{ $t('newlyAdded') }}</a-button>
</div>
@@ -11,8 +11,7 @@
:dataSource="dataSource"
:can-drag="true"
rowKey="id"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:pagination="ipagination"
:pagination="false"
:scroll="{x: '100%'}"
@change="tableOnChange">
@@ -28,7 +27,7 @@
<!-- 稽查联络人 -->
<template v-slot:inspectionContactPerson="{text, record}">
<div class="table-form" v-if="currentNode === '1'">
<div class="table-form" v-if="isInitiate">
<a-select v-model="record.inspectionContactPerson" style="width: 100%" allowClear
:placeholder="$t('pleaseSelect')+$t('workCenter.incExtensionRequest.inspectionContactPerson')">
<a-select-option v-for="item in userList" :key="item.id" :value="item.id">{{ item.realname + '(' + item.username + ')' }}</a-select-option>
@@ -64,6 +63,7 @@ import { getUserList } from '@api/api'
import ExtensionRequestTableModal
from '@views/workCenter/inspectionExtensionRequestProcess/modules/ExtensionRequestTableModal'
import RequestExtensionModal from '@views/workCenter/inspectionExtensionRequestProcess/modules/RequestExtensionModal'
import { InspectionExtensionRequestProcess } from '@/enums/commonEnums'
export default {
name: 'ExtensionRequestTable',
components: { RequestExtensionModal, ExtensionRequestTableModal, JTable },
@@ -82,34 +82,7 @@ export default {
},
model: {},
userList: [],
dataSource: [
{
id: 1,
inspectionBasisStandardName: '123',
inspectionBasisStandardNumber: '123',
detailFlag: true,
departOpinion: '123',
mainDutyStandardizationGroup: '1699358097292472322'
},
{
id: 3,
inspectionBasisStandardName: 'qaaa',
inspectionBasisStandardNumber: '12asdasdas3',
detailFlag: true,
departOpinion: '123',
opinion: [],
mainDutyStandardizationGroup: '1699358097292472322'
},
{
id: 2,
inspectionBasisStandardName: '123',
inspectionBasisStandardNumber: '123',
detailFlag: true,
departOpinion: '123',
userId: 'e9ca23d68d884d4ebb19d07889727dae'
// mainDutyStandardizationGroup: '1699358097292472322'
}
],
dataSource: [],
allColumns: [
{
title: this.$t('serialNumber'),
@@ -179,7 +152,9 @@ export default {
},
{ // 稽查联络人
title: this.$t('workCenter.incExtensionRequest.inspectionContactPerson'),
showCodeList: ['1'],
showCodeList: [
InspectionExtensionRequestProcess.initiate.value
],
align: 'center',
width: 200,
dataIndex: 'inspectionContactPerson',
@@ -189,7 +164,9 @@ export default {
// 操作
fixed: 'right',
title: this.$t('operation'),
showCodeList: ['1'],
showCodeList: [
InspectionExtensionRequestProcess.initiate.value
],
// dataIndex: 'action',
align: 'center',
width: 180,
@@ -199,6 +176,22 @@ export default {
}
},
computed: {
// 是否第一个节点
isInitiate () {
return this.currentNode === InspectionExtensionRequestProcess.initiate.value
},
// 是否第二个节点
isDirectorLeaderApproval () {
return this.currentNode === InspectionExtensionRequestProcess.directorLeaderApproval.value
},
// 是否第三个节点
isContactEvaluation () {
return this.currentNode === InspectionExtensionRequestProcess.contactEvaluation.value
},
// 是否第四个节点
isDirectorSuperiorLeaderApproval () {
return this.currentNode === InspectionExtensionRequestProcess.directorSuperiorLeaderApproval.value
},
// 按节点进行过滤
columns () {
return this.allColumns.filter(item => {
@@ -212,7 +205,7 @@ export default {
}
},
mounted () {
if (this.currentNode === '1') {
if (this.isInitiate) {
this.getUserList()
}
},