Authored by 陈峰

merge

@@ -4,6 +4,7 @@ import SelectSeason from './select-season'; @@ -4,6 +4,7 @@ import SelectSeason from './select-season';
4 import SelectRoom from './select-room'; 4 import SelectRoom from './select-room';
5 import SelectExpress from './select-express'; 5 import SelectExpress from './select-express';
6 import SelectStockStatus from './select-stock-status'; 6 import SelectStockStatus from './select-stock-status';
  7 +import SelectSellType from './select-sell-type';
7 8
8 export default { 9 export default {
9 SelectBrand, 10 SelectBrand,
@@ -11,5 +12,6 @@ export default { @@ -11,5 +12,6 @@ export default {
11 SelectSeason, 12 SelectSeason,
12 SelectRoom, 13 SelectRoom,
13 SelectExpress, 14 SelectExpress,
14 - SelectStockStatus 15 + SelectStockStatus,
  16 + SelectSellType
15 }; 17 };
  1 +<template>
  2 + <Select :value="handleValue" @on-change="updateValue" clearable placeholder="请选择">
  3 + <Option :value="item.id" v-for="item in list" :key="item.text">{{item.text}}</Option>
  4 + </Select>
  5 +</template>
  6 +
  7 +<script>
  8 +
  9 + import SellTypeService from 'services/product/sell-type-service';
  10 +
  11 + export default {
  12 + name: 'select-sell-type',
  13 + props: {
  14 + value: {
  15 + type: String
  16 + },
  17 + brandId: {
  18 + type: String
  19 + }
  20 + },
  21 + data() {
  22 + return {
  23 + handleValue: this.value,
  24 + list: []
  25 + };
  26 + },
  27 + created() {
  28 + this.sellTypeService = new SellTypeService();
  29 + },
  30 + methods: {
  31 + updateValue(newValue) {
  32 + this.$emit('input', newValue);
  33 + this.$emit('change', newValue);
  34 + }
  35 + },
  36 + watch: {
  37 + value(newValue) {
  38 + this.handleValue = newValue;
  39 + },
  40 + brandId(newValue) {
  41 + this.sellTypeService.getSellType({brandId: newValue}).then((result) => {
  42 + if (result.code === 200) {
  43 + this.list = result.data;
  44 + }
  45 + });
  46 + }
  47 + }
  48 +
  49 + };
  50 +</script>
  51 +
  52 +<style>
  53 +
  54 +</style>
@@ -8,11 +8,16 @@ @@ -8,11 +8,16 @@
8 </div> 8 </div>
9 </Row> 9 </Row>
10 10
11 - <Form ref="formData" :model="formData" :label-width="50" :rules="ruleValidate"> 11 + <Form ref="formData" :model="formData" :label-width="70" :rules="ruleValidate">
12 <Form-item label="品牌" prop="brandId"> 12 <Form-item label="品牌" prop="brandId">
13 <select-brand v-model="formData.brandId" @change="selectBrand" style="width: 300px;"></select-brand> 13 <select-brand v-model="formData.brandId" @change="selectBrand" style="width: 300px;"></select-brand>
14 </Form-item> 14 </Form-item>
15 15
  16 + <Form-item label="销售类型" prop="sellType">
  17 + <select-sell-type v-model="formData.sellType" style="width: 300px;" :brandId="formData.brandId" @change="selectSellType">
  18 + </select-sell-type>
  19 + </Form-item>
  20 +
16 <Form-item label="类目" prop="sortId"> 21 <Form-item label="类目" prop="sortId">
17 <select-category :value="formData.sortId" @input="selectSort" style="width: 300px;"> 22 <select-category :value="formData.sortId" @input="selectSort" style="width: 300px;">
18 </select-category> 23 </select-category>
@@ -59,11 +64,15 @@ export default { @@ -59,11 +64,15 @@ export default {
59 formData: { 64 formData: {
60 brandId: '', 65 brandId: '',
61 sortId: [], 66 sortId: [],
  67 + sellType: ''
62 }, 68 },
63 ruleValidate: { 69 ruleValidate: {
64 brandId: [ 70 brandId: [
65 { required: true, message: '品牌不能为空', trigger: 'change', validator: validateEmpty} 71 { required: true, message: '品牌不能为空', trigger: 'change', validator: validateEmpty}
66 ], 72 ],
  73 + sellType: [
  74 + { required: true, message: '销售类型不能为空', trigger: 'change', validator: validateEmpty}
  75 + ],
67 sortId: [ 76 sortId: [
68 { required: true, trigger: 'NONE', validator: validateValue}, 77 { required: true, trigger: 'NONE', validator: validateValue},
69 ], 78 ],
@@ -97,6 +106,9 @@ export default { @@ -97,6 +106,9 @@ export default {
97 this.product.maxSortName = sorts[0].label; 106 this.product.maxSortName = sorts[0].label;
98 this.product.middleSortName = sorts[1].label; 107 this.product.middleSortName = sorts[1].label;
99 this.product.smallSortName = sorts[2].label; 108 this.product.smallSortName = sorts[2].label;
  109 + },
  110 + selectSellType(sellerType) {
  111 + this.product.sellType = sellerType;
100 } 112 }
101 } 113 }
102 }; 114 };
@@ -28,6 +28,7 @@ export default () => { @@ -28,6 +28,7 @@ export default () => {
28 salesPrice: '', 28 salesPrice: '',
29 sellerGoodsInfoStr: '', 29 sellerGoodsInfoStr: '',
30 selectSize: [], 30 selectSize: [],
31 - selectColor: [] 31 + selectColor: [],
  32 + sellType: ''
32 }; 33 };
33 }; 34 };
@@ -37,6 +37,10 @@ @@ -37,6 +37,10 @@
37 <select-brand v-model="brandId"></select-brand> 37 <select-brand v-model="brandId"></select-brand>
38 </filter-item> 38 </filter-item>
39 39
  40 + <filter-item label="销售类型">
  41 + <select-sell-type v-model="sellType" :brandId="brandId"></select-sell-type>
  42 + </filter-item>
  43 +
