[update] 修改bug
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
:class="{'form-flex-item-line': item.fieldShowType === FieldType.STANDARD_MORE.value}"
|
||||
v-if="!hiddenFieldList.includes(item.dbFieldName)">
|
||||
<div class="title-text">
|
||||
<span class="required" v-if="item.fieldMustInput === '1'">*</span>
|
||||
<span class="required" v-if="item.fieldMustInput === '1' || rules[item.dbFieldName][0].required">*</span>
|
||||
<span class="title-text-text" :title="item.dbFieldTxt">{{ item.dbFieldTxt }}</span>
|
||||
</div>
|
||||
<a-form-model-item class="item-model" :prop="item.dbFieldName">
|
||||
@@ -85,7 +85,7 @@
|
||||
<j-dict-select-tag v-else-if="item.fieldShowType === FieldType.OPTION_SINGLE.value"
|
||||
class="box-input"
|
||||
v-model="formInline[item.dbFieldName]"
|
||||
:disabled="disabled || disabledFieldList.includes(item.dbFieldName)"
|
||||
:disabled="disabled || disabledFieldList.includes(item.dbFieldName) || innerDisabledField.includes(item.dbFieldName)"
|
||||
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
|
||||
:type="'select'"
|
||||
:triggerChange="false"
|
||||
@@ -155,7 +155,7 @@ import JMultiSelectTag from '../dict/JMultiSelectTag'
|
||||
import UploadFile from '../UploadFile'
|
||||
// 选择标准选择器
|
||||
import StandardSelection from '../selection/StandardSelection'
|
||||
import { FieldType, StandardGradeClassify, StandardProperty } from '../../enums/commonEnums'
|
||||
import { FieldType, StandardGradeClassify, StandardProperty, IsTrial, EnterpriseStandardStatus } from '../../enums/commonEnums'
|
||||
import JMultipleDatePicker from '../JMultipleDatePicker'
|
||||
import UserSelection from '../selection/UserSelection'
|
||||
import { getAction } from '../../api/manage.js'
|
||||
@@ -312,12 +312,14 @@ export default {
|
||||
} else if (val === StandardGradeClassify.ONE_LEVEL.value) {
|
||||
// 选的是1级
|
||||
this.formInline.auth_dept = this.standardGradeClassification.find(item => item.level + '' === '1').deptIds
|
||||
this.formInline = JSON.parse(JSON.stringify(this.formInline))
|
||||
if (this.innerDisabledField.includes('auth_dept')) {
|
||||
this.innerDisabledField = this.innerDisabledField.filter(item => item !== 'auth_dept')
|
||||
}
|
||||
} else if (val === StandardGradeClassify.TWO_LEVEL.value) {
|
||||
// 选的是2级
|
||||
this.formInline.auth_dept = this.standardGradeClassification.find(item => item.level + '' === '2').deptIds
|
||||
this.formInline = JSON.parse(JSON.stringify(this.formInline))
|
||||
if (this.innerDisabledField.includes('auth_dept')) {
|
||||
this.innerDisabledField = this.innerDisabledField.filter(item => item !== 'auth_dept')
|
||||
}
|
||||
@@ -329,6 +331,29 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// 企标是否试行改变,标准状态需要跟着变,试行周期必填校验也跟着变
|
||||
'formInline.try_flag' (val) {
|
||||
if (val && this.flag === '3') {
|
||||
if (val === IsTrial.YES.value) {
|
||||
// 试行,标准状态改为试运行,
|
||||
this.formInline.standard_state = EnterpriseStandardStatus.TRIAL_OPERATION.value
|
||||
this.formInline = JSON.parse(JSON.stringify(this.formInline))
|
||||
// 试行,标准状态不可修改
|
||||
if (!this.innerDisabledField.includes('standard_state')) {
|
||||
this.innerDisabledField.push('standard_state')
|
||||
}
|
||||
// 试行,试行周期必填
|
||||
this.rules.trial_period[0].required = true
|
||||
} else {
|
||||
// 不试行,标准状态可修改
|
||||
if (this.innerDisabledField.includes('standard_state')) {
|
||||
this.innerDisabledField = this.innerDisabledField.filter(item => item !== 'standard_state')
|
||||
}
|
||||
// 不试行,试行周期非必填
|
||||
this.rules.trial_period[0].required = false
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -420,16 +445,23 @@ export default {
|
||||
message: res.dbFieldTxt + this.$t('cannotEmpty'),
|
||||
trigger: 'blur'
|
||||
})
|
||||
} else if (res.fieldShowType === FieldType.DATE_SINGLE.value) {
|
||||
// 解决第一次校验不消失的问题
|
||||
} else {
|
||||
rule.push({
|
||||
required: true,
|
||||
message: res.dbFieldTxt + this.$t('cannotEmpty'),
|
||||
trigger: 'change'
|
||||
})
|
||||
}
|
||||
} else {
|
||||
if ([FieldType.TEXT_BOX.value, FieldType.TEXTAREA.value].includes(res.fieldShowType)) {
|
||||
rule.push({
|
||||
required: false,
|
||||
message: res.dbFieldTxt + this.$t('cannotEmpty'),
|
||||
trigger: 'blur'
|
||||
})
|
||||
} else {
|
||||
rule.push({
|
||||
required: true,
|
||||
required: false,
|
||||
message: res.dbFieldTxt + this.$t('cannotEmpty'),
|
||||
trigger: 'change'
|
||||
})
|
||||
@@ -439,6 +471,7 @@ export default {
|
||||
rules[res.dbFieldName] = rule
|
||||
}
|
||||
})
|
||||
console.log(rules)
|
||||
this.rules = rules
|
||||
this.isFormInline = true
|
||||
this.confirmLoading = false
|
||||
|
||||
Reference in New Issue
Block a user