Authored by lzhy

增加导出功能

@@ -177,6 +177,11 @@ export default { @@ -177,6 +177,11 @@ export default {
177 align: 'center', 177 align: 'center',
178 }, 178 },
179 { 179 {
  180 + title: '交易服务费',
  181 + key: 'serviceAmount',
  182 + align: 'center',
  183 + },
  184 + {
180 title: '商家实收', 185 title: '商家实收',
181 key: 'shopNetAmount', 186 key: 'shopNetAmount',
182 align: 'center', 187 align: 'center',
@@ -293,7 +298,6 @@ export default { @@ -293,7 +298,6 @@ export default {
293 }, 298 },
294 //导出列表 299 //导出列表
295 exportList() { 300 exportList() {
296 - this.enableFilter = true;  
297 const queryString = { ...this.filterValues(), excelConf: 'shopBill' }; 301 const queryString = { ...this.filterValues(), excelConf: 'shopBill' };
298 const params = qs.stringify(queryString, true); 302 const params = qs.stringify(queryString, true);
299 const href = `${baseExportApi}${params}`; 303 const href = `${baseExportApi}${params}`;
@@ -81,6 +81,7 @@ @@ -81,6 +81,7 @@
81 <div class="select-container"> 81 <div class="select-container">
82 <Button type="primary" @click="search">查询</Button> 82 <Button type="primary" @click="search">查询</Button>
83 <Button type="primary" @click="reset">全部</Button> 83 <Button type="primary" @click="reset">全部</Button>
  84 + <Button type="warning" @click="exportList">导出</Button>
84 </div> 85 </div>
85 </filter-item> 86 </filter-item>
86 </layout-filter> 87 </layout-filter>
@@ -103,6 +104,8 @@ import _ from 'lodash'; @@ -103,6 +104,8 @@ import _ from 'lodash';
103 import moment from 'moment'; 104 import moment from 'moment';
104 import { FreightApply } from './store'; 105 import { FreightApply } from './store';
105 import FinanceService from 'services/finance/finance-service'; 106 import FinanceService from 'services/finance/finance-service';
  107 +import baseExportApi from 'util/excel';
  108 +import qs from 'querystringify';
106 109
107 export default { 110 export default {
108 data() { 111 data() {
@@ -129,33 +132,33 @@ export default { @@ -129,33 +132,33 @@ export default {
129 subClearingType: 'subClearingType', 132 subClearingType: 'subClearingType',
130 status: 'status', 133 status: 'status',
131 }; 134 };
132 -  
133 - if (this.enableFilter) {  
134 - _.each(keysMap, (val, key) => {  
135 - values[key] = fields[val].model;  
136 - });  
137 - } 135 + _.each(keysMap, (val, key) => {
  136 + values[key] = fields[val].model;
  137 + });
138 return values; 138 return values;
139 }, 139 },
140 search() { 140 search() {
141 let params = {}; 141 let params = {};
142 - this.enableFilter = true; 142 + this.filters.timeFlag.model = '';
143 params = this.filterValues(); 143 params = this.filterValues();
144 this.list(params); 144 this.list(params);
145 this.pageData.current = 1; 145 this.pageData.current = 1;
146 }, 146 },
147 reset() { 147 reset() {
148 let params = {}; 148 let params = {};
149 - this.enableFilter = false; 149 + _.each(this.filters, value => {
  150 + if (value.hasOwnProperty('model')) {
  151 + value.model = '';
  152 + }
  153 + });
150 params = this.filterValues(); 154 params = this.filterValues();
151 this.list(params); 155 this.list(params);
152 this.pageData.current = 1; 156 this.pageData.current = 1;
153 }, 157 },
154 timeFlag(flag) { 158 timeFlag(flag) {
155 let params = {}; 159 let params = {};
156 - this.enableFilter = false; 160 + this.filters.timeFlag.model = flag;
157 params = this.filterValues(); 161 params = this.filterValues();
158 - params.timeFlag = flag;  
159 this.list(params); 162 this.list(params);
160 this.pageData.current = 1; 163 this.pageData.current = 1;
161 }, 164 },
@@ -192,6 +195,12 @@ export default { @@ -192,6 +195,12 @@ export default {
192 }, 195 },
193 }); 196 });
194 }, 197 },
  198 + exportList() {
  199 + const queryString = { ...this.filterValues(), excelConf: 'shopFreightList' };
  200 + const params = qs.stringify(queryString, true);
  201 + const href = `${baseExportApi}${params}`;
  202 + window.open(href, '_blank');
  203 + },
