update 企标稽查计划完善

This commit is contained in:
danshihao
2023-11-23 18:10:08 +08:00
parent 8ccd87a3f9
commit a67c3cf589
6 changed files with 162 additions and 126 deletions
-1
View File
@@ -217,7 +217,6 @@ module.exports = {
}, },
// 企标稽查计划 // 企标稽查计划
esInspectionPlan: { esInspectionPlan: {
node1: '稽查联络人发起计划',
inspectionPlan: '稽查计划', inspectionPlan: '稽查计划',
inspectionBasisStandardNumber: '稽查依据标准号', inspectionBasisStandardNumber: '稽查依据标准号',
inspectionBasisStandardName: '稽查依据标准名称', inspectionBasisStandardName: '稽查依据标准名称',
-1
View File
@@ -243,7 +243,6 @@ module.exports = {
}, },
// 企标稽查计划 // 企标稽查计划
esInspectionPlan: { esInspectionPlan: {
node1: '稽查联络人发起计划',
inspectionPlan: '稽查计划', inspectionPlan: '稽查计划',
inspectionBasisStandardNumber: '稽查依据标准号', inspectionBasisStandardNumber: '稽查依据标准号',
inspectionBasisStandardName: '稽查依据标准名称', inspectionBasisStandardName: '稽查依据标准名称',
@@ -15,6 +15,7 @@
<a-tree <a-tree
:checkable="true" :checkable="true"
:class="treeScreenClass" :class="treeScreenClass"
class="select-work-group-tree"
:treeData="treeData" :treeData="treeData"
:checkStrictly="checkStrictly" :checkStrictly="checkStrictly"
@check="onCheck" @check="onCheck"
@@ -120,7 +121,9 @@ export default {
} }
} }
} }
searchTree(this.treeData[0]) this.treeData.forEach(data => {
searchTree(data)
})
return nodes return nodes
}, },
// 处理工作组树数据结构 // 处理工作组树数据结构
@@ -129,6 +132,7 @@ export default {
item.title = item.name item.title = item.name
item.value = item.id item.value = item.id
item.key = item.id item.key = item.id
item.disabled = item.subset && item.subset.length
item.children = this.dealTreeData(item.subset) item.children = this.dealTreeData(item.subset)
return item return item
}) })
@@ -335,4 +339,13 @@ export default {
background: #fff; background: #fff;
border-radius: 0 0 2px 2px; border-radius: 0 0 2px 2px;
} }
.select-work-group-tree {
/deep/.ant-tree-checkbox-disabled {
display: none;
}
/deep/li.ant-tree-treenode-disabled > .ant-tree-node-content-wrapper span {
color: rgba(0, 0, 0, .65)
}
}
</style> </style>
@@ -36,7 +36,7 @@
<a-date-picker :placeholder="$t('pleaseSelect') + $t('expirationDate')" <a-date-picker :placeholder="$t('pleaseSelect') + $t('expirationDate')"
style="width: 100%" style="width: 100%"
:disabled="disabled || processDisabled" :disabled="disabled || processDisabled"
value-format="YYYY-MM-DD" value-format="YYYY-MM-DD hh:mm:ss"
v-decorator="['dueTime']" /> v-decorator="['dueTime']" />
</a-form-item> </a-form-item>
</a-col> </a-col>
@@ -55,28 +55,27 @@
<!-- 业务基本信息 --> <!-- 业务基本信息 -->
<div class="process-part-title">{{ $t('basicServiceInformation') }}</div> <div class="process-part-title">{{ $t('basicServiceInformation') }}</div>
<inspection-plan-table ref="inspectionPlanTable" :current-node="currentNode" :project-id="projectId"/> <inspection-plan-table class="form-add" ref="inspectionPlanTable" :current-node="currentNode" :project-id="projectId"/>
<!-- 会签表单 --> <!-- 会签表单 -->
<a-form :form="countersignForm" v-if="currentNode === EsInspectionPlan.liaisonCollect.value"> <a-form :form="countersignForm" v-if="currentNode === EsInspectionPlan.liaisonCollect.value">
<a-row type="flex"> <div class="form-flex-box">
<a-col :span="12"> <div class="form-flex-item custom-flex-form-item">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('workCenter.esInspectionPlan.isCountersign')"> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('workCenter.esInspectionPlan.isCountersign')">
<j-dict-select-tag :placeholder="$t('pleaseSelect') + $t('workCenter.esInspectionPlan.isCountersign')" <j-dict-select-tag :placeholder="$t('pleaseSelect') + $t('workCenter.esInspectionPlan.isCountersign')"
type="radio" type="radio"
dictCode="yn" dictCode="yn"
@change="changeIsCountersign" @change="changeIsCountersign"
v-decorator="['pass', validatorRules.isCountersign]" /> v-decorator="['pass', validatorRules.isCountersign]" />
</a-form-item> </a-form-item>
</a-col> </div>
<a-col :span="12"></a-col> <div class="form-flex-item custom-flex-form-item">
<a-col :span="12">
<a-form-item v-if="isCountersign" :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('workCenter.esInspectionPlan.countersignRelevantPersonnel')"> <a-form-item v-if="isCountersign" :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('workCenter.esInspectionPlan.countersignRelevantPersonnel')">
<user-selection :placeholder="$t('pleaseSelect') + $t('workCenter.esInspectionPlan.countersignRelevantPersonnel')" <user-selection :placeholder="$t('pleaseSelect') + $t('workCenter.esInspectionPlan.countersignRelevantPersonnel')"
type="checkbox" type="checkbox" :nameStr="involveNameStr"
v-decorator="['involveList', validatorRules.countersignRelevantPersonnel]" /> v-decorator="['involveList', validatorRules.countersignRelevantPersonnel]" />
</a-form-item> </a-form-item>
</a-col> </div>
</a-row> </div>
</a-form> </a-form>
<!-- 流程审批信息 --> <!-- 流程审批信息 -->
<div class="process-part-title">{{ $t('processApprovalInformation') }}</div> <div class="process-part-title">{{ $t('processApprovalInformation') }}</div>
@@ -98,7 +97,7 @@
<div v-show="switchValue === 'user'" class="detail-page-scroll-content p-0"> <div v-show="switchValue === 'user'" class="detail-page-scroll-content p-0">
<process-detail-list> <process-detail-list>
<template #personnelInfo> <template #personnelInfo>
<personnel-info ref="personnelInfo" :data="personnelInfoData" /> <personnel-info ref="personnelInfo" :data="personnelInfoData" :current-node="currentNodeName" />
</template> </template>
</process-detail-list> </process-detail-list>
</div> </div>
@@ -133,7 +132,6 @@ import {
approvalInspectPlan, approvalInspectPlan,
getInspectPlanDetail, getInspectPlanDetail,
getInspectPlanProjectId, getInspectPlanProjectId,
refusalInspectPlan,
saveInspectPlan, saveInspectPlan,
startInspectPlan, transferInspectPlan startInspectPlan, transferInspectPlan
} from '@api/workCenter' } from '@api/workCenter'
@@ -146,8 +144,8 @@ export default {
data () { data () {
return { return {
// 当前流程信息 // 当前流程信息
info: {},
EsInspectionPlan, EsInspectionPlan,
info: {},
loading: false, loading: false,
switchValue: 'base', switchValue: 'base',
disabled: false, disabled: false,
@@ -168,6 +166,7 @@ export default {
sm: { span: 22 } sm: { span: 22 }
}, },
currentNode: '', currentNode: '',
currentNodeName: '',
// 项目id // 项目id
projectId: '', projectId: '',
btn: 0, btn: 0,
@@ -216,20 +215,32 @@ export default {
return this.$t('flowCenter') + this.$route.meta.title + '' + this.subTitle + '' return this.$t('flowCenter') + this.$route.meta.title + '' + this.subTitle + ''
}, },
subTitle () { subTitle () {
return this.$route.query.taskName || this.$t('workCenter.esInspectionPlan.node1') return this.$route.query.taskName || EsInspectionPlan.initiate.text
}, },
processDisabled () { processDisabled () {
return this.currentNode !== EsInspectionPlan.initiate.value return this.currentNode !== EsInspectionPlan.initiate.value
},
// 会签人员回显
involveNameStr () {
return (this.info.map && this.info.map.involveListDictText) || ''
} }
}, },
created () { created () {
const { projectId, nodeId, taskName } = this.$route.query
// 发起、草稿进来没有nodeId,就默认发起节点
this.currentNode = nodeId || EsInspectionPlan.initiate.value
this.currentNodeName = taskName || EsInspectionPlan.initiate.text
this.projectId = projectId
// 查询人员信息 // 查询人员信息
this.getPersonInfoStructure(ProcessKey.ES_Inspection_Plan.value) this.getPersonInfoStructure(ProcessKey.ES_Inspection_Plan.value, () => {
this.initPersonInfoData(this.currentNode === EsInspectionPlan.initiate.value)
})
// 如果是待办进来,就获取详情数据 // 如果是待办进来,就获取详情数据
if (this.$route.query.projectId) { if (this.$route.query.projectId) {
this.loadPage() this.loadPage()
return return
} }
// 如果是新建进来,就获取项目id
this.getProjectId() this.getProjectId()
}, },
methods: { methods: {
@@ -238,12 +249,12 @@ export default {
*/ */
getProjectId () { getProjectId () {
this.loading = true this.loading = true
this.currentNode = EsInspectionPlan.initiate.value
this.btn = EsInspectionPlan.initiate.btn
// 否则就是创建一个新的流程 // 否则就是创建一个新的流程
getInspectPlanProjectId().then(res => { getInspectPlanProjectId().then(res => {
if (res) { if (res) {
this.projectId = res + '' this.projectId = res + ''
this.currentNode = EsInspectionPlan.initiate.value
this.btn = EsInspectionPlan.initiate.btn
} }
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
@@ -253,14 +264,7 @@ export default {
* 获取页面详情 * 获取页面详情
*/ */
loadPage () { loadPage () {
let { projectId, taskId, nodeId } = this.$route.query const { projectId, taskId } = this.$route.query
// 草稿进来没有nodeId,就默认发起节点
if (!nodeId) {
nodeId = EsInspectionPlan.initiate.value
}
this.currentNode = nodeId
this.projectId = projectId
this.initPersonInfoData(this.currentNode === EsInspectionPlan.initiate.value)
switch (this.currentNode) { switch (this.currentNode) {
case EsInspectionPlan.initiate.value: case EsInspectionPlan.initiate.value:
this.btn = EsInspectionPlan.initiate.btn this.btn = EsInspectionPlan.initiate.btn
@@ -285,110 +289,101 @@ export default {
}).then(res => { }).then(res => {
if (res.success) { if (res.success) {
const data = res.result || {} const data = res.result || {}
const processAll = data.processAll || {}
const map = data.map || {}
const processApprovalRecord = data.processApprovalRecord || {}
this.info = data this.info = data
this.$nextTick(() => { // 页面回显
this.processInfoForm.setFieldsValue({ this.processInfoForm && this.processInfoForm.setFieldsValue({
prcName: data.processAll.prcName, prcName: processAll.prcName,
dueTime: data.processAll.dueTime, dueTime: processAll.dueTime,
prcMes: data.processAll.prcMes prcMes: processAll.prcMes
})
}) })
this.$nextTick(() => { this.countersignForm && this.countersignForm.setFieldsValue({
this.approvalInfoForm.setFieldsValue({ pass: this.convertPass(map.pass)
commitText: data.processApprovalRecord.commitText, })
commitFile: data.processApprovalRecord.commitFile this.approvalInfoForm && this.approvalInfoForm.setFieldsValue({
}) commitText: processApprovalRecord.commitText,
commitFile: processApprovalRecord.commitFile
}) })
} }
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
}) })
}, },
switchChange (value) { // 获取人员信息
this.switchValue = value getPersonInfo (isValidate = true) {
let personnelObj = {}
const funName = isValidate ? 'getDataObjVerify' : 'getDataObj'
// 节点1:所有的人员信息
if (this.currentNode === EsInspectionPlan.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))
}
// else if (this.currentNode === EsInspectionPlan.liaisonCollect.value) {
// // 节点3:只给后端leader
// const map = this.$refs.personnelInfo[funName]()
// personnelObj.leader = map.leader
// }
return personnelObj
}, },
// 获取页面参数 // 获取页面参数
getPageParams (isValidate = true) { async getPageParams (isValidate = true) {
return new Promise((resolve, reject) => { if (this.$refs.inspectionPlanTable.dataSource.length === 0) {
const params = {} this.$message.warning(this.$t('addAtLeastOneRowOfData'))
if (isValidate) { throw new Error('base')
// 发起节点才获取人员信息 }
let personnelObj = {} const params = {}
if (this.currentNode === EsInspectionPlan.initiate.value) { // 收集所有表单信息
// 人员信息的数据, 处理成对象 let formDataList = []
personnelObj = this.$refs.personnelInfo.getDataObjVerify() if (isValidate) {
if (!personnelObj) { formDataList = await this.validateFormList(this.processInfoForm, this.countersignForm, this.approvalInfoForm)
return reject(new Error()) } else {
} formDataList = [
// List拆成数组 this.processInfoForm.getFieldsValue(),
for (const key in personnelObj) { this.countersignForm.getFieldsValue(),
if (personnelObj[key] && key.includes('List')) { this.approvalInfoForm.getFieldsValue()
personnelObj[key] = personnelObj[key].split(',') ]
} }
} // 收集人员信息
// 通过表格中的所属部门人员获取稽查征求意见对象 const getPersonInfo = this.getPersonInfo(isValidate)
personnelObj.opinionFillList = this.$refs.inspectionPlanTable.dataSource.map(item => item.objectOfConsultation) if (!getPersonInfo) {
} throw new Error('user')
// 校验表单 }
this.validateFormList(
this.processInfoForm,
this.countersignForm,
this.approvalInfoForm
).then(res => {
params.processAll = Object.assign({}, this.info.processAll, res[0])
if (params.processAll.dueTime && !params.processAll.dueTime.includes(' 00:00:00')) {
params.processAll.dueTime = params.processAll.dueTime + ' 00:00:00'
}
params.processAll.projectId = this.projectId
params.processAll.taskId = this.$route.query.taskId
params.processApprovalRecord = Object.assign({}, this.info.processApprovalRecord, res[2]) // 开始处理信息
params.processApprovalRecord.projectId = this.projectId // 流程信息
params.map = {} params.processAll = Object.assign({}, this.info.processAll, formDataList[0], {
Object.assign(params.map, res[1], personnelObj) projectId: this.projectId,
if (params.map.pass) { taskId: this.$route.query.taskId
params.map.pass = params.map.pass + '' === '1'
}
if (params.map.involveList && typeof params.map.involveList === 'string') {
params.map.involveList = params.map.involveList.split(',')
}
resolve(params)
}).catch(err => {
reject(err)
})
} else {
// 发起节点才获取人员信息
let personnelObj = {}
if (this.currentNode === EsInspectionPlan.initiate.value) {
// 人员信息的数据, 处理成对象
personnelObj = this.$refs.personnelInfo.getDataObj()
// List拆成数组
for (const key in personnelObj) {
if (personnelObj[key] && key.includes('List')) {
personnelObj[key] = personnelObj[key].split(',')
}
}
// 通过表格中的所属部门人员获取稽查征求意见对象
personnelObj.opinionFillList = this.$refs.inspectionPlanTable.dataSource.map(item => item.objectOfConsultation)
}
params.processAll = Object.assign({}, this.info.processAll, this.processInfoForm.getFieldsValue())
if (params.processAll.dueTime && !params.processAll.dueTime.includes(' 00:00:00')) {
params.processAll.dueTime = params.processAll.dueTime + ' 00:00:00'
}
params.processAll.projectId = this.projectId
params.processApprovalRecord = Object.assign({}, this.info.processApprovalRecord, this.approvalInfoForm.getFieldsValue())
params.processApprovalRecord.projectId = this.projectId
params.map = {}
Object.assign(params.map, this.countersignForm.getFieldsValue(), personnelObj)
if (params.map.pass) {
params.map.pass = params.map.pass + '' === '1'
}
if (params.map.involveList && typeof params.map.involveList === 'string') {
params.map.involveList = params.map.involveList.split(',')
}
resolve(params)
}
}) })
// 处理其他参数
params.map = Object.assign({}, formDataList[1], getPersonInfo)
if (params.map.pass) {
params.map.pass = this.convertPass(params.map.pass)
}
if (params.map.involveList && typeof params.map.involveList === 'string') {
params.map.involveList = params.map.involveList.split(',')
}
// 流程审批信息
params.processApprovalRecord = Object.assign({}, this.info.processApprovalRecord, formDataList[2], {
projectId: this.projectId
})
return params
}, },
/** /**
* 转办弹框 * 转办弹框
@@ -433,6 +428,8 @@ export default {
} else { } else {
this.$message.warn(res.message) this.$message.warn(res.message)
} }
}).catch((err) => {
console.log(err)
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
}) })
@@ -463,6 +460,8 @@ export default {
} else { } else {
this.$message.warn(res.message) this.$message.warn(res.message)
} }
}).catch((err) => {
this.switchChange(err.message)
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
}) })
@@ -483,6 +482,8 @@ export default {
} else { } else {
this.$message.warn(res.message) this.$message.warn(res.message)
} }
}).catch((err) => {
this.switchChange(err.message)
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
}) })
@@ -495,7 +496,7 @@ export default {
this.loading = true this.loading = true
this.getPageParams().then(res => { this.getPageParams().then(res => {
res.map.pass = false res.map.pass = false
return refusalInspectPlan(res) return approvalInspectPlan(res)
}).then(res => { }).then(res => {
if (res.success) { if (res.success) {
this.$message.success(res.message) this.$message.success(res.message)
@@ -503,6 +504,8 @@ export default {
} else { } else {
this.$message.warn(res.message) this.$message.warn(res.message)
} }
}).catch((err) => {
this.switchChange(err.message)
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
}) })
@@ -511,12 +514,31 @@ export default {
changeIsCountersign (val) { changeIsCountersign (val) {
if (val === '1') { if (val === '1') {
this.isCountersign = true this.isCountersign = true
} else if (val === '2') { // 回显列表
this.info.map && this.info.map.involveList && this.countersignForm && this.countersignForm.setFieldsValue({
involveList: this.info.map.involveList
})
} else if (val === '0') {
this.isCountersign = false this.isCountersign = false
} else { } else {
this.isCountersign = null this.isCountersign = null
} }
}, },
// pass数据字典值和布尔值互相转换
convertPass (pass) {
switch (pass + '') {
case '1':
return true
case '0':
return false
case 'true':
return '1'
case 'false':
return '0'
default:
return null
}
},
/** /**
* 验证所有表单 * 验证所有表单
* @param formList - 多个需要校验的表单实例 * @param formList - 多个需要校验的表单实例
@@ -536,7 +558,9 @@ export default {
}) })
) )
} }
return Promise.all(promiseList) return Promise.all(promiseList).catch(() => {
throw new Error('base')
})
} }
} }
} }
@@ -4,7 +4,7 @@
<!-- 新增 --> <!-- 新增 -->
<a-button icon="plus" type="primary" @click="handleAdd" v-has="'enterpriseStandard:add'">{{ $t('newlyAdded') }}</a-button> <a-button icon="plus" type="primary" @click="handleAdd" v-has="'enterpriseStandard:add'">{{ $t('newlyAdded') }}</a-button>
<!-- 导入 --> <!-- 导入 -->
<a-upload name="file" :data="projectId" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> <a-upload name="file" :data="{projectId}" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button icon="upload" type="primary" ghost v-has="'enterpriseStandard:upload'">{{ $t('import') }}</a-button> <a-button icon="upload" type="primary" ghost v-has="'enterpriseStandard:upload'">{{ $t('import') }}</a-button>
</a-upload> </a-upload>
<!-- 批量删除 --> <!-- 批量删除 -->
+2 -1
View File
@@ -86,7 +86,8 @@ module.exports = {
} }
}, */ }, */
'/laws-sinotruk': { '/laws-sinotruk': {
target: 'http://localhost:8184', host: '0.0.0.0',
target: 'http://192.168.137.128:8184',
ws: false, ws: false,
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {