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, disabled: false,
form: { form: {
qymc: '安徽江淮汽车集团股份有限公司', qymc: '安徽江淮汽车集团股份有限公司',
bapc: undefined bapc: undefined,
cxmb: undefined
}, },
url: { url: {
exportData: '/ota/otaBaSjSjmbcx/exportData', exportData: '/ota/otaBaSjSjmbcx/exportData',
@@ -206,7 +207,7 @@ export default {
handleModule() { handleModule() {
downloadFile('ota/otaBaSjSjmbcx/exportTemplate', '升级目标车型' + '.zip', {}) downloadFile('ota/otaBaSjSjmbcx/exportTemplate', '升级目标车型' + '.zip', {})
}, },
getData() { getData(item) {
let otaIdT = localStorage.getItem('otaIdT') let otaIdT = localStorage.getItem('otaIdT')
if (otaIdT == null) { if (otaIdT == null) {
otaIdT = '' otaIdT = ''
@@ -232,15 +233,15 @@ export default {
this.form = res.result this.form = res.result
this.form.otaId='' this.form.otaId=''
// 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.babh + '-' + this.form.bapc + '-' + this.form.cpxh this.form.cxmb = this.form.babh + '-' + this.form.bapc + '-' + this.form.cpxh
// } else { } 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.babh + '-' + this.form.bapc + '-' + this.form.cpxh this.form.cxmb = this.form.babh + '-' + this.form.bapc + '-' + this.form.cpxh
// } else { } else {
// this.form.cxmb = res.result.cxmb ? res.result.cxmb : undefined this.form.cxmb = res.result.cxmb ? res.result.cxmb : undefined
// } }
// } }
if (res.result.dllx1 == null || res.result.dllx1 == "") { if (res.result.dllx1 == null || res.result.dllx1 == "") {
this.form.dllx1 = undefined this.form.dllx1 = undefined
@@ -249,9 +250,9 @@ export default {
if (res.result.dllx2 == null || res.result.dllx2 == "") { if (res.result.dllx2 == null || res.result.dllx2 == "") {
this.form.dllx2 = undefined this.form.dllx2 = undefined
} }
if (res.result.cxmb == null || res.result.cxmb == "") { // if (res.result.cxmb == null || res.result.cxmb == "") {
this.form.cxmb = undefined // this.form.cxmb = undefined
} // }
if (res.result.bapc == null || res.result.bapc == "") { if (res.result.bapc == null || res.result.bapc == "") {
this.form.bapc = undefined this.form.bapc = undefined
} }
@@ -241,6 +241,7 @@ import { message } from 'ant-design-vue'
formInline:{}, formInline:{},
projectNameList:[], projectNameList:[],
formRules:[], formRules:[],
flag:'',
url: { url: {
exportData: '/ota/otaBaCxJbxx/exportData', exportData: '/ota/otaBaCxJbxx/exportData',
importZipUrl: '/ota/otaBaCxJbxx/importData?otaId=' + localStorage.getItem('otaId'),//导入 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') let otaIdT=localStorage.getItem('otaIdT')
if(otaIdT==null){ if(otaIdT==null){
otaIdT='' otaIdT=''
@@ -332,10 +333,10 @@ import { message } from 'ant-design-vue'
this.form.txzd=res.result.txzd this.form.txzd=res.result.txzd
this.form.cdotasj=res.result.cdotasj this.form.cdotasj=res.result.cdotasj
this.form.id=res.result.id 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 this.form.cxmb = this.form.djbh+'-'+ this.form.ggpc+'-'+this.form.cpxh
}else { }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 this.form.cxmb = this.form.djbh+'-'+ this.form.ggpc+'-'+this.form.cpxh
}else{ }else{
this.form.cxmb = res.result.cxmb ? res.result.cxmb : undefined this.form.cxmb = res.result.cxmb ? res.result.cxmb : undefined
@@ -370,6 +371,9 @@ import { message } from 'ant-design-vue'
if(valid){ if(valid){
this.save() this.save()
setTimeout(()=>{ setTimeout(()=>{
if(this.flag == 1){
return
}
this.$emit('basicInformationForm') this.$emit('basicInformationForm')
},1000) },1000)
@@ -385,11 +389,14 @@ import { message } from 'ant-design-vue'
otaId='' otaId=''
} }
postAction('/ota/otaBaCxJbxx/add',{ otaId:otaId,...this.form}).then( res => { postAction('/ota/otaBaCxJbxx/add',{ otaId:otaId,...this.form}).then( res => {
if(res.code == 200){ if(res.success){
localStorage.setItem('otaId', res.result.otaId) localStorage.setItem('otaId', res.result.otaId)
this.$message.success(this.$t('SavedSuccessfully')) this.$message.success(res.message)
this.getData() this.getData()
} }else{
this.$message.warning(res.message)
this.flag = 1
}
}) })
} }
}) })