Authored by 陈峰

Merge branch 'release/1.0' of http://git.yoho.cn/fe/yoho-shop-manage into release/1.0

... ... @@ -4,20 +4,16 @@ import yohoPluginCore from './plugins/yoho-plugin-core';
import yohoPluginRouter from './plugins/yoho-plugin-router';
import yohoPluginAuth from './plugins/yoho-plugin-auth';
import yohoPluginBus from './plugins/yoho-plugin-bus';
import yohoPluginHelper from './plugins/yoho-plugin-helper';
import './filters';
import './directives';
import 'iview/dist/styles/iview.css';
import 'font-awesome/css/font-awesome.css';
Vue.use(yohoPluginCore);
Vue.use(yohoPluginRouter);
Vue.use(yohoPluginAuth);
Vue.use(yohoPluginBus);
Vue.use(yohoPluginHelper);
Vue.render({
el: '#app',
... ...
... ... @@ -85,8 +85,8 @@ export default {
key: 'image',
render(row){
return `<div>
<img :src="$helper.sknImage({sku: ${row.productSku}})">
</div>`
<img v-prod-img.sku="row.productSku">
</div>`;
}
},
{
... ...
import Vue from 'vue';
import purview from './purview';
import prodImage from './prodImage';
Vue.directive('purview', purview);
Vue.directive('prod-img', prodImage);
... ...
/**
* Created by TaoHuang on 2017/5/12.
*/
import _ from 'lodash';
function sknImage ({skn, sku, size}) {
let baseUrl = '/Api/platform/getRemoteImageUrlBySku';
let params = [];
if (skn) {
params.push(`skn_id=${skn}`);
}
if (sku) {
params.push(`sku_id=${sku}`);
}
params.push(size ? `size=${size}` : 'size=80x80');
return `${baseUrl}?${params.join('&')}`;
}
export default {
bind (el, binding) {
// v-prod-img.skn="{ val: 'fdsa', size: '121X123'}" skn
// v-prod-img.sku="{ val: 'fdsa', size: '121X123'}" sku
// v-prod-img.sku="row.productSkn" sku
// v-prod-img.skn="row.productSkn" skn
// v-prod-img="row.productSkn" skn
let data = null;
let key = null;
if (!_.isEmpty(binding.modifiers)) {
key = _.first(_.keys(binding.modifiers));
} else {
key = 'skn';
}
if (_.isPlainObject(binding.value)) {
data = {
[key]: binding.value.val,
size: binding.value.size
};
} else {
data = {
[key]: binding.value
}
}
el.src = sknImage(data);
}
}
\ No newline at end of file
... ...
... ... @@ -13,7 +13,8 @@
<Row>
<Col>
<div class="create-item-title">商品颜色主图
<span class="create-group-sub-title">(商品正面图默认为用户选择商品颜色和展示使用。用户从不同频道查看商品,优先展示频道封面图)</span>
<span class="create-group-sub-title">(商品正面图默认为用户选择商品颜色和展示使用。用户从不同频道查看商品,优先展示频道封面图)<a
href="javascript: void 0;" @click="onClickShowExample">查看色卡图片示例</a></span>
</div>
</Col>
</Row>
... ... @@ -207,6 +208,13 @@
</div>
</Col>
</Row>
<Modal
v-model="showExample"
title="色卡图片示例">
<p>自定义宽度,单位 px,默认 520px。</p>
<p>对话框的宽度是响应式的,当屏幕尺寸小于 768px 时,宽度会变为自动<code>auto</code>。</p>
</Modal>
</div>
</template>
... ... @@ -227,7 +235,8 @@ export default {
attributeProValuesOne: [],
attributeProValuesTwo: [],
productMaterial: {}
}
},
showExample: false
};
},
mounted: function() {
... ... @@ -312,6 +321,10 @@ export default {
let imageIndex = data.imageIndex;
this.product.goods[colorIndex].goodsImage[imageIndex].imageUrl = '';
},
onClickShowExample: function() {
console.log('fdsad');
this.showExample = true;
}
}
};
... ...
... ... @@ -15,9 +15,7 @@ let tableCols = [
key: 'image',
align: 'center',
render(row) {
return `<div>
<img :src="$helper.sknImage({skn: ${row.productSkn}})">
</div>`
return `<div> <img v-prod-img="row.productSkn"> </div>`
}
},
{
... ...
... ... @@ -2,7 +2,7 @@
<div class="cell-deliver">
<p class="row">
发货<span class="num">
<Input v-if="rowDisabled" placeholder="数量" disabled></Input>
<Input v-if="rowDisabled || changeDisabled" v-model="deliver" placeholder="数量" disabled></Input>
<Input v-else v-model="deliver" placeholder="数量"></Input>
</span>
</p>
... ... @@ -14,6 +14,9 @@
export default {
name: 'CellDeliver',
props: {
changeDisabled: {
default: false
},
rowDisabled: {
type: Boolean
},
... ...
... ... @@ -2,8 +2,8 @@
<div class="cell-info">
<span class="item">销售数:{{buyNum}}</span>
<span class="item">实际应发数:{{actualNeed}}</span>
<span class="item">当前需发数:{{currentNeed}}</span>
<span class="item">收货数:{{storeNum}}</span>
<span class="item darker">当前需发数:{{currentNeed}}</span>
<span v-if="showStore" class="item">收货数:{{storeNum}}</span>
</div>
</template>
... ... @@ -11,6 +11,9 @@
export default {
name: 'CellDispatch',
props: {
showStore: {
default: false
},
storeNum: {
type: [String, Number]
},
... ... @@ -46,6 +49,11 @@
.item {
display: block;
&.darker {
font-weight: bold;
color: #000000;
}
}
}
... ...
... ... @@ -6,7 +6,7 @@
<Input v-else v-model="uploadNum" placeholder="数量"></Input>
</span>
</p>
<p class="row">缺货数:{{lackNum}}</p>
<p class="row" :class="{highlight: lackNum > 0}">缺货数:{{lackNum}}</p>
<p class="row">
<Button v-if="rowDisabled" type="error" @click="showModal" disabled>上传确认缺货</Button>
<Button v-else type="error" @click="showModal">上传确认缺货</Button>
... ... @@ -57,6 +57,11 @@
.row {
margin: 10px 0;
&.highlight {
color: #ff0000;
font-weight: bold;
}
}
.num {
... ...
... ... @@ -67,11 +67,6 @@ export default () => {
table: {
cols: [
{
type: 'selection',
width: 60,
align: 'center'
},
{
title: '下单时间',
key: 'createTime',
align: 'center'
... ... @@ -81,8 +76,8 @@ export default () => {
align: 'center',
render(row){
return `<div>
<img :src="$helper.sknImage({sku: ${row.productSku}})">
</div>`
<img v-prod-img.sku="row.productSku">
</div>`;
}
},
{
... ... @@ -135,8 +130,9 @@ export default () => {
ot = ot === 'N' ? true : false;
return `<span v-if="${ot}">待处理</span>
<span v-else>待处理(超时)</span>`;
}
<span v-else class="is-overtime">待处理(超时)</span>`;
},
className: 'status-cell'
},
{
title: '入库单号',
... ...
... ... @@ -72,8 +72,8 @@ export default () => {
align: 'center',
render(row){
return `<div>
<img :src="$helper.sknImage({sku: ${row.productSku}})">
</div>`
<img v-prod-img.sku="row.productSku">
</div>`;
}
},
{
... ... @@ -95,7 +95,8 @@ export default () => {
title: '订单收发货',
align: 'center',
render(row){
return `<cell-dispatch
return `<cell-dispatch
:show-store="true"
:store-num="row.inStoreNum"
:buy-num="row.buyingNums"
:ship-num="row.shipmentsNums"
... ... @@ -109,6 +110,7 @@ export default () => {
render(row, column, i){
return `<cell-deliver
:row-index="${i}"
:change-disabled="${row._changeDisabled}"
:row-disabled="${row._disabled}"
:ship-num="row.shipmentsNums"
@deliver-change="deliverChange">
... ... @@ -136,8 +138,9 @@ export default () => {
ot = ot === 'N' ? true : false;
return `<span v-if="${ot}">待处理</span>
<span v-else>待处理(超时)</span>`;
}
<span v-else class="is-overtime">待处理(超时)</span>`;
},
className: 'status-cell'
},
{
title: '入库单号',
... ...
... ... @@ -3,15 +3,15 @@
<LayoutFilter>
<FilterItem :label="filters.orderNo.label">
<Input v-model.trim="filters.orderNo.model"
:placeholder="filters.orderNo.holder" number></Input>
:placeholder="filters.orderNo.holder"></Input>
</FilterItem>
<FilterItem :label="filters.expressNo.label">
<Input v-model.trim="filters.expressNo.model"
:placeholder="filters.expressNo.holder" number></Input>
:placeholder="filters.expressNo.holder"></Input>
</FilterItem>
<FilterItem :label="filters.prodCode.label">
<Input v-model.trim="filters.prodCode.model"
:placeholder="filters.prodCode.holder" number></Input>
:placeholder="filters.prodCode.holder"></Input>
</FilterItem>
<FilterItem :label="filters.merChantCode.label">
<Input v-model.trim="filters.merChantCode.model"
... ... @@ -195,4 +195,11 @@
background-color: #2db7f5;
color: #fff;
}
.status-cell {
.is-overtime {
color: #ff0000;
font-weight: bold;
}
}
</style>
... ...
... ... @@ -3,11 +3,11 @@
<LayoutFilter>
<FilterItem :label="filters.orderNo.label">
<Input v-model.trim="filters.orderNo.model"
:placeholder="filters.orderNo.holder" number></Input>
:placeholder="filters.orderNo.holder"></Input>
</FilterItem>
<FilterItem :label="filters.prodCode.label">
<Input v-model.trim="filters.prodCode.model"
:placeholder="filters.prodCode.holder" number></Input>
:placeholder="filters.prodCode.holder"></Input>
</FilterItem>
<FilterItem :label="filters.merChantCode.label">
<Input v-model.trim="filters.merChantCode.model"
... ... @@ -181,6 +181,7 @@
this.page.current = page;
},
selectChange(rows){
this.table.list[0]._changeDisabled = true;
this.deliverRows = rows;
},
deliverChange(data) {
... ... @@ -257,7 +258,6 @@
this.$refs.stockOutModal.show(row);
},
uploadSuccess() {
console.log('uploadsuccess')
this.$Message.success('上传缺货成功');
this.productList(this.params());
this.page.current = 1;
... ... @@ -284,4 +284,11 @@
.ivu-table .over-time td{
background-color: #fcecec;
}
.status-cell {
.is-overtime {
color: #ff0000;
font-weight: bold;
}
}
</style>
... ...
... ... @@ -34,7 +34,7 @@
align: 'center',
render(row){
return `<div>
<img :src="$helper.sknImage({sku: ${row.productSku}})">
<img v-prod-img.sku="row.sku">
</div>`
}
},{
... ... @@ -45,7 +45,7 @@
title: '规格',
align: 'center',
render(row) {
return `${row.colorName}/${row.size}`
return `${row.colorNama || ''}/${row.size}`
}
},{
title: '订单号/已发数',
... ...
/**
* Created by TaoHuang on 2017/5/11.
*/
/**
* 使用skn ,sku 拿到商品图片
* @param skn
* @param sku
* @param size
* @returns {string}
*/
function sknImage ({skn, sku, size}) {
let baseUrl = '/Api/platform/getRemoteImageUrlBySku';
let params = [];
if (skn) {
params.push(`skn_id=${skn}`);
}
if (sku) {
params.push(`sku_id=${sku}`);
}
params.push(size ? `size=${size}` : 'size=80x80');
return `${baseUrl}?${params.join('&')}`;
}
let helper = {
install(vue) {
Object.defineProperty(vue.prototype, '$helper', {
get(){
return {
sknImage
}
}
});
}
};
export default helper;