Commit 3d9a9288 by lichengming

修改了附件上传

parent 18f82b6c
...@@ -81,6 +81,7 @@ export default { ...@@ -81,6 +81,7 @@ export default {
this.subcontractorId = '' this.subcontractorId = ''
this.originalRecordId = '' this.originalRecordId = ''
this.curveId = '' this.curveId = ''
this.entrustId = ''
this.idKey = key this.idKey = key
switch (key) { switch (key) {
// 委托 // 委托
...@@ -97,6 +98,19 @@ export default { ...@@ -97,6 +98,19 @@ export default {
viewUri: '/meter/v1/entrust_attachment/preview/' viewUri: '/meter/v1/entrust_attachment/preview/'
} }
break 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': case 'sampleId':
// 样品 // 样品
this.sampleId = id this.sampleId = id
...@@ -159,11 +173,13 @@ export default { ...@@ -159,11 +173,13 @@ export default {
sampleId: this.sampleId, sampleId: this.sampleId,
subcontractorId: this.subcontractorId, subcontractorId: this.subcontractorId,
originalRecordId: this.originalRecordId, originalRecordId: this.originalRecordId,
curveId: this.curveId curveId: this.curveId,
entrustId: this.entrustId
} }
this.$refs.fileModal._setUploadData( this.$refs.fileModal._setUploadData(
Object.assign({ id: id }, this.urlData), Object.assign({ id: id }, this.urlData),
idsObj idsObj,
this.idKey
) )
}, },
_deleteById(ids) { _deleteById(ids) {
......
...@@ -165,8 +165,8 @@ export default { ...@@ -165,8 +165,8 @@ export default {
// {title: '上传人', key: 'cname', width: 120}, // {title: '上传人', key: 'cname', width: 120},
], ],
formObj: { formObj: {
contractId: '', contractId: undefined,
entrustId: '' entrustId: undefined
}, },
viewVal: 1, viewVal: 1,
viewStyle: 1, viewStyle: 1,
...@@ -202,13 +202,17 @@ export default { ...@@ -202,13 +202,17 @@ export default {
} }
}, },
methods: { methods: {
_setUploadData(data, idsObj) { _setUploadData(data, idsObj, idKey) {
this.selectIds = [] this.selectIds = []
this.imgViewIndex = null this.imgViewIndex = null
this.isLoad = false this.isLoad = false
this.id = data.id this.id = data.id
this.formObj.contractId = data.id const pageKey = idKey
this.formObj.entrustId = data.id 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 // 各个ids
this.idsObj = idsObj this.idsObj = idsObj
this.urlData = data this.urlData = data
......
...@@ -324,7 +324,7 @@ export default { ...@@ -324,7 +324,7 @@ export default {
_upload(id) { _upload(id) {
// 上传文件 // 上传文件
this.$refs.FileManage._open(id, 'contractId') this.$refs.FileManage._open(id, 'entrustId')
}, },
_exportEntrust(id) { _exportEntrust(id) {
this.$Modal.confirm({ 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