会员中心添加首页按钮,pclogo改为阿里云地址,编辑折扣券没有传折扣值,

This commit is contained in:
mabo
2021-07-21 15:27:39 +08:00
parent f512caa81d
commit 75bff1edc4
30 changed files with 490 additions and 903 deletions

View File

@@ -1,19 +1,16 @@
<template>
<div class="search">
<Card>
<Row @keydown.enter.native="handleSearch">
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
<Form-item label="品牌名称" prop="name">
<Input type="text" v-model="searchForm.name" placeholder="请输入品牌名称" clearable style="width: 200px" />
</Form-item>
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
</Form>
</Row>
<Form ref="searchForm" @keydown.enter.native="handleSearch" :model="searchForm" inline :label-width="70" class="search-form">
<Form-item label="品牌名称">
<Input type="text" v-model="searchForm.name" placeholder="请输入品牌名称" clearable style="width: 200px" />
</Form-item>
<Button @click="handleSearch" type="primary">搜索</Button>
</Form>
<Row class="operation padding-row">
<Button @click="add" type="primary">添加</Button>
</Row>
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect"></Table>
<Table :loading="loading" border :columns="columns" :data="data" ref="table"></Table>
<Row type="flex" justify="end" class="mt_10">
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small"
show-total show-elevator show-sizer></Page>
@@ -30,8 +27,7 @@
</Form>
<div slot="footer">
<Button type="text" @click="modalVisible = false">取消</Button>
<Button type="primary" :loading="submitLoading" @click="handleSubmit">提交
</Button>
<Button type="primary" :loading="submitLoading" @click="handleSubmit">提交</Button>
</div>
</Modal>
</div>
@@ -50,7 +46,7 @@ import uploadPicInput from "@/views/my-components/lili/upload-pic-input";
export default {
name: "brand",
components: {
uploadPicInput,
uploadPicInput
},
data() {
return {
@@ -74,8 +70,6 @@ export default {
// 表单验证规则
formValidate: {},
submitLoading: false, // 添加或编辑提交状态
selectList: [], // 多选数据
selectCount: 0, // 多选计数
columns: [
{
title: "品牌名称",
@@ -237,51 +231,38 @@ export default {
this.getDataList();
}
},
// 初始化数据
init() {
this.getDataList();
},
// 分页 改变页码
changePage(v) {
this.searchForm.pageNumber = v;
this.getDataList();
this.clearSelectAll();
},
// 分页 改变页数
changePageSize(v) {
this.searchForm.pageSize = v;
this.getDataList();
},
// 搜索
handleSearch() {
this.searchForm.pageNumber = 1;
this.searchForm.pageSize = 10;
this.getDataList();
},
changeSort(e) {
this.searchForm.sort = e.key;
this.searchForm.order = e.order;
if (e.order === "normal") {
this.searchForm.order = "";
}
this.getDataList();
},
clearSelectAll() {
this.$refs.table.selectAll(false);
},
changeSelect(e) {
this.selectList = e;
this.selectCount = e.length;
},
// 获取数据
getDataList() {
this.loading = true;
// 带多条件搜索参数获取表单数据 请自行修改接口
getManagerBrandPage(this.searchForm).then((res) => {
this.loading = false;
if (res.success) {
console.warn(12);
this.data = res.result.records;
this.total = res.result.total;
}
});
},
// 提交表单
handleSubmit() {
this.$refs.form.validate((valid) => {
if (valid) {
@@ -311,6 +292,7 @@ export default {
}
});
},
// 添加
add() {
this.modalType = 0;
this.modalTitle = "添加";
@@ -318,6 +300,7 @@ export default {
delete this.form.id;
this.modalVisible = true;
},
// 编辑
edit(v) {
this.modalType = 1;
this.modalTitle = "编辑";
@@ -333,6 +316,7 @@ export default {
this.form = data;
this.modalVisible = true;
},
// 启用品牌
enable(v) {
this.$Modal.confirm({
title: "确认启用",
@@ -349,6 +333,7 @@ export default {
},
});
},
// 禁用
disable(v) {
this.$Modal.confirm({
title: "确认禁用",

View File

@@ -1,111 +1,113 @@
<template>
<div class="wrapper">
<div class="operation">
<Button @click="addParent" icon="md-add">添加一级分类</Button>
</div>
<Table size="default" :load-data="handleLoadData" row-key="id" :loading="loading" :data="tableData" :columns="columns">
<div>
<Card>
<div class="mb_10">
<Button @click="addParent" icon="md-add">添加一级分类</Button>
</div>
<Table :load-data="handleLoadData" row-key="id" :loading="loading" :data="tableData" :columns="columns">
<template slot="action" slot-scope="scope">
<Dropdown v-show="scope.row.level == 2" transfer="true" trigger="click">
<Button size="small">
绑定
<Icon type="ios-arrow-down"></Icon>
</Button>
<DropdownMenu slot="list">
<DropdownItem @click.native="brandOperation(scope.row)">编辑绑定品牌</DropdownItem>
<DropdownItem @click.native="specOperation(scope.row)">编辑绑定规格</DropdownItem>
<DropdownItem @click.native="parameterOperation(scope.row)">编辑绑定参数</DropdownItem>
</DropdownMenu>
</Dropdown>
<template slot="action" slot-scope="scope">
<Dropdown v-show="scope.row.level == 2" transfer="true" trigger="click">
<Button size="small">
绑定
<Icon type="ios-arrow-down"></Icon>
&nbsp;
<Dropdown transfer="true" trigger="click">
<Button size="small">
操作
<Icon type="ios-arrow-down"></Icon>
</Button>
<DropdownMenu slot="list">
<DropdownItem @click.native="edit(scope.row)">编辑</DropdownItem>
<DropdownItem v-if="scope.row.deleteFlag == 1" @click.native="enable(scope.row)">启用</DropdownItem>
<DropdownItem v-if="scope.row.deleteFlag == 0" @click.native="disable(scope.row)">禁用</DropdownItem>
<DropdownItem @click.native="remove(scope.row)">删除</DropdownItem>
</DropdownMenu>
</Dropdown>
&nbsp;
<Button v-show="scope.row.level != 2" type="primary" @click="addChildren(scope.row)" size="small" icon="md-add" style="margin-right: 5px">添加子分类
</Button>
<DropdownMenu slot="list">
<DropdownItem @click.native="brandOperation(scope.row)">编辑绑定品牌</DropdownItem>
<DropdownItem @click.native="specOperation(scope.row)">编辑绑定规格</DropdownItem>
<DropdownItem @click.native="parameterOperation(scope.row)">编辑绑定参数</DropdownItem>
</DropdownMenu>
</Dropdown>
</template>
&nbsp;
<Dropdown transfer="true" trigger="click">
<Button size="small">
操作
<Icon type="ios-arrow-down"></Icon>
</Button>
<DropdownMenu slot="list">
<DropdownItem @click.native="edit(scope.row)">编辑</DropdownItem>
<DropdownItem v-if="scope.row.deleteFlag == 1" @click.native="enable(scope.row)">启用</DropdownItem>
<DropdownItem v-if="scope.row.deleteFlag == 0" @click.native="disable(scope.row)">禁用</DropdownItem>
<DropdownItem @click.native="remove(scope.row)">删除</DropdownItem>
</DropdownMenu>
</Dropdown>
&nbsp;
<Button v-show="scope.row.level != 2" type="primary" @click="addChildren(scope.row)" size="small" icon="md-add" style="margin-right: 5px">添加子分类
</Button>
</template>
<template slot="commissionRate" slot-scope="scope">
{{ scope.row.commissionRate }}%
</template>
<template slot="commissionRate" slot-scope="scope">
{{ scope.row.commissionRate }}%
</template>
<template slot="deleteFlag" slot-scope="{row}">
<Tag :class="{'ml_10': row.deleteFlag}" :color="row.deleteFlag == false ? 'success' : 'error'">{{row.deleteFlag == false ? '正常启用' : '禁用'}}</Tag>
</template>
</Table>
<template slot="deleteFlag" slot-scope="{row}">
<Tag :class="{'ml_10': row.deleteFlag}" :color="row.deleteFlag == false ? 'success' : 'error'">{{row.deleteFlag == false ? '正常启用' : '禁用'}}</Tag>
</template>
</Table>
<Modal :title="modalTitle" v-model="modalVisible" :mask-closable="false" :width="500">
<Form ref="form" :model="formAdd" :label-width="100" :rules="formValidate">
<div v-if="showParent">
<FormItem label="上级分类" prop="parentId">
{{ parentTitle }}
<Input v-model="formAdd.parentId" clearable style="width: 100%; display: none" />
<Modal :title="modalTitle" v-model="modalVisible" :mask-closable="false" :width="500">
<Form ref="form" :model="formAdd" :label-width="100" :rules="formValidate">
<div v-if="showParent">
<FormItem label="上级分类" prop="parentId">
{{ parentTitle }}
<Input v-model="formAdd.parentId" clearable style="width: 100%; display: none" />
</FormItem>
</div>
<FormItem label="层级" prop="level" style="display: none">
<Input v-model="formAdd.level" clearable style="width: 100%" />
</FormItem>
<FormItem label="分类名称" prop="name">
<Input v-model="formAdd.name" clearable style="width: 100%" />
</FormItem>
<FormItem label="分类图标" prop="image">
<upload-pic-input v-model="formAdd.image" style="width: 100%"></upload-pic-input>
</FormItem>
<FormItem label="排序值" prop="sortOrder" style="width: 345px">
<InputNumber v-model="formAdd.sortOrder"></InputNumber>
</FormItem>
<FormItem label="佣金比例(%)" prop="commissionRate" style="width: 345px">
<InputNumber v-model="formAdd.commissionRate"></InputNumber>
</FormItem>
<FormItem label="是否启用" prop="deleteFlag">
<i-switch size="large" v-model="formAdd.deleteFlag" :true-value="0" :false-value="1">
<span slot="open">启用</span>
<span slot="close">禁用</span>
</i-switch>
</FormItem>
</Form>
<div slot="footer">
<Button type="text" @click="modalVisible = false">取消</Button>
<Button type="primary" :loading="submitLoading" @click="Submit">提交</Button>
</div>
<FormItem label="层级" prop="level" style="display: none">
<Input v-model="formAdd.level" clearable style="width: 100%" />
</FormItem>
<FormItem label="分类名称" prop="name">
<Input v-model="formAdd.name" clearable style="width: 100%" />
</FormItem>
<FormItem label="分类图标" prop="image">
<upload-pic-input v-model="formAdd.image" style="width: 100%"></upload-pic-input>
</FormItem>
<FormItem label="排序值" prop="sortOrder" style="width: 345px">
<InputNumber v-model="formAdd.sortOrder"></InputNumber>
</FormItem>
<FormItem label="佣金比例(%)" prop="commissionRate" style="width: 345px">
<InputNumber v-model="formAdd.commissionRate"></InputNumber>
</FormItem>
<FormItem label="是否启用" prop="deleteFlag">
<i-switch size="large" v-model="formAdd.deleteFlag" :true-value="0" :false-value="1">
<span slot="open">启用</span>
<span slot="close">禁用</span>
</i-switch>
</FormItem>
</Form>
<div slot="footer">
<Button type="text" @click="modalVisible = false">取消</Button>
<Button type="primary" :loading="submitLoading" @click="Submit">提交</Button>
</div>
</Modal>
</Modal>
<Modal :title="modalBrandTitle" v-model="modalBrandVisible" :mask-closable="false" :width="500">
<Form ref="brandForm" :model="brandForm" :label-width="100">
<Select v-model="brandForm.categoryBrands" multiple>
<Option v-for="item in brandWay" :value="item.id" :key="item.id">{{ item.name }}</Option>
<Modal :title="modalBrandTitle" v-model="modalBrandVisible" :mask-closable="false" :width="500">
<Form ref="brandForm" :model="brandForm" :label-width="100">
<Select v-model="brandForm.categoryBrands" multiple>
<Option v-for="item in brandWay" :value="item.id" :key="item.id">{{ item.name }}</Option>
</Select>
</Form>
<div slot="footer">
<Button type="text" @click="modalBrandVisible = false">取消</Button>
<Button type="primary" :loading="submitLoading" @click="saveCategoryBrand">提交</Button>
</div>
</Modal>
</Select>
</Form>
<div slot="footer">
<Button type="text" @click="modalBrandVisible = false">取消</Button>
<Button type="primary" :loading="submitLoading" @click="saveCategoryBrand">提交</Button>
</div>
</Modal>
<Modal :title="modalSpecTitle" v-model="modalSpecVisible" :mask-closable="false" :width="500">
<Form ref="specForm" :model="specForm" :label-width="100">
<Select v-model="specForm.categorySpecs" multiple>
<Option v-for="item in specifications" :value="item.id" :key="item.id" :label="item.specName">
</Option>
</Select>
</Form>
<div slot="footer">
<Button type="text" @click="modalSpecVisible = false">取消</Button>
<Button type="primary" :loading="submitLoading" @click="saveCategorySpec">提交</Button>
</div>
</Modal>
<Modal :title="modalSpecTitle" v-model="modalSpecVisible" :mask-closable="false" :width="500">
<Form ref="specForm" :model="specForm" :label-width="100">
<Select v-model="specForm.categorySpecs" multiple>
<Option v-for="item in specifications" :value="item.id" :key="item.id" :label="item.specName">
</Option>
</Select>
</Form>
<div slot="footer">
<Button type="text" @click="modalSpecVisible = false">取消</Button>
<Button type="primary" :loading="submitLoading" @click="saveCategorySpec">提交</Button>
</div>
</Modal>
</Card>
</div>
</template>
<script>
@@ -126,22 +128,18 @@ import {
import uploadPicInput from "@/views/my-components/lili/upload-pic-input";
import {regular} from "@/utils";
export default {
name: "lili-components",
name: "goods-category",
components: {
uploadPicInput,
uploadPicInput
},
data() {
return {
categoryList: [], // 分类列表
sortCate: "", //筛选的数据
loading: false, // 加载状态
selectCount: 0, // 选择数量
brands: [], //品牌集合
specifications: [], //规格集合
categoryId: "", // 分类id
category_brands: [], //已经选择的品牌
categorySpecs: [], //已经选择的规格
expandLevel: 1, // 展开层级
modalType: 0, // 添加或编辑标识
modalVisible: false, // 添加或编辑显示
modalBrandVisible: false, //品牌关联编辑显示
@@ -149,8 +147,8 @@ export default {
modalTitle: "", // 添加或编辑标题
showParent: false, // 是否展示上级菜单
parentTitle: "", // 父级菜单名称
modalBrandTitle: "",
modalSpecTitle: "",
modalBrandTitle: "", // 品牌弹窗标题
modalSpecTitle: "", // 规格弹窗标题
formAdd: {
// 添加或编辑表单对象初始化数据
parentId: "",
@@ -165,7 +163,7 @@ export default {
categoryBrands: [],
},
brandWay: "", //请求绑定品牌的信息
specForm: {},
specForm: {}, // 规格数据
// 表单验证规则
formValidate: {
commissionRate: [
@@ -197,22 +195,13 @@ export default {
slot: "action",
},
],
tableData: [],
categoryIndex: 0,
tableData: [], // 表格数据
categoryIndex: 0, // 分类id
checkedCategoryChildren: "", //选中的分类子级
};
},
methods: {
// changeSortCate(val) {
// let way = this.categoryList.find((item, index) => {
// if (item.name == val) {
// this.categoryIndex = index;
// console.log((this.categoryIndex = index));
// return item.name == val;
// }
// });
// this.tableData = [way];
// },
// 初始化数据
init() {
this.getAllList(0);
this.getBrandList();
@@ -239,7 +228,6 @@ export default {
this.categoryId = v.id;
this.modalBrandTitle = "品牌关联";
this.brandForm.categoryBrands = res.result.map((item) => item.id);
// this.brandWay = {...res.result}
this.modalBrandVisible = true;
});
},
@@ -272,27 +260,22 @@ export default {
}
});
},
// 编辑绑定参数
parameterOperation(v) {
this.$router.push({ name: "parameter", query: { id: v.id } });
},
refresh() {
this.loading = true;
let that = this;
setTimeout(function () {
that.loading = false;
}, 1000);
},
// 添加子分类
addChildren(v) {
this.modalType = 0;
this.modalTitle = "添加子分类";
this.parentTitle = v.name;
this.formAdd.level = eval(v.level + "+1");
this.showParent = true;
// this.$refs.form.resetFields();
delete this.formAdd.id;
this.formAdd.parentId = v.id;
this.modalVisible = true;
},
// 编辑分类
edit(v) {
this.modalType = 1;
this.modalTitle = "编辑";
@@ -307,6 +290,7 @@ export default {
this.showParent = false;
this.modalVisible = true;
},
// 添加一级分类
addParent() {
this.modalType = 0;
this.modalTitle = "添加一级分类";
@@ -317,6 +301,7 @@ export default {
this.formAdd.parentId = 0;
this.modalVisible = true;
},
// 提交
Submit() {
this.$refs.form.validate((valid) => {
if (valid) {
@@ -348,10 +333,10 @@ export default {
}
});
},
// 删除分类
remove(v) {
this.$Modal.confirm({
title: "确认删除",
// 记得确认修改此处
content: "您确认要删除 " + v.name + " ?",
loading: true,
onOk: () => {
@@ -407,7 +392,7 @@ export default {
}
}
},
// 获取分类数据
getAllList(parent_id) {
this.loading = true;
getCategoryTree(parent_id).then((res) => {
@@ -427,6 +412,7 @@ export default {
}
});
},
// 启用分类
enable(v) {
this.$Modal.confirm({
title: "确认启用",
@@ -448,6 +434,7 @@ export default {
},
});
},
// 禁用分类
disable(v) {
this.$Modal.confirm({
title: "确认禁用",
@@ -476,14 +463,4 @@ export default {
};
</script>
<style lang="scss" scoped>
.wrapper {
width: 100%;
height: 100%;
background: #fff;
padding: 20px;
}
.operation {
margin-bottom: 2vh;
}
</style>

View File

@@ -116,7 +116,6 @@ import {
} from "@/api/goods";
export default {
name: "categoryParams",
components: {},
data() {
return {
/** 分类ID */
@@ -127,19 +126,17 @@ export default {
modalType: 0,
/** 添加或编辑标题 */
modalTitle: "",
modalTitle1: "",
/** 参数添加或编辑弹出框 */
dialogParamsVisible: false,
/** 参数组添加或编辑弹出框 */
dialogParamsGroupVisible: false,
/** 参数ID **/
paramId: "",
//参数表单
paramForm: {},
/** 参数值 **/
ops:{
options: []
},
// 参数表单
paramGroupForm: {},
/** 添加、编辑参数 规格 */
formValidate: {
@@ -161,6 +158,7 @@ export default {
},
},
methods: {
// 初始化数据
init() {
this.getDataList();
},
@@ -207,6 +205,7 @@ export default {
this.modalTitle = "修改参数组";
this.dialogParamsGroupVisible = true;
},
// 添加参数
handleAddParamsGroup() {
this.paramGroupForm = {
@@ -279,6 +278,7 @@ export default {
}
});
},
// 获取分类列表
getDataList() {
getCategoryParamsListData(this.categoryId).then((res) => {
if (res.success) {

View File

@@ -1,27 +1,25 @@
<template>
<div class="search">
<Card>
<Row @keydown.enter.native="handleSearch">
<Form
ref="searchForm"
:model="searchForm"
inline
:label-width="70"
class="search-form"
>
<Form-item label="规格名称" prop="specName">
<Input
type="text"
v-model="searchForm.specName"
placeholder="请输入规格名称"
clearable
style="width: 200px"
/>
</Form-item>
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
</Form>
</Row>
<Form
@keydown.enter.native="handleSearch"
ref="searchForm"
:model="searchForm"
inline
:label-width="70"
class="search-form"
>
<Form-item label="规格名称" prop="specName">
<Input
type="text"
v-model="searchForm.specName"
placeholder="请输入规格名称"
clearable
style="width: 200px"
/>
</Form-item>
<Button @click="handleSearch" type="primary" class="search-btn">搜索</Button>
</Form>
<Row class="operation padding-row">
<Button @click="add" type="primary">添加</Button>
<Button @click="delAll">批量删除</Button>
@@ -58,7 +56,7 @@
:mask-closable="false"
:width="500"
>
<Form ref="form" :model="form" :label-width="100" :rules="formValidate">
<Form ref="form" :model="form" :label-width="100">
<FormItem label="规格名称" prop="specName">
<Input v-model="form.specName" maxlength="30" clearable style="width: 100%"/>
</FormItem>
@@ -73,11 +71,7 @@
popper-class="spec-values-popper"
style="width: 100%; text-align: left; margin-right: 10px"
>
<Option
v-for="item in specValue"
:value="item"
:label="item"
>
<Option v-for="item in specValue" :value="item" :label="item" :key="item">
</Option>
</Select>
</FormItem>
@@ -110,7 +104,6 @@ export default {
modalType: 0, // 添加或编辑标识
modalVisible: false, // 添加或编辑显示
modalTitle: "", // 添加或编辑标题
specTitle: "", // 添加或编辑规格值
searchForm: {
// 搜索框初始化对象
pageNumber: 1, // 当前页数
@@ -125,8 +118,6 @@ export default {
},
/** 编辑规格值 */
specValue: [],
// 表单验证规则
formValidate: {},
submitLoading: false, // 添加或编辑提交状态
selectList: [], // 多选数据
selectCount: 0, // 多选计数
@@ -320,10 +311,10 @@ export default {
}
this.modalVisible = true;
},
// 删除规格
remove(v) {
this.$Modal.confirm({
title: "确认删除",
// 记得确认修改此处
content: "您确认要删除 " + v.specName + " ?",
loading: true,
onOk: () => {
@@ -338,6 +329,7 @@ export default {
},
});
},
// 批量删除
delAll() {
if (this.selectCount <= 0) {
this.$Message.warning("您还未选择要删除的数据");