Merge remote-tracking branch 'origin/release/1.0' into release/1.0
Showing
16 changed files
with
193 additions
and
30 deletions
@@ -5,10 +5,10 @@ module.exports = { | @@ -5,10 +5,10 @@ module.exports = { | ||
5 | env: { | 5 | env: { |
6 | NODE_ENV: '"production"' | 6 | NODE_ENV: '"production"' |
7 | }, | 7 | }, |
8 | - index: path.resolve(__dirname, './bundle/index.html'), | 8 | + index: path.resolve(__dirname, '../../server/public/index.html'), |
9 | assetsRoot: path.resolve(__dirname, './bundle'), | 9 | assetsRoot: path.resolve(__dirname, './bundle'), |
10 | assetsSubDirectory: 'static', | 10 | assetsSubDirectory: 'static', |
11 | - assetsPublicPath: '/', | 11 | + assetsPublicPath: 'http://shop-manage.yohobuy.com/', |
12 | productionSourceMap: true, | 12 | productionSourceMap: true, |
13 | productionGzip: false, | 13 | productionGzip: false, |
14 | productionGzipExtensions: ['js', 'css'], | 14 | productionGzipExtensions: ['js', 'css'], |
@@ -3,9 +3,7 @@ | @@ -3,9 +3,7 @@ | ||
3 | v-model="showModal" | 3 | v-model="showModal" |
4 | @on-ok="deliver" | 4 | @on-ok="deliver" |
5 | width="auto" | 5 | width="auto" |
6 | - class-name="deliver-modal" | ||
7 | - cancel-text="取消" | ||
8 | - ok-text="提交"> | 6 | + class-name="deliver-modal"> |
9 | <div class="deliver-modal"> | 7 | <div class="deliver-modal"> |
10 | <Spin v-if="showLoading" fix size="large"></Spin> | 8 | <Spin v-if="showLoading" fix size="large"></Spin> |
11 | <div v-else class="deliver-info"> | 9 | <div v-else class="deliver-info"> |
@@ -34,6 +32,10 @@ | @@ -34,6 +32,10 @@ | ||
34 | </p> | 32 | </p> |
35 | </div> | 33 | </div> |
36 | </div> | 34 | </div> |
35 | + <div slot="footer"> | ||
36 | + <Button type="text" size="large" @click="cancel">取消</Button> | ||
37 | + <Button type="primary" size="large" @click="deliver">提交</Button> | ||
38 | + </div> | ||
37 | </Modal> | 39 | </Modal> |
38 | </template> | 40 | </template> |
39 | 41 | ||
@@ -77,6 +79,9 @@ export default { | @@ -77,6 +79,9 @@ export default { | ||
77 | this.houseList = res.data; | 79 | this.houseList = res.data; |
78 | }); | 80 | }); |
79 | }, | 81 | }, |
82 | + cancel() { | ||
83 | + this.showModal = false; | ||
84 | + }, | ||
80 | deliver() { | 85 | deliver() { |
81 | if (this.submitting) { | 86 | if (this.submitting) { |
82 | return; | 87 | return; |
@@ -295,7 +295,11 @@ | @@ -295,7 +295,11 @@ | ||
295 | </script> | 295 | </script> |
296 | 296 | ||
297 | <style lang="scss"> | 297 | <style lang="scss"> |
298 | - .btn-row-space { | 298 | + .cell-action-row { |
299 | margin-top: 10px; | 299 | margin-top: 10px; |
300 | + | ||
301 | + &:last-child { | ||
302 | + margin-bottom: 10px; | ||
303 | + } | ||
300 | } | 304 | } |
301 | </style> | 305 | </style> |
@@ -216,14 +216,18 @@ export default () => { | @@ -216,14 +216,18 @@ export default () => { | ||
216 | width: 180, | 216 | width: 180, |
217 | align: 'center', | 217 | align: 'center', |
218 | render: function(row) { // eslint-disable-line | 218 | render: function(row) { // eslint-disable-line |
219 | - return `<div class="action-btn-row"> | 219 | + return `<div class="cell-action-row"> |
220 | <i-button type="primary" size="small" @click="editSize(row.productSkn)">尺码维护</i-button> | 220 | <i-button type="primary" size="small" @click="editSize(row.productSkn)">尺码维护</i-button> |
221 | - <i-button type="primary" size="small" @click="editProduct(${row.productSkn})">内容编辑</i-button> | ||
222 | </div> | 221 | </div> |
223 | - <div class="btn-row-space"> | 222 | + <div class="cell-action-row"> |
223 | + <i-button type="primary" size="small" | ||
224 | + @click="editProduct(${row.productSkn})">内容编辑</i-button> | ||
225 | + </div> | ||
226 | + <div class="cell-action-row"> | ||
224 | <i-button v-if="row._disabled" type="success" size="small" | 227 | <i-button v-if="row._disabled" type="success" size="small" |
225 | - @click="setOnSale(${row.productSkn})" disabled>上架</i-button> | ||
226 | - <i-button v-else type="success" size="small" @click="setOnSale(${row.productSkn})">上架</i-button> | 228 | + @click="setOnSale(${row.productSkn})" disabled>商品上架</i-button> |
229 | + <i-button v-else type="success" size="small" | ||
230 | + @click="setOnSale(${row.productSkn})">商品上架</i-button> | ||
227 | </div>`; | 231 | </div>`; |
228 | } | 232 | } |
229 | } | 233 | } |
@@ -289,7 +289,11 @@ | @@ -289,7 +289,11 @@ | ||
289 | </script> | 289 | </script> |
290 | 290 | ||
291 | <style lang="scss"> | 291 | <style lang="scss"> |
292 | - .btn-row-space { | 292 | + .cell-action-row { |
293 | margin-top: 10px; | 293 | margin-top: 10px; |
294 | + | ||
295 | + &:last-child { | ||
296 | + margin-bottom: 10px; | ||
297 | + } | ||
294 | } | 298 | } |
295 | </style> | 299 | </style> |
@@ -91,16 +91,22 @@ export default () => { | @@ -91,16 +91,22 @@ export default () => { | ||
91 | width: 180, | 91 | width: 180, |
92 | align: 'center', | 92 | align: 'center', |
93 | render: function(row) { | 93 | render: function(row) { |
94 | - return `<div class="action-btn-row"> | ||
95 | - <i-button type="primary" size="small" @click="editSize(row.productSkn)">尺码维护</i-button> | ||
96 | - <i-button type="primary" size="small" @click="editProduct(${row.productSkn})">内容编辑</i-button> | 94 | + return `<div class="cell-action-row"> |
95 | + <i-button type="primary" size="small" | ||
96 | + @click="editSize(row.productSkn)">尺码维护</i-button> | ||
97 | </div> | 97 | </div> |
98 | - <div class="btn-row-space"> | 98 | + <div class="cell-action-row"> |
99 | + <i-button type="primary" size="small" | ||
100 | + @click="editProduct(${row.productSkn})">内容编辑</i-button> | ||
101 | + </div> | ||
102 | + <div class="cell-action-row"> | ||
99 | <i-button v-if="row._disabled" type="error" size="small" | 103 | <i-button v-if="row._disabled" type="error" size="small" |
100 | - @click="setOffSale(${row.productSkn})" disabled>下架</i-button> | ||
101 | - <i-button v-else type="error" size="small" @click="setOffSale(${row.productSkn})" >下架</i-button> | 104 | + @click="setOffSale(${row.productSkn})" disabled>商品下架</i-button> |
105 | + <i-button v-else type="error" size="small" | ||
106 | + @click="setOffSale(${row.productSkn})" >商品下架</i-button> | ||
102 | </div>`; | 107 | </div>`; |
103 | - } | 108 | + }, |
109 | + cellClassName: 'cell-action' | ||
104 | } | 110 | } |
105 | ], | 111 | ], |
106 | tableData: [], | 112 | tableData: [], |
@@ -8,7 +8,7 @@ export default () => { | @@ -8,7 +8,7 @@ export default () => { | ||
8 | return { | 8 | return { |
9 | filters: { | 9 | filters: { |
10 | orderNo: { | 10 | orderNo: { |
11 | - label: '入库单号', | 11 | + label: '调拨单号', |
12 | model: '', | 12 | model: '', |
13 | holder: '', | 13 | holder: '', |
14 | }, | 14 | }, |
@@ -93,7 +93,7 @@ export default () => { | @@ -93,7 +93,7 @@ export default () => { | ||
93 | return `<cell-prd-info | 93 | return `<cell-prd-info |
94 | :skn="row.productSkn" | 94 | :skn="row.productSkn" |
95 | :sku="row.productSku" | 95 | :sku="row.productSku" |
96 | - :color="row.colorName" | 96 | + :color="row._colorName" |
97 | :name="row.productName" | 97 | :name="row.productName" |
98 | :brand="row.brandName" | 98 | :brand="row.brandName" |
99 | :price="row.salesPrice" | 99 | :price="row.salesPrice" |
@@ -133,11 +133,26 @@ export default () => { | @@ -133,11 +133,26 @@ export default () => { | ||
133 | align: 'center', | 133 | align: 'center', |
134 | render(row) { | 134 | render(row) { |
135 | let ot = row.isOvertime; | 135 | let ot = row.isOvertime; |
136 | + let status = row.status; | ||
137 | + let type = 1; | ||
138 | + | ||
139 | + const txtMap = { | ||
140 | + 1: '已处理', | ||
141 | + 2: '已处理(超时)', | ||
142 | + 3: '收货完成' | ||
143 | + }; | ||
136 | 144 | ||
137 | ot = ot === 'N' ? true : false; | 145 | ot = ot === 'N' ? true : false; |
146 | + if (status === 2 && !ot) { | ||
147 | + type = 2; | ||
148 | + } | ||
149 | + | ||
150 | + if (status === 3) { | ||
151 | + type = 3; | ||
152 | + } | ||
138 | 153 | ||
139 | - return `<span v-if="${ot}">待处理</span> | ||
140 | - <span v-else class="is-overtime">待处理(超时)</span>`; | 154 | + return `<span v-if="${ot}">${txtMap[type]}</span> |
155 | + <span v-else class="is-overtime">${txtMap[type]}</span>`; | ||
141 | }, | 156 | }, |
142 | className: 'status-cell' | 157 | className: 'status-cell' |
143 | }, | 158 | }, |
@@ -8,7 +8,7 @@ export default () => { | @@ -8,7 +8,7 @@ export default () => { | ||
8 | return { | 8 | return { |
9 | filters: { | 9 | filters: { |
10 | orderNo: { | 10 | orderNo: { |
11 | - label: '入库单号', | 11 | + label: '调拨单号', |
12 | model: '', | 12 | model: '', |
13 | holder: '', | 13 | holder: '', |
14 | }, | 14 | }, |
@@ -89,7 +89,7 @@ export default () => { | @@ -89,7 +89,7 @@ export default () => { | ||
89 | return `<cell-prd-info | 89 | return `<cell-prd-info |
90 | :skn="row.productSkn" | 90 | :skn="row.productSkn" |
91 | :sku="row.productSku" | 91 | :sku="row.productSku" |
92 | - :color="row.colorName" | 92 | + :color="row._colorName" |
93 | :name="row.productName" | 93 | :name="row.productName" |
94 | :brand="row.brandName" | 94 | :brand="row.brandName" |
95 | :price="row.salesPrice" | 95 | :price="row.salesPrice" |
@@ -167,6 +167,7 @@ | @@ -167,6 +167,7 @@ | ||
167 | const list = res.data.records; | 167 | const list = res.data.records; |
168 | 168 | ||
169 | _.each(list, i => { | 169 | _.each(list, i => { |
170 | + i._colorName = i.factoryGoodsName || ''; | ||
170 | i.createTime = moment.unix(i.createTime).format(fmt); | 171 | i.createTime = moment.unix(i.createTime).format(fmt); |
171 | }); | 172 | }); |
172 | 173 |
@@ -175,6 +175,7 @@ | @@ -175,6 +175,7 @@ | ||
175 | _.each(list, (v, i) => { | 175 | _.each(list, (v, i) => { |
176 | v._rowIndex = i; // 当前行index | 176 | v._rowIndex = i; // 当前行index |
177 | v._disabled = v.isOvertime === 'Y'; | 177 | v._disabled = v.isOvertime === 'Y'; |
178 | + v._colorName = v.factoryGoodsName || ''; | ||
178 | v.createTime = moment.unix(v.createTime).format(fmt); | 179 | v.createTime = moment.unix(v.createTime).format(fmt); |
179 | v._needDeliver = v.buyingNums - v.lackNum - v.shipmentsNums; // 当前需发数 | 180 | v._needDeliver = v.buyingNums - v.lackNum - v.shipmentsNums; // 当前需发数 |
180 | }); | 181 | }); |
@@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
2 | <LayoutBody> | 2 | <LayoutBody> |
3 | <div class="detail-header"> | 3 | <div class="detail-header"> |
4 | <Button type="primary" @click="backExpList">返回发货物流表</Button> | 4 | <Button type="primary" @click="backExpList">返回发货物流表</Button> |
5 | + <Button type="primary" @click="print">打印</Button> | ||
5 | <span class="no">物流单号:{{expressNo}}</span> | 6 | <span class="no">物流单号:{{expressNo}}</span> |
6 | <span class="time">发货时间:{{expressTime}}</span> | 7 | <span class="time">发货时间:{{expressTime}}</span> |
7 | </div> | 8 | </div> |
@@ -45,10 +46,10 @@ | @@ -45,10 +46,10 @@ | ||
45 | title: '规格', | 46 | title: '规格', |
46 | align: 'center', | 47 | align: 'center', |
47 | render(row) { | 48 | render(row) { |
48 | - return `${row.colorNama || ''}/${row.size}`; | 49 | + return `${row.colorName || ''}/${row.size}`; |
49 | } | 50 | } |
50 | }, { | 51 | }, { |
51 | - title: '订单号/已发数', | 52 | + title: '调拨单号/已发数', |
52 | align: 'center', | 53 | align: 'center', |
53 | render(row) { | 54 | render(row) { |
54 | let $html = ''; | 55 | let $html = ''; |
@@ -72,6 +73,10 @@ | @@ -72,6 +73,10 @@ | ||
72 | this.expressDetail(); | 73 | this.expressDetail(); |
73 | }, | 74 | }, |
74 | methods: { | 75 | methods: { |
76 | + print(){ | ||
77 | + window.print(); | ||
78 | + | ||
79 | + }, | ||
75 | backExpList() { | 80 | backExpList() { |
76 | this.$router.push({ | 81 | this.$router.push({ |
77 | name: 'trade.allot.express' | 82 | name: 'trade.allot.express' |
@@ -19,6 +19,7 @@ | @@ -19,6 +19,7 @@ | ||
19 | "bluebird": "^3.5.0", | 19 | "bluebird": "^3.5.0", |
20 | "body-parser": "^1.17.1", | 20 | "body-parser": "^1.17.1", |
21 | "compression": "^1.6.2", | 21 | "compression": "^1.6.2", |
22 | + "connect-history-api-fallback": "^1.3.0", | ||
22 | "connect-multiparty": "^2.0.0", | 23 | "connect-multiparty": "^2.0.0", |
23 | "cookie-parser": "^1.4.3", | 24 | "cookie-parser": "^1.4.3", |
24 | "cookie-session": "^2.0.0-beta.1", | 25 | "cookie-session": "^2.0.0-beta.1", |
@@ -9,6 +9,7 @@ const bodyParser = require('body-parser'); | @@ -9,6 +9,7 @@ const bodyParser = require('body-parser'); | ||
9 | const cookieParser = require('cookie-parser'); | 9 | const cookieParser = require('cookie-parser'); |
10 | const compression = require('compression'); | 10 | const compression = require('compression'); |
11 | const Express = require('express'); | 11 | const Express = require('express'); |
12 | +const history = require('./framework/history-api-fallback'); | ||
12 | 13 | ||
13 | // const session = require('express-session'); | 14 | // const session = require('express-session'); |
14 | const cookieSession = require('cookie-session'); | 15 | const cookieSession = require('cookie-session'); |
@@ -30,7 +31,12 @@ global.yoho = { | @@ -30,7 +31,12 @@ global.yoho = { | ||
30 | apiDomain: config.apiDomain, | 31 | apiDomain: config.apiDomain, |
31 | co: global.Promise.coroutine | 32 | co: global.Promise.coroutine |
32 | }; | 33 | }; |
33 | - | 34 | +app.use(history({ |
35 | + disableIndex: true, | ||
36 | + rewrites: [ | ||
37 | + { from: /\.html/, to: '/index.html'} | ||
38 | + ] | ||
39 | +})); | ||
34 | app.use(cookieSession({ | 40 | app.use(cookieSession({ |
35 | name: 'yoho-shop', | 41 | name: 'yoho-shop', |
36 | secret: 'yoho!shop@manage', | 42 | secret: 'yoho!shop@manage', |
server/framework/history-api-fallback.js
0 → 100644
1 | +/* eslint-disable */ | ||
2 | +var url = require('url'); | ||
3 | + | ||
4 | +exports = module.exports = function historyApiFallback(options) { | ||
5 | + options = options || {}; | ||
6 | + var logger = getLogger(options); | ||
7 | + | ||
8 | + return function (req, res, next) { | ||
9 | + var headers = req.headers; | ||
10 | + if (req.method !== 'GET') { | ||
11 | + logger( | ||
12 | + 'Not rewriting', | ||
13 | + req.method, | ||
14 | + req.url, | ||
15 | + 'because the method is not GET.' | ||
16 | + ); | ||
17 | + return next(); | ||
18 | + } else if (!headers || typeof headers.accept !== 'string') { | ||
19 | + logger( | ||
20 | + 'Not rewriting', | ||
21 | + req.method, | ||
22 | + req.url, | ||
23 | + 'because the client did not send an HTTP accept header.' | ||
24 | + ); | ||
25 | + return next(); | ||
26 | + } else if (headers.accept.indexOf('application/json') === 0) { | ||
27 | + logger( | ||
28 | + 'Not rewriting', | ||
29 | + req.method, | ||
30 | + req.url, | ||
31 | + 'because the client prefers JSON.' | ||
32 | + ); | ||
33 | + return next(); | ||
34 | + } else if (!acceptsHtml(headers.accept, options)) { | ||
35 | + logger( | ||
36 | + 'Not rewriting', | ||
37 | + req.method, | ||
38 | + req.url, | ||
39 | + 'because the client does not accept HTML.' | ||
40 | + ); | ||
41 | + return next(); | ||
42 | + } | ||
43 | + | ||
44 | + var parsedUrl = url.parse(req.url); | ||
45 | + var rewriteTarget; | ||
46 | + options.rewrites = options.rewrites || []; | ||
47 | + | ||
48 | + for (var i = 0; i < options.rewrites.length; i++) { | ||
49 | + var rewrite = options.rewrites[i]; | ||
50 | + var match = parsedUrl.pathname.match(rewrite.from); | ||
51 | + if (match !== null) { | ||
52 | + rewriteTarget = evaluateRewriteRule(parsedUrl, match, rewrite.to); | ||
53 | + logger('Rewriting', req.method, req.url, 'to', rewriteTarget); | ||
54 | + req.url = rewriteTarget; | ||
55 | + return next(); | ||
56 | + } | ||
57 | + } | ||
58 | + | ||
59 | + if (parsedUrl.pathname.indexOf('.') !== -1 && | ||
60 | + options.disableDotRule !== true) { | ||
61 | + logger( | ||
62 | + 'Not rewriting', | ||
63 | + req.method, | ||
64 | + req.url, | ||
65 | + 'because the path includes a dot (.) character.' | ||
66 | + ); | ||
67 | + return next(); | ||
68 | + } | ||
69 | + | ||
70 | + if (options.disableIndex) { | ||
71 | + return next(); | ||
72 | + } | ||
73 | + | ||
74 | + rewriteTarget = options.index || '/index.html'; | ||
75 | + logger('Rewriting', req.method, req.url, 'to', rewriteTarget); | ||
76 | + req.url = rewriteTarget; | ||
77 | + next(); | ||
78 | + }; | ||
79 | +}; | ||
80 | + | ||
81 | +function evaluateRewriteRule(parsedUrl, match, rule) { | ||
82 | + if (typeof rule === 'string') { | ||
83 | + return rule; | ||
84 | + } else if (typeof rule !== 'function') { | ||
85 | + throw new Error('Rewrite rule can only be of type string of function.'); | ||
86 | + } | ||
87 | + | ||
88 | + return rule({ | ||
89 | + parsedUrl: parsedUrl, | ||
90 | + match: match | ||
91 | + }); | ||
92 | +} | ||
93 | + | ||
94 | +function acceptsHtml(header, options) { | ||
95 | + options.htmlAcceptHeaders = options.htmlAcceptHeaders || ['text/html', '*/*']; | ||
96 | + for (var i = 0; i < options.htmlAcceptHeaders.length; i++) { | ||
97 | + if (header.indexOf(options.htmlAcceptHeaders[i]) !== -1) { | ||
98 | + return true; | ||
99 | + } | ||
100 | + } | ||
101 | + return false; | ||
102 | +} | ||
103 | + | ||
104 | +function getLogger(options) { | ||
105 | + if (options && options.logger) { | ||
106 | + return options.logger; | ||
107 | + } else if (options && options.verbose) { | ||
108 | + return console.log.bind(console); | ||
109 | + } | ||
110 | + return function () { }; | ||
111 | +} |
-
Please register or login to post a comment