Browse Source

文件导出功能

master
453530270@qq.com 3 years ago
parent
commit
8d068ec6b4
  1. 14
      src/api/index.js
  2. 191
      src/components/page/order/closed.vue
  3. 23
      src/components/page/order/completed.vue
  4. 24
      src/components/page/order/index.vue
  5. 19
      src/components/page/order/pendingPayment.vue
  6. 19
      src/components/page/order/toBeDelivered.vue
  7. 19
      src/components/page/order/toBeSettled.vue

14
src/api/index.js

@ -128,6 +128,20 @@ export const rankingSort = query => {
data: query data: query
}); });
}; };
// 导出订单xls
export const xlsdc =query => {
return request({
url: '/admin/order.Order/export',
method: 'post',
data: query,
//
responseType:'blob',
//请求头
headers:{
"Content-Type":"application/json;charset=UTF-8;"
}
});
};
//订单详情 //订单详情
export const orderInfo = query => { export const orderInfo = query => {
return request({ return request({

191
src/components/page/order/closed.vue

@ -8,22 +8,22 @@
</div> </div>
<div class="body"> <div class="body">
<div class="query"> <div class="query">
<a-row type="flex" justify="space-between" > <a-row type="flex" justify="space-between">
<a-col :lg="12" :xl="8" :xxl="6" class="query_item"> <a-col :lg="12" :xl="8" :xxl="6" class="query_item">
<span>订单编号</span> <span>订单编号</span>
<a-input v-model="query.batchcode"/> <a-input v-model="query.batchcode" />
</a-col> </a-col>
<a-col :lg="12" :xl="8" :xxl="6" class="query_item query_item3"> <a-col :lg="12" :xl="8" :xxl="6" class="query_item query_item3">
<span>委托方/授权方</span> <span>委托方/授权方</span>
<a-input v-model="query.entrust_name" placeholder="名称/交易主体唯一标志码"/> <a-input v-model="query.entrust_name" placeholder="名称/交易主体唯一标志码" />
</a-col> </a-col>
<a-col :lg="12" :xl="8" :xxl="6" class="query_item query_item3"> <a-col :lg="12" :xl="8" :xxl="6" class="query_item query_item3">
<span>购买方/被授权方</span> <span>购买方/被授权方</span>
<a-input v-model="query.buy_name" placeholder="名称/交易主体唯一标志码"/> <a-input v-model="query.buy_name" placeholder="名称/交易主体唯一标志码" />
</a-col> </a-col>
<a-col :lg="12" :xl="8" :xxl="6" class="query_item"> <a-col :lg="12" :xl="8" :xxl="6" class="query_item">
<span>交易标的</span> <span>交易标的</span>
<a-input v-model="query.goods_name" placeholder="名称/标的ISLI标志码"/> <a-input v-model="query.goods_name" placeholder="名称/标的ISLI标志码" />
</a-col> </a-col>
<!-- <a-col :span="5" class="query_item" > <!-- <a-col :span="5" class="query_item" >
@ -53,28 +53,29 @@
</a-col> </a-col>
<a-col :lg="12" :xl="8" :xxl="12" class="query_item query_item2"> <a-col :lg="12" :xl="8" :xxl="12" class="query_item query_item2">
<span>创建时间</span> <span>创建时间</span>
<a-range-picker v-model="query.createtime" valueFormat="YYYY-MM-DD"/> <a-range-picker v-model="query.createtime" valueFormat="YYYY-MM-DD" />
</a-col> </a-col>
<a-col :lg="12" :xl="8" :xxl="12" class="query_item query_item3"> <a-col :lg="12" :xl="8" :xxl="12" class="query_item query_item3">
<span>标的金额</span> <span>标的金额</span>
<a-input v-model="query.biaodi_start" placeholder="最小值"/> <a-input v-model="query.biaodi_start" placeholder="最小值" />
<el-col :span="10" v-html="'\u00a0'"/> <el-col :span="10" v-html="'\u00a0'" />
<el-col style="color:#d9d9d9;">-</el-col> <el-col style="color:#d9d9d9;">-</el-col>
<el-col :span="10" v-html="'\u00a0'"/> <el-col :span="10" v-html="'\u00a0'" />
<a-input v-model="query.biaodi_end" placeholder="最大值"/> <a-input v-model="query.biaodi_end" placeholder="最大值" />
</a-col> </a-col>
<a-col :lg="12" :xl="8" :xxl="12" class="query_item query_item3"> <a-col :lg="12" :xl="8" :xxl="12" class="query_item query_item3">
<span>订单金额</span> <span>订单金额</span>
<a-input v-model="query.dingdan_start" placeholder="最小值"/> <a-input v-model="query.dingdan_start" placeholder="最小值" />
<el-col :span="10" v-html="'\u00a0'"/> <el-col :span="10" v-html="'\u00a0'" />
<el-col style="color:#d9d9d9;">-</el-col> <el-col style="color:#d9d9d9;">-</el-col>
<el-col :span="10" v-html="'\u00a0'"/> <el-col :span="10" v-html="'\u00a0'" />
<a-input v-model="query.dingdan_end" placeholder="最大值"/> <a-input v-model="query.dingdan_end" placeholder="最大值" />
</a-col> </a-col>
<a-col :lg="12" :xl="16" :xxl="24" class="query_item query_item1"> <a-col :lg="12" :xl="16" :xxl="24" class="query_item query_item1">
<a-space :size="21"> <a-space :size="21">
<a-button type="primary" class="query_button" @click="getList(1)"> </a-button> <a-button type="primary" class="query_button" @click="getList(1)"> </a-button>
<a-button class="query_button" @click="resetQurey"> </a-button> <a-button class="query_button" @click="resetQurey"> </a-button>
<a-button type="default" class="query_button" @click="xlsdc"> </a-button>
</a-space> </a-space>
</a-col> </a-col>
</a-row> </a-row>
@ -82,12 +83,11 @@
<div class="table"> <div class="table">
<div class="table_title"> <div class="table_title">
<span>查询结果</span> <span>查询结果</span>
<a-button type="primary" class="query_button"> </a-button>
<!-- <a-button type="primary" class="query_button"> </a-button> --> <!-- <a-button type="primary" class="query_button"> </a-button> -->
</div> </div>
<a-table :columns="columns" :data-source="data" bordered :pagination="false"> <a-table :columns="columns" :data-source="data" bordered :pagination="false">
<template slot="type" slot-scope="type"> <template slot="type" slot-scope="type">
<span>{{type==1?'委托订单':type==2?'认证订单':'服务订单'}}</span> <span>{{ type == 1 ? '委托订单' : type == 2 ? '认证订单' : '服务订单' }}</span>
</template> </template>
<template slot="operation" slot-scope="item"> <template slot="operation" slot-scope="item">
<a-space :size="24"> <a-space :size="24">
@ -96,19 +96,11 @@
</a-space> </a-space>
</template> </template>
</a-table> </a-table>
<a-pagination <a-pagination class="pagination" size="small" :total="total" v-model="page" :page-size="limit"
class="pagination" :show-total="total => `第 ${startTotal} - ${endTotal} 条 / 总共 ${total} 条`" :page-size-options="pageSizeOptions"
size="small" @showSizeChange="onShowSizeChange" @change="changePage" show-size-changer>
:total="total"
v-model="page"
:page-size="limit"
:show-total="total => `第 ${startTotal} - ${endTotal} 条 / 总共 ${total} 条`"
:page-size-options="pageSizeOptions"
@showSizeChange="onShowSizeChange"
@change="changePage"
show-size-changer >
<template slot="buildOptionText" slot-scope="props"> <template slot="buildOptionText" slot-scope="props">
<span >{{ props.value }}/</span> <span>{{ props.value }}/</span>
</template> </template>
</a-pagination> </a-pagination>
</div> </div>
@ -119,38 +111,38 @@
</template> </template>
<script> <script>
import Operation from '../../Operation.vue' import Operation from '../../Operation.vue'
import {getOrderList} from '../../../api/index' import { getOrderList,xlsdc } from '../../../api/index'
export default { export default {
data() { data() {
return{ return {
query:{ query: {
batchcode:'', batchcode: '',
entrust_name:'', entrust_name: '',
buy_name:'', buy_name: '',
goods_name:'', goods_name: '',
order_type:'', order_type: '',
entrust_type:'', entrust_type: '',
transaction_status:'5', transaction_status: '5',
createtime:[], createtime: [],
goods_isli:'', goods_isli: '',
charges_type:'', charges_type: '',
biaodi_start:'', biaodi_start: '',
biaodi_end:'', biaodi_end: '',
dingdan_start:'', dingdan_start: '',
dingdan_end:'', dingdan_end: '',
}, },
visible:false, visible: false,
visible2:false, visible2: false,
pageSizeOptions: ['10', '20', '30', '40', '50'], pageSizeOptions: ['10', '20', '30', '40', '50'],
total:0, total: 0,
// //
startTotal:1, startTotal: 1,
endTotal:10, endTotal: 10,
limit:10, limit: 10,
// //
page:1, page: 1,
data:[], data: [],
columns:[ columns: [
// { // {
// title: '', // title: '',
// dataIndex: 'id', // dataIndex: 'id',
@ -160,7 +152,7 @@ export default {
{ {
title: '订单创建时间', title: '订单创建时间',
dataIndex: 'createtime', dataIndex: 'createtime',
width:'120px', width: '120px',
// align:'center' // align:'center'
}, },
{ {
@ -171,7 +163,7 @@ export default {
{ {
title: '委托方/授权方', title: '委托方/授权方',
dataIndex: 'entrust_name', dataIndex: 'entrust_name',
width:'125px', width: '125px',
// align:'center' // align:'center'
}, },
{ {
@ -182,7 +174,7 @@ export default {
{ {
title: '购买方/被授权方', title: '购买方/被授权方',
dataIndex: 'buy_username', dataIndex: 'buy_username',
width:'135px', width: '135px',
// width:'130px', // width:'130px',
// align:'center' // align:'center'
}, },
@ -196,90 +188,103 @@ export default {
{ {
title: '交易方式', title: '交易方式',
dataIndex: 'entrust_type', dataIndex: 'entrust_type',
width:'90px', width: '90px',
// align:'center' // align:'center'
}, },
{ {
title: '标的金额', title: '标的金额',
dataIndex: 'goods_price', dataIndex: 'goods_price',
width:'90px', width: '90px',
// align:'center' // align:'center'
}, },
{ {
title: '交易佣金', title: '交易佣金',
dataIndex: 'total_service_charge', dataIndex: 'total_service_charge',
width:'90px', width: '90px',
// align:'center' // align:'center'
}, },
{ {
title: '订单金额', title: '订单金额',
dataIndex: 'total_money', dataIndex: 'total_money',
width:'90px', width: '90px',
// align:'center' // align:'center'
}, },
{ {
title: '操作', title: '操作',
width:'170px', width: '170px',
scopedSlots: { customRender: 'operation' }, scopedSlots: { customRender: 'operation' },
align:'center' align: 'center'
}, },
] ]
} }
}, },
components:{ components: {
Operation, Operation,
orderDataSelect: () => import('../../dateSelect/order.vue'), orderDataSelect: () => import('../../dateSelect/order.vue'),
orderDetails: () => import('../../orderDetails/index.vue'), orderDetails: () => import('../../orderDetails/index.vue'),
}, },
created(){ created() {
this.getList() this.getList()
}, },
methods:{ methods: {
// query // query
resetQurey(){ resetQurey() {
Object.assign(this.query, this.$options.data().query) Object.assign(this.query, this.$options.data().query)
this.getList() this.getList()
}, },
getList(type){ xlsdc() {
let data=this.query xlsdc(this.query).then(res => {
data.limit=this.limit const fname = '关闭订单'+new Date().getTime() + ".xlsx"
if(type==1){ let bloburl = window.URL.createObjectURL(new Blob([res]))
this.page=1 const a = document.createElement('a')
a.download = fname
a.href = bloburl
// add click
a.click()
window.URL.revokeObjectURL(bloburl)
})
.catch(err => {
console.error(err)
});
},
getList(type) {
let data = this.query
data.limit = this.limit
if (type == 1) {
this.page = 1
} }
data.page=this.page data.page = this.page
getOrderList(data).then(res=>{ getOrderList(data).then(res => {
if(res.code==200){ if (res.code == 200) {
this.data=res.data.data this.data = res.data.data
this.startTotal=res.data.start this.startTotal = res.data.start
this.endTotal=res.data.end this.endTotal = res.data.end
this.total=res.data.total this.total = res.data.total
}else{ } else {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
}) })
}, },
SelectOrder(val){ SelectOrder(val) {
this.batchcode=val this.batchcode = val
this.visible2=true this.visible2 = true
}, },
SelectDate(val){ SelectDate(val) {
this.visible=true this.visible = true
this.batchcode=val this.batchcode = val
}, },
// //
onShowSizeChange(current, pageSize){ onShowSizeChange(current, pageSize) {
this.page=1 this.page = 1
this.limit = pageSize; this.limit = pageSize;
this.getList() this.getList()
}, },
// //
changePage(page){ changePage(page) {
this.page=page this.page = page
this.getList() this.getList()
}, },
} }
} }
</script> </script>
<style scoped> <style scoped></style>
</style>

23
src/components/page/order/completed.vue

@ -75,6 +75,7 @@
<a-space :size="21"> <a-space :size="21">
<a-button type="primary" class="query_button" @click="getList(1)"> </a-button> <a-button type="primary" class="query_button" @click="getList(1)"> </a-button>
<a-button class="query_button" @click="resetQurey"> </a-button> <a-button class="query_button" @click="resetQurey"> </a-button>
<a-button type="default" class="query_button" @click="xlsdc"> </a-button>
</a-space> </a-space>
</a-col> </a-col>
</a-row> </a-row>
@ -82,7 +83,6 @@
<div class="table"> <div class="table">
<div class="table_title"> <div class="table_title">
<span>查询结果</span> <span>查询结果</span>
<a-button type="primary" class="query_button"> </a-button>
<!-- <a-button type="primary" class="query_button"> </a-button> --> <!-- <a-button type="primary" class="query_button"> </a-button> -->
</div> </div>
<a-table :columns="columns" :data-source="data" bordered :pagination="false"> <a-table :columns="columns" :data-source="data" bordered :pagination="false">
@ -119,7 +119,7 @@
</template> </template>
<script> <script>
import Operation from '../../Operation.vue' import Operation from '../../Operation.vue'
import {getOrderList} from '../../../api/index' import {getOrderList,xlsdc} from '../../../api/index'
export default { export default {
data() { data() {
return{ return{
@ -238,6 +238,25 @@ export default {
resetQurey(){ resetQurey(){
Object.assign(this.query, this.$options.data().query) Object.assign(this.query, this.$options.data().query)
this.getList() this.getList()
},
// xls
xlsdc(){
xlsdc(this.query).then(res=>{
// console.log(res)
const fname = new Date().getTime()+".xlsx"
// let bloburl = window.URL.createObjectURL(res)
let bloburl = window.URL.createObjectURL(new Blob([res]))
const a = document.createElement('a')
a.download = fname
a.href = bloburl
// add click
a.click()
window.URL.revokeObjectURL(bloburl)
console.log(a)
})
.catch(err=>{
console.error(err)
});
}, },
getList(type){ getList(type){
let data=this.query let data=this.query

24
src/components/page/order/index.vue

@ -90,6 +90,7 @@
<a-space :size="21"> <a-space :size="21">
<a-button type="primary" class="query_button" @click="getList(1)"> </a-button> <a-button type="primary" class="query_button" @click="getList(1)"> </a-button>
<a-button class="query_button" @click="resetQurey"> </a-button> <a-button class="query_button" @click="resetQurey"> </a-button>
<a-button type="default" class="query_button" @click="xlsdc"> </a-button>
</a-space> </a-space>
</a-col> </a-col>
</a-row> </a-row>
@ -97,7 +98,7 @@
<div class="table"> <div class="table">
<div class="table_title"> <div class="table_title">
<span>查询结果</span> <span>查询结果</span>
<a-button type="primary" class="query_button"> </a-button>
<!-- <a-button type="primary" class="query_button"> </a-button> --> <!-- <a-button type="primary" class="query_button"> </a-button> -->
</div> </div>
<a-table :columns="columns" :data-source="data" bordered :pagination="false" rowKey="id"> <a-table :columns="columns" :data-source="data" bordered :pagination="false" rowKey="id">
@ -129,7 +130,7 @@
</template> </template>
<script> <script>
import Operation from '../../Operation.vue' import Operation from '../../Operation.vue'
import { getOrderList } from '../../../api/index' import { getOrderList,xlsdc } from '../../../api/index'
export default { export default {
data() { data() {
return { return {
@ -259,6 +260,25 @@ export default {
Object.assign(this.query, this.$options.data().query) Object.assign(this.query, this.$options.data().query)
this.getList() this.getList()
}, },
// xls
xlsdc(){
xlsdc(this.query).then(res=>{
// console.log(res)
const fname = new Date().getTime()+".xlsx"
// let bloburl = window.URL.createObjectURL(res)
let bloburl = window.URL.createObjectURL(new Blob([res]))
const a = document.createElement('a')
a.download = fname
a.href = bloburl
// add click
a.click()
window.URL.revokeObjectURL(bloburl)
console.log(a)
})
.catch(err=>{
console.error(err)
});
},
getList(type) { getList(type) {
let data = this.query let data = this.query
data.limit = this.limit data.limit = this.limit

19
src/components/page/order/pendingPayment.vue

@ -75,6 +75,7 @@
<a-space :size="21"> <a-space :size="21">
<a-button type="primary" class="query_button" @click="getList(1)"> </a-button> <a-button type="primary" class="query_button" @click="getList(1)"> </a-button>
<a-button class="query_button" @click="resetQurey"> </a-button> <a-button class="query_button" @click="resetQurey"> </a-button>
<a-button type="default" class="query_button" @click="xlsdc"> </a-button>
</a-space> </a-space>
</a-col> </a-col>
</a-row> </a-row>
@ -82,7 +83,7 @@
<div class="table"> <div class="table">
<div class="table_title"> <div class="table_title">
<span>查询结果</span> <span>查询结果</span>
<a-button type="primary" class="query_button"> </a-button> <!-- <a-button type="primary" class="query_button"> </a-button> -->
</div> </div>
<a-table :columns="columns" :data-source="data" bordered :pagination="false"> <a-table :columns="columns" :data-source="data" bordered :pagination="false">
<template slot="type" slot-scope="type"> <template slot="type" slot-scope="type">
@ -237,6 +238,22 @@ export default {
resetQurey(){ resetQurey(){
Object.assign(this.query, this.$options.data().query) Object.assign(this.query, this.$options.data().query)
this.getList() this.getList()
},
// xls
xlsdc(){
xlsdc(this.query).then(res=>{
const fname = new Date().getTime()+".xlsx"
let bloburl = window.URL.createObjectURL(new Blob([res]))
const a = document.createElement('a')
a.download = fname
a.href = bloburl
// add click
a.click()
window.URL.revokeObjectURL(bloburl)
})
.catch(err=>{
console.error(err)
});
}, },
getList(type){ getList(type){
let data=this.query let data=this.query

19
src/components/page/order/toBeDelivered.vue

@ -75,6 +75,7 @@
<a-space :size="21"> <a-space :size="21">
<a-button type="primary" class="query_button" @click="getList(1)"> </a-button> <a-button type="primary" class="query_button" @click="getList(1)"> </a-button>
<a-button class="query_button" @click="resetQurey"> </a-button> <a-button class="query_button" @click="resetQurey"> </a-button>
<a-button type="default" class="query_button" @click="xlsdc"> </a-button>
</a-space> </a-space>
</a-col> </a-col>
</a-row> </a-row>
@ -82,7 +83,7 @@
<div class="table"> <div class="table">
<div class="table_title"> <div class="table_title">
<span>查询结果</span> <span>查询结果</span>
<a-button type="primary" class="query_button"> </a-button> <!-- <a-button type="primary" class="query_button"> </a-button> -->
</div> </div>
<a-table :columns="columns" :data-source="data" bordered :pagination="false"> <a-table :columns="columns" :data-source="data" bordered :pagination="false">
<template slot="type" slot-scope="type"> <template slot="type" slot-scope="type">
@ -236,6 +237,22 @@ export default {
resetQurey(){ resetQurey(){
Object.assign(this.query, this.$options.data().query) Object.assign(this.query, this.$options.data().query)
this.getList() this.getList()
},
// xls
xlsdc(){
xlsdc(this.query).then(res=>{
const fname = new Date().getTime()+".xlsx"
let bloburl = window.URL.createObjectURL(new Blob([res]))
const a = document.createElement('a')
a.download = fname
a.href = bloburl
// add click
a.click()
window.URL.revokeObjectURL(bloburl)
})
.catch(err=>{
console.error(err)
});
}, },
getList(type){ getList(type){
let data=this.query let data=this.query

19
src/components/page/order/toBeSettled.vue

@ -75,6 +75,7 @@
<a-space :size="21"> <a-space :size="21">
<a-button type="primary" class="query_button" @click="getList(1)"> </a-button> <a-button type="primary" class="query_button" @click="getList(1)"> </a-button>
<a-button class="query_button" @click="resetQurey"> </a-button> <a-button class="query_button" @click="resetQurey"> </a-button>
<a-button type="default" class="query_button" @click="xlsdc"> </a-button>
</a-space> </a-space>
</a-col> </a-col>
</a-row> </a-row>
@ -82,7 +83,7 @@
<div class="table"> <div class="table">
<div class="table_title"> <div class="table_title">
<span>查询结果</span> <span>查询结果</span>
<a-button type="primary" class="query_button">导出</a-button> <!-- <a-button type="primary" class="query_button">导出</a-button> -->
</div> </div>
<a-table :columns="columns" :data-source="data" bordered :pagination="false"> <a-table :columns="columns" :data-source="data" bordered :pagination="false">
<template slot="type" slot-scope="type"> <template slot="type" slot-scope="type">
@ -237,6 +238,22 @@ export default {
Object.assign(this.query, this.$options.data().query) Object.assign(this.query, this.$options.data().query)
this.getList() this.getList()
}, },
// xls
xlsdc(){
xlsdc(this.query).then(res=>{
const fname = new Date().getTime()+".xlsx"
let bloburl = window.URL.createObjectURL(new Blob([res]))
const a = document.createElement('a')
a.download = fname
a.href = bloburl
// add click
a.click()
window.URL.revokeObjectURL(bloburl)
})
.catch(err=>{
console.error(err)
});
},
getList(type){ getList(type){
let data=this.query let data=this.query
data.limit=this.limit data.limit=this.limit

Loading…
Cancel
Save