Authored by 李奇

调拨发货未完成data store归集

@@ -8,6 +8,10 @@ import { CellDispatch, CellDeliver, CellStockOut } from '../components'; @@ -8,6 +8,10 @@ import { CellDispatch, CellDeliver, CellStockOut } from '../components';
8 8
9 export default function() { 9 export default function() {
10 return { 10 return {
  11 + useFilter: false,
  12 + isExporting: false,
  13 + showOutStock: false,
  14 + deliverRows: [],
11 filters: { 15 filters: {
12 orderNo: { 16 orderNo: {
13 label: '调拨单号', 17 label: '调拨单号',
@@ -64,35 +64,22 @@ @@ -64,35 +64,22 @@
64 <script> 64 <script>
65 import _ from 'lodash'; 65 import _ from 'lodash';
66 import moment from 'moment'; 66 import moment from 'moment';
  67 + import {undone as undoneStore} from '../store';
67 import TradeService from 'services/trade/trade-service'; 68 import TradeService from 'services/trade/trade-service';
68 - import dataStore from '../store/undone';  
69 69
70 export default { 70 export default {
71 name: 'TabUndone', 71 name: 'TabUndone',
72 data() { 72 data() {
73 - return {  
74 - self: this,  
75 - filters: {},  
76 - page: {},  
77 - table: {},  
78 - useFilter: false,  
79 - isExporting: false,  
80 - showOutStock: false,  
81 - deliverRows: []  
82 - }; 73 + return undoneStore.apply(this);
83 }, 74 },
84 created() { 75 created() {
85 this.tradeService = new TradeService(); 76 this.tradeService = new TradeService();
86 const no = this.$route.query.no || 0; 77 const no = this.$route.query.no || 0;
87 - const store = dataStore.apply(this);  
88 78
89 - this.filters = store.filters;  
90 if (no) { 79 if (no) {
91 this.filters.orderNo.model = +no; 80 this.filters.orderNo.model = +no;
92 this.useFilter = true; 81 this.useFilter = true;
93 } 82 }
94 - this.page = store.page;  
95 - this.table = store.table;  
96 this.productList(this.params()); 83 this.productList(this.params());
97 }, 84 },
98 methods: { 85 methods: {
@@ -196,10 +183,13 @@ @@ -196,10 +183,13 @@
196 this.page.current = 1; 183 this.page.current = 1;
197 }, 184 },
198 clearFilter() { 185 clearFilter() {
199 - this.filters = dataStore.apply(this).filters;  
200 this.useFilter = false; 186 this.useFilter = false;
201 this.productList(this.params()); 187 this.productList(this.params());
202 this.page.current = 1; 188 this.page.current = 1;
  189 +
  190 + _.each(this.filters, item => {
  191 + item.model = '';
  192 + });
203 }, 193 },
204 pageChange(page) { 194 pageChange(page) {
205 let params = this.params(); 195 let params = this.params();
@@ -107,10 +107,9 @@ @@ -107,10 +107,9 @@
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 + this.expressTime = '-';
110 if (data.length) { 111 if (data.length) {
111 this.expressTime = moment.unix(data[0].createTime).format(fmt); 112 this.expressTime = moment.unix(data[0].createTime).format(fmt);
112 - } else {  
113 - this.expressTime = '-';  
114 } 113 }
115 } 114 }
116 }, 115 },