Authored by htoooth

fix

1 <template> 1 <template>
2 <LayoutBody> 2 <LayoutBody>
3 - <LayoutFilter>  
4 - <FilterItem>  
5 - </FilterItem>  
6 - <FilterItem>  
7 - </FilterItem>  
8 - </LayoutFilter> 3 + <div>
  4 + <Button type="primary" @click="back">返回发货物流列表</Button>
  5 + <span>物流单号:{{id}}</span>
  6 + <span>发货时间:{{sendTime}}</span>
  7 + </div>
9 8
10 <LayoutAction> 9 <LayoutAction>
11 - 10 + 发往:{{storeroomName}} {{address}} {{adminName}}
12 </LayoutAction> 11 </LayoutAction>
13 12
14 <LayoutList> 13 <LayoutList>
@@ -22,6 +21,8 @@ @@ -22,6 +21,8 @@
22 21
23 <script> 22 <script>
24 import service from 'services/express-service'; 23 import service from 'services/express-service';
  24 + import moment from 'moment';
  25 + import _ from 'lodash';
25 26
26 export default { 27 export default {
27 props: ['id'], 28 props: ['id'],
@@ -40,8 +41,14 @@ @@ -40,8 +41,14 @@
40 }, 41 },
41 { 42 {
42 title: '商品图片', 43 title: '商品图片',
43 - key: 'storeroomName',  
44 align: 'center', 44 align: 'center',
  45 + render: (h, params) => {
  46 + return (
  47 + <div>
  48 + <img v-prod-img={params.row.skn}></img>
  49 + </div>
  50 + );
  51 + }
45 }, 52 },
46 { 53 {
47 title: '商品名称', 54 title: '商品名称',
@@ -58,8 +65,17 @@ @@ -58,8 +65,17 @@
58 } 65 }
59 }, 66 },
60 { 67 {
61 - title: '订单号/已发数/入库数', 68 + title: '订单号/已发数',
62 align: 'center', 69 align: 'center',
  70 + render: (h, params) => {
  71 + return (
  72 + <div>{params.row.boList.map((i) => {
  73 + return (
  74 + <div>{i.proRequisitionFormId}/{i.num}</div>
  75 + );
  76 + })}</div>
  77 + );
  78 + }
63 } 79 }
64 ], 80 ],
65 tableData: [], 81 tableData: [],
@@ -67,19 +83,44 @@ @@ -67,19 +83,44 @@
67 current: 1, 83 current: 1,
68 pageSize: 20, 84 pageSize: 20,
69 total: 0 85 total: 0
70 - } 86 + },
  87 + id: null,
  88 + time: null,
  89 + storeroomName: null,
  90 + address: null,
  91 + adminName: null
