...
|
...
|
@@ -53,93 +53,101 @@ |
|
|
filters: {},
|
|
|
page: {},
|
|
|
table: {},
|
|
|
useFilterSign: false
|
|
|
useFilter: false
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
const store = Store();
|
|
|
const params = {
|
|
|
pageNo: 1,
|
|
|
statusList: [3] // TODO
|
|
|
pageSize: 20,
|
|
|
statusList: [2,3]
|
|
|
};
|
|
|
|
|
|
this.page = store.page;
|
|
|
this.table = store.table;
|
|
|
this.filters = store.filters;
|
|
|
this.expressList(params);
|
|
|
this.getExpList(params);
|
|
|
},
|
|
|
methods: {
|
|
|
expressList(params){
|
|
|
service.allotExpressList(
|
|
|
_.merge(params || {}, {
|
|
|
pageSize: 20
|
|
|
}))
|
|
|
getExpList(params){
|
|
|
service.allotExpressList(params)
|
|
|
.then(res => {
|
|
|
const fmt = 'YYYY-MM-DD HH:mm:ss';
|
|
|
const list = res.data.records;
|
|
|
|
|
|
_.each(list, i => {
|
|
|
i.createTime = moment(i.createTime).format(fmt);
|
|
|
});
|
|
|
|
|
|
this.table.list = list;
|
|
|
this.page.total = res.data.totalCount;
|
|
|
this.handleData(res.data);
|
|
|
});
|
|
|
},
|
|
|
filterSearch(){
|
|
|
const params = this.params();
|
|
|
|
|
|
this.useFilterSign = true;
|
|
|
this.expressList(params);
|
|
|
this.useFilter = true;
|
|
|
this.getExpList(this.params());
|
|
|
this.page.current = 1;
|
|
|
},
|
|
|
clearFilter(){
|
|
|
this.filters = Store().filters;
|
|
|
this.expressList();
|
|
|
this.useFilterSign = false;
|
|
|
this.useFilter = false;
|
|
|
this.getExpList(this.params());
|
|
|
this.page.current = 1;
|
|
|
this.filters = Store().filters;
|
|
|
},
|
|
|
pageChange(page) {
|
|
|
let params = {};
|
|
|
let params = this.params();
|
|
|
params.pageNo = page;
|
|
|
this.page.current = page;
|
|
|
|
|
|
if(this.useFilterSign) {
|
|
|
params = this.params();
|
|
|
}
|
|
|
|
|
|
_.merge(params, {
|
|
|
page
|
|
|
});
|
|
|
|
|
|
this.expressList(params);
|
|
|
this.getExpList(params);
|
|
|
},
|
|
|
params(){
|
|
|
const data = {};
|
|
|
const data = {
|
|
|
pageNo: 1,
|
|
|
pageSize: 20,
|
|
|
statusList: [2,3]
|
|
|
};
|
|
|
const mapKeys = {
|
|
|
proRequisitionFormId: 'orderNo',
|
|
|
productSkn: 'prodCode',
|
|
|
sknFactoryCode: 'merChantCode',
|
|
|
expressNumber: 'expressNo',
|
|
|
sknFactoryCode: 'prodCode',
|
|
|
skuFactoryCode: 'prodBarCode',
|
|
|
startTime: 'orderTime',
|
|
|
endTime: 'orderTime',
|
|
|
isOvertime: 'prodStatus'
|
|
|
proRequisitionFormId: 'orderNo',
|
|
|
statusList: 'expressStatus'
|
|
|
};
|
|
|
|
|
|
_.each(mapKeys, (v, k) => {
|
|
|
data[k] = this.filters[v].model;
|
|
|
});
|
|
|
if(this.useFilter) {
|
|
|
let val;
|
|
|
_.each(mapKeys, (v, k) => {
|
|
|
val = '' + this.filters[v].model;
|
|
|
if(val.length) {
|
|
|
data[k] = this.filters[v].model;
|
|
|
}
|
|
|
|
|
|
// 物流状态
|
|
|
if(k === 'statusList') {
|
|
|
if (val === '0') {
|
|
|
data[k] = [2, 3];
|
|
|
} else {
|
|
|
data[k] = [this.filters[v].model];
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
|
|
|
return data;
|
|
|
},
|
|
|
expressDetail(expressNo) {
|
|
|
goExpDetail(expressNo) {
|
|
|
this.$router.push({
|
|
|
name: 'trade.expdetail',
|
|
|
query: {
|
|
|
expressNo
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
handleData(data) {
|
|
|
const fmt = 'YYYY-MM-DD HH:mm:ss';
|
|
|
const list = data.records;
|
|
|
|
|
|
_.each(list, i => {
|
|
|
i.createTime = moment(i.createTime).format(fmt);
|
|
|
});
|
|
|
|
|
|
this.table.list = list;
|
|
|
this.page.total = data.totalCount;
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
</script>
|
...
|
...
|
|