195 }, 204 },
196 }; 205 };
197 </script> 206 </script>
@@ -84,7 +84,7 @@ @@ -84,7 +84,7 @@
84 <div class="select-container"> 84 <div class="select-container">
85 <Button type="primary" @click="search">查询</Button> 85 <Button type="primary" @click="search">查询</Button>
86 <Button type="primary" @click="reset">全部</Button> 86 <Button type="primary" @click="reset">全部</Button>
87 - <!-- <Button>导出</Button>--> 87 + <Button type="warning" @click="exportList">导出</Button>
88 </div> 88 </div>
89 </filter-item> 89 </filter-item>
90 </layout-filter> 90 </layout-filter>
@@ -107,7 +107,8 @@ import _ from 'lodash'; @@ -107,7 +107,8 @@ import _ from 'lodash';
107 import moment from 'moment'; 107 import moment from 'moment';
108 import { ServiceList } from './store'; 108 import { ServiceList } from './store';
109 import FinanceService from 'services/finance/finance-service'; 109 import FinanceService from 'services/finance/finance-service';
110 - 110 +import baseExportApi from 'util/excel';
  111 +import qs from 'querystringify';
111 export default { 112 export default {
112 data() { 113 data() {
113 return ServiceList.call(this); 114 return ServiceList.call(this);
@@ -133,35 +134,34 @@ export default { @@ -133,35 +134,34 @@ export default {
133 targetAccount: 'targetAccount', 134 targetAccount: 'targetAccount',
134 clearingType: 'clearingType', 135 clearingType: 'clearingType',
135 subClearingType: 'subClearingType', 136 subClearingType: 'subClearingType',
136 - // statementSn: 'statementSn',  
137 }; 137 };
138 -  
139 - if (this.enableFilter) {  
140 - _.each(keysMap, (val, key) => {  
141 - values[key] = fields[val].model;  
142 - });  
143 - } 138 + _.each(keysMap, (val, key) => {
  139 + values[key] = fields[val].model;
  140 + });
144 return values; 141 return values;
145 }, 142 },
146 search() { 143 search() {
147 let params = {}; 144 let params = {};
148 - this.enableFilter = true; 145 + this.filters.timeFlag.model = '';
149 params = this.filterValues(); 146 params = this.filterValues();
150 this.list(params); 147 this.list(params);
151 this.pageData.current = 1; 148 this.pageData.current = 1;
152 }, 149 },
153 reset() { 150 reset() {
154 let params = {}; 151 let params = {};
155 - this.enableFilter = false; 152 + _.each(this.filters, value => {
  153 + if (value.hasOwnProperty('model')) {
  154 + value.model = '';
  155 + }
  156 + });
156 params = this.filterValues(); 157 params = this.filterValues();
157 this.list(params); 158 this.list(params);
158 this.pageData.current = 1; 159 this.pageData.current = 1;
159 }, 160 },
160 timeFlag(flag) { 161 timeFlag(flag) {
161 let params = {}; 162 let params = {};
162 - this.enableFilter = false; 163 + this.filters.timeFlag.model = flag;
163 params = this.filterValues(); 164 params = this.filterValues();
164 - params.timeFlag = flag;  
165 this.list(params); 165 this.list(params);
166 this.pageData.current = 1; 166 this.pageData.current = 1;
167 }, 167 },
@@ -190,6 +190,12 @@ export default { @@ -190,6 +190,12 @@ export default {
190 this.pageData.current = _.get(ret, 'data.pageNo', 1); 190 this.pageData.current = _.get(ret, 'data.pageNo', 1);
191 }); 191 });
192 }, 192 },
  193 + exportList() {
  194 + const queryString = { ...this.filterValues(), excelConf: 'shopServiceList' };
  195 + const params = qs.stringify(queryString, true);
  196 + const href = `${baseExportApi}${params}`;
  197 + window.open(href, '_blank');
  198 + },
