上报库管理-导出历史对接接口

This commit is contained in:
zyx.net
2022-07-04 17:43:54 +08:00
parent 26c370b3cd
commit 0f5b9f6989
4 changed files with 75 additions and 58 deletions
+26 -39
View File
@@ -43,9 +43,10 @@
:scroll='{x: 600}'
:rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}'
@change='handleTableChange'>
<span slot='click' slot-scope='text, record'>
<a class='action-edit' @click='editArea(record)' v-has="'area:edit'">{{ text }}</a>
</span>
<template slot="file" slot-scope="text, record">
<a class="action-edit" href="javascript:;" @click="dowloadfile(record)" v-has="'bqnrzdpzxlbj'">{{record.exportFileName}}</a>
</template>
</a-table>
<div class="page" style='display: flex;justify-content: flex-end;'>
<a-pagination
@@ -59,15 +60,15 @@
@showSizeChange="SizeChange"
/>
</div>
<div class='drawer-bootom-button'>
<a-button style='margin-right: .8rem' @click='handleCancel'>{{ $t('cancel') }}</a-button>
<a-button @click='handleSubmit' type='primary' :loading='confirmLoading'>{{ $t('submit') }}</a-button>
</div>
<!-- <div class='drawer-bootom-button'>-->
<!-- <a-button style='margin-right: .8rem' @click='handleCancel'>{{ $t('cancel') }}</a-button>-->
<!-- <a-button @click='handleSubmit' type='primary' :loading='confirmLoading'>{{ $t('submit') }}</a-button>-->
<!-- </div>-->
</div>
</template>
<script>
import { putAction, postAction, getAction, deleteAction } from '@/api/manage'
import { putAction, postAction, getAction, deleteAction ,downloadFile } from '@/api/manage'
import axios from 'axios'
import Vue from 'vue'
import { ACCESS_TOKEN } from '@/store/mutation-types'
@@ -100,19 +101,20 @@ export default {
{
title: this.$t('Exporttype'),
align: 'center',
dataIndex: 'paramsTemplateName',
dataIndex: 'exportType',
ellipsis: true
},
{
title: this.$t('Exporttime'),
align: 'center',
dataIndex: 'paramsTemplateName',
dataIndex: 'exportTime',
ellipsis: true
},
{
title: this.$t('file'),
align: 'center',
dataIndex: 'paramsTemplateName',
dataIndex: 'exportFileName',
scopedSlots: { customRender: 'file' },
ellipsis: true
}
],
@@ -154,6 +156,11 @@ export default {
default: '',
require: true
},
paramsManifestId: {
type: String,
default: '',
require: true
},
url: {
type: Object,
default: '',
@@ -194,43 +201,23 @@ export default {
this.pageSize = pageSize
this.loadData()
},
dowloadfile(item){
downloadFile('/sys/common/downLoadFile', item.exportFileName, {id:item.exportFileId})
},
loadData() {
let _this = this
let params = {
pageNo: this.pageNo,
pageSize: this.pageSize,
paramsManifestId:this.paramsManifestId,
...this.formData
}
this.loading = true
axios({
url: `/jero-boot/params/manifest/getAllManifest`,
method: 'post',
data: params,
transformRequest: [function (data) {
let ret = ''
for (let it in data) {
ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
}
return ret
}],
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-Access-Token':_this.token
getAction('params/report/exportHistoryPage', params).then((res) => {
if (res.success) {
this.areaTable = res.result.records
this.total = res.result.total
}
})
.then( (res) =>{
if (res.data.success) {
console.log(res.data)
this.loading = false
this.areaTable = res.data.result.records || []
this.total = res.data.result.total
}else{
this.loading = false
}
})
.catch( (error) =>{
console.log(error);
});
},
searchQuery() {
this.loadData()