Authored by htoooth

fix

<template>
<LayoutBody>
<LayoutFilter>
<FilterItem>
</FilterItem>
<FilterItem>
</FilterItem>
</LayoutFilter>
<div>
<Button type="primary" @click="back">返回发货物流列表</Button>
<span>物流单号:{{id}}</span>
<span>发货时间:{{sendTime}}</span>
</div>
<LayoutAction>
发往:{{storeroomName}} {{address}} {{adminName}}
</LayoutAction>
<LayoutList>
... ... @@ -22,6 +21,8 @@
<script>
import service from 'services/express-service';
import moment from 'moment';
import _ from 'lodash';
export default {
props: ['id'],
... ... @@ -40,8 +41,14 @@
},
{
title: '商品图片',
key: 'storeroomName',
align: 'center',
render: (h, params) => {
return (
<div>
<img v-prod-img={params.row.skn}></img>
</div>
);
}
},
{
title: '商品名称',
... ... @@ -58,8 +65,17 @@
}
},
{
title: '订单号/已发数/入库数',
title: '订单号/已发数',
align: 'center',
render: (h, params) => {
return (
<div>{params.row.boList.map((i) => {
return (
<div>{i.proRequisitionFormId}/{i.num}</div>
);
})}</div>
);
}
}
],
tableData: [],
... ... @@ -67,19 +83,44 @@
current: 1,
pageSize: 20,
total: 0
}
},
id: null,
time: null,
storeroomName: null,
address: null,
adminName: null
};
},
mounted() {
this.getExpress(this.$route.params.id);
this.id = this.$route.params.id;
this.time = this.$route.query.time;
this.getExpress(this.id);
},
computed: {
sendTime() {
return moment.unix(this.time).format('YYYY-MM-DD HH:mm:ss');
}
},
methods: {
pageChange(num) {
this.pageData.current = num;
},
getExpress(id) {
return service.show({expressNumber: id});
return service.show({expressNumber: id}).then((result) => {
if (result.code === 200) {
this.tableData = result.data;
this.storeroomName = _.first(this.tableData || {}).storeroomName;
this.address = _.first(this.tableData || {}).address;
this.adminName = _.first(this.tableData || {}).adminName;
}
});
},
back() {
this.$router.push({
name: 'repository.express.list'
});
}
}
};
</script>
... ...
... ... @@ -21,14 +21,6 @@
:placeholder="filters.skuFactoryCode.holder" :maxlength="9"></Input>
</FilterItem>
<FilterItem :label="filters.status.label">
<Select v-model.trim="filters.status.model">
<Option v-for="option in filters.status.options"
:value="option.value"
:key="option.value">{{option.label}}</Option>
</Select>
</FilterItem>
<FilterItem>
<Button type="primary" @click="getExpress">筛选</Button>
<Button @click="clearFilters">清空条件</Button>
... ... @@ -87,31 +79,6 @@
holder: '',
fieldSpan: 18
},
status: {
label: '物流状态',
labelSpan: 6,
model: '',
holder: '',
fieldSpan: 18,
options: [
{
value: -1,
label: '全部'
},
{
value: 10,
label: '已发出'
},
{
value: 20,
label: '已收货'
},
{
value: 41,
label: '入库完成'
}
]
}
}
};
},
... ... @@ -124,7 +91,6 @@
this.filters.expressNumber.model = null;
this.filters.productSkn.model = null;
this.filters.skuFactoryCode.model = null;
this.filters.status.model = -1;
this.pageData.current = 1;
this.pageData.total = 0;
... ... @@ -134,7 +100,7 @@
let params = {};
if (this.filters.id.model) {
params.id = this.filters.id.model;
params.proReqFormId = this.filters.id.model;
}
if (this.filters.expressNumber.model) {
... ... @@ -149,10 +115,6 @@
params.skuFactoryCode = this.filters.skuFactoryCode.model;
}
if (this.filters.status.model !== -1) {
params.status = this.filters.status.model;
}
params.pageSize = this.pageData.pageSize;
params.pageNo = this.pageData.current;
... ... @@ -169,11 +131,14 @@
}
});
},
info(expressId) {
info(data) {
this.$router.push({
name: 'repository.express.info',
params: {
id: expressId
id: data.expressNumber
},
query: {
time: data.createTime
}
});
}
... ...
... ... @@ -3,23 +3,36 @@
* @author: qi.li <qi.li@yoho.cn>
* @date: 2017/04/13
*/
import moment from 'moment';
let tableCols = function() {
return [
{
title: '物流单号',
key: 'expressNumber',
align: 'center'
align: 'center',
render: (h, params) => {
return (
<div>
{params.row.expressNumber} ({params.row.expressName})
</div>
);
}
},
{
title: '发货时间',
key: 'createTime',
align: 'center'
},
{
title: '仓库',
key: 'storeroomName',
align: 'center',
render: (h, params) => {
let time = moment.unix(params.row.createTime);
return (
<div>
<div> {time.format('YYYY-MM-DD')} </div>
<div> {time.format('HH:mm:ss')} </div>
</div>
);
}
},
{
title: '操作',
... ... @@ -28,7 +41,7 @@ let tableCols = function() {
render: (h, params) => {
return (
<div class="action-btn-row">
<i-button type="primary" size="small" onClick={() => this.info(params.row.expressId)}>查看明细</i-button>
<i-button type="primary" size="small" onClick={() => this.info(params.row)}>查看明细</i-button>
</div>
);
}
... ...
... ... @@ -3,11 +3,13 @@ import jit from './jit';
import prodReturn from './return';
import supplement from './supplement';
import invoice from './invoice';
import express from './express';
export default {
diff,
jit,
supplement,
prodReturn,
invoice
invoice,
express
};
... ...