Commit b9679521 by lichengming

修改了业务管理和合同管理的附件

parent bacefce2
......@@ -111,5 +111,15 @@ export default {
// 城市
getCity: data => http.post('/base/v1/city/list_' + data).then(res => res),
// 地区
getArea: data => http.post('/base/v1/area/list_' + data).then(res => res)
getArea: data => http.post('/base/v1/area/list_' + data).then(res => res),
// 附件列表
attachmentPage: (url, data) => http.post(url, data).then(res => res),
// 附件删除
attachmentDelete: (url, data) => http.delete(url + data).then(res => res),
// 预览附件
attachmentPreview: data =>
http.post('/meter/v1/contract_attachment/preview/' + data).then(res => res),
// 委托附件预览
entrustPreview: data =>
http.post('/meter/v1/entrust_attachment/preview/' + data).then(res => res)
}
......@@ -27,8 +27,8 @@
</template>
<script>
import ModalConfirm from '../../base/ModalConfirm'
import { meterEntrust } from '../../../api'
import FilesList from './FilesList'
export default {
components: {
FilesList,
......@@ -88,13 +88,13 @@ export default {
this.contractId = id
this.urlData = {
msg: 'FoodContractAttachment',
pageUrl: 'FoodContractAttachment/page',
deleteUrl: 'FoodContractAttachment/deleteByIds',
uploadFileUrl: '/food/v1/contract_attachment/',
downloadFileUrl: '/food/v1/contract_attachment/download/',
pageUrl: '/meter/v1/entrust_attachment/page',
deleteUrl: '/meter/v1/entrust_attachment/?ids=',
uploadFileUrl: '/meter/v1/entrust_attachment/upload/',
downloadFileUrl: '/meter/v1/entrust_attachment/download/',
downloadBatch: '/food/v1/contract_attachment/download_batch',
uri: 'FoodContractAttachment/getByContractId',
viewUri: '/food/v1/contract_attachment/view'
viewUri: '/meter/v1/entrust_attachment/preview/'
}
break
case 'sampleId':
......@@ -116,10 +116,10 @@ export default {
this.subcontractorId = id
this.urlData = {
msg: 'FoodSubContractAttachment',
pageUrl: 'FoodSubContractAttachment/page',
pageUrl: '/meter/v1/contract_attachment/page',
deleteUrl: 'FoodSubContractAttachment/deleteByIds',
uploadFileUrl: '/food/v1/subcontractor_attachment/upload_',
downloadFileUrl: '/food/v1/subcontractor_attachment/download/',
uploadFileUrl: '/meter/v1/contract_attachment/upload/',
downloadFileUrl: '/meter/v1/contract_attachment/download/',
downloadBatch: '/food/v1/subcontractor_attachment/download_batch',
uri: 'FoodSubContractAttachment/getBySubcontractorId',
viewUri: '/food/v1/subcontractor_attachment/view'
......@@ -171,16 +171,18 @@ export default {
this.modalContent = '确定要删除这 ' + ids.length + ' 个附件?'
this.$refs.confirmModal._openModal()
},
_delPage(data) {
this.$store.dispatch(this.urlData.deleteUrl, data).then(() => {
const status = this.$store.state[this.urlData.msg].success
if (status) {
this.$Message.success('删除成功!')
this.$refs.fileModal._page()
}
this.$refs.confirmModal._closeModal()
this.deleteId = []
})
_delPage: async function(data) {
console.log(data)
const result = await meterEntrust.attachmentDelete(
this.urlData.deleteUrl,
data.id
)
if (result) {
this.$Message.success('删除成功!')
this.$refs.fileModal._page()
}
this.$refs.confirmModal._closeModal()
this.deleteId = []
},
// 删除提示框返回
_modalResult(msg) {
......
......@@ -59,7 +59,7 @@
fixed="right">
<template slot-scope="scope">
<VXEIconList
:msg="$fileFormat(scope.row.type,'img')?iconMsg:iconMsgDis"
:msg="iconMsg"
@on-result-change="_iconClick" :rowData="scope.row"></VXEIconList>
</template>
</vxe-table-column>
......@@ -68,7 +68,7 @@
<!--/-->
<!--缩略图 模式-->
<div v-show="viewStyle === 2">
<ul :style="{ 'height': tableHeight + 'px' }" class="thumbnailStyle">
<ul :style="{ 'height': 'auto' }" class="thumbnailStyle">
<CheckboxGroup @on-change="_chkVal" v-model="selectIds">
<li v-for="item in getPage.records" :key="item.id">
<div class="thumbnailStyleImg">
......@@ -91,7 +91,7 @@
<!--/-->
<!--列表 模式-->
<div v-show="viewStyle === 3">
<ul :style="{ 'height': tableHeight + 'px' }" class="listStyle">
<ul :style="{ 'height': 'auto' }" class="listStyle">
<CheckboxGroup @on-change="_chkVal" v-model="selectIds">
<li v-for="item in getPage.records" :key="item.id">
<div class="listStyleCheck clearCheck">
......@@ -133,7 +133,7 @@
<script>
import VueGallerySlideshow from 'vue-gallery-slideshow'
import global from '../../../api/config'
import { meterEntrust } from '../../../api'
/**
* 公共组件modal 弹框(支持上传,下载,预览,删除附件等操作)
*/
......@@ -147,9 +147,9 @@ export default {
imgViewList: [],
imgViewIndex: null,
iconMsg: [
{ type: 'trash-a', id: '', name: '删除' },
{ type: 'ios-download', id: '', name: '删除' },
{ type: 'ios-download', id: '', name: '下载' },
{ type: 'images', id: '', name: '预览' }
{ type: 'ios-download', id: '', name: '预览' }
],
iconMsgDis: [
{ type: 'trash-a', id: '', name: '删除' },
......@@ -164,6 +164,7 @@ export default {
{ title: '上传时间', key: 'ctime', width: 140, dateTime: true }
// {title: '上传人', key: 'cname', width: 120},
],
formObj: {},
viewVal: 1,
viewStyle: 1,
menusList: [
......@@ -211,11 +212,25 @@ export default {
// this._page()
// })
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await meterEntrust.attachmentPage(
this.urlData.pageUrl,
this.formObj
)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
// _page: async function() {
// Object.assign(this.formObj, this.$refs.pageTable._searchParams())
// console.log('this.formObj', this.formObj)
// const result = await meterEntrust.pageSendEntrust(this.formObj)
// const result = await meterEntrust.attachmentPage(this.formObj)
// console.log('请求结果', result)
// if (result) {
// console.log(result)
// this.$refs.pageTable._hideLoading()
// this.getPage = result
// }
......@@ -270,37 +285,47 @@ export default {
}
},
// 预览图片(该合同下所有的)
_viewImg(data) {
this.$store.dispatch(this.urlData.uri, this.id).then(() => {
const viewUri = this.urlData.viewUri
const result = this.$store.state[this.urlData.msg].list
const imgViewList = []
for (let i = 0; i < result.length; i++) {
imgViewList.push(
global.baseURL +
viewUri +
'?id=' +
result[i].id +
'&objectKey=' +
result[i].objectKey
)
}
this.imgViewList = imgViewList
// 打开的是当前第几张图片
const salesUri =
global.baseURL +
viewUri +
'?id=' +
data.id +
'&objectKey=' +
data.objectKey
const index = this.imgViewList.findIndex(item => item === salesUri)
if (index === -1) {
this.imgViewIndex = 0
} else {
this.imgViewIndex = index
}
})
_viewImg: async function(data) {
if (this.urlData.viewUri === '/meter/v1/entrust_attachment/preview/') {
const id = data.entrustId
const result = await meterEntrust.entrustPreview(id)
console.log(result)
} else {
const id = data.contractId
const result = await meterEntrust.attachmentPreview(id)
console.log(result)
}
// this.$store.dispatch(this.urlData.uri, this.id).then(() => {
// const viewUri = this.urlData.viewUri
// const result = this.$store.state[this.urlData.msg].list
// const imgViewList = []
// for (let i = 0; i < result.length; i++) {
// imgViewList.push(
// global.baseURL +
// viewUri +
// '?id=' +
// result[i].id +
// '&objectKey=' +
// result[i].objectKey
// )
// }
// this.imgViewList = imgViewList
// // 打开的是当前第几张图片
// const salesUri =
// global.baseURL +
// viewUri +
// '?id=' +
// data.id +
// '&objectKey=' +
// data.objectKey
// const index = this.imgViewList.findIndex(item => item === salesUri)
// if (index === -1) {
// this.imgViewIndex = 0
// } else {
// this.imgViewIndex = index
// }
// })
},
// 删除
_deleteById(id) {
......
......@@ -47,6 +47,7 @@
<MeterSampleManage ref="meterSampleManageModal" @on-result-change="_page"></MeterSampleManage>
<MeterEntrustDetail ref="meterSampleEdit" @on-result-change="_page"></MeterEntrustDetail>
<Operation ref="operation"></Operation>
<FileManage ref="FileManage"></FileManage>
</div>
</template>
<script>
......@@ -278,7 +279,8 @@ export default {
_upload(id) {
// 上传文件
this.$refs.refModal._open(id, 'subcontractorId')
// this.$refs.refModal._open(id, 'subcontractorId')
this.$refs.FileManage._open(id, 'subcontractorId')
},
_getById: async function(id) {
const result = await meterSubcontractor.getById(id)
......
......@@ -48,6 +48,7 @@
<MeterSampleManage ref="meterSampleManageModal" @on-result-change="_page"></MeterSampleManage>
<MeterEntrustDetail ref="meterSampleEdit" @on-result-change="_page"></MeterEntrustDetail>
<Operation ref="operation"></Operation>
<FileManage ref="FileManage"></FileManage>
</div>
</template>
<script>
......@@ -289,7 +290,8 @@ export default {
_upload(id) {
// 上传文件
this.$refs.refModal._open(id, 'subcontractorId')
this.$refs.FileManage._open(id, 'subcontractorId')
// this.$refs.refModal._open(id, 'subcontractorId')
},
_getById: async function(id) {
const result = await meterSubcontractor.getById(id)
......
......@@ -48,6 +48,7 @@
<MeterSampleManage ref="meterSampleManageModal" @on-result-change="_page"></MeterSampleManage>
<MeterEntrustDetail ref="meterSampleEdit" @on-result-change="_page"></MeterEntrustDetail>
<Operation ref="operation"></Operation>
<FileManage ref="FileManage"></FileManage>
</div>
</template>
<script>
......@@ -284,7 +285,8 @@ export default {
_upload(id) {
// 上传文件
this.$refs.refModal._open(id, 'subcontractorId')
this.$refs.FileManage._open(id, 'subcontractorId')
// this.$refs.refModal._open(id, 'subcontractorId')
},
_getById: async function(id) {
const result = await meterSubcontractor.getById(id)
......
......@@ -44,6 +44,7 @@
</Row>
</div>
</div>
<FileManage ref="FileManage"></FileManage>
<Reason ref="reasonModal" @on-result-change="_reasonResult"></Reason>
<MeterSampleManage ref="meterSampleManageModal" @on-result-change="_page"></MeterSampleManage>
<MeterEntrustDetail ref="meterSampleEdit" @on-result-change="_page"></MeterEntrustDetail>
......@@ -292,7 +293,8 @@ export default {
_upload(id) {
// 上传文件
this.$refs.refModal._open(id, 'subcontractorId')
this.$refs.FileManage._open(id, 'subcontractorId')
// this.$refs.refModal._open(id, 'subcontractorId')
},
_getById: async function(id) {
const result = await meterSubcontractor.getById(id)
......
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