商品的品牌管理修改
This commit is contained in:
@@ -129,7 +129,6 @@ function CRUD(options) {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
crud.loading = true
|
crud.loading = true
|
||||||
// 请求数据
|
// 请求数据
|
||||||
// return
|
|
||||||
initData(crud.url, crud.getQueryParams()).then(data => {
|
initData(crud.url, crud.getQueryParams()).then(data => {
|
||||||
crud.page.total = data.totalElements
|
crud.page.total = data.totalElements
|
||||||
crud.data = data.content
|
crud.data = data.content
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ export default {
|
|||||||
checkPermission,
|
checkPermission,
|
||||||
//通用的搜索方法
|
//通用的搜索方法
|
||||||
async init() {
|
async init() {
|
||||||
console.log('回调这个搜索方法吗?');
|
|
||||||
if (!await this.beforeInit()) {
|
if (!await this.beforeInit()) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
<el-form-item label="商品品牌:" prop="brand_id">
|
<el-form-item label="商品品牌:" prop="brand_id">
|
||||||
<el-select v-model="formValidate.brand_id" filterable :filter-method="dataFilter" clearable>
|
<el-select v-model="formValidate.brand_id" filterable :filter-method="dataFilter" clearable>
|
||||||
<el-option v-for="item in brandList"
|
<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-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -357,6 +357,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getCates } from '@/api/bxg/yxStoreCategory'
|
import { getCates } from '@/api/bxg/yxStoreCategory'
|
||||||
|
import { initData} from '@/api/bxg/data'
|
||||||
import { add, edit, getInfo, isFormatAttr } from '@/api/bxg/yxStoreProduct'
|
import { add, edit, getInfo, isFormatAttr } from '@/api/bxg/yxStoreProduct'
|
||||||
import editor from '../../components/Editor'
|
import editor from '../../components/Editor'
|
||||||
import picUpload from '@/components/pic-upload'
|
import picUpload from '@/components/pic-upload'
|
||||||
@@ -425,6 +426,7 @@ export default {
|
|||||||
sliderImageArr: [],
|
sliderImageArr: [],
|
||||||
store_name: '',
|
store_name: '',
|
||||||
cate_id: '',
|
cate_id: '',
|
||||||
|
brand_id:'',
|
||||||
keyword: '',
|
keyword: '',
|
||||||
unit_name: '',
|
unit_name: '',
|
||||||
store_info: '',
|
store_info: '',
|
||||||
@@ -674,9 +676,20 @@ export default {
|
|||||||
getInfo () {
|
getInfo () {
|
||||||
let that = this;
|
let that = this;
|
||||||
let id = that.$route.params.id || 0;
|
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 => {
|
getInfo(id).then(async res => {
|
||||||
let data = res.productInfo;
|
let data = res.productInfo;
|
||||||
console.log('data:'+data)
|
console.log('data:'+data,res)
|
||||||
if(data){
|
if(data){
|
||||||
let cate_id = parseInt(data.cate_id) || 0;
|
let cate_id = parseInt(data.cate_id) || 0;
|
||||||
this.attrs = data.items || [];
|
this.attrs = data.items || [];
|
||||||
@@ -711,8 +724,9 @@ export default {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//商品分类
|
||||||
that.treeSelect = res.cateList;
|
that.treeSelect = res.cateList;
|
||||||
|
//规格
|
||||||
that.ruleList = res.ruleList;
|
that.ruleList = res.ruleList;
|
||||||
that.templateList = res.tempList;
|
that.templateList = res.tempList;
|
||||||
that.optionsMetaShow = that.treeSelect
|
that.optionsMetaShow = that.treeSelect
|
||||||
@@ -742,6 +756,8 @@ export default {
|
|||||||
if(this.formValidate.spec_type === 1 && this.manyFormValidate.length===0){
|
if(this.formValidate.spec_type === 1 && this.manyFormValidate.length===0){
|
||||||
return this.$message.warning('请点击生成规格!');
|
return this.$message.warning('请点击生成规格!');
|
||||||
}
|
}
|
||||||
|
console.log(this.formValidate,'提交的')
|
||||||
|
// return
|
||||||
add(this.formValidate).then(async res => {
|
add(this.formValidate).then(async res => {
|
||||||
//成功后返回的Status Code为201
|
//成功后返回的Status Code为201
|
||||||
this.$message({
|
this.$message({
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="storeName" label="商品名称" />
|
<el-table-column prop="storeName" label="商品名称" />
|
||||||
<el-table-column prop="storeCategory.cateName" 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="price" label="商品价格" />
|
||||||
<el-table-column prop="sales" label="销量" />
|
<el-table-column prop="sales" label="销量" />
|
||||||
<el-table-column prop="stock" label="库存" />
|
<el-table-column prop="stock" label="库存" />
|
||||||
@@ -218,6 +218,7 @@ export default {
|
|||||||
keyword: data.keyword,
|
keyword: data.keyword,
|
||||||
barCode: data.barCode,
|
barCode: data.barCode,
|
||||||
storeCategory: data.storeCategory || {id:null},
|
storeCategory: data.storeCategory || {id:null},
|
||||||
|
storeBrand:data.brandName || {id:null},
|
||||||
price: data.price,
|
price: data.price,
|
||||||
vipPrice: data.vipPrice,
|
vipPrice: data.vipPrice,
|
||||||
otPrice: data.otPrice,
|
otPrice: data.otPrice,
|
||||||
|
|||||||
@@ -18,11 +18,13 @@
|
|||||||
<el-form-item label="品牌名称" prop="brandName">
|
<el-form-item label="品牌名称" prop="brandName">
|
||||||
<el-input v-model="form.brandName" style="width: 370px;" />
|
<el-input v-model="form.brandName" style="width: 370px;" />
|
||||||
</el-form-item>
|
</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-form-item label="排序">
|
||||||
<el-input v-model="form.sort" style="width: 370px;" />
|
<el-input v-model="form.sort" style="width: 370px;" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="图标">
|
<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" />
|
<MaterialList v-model="picArr" type="image" :num="1" :width="150" :height="150" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="是否推荐">
|
<el-form-item label="是否推荐">
|
||||||
@@ -39,8 +41,9 @@
|
|||||||
<el-table-column type="selection" width="55" />
|
<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('id')" prop="id" label="品牌ID" />
|
||||||
<el-table-column v-if="columns.visible('brandName')" prop="brandName" label="品牌名称" />
|
<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('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('isShow')" prop="isShow" label="是否推荐" />
|
||||||
<el-table-column v-if="columns.visible('createTime')" prop="createTime" label="添加时间">
|
<el-table-column v-if="columns.visible('createTime')" prop="createTime" label="添加时间">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
|||||||
Reference in New Issue
Block a user