This commit is contained in:
yuekuo
2023-03-25 22:36:25 +08:00
parent de17ee6a93
commit 6d76daa6ce
5 changed files with 106 additions and 36 deletions
@@ -10,7 +10,7 @@
</div> </div>
</div> </div>
<a-spin :spinning="confirmLoading"> <a-spin :spinning="confirmLoading">
<a-form-model class="formAdd" ref="ruleForm" :model="form" > <a-form-model class="formAdd" ref="ruleForm" :model="form" :rules="rules">
<!-- :rules="formRules" --> <!-- :rules="formRules" -->
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="24"> <a-col :span="24">
@@ -20,9 +20,9 @@
</div> </div>
<a-form-model-item class="itemModel" prop="dutyTerritory"> <a-form-model-item class="itemModel" prop="dutyTerritory">
<a-select :disabled="disabled" class="box-input" v-model="form.cxmb" allowClear :triggerChange="false" :placeholder="$t('PleaseSelect')"> <a-select :disabled="disabled" class="box-input" v-model="form.cxmb" allowClear :placeholder="$t('PleaseSelect')" @change="changeId">
<a-select-option v-for="(item , key ) in selectList" :key="key" :value="item.id"> <a-select-option v-for="(item , key ) in selectList" :key="key" :value="item.id" >
{{ item.ggpc }} {{ item.value }}
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-model-item> </a-form-model-item>
@@ -47,9 +47,11 @@
<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('registrationnumber')">{{$t('registrationnumber')}}</span> <span class="title-text-text" :title="$t('registrationnumber')">{{$t('registrationnumber')}}</span>
</div> </div>
<a-form-model-item class="itemModel"> <a-form-model-item class="itemModel" prop="djbh">
<a-input <a-input
:max-length="500" :max-length="500"
:disabled="disabled" :disabled="disabled"
@@ -221,6 +223,7 @@
<script> <script>
import { getAction, postAction, deleteAction,downloadFile } from '@/api/manage' import { getAction, postAction, deleteAction,downloadFile } from '@/api/manage'
import ImportFile from '@/components/ImportFileData/index' import ImportFile from '@/components/ImportFileData/index'
import { message } from 'ant-design-vue'
export default { export default {
name: 'basicInformation', name: 'basicInformation',
@@ -243,7 +246,16 @@
projectNameList1:['传统动力汽车','节能汽车','新能源汽车','其他'], projectNameList1:['传统动力汽车','节能汽车','新能源汽车','其他'],
projectNameList2:[], projectNameList2:[],
selectList:[], selectList:[],
otaId:'' otaId:'',
rules:{
djbh:[
{
required: true,
message:this.$t('registrationnumber')+this.$t('cannotEmpty'),
trigger:'blur'
}
]
}
} }
}, },
mounted() { mounted() {
@@ -252,6 +264,14 @@
this.getData() this.getData()
}, },
methods: { methods: {
changeId(value,option){
localStorage.removeItem('otaId')
localStorage.removeItem('otaIdT')
localStorage.setItem('otaIdT',value)
this.$forceUpdate()
this.getData()
},
// 模板下载 // 模板下载
handleModule() { handleModule() {
downloadFile('ota/otaBaCxJbxx/exportTemplate', '车型及功能备案' + '.zip', {}) downloadFile('ota/otaBaCxJbxx/exportTemplate', '车型及功能备案' + '.zip', {})
@@ -263,7 +283,13 @@
res.result.forEach(item=>{ res.result.forEach(item=>{
let obj={} let obj={}
obj.id=item.id obj.id=item.id
obj.ggpc=item.ggpc if(item.cpmc==null){
item.cpmc=''
}
if(item.cpxh==null){
item.cpxh=''
}
obj.value=item.ggpc+'-'+item.cpmc+'-'+item.cpxh
this.selectList.push(obj) this.selectList.push(obj)
}) })
} }
@@ -281,14 +307,27 @@
} }
getAction('/ota/otaBaCxJbxx/queryByOtaId',{otaIdT:otaIdT,otaId:otaId}).then(res=>{ getAction('/ota/otaBaCxJbxx/queryByOtaId',{otaIdT:otaIdT,otaId:otaId}).then(res=>{
if(res.code == 200){ if(res.code == 200){
this.form=res.result
this.form.qymc=res.result.qymc
this.form.djbh=res.result.djbh
this.form.cplb=res.result.cplb
this.form.ggpc=res.result.ggpc
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 ){ if(res.result.dllx1 == null ){
res.result.dllx1 = undefined res.result.dllx1 = undefined
} }
if(res.result.dllx2 == null){ if(res.result.dllx2 == null){
res.result.dllx2 = undefined res.result.dllx2 = undefined
} }
this.changeSelect() // this.changeSelect()
} }
}) })
@@ -403,4 +442,8 @@
// /deep/ .ant-input{ // /deep/ .ant-input{
// width: calc(100%+20px); // width: calc(100%+20px);
// } // }
.Required {
color: red;
margin-right: 3px;
}
</style> </style>
@@ -87,7 +87,9 @@
</span> </span>
</a-table> </a-table>
<div> <div>
<a-button @click="clickButtonToUpload" type="primary">{{$t('uploadattachment')}}</a-button> <a-button @click="clickButtonToUpload('fileKey')" type="primary"> {{ (formInline.fileKey === 'null' || formInline.fileKey === '' ||
formInline.fileKey == null) ? $t('clickUpload') : $t('viewUploadedFiles')
}}</a-button>
<p>注:附件包括测试项目清单、测试报告.测试标准或技术规范</p> <p>注:附件包括测试项目清单、测试报告.测试标准或技术规范</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;支持doc/docx/pdf格式,大小50M以内</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;支持doc/docx/pdf格式,大小50M以内</p>
@@ -114,6 +116,8 @@ import ImportFile from '@/components/ImportFileData/index'
}, },
data() { data() {
return { return {
formInline: {},
uploadName:'',
url: { url: {
exportData: '/ota/otaBaCxKsjjsmccs/exportData', exportData: '/ota/otaBaCxKsjjsmccs/exportData',
importZipUrl: '/ota/otaBaCxKsjjsmccs/importData',//导入 importZipUrl: '/ota/otaBaCxKsjjsmccs/importData',//导入
@@ -318,6 +322,18 @@ import ImportFile from '@/components/ImportFileData/index'
} }
}) })
}, },
clickButtonToUpload(item) {
this.$refs.uploadFile.perentHandleFunc()
this.$refs.uploadFile.visible = true
this.uploadName = item
getAction('sys/common/getFileInfos', { id: this.formInline[item] }).then((res) => {
if (res.success) {
this.$refs.uploadFile.perentHandleFunc(res.result)
} else {
this.$refs.uploadFile.perentHandleFunc()
}
})
},
getData(){ getData(){
let otaIdT=localStorage.getItem('otaIdT') let otaIdT=localStorage.getItem('otaIdT')
if(otaIdT==null){ if(otaIdT==null){
@@ -381,19 +397,17 @@ import ImportFile from '@/components/ImportFileData/index'
this.$emit('beupgradedonlinedown') this.$emit('beupgradedonlinedown')
}, },
uploadSuccess(data) { uploadSuccess(data) {
let attIdList = [] let attIdList = []
if (data && data.length > 0) { if (data && data.length > 0) {
data.map(item => { data.map(item => {
attIdList.push({ attIdList.push(item.id || data.name)
id:item.id, })
fileName:item.fileName }
}) /** 赋值给当前对应的表单文件 */
}) this.formInline[this.uploadName] = attIdList.join(',')
} this.formInline = { ...this.formInline }
/** 赋值给当前对应的表单文件 */ this.$refs.ruleForm.clearValidate(['fileKey'])
this.fileList.uploadName = attIdList },
this.fileList.certifyingmaterials = this.$t('viewFile')
},
//中间加 //中间加
addlineAtMid(record){ addlineAtMid(record){
let obj = {gnmc:record.gnmc} let obj = {gnmc:record.gnmc}
@@ -24,10 +24,11 @@
<span slot="havemeasures" slot-scope="text,record"> <span slot="havemeasures" slot-scope="text,record">
<j-dict-select-tag class="box-input" <j-dict-select-tag class="box-input"
v-model="record.info" v-model="record.info"
:placeholder="$t('PleaseSelect')" @change="update"
:type="'select'" :placeholder="$t('PleaseSelect')"
:dictCode="record.dictCode" :type="'select'"
:triggerChange="false"/> :dictCode="record.dictCode"
:triggerChange="false"/>
</span> </span>
<span slot="certifyingmaterials" slot-scope="text,record"> <span slot="certifyingmaterials" slot-scope="text,record">
<a-button type="primary" @click="clickButtonToUpload(record.zmcl,record.key)" v-model="record.zmcl"> <a-button type="primary" @click="clickButtonToUpload(record.zmcl,record.key)" v-model="record.zmcl">
@@ -177,8 +178,10 @@ import ImportFile from '@/components/ImportFileData/index'
// this.getList() // this.getList()
this.getData() this.getData()
}, },
methods: { methods: {
// 模板下载 // 模板下载
handleModule() { handleModule() {
downloadFile('ota/otaBaCxAqcs/exportTemplate', '车型及功能备案' + '.zip', {}) downloadFile('ota/otaBaCxAqcs/exportTemplate', '车型及功能备案' + '.zip', {})
}, },
@@ -189,10 +192,11 @@ import ImportFile from '@/components/ImportFileData/index'
} }
getAction('/ota/otaBaCxAqcs/queryByOtaId',{otaIdT:otaIdT,otaId:localStorage.getItem('otaId')}).then(res=>{ getAction('/ota/otaBaCxAqcs/queryByOtaId',{otaIdT:otaIdT,otaId:localStorage.getItem('otaId')}).then(res=>{
if(res.code == 200){ if(res.code == 200){
this.dataSource[0].info = Number(res.result.bhjz)
this.dataSource[1].info =Number(res.result.fsxjz) this.dataSource[0].info = Number(res.result.bhjz) == 0 ? undefined :Number(res.result.bhjz)
this.dataSource[2].info= Number(res.result.sjsbcs) this.dataSource[1].info =Number(res.result.fsxjz)== 0 ? undefined :Number(res.result.fsxjz)
this.dataSource[3].info=Number(res.result.xxaqjz) this.dataSource[2].info= Number(res.result.sjsbcs)== 0 ? undefined :Number(res.result.sjsbcs)
this.dataSource[3].info=Number(res.result.xxaqjz)== 0 ? undefined :Number(res.result.xxaqjz)
this.fileList.uploadName = res.result.zmclList this.fileList.uploadName = res.result.zmclList
this.fileList.certifyingmaterials = this.$t('viewFile') this.fileList.certifyingmaterials = this.$t('viewFile')
this.$refs.uploadFile.perentHandleFunc(this.fileList.uploadName) this.$refs.uploadFile.perentHandleFunc(this.fileList.uploadName)
@@ -304,7 +304,7 @@ import ImportFile from '@/components/ImportFileData/index'
} }
getAction('/ota/otaBaCxKsjxtmccs/queryByOtaId',{otaIdT:otaIdT,otaId:localStorage.getItem('otaId')}).then(res=>{ getAction('/ota/otaBaCxKsjxtmccs/queryByOtaId',{otaIdT:otaIdT,otaId:localStorage.getItem('otaId')}).then(res=>{
if(res.code==200){ if(res.code==200){
if(res.result.length==0){ if(res.result.list.length==0){
this.dataSource= [ this.dataSource= [
{ {
xtlb:'动力系统', xtlb:'动力系统',
@@ -332,10 +332,10 @@ import ImportFile from '@/components/ImportFileData/index'
}, },
] ]
}else{ }else{
res.result.forEach(item =>{ res.result.list.forEach(item =>{
item.sfksj =Number(item.sfksj) item.sfksj =Number(item.sfksj)
}) })
this.dataSource=res.result this.dataSource=res.result.list
} }
} }
}) })
@@ -380,6 +380,7 @@ export default {
// 创建车型 // 创建车型
createvehicleandfunctionrecords() { createvehicleandfunctionrecords() {
localStorage.removeItem('otaId') localStorage.removeItem('otaId')
localStorage.removeItem('otaIdT')
this.$router.push({ this.$router.push({
path: '/vehicleinformation', path: '/vehicleinformation',
query: {} query: {}
@@ -398,8 +399,16 @@ export default {
downloadFile(this.url.exportData, text + '.zip', query, this.Deselect) downloadFile(this.url.exportData, text + '.zip', query, this.Deselect)
}, },
// 查看 // 查看
detailclick() { detailclick(data) {
console.log('data',data);
localStorage.removeItem('otaIdT')
localStorage.removeItem('otaId')
localStorage.setItem('otaId',data.id)
console.log('data',data.id);
this.$router.push({
path: '/vehicleinformation',
query: {}
})
}, },
// 维护 // 维护
maintenanceClick(row) { maintenanceClick(row) {