认证-参数清单-配置校验修改

This commit is contained in:
liyawei
2022-07-02 13:45:49 +08:00
parent 1507953aee
commit 0c7e693472
2 changed files with 31 additions and 25 deletions
@@ -275,9 +275,8 @@
// 配置
configure(item) {
this.itemId = item.id
this.itemRow = item
this.$refs.configureRef.addModel(item.id)
this.$refs.configureRef.addModel(item.id,item)
},
handleCancel(val) {
this.areaVisible = val
@@ -95,7 +95,7 @@
<div class="title-text">
<!-- <span class="title-text-text" :title="$t('Required')">{{$t('Required')}}</span>-->
</div>
<a-button style="margin-right: .8rem" @click="addConfiguration(index)" v-has="'params:config:add'">{{$t('addConfiguration')}}
<a-button style="margin-right: .8rem" @click="addConfiguration(index)" :loading="loading" v-has="'params:config:add'">{{$t('addConfiguration')}}
</a-button>
<a-button @click="deleteConfiguration(item.id,index)" v-has="'params:config:delete'" type="primary" :loading="confirmLoading">
{{$t('deleteConfiguration')}}
@@ -146,6 +146,7 @@
formInline: {},
confirmLoading: false,
visible: false,
loading:false,
rules: {
// nioNumber:[
// { required: true, message: this.$t('PleaseEnter')+this.$t('NiONumber'), trigger: 'change' },
@@ -155,7 +156,7 @@
projectNameList: [],
title: '',
stateOne: '',
configFlag:'',
conFlag:'',
contentList: [],
paramsConfigEOList: [
{
@@ -187,19 +188,13 @@
}
})
},
addModel(id) {
addModel(id,item) {
this.paramsConfigEOList = []
this.visible = true
this.title = this.$t('MaintainConfigureInfo')
this.formInline = {}
this.getconList(id)
getAction(this.url.configurelist, { paramsManifestId: this.itemRow.id }).then((res) => {
if (res.success) {
this.configFlag = res.result
} else {
this.$message.warning(res.message)
}
})
},
getconList(id) {
getAction(`${this.url.conList}?paramsManifestId=${id}`, {}).then((res) => {
@@ -226,19 +221,29 @@
})
},
addConfiguration(item) {
console.log(this.configFlag)
if (this.configFlag == true) {
this.paramsConfigEOList.splice(item.displaySeq + 1, 0, {
id: '',
configName: '', // 配置名称
version: '', // 版本
carType: '', // 车型
battery: '', // 电池
motor: '' // 电机
})
} else {
this.$message.warning(this.$t('Theselectedconfiguration'))
}
this.loading = true
getAction(this.url.configurelist, { paramsManifestId: this.itemRow.id }).then((res) => {
if (res.success) {
this.conFlag = res.result
if (this.conFlag == true) {
this.paramsConfigEOList.splice(item.displaySeq + 1, 0, {
id: '',
configName: '', // 配置名称
version: '', // 版本
carType: '', // 车型
battery: '', // 电池
motor: '' // 电机
})
this.loading = false
} else {
this.loading = false
this.$message.warning(this.$t('Theselectedconfiguration'))
}
} else {
this.$message.warning(res.message)
}
})
},
deleteConfiguration(displaySeq, index) {
if (this.paramsConfigEOList.length === 1) {
@@ -262,6 +267,8 @@
},
handleCancel() {
this.visible = false
this.$refs.ruleForm.clearValidate()
this.conFlag = ''
},
handleSubmit() {
let flag = 1