Authored by 陈峰

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

... ... @@ -17,6 +17,7 @@
</layout-filter>
<layout-list>
<Button type="success" @click="print" class="table-btn">打印</Button>
<Button type="warning" @click="exportData" class="table-btn">导出</Button>
<Table border :columns="tableCols" :data="tableData"></Table>
<Page :total="pageData.total" :current="pageData.pageNo"
@on-change="pageChange" :page-size="20" show-total></Page>
... ... @@ -91,6 +92,15 @@ export default {
window.open(href, '_blank');
},
exportData() {
const beginTime = this.startTime;
const endTime = this.endTime;
const href = '/Api/erp/exportInventoryLedgerList?' +
`beginTime=${beginTime}&endTime=${endTime}`;
window.open(href, '_blank');
},
returnPage() {
this.$router.push({
name: 'finance.clearing'
... ...
... ... @@ -17,6 +17,7 @@
</layout-filter>
<layout-list>
<Button type="success" @click="print" class="table-btn">打印</Button>
<Button type="warning" @click="exportData" class="table-btn">导出</Button>
<Table border :columns="tableCols" :data="tableData"></Table>
<Page :total="pageData.total" :current="pageData.pageNo"
@on-change="pageChange" :page-size="20" show-total></Page>
... ... @@ -92,6 +93,15 @@ export default {
window.open(href, '_blank');
},
exportData() {
const beginTime = this.startTime;
const endTime = this.endTime;
const href = '/Api/erp/exportInventoryLedgerList?' +
`beginTime=${beginTime}&endTime=${endTime}`;
window.open(href, '_blank');
},
returnPage() {
this.$router.push({
name: 'finance.payment'
... ...
... ... @@ -5,7 +5,7 @@ import supplement from './supplement';
import invoice from './invoice';
import express from './express';
import sellback from './sellback';
import inventory from './inventory';
export default {
diff,
jit,
... ... @@ -13,5 +13,6 @@ export default {
prodReturn,
invoice,
express,
sellback
sellback,
inventory
};
... ...
<template>
<Modal v-model="model"
width="800"
:title="title"
class-name="vertical-center-modal">
<div class="intro-item">
<p class="tip">*该功能提供整体库存情况查询、JIT合作模式库存维护请使用[仓库管理-JIT可调拨库存]</p>
<dl>
<dt class="bold">可售库存范畴:</dt>
<dd><label class="normal">仓库可售库存:</label>正常可以售卖的商品数量</dd>
<dd><label class="normal">JIT可调拨库存:</label>JIT合作模式使用,供应商可供销售调拨的商品库存数</dd>
</dl>
<dl>
<dt class="bold">不可售库存范畴:</dt>
<dd><label class="normal">订单占用:</label>商品下单后被占用的库存,包括已支付商品和未支付的商品,不可售卖</dd>
<dd><label class="normal">退供应商占用:</label>被绑定到退库单,准备做退库处理的商品库存,不可售卖</dd>
<dd><label class="normal">残次货位:</label>商品有质量问题,不可售卖</dd>
<dd><label class="normal">不可售(其他):</label>商品借出拍摄、测量或被有货其他渠道销售占用的库存等,不可在有货平台售卖,具体情况可联系品牌经理进行查询</dd>
</dl>
<dl>
<dd><label class="bold">库存总价:</label>全部商品库存的数量。其中,<span class="bold">可售库存,即作为商品在前台用于销售的库存,是有货仓库的可售库存和JIT可调拨库存的总和</span></dd>
</dl>
</div>
<div slot="footer" style="textAlign: center;">
<Button type="primary" size="large" @click="close">关闭</Button>
</div>
</Modal>
</template>
<script>
export default {
name: 'edit-intro',
created() {
},
data() {
return {
model: false,
title: '帮助说明'
};
},
methods: {
show() {
this.model = true;
},
close() {
this.model = false;
},
}
};
</script>
<style lang="scss">
.intro-item {
color: #999;
.tip {
color: #ed3f14;
}
.bold {
color: #444;
font-weight: bold;
}
.normal {
color: #444;
}
dl {
padding-top: 10px;
padding-bottom: 10px;
box-sizing: border-box;
border-bottom: 1px solid #e9eaec;
&:nth-child(4) {
border-bottom: none;
}
}
}
</style>
... ...
export default {
path: '/inventory.html',
name: 'inventory',
component: () => import(/* webpackChunkName: "repository.inventory" */'./inventory'),
meta: {
pageName: '实时库存查询'
}
};
... ...
<template>
<layout-body>
<layout-filter>
<filter-item :label="filters.productSku.label">
<Input v-model.trim="filters.productSku.model"
:placeholder="filters.productSku.holder" :maxlength="9"></Input>
</filter-item>
<filter-item :label="filters.factoryCode.label">
<Input v-model.trim="filters.factoryCode.model"
:placeholder="filters.factoryCode.holder" :maxlength="100" ></Input>
</filter-item>
<filter-item :label="filters.upmCode.label">
<Input v-model.trim="filters.upmCode.model"
:placeholder="filters.upmCode.holder" :maxlength="100" ></Input>
</filter-item>
<filter-item>
<Button type="primary" @click="filterSearch">筛选</Button>
<Button @click="clearFilters">清空条件</Button>
<Button type="warning" @click="exportList">导出全部</Button>
<em class="help" @click="editIntro"><Icon type="ios-help"></Icon>帮助说明</em>
</filter-item>
</layout-filter>
<layout-list>
<Table border :columns="tableCols" :data="tableData" :no-data-text="noFilteredDataText"></Table>
<Page :total="pageData.total" :current="pageData.current"
@on-change="pageChange" show-total></Page>
</layout-list>
<edit-intro ref="showImgEdit" @on-success="editSuccess"></edit-intro>
</layout-body>
</template>
<script>
import _ from 'lodash';
import store from './store';
import EditIntro from './components/edit-intro.vue';
import InventoryService from 'services/repository/inventory-service';
export default {
created() {
this.tableFalse = false;
this.inventoryService = new InventoryService();
this.noFilteredDataText = '请输入查询条件,进行数据筛选展示!';
},
data() {
return store.call(this);
},
watch: {
data() {
this.filters.productSku.model = null;
this.filters.factoryCode.model = null;
this.filters.upmCode.model = null;
this.pageData.current = 1;
}
},
methods: {
editIntro(row) {
this.$refs.showImgEdit.show(row);
},
editSuccess() {
this.filtersParams();
},
clearFilters() {
this.filters.productSku.model = null;
this.filters.factoryCode.model = null;
this.filters.upmCode.model = null;
this.pageData.current = 1;
this.tableData = [];
this.noFilteredDataText = '请输入查询条件,进行数据筛选展示!';
},
pageChange(page) {
this.pageData.current = page;
this.getInventory();
},
filtersParams() {
let params = {};
let productSku = this.filters.productSku.model || null;
let factoryCode = this.filters.factoryCode.model || null;
let upmCode = this.filters.upmCode.model || null;
let pageNo = this.pageData.current;
let pageSize = this.pageData.pageSize;
if (this.filters.productSku.model) {
if (this.isNumber(this.filters.productSku.model)) {
params.productSku = this.filters.productSku.model;
} else {
return Promise.reject('sku必须是数字');
}
}
params.pageSize = this.pageData.pageSize;
params.pageNo = this.pageData.current;
return Promise.resolve({
params,
productSku,
factoryCode,
upmCode,
pageNo,
pageSize
});
},
filterSearch() {
this.pageData.current = 1;
this.getInventory();
},
getInventory() {
this.$Loading.start();
return this.filtersParams().then((params) => {
if (params.productSku || params.factoryCode || params.upmCode) {
this.noFilteredDataText = '暂无数据';
return this.inventoryService.list(params).then((result) => {
if (result.code === 200) {
this.pageData.total = result.data.totalCount;
this.pageData.current = result.data.pageNo;
this.tableData = result.data.records;
}
this.$Loading.finish();
}).catch((err) => {
this.$Loading.finish();
this.$Message.error(err);
});
} else {
this.tableData = [];
return;
}
}).catch((err) => {
this.$Loading.finish();
this.$Message.error(err);
});
},
isNumber(numStr) {
const isNumber = /^[0-9]+$/;
return isNumber.test(numStr);
},
exportList() {
const keysMap = {
productSku: 'productSku',
factoryCode: 'factoryCode',
upmCode: 'upmCode',
};
const fields = this.filters;
let temp = [];
let params = {};
_.each(keysMap, (val, key) => {
params[key] = fields[val].model;
});
params = _.pickBy(params, (v) => {
return (v + '').length;
});
_.each(params, (val, key) => {
if (val !== null) {
temp.push(`${key}=${val}`);
}
});
const href = `/Api/erp/exportStorageDetailList?${temp.join('&')}`;
window.open(href, '_blank');
},
},
components: {
EditIntro
}
};
</script>
<style lang="scss">
.help {
margin-left: 10px;
padding-top: 7px;
height: 32px;
display: inline-block;
vertical-align: top;
text-decoration: underline;
color: #2d8cf0;
font-style: normal;
cursor: pointer;
i {
font-size: 18px;
vertical-align: top;
margin-right: 5px;
}
}
</style>
... ...
/**
* on inventory page store
* @author: GeXuHui <xuhui.ge@yoho.cn>
* @date: 2017/08/31
*/
export default function() {
return {
tableFalse: false,
noFilteredDataText: '',
tableCols: [{
title: 'SKN',
key: 'productSkn',
align: 'center',
},
{
title: 'SKU',
key: 'productSku',
align: 'center'
},
{
title: '商家编码',
key: 'factoryCode',
align: 'center',
},
{
title: '入库识别码',
key: 'upmCode',
align: 'center',
render: (h, params) => {
return (
<span>{params.row.upmCode ? params.row.upmCode : '-'}</span>
);
},
},
{
title: '仓库可售库存',
key: 'total',
align: 'center'
},
{
title: 'JIT可调拨库存(可售)',
key: 'jitVirtual',
align: 'center'
},
{
title: '订单占用',
key: 'orderBuy',
align: 'center'
},
{
title: '退供应商占用',
key: 'returnSupplier',
align: 'center'
},
{
title: '残次货位',
key: 'defective',
align: 'center'
},
{
title: '仓库不可售(其他)',
key: 'otherStorage',
align: 'center'
},
{
title: '库存总计',
key: 'total',
align: 'center',
render: (h, params) => {
return (
<span>{params.row.total + params.row.jitVirtual +
params.row.orderBuy + params.row.returnSupplier +
params.row.defective + params.row.otherStorage}
(可售:{params.row.total + params.row.jitVirtual})</span>
);
},
}],
tableData: [],
pageData: {
total: 0,
current: 1,
pageSize: 20
},
filters: {
productSku: {
label: 'SKU编码',
labelSpan: 6,
model: '',
holder: '',
fieldSpan: 18
},
factoryCode: {
label: '商家编码',
labelSpan: 6,
model: '',
holder: '',
fieldSpan: 18
},
upmCode: {
label: '入库识别码',
labelSpan: 6,
model: '',
holder: '',
fieldSpan: 18
}
}
};
}
... ...
... ... @@ -115,6 +115,9 @@ export default {
if (!storages.length) {
return this.$Message.error('导入存储为空');
}
if (storages.length > 1000) {
return this.$Message.error('导入数据不能大于1000条');
}
this.jitService.updateStorage(storages).then(result => {
if (result.code === 200) {
this.$Notice.success({
... ...
... ... @@ -71,6 +71,10 @@ export default function() {
{
value: 4,
label: '已取消'
},
{
value: 5,
label: '收货完成(超时)'
}
]
}
... ... @@ -204,7 +208,8 @@ export default function() {
1: '已处理',
2: '已处理(超时)',
3: '收货完成',
4: '已取消'
4: '已取消',
5: '收货完成(超时)'
};
ot = ot === 'N' ? true : false;
... ...
... ... @@ -68,7 +68,7 @@
const params = {
pageNo: 1,
pageSize: 20,
statusList: [2, 3, 4]
statusList: [2, 3, 4, 5]
};
this.tradeService = new TradeService();
... ... @@ -79,7 +79,7 @@
let data = {
pageNo: 1,
pageSize: 20,
statusList: [2, 3, 4]
statusList: [2, 3, 4, 5]
};
if (!this.useFilterSign) {
... ...
/**
* 实时库存service
* @author: Gexuhui <xuhui.Ge@yoho.cn>
* @date: 2017/08/31
*/
import Service from '../service';
const apiUrl = {
storageList: '/erp/storageList'
};
class InventoryService extends Service {
list(params) {
return this.post(apiUrl.storageList, params);
}
}
export default InventoryService;
... ...
... ... @@ -46,12 +46,15 @@ let domainApis = {
settlementList: '/erp-shop-web/financeBill/settlementList',
inventoryLedgerList: '/erp-shop-web/inventoryLedger/list',
exportBalanceList: '/erp-shop-web/export/exportBalanceList',
exportInventoryLedgerList: '/erp-shop-web/export/exportInventoryLedgerList',
exportSettlementDetail: '/erp-shop-web/export/exportSettlementDetail',
exportBalanceDetail: '/erp-shop-web/export/exportBalanceDetail',
balanceDetailSum: '/erp-shop-web/financeBill/balanceDetailSum',
settlementListSum: '/erp-shop-web/financeBill/settlementListSum',
defectGoodsList: '/erp-shop-web/defectGoods/list',
defectGoodsImg: '/erp-shop-web/defectGoods/detail'
defectGoodsImg: '/erp-shop-web/defectGoods/detail',
storageList: '/erp-shop-web/storage/list',
exportStorageDetailList: '/erp-shop-web/export/exportStorageDetailList'
},
platform: {
queryShopsByAdminPid: '/SellerShopController/queryShopsByAdminPid',
... ...