Commit b9679521 by lichengming

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

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