[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')) { if (!this.approvalInfoForm.getFieldValue('commitText')) {
this.approvalInfoForm.setFieldsValue({ commitText: '同意' }) this.approvalInfoForm.setFieldsValue({ commitText: '同意' })
} }
this.approvalInfoForm.validateFields((err, values) => { this.approvalInfoForm.validateFields(async (err, values) => {
if (!err) { const data = await this.$refs.baseInfoRef.getDataValidate()
if (!err && data) {
this.loading = true this.loading = true
const param = {} const param = {}
param.common = Object.assign({}, values) param.common = Object.assign({}, values)
param.common.taskId = this.$route.query.taskId param.common.taskId = this.$route.query.taskId
param.data = data
enStandardEditAgree(param).then(res => { enStandardEditAgree(param).then(res => {
if (res.success) { if (res.success) {
this.$message.success(res.message) this.$message.success(res.message)
@@ -128,7 +128,7 @@ export default {
// 看能上传企标的行是否都上传了 // 看能上传企标的行是否都上传了
let hasErr = false let hasErr = false
for (const item of this.dataSource) { 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 hasErr = true
} }
@@ -147,7 +147,7 @@ export default {
}, },
// 上传企标 // 上传企标
handleUploadStandard (record, index) { handleUploadStandard (record, index) {
this.$refs.uploadFile.open(record.standardFile) this.$refs.uploadFile.open(record.fileId)
this.uploadIndex = index 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} children: <a-input v-model={this.dataSource[index].deductionScoreReason} maxLength={50}
title={this.dataSource[index].deductionScoreReason} placeholder={'请输入'} title={this.dataSource[index].deductionScoreReason} placeholder={'请输入'}
onChange={ e => { onChange={ e => {
e.target.value = (e.target.value.replace(/[^0-9-]/g, '')).trim() e.target.value = e.target.value.trim()
this.dataSource[index].deductionScoreReason = (e.target.value.replace(/[^0-9-]/g, '')).trim() this.dataSource[index].deductionScoreReason = e.target.value.trim()
} } } }
/>, />,
attrs: {} attrs: {}
@@ -305,10 +305,17 @@ export default {
// 外层获取数据要过校验,返回false表示没有通过校验 // 外层获取数据要过校验,返回false表示没有通过校验
getDataValidate () { getDataValidate () {
let hasErr = false let hasErr = false
for (const item of this.dataSource) { const arr = []
if (!item.evaluateScore || !item.deductionScoreReason) { for (const item in this.dataSource) {
if (item % 3 === 0 && (!this.dataSource[item].evaluateScore || !this.dataSource[item].deductionScoreReason)) {
hasErr = true hasErr = true
break 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 = {} // 需要返回的数据 let data = {} // 需要返回的数据
@@ -316,7 +323,7 @@ export default {
this.$message.warning(this.$t('workCenter.enStandardRevision.pleaseEnterAllMarkItem')) this.$message.warning(this.$t('workCenter.enStandardRevision.pleaseEnterAllMarkItem'))
data = false data = false
} else { } else {
data.dataSource = this.dataSource data.reviewMeetingDetails = arr
} }
return data return data
} }
@@ -177,6 +177,9 @@ export default {
initData (data) { initData (data) {
// 给表格赋值,在线编辑不知道要怎么赋值? // 给表格赋值,在线编辑不知道要怎么赋值?
this.formInline = Object.assign({}, data) this.formInline = Object.assign({}, data)
if (!this.formInline.reviewMeetingFlag) {
this.formInline.reviewMeetingFlag = 1
}
// 给表单赋值 // 给表单赋值
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.baseInfoForm.initData(data) this.$refs.baseInfoForm.initData(data)
@@ -189,9 +192,10 @@ export default {
return data return data
}, },
// 外层获取数据要过校验,返回false表示没有通过校验 // 外层获取数据要过校验,返回false表示没有通过校验
getDataValidate () { async getDataValidate () {
let data = {} // 要返回的数据 let data = {} // 要返回的数据
this.$refs.ruleForm.validate(valid => { await this.$refs.ruleForm.validate(valid => {
console.log(valid)
if (valid) { if (valid) {
data = Object.assign({}, this.formInline) data = Object.assign({}, this.formInline)
} else { } else {