[update] 修改企标流程各模块的数据格式
This commit is contained in:
+18
-47
@@ -149,6 +149,8 @@ import {
|
||||
import Vue from 'vue'
|
||||
import { USER_INFO } from '@/store/mutation-types'
|
||||
import pick from 'lodash.pick'
|
||||
import { WorkCenterMixin } from '@/mixins/WorkCenterMixin'
|
||||
import { ProcessKey } from '../../../enums/commonEnums'
|
||||
|
||||
const personData = [
|
||||
{
|
||||
@@ -215,9 +217,10 @@ export default {
|
||||
ProcessDetailList,
|
||||
PersonnelInfo
|
||||
},
|
||||
mixins: [WorkCenterMixin],
|
||||
computed: {
|
||||
pageTitle () {
|
||||
return this.$t('flowCenter') + this.$route.meta.title
|
||||
return this.$t('flowCenter') + this.$route.meta.title + '(' + this.currentNodeName + ')'
|
||||
},
|
||||
// 流程信息不能编辑
|
||||
processInfoDisabled () {
|
||||
@@ -225,12 +228,14 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
// 获取人员信息结构
|
||||
this.getPersonInfoStructure(ProcessKey.ES_ANNUAL_INIT.value)
|
||||
if (this.$route.query.taskId) {
|
||||
this.currentNodeName = this.$route.query.taskName
|
||||
// 有流程id说明是从流程中心来的,需要初始化数据
|
||||
this.getProcessData(this.$route.query.taskId)
|
||||
} else {
|
||||
// 没有taskId说明是新建进来的,初始化人员信息
|
||||
this.personnelInfoData = personData
|
||||
this.currentNodeName = '标准化工程师发起'
|
||||
}
|
||||
// 初始化节点
|
||||
const taskName = this.$route.query.taskName
|
||||
@@ -254,6 +259,10 @@ export default {
|
||||
this.currentNode = 999
|
||||
}
|
||||
}
|
||||
// 如果不是第一个节点,人员信息全部不可选
|
||||
if (this.currentNode !== 1) {
|
||||
this.initPersonInfoData()
|
||||
}
|
||||
// 如果是查看进入的,不可编辑,不可操作
|
||||
if (this.$route.query.onlyLook) {
|
||||
this.onlyLook = this.$route.query.onlyLook
|
||||
@@ -306,11 +315,13 @@ export default {
|
||||
}
|
||||
},
|
||||
currentNode: 1,
|
||||
currentNodeName: '',
|
||||
approvalInfoForm: this.$form.createForm(this), // 审批信息表单
|
||||
personnelInfoData: [], // 人员信息数据
|
||||
url: {
|
||||
list: '' // 人员信息右侧表的分页查询接口
|
||||
}
|
||||
},
|
||||
model: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -324,27 +335,6 @@ export default {
|
||||
// 初始化流程审批信息,todo:需要判断是不是草稿进来的,草稿进来的才回显审批信息
|
||||
// this.approvalInfoForm.setFieldsValue(pick(this.model[0], 'commitText', 'commitFile'))
|
||||
})
|
||||
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)
|
||||
@@ -362,13 +352,7 @@ export default {
|
||||
// 流程审批信息
|
||||
const approvalInfoForm = this.approvalInfoForm.getFieldsValue()
|
||||
// 人员信息的数据, 处理成对象
|
||||
const personnelInfo = this.$refs.personnelInfo.stepsData
|
||||
const personnelObj = {}
|
||||
for (const item of personnelInfo) {
|
||||
if (item.fieldName) {
|
||||
personnelObj[item.fieldName] = item.user
|
||||
}
|
||||
}
|
||||
const personnelObj = this.$refs.personnelInfogetDataObj()
|
||||
// 需要传给后端的
|
||||
const param = {}
|
||||
param.common = { ...processInfoForm, ...approvalInfoForm }
|
||||
@@ -412,18 +396,8 @@ export default {
|
||||
handleStart () {
|
||||
if (this.loading) return
|
||||
// 人员信息的数据, 处理成对象
|
||||
const personnelInfo = this.$refs.personnelInfo.stepsData
|
||||
const personnelObj = {}
|
||||
for (const item of personnelInfo) {
|
||||
if (item.fieldName && item.canChoose) {
|
||||
personnelObj[item.fieldName] = item.user
|
||||
}
|
||||
}
|
||||
// 发起人,标准化工程师设置为当前登录人
|
||||
personnelObj.standardEngineer = Vue.ls.get(USER_INFO).id
|
||||
// 校验是否填了所有能填的人员信息
|
||||
if (!Object.values(personnelObj).every(v => !!v)) {
|
||||
this.$message.warning(this.$t('pleaseEnterPersonnelInfo'))
|
||||
const personnelObj = this.$refs.personnelInfo.getDataObjVerify()
|
||||
if (!personnelObj) {
|
||||
return
|
||||
}
|
||||
this.processInfoForm.validateFields((err, values) => {
|
||||
@@ -545,9 +519,6 @@ export default {
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
goBack () {
|
||||
this.$router.go(-1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user