[update] 修改企标制修订流程

This commit is contained in:
lideqin
2023-12-25 10:37:33 +08:00
parent 3e024f91c6
commit f58c41bc74
4 changed files with 25 additions and 12 deletions
@@ -587,12 +587,14 @@ export default {
if (!this.approvalInfoForm.getFieldValue('commitText')) {
this.approvalInfoForm.setFieldsValue({ commitText: '同意' })
}
this.approvalInfoForm.validateFields((err, values) => {
if (!err) {
this.approvalInfoForm.validateFields(async (err, values) => {
const data = await this.$refs.baseInfoRef.getDataValidate()
if (!err && data) {
this.loading = true
const param = {}
param.common = Object.assign({}, values)
param.common.taskId = this.$route.query.taskId
param.data = data
enStandardEditAgree(param).then(res => {
if (res.success) {
this.$message.success(res.message)
@@ -128,7 +128,7 @@ export default {
// 看能上传企标的行是否都上传了
let hasErr = false
for (const item of this.dataSource) {
if (item.drafter === this.userInfo.id && item.expirationDate < this.currentDate && !item.standardFile) {
if (item.operateType !== '1' && !item.fileId) {
// 需要上传企标,但是没有企标文件
hasErr = true
}
@@ -147,7 +147,7 @@ export default {
},
// 上传企标
handleUploadStandard (record, index) {
this.$refs.uploadFile.open(record.standardFile)
this.$refs.uploadFile.open(record.fileId)
this.uploadIndex = index
},
// 上传企标后的回调
@@ -159,7 +159,7 @@ export default {
})
}
/** 赋值给对应行的企标 */
this.dataSource[this.uploadIndex].standardFile = attIdList.join(',')
this.dataSource[this.uploadIndex].fileId = attIdList.join(',')
}
}
}
@@ -253,8 +253,8 @@ export default {
children: <a-input v-model={this.dataSource[index].deductionScoreReason} maxLength={50}
title={this.dataSource[index].deductionScoreReason} placeholder={'请输入'}
onChange={ e => {
e.target.value = (e.target.value.replace(/[^0-9-]/g, '')).trim()
this.dataSource[index].deductionScoreReason = (e.target.value.replace(/[^0-9-]/g, '')).trim()
e.target.value = e.target.value.trim()
this.dataSource[index].deductionScoreReason = e.target.value.trim()
} }
/>,
attrs: {}
@@ -305,10 +305,17 @@ export default {
// 外层获取数据要过校验,返回false表示没有通过校验
getDataValidate () {
let hasErr = false
for (const item of this.dataSource) {
if (!item.evaluateScore || !item.deductionScoreReason) {
const arr = []
for (const item in this.dataSource) {
if (item % 3 === 0 && (!this.dataSource[item].evaluateScore || !this.dataSource[item].deductionScoreReason)) {
hasErr = true
break
} else if (item % 3 === 0 && this.dataSource[item].evaluateScore && this.dataSource[item].deductionScoreReason) {
// 是有评分和扣分理由的行
arr.push({
...this.dataSource[item],
evaluateItem: ((item % 3) + 1) + ''
})
}
}
let data = {} // 需要返回的数据
@@ -316,7 +323,7 @@ export default {
this.$message.warning(this.$t('workCenter.enStandardRevision.pleaseEnterAllMarkItem'))
data = false
} else {
data.dataSource = this.dataSource
data.reviewMeetingDetails = arr
}
return data
}
@@ -177,6 +177,9 @@ export default {
initData (data) {
// 给表格赋值,在线编辑不知道要怎么赋值?
this.formInline = Object.assign({}, data)
if (!this.formInline.reviewMeetingFlag) {
this.formInline.reviewMeetingFlag = 1
}
// 给表单赋值
this.$nextTick(() => {
this.$refs.baseInfoForm.initData(data)
@@ -189,9 +192,10 @@ export default {
return data
},
// 外层获取数据要过校验,返回false表示没有通过校验
getDataValidate () {
async getDataValidate () {
let data = {} // 要返回的数据
this.$refs.ruleForm.validate(valid => {
await this.$refs.ruleForm.validate(valid => {
console.log(valid)
if (valid) {
data = Object.assign({}, this.formInline)
} else {