Authored by shuiling.wang@yoho.cn

财务管理库存

@@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
17 </filter-item> 17 </filter-item>
18 <filter-item :label="filters.createTime.label"> 18 <filter-item :label="filters.createTime.label">
19 <Date-picker v-model="filters.createTime.model" 19 <Date-picker v-model="filters.createTime.model"
20 - type="datetimerange" format="yyyy-MM-dd" placeholder="选择日期和时间"> 20 + type="datetimerange" format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期和时间">
21 </Date-picker> 21 </Date-picker>
22 </filter-item> 22 </filter-item>
23 <filter-item> 23 <filter-item>
@@ -26,6 +26,7 @@ @@ -26,6 +26,7 @@
26 </filter-item> 26 </filter-item>
27 </layout-filter> 27 </layout-filter>
28 <layout-list> 28 <layout-list>
  29 + <Button type="warning" @click="exportData" class="table-btn">导出</Button>
29 <Table border :columns="tableCols" :data="tableData"></Table> 30 <Table border :columns="tableCols" :data="tableData"></Table>
30 <Page :total="pageData.total" :current="pageData.pageNo" 31 <Page :total="pageData.total" :current="pageData.pageNo"
31 @on-change="pageChange" :page-size="20" show-total></Page> 32 @on-change="pageChange" :page-size="20" show-total></Page>
@@ -35,15 +36,17 @@ @@ -35,15 +36,17 @@
35 36
36 <script> 37 <script>
37 import list from './store/list'; 38 import list from './store/list';
  39 +import filter from './store/filter';
