Authored by 李奇

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

... ... @@ -8,6 +8,7 @@ import timeFormat from 'filters/time-format';
export default function() {
return {
useFilter: false,
filters: {
orderNo: {
label: '调拨单号',
... ...
/**
* data store
* @author: qi.li <qi.li@yoho.cn>
* @date: 2017/04/13
*/
import done from './done';
import undone from './undone';
import express from './express';
export {
done,
undone,
express
};
... ...
... ... @@ -33,23 +33,15 @@
<script>
import _ from 'lodash';
import {express as expressStore} from '../store';
import TradeService from 'services/trade/trade-service';
import dataStore from '../store/express';
export default {
name: 'TabDone',
data() {
return {
self: this,
filters: {},
page: {},
table: {},
useFilter: false
};
return expressStore.apply(this);
},
created() {
this.tradeService = new TradeService();
const store = dataStore.apply(this);
const params = {
pageNo: 1,
pageSize: 20,
... ... @@ -57,9 +49,7 @@
statusList: [2, 3]
};
this.page = store.page;
this.table = store.table;
this.filters = store.filters;
this.tradeService = new TradeService();
this.getExpList(params);
},
methods: {
... ... @@ -84,7 +74,9 @@
this.getExpList(this.params());
this.page.current = 1;
}
this.filters = dataStore.apply(this).filters;
_.each(this.filters, item => {
item.model = '';
});
},
pageChange(page) {
let params = this.params();
... ...
... ... @@ -107,7 +107,11 @@
const fmt = 'YYYY-MM-DD HH:mm:ss';
this.table.list = data;
this.expressTime = moment.unix(data[0].createTime).format(fmt);
if (data.length) {
this.expressTime = moment.unix(data[0].createTime).format(fmt);
} else {
this.expressTime = '-';
}
}
},
components: {
... ...