Authored by 陈峰

Merge branch 'feature/business-board-add-field' into 'master'

增加进销存报表,商品看板增加字段



See merge request !101
@@ -13,3 +13,4 @@ app/bundle @@ -13,3 +13,4 @@ app/bundle
13 build/dll/ 13 build/dll/
14 server/bundle/*.json 14 server/bundle/*.json
15 server/bundle/**/ 15 server/bundle/**/
  16 +dist
@@ -4,11 +4,13 @@ import outinstore from './outinstore-iframe'; @@ -4,11 +4,13 @@ import outinstore from './outinstore-iframe';
4 import stock from './stock-iframe'; 4 import stock from './stock-iframe';
5 import shop from './shop'; 5 import shop from './shop';
6 import product from './product'; 6 import product from './product';
  7 +import inventory from './inventory';
7 export default { 8 export default {
8 overview, 9 overview,
9 sale, 10 sale,
10 outinstore, 11 outinstore,
11 stock, 12 stock,
12 shop, 13 shop,
13 - product 14 + product,
  15 + inventory
14 }; 16 };
  1 +export default {
  2 + path: '/inventory.html',
  3 + name: 'inventory',
  4 + component: () => import(/* webpackChunkName: "statistics.inventory" */'./inventory'),
  5 + meta: {
  6 + pageName: '进销存报表'
  7 + }
  8 +};
  1 +<template>
  2 + <div class="stat-shop">
  3 + <layout-body>
  4 + <p slot="title">商品看板</p>
  5 + <div class="box-filter" :inline="true" :col="1">
  6 + <Row>
  7 + <Col span="2">选择品牌:</Col>
  8 + <Col span="6">
  9 + <Select v-model="brandId" style="width: 200px;">
  10 + <Option value="0">请选择品牌</Option>
  11 + <Option v-for="item in brandList" :value="item.id" :key="item.id">
  12 + {{item.brandName}}
  13 + </Option>
  14 + </Select>
  15 + </Col>
  16 + <Col span="2">选择类目:</Col>
  17 + <Col span="6">
  18 + <select-category :value="categoryValue" @select-change="sortChange"></select-category>
  19 + </Col>
  20 + <Col span="2">货品年季:</Col>
  21 + <Col span="6">
  22 + <Select v-model="goodsYearsValue" style="width: 120px;">
  23 + <Option value="0">请选择年</Option>
  24 + <Option v-for="item in goodsYearsList" :value="item.value" :key="item.value">
  25 + {{item.name}}
  26 + </Option>
  27 + </Select>
  28 + <Select v-model="goodsSeasonsValue" style="width: 120px;">
  29 + <Option value="0">请选择季</Option>
  30 + <Option v-for="item in goodsSeasonsList" :value="item.value" :key="item.value">
  31 + {{item.name}}
  32 + </Option>
  33 + </Select>
  34 + </Col>
  35 + </Row>
  36 + <Row>
  37 + <Col span="2">时间:</Col>
  38 + <Col span="6">
  39 + <Date-picker
  40 + type="daterange"
  41 + v-model="dateRange"
  42 + format="yyyy-MM-dd"
  43 + placeholder="选择开始结束日期"></Date-picker>
  44 + </Col>
  45 + <Col span="6">
  46 + <Poptip trigger="hover" placement="bottom-end">
  47 + <div slot="content">
  48 + * 查询的时间跨度不得超过30天
  49 + </div>
  50 + <Button type="primary" @click="list">筛选</Button>
  51 + </Poptip>
  52 + <Poptip trigger="hover" placement="bottom-end">
  53 + <div slot="content">
  54 + * 仅支持历史数据,时间跨度不得超过30天
  55 + </div>
  56 + <Button type="primary" @click="exportFile">导出</Button>
  57 + </Poptip>
  58 + </Col>
  59 + </Row>
  60 +
  61 + </div>
  62 + <layout-list>
  63 + <Table border :columns="tableCols" :data="tableData"></Table>
  64 + <Page :total="pageData.total" :current="pageData.current"
  65 + @on-change="pageChange" :page-size="20" show-total></Page>
  66 + </layout-list>
  67 + </layout-body>
  68 + </div>
  69 +</template>
  70 +
  71 +<script>
  72 + import moment from 'moment';
  73 + import InventoryStore from './store';
  74 + import InventoryService from 'services/inventory/inventory-service';
  75 +
  76 + export default {
  77 + data() {
  78 + return InventoryStore.call(this);
  79 + },
  80 + created() {
  81 + this.inventoryService = new InventoryService();
  82 + },
  83 + mounted() {
  84 + this.loadData();
  85 + },
  86 + watch: {
  87 + dateRange(newDate) {
  88 + if (!Array.isArray(newDate)) {
  89 + newDate = [];
  90 + }
  91 + if (!newDate[0]) {
  92 + newDate[0] = moment().format('YYYY-MM-DD');
  93 + }
  94 + if (!newDate[1]) {
  95 + newDate[1] = moment().format('YYYY-MM-DD');
  96 + }
  97 + this.beginDate = moment(Array.isArray(newDate) ? newDate[0] : newDate).format('YYYY-MM-DD');
  98 + this.endDate = moment(Array.isArray(newDate) ? newDate[1] : newDate).format('YYYY-MM-DD');
  99 +// this.day = this.beginDate === this.endDate === this.today ? '' : this.beginDate;
  100 + this.pageData.current = 1;
  101 + },
  102 + },
  103 + methods: {
  104 + loadData() {
  105 + this.addGoodsYears();
  106 + this.getBrandList();
  107 + this.list();
  108 + },
  109 + changeLimit(limit) {
  110 + this.dateRange = [this[`day${limit}`], this.today];
  111 + this.pageData.current = 1;
  112 + },
  113 + pageChange(page) {
  114 + this.pageData.current = page;
  115 + this.list();
  116 + },
  117 + addGoodsYears() {
  118 + let date = new Date();
  119 + let startYear = 2018;
  120 + let yearList = [];
  121 +
  122 + for (let i = date.getFullYear(); i > startYear; i--) {
  123 + yearList.push({
  124 + name: i.toString() + '年',
  125 + value: i
  126 + })
  127 + }
  128 +
  129 + this.goodsYearsList = yearList;
  130 + },
  131 + getBrandList() {
  132 + return this.inventoryService.queryBrandsByShopId().then(result => {
  133 + this.brandList = result.data;
  134 + })
  135 + },
  136 + sortChange(sort) {
  137 + this.maxSortId = sort.max;
  138 + this.middleSortId = sort.mid;
  139 + this.smallSortId = sort.min;
  140 + },
  141 + filterParams() {
  142 + let pageNum = this.pageData.current;
  143 + let pageSize = this.pageData.pageSize;
  144 + let brandId = parseInt(this.brandId) ? {brandId: this.brandId} : {};
  145 + let goodYear = parseInt(this.goodsYearsValue) ? {goodYear: this.goodsYearsValue} : {};
  146 + let goodSeason = parseInt(this.goodsSeasonsValue) ? {goodSeason: this.goodsSeasonsValue} : {};
  147 + let smallSortId = parseInt(this.smallSortId) ? {smallSortId: this.smallSortId} : {};
  148 +
  149 + let begin = this.beginDate;
  150 + let end = this.endDate;
  151 +
  152 + return Promise.resolve(Object.assign({}, {
  153 + pageNum,
  154 + pageSize,
  155 + begin,
  156 + end
  157 + }, brandId, goodYear, goodSeason, smallSortId));
  158 + },
  159 + list() {
  160 + this.$Loading.start();
  161 +
  162 + return this.filterParams().then(params => {
  163 + return this.inventoryService.queryProductInvoicingOverview(params)
  164 + }).then(result => {
  165 + if (!result.data) {
  166 + result.data = {
  167 + pageNo: 1,
  168 + pageSize: 1,
  169 + totalCount: 1,
  170 + totalPage: 1,
  171 + records: []
  172 + }
  173 + }
  174 + this.pageData.total = result.data.totalCount;
  175 + this.pageData.current = result.data.pageNo;
  176 + this.tableData = result.data.records;
  177 + this.$Loading.finish();
  178 + }).catch(() => {
  179 + this.$Loading.finish();
  180 + });
  181 + },
  182 + exportFile() {
  183 + let param = {};
  184 +
  185 + param.begin = this.beginDate;
  186 + param.end = this.endDate;
  187 + param.platform = '1,2,3,4';
  188 + if (this.brandId && parseInt(this.brandId)) {
  189 + param.brandId = this.brandId;
  190 + }
  191 + if (this.goodsYearsValue && parseInt(this.goodsYearsValue)) {
  192 + param.goodYear = this.goodsYearsValue;
  193 + }
  194 +
  195 + if (this.goodsSeasonsValue && parseInt(this.goodsSeasonsValue)) {
  196 + param.goodSeason = this.goodsSeasonsValue;
  197 + }
  198 +
  199 + if (this.smallSortId && parseInt(this.smallSortId)) {
  200 + param.smallSortId = this.smallSortId;
  201 + }
  202 +
  203 + const href = '/Api/platform/exportProductInvoicingOverview?queryConf=' +
  204 + JSON.stringify(param);
  205 +
  206 + window.open(href, '_blank');
  207 + }
  208 + }
  209 + };
  210 +</script>
  211 +
  212 +<style lang="scss">
  213 + .stat-shop {
  214 + .ivu-tabs-tabpane {
  215 + height: 400px;
  216 + position: relative;
  217 + }
  218 + }
  219 +
  220 + .layout-container {
  221 + min-height: 200px;
  222 + margin: 15px;
  223 + overflow: hidden;
  224 + background: #fff;
  225 + border-radius: 4px;
  226 +
  227 + .layout-filter .line {
  228 + border-top: none;
  229 + margin-bottom: 0;
  230 + }
  231 + }
  232 +
  233 + .shop-card {
  234 + margin-top: 10px;
  235 + margin-bottom: 10px;
  236 + }
  237 +
  238 + .box-title {
  239 + font-weight: 700;
  240 + color: #495060;
  241 + font-size: 16px;
  242 + line-height: 22px;
  243 + margin: 5px;
  244 +
  245 + &:before {
  246 + content: " ";
  247 + display: inline-block;
  248 + width: 5px;
  249 + margin-right: 2px;
  250 + height: 22px;
  251 + vertical-align: top;
  252 + background-color: #999;
  253 + }
  254 + }
  255 +
  256 + .box-item {
  257 + width: 90%;
  258 + height: 50px;
  259 + padding: 0 0 0 15px;
  260 + line-height: 50px;
  261 + font-size: 14px;
  262 + overflow: hidden;
  263 + border-radius: 5px;
  264 + color: #fff;
  265 + margin-bottom: 10px;
  266 +
  267 + .box-item-label {
  268 + display: inline-block;
  269 + min-width: 75px;
  270 + vertical-align: top;
  271 + font-weight: normal;
  272 + }
  273 +
  274 + .box-item-value {
  275 + font-size: 20px;
  276 + font-weight: 600;
  277 + }
  278 +
  279 + i {
  280 + display: inline-block;
  281 + width: 20px;
  282 + height: 20px;
  283 + font-size: 22px;
  284 + text-align: center;
  285 + margin-top: -7px;
  286 + vertical-align: middle;
  287 + margin-right: 3px;
  288 + }
  289 + }
  290 +
  291 + .box-filter {
  292 + .ivu-date-picker {
  293 + margin-left: 0;
  294 + width: 220px !important;
  295 + }
  296 +
  297 + .ivu-col {
  298 + height: 32px;
  299 + line-height: 32px;
  300 + text-align: center;
  301 + margin-bottom: 20px;
  302 + }
  303 +
  304 + .ivu-btn {
  305 + margin: 0 10px;
  306 + }
  307 +
  308 + .ivu-cascader {
  309 + max-width: 220px;
  310 + }
  311 +
  312 + .quick {
  313 + display: inline-block;
  314 + margin-left: 20px;
  315 + margin-right: 50px;
  316 +
  317 + a {
  318 + margin-right: 5px;
  319 + }
  320 + }
  321 +
  322 + .brand-select-container {
  323 + display: inline-block;
  324 + width: 280px;
  325 + }
  326 + margin-bottom: 20px;
  327 + border-bottom: 1px solid #f0f0f0;
  328 + }
  329 +
  330 + .ivu-table-cell {
  331 + padding-left: 6px;
  332 + padding-right: 6px;
  333 + }
  334 +
  335 +
  336 +</style>
  337 +
  1 +/**
  2 + * on product page store
  3 + * @author: Gexuhui
  4 + * @date: 2017/08/23
  5 + */
  6 +import moment from 'moment';
  7 +let curDay = moment().format('YYYY-MM-DD');
  8 +
  9 +export default function() {
  10 + return {
  11 + day: curDay,
  12 + date: curDay,
  13 + dateRange: [curDay, curDay],
  14 + categoryValue: [],
  15 + maxSortId: 0,
  16 + middleSortId: 0,
  17 + smallSortId: 0,
  18 + goodsYearsValue: '0',
  19 + goodsSeasonsValue: '0',
  20 + beginDate: curDay,
  21 + endDate: curDay,
  22 + today: moment().format('YYYY-MM-DD'),
  23 + yesterday: moment().add(-1, 'days').format('YYYY-MM-DD'),
  24 + day7: moment().add(-6, 'days').format('YYYY-MM-DD'),
  25 + day30: moment().add(-29, 'days').format('YYYY-MM-DD'),
  26 + timeLimit: true,
  27 + goodsSeasonsList: [
  28 + {
  29 + name: '春',
  30 + value: 1
  31 + },
  32 + {
  33 + name: '夏',
  34 + value: 2
  35 + },
  36 + {
  37 + name: '秋',
  38 + value: 3
  39 + },
  40 + {
  41 + name: '冬',
  42 + value: 4
  43 + },
  44 + {
  45 + name: '春夏',
  46 + value: 5
  47 + },
  48 + {
  49 + name: '秋冬',
  50 + value: 6
  51 + }
  52 + ],
  53 + goodsYearsList: [],
  54 + tableCols: [
  55 + {
  56 + title: 'skn',
  57 + align: 'center',
  58 + width: 70,
  59 + key: 'skn'
  60 + },
  61 + {
  62 + title: 'sku',
  63 + align: 'center',
  64 + width: 70,
  65 + key: 'sku'
  66 + },
  67 + {
  68 + title: '品牌',
  69 + align: 'center',
  70 + width: 85,
  71 + key: 'brandName'
  72 + },
  73 + {
  74 + title: '厂家编号',
  75 + align: 'center',
  76 + width: 75,
  77 + key: 'factoryCode'
  78 + },
  79 + {
  80 + title: '货品年季',
  81 + align: 'center',
  82 + width: 75,
  83 + key: 'goodYearSeason'
  84 + },
  85 + {
  86 + title: '三级品类',
  87 + align: 'center',
  88 + width: 75,
  89 + key: 'smallSortName'
  90 + },
  91 + {
  92 + title: '性别',
  93 + align: 'center',
  94 + key: 'gender'
  95 + },
  96 + {
  97 + title: '吊牌价',
  98 + align: 'center',
  99 + width: 70,
  100 + key: 'retailPrice'
  101 + },
  102 + {
  103 + title: '当前价',
  104 + align: 'center',
  105 + width: 70,
  106 + key: 'salePrice'
  107 + },
  108 + {
  109 + title: '采购入库数',
  110 + key: 'inNum',
  111 + align: 'center',
  112 + sortable: false
  113 + },
  114 + {
  115 + title: '采购入库金额',
  116 + key: 'inAmount',
  117 + align: 'center',
  118 + width: 85,
  119 + sortable: false
  120 + },
  121 + {
  122 + title: '退供应商数',
  123 + key: 'outNum',
  124 + align: 'center',
  125 + sortable: false
  126 + },
  127 + {
  128 + title: '退供应商金额',
  129 + key: 'outAmount',
  130 + align: 'center',
  131 + width: 85,
  132 + sortable: false
  133 + },
  134 + {
  135 + title: '交易数量',
  136 + key: 'postNum',
  137 + align: 'center',
  138 + sortable: false
  139 + },
  140 + {
  141 + title: '交易金额',
  142 + key: 'postAmount',
  143 + align: 'center',
  144 + sortable: false
  145 + },
  146 + {
  147 + title: '库存数量',
  148 + key: 'storageNum',
  149 + align: 'center',
  150 + sortable: false
  151 + },
  152 + {
  153 + title: '库存金额',
  154 + key: 'storageAmount',
  155 + align: 'center',
  156 + sortable: false
  157 + }
  158 + ],
  159 + tableData: [],
  160 + brandList: [],
  161 + brandId: '0',
  162 + pageData: {
  163 + total: 0,
  164 + current: 1,
  165 + pageSize: 20
  166 + },
  167 + filters: {
  168 + dateRange: {
  169 + model: ''
  170 + },
  171 + begin: {
  172 + model: ''
  173 + },
  174 + end: {
  175 + model: ''
  176 + }
  177 + }
  178 + };
  179 +}
