Authored by htoooth

fix

... ... @@ -13,7 +13,7 @@
<Row>
<Col span="8">
<Form-item label="品牌" prop="brandId">
<Select v-model="product.brandId" placeholder="请选择" :label-in-value="true" @on-change="selectBrand">
<Select v-model="product.brandId" placeholder="请选择" @on-change="selectBrand">
<Option v-for="brand in brands" :value="brand.brandId" :key="brand">{{ brand.brandName }}</Option>
</Select>
</Form-item>
... ... @@ -59,6 +59,7 @@
<script>
import api from 'product-create/api';
import _ from 'lodash';
export default {
props: ['step', 'product'],
... ... @@ -142,7 +143,7 @@ export default {
this.product.smallSortName = value.label;
},
selectBrand: function(value) {
this.product.brandName = value.label;
this.product.brandName = _.find(this.brands, {brandId: value}).brandName;
},
getBrand: function() {
return api.getBrand().then((result) => {
... ...
... ... @@ -87,6 +87,7 @@ function countBindProduct(categoryId) {
.then(res => res.data);
}
/**
* 增加类目中关联的商品
* @param categoryId {string | array}
... ... @@ -97,7 +98,7 @@ function createBindProduct(categoryId, productSKN) {
}
return request.post(apiUrl.createBindProduct, {
categoryId, productSKN: _.isArray(productSKN) ? productSKN.join(',') : productSKN
categoryId, productSKN: _.isArray(productSKN) ? productSKN : [productSKN]
}).then(res => res.data);
}
... ... @@ -108,7 +109,7 @@ function createBindProduct(categoryId, productSKN) {
*/
function deleteBindProduct(categoryId, productSKN) {
return request.post(apiUrl.deleteBindProduct, {
categoryId, productSKN: _.isArray(productSKN) ? productSKN.join(',') : productSKN
categoryId, productSKN: _.isArray(productSKN) ? productSKN : [productSKN]
}).then(res => res.data);
}
... ...