|
|
|
@ -26,7 +26,7 @@
|
|
|
|
|
<el-form-item label="商品品牌:" prop="brand_id"> |
|
|
|
|
<el-select v-model="formValidate.brand_id" filterable :filter-method="dataFilter" clearable> |
|
|
|
|
<el-option v-for="item in brandList" |
|
|
|
|
:value="item.value" :key="item.id" :label="item.label" ></el-option> |
|
|
|
|
:value="item.id" :key="item.id" :label="item.brandName" ></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
@ -357,6 +357,7 @@
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import { getCates } from '@/api/bxg/yxStoreCategory' |
|
|
|
|
import { initData} from '@/api/bxg/data' |
|
|
|
|
import { add, edit, getInfo, isFormatAttr } from '@/api/bxg/yxStoreProduct' |
|
|
|
|
import editor from '../../components/Editor' |
|
|
|
|
import picUpload from '@/components/pic-upload' |
|
|
|
@ -425,6 +426,7 @@ export default {
|
|
|
|
|
sliderImageArr: [], |
|
|
|
|
store_name: '', |
|
|
|
|
cate_id: '', |
|
|
|
|
brand_id:'', |
|
|
|
|
keyword: '', |
|
|
|
|
unit_name: '', |
|
|
|
|
store_info: '', |
|
|
|
@ -674,9 +676,20 @@ export default {
|
|
|
|
|
getInfo () { |
|
|
|
|
let that = this; |
|
|
|
|
let id = that.$route.params.id || 0; |
|
|
|
|
//查询商品品牌 |
|
|
|
|
initData('/bxg/api/yxStoreBrand', { |
|
|
|
|
page: 0, |
|
|
|
|
size: 999, |
|
|
|
|
sort: 'id,desc' |
|
|
|
|
}).then(data => { |
|
|
|
|
console.log('dara', data); |
|
|
|
|
that.brandList=data.content |
|
|
|
|
//若为编辑,应初始化一下品牌 |
|
|
|
|
}), |
|
|
|
|
//查询商品规格和分类 |
|
|
|
|
getInfo(id).then(async res => { |
|
|
|
|
let data = res.productInfo; |
|
|
|
|
console.log('data:'+data) |
|
|
|
|
console.log('data:'+data,res) |
|
|
|
|
if(data){ |
|
|
|
|
let cate_id = parseInt(data.cate_id) || 0; |
|
|
|
|
this.attrs = data.items || []; |
|
|
|
@ -711,8 +724,9 @@ export default {
|
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//商品分类 |
|
|
|
|
that.treeSelect = res.cateList; |
|
|
|
|
//规格 |
|
|
|
|
that.ruleList = res.ruleList; |
|
|
|
|
that.templateList = res.tempList; |
|
|
|
|
that.optionsMetaShow = that.treeSelect |
|
|
|
@ -742,6 +756,8 @@ export default {
|
|
|
|
|
if(this.formValidate.spec_type === 1 && this.manyFormValidate.length===0){ |
|
|
|
|
return this.$message.warning('请点击生成规格!'); |
|
|
|
|
} |
|
|
|
|
console.log(this.formValidate,'提交的') |
|
|
|
|
// return |
|
|
|
|
add(this.formValidate).then(async res => { |
|
|
|
|
//成功后返回的Status Code为201 |
|
|
|
|
this.$message({ |
|
|
|
|