Authored by 陈峰

merge

... ... @@ -4,6 +4,7 @@ import SelectSeason from './select-season';
import SelectRoom from './select-room';
import SelectExpress from './select-express';
import SelectStockStatus from './select-stock-status';
import SelectSellType from './select-sell-type';
export default {
SelectBrand,
... ... @@ -11,5 +12,6 @@ export default {
SelectSeason,
SelectRoom,
SelectExpress,
SelectStockStatus
SelectStockStatus,
SelectSellType
};
... ...
<template>
<Select :value="handleValue" @on-change="updateValue" clearable placeholder="请选择">
<Option :value="item.id" v-for="item in list" :key="item.text">{{item.text}}</Option>
</Select>
</template>
<script>
import SellTypeService from 'services/product/sell-type-service';
export default {
name: 'select-sell-type',
props: {
value: {
type: String
},
brandId: {
type: String
}
},
data() {
return {
handleValue: this.value,
list: []
};
},
created() {
this.sellTypeService = new SellTypeService();
},
methods: {
updateValue(newValue) {
this.$emit('input', newValue);
this.$emit('change', newValue);
}
},
watch: {
value(newValue) {
this.handleValue = newValue;
},
brandId(newValue) {
this.sellTypeService.getSellType({brandId: newValue}).then((result) => {
if (result.code === 200) {
this.list = result.data;
}
});
}
}
};
</script>
<style>
</style>
... ...
... ... @@ -8,11 +8,16 @@
</div>
</Row>
<Form ref="formData" :model="formData" :label-width="50" :rules="ruleValidate">
<Form ref="formData" :model="formData" :label-width="70" :rules="ruleValidate">
<Form-item label="品牌" prop="brandId">
<select-brand v-model="formData.brandId" @change="selectBrand" style="width: 300px;"></select-brand>
</Form-item>
<Form-item label="销售类型" prop="sellType">
<select-sell-type v-model="formData.sellType" style="width: 300px;" :brandId="formData.brandId" @change="selectSellType">
</select-sell-type>
</Form-item>
<Form-item label="类目" prop="sortId">
<select-category :value="formData.sortId" @input="selectSort" style="width: 300px;">
</select-category>
... ... @@ -59,11 +64,15 @@ export default {
formData: {
brandId: '',
sortId: [],
sellType: ''
},
ruleValidate: {
brandId: [
{ required: true, message: '品牌不能为空', trigger: 'change', validator: validateEmpty}
],
sellType: [
{ required: true, message: '销售类型不能为空', trigger: 'change', validator: validateEmpty}
],
sortId: [
{ required: true, trigger: 'NONE', validator: validateValue},
],
... ... @@ -97,6 +106,9 @@ export default {
this.product.maxSortName = sorts[0].label;
this.product.middleSortName = sorts[1].label;
this.product.smallSortName = sorts[2].label;
},
selectSellType(sellerType) {
this.product.sellType = sellerType;
}
}
};
... ...
... ... @@ -28,6 +28,7 @@ export default () => {
salesPrice: '',
sellerGoodsInfoStr: '',
selectSize: [],
selectColor: []
selectColor: [],
sellType: ''
};
};
... ...
... ... @@ -37,6 +37,10 @@
<select-brand v-model="brandId"></select-brand>
</filter-item>
<filter-item label="销售类型">
<select-sell-type v-model="sellType" :brandId="brandId"></select-sell-type>
</filter-item>
<filter-item label="上传文件">
<Input v-model="xlsxFile" style="width: 300px"></Input>
... ... @@ -57,14 +61,12 @@
</filter-item>
</layout-filter>
<layout-list>
<div v-if="importInfo">
<div v-if="importInfo.length !== 0">
<div class="error-title">导入错误记录</div>
<div class="error-content" v-for="e in importInfo"> {{e}} </div>
</div>
</div>
</layout-list>
</layout-body>
</template>
... ... @@ -94,6 +96,7 @@
},
xlsxFile: '',
brandId: '',
sellType: '',
action: '/importSeller',
sort: {
first: {
... ... @@ -148,11 +151,12 @@
},
upload() {
this.loading = true;
this.$refs.xlsxUpload.upload({brandId: this.brandId})
.then(() => {
this.$refs.xlsxUpload.upload({
brandId: this.brandId,
sellType: this.sellType
}).then(() => {
this.loading = false;
})
.catch(() => {
}).catch(() => {
this.loading = false;
});
},
... ...
... ... @@ -4,6 +4,7 @@ import ColorService from './color-service';
import SizeService from './size-service';
import ProductCreateService from './product-create-service';
import ProductService from './product-service';
import SellTypeService from './sell-type-service';
export {
BrandService,
... ... @@ -11,5 +12,6 @@ export {
ProductService,
SortService,
ColorService,
SizeService
SizeService,
SellTypeService
};
... ...
/**
* Created by TaoHuang on 2017/6/12.
*/
import Service from '../service';
class SellTypeService extends Service {
getSellType(params) {
return this.post('/platform/getSellType', params);
}
}
export default SellTypeService;
\ No newline at end of file
... ...
... ... @@ -78,7 +78,8 @@ let domainApis = {
deleteCategoryLinkProduct: '/SellerShopController/deleteCategoryLinkProduct',
getRemoteImageUrlBySku: '/product/getRemoteImageUrlBySku',
importSeller: '/batch/importSeller',
downloadFile: '/exceltemplate/download/CreateProductForShops'
downloadFile: '/exceltemplate/download/CreateProductForShops',
getSellType: '/SellerProductController/getSellType'
},
shop: {
login: '/loginInter',
... ...