Merge branch 'release/1.0' of http://git.yoho.cn/fe/yoho-shop-manage into release/1.0
Showing
15 changed files
with
128 additions
and
78 deletions
@@ -4,20 +4,16 @@ import yohoPluginCore from './plugins/yoho-plugin-core'; | @@ -4,20 +4,16 @@ import yohoPluginCore from './plugins/yoho-plugin-core'; | ||
4 | import yohoPluginRouter from './plugins/yoho-plugin-router'; | 4 | import yohoPluginRouter from './plugins/yoho-plugin-router'; |
5 | import yohoPluginAuth from './plugins/yoho-plugin-auth'; | 5 | import yohoPluginAuth from './plugins/yoho-plugin-auth'; |
6 | import yohoPluginBus from './plugins/yoho-plugin-bus'; | 6 | import yohoPluginBus from './plugins/yoho-plugin-bus'; |
7 | -import yohoPluginHelper from './plugins/yoho-plugin-helper'; | ||
8 | 7 | ||
9 | import './filters'; | 8 | import './filters'; |
10 | import './directives'; | 9 | import './directives'; |
11 | import 'iview/dist/styles/iview.css'; | 10 | import 'iview/dist/styles/iview.css'; |
12 | import 'font-awesome/css/font-awesome.css'; | 11 | import 'font-awesome/css/font-awesome.css'; |
13 | 12 | ||
14 | - | ||
15 | - | ||
16 | Vue.use(yohoPluginCore); | 13 | Vue.use(yohoPluginCore); |
17 | Vue.use(yohoPluginRouter); | 14 | Vue.use(yohoPluginRouter); |
18 | Vue.use(yohoPluginAuth); | 15 | Vue.use(yohoPluginAuth); |
19 | Vue.use(yohoPluginBus); | 16 | Vue.use(yohoPluginBus); |
20 | -Vue.use(yohoPluginHelper); | ||
21 | 17 | ||
22 | Vue.render({ | 18 | Vue.render({ |
23 | el: '#app', | 19 | el: '#app', |
@@ -85,8 +85,8 @@ export default { | @@ -85,8 +85,8 @@ export default { | ||
85 | key: 'image', | 85 | key: 'image', |
86 | render(row){ | 86 | render(row){ |
87 | return `<div> | 87 | return `<div> |
88 | - <img :src="$helper.sknImage({sku: ${row.productSku}})"> | ||
89 | - </div>` | 88 | + <img v-prod-img.sku="row.productSku"> |
89 | + </div>`; | ||
90 | } | 90 | } |
91 | }, | 91 | }, |
92 | { | 92 | { |
app/directives/prodImage.js
0 → 100644
1 | +/** | ||
2 | + * Created by TaoHuang on 2017/5/12. | ||
3 | + */ | ||
4 | +import _ from 'lodash'; | ||
5 | + | ||
6 | +function sknImage ({skn, sku, size}) { | ||
7 | + let baseUrl = '/Api/platform/getRemoteImageUrlBySku'; | ||
8 | + let params = []; | ||
9 | + | ||
10 | + if (skn) { | ||
11 | + params.push(`skn_id=${skn}`); | ||
12 | + } | ||
13 | + | ||
14 | + if (sku) { | ||
15 | + params.push(`sku_id=${sku}`); | ||
16 | + } | ||
17 | + | ||
18 | + params.push(size ? `size=${size}` : 'size=80x80'); | ||
19 | + | ||
20 | + return `${baseUrl}?${params.join('&')}`; | ||
21 | +} | ||
22 | + | ||
23 | +export default { | ||
24 | + bind (el, binding) { | ||
25 | + // v-prod-img.skn="{ val: 'fdsa', size: '121X123'}" skn | ||
26 | + // v-prod-img.sku="{ val: 'fdsa', size: '121X123'}" sku | ||
27 | + // v-prod-img.sku="row.productSkn" sku | ||
28 | + // v-prod-img.skn="row.productSkn" skn | ||
29 | + // v-prod-img="row.productSkn" skn | ||
30 | + | ||
31 | + let data = null; | ||
32 | + let key = null; | ||
33 | + | ||
34 | + if (!_.isEmpty(binding.modifiers)) { | ||
35 | + key = _.first(_.keys(binding.modifiers)); | ||
36 | + } else { | ||
37 | + key = 'skn'; | ||
38 | + } | ||
39 | + | ||
40 | + if (_.isPlainObject(binding.value)) { | ||
41 | + data = { | ||
42 | + [key]: binding.value.val, | ||
43 | + size: binding.value.size | ||
44 | + }; | ||
45 | + } else { | ||
46 | + data = { | ||
47 | + [key]: binding.value | ||
48 | + } | ||
49 | + } | ||
50 | + | ||
51 | + el.src = sknImage(data); | ||
52 | + } | ||
53 | +} |
@@ -13,7 +13,8 @@ | @@ -13,7 +13,8 @@ | ||
13 | <Row> | 13 | <Row> |
14 | <Col> | 14 | <Col> |
15 | <div class="create-item-title">商品颜色主图 | 15 | <div class="create-item-title">商品颜色主图 |
16 | - <span class="create-group-sub-title">(商品正面图默认为用户选择商品颜色和展示使用。用户从不同频道查看商品,优先展示频道封面图)</span> | 16 | + <span class="create-group-sub-title">(商品正面图默认为用户选择商品颜色和展示使用。用户从不同频道查看商品,优先展示频道封面图)<a |
17 | + href="javascript: void 0;" @click="onClickShowExample">查看色卡图片示例</a></span> | ||
17 | </div> | 18 | </div> |
18 | </Col> | 19 | </Col> |
19 | </Row> | 20 | </Row> |
@@ -207,6 +208,13 @@ | @@ -207,6 +208,13 @@ | ||
207 | </div> | 208 | </div> |
208 | </Col> | 209 | </Col> |
209 | </Row> | 210 | </Row> |
211 | + | ||
212 | + <Modal | ||
213 | + v-model="showExample" | ||
214 | + title="色卡图片示例"> | ||
215 | + <p>自定义宽度,单位 px,默认 520px。</p> | ||
216 | + <p>对话框的宽度是响应式的,当屏幕尺寸小于 768px 时,宽度会变为自动<code>auto</code>。</p> | ||
217 | + </Modal> | ||
210 | </div> | 218 | </div> |
211 | </template> | 219 | </template> |
212 | 220 | ||
@@ -227,7 +235,8 @@ export default { | @@ -227,7 +235,8 @@ export default { | ||
227 | attributeProValuesOne: [], | 235 | attributeProValuesOne: [], |
228 | attributeProValuesTwo: [], | 236 | attributeProValuesTwo: [], |
229 | productMaterial: {} | 237 | productMaterial: {} |
230 | - } | 238 | + }, |
239 | + showExample: false | ||
231 | }; | 240 | }; |
232 | }, | 241 | }, |
233 | mounted: function() { | 242 | mounted: function() { |
@@ -312,6 +321,10 @@ export default { | @@ -312,6 +321,10 @@ export default { | ||
312 | let imageIndex = data.imageIndex; | 321 | let imageIndex = data.imageIndex; |
313 | 322 | ||
314 | this.product.goods[colorIndex].goodsImage[imageIndex].imageUrl = ''; | 323 | this.product.goods[colorIndex].goodsImage[imageIndex].imageUrl = ''; |
324 | + }, | ||
325 | + onClickShowExample: function() { | ||
326 | + console.log('fdsad'); | ||
327 | + this.showExample = true; | ||
315 | } | 328 | } |
316 | } | 329 | } |
317 | }; | 330 | }; |
@@ -15,9 +15,7 @@ let tableCols = [ | @@ -15,9 +15,7 @@ let tableCols = [ | ||
15 | key: 'image', | 15 | key: 'image', |
16 | align: 'center', | 16 | align: 'center', |
17 | render(row) { | 17 | render(row) { |
18 | - return `<div> | ||
19 | - <img :src="$helper.sknImage({skn: ${row.productSkn}})"> | ||
20 | - </div>` | 18 | + return `<div> <img v-prod-img="row.productSkn"> </div>` |
21 | } | 19 | } |
22 | }, | 20 | }, |
23 | { | 21 | { |
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | <div class="cell-deliver"> | 2 | <div class="cell-deliver"> |
3 | <p class="row"> | 3 | <p class="row"> |
4 | 发货<span class="num"> | 4 | 发货<span class="num"> |
5 | - <Input v-if="rowDisabled" placeholder="数量" disabled></Input> | 5 | + <Input v-if="rowDisabled || changeDisabled" v-model="deliver" placeholder="数量" disabled></Input> |
6 | <Input v-else v-model="deliver" placeholder="数量"></Input> | 6 | <Input v-else v-model="deliver" placeholder="数量"></Input> |
7 | </span> | 7 | </span> |
8 | </p> | 8 | </p> |
@@ -14,6 +14,9 @@ | @@ -14,6 +14,9 @@ | ||
14 | export default { | 14 | export default { |
15 | name: 'CellDeliver', | 15 | name: 'CellDeliver', |
16 | props: { | 16 | props: { |
17 | + changeDisabled: { | ||
18 | + default: false | ||
19 | + }, | ||
17 | rowDisabled: { | 20 | rowDisabled: { |
18 | type: Boolean | 21 | type: Boolean |
19 | }, | 22 | }, |
@@ -2,8 +2,8 @@ | @@ -2,8 +2,8 @@ | ||
2 | <div class="cell-info"> | 2 | <div class="cell-info"> |
3 | <span class="item">销售数:{{buyNum}}</span> | 3 | <span class="item">销售数:{{buyNum}}</span> |
4 | <span class="item">实际应发数:{{actualNeed}}</span> | 4 | <span class="item">实际应发数:{{actualNeed}}</span> |
5 | - <span class="item">当前需发数:{{currentNeed}}</span> | ||
6 | - <span class="item">收货数:{{storeNum}}</span> | 5 | + <span class="item darker">当前需发数:{{currentNeed}}</span> |
6 | + <span v-if="showStore" class="item">收货数:{{storeNum}}</span> | ||
7 | </div> | 7 | </div> |
8 | </template> | 8 | </template> |
9 | 9 | ||
@@ -11,6 +11,9 @@ | @@ -11,6 +11,9 @@ | ||
11 | export default { | 11 | export default { |
12 | name: 'CellDispatch', | 12 | name: 'CellDispatch', |
13 | props: { | 13 | props: { |
14 | + showStore: { | ||
15 | + default: false | ||
16 | + }, | ||
14 | storeNum: { | 17 | storeNum: { |
15 | type: [String, Number] | 18 | type: [String, Number] |
16 | }, | 19 | }, |
@@ -46,6 +49,11 @@ | @@ -46,6 +49,11 @@ | ||
46 | 49 | ||
47 | .item { | 50 | .item { |
48 | display: block; | 51 | display: block; |
52 | + | ||
53 | + &.darker { | ||
54 | + font-weight: bold; | ||
55 | + color: #000000; | ||
56 | + } | ||
49 | } | 57 | } |
50 | } | 58 | } |
51 | 59 |
@@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
6 | <Input v-else v-model="uploadNum" placeholder="数量"></Input> | 6 | <Input v-else v-model="uploadNum" placeholder="数量"></Input> |
7 | </span> | 7 | </span> |
8 | </p> | 8 | </p> |
9 | - <p class="row">缺货数:{{lackNum}}</p> | 9 | + <p class="row" :class="{highlight: lackNum > 0}">缺货数:{{lackNum}}</p> |
10 | <p class="row"> | 10 | <p class="row"> |
11 | <Button v-if="rowDisabled" type="error" @click="showModal" disabled>上传确认缺货</Button> | 11 | <Button v-if="rowDisabled" type="error" @click="showModal" disabled>上传确认缺货</Button> |
12 | <Button v-else type="error" @click="showModal">上传确认缺货</Button> | 12 | <Button v-else type="error" @click="showModal">上传确认缺货</Button> |
@@ -57,6 +57,11 @@ | @@ -57,6 +57,11 @@ | ||
57 | 57 | ||
58 | .row { | 58 | .row { |
59 | margin: 10px 0; | 59 | margin: 10px 0; |
60 | + | ||
61 | + &.highlight { | ||
62 | + color: #ff0000; | ||
63 | + font-weight: bold; | ||
64 | + } | ||
60 | } | 65 | } |
61 | 66 | ||
62 | .num { | 67 | .num { |
@@ -67,11 +67,6 @@ export default () => { | @@ -67,11 +67,6 @@ export default () => { | ||
67 | table: { | 67 | table: { |
68 | cols: [ | 68 | cols: [ |
69 | { | 69 | { |
70 | - type: 'selection', | ||
71 | - width: 60, | ||
72 | - align: 'center' | ||
73 | - }, | ||
74 | - { | ||
75 | title: '下单时间', | 70 | title: '下单时间', |
76 | key: 'createTime', | 71 | key: 'createTime', |
77 | align: 'center' | 72 | align: 'center' |
@@ -81,8 +76,8 @@ export default () => { | @@ -81,8 +76,8 @@ export default () => { | ||
81 | align: 'center', | 76 | align: 'center', |
82 | render(row){ | 77 | render(row){ |
83 | return `<div> | 78 | return `<div> |
84 | - <img :src="$helper.sknImage({sku: ${row.productSku}})"> | ||
85 | - </div>` | 79 | + <img v-prod-img.sku="row.productSku"> |
80 | + </div>`; | ||
86 | } | 81 | } |
87 | }, | 82 | }, |
88 | { | 83 | { |
@@ -135,8 +130,9 @@ export default () => { | @@ -135,8 +130,9 @@ export default () => { | ||
135 | ot = ot === 'N' ? true : false; | 130 | ot = ot === 'N' ? true : false; |
136 | 131 | ||
137 | return `<span v-if="${ot}">待处理</span> | 132 | return `<span v-if="${ot}">待处理</span> |
138 | - <span v-else>待处理(超时)</span>`; | ||
139 | - } | 133 | + <span v-else class="is-overtime">待处理(超时)</span>`; |
134 | + }, | ||
135 | + className: 'status-cell' | ||
140 | }, | 136 | }, |
141 | { | 137 | { |
142 | title: '入库单号', | 138 | title: '入库单号', |
@@ -72,8 +72,8 @@ export default () => { | @@ -72,8 +72,8 @@ export default () => { | ||
72 | align: 'center', | 72 | align: 'center', |
73 | render(row){ | 73 | render(row){ |
74 | return `<div> | 74 | return `<div> |
75 | - <img :src="$helper.sknImage({sku: ${row.productSku}})"> | ||
76 | - </div>` | 75 | + <img v-prod-img.sku="row.productSku"> |
76 | + </div>`; | ||
77 | } | 77 | } |
78 | }, | 78 | }, |
79 | { | 79 | { |
@@ -95,7 +95,8 @@ export default () => { | @@ -95,7 +95,8 @@ export default () => { | ||
95 | title: '订单收发货', | 95 | title: '订单收发货', |
96 | align: 'center', | 96 | align: 'center', |
97 | render(row){ | 97 | render(row){ |
98 | - return `<cell-dispatch | 98 | + return `<cell-dispatch |
99 | + :show-store="true" | ||
99 | :store-num="row.inStoreNum" | 100 | :store-num="row.inStoreNum" |
100 | :buy-num="row.buyingNums" | 101 | :buy-num="row.buyingNums" |
101 | :ship-num="row.shipmentsNums" | 102 | :ship-num="row.shipmentsNums" |
@@ -109,6 +110,7 @@ export default () => { | @@ -109,6 +110,7 @@ export default () => { | ||
109 | render(row, column, i){ | 110 | render(row, column, i){ |
110 | return `<cell-deliver | 111 | return `<cell-deliver |
111 | :row-index="${i}" | 112 | :row-index="${i}" |
113 | + :change-disabled="${row._changeDisabled}" | ||
112 | :row-disabled="${row._disabled}" | 114 | :row-disabled="${row._disabled}" |
113 | :ship-num="row.shipmentsNums" | 115 | :ship-num="row.shipmentsNums" |
114 | @deliver-change="deliverChange"> | 116 | @deliver-change="deliverChange"> |
@@ -136,8 +138,9 @@ export default () => { | @@ -136,8 +138,9 @@ export default () => { | ||
136 | ot = ot === 'N' ? true : false; | 138 | ot = ot === 'N' ? true : false; |
137 | 139 | ||
138 | return `<span v-if="${ot}">待处理</span> | 140 | return `<span v-if="${ot}">待处理</span> |
139 | - <span v-else>待处理(超时)</span>`; | ||
140 | - } | 141 | + <span v-else class="is-overtime">待处理(超时)</span>`; |
142 | + }, | ||
143 | + className: 'status-cell' | ||
141 | }, | 144 | }, |
142 | { | 145 | { |
143 | title: '入库单号', | 146 | title: '入库单号', |
@@ -3,15 +3,15 @@ | @@ -3,15 +3,15 @@ | ||
3 | <LayoutFilter> | 3 | <LayoutFilter> |
4 | <FilterItem :label="filters.orderNo.label"> | 4 | <FilterItem :label="filters.orderNo.label"> |
5 | <Input v-model.trim="filters.orderNo.model" | 5 | <Input v-model.trim="filters.orderNo.model" |
6 | - :placeholder="filters.orderNo.holder" number></Input> | 6 | + :placeholder="filters.orderNo.holder"></Input> |
7 | </FilterItem> | 7 | </FilterItem> |
8 | <FilterItem :label="filters.expressNo.label"> | 8 | <FilterItem :label="filters.expressNo.label"> |
9 | <Input v-model.trim="filters.expressNo.model" | 9 | <Input v-model.trim="filters.expressNo.model" |
10 | - :placeholder="filters.expressNo.holder" number></Input> | 10 | + :placeholder="filters.expressNo.holder"></Input> |
11 | </FilterItem> | 11 | </FilterItem> |
12 | <FilterItem :label="filters.prodCode.label"> | 12 | <FilterItem :label="filters.prodCode.label"> |
13 | <Input v-model.trim="filters.prodCode.model" | 13 | <Input v-model.trim="filters.prodCode.model" |
14 | - :placeholder="filters.prodCode.holder" number></Input> | 14 | + :placeholder="filters.prodCode.holder"></Input> |
15 | </FilterItem> | 15 | </FilterItem> |
16 | <FilterItem :label="filters.merChantCode.label"> | 16 | <FilterItem :label="filters.merChantCode.label"> |
17 | <Input v-model.trim="filters.merChantCode.model" | 17 | <Input v-model.trim="filters.merChantCode.model" |
@@ -195,4 +195,11 @@ | @@ -195,4 +195,11 @@ | ||
195 | background-color: #2db7f5; | 195 | background-color: #2db7f5; |
196 | color: #fff; | 196 | color: #fff; |
197 | } | 197 | } |
198 | + | ||
199 | + .status-cell { | ||
200 | + .is-overtime { | ||
201 | + color: #ff0000; | ||
202 | + font-weight: bold; | ||
203 | + } | ||
204 | + } | ||
198 | </style> | 205 | </style> |
@@ -3,11 +3,11 @@ | @@ -3,11 +3,11 @@ | ||
3 | <LayoutFilter> | 3 | <LayoutFilter> |
4 | <FilterItem :label="filters.orderNo.label"> | 4 | <FilterItem :label="filters.orderNo.label"> |
5 | <Input v-model.trim="filters.orderNo.model" | 5 | <Input v-model.trim="filters.orderNo.model" |
6 | - :placeholder="filters.orderNo.holder" number></Input> | 6 | + :placeholder="filters.orderNo.holder"></Input> |
7 | </FilterItem> | 7 | </FilterItem> |
8 | <FilterItem :label="filters.prodCode.label"> | 8 | <FilterItem :label="filters.prodCode.label"> |
9 | <Input v-model.trim="filters.prodCode.model" | 9 | <Input v-model.trim="filters.prodCode.model" |
10 | - :placeholder="filters.prodCode.holder" number></Input> | 10 | + :placeholder="filters.prodCode.holder"></Input> |
11 | </FilterItem> | 11 | </FilterItem> |
12 | <FilterItem :label="filters.merChantCode.label"> | 12 | <FilterItem :label="filters.merChantCode.label"> |
13 | <Input v-model.trim="filters.merChantCode.model" | 13 | <Input v-model.trim="filters.merChantCode.model" |
@@ -181,6 +181,7 @@ | @@ -181,6 +181,7 @@ | ||
181 | this.page.current = page; | 181 | this.page.current = page; |
182 | }, | 182 | }, |
183 | selectChange(rows){ | 183 | selectChange(rows){ |
184 | + this.table.list[0]._changeDisabled = true; | ||
184 | this.deliverRows = rows; | 185 | this.deliverRows = rows; |
185 | }, | 186 | }, |
186 | deliverChange(data) { | 187 | deliverChange(data) { |
@@ -257,7 +258,6 @@ | @@ -257,7 +258,6 @@ | ||
257 | this.$refs.stockOutModal.show(row); | 258 | this.$refs.stockOutModal.show(row); |
258 | }, | 259 | }, |
259 | uploadSuccess() { | 260 | uploadSuccess() { |
260 | - console.log('uploadsuccess') | ||
261 | this.$Message.success('上传缺货成功'); | 261 | this.$Message.success('上传缺货成功'); |
262 | this.productList(this.params()); | 262 | this.productList(this.params()); |
263 | this.page.current = 1; | 263 | this.page.current = 1; |
@@ -284,4 +284,11 @@ | @@ -284,4 +284,11 @@ | ||
284 | .ivu-table .over-time td{ | 284 | .ivu-table .over-time td{ |
285 | background-color: #fcecec; | 285 | background-color: #fcecec; |
286 | } | 286 | } |
287 | + | ||
288 | + .status-cell { | ||
289 | + .is-overtime { | ||
290 | + color: #ff0000; | ||
291 | + font-weight: bold; | ||
292 | + } | ||
293 | + } | ||
287 | </style> | 294 | </style> |
@@ -34,7 +34,7 @@ | @@ -34,7 +34,7 @@ | ||
34 | align: 'center', | 34 | align: 'center', |
35 | render(row){ | 35 | render(row){ |
36 | return `<div> | 36 | return `<div> |
37 | - <img :src="$helper.sknImage({sku: ${row.productSku}})"> | 37 | + <img v-prod-img.sku="row.sku"> |
38 | </div>` | 38 | </div>` |
39 | } | 39 | } |
40 | },{ | 40 | },{ |
@@ -45,7 +45,7 @@ | @@ -45,7 +45,7 @@ | ||
45 | title: '规格', | 45 | title: '规格', |
46 | align: 'center', | 46 | align: 'center', |
47 | render(row) { | 47 | render(row) { |
48 | - return `${row.colorName}/${row.size}` | 48 | + return `${row.colorNama || ''}/${row.size}` |
49 | } | 49 | } |
50 | },{ | 50 | },{ |
51 | title: '订单号/已发数', | 51 | title: '订单号/已发数', |
app/plugins/yoho-plugin-helper.js
deleted
100644 → 0
1 | -/** | ||
2 | - * Created by TaoHuang on 2017/5/11. | ||
3 | - */ | ||
4 | - | ||
5 | -/** | ||
6 | - * 使用skn ,sku 拿到商品图片 | ||
7 | - * @param skn | ||
8 | - * @param sku | ||
9 | - * @param size | ||
10 | - * @returns {string} | ||
11 | - */ | ||
12 | -function sknImage ({skn, sku, size}) { | ||
13 | - let baseUrl = '/Api/platform/getRemoteImageUrlBySku'; | ||
14 | - let params = []; | ||
15 | - | ||
16 | - if (skn) { | ||
17 | - params.push(`skn_id=${skn}`); | ||
18 | - } | ||
19 | - | ||
20 | - if (sku) { | ||
21 | - params.push(`sku_id=${sku}`); | ||
22 | - } | ||
23 | - | ||
24 | - params.push(size ? `size=${size}` : 'size=80x80'); | ||
25 | - | ||
26 | - return `${baseUrl}?${params.join('&')}`; | ||
27 | -} | ||
28 | - | ||
29 | -let helper = { | ||
30 | - install(vue) { | ||
31 | - Object.defineProperty(vue.prototype, '$helper', { | ||
32 | - get(){ | ||
33 | - return { | ||
34 | - sknImage | ||
35 | - } | ||
36 | - } | ||
37 | - }); | ||
38 | - } | ||
39 | -}; | ||
40 | - | ||
41 | -export default helper; |
-
Please register or login to post a comment