Authored by 李奇

added:vip价格管理、调拨单

... ... @@ -2,6 +2,7 @@ import create from './create';
import edit from './edit';
import onsale from './onsale';
import offsale from './offsale';
import vips from './vips';
import output from './output';
export default {
... ... @@ -9,5 +10,6 @@ export default {
edit,
onsale,
offsale,
vips,
output
};
... ...
... ... @@ -3,5 +3,8 @@ const page = r => require.ensure([], () => r(require('./vips')), 'product.vips')
export default {
path: '/vips.html',
name: 'vips',
component: page
component: page,
meta: {
pageName: '在售商品'
}
};
... ...
/**
* vips data
* @author: qi.li <qi.li@yoho.cn>
* @date: 2017/05/23
*/
export default () => {
return {
tableCols: [
{
type: 'selection',
width: 60,
align: 'center'
},
{
title: '商品图片',
key: 'image',
width: 120,
align: 'center',
render(row) { // eslint-disable-line
return '<cell-image :image-src="row.picImgUrl" :product-url="row.productUrl"></cell-image>';
}
},
{
title: '商品信息',
key: 'info',
align: 'center',
render(row) { // eslint-disable-line
return `<cell-info
:skn="row.productSkn"
:product-name="row.productName"
:brand-name="row.brandName"
:max-name="row.maxSortName"
:middle-name="row.middleSortName"
:small-name="row.smallSortName">
</cell-info>`;
}
},
{
title: '价格(元)',
key: 'price',
width: '180',
align: 'center',
render(row, column, index) {
row.lineIndex = index;
return `<cell-price
:can-change="false"
:retail-price="row.retailPrice"
:sales-price="row.salesPrice">
</cell-price>`;
}
},
{
title: '可售库存',
key: 'stock',
width: 100,
align: 'center',
},
{
title: 'VIP价格',
key: 'stock',
width: 100,
align: 'center',
},
{
title: '销售状态',
key: 'stock',
width: 100,
align: 'center',
},
{
title: 'VIP价格状态',
key: 'stock',
width: 100,
align: 'center',
},
{
title: '操作',
key: 'action',
width: 180,
align: 'center',
render: function(row) {
return `<i-button type="primary" size="large"
@click="enablePrice">启用</i-button>`;
},
className: 'action-column'
}
],
tableData: [],
pageData: {
total: 0,
current: 1
},
filterFields: {
sknCode: {
label: 'SKN编码',
model: '',
holder: ''
},
prodCode: {
label: '商家编码',
model: '',
holder: ''
},
prodBarCode: {
label: '商品条码',
model: '',
holder: ''
},
priceStatus: {
label: '价格状态',
model: -1,
options: [
{
value: -1,
label: '全部'
},
{
value: 1,
label: '启用'
},
{
value: 2,
label: '禁用'
}
]
},
saleStatus: {
label: '销售状态',
model: -1,
options: [
{
value: -1,
label: '全部'
},
{
value: 1,
label: '新品未上架'
},
{
value: 2,
label: '已上架'
},
{
value: 2,
label: '已下架'
}
]
},
stockStatus: {
label: '库存状态',
model: -1,
options: [
{
value: -1,
label: '全部'
},
{
value: 1,
label: '有库存'
},
{
value: 2,
label: '无库存'
}
]
},
sort: {
first: {
label: '选择类目',
holder: '选择一级类目',
labelSpan: 6,
fieldSpan: 18,
model: ''
},
second: {
label: '二级类目',
holder: '选择二级类目',
labelSpan: 6,
fieldSpan: 18,
model: ''
},
third: {
label: '三级类目',
holder: '选择三级类目',
labelSpan: 6,
fieldSpan: 18,
model: ''
}
},
}
};
};
... ...
<template>
<div class="onsale-list">
</div>
<LayoutBody>
<LayoutFilter>
<FilterItem :label="filters.sknCode.label">
<Input v-model.trim="filters.sknCode.model"
:placeholder="filters.sknCode.holder"></Input>
</FilterItem>
<FilterItem :label="filters.prodCode.label">
<Input v-model.trim="filters.prodCode.model"
:placeholder="filters.prodCode.holder"></Input>
</FilterItem>
<FilterItem :label="filters.prodBarCode.label">
<Input v-model.trim="filters.prodBarCode.model"
:placeholder="filters.prodBarCode.holder"></Input>
</FilterItem>
<FilterItem :label="filters.priceStatus.label">
<Select v-model.trim="filters.priceStatus.model">
<Option v-for="option in filters.priceStatus.options"
:value="option.value"
:key="option.value">{{option.label}}</Option>
</Select>
</FilterItem>
<FilterItem :label="filters.saleStatus.label">
<Select v-model.trim="filters.saleStatus.model">
<Option v-for="option in filters.saleStatus.options"
:value="option.value"
:key="option.value">{{option.label}}</Option>
</Select>
</FilterItem>
<FilterItem :label="filters.stockStatus.label">
<Select v-model.trim="filters.stockStatus.model">
<Option v-for="option in filters.stockStatus.options"
:value="option.value"
:key="option.value">{{option.label}}</Option>
</Select>
</FilterItem>
<FilterItem label="选择类目">
<SelectCategory :value="categoryValue"
@select-change="sortChange"></SelectCategory>
</FilterItem>
<FilterItem>
<Button type="primary" @click="filterSearch">筛选</Button>
<Button @click="clearFilter">清空条件</Button>
</FilterItem>
</LayoutFilter>
<LayoutAction>
<Button type="primary" @click="batchEnable">启用</Button>
<Button type="error" @click="batchDisable">禁用</Button>
</LayoutAction>
<LayoutList>
<Table border :context="self" :columns="tableCols"
:data="tableData" @on-selection-change="selectChange"></Table>
<Page :total="pageData.total" :current="pageData.current"
@on-change="pageChange" :page-size="20" show-total></Page>
</LayoutList>
</LayoutBody>
</template>
<script>
import _ from 'lodash';
import service from 'product-service';
import {ModalSizeEdit} from 'components/modal';
import {SelectBrand, SelectCategory} from 'components/select';
import {CellImage, CellInfo, CellPrice} from 'components/cell';
import onSaleStore from './store';
export default {
data() {
return {
self: this,
showSizeEdit: false,
tableCols: [],
tableData: {},
pageData: {},
filters: {},
batchOffSale: [],
useFilterSign: false,
categoryValue: []
};
},
created() {
const store = onSaleStore();
this.productList();
this.filters = store.filterFields;
this.tableCols = store.tableCols;
this.tableData = store.tableData;
this.pageData = store.pageData;
},
methods: {
filterParams() {
const fts = this.filters;
const data = {};
return data;
},
filterSearch() {
const params = this.filterParams();
this.useFilterSign = true;
this.productList(params);
this.pageData.current = 1;
},
clearFilter() {
const store = onSaleStore();
this.filters = store.filterFields;
this.productList();
this.useFilterSign = false;
this.pageData.current = 1;
this.categoryValue = [];
},
enablePrice(){
},
disablePrice(){
},
batchEnable(){
},
batchDisable(){
},
productList(params) {
// if (_.isObject(params) &&
// typeof params.productSkn !== 'undefined' &&
// !_.isFinite(+params.productSkn)) {
// this.$Message.error('SKN编码只能是数字', 3);
// return;
// }
this.$Loading.start();
service.vipProductList({size: 20, page: 1})
.then(res => {
this.$Loading.finish();
if (res.code === 200) {
this.updateStore(res.data);
}
});
},
reloadList() {
let params = {};
if (this.useFilterSign) {
params = this.filterParams();
}
_.merge(params, {
page: 1,
size: 20,
productStatusStr: 1
});
this.productList(params);
this.pageData.current = 1;
},
updateStore(data) {
_.each(data.list, item => {
item.changePrice = false;
item.stock = item.stock || 0;
item._disabled = item.auditStatus === 1;
item.shelveTime = item.shelveTime || '-';
});
this.tableData = data.list;
this.pageData.total = data.total;
},
sortChange(sort) {
this.filters.sort.first.model = sort.max;
this.filters.sort.second.model = sort.mid;
this.filters.sort.third.model = sort.min;
},
brandChange(val) {
_.set(this.filters, 'brand.model', val);
},
pageChange(page) {
this.pageData.current = page;
let params = {};
if (this.useFilterSign) {
params = this.filterParams();
}
_.merge(params, {
page,
size: 20,
productStatusStr: 1
});
this.productList(params);
},
selectChange(selection) {
this.batchOffSale = selection;
}
},
components: {
SelectBrand,
SelectCategory,
CellImage,
CellInfo,
CellPrice
}
};
</script>
<style lang="scss">
</style>
... ...
<template>
<LayoutBody>
<LayoutFilter>
<FilterItem :label="filters.orderNo.label">
<Input v-model.trim="filters.orderNo.model"
:placeholder="filters.orderNo.holder"></Input>
</FilterItem>
<FilterItem :label="filters.orderTime.label">
<Date-picker type="daterange"
placeholder="选择日期"
@on-change="dateChange"
v-model="filters.orderTime.model">
</Date-picker>
</FilterItem>
<FilterItem :label="filters.receiveStatus.label">
<Select v-model.trim="filters.receiveStatus.model">
<Option v-for="option in filters.receiveStatus.options"
:value="option.value"
:key="option.value">{{option.label}}</Option>
</Select>
</FilterItem>
<FilterItem>
<Button type="primary" @click="filterSearch">筛选</Button>
<Button @click="clearFilter">清空条件</Button>
</FilterItem>
</LayoutFilter>
<LayoutList>
<Table border :context="self" :columns="tableCols" :data="tableData"></Table>
<Page :total="page.total" :current="page.current"
@on-change="pageChange" :page-size="20" show-total></Page>
</LayoutList>
</LayoutBody>
</template>
<script>
import _ from 'lodash';
import service from 'trade-service';
import onSaleStore from './store';
export default {
data() {
return {
self: this,
tableCols: [],
tableData: {},
page: {},
filters: {},
withFilter: false
};
},
created() {
const store = onSaleStore();
this.allotList();
this.filters = store.filterFields;
this.tableCols = store.tableCols;
this.tableData = store.tableData;
this.page = store.page;
},
methods: {
filterValues() {
const values = {};
const keyMap = {
endTime: 'endTime',
orderNo: 'orderNo',
startTime: 'startTime',
status: 'receiveStatus'
};
const filters = this.filters;
_.each(keyMap, (val, key) => {
values[key] = filters[val];
});
return values;
},
filterSearch() {
this.page.current = 1;
this.withFilter = true;
this.allotList(this.filterValues());
},
clearFilter() {
const store = onSaleStore();
this.filters = store.filterFields;
this.allotList();
this.withFilter = false;
this.page.current = 1;
this.categoryValue = [];
},
allotList() {
service.allotList()
.then(res => {
});
},
reloadList() {
let params = {};
if (this.withFilter) {
params = this.filterValues();
}
_.merge(params, {
page: 1,
size: 20
});
this.allotList(params);
this.page.current = 1;
},
resolveData(data) {
this.tableData = data.list;
this.page.total = data.total;
},
pageChange(page) {
this.page.current = page;
let params = {};
if (this.withFilter) {
params = this.filterValues();
}
_.merge(params, {
page,
size: 20,
productStatusStr: 1
});
this.allotList(params);
},
dateChange(date) {
this.filters.startTime = date[0];
this.filters.endTime = date[1];
}
},
components: {}
};
</script>
<style lang="scss">
</style>
... ...
const allotList = r => require.ensure([], () => r(require('./allot-list')), 'trade.allotList');
export default {
path: '/allotList.html',
name: 'allotList',
component: allotList,
meta: {
pageName: '调拨单'
}
};
... ...
/**
* on sale page store
* @author: qi.li <qi.li@yoho.cn>
* @date: 2017/04/13
*/
const auditStatus = {
0: '无状态',
1: '下架待审核',
2: '下架驳回',
3: '已上架'
};
export default () => {
return {
tableCols: [
{
title: '调拨单号',
key: 'stock',
align: 'center',
},
{
title: '下单时间',
key: 'shelveTime',
align: 'center'
},
{
title: '发货进度(已发总数/实际需发总数)',
key: 'shelveTime',
align: 'center'
},
{
title: '收货进度(收货总数/已发总数)',
key: 'shelveTime',
align: 'center'
},
{
title: '调拨总数',
key: 'shelveTime',
align: 'center'
},
{
title: '缺货数',
key: 'shelveTime',
align: 'center'
},
{
title: '状态',
key: 'shelveTime',
align: 'center'
}
],
tableData: [],
pageData: {
total: 0,
current: 1
},
filterFields: {
orderNo: {
label: '入库单号',
model: ''
},
orderTime: {
label: '下单时间',
model: ''
},
startTime: {
model: '',
},
endTime: {
model: '',
},
receiveStatus: {
label: '状态',
model: -1,
options: [
{
value: -1,
label: '全部'
},
{
value: 1,
label: '未收货'
},
{
value: 2,
label: '收货未完成'
},
{
value: 3,
label: '发货未完成'
},
{
value: 4,
label: '收货已完成'
}
]
}
}
};
};
... ...
import allot from './allot';
import expdetail from './express-detail';
import printdetail from './print-detail';
import allotlist from './allot-list';
export default {
allot,
expdetail,
printdetail
printdetail,
allotlist
};
... ...
... ... @@ -9,6 +9,7 @@ import axios from 'axios';
const apiUrl = {
brand: '/platform/getSellerBrandInfo',
productList: '/platform/querySellerProductList',
vipProductList: '/platform/queryVipProductList',
productOutSale: '/platform/productOutSale',
productOnSale: '/platform/productOnSale',
updateSellerPrice: '/platform/updateSellerPrice',
... ... @@ -47,6 +48,18 @@ const productService = {
});
},
vipProductList(params) {
return axios.post(apiUrl.vipProductList, {
params
})
.then(res => {
if (res.status === 200) {
return res.data;
}
return {};
});
},
setOffSale(params) {
return axios.post(apiUrl.productOutSale, params);
},
... ...
... ... @@ -14,6 +14,7 @@ const apiUrl = {
allotStockOut: '/erp/allotStockOut',
allotExpressNumList: '/erp/allotExpressNumList',
allotExpressCompList: '/erp/allotExpressCompList',
allotList: '/erp/allotExpressCompList', // todo
allotPrintExpressDetail: '/erp/allotPrintExpressDetail'
};
... ... @@ -99,6 +100,16 @@ const tradeService = {
return {};
});
},
allotList() {
return axios.get(apiUrl.allotList)
.then(res => {
if (res.status === 200) {
return res.data;
}
return {};
});
},
allotPrintExpressDetail(no) {
return axios.post(apiUrl.allotPrintExpressDetail, {
expressNumber: no
... ...
... ... @@ -31,6 +31,7 @@ let domainApis = {
querySellerProductMaterial: '/SellerProductController/querySellerProductMaterial',
updateSellerProductNetSaleInfo: '/SellerProductController/updateSellerProductNetSaleInfo',
querySellerProductList: '/SellerProductController/querySellerProductList',
queryVipProductList: '/sellerVip/queryProductVipList',
productOutSale: '/SellerSknStatusController/productOutSale',
productOnSale: '/SellerSknStatusController/productOnSale',
queryProdSizeList: '/SellerProductSize/queryProdSizeList',
... ...