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: {
node1: '稽查联络人发起计划',
inspectionPlan: '稽查计划',
inspectionBasisStandardNumber: '稽查依据标准号',
inspectionBasisStandardName: '稽查依据标准名称',
-1
View File
@@ -243,7 +243,6 @@ module.exports = {
},
// 企标稽查计划
esInspectionPlan: {
node1: '稽查联络人发起计划',
inspectionPlan: '稽查计划',
inspectionBasisStandardNumber: '稽查依据标准号',
inspectionBasisStandardName: '稽查依据标准名称',
@@ -15,6 +15,7 @@
<a-tree
:checkable="true"
:class="treeScreenClass"
class="select-work-group-tree"
:treeData="treeData"
:checkStrictly="checkStrictly"
@check="onCheck"
@@ -120,7 +121,9 @@ export default {
}
}
}
searchTree(this.treeData[0])
this.treeData.forEach(data => {
searchTree(data)
})
return nodes
},
// 处理工作组树数据结构
@@ -129,6 +132,7 @@ export default {
item.title = item.name
item.value = item.id
item.key = item.id
item.disabled = item.subset && item.subset.length
item.children = this.dealTreeData(item.subset)
return item
})
@@ -335,4 +339,13 @@ export default {
background: #fff;
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>
@@ -36,7 +36,7 @@
<a-date-picker :placeholder="$t('pleaseSelect') + $t('expirationDate')"
style="width: 100%"
:disabled="disabled || processDisabled"
value-format="YYYY-MM-DD"
value-format="YYYY-MM-DD hh:mm:ss"
v-decorator="['dueTime']" />
</a-form-item>
</a-col>
@@ -55,28 +55,27 @@
<!-- 业务基本信息 -->
<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-row type="flex">
<a-col :span="12">
<div class="form-flex-box">
<div class="form-flex-item custom-flex-form-item">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('workCenter.esInspectionPlan.isCountersign')">
<j-dict-select-tag :placeholder="$t('pleaseSelect') + $t('workCenter.esInspectionPlan.isCountersign')"
type="radio"
dictCode="yn"
@change="changeIsCountersign"
v-decorator="['pass', validatorRules.isCountersign]" />
v-decorator="['pass', validatorRules.isCountersign]" />
</a-form-item>
</a-col>
<a-col :span="12"></a-col>
<a-col :span="12">
</div>
<div class="form-flex-item custom-flex-form-item">
<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"
type="checkbox" :nameStr="involveNameStr"
v-decorator="['involveList', validatorRules.countersignRelevantPersonnel]" />
</a-form-item>
</a-col>
</a-row>
</div>
</div>
</a-form>
<!-- 流程审批信息 -->
<div class="process-part-title">{{ $t('processApprovalInformation') }}</div>
@@ -98,7 +97,7 @@
<div v-show="switchValue === 'user'" class="detail-page-scroll-content p-0">
<process-detail-list>
<template #personnelInfo>
<personnel-info ref="personnelInfo" :data="personnelInfoData" />
<personnel-info ref="personnelInfo" :data="personnelInfoData" :current-node="currentNodeName" />
</template>
</process-detail-list>
</div>
@@ -133,7 +132,6 @@ import {
approvalInspectPlan,
getInspectPlanDetail,
getInspectPlanProjectId,
refusalInspectPlan,
saveInspectPlan,
startInspectPlan, transferInspectPlan
} from '@api/workCenter'
@@ -146,8 +144,8 @@ export default {
data () {
return {
// 当前流程信息
info: {},
EsInspectionPlan,
info: {},
loading: false,
switchValue: 'base',
disabled: false,
@@ -168,6 +166,7 @@ export default {
sm: { span: 22 }
},
currentNode: '',
currentNodeName: '',
// 项目id
projectId: '',
btn: 0,
@@ -216,20 +215,32 @@ export default {
return this.$t('flowCenter') + this.$route.meta.title + '' + this.subTitle + ''
},
subTitle () {
return this.$route.query.taskName || this.$t('workCenter.esInspectionPlan.node1')
return this.$route.query.taskName || EsInspectionPlan.initiate.text
},
processDisabled () {
return this.currentNode !== EsInspectionPlan.initiate.value
},
// 会签人员回显
involveNameStr () {
return (this.info.map && this.info.map.involveListDictText) || ''
}
},
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) {
this.loadPage()
return
}
// 如果是新建进来,就获取项目id
this.getProjectId()
},
methods: {
@@ -238,12 +249,12 @@ export default {
*/
getProjectId () {
this.loading = true
this.currentNode = EsInspectionPlan.initiate.value
this.btn = EsInspectionPlan.initiate.btn
// 否则就是创建一个新的流程
getInspectPlanProjectId().then(res => {
if (res) {
this.projectId = res + ''
this.currentNode = EsInspectionPlan.initiate.value
this.btn = EsInspectionPlan.initiate.btn
}
}).finally(() => {
this.loading = false
@@ -253,14 +264,7 @@ export default {
* 获取页面详情
*/
loadPage () {
let { projectId, taskId, nodeId } = this.$route.query
// 草稿进来没有nodeId,就默认发起节点
if (!nodeId) {
nodeId = EsInspectionPlan.initiate.value
}
this.currentNode = nodeId
this.projectId = projectId
this.initPersonInfoData(this.currentNode === EsInspectionPlan.initiate.value)
const { projectId, taskId } = this.$route.query
switch (this.currentNode) {
case EsInspectionPlan.initiate.value:
this.btn = EsInspectionPlan.initiate.btn
@@ -285,110 +289,101 @@ export default {
}).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.$nextTick(() => {
this.processInfoForm.setFieldsValue({
prcName: data.processAll.prcName,
dueTime: data.processAll.dueTime,
prcMes: data.processAll.prcMes
})
// 页面回显
this.processInfoForm && this.processInfoForm.setFieldsValue({
prcName: processAll.prcName,
dueTime: processAll.dueTime,
prcMes: processAll.prcMes
})
this.$nextTick(() => {
this.approvalInfoForm.setFieldsValue({
commitText: data.processApprovalRecord.commitText,
commitFile: data.processApprovalRecord.commitFile
})
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
})
},
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) {
return new Promise((resolve, reject) => {
const params = {}
if (isValidate) {
// 发起节点才获取人员信息
let personnelObj = {}
if (this.currentNode === EsInspectionPlan.initiate.value) {
// 人员信息的数据, 处理成对象
personnelObj = this.$refs.personnelInfo.getDataObjVerify()
if (!personnelObj) {
return reject(new Error())
}
// 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)
}
// 校验表单
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
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.countersignForm, this.approvalInfoForm)
} else {
formDataList = [
this.processInfoForm.getFieldsValue(),
this.countersignForm.getFieldsValue(),
this.approvalInfoForm.getFieldsValue()
]
}
// 收集人员信息
const getPersonInfo = this.getPersonInfo(isValidate)
if (!getPersonInfo) {
throw new Error('user')
}
params.processApprovalRecord = Object.assign({}, this.info.processApprovalRecord, res[2])
params.processApprovalRecord.projectId = this.projectId
params.map = {}
Object.assign(params.map, res[1], 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)
}).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.processAll = Object.assign({}, this.info.processAll, formDataList[0], {
projectId: this.projectId,
taskId: this.$route.query.taskId
})
// 处理其他参数
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 {
this.$message.warn(res.message)
}
}).catch((err) => {
console.log(err)
}).finally(() => {
this.loading = false
})
@@ -463,6 +460,8 @@ export default {
} else {
this.$message.warn(res.message)
}
}).catch((err) => {
this.switchChange(err.message)
}).finally(() => {
this.loading = false
})
@@ -483,6 +482,8 @@ export default {
} else {
this.$message.warn(res.message)
}
}).catch((err) => {
this.switchChange(err.message)
}).finally(() => {
this.loading = false
})
@@ -495,7 +496,7 @@ export default {
this.loading = true
this.getPageParams().then(res => {
res.map.pass = false
return refusalInspectPlan(res)
return approvalInspectPlan(res)
}).then(res => {
if (res.success) {
this.$message.success(res.message)
@@ -503,6 +504,8 @@ export default {
} else {
this.$message.warn(res.message)
}
}).catch((err) => {
this.switchChange(err.message)
}).finally(() => {
this.loading = false
})
@@ -511,12 +514,31 @@ export default {
changeIsCountersign (val) {
if (val === '1') {
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
} else {
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 - 多个需要校验的表单实例
@@ -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-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-upload>
<!-- 批量删除 -->
+2 -1
View File
@@ -86,7 +86,8 @@ module.exports = {
}
}, */
'/laws-sinotruk': {
target: 'http://localhost:8184',
host: '0.0.0.0',
target: 'http://192.168.137.128:8184',
ws: false,
changeOrigin: true,
pathRewrite: {