Authored by htoooth

Merge remote-tracking branch 'origin/release/1.0' into release/1.0

1 <template> 1 <template>
2 - <Select v-model="_fieldModel" @on-change="selectChange" clearable> 2 + <Select v-model="brandId" @on-change="selectChange" clearable>
3 <Option :value="-1">全部</Option> 3 <Option :value="-1">全部</Option>
4 <Option v-for="option in optionList" :value="option.brandId" :key="option.brandId"> 4 <Option v-for="option in optionList" :value="option.brandId" :key="option.brandId">
5 {{option.brandName}} 5 {{option.brandName}}
@@ -14,43 +14,27 @@ @@ -14,43 +14,27 @@
14 export default { 14 export default {
15 name: 'SelectBrand', 15 name: 'SelectBrand',
16 props: { 16 props: {
17 - fieldLabel: {  
18 - type: String  
19 - },  
20 -  
21 - fieldModel: {  
22 - type: [String, Number]  
23 - },  
24 -  
25 - labelSpan: {  
26 - type: [String, Number],  
27 - default: 6  
28 - },  
29 -  
30 - fieldSpan: {  
31 - type: [String, Number],  
32 - default: 18 17 + value: {
  18 + type: Number,
  19 + default: 0
33 } 20 }
34 }, 21 },
35 data() { 22 data() {
36 return { 23 return {
  24 + brandId: this.value,
37 optionList: [] 25 optionList: []
38 - }  
39 - },  
40 - computed: {  
41 - _fieldModel() {  
42 - return this.fieldModel;  
43 - } 26 + };
44 }, 27 },
45 created() { 28 created() {
46 const err_msg = '获取品牌列表失败。'; 29 const err_msg = '获取品牌列表失败。';
  30 +
47 service.getBrand().then((res) => { 31 service.getBrand().then((res) => {
48 let code = _.get(res, 'data.code'); 32 let code = _.get(res, 'data.code');
49 33
50 - if(code === 200) {  
51 - return this.optionList = res.data.data; 34 + if (code === 200) {
  35 + this.optionList = res.data.data;
  36 + return;
52 } 37 }
53 -  
54 return this.$Message.error(err_msg); 38 return this.$Message.error(err_msg);
55 }, (error) => { 39 }, (error) => {
56 this.$Message.error(error.message); 40 this.$Message.error(error.message);
@@ -58,10 +42,10 @@ @@ -58,10 +42,10 @@
58 }, 42 },
59 methods: { 43 methods: {
60 selectChange(val) { 44 selectChange(val) {
61 - this.$emit('on-change', val); 45 + this.$emit('input', val);
62 } 46 }
63 } 47 }
64 - } 48 + };
65 </script> 49 </script>
66 50
67 <style lang="scss" scoped> 51 <style lang="scss" scoped>
@@ -18,12 +18,7 @@ @@ -18,12 +18,7 @@
18 :placeholder="filters.prodBarCode.holder"></Input> 18 :placeholder="filters.prodBarCode.holder"></Input>
19 </FilterItem> 19 </FilterItem>
20 <FilterItem label="选择品牌"> 20 <FilterItem label="选择品牌">
21 - <SelectBrand @on-change="brandChange"  
22 - :field-label="filters.brand.label"  
23 - :field-model="filters.brand.model"  
24 - :label-span="filters.brand.labelSpan"  
25 - :field-span="filters.brand.fieldSpan"  
26 - :option-list="filters.brand.options"> 21 + <SelectBrand v-model="filters.brand.model">
27 </SelectBrand> 22 </SelectBrand>
28 </FilterItem> 23 </FilterItem>
29 <FilterItem label="选择类目"> 24 <FilterItem label="选择类目">
1 -// import _ from 'lodash';  
2 import axios from 'axios'; 1 import axios from 'axios';
3 2
4 const shopService = { 3 const shopService = {
@@ -25,6 +24,13 @@ const shopService = { @@ -25,6 +24,13 @@ const shopService = {
25 return axios.post('/platform/updateShopBaseInfoById', shop) 24 return axios.post('/platform/updateShopBaseInfoById', shop)
26 .then(result => result.data); 25 .then(result => result.data);
27 26
  27 + },
  28 +
  29 + /**
  30 + * 获取装修店铺列表
  31 + */
  32 + getDecoratorShops() {
  33 + return axios.get('/platform/queryShopsDecoratorList').then(result => result.data);
28 } 34 }
29 35
30 }; 36 };