bug 67206

附件格式修改
This commit is contained in:
zyx.net
2023-03-28 10:07:14 +08:00
parent 7cf0341d27
commit 44e3a1dc93
10 changed files with 97 additions and 72 deletions
+1
View File
@@ -1717,6 +1717,7 @@ module.exports = {
complianceReporting:'Compliance Reporting', complianceReporting:'Compliance Reporting',
youCanOnlySelectStatusClearSubmit:'You can only select data with a process status of Clear to Submit', youCanOnlySelectStatusClearSubmit:'You can only select data with a process status of Clear to Submit',
note:'Note: The attachment includes the list of test items and test report. Test standard or technical specification', note:'Note: The attachment includes the list of test items and test report. Test standard or technical specification',
notecsv:'Note: CSV format is supported. The value is within 20M',
format:'It supports doc/docx/pdf format and is less than 50M in size', format:'It supports doc/docx/pdf format and is less than 50M in size',
cantTransferToYourself:"Can't transfer to yourself", cantTransferToYourself:"Can't transfer to yourself",
theDataYouInitiate:'The data you selected does not meet the process initiation criteria. Please recheck and initiate', theDataYouInitiate:'The data you selected does not meet the process initiation criteria. Please recheck and initiate',
+2 -1
View File
@@ -1821,7 +1821,8 @@ module.exports = {
note:':附件包括测试项目清单测试报告测试标准或技术规范', note:':附件包括测试项目清单测试报告测试标准或技术规范',
format:'支持doc/docx/pdf格式,大小50M以内', format:'支持doc/docx/pdf格式,大小50M以内',
cantTransferToYourself:"不能转办给自己", cantTransferToYourself:"不能转办给自己",
noteone:':支持CSV格式大小20M以内数量1-10个', noteone:':支持CSV格式大小20M以内数量1-20个',
notecsv:':支持CSV格式大小20M以内',
theDataYouInitiate:'您所选的数据均不符合流程发起条件请重新检查后发起', theDataYouInitiate:'您所选的数据均不符合流程发起条件请重新检查后发起',
dataWithProcessReleasedCannotBeReset:'流程状态为清单待发布的数据不能被重置', dataWithProcessReleasedCannotBeReset:'流程状态为清单待发布的数据不能被重置',
reasonForReturnOfDesignCompliance:'设计符合性退回原因', reasonForReturnOfDesignCompliance:'设计符合性退回原因',
@@ -66,6 +66,7 @@
formInline.VINcodelist == null) ? $t('clickUpload') : $t('viewUploadedFiles') formInline.VINcodelist == null) ? $t('clickUpload') : $t('viewUploadedFiles')
}} }}
</a-button> </a-button>
<p>{{$t('notecsv')}}</p>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
@@ -123,6 +124,7 @@
formInline.VINcodelist == null) ? $t('clickUpload') : $t('viewUploadedFiles') formInline.VINcodelist == null) ? $t('clickUpload') : $t('viewUploadedFiles')
}} }}
</a-button> </a-button>
<p style='width: 243px'>{{$t('format')}}</p>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
@@ -151,11 +153,12 @@
</div> </div>
<a-form-model-item class="itemModel" prop="VINcodelist"> <a-form-model-item class="itemModel" prop="VINcodelist">
<a-button type="primary" class="button-text" <a-button type="primary" class="button-text"
@click="clickButtonToUpload('VINcodelist')"> @click="clickButtonToUpload('VINcodelist1')">
{{ (formInline.VINcodelist === 'null' || formInline.VINcodelist === '' || {{ (formInline.VINcodelist === 'null' || formInline.VINcodelist === '' ||
formInline.VINcodelist == null) ? $t('clickUpload') : $t('viewUploadedFiles') formInline.VINcodelist == null) ? $t('clickUpload') : $t('viewUploadedFiles')
}} }}
</a-button> </a-button>
<p>{{$t('format')}}</p>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
@@ -167,7 +170,7 @@
<a-button type="primary" @click="handleSubmit" :loading="confirmLoading">{{$t('submit')}}</a-button> <a-button type="primary" @click="handleSubmit" :loading="confirmLoading">{{$t('submit')}}</a-button>
</div> </div>
</a-drawer> </a-drawer>
<uploadFile ref="uploadFile" @uploadSuccess="uploadSuccess"/> <uploadFile ref="uploadFile" :acceptcode="acceptcode" @uploadSuccess="uploadSuccess"/>
</div> </div>
</template> </template>
@@ -189,6 +192,7 @@ export default {
disabled: false, disabled: false,
formInline: {}, formInline: {},
confirmLoading: false, confirmLoading: false,
acceptcode:'',
projectNameList: [], projectNameList: [],
DeliverableTreeList: [], DeliverableTreeList: [],
rules: { rules: {
@@ -302,6 +306,11 @@ export default {
}) })
}, },
clickButtonToUpload(item) { clickButtonToUpload(item) {
if(item == 'VINcodelist'){
this.acceptcode = 'csv'
}else {
this.acceptcode = 'doc,docx,pdf'
}
this.$refs.uploadFile.perentHandleFunc() this.$refs.uploadFile.perentHandleFunc()
this.$refs.uploadFile.visible = true this.$refs.uploadFile.visible = true
this.uploadName = item this.uploadName = item
@@ -288,7 +288,7 @@ export default {
align: 'left', align: 'left',
ellipsis: true, ellipsis: true,
width: 170, width: 170,
dataIndex: 'cjsj' dataIndex: 'createTime'
}, },
{ {
title: this.$t('remarks'), title: this.$t('remarks'),
@@ -53,7 +53,11 @@
</span> </span>
</a-table> </a-table>
<div> <div>
<a-button @click="clickButtonToUpload" type="primary">{{$t('uploadattachment')}}</a-button> <a-button type="primary" @click="clickButtonToUpload(fileList)">
{{ (fileList === 'null' || fileList === '' ||
fileList == null) ? $t('uploadattachment') : $t('viewUploadedFiles')
}}
</a-button>
<div style='margin-top: 20px'> <div style='margin-top: 20px'>
<p>{{$t('note')}}</p> <p>{{$t('note')}}</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;{{$t('format')}}</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;{{$t('format')}}</p>
@@ -64,7 +68,7 @@
<a-button type="primary" style='width: 73px;margin-right: 50px' @click='last'>{{$t('last')}}</a-button> <a-button type="primary" style='width: 73px;margin-right: 50px' @click='last'>{{$t('last')}}</a-button>
<a-button type="primary" style='width: 73px' @click='next'>{{$t('next')}}</a-button> <a-button type="primary" style='width: 73px' @click='next'>{{$t('next')}}</a-button>
</div> </div>
<uploadFile ref="uploadFile" @uploadSuccess="uploadSuccess"></uploadFile> <uploadFile ref="uploadFile" :acceptcode="'doc,docx,pdf'" @uploadSuccess="uploadSuccess"></uploadFile>
</div> </div>
</template> </template>
@@ -86,6 +90,7 @@ export default {
} }
], ],
fileList:'',
loading: false, loading: false,
disable:false, disable:false,
columns: [ columns: [
@@ -216,14 +221,39 @@ export default {
} }
getAction('/ota/otaBaSjSjfzbh/queryByOtaId',{otaIdT:otaIdT,otaId:otaId}).then(res=>{ getAction('/ota/otaBaSjSjfzbh/queryByOtaId',{otaIdT:otaIdT,otaId:otaId}).then(res=>{
this.dataSource =res.result.list == null ? {} : res.result.list this.dataSource =res.result.list == null ? {} : res.result.list
this.fileList = res.result.fj
}) })
}, },
save(){ save(){
postAction('/ota/otaBaSjSjfzbh/add' ,{otaId:localStorage.getItem('otaId')== undefined ? '' :localStorage.getItem('otaId'),list:this.dataSource}).then(res=>{ postAction('/ota/otaBaSjSjfzbh/add' ,{otaId:localStorage.getItem('otaId')== undefined ? '' :localStorage.getItem('otaId'),list:this.dataSource,fj:this.fileList}).then(res=>{
console.log(res); console.log(res);
this.$message.success(this.$t('SavedSuccessfully')) this.$message.success(this.$t('SavedSuccessfully'))
}) })
}, },
uploadSuccess(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) {
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()
}
})
},
last(){ last(){
this.save() this.save()
this.$emit('beupgradedonlineup') this.$emit('beupgradedonlineup')
@@ -239,20 +269,6 @@ export default {
deleteData(record){ deleteData(record){
this.dataSource.splice(this.dataSource.indexOf(record),1) this.dataSource.splice(this.dataSource.indexOf(record),1)
}, },
uploadSuccess(data) {
let attIdList = []
if (data && data.length > 0) {
data.map(item => {
attIdList.push({
id:item.id,
fileName:item.fileName
})
})
}
/** 赋值给当前对应的表单文件 */
this.fileList.uploadName = attIdList
this.fileList.certifyingmaterials = this.$t('viewFile')
},
} }
} }
</script> </script>
@@ -72,15 +72,15 @@
<!-- <span class="Required">*</span>--> <!-- <span class="Required">*</span>-->
<span class="title-text-text"></span> <span class="title-text-text"></span>
</div> </div>
<a-form-model-item class="itemModel" prop="VINcodelist"> <a-form-model-item class="itemModel" prop="csv">
<a-button type="primary" class="button-text" <a-button type="primary" class="button-text"
@click="clickButtonToUpload('VINcodelist')"> @click="clickButtonToUpload('csv')">
{{ (formInline.VINcodelist === 'null' || formInline.VINcodelist === '' || {{ (formInline.csv === 'null' || formInline.csv === '' ||
formInline.VINcodelist == null) ? $t('VINcodeupload') : $t('viewUploadedFiles') formInline.csv == null) ? $t('VINcodeupload') : $t('viewUploadedFiles')
}} }}
</a-button> </a-button>
<p>{{$t('noteone')}}</p> <p>{{$t('noteone')}}</p>
<uploadFile ref="uploadFile" @uploadSuccess="uploadSuccess"></uploadFile> <uploadFile ref="uploadFile" :acceptcode="'csv'" @uploadSuccess="uploadSuccess"></uploadFile>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
@@ -139,6 +139,7 @@ export default {
if(res.code==200){ if(res.code==200){
this.formInline.zsl=res.result.zsl this.formInline.zsl=res.result.zsl
this.formInline.vinList=res.result.vinList this.formInline.vinList=res.result.vinList
this.formInline.csv=res.result.csv
this.formInline.dateofproduction=[] this.formInline.dateofproduction=[]
this.formInline.dateofproduction.push(res.result.scrqks) this.formInline.dateofproduction.push(res.result.scrqks)
this.formInline.dateofproduction.push(res.result.scrqjs) this.formInline.dateofproduction.push(res.result.scrqjs)
@@ -152,6 +153,7 @@ export default {
let obj={} let obj={}
obj.otaId=localStorage.getItem('otaId') obj.otaId=localStorage.getItem('otaId')
obj.zsl = this.formInline.zsl obj.zsl = this.formInline.zsl
obj.csv = this.formInline.csv
if(this.formInline.dateofproduction){ if(this.formInline.dateofproduction){
obj.scrqks = this.formInline.dateofproduction[0] obj.scrqks = this.formInline.dateofproduction[0]
obj.scrqjs = this.formInline.dateofproduction[1] obj.scrqjs = this.formInline.dateofproduction[1]
@@ -188,6 +190,25 @@ export default {
} }
}) })
}, },
/** 上传文件的回调 */
uploadSuccess(data) {
// console.log(data)
let attIdList = []
if(data && data.length>0){
data.map(item => {
attIdList.push(item.id || data.name)
})
/** 赋值给当前对应的表单文件 */
this.formInline.csv = attIdList.join(',')
this.formInline = { ...this.formInline }
// console.log('form',this.formInline)
}else{
this.formInline.csv = ''
this.formInline = { ...this.formInline }
// console.log('form',this.formInline)
}
},
} }
} }
</script> </script>
@@ -146,7 +146,7 @@
<a-button type="primary" style='width: 73px;margin-right: 50px' @click='last'>{{$t('last')}}</a-button> <a-button type="primary" style='width: 73px;margin-right: 50px' @click='last'>{{$t('last')}}</a-button>
<a-button type="primary" style='width: 73px' @click='next'>{{$t('next')}}</a-button> <a-button type="primary" style='width: 73px' @click='next'>{{$t('next')}}</a-button>
</div> </div>
<uploadFile ref="uploadFile" @uploadSuccess="uploadSuccess"></uploadFile> <uploadFile ref="uploadFile" :acceptcode="'doc,docx,pdf'" @uploadSuccess="uploadSuccess"></uploadFile>
</div> </div>
</template> </template>
@@ -331,7 +331,7 @@ this.$forceUpdate()
this.$refs.uploadFile.perentHandleFunc() this.$refs.uploadFile.perentHandleFunc()
this.$refs.uploadFile.visible = true this.$refs.uploadFile.visible = true
this.uploadName = item this.uploadName = item
getAction('sys/common/getFileInfos', { id: this.formInline[item] }).then((res) => { getAction('sys/common/getFileInfos', { id: this.form[item] }).then((res) => {
if (res.success) { if (res.success) {
this.$refs.uploadFile.perentHandleFunc(res.result) this.$refs.uploadFile.perentHandleFunc(res.result)
} else { } else {
@@ -339,33 +339,22 @@ this.$forceUpdate()
} }
}) })
}, },
getList() { uploadSuccess(data) {
let queryParam = JSON.parse(JSON.stringify(this.queryParam)) let attIdList = []
Object.keys(queryParam).forEach(val => { if(data && data.length>0){
if (queryParam[val] instanceof Array) { data.map(item => {
queryParam[val] = queryParam[val].join(',') attIdList.push(item.id || data.name)
} })
}) /** 赋值给当前对应的表单文件 */
let query = { this.form[this.uploadName] = attIdList.join(',')
pageNo: this.pageNo, this.form = { ...this.form }
pageSize: this.pageSize, // console.log('form',this.formInline)
...queryParam }else{
this.form[this.uploadName] = ''
this.form = { ...this.form }
// console.log('form',this.formInline)
} }
this.loading = true
getAction(this.url.list, query).then((res) => {
if (res.success) {
if (res.result.current > 1 && res.result.records.length == 0) {
this.pageNo = 1
this.getList()
return
}
this.dataSource = res.result.records || []
this.total = res.result.total
this.loading = false
} else {
this.loading = false
}
})
}, },
getData(){ getData(){
let otaIdT=localStorage.getItem('otaIdT') let otaIdT=localStorage.getItem('otaIdT')
@@ -411,20 +400,6 @@ this.$forceUpdate()
this.save() this.save()
this.$emit('safetyPrecautionsdown') this.$emit('safetyPrecautionsdown')
}, },
uploadSuccess(data) {
let attIdList = []
if (data && data.length > 0) {
data.map(item => {
attIdList.push({
id:item.id,
fileName:item.fileName
})
})
}
/** 赋值给当前对应的表单文件 */
this.fileList.uploadName = attIdList
this.fileList.certifyingmaterials = this.$t('viewFile')
},
} }
} }
</script> </script>
@@ -170,7 +170,7 @@
<a-button type="primary" style='width: 73px;margin-right: 50px' @click='last'>{{$t('last')}}</a-button> <a-button type="primary" style='width: 73px;margin-right: 50px' @click='last'>{{$t('last')}}</a-button>
<a-button type="primary" style='width: 73px' @click='next'>{{$t('next')}}</a-button> <a-button type="primary" style='width: 73px' @click='next'>{{$t('next')}}</a-button>
</div> </div>
<uploadFile ref="uploadFile" @uploadSuccess="uploadSuccess"></uploadFile> <uploadFile ref="uploadFile" :acceptcode="'doc,docx,pdf'" @uploadSuccess="uploadSuccess"></uploadFile>
</div> </div>
</template> </template>
@@ -311,6 +311,7 @@ import uploadFileOta from '@/components/uploadFileOta/file'
if(otaIdT==null){ if(otaIdT==null){
otaIdT='' otaIdT=''
} }
let randomNum = Math.floor(Math.random()*99999999999+1)
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.list.length==0){ if(res.result.list.length==0){
@@ -341,8 +342,9 @@ import uploadFileOta from '@/components/uploadFileOta/file'
}, },
] ]
}else{ }else{
res.result.list.forEach(item =>{ res.result.list.forEach((item,index) =>{
item.sfksj =Number(item.sfksj) item.sfksj = Number(item.sfksj)
item.key = randomNum + index
}) })
this.dataSource=res.result.list this.dataSource=res.result.list
this.fileList = res.result.fj this.fileList = res.result.fj
@@ -256,7 +256,7 @@ export default {
align: 'left', align: 'left',
ellipsis: true, ellipsis: true,
width: 170, width: 170,
dataIndex: 'cjsj' dataIndex: 'createTime'
}, },
{ {
title: this.$t('remarks'), title: this.$t('remarks'),