12
This commit is contained in:
@@ -1,6 +1,24 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
var service_name = 'oil-mall'
|
var service_name = 'oil-mall'
|
||||||
export default {
|
export default {
|
||||||
|
brandGetByPage() {
|
||||||
|
return request({
|
||||||
|
url: `/${service_name}/mallProductBrands/getByPage`,
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getAllAttributesType() {
|
||||||
|
return request({
|
||||||
|
url: `/${service_name}/mallProductAttributesType/getAllAttributesType`,
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getClassificationTree() {
|
||||||
|
return request({
|
||||||
|
url: `/${service_name}/mallProductClassification/getClassificationTree`,
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
},
|
||||||
classifySave(page) {
|
classifySave(page) {
|
||||||
return request({
|
return request({
|
||||||
url: `/${service_name}/mallProductClassification/save`,
|
url: `/${service_name}/mallProductClassification/save`,
|
||||||
@@ -70,6 +88,13 @@ delete(page) {
|
|||||||
data: page
|
data: page
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
typeUpdate(page) {
|
||||||
|
return request({
|
||||||
|
url: `/${service_name}/mallProductAttributes/update`,
|
||||||
|
method: 'post',
|
||||||
|
data: page
|
||||||
|
})
|
||||||
|
},
|
||||||
update(page) {
|
update(page) {
|
||||||
return request({
|
return request({
|
||||||
url: `/${service_name}/mallProductAttributesType/update`,
|
url: `/${service_name}/mallProductAttributesType/update`,
|
||||||
|
|||||||
@@ -36,6 +36,12 @@ export const constantRoutes = [{
|
|||||||
name: 'productAdd',
|
name: 'productAdd',
|
||||||
meta: { title: '添加商品', icon: 'iconkongzhitai', affix: true }
|
meta: { title: '添加商品', icon: 'iconkongzhitai', affix: true }
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/brand',
|
||||||
|
component: () => import('@/views/product/brand/index'),
|
||||||
|
name: 'brand',
|
||||||
|
meta: { title: '商品品牌', icon: 'iconkongzhitai', affix: true }
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/productClassify',
|
path: '/productClassify',
|
||||||
component: () => import('@/views/product/productClassify/index'),
|
component: () => import('@/views/product/productClassify/index'),
|
||||||
|
|||||||
134
src/views/product/brand/index.vue
Normal file
134
src/views/product/brand/index.vue
Normal file
@@ -0,0 +1,134 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-card :bordered="false" shadow="never" class="ivu-mt" :body-style="{ padding: 0 }">
|
||||||
|
<div class="padding-add">
|
||||||
|
<el-form ref="artFrom" :model="page" label-width="80px" label-position="right" class="tabform"
|
||||||
|
@submit.native.prevent inline>
|
||||||
|
<el-form-item label="输入搜索">
|
||||||
|
<el-input clearable v-model="page.rule_name" placeholder="品牌名称/关键词"
|
||||||
|
class="form_content_width"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="userSearchs">查询</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
<el-card :bordered="false" shadow="never" class="ivu-mt-16">
|
||||||
|
<el-button type="primary" @click="addType">添加品牌</el-button>
|
||||||
|
<el-table @current-change="tableCurrentChange" ref="table" :data="tableData" v-loading="loading"
|
||||||
|
highlight-current-row :row-key="getRowKey" @selection-change="handleSelectRow" empty-text="暂无数据"
|
||||||
|
class="mt14">
|
||||||
|
<el-table-column type="selection" width="60" :reserve-selection="true"> </el-table-column>
|
||||||
|
<el-table-column label="编号">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.brandNum }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="品牌名称">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.name }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="品牌首字母">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button @click="showAttrList(scope.row)" type="text">
|
||||||
|
{{ scope.row.attrCount }}
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="排序">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button @click="showAttrList(scope.row)" type="text">
|
||||||
|
{{ scope.row.attrCount }}
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="是否显示">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button @click="showAttrList(scope.row)" type="text">
|
||||||
|
{{ scope.row.attrCount }}
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" fixed="right">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<a @click="edit(scope.row)">编辑</a>
|
||||||
|
<el-divider direction="vertical"></el-divider>
|
||||||
|
<a @click="del(scope.row)">删除</a>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<div class="acea-row row-right page">
|
||||||
|
<el-pagination
|
||||||
|
@size-change="handleSizeChange"
|
||||||
|
@current-change="handleCurrentChange"
|
||||||
|
:current-page="page.currentPage"
|
||||||
|
:page-sizes="[10, 15, 20, 30]"
|
||||||
|
:page-size="page.pageSize"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
:total="page.totalCount" />
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import productApi from '@/api/product/productAttr.js';
|
||||||
|
import { loadingFn } from "@/utils/validate"
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
selection: [],
|
||||||
|
selectAttrList: null,
|
||||||
|
isShowAttrList: false,
|
||||||
|
loading: false,
|
||||||
|
page: {
|
||||||
|
"currentPage": 1,
|
||||||
|
"pageSize": 10,
|
||||||
|
"params": {},
|
||||||
|
totalCount: 0
|
||||||
|
},
|
||||||
|
tableData: [],
|
||||||
|
total: 0,
|
||||||
|
selectedIds: new Set(), //选中合并项的id
|
||||||
|
ids: [],
|
||||||
|
multipleSelection: [],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {},
|
||||||
|
created() { },
|
||||||
|
methods: {
|
||||||
|
tableCurrentChange(e) { },
|
||||||
|
handleCurrentChange(val) { },
|
||||||
|
handleSizeChange(val) { },
|
||||||
|
clearSelection() { },
|
||||||
|
onCancel() { },
|
||||||
|
addType() { },
|
||||||
|
showAttrList(e) { },
|
||||||
|
getRowKey(row) { },
|
||||||
|
//全选和取消全选时触发
|
||||||
|
handleSelectAll(selection) { },
|
||||||
|
// 选中某一行
|
||||||
|
handleSelectRow(selection) { },
|
||||||
|
setChecked() { },
|
||||||
|
// 删除
|
||||||
|
del(row) { },
|
||||||
|
addAttr(model) {
|
||||||
|
},
|
||||||
|
// 编辑
|
||||||
|
edit(row) {
|
||||||
|
},
|
||||||
|
// 列表
|
||||||
|
getList() {
|
||||||
|
loadingFn.call(this, "loading", productApi.brandGetByPage(this.page).then(res => {
|
||||||
|
if (res.code = 20000) ({ list: this.tableData = [], totalCount: this.page.totalCount = 0 } = res.data);
|
||||||
|
}));
|
||||||
|
},
|
||||||
|
// 表格搜索
|
||||||
|
userSearchs() { },
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped></style>
|
||||||
|
|
||||||
@@ -717,7 +717,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24" v-if="formValidate.freight == 3">
|
<!-- <el-col :span="24" v-if="formValidate.freight == 3">
|
||||||
<el-form-item label="" prop="temp_id">
|
<el-form-item label="" prop="temp_id">
|
||||||
<div class="acea-row">
|
<div class="acea-row">
|
||||||
<el-select
|
<el-select
|
||||||
@@ -736,7 +736,7 @@
|
|||||||
<span class="addfont" @click="addTemp">新增运费模板</span>
|
<span class="addfont" @click="addTemp">新增运费模板</span>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col> -->
|
||||||
</el-row>
|
</el-row>
|
||||||
<!-- 营销设置-->
|
<!-- 营销设置-->
|
||||||
<el-row :gutter="24" v-show="headTab.length === 6 ? currentTab === '5' : currentTab === '4'">
|
<el-row :gutter="24" v-show="headTab.length === 6 ? currentTab === '5' : currentTab === '4'">
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog :visible.sync="modal" @closed="onCancel" title="商品规格" width="1000px" v-loading="spinShow">
|
<el-dialog :visible.sync="modal" @close="onCancel" title="商品规格" width="1000px" v-loading="spinShow">
|
||||||
<el-form ref="formDynamic" :model="formDynamic" :rules="rules" class="attrFrom" label-width="110px"
|
<el-form ref="formDynamic" :model="formDynamic" :rules="rules" class="attrFrom" label-width="110px"
|
||||||
label-position="right" @submit.native.prevent>
|
label-position="right" @submit.native.prevent>
|
||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-button type="primary" @click="addBtn" v-if="!isBtn&model=='save'" class="add">添加新规格</el-button>
|
<el-button type="primary" @click="addBtn" v-if="!isBtn & model == 'save'" class="add">添加新规格</el-button>
|
||||||
</el-form>
|
</el-form>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button @click="onClose">取消</el-button>
|
<el-button @click="onClose">取消</el-button>
|
||||||
@@ -104,13 +104,14 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() { },
|
||||||
console.log(this.formDynamic)
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
onCancel() {
|
onCancel() {
|
||||||
this.$parent.clearSelection();
|
this.$parent.clearSelection();
|
||||||
this.$parent.selection = [];
|
this.formDynamic = {
|
||||||
|
name: '',
|
||||||
|
spec: [],
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onClose() {
|
onClose() {
|
||||||
this.ids = 0;
|
this.ids = 0;
|
||||||
@@ -144,17 +145,21 @@ export default {
|
|||||||
}
|
}
|
||||||
this.modal_loading = true;
|
this.modal_loading = true;
|
||||||
Promise.all([...this.formDynamic.spec.map(item => {
|
Promise.all([...this.formDynamic.spec.map(item => {
|
||||||
return productApi[this.model]({
|
return productApi[this.model](Object.assign({
|
||||||
"attributeName": item.value,
|
"attributeName": item.value,
|
||||||
"attributeContent": item.detail.join(","),
|
"attributeContent": item.detail.join(","),
|
||||||
"typeId": this.formDynamic.id,
|
|
||||||
"sort": 1,
|
"sort": 1,
|
||||||
})
|
}, this.model == "save" ? {
|
||||||
|
"typeId": this.formDynamic.id,
|
||||||
|
} : {
|
||||||
|
"id": this.formDynamic.id || ""
|
||||||
|
}))
|
||||||
})]).then(res => {
|
})]).then(res => {
|
||||||
this.$message.success("添加成功")
|
this.$message.success("添加成功")
|
||||||
this.modal = false;
|
this.modal = false;
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.modal_loading = false;
|
this.modal_loading = false;
|
||||||
|
this.model == "save" ? this.$parent.handleCurrentChange() : this.$parent.$refs.attrList.getByPage()
|
||||||
})
|
})
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -222,9 +227,10 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
::v-deep .el-tag{
|
::v-deep .el-tag {
|
||||||
margin-right: 20px !important;
|
margin-right: 20px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.rulesBox {
|
.rulesBox {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@@ -35,7 +35,6 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import productApi from '@/api/product/productAttr.js';
|
import productApi from '@/api/product/productAttr.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "attrList",
|
name: "attrList",
|
||||||
props: {
|
props: {
|
||||||
@@ -111,7 +110,7 @@ export default {
|
|||||||
}],
|
}],
|
||||||
})
|
})
|
||||||
this.$parent.$parent.selection = [data];
|
this.$parent.$parent.selection = [data];
|
||||||
this.$parent.$parent.addAttr('update');
|
this.$parent.$parent.addAttr('typeUpdate');
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
if (this.selectAttrId && this.selectAttrId.indexOf("/") !== -1) {
|
if (this.selectAttrId && this.selectAttrId.indexOf("/") !== -1) {
|
||||||
|
|||||||
@@ -52,8 +52,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
<add-attr :selection="selection" ref="addattr" @getList="userSearchs"></add-attr>
|
<add-attr :selection="selection" ref="addattr" @getList="userSearchs"></add-attr>
|
||||||
<el-dialog @closed="onCancel" title="属性列表" :visible.sync="isShowAttrList" width="30%">
|
<el-dialog title="属性列表" :visible.sync="isShowAttrList" width="30%">
|
||||||
<attrList :selectAttrId="selectAttrId" v-if="isShowAttrList"></attrList>
|
<attrList ref="attrList" :selectAttrId="selectAttrId" v-if="isShowAttrList"></attrList>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -85,14 +85,18 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {},
|
computed: {},
|
||||||
|
watch:{
|
||||||
|
// isShowAttrList(n,o){
|
||||||
|
// this.clearSelection()
|
||||||
|
// }
|
||||||
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
tableCurrentChange(e) {
|
tableCurrentChange(e) {
|
||||||
|
|
||||||
// this.$message.warning()
|
// this.$message.warning()
|
||||||
console.log(e, '===')
|
console.log(e,'===')
|
||||||
},
|
},
|
||||||
handleCurrentChange(val) {
|
handleCurrentChange(val) {
|
||||||
this.artFrom.currentPage = val
|
this.artFrom.currentPage = val
|
||||||
@@ -103,11 +107,11 @@ export default {
|
|||||||
this.getDataList()
|
this.getDataList()
|
||||||
},
|
},
|
||||||
clearSelection(){
|
clearSelection(){
|
||||||
|
this.selection = [];
|
||||||
|
// this.handleSelectRow([]);
|
||||||
this.$refs.table.clearSelection();
|
this.$refs.table.clearSelection();
|
||||||
},
|
},
|
||||||
onCancel(){
|
onCancel(){ },
|
||||||
|
|
||||||
},
|
|
||||||
addType() {
|
addType() {
|
||||||
this.$prompt('请输入类型', '提示', {
|
this.$prompt('请输入类型', '提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
@@ -154,7 +158,6 @@ export default {
|
|||||||
},
|
},
|
||||||
// 选中某一行
|
// 选中某一行
|
||||||
handleSelectRow(selection) {
|
handleSelectRow(selection) {
|
||||||
console.log("selection",selection)
|
|
||||||
this.selection = selection;
|
this.selection = selection;
|
||||||
},
|
},
|
||||||
setChecked() {
|
setChecked() {
|
||||||
@@ -208,7 +211,6 @@ export default {
|
|||||||
getDataList() {
|
getDataList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
productApi.typeFindByPage(this.artFrom).then(res => {
|
productApi.typeFindByPage(this.artFrom).then(res => {
|
||||||
console.log(res.data);
|
|
||||||
if (res.code = 20000) ({ list: this.tableList = [], totalCount: this.artFrom.totalCount = 0 } = res.data);
|
if (res.code = 20000) ({ list: this.tableList = [], totalCount: this.artFrom.totalCount = 0 } = res.data);
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user