40 <filter-item label="上传文件"> 44 <filter-item label="上传文件">
41 <Input v-model="xlsxFile" style="width: 300px"></Input> 45 <Input v-model="xlsxFile" style="width: 300px"></Input>
42 46
@@ -57,14 +61,12 @@ @@ -57,14 +61,12 @@
57 </filter-item> 61 </filter-item>
58 </layout-filter> 62 </layout-filter>
59 63
60 - <layout-list>  
61 <div v-if="importInfo"> 64 <div v-if="importInfo">
62 <div v-if="importInfo.length !== 0"> 65 <div v-if="importInfo.length !== 0">
63 <div class="error-title">导入错误记录</div> 66 <div class="error-title">导入错误记录</div>
64 <div class="error-content" v-for="e in importInfo"> {{e}} </div> 67 <div class="error-content" v-for="e in importInfo"> {{e}} </div>
65 </div> 68 </div>
66 </div> 69 </div>
67 - </layout-list>  
68 </layout-body> 70 </layout-body>
69 </template> 71 </template>
70 72
@@ -94,6 +96,7 @@ @@ -94,6 +96,7 @@
94 }, 96 },
95 xlsxFile: '', 97 xlsxFile: '',
96 brandId: '', 98 brandId: '',
  99 + sellType: '',
97 action: '/importSeller', 100 action: '/importSeller',
98 sort: { 101 sort: {
99 first: { 102 first: {
@@ -148,11 +151,12 @@ @@ -148,11 +151,12 @@
148 }, 151 },
149 upload() { 152 upload() {
150 this.loading = true; 153 this.loading = true;
151 - this.$refs.xlsxUpload.upload({brandId: this.brandId})  
152 - .then(() => { 154 + this.$refs.xlsxUpload.upload({
  155 + brandId: this.brandId,
  156 + sellType: this.sellType
  157 + }).then(() => {
153 this.loading = false; 158 this.loading = false;
154 - })  
155 - .catch(() => { 159 + }).catch(() => {
156 this.loading = false; 160 this.loading = false;
157 }); 161 });
158 }, 162 },
@@ -4,6 +4,7 @@ import ColorService from './color-service'; @@ -4,6 +4,7 @@ import ColorService from './color-service';
4 import SizeService from './size-service'; 4 import SizeService from './size-service';
5 import ProductCreateService from './product-create-service'; 5 import ProductCreateService from './product-create-service';
6 import ProductService from './product-service'; 6 import ProductService from './product-service';
  7 +import SellTypeService from './sell-type-service';
7 8
8 export { 9 export {
9 BrandService, 10 BrandService,
@@ -11,5 +12,6 @@ export { @@ -11,5 +12,6 @@ export {
11 ProductService, 12 ProductService,
12 SortService, 13 SortService,
13 ColorService, 14 ColorService,
14 - SizeService 15 + SizeService,
  16 + SellTypeService
15 }; 17 };
  1 +/**
  2 + * Created by TaoHuang on 2017/6/12.
  3 + */
  4 +
  5 +import Service from '../service';
  6 +
  7 +class SellTypeService extends Service {
  8 + getSellType(params) {
  9 + return this.post('/platform/getSellType', params);
  10 + }
  11 +}
  12 +
  13 +export default SellTypeService;
@@ -78,7 +78,8 @@ let domainApis = { @@ -78,7 +78,8 @@ let domainApis = {
78 deleteCategoryLinkProduct: '/SellerShopController/deleteCategoryLinkProduct', 78 deleteCategoryLinkProduct: '/SellerShopController/deleteCategoryLinkProduct',
79 getRemoteImageUrlBySku: '/product/getRemoteImageUrlBySku', 79 getRemoteImageUrlBySku: '/product/getRemoteImageUrlBySku',
80 importSeller: '/batch/importSeller', 80 importSeller: '/batch/importSeller',
81 - downloadFile: '/exceltemplate/download/CreateProductForShops' 81 + downloadFile: '/exceltemplate/download/CreateProductForShops',
  82 + getSellType: '/SellerProductController/getSellType'
82 }, 83 },
83 shop: { 84 shop: {
84 login: '/loginInter', 85 login: '/loginInter',