ota修改

This commit is contained in:
zyx.net
2023-03-26 10:55:13 +08:00
parent 87f6dbe1ae
commit a3307e4ac2
9 changed files with 320 additions and 21 deletions
@@ -270,6 +270,9 @@ import { message } from 'ant-design-vue'
localStorage.setItem('otaIdT',value)
this.$forceUpdate()
if(this.$route.query.type == 1){
return
}
this.getData()
},
// 模板下载
@@ -296,8 +299,10 @@ import { message } from 'ant-design-vue'
})
},
getData(){
if(this.$route.query.type == 1){
return
}
let otaIdT=localStorage.getItem('otaIdT')
console.log('!!!',otaIdT);
if(otaIdT==null){
otaIdT=''
}
@@ -315,19 +320,19 @@ import { message } from 'ant-design-vue'
this.form.cpsb=res.result.cpsb
this.form.cpmc=res.result.cpmc
this.form.cpxh=res.result.cpxh
this.form.dllx1=res.result.dllx1
this.form.dllx2=res.result.dllx2
this.form.txzd=res.result.txzd
this.form.cdotasj=res.result.cdotasj
this.form.cxmb=this.form.ggpc+'-'+ this.form.cpmc+'-'+this.form.cpxh
console.log(res.result);
if(res.result.dllx1 == null ){
res.result.dllx1 = undefined
}
if(res.result.dllx2 == null){
res.result.dllx2 = undefined
}
this.form.dllx1=res.result.dllx1
this.form.dllx2=res.result.dllx2
// this.changeSelect()
this.$forceUpdate()
}
})
@@ -119,6 +119,7 @@ import ImportFile from '@/components/ImportFileData/index'
return {
formInline: {},
uploadName:'',
fileList:'',
url: {
exportData: '/ota/otaBaCxKsjjsmccs/exportData',
importZipUrl: '/ota/otaBaCxKsjjsmccs/importData',//导入
@@ -375,16 +376,20 @@ import ImportFile from '@/components/ImportFileData/index'
}else{
res.result.list.forEach(item =>{
item.pzqk =Number(item.pzqk)
})
res.result.list.forEach(item =>{
item.sfksj =Number(item.sfksj)
item.jszdhjb=Number(item.jszdhjb)== 0?undefined:Number(item.jszdhjb)
})
this.dataSource=res.result.list
this.fileList = res.result.fj
this.$forceUpdate()
}
}
})
},
save(){
postAction('/ota/otaBaCxKsjjsmccs/add',{otaId:localStorage.getItem('otaId'),list:this.dataSource}).then(res =>{
postAction('/ota/otaBaCxKsjjsmccs/add',{otaId:localStorage.getItem('otaId'),list:this.dataSource,fj:this.fileList}).then(res =>{
console.log(res);
})
},
@@ -397,16 +402,15 @@ import ImportFile from '@/components/ImportFileData/index'
this.$emit('beupgradedonlinedown')
},
uploadSuccess(data) {
let attIdList = []
if (data && data.length > 0) {
data.map(item => {
attIdList.push(item.id || data.name)
})
}
/** 赋值给当前对应的表单文件 */
this.formInline[this.uploadName] = attIdList.join(',')
this.formInline = { ...this.formInline }
this.$refs.ruleForm.clearValidate(['fileKey'])
let attIdList = []
if (data && data.length > 0) {
data.map(item => {
attIdList.push(item.id || data.name)
})
}
this.$forceUpdate()
// /** 赋值给当前对应的表单文件 */
this.fileList = attIdList.join(',')
},
//中间加
addlineAtMid(record){
@@ -51,6 +51,9 @@ export default {
},
methods: {
getData(){
if(this.$route.query.type == 1){
return
}
let otaIdT=localStorage.getItem('otaIdT')
if(otaIdT==null){
otaIdT=''
@@ -866,6 +866,9 @@ export default {
downloadFile('ota/otaBaCxList/exportTemplate', '车型及功能备案' + '.zip', {})
},
getData(){
if(this.$route.query.type == 1){
return
}
let otaIdT=localStorage.getItem('otaIdT')
if(otaIdT==null){
otaIdT=''
@@ -69,6 +69,7 @@ import ImportFile from '@/components/ImportFileData/index'
{
key: '1',
zmcl:'',
info:'',
aspect: this.$t('upgradepacketprotectionmeasures'),
safetymeasure: this.$t('authenticityandintegrityprotectionmechanism'),
relevantverification: 'havemeasures',
@@ -78,6 +79,7 @@ import ImportFile from '@/components/ImportFileData/index'
{
key: '2',
zmcl:'',
info:'',
aspect: this.$t('otaupgradedsecuritymeasuresforvehicles'),
safetymeasure: this.$t('failsafmechanism'),
relevantverification: 'havemeasures',
@@ -88,6 +90,7 @@ import ImportFile from '@/components/ImportFileData/index'
key: '3',
aspect: '',
zmcl:'',
info:'',
safetymeasure: this.$t('vehiclesafetyMeasuresafterUpgradefailure'),
relevantverification: 'havemeasures',
certifyingmaterials:'',
@@ -97,6 +100,7 @@ import ImportFile from '@/components/ImportFileData/index'
key: '4',
aspect: '',
zmcl:'',
info:'',
safetymeasure: this.$t('informationsecuritymechanism'),
relevantverification: 'havemeasures',
certifyingmaterials:'',
@@ -186,6 +190,9 @@ import ImportFile from '@/components/ImportFileData/index'
downloadFile('ota/otaBaCxAqcs/exportTemplate', '车型及功能备案' + '.zip', {})
},
getData(){
if(this.$route.query.type == 1){
return
}
let otaIdT=localStorage.getItem('otaIdT')
if(otaIdT==null){
otaIdT=''
@@ -205,6 +205,9 @@ export default {
downloadFile('ota/otaBaCxZxsjyq/exportTemplate', '车型及功能备案' + '.zip', {})
},
getData(){
if(this.$route.query.type == 1){
return
}
console.log(localStorage.getItem('otaId'));
let otaIdT=localStorage.getItem('otaIdT')
if(otaIdT==null){
@@ -83,7 +83,10 @@
</span>
</a-table>
<div>
<a-button @click="clickButtonToUpload" type="primary">{{$t('uploadattachment')}}</a-button>
<a-button @click="clickButtonToUploadota(fileList)" type="primary">
{{ (fileList === 'null' || fileList === '' ||
fileList == null) ? $t('uploadattachment') : $t('viewUploadedFiles')
}}</a-button>
<p>注:附件包括测试项目清单、测试报告.测试标准或技术规范</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;支持doc/docx/pdf格式,大小50M以内</p>
@@ -94,18 +97,21 @@
<a-button type="primary" style='width: 73px' @click='next'>{{$t('next')}}</a-button>
</div>
<uploadFile ref="uploadFile" @uploadSuccess="uploadSuccess"></uploadFile>
<uploadFileOta ref="uploadFileOta" @uploadSuccess="uploadSuccessOta"></uploadFileOta>
</div>
</template>
<script>
import { getAction, postAction, deleteAction,downloadFile } from '@/api/manage'
import ImportFile from '@/components/ImportFileData/index'
import uploadFile from '@/components/uploadFile/file'
import uploadFile from '@/components/uploadFile/file'
import uploadFileOta from '@/components/uploadFileOta/file'
export default {
name: 'upgradedonline',
components:{
uploadFile,
uploadFileOta,
ImportFile
},
data() {
@@ -114,6 +120,7 @@ import ImportFile from '@/components/ImportFileData/index'
exportData: '/ota/otaBaCxKsjxtmccs/exportData',
importZipUrl: '/ota/otaBaCxKsjxtmccs/importData',//导入
},
fileList:'',
dataSource: [
{
xtlb:'动力系统',
@@ -298,6 +305,9 @@ import ImportFile from '@/components/ImportFileData/index'
downloadFile('ota/otaBaCxKsjxtmccs/exportTemplate', '车型及功能备案' + '.zip', {})
},
getData(){
if(this.$route.query.type == 1){
return
}
let otaIdT=localStorage.getItem('otaIdT')
if(otaIdT==null){
otaIdT=''
@@ -336,6 +346,7 @@ import ImportFile from '@/components/ImportFileData/index'
item.sfksj =Number(item.sfksj)
})
this.dataSource=res.result.list
this.fileList = res.result.fj
}
}
})
@@ -390,12 +401,34 @@ import ImportFile from '@/components/ImportFileData/index'
})
this.$forceUpdate()
// /** 赋值给当前对应的表单文件 */
// this.fileList.uploadName = attIdList.join(',')
// this.fileList.certifyingmaterials = this.$t('viewFile')
},
uploadSuccessOta(data) {
let attIdList = []
if (data && data.length > 0) {
data.map(item => {
attIdList.push(item.id || data.name)
})
}
this.$forceUpdate()
// /** 赋值给当前对应的表单文件 */
this.fileList = attIdList.join(',')
// this.fileList.certifyingmaterials = this.$t('viewFile')
},
clickButtonToUpload(current,index) {
this.type = index
console.log(current)
this.$refs.uploadFile.perentHandleFunc()
this.$refs.uploadFile.visible = true
this.uploadName = current
getAction('sys/common/getFileInfos', { id: current }).then((res) => {
if (res.success) {
this.$refs.uploadFile.perentHandleFunc(res.result)
} else {
this.$refs.uploadFile.perentHandleFunc()
}
})
},
clickButtonToUploadota(current) {
this.$refs.uploadFile.perentHandleFunc()
this.$refs.uploadFile.visible = true
this.uploadName = current
@@ -424,7 +457,7 @@ import ImportFile from '@/components/ImportFileData/index'
this.dataSource.splice(this.dataSource.indexOf(record),1)
},
save(){
postAction('/ota/otaBaCxKsjxtmccs/add',{otaId:localStorage.getItem('otaId'),list:this.dataSource}).then(res => {
postAction('/ota/otaBaCxKsjxtmccs/add',{otaId:localStorage.getItem('otaId'),list:this.dataSource,fj:this.fileList}).then(res => {
console.log(res);
})
}
@@ -383,7 +383,9 @@ export default {
localStorage.removeItem('otaIdT')
this.$router.push({
path: '/vehicleinformation',
query: {}
query: {
type:1,
}
})
},
viewProcessClick(row) {