193 }, 199 },
194 }; 200 };
195 </script> 201 </script>
@@ -128,6 +128,10 @@ export default function() { @@ -128,6 +128,10 @@ export default function() {
128 key: 'realIncome', 128 key: 'realIncome',
129 }, 129 },
130 { 130 {
  131 + title: '提现服务费',
  132 + key: 'withdrawServiceAmount',
  133 + },
  134 + {
131 title: '提现状态', 135 title: '提现状态',
132 key: 'status', 136 key: 'status',
133 align: 'center', 137 align: 'center',
@@ -129,11 +129,6 @@ export default function() { @@ -129,11 +129,6 @@ export default function() {
129 key: 'productName', 129 key: 'productName',
130 align: 'center', 130 align: 'center',
131 }, 131 },
132 - // {  
133 - // title: '业务单据号',  
134 - // key: 'statementSn',  
135 - // align: 'center',  
136 - // },  
137 { 132 {
138 title: '账务类型', 133 title: '账务类型',
139 key: 'clearingType', 134 key: 'clearingType',
@@ -145,6 +140,16 @@ export default function() { @@ -145,6 +140,16 @@ export default function() {
145 align: 'center', 140 align: 'center',
146 }, 141 },
147 { 142 {
  143 + title: '交易服务费',
  144 + key: 'tradeServiceAmount',
  145 + align: 'center',
  146 + },
  147 + {
  148 + title: '提现服务费',
  149 + key: 'withdrawServiceAmount',
  150 + align: 'center',
  151 + },
  152 + {
148 title: '服务费金额(元)', 153 title: '服务费金额(元)',
149 key: 'serviceAmount', 154 key: 'serviceAmount',
150 align: 'center', 155 align: 'center',
@@ -32,7 +32,7 @@ @@ -32,7 +32,7 @@
32 <td :rowspan="item.goodsList.length">{{ item.consigneeName }}</td> 32 <td :rowspan="item.goodsList.length">{{ item.consigneeName }}</td>
33 <td :rowspan="item.goodsList.length">{{ paymentStatusArr[item.paymentStatus] }}</td> 33 <td :rowspan="item.goodsList.length">{{ paymentStatusArr[item.paymentStatus] }}</td>
34 <td :rowspan="item.goodsList.length">{{ item.lastOrderAmount }}</td> 34 <td :rowspan="item.goodsList.length">{{ item.lastOrderAmount }}</td>
35 - <td :rowspan="item.goodsList.length">{{ orderStatusArr[item.orderStatus] }}</td> 35 + <td :rowspan="item.goodsList.length">{{ item.orderStatusStr }}</td>
36 <td :rowspan="item.goodsList.length"> 36 <td :rowspan="item.goodsList.length">
37 <i-button type="default" size="small" @click="goToDetail(item.orderCode)">查看订单</i-button> 37 <i-button type="default" size="small" @click="goToDetail(item.orderCode)">查看订单</i-button>
38 <template v-if="item.orderStatus == 100 || item.orderStatus == 200"> 38 <template v-if="item.orderStatus == 100 || item.orderStatus == 200">
1 const exportExcelConfs = { 1 const exportExcelConfs = {
  2 + //交易账务明细报表导出配置
2 shopBill: { 3 shopBill: {
3 apiUrl: '/erp/queryShopBillList', 4 apiUrl: '/erp/queryShopBillList',
4 conf: { 5 conf: {
@@ -52,6 +53,10 @@ const exportExcelConfs = { @@ -52,6 +53,10 @@ const exportExcelConfs = {
52 type: 'number', 53 type: 'number',
53 }, 54 },
54 { 55 {
  56 + caption: '交易服务费',
  57 + type: 'number',
  58 + },
  59 + {
55 caption: '商家实收', 60 caption: '商家实收',
56 type: 'number', 61 type: 'number',
57 }, 62 },
@@ -81,6 +86,7 @@ const exportExcelConfs = { @@ -81,6 +86,7 @@ const exportExcelConfs = {
81 'clearingDiscount', 86 'clearingDiscount',
82 'shopDeserveAmount', 87 'shopDeserveAmount',
83 'withdrawServiceAmount', 88 'withdrawServiceAmount',
  89 + 'serviceAmount',
84 'shopNetAmount', 90 'shopNetAmount',
85 'statusName', 91 'statusName',
86 'withdrawalTime', 92 'withdrawalTime',
@@ -88,5 +94,135 @@ const exportExcelConfs = { @@ -88,5 +94,135 @@ const exportExcelConfs = {
88 ], 94 ],
89 }, 95 },
90 }, 96 },
  97 + //服务费账单报表导出配置
  98 + shopServiceList: {
  99 + apiUrl: '/erp/shopWithdrawServiceList',
  100 + conf: {
  101 + cols: [
  102 + {
  103 + caption: '账务ID',
  104 + type: 'number',
  105 + },
  106 + {
  107 + caption: '提现时间',
  108 + type: 'string',
  109 + },
  110 + {
  111 + caption: '商家收款账户',
  112 + type: 'string',
  113 + },
  114 + {
  115 + caption: '订单号',
  116 + type: 'string',
  117 + },
  118 + {
  119 + caption: 'SKU',
  120 + type: 'number',
  121 + },
  122 + {
  123 + caption: '商品名称',
  124 + type: 'string',
  125 + },
  126 + {
  127 + caption: '账务类型',
  128 + type: 'string',
  129 + },
  130 + {
  131 + caption: '子服务类型',
  132 + type: 'string',
  133 + },
  134 + {
  135 + caption: '交易服务费',
  136 + type: 'number',
  137 + },
  138 + {
  139 + caption: '提现服务费',
  140 + type: 'number',
  141 + },
  142 + {
  143 + caption: '服务费金额',
  144 + type: 'number',
  145 + },
  146 + {
  147 + caption: '提现状态',
  148 + type: 'string',
  149 + },
  150 + {
  151 + caption: '提现成功日期',
  152 + type: 'string',
  153 + },
  154 + ],
  155 + rows: [
  156 + 'id',
  157 + 'withdrawTime',
  158 + 'targetAccount',
  159 + 'orderCode',
  160 + 'productSku',
  161 + 'productName',
  162 + 'clearingType',
  163 + 'clearingTypeName',
  164 + 'tradeServiceAmount',
  165 + 'withdrawServiceAmount',
  166 + 'serviceAmount',
  167 + 'statusName',
  168 + 'createTime',
  169 + ],
  170 + },
  171 + },
  172 + //运费账务明细报表导出配置
  173 + shopFreightList: {
  174 + apiUrl: '/erp/shopWithdrawFreightList',
  175 + conf: {
  176 + cols: [
  177 + {
  178 + caption: '账务ID',
  179 + type: 'number',
  180 + },
  181 + {
  182 + caption: '结算时间',
  183 + type: 'string',
  184 + },
  185 + {
  186 + caption: '订单号',
  187 + type: 'string',
  188 + },
  189 + {
  190 + caption: '商品名称',
  191 + type: 'string',
  192 + },
  193 + {
  194 + caption: '账务类型',
  195 + type: 'string',
  196 + },
  197 + {
  198 + caption: '商家实收',
  199 + type: 'number',
  200 + },
  201 + {
  202 + caption: '提现服务费',
  203 + type: 'number',
  204 + },
  205 + {
  206 + caption: '提现状态',
  207 + type: 'string',
  208 + },
  209 + {
  210 + caption: '提现成功日期',
  211 + type: 'string',
  212 + },
  213 + ],
  214 + rows: [
  215 + 'id',
  216 + 'clearingTime',
  217 + 'orderCode',
  218 + 'productName',
  219 + 'clearingType',
  220 + 'realIncome',
  221 + 'withdrawServiceAmount',
  222 + 'statusName',
  223 + 'withdrawTime',
  224 + ],
  225 + },
  226 + },
91 }; 227 };
92 module.exports = exportExcelConfs; 228 module.exports = exportExcelConfs;