[update] 企标流程联调

This commit is contained in:
lideqin
2023-11-01 15:43:17 +08:00
parent e25bbfbc5c
commit d8a44a4ae6
12 changed files with 301 additions and 136 deletions
@@ -143,10 +143,12 @@ import {
standardizationInitSave,
standardizationInitTurnTo,
standardizationInitAgree,
standardizationInitReject
standardizationInitReject,
standardizationInitGetDataById
} from '@/api/workCenter'
import Vue from 'vue'
import { USER_INFO } from '@/store/mutation-types'
import pick from 'lodash.pick'
const personData = [
{
@@ -161,37 +163,43 @@ const personData = [
id: 2,
nodeName: '部所联络人选取审批人',
nodeRoleName: '部所联络人',
canChoose: false
canChoose: false,
fieldName: 'contactUser'
},
{
id: 3,
nodeName: '主起草单位主管级领导审批下发',
nodeRoleName: '主起草单位主管级领导',
canChoose: false
canChoose: false,
fieldName: 'approvalUser'
},
{
id: 4,
nodeName: '主起草人填写信息',
nodeRoleName: '主起草人',
canChoose: false
canChoose: false,
fieldName: 'mainDraftUser'
},
{
id: 5,
nodeName: '部所联络人汇总',
nodeRoleName: '部所联络人',
canChoose: false
canChoose: false,
fieldName: 'contactUser'
},
{
id: 6,
nodeName: '主起草单位主管级领导批准',
nodeRoleName: '主起草单位主管级领导',
canChoose: false
canChoose: false,
fieldName: 'approvalUser'
},
{
id: 7,
nodeName: '标准化归档',
nodeRoleName: '标准化工程师',
canChoose: false
canChoose: false,
fieldName: 'standardEngineer'
}
]
@@ -217,12 +225,12 @@ export default {
}
},
mounted () {
if (this.currentNode === 1) {
this.personnelInfoData = personData
if (this.$route.query.taskId) {
// 有流程id说明是从流程中心来的,需要初始化数据
this.getProcessData(this.$route.query.taskId)
} else {
this.personnelInfoData = personData.map(item => {
return { ...item, canChoose: false, fieldName: undefined }
})
// 没有taskId说明是新建进来的,初始化人员信息
this.personnelInfoData = personData
}
// 如果是查看进入的,不可编辑,不可操作
if (this.$route.query.onlyLook) {
@@ -284,6 +292,61 @@ export default {
}
},
methods: {
getProcessData (taskId) {
standardizationInitGetDataById(taskId).then(res => {
if (res.success) {
this.model = res.result
this.$nextTick(() => {
// 初始化流程信息
this.processInfoForm.setFieldsValue(pick(this.model.common, 'prcName', 'dueTime', 'prcMes'))
// 初始化流程审批信息,todo:需要判断是不是草稿进来的,草稿进来的才回显审批信息
// this.approvalInfoForm.setFieldsValue(pick(this.model[0], 'commitText', 'commitFile'))
})
const taskName = this.$route.query.taskName
if (taskName) {
if (taskName === '标准化工程师发起') {
this.currentNode = 1
} else if (taskName === '部所联络人选取审批人') {
this.currentNode = 2
} else if (taskName === '主起草单位主管级领导审批下发') {
this.currentNode = 3
} else if (taskName === '主起草人填写信息') {
this.currentNode = 4
} else if (taskName === '部所联络人汇总') {
this.currentNode = 5
} else if (taskName === '主起草单位主管级领导批准') {
this.currentNode = 6
} else {
this.currentNode = 7
}
}
if (this.currentNode === 1) {
this.personnelInfoData = personData.map(item => {
if (item.fieldName) {
return {
...item,
user: this.model.flowUser[item.fieldName],
user_dictText: this.model.flowUser[item.fieldName + '_dictText']
}
} else {
return item
}
})
} else {
this.personnelInfoData = personData.map(item => {
if (item.fieldName) {
return { ...item, user: this.model.flowUser[item.fieldName], userList: this.model.flowUser[item.fieldName + '_dictText'], canChoose: false }
} else {
return item
}
})
}
this.$refs.baseInfoRef.initData(this.model.dataList)
} else {
this.$message.warning(res.message)
}
})
},
switchChange (value) {
this.switchValue = value
},
@@ -333,6 +396,7 @@ export default {
standardizationInitSave(param).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warning(res.message)
}
@@ -347,7 +411,7 @@ export default {
const personnelInfo = this.$refs.personnelInfo.stepsData
const personnelObj = {}
for (const item of personnelInfo) {
if (item.fieldName) {
if (item.fieldName && item.canChoose) {
personnelObj[item.fieldName] = item.user
}
}
@@ -369,6 +433,7 @@ export default {
standardizationInitApproval(param).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warning(res.message)
}
@@ -397,6 +462,7 @@ export default {
standardizationInitTurnTo(param).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warning(res.message)
}
@@ -420,6 +486,7 @@ export default {
standardizationInitAgree(param).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warning(res.message)
}
@@ -442,6 +509,7 @@ export default {
standardizationInitAgree(param).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warning(res.message)
}
@@ -463,6 +531,7 @@ export default {
standardizationInitReject(param).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warning(res.message)
}
@@ -471,6 +540,9 @@ export default {
})
}
})
},
goBack () {
this.$router.go(-1)
}
}
}