校验
This commit is contained in:
+32
-6
@@ -12,7 +12,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<a-spin :spinning="confirmLoading">
|
<a-spin :spinning="confirmLoading">
|
||||||
<a-form-model class="formAdd" ref="ruleForm">
|
<a-form-model class="formAdd" ref="ruleForm" :model="form" :rules="rules">
|
||||||
<a-row :gutter="24">
|
<a-row :gutter="24">
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<div class="box-title-text-add">
|
<div class="box-title-text-add">
|
||||||
@@ -37,11 +37,14 @@
|
|||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<div class="box-title-text-add">
|
<div class="box-title-text-add">
|
||||||
<div class="title-text-add">
|
<div class="title-text-add">
|
||||||
|
<span class="Required">*</span>
|
||||||
<span class="title-text-text" :title="$t('upgraderecordnumber')">{{$t('upgraderecordnumber')}}</span>
|
<span class="title-text-text" :title="$t('upgraderecordnumber')">{{$t('upgraderecordnumber')}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="title-text-add-input">
|
<div style="width:78%">
|
||||||
<!-- <span class="title-text-text">中文</span> -->
|
<!-- <span class="title-text-text">中文</span> -->
|
||||||
<a-input class="box-input" v-model="form.babh" :title='form.babh' :placeholder="$t('pleaseEnter')" disabled style="width:93%" :max-length="50"></a-input>
|
<a-form-model-item prop="babh">
|
||||||
|
<a-input class="box-input" v-model="form.babh" :title='form.babh' :placeholder="$t('pleaseEnter')" style="width:93%" :max-length="50"></a-input>
|
||||||
|
</a-form-model-item>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a-col>
|
</a-col>
|
||||||
@@ -60,9 +63,10 @@
|
|||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<div class="box-title-text-add">
|
<div class="box-title-text-add">
|
||||||
<div class="title-text-add plus">
|
<div class="title-text-add plus">
|
||||||
|
<span class="Required">*</span>
|
||||||
<span class="title-text-text" :title="$t('Modelandfunctionrecord')">{{$t('Modelandfunctionrecord')}}</span>
|
<span class="title-text-text" :title="$t('Modelandfunctionrecord')">{{$t('Modelandfunctionrecord')}}</span>
|
||||||
</div>
|
</div>
|
||||||
<a-form-model-item class="itemModel" prop="dutyTerritory">
|
<a-form-model-item class="itemModel" prop="bapc">
|
||||||
<a-select :disabled="disabled" class="box-input" v-model="form.bapc" allowClear :placeholder="$t('PleaseSelect')" @change="changeId">
|
<a-select :disabled="disabled" class="box-input" v-model="form.bapc" allowClear :placeholder="$t('PleaseSelect')" @change="changeId">
|
||||||
<a-select-option v-for="(item , key ) in selectListPc" :key="key" :value="item.id" >
|
<a-select-option v-for="(item , key ) in selectListPc" :key="key" :value="item.id" >
|
||||||
{{ item.ggpc }}
|
{{ item.ggpc }}
|
||||||
@@ -174,6 +178,14 @@ import ImportFile from '@/components/ImportFileData/index'
|
|||||||
projectNameList2:[],
|
projectNameList2:[],
|
||||||
selectListPc:[],
|
selectListPc:[],
|
||||||
selectListMb:[],
|
selectListMb:[],
|
||||||
|
rules:{
|
||||||
|
babh:[
|
||||||
|
{ required:true,message:this.$t('upgraderecordnumber')+this.$t('cannotEmpty'),trigger:'blur'}
|
||||||
|
],
|
||||||
|
bapc:[
|
||||||
|
{ required:true,message:this.$t('Modelandfunctionrecord')+this.$t('cannotEmpty'),trigger:'change'}
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@@ -230,17 +242,27 @@ import ImportFile from '@/components/ImportFileData/index'
|
|||||||
if(otaId==null){
|
if(otaId==null){
|
||||||
otaId=''
|
otaId=''
|
||||||
}
|
}
|
||||||
postAction('/ota/otaBaSjSjmbcx/add',{otaId:otaId,...this.form}).then(res=>{
|
this.$refs.ruleForm.validate(valid=>{
|
||||||
|
if(valid){
|
||||||
|
postAction('/ota/otaBaSjSjmbcx/add',{otaId:otaId,...this.form}).then(res=>{
|
||||||
if(res.code==200){
|
if(res.code==200){
|
||||||
localStorage.setItem('otaId', res.result.otaId)
|
localStorage.setItem('otaId', res.result.otaId)
|
||||||
this.$message.success(this.$t('SavedSuccessfully'))
|
this.$message.success(this.$t('SavedSuccessfully'))
|
||||||
this.getData()
|
this.getData()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
next(){
|
next(){
|
||||||
this.save()
|
this.save()
|
||||||
this.$emit('basicInformationForm')
|
this.$refs.ruleForm.validate(valid=>{
|
||||||
|
if(valid){
|
||||||
|
this.$emit('basicInformationForm')
|
||||||
|
}})
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
getSelect(){
|
getSelect(){
|
||||||
getAction('/ota/otaBaCxList/list').then(res=>{
|
getAction('/ota/otaBaCxList/list').then(res=>{
|
||||||
@@ -368,4 +390,8 @@ import ImportFile from '@/components/ImportFileData/index'
|
|||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
line-height: 1.4 !important;
|
line-height: 1.4 !important;
|
||||||
}
|
}
|
||||||
|
.Required {
|
||||||
|
color: red;
|
||||||
|
margin-right: 3px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
Reference in New Issue
Block a user