ota数据导入模板修改

This commit is contained in:
zyx.net
2023-04-02 18:24:54 +08:00
parent 8a222d27cb
commit c4c73f2a26
2 changed files with 28 additions and 20 deletions
@@ -176,7 +176,8 @@ export default {
disabled: false,
form: {
qymc: '安徽江淮汽车集团股份有限公司',
bapc: undefined
bapc: undefined,
cxmb: undefined
},
url: {
exportData: '/ota/otaBaSjSjmbcx/exportData',
@@ -206,7 +207,7 @@ export default {
handleModule() {
downloadFile('ota/otaBaSjSjmbcx/exportTemplate', '升级目标车型' + '.zip', {})
},
getData() {
getData(item) {
let otaIdT = localStorage.getItem('otaIdT')
if (otaIdT == null) {
otaIdT = ''
@@ -232,15 +233,15 @@ export default {
this.form = res.result
this.form.otaId=''
// if (this.$route.query.type == 1 && res.result.cxmb == null) {
// this.form.cxmb = this.form.babh + '-' + this.form.bapc + '-' + this.form.cpxh
// } else {
// if (this.$route.query.type == 2 && res.result.cxmb == null) {
// this.form.cxmb = this.form.babh + '-' + this.form.bapc + '-' + this.form.cpxh
// } else {
// this.form.cxmb = res.result.cxmb ? res.result.cxmb : undefined
// }
// }
if (this.$route.query.type == 1 && res.result.cxmb == null && !item) {
this.form.cxmb = this.form.babh + '-' + this.form.bapc + '-' + this.form.cpxh
} else {
if (this.$route.query.type == 2 && res.result.cxmb == null && !item) {
this.form.cxmb = this.form.babh + '-' + this.form.bapc + '-' + this.form.cpxh
} else {
this.form.cxmb = res.result.cxmb ? res.result.cxmb : undefined
}
}
if (res.result.dllx1 == null || res.result.dllx1 == "") {
this.form.dllx1 = undefined
@@ -249,9 +250,9 @@ export default {
if (res.result.dllx2 == null || res.result.dllx2 == "") {
this.form.dllx2 = undefined
}
if (res.result.cxmb == null || res.result.cxmb == "") {
this.form.cxmb = undefined
}
// if (res.result.cxmb == null || res.result.cxmb == "") {
// this.form.cxmb = undefined
// }
if (res.result.bapc == null || res.result.bapc == "") {
this.form.bapc = undefined
}
@@ -241,6 +241,7 @@ import { message } from 'ant-design-vue'
formInline:{},
projectNameList:[],
formRules:[],
flag:'',
url: {
exportData: '/ota/otaBaCxJbxx/exportData',
importZipUrl: '/ota/otaBaCxJbxx/importData?otaId=' + localStorage.getItem('otaId'),//导入
@@ -310,7 +311,7 @@ import { message } from 'ant-design-vue'
}
})
},
getData(){
getData(item){
let otaIdT=localStorage.getItem('otaIdT')
if(otaIdT==null){
otaIdT=''
@@ -332,10 +333,10 @@ import { message } from 'ant-design-vue'
this.form.txzd=res.result.txzd
this.form.cdotasj=res.result.cdotasj
this.form.id=res.result.id
if(this.$route.query.type == 1 && res.result.cxmb == null){
if(this.$route.query.type == 1 && res.result.cxmb == null && !item){
this.form.cxmb = this.form.djbh+'-'+ this.form.ggpc+'-'+this.form.cpxh
}else {
if(this.$route.query.type == 2 && res.result.cxmb == null){
if(this.$route.query.type == 2 && res.result.cxmb == null && !item){
this.form.cxmb = this.form.djbh+'-'+ this.form.ggpc+'-'+this.form.cpxh
}else{
this.form.cxmb = res.result.cxmb ? res.result.cxmb : undefined
@@ -370,6 +371,9 @@ import { message } from 'ant-design-vue'
if(valid){
this.save()
setTimeout(()=>{
if(this.flag == 1){
return
}
this.$emit('basicInformationForm')
},1000)
@@ -385,11 +389,14 @@ import { message } from 'ant-design-vue'
otaId=''
}
postAction('/ota/otaBaCxJbxx/add',{ otaId:otaId,...this.form}).then( res => {
if(res.code == 200){
if(res.success){
localStorage.setItem('otaId', res.result.otaId)
this.$message.success(this.$t('SavedSuccessfully'))
this.$message.success(res.message)
this.getData()
}
}else{
this.$message.warning(res.message)
this.flag = 1
}
})
}
})