@@ -13,6 +13,16 @@ @@ -13,6 +13,16 @@
13 <a href="javascript:;" @click="() => {changeLimit(7)}">近7天</a> 13 <a href="javascript:;" @click="() => {changeLimit(7)}">近7天</a>
14 <a href="javascript:;" @click="() => {changeLimit(30)}">近30天</a> 14 <a href="javascript:;" @click="() => {changeLimit(30)}">近30天</a>
15 </div> 15 </div>
  16 + <div class="brand-select-container">
  17 + <span>选择品牌: </span>
  18 + <Select v-model="brandId" style="width: 200px;">
  19 + <Option value="0">请选择品牌</Option>
  20 + <Option v-for="item in brandList" :value="item.id" :key="item.id">
  21 + {{item.brandName}}
  22 + </Option>
  23 + </Select>
  24 + </div>
  25 +
16 <Poptip trigger="hover" placement="bottom-end"> 26 <Poptip trigger="hover" placement="bottom-end">
17 <div slot="content"> 27 <div slot="content">
18 * 仅支持历史数据,时间跨度不得超过30天 28 * 仅支持历史数据,时间跨度不得超过30天
@@ -66,11 +76,15 @@ @@ -66,11 +76,15 @@
66 this.day = this.beginDate === this.endDate === this.today ? '' : this.beginDate; 76 this.day = this.beginDate === this.endDate === this.today ? '' : this.beginDate;
67 this.pageData.current = 1; 77 this.pageData.current = 1;
68 this.list(); 78 this.list();
  79 + },
  80 + brandId() {
  81 + this.list();
69 } 82 }
70 }, 83 },
71 methods: { 84 methods: {
72 loadData() { 85 loadData() {
73 this.list(); 86 this.list();
  87 + this.getBrandList();
74 }, 88 },
75 changeLimit(limit) { 89 changeLimit(limit) {
76 this.dateRange = [this[`day${limit}`], this.today]; 90 this.dateRange = [this[`day${limit}`], this.today];
@@ -94,16 +108,34 @@ @@ -94,16 +108,34 @@
94 pageSize 108 pageSize
95 }); 109 });
96 }, 110 },
  111 + getBrandList() {
  112 + return this.productService.queryBrandsByShopId().then(result => {
  113 + this.brandList = result.data;
  114 + })
  115 + },
