|
@@ -103,7 +103,7 @@
|
|
|
<script>
|
|
|
import {fetchListWithChildren} from '@/api/productCate'
|
|
|
import {fetchList as fetchBrandList,fetchOriginList} from '@/api/brand'
|
|
|
- import {getProduct} from '@/api/product';
|
|
|
+ import {getProduct, selectCompList} from '@/api/product';
|
|
|
|
|
|
export default {
|
|
|
name: "ProductInfoDetail",
|
|
@@ -122,6 +122,7 @@
|
|
|
productCateOptions: [],
|
|
|
brandOptions: [],
|
|
|
originOptions:[],
|
|
|
+ supplierOptList: [],
|
|
|
cascaderPlaceholder:'',
|
|
|
rules: {
|
|
|
name: [
|
|
@@ -131,6 +132,7 @@
|
|
|
subTitle: [{required: true, message: '请输入商品副标题', trigger: 'blur'}],
|
|
|
productCategoryId: [{required: true, message: '请选择商品分类', trigger: 'blur'}],
|
|
|
brandId: [{required: true, message: '请选择商品品牌', trigger: 'blur'}],
|
|
|
+ compId: [{required: true, message: '请选择供应商', trigger: 'blur'}],
|
|
|
placeOfProductionId: [{required: true, message: '请选择生产地', trigger: 'blur'}],
|
|
|
description: [{required: true, message: '请输入商品介绍', trigger: 'blur'}],
|
|
|
requiredProp: [{required: true, message: '该项为必填项', trigger: 'blur'}],
|
|
@@ -144,8 +146,7 @@
|
|
|
created() {
|
|
|
this.getProductCateList();
|
|
|
this.getBrandList();
|
|
|
- this.getOriginList();
|
|
|
- console.log('selectProductCateValue',this.selectProductCateValue);
|
|
|
+ this.getSupplierOptList();
|
|
|
},
|
|
|
computed:{
|
|
|
//商品的编号
|
|
@@ -177,8 +178,9 @@
|
|
|
this.value.productBigCategoryId = null;
|
|
|
this.value.productBigCategoryName = null;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+ },
|
|
|
+ 'value.compId'(newValue) {
|
|
|
+ this.getOriginList(newValue);
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -222,9 +224,9 @@
|
|
|
this.supplierOptList = response.data;
|
|
|
});
|
|
|
},
|
|
|
- getOriginList() {
|
|
|
- fetchOriginList({pageNum: 1, pageSize: 100}).then(response => {
|
|
|
- // console.log('getOriginList',response);
|
|
|
+ getOriginList(compId) {
|
|
|
+ if(!compId) { return; }
|
|
|
+ fetchOriginList(compId).then(response => {
|
|
|
this.originOptions = [];
|
|
|
let originList = response.data;
|
|
|
for (let i = 0; i < originList.length; i++) {
|
|
@@ -280,6 +282,8 @@
|
|
|
this.value.brandName = brandName;
|
|
|
},
|
|
|
handleSupplierChange(val) {
|
|
|
+ this.value.placeOfProductionId = '';
|
|
|
+ this.getOriginList(val);
|
|
|
let supplierInfoObj = {};
|
|
|
supplierInfoObj = this.supplierOptList.find(item => {
|
|
|
return item.value === val;
|