Authored by 陈峰

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

@@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
17 </layout-filter> 17 </layout-filter>
18 <layout-list> 18 <layout-list>
19 <Button type="success" @click="print" class="table-btn">打印</Button> 19 <Button type="success" @click="print" class="table-btn">打印</Button>
  20 + <Button type="warning" @click="exportData" class="table-btn">导出</Button>
20 <Table border :columns="tableCols" :data="tableData"></Table> 21 <Table border :columns="tableCols" :data="tableData"></Table>
21 <Page :total="pageData.total" :current="pageData.pageNo" 22 <Page :total="pageData.total" :current="pageData.pageNo"
22 @on-change="pageChange" :page-size="20" show-total></Page> 23 @on-change="pageChange" :page-size="20" show-total></Page>
@@ -91,6 +92,15 @@ export default { @@ -91,6 +92,15 @@ export default {
91 92
92 window.open(href, '_blank'); 93 window.open(href, '_blank');
93 }, 94 },
  95 + exportData() {
  96 + const beginTime = this.startTime;
  97 + const endTime = this.endTime;
  98 +
  99 + const href = '/Api/erp/exportInventoryLedgerList?' +
  100 + `beginTime=${beginTime}&endTime=${endTime}`;
  101 +
  102 + window.open(href, '_blank');
  103 + },
