Merge branch 'release/2.0' of http://git.yoho.cn/fe/yoho-shop-manage into release/2.0
Showing
13 changed files
with
117 additions
and
44 deletions
@@ -16,6 +16,10 @@ | @@ -16,6 +16,10 @@ | ||
16 | value: { | 16 | value: { |
17 | type: [Number, String], | 17 | type: [Number, String], |
18 | default: 0 | 18 | default: 0 |
19 | + }, | ||
20 | + selectWhenOnlyOne: { | ||
21 | + type: Boolean, | ||
22 | + default: false | ||
19 | } | 23 | } |
20 | }, | 24 | }, |
21 | created() { | 25 | created() { |
@@ -23,6 +27,12 @@ | @@ -23,6 +27,12 @@ | ||
23 | 27 | ||
24 | this.brandService.getBrand().then((res) => { | 28 | this.brandService.getBrand().then((res) => { |
25 | this.optionList = res.data; | 29 | this.optionList = res.data; |
30 | + | ||
31 | + if (this.selectWhenOnlyOne) { | ||
32 | + if (this.optionList.length === 1) { | ||
33 | + this.brandId = this.optionList[0].brandId; | ||
34 | + } | ||
35 | + } | ||
26 | }); | 36 | }); |
27 | }, | 37 | }, |
28 | data() { | 38 | data() { |
@@ -11,8 +11,6 @@ | @@ -11,8 +11,6 @@ | ||
11 | 11 | ||
12 | <layout-list> | 12 | <layout-list> |
13 | <Table border :columns="tableCols" :data="tableData"></Table> | 13 | <Table border :columns="tableCols" :data="tableData"></Table> |
14 | - <Page :total="pageData.total" :current="pageData.current" | ||
15 | - @on-change="pageChange" :page-size="20" show-total></Page> | ||
16 | </layout-list> | 14 | </layout-list> |
17 | 15 | ||
18 | </layout-body> | 16 | </layout-body> |
@@ -85,11 +83,6 @@ | @@ -85,11 +83,6 @@ | ||
85 | } | 83 | } |
86 | ], | 84 | ], |
87 | tableData: [], | 85 | tableData: [], |
88 | - pageData: { | ||
89 | - current: 1, | ||
90 | - pageSize: 20, | ||
91 | - total: 0 | ||
92 | - }, | ||
93 | id: null, | 86 | id: null, |
94 | time: null, | 87 | time: null, |
95 | storeroomName: null, | 88 | storeroomName: null, |
@@ -108,9 +101,6 @@ | @@ -108,9 +101,6 @@ | ||
108 | } | 101 | } |
109 | }, | 102 | }, |
110 | methods: { | 103 | methods: { |
111 | - pageChange(num) { | ||
112 | - this.pageData.current = num; | ||
113 | - }, | ||
114 | getExpress(id) { | 104 | getExpress(id) { |
115 | return this.expressService.show({expressNumber: id}).then((result) => { | 105 | return this.expressService.show({expressNumber: id}).then((result) => { |
116 | if (result.code === 200) { | 106 | if (result.code === 200) { |
@@ -2,23 +2,23 @@ | @@ -2,23 +2,23 @@ | ||
2 | <layout-body> | 2 | <layout-body> |
3 | <layout-filter> | 3 | <layout-filter> |
4 | <filter-item :label="filters.id.label"> | 4 | <filter-item :label="filters.id.label"> |
5 | - <Input v-model.trim="filters.id.model" :number="true" | ||
6 | - :placeholder="filters.id.holder" :maxlength="9"></Input> | 5 | + <Input v-model.trim="filters.id.model" |
6 | + :placeholder="filters.id.holder" ></Input> | ||
7 | </filter-item> | 7 | </filter-item> |
8 | 8 | ||
9 | <filter-item :label="filters.expressNumber.label"> | 9 | <filter-item :label="filters.expressNumber.label"> |
10 | - <Input v-model.trim="filters.expressNumber.model" :number="true" | ||
11 | - :placeholder="filters.expressNumber.holder" :maxlength="9"></Input> | 10 | + <Input v-model.trim="filters.expressNumber.model" |
11 | + :placeholder="filters.expressNumber.holder" ></Input> | ||
12 | </filter-item> | 12 | </filter-item> |
13 | 13 | ||
14 | <filter-item :label="filters.productSkn.label"> | 14 | <filter-item :label="filters.productSkn.label"> |
15 | - <Input v-model.trim="filters.productSkn.model" :number="true" | ||
16 | - :placeholder="filters.productSkn.holder" :maxlength="9"></Input> | 15 | + <Input v-model.trim="filters.productSkn.model" |
16 | + :placeholder="filters.productSkn.holder"></Input> | ||
17 | </filter-item> | 17 | </filter-item> |
18 | 18 | ||
19 | <filter-item :label="filters.skuFactoryCode.label"> | 19 | <filter-item :label="filters.skuFactoryCode.label"> |
20 | - <Input v-model.trim="filters.skuFactoryCode.model" :number="true" | ||
21 | - :placeholder="filters.skuFactoryCode.holder" :maxlength="9"></Input> | 20 | + <Input v-model.trim="filters.skuFactoryCode.model" |
21 | + :placeholder="filters.skuFactoryCode.holder"></Input> | ||
22 | </filter-item> | 22 | </filter-item> |
23 | 23 | ||
24 | <filter-item> | 24 | <filter-item> |
@@ -13,11 +13,12 @@ | @@ -13,11 +13,12 @@ | ||
13 | </Form-item> | 13 | </Form-item> |
14 | 14 | ||
15 | <Form-item label="预计到货时间"> | 15 | <Form-item label="预计到货时间"> |
16 | - <Date-picker v-model="createDate" type="date" placeholder="选择日期"></Date-picker> | 16 | + <!--<Date-picker v-model="createDate" type="date" placeholder="选择日期"></Date-picker>--> |
17 | + <date-pick v-model="createDate"></date-pick> | ||
17 | </Form-item> | 18 | </Form-item> |
18 | 19 | ||
19 | <Form-item label="品牌"> | 20 | <Form-item label="品牌"> |
20 | - <select-brand v-model="brandId"></select-brand> | 21 | + <select-brand v-model="brandId" :selectWhenOnlyOne="true"></select-brand> |
21 | </Form-item> | 22 | </Form-item> |
22 | </Form> | 23 | </Form> |
23 | </div> | 24 | </div> |
@@ -33,6 +34,8 @@ | @@ -33,6 +34,8 @@ | ||
33 | <script> | 34 | <script> |
34 | 35 | ||
35 | import InvoiceService from 'services/repository/invoice-service'; | 36 | import InvoiceService from 'services/repository/invoice-service'; |
37 | +import DatePick from './date-pick'; | ||
38 | +import moment from 'moment'; | ||
36 | 39 | ||
37 | export default { | 40 | export default { |
38 | name: 'create-modal', | 41 | name: 'create-modal', |
@@ -49,8 +52,8 @@ export default { | @@ -49,8 +52,8 @@ export default { | ||
49 | }; | 52 | }; |
50 | }, | 53 | }, |
51 | computed: { | 54 | computed: { |
52 | - hanldeDate() { | ||
53 | - return this.createDate.getTime() / 1000; | 55 | + handleDate() { |
56 | + return moment(this.createDate, 'YYYY-MM-DD').unix(); | ||
54 | } | 57 | } |
55 | }, | 58 | }, |
56 | methods: { | 59 | methods: { |
@@ -111,7 +114,7 @@ export default { | @@ -111,7 +114,7 @@ export default { | ||
111 | } | 114 | } |
112 | 115 | ||
113 | this.modal_loading = true; | 116 | this.modal_loading = true; |
114 | - return this.invoiceService.createOrder(this.storageId, this.hanldeDate, this.brandId).then((result) => { | 117 | + return this.invoiceService.createOrder(this.storageId, this.handleDate, this.brandId).then((result) => { |
115 | if (result.code === 200) { | 118 | if (result.code === 200) { |
116 | this.$Message.info('创建成功'); | 119 | this.$Message.info('创建成功'); |
117 | } else { | 120 | } else { |
@@ -124,7 +127,11 @@ export default { | @@ -124,7 +127,11 @@ export default { | ||
124 | emitEvent() { | 127 | emitEvent() { |
125 | this.$emit('on-success'); | 128 | this.$emit('on-success'); |
126 | } | 129 | } |
130 | + }, | ||
131 | + components: { | ||
132 | + DatePick | ||
127 | } | 133 | } |
134 | + | ||
128 | }; | 135 | }; |
129 | 136 | ||
130 | </script> | 137 | </script> |
1 | +<template> | ||
2 | + <Date-picker | ||
3 | + :value="value" | ||
4 | + :type="type" | ||
5 | + :options="options" | ||
6 | + @on-change="updateHandle" | ||
7 | + clearable | ||
8 | + placeholder="选择日期"> | ||
9 | + </Date-picker> | ||
10 | +</template> | ||
11 | + | ||
12 | +<script> | ||
13 | + const DAY_MS = 86400000; | ||
14 | + | ||
15 | + export default { | ||
16 | + props: { | ||
17 | + value: { | ||
18 | + type: Object, | ||
19 | + default: null | ||
20 | + }, | ||
21 | + type: { | ||
22 | + type: String, | ||
23 | + default: 'date' | ||
24 | + }, | ||
25 | + options: { | ||
26 | + type: Object, | ||
27 | + default() { | ||
28 | + return { | ||
29 | + disabledDate(date) { | ||
30 | + return date && date.valueOf() < Date.now() - DAY_MS; | ||
31 | + } | ||
32 | + }; | ||
33 | + } | ||
34 | + } | ||
35 | + }, | ||
36 | + methods: { | ||
37 | + updateHandle(newValue) { | ||
38 | + this.$emit('input', newValue); | ||
39 | + } | ||
40 | + }, | ||
41 | + watch: { | ||
42 | + value(newValue) { | ||
43 | + this.value = newValue; | ||
44 | + } | ||
45 | + } | ||
46 | + }; | ||
47 | +</script> |
@@ -63,7 +63,7 @@ | @@ -63,7 +63,7 @@ | ||
63 | brandId: this.brandId | 63 | brandId: this.brandId |
64 | }).then((res) => { | 64 | }).then((res) => { |
65 | if (res.code === 200) { | 65 | if (res.code === 200) { |
66 | - this.tableData = res.data.records.map((i) => { | 66 | + this.tableData = (res.data.records || []).map((i) => { |
67 | i.buyingNums = null; | 67 | i.buyingNums = null; |
68 | return i; | 68 | return i; |
69 | }); | 69 | }); |
@@ -77,7 +77,7 @@ | @@ -77,7 +77,7 @@ | ||
77 | brandId: this.brandId | 77 | brandId: this.brandId |
78 | }).then((res) => { | 78 | }).then((res) => { |
79 | if (res.code === 200) { | 79 | if (res.code === 200) { |
80 | - this.tableData = res.data.goodsList.map((i) => { | 80 | + this.tableData = (res.data.goodsList || []).map((i) => { |
81 | i.editable = false; | 81 | i.editable = false; |
82 | return i; | 82 | return i; |
83 | }); | 83 | }); |
@@ -108,7 +108,7 @@ | @@ -108,7 +108,7 @@ | ||
108 | this.invoiceService.addGoods(data).then((result) => { | 108 | this.invoiceService.addGoods(data).then((result) => { |
109 | if (result.code === 200) { | 109 | if (result.code === 200) { |
110 | this.$Message.info('加入成功'); | 110 | this.$Message.info('加入成功'); |
111 | - this.search(); | 111 | + params.row.hasAdded = true; |
112 | } else { | 112 | } else { |
113 | this.$Message.error('加入失败'); | 113 | this.$Message.error('加入失败'); |
114 | } | 114 | } |
@@ -49,9 +49,20 @@ | @@ -49,9 +49,20 @@ | ||
49 | methods: { | 49 | methods: { |
50 | onClickCreate() { | 50 | onClickCreate() { |
51 | this.tableData = this.$refs.goodsList.rebuildData; | 51 | this.tableData = this.$refs.goodsList.rebuildData; |
52 | - this.$refs.sendModal.show(this.id, this.tableData.filter(i => { | 52 | + |
53 | + let select = this.tableData.filter(i => { | ||
53 | return _.find(this.selection, (s) => s.id === i.id); | 54 | return _.find(this.selection, (s) => s.id === i.id); |
54 | - })); | 55 | + }); |
56 | + | ||
57 | + if (!select.some((i) => { | ||
58 | + return i.num && i.num <= i.buyingNums; | ||
59 | + })) { | ||
60 | + this.$Message.error('请正确填写发货数量'); | ||
61 | + this.selection = []; | ||
62 | + return; | ||
63 | + } | ||
64 | + | ||
65 | + this.$refs.sendModal.show(this.id, select); | ||
55 | }, | 66 | }, |
56 | getGoods() { | 67 | getGoods() { |
57 | return this.invoiceService.listProduct({ | 68 | return this.invoiceService.listProduct({ |
@@ -61,6 +72,7 @@ | @@ -61,6 +72,7 @@ | ||
61 | if (res.code === 200) { | 72 | if (res.code === 200) { |
62 | this.tableData = (res.data.goodsList || []).map((i) => { | 73 | this.tableData = (res.data.goodsList || []).map((i) => { |
63 | i.num = null; | 74 | i.num = null; |
75 | + i._disabled = i.shipmentsNums === i.buyingNums; | ||
64 | return i; | 76 | return i; |
65 | }); | 77 | }); |
66 | } | 78 | } |
@@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
6 | </filter-item> | 6 | </filter-item> |
7 | 7 | ||
8 | <filter-item label="预计到货"> | 8 | <filter-item label="预计到货"> |
9 | - <Date-picker v-model="arrival" type="date" placeholder="选择日期"></Date-picker> | 9 | + <Date-Pick v-model="arrival"></Date-Pick> |
10 | </filter-item> | 10 | </filter-item> |
11 | 11 | ||
12 | <filter-item > | 12 | <filter-item > |
@@ -41,7 +41,9 @@ | @@ -41,7 +41,9 @@ | ||
41 | 41 | ||
42 | import ProductList from './components/product-list'; | 42 | import ProductList from './components/product-list'; |
43 | import OrderInfo from './components/order-info'; | 43 | import OrderInfo from './components/order-info'; |
44 | + import DatePick from './components/date-pick'; | ||
44 | import InvoiceService from 'services/repository/invoice-service'; | 45 | import InvoiceService from 'services/repository/invoice-service'; |
46 | + import moment from 'moment'; | ||
45 | 47 | ||
46 | export default { | 48 | export default { |
47 | props: ['isEdit'], | 49 | props: ['isEdit'], |
@@ -50,7 +52,7 @@ | @@ -50,7 +52,7 @@ | ||
50 | count: 0, | 52 | count: 0, |
51 | id: '', | 53 | id: '', |
52 | storeId: '', | 54 | storeId: '', |
53 | - arrivalTime: new Date().getTime() / 1000, | 55 | + arrivalTime: null, |
54 | brandId: '', | 56 | brandId: '', |
55 | info: null | 57 | info: null |
56 | }; | 58 | }; |
@@ -63,10 +65,10 @@ | @@ -63,10 +65,10 @@ | ||
63 | computed: { | 65 | computed: { |
64 | arrival: { | 66 | arrival: { |
65 | get() { | 67 | get() { |
66 | - return new Date(this.arrivalTime * 1000); | 68 | + return moment.unix(this.arrivalTime).format('YYYY-MM-DD'); |
67 | }, | 69 | }, |
68 | set(newVal) { | 70 | set(newVal) { |
69 | - this.arrivalTime = newVal.getTime() / 1000; | 71 | + this.arrivalTime = moment(newVal, 'YYYY-MM-DD').unix(); |
70 | } | 72 | } |
71 | } | 73 | } |
72 | }, | 74 | }, |
@@ -101,7 +103,8 @@ | @@ -101,7 +103,8 @@ | ||
101 | }, | 103 | }, |
102 | components: { | 104 | components: { |
103 | ProductList, | 105 | ProductList, |
104 | - OrderInfo | 106 | + OrderInfo, |
107 | + DatePick | ||
105 | } | 108 | } |
106 | }; | 109 | }; |
107 | </script> | 110 | </script> |
@@ -69,11 +69,11 @@ let tableCols = function() { | @@ -69,11 +69,11 @@ let tableCols = function() { | ||
69 | }, | 69 | }, |
70 | 70 | ||
71 | { | 71 | { |
72 | - title: '发货进度 已发数/采购数', | 72 | + title: '发货进度 已发数/需发总数', |
73 | key: 'editTime', | 73 | key: 'editTime', |
74 | align: 'center', | 74 | align: 'center', |
75 | renderHeader() { | 75 | renderHeader() { |
76 | - return '发货进度<br/> 已发数/采购数 '; | 76 | + return '发货进度<br/> 已发数/需发总数 '; |
77 | }, | 77 | }, |
78 | render: (h, params) => { | 78 | render: (h, params) => { |
79 | let percent = 0; | 79 | let percent = 0; |
@@ -98,11 +98,11 @@ let tableCols = function() { | @@ -98,11 +98,11 @@ let tableCols = function() { | ||
98 | }, | 98 | }, |
99 | 99 | ||
100 | { | 100 | { |
101 | - title: '入库进度 已入库数/采购数', | 101 | + title: '入库进度 已入库数/需发总数', |
102 | key: 'editTime', | 102 | key: 'editTime', |
103 | align: 'center', | 103 | align: 'center', |
104 | renderHeader() { | 104 | renderHeader() { |
105 | - return '入库进度<br/> 已入库数/采购数'; | 105 | + return '入库进度<br/> 已入库数/需发总数'; |
106 | }, | 106 | }, |
107 | render: (h, params) => { | 107 | render: (h, params) => { |
108 | let percent = 0; | 108 | let percent = 0; |
@@ -131,10 +131,14 @@ let tableCols = function() { | @@ -131,10 +131,14 @@ let tableCols = function() { | ||
131 | key: 'action', | 131 | key: 'action', |
132 | align: 'center', | 132 | align: 'center', |
133 | render: (h, params) => { | 133 | render: (h, params) => { |
134 | + let disabled = params.row.shipmentsNums === params.row.buyingNums; | ||
135 | + | ||
134 | return ( | 136 | return ( |
135 | <i-input | 137 | <i-input |
136 | value={params.row.num} | 138 | value={params.row.num} |
137 | - onInput={val => (params.row.num = val)}/> | 139 | + onInput={val => (params.row.num = val)} |
140 | + disabled={disabled} | ||
141 | + /> | ||
138 | ); | 142 | ); |
139 | } | 143 | } |
140 | } | 144 | } |
@@ -72,7 +72,7 @@ let tableCols = function() { | @@ -72,7 +72,7 @@ let tableCols = function() { | ||
72 | ); | 72 | ); |
73 | }, | 73 | }, |
74 | renderHeader() { | 74 | renderHeader() { |
75 | - return '发货进度<br/> 已发数/采购数 '; | 75 | + return '发货进度<br/> 已发数/需发总数 '; |
76 | } | 76 | } |
77 | }, | 77 | }, |
78 | 78 | ||
@@ -101,7 +101,7 @@ let tableCols = function() { | @@ -101,7 +101,7 @@ let tableCols = function() { | ||
101 | ); | 101 | ); |
102 | }, | 102 | }, |
103 | renderHeader() { | 103 | renderHeader() { |
104 | - return '入库进度<br/> 已入库数/采购数'; | 104 | + return '入库进度<br/> 已入库数/需发总数'; |
105 | } | 105 | } |
106 | }, | 106 | }, |
107 | 107 |
@@ -112,7 +112,7 @@ let cols = function() { | @@ -112,7 +112,7 @@ let cols = function() { | ||
112 | if (!params.row.hasAdded) { | 112 | if (!params.row.hasAdded) { |
113 | return ( | 113 | return ( |
114 | <div class="action-btn-row"> | 114 | <div class="action-btn-row"> |
115 | - <i-button type='warning' size="small" onClick={() => this.create(params)}> 保存 </i-button> | 115 | + <i-button type='warning' size="small" onClick={() => this.create(params)}> 添加 </i-button> |
116 | </div> | 116 | </div> |
117 | ); | 117 | ); |
118 | } else { | 118 | } else { |
@@ -217,7 +217,7 @@ let infoCols = function() { | @@ -217,7 +217,7 @@ let infoCols = function() { | ||
217 | ); | 217 | ); |
218 | }, | 218 | }, |
219 | renderHeader() { | 219 | renderHeader() { |
220 | - return '入库进度<br/> 已入库数/采购数'; | 220 | + return '入库进度<br/> 已入库数/需发总数'; |
221 | } | 221 | } |
222 | }, | 222 | }, |
223 | ]; | 223 | ]; |
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | * Created by TaoHuang on 2017/5/8. | 2 | * Created by TaoHuang on 2017/5/8. |
3 | */ | 3 | */ |
4 | 4 | ||
5 | -import ProductList from './produc-list'; | 5 | +import ProductList from './product-list'; |
6 | import EditName from './edit-name'; | 6 | import EditName from './edit-name'; |
7 | 7 | ||
8 | export { | 8 | export { |
@@ -218,7 +218,7 @@ | @@ -218,7 +218,7 @@ | ||
218 | if (res.code === 200) { | 218 | if (res.code === 200) { |
219 | this.tableData = res.data.list; | 219 | this.tableData = res.data.list; |
220 | this.pageData.total = res.data.total; | 220 | this.pageData.total = res.data.total; |
221 | - this.pageData.current = res.data.page ; | 221 | + this.pageData.current = res.data.page; |
222 | } | 222 | } |
223 | }); | 223 | }); |
224 | }, | 224 | }, |
-
Please register or login to post a comment