38 import FinanceService from 'services/finance/finance-service'; 40 import FinanceService from 'services/finance/finance-service';
39 import _ from 'lodash'; 41 import _ from 'lodash';
40 42
41 export default { 43 export default {
42 data() { 44 data() {
43 - return list.call(this); 45 + return _.assign(list.call(this), filter);
44 }, 46 },
45 created() { 47 created() {
46 this.FinanceService = new FinanceService(); 48 this.FinanceService = new FinanceService();
  49 + this.search();
47 }, 50 },
48 computed: { 51 computed: {
49 startTime() { 52 startTime() {
@@ -66,13 +69,11 @@ export default { @@ -66,13 +69,11 @@ export default {
66 } 69 }
67 }, 70 },
68 methods: { 71 methods: {
69 - search() {  
70 - // 在这里实现异步查询的方法,建议在service中做 72 + filterValues() {
71 let params = { 73 let params = {
72 type: 1, 74 type: 1,
73 - supplierId: 128,  
74 balanceId: +this.filters.balanceId.model, 75 balanceId: +this.filters.balanceId.model,
75 - brandId: this.filters.brandId.model, 76 + brandId: +this.filters.brandId.model,
76 status: this.filters.status.model, 77 status: this.filters.status.model,
77 beginTime: this.startTime, 78 beginTime: this.startTime,
78 endTime: this.endTime, 79 endTime: this.endTime,
@@ -80,12 +81,13 @@ export default { @@ -80,12 +81,13 @@ export default {
80 pageNo: this.pageData.pageNo 81 pageNo: this.pageData.pageNo
81 }; 82 };
82 83
83 - params = _.pickBy(params, val => val);  
84 -  
85 - this.FinanceService.balanceList(params).then(ret => { 84 + return _.pickBy(params, val => val);
  85 + },
  86 + search() {
  87 + this.FinanceService.balanceList(this.filterValues()).then(ret => {
86 this.tableData = _.get(ret, 'data.records', []); 88 this.tableData = _.get(ret, 'data.records', []);
87 - this.pageData.total = ret.data.pageNo;  
88 - this.pageData.pageNo = ret.data.pageNo; 89 + this.pageData.total = _.get(ret, 'data.totalCount', 0);
  90 + this.pageData.pageNo = _.get(ret, 'data.pageNo', 1);
89 }); 91 });
90 }, 92 },
91 reset() { 93 reset() {
@@ -95,6 +97,8 @@ export default { @@ -95,6 +97,8 @@ export default {
95 this.filters.createTime.model = null; 97 this.filters.createTime.model = null;
96 this.pageData.pageNo = 1; 98 this.pageData.pageNo = 1;
97 this.pageData.total = 0; 99 this.pageData.total = 0;
  100 +
  101 + this.search();
98 }, 102 },
99 pageChange(val) { 103 pageChange(val) {
100 this.pageData.pageNo = val; 104 this.pageData.pageNo = val;
@@ -102,24 +106,35 @@ export default { @@ -102,24 +106,35 @@ export default {
102 }, 106 },
103 onClickInfo(params) { 107 onClickInfo(params) {
104 this.$router.push({ 108 this.$router.push({
105 - name: 'finance.clearing.detail',  
106 - params: {},  
107 - query: {  
108 - balanceId: params.row.balanceId,  
109 - status: {未结算: 1, 已结算: 2}[params.row.statusDesc],  
110 - brandId: params.row.brandId  
111 - } 109 + name: 'finance.clearing.detail'
112 }); 110 });
113 }, 111 },
114 onClickStock(params) { 112 onClickStock(params) {
  113 + let opt = _.pickBy({
  114 + brandId: params.row.brandId,
  115 + begin: this.startTime,
  116 + end: this.endTime
  117 + }, val => val);
  118 +
115 this.$router.push({ 119 this.$router.push({
116 - name: 'finance.stock', 120 + name: 'finance.clearing.stock',
117 params: {}, 121 params: {},
118 - query: {  
119 - brandId: params.row.brandId,  
120 - shopId  
121 - } 122 + query: opt
122 }); 123 });
  124 + },
  125 + exportData() {
  126 + let params = {};
  127 + let temp = [];
  128 +
  129 + _.assign(params, this.filterValues());
  130 +
  131 + _.each(params, (val, key) => {
  132 + temp.push(`${key}=${val}`);
  133 + });
  134 +
  135 + const href = `/Api/erp/exportBalanceList?${temp.join('&')}`;
  136 +
  137 + window.open(href, '_blank');
123 } 138 }
124 } 139 }
125 }; 140 };
@@ -129,4 +144,8 @@ export default { @@ -129,4 +144,8 @@ export default {
129 .ivu-date-picker .ivu-select-dropdown { 144 .ivu-date-picker .ivu-select-dropdown {
130 left: -284px !important; 145 left: -284px !important;
131 } 146 }
  147 +
  148 +.table-btn {
  149 + margin-bottom: 20px;
  150 +}
132 </style> 151 </style>
@@ -24,12 +24,13 @@ @@ -24,12 +24,13 @@
24 </Select> 24 </Select>
25 </filter-item> 25 </filter-item>
26 <filter-item> 26 <filter-item>
  27 + <Button @click="returnPage">返回对账单列表</Button>
27 <Button type="primary" @click="search">筛选</Button> 28 <Button type="primary" @click="search">筛选</Button>
28 - <Button type="warning" @click="exportData">导出</Button>  
29 <Button @click="reset">清空条件</Button> 29 <Button @click="reset">清空条件</Button>
30 </filter-item> 30 </filter-item>
31 </layout-filter> 31 </layout-filter>
32 <layout-list> 32 <layout-list>
  33 + <Button type="warning" @click="exportData" class="table-btn">导出</Button>
33 <Table border :columns="tableCols" :data="tableData"></Table> 34 <Table border :columns="tableCols" :data="tableData"></Table>
34 <Page :total="pageData.total" :current="pageData.pageNo" 35 <Page :total="pageData.total" :current="pageData.pageNo"
35 @on-change="pageChange" :page-size="20" show-total></Page> 36 @on-change="pageChange" :page-size="20" show-total></Page>
@@ -39,11 +40,29 @@ @@ -39,11 +40,29 @@
39 40
40 <script> 41 <script>
41 import detail from './store/detail'; 42 import detail from './store/detail';
  43 +import filter from './store/filter';
42 import FinanceService from 'services/finance/finance-service'; 44 import FinanceService from 'services/finance/finance-service';
43 45
44 export default { 46 export default {
45 data() { 47 data() {
46 - return detail.call(this); 48 + filter.filters = _.assign({
  49 + orderCode: {
  50 + label: '订单号',
  51 + labelSpan: 6,
  52 + model: '',
  53 + holder: '',
  54 + fieldSpan: 18
  55 + },
  56 + sku: {
  57 + label: 'SKU',
  58 + labelSpan: 6,
  59 + model: '',
  60 + holder: '',
  61 + fieldSpan: 18
  62 + }
  63 + }, filter.filters);
  64 +
  65 + return _.assign(detail.call(this), filter);
47 }, 66 },
48 created() { 67 created() {
49 this.FinanceService = new FinanceService(); 68 this.FinanceService = new FinanceService();
@@ -54,12 +73,10 @@ export default { @@ -54,12 +73,10 @@ export default {
54 computed: { 73 computed: {
55 }, 74 },
56 methods: { 75 methods: {
57 - search() {  
58 - // 在这里实现异步查询的方法,建议在service中做 76 + filterValues() {
59 let params = { 77 let params = {
60 - supplierId: 128,  
61 balanceId: +this.filters.balanceId.model, 78 balanceId: +this.filters.balanceId.model,
62 - brandId: this.filters.brandId.model, 79 + brandId: +this.filters.brandId.model,
63 orderCode: +this.filters.orderCode.model, 80 orderCode: +this.filters.orderCode.model,
64 status: this.filters.status.model, 81 status: this.filters.status.model,
65 productSku: +this.filters.sku.model, 82 productSku: +this.filters.sku.model,
@@ -67,12 +84,13 @@ export default { @@ -67,12 +84,13 @@ export default {
67 pageNo: this.pageData.pageNo 84 pageNo: this.pageData.pageNo
68 }; 85 };
69 86
70 - params = _.pickBy(params, val => val);  
71 -  
72 - this.FinanceService.balanceDetail(params).then(ret => { 87 + return _.pickBy(params, val => val);
  88 + },
  89 + search() {
  90 + this.FinanceService.balanceDetail(this.filterValues()).then(ret => {
73 this.tableData = _.get(ret, 'data.records', []); 91 this.tableData = _.get(ret, 'data.records', []);
74 - this.pageData.total = ret.data.totalCount;  
75 - this.pageData.pageNo = ret.data.pageNo; 92 + this.pageData.total = _.get(ret, 'data.totalCount', 0);
  93 + this.pageData.pageNo = _.get(ret, 'data.pageNo', 1);
76 }); 94 });
77 }, 95 },
78 reset() { 96 reset() {
@@ -83,16 +101,31 @@ export default { @@ -83,16 +101,31 @@ export default {
83 this.filters.sku.model = null; 101 this.filters.sku.model = null;
84 this.pageData.pageNo = 1; 102 this.pageData.pageNo = 1;
85 this.pageData.total = 0; 103 this.pageData.total = 0;
  104 + this.search();
86 }, 105 },
87 pageChange(val) { 106 pageChange(val) {
88 this.pageData.pageNo = val; 107 this.pageData.pageNo = val;
89 this.search(); 108 this.search();
90 }, 109 },
91 exportData() { 110 exportData() {
92 - console.log('导出'); 111 + let params = {};
  112 + let temp = [];
  113 +
  114 + _.assign(params, this.filterValues());
  115 +
  116 + _.each(params, (val, key) => {
  117 + temp.push(`${key}=${val}`);
  118 + });
  119 +
  120 + const href = `/Api/erp/exportBalanceDetail?${temp.join('&')}`;
  121 +
  122 + window.open(href, '_blank');
93 }, 123 },
94 - onClickInfo() {},  
95 - onClickStock() {} 124 + returnPage() {
  125 + this.$router.push({
  126 + name: 'finance.clearing'
  127 + });
  128 + }
96 } 129 }
97 }; 130 };
98 </script> 131 </script>
@@ -101,4 +134,8 @@ export default { @@ -101,4 +134,8 @@ export default {
101 .ivu-date-picker .ivu-select-dropdown { 134 .ivu-date-picker .ivu-select-dropdown {
102 left: -284px !important; 135 left: -284px !important;
103 } 136 }
  137 +
  138 +.table-btn {
  139 + margin-bottom: 20px;
  140 +}
104 </style> 141 </style>
@@ -12,4 +12,11 @@ export default [{ @@ -12,4 +12,11 @@ export default [{
12 meta: { 12 meta: {
13 pageName: '对账单明细' 13 pageName: '对账单明细'
14 } 14 }
  15 +}, {
  16 + path: '/stock.html',
  17 + name: 'stock',
  18 + component: () => import(/* webpackChunkName: "trade.printDetail" */'./stock'),
  19 + meta: {
  20 + pageName: '对账单库存'
  21 + }
15 }]; 22 }];
  1 +<template>
  2 + <layout-body>
  3 + <layout-filter>
  4 + <filter-item :label="filters.brandId.label">
  5 + <select-brand v-model="filters.brandId.model"></select-brand>
  6 + </filter-item>
  7 + <filter-item :label="filters.createTime.label">
  8 + <Date-picker v-model="filters.createTime.model"
  9 + type="datetimerange" format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期和时间">
  10 + </Date-picker>
  11 + </filter-item>
  12 + <filter-item>
  13 + <Button @click="returnPage">返回对账单列表</Button>
  14 + <Button type="primary" @click="search">筛选</Button>
  15 + <Button @click="reset">清空条件</Button>
  16 + </filter-item>
  17 + </layout-filter>
  18 + <layout-list>
  19 + <Button type="success" @click="print" class="table-btn">打印</Button>
  20 + <Table border :columns="tableCols" :data="tableData"></Table>
  21 + <Page :total="pageData.total" :current="pageData.pageNo"
  22 + @on-change="pageChange" :page-size="20" show-total></Page>
  23 + </layout-list>
  24 + </layout-body>
  25 +</template>
  26 +
  27 +<script>
  28 +import stock from './store/stock';
  29 +import filter from './store/filter';
  30 +import FinanceService from 'services/finance/finance-service';
  31 +import _ from 'lodash';
  32 +
  33 +export default {
  34 + data() {
  35 + return _.assign(stock.call(this), filter);
  36 + },
  37 + created() {
  38 + this.FinanceService = new FinanceService();
  39 + this.search();
  40 + },
  41 + computed: {
  42 + startTime() {
  43 + let createTime = this.filters.createTime.model;
  44 +
  45 + if (_.isEmpty(createTime)) {
  46 + return 0;
  47 + } else {
  48 + return createTime[0] ? createTime[0].getTime() / 1000 : 0;
  49 + }
  50 + },
  51 + endTime() {
  52 + let createTime = this.filters.createTime.model;
  53 +
  54 + if (_.isEmpty(createTime)) {
  55 + return 0;
  56 + } else {
  57 + return createTime[1] ? createTime[1].getTime() / 1000 : 0;
  58 + }
  59 + }
  60 + },
  61 + methods: {
  62 + search() {
  63 + let params = {
  64 + brandId: +this.filters.brandId.model,
  65 + beginTime: this.startTime || this.curDay,
  66 + endTime: this.endTime || this.curDay,
  67 + pageSize: this.pageData.pageSize,
  68 + pageNo: this.pageData.pageNo
  69 + };
  70 +
  71 + params = _.pickBy(params, val => val);
  72 +
  73 + this.FinanceService.inventoryLedgerList(params).then(ret => {
  74 + this.tableData = _.get(ret, 'data.records', []);
  75 + this.pageData.total = _.get(ret, 'data.totalCount', 0);
  76 + this.pageData.pageNo = _.get(ret, 'data.pageNo', 1);
  77 + });
  78 + },
  79 + reset() {
  80 + this.filters.brandId.model = null;
  81 + this.filters.createTime.model = null;
  82 + this.pageData.pageNo = 1;
  83 + this.pageData.total = 0;
  84 + this.search();
  85 + },
  86 + pageChange(val) {
  87 + this.pageData.pageNo = val;
  88 + this.search();
  89 + },
  90 + print() {
  91 + const href = `/finance/print/clearing/stock.html?brandId=${this.filters.brandId.model}&begin=${this.startTime}&end=${this.endTime}&page=${this.pageData.pageNo}`;
  92 +
  93 + window.open(href, '_blank');
  94 + },
  95 + returnPage() {
  96 + this.$router.push({
  97 + name: 'finance.clearing'
  98 + });
  99 + }
  100 + }
  101 +};
  102 +</script>
  103 +
  104 +<style lang="scss">
  105 +.ivu-date-picker .ivu-select-dropdown {
  106 + left: -284px !important;
  107 +}
  108 +
  109 +.table-btn {
  110 + margin-bottom: 20px;
  111 +}
  112 +</style>
@@ -3,10 +3,6 @@ @@ -3,10 +3,6 @@
3 * @author: wsl <shuiling.wang@yoho.cn> 3 * @author: wsl <shuiling.wang@yoho.cn>
4 * @date: 2017/07/11 4 * @date: 2017/07/11
5 */ 5 */
6 -  
7 -import moment from 'moment';  
8 -  
9 -  
10 export default function() { 6 export default function() {
11 return { 7 return {
12 tableCols: [ 8 tableCols: [
@@ -91,53 +87,6 @@ export default function() { @@ -91,53 +87,6 @@ export default function() {
91 total: 0, 87 total: 0,
92 pageNo: 1, 88 pageNo: 1,
93 pageSize: 20 89 pageSize: 20
94 - },  
95 - filters: {  
96 - orderCode: {  
97 - label: '订单号',  
98 - labelSpan: 6,  
99 - model: '',  
100 - holder: '',  
101 - fieldSpan: 18  
102 - },  
103 - balanceId: {  
104 - label: '对账单号',  
105 - labelSpan: 6,  
106 - model: this.$route.query.balanceId,  
107 - holder: '',  
108 - fieldSpan: 18  
109 - },  
110 - sku: {  
111 - label: 'SKU',  
112 - labelSpan: 6,  
113 - model: '',  
114 - holder: '',  
115 - fieldSpan: 18  
116 - },  
117 - brandId: {  
118 - label: '品牌',  
119 - labelSpan: 6,  
120 - model: this.$route.query.brandId,  
121 - holder: '',  
122 - fieldSpan: 18  
123 - },  
124 - status: {  
125 - label: '状态',  
126 - labelSpan: 6,  
127 - model: +this.$route.query.status,  
128 - holder: '',  
129 - fieldSpan: 18,  
130 - options: [  
131 - {  
132 - value: 1,  
133 - label: '未结算'  
134 - },  
135 - {  
136 - value: 2,  
137 - label: '已结算'  
138 - }  
139 - ]  
140 - }  
141 } 90 }
142 }; 91 };
143 } 92 }
  1 +let date = new Date();
  2 +let agoMonthFirstDay = new Date(date.getFullYear(),date.getMonth()-1,1);
  3 +let agoMonthLastDay = new Date(date.getFullYear(),date.getMonth()-1,30);
  4 +
  5 +export default {
  6 + filters: {
  7 + balanceId: {
  8 + label: '对账单号',
  9 + labelSpan: 6,
  10 + model: '',
  11 + holder: '',
  12 + fieldSpan: 18
  13 + },
  14 + brandId: {
  15 + label: '品牌',
  16 + labelSpan: 6,
  17 + model: '',
  18 + holder: '',
  19 + fieldSpan: 18
  20 + },
  21 + createTime: {
  22 + label: '创建时间',
  23 + labelSpan: 6,
  24 + model: [agoMonthFirstDay, agoMonthLastDay],
  25 + holder: '',
  26 + fieldSpan: 18
  27 + },
  28 + status: {
  29 + label: '状态',
  30 + labelSpan: 6,
  31 + model: '',
  32 + holder: '',
  33 + fieldSpan: 18,
  34 + options: [
  35 + {
  36 + value: 1,
  37 + label: '未结算'
  38 + },
  39 + {
  40 + value: 2,
  41 + label: '已结算'
  42 + }
  43 + ]
  44 + }
  45 + }
  46 +}
@@ -81,46 +81,6 @@ export default function() { @@ -81,46 +81,6 @@ export default function() {
81 total: 0, 81 total: 0,
82 pageNo: 1, 82 pageNo: 1,
83 pageSize: 20 83 pageSize: 20
84 - },  
85 - filters: {  
86 - balanceId: {  
87 - label: '对账单号',  
88 - labelSpan: 6,  
89 - model: '',  
90 - holder: '',  
91 - fieldSpan: 18  
92 - },  
93 - brandId: {  
94 - label: '品牌',  
95 - labelSpan: 6,  
96 - model: 162,  
97 - holder: '',  
98 - fieldSpan: 18  
99 - },  
100 - createTime: {  
101 - label: '创建时间',  
102 - labelSpan: 6,  
103 - model: '',  
104 - holder: '',  
105 - fieldSpan: 18  
106 - },  
107 - status: {  
108 - label: '状态',  
109 - labelSpan: 6,  
110 - model: '',  
111 - holder: '',  
112 - fieldSpan: 18,  
113 - options: [  
114 - {  
115 - value: 1,  
116 - label: '未结算'  
117 - },  
118 - {  
119 - value: 2,  
120 - label: '已结算'  
121 - }  
122 - ]  
123 - }  
124 } 84 }
125 }; 85 };
126 } 86 }
  1 +/**
  2 + * on stock page store
  3 + * @author: wsl <shuiling.wang@yoho.cn>
  4 + * @date: 2017/07/13
  5 + */
  6 +import moment from 'moment';
  7 +
  8 +export default function() {
  9 + return {
  10 + tableCols: [
  11 + {
  12 + title: '商品编号',
  13 + key: 'productSkn',
  14 + align: 'center'
  15 + },
  16 + {
  17 + title: '产品名称',
  18 + key: 'productName',
  19 + align: 'center'
  20 + },
  21 + {
  22 + title: '厂家编号',
  23 + key: 'supplierSku',
  24 + align: 'center',
  25 + },
  26 + {
  27 + title: '请购类型',
  28 + key: 'sellTypeName',
  29 + align: 'center',
  30 + },
  31 + {
  32 + title: '初期数量',
  33 + key: 'supplier90Sell',
  34 + align: 'center'
  35 + },
  36 + {
  37 + title: '进货数量',
  38 + key: 'supplier11Sell',
  39 + align: 'center'
  40 + },
  41 + {
  42 + title: '销售数量',
  43 + key: 'supplier30Sell',
  44 + align: 'center'
  45 + },
  46 + {
  47 + title: '销退数量',
  48 + key: 'supplier33Sell',
  49 + align: 'center'
  50 + },
  51 + {
  52 + title: '退供应商数量',
  53 + key: 'supplier10Sell',
  54 + align: 'center'
  55 + },
  56 + {
  57 + title: '其他出库数量',
  58 + key: 'supplier60Sell',
  59 + align: 'center'
  60 + },
  61 + {
  62 + title: '地面店出库数量',
  63 + key: 'supplier70Sell',
  64 + align: 'center',
  65 + width: 150
  66 + },
  67 + {
  68 + title: '地面店入库数量',
  69 + key: 'supplier71Sell',
  70 + align: 'center',
  71 + width: 150
  72 + },
  73 + {
  74 + title: '期末库存数量',
  75 + key: 'supplier100Sell',
  76 + align: 'center'
  77 + },
  78 + {
  79 + title: '库房',
  80 + key: 'supplierName',
  81 + align: 'center'
  82 + }
  83 + ],
  84 + tableData: [],
  85 + pageData: {
  86 + total: 0,
  87 + pageNo: 1,
  88 + pageSize: 20
  89 + },
  90 + curDay: Math.round(new Date().getTime()/1000)
  91 + };
  92 +}
@@ -13,13 +13,15 @@ @@ -13,13 +13,15 @@
13 <select-brand v-model="filters.brandId.model"></select-brand> 13 <select-brand v-model="filters.brandId.model"></select-brand>
14 </filter-item> 14 </filter-item>
15 <filter-item> 15 <filter-item>
  16 + <Button @click="returnPage">返回结算单列表</Button>
16 <Button type="primary" @click="search">筛选</Button> 17 <Button type="primary" @click="search">筛选</Button>
17 - <Button type="warning" @click="exportData">导出</Button>  
18 - <Button type="success" @click="print">打印</Button>  
19 <Button @click="reset">清空条件</Button> 18 <Button @click="reset">清空条件</Button>
  19 +
20 </filter-item> 20 </filter-item>
21 </layout-filter> 21 </layout-filter>
22 <layout-list> 22 <layout-list>
  23 + <Button type="warning" @click="exportData" class="table-btn">导出</Button>
  24 + <Button type="success" @click="print" class="table-btn">打印</Button>
23 <Table border :columns="tableCols" :data="tableData"></Table> 25 <Table border :columns="tableCols" :data="tableData"></Table>
24 <Page :total="pageData.total" :current="pageData.pageNo" 26 <Page :total="pageData.total" :current="pageData.pageNo"
25 @on-change="pageChange" :page-size="20" show-total></Page> 27 @on-change="pageChange" :page-size="20" show-total></Page>
@@ -29,21 +31,31 @@ @@ -29,21 +31,31 @@
29 31
30 <script> 32 <script>
31 import detail from './store/detail'; 33 import detail from './store/detail';
  34 +import filter from './store/filter';
32 import FinanceService from 'services/finance/finance-service'; 35 import FinanceService from 'services/finance/finance-service';
  36 +import _ from 'lodash';
33 37
34 export default { 38 export default {
35 data() { 39 data() {
36 - return detail.call(this); 40 + filter.filters = _.assign({
  41 + sku: {
  42 + label: 'SKU',
  43 + labelSpan: 6,
  44 + model: this.$route.query.sku || '',
  45 + holder: '',
  46 + fieldSpan: 18
  47 + }
  48 + }, filter.filters);
  49 +
  50 + return _.assign(detail.call(this), filter);
37 }, 51 },
38 created() { 52 created() {
39 this.FinanceService = new FinanceService(); 53 this.FinanceService = new FinanceService();
40 this.search(); 54 this.search();
41 }, 55 },
42 methods: { 56 methods: {
43 - search() {  
44 - // 在这里实现异步查询的方法,建议在service中做 57 + filterValues() {
45 let params = { 58 let params = {
46 - supplierId: 128,  
47 balanceId: +this.filters.balanceId.model, 59 balanceId: +this.filters.balanceId.model,
48 brandId: +this.filters.brandId.model, 60 brandId: +this.filters.brandId.model,
49 productSku: +this.filters.sku.model, 61 productSku: +this.filters.sku.model,
@@ -51,12 +63,13 @@ export default { @@ -51,12 +63,13 @@ export default {
51 pageNo: this.pageData.pageNo 63 pageNo: this.pageData.pageNo
52 }; 64 };
53 65
54 - params = _.pickBy(params, val => val);  
55 -  
56 - this.FinanceService.settlementList(params).then(ret => { 66 + return _.pickBy(params, val => val);
  67 + },
  68 + search() {
  69 + this.FinanceService.settlementList(this.filterValues()).then(ret => {
57 this.tableData = _.get(ret, 'data.records', []); 70 this.tableData = _.get(ret, 'data.records', []);
58 - this.pageData.total = ret.data.pageNo;  
59 - this.pageData.pageNo = ret.data.pageNo; 71 + this.pageData.total = _.get(ret, 'data.totalCount', 0);
  72 + this.pageData.pageNo = _.get(ret, 'data.pageNo', 1);
60 }); 73 });
61 }, 74 },
62 reset() { 75 reset() {
@@ -67,18 +80,35 @@ export default { @@ -67,18 +80,35 @@ export default {
67 this.filters.sku.model = null; 80 this.filters.sku.model = null;
68 this.pageData.pageNo = 1; 81 this.pageData.pageNo = 1;
69 this.pageData.total = 0; 82 this.pageData.total = 0;
  83 + this.search();
70 }, 84 },
71 pageChange(val) { 85 pageChange(val) {
72 this.pageData.pageNo = val; 86 this.pageData.pageNo = val;
73 this.search(); 87 this.search();
74 }, 88 },
75 exportData() { 89 exportData() {
76 - console.log('导出'); 90 + let params = {};
  91 + let temp = [];
  92 +
  93 + _.assign(params, this.filterValues());
  94 +
  95 + _.each(params, (val, key) => {
  96 + temp.push(`${key}=${val}`);
  97 + });
  98 +
  99 + const href = `/Api/erp/exportSettlementDetail?${temp.join('&')}`;
  100 +
  101 + window.open(href, '_blank');
77 }, 102 },
78 print() { 103 print() {
79 - const href = `/finance/print/payment/printDetail.html?balanceId=${this.filters.balanceId.model}&brandId=${this.filters.brandId.model}&sku=${this.filters.sku.model}&page=${this.pageData.pageNo}`; 104 + const href = `/finance/print/payment/detail.html?balanceId=${this.filters.balanceId.model}&brandId=${this.filters.brandId.model}&sku=${this.filters.sku.model}&page=${this.pageData.pageNo}`;
80 105
81 window.open(href, '_blank'); 106 window.open(href, '_blank');
  107 + },
  108 + returnPage() {
  109 + this.$router.push({
  110 + name: 'finance.payment'
  111 + });
82 } 112 }
83 } 113 }
84 }; 114 };
@@ -88,4 +118,8 @@ export default { @@ -88,4 +118,8 @@ export default {
88 .ivu-date-picker .ivu-select-dropdown { 118 .ivu-date-picker .ivu-select-dropdown {
89 left: -284px !important; 119 left: -284px !important;
90 } 120 }
  121 +
  122 +.table-btn {
  123 + margin-bottom: 20px;
  124 +}
91 </style> 125 </style>
@@ -12,4 +12,11 @@ export default [{ @@ -12,4 +12,11 @@ export default [{
12 meta: { 12 meta: {
13 pageName: '结算单详情' 13 pageName: '结算单详情'
14 } 14 }
  15 +}, {
  16 + path: '/stock.html',
  17 + name: 'stock',
  18 + component: () => import(/* webpackChunkName: "trade.printDetail" */'./stock'),
  19 + meta: {
  20 + pageName: '库存'
  21 + }
15 }]; 22 }];
@@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
10 </filter-item> 10 </filter-item>
11 <filter-item :label="filters.createTime.label"> 11 <filter-item :label="filters.createTime.label">
12 <Date-picker v-model="filters.createTime.model" 12 <Date-picker v-model="filters.createTime.model"
13 - type="datetimerange" format="yyyy-MM-dd" placeholder="选择日期和时间"> 13 + type="datetimerange" format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期和时间">
14 </Date-picker> 14 </Date-picker>
15 </filter-item> 15 </filter-item>
16 <filter-item> 16 <filter-item>
@@ -19,6 +19,7 @@ @@ -19,6 +19,7 @@
19 </filter-item> 19 </filter-item>
20 </layout-filter> 20 </layout-filter>
21 <layout-list> 21 <layout-list>
  22 + <Button type="warning" @click="exportData" class="table-btn">导出</Button>
22 <Table border :columns="tableCols" :data="tableData"></Table> 23 <Table border :columns="tableCols" :data="tableData"></Table>
23 <Page :total="pageData.total" :current="pageData.pageNo" 24 <Page :total="pageData.total" :current="pageData.pageNo"
24 @on-change="pageChange" :page-size="20" show-total></Page> 25 @on-change="pageChange" :page-size="20" show-total></Page>
@@ -28,14 +29,17 @@ @@ -28,14 +29,17 @@
28 29
29 <script> 30 <script>
30 import list from './store/list'; 31 import list from './store/list';
  32 +import filter from './store/filter';
31 import FinanceService from 'services/finance/finance-service'; 33 import FinanceService from 'services/finance/finance-service';
  34 +import _ from 'lodash';
32 35
33 export default { 36 export default {
34 data() { 37 data() {
35 - return list.call(this); 38 + return _.assign(list.call(this), filter);
36 }, 39 },
37 created() { 40 created() {
38 this.FinanceService = new FinanceService(); 41 this.FinanceService = new FinanceService();
  42 + this.search();
39 }, 43 },
40 computed: { 44 computed: {
41 startTime() { 45 startTime() {
@@ -58,35 +62,33 @@ export default { @@ -58,35 +62,33 @@ export default {
58 } 62 }
59 }, 63 },
60 methods: { 64 methods: {
61 - search() {  
62 - // 在这里实现异步查询的方法,建议在service中做 65 + filterValues() {
63 let params = { 66 let params = {
64 type: 2, 67 type: 2,
65 - supplierId: 128,  
66 balanceId: +this.filters.balanceId.model, 68 balanceId: +this.filters.balanceId.model,
67 - brandId: this.filters.brandId.model || 162,  
68 - // status: this.filters.status.model, 69 + brandId: +this.filters.brandId.model,
69 beginTime: this.startTime, 70 beginTime: this.startTime,
70 endTime: this.endTime, 71 endTime: this.endTime,
71 pageSize: this.pageData.pageSize, 72 pageSize: this.pageData.pageSize,
72 pageNo: this.pageData.pageNo 73 pageNo: this.pageData.pageNo
73 }; 74 };
74 75
75 - params = _.pickBy(params, val => val);  
76 -  
77 - this.FinanceService.balanceList(params).then(ret => { 76 + return _.pickBy(params, val => val);
  77 + },
  78 + search() {
  79 + this.FinanceService.balanceList(this.filterValues()).then(ret => {
78 this.tableData = _.get(ret, 'data.records', []); 80 this.tableData = _.get(ret, 'data.records', []);
79 - this.pageData.total = ret.data.pageNo;  
80 - this.pageData.pageNo = ret.data.pageNo; 81 + this.pageData.total = _.get(ret, 'data.totalCount', 0);
  82 + this.pageData.pageNo = _.get(ret, 'data.pageNo', 1);
81 }); 83 });
82 }, 84 },
83 reset() { 85 reset() {
84 this.filters.balanceId.model = null; 86 this.filters.balanceId.model = null;
85 this.filters.brandId.model = null; 87 this.filters.brandId.model = null;
86 - this.filters.status.model = null;  
87 this.filters.createTime.model = null; 88 this.filters.createTime.model = null;
88 this.pageData.pageNo = 1; 89 this.pageData.pageNo = 1;
89 this.pageData.total = 0; 90 this.pageData.total = 0;
  91 + this.search();
90 }, 92 },
91 pageChange(val) { 93 pageChange(val) {
92 this.pageData.pageNo = val; 94 this.pageData.pageNo = val;
@@ -104,11 +106,25 @@ export default { @@ -104,11 +106,25 @@ export default {
104 }, 106 },
105 onClickStock(params) { 107 onClickStock(params) {
106 this.$router.push({ 108 this.$router.push({
107 - name: 'finance.stock', 109 + name: 'finance.payment.stock',
108 params: {}, 110 params: {},
109 query: { 111 query: {
110 } 112 }
111 }); 113 });
  114 + },
  115 + exportData() {
  116 + let params = {};
  117 + let temp = [];
  118 +
  119 + _.assign(params, this.filterValues());
  120 +
  121 + _.each(params, (val, key) => {
  122 + temp.push(`${key}=${val}`);
  123 + });
  124 +
  125 + const href = `/Api/erp/exportBalanceList?${temp.join('&')}`;
  126 +
  127 + window.open(href, '_blank');
112 } 128 }
113 } 129 }
114 }; 130 };
@@ -118,4 +134,8 @@ export default { @@ -118,4 +134,8 @@ export default {
118 .ivu-date-picker .ivu-select-dropdown { 134 .ivu-date-picker .ivu-select-dropdown {
119 left: -284px !important; 135 left: -284px !important;
120 } 136 }
  137 +
  138 +.table-btn {
  139 + margin-bottom: 20px;
  140 +}
121 </style> 141 </style>
  1 +<template>
  2 + <layout-body>
  3 + <layout-filter>
  4 + <filter-item :label="filters.brandId.label">
  5 + <select-brand v-model="filters.brandId.model"></select-brand>
  6 + </filter-item>
  7 + <filter-item :label="filters.createTime.label">
  8 + <Date-picker v-model="filters.createTime.model"
  9 + type="datetimerange" format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期和时间">
  10 + </Date-picker>
  11 + </filter-item>
  12 + <filter-item>
  13 + <Button @click="returnPage">返回结算单列表</Button>
  14 + <Button type="primary" @click="search">筛选</Button>
  15 + <Button @click="reset">清空条件</Button>
  16 + </filter-item>
  17 + </layout-filter>
  18 + <layout-list>
  19 + <Button type="success" @click="print" class="table-btn">打印</Button>
  20 + <Table border :columns="tableCols" :data="tableData"></Table>
  21 + <Page :total="pageData.total" :current="pageData.pageNo"
  22 + @on-change="pageChange" :page-size="20" show-total></Page>
  23 + </layout-list>
  24 + </layout-body>
  25 +</template>
  26 +
  27 +<script>
  28 +import stock from './store/stock';
  29 +import filter from './store/filter';
  30 +import FinanceService from 'services/finance/finance-service';
  31 +import _ from 'lodash';
  32 +
  33 +export default {
  34 + data() {
  35 + return _.assign(stock.call(this), filter);
  36 + },
  37 + created() {
  38 + this.FinanceService = new FinanceService();
  39 + this.search();
  40 + },
  41 + computed: {
  42 + startTime() {
  43 + let createTime = this.filters.createTime.model;
  44 +
  45 + if (_.isEmpty(createTime)) {
  46 + return 0;
  47 + } else {
  48 + return createTime[0] ? createTime[0].getTime() / 1000 : 0;
  49 + }
  50 + },
  51 + endTime() {
  52 + let createTime = this.filters.createTime.model;
  53 +
  54 + if (_.isEmpty(createTime)) {
  55 + return 0;
  56 + } else {
  57 + return createTime[1] ? createTime[1].getTime() / 1000 : 0;
  58 + }
  59 + }
  60 + },
  61 + methods: {
  62 + search() {
  63 +
  64 + let params = {
  65 + brandId: +this.filters.brandId.model,
  66 + beginTime: this.startTime,
  67 + endTime: this.endTime,
  68 + pageSize: this.pageData.pageSize,
  69 + pageNo: this.pageData.pageNo
  70 + };
  71 +
  72 + params = _.pickBy(params, val => val);
  73 +
  74 + this.FinanceService.inventoryLedgerList(params).then(ret => {
  75 + this.tableData = _.get(ret, 'data.records', []);
  76 + this.pageData.total = _.get(ret, 'data.totalCount', 0);
  77 + this.pageData.pageNo = _.get(ret, 'data.pageNo', 1);
  78 + });
  79 + },
  80 + reset() {
  81 + this.filters.brandId.model = null;
  82 + this.filters.createTime.model = null;
  83 + this.pageData.pageNo = 1;
  84 + this.pageData.total = 0;
  85 + this.search();
  86 + },
  87 + pageChange(val) {
  88 + this.pageData.pageNo = val;
  89 + this.search();
  90 + },
  91 + print() {
  92 + const href = `/finance/print/payment/stock.html?brandId=${this.filters.brandId.model}&begin=${this.startTime}&end=${this.endTime}&page=${this.pageData.pageNo}`;
  93 +
  94 + window.open(href, '_blank');
  95 + },
  96 + returnPage() {
  97 + this.$router.push({
  98 + name: 'finance.payment'
  99 + });
  100 + }
  101 + }
  102 +};
  103 +</script>
  104 +
  105 +<style lang="scss">
  106 +.ivu-date-picker .ivu-select-dropdown {
  107 + left: -284px !important;
  108 +}
  109 +
  110 +.table-btn {
  111 + margin-bottom: 20px;
  112 +}
  113 +</style>
@@ -3,9 +3,6 @@ @@ -3,9 +3,6 @@
3 * @author: wsl <shuiling.wang@yoho.cn> 3 * @author: wsl <shuiling.wang@yoho.cn>
4 * @date: 2017/07/11 4 * @date: 2017/07/11
5 */ 5 */
6 -  
7 -import moment from 'moment';  
8 -  
9 export default function() { 6 export default function() {
10 return { 7 return {
11 tableCols: [ 8 tableCols: [
@@ -70,29 +67,6 @@ export default function() { @@ -70,29 +67,6 @@ export default function() {
70 total: 0, 67 total: 0,
71 pageNo: 1, 68 pageNo: 1,
72 pageSize: 20 69 pageSize: 20
73 - },  
74 - filters: {  
75 - balanceId: {  
76 - label: '结算单号',  
77 - labelSpan: 6,  
78 - model: this.$route.query.balanceId,  
79 - holder: '',  
80 - fieldSpan: 18  
81 - },  
82 - sku: {  
83 - label: 'SKU',  
84 - labelSpan: 6,  
85 - model: this.$route.query.sku || '',  
86 - holder: '',  
87 - fieldSpan: 18  
88 - },  
89 - brandId: {  
90 - label: '品牌',  
91 - labelSpan: 6,  
92 - model: this.$route.query.brandId,  
93 - holder: '',  
94 - fieldSpan: 18  
95 - }  
96 } 70 }
97 }; 71 };
98 } 72 }
  1 +export default {
  2 + filters: {
  3 + balanceId: {
  4 + label: '结算单号',
  5 + labelSpan: 6,
  6 + model: '',
  7 + holder: '',
  8 + fieldSpan: 18
  9 + },
  10 + brandId: {
  11 + label: '品牌',
  12 + labelSpan: 6,
  13 + model: '',
  14 + holder: '1111',
  15 + fieldSpan: 18
  16 + },
  17 + createTime: {
  18 + label: '创建时间',
  19 + labelSpan: 6,
  20 + model: '',
  21 + holder: '',
  22 + fieldSpan: 18
  23 + }
  24 + }
  25 +}
@@ -76,29 +76,6 @@ export default function() { @@ -76,29 +76,6 @@ export default function() {
76 total: 0, 76 total: 0,
77 pageNo: 1, 77 pageNo: 1,
78 pageSize: 20 78 pageSize: 20
79 - },  
80 - filters: {  
81 - balanceId: {  
82 - label: '对账单号',  
83 - labelSpan: 6,  
84 - model: '',  
85 - holder: '',  
86 - fieldSpan: 18  
87 - },  
88 - brandId: {  
89 - label: '品牌',  
90 - labelSpan: 6,  
91 - model: '',  
92 - holder: '1111',  
93 - fieldSpan: 18  
94 - },  
95 - createTime: {  
96 - label: '创建时间',  
97 - labelSpan: 6,  
98 - model: '',  
99 - holder: '',  
100 - fieldSpan: 18  
101 - }  
102 } 79 }
103 }; 80 };
104 } 81 }
  1 +/**
  2 + * on stock page store
  3 + * @author: wsl <shuiling.wang@yoho.cn>
  4 + * @date: 2017/07/13
  5 + */
  6 +export default function() {
  7 + return {
  8 + tableCols: [
  9 + {
  10 + title: '商品编号',
  11 + key: 'productSkn',
  12 + align: 'center'
  13 + },
  14 + {
  15 + title: '产品名称',
  16 + key: 'productName',
  17 + align: 'center'
  18 + },
  19 + {
  20 + title: '厂家编号',
  21 + key: 'supplierSku',
  22 + align: 'center',
  23 + },
  24 + {
  25 + title: '请购类型',
  26 + key: 'sellTypeName',
  27 + align: 'center',
  28 + },
  29 + {
  30 + title: '初期数量',
  31 + key: 'supplier90Sell',
  32 + align: 'center'
  33 + },
  34 + {
  35 + title: '进货数量',
  36 + key: 'supplier11Sell',
  37 + align: 'center'
  38 + },
  39 + {
  40 + title: '销售数量',
  41 + key: 'supplier30Sell',
  42 + align: 'center'
  43 + },
  44 + {
  45 + title: '销退数量',
  46 + key: 'supplier33Sell',
  47 + align: 'center'
  48 + },
  49 + {
  50 + title: '退供应商数量',
  51 + key: 'supplier10Sell',
  52 + align: 'center'
  53 + },
  54 + {
  55 + title: '其他出库数量',
  56 + key: 'supplier60Sell',
  57 + align: 'center'
  58 + },
  59 + {
  60 + title: '地面店出库数量',
  61 + key: 'supplier70Sell',
  62 + align: 'center',
  63 + width: 150
  64 + },
  65 + {
  66 + title: '地面店入库数量',
  67 + key: 'supplier71Sell',
  68 + align: 'center',
  69 + width: 150
  70 + },
  71 + {
  72 + title: '期末库存数量',
  73 + key: 'supplier100Sell',
  74 + align: 'center'
  75 + },
  76 + {
  77 + title: '库房',
  78 + key: 'supplierName',
  79 + align: 'center'
  80 + }
  81 + ],
  82 + tableData: [],
  83 + pageData: {
  84 + total: 0,
  85 + pageNo: 1,
  86 + pageSize: 20
  87 + },
  88 + curDay: Math.round(new Date().getTime() / 1000)
  89 + };
  90 +}
1 <template> 1 <template>
2 <layout-print> 2 <layout-print>
3 - <h2>库存</h2> 3 + <h2>对账单库存</h2>
4 <Table border :columns="tableCols" :data="tableData"></Table> 4 <Table border :columns="tableCols" :data="tableData"></Table>
5 </layout-print> 5 </layout-print>
6 </template> 6 </template>
7 7
8 <script> 8 <script>
9 import _ from 'lodash'; 9 import _ from 'lodash';
10 - import stock from '../stock/store/stock'; 10 + import stock from '../clearing/store/stock';
11 import FinanceService from 'services/finance/finance-service'; 11 import FinanceService from 'services/finance/finance-service';
12 12
13 13
@@ -21,20 +21,19 @@ @@ -21,20 +21,19 @@
21 }, 21 },
22 methods: { 22 methods: {
23 search() { 23 search() {
24 - // let params = {  
25 - // supplierId: 128,  
26 - // balanceId: +this.filters.balanceId.model,  
27 - // brandId: +this.filters.brandId.model,  
28 - // productSku: +this.filters.sku.model,  
29 - // pageSize: 20,  
30 - // pageNo: this.$route.query.page  
31 - // }; 24 + let params = {
  25 + brandId: +this.$route.query.brandId,
  26 + beginTime: +this.$route.query.begin,
  27 + endTime: +this.$route.query.end,
  28 + pageSize: 20,
  29 + pageNo: this.$route.query.page
  30 + };
32 31
33 - // params = _.pickBy(params, val => val); 32 + params = _.pickBy(params, val => val);
34 33
35 - // this.FinanceService.settlementList(params).then(ret => {  
36 - // this.tableData = _.get(ret, 'data.records', []);  
37 - // }); 34 + this.FinanceService.inventoryLedgerList(params).then(ret => {
  35 + this.tableData = _.get(ret, 'data.records', []);
  36 + });
38 } 37 }
39 } 38 }
40 }; 39 };
1 export default [{ 1 export default [{
2 - path: '/payment/printDetail.html', 2 + path: '/payment/detail.html',
3 name: 'printdetail', 3 name: 'printdetail',
4 component: () => import(/* webpackChunkName: "trade.printDetail" */'./payment-print-detail'), 4 component: () => import(/* webpackChunkName: "trade.printDetail" */'./payment-print-detail'),
5 meta: { 5 meta: {
6 pageName: '结算单详情打印' 6 pageName: '结算单详情打印'
7 } 7 }
8 }, { 8 }, {
9 - path: '/stock/printDetail.html',  
10 - name: 'printdetail',  
11 - component: () => import(/* webpackChunkName: "trade.printDetail" */'./stock-print-detail'), 9 + path: '/payment/stock.html',
  10 + name: 'printStock',
  11 + component: () => import(/* webpackChunkName: "trade.printDetail" */'./payment-print-stock'),
  12 + meta: {
  13 + pageName: '结算单库存打印'
  14 + }
  15 +}, {
  16 + path: '/clearing/stock.html',
  17 + name: 'printStock',
  18 + component: () => import(/* webpackChunkName: "trade.printDetail" */'./clearing-print-stock'),
12 meta: { 19 meta: {
13 - pageName: '库存打印' 20 + pageName: '对账单库存打印'
14 } 21 }
15 }]; 22 }];
@@ -22,7 +22,6 @@ @@ -22,7 +22,6 @@
22 methods: { 22 methods: {
23 search() { 23 search() {
24 let params = { 24 let params = {
25 - supplierId: 128,  
26 balanceId: +this.filters.balanceId.model, 25 balanceId: +this.filters.balanceId.model,
27 brandId: +this.filters.brandId.model, 26 brandId: +this.filters.brandId.model,
28 productSku: +this.filters.sku.model, 27 productSku: +this.filters.sku.model,
  1 +<template>
  2 + <layout-print>
  3 + <h2>结算单库存</h2>
  4 + <Table border :columns="tableCols" :data="tableData"></Table>
  5 + </layout-print>
  6 +</template>
  7 +
  8 +<script>
  9 + import _ from 'lodash';
  10 + import stock from '../payment/store/stock';
  11 + import FinanceService from 'services/finance/finance-service';
  12 +
  13 +
  14 + export default {
  15 + data() {
  16 + return stock.call(this);
  17 + },
  18 + created() {
  19 + this.FinanceService = new FinanceService();
  20 + this.search();
  21 + },
  22 + methods: {
  23 + search() {
  24 + let params = {
  25 + brandId: +this.$route.query.brandId,
  26 + beginTime: +this.$route.query.begin,
  27 + endTime: +this.$route.query.end,
  28 + pageSize: 20,
  29 + pageNo: this.$route.query.page
  30 + };
  31 +
  32 + params = _.pickBy(params, val => val);
  33 +
  34 + this.FinanceService.inventoryLedgerList(params).then(ret => {
  35 + this.tableData = _.get(ret, 'data.records', []);
  36 + });
  37 + }
  38 + }
  39 + };
  40 +</script>
  41 +
  42 +<style lang="scss" scoped>
  43 +h2 {
  44 + line-height: 50px;
  45 + border-bottom: 1px solid #f2f2f2;
  46 + margin-bottom: 10px;
  47 +}
  48 +.print-detail {
  49 + margin-bottom: 20px;
  50 + color: #333;
  51 +}
  52 +</style>
  53 +
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
6 </filter-item> 6 </filter-item>
7 <filter-item :label="filters.createTime.label"> 7 <filter-item :label="filters.createTime.label">
8 <Date-picker v-model="filters.createTime.model" 8 <Date-picker v-model="filters.createTime.model"
9 - type="datetimerange" format="yyyy-MM-dd" placeholder="选择日期和时间"> 9 + type="datetimerange" format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期和时间">
10 </Date-picker> 10 </Date-picker>
11 </filter-item> 11 </filter-item>
12 <filter-item> 12 <filter-item>
@@ -25,15 +25,17 @@ @@ -25,15 +25,17 @@
25 25
26 <script> 26 <script>
27 import stock from './store/stock'; 27 import stock from './store/stock';
  28 +import filter from './store/filter';
28 import FinanceService from 'services/finance/finance-service'; 29 import FinanceService from 'services/finance/finance-service';
29 import _ from 'lodash'; 30 import _ from 'lodash';
30 31
31 export default { 32 export default {
32 data() { 33 data() {
33 - return stock.call(this); 34 + return _.assign(stock.call(this), filter);
34 }, 35 },
35 created() { 36 created() {
36 this.FinanceService = new FinanceService(); 37 this.FinanceService = new FinanceService();
  38 + this.search();
37 }, 39 },
38 computed: { 40 computed: {
39 startTime() { 41 startTime() {
@@ -57,15 +59,15 @@ export default { @@ -57,15 +59,15 @@ export default {
57 }, 59 },
58 methods: { 60 methods: {
59 search() { 61 search() {
  62 +
60 // 在这里实现异步查询的方法,建议在service中做 63 // 在这里实现异步查询的方法,建议在service中做
61 let params = { 64 let params = {
62 - shopId: 1,  
63 supplierId: 128, 65 supplierId: 128,
64 - brandId: this.filters.brandId.model, 66 + brandId: +this.filters.brandId.model,
65 productSkn: '', 67 productSkn: '',
66 productSku: '', 68 productSku: '',
67 - beginTime: this.startTime,  
68 - endTime: this.endTime, 69 + beginTime: this.startTime || this.curDay,
  70 + endTime: this.endTime || this.curDay,
69 pageSize: this.pageData.pageSize, 71 pageSize: this.pageData.pageSize,
70 pageNo: this.pageData.pageNo 72 pageNo: this.pageData.pageNo
71 }; 73 };
@@ -74,8 +76,8 @@ export default { @@ -74,8 +76,8 @@ export default {
74 76
75 this.FinanceService.inventoryLedgerList(params).then(ret => { 77 this.FinanceService.inventoryLedgerList(params).then(ret => {
76 this.tableData = _.get(ret, 'data.records', []); 78 this.tableData = _.get(ret, 'data.records', []);
77 - this.pageData.total = ret.data.pageNo;  
78 - this.pageData.pageNo = ret.data.pageNo; 79 + this.pageData.total = _.get(ret, 'data.totalCount', 0);
  80 + this.pageData.pageNo = _.get(ret, 'data.pageNo', 1);
79 }); 81 });
80 }, 82 },
81 reset() { 83 reset() {
  1 +export default {
  2 + filters: {
  3 + brandId: {
  4 + label: '品牌',
  5 + labelSpan: 6,
  6 + model: '',
  7 + holder: '',
  8 + fieldSpan: 18
  9 + },
  10 + createTime: {
  11 + label: '创建时间',
  12 + labelSpan: 6,
  13 + model: '',
  14 + holder: '',
  15 + fieldSpan: 18
  16 + }
  17 + }
  18 +}
@@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
3 * @author: wsl <shuiling.wang@yoho.cn> 3 * @author: wsl <shuiling.wang@yoho.cn>
4 * @date: 2017/07/13 4 * @date: 2017/07/13
5 */ 5 */
  6 +import moment from 'moment';
6 7
7 export default function() { 8 export default function() {
8 return { 9 return {
@@ -86,21 +87,6 @@ export default function() { @@ -86,21 +87,6 @@ export default function() {
86 pageNo: 1, 87 pageNo: 1,
87 pageSize: 20 88 pageSize: 20
88 }, 89 },
89 - filters: {  
90 - brandId: {  
91 - label: '品牌',  
92 - labelSpan: 6,  
93 - model: '',  
94 - holder: '',  
95 - fieldSpan: 18  
96 - },  
97 - createTime: {  
98 - label: '创建时间',  
99 - labelSpan: 6,  
100 - model: '',  
101 - holder: '',  
102 - fieldSpan: 18  
103 - }  
104 - } 90 + curDay: Math.round(new Date().getTime()/1000)
105 }; 91 };
106 } 92 }
@@ -4,7 +4,8 @@ let apiUrl = { @@ -4,7 +4,8 @@ let apiUrl = {
4 balanceList: '/erp/balanceList', 4 balanceList: '/erp/balanceList',
5 balanceDetail: '/erp/balanceDetail', 5 balanceDetail: '/erp/balanceDetail',
6 settlementList: '/erp/settlementList', 6 settlementList: '/erp/settlementList',
7 - inventoryLedgerList: '/erp/inventoryLedgerList' 7 + inventoryLedgerList: '/erp/inventoryLedgerList',
  8 + exportBalanceList: '/erp/exportBalanceList'
8 }; 9 };
9 10
10 class FinanceService extends Service { 11 class FinanceService extends Service {
@@ -44,7 +44,10 @@ let domainApis = { @@ -44,7 +44,10 @@ let domainApis = {
44 balanceList: '/erp-shop-web/financeBill/balanceList', 44 balanceList: '/erp-shop-web/financeBill/balanceList',
45 balanceDetail: '/erp-shop-web/financeBill/balanceDetail', 45 balanceDetail: '/erp-shop-web/financeBill/balanceDetail',
46 settlementList: '/erp-shop-web/financeBill/settlementList', 46 settlementList: '/erp-shop-web/financeBill/settlementList',
47 - inventoryLedgerList: '/erp-shop-web/inventoryLedger/list' 47 + inventoryLedgerList: '/erp-shop-web/inventoryLedger/list',
  48 + exportBalanceList: '/erp-shop-web/export/exportBalanceList',
  49 + exportSettlementDetail: '/erp-shop-web/export/exportSettlementDetail',
  50 + exportBalanceDetail: '/erp-shop-web/export/exportBalanceDetail'
48 }, 51 },
49 platform: { 52 platform: {
50 queryShopsByAdminPid: '/SellerShopController/queryShopsByAdminPid', 53 queryShopsByAdminPid: '/SellerShopController/queryShopsByAdminPid',