Authored by htoooth

Merge remote-tracking branch 'origin/release/1.0' into release/1.0

.DS_Store
.idea
app/build/bundle
server/public/
node_modules/
*.log
.eslintcache
app/bundle
\ No newline at end of file
app/bundle
server/public/*.html
\ No newline at end of file
... ...
... ... @@ -5,10 +5,10 @@ module.exports = {
env: {
NODE_ENV: '"production"'
},
index: path.resolve(__dirname, './bundle/index.html'),
index: path.resolve(__dirname, '../../server/public/index.html'),
assetsRoot: path.resolve(__dirname, './bundle'),
assetsSubDirectory: 'static',
assetsPublicPath: '/',
assetsPublicPath: 'http://shop-manage.yohobuy.com/',
productionSourceMap: true,
productionGzip: false,
productionGzipExtensions: ['js', 'css'],
... ...
... ... @@ -3,9 +3,7 @@
v-model="showModal"
@on-ok="deliver"
width="auto"
class-name="deliver-modal"
cancel-text="取消"
ok-text="提交">
class-name="deliver-modal">
<div class="deliver-modal">
<Spin v-if="showLoading" fix size="large"></Spin>
<div v-else class="deliver-info">
... ... @@ -34,6 +32,10 @@
</p>
</div>
</div>
<div slot="footer">
<Button type="text" size="large" @click="cancel">取消</Button>
<Button type="primary" size="large" @click="deliver">提交</Button>
</div>
</Modal>
</template>
... ... @@ -77,6 +79,9 @@ export default {
this.houseList = res.data;
});
},
cancel() {
this.showModal = false;
},
deliver() {
if (this.submitting) {
return;
... ...
... ... @@ -295,7 +295,11 @@
</script>
<style lang="scss">
.btn-row-space {
.cell-action-row {
margin-top: 10px;
&:last-child {
margin-bottom: 10px;
}
}
</style>
... ...
... ... @@ -216,15 +216,19 @@ export default () => {
width: 180,
align: 'center',
render: function(row) { // eslint-disable-line
return `<div class="action-btn-row">
<i-button type="primary" size="small" @click="editSize(row.productSkn)">尺码维护</i-button>
<i-button type="primary" size="small" @click="editProduct(${row.productSkn})">内容编辑</i-button>
</div>
<div class="btn-row-space">
<i-button v-if="row._disabled" type="success" size="small"
@click="setOnSale(${row.productSkn})" disabled>上架</i-button>
<i-button v-else type="success" size="small" @click="setOnSale(${row.productSkn})">上架</i-button>
</div>`;
return `<div class="cell-action-row">
<i-button type="primary" size="small" @click="editSize(row.productSkn)">尺码维护</i-button>
</div>
<div class="cell-action-row">
<i-button type="primary" size="small"
@click="editProduct(${row.productSkn})">内容编辑</i-button>
</div>
<div class="cell-action-row">
<i-button v-if="row._disabled" type="success" size="small"
@click="setOnSale(${row.productSkn})" disabled>商品上架</i-button>
<i-button v-else type="success" size="small"
@click="setOnSale(${row.productSkn})">商品上架</i-button>
</div>`;
}
}
],
... ...
... ... @@ -289,7 +289,11 @@
</script>
<style lang="scss">
.btn-row-space {
.cell-action-row {
margin-top: 10px;
&:last-child {
margin-bottom: 10px;
}
}
</style>
... ...
... ... @@ -91,16 +91,22 @@ export default () => {
width: 180,
align: 'center',
render: function(row) {
return `<div class="action-btn-row">
<i-button type="primary" size="small" @click="editSize(row.productSkn)">尺码维护</i-button>
<i-button type="primary" size="small" @click="editProduct(${row.productSkn})">内容编辑</i-button>
</div>
<div class="btn-row-space">
<i-button v-if="row._disabled" type="error" size="small"
@click="setOffSale(${row.productSkn})" disabled>下架</i-button>
<i-button v-else type="error" size="small" @click="setOffSale(${row.productSkn})" >下架</i-button>
</div>`;
}
return `<div class="cell-action-row">
<i-button type="primary" size="small"
@click="editSize(row.productSkn)">尺码维护</i-button>
</div>
<div class="cell-action-row">
<i-button type="primary" size="small"
@click="editProduct(${row.productSkn})">内容编辑</i-button>
</div>
<div class="cell-action-row">
<i-button v-if="row._disabled" type="error" size="small"
@click="setOffSale(${row.productSkn})" disabled>商品下架</i-button>
<i-button v-else type="error" size="small"
@click="setOffSale(${row.productSkn})" >商品下架</i-button>
</div>`;
},
cellClassName: 'cell-action'
}
],
tableData: [],
... ...
... ... @@ -8,7 +8,7 @@ export default () => {
return {
filters: {
orderNo: {
label: '入库单号',
label: '调拨单号',
model: '',
holder: '',
},
... ... @@ -93,7 +93,7 @@ export default () => {
return `<cell-prd-info
:skn="row.productSkn"
:sku="row.productSku"
:color="row.colorName"
:color="row._colorName"
:name="row.productName"
:brand="row.brandName"
:price="row.salesPrice"
... ... @@ -133,11 +133,26 @@ export default () => {
align: 'center',
render(row) {
let ot = row.isOvertime;
let status = row.status;
let type = 1;
const txtMap = {
1: '已处理',
2: '已处理(超时)',
3: '收货完成'
};
ot = ot === 'N' ? true : false;
if (status === 2 && !ot) {
type = 2;
}
if (status === 3) {
type = 3;
}
return `<span v-if="${ot}">待处理</span>
<span v-else class="is-overtime">待处理(超时)</span>`;
return `<span v-if="${ot}">${txtMap[type]}</span>
<span v-else class="is-overtime">${txtMap[type]}</span>`;
},
className: 'status-cell'
},
... ...
... ... @@ -8,7 +8,7 @@ export default () => {
return {
filters: {
orderNo: {
label: '入库单号',
label: '调拨单号',
model: '',
holder: '',
},
... ...
... ... @@ -8,7 +8,7 @@ export default () => {
return {
filters: {
orderNo: {
label: '入库单号',
label: '调拨单号',
model: '',
holder: '',
},
... ... @@ -89,7 +89,7 @@ export default () => {
return `<cell-prd-info
:skn="row.productSkn"
:sku="row.productSku"
:color="row.colorName"
:color="row._colorName"
:name="row.productName"
:brand="row.brandName"
:price="row.salesPrice"
... ...
... ... @@ -167,6 +167,7 @@
const list = res.data.records;
_.each(list, i => {
i._colorName = i.factoryGoodsName || '';
i.createTime = moment.unix(i.createTime).format(fmt);
});
... ...
... ... @@ -175,6 +175,7 @@
_.each(list, (v, i) => {
v._rowIndex = i; // 当前行index
v._disabled = v.isOvertime === 'Y';
v._colorName = v.factoryGoodsName || '';
v.createTime = moment.unix(v.createTime).format(fmt);
v._needDeliver = v.buyingNums - v.lackNum - v.shipmentsNums; // 当前需发数
});
... ...
... ... @@ -2,6 +2,7 @@
<LayoutBody>
<div class="detail-header">
<Button type="primary" @click="backExpList">返回发货物流表</Button>
<Button type="primary" @click="print">打印</Button>
<span class="no">物流单号:{{expressNo}}</span>
<span class="time">发货时间:{{expressTime}}</span>
</div>
... ... @@ -45,10 +46,10 @@
title: '规格',
align: 'center',
render(row) {
return `${row.colorNama || ''}/${row.size}`;
return `${row.colorName || ''}/${row.size}`;
}
}, {
title: '单号/已发数',
title: '调拨单号/已发数',
align: 'center',
render(row) {
let $html = '';
... ... @@ -72,6 +73,10 @@
this.expressDetail();
},
methods: {
print(){
window.print();
},
backExpList() {
this.$router.push({
name: 'trade.allot.express'
... ...
... ... @@ -19,6 +19,7 @@
"bluebird": "^3.5.0",
"body-parser": "^1.17.1",
"compression": "^1.6.2",
"connect-history-api-fallback": "^1.3.0",
"connect-multiparty": "^2.0.0",
"cookie-parser": "^1.4.3",
"cookie-session": "^2.0.0-beta.1",
... ...
... ... @@ -9,6 +9,7 @@ const bodyParser = require('body-parser');
const cookieParser = require('cookie-parser');
const compression = require('compression');
const Express = require('express');
const history = require('./framework/history-api-fallback');
// const session = require('express-session');
const cookieSession = require('cookie-session');
... ... @@ -30,7 +31,12 @@ global.yoho = {
apiDomain: config.apiDomain,
co: global.Promise.coroutine
};
app.use(history({
disableIndex: true,
rewrites: [
{ from: /\.html/, to: '/index.html'}
]
}));
app.use(cookieSession({
name: 'yoho-shop',
secret: 'yoho!shop@manage',
... ...
/* eslint-disable */
var url = require('url');
exports = module.exports = function historyApiFallback(options) {
options = options || {};
var logger = getLogger(options);
return function (req, res, next) {
var headers = req.headers;
if (req.method !== 'GET') {
logger(
'Not rewriting',
req.method,
req.url,
'because the method is not GET.'
);
return next();
} else if (!headers || typeof headers.accept !== 'string') {
logger(
'Not rewriting',
req.method,
req.url,
'because the client did not send an HTTP accept header.'
);
return next();
} else if (headers.accept.indexOf('application/json') === 0) {
logger(
'Not rewriting',
req.method,
req.url,
'because the client prefers JSON.'
);
return next();
} else if (!acceptsHtml(headers.accept, options)) {
logger(
'Not rewriting',
req.method,
req.url,
'because the client does not accept HTML.'
);
return next();
}
var parsedUrl = url.parse(req.url);
var rewriteTarget;
options.rewrites = options.rewrites || [];
for (var i = 0; i < options.rewrites.length; i++) {
var rewrite = options.rewrites[i];
var match = parsedUrl.pathname.match(rewrite.from);
if (match !== null) {
rewriteTarget = evaluateRewriteRule(parsedUrl, match, rewrite.to);
logger('Rewriting', req.method, req.url, 'to', rewriteTarget);
req.url = rewriteTarget;
return next();
}
}
if (parsedUrl.pathname.indexOf('.') !== -1 &&
options.disableDotRule !== true) {
logger(
'Not rewriting',
req.method,
req.url,
'because the path includes a dot (.) character.'
);
return next();
}
if (options.disableIndex) {
return next();
}
rewriteTarget = options.index || '/index.html';
logger('Rewriting', req.method, req.url, 'to', rewriteTarget);
req.url = rewriteTarget;
next();
};
};
function evaluateRewriteRule(parsedUrl, match, rule) {
if (typeof rule === 'string') {
return rule;
} else if (typeof rule !== 'function') {
throw new Error('Rewrite rule can only be of type string of function.');
}
return rule({
parsedUrl: parsedUrl,
match: match
});
}
function acceptsHtml(header, options) {
options.htmlAcceptHeaders = options.htmlAcceptHeaders || ['text/html', '*/*'];
for (var i = 0; i < options.htmlAcceptHeaders.length; i++) {
if (header.indexOf(options.htmlAcceptHeaders[i]) !== -1) {
return true;
}
}
return false;
}
function getLogger(options) {
if (options && options.logger) {
return options.logger;
} else if (options && options.verbose) {
return console.log.bind(console);
}
return function () { };
}
... ...