94 returnPage() { 104 returnPage() {
95 this.$router.push({ 105 this.$router.push({
96 name: 'finance.clearing' 106 name: 'finance.clearing'
@@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
17 </layout-filter> 17 </layout-filter>
18 <layout-list> 18 <layout-list>
19 <Button type="success" @click="print" class="table-btn">打印</Button> 19 <Button type="success" @click="print" class="table-btn">打印</Button>
  20 + <Button type="warning" @click="exportData" class="table-btn">导出</Button>
20 <Table border :columns="tableCols" :data="tableData"></Table> 21 <Table border :columns="tableCols" :data="tableData"></Table>
21 <Page :total="pageData.total" :current="pageData.pageNo" 22 <Page :total="pageData.total" :current="pageData.pageNo"
22 @on-change="pageChange" :page-size="20" show-total></Page> 23 @on-change="pageChange" :page-size="20" show-total></Page>
@@ -92,6 +93,15 @@ export default { @@ -92,6 +93,15 @@ export default {
92 93
93 window.open(href, '_blank'); 94 window.open(href, '_blank');
94 }, 95 },
  96 + exportData() {
  97 + const beginTime = this.startTime;
  98 + const endTime = this.endTime;
  99 +
  100 + const href = '/Api/erp/exportInventoryLedgerList?' +
  101 + `beginTime=${beginTime}&endTime=${endTime}`;
  102 +
  103 + window.open(href, '_blank');
  104 + },
95 returnPage() { 105 returnPage() {
96 this.$router.push({ 106 this.$router.push({
97 name: 'finance.payment' 107 name: 'finance.payment'
@@ -5,7 +5,7 @@ import supplement from './supplement'; @@ -5,7 +5,7 @@ import supplement from './supplement';
5 import invoice from './invoice'; 5 import invoice from './invoice';
6 import express from './express'; 6 import express from './express';
7 import sellback from './sellback'; 7 import sellback from './sellback';
8 - 8 +import inventory from './inventory';
9 export default { 9 export default {
10 diff, 10 diff,
11 jit, 11 jit,
@@ -13,5 +13,6 @@ export default { @@ -13,5 +13,6 @@ export default {
13 prodReturn, 13 prodReturn,
14 invoice, 14 invoice,
15 express, 15 express,
16 - sellback 16 + sellback,
  17 + inventory
17 }; 18 };
  1 +<template>
  2 + <Modal v-model="model"
  3 + width="800"
  4 + :title="title"
  5 + class-name="vertical-center-modal">
  6 +
  7 + <div class="intro-item">
  8 + <p class="tip">*该功能提供整体库存情况查询、JIT合作模式库存维护请使用[仓库管理-JIT可调拨库存]</p>
  9 + <dl>
  10 + <dt class="bold">可售库存范畴:</dt>
  11 + <dd><label class="normal">仓库可售库存:</label>正常可以售卖的商品数量</dd>
  12 + <dd><label class="normal">JIT可调拨库存:</label>JIT合作模式使用,供应商可供销售调拨的商品库存数</dd>
  13 + </dl>
  14 + <dl>
  15 + <dt class="bold">不可售库存范畴:</dt>
  16 + <dd><label class="normal">订单占用:</label>商品下单后被占用的库存,包括已支付商品和未支付的商品,不可售卖</dd>
  17 + <dd><label class="normal">退供应商占用:</label>被绑定到退库单,准备做退库处理的商品库存,不可售卖</dd>
  18 + <dd><label class="normal">残次货位:</label>商品有质量问题,不可售卖</dd>
  19 + <dd><label class="normal">不可售(其他):</label>商品借出拍摄、测量或被有货其他渠道销售占用的库存等,不可在有货平台售卖,具体情况可联系品牌经理进行查询</dd>
  20 + </dl>
  21 + <dl>
  22 + <dd><label class="bold">库存总价:</label>全部商品库存的数量。其中,<span class="bold">可售库存,即作为商品在前台用于销售的库存,是有货仓库的可售库存和JIT可调拨库存的总和</span></dd>
  23 + </dl>
  24 + </div>
  25 +
  26 + <div slot="footer" style="textAlign: center;">
  27 + <Button type="primary" size="large" @click="close">关闭</Button>
  28 + </div>
  29 + </Modal>
  30 +</template>
  31 +
  32 +<script>
  33 +
  34 +export default {
  35 + name: 'edit-intro',
  36 + created() {
  37 + },
  38 + data() {
  39 + return {
  40 + model: false,
  41 + title: '帮助说明'
  42 + };
  43 + },
  44 + methods: {
  45 + show() {
  46 + this.model = true;
  47 + },
  48 + close() {
  49 + this.model = false;
  50 + },
  51 +
  52 + }
  53 +};
  54 +
  55 +</script>
  56 +
  57 +<style lang="scss">
  58 +.intro-item {
  59 + color: #999;
  60 +
  61 + .tip {
  62 + color: #ed3f14;
  63 + }
  64 +
  65 + .bold {
  66 + color: #444;
  67 + font-weight: bold;
  68 + }
  69 +
  70 + .normal {
  71 + color: #444;
  72 + }
  73 +
  74 + dl {
  75 + padding-top: 10px;
  76 + padding-bottom: 10px;
  77 + box-sizing: border-box;
  78 + border-bottom: 1px solid #e9eaec;
  79 +
  80 + &:nth-child(4) {
  81 + border-bottom: none;
  82 + }
  83 + }
  84 +}
  85 +</style>
  1 +export default {
  2 + path: '/inventory.html',
  3 + name: 'inventory',
  4 + component: () => import(/* webpackChunkName: "repository.inventory" */'./inventory'),
  5 + meta: {
  6 + pageName: '实时库存查询'
  7 + }
  8 +};
  1 +<template>
  2 + <layout-body>
  3 + <layout-filter>
  4 +
  5 + <filter-item :label="filters.productSku.label">
  6 + <Input v-model.trim="filters.productSku.model"
  7 + :placeholder="filters.productSku.holder" :maxlength="9"></Input>
  8 + </filter-item>
  9 + <filter-item :label="filters.factoryCode.label">
  10 + <Input v-model.trim="filters.factoryCode.model"
  11 + :placeholder="filters.factoryCode.holder" :maxlength="100" ></Input>
  12 + </filter-item>
  13 + <filter-item :label="filters.upmCode.label">
  14 + <Input v-model.trim="filters.upmCode.model"
  15 + :placeholder="filters.upmCode.holder" :maxlength="100" ></Input>
  16 + </filter-item>
  17 +
  18 + <filter-item>
  19 + <Button type="primary" @click="filterSearch">筛选</Button>
  20 + <Button @click="clearFilters">清空条件</Button>
  21 + <Button type="warning" @click="exportList">导出全部</Button>
  22 + <em class="help" @click="editIntro"><Icon type="ios-help"></Icon>帮助说明</em>
  23 + </filter-item>
  24 + </layout-filter>
  25 +
  26 + <layout-list>
  27 + <Table border :columns="tableCols" :data="tableData" :no-data-text="noFilteredDataText"></Table>
  28 + <Page :total="pageData.total" :current="pageData.current"
  29 + @on-change="pageChange" show-total></Page>
  30 + </layout-list>
  31 +
  32 + <edit-intro ref="showImgEdit" @on-success="editSuccess"></edit-intro>
  33 +
  34 + </layout-body>
  35 +</template>
  36 +
  37 +<script>
  38 + import _ from 'lodash';
  39 + import store from './store';
  40 + import EditIntro from './components/edit-intro.vue';
  41 + import InventoryService from 'services/repository/inventory-service';
  42 +
  43 + export default {
  44 + created() {
  45 + this.tableFalse = false;
  46 + this.inventoryService = new InventoryService();
  47 + this.noFilteredDataText = '请输入查询条件,进行数据筛选展示!';
  48 + },
  49 + data() {
  50 + return store.call(this);
  51 + },
  52 + watch: {
  53 + data() {
  54 + this.filters.productSku.model = null;
  55 + this.filters.factoryCode.model = null;
  56 + this.filters.upmCode.model = null;
  57 +
  58 + this.pageData.current = 1;
  59 + }
  60 +
  61 + },
  62 + methods: {
  63 + editIntro(row) {
  64 + this.$refs.showImgEdit.show(row);
  65 + },
  66 + editSuccess() {
  67 + this.filtersParams();
  68 + },
  69 + clearFilters() {
  70 + this.filters.productSku.model = null;
  71 + this.filters.factoryCode.model = null;
  72 + this.filters.upmCode.model = null;
  73 +
  74 + this.pageData.current = 1;
  75 + this.tableData = [];
  76 + this.noFilteredDataText = '请输入查询条件,进行数据筛选展示!';
  77 + },
  78 + pageChange(page) {
  79 + this.pageData.current = page;
  80 + this.getInventory();
  81 + },
  82 + filtersParams() {
  83 + let params = {};
  84 + let productSku = this.filters.productSku.model || null;
  85 + let factoryCode = this.filters.factoryCode.model || null;
  86 + let upmCode = this.filters.upmCode.model || null;
  87 +
  88 + let pageNo = this.pageData.current;
  89 + let pageSize = this.pageData.pageSize;
  90 +
  91 + if (this.filters.productSku.model) {
  92 + if (this.isNumber(this.filters.productSku.model)) {
  93 + params.productSku = this.filters.productSku.model;
  94 + } else {
  95 + return Promise.reject('sku必须是数字');
  96 + }
  97 + }
  98 +
  99 + params.pageSize = this.pageData.pageSize;
  100 + params.pageNo = this.pageData.current;
  101 +
  102 + return Promise.resolve({
  103 + params,
  104 + productSku,
  105 + factoryCode,
  106 + upmCode,
  107 + pageNo,
  108 + pageSize
  109 + });
  110 + },
  111 + filterSearch() {
  112 + this.pageData.current = 1;
  113 + this.getInventory();
  114 + },
  115 + getInventory() {
  116 + this.$Loading.start();
  117 + return this.filtersParams().then((params) => {
  118 +
  119 + if (params.productSku || params.factoryCode || params.upmCode) {
  120 + this.noFilteredDataText = '暂无数据';
  121 + return this.inventoryService.list(params).then((result) => {
  122 + if (result.code === 200) {
  123 + this.pageData.total = result.data.totalCount;
  124 + this.pageData.current = result.data.pageNo;
  125 + this.tableData = result.data.records;
  126 + }
  127 + this.$Loading.finish();
  128 + }).catch((err) => {
  129 + this.$Loading.finish();
  130 + this.$Message.error(err);
  131 + });
  132 + } else {
  133 + this.tableData = [];
  134 + return;
  135 + }
  136 + }).catch((err) => {
  137 + this.$Loading.finish();
  138 + this.$Message.error(err);
  139 + });
  140 + },
  141 + isNumber(numStr) {
  142 + const isNumber = /^[0-9]+$/;
  143 +
  144 + return isNumber.test(numStr);
  145 + },
  146 + exportList() {
  147 + const keysMap = {
  148 + productSku: 'productSku',
  149 + factoryCode: 'factoryCode',
  150 + upmCode: 'upmCode',
  151 +
  152 + };
  153 + const fields = this.filters;
  154 +
  155 + let temp = [];
  156 + let params = {};
  157 +
  158 + _.each(keysMap, (val, key) => {
  159 + params[key] = fields[val].model;
  160 + });
  161 +
  162 + params = _.pickBy(params, (v) => {
  163 + return (v + '').length;
  164 + });
  165 +
  166 + _.each(params, (val, key) => {
  167 + if (val !== null) {
  168 + temp.push(`${key}=${val}`);
  169 + }
  170 + });
  171 +
  172 + const href = `/Api/erp/exportStorageDetailList?${temp.join('&')}`;
  173 +
  174 + window.open(href, '_blank');
  175 + },
  176 + },
  177 + components: {
  178 + EditIntro
  179 + }
  180 + };
  181 +</script>
  182 +<style lang="scss">
  183 +.help {
  184 + margin-left: 10px;
  185 + padding-top: 7px;
  186 + height: 32px;
  187 + display: inline-block;
  188 + vertical-align: top;
  189 + text-decoration: underline;
  190 + color: #2d8cf0;
  191 + font-style: normal;
  192 + cursor: pointer;
  193 +
  194 + i {
  195 + font-size: 18px;
  196 + vertical-align: top;
  197 + margin-right: 5px;
  198 + }
  199 +}
  200 +</style>
  1 +/**
  2 + * on inventory page store
  3 + * @author: GeXuHui <xuhui.ge@yoho.cn>
  4 + * @date: 2017/08/31
  5 + */
  6 +
  7 +export default function() {
  8 + return {
  9 + tableFalse: false,
  10 + noFilteredDataText: '',
  11 + tableCols: [{
  12 + title: 'SKN',
  13 + key: 'productSkn',
  14 + align: 'center',
  15 + },
  16 + {
  17 + title: 'SKU',
  18 + key: 'productSku',
  19 + align: 'center'
  20 + },
  21 + {
  22 + title: '商家编码',
  23 + key: 'factoryCode',
  24 + align: 'center',
  25 + },
  26 +
  27 + {
  28 + title: '入库识别码',
  29 + key: 'upmCode',
  30 + align: 'center',
  31 + render: (h, params) => {
  32 + return (
  33 + <span>{params.row.upmCode ? params.row.upmCode : '-'}</span>
  34 + );
  35 + },
  36 + },
  37 + {
  38 + title: '仓库可售库存',
  39 + key: 'total',
  40 + align: 'center'
  41 + },
  42 + {
  43 + title: 'JIT可调拨库存(可售)',
  44 + key: 'jitVirtual',
  45 + align: 'center'
  46 + },
  47 + {
  48 + title: '订单占用',
  49 + key: 'orderBuy',
  50 + align: 'center'
  51 + },
  52 + {
  53 + title: '退供应商占用',
  54 + key: 'returnSupplier',
  55 + align: 'center'
  56 + },
  57 + {
  58 + title: '残次货位',
  59 + key: 'defective',
  60 + align: 'center'
  61 + },
  62 + {
  63 + title: '仓库不可售(其他)',
  64 + key: 'otherStorage',
  65 + align: 'center'
  66 + },
  67 + {
  68 + title: '库存总计',
  69 + key: 'total',
  70 + align: 'center',
  71 + render: (h, params) => {
  72 + return (
  73 + <span>{params.row.total + params.row.jitVirtual +
  74 + params.row.orderBuy + params.row.returnSupplier +
  75 + params.row.defective + params.row.otherStorage}
  76 + (可售:{params.row.total + params.row.jitVirtual})</span>
  77 + );
  78 + },
  79 + }],
  80 + tableData: [],
  81 + pageData: {
  82 + total: 0,
  83 + current: 1,
  84 + pageSize: 20
  85 + },
  86 + filters: {
  87 + productSku: {
  88 + label: 'SKU编码',
  89 + labelSpan: 6,
  90 + model: '',
  91 + holder: '',
  92 + fieldSpan: 18
  93 + },
  94 + factoryCode: {
  95 + label: '商家编码',
  96 + labelSpan: 6,
  97 + model: '',
  98 + holder: '',
  99 + fieldSpan: 18
  100 + },
  101 + upmCode: {
  102 + label: '入库识别码',
  103 + labelSpan: 6,
  104 + model: '',
  105 + holder: '',
  106 + fieldSpan: 18
  107 + }
  108 +
  109 + }
  110 + };
  111 +}
@@ -115,6 +115,9 @@ export default { @@ -115,6 +115,9 @@ export default {
115 if (!storages.length) { 115 if (!storages.length) {
116 return this.$Message.error('导入存储为空'); 116 return this.$Message.error('导入存储为空');
117 } 117 }
  118 + if (storages.length > 1000) {
  119 + return this.$Message.error('导入数据不能大于1000条');
  120 + }
118 this.jitService.updateStorage(storages).then(result => { 121 this.jitService.updateStorage(storages).then(result => {
119 if (result.code === 200) { 122 if (result.code === 200) {
120 this.$Notice.success({ 123 this.$Notice.success({
@@ -71,6 +71,10 @@ export default function() { @@ -71,6 +71,10 @@ export default function() {
71 { 71 {
72 value: 4, 72 value: 4,
73 label: '已取消' 73 label: '已取消'
  74 + },
  75 + {
  76 + value: 5,
  77 + label: '收货完成(超时)'
74 } 78 }
75 ] 79 ]
76 } 80 }
@@ -204,7 +208,8 @@ export default function() { @@ -204,7 +208,8 @@ export default function() {
204 1: '已处理', 208 1: '已处理',
205 2: '已处理(超时)', 209 2: '已处理(超时)',
206 3: '收货完成', 210 3: '收货完成',
207 - 4: '已取消' 211 + 4: '已取消',
  212 + 5: '收货完成(超时)'
208 }; 213 };
209 214
210 ot = ot === 'N' ? true : false; 215 ot = ot === 'N' ? true : false;
@@ -68,7 +68,7 @@ @@ -68,7 +68,7 @@
68 const params = { 68 const params = {
69 pageNo: 1, 69 pageNo: 1,
70 pageSize: 20, 70 pageSize: 20,
71 - statusList: [2, 3, 4] 71 + statusList: [2, 3, 4, 5]
72 }; 72 };
73 73
74 this.tradeService = new TradeService(); 74 this.tradeService = new TradeService();
@@ -79,7 +79,7 @@ @@ -79,7 +79,7 @@
79 let data = { 79 let data = {
80 pageNo: 1, 80 pageNo: 1,
81 pageSize: 20, 81 pageSize: 20,
82 - statusList: [2, 3, 4] 82 + statusList: [2, 3, 4, 5]
83 }; 83 };
84 84
85 if (!this.useFilterSign) { 85 if (!this.useFilterSign) {
  1 +/**
  2 + * 实时库存service
  3 + * @author: Gexuhui <xuhui.Ge@yoho.cn>
  4 + * @date: 2017/08/31
  5 + */
  6 +import Service from '../service';
  7 +const apiUrl = {
  8 + storageList: '/erp/storageList'
  9 +};
  10 +
  11 +class InventoryService extends Service {
  12 + list(params) {
  13 + return this.post(apiUrl.storageList, params);
  14 + }
  15 +}
  16 +export default InventoryService;
  17 +
@@ -46,12 +46,15 @@ let domainApis = { @@ -46,12 +46,15 @@ let domainApis = {
46 settlementList: '/erp-shop-web/financeBill/settlementList', 46 settlementList: '/erp-shop-web/financeBill/settlementList',
47 inventoryLedgerList: '/erp-shop-web/inventoryLedger/list', 47 inventoryLedgerList: '/erp-shop-web/inventoryLedger/list',
48 exportBalanceList: '/erp-shop-web/export/exportBalanceList', 48 exportBalanceList: '/erp-shop-web/export/exportBalanceList',
  49 + exportInventoryLedgerList: '/erp-shop-web/export/exportInventoryLedgerList',
49 exportSettlementDetail: '/erp-shop-web/export/exportSettlementDetail', 50 exportSettlementDetail: '/erp-shop-web/export/exportSettlementDetail',
50 exportBalanceDetail: '/erp-shop-web/export/exportBalanceDetail', 51 exportBalanceDetail: '/erp-shop-web/export/exportBalanceDetail',
51 balanceDetailSum: '/erp-shop-web/financeBill/balanceDetailSum', 52 balanceDetailSum: '/erp-shop-web/financeBill/balanceDetailSum',
52 settlementListSum: '/erp-shop-web/financeBill/settlementListSum', 53 settlementListSum: '/erp-shop-web/financeBill/settlementListSum',
53 defectGoodsList: '/erp-shop-web/defectGoods/list', 54 defectGoodsList: '/erp-shop-web/defectGoods/list',
54 - defectGoodsImg: '/erp-shop-web/defectGoods/detail' 55 + defectGoodsImg: '/erp-shop-web/defectGoods/detail',
  56 + storageList: '/erp-shop-web/storage/list',
  57 + exportStorageDetailList: '/erp-shop-web/export/exportStorageDetailList'
55 }, 58 },
56 platform: { 59 platform: {
57 queryShopsByAdminPid: '/SellerShopController/queryShopsByAdminPid', 60 queryShopsByAdminPid: '/SellerShopController/queryShopsByAdminPid',