Browse Source

商品的品牌管理修改

master
sj 2 years ago
parent
commit
40464254ce
  1. 1
      src/components/Crud/crud.js
  2. 1
      src/mixins/crud.js
  3. 22
      src/views/bxg/shop/goods/form.vue
  4. 3
      src/views/bxg/shop/goods/index.vue
  5. 7
      src/views/bxg/shop/storeBrand/index.vue

1
src/components/Crud/crud.js

@ -129,7 +129,6 @@ function CRUD(options) {
return new Promise((resolve, reject) => {
crud.loading = true
// 请求数据
// return
initData(crud.url, crud.getQueryParams()).then(data => {
crud.page.total = data.totalElements
crud.data = data.content

1
src/mixins/crud.js

@ -55,7 +55,6 @@ export default {
checkPermission,
//通用的搜索方法
async init() {
console.log('回调这个搜索方法吗?');
if (!await this.beforeInit()) {
return
}

22
src/views/bxg/shop/goods/form.vue

@ -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 Code201
this.$message({

3
src/views/bxg/shop/goods/index.vue

@ -45,7 +45,7 @@
</el-table-column>
<el-table-column prop="storeName" label="商品名称" />
<el-table-column prop="storeCategory.cateName" label="分类名称" />
<el-table-column prop="storeCategory.brandName" label="品牌名称" />
<el-table-column prop="storeBrand.brandName" label="品牌名称" />
<el-table-column prop="price" label="商品价格" />
<el-table-column prop="sales" label="销量" />
<el-table-column prop="stock" label="库存" />
@ -218,6 +218,7 @@ export default {
keyword: data.keyword,
barCode: data.barCode,
storeCategory: data.storeCategory || {id:null},
storeBrand:data.brandName || {id:null},
price: data.price,
vipPrice: data.vipPrice,
otPrice: data.otPrice,

7
src/views/bxg/shop/storeBrand/index.vue

@ -18,11 +18,13 @@
<el-form-item label="品牌名称" prop="brandName">
<el-input v-model="form.brandName" style="width: 370px;" />
</el-form-item>
<el-form-item label="品牌描述" prop="brandDescription">
<el-input v-model="form.brandDescription" type="textarea" style="width: 370px;" />
</el-form-item>
<el-form-item label="排序">
<el-input v-model="form.sort" style="width: 370px;" />
</el-form-item>
<el-form-item label="图标">
<!-- <el-input v-model="form.pic" style="width: 370px;" />-->
<MaterialList v-model="picArr" type="image" :num="1" :width="150" :height="150" />
</el-form-item>
<el-form-item label="是否推荐">
@ -39,8 +41,9 @@
<el-table-column type="selection" width="55" />
<el-table-column v-if="columns.visible('id')" prop="id" label="品牌ID" />
<el-table-column v-if="columns.visible('brandName')" prop="brandName" label="品牌名称" />
<el-table-column v-if="columns.visible('brandDescription')" prop="brandDescription" label="品牌描述" />
<el-table-column v-if="columns.visible('sort')" prop="sort" label="排序" />
<el-table-column v-if="columns.visible('pic')" prop="pic" label="图标" />
<!-- <el-table-column v-if="columns.visible('pic')" prop="pic" label="图标" />-->
<el-table-column v-if="columns.visible('isShow')" prop="isShow" label="是否推荐" />
<el-table-column v-if="columns.visible('createTime')" prop="createTime" label="添加时间">
<template slot-scope="scope">

Loading…
Cancel
Save