71 }; 92 };
72 }, 93 },
73 mounted() { 94 mounted() {
74 - this.getExpress(this.$route.params.id); 95 + this.id = this.$route.params.id;
  96 + this.time = this.$route.query.time;
  97 + this.getExpress(this.id);
  98 + },
  99 + computed: {
  100 + sendTime() {
  101 + return moment.unix(this.time).format('YYYY-MM-DD HH:mm:ss');
  102 + }
75 }, 103 },
76 methods: { 104 methods: {
77 pageChange(num) { 105 pageChange(num) {
78 this.pageData.current = num; 106 this.pageData.current = num;
79 }, 107 },
80 getExpress(id) { 108 getExpress(id) {
81 - return service.show({expressNumber: id}); 109 + return service.show({expressNumber: id}).then((result) => {
  110 + if (result.code === 200) {
  111 + this.tableData = result.data;
  112 + this.storeroomName = _.first(this.tableData || {}).storeroomName;
  113 + this.address = _.first(this.tableData || {}).address;
  114 + this.adminName = _.first(this.tableData || {}).adminName;
  115 + }
  116 + });
  117 + },
  118 + back() {
  119 + this.$router.push({
  120 + name: 'repository.express.list'
  121 + });
82 } 122 }
  123 +
83 } 124 }
84 }; 125 };
85 </script> 126 </script>
@@ -21,14 +21,6 @@ @@ -21,14 +21,6 @@
21 :placeholder="filters.skuFactoryCode.holder" :maxlength="9"></Input> 21 :placeholder="filters.skuFactoryCode.holder" :maxlength="9"></Input>
22 </FilterItem> 22 </FilterItem>
23 23
24 - <FilterItem :label="filters.status.label">  
25 - <Select v-model.trim="filters.status.model">  
26 - <Option v-for="option in filters.status.options"  
27 - :value="option.value"  
28 - :key="option.value">{{option.label}}</Option>  
29 - </Select>  
30 - </FilterItem>  
31 -  
32 <FilterItem> 24 <FilterItem>
33 <Button type="primary" @click="getExpress">筛选</Button> 25 <Button type="primary" @click="getExpress">筛选</Button>
34 <Button @click="clearFilters">清空条件</Button> 26 <Button @click="clearFilters">清空条件</Button>
@@ -87,31 +79,6 @@ @@ -87,31 +79,6 @@
87 holder: '', 79 holder: '',
88 fieldSpan: 18 80 fieldSpan: 18
89 }, 81 },
90 - status: {  
91 - label: '物流状态',  
92 - labelSpan: 6,  
93 - model: '',  
94 - holder: '',  
95 - fieldSpan: 18,  
96 - options: [  
97 - {  
98 - value: -1,  
99 - label: '全部'  
100 - },  
101 - {  
102 - value: 10,  
103 - label: '已发出'  
104 - },  
105 - {  
106 - value: 20,  
107 - label: '已收货'  
108 - },  
109 - {  
110 - value: 41,  
111 - label: '入库完成'  
112 - }  
113 - ]  
114 - }  
115 } 82 }
116 }; 83 };
117 }, 84 },
@@ -124,7 +91,6 @@ @@ -124,7 +91,6 @@
124 this.filters.expressNumber.model = null; 91 this.filters.expressNumber.model = null;
125 this.filters.productSkn.model = null; 92 this.filters.productSkn.model = null;
126 this.filters.skuFactoryCode.model = null; 93 this.filters.skuFactoryCode.model = null;
127 - this.filters.status.model = -1;  
128 this.pageData.current = 1; 94 this.pageData.current = 1;
129 this.pageData.total = 0; 95 this.pageData.total = 0;
130 96
@@ -134,7 +100,7 @@ @@ -134,7 +100,7 @@
134 let params = {}; 100 let params = {};
135 101
136 if (this.filters.id.model) { 102 if (this.filters.id.model) {
137 - params.id = this.filters.id.model; 103 + params.proReqFormId = this.filters.id.model;
138 } 104 }
139 105
140 if (this.filters.expressNumber.model) { 106 if (this.filters.expressNumber.model) {
@@ -149,10 +115,6 @@ @@ -149,10 +115,6 @@
149 params.skuFactoryCode = this.filters.skuFactoryCode.model; 115 params.skuFactoryCode = this.filters.skuFactoryCode.model;
150 } 116 }
151 117
152 - if (this.filters.status.model !== -1) {  
153 - params.status = this.filters.status.model;  
154 - }  
155 -  
156 params.pageSize = this.pageData.pageSize; 118 params.pageSize = this.pageData.pageSize;
157 params.pageNo = this.pageData.current; 119 params.pageNo = this.pageData.current;
158 120
@@ -169,11 +131,14 @@ @@ -169,11 +131,14 @@
169 } 131 }
170 }); 132 });
171 }, 133 },
172 - info(expressId) { 134 + info(data) {
173 this.$router.push({ 135 this.$router.push({
174 name: 'repository.express.info', 136 name: 'repository.express.info',
175 params: { 137 params: {
176 - id: expressId 138 + id: data.expressNumber
  139 + },
  140 + query: {
  141 + time: data.createTime
177 } 142 }
178 }); 143 });
179 } 144 }
@@ -3,23 +3,36 @@ @@ -3,23 +3,36 @@
3 * @author: qi.li <qi.li@yoho.cn> 3 * @author: qi.li <qi.li@yoho.cn>
4 * @date: 2017/04/13 4 * @date: 2017/04/13
5 */ 5 */
  6 +import moment from 'moment';
6 7
7 let tableCols = function() { 8 let tableCols = function() {
8 return [ 9 return [
9 { 10 {
10 title: '物流单号', 11 title: '物流单号',
11 key: 'expressNumber', 12 key: 'expressNumber',
12 - align: 'center' 13 + align: 'center',
  14 + render: (h, params) => {
  15 + return (
  16 + <div>
  17 + {params.row.expressNumber} ({params.row.expressName})
  18 + </div>
  19 + );
  20 + }
13 }, 21 },
14 { 22 {
15 title: '发货时间', 23 title: '发货时间',
16 key: 'createTime', 24 key: 'createTime',
17 - align: 'center'  
18 - },  
19 - {  
20 - title: '仓库',  
21 - key: 'storeroomName',  
22 align: 'center', 25 align: 'center',
  26 + render: (h, params) => {
  27 + let time = moment.unix(params.row.createTime);
  28 +
  29 + return (
  30 + <div>
  31 + <div> {time.format('YYYY-MM-DD')} </div>
  32 + <div> {time.format('HH:mm:ss')} </div>
  33 + </div>
  34 + );
  35 + }
23 }, 36 },
24 { 37 {
25 title: '操作', 38 title: '操作',
@@ -28,7 +41,7 @@ let tableCols = function() { @@ -28,7 +41,7 @@ let tableCols = function() {
28 render: (h, params) => { 41 render: (h, params) => {
29 return ( 42 return (
30 <div class="action-btn-row"> 43 <div class="action-btn-row">
31 - <i-button type="primary" size="small" onClick={() => this.info(params.row.expressId)}>查看明细</i-button> 44 + <i-button type="primary" size="small" onClick={() => this.info(params.row)}>查看明细</i-button>
32 </div> 45 </div>
33 ); 46 );
34 } 47 }
@@ -3,11 +3,13 @@ import jit from './jit'; @@ -3,11 +3,13 @@ import jit from './jit';
3 import prodReturn from './return'; 3 import prodReturn from './return';
4 import supplement from './supplement'; 4 import supplement from './supplement';
5 import invoice from './invoice'; 5 import invoice from './invoice';
  6 +import express from './express';
6 7
7 export default { 8 export default {
8 diff, 9 diff,
9 jit, 10 jit,
10 supplement, 11 supplement,
11 prodReturn, 12 prodReturn,
12 - invoice 13 + invoice,
  14 + express
13 }; 15 };