[update] 修改企标更改流程是否试行和试行周期的联动

This commit is contained in:
lideqin
2023-12-07 14:54:50 +08:00
parent 36b7b3a2b2
commit c3ff042ad9
@@ -172,6 +172,7 @@
<!-- 试行周期 -->
<div class="box-title-text form-flex-item">
<div class="title-text">
<span v-if="rules.trialPeriod[0].required" class="required">*</span>
<span class="title-text-text" :title="$t('workCenter.enStandardChange.trialPeriod')">
{{ $t('workCenter.enStandardChange.trialPeriod') }}
</span>
@@ -341,14 +342,13 @@
</template>
<script>
import { StandardSource, StandardGradeClassify } from '@/enums/commonEnums'
import { getTreeList, getEnterpriseStandardInfoById } from '@/api/enterpriseStandardLibraryApi'
import { StandardSource, StandardGradeClassify, IsTrial } from '@/enums/commonEnums'
import { getTreeList, getEnterpriseStandardInfoById, getStandardGradeClassification } from '@/api/enterpriseStandardLibraryApi'
import StandardSelection from '@/components/selection/StandardSelection'
import UserSelection from '@/components/selection/UserSelection'
import UploadFile from '@/components/UploadFile'
import TreeSelection from '@/components/selection/TreeSelection'
import STreeSelect from '@/components/STreeSelect'
import { getStandardGradeClassification } from '../../../../api/enterpriseStandardLibraryApi'
export default {
name: 'BaseInfoForm',
@@ -443,6 +443,22 @@ export default {
}
}
},
// 企标是否试行改变,标准状态需要跟着变,试行周期必填校验也跟着变
'formInline.tryFlag' (val) {
if (val) {
if (val === IsTrial.YES.value) {
// 试行周期给默认值24
this.formInline.trialPeriod = '24'
// 试行,试行周期必填
this.rules.trialPeriod[0].required = true
} else {
// 试行周期置空
this.formInline.trialPeriod = undefined
// 不试行,试行周期非必填
this.rules.trialPeriod[0].required = false
}
}
}
},
data () {
return {
@@ -502,6 +518,14 @@ export default {
message: this.$t('workCenter.enterpriseInitChangePlan.partName') + this.$t('cannotEmpty'),
trigger: 'change'
}
],
// 试行周期
trialPeriod: [
{
required: false,
message: this.$t('workCenter.enStandardChange.trialPeriod') + this.$t('cannotEmpty'),
trigger: 'change'
}
]
}
}