97 list() { 116 list() {
98 this.$Loading.start(); 117 this.$Loading.start();
99 118
100 return this.filtersParams().then((params) => { 119 return this.filtersParams().then((params) => {
101 - return this.productService.getShopOverview({ 120 + let filter = {
102 begin: this.beginDate, 121 begin: this.beginDate,
103 end: this.endDate, 122 end: this.endDate,
104 - pageNo: params.pageNo  
105 - }); 123 + pageNo: params.pageNo,
  124 + };
  125 + if (this.brandId && this.brandId !== '0') {
  126 + filter = Object.assign({}, filter, {brandId: this.brandId});
  127 + }
  128 + return this.productService.getShopOverview(filter);
106 }).then(result => { 129 }).then(result => {
  130 + if (!result.data) {
  131 + result.data = {
  132 + pageNo: 1,
  133 + pageSize: 1,
  134 + totalCount: 1,
  135 + totalPage: 1,
  136 + records: []
  137 + }
  138 + }
107 this.pageData.total = result.data.totalCount; 139 this.pageData.total = result.data.totalCount;
108 this.pageData.current = result.data.pageNo; 140 this.pageData.current = result.data.pageNo;
109 this.tableData = result.data.records; 141 this.tableData = result.data.records;
@@ -118,6 +150,9 @@ @@ -118,6 +150,9 @@
118 param.begin = this.beginDate; 150 param.begin = this.beginDate;
119 param.end = this.endDate; 151 param.end = this.endDate;
120 param.platform = '1,2,3,4'; 152 param.platform = '1,2,3,4';
  153 + if (this.brandId && this.brandId !== '0') {
  154 + param.brandId = this.brandId;
  155 + }
121 156
122 const href = '/Api/platform/exportOneShopProductOverview?queryConf=' + 157 const href = '/Api/platform/exportOneShopProductOverview?queryConf=' +
123 JSON.stringify(param); 158 JSON.stringify(param);
@@ -222,6 +257,16 @@ @@ -222,6 +257,16 @@
222 margin-right: 5px; 257 margin-right: 5px;
223 } 258 }
224 } 259 }
  260 +
  261 + .brand-select-container {
  262 + display: inline-block;
  263 + width: 280px;
  264 + }
  265 + }
  266 +
  267 + .ivu-table-cell {
  268 + padding-left: 6px;
  269 + padding-right: 6px;
225 } 270 }
226 </style> 271 </style>
227 272
@@ -22,7 +22,7 @@ export default function() { @@ -22,7 +22,7 @@ export default function() {
22 { 22 {
23 title: '商品图片', 23 title: '商品图片',
24 key: 'image', 24 key: 'image',
25 - width: 120, 25 + width: '10%',
26 align: 'center', 26 align: 'center',
27 render: (h, params) => { 27 render: (h, params) => {
28 return ( 28 return (
@@ -31,6 +31,36 @@ export default function() { @@ -31,6 +31,36 @@ export default function() {
31 } 31 }
32 }, 32 },
33 { 33 {
  34 + title: 'skn',
  35 + align: 'center',
  36 + width: 90,
  37 + key: 'skn'
  38 + },
  39 + {
  40 + title: '厂家编号',
  41 + align: 'center',
  42 + width: 90,
  43 + key: 'factoryCode'
  44 + },
  45 + {
  46 + title: '性别',
  47 + align: 'center',
  48 + width: 80,
  49 + key: 'gender'
  50 + },
  51 + {
  52 + title: '三级品类',
  53 + align: 'center',
  54 + width: 90,
  55 + key: 'smallSortName'
  56 + },
  57 + {
  58 + title: '吊牌价',
  59 + align: 'center',
  60 + width: 90,
  61 + key: 'retailPrice'
  62 + },
  63 + /*{
34 title: '商品', 64 title: '商品',
35 align: 'center', 65 align: 'center',
36 width: 200, 66 width: 200,
@@ -44,7 +74,7 @@ export default function() { @@ -44,7 +74,7 @@ export default function() {
44 </div> 74 </div>
45 ); 75 );
46 } 76 }
47 - }, 77 + },*/
48 78
49 // { 79 // {
50 // title: '访客数', 80 // title: '访客数',
@@ -113,6 +143,18 @@ export default function() { @@ -113,6 +143,18 @@ export default function() {
113 sortable: true 143 sortable: true
114 }, 144 },
115 { 145 {
  146 + title: '库存数',
  147 + key: 'stock',
  148 + align: 'center',
  149 + sortable: true
  150 + },
  151 + {
  152 + title: '交寄数',
  153 + key: 'completeNum',
  154 + align: 'center',
  155 + sortable: true
  156 + }
  157 + /*{
116 title: '订单转化率', 158 title: '订单转化率',
117 key: 'paymentOrderAmountUidsRate', 159 key: 'paymentOrderAmountUidsRate',
118 align: 'center', 160 align: 'center',
@@ -126,9 +168,11 @@ export default function() { @@ -126,9 +168,11 @@ export default function() {
126 </div> 168 </div>
127 ); 169 );
128 } 170 }
129 - }, 171 + },*/
130 ], 172 ],
131 tableData: [], 173 tableData: [],
  174 + brandList: [],
  175 + brandId: '0',
132 pageData: { 176 pageData: {
133 total: 0, 177 total: 0,
134 current: 1, 178 current: 1,
  1 +/**
  2 + * Created by qiujun on 2019/3/22.
  3 + */
  4 +import InventroyService from './inventory-service';
  5 +
  6 +export {
  7 + InventroyService
  8 +};
  1 +/**
  2 + * Created by qiujun on 2019/3/22.
  3 + */
  4 +import Service from '../service';
  5 +
  6 +const apiUrl = {
  7 + queryBrandsByShopId: '/platform/queryBrandsByShopId',
  8 + queryProductInvoicingOverview: '/platform/queryProductInvoicingOverview'
  9 +};
  10 +
  11 +class InventroyService extends Service {
  12 + queryBrandsByShopId(params) {
  13 + return this.get(apiUrl.queryBrandsByShopId, params);
  14 + }
  15 +
  16 + queryProductInvoicingOverview(params) {
  17 + return this.post(apiUrl.queryProductInvoicingOverview, params);
  18 + }
  19 +}
  20 +
  21 +export default InventroyService;
@@ -7,6 +7,7 @@ import Service from '../service'; @@ -7,6 +7,7 @@ import Service from '../service';
7 7
8 const apiUrl = { 8 const apiUrl = {
9 queryOneShopProductOverview: '/platform/queryOneShopProductOverview', 9 queryOneShopProductOverview: '/platform/queryOneShopProductOverview',
  10 + queryBrandsByShopId: '/platform/queryBrandsByShopId'
10 }; 11 };
11 12
12 class ProductService extends Service { 13 class ProductService extends Service {
@@ -14,6 +15,10 @@ class ProductService extends Service { @@ -14,6 +15,10 @@ class ProductService extends Service {
14 getShopOverview(params) { 15 getShopOverview(params) {
15 return this.post(apiUrl.queryOneShopProductOverview, params); 16 return this.post(apiUrl.queryOneShopProductOverview, params);
16 } 17 }
  18 +
  19 + queryBrandsByShopId(params) {
  20 + return this.get(apiUrl.queryBrandsByShopId, params);
  21 + }
17 } 22 }
18 23
19 export default ProductService; 24 export default ProductService;
@@ -6,8 +6,8 @@ module.exports = { @@ -6,8 +6,8 @@ module.exports = {
6 env: { 6 env: {
7 NODE_ENV: '"production"' 7 NODE_ENV: '"production"'
8 }, 8 },
9 - index: path.resolve(__dirname, `../public/dist/${pkg.name}/${pkg.version}/index.html`),  
10 - assetsRoot: path.resolve(__dirname, `../public/dist/${pkg.name}/`), 9 + index: path.resolve(__dirname, `../dist/statics/${pkg.name}/${pkg.version}/index.html`),
  10 + assetsRoot: path.resolve(__dirname, `../dist/statics/${pkg.name}/`),
11 assetsSubDirectory: 'static', 11 assetsSubDirectory: 'static',
12 assetsPublicPath: '//cdn.yoho.cn/yoho-shop-manage/', 12 assetsPublicPath: '//cdn.yoho.cn/yoho-shop-manage/',
13 productionSourceMap: true, 13 productionSourceMap: true,
  1 +const shelljs = require('shelljs');
  2 +const path = require('path');
  3 +
  4 +const distDir = path.join(__dirname, '../dist/node');
  5 +
  6 +shelljs.rm('-rf', distDir);
  7 +shelljs.mkdir('-p', distDir);
  8 +
  9 +const cpPaths = [
  10 + '.npmrc',
  11 + 'process.json',
  12 + 'Dockerfile',
  13 + 'yarn.lock',
  14 + 'package.json',
  15 + 'server',
  16 + 'manifest.json'
  17 +];
  18 +
  19 +new Promise(resolve => { // 加载manifest.json文件
  20 + resolve();
  21 +}).then(() => { // 拷贝node代码
  22 + cpPaths.forEach(p => {
  23 + let dist = distDir;
  24 + let file = p;
  25 +
  26 + if (typeof p === 'object') {
  27 + dist = path.join(dist, p[1]);
  28 + file = p[0];
  29 +
  30 + if (!shelljs.test('-e', dist)) {
  31 + shelljs.mkdir('-p', dist);
  32 + }
  33 + }
  34 + shelljs.cp('-R', path.join(__dirname, '../', file), dist);
  35 + });
  36 +}).then(() => { // 安装依赖和清理node_modules
  37 +
  38 + shelljs.cd(distDir);
  39 + if (shelljs.exec('yarn --production=true').code !== 0) {
  40 + throw 'yarn install faild';
  41 + }
  42 +}).catch(error => {
  43 + console.error(`error:${error}`);
  44 + return process.exit(1); //eslint-disable-line
  45 +});
  46 +
  47 +
  48 +
  49 +
  50 +
  51 +
This diff could not be displayed because it is too large.
1 { 1 {
2 "name": "yoho-shop-manage", 2 "name": "yoho-shop-manage",
3 - "version": "1.0.38", 3 + "version": "1.0.40",
4 "description": "", 4 "description": "",
5 "main": "app.js", 5 "main": "app.js",
6 "scripts": { 6 "scripts": {
@@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
8 "dev": "nodemon --watch server server/app.js", 8 "dev": "nodemon --watch server server/app.js",
9 "static": "node ./build/dev-server.js", 9 "static": "node ./build/dev-server.js",
10 "dist": "node ./build/build.js", 10 "dist": "node ./build/build.js",
  11 + "build:node": "node ./build/node-build.js",
11 "build": "npm run build:dll --production && node ./build/build.js", 12 "build": "npm run build:dll --production && node ./build/build.js",
12 "build:dll": "rimraf build/dll && webpack --config build/webpack.dll.conf.js", 13 "build:dll": "rimraf build/dll && webpack --config build/webpack.dll.conf.js",
13 "lint-js": "lint-js", 14 "lint-js": "lint-js",
@@ -124,7 +124,10 @@ let domainApis = { @@ -124,7 +124,10 @@ let domainApis = {
124 queryWarehouseProductList: '/SellerDistributionController/queryWarehouseProductList', 124 queryWarehouseProductList: '/SellerDistributionController/queryWarehouseProductList',
125 batchDelProduct: '/SellerDistributionController/batchDelProduct', 125 batchDelProduct: '/SellerDistributionController/batchDelProduct',
126 queryPoolProductList: '/SellerDistributionController/queryPoolProductList', 126 queryPoolProductList: '/SellerDistributionController/queryPoolProductList',
127 - getBrandNames: '/SellerDistributionController/getBrandNames' 127 + getBrandNames: '/SellerDistributionController/getBrandNames',
  128 + queryBrandsByShopId: '/SellerShopsBrandsController/queryBrandsByShopId', // 根据店铺Id获取品牌列表下拉框数据
  129 + queryProductInvoicingOverview: '/merchant/queryProductInvoicingOverview', // 商家进销存报表查询
  130 + exportProductInvoicingOverview: '/merchant/exportProductInvoicingOverview', // 商家进销存报表导出
128 }, 131 },
129 shop: { 132 shop: {
130 login: '/loginInter', 133 login: '/loginInter',
@@ -134,14 +137,17 @@ let domainApis = { @@ -134,14 +137,17 @@ let domainApis = {
134 137
135 // 域名列表 138 // 域名列表
136 const domains = { 139 const domains = {
137 - erp: 'http://192.168.103.82:9098', 140 + /* erp: 'http://192.168.103.82:9098',
138 platform: 'http://192.168.102.202:8088/platform', 141 platform: 'http://192.168.102.202:8088/platform',
139 - shop: 'http://192.168.102.211:30016' 142 + shop: 'http://192.168.102.211:30016'*/
  143 + erp: 'http://192.168.103.48:9098',
  144 + platform: 'http://java-yoho-platform.test3.ingress.dev.yohocorp.com/platform',
  145 + shop: 'http://192.168.102.211:30016',
140 }; 146 };
141 147
142 if (global.env.Test) { 148 if (global.env.Test) {
143 - domains.erp = 'http://192.168.103.82:9098';  
144 - domains.platform = 'http://192.168.102.202:8088/platform'; 149 + domains.erp = 'http://192.168.103.48:9098';
  150 + domains.platform = 'http://java-yoho-platform.test3.ingress.dev.yohocorp.com/platform';
145 domains.shop = 'http://192.168.102.211:30016'; 151 domains.shop = 'http://192.168.102.211:30016';
146 } 152 }
147 153