Authored by 李奇

调拨发货物流列表data store归集

@@ -8,6 +8,7 @@ import timeFormat from 'filters/time-format'; @@ -8,6 +8,7 @@ import timeFormat from 'filters/time-format';
8 8
9 export default function() { 9 export default function() {
10 return { 10 return {
  11 + useFilter: false,
11 filters: { 12 filters: {
12 orderNo: { 13 orderNo: {
13 label: '调拨单号', 14 label: '调拨单号',
  1 +/**
  2 + * data store
  3 + * @author: qi.li <qi.li@yoho.cn>
  4 + * @date: 2017/04/13
  5 + */
  6 +
  7 +import done from './done';
  8 +import undone from './undone';
  9 +import express from './express';
  10 +
  11 +export {
  12 + done,
  13 + undone,
  14 + express
  15 +};
@@ -33,23 +33,15 @@ @@ -33,23 +33,15 @@
33 33
34 <script> 34 <script>
35 import _ from 'lodash'; 35 import _ from 'lodash';
  36 + import {express as expressStore} from '../store';
36 import TradeService from 'services/trade/trade-service'; 37 import TradeService from 'services/trade/trade-service';
37 - import dataStore from '../store/express';  
38 38
39 export default { 39 export default {
40 name: 'TabDone', 40 name: 'TabDone',
41 data() { 41 data() {
42 - return {  
43 - self: this,  
44 - filters: {},  
45 - page: {},  
46 - table: {},  
47 - useFilter: false  
48 - }; 42 + return expressStore.apply(this);
49 }, 43 },
50 created() { 44 created() {
51 - this.tradeService = new TradeService();  
52 - const store = dataStore.apply(this);  
53 const params = { 45 const params = {
54 pageNo: 1, 46 pageNo: 1,
55 pageSize: 20, 47 pageSize: 20,
@@ -57,9 +49,7 @@ @@ -57,9 +49,7 @@
57 statusList: [2, 3] 49 statusList: [2, 3]
58 }; 50 };
59 51
60 - this.page = store.page;  
61 - this.table = store.table;  
62 - this.filters = store.filters; 52 + this.tradeService = new TradeService();
63 this.getExpList(params); 53 this.getExpList(params);
64 }, 54 },
65 methods: { 55 methods: {
@@ -84,7 +74,9 @@ @@ -84,7 +74,9 @@
84 this.getExpList(this.params()); 74 this.getExpList(this.params());
85 this.page.current = 1; 75 this.page.current = 1;
86 } 76 }
87 - this.filters = dataStore.apply(this).filters; 77 + _.each(this.filters, item => {
  78 + item.model = '';
  79 + });
88 }, 80 },
89 pageChange(page) { 81 pageChange(page) {
90 let params = this.params(); 82 let params = this.params();
@@ -107,7 +107,11 @@ @@ -107,7 +107,11 @@
107 const fmt = 'YYYY-MM-DD HH:mm:ss'; 107 const fmt = 'YYYY-MM-DD HH:mm:ss';
108 108
109 this.table.list = data; 109 this.table.list = data;
  110 + if (data.length) {
110 this.expressTime = moment.unix(data[0].createTime).format(fmt); 111 this.expressTime = moment.unix(data[0].createTime).format(fmt);
  112 + } else {
  113 + this.expressTime = '-';
  114 + }
111 } 115 }
112 }, 116 },
113 components: { 117 components: {