Commit 3d9a9288 by lichengming

修改了附件上传

parent 18f82b6c
......@@ -81,6 +81,7 @@ export default {
this.subcontractorId = ''
this.originalRecordId = ''
this.curveId = ''
this.entrustId = ''
this.idKey = key
switch (key) {
// 委托
......@@ -97,6 +98,19 @@ export default {
viewUri: '/meter/v1/entrust_attachment/preview/'
}
break
case 'entrustId':
this.entrustId = id
this.urlData = {
msg: 'FoodContractAttachment',
pageUrl: '/soil/v1/sample_photo/page',
deleteUrl: '/meter/v1/entrust_attachment/?ids=',
uploadFileUrl: '/soil/v1/sample_photo/upload/',
downloadFileUrl: '/meter/v1/entrust_attachment/download/',
downloadBatch: '/food/v1/contract_attachment/download_batch',
uri: 'FoodContractAttachment/getByContractId',
viewUri: '/meter/v1/entrust_attachment/preview/'
}
break
case 'sampleId':
// 样品
this.sampleId = id
......@@ -159,11 +173,13 @@ export default {
sampleId: this.sampleId,
subcontractorId: this.subcontractorId,
originalRecordId: this.originalRecordId,
curveId: this.curveId
curveId: this.curveId,
entrustId: this.entrustId
}
this.$refs.fileModal._setUploadData(
Object.assign({ id: id }, this.urlData),
idsObj
idsObj,
this.idKey
)
},
_deleteById(ids) {
......
......@@ -165,8 +165,8 @@ export default {
// {title: '上传人', key: 'cname', width: 120},
],
formObj: {
contractId: '',
entrustId: ''
contractId: undefined,
entrustId: undefined
},
viewVal: 1,
viewStyle: 1,
......@@ -202,13 +202,17 @@ export default {
}
},
methods: {
_setUploadData(data, idsObj) {
_setUploadData(data, idsObj, idKey) {
this.selectIds = []
this.imgViewIndex = null
this.isLoad = false
this.id = data.id
this.formObj.contractId = data.id
this.formObj.entrustId = data.id
const pageKey = idKey
console.log(pageKey)
this.$set(this.formObj, pageKey, data.id)
console.log(this.formObj)
// this.formObj.contractId = data.id
// this.formObj.entrustId = data.id
// 各个ids
this.idsObj = idsObj
this.urlData = data
......
......@@ -324,7 +324,7 @@ export default {
_upload(id) {
// 上传文件
this.$refs.FileManage._open(id, 'contractId')
this.$refs.FileManage._open(id, 'entrustId')
},
_exportEntrust(id) {
this.$Modal.confirm({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment