Commit e8679775 by wangzhihui

商品导出

1 parent b5daf7ed
...@@ -312,6 +312,24 @@ const exportUseRecordList = params => { ...@@ -312,6 +312,24 @@ const exportUseRecordList = params => {
data: params data: params
}) })
} }
/**导出订单 */
const exportOrderList = params => {
params.method = 'scrm.api.shopmall.platform.order.export'
return http({
url,
data: params,
sign: true
})
}
/**导出售后订单 */
const exportSaleOrderList=params => {
params.method = 'scrm.api.shopmall.platform.after.sales.order.export'
return http({
url,
data: params,
sign: true
})
}
export default { export default {
getCategoryListApi, getCategoryListApi,
getGoodsListApi, getGoodsListApi,
......
<!-- 秒杀活动 --> <!-- 秒杀活动 -->
<template> <template>
<div class="ctnr"> <div class="ctnr">
<GLCombiForm class="search-wrap" rowNumber="1" ref="orderRef" @handleOk="handleSearch" @handleRest="handleReset" :formObj="orderFormObj" :formData="orderFormData"> <GLCombiForm class="search-wrap" rowNumber="1" ref="orderRef" @handleOk="handleSearch" @handleRest="handleReset" :formObj="orderFormObj" :formData="orderFormData"></GLCombiForm>
</GLCombiForm>
<div class="main-wrap"> <div class="main-wrap">
<div class="flex">
<div class="global-title-wrap"> <div class="global-title-wrap">
<span v-for="item in titleList" :key="item.id" :class="['title', {'curTitleCla': orderFormObj.requestType==item.id}]" @click="changeTable(item.id)">{{ item.name }}</span> <span v-for="item in titleList" :key="item.id" :class="['title', { curTitleCla: orderFormObj.requestType == item.id }]" @click="changeTable(item.id)">{{ item.name }}</span>
</div> </div>
<div class="batch-wrap">
<el-button size="small" @click="handleExport">导出</el-button>
</div>
</div>
<div class="table-wrap"> <div class="table-wrap">
<GLTable @setTableFinishFun="setTableFinishFun" ref="tableRef" :pageConf="pageConf" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn"> <GLTable @setTableFinishFun="setTableFinishFun" ref="tableRef" :pageConf="pageConf" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn">
<div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope"> <div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope">
<img :src="scope.scope.goodsImageUrl" alt=""> <img :src="scope.scope.goodsImageUrl" alt="" />
<el-tooltip class="item" effect="dark" :content="(scope.scope.brandName || '') + (scope.scope.goodsSkuName || '')" placement="top"> <el-tooltip class="item" effect="dark" :content="(scope.scope.brandName || '') + (scope.scope.goodsSkuName || '')" placement="top">
<span class="name">{{ scope.scope.brandName }}{{ scope.scope.goodsSkuName }}</span> <span class="name">{{ scope.scope.brandName }}{{ scope.scope.goodsSkuName }}</span>
</el-tooltip> </el-tooltip>
...@@ -41,7 +46,7 @@ ...@@ -41,7 +46,7 @@
import { utils } from 'glsx-common' import { utils } from 'glsx-common'
import util from '@/util/util' import util from '@/util/util'
import SelectDialog from '../pointProducts/components/SelectDialog' import SelectDialog from '../pointProducts/components/SelectDialog'
import { exportFn } from '@/common/constant'
const titleList = [ const titleList = [
{ {
id: 0, id: 0,
...@@ -70,7 +75,7 @@ const titleList = [ ...@@ -70,7 +75,7 @@ const titleList = [
{ {
id: 5, id: 5,
name: '已关闭' name: '已关闭'
}, }
] ]
export default { export default {
name: 'goodsOrderIndex', name: 'goodsOrderIndex',
...@@ -154,20 +159,23 @@ export default { ...@@ -154,20 +159,23 @@ export default {
{ {
id: '', id: '',
value: '全部' value: '全部'
}, { },
{
id: '0', id: '0',
value: '普通订单' value: '普通订单'
}, },
{ {
id: '1', id: '1',
value: 'B端积分订单' value: 'B端积分订单'
}, { },
{
id: '2', id: '2',
value: 'C端积分订单' value: 'C端积分订单'
}], }
],
optionId: 'id', optionId: 'id',
optionLabel: 'value' optionLabel: 'value'
}, }
], ],
getListApi: this.$apis.platformGoods.getOrderList, getListApi: this.$apis.platformGoods.getOrderList,
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' }, pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
...@@ -189,7 +197,7 @@ export default { ...@@ -189,7 +197,7 @@ export default {
prop: 'salePrice', prop: 'salePrice',
align: 'right', align: 'right',
formatter: cell => { formatter: cell => {
return cell.goodsSource ? cell.redeemPoints + '积分' : (cell.businessType == 1 || cell.businessType == 2 ? cell.redeemPoints + '积分' + '+' + cell.salePrice + '元' : cell.salePrice + '元') return cell.goodsSource ? cell.redeemPoints + '积分' : cell.businessType == 1 || cell.businessType == 2 ? cell.redeemPoints + '积分' + '+' + cell.salePrice + '元' : cell.salePrice + '元'
} }
}, },
{ {
...@@ -204,7 +212,7 @@ export default { ...@@ -204,7 +212,7 @@ export default {
formatter: cell => { formatter: cell => {
let price = 0 let price = 0
if (cell.payStatus == 1002) { if (cell.payStatus == 1002) {
price = cell.goodsSource ? (cell.redeemPoints * cell.sellQty).toFixed(0) + '积分' : (cell.businessType == 1 || cell.businessType == 2 ? (cell.redeemPoints * cell.sellQty) + '积分' + '+' + +(cell.salePrice * cell.sellQty).toFixed(2) + '元' : +(cell.salePrice * cell.sellQty).toFixed(2) + '元') price = cell.goodsSource ? (cell.redeemPoints * cell.sellQty).toFixed(0) + '积分' : cell.businessType == 1 || cell.businessType == 2 ? cell.redeemPoints * cell.sellQty + '积分' + '+' + +(cell.salePrice * cell.sellQty).toFixed(2) + '元' : +(cell.salePrice * cell.sellQty).toFixed(2) + '元'
} }
return price return price
// return cell.businessType == 1 || cell.businessType == 2 ? (cell.redeemPoints * cell.sellQty) + '积分' + '+' + +(cell.salePrice * cell.sellQty).toFixed(2) + '元' : +(cell.salePrice * cell.sellQty).toFixed(2) + '元' // return cell.businessType == 1 || cell.businessType == 2 ? (cell.redeemPoints * cell.sellQty) + '积分' + '+' + +(cell.salePrice * cell.sellQty).toFixed(2) + '元' : +(cell.salePrice * cell.sellQty).toFixed(2) + '元'
...@@ -289,6 +297,12 @@ export default { ...@@ -289,6 +297,12 @@ export default {
methods: { methods: {
transfStatus: util.transfStatus, transfStatus: util.transfStatus,
handleExport() {
const params = this.getParams()
this.$apis.platformGoods.exportOrderList(params).then(res => {
exportFn(res)
})
},
setTableFinishFun() { setTableFinishFun() {
//接收到的数据为空 //接收到的数据为空
this.$refs.tableRef.data.length ? (this.$refs.tableRef.tableHeightValues = '') : this.$refs.tableRef.setTableHeightFun() this.$refs.tableRef.data.length ? (this.$refs.tableRef.tableHeightValues = '') : this.$refs.tableRef.setTableHeightFun()
...@@ -382,7 +396,12 @@ export default { ...@@ -382,7 +396,12 @@ export default {
.main-wrap { .main-wrap {
background-color: #fff; background-color: #fff;
margin-top: 16px; margin-top: 16px;
.flex {
display: flex;
align-items: center;
justify-content: space-between;
margin-right: 20px;
}
.table-wrap { .table-wrap {
padding: 20px; padding: 20px;
......
...@@ -4,9 +4,14 @@ ...@@ -4,9 +4,14 @@
<GLCombiForm class="search-wrap" rowNumber="2" ref="orderRef" @handleOk="handleSearch" @handleRest="handleReset" :formObj="orderFormObj" :formData="orderFormData"> <GLCombiForm class="search-wrap" rowNumber="2" ref="orderRef" @handleOk="handleSearch" @handleRest="handleReset" :formObj="orderFormObj" :formData="orderFormData">
</GLCombiForm> </GLCombiForm>
<div class="main-wrap"> <div class="main-wrap">
<div class="flex">
<div class="global-title-wrap"> <div class="global-title-wrap">
<span v-for="item in titleList" :key="item.id" :class="['title', {'curTitleCla': orderFormObj.requestType==item.id}]" @click="changeTable(item.id)">{{ item.name }}</span> <span v-for="item in titleList" :key="item.id" :class="['title', {'curTitleCla': orderFormObj.requestType==item.id}]" @click="changeTable(item.id)">{{ item.name }}</span>
</div> </div>
<div class="batch-wrap">
<el-button size="small" @click="handleExport">导出</el-button>
</div>
</div>
<div class="table-wrap"> <div class="table-wrap">
<GLTable @setTableFinishFun="setTableFinishFun" ref="tableRef" :pageConf="pageConf" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn"> <GLTable @setTableFinishFun="setTableFinishFun" ref="tableRef" :pageConf="pageConf" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn">
<div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope"> <div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope">
...@@ -47,7 +52,7 @@ ...@@ -47,7 +52,7 @@
import { utils } from 'glsx-common' import { utils } from 'glsx-common'
import util from '@/util/util' import util from '@/util/util'
import glsxCombiForm from '@/components/glsx-combi-form' import glsxCombiForm from '@/components/glsx-combi-form'
import { exportFn } from '@/common/constant'
const titleList = [ const titleList = [
{ {
id: 0, id: 0,
...@@ -377,6 +382,12 @@ export default { ...@@ -377,6 +382,12 @@ export default {
mounted() { }, mounted() { },
methods: { methods: {
handleExport() {
const params = this.getParams()
this.$apis.platformGoods.exportSaleOrderList(params).then(res => {
exportFn(res)
})
},
setTableFinishFun() { setTableFinishFun() {
//接收到的数据为空 //接收到的数据为空
this.$refs.tableRef.data.length ? (this.$refs.tableRef.tableHeightValues = '') : this.$refs.tableRef.setTableHeightFun() this.$refs.tableRef.data.length ? (this.$refs.tableRef.tableHeightValues = '') : this.$refs.tableRef.setTableHeightFun()
...@@ -517,7 +528,12 @@ export default { ...@@ -517,7 +528,12 @@ export default {
.main-wrap { .main-wrap {
background-color: #fff; background-color: #fff;
margin-top: 16px; margin-top: 16px;
.flex {
display: flex;
align-items: center;
justify-content: space-between;
margin-right: 20px;
}
.table-wrap { .table-wrap {
padding: 20px; padding: 20px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!