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',
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',
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',
cantTransferToYourself:"Can't transfer to yourself",
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:':附件包括测试项目清单测试报告测试标准或技术规范',
format:'支持doc/docx/pdf格式,大小50M以内',
cantTransferToYourself:"不能转办给自己",
noteone:':支持CSV格式大小20M以内数量1-10个',
noteone:':支持CSV格式大小20M以内数量1-20个',
notecsv:':支持CSV格式大小20M以内',
theDataYouInitiate:'您所选的数据均不符合流程发起条件请重新检查后发起',
dataWithProcessReleasedCannotBeReset:'流程状态为清单待发布的数据不能被重置',
reasonForReturnOfDesignCompliance:'设计符合性退回原因',
@@ -66,6 +66,7 @@
formInline.VINcodelist == null) ? $t('clickUpload') : $t('viewUploadedFiles')
}}
</a-button>
<p>{{$t('notecsv')}}</p>
</a-form-model-item>
</div>
</a-col>
@@ -123,6 +124,7 @@
formInline.VINcodelist == null) ? $t('clickUpload') : $t('viewUploadedFiles')
}}
</a-button>
<p style='width: 243px'>{{$t('format')}}</p>
</a-form-model-item>
</div>
</a-col>
@@ -151,11 +153,12 @@
</div>
<a-form-model-item class="itemModel" prop="VINcodelist">
<a-button type="primary" class="button-text"
@click="clickButtonToUpload('VINcodelist')">
@click="clickButtonToUpload('VINcodelist1')">
{{ (formInline.VINcodelist === 'null' || formInline.VINcodelist === '' ||
formInline.VINcodelist == null) ? $t('clickUpload') : $t('viewUploadedFiles')
}}
</a-button>
<p>{{$t('format')}}</p>
</a-form-model-item>
</div>
</a-col>
@@ -167,7 +170,7 @@
<a-button type="primary" @click="handleSubmit" :loading="confirmLoading">{{$t('submit')}}</a-button>
</div>
</a-drawer>
<uploadFile ref="uploadFile" @uploadSuccess="uploadSuccess"/>
<uploadFile ref="uploadFile" :acceptcode="acceptcode" @uploadSuccess="uploadSuccess"/>
</div>
</template>
@@ -189,6 +192,7 @@ export default {
disabled: false,
formInline: {},
confirmLoading: false,
acceptcode:'',
projectNameList: [],
DeliverableTreeList: [],
rules: {
@@ -302,6 +306,11 @@ export default {
})
},
clickButtonToUpload(item) {
if(item == 'VINcodelist'){
this.acceptcode = 'csv'
}else {
this.acceptcode = 'doc,docx,pdf'
}
this.$refs.uploadFile.perentHandleFunc()
this.$refs.uploadFile.visible = true
this.uploadName = item
@@ -288,7 +288,7 @@ export default {
align: 'left',
ellipsis: true,
width: 170,
dataIndex: 'cjsj'
dataIndex: 'createTime'
},
{
title: this.$t('remarks'),
@@ -53,7 +53,11 @@
</span>
</a-table>
<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'>
<p>{{$t('note')}}</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' @click='next'>{{$t('next')}}</a-button>
</div>
<uploadFile ref="uploadFile" @uploadSuccess="uploadSuccess"></uploadFile>
<uploadFile ref="uploadFile" :acceptcode="'doc,docx,pdf'" @uploadSuccess="uploadSuccess"></uploadFile>
</div>
</template>
@@ -86,6 +90,7 @@ export default {
}
],
fileList:'',
loading: false,
disable:false,
columns: [
@@ -216,14 +221,39 @@ export default {
}
getAction('/ota/otaBaSjSjfzbh/queryByOtaId',{otaIdT:otaIdT,otaId:otaId}).then(res=>{
this.dataSource =res.result.list == null ? {} : res.result.list
this.fileList = res.result.fj
})
},
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);
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(){
this.save()
this.$emit('beupgradedonlineup')
@@ -239,20 +269,6 @@ export default {
deleteData(record){
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>
@@ -72,15 +72,15 @@
<!-- <span class="Required">*</span>-->
<span class="title-text-text"></span>
</div>
<a-form-model-item class="itemModel" prop="VINcodelist">
<a-form-model-item class="itemModel" prop="csv">
<a-button type="primary" class="button-text"
@click="clickButtonToUpload('VINcodelist')">
{{ (formInline.VINcodelist === 'null' || formInline.VINcodelist === '' ||
formInline.VINcodelist == null) ? $t('VINcodeupload') : $t('viewUploadedFiles')
@click="clickButtonToUpload('csv')">
{{ (formInline.csv === 'null' || formInline.csv === '' ||
formInline.csv == null) ? $t('VINcodeupload') : $t('viewUploadedFiles')
}}
</a-button>
<p>{{$t('noteone')}}</p>
<uploadFile ref="uploadFile" @uploadSuccess="uploadSuccess"></uploadFile>
<uploadFile ref="uploadFile" :acceptcode="'csv'" @uploadSuccess="uploadSuccess"></uploadFile>
</a-form-model-item>
</div>
</a-col>
@@ -139,6 +139,7 @@ export default {
if(res.code==200){
this.formInline.zsl=res.result.zsl
this.formInline.vinList=res.result.vinList
this.formInline.csv=res.result.csv
this.formInline.dateofproduction=[]
this.formInline.dateofproduction.push(res.result.scrqks)
this.formInline.dateofproduction.push(res.result.scrqjs)
@@ -152,6 +153,7 @@ export default {
let obj={}
obj.otaId=localStorage.getItem('otaId')
obj.zsl = this.formInline.zsl
obj.csv = this.formInline.csv
if(this.formInline.dateofproduction){
obj.scrqks = this.formInline.dateofproduction[0]
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>
@@ -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' @click='next'>{{$t('next')}}</a-button>
</div>
<uploadFile ref="uploadFile" @uploadSuccess="uploadSuccess"></uploadFile>
<uploadFile ref="uploadFile" :acceptcode="'doc,docx,pdf'" @uploadSuccess="uploadSuccess"></uploadFile>
</div>
</template>
@@ -331,7 +331,7 @@ this.$forceUpdate()
this.$refs.uploadFile.perentHandleFunc()
this.$refs.uploadFile.visible = true
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) {
this.$refs.uploadFile.perentHandleFunc(res.result)
} else {
@@ -339,33 +339,22 @@ this.$forceUpdate()
}
})
},
getList() {
let queryParam = JSON.parse(JSON.stringify(this.queryParam))
Object.keys(queryParam).forEach(val => {
if (queryParam[val] instanceof Array) {
queryParam[val] = queryParam[val].join(',')
}
})
let query = {
pageNo: this.pageNo,
pageSize: this.pageSize,
...queryParam
uploadSuccess(data) {
let attIdList = []
if(data && data.length>0){
data.map(item => {
attIdList.push(item.id || data.name)
})
/** 赋值给当前对应的表单文件 */
this.form[this.uploadName] = attIdList.join(',')
this.form = { ...this.form }
// console.log('form',this.formInline)
}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(){
let otaIdT=localStorage.getItem('otaIdT')
@@ -411,20 +400,6 @@ this.$forceUpdate()
this.save()
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>
@@ -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' @click='next'>{{$t('next')}}</a-button>
</div>
<uploadFile ref="uploadFile" @uploadSuccess="uploadSuccess"></uploadFile>
<uploadFile ref="uploadFile" :acceptcode="'doc,docx,pdf'" @uploadSuccess="uploadSuccess"></uploadFile>
</div>
</template>
@@ -311,6 +311,7 @@ import uploadFileOta from '@/components/uploadFileOta/file'
if(otaIdT==null){
otaIdT=''
}
let randomNum = Math.floor(Math.random()*99999999999+1)
getAction('/ota/otaBaCxKsjxtmccs/queryByOtaId',{otaIdT:otaIdT,otaId:localStorage.getItem('otaId')}).then(res=>{
if(res.code==200){
if(res.result.list.length==0){
@@ -341,8 +342,9 @@ import uploadFileOta from '@/components/uploadFileOta/file'
},
]
}else{
res.result.list.forEach(item =>{
item.sfksj =Number(item.sfksj)
res.result.list.forEach((item,index) =>{
item.sfksj = Number(item.sfksj)
item.key = randomNum + index
})
this.dataSource=res.result.list
this.fileList = res.result.fj
@@ -256,7 +256,7 @@ export default {
align: 'left',
ellipsis: true,
width: 170,
dataIndex: 'cjsj'
dataIndex: 'createTime'
},
{
title: this.$t('remarks'),