[update] 修改企标制修订流程,任务转交

This commit is contained in:
lideqin
2023-12-28 17:21:00 +08:00
parent d5ed9e75b0
commit 2baeb787d8
7 changed files with 86 additions and 126 deletions
@@ -571,7 +571,7 @@ export default {
// 企标计划id
param.data.espId = data.formInline.espId
// data的id
param.data.id = this.model.data.id || ''
param.data.id = this.model.data ? this.model.data.id : ''
let func
if (this.$route.query.taskId) {
// 有taskId说明是驳回的提交
@@ -116,7 +116,20 @@ export default {
let data = {}
await this.$refs.ruleForm.validate(valid => {
if (valid) {
data = Object.assign({}, this.formInline)
// 有征求意见稿计划完成日期和征求意见截止日期,需要征求意见截止日期比计划完成日期早
if (JSON.parse(this.formInline.businessJson).solicitationDraftPlanCompleteDate && this.formInline.adviceDeadline) {
const planDate = new Date(Date.parse(JSON.parse(this.formInline.businessJson).solicitationDraftPlanCompleteDate))
const deadlineDate = new Date(Date.parse(this.formInline.adviceDeadline))
if (deadlineDate < planDate) {
// 截止日期比完成日期早
data = Object.assign({}, this.formInline)
} else {
this.$message.warning(this.$t('workCenter.enStandardRevision.deadlineNeedGreaterThan'))
data = false
}
} else {
data = Object.assign({}, this.formInline)
}
} else {
data = false
}
@@ -260,46 +260,61 @@ export default {
standardGradeClassification: [] // 企标级别映射数据
}
},
mounted () {
created () {
this.getStandardGradeClassificationArr()
},
methods: {
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) {
// 给表单赋值,在线编辑不知道要怎么赋值?
this.formInline = Object.assign({}, data)
// 设置授权部门是否可更改和可选范围
// 基础信息中的标准等级分类
const gradeClassification = JSON.parse(data.businessJson).grade_classification
// 基础信息中的授权部门
const authDept = JSON.parse(data.businessJson).auth_dept
if (gradeClassification === StandardGradeClassify.ZERO_LEVEL.value) {
// 选的是0级,授权部门带出发起时填写的数据不可编辑
this.formInline.authDept = authDept
this.authDeptDisabled = true
} else if (gradeClassification === StandardGradeClassify.ONE_LEVEL.value) {
// 选的是1级,授权部门带出发起时填写的数据
this.formInline.authDept = authDept
// 设置可选择项
this.departSelectRange = this.standardGradeClassification.find(item => item.level + '' === '1').deptIds.split(',')
// 设置授权部门可编辑
this.authDeptDisabled = false
} else if (gradeClassification === StandardGradeClassify.TWO_LEVEL.value) {
// 选的是2级,授权部门带出发起时填写的数据
this.formInline.authDept = authDept
// 设置可选择项
this.departSelectRange = this.standardGradeClassification.find(item => item.level + '' === '2').deptIds.split(',')
// 设置授权部门可编辑
this.authDeptDisabled = false
} else if (gradeClassification === StandardGradeClassify.THREE_LEVEL.value) {
// 选的是3级,授权部门带出发起时填写的数据,不可编辑
this.formInline.authDept = authDept
this.authDeptDisabled = true
}
// 给表单赋值
this.$nextTick(() => {
this.$refs.baseInfoForm.initData(data)
})
setTimeout(() => {
// 给表单赋值,在线编辑不知道要怎么赋值?
this.formInline = Object.assign({}, data)
// 设置授权部门是否可更改和可选范围
// 基础信息中的标准等级分类
const gradeClassification = JSON.parse(data.businessJson).grade_classification
// 基础信息中的授权部门
const authDept = JSON.parse(data.businessJson).auth_dept
console.log(gradeClassification, authDept)
if (gradeClassification === StandardGradeClassify.ZERO_LEVEL.value) {
// 选的是0级,授权部门带出发起时填写的数据不可编辑
if (!this.formInline.authDept) {
// 没有数据,说明不是驳回或者保存,带入发起的
this.formInline.authDept = authDept
}
this.authDeptDisabled = true
} else if (gradeClassification === StandardGradeClassify.ONE_LEVEL.value) {
// 选的是1级,授权部门带出发起时填写的数据
if (!this.formInline.authDept) {
// 没有数据,说明不是驳回或者保存,带入发起的
this.formInline.authDept = authDept
}
// 设置可选择项
this.departSelectRange = this.standardGradeClassification.find(item => item.level + '' === '1').deptIds.split(',')
// 设置授权部门可编辑
this.authDeptDisabled = false
} else if (gradeClassification === StandardGradeClassify.TWO_LEVEL.value) {
// 选的是2级,授权部门带出发起时填写的数据
if (!this.formInline.authDept) {
// 没有数据,说明不是驳回或者保存,带入发起的
this.formInline.authDept = authDept
}
// 设置可选择项
this.departSelectRange = this.standardGradeClassification.find(item => item.level + '' === '2').deptIds.split(',')
// 设置授权部门可编辑
this.authDeptDisabled = false
} else if (gradeClassification === StandardGradeClassify.THREE_LEVEL.value) {
// 选的是3级,授权部门带出发起时填写的数据,不可编辑
if (!this.formInline.authDept) {
// 没有数据,说明不是驳回或者保存,带入发起的
this.formInline.authDept = authDept
}
this.authDeptDisabled = true
}
}, 500)
},
// 外层要获取数据
getData () {