添加注释,删除无用代码,bug修改
parent
df9ea021b3
commit
87980277bf
|
@ -192,12 +192,6 @@ export const otherRouter = {
|
|||
name: "edit-platform-coupon",
|
||||
component: () => import("@/views/promotion/coupon/couponPublish.vue")
|
||||
},
|
||||
{
|
||||
path: "promotion/platform-coupon-info",
|
||||
title: "详情",
|
||||
name: "platform-coupon-info",
|
||||
component: () => import("@/views/promotion/coupon/couponInfo.vue")
|
||||
},
|
||||
{
|
||||
path: "coupon-activity/add",
|
||||
title: "添加优惠券活动",
|
||||
|
@ -216,12 +210,6 @@ export const otherRouter = {
|
|||
name: "coupon-activity-info",
|
||||
component: () => import("@/views/promotion/couponActivity/couponInfo.vue")
|
||||
},
|
||||
{
|
||||
path: "promotion/platform-coupon-info",
|
||||
title: "详情",
|
||||
name: "platform-coupon-activity",
|
||||
component: () => import("@/views/promotion/coupon/couponInfo.vue")
|
||||
},
|
||||
{
|
||||
path: "promotion/manager-pintuan",
|
||||
title: "平台拼团",
|
||||
|
|
|
@ -17,12 +17,11 @@
|
|||
<Button @click="handleSearch" class="search-btn" type="primary" icon="ios-search">搜索</Button>
|
||||
</Form>
|
||||
</Row>
|
||||
<Row class="operation padding-row">
|
||||
<Row class="operation padding-row" v-if="!selectedMember">
|
||||
<Button @click="addMember" type="primary">添加会员</Button>
|
||||
</Row>
|
||||
|
||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table">
|
||||
</Table>
|
||||
<Table :loading="loading" border :columns="columns" class="mt_10" :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>
|
||||
|
@ -43,29 +42,20 @@
|
|||
<Input type="password" password v-model="addMemberForm.password" maxlength="20" placeholder="请输入会员密码" />
|
||||
</FormItem>
|
||||
</Form>
|
||||
|
||||
<div slot="footer">
|
||||
<Button @click="addFlag = false">
|
||||
取消
|
||||
</Button>
|
||||
<Button type="primary" :loading="handleAddLoading" @click="addMemberSubmit">
|
||||
确定
|
||||
</Button>
|
||||
<Button @click="addFlag = false">取消</Button>
|
||||
<Button type="primary" :loading="handleAddLoading" @click="addMemberSubmit">确定</Button>
|
||||
</div>
|
||||
</Modal>
|
||||
|
||||
<!-- 修改模态框 -->
|
||||
<Modal v-model="descFlag" :title="descTitle" @on-ok="handleSubmitModal" width="500">
|
||||
<Form ref="form" :model="form" :rules="ruleValidate" :label-width="80">
|
||||
<FormItem label="头像">
|
||||
<img :src="form.face" class="face" />
|
||||
<Button type="text" class="upload" @click="
|
||||
() => {
|
||||
<Button type="text" class="upload" @click="() => {
|
||||
this.picModelFlag = true;
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
}
|
||||
">修改
|
||||
</Button>
|
||||
}">修改</Button>
|
||||
<input type="file" style="display: none" id="file" />
|
||||
</FormItem>
|
||||
<FormItem label="用户名" prop="name">
|
||||
|
@ -93,12 +83,9 @@
|
|||
<FormItem label="所在地" prop="mail">
|
||||
<div class="form-item" v-if="!updateRegion">
|
||||
<Input disabled style="width: 250px" :value="form.region" />
|
||||
<Button type="text" @click="
|
||||
() => {
|
||||
<Button type="text" @click="() => {
|
||||
this.updateRegion = !this.updateRegion;
|
||||
}
|
||||
">修改
|
||||
</Button>
|
||||
}">修改</Button>
|
||||
</div>
|
||||
<div class="form-item" v-else>
|
||||
<region style="width: 250px" @selected="selectedRegion" />
|
||||
|
@ -121,8 +108,7 @@ import * as RegExp from "@/libs/RegExp.js";
|
|||
export default {
|
||||
name: "member",
|
||||
components: {
|
||||
region,
|
||||
ossManage
|
||||
region, ossManage
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -372,9 +358,6 @@ export default {
|
|||
// 分页 改变页码
|
||||
changePage(v) {
|
||||
this.searchForm.pageNumber = v;
|
||||
// 此处如果是父子级传值的时候需要做一下处理
|
||||
//selectedMember
|
||||
|
||||
this.getData();
|
||||
},
|
||||
// 分页 改变页数
|
||||
|
|
|
@ -1,509 +0,0 @@
|
|||
<template>
|
||||
<div class="search">
|
||||
<Card>
|
||||
<Row class="operation">
|
||||
<Button @click="add" type="primary" icon="md-add">添加</Button>
|
||||
<Button @click="disableAll" icon="md-trash">批量禁用</Button>
|
||||
<Button @click="getDataList" icon="md-refresh">刷新</Button>
|
||||
<Button type="dashed" @click="openTip = !openTip">{{
|
||||
openTip ? "关闭提示" : "开启提示"
|
||||
}}</Button>
|
||||
</Row>
|
||||
<Row v-show="openTip">
|
||||
<Alert show-icon>
|
||||
已选择 <span class="select-count">{{ selectCount }}</span> 项
|
||||
<a class="select-clear" @click="clearSelectAll">清空</a>
|
||||
</Alert>
|
||||
</Row>
|
||||
<Table
|
||||
:loading="loading"
|
||||
border
|
||||
:columns="columns"
|
||||
:data="data"
|
||||
ref="table"
|
||||
sortable="custom"
|
||||
@on-sort-change="changeSort"
|
||||
@on-selection-change="changeSelect"
|
||||
></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>
|
||||
</Row>
|
||||
</Card>
|
||||
<Modal
|
||||
:title="modalTitle"
|
||||
v-model="modalVisible"
|
||||
:mask-closable="false"
|
||||
:width="500"
|
||||
>
|
||||
<Form ref="form" :model="form" :label-width="100" :rules="formValidate">
|
||||
<FormItem label="名称" prop="name">
|
||||
<Input v-model="form.name" clearable style="width: 100%" />
|
||||
</FormItem>
|
||||
<FormItem label="图片" prop="url">
|
||||
<upload-pic-input
|
||||
v-model="form.url"
|
||||
style="width: 100%"
|
||||
></upload-pic-input>
|
||||
</FormItem>
|
||||
<FormItem label="操作类型" prop="operationType">
|
||||
<Select
|
||||
v-model="form.operationType"
|
||||
placeholder="请选择"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
>
|
||||
<Option value="NONE">无操作</Option>
|
||||
<Option value="URL">链接地址</Option>
|
||||
<Option value="GOODS">商品序号</Option>
|
||||
<Option value="SHOP">店铺编号</Option>
|
||||
<Option value="KEYWORD">关键字</Option>
|
||||
<Option value="CATEGORY">商品分类</Option>
|
||||
</Select>
|
||||
</FormItem>
|
||||
<FormItem label="链接值" prop="sort">
|
||||
<Input v-model="form.operationUrl" clearable style="width: 100%" />
|
||||
</FormItem>
|
||||
<FormItem label="排序" prop="sort">
|
||||
<InputNumber :max="999" :min="0" v-model="form.sort"></InputNumber>
|
||||
</FormItem>
|
||||
</Form>
|
||||
<div slot="footer">
|
||||
<Button type="text" @click="modalVisible = false">取消</Button>
|
||||
<Button type="primary" :loading="submitLoading" @click="handleSubmit"
|
||||
>提交</Button
|
||||
>
|
||||
</div>
|
||||
</Modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getFocusData,
|
||||
saveFocusData,
|
||||
disableFocus,
|
||||
enableFocus,
|
||||
delFocus,
|
||||
} from "@/api/pages";
|
||||
import uploadPicInput from "@/views/my-components/lili/upload-pic-input";
|
||||
|
||||
export default {
|
||||
name: "mobileFocus",
|
||||
components: {
|
||||
uploadPicInput,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
openTip: true, // 显示提示
|
||||
loading: true, // 表单加载状态
|
||||
modalType: 0, // 添加或编辑标识
|
||||
modalVisible: false, // 添加或编辑显示
|
||||
modalTitle: "", // 添加或编辑标题
|
||||
searchForm: {
|
||||
// 搜索框初始化对象
|
||||
clientType: "MOBILE", //客户端类型
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
sort: "createTime", // 默认排序字段
|
||||
order: "desc", // 默认排序方式
|
||||
},
|
||||
form: {
|
||||
// 添加或编辑表单对象初始化数据
|
||||
name: "",
|
||||
operationType: "",
|
||||
operationUrl: "",
|
||||
url: "",
|
||||
sort: 0,
|
||||
},
|
||||
// 表单验证规则
|
||||
formValidate: {
|
||||
name: [{ required: true, message: "不能为空", trigger: "blur" }],
|
||||
},
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
selectList: [], // 多选数据
|
||||
selectCount: 0, // 多选计数
|
||||
columns: [
|
||||
// 表头
|
||||
{
|
||||
type: "selection",
|
||||
width: 60,
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "名称",
|
||||
key: "name",
|
||||
minWidth: 120,
|
||||
sortable: false,
|
||||
},
|
||||
{
|
||||
title: "状态",
|
||||
key: "status",
|
||||
minWidth: 100,
|
||||
sortable: false,
|
||||
render: (h, params) => {
|
||||
if (params.row.status == "CLOSE") {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "error",
|
||||
text: "禁用",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
} else if (params.row.status == "OPEN") {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "success",
|
||||
text: "启用",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "图片",
|
||||
key: "url",
|
||||
minWidth: 120,
|
||||
sortable: false,
|
||||
render: (h, params) => {
|
||||
return h("img", {
|
||||
attrs: {
|
||||
src: params.row.url,
|
||||
alt: "加载图片失败",
|
||||
},
|
||||
style: {
|
||||
cursor: "pointer",
|
||||
width: "80px",
|
||||
height: "60px",
|
||||
margin: "10px 0",
|
||||
"object-fit": "contain",
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "排序",
|
||||
key: "sort",
|
||||
minWidth: 120,
|
||||
sortable: false,
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
align: "center",
|
||||
width: 200,
|
||||
render: (h, params) => {
|
||||
let enableOrDisable = "";
|
||||
if (params.row.status == "CLOSE") {
|
||||
enableOrDisable = h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "success",
|
||||
size: "small",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.enable(params.row);
|
||||
},
|
||||
},
|
||||
},
|
||||
"启用"
|
||||
);
|
||||
} else {
|
||||
enableOrDisable = h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
size: "small",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.disable(params.row);
|
||||
},
|
||||
},
|
||||
},
|
||||
"禁用"
|
||||
);
|
||||
}
|
||||
return h("div", [
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "primary",
|
||||
size: "small",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.edit(params.row);
|
||||
},
|
||||
},
|
||||
},
|
||||
"编辑"
|
||||
),
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "error",
|
||||
size: "small",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.remove(params.row);
|
||||
},
|
||||
},
|
||||
},
|
||||
"删除"
|
||||
),
|
||||
enableOrDisable,
|
||||
]);
|
||||
},
|
||||
},
|
||||
],
|
||||
data: [], // 表单数据
|
||||
total: 0, // 表单数据总数
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
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();
|
||||
},
|
||||
handleReset() {
|
||||
this.$refs.searchForm.resetFields();
|
||||
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;
|
||||
// 带多条件搜索参数获取表单数据 请自行修改接口
|
||||
getFocusData(this.searchForm).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.data = res.result.records;
|
||||
this.total = res.result.total;
|
||||
}
|
||||
});
|
||||
// 以下为模拟数据
|
||||
//this.data = [
|
||||
//];
|
||||
this.total = this.data.length;
|
||||
this.loading = false;
|
||||
},
|
||||
enable(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认启用",
|
||||
// 记得确认修改此处
|
||||
content: "您确认要确认启用 " + v.name + " ?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
// 删除
|
||||
enableFocus(v.id).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
disable(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认禁用",
|
||||
// 记得确认修改此处
|
||||
content: "您确认要禁用 " + v.name + " ?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
// 删除
|
||||
disableFocus(v.id).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
handleSubmit() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.form.ClientType = "MOBILE";
|
||||
this.submitLoading = true;
|
||||
if (this.modalType === 0) {
|
||||
this.form.status = "OPEN";
|
||||
// 添加 避免编辑后传入id等数据 记得删除
|
||||
delete this.form.id;
|
||||
saveFocusData(this.form).then((res) => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.getDataList();
|
||||
this.modalVisible = false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// 编辑
|
||||
saveFocusData(this.form).then((res) => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.getDataList();
|
||||
this.modalVisible = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
add() {
|
||||
this.modalType = 0;
|
||||
this.modalTitle = "添加";
|
||||
this.$refs.form.resetFields();
|
||||
delete this.form.id;
|
||||
this.modalVisible = true;
|
||||
},
|
||||
edit(v) {
|
||||
this.modalType = 1;
|
||||
this.modalTitle = "编辑";
|
||||
this.$refs.form.resetFields();
|
||||
// 转换null为""
|
||||
for (let attr in v) {
|
||||
if (v[attr] === null) {
|
||||
v[attr] = "";
|
||||
}
|
||||
}
|
||||
let str = JSON.stringify(v);
|
||||
let data = JSON.parse(str);
|
||||
this.form = data;
|
||||
this.modalVisible = true;
|
||||
},
|
||||
remove(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认删除",
|
||||
// 记得确认修改此处
|
||||
content: "您确认要删除么?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
// 删除
|
||||
delFocus(v.id).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
disableAll() {
|
||||
if (this.selectCount <= 0) {
|
||||
this.$Message.warning("您还未选择要禁用的数据");
|
||||
return;
|
||||
}
|
||||
this.$Modal.confirm({
|
||||
title: "确认禁用",
|
||||
content: "您确认要禁用所选的 " + this.selectCount + " 条数据?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
let ids = "";
|
||||
this.selectList.forEach(function (e) {
|
||||
ids += e.id + ",";
|
||||
});
|
||||
ids = ids.substring(0, ids.length - 1);
|
||||
// 批量删除
|
||||
disableFocus(ids).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("禁用成功");
|
||||
this.clearSelectAll();
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.search {
|
||||
.operation {
|
||||
margin-bottom: 2vh;
|
||||
}
|
||||
.select-count {
|
||||
font-weight: 600;
|
||||
color: #40a9ff;
|
||||
}
|
||||
.select-clear {
|
||||
margin-left: 10px;
|
||||
}
|
||||
.page {
|
||||
margin-top: 2vh;
|
||||
}
|
||||
.drop-down {
|
||||
margin-left: 5px;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -1,509 +0,0 @@
|
|||
<template>
|
||||
<div class="search">
|
||||
<Card>
|
||||
<Row class="operation">
|
||||
<Button @click="add" type="primary" icon="md-add">添加</Button>
|
||||
<Button @click="disableAll" icon="md-trash">批量禁用</Button>
|
||||
<Button @click="getDataList" icon="md-refresh">刷新</Button>
|
||||
<Button type="dashed" @click="openTip = !openTip">{{
|
||||
openTip ? "关闭提示" : "开启提示"
|
||||
}}</Button>
|
||||
</Row>
|
||||
<Row v-show="openTip">
|
||||
<Alert show-icon>
|
||||
已选择 <span class="select-count">{{ selectCount }}</span> 项
|
||||
<a class="select-clear" @click="clearSelectAll">清空</a>
|
||||
</Alert>
|
||||
</Row>
|
||||
<Table
|
||||
:loading="loading"
|
||||
border
|
||||
:columns="columns"
|
||||
:data="data"
|
||||
ref="table"
|
||||
sortable="custom"
|
||||
@on-sort-change="changeSort"
|
||||
@on-selection-change="changeSelect"
|
||||
></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>
|
||||
</Row>
|
||||
</Card>
|
||||
<Modal
|
||||
:title="modalTitle"
|
||||
v-model="modalVisible"
|
||||
:mask-closable="false"
|
||||
:width="500"
|
||||
>
|
||||
<Form ref="form" :model="form" :label-width="100" :rules="formValidate">
|
||||
<FormItem label="名称" prop="name">
|
||||
<Input v-model="form.name" clearable style="width: 100%" />
|
||||
</FormItem>
|
||||
<FormItem label="图片" prop="url">
|
||||
<upload-pic-input
|
||||
v-model="form.url"
|
||||
style="width: 100%"
|
||||
></upload-pic-input>
|
||||
</FormItem>
|
||||
<FormItem label="操作类型" prop="operationType">
|
||||
<Select
|
||||
v-model="form.operationType"
|
||||
placeholder="请选择"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
>
|
||||
<Option value="NONE">无操作</Option>
|
||||
<Option value="URL">链接地址</Option>
|
||||
<Option value="GOODS">商品序号</Option>
|
||||
<Option value="SHOP">店铺编号</Option>
|
||||
<Option value="KEYWORD">关键字</Option>
|
||||
<Option value="CATEGORY">商品分类</Option>
|
||||
</Select>
|
||||
</FormItem>
|
||||
<FormItem label="链接值" prop="sort">
|
||||
<Input v-model="form.operationUrl" clearable style="width: 100%" />
|
||||
</FormItem>
|
||||
<FormItem label="排序" prop="sort">
|
||||
<InputNumber :max="999" :min="0" v-model="form.sort"></InputNumber>
|
||||
</FormItem>
|
||||
</Form>
|
||||
<div slot="footer">
|
||||
<Button type="text" @click="modalVisible = false">取消</Button>
|
||||
<Button type="primary" :loading="submitLoading" @click="handleSubmit"
|
||||
>提交</Button
|
||||
>
|
||||
</div>
|
||||
</Modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getFocusData,
|
||||
saveFocusData,
|
||||
disableFocus,
|
||||
enableFocus,
|
||||
delFocus,
|
||||
} from "@/api/pages";
|
||||
import uploadPicInput from "@/views/my-components/lili/upload-pic-input";
|
||||
|
||||
export default {
|
||||
name: "pcFocus",
|
||||
components: {
|
||||
uploadPicInput,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
openTip: true, // 显示提示
|
||||
loading: true, // 表单加载状态
|
||||
modalType: 0, // 添加或编辑标识
|
||||
modalVisible: false, // 添加或编辑显示
|
||||
modalTitle: "", // 添加或编辑标题
|
||||
searchForm: {
|
||||
// 搜索框初始化对象
|
||||
clientType: "PC", //客户端类型
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
sort: "createTime", // 默认排序字段
|
||||
order: "desc", // 默认排序方式
|
||||
},
|
||||
form: {
|
||||
// 添加或编辑表单对象初始化数据
|
||||
name: "",
|
||||
operationType: "",
|
||||
operationUrl: "",
|
||||
url: "",
|
||||
sort: 0,
|
||||
},
|
||||
// 表单验证规则
|
||||
formValidate: {
|
||||
name: [{ required: true, message: "不能为空", trigger: "blur" }],
|
||||
},
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
selectList: [], // 多选数据
|
||||
selectCount: 0, // 多选计数
|
||||
columns: [
|
||||
// 表头
|
||||
{
|
||||
type: "selection",
|
||||
width: 60,
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "名称",
|
||||
key: "name",
|
||||
minWidth: 120,
|
||||
sortable: false,
|
||||
},
|
||||
{
|
||||
title: "状态",
|
||||
key: "status",
|
||||
minWidth: 100,
|
||||
sortable: false,
|
||||
render: (h, params) => {
|
||||
if (params.row.status == "CLOSE") {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "error",
|
||||
text: "禁用",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
} else if (params.row.status == "OPEN") {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "success",
|
||||
text: "启用",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "图片",
|
||||
key: "url",
|
||||
minWidth: 120,
|
||||
sortable: false,
|
||||
render: (h, params) => {
|
||||
return h("img", {
|
||||
attrs: {
|
||||
src: params.row.url,
|
||||
alt: "加载图片失败",
|
||||
},
|
||||
style: {
|
||||
cursor: "pointer",
|
||||
width: "80px",
|
||||
height: "60px",
|
||||
margin: "10px 0",
|
||||
"object-fit": "contain",
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "排序",
|
||||
key: "sort",
|
||||
minWidth: 120,
|
||||
sortable: false,
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
align: "center",
|
||||
width: 200,
|
||||
render: (h, params) => {
|
||||
let enableOrDisable = "";
|
||||
if (params.row.status == "CLOSE") {
|
||||
enableOrDisable = h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "success",
|
||||
size: "small",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.enable(params.row);
|
||||
},
|
||||
},
|
||||
},
|
||||
"启用"
|
||||
);
|
||||
} else {
|
||||
enableOrDisable = h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
size: "small",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.disable(params.row);
|
||||
},
|
||||
},
|
||||
},
|
||||
"禁用"
|
||||
);
|
||||
}
|
||||
return h("div", [
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "primary",
|
||||
size: "small",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.edit(params.row);
|
||||
},
|
||||
},
|
||||
},
|
||||
"编辑"
|
||||
),
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "error",
|
||||
size: "small",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.remove(params.row);
|
||||
},
|
||||
},
|
||||
},
|
||||
"删除"
|
||||
),
|
||||
enableOrDisable,
|
||||
]);
|
||||
},
|
||||
},
|
||||
],
|
||||
data: [], // 表单数据
|
||||
total: 0, // 表单数据总数
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
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();
|
||||
},
|
||||
handleReset() {
|
||||
this.$refs.searchForm.resetFields();
|
||||
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;
|
||||
// 带多条件搜索参数获取表单数据 请自行修改接口
|
||||
getFocusData(this.searchForm).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.data = res.result.records;
|
||||
this.total = res.result.total;
|
||||
}
|
||||
});
|
||||
// 以下为模拟数据
|
||||
//this.data = [
|
||||
//];
|
||||
this.total = this.data.length;
|
||||
this.loading = false;
|
||||
},
|
||||
enable(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认启用",
|
||||
// 记得确认修改此处
|
||||
content: "您确认要确认启用 " + v.name + " ?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
// 删除
|
||||
enableFocus(v.id).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
disable(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认禁用",
|
||||
// 记得确认修改此处
|
||||
content: "您确认要禁用 " + v.name + " ?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
// 删除
|
||||
disableFocus(v.id).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
handleSubmit() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.form.ClientType = "PC";
|
||||
this.submitLoading = true;
|
||||
if (this.modalType === 0) {
|
||||
this.form.status = "OPEN";
|
||||
// 添加 避免编辑后传入id等数据 记得删除
|
||||
delete this.form.id;
|
||||
saveFocusData(this.form).then((res) => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.getDataList();
|
||||
this.modalVisible = false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// 编辑
|
||||
saveFocusData(this.form).then((res) => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.getDataList();
|
||||
this.modalVisible = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
add() {
|
||||
this.modalType = 0;
|
||||
this.modalTitle = "添加";
|
||||
this.$refs.form.resetFields();
|
||||
delete this.form.id;
|
||||
this.modalVisible = true;
|
||||
},
|
||||
edit(v) {
|
||||
this.modalType = 1;
|
||||
this.modalTitle = "编辑";
|
||||
this.$refs.form.resetFields();
|
||||
// 转换null为""
|
||||
for (let attr in v) {
|
||||
if (v[attr] === null) {
|
||||
v[attr] = "";
|
||||
}
|
||||
}
|
||||
let str = JSON.stringify(v);
|
||||
let data = JSON.parse(str);
|
||||
this.form = data;
|
||||
this.modalVisible = true;
|
||||
},
|
||||
remove(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认删除",
|
||||
// 记得确认修改此处
|
||||
content: "您确认要删除么?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
// 删除
|
||||
delFocus(v.id).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
disableAll() {
|
||||
if (this.selectCount <= 0) {
|
||||
this.$Message.warning("您还未选择要禁用的数据");
|
||||
return;
|
||||
}
|
||||
this.$Modal.confirm({
|
||||
title: "确认禁用",
|
||||
content: "您确认要禁用所选的 " + this.selectCount + " 条数据?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
let ids = "";
|
||||
this.selectList.forEach(function (e) {
|
||||
ids += e.id + ",";
|
||||
});
|
||||
ids = ids.substring(0, ids.length - 1);
|
||||
// 批量删除
|
||||
disableFocus(ids).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("禁用成功");
|
||||
this.clearSelectAll();
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.search {
|
||||
.operation {
|
||||
margin-bottom: 2vh;
|
||||
}
|
||||
.select-count {
|
||||
font-weight: 600;
|
||||
color: #40a9ff;
|
||||
}
|
||||
.select-clear {
|
||||
margin-left: 10px;
|
||||
}
|
||||
.page {
|
||||
margin-top: 2vh;
|
||||
}
|
||||
.drop-down {
|
||||
margin-left: 5px;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -1,474 +0,0 @@
|
|||
<template>
|
||||
<div class="search">
|
||||
<Card>
|
||||
<Row class="operation">
|
||||
<Button @click="add" type="primary" icon="md-add">添加</Button>
|
||||
<Button @click="disableAll" icon="md-trash">批量禁用</Button>
|
||||
<Button @click="getDataList" icon="md-refresh">刷新</Button>
|
||||
<Button type="dashed" @click="openTip = !openTip">{{
|
||||
openTip ? "关闭提示" : "开启提示"
|
||||
}}</Button>
|
||||
</Row>
|
||||
<Row v-show="openTip">
|
||||
<Alert show-icon>
|
||||
已选择 <span class="select-count">{{ selectCount }}</span> 项
|
||||
<a class="select-clear" @click="clearSelectAll">清空</a>
|
||||
</Alert>
|
||||
</Row>
|
||||
<Table
|
||||
:loading="loading"
|
||||
border
|
||||
:columns="columns"
|
||||
:data="data"
|
||||
ref="table"
|
||||
sortable="custom"
|
||||
@on-sort-change="changeSort"
|
||||
@on-selection-change="changeSelect"
|
||||
></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>
|
||||
</Row>
|
||||
</Card>
|
||||
<Modal
|
||||
:title="modalTitle"
|
||||
v-model="modalVisible"
|
||||
:mask-closable="false"
|
||||
:width="500"
|
||||
>
|
||||
<Form ref="form" :model="form" :label-width="100" :rules="formValidate">
|
||||
<FormItem label="导航栏名称" prop="navigationName">
|
||||
<Input v-model="form.navigationName" clearable style="width: 100%" />
|
||||
</FormItem>
|
||||
<FormItem label="导航栏链接" prop="url">
|
||||
<Input v-model="form.url" clearable style="width: 100%" />
|
||||
</FormItem>
|
||||
<FormItem label="品牌图标" prop="image">
|
||||
<upload-pic-input
|
||||
v-model="form.image"
|
||||
style="width: 100%"
|
||||
></upload-pic-input>
|
||||
</FormItem>
|
||||
</Form>
|
||||
<div slot="footer">
|
||||
<Button type="text" @click="modalVisible = false">取消</Button>
|
||||
<Button type="primary" :loading="submitLoading" @click="handleSubmit"
|
||||
>提交</Button
|
||||
>
|
||||
</div>
|
||||
</Modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
save,
|
||||
getNavigationData,
|
||||
disableNavigation,
|
||||
enableNavigation,
|
||||
delNavigation,
|
||||
update,
|
||||
} from "@/api/pages";
|
||||
import uploadPicInput from "@/views/my-components/lili/upload-pic-input";
|
||||
|
||||
export default {
|
||||
name: "mobileNavigation",
|
||||
components: {
|
||||
uploadPicInput,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
openTip: true, // 显示提示
|
||||
loading: true, // 表单加载状态
|
||||
type: "MOBILE", // 手机还是pc
|
||||
modalType: 0, // 添加或编辑标识
|
||||
modalVisible: false, // 添加或编辑显示
|
||||
modalTitle: "", // 添加或编辑标题
|
||||
searchForm: {
|
||||
// 搜索框初始化对象
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
sort: "createTime", // 默认排序字段
|
||||
order: "desc", // 默认排序方式
|
||||
},
|
||||
form: {
|
||||
// 添加或编辑表单对象初始化数据
|
||||
navigationName: "",
|
||||
image: "",
|
||||
url: "",
|
||||
},
|
||||
// 表单验证规则
|
||||
formValidate: {
|
||||
url: [
|
||||
{ required: true, message: "导航栏url不能为空", trigger: "blur" },
|
||||
],
|
||||
navigationName: [
|
||||
{ required: true, message: "导航栏不能为空", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
selectList: [], // 多选数据
|
||||
selectCount: 0, // 多选计数
|
||||
columns: [
|
||||
// 表头
|
||||
{
|
||||
type: "selection",
|
||||
width: 60,
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "导航名称",
|
||||
key: "navigationName",
|
||||
minWidth: 120,
|
||||
sortable: false,
|
||||
},
|
||||
{
|
||||
title: "状态",
|
||||
key: "status",
|
||||
minWidth: 100,
|
||||
sortable: false,
|
||||
render: (h, params) => {
|
||||
if (params.row.status == "CLOSE") {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "error",
|
||||
text: "禁用",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
} else if (params.row.status == "OPEN") {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "success",
|
||||
text: "启用",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "图片",
|
||||
key: "image",
|
||||
minWidth: 120,
|
||||
sortable: false,
|
||||
render: (h, params) => {
|
||||
return h("img", {
|
||||
attrs: {
|
||||
src: params.row.image,
|
||||
alt: "加载图片失败",
|
||||
},
|
||||
style: {
|
||||
cursor: "pointer",
|
||||
width: "80px",
|
||||
height: "60px",
|
||||
margin: "10px 0",
|
||||
"object-fit": "contain",
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "排序",
|
||||
key: "sort",
|
||||
minWidth: 120,
|
||||
sortable: false,
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
align: "center",
|
||||
width: 250,
|
||||
render: (h, params) => {
|
||||
console.warn(params.status);
|
||||
let enableOrDisable = "";
|
||||
if (params.row.status == "CLOSE") {
|
||||
enableOrDisable = h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "success",
|
||||
size: "small",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.enable(params.row);
|
||||
},
|
||||
},
|
||||
},
|
||||
"启用"
|
||||
);
|
||||
} else {
|
||||
enableOrDisable = h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
size: "small",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.disable(params.row);
|
||||
},
|
||||
},
|
||||
},
|
||||
"禁用"
|
||||
);
|
||||
}
|
||||
return h("div", [
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "primary",
|
||||
size: "small",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.edit(params.row);
|
||||
},
|
||||
},
|
||||
},
|
||||
"编辑"
|
||||
),
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "error",
|
||||
size: "small",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.del(params.row);
|
||||
},
|
||||
},
|
||||
},
|
||||
"删除"
|
||||
),
|
||||
enableOrDisable,
|
||||
]);
|
||||
},
|
||||
},
|
||||
],
|
||||
data: [], // 表单数据
|
||||
total: 0, // 表单数据总数
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
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();
|
||||
},
|
||||
handleReset() {
|
||||
this.$refs.searchForm.resetFields();
|
||||
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.searchForm.clientType = this.type;
|
||||
this.loading = true;
|
||||
// 带多条件搜索参数获取表单数据 请自行修改接口
|
||||
getNavigationData(this.searchForm).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.data = res.result.records;
|
||||
this.total = res.result.total;
|
||||
}
|
||||
});
|
||||
this.total = this.data.length;
|
||||
this.loading = false;
|
||||
},
|
||||
handleSubmit() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.submitLoading = true;
|
||||
this.form.clientType = this.type;
|
||||
if (this.modalType === 0) {
|
||||
// 添加 避免编辑后传入id等数据 记得删除
|
||||
delete this.form.id;
|
||||
save(this.form).then((res) => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.getDataList();
|
||||
this.modalVisible = false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// 编辑
|
||||
update(this.form).then((res) => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.getDataList();
|
||||
this.modalVisible = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
add() {
|
||||
this.modalType = 0;
|
||||
this.modalTitle = "添加";
|
||||
this.$refs.form.resetFields();
|
||||
delete this.form.id;
|
||||
this.modalVisible = true;
|
||||
},
|
||||
edit(v) {
|
||||
this.modalType = 1;
|
||||
this.modalTitle = "编辑";
|
||||
this.$refs.form.resetFields();
|
||||
// 转换null为""
|
||||
for (let attr in v) {
|
||||
if (v[attr] === null) {
|
||||
v[attr] = "";
|
||||
}
|
||||
}
|
||||
let str = JSON.stringify(v);
|
||||
let data = JSON.parse(str);
|
||||
this.form = data;
|
||||
this.modalVisible = true;
|
||||
},
|
||||
enable(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认启用",
|
||||
// 记得确认修改此处
|
||||
content: "您确认要确认启用 " + v.navigationName + " ?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
// 删除
|
||||
enableNavigation(v.id).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
disable(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认禁用",
|
||||
// 记得确认修改此处
|
||||
content: "您确认要禁用 " + v.navigationName + " ?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
// 删除
|
||||
disableNavigation(v.id).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
disableAll() {
|
||||
if (this.selectCount <= 0) {
|
||||
this.$Message.warning("您还未选择要禁用的数据");
|
||||
return;
|
||||
}
|
||||
this.$Modal.confirm({
|
||||
title: "确认禁用",
|
||||
content: "您确认要禁用所选的 " + this.selectCount + " 条数据?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
let ids = "";
|
||||
this.selectList.forEach(function (e) {
|
||||
ids += e.id + ",";
|
||||
});
|
||||
ids = ids.substring(0, ids.length - 1);
|
||||
// 批量禁用
|
||||
disableNavigation(ids).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.clearSelectAll();
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
del(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认删除",
|
||||
// 记得确认修改此处
|
||||
content: "您确认要永久性删除 " + v.navigationName + " ?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
// 删除
|
||||
delNavigation(v.id).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
};
|
||||
</script>
|
|
@ -1,439 +0,0 @@
|
|||
<template>
|
||||
<div class="search">
|
||||
<Card>
|
||||
<Row class="operation">
|
||||
<Button @click="add" type="primary" icon="md-add">添加</Button>
|
||||
<Button @click="disableAll" icon="md-trash">批量禁用</Button>
|
||||
<Button @click="getDataList" icon="md-refresh">刷新</Button>
|
||||
<Button type="dashed" @click="openTip=!openTip">{{openTip ? "关闭提示" : "开启提示"}}</Button>
|
||||
</Row>
|
||||
<Row v-show="openTip">
|
||||
<Alert show-icon>
|
||||
已选择 <span class="select-count">{{selectCount}}</span> 项
|
||||
<a class="select-clear" @click="clearSelectAll">清空</a>
|
||||
</Alert>
|
||||
</Row>
|
||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom"
|
||||
@on-sort-change="changeSort" @on-selection-change="changeSelect"></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>
|
||||
</Row>
|
||||
</Card>
|
||||
<Modal :title="modalTitle" v-model="modalVisible" :mask-closable='false' :width="500">
|
||||
<Form ref="form" :model="form" :label-width="100" :rules="formValidate">
|
||||
<FormItem label="导航栏名称" prop="navigationName">
|
||||
<Input v-model="form.navigationName" clearable style="width:100%"/>
|
||||
</FormItem>
|
||||
<FormItem label="导航栏链接" prop="url">
|
||||
<Input v-model="form.url" clearable style="width:100%"/>
|
||||
</FormItem>
|
||||
<FormItem label="品牌图标" prop="image">
|
||||
<upload-pic-input v-model="form.image" style="width:100%"></upload-pic-input>
|
||||
</FormItem>
|
||||
</Form>
|
||||
<div slot="footer">
|
||||
<Button type="text" @click="modalVisible=false">取消</Button>
|
||||
<Button type="primary" :loading="submitLoading" @click="handleSubmit">提交</Button>
|
||||
</div>
|
||||
</Modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
save,
|
||||
getNavigationData,
|
||||
disableNavigation,
|
||||
enableNavigation,
|
||||
delNavigation,
|
||||
update
|
||||
} from "@/api/pages";
|
||||
import uploadPicInput from "@/views/my-components/lili/upload-pic-input";
|
||||
|
||||
export default {
|
||||
name: "pcNavigation",
|
||||
components: {
|
||||
uploadPicInput
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
openTip: true, // 显示提示
|
||||
loading: true, // 表单加载状态
|
||||
type: "PC", // 手机还是pc
|
||||
modalType: 0, // 添加或编辑标识
|
||||
modalVisible: false, // 添加或编辑显示
|
||||
modalTitle: "", // 添加或编辑标题
|
||||
searchForm: { // 搜索框初始化对象
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
sort: "createTime", // 默认排序字段
|
||||
order: "desc", // 默认排序方式
|
||||
},
|
||||
form: { // 添加或编辑表单对象初始化数据
|
||||
navigationName: "",
|
||||
image: "",
|
||||
url: "",
|
||||
},
|
||||
// 表单验证规则
|
||||
formValidate: {
|
||||
url: [{required: true, message: "导航栏url不能为空", trigger: "blur"}],
|
||||
navigationName: [{required: true, message: "导航栏不能为空", trigger: "blur"}],
|
||||
},
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
selectList: [], // 多选数据
|
||||
selectCount: 0, // 多选计数
|
||||
columns: [
|
||||
// 表头
|
||||
{
|
||||
type: "selection",
|
||||
width: 60,
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "导航名称",
|
||||
key: "navigationName",
|
||||
minWidth: 120,
|
||||
sortable: false,
|
||||
},
|
||||
{
|
||||
title: "状态",
|
||||
key: "status",
|
||||
minWidth: 100,
|
||||
sortable: false,
|
||||
render: (h, params) => {
|
||||
if (params.row.status == 'CLOSE') {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "error",
|
||||
text: "禁用"
|
||||
}
|
||||
})
|
||||
]);
|
||||
} else if (params.row.status == 'OPEN') {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "success",
|
||||
text: "启用"
|
||||
}
|
||||
})
|
||||
]);
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "图片",
|
||||
key: "image",
|
||||
minWidth: 120,
|
||||
sortable: false,
|
||||
render: (h, params) => {
|
||||
return h("img", {
|
||||
attrs: {
|
||||
src: params.row.image,
|
||||
alt: "加载图片失败"
|
||||
},
|
||||
style: {
|
||||
cursor: "pointer",
|
||||
width: "80px",
|
||||
height: "60px",
|
||||
margin: "10px 0",
|
||||
"object-fit": "contain"
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "排序",
|
||||
key: "sort",
|
||||
minWidth: 120,
|
||||
sortable: false,
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
align: "center",
|
||||
width: 250,
|
||||
render: (h, params) => {
|
||||
console.warn(params.status)
|
||||
let enableOrDisable = "";
|
||||
if (params.row.status == "CLOSE") {
|
||||
enableOrDisable = h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "success",
|
||||
size: "small"
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px"
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.enable(params.row);
|
||||
}
|
||||
}
|
||||
},
|
||||
"启用"
|
||||
);
|
||||
} else {
|
||||
enableOrDisable = h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
size: "small"
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px"
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.disable(params.row);
|
||||
}
|
||||
}
|
||||
},
|
||||
"禁用"
|
||||
);
|
||||
}
|
||||
return h("div", [
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "primary",
|
||||
size: "small"
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px"
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.edit(params.row);
|
||||
}
|
||||
}
|
||||
},
|
||||
"编辑"
|
||||
),
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "error",
|
||||
size: "small",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px"
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.del(params.row);
|
||||
}
|
||||
}
|
||||
},
|
||||
"删除"
|
||||
),
|
||||
enableOrDisable,
|
||||
]);
|
||||
}
|
||||
}
|
||||
],
|
||||
data: [], // 表单数据
|
||||
total: 0 // 表单数据总数
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
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();
|
||||
},
|
||||
handleReset() {
|
||||
this.$refs.searchForm.resetFields();
|
||||
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.searchForm.clientType = this.type
|
||||
this.loading = true;
|
||||
// 带多条件搜索参数获取表单数据 请自行修改接口
|
||||
getNavigationData(this.searchForm).then(res => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.data = res.result.records;
|
||||
this.total = res.result.total;
|
||||
}
|
||||
});
|
||||
this.total = this.data.length;
|
||||
this.loading = false;
|
||||
},
|
||||
handleSubmit() {
|
||||
this.$refs.form.validate(valid => {
|
||||
if (valid) {
|
||||
this.submitLoading = true;
|
||||
this.form.clientType = this.type
|
||||
if (this.modalType === 0) {
|
||||
// 添加 避免编辑后传入id等数据 记得删除
|
||||
delete this.form.id;
|
||||
save(this.form).then(res => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.getDataList();
|
||||
this.modalVisible = false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// 编辑
|
||||
update(this.form).then(res => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.getDataList();
|
||||
this.modalVisible = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
add() {
|
||||
this.modalType = 0;
|
||||
this.modalTitle = "添加";
|
||||
this.$refs.form.resetFields();
|
||||
delete this.form.id;
|
||||
this.modalVisible = true;
|
||||
},
|
||||
edit(v) {
|
||||
this.modalType = 1;
|
||||
this.modalTitle = "编辑";
|
||||
this.$refs.form.resetFields();
|
||||
// 转换null为""
|
||||
for (let attr in v) {
|
||||
if (v[attr] === null) {
|
||||
v[attr] = "";
|
||||
}
|
||||
}
|
||||
let str = JSON.stringify(v);
|
||||
let data = JSON.parse(str);
|
||||
this.form = data;
|
||||
this.modalVisible = true;
|
||||
},
|
||||
enable(v){
|
||||
this.$Modal.confirm({
|
||||
title: "确认启用",
|
||||
// 记得确认修改此处
|
||||
content: "您确认要确认启用 " + v.navigationName + " ?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
// 删除
|
||||
enableNavigation(v.id).then(res => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
disable(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认禁用",
|
||||
// 记得确认修改此处
|
||||
content: "您确认要禁用 " + v.navigationName + " ?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
// 删除
|
||||
disableNavigation(v.id).then(res => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
disableAll() {
|
||||
if (this.selectCount <= 0) {
|
||||
this.$Message.warning("您还未选择要禁用的数据");
|
||||
return;
|
||||
}
|
||||
this.$Modal.confirm({
|
||||
title: "确认禁用",
|
||||
content: "您确认要禁用所选的 " + this.selectCount + " 条数据?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
let ids = "";
|
||||
this.selectList.forEach(function (e) {
|
||||
ids += e.id + ",";
|
||||
});
|
||||
ids = ids.substring(0, ids.length - 1);
|
||||
// 批量禁用
|
||||
disableNavigation(ids).then(res => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.clearSelectAll();
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
del(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认删除",
|
||||
// 记得确认修改此处
|
||||
content: "您确认要永久性删除 " + v.navigationName + " ?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
// 删除
|
||||
delNavigation(v.id).then(res => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.init();
|
||||
}
|
||||
};
|
||||
</script>
|
|
@ -1,65 +0,0 @@
|
|||
.own-space {
|
||||
.own-space-new {
|
||||
.ivu-card-body {
|
||||
padding: 16px 16px 16px 0px;
|
||||
}
|
||||
}
|
||||
|
||||
.own-wrap {
|
||||
display: flex;
|
||||
|
||||
.title {
|
||||
font-size: 20px;
|
||||
color: rgba(0, 0, 0, .85);
|
||||
line-height: 28px;
|
||||
font-weight: 500;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.safe {
|
||||
width: 100%;
|
||||
|
||||
.item {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding-top: 14px;
|
||||
padding-bottom: 14px;
|
||||
border-bottom: 1px solid #e8e8e8;
|
||||
|
||||
.title {
|
||||
color: rgba(0, 0, 0, .65);
|
||||
margin-bottom: 4px;
|
||||
font-size: 14px;
|
||||
line-height: 22px;
|
||||
}
|
||||
|
||||
.desc {
|
||||
color: rgba(0, 0, 0, .45);
|
||||
font-size: 14px;
|
||||
line-height: 22px;
|
||||
|
||||
.red {
|
||||
color: #ed3f14;
|
||||
}
|
||||
|
||||
.middle {
|
||||
color: #faad14;
|
||||
}
|
||||
|
||||
.green {
|
||||
color: #52c41a;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/deep/ .upload-list {
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
|
@ -1,7 +1,3 @@
|
|||
<style lang="scss" scoped>
|
||||
@import "./personal-center.scss";
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<div class="own-space">
|
||||
<Card class="own-space-new">
|
||||
|
@ -85,6 +81,7 @@ export default {
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
// 初始化数据
|
||||
init() {
|
||||
let v = JSON.parse(Cookies.get("userInfo"));
|
||||
// 转换null为""
|
||||
|
@ -97,15 +94,18 @@ export default {
|
|||
this.userForm = userInfo;
|
||||
console.log(userInfo)
|
||||
},
|
||||
// 跳转修改密码页面
|
||||
changePassword() {
|
||||
util.openNewPage(this, "change-password");
|
||||
this.$router.push({
|
||||
name: "change_password"
|
||||
});
|
||||
},
|
||||
// 左侧菜单点击
|
||||
changeMenu(v) {
|
||||
this.currMenu = v;
|
||||
},
|
||||
// 保存
|
||||
saveEdit() {
|
||||
this.saveLoading = true;
|
||||
let params = this.userForm;
|
||||
|
@ -117,7 +117,6 @@ export default {
|
|||
Cookies.set("userInfo", this.userForm);
|
||||
// 更新头像
|
||||
this.$store.commit("setAvatarPath", this.userForm.avatar);
|
||||
|
||||
setTimeout(()=>{
|
||||
this.$router.go(0)
|
||||
},500)
|
||||
|
@ -125,31 +124,77 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
updateUserInfo() {
|
||||
// 更新用户信息
|
||||
userInfo().then(res => {
|
||||
if (res.success) {
|
||||
// 避免超过大小限制
|
||||
delete res.result.permissions;
|
||||
if (this.getStore("saveLogin")) {
|
||||
// 保存7天
|
||||
Cookies.set("userInfo", JSON.stringify(res.result), {
|
||||
expires: 7
|
||||
});
|
||||
} else {
|
||||
Cookies.set("userInfo", JSON.stringify(res.result));
|
||||
}
|
||||
this.setStore("userInfo", res.result);
|
||||
}
|
||||
});
|
||||
},
|
||||
changeMessage(v) {
|
||||
this.setStore("messageOpen", v);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
let type = this.$route.query.type;
|
||||
this.init();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.own-space {
|
||||
.own-space-new {
|
||||
.ivu-card-body {
|
||||
padding: 16px 16px 16px 0px;
|
||||
}
|
||||
}
|
||||
|
||||
.own-wrap {
|
||||
display: flex;
|
||||
|
||||
.title {
|
||||
font-size: 20px;
|
||||
color: rgba(0, 0, 0, .85);
|
||||
line-height: 28px;
|
||||
font-weight: 500;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.safe {
|
||||
width: 100%;
|
||||
|
||||
.item {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding-top: 14px;
|
||||
padding-bottom: 14px;
|
||||
border-bottom: 1px solid #e8e8e8;
|
||||
|
||||
.title {
|
||||
color: rgba(0, 0, 0, .65);
|
||||
margin-bottom: 4px;
|
||||
font-size: 14px;
|
||||
line-height: 22px;
|
||||
}
|
||||
|
||||
.desc {
|
||||
color: rgba(0, 0, 0, .45);
|
||||
font-size: 14px;
|
||||
line-height: 22px;
|
||||
|
||||
.red {
|
||||
color: #ed3f14;
|
||||
}
|
||||
|
||||
.middle {
|
||||
color: #faad14;
|
||||
}
|
||||
|
||||
.green {
|
||||
color: #52c41a;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/deep/ .upload-list {
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
|
@ -22,7 +22,7 @@
|
|||
<Button @click="add" type="primary">添加优惠券</Button>
|
||||
<Button @click="delAll">批量下架</Button>
|
||||
</Row>
|
||||
<Table v-if="refreshTable" :loading="loading" border :columns="columns" :data="data" ref="table" @on-selection-change="changeSelect">
|
||||
<Table v-if="refreshTable" :loading="loading" border :columns="columns" :data="data" ref="table" class="mt_10" @on-selection-change="changeSelect">
|
||||
<template slot-scope="{ row }" slot="action">
|
||||
<Button v-if="row.promotionStatus === 'NEW' || row.promotionStatus === 'CLOSE'" type="success" :class="{'mr_10' : row.promotionStatus === 'START' || row.promotionStatus === 'NEW'}" size="small" @click="edit(row)">编辑
|
||||
</Button>
|
||||
|
@ -37,7 +37,6 @@
|
|||
</Card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getPlatformCouponList,
|
||||
|
@ -46,14 +45,9 @@ import {
|
|||
|
||||
export default {
|
||||
name: "coupon",
|
||||
components: {},
|
||||
|
||||
data() {
|
||||
return {
|
||||
loading: true, // 表单加载状态
|
||||
modalType: 0, // 添加或编辑标识
|
||||
modalVisible: false, // 添加或编辑显示
|
||||
modalTitle: "", // 添加或编辑标题
|
||||
searchForm: {
|
||||
// 搜索框初始化对象
|
||||
pageNumber: 1, // 当前页数
|
||||
|
@ -62,17 +56,6 @@ export default {
|
|||
order: "desc", // 默认排序方式
|
||||
getType: "", // 默认排序方式
|
||||
},
|
||||
form: {
|
||||
// 添加或编辑表单对象初始化数据
|
||||
promotionName: "",
|
||||
},
|
||||
// 表单验证规则
|
||||
formValidate: {
|
||||
promotionName: [
|
||||
{ required: true, message: "不能为空", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
selectList: [], // 多选数据
|
||||
selectCount: 0, // 多选计数
|
||||
columns: [
|
||||
|
@ -271,6 +254,7 @@ export default {
|
|||
check() { // 选中的优惠券
|
||||
this.$emit("selected", this.selectList);
|
||||
},
|
||||
// 初始化数据
|
||||
init() {
|
||||
this.getDataList();
|
||||
},
|
||||
|
@ -285,11 +269,12 @@ export default {
|
|||
this.getDataList();
|
||||
},
|
||||
changePageSize(v) { // 改变页数
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = v;
|
||||
this.getDataList();
|
||||
},
|
||||
handleSearch() { // 搜索
|
||||
this.searchForm.pageNumber = 0;
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.getDataList();
|
||||
},
|
||||
|
@ -313,7 +298,6 @@ export default {
|
|||
this.searchForm.startTime = null;
|
||||
this.searchForm.endTime = null;
|
||||
}
|
||||
// 带多条件搜索参数获取表单数据 请自行修改接口
|
||||
getPlatformCouponList(this.searchForm).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
|
|
|
@ -1,240 +0,0 @@
|
|||
<template>
|
||||
<div>
|
||||
<div class="content-goods-publish">
|
||||
<Form ref="form" :model="form" :label-width="130">
|
||||
<div class="base-info-item">
|
||||
<h4>平台券活动详情</h4>
|
||||
<div class="form-item-view">
|
||||
<FormItem label="活动名称">
|
||||
<span class="goods-category-name">{{ form.promotionName }}</span>
|
||||
</FormItem>
|
||||
<FormItem label="活动类型">
|
||||
<span class="goods-category-name">{{
|
||||
getCouponType(form.couponType)
|
||||
}}</span>
|
||||
</FormItem>
|
||||
<FormItem label="面额">
|
||||
<span class="goods-category-name"> ¥{{ form.price | unitPrice }}</span>
|
||||
</FormItem>
|
||||
<FormItem label="活动说明">
|
||||
<span class="goods-category-name">{{ form.description }}</span>
|
||||
</FormItem>
|
||||
<FormItem label="发放总数">
|
||||
<span class="goods-category-name">{{ form.publishNum }}</span>
|
||||
</FormItem>
|
||||
<FormItem label="领取限制">
|
||||
<span class="goods-category-name">{{ form.limitNum }}</span>
|
||||
</FormItem>
|
||||
<FormItem label="活动开始时间">
|
||||
<span class="goods-category-name">{{ form.startTime }}</span>
|
||||
</FormItem>
|
||||
<FormItem label="消费限额">
|
||||
<span class="goods-category-name">{{
|
||||
form.consumptionLimit
|
||||
}}</span>
|
||||
</FormItem>
|
||||
<FormItem label="使用有效期">
|
||||
<span class="goods-category-name">{{ form.startTime }} 至 {{ form.endTime }}</span>
|
||||
</FormItem>
|
||||
<FormItem label="适用品类范围">
|
||||
<span class="goods-category-name">{{
|
||||
getScopeType(form.scopeType)
|
||||
}}</span>
|
||||
</FormItem>
|
||||
<FormItem label="品类范围描述">
|
||||
<span class="goods-category-name">{{ form.couponName }}</span>
|
||||
</FormItem>
|
||||
<FormItem label="状态">
|
||||
<span class="goods-category-name">{{
|
||||
getStatus(form.status)
|
||||
}}</span>
|
||||
</FormItem>
|
||||
<FormItem label="优惠券类型">
|
||||
<span class="goods-category-name">{{
|
||||
getType(form.getType)
|
||||
}}</span>
|
||||
</FormItem>
|
||||
<FormItem label="活动创建时间">
|
||||
<span class="goods-category-name">{{ form.createTime }}</span>
|
||||
</FormItem>
|
||||
<FormItem label="活动最后更新时间">
|
||||
<span class="goods-category-name">{{ form.updateTime }}</span>
|
||||
</FormItem>
|
||||
<FormItem label="更新管理员名称">
|
||||
<span class="goods-category-name">{{ form.updateBy }}</span>
|
||||
</FormItem>
|
||||
<FormItem label="已发放数量">
|
||||
<span class="goods-category-name">{{ form.receivedNum }}</span>
|
||||
</FormItem>
|
||||
<FormItem label="已使用数量">
|
||||
<span class="goods-category-name">{{ form.usedNum }}</span>
|
||||
</FormItem>
|
||||
</div>
|
||||
<h4>适用品类范围</h4>
|
||||
<div>
|
||||
<Table :loading="loading" border :columns="columns1" :data="data1" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect"></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>
|
||||
</Row>
|
||||
</div>
|
||||
</div>
|
||||
</Form>
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
<Button type="primary" @click="back">返回活动列表</Button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getPlatformCoupon } from "@/api/promotion";
|
||||
|
||||
import uploadPicThumb from "@/views/my-components/lili/upload-pic-thumb";
|
||||
import editor from "@/views/my-components/lili/editor";
|
||||
|
||||
export default {
|
||||
name: "addCoupon",
|
||||
components: {
|
||||
uploadPicThumb,
|
||||
editor,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
modalType: 0, // 当前类型
|
||||
loading: false, // 表单加载状态
|
||||
searchForm: {
|
||||
// 搜索框初始化对象
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
sort: "createTime", // 默认排序字段
|
||||
order: "desc", // 默认排序方式
|
||||
},
|
||||
form: {
|
||||
/** 店铺承担比例 */
|
||||
sellerCommission: 0,
|
||||
/** 发行数量 */
|
||||
publishNum: 1,
|
||||
/** 运费承担者 */
|
||||
scopeType: "ALL",
|
||||
/** 消费限额 */
|
||||
consumptionLimit: "",
|
||||
/** 限领数量 */
|
||||
limitNum: 1,
|
||||
/** 活动类型 */
|
||||
couponType: "",
|
||||
/** 优惠券名称 */
|
||||
couponName: "",
|
||||
/** 已被使用数量 */
|
||||
usedNum: 0,
|
||||
/** 已被领取的数量 */
|
||||
receivedNum: 0,
|
||||
},
|
||||
id: this.$route.query.id,
|
||||
columns1: [
|
||||
{
|
||||
title: "一级类目",
|
||||
key: "name",
|
||||
},
|
||||
{
|
||||
title: "二级类目",
|
||||
key: "age",
|
||||
},
|
||||
{
|
||||
title: "三级类目",
|
||||
key: "address",
|
||||
},
|
||||
],
|
||||
data1: [
|
||||
{
|
||||
name: "王小明",
|
||||
age: 18,
|
||||
address: "北京市朝阳区芍药居",
|
||||
},
|
||||
{
|
||||
name: "张小刚",
|
||||
age: 25,
|
||||
address: "北京市海淀区西二旗",
|
||||
},
|
||||
{
|
||||
name: "李小红",
|
||||
age: 30,
|
||||
address: "上海市浦东新区世纪大道",
|
||||
},
|
||||
{
|
||||
name: "周小伟",
|
||||
age: 26,
|
||||
address: "深圳市南山区深南大道",
|
||||
},
|
||||
],
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
// 如果id不为空则查询信息
|
||||
if (this.id) {
|
||||
this.getCoupon();
|
||||
this.modalType = 1;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getCouponType(value) {
|
||||
switch (value) {
|
||||
case "POINT":
|
||||
return "打折";
|
||||
case "PRICE":
|
||||
return "减免现金";
|
||||
}
|
||||
},
|
||||
/** 获取状态 */
|
||||
getStatus(value) {
|
||||
switch (value) {
|
||||
case "NEW":
|
||||
return "新建";
|
||||
case "START":
|
||||
return "开始";
|
||||
case "LOWER":
|
||||
return "结束";
|
||||
case "CANCEL":
|
||||
return "作废";
|
||||
}
|
||||
},
|
||||
/** 关联范围类型 */
|
||||
getScopeType(value) {
|
||||
switch (value) {
|
||||
case "PORTION_CATEGORY":
|
||||
return "部分商品分类";
|
||||
case "PORTION_GOODS":
|
||||
return "指定商品";
|
||||
case "ALL":
|
||||
return "全品类";
|
||||
}
|
||||
},
|
||||
/** 优惠券类型 */
|
||||
getType(value) {
|
||||
switch (value) {
|
||||
case "FREE":
|
||||
return "免费获取";
|
||||
case "ACTIVITY":
|
||||
return "活动获取";
|
||||
}
|
||||
},
|
||||
|
||||
getCoupon() {
|
||||
getPlatformCoupon(this.id).then((res) => {
|
||||
this.form = res.result;
|
||||
});
|
||||
},
|
||||
back() {
|
||||
this.$store.commit("removeTag", "platform-coupon-info");
|
||||
this.$router.go(-1);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "couponPublish.scss";
|
||||
</style>
|
||||
|
|
@ -1,257 +0,0 @@
|
|||
/*选择商品品类*/
|
||||
.content-goods-publish {
|
||||
padding: 15px;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
border: 1px solid #ddd;
|
||||
background: none repeat 0 0 #fff;
|
||||
height: 100%;
|
||||
margin-bottom: 20px;
|
||||
|
||||
/*商品品类*/
|
||||
.goods-category {
|
||||
text-align: left;
|
||||
padding: 10px;
|
||||
background: #fafafa;
|
||||
border: 1px solid #e6e6e6;
|
||||
|
||||
ul {
|
||||
padding: 8px 4px 8px 8px;
|
||||
list-style: none;
|
||||
width: 300px;
|
||||
background: none repeat 0 0 #fff;
|
||||
border: 1px solid #e6e6e6;
|
||||
display: inline-block;
|
||||
letter-spacing: normal;
|
||||
margin-right: 15px;
|
||||
vertical-align: top;
|
||||
word-spacing: normal;
|
||||
|
||||
li {
|
||||
line-height: 20px;
|
||||
padding: 5px;
|
||||
cursor: pointer;
|
||||
color: #333;
|
||||
font-size: 12px;
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** 当前品类被选中的样式 */
|
||||
.activeClass {
|
||||
background-color: #d9edf7;
|
||||
border: 1px solid #bce8f1;
|
||||
color: #3a87ad;
|
||||
}
|
||||
|
||||
/*!*当前选择的商品品类文字*!*/
|
||||
.current-goods-category {
|
||||
text-align: left;
|
||||
padding: 10px;
|
||||
width: 100%;
|
||||
border: 1px solid #fbeed5;
|
||||
color: #c09853;
|
||||
background-color: #fcf8e3;
|
||||
margin: 10px auto;
|
||||
padding: 8px 35px 8px 14px;
|
||||
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
/*编辑基本信息*/
|
||||
.el-form {
|
||||
padding-bottom: 80px;
|
||||
|
||||
.el-form-item {
|
||||
width: 100%;
|
||||
color: gray;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
|
||||
div.base-info-item {
|
||||
|
||||
h4 {
|
||||
margin-bottom: 10px;
|
||||
padding: 0 10px;
|
||||
border: 1px solid #ddd;
|
||||
background-color: #f8f8f8;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
font-size: 14px;
|
||||
line-height: 40px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.form-item-view {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
padding-left: 80px;
|
||||
|
||||
.shop-category-text {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.item-goods-properts-row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
word-break: break-all;
|
||||
white-space: normal;
|
||||
width: 300px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
.item-goods-properts {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.form-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
|
||||
/** 审核信息-拒绝原因 */
|
||||
.auth-info {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
width: 30%;
|
||||
min-width: 300px;
|
||||
}
|
||||
|
||||
.goods-name-width {
|
||||
width: 50%;
|
||||
min-width: 300px;
|
||||
}
|
||||
|
||||
.el-form-item__content {
|
||||
margin-left: 120px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
p.goods-group-manager {
|
||||
padding-left: 7.5%;
|
||||
text-align: left;
|
||||
color: #999;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
/*teatarea*/
|
||||
/deep/ .el-textarea {
|
||||
width: 150%;
|
||||
}
|
||||
|
||||
.seo-text {
|
||||
width: 150%;
|
||||
}
|
||||
}
|
||||
|
||||
/*折叠面板*/
|
||||
.el-collapse-item {
|
||||
/deep/ .el-collapse-item__header {
|
||||
text-align: left;
|
||||
background-color: #f8f8f8;
|
||||
padding: 0 10px;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
margin-left: 5%;
|
||||
width: 25%;
|
||||
}
|
||||
|
||||
/deep/ .el-form-item__content {
|
||||
margin-left: 120px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
p.goods-group-manager {
|
||||
padding-left: 12%;
|
||||
text-align: left;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
/deep/ .el-collapse-item__content {
|
||||
padding: 10px 0;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
|
||||
/*商品描述*/
|
||||
.goods-intro {
|
||||
line-height: 40;
|
||||
}
|
||||
|
||||
/** 底部步骤 */
|
||||
.footer {
|
||||
width: 88.7%;
|
||||
padding: 10px;
|
||||
background-color: #ffc;
|
||||
position: fixed;
|
||||
bottom: 0px;
|
||||
left: 10%;
|
||||
text-align: center;
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
/*图片上传组件第一张图设置封面*/
|
||||
.goods-images {
|
||||
/deep/ li.el-upload-list__item:first-child {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/deep/ li.el-upload-list__item:first-child:after {
|
||||
content: "封";
|
||||
color: #fff;
|
||||
font-weight: bold;
|
||||
font-size: 12px;
|
||||
position: absolute;
|
||||
left: -15px;
|
||||
top: -6px;
|
||||
width: 40px;
|
||||
height: 24px;
|
||||
padding-top: 6px;
|
||||
background: #13ce66;
|
||||
text-align: center;
|
||||
-webkit-transform: rotate(-45deg);
|
||||
transform: rotate(-45deg);
|
||||
-webkit-box-shadow: 0 0 1pc 1px rgba(0, 0, 0, 0.2);
|
||||
box-shadow: 0 0 1pc 1px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
}
|
||||
|
||||
.el-form-item__label {
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.step-view {
|
||||
width: 33%;
|
||||
height: 40px;
|
||||
font-size: 19px;
|
||||
text-align: center;
|
||||
display: flex;
|
||||
background-color: #fff;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.page {
|
||||
margin-top: 2vh;
|
||||
margin-bottom: 5vh;
|
||||
}
|
|
@ -198,12 +198,6 @@ export default {
|
|||
submitLoading: false, // 添加或编辑提交状态
|
||||
selectedGoods: [], // 已选商品列表,便于删除
|
||||
goodsCategoryList: [], // 商品分类列表
|
||||
shopCategoryList: [], // 店铺分类列表
|
||||
cascaderProps: {
|
||||
multiple: true,
|
||||
label: "name",
|
||||
value: "id",
|
||||
}, // 级联选择器配置项
|
||||
formRule: {
|
||||
promotionName: [{required: true, message: "活动名称不能为空"}],
|
||||
couponName: [{required: true, message: "优惠券名称不能为空"}],
|
||||
|
@ -306,6 +300,7 @@ export default {
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
// 获取优惠券数据
|
||||
getCoupon() {
|
||||
getPlatformCoupon(this.id).then((res) => {
|
||||
let data = res.result;
|
||||
|
@ -495,17 +490,11 @@ export default {
|
|||
});
|
||||
this.form.promotionGoodsList = list;
|
||||
},
|
||||
getGoodsCategory(e) {
|
||||
// 获取级联选择器商品分类id
|
||||
// console.log(e);
|
||||
},
|
||||
|
||||
async getCagetoryList() {
|
||||
// 获取全部商品分类
|
||||
let data = await getCategoryTree();
|
||||
this.goodsCategoryList = data.result;
|
||||
// 过滤出可显示的值
|
||||
|
||||
this.goodsCategoryList = this.goodsCategoryList.map((item) => {
|
||||
if (item.children) {
|
||||
item.children = item.children.map((child) => {
|
||||
|
@ -531,7 +520,6 @@ export default {
|
|||
}
|
||||
return {value: item.id, label: item.name, children: item.children};
|
||||
});
|
||||
console.log(this.goodsCategoryList);
|
||||
},
|
||||
filterCategoryId(list, idArr) {
|
||||
// 递归获取分类id
|
||||
|
|
|
@ -5,19 +5,17 @@
|
|||
<Button @click="add" type="primary">添加活动</Button>
|
||||
</Row>
|
||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom">
|
||||
|
||||
<template slot-scope="{ row,index }" slot="action">
|
||||
<Button type="info"
|
||||
size="small" style="margin-right: 10px" @click="info(row)">查看
|
||||
<template slot-scope="{ row }" slot="action">
|
||||
<Button type="info" size="small" style="margin-right: 10px" @click="info(row)">
|
||||
查看
|
||||
</Button>
|
||||
<Button v-if="!checked && row.promotionStatus === 'START' || row.promotionStatus === 'NEW'" type="error"
|
||||
size="small" style="margin-right: 10px" @click="remove(row)">停止
|
||||
</Button>
|
||||
</template>
|
||||
|
||||
</Table>
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
<Page :current="searchForm.pageNumber + 1" :total="total" :page-size="searchForm.pageSize"
|
||||
<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>
|
||||
</Row>
|
||||
|
@ -42,7 +40,7 @@ export default {
|
|||
modalTitle: "", // 添加或编辑标题
|
||||
searchForm: {
|
||||
// 搜索框初始化对象
|
||||
pageNumber: 0, // 当前页数
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
sort: "createTime", // 默认排序字段
|
||||
order: "desc", // 默认排序方式
|
||||
|
@ -170,19 +168,20 @@ export default {
|
|||
info(v) {
|
||||
this.$router.push({name: "coupon-activity-info", query: {id: v.id}});
|
||||
},
|
||||
//跳转页面
|
||||
// 分页 修改页码
|
||||
changePage(v) {
|
||||
this.searchForm.pageNumber = v - 1;
|
||||
this.searchForm.pageNumber = v;
|
||||
this.getDataList();
|
||||
},
|
||||
//修改分页
|
||||
// 分页 修改页数
|
||||
changePageSize(v) {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = v;
|
||||
this.getDataList();
|
||||
},
|
||||
//搜索活动
|
||||
handleSearch() {
|
||||
this.searchForm.pageNumber = 0;
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.getDataList();
|
||||
},
|
||||
|
@ -196,7 +195,6 @@ export default {
|
|||
this.searchForm.startTime = null;
|
||||
this.searchForm.endTime = null;
|
||||
}
|
||||
// 带多条件搜索参数获取表单数据 请自行修改接口
|
||||
getCouponActivityList(this.searchForm).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
|
@ -210,23 +208,21 @@ export default {
|
|||
edit(v) {
|
||||
this.$router.push({name: "edit-platform-coupon", query: {id: v.id}});
|
||||
},
|
||||
//下架活动
|
||||
//停止活动
|
||||
remove(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认下架",
|
||||
title: "确认停止",
|
||||
// 记得确认修改此处
|
||||
content: "确认要下架此优惠券活动么?下架活动只能重新创建",
|
||||
content: "确认要停止此优惠券活动么?停止活动只能重新创建",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
// 删除
|
||||
closeActivity(v.id).then((res) => {
|
||||
if (res.success) {
|
||||
this.$Message.success("优惠券活动已作废");
|
||||
this.$Message.success("优惠券活动已停止");
|
||||
this.getDataList();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$Modal;
|
||||
});
|
||||
}).catch(() => {});
|
||||
},
|
||||
});
|
||||
},
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<div>
|
||||
<div class="content-goods-publish">
|
||||
<Form ref="form" :model="form" :label-width="130">
|
||||
<Form ref="form" :model="form" :label-width="70">
|
||||
<div class="base-info-item">
|
||||
<h4>优惠券活动详情</h4>
|
||||
<div class="form-item-view">
|
||||
|
@ -30,10 +30,10 @@
|
|||
<h4>优惠券列表</h4>
|
||||
<Table :columns="couponColumn" :data="couponData" ref="table">
|
||||
</Table>
|
||||
<h4 v-if="couponActivity.activityScopeInfo && memberData.length>0">会员列表列表</h4>
|
||||
<Table :columns="memberColumn" :data="memberData">
|
||||
|
||||
</Table>
|
||||
<template v-if="couponActivity.activityScopeInfo && memberData.length>0">
|
||||
<h4 class="mt_10">会员列表列表</h4>
|
||||
<Table :columns="memberColumn" :data="memberData"></Table>
|
||||
</template>
|
||||
</div>
|
||||
</Form>
|
||||
</div>
|
||||
|
@ -52,7 +52,9 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
id: this.$route.query.id,//表单id
|
||||
couponActivity: "",//券活动
|
||||
couponActivity: {
|
||||
|
||||
},//券活动
|
||||
couponColumn: [
|
||||
{
|
||||
title: "优惠券名称",
|
||||
|
@ -124,6 +126,52 @@ export default {
|
|||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "couponPublish.scss";
|
||||
/*选择商品品类*/
|
||||
.content-goods-publish {
|
||||
padding: 15px;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
border: 1px solid #ddd;
|
||||
background: none repeat 0 0 #fff;
|
||||
height: 100%;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
div.base-info-item {
|
||||
h4 {
|
||||
margin-bottom: 10px;
|
||||
padding: 0 10px;
|
||||
border: 1px solid #ddd;
|
||||
background-color: #f8f8f8;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
font-size: 14px;
|
||||
line-height: 40px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.form-item-view {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
padding-left: 40px;
|
||||
|
||||
.shop-category-text {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
/** 底部步骤 */
|
||||
.footer {
|
||||
width: 88.7%;
|
||||
padding: 10px;
|
||||
background-color: #ffc;
|
||||
position: fixed;
|
||||
bottom: 0px;
|
||||
left: 10%;
|
||||
text-align: center;
|
||||
z-index: 9999;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
|
|
@ -1,253 +0,0 @@
|
|||
/*选择商品品类*/
|
||||
.content-goods-publish {
|
||||
padding: 15px;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
border: 1px solid #ddd;
|
||||
background: none repeat 0 0 #fff;
|
||||
height: 100%;
|
||||
margin-bottom: 20px;
|
||||
|
||||
/*商品品类*/
|
||||
.goods-category {
|
||||
text-align: left;
|
||||
padding: 10px;
|
||||
background: #fafafa;
|
||||
border: 1px solid #e6e6e6;
|
||||
|
||||
ul {
|
||||
padding: 8px 4px 8px 8px;
|
||||
list-style: none;
|
||||
width: 300px;
|
||||
background: none repeat 0 0 #fff;
|
||||
border: 1px solid #e6e6e6;
|
||||
display: inline-block;
|
||||
letter-spacing: normal;
|
||||
margin-right: 15px;
|
||||
vertical-align: top;
|
||||
word-spacing: normal;
|
||||
|
||||
li {
|
||||
line-height: 20px;
|
||||
padding: 5px;
|
||||
cursor: pointer;
|
||||
color: #333;
|
||||
font-size: 12px;
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** 当前品类被选中的样式 */
|
||||
.activeClass {
|
||||
background-color: #d9edf7;
|
||||
border: 1px solid #bce8f1;
|
||||
color: #3a87ad;
|
||||
}
|
||||
|
||||
/*!*当前选择的商品品类文字*!*/
|
||||
.current-goods-category {
|
||||
text-align: left;
|
||||
padding: 10px;
|
||||
width: 100%;
|
||||
border: 1px solid #fbeed5;
|
||||
color: #c09853;
|
||||
background-color: #fcf8e3;
|
||||
margin: 10px auto;
|
||||
padding: 8px 35px 8px 14px;
|
||||
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
/*编辑基本信息*/
|
||||
.el-form {
|
||||
padding-bottom: 80px;
|
||||
|
||||
.el-form-item {
|
||||
width: 100%;
|
||||
color: gray;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
|
||||
div.base-info-item {
|
||||
|
||||
h4 {
|
||||
margin-bottom: 10px;
|
||||
padding: 0 10px;
|
||||
border: 1px solid #ddd;
|
||||
background-color: #f8f8f8;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
font-size: 14px;
|
||||
line-height: 40px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.form-item-view {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
padding-left: 80px;
|
||||
|
||||
.shop-category-text {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.item-goods-properts-row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
word-break: break-all;
|
||||
white-space: normal;
|
||||
width: 300px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
.item-goods-properts {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.form-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.el-form-item {
|
||||
width: 30%;
|
||||
min-width: 300px;
|
||||
}
|
||||
|
||||
.goods-name-width {
|
||||
width: 50%;
|
||||
min-width: 300px;
|
||||
}
|
||||
|
||||
.el-form-item__content {
|
||||
margin-left: 120px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
p.goods-group-manager {
|
||||
padding-left: 7.5%;
|
||||
text-align: left;
|
||||
color: #999;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
/*teatarea*/
|
||||
/deep/ .el-textarea {
|
||||
width: 150%;
|
||||
}
|
||||
|
||||
.seo-text {
|
||||
width: 150%;
|
||||
}
|
||||
}
|
||||
|
||||
/*折叠面板*/
|
||||
.el-collapse-item {
|
||||
/deep/ .el-collapse-item__header {
|
||||
text-align: left;
|
||||
background-color: #f8f8f8;
|
||||
padding: 0 10px;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
margin-left: 5%;
|
||||
width: 25%;
|
||||
}
|
||||
|
||||
/deep/ .el-form-item__content {
|
||||
margin-left: 120px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
p.goods-group-manager {
|
||||
padding-left: 12%;
|
||||
text-align: left;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
/deep/ .el-collapse-item__content {
|
||||
padding: 10px 0;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
|
||||
/*商品描述*/
|
||||
.goods-intro {
|
||||
line-height: 40;
|
||||
}
|
||||
|
||||
/** 底部步骤 */
|
||||
.footer {
|
||||
width: 88.7%;
|
||||
padding: 10px;
|
||||
background-color: #ffc;
|
||||
position: fixed;
|
||||
bottom: 0px;
|
||||
left: 10%;
|
||||
text-align: center;
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
/*图片上传组件第一张图设置封面*/
|
||||
.goods-images {
|
||||
/deep/ li.el-upload-list__item:first-child {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/deep/ li.el-upload-list__item:first-child:after {
|
||||
content: "封";
|
||||
color: #fff;
|
||||
font-weight: bold;
|
||||
font-size: 12px;
|
||||
position: absolute;
|
||||
left: -15px;
|
||||
top: -6px;
|
||||
width: 40px;
|
||||
height: 24px;
|
||||
padding-top: 6px;
|
||||
background: #13ce66;
|
||||
text-align: center;
|
||||
-webkit-transform: rotate(-45deg);
|
||||
transform: rotate(-45deg);
|
||||
-webkit-box-shadow: 0 0 1pc 1px rgba(0, 0, 0, 0.2);
|
||||
box-shadow: 0 0 1pc 1px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
}
|
||||
|
||||
.el-form-item__label {
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.step-view {
|
||||
width: 33%;
|
||||
height: 40px;
|
||||
font-size: 19px;
|
||||
text-align: center;
|
||||
display: flex;
|
||||
background-color: #fff;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.page {
|
||||
margin-top: 2vh;
|
||||
margin-bottom: 5vh;
|
||||
}
|
|
@ -6,12 +6,11 @@
|
|||
<h4>活动信息</h4>
|
||||
<div class="form-item-view">
|
||||
<FormItem label="活动名称" prop="promotionName">
|
||||
<Input type="text" v-model="form.promotionName" placeholder="活动名称" clearable style="width: 260px"/>
|
||||
<Input type="text" v-model="form.promotionName" placeholder="请填写活动名称" clearable style="width: 260px"/>
|
||||
</FormItem>
|
||||
|
||||
<FormItem label="活动时间">
|
||||
<DatePicker type="datetimerange" :options="options" v-model="rangeTime" format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="请选择" style="width: 260px">
|
||||
placeholder="请选择活动时间" style="width: 260px">
|
||||
</DatePicker>
|
||||
</FormItem>
|
||||
|
||||
|
@ -72,18 +71,16 @@
|
|||
|
||||
<script>
|
||||
import couponTemplate from "@/views/promotion/coupon/coupon";
|
||||
|
||||
import userList from "@/views/member/list/index";
|
||||
|
||||
import {saveActivityCoupon, updateCouponActivity} from "@/api/promotion";
|
||||
import {saveActivityCoupon} from "@/api/promotion";
|
||||
|
||||
export default {
|
||||
name: "addCouponActivity",
|
||||
components: {
|
||||
couponTemplate,
|
||||
userList,
|
||||
userList
|
||||
},
|
||||
data() {
|
||||
data () {
|
||||
return {
|
||||
options: {
|
||||
disabledDate(date) {
|
||||
|
@ -228,7 +225,6 @@ export default {
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
|
||||
// 返回已选择的用户
|
||||
callbackSelectUser(val) {
|
||||
// 每次将返回的数据回调判断
|
||||
|
@ -283,7 +279,6 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 添加指定用户
|
||||
addVip() {
|
||||
this.checkUserList = true;
|
||||
|
|
|
@ -2,13 +2,7 @@
|
|||
<div class="full-cut">
|
||||
<Card>
|
||||
<Row>
|
||||
<Form
|
||||
ref="searchForm"
|
||||
:model="searchForm"
|
||||
inline
|
||||
:label-width="70"
|
||||
class="search-form"
|
||||
>
|
||||
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
|
||||
<Form-item label="活动名称" prop="promotionName">
|
||||
<Input
|
||||
type="text"
|
||||
|
@ -59,9 +53,7 @@
|
|||
{{ row.isFullMinus ? "满减" : "满折" }}
|
||||
</template>
|
||||
<template slot-scope="{ row }" slot="hours">
|
||||
<Tag v-for="item in unixHours(row.hours)" :key="item">{{
|
||||
item
|
||||
}}</Tag>
|
||||
<Tag v-for="item in unixHours(row.hours)" :key="item">{{item}}</Tag>
|
||||
</template>
|
||||
<template slot-scope="{ row }" slot="action">
|
||||
<div>
|
||||
|
@ -83,7 +75,7 @@
|
|||
</div>
|
||||
</template>
|
||||
</Table>
|
||||
<Row type="flex" justify="end" class="page operation">
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
<Page
|
||||
:current="searchForm.pageNumber"
|
||||
:total="total"
|
||||
|
@ -183,6 +175,7 @@ export default {
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
// 初始化数据
|
||||
init() {
|
||||
this.getDataList();
|
||||
},
|
||||
|
@ -218,6 +211,7 @@ export default {
|
|||
},
|
||||
changePageSize(v) {
|
||||
// 改变页码
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = v;
|
||||
this.getDataList();
|
||||
},
|
||||
|
@ -227,6 +221,7 @@ export default {
|
|||
this.searchForm.pageSize = 10;
|
||||
this.getDataList();
|
||||
},
|
||||
// 获取列表数据
|
||||
getDataList() {
|
||||
this.loading = true;
|
||||
if (this.selectDate && this.selectDate[0] && this.selectDate[1]) {
|
||||
|
|
|
@ -5,9 +5,7 @@
|
|||
<Tabs v-model="searchForm.status">
|
||||
<!-- 标签栏 -->
|
||||
<TabPane v-for="(item,index) in tabs" :key="index" :name="item.status" :label="item.title">
|
||||
|
||||
</TabPane>
|
||||
|
||||
</Tabs>
|
||||
<Table :columns="liveColumns" :data="liveData"></Table>
|
||||
<Row type="flex" style="margin:20px;" justify="end" class="mt_10">
|
||||
|
@ -167,6 +165,7 @@ export default {
|
|||
};
|
||||
},
|
||||
watch: {
|
||||
// 直播状态
|
||||
"searchForm.status": {
|
||||
handler() {
|
||||
this.liveData = [];
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<template>
|
||||
<div>
|
||||
<Card>
|
||||
|
||||
<Form :model="liveForm" ref="liveForm" :rules="liveRulesForm" :label-width="120">
|
||||
<FormItem label="直播标题" prop="name">
|
||||
<Input disabled v-model="liveForm.name" style="width:460px"></Input>
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<template>
|
||||
<div class="search">
|
||||
<Card>
|
||||
<Row v-show="openSearch">
|
||||
<Form
|
||||
ref="searchForm"
|
||||
:model="searchForm"
|
||||
|
@ -44,13 +43,13 @@
|
|||
>搜索</Button
|
||||
>
|
||||
</Form>
|
||||
</Row>
|
||||
<Table
|
||||
:loading="loading"
|
||||
border
|
||||
:columns="columns"
|
||||
:data="data"
|
||||
ref="table"
|
||||
class="mt_10"
|
||||
>
|
||||
<template slot-scope="{ row }" slot="action">
|
||||
<Button
|
||||
|
@ -73,7 +72,7 @@
|
|||
</Table>
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
<Page
|
||||
:current="searchForm.pageNumber + 1"
|
||||
:current="searchForm.pageNumber"
|
||||
:total="total"
|
||||
:page-size="searchForm.pageSize"
|
||||
@on-change="changePage"
|
||||
|
@ -94,14 +93,12 @@ import { getPintuanList, closePintuan } from "@/api/promotion";
|
|||
|
||||
export default {
|
||||
name: "pintuan",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
loading: true, // 表单加载状态
|
||||
openSearch: true, // 显示搜索项
|
||||
searchForm: {
|
||||
// 搜索框初始化对象
|
||||
pageNumber: 0, // 当前页数
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
sort: "startTime",
|
||||
order: "desc", // 默认排序方式
|
||||
|
@ -175,23 +172,29 @@ export default {
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
// 初始化数据
|
||||
init() {
|
||||
this.getDataList();
|
||||
},
|
||||
// 分页 修改页码
|
||||
changePage(v) {
|
||||
this.searchForm.pageNumber = v - 1;
|
||||
this.searchForm.pageNumber = v;
|
||||
this.getDataList();
|
||||
this.clearSelectAll();
|
||||
},
|
||||
// 分页 修改页数
|
||||
changePageSize(v) {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = v;
|
||||
this.getDataList();
|
||||
},
|
||||
// 搜索
|
||||
handleSearch() {
|
||||
this.searchForm.pageNumber = 0;
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.getDataList();
|
||||
},
|
||||
// 获取拼团列表
|
||||
getDataList() {
|
||||
this.loading = true;
|
||||
if (this.selectDate && this.selectDate[0] && this.selectDate[1]) {
|
||||
|
@ -209,9 +212,11 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
// 查看拼团商品
|
||||
view(v) {
|
||||
this.$router.push({ name: "pintuan-goods", query: { id: v.id } });
|
||||
},
|
||||
// 关闭当前活动
|
||||
close(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认关闭",
|
||||
|
|
|
@ -2,9 +2,7 @@
|
|||
<div class="pintuan-goods">
|
||||
<Card>
|
||||
<h4>活动详情</h4>
|
||||
<Table
|
||||
style="margin: 10px 0"
|
||||
border
|
||||
<Table style="margin: 10px 0" border
|
||||
:columns="columns"
|
||||
:data="data"
|
||||
></Table>
|
||||
|
@ -36,7 +34,7 @@
|
|||
</Table>
|
||||
<Row type="flex" justify="end" class="page operation">
|
||||
<Page
|
||||
:current="searchForm.pageNumber + 1"
|
||||
:current="searchForm.pageNumber"
|
||||
:total="total"
|
||||
:page-size="searchForm.pageSize"
|
||||
@on-change="changePage"
|
||||
|
@ -49,41 +47,21 @@
|
|||
></Page>
|
||||
</Row>
|
||||
</Card>
|
||||
<Modal title="查看图片" v-model="visible">
|
||||
<img
|
||||
:src="showImg"
|
||||
v-if="visible"
|
||||
style="width: 200px; height: 200px; margin-left: 130px"
|
||||
/>
|
||||
</Modal>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getPintuanGoodsList, getPintuanDetail } from "@/api/promotion.js";
|
||||
import config from "@/config";
|
||||
|
||||
const buyerUrl =
|
||||
process.env.NODE_ENV === "development"
|
||||
? config.api_dev.buyer
|
||||
: config.api_prod.buyer;
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
visible: false,// 预览图片
|
||||
showImg: "", // 预览图片url
|
||||
openSearch: true, // 显示搜索
|
||||
openTip: true, // 显示提示
|
||||
loading: false, // 表单加载状态
|
||||
searchForm: {
|
||||
// 搜索框初始化对象
|
||||
pageNumber: 0, // 当前页数
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
},
|
||||
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
selectList: [], // 多选数据
|
||||
selectCount: 0, // 多选计数
|
||||
data: [], // 表单数据
|
||||
total: 0, // 表单数据总数
|
||||
columns: [
|
||||
|
@ -170,35 +148,27 @@ export default {
|
|||
},
|
||||
|
||||
],
|
||||
goodsData: [],
|
||||
goodsData: [] // 商品数据
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
// 初始化数据
|
||||
init() {
|
||||
this.getDataList();
|
||||
this.getPintuanMsg();
|
||||
},
|
||||
|
||||
// 分页 改变页码
|
||||
changePage(v) {
|
||||
this.searchForm.pageNumber = v - 1;
|
||||
this.searchForm.pageNumber = v;
|
||||
this.getDataList();
|
||||
this.clearSelectAll();
|
||||
},
|
||||
|
||||
// 分页 改变页数
|
||||
changePageSize(v) {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = v;
|
||||
this.getDataList();
|
||||
},
|
||||
|
||||
handleReset() {
|
||||
// 重置
|
||||
this.searchForm.pageNumber = 0;
|
||||
this.searchForm.promotionName = "";
|
||||
this.selectDate = null;
|
||||
// 重新加载数据
|
||||
this.getDataList();
|
||||
},
|
||||
|
||||
// 获取拼团商品列表
|
||||
getDataList() {
|
||||
this.loading = true;
|
||||
this.searchForm.pintuanId = this.$route.query.id;
|
||||
|
@ -211,27 +181,12 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
|
||||
getPintuanMsg() {
|
||||
// 获取拼团详情
|
||||
getPintuanMsg() {
|
||||
getPintuanDetail(this.$route.query.id).then((res) => {
|
||||
if (res.success) this.data.push(res.result);
|
||||
});
|
||||
},
|
||||
|
||||
toBuyerGoods(row) {
|
||||
window.open(
|
||||
buyerUrl +
|
||||
"/pages/product/product?id=" +
|
||||
row.skuId +
|
||||
"&goodsId=" +
|
||||
row.goodsId
|
||||
);
|
||||
},
|
||||
viewImg(img) {
|
||||
this.showImg = img;
|
||||
this.visible = true;
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
|
@ -239,9 +194,6 @@ export default {
|
|||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.operation {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
h4 {
|
||||
margin: 20px 0;
|
||||
padding: 0 10px;
|
||||
|
|
|
@ -56,19 +56,11 @@
|
|||
>
|
||||
</Select>
|
||||
</template>
|
||||
|
||||
<template slot-scope="{ index }" slot="activeStock">
|
||||
<Input
|
||||
type="number"
|
||||
v-model="promotionGoodsList[index].activeStock"
|
||||
/>
|
||||
<Input type="number" v-model="promotionGoodsList[index].activeStock" />
|
||||
</template>
|
||||
|
||||
<template slot-scope="{ index }" slot="points">
|
||||
<Input
|
||||
type="number"
|
||||
v-model="promotionGoodsList[index].points"
|
||||
/>
|
||||
<Input type="number" v-model="promotionGoodsList[index].points" />
|
||||
</template>
|
||||
</Table>
|
||||
</FormItem>
|
||||
|
@ -306,6 +298,7 @@ export default {
|
|||
await this.getCategory();
|
||||
},
|
||||
methods: {
|
||||
// 获取商品分类
|
||||
async getCategory() {
|
||||
let res = await getPointsGoodsCategoryList();
|
||||
this.categoryList = res.result.records;
|
||||
|
@ -351,10 +344,12 @@ export default {
|
|||
);
|
||||
this.$router.go(-1);
|
||||
},
|
||||
// 选择分类
|
||||
changeCategory(val, index) {
|
||||
this.promotionGoodsList[index].pointsGoodsCategoryName = val.label;
|
||||
console.log(this.promotionGoodsList);
|
||||
},
|
||||
// 变更选中状态
|
||||
changeSelect(e) {
|
||||
// 已选商品批量选择
|
||||
this.selectedGoods = e;
|
||||
|
|
|
@ -110,13 +110,11 @@ import {
|
|||
getPointsGoodsById,
|
||||
getPointsGoodsCategoryList,
|
||||
} from "@/api/promotion";
|
||||
import { format } from "date-fns";
|
||||
|
||||
export default {
|
||||
name: "addCoupon",
|
||||
name: "editPointsGoods",
|
||||
data() {
|
||||
return {
|
||||
modalType: 0, // 添加、编辑标识
|
||||
form: {
|
||||
/** 活动名称 */
|
||||
promotionName: "",
|
||||
|
@ -134,7 +132,6 @@ export default {
|
|||
categoryList: [], // 分类列表
|
||||
id: this.$route.query.id, // 活动id
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
|
||||
formRule: {
|
||||
settlementPrice: [{ required: true, message: "请填写结算价格" }],
|
||||
pointsGoodsCategoryId: [
|
||||
|
@ -150,7 +147,6 @@ export default {
|
|||
// 如果id不为空则查询信息
|
||||
if (this.id) {
|
||||
this.getData();
|
||||
this.modalType = 1;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -162,6 +158,7 @@ export default {
|
|||
);
|
||||
this.$router.go(-1);
|
||||
},
|
||||
// 获取商品数据
|
||||
getData() {
|
||||
getPointsGoodsById(this.id).then((res) => {
|
||||
if (res.success) {
|
||||
|
@ -170,11 +167,12 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
// 获取分类
|
||||
async getCategory() {
|
||||
let res = await getPointsGoodsCategoryList();
|
||||
this.categoryList = res.result.records;
|
||||
},
|
||||
/** 保存平台优惠券 */
|
||||
/** 保存 */
|
||||
handleSubmit() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
|
|
|
@ -16,15 +16,14 @@
|
|||
<Option v-for="item in statusList" :value="item.value" :key="item.value">{{ item.label }}</Option>
|
||||
</Select>
|
||||
</Form-item>
|
||||
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
||||
<Form-item label="SKU编码">
|
||||
<Input type="text" v-model="searchForm.skuId" placeholder="请输入SKU编码" clearable style="width: 200px" />
|
||||
</Form-item>
|
||||
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
||||
</Form>
|
||||
</Row>
|
||||
<Row class="operation padding-row">
|
||||
<Button @click="addPointsGoods" type="primary">添加积分商品</Button>
|
||||
|
||||
</Row>
|
||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table">
|
||||
<template slot-scope="{ row }" slot="goodsName">
|
||||
|
@ -51,7 +50,6 @@
|
|||
<div>{{ row.startTime }}</div>
|
||||
<div>{{ row.endTime }}</div>
|
||||
</template>
|
||||
|
||||
<template slot-scope="{ row }" slot="action">
|
||||
<Button v-if="row.promotionStatus == 'NEW'" type="info" size="small" @click="edit(row.id)" style="margin-right: 5px">编辑</Button>
|
||||
<Button v-if="row.promotionStatus == 'START'" type="warning" size="small" @click="statusChanged(row.id, 'CLOSE')" style="margin-right: 5px">停用</Button>
|
||||
|
@ -75,7 +73,6 @@ import {
|
|||
} from "@/api/promotion";
|
||||
export default {
|
||||
name: "pointsGoods",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
loading: true, // 表单加载状态
|
||||
|
@ -92,8 +89,7 @@ export default {
|
|||
{ label: "已结束", value: "END" },
|
||||
{ label: "已关闭", value: "CLOSE" },
|
||||
],
|
||||
columns: [
|
||||
// 表头
|
||||
columns: [ // 表头
|
||||
{
|
||||
title: "商品名称",
|
||||
slot: "goodsName",
|
||||
|
@ -111,7 +107,6 @@ export default {
|
|||
slot: "settlementPrice",
|
||||
width: 100,
|
||||
},
|
||||
|
||||
{
|
||||
title: "库存数量",
|
||||
slot: "quantity",
|
||||
|
@ -178,20 +173,26 @@ export default {
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
// 初始化数据
|
||||
init() {
|
||||
this.getDataList();
|
||||
},
|
||||
// 跳转添加商品页面
|
||||
addPointsGoods() {
|
||||
this.$router.push({ name: "add-points-goods" });
|
||||
},
|
||||
// 分页 修改页码
|
||||
changePage(v) {
|
||||
this.searchForm.pageNumber = v;
|
||||
this.getDataList();
|
||||
},
|
||||
// 分页 修改页数
|
||||
changePageSize(v) {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = v;
|
||||
this.getDataList();
|
||||
},
|
||||
// 搜索
|
||||
handleSearch() {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
|
@ -201,10 +202,9 @@ export default {
|
|||
"_" +
|
||||
(this.searchForm.pointsE ? this.searchForm.pointsE : "");
|
||||
}
|
||||
|
||||
this.getDataList();
|
||||
},
|
||||
|
||||
// 获取列表数据
|
||||
getDataList() {
|
||||
this.loading = true;
|
||||
getPointsGoodsList(this.searchForm).then((res) => {
|
||||
|
@ -215,9 +215,11 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
// 编辑
|
||||
edit(id) {
|
||||
this.$router.push({ name: "edit-points-goods", query: { id: id } });
|
||||
},
|
||||
// 启用 停用积分商品
|
||||
statusChanged(id, status) {
|
||||
let text = "";
|
||||
if (status == "START") {
|
||||
|
@ -242,6 +244,7 @@ export default {
|
|||
},
|
||||
});
|
||||
},
|
||||
// 删除积分商品
|
||||
close(id) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认删除",
|
||||
|
@ -258,7 +261,7 @@ export default {
|
|||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
<template>
|
||||
<div>
|
||||
<div class="operation">
|
||||
<Button @click="addParent" icon="md-add">添加积分商品分类</Button>
|
||||
<Button icon="md-refresh" @click="refresh">刷新</Button>
|
||||
<Card>
|
||||
<div class="operation mb_10">
|
||||
<Button @click="addParent" type="primary" icon="md-add">添加积分商品分类</Button>
|
||||
<Button icon="md-refresh" @click="init">刷新</Button>
|
||||
</div>
|
||||
<tree-table
|
||||
ref="treeTable"
|
||||
|
@ -19,10 +20,9 @@
|
|||
<template slot="action" slot-scope="scope">
|
||||
<Button @click.native="edit(scope.row)" style="margin-right:10px;" size="small">编辑</Button>
|
||||
<Button @click.native="remove(scope.row)" type="primary" size="small">删除</Button>
|
||||
|
||||
</template>
|
||||
</tree-table>
|
||||
|
||||
</Card>
|
||||
<Modal
|
||||
:title="modalTitle"
|
||||
v-model="modalVisible"
|
||||
|
@ -59,13 +59,11 @@ import {
|
|||
deletePointsGoodsCategoryById,
|
||||
} from "@/api/promotion";
|
||||
import TreeTable from "@/views/my-components/tree-table/Table/Table";
|
||||
import uploadPicInput from "@/views/my-components/lili/upload-pic-input";
|
||||
|
||||
export default {
|
||||
name: "pointsGoodsCategory",
|
||||
components: {
|
||||
TreeTable,
|
||||
uploadPicInput,
|
||||
TreeTable
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -102,20 +100,15 @@ export default {
|
|||
template: "action",
|
||||
},
|
||||
],
|
||||
tableData: [],
|
||||
tableData: [], // 表格数据
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
// 初始化数据
|
||||
init() {
|
||||
this.getAllList();
|
||||
},
|
||||
refresh() {
|
||||
this.loading = true;
|
||||
let that = this;
|
||||
setTimeout(function () {
|
||||
that.loading = false;
|
||||
}, 1000);
|
||||
},
|
||||
// 编辑分类
|
||||
edit(v) {
|
||||
this.modalType = 1;
|
||||
this.modalTitle = "编辑";
|
||||
|
@ -125,6 +118,7 @@ export default {
|
|||
this.showParent = false;
|
||||
this.modalVisible = true;
|
||||
},
|
||||
// 添加顶级分类
|
||||
addParent() {
|
||||
this.modalType = 0;
|
||||
this.modalTitle = "添加积分商品分类";
|
||||
|
@ -135,6 +129,7 @@ export default {
|
|||
this.formAdd.parentId = 0;
|
||||
this.modalVisible = true;
|
||||
},
|
||||
// 提交
|
||||
Submit() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
console.log(valid);
|
||||
|
@ -167,10 +162,10 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
// 删除
|
||||
remove(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认删除",
|
||||
// 记得确认修改此处
|
||||
content: "您确认要删除 " + v.name + " ?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
|
@ -185,6 +180,7 @@ export default {
|
|||
},
|
||||
});
|
||||
},
|
||||
// 获取所有分类
|
||||
getAllList() {
|
||||
this.loading = true;
|
||||
getPointsGoodsCategoryList().then((res) => {
|
||||
|
|
|
@ -1,264 +0,0 @@
|
|||
/*选择商品品类*/
|
||||
.content-goods-publish {
|
||||
padding: 15px;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
border: 1px solid #ddd;
|
||||
background: none repeat 0 0 #fff;
|
||||
height: 100%;
|
||||
margin-bottom: 20px;
|
||||
|
||||
/*商品品类*/
|
||||
.goods-category {
|
||||
text-align: left;
|
||||
padding: 10px;
|
||||
background: #fafafa;
|
||||
border: 1px solid #e6e6e6;
|
||||
|
||||
ul {
|
||||
padding: 8px 4px 8px 8px;
|
||||
list-style: none;
|
||||
width: 300px;
|
||||
background: none repeat 0 0 #fff;
|
||||
border: 1px solid #e6e6e6;
|
||||
display: inline-block;
|
||||
letter-spacing: normal;
|
||||
margin-right: 15px;
|
||||
vertical-align: top;
|
||||
word-spacing: normal;
|
||||
|
||||
li {
|
||||
line-height: 20px;
|
||||
padding: 5px;
|
||||
cursor: pointer;
|
||||
color: #333;
|
||||
font-size: 12px;
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** 当前品类被选中的样式 */
|
||||
.activeClass {
|
||||
background-color: #d9edf7;
|
||||
border: 1px solid #bce8f1;
|
||||
color: #3a87ad;
|
||||
}
|
||||
|
||||
/*!*当前选择的商品品类文字*!*/
|
||||
.current-goods-category {
|
||||
text-align: left;
|
||||
padding: 10px;
|
||||
width: 100%;
|
||||
border: 1px solid #fbeed5;
|
||||
color: #c09853;
|
||||
background-color: #fcf8e3;
|
||||
margin: 10px auto;
|
||||
padding: 8px 35px 8px 14px;
|
||||
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
/*编辑基本信息*/
|
||||
.el-form {
|
||||
padding-bottom: 80px;
|
||||
|
||||
.el-form-item {
|
||||
width: 100%;
|
||||
color: gray;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
|
||||
getGoodsCategoryLevelList
|
||||
|
||||
/*平铺*/
|
||||
div.base-info-item>div {
|
||||
margin-left: 5%;
|
||||
}
|
||||
|
||||
div.base-info-item {
|
||||
|
||||
h4 {
|
||||
margin-bottom: 10px;
|
||||
padding: 0 10px;
|
||||
border: 1px solid #ddd;
|
||||
background-color: #f8f8f8;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
font-size: 14px;
|
||||
line-height: 40px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.form-item-view {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
padding-left: 80px;
|
||||
|
||||
.shop-category-text {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.item-goods-properts-row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
word-break: break-all;
|
||||
white-space: normal;
|
||||
width: 300px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
.item-goods-properts {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.form-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
|
||||
/** 审核信息-拒绝原因 */
|
||||
.auth-info {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
width: 30%;
|
||||
min-width: 300px;
|
||||
}
|
||||
|
||||
.goods-name-width {
|
||||
width: 50%;
|
||||
min-width: 300px;
|
||||
}
|
||||
|
||||
.el-form-item__content {
|
||||
margin-left: 120px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
p.goods-group-manager {
|
||||
padding-left: 7.5%;
|
||||
text-align: left;
|
||||
color: #999;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
/*teatarea*/
|
||||
/deep/ .el-textarea {
|
||||
width: 150%;
|
||||
}
|
||||
|
||||
.seo-text {
|
||||
width: 150%;
|
||||
}
|
||||
}
|
||||
|
||||
/*折叠面板*/
|
||||
.el-collapse-item {
|
||||
/deep/ .el-collapse-item__header {
|
||||
text-align: left;
|
||||
background-color: #f8f8f8;
|
||||
padding: 0 10px;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
margin-left: 5%;
|
||||
width: 25%;
|
||||
}
|
||||
|
||||
/deep/ .el-form-item__content {
|
||||
margin-left: 120px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
p.goods-group-manager {
|
||||
padding-left: 12%;
|
||||
text-align: left;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
/deep/ .el-collapse-item__content {
|
||||
padding: 10px 0;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
|
||||
/*商品描述*/
|
||||
.goods-intro {
|
||||
line-height: 40;
|
||||
}
|
||||
|
||||
/** 底部步骤 */
|
||||
.footer {
|
||||
width: 88.7%;
|
||||
padding: 10px;
|
||||
background-color: #ffc;
|
||||
position: fixed;
|
||||
bottom: 0px;
|
||||
left: 10%;
|
||||
text-align: center;
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
/*图片上传组件第一张图设置封面*/
|
||||
.goods-images {
|
||||
/deep/ li.el-upload-list__item:first-child {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/deep/ li.el-upload-list__item:first-child:after {
|
||||
content: "封";
|
||||
color: #fff;
|
||||
font-weight: bold;
|
||||
font-size: 12px;
|
||||
position: absolute;
|
||||
left: -15px;
|
||||
top: -6px;
|
||||
width: 40px;
|
||||
height: 24px;
|
||||
padding-top: 6px;
|
||||
background: #13ce66;
|
||||
text-align: center;
|
||||
-webkit-transform: rotate(-45deg);
|
||||
transform: rotate(-45deg);
|
||||
-webkit-box-shadow: 0 0 1pc 1px rgba(0, 0, 0, 0.2);
|
||||
box-shadow: 0 0 1pc 1px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
}
|
||||
|
||||
.el-form-item__label {
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.step-view {
|
||||
width: 33%;
|
||||
height: 40px;
|
||||
font-size: 19px;
|
||||
text-align: center;
|
||||
display: flex;
|
||||
background-color: #fff;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.page {
|
||||
margin-top: 2vh;
|
||||
margin-bottom: 5vh;
|
||||
}
|
|
@ -118,9 +118,9 @@ export default {
|
|||
|
||||
formRule: {
|
||||
promotionName: [{ required: true, message: "请填写活动名称" }],
|
||||
applyEndTime: [{ required: true, message: "请填写报名截止时间" }],
|
||||
applyEndTime: [{ required: true, message: "请选择报名截止时间" }],
|
||||
seckillPeriod: [{ required: true, message: "请填写抢购时间段" }],
|
||||
startTime: [{ required: true, message: "请填写活动开始时间" }],
|
||||
startTime: [{ required: true, message: "请选择活动开始时间" }],
|
||||
seckillRule: [{ required: true, message: "请输入申请规则" }],
|
||||
},
|
||||
};
|
||||
|
@ -139,6 +139,7 @@ export default {
|
|||
localStorage.pageOpenedList = JSON.stringify(this.$store.state.app.pageOpenedList);
|
||||
this.$router.go(-1);
|
||||
},
|
||||
// 获取活动详情
|
||||
getData() {
|
||||
seckillDetail(this.id).then((res) => {
|
||||
if (res.success) {
|
||||
|
@ -201,8 +202,18 @@ export default {
|
|||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "addSeckill.scss";
|
||||
.ivu-form-item{
|
||||
margin-bottom: 30px;
|
||||
h4 {
|
||||
margin-bottom: 10px;
|
||||
padding: 0 10px;
|
||||
border: 1px solid #ddd;
|
||||
background-color: #f8f8f8;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
font-size: 14px;
|
||||
line-height: 40px;
|
||||
text-align: left;
|
||||
}
|
||||
// .ivu-form-item{
|
||||
// margin-bottom: 30px;
|
||||
// }
|
||||
</style>
|
||||
|
|
|
@ -63,7 +63,7 @@ import setupSeckill from "@/views/promotion/seckill/setupSeckill";
|
|||
export default {
|
||||
name: "seckill",
|
||||
components: {
|
||||
setupSeckill,
|
||||
setupSeckill
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -131,33 +131,32 @@ export default {
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
// tab栏点击切换列表和设置
|
||||
clickTabPane(name) {
|
||||
|
||||
if (name == "setup") {
|
||||
|
||||
this.setupFlag = true;
|
||||
} else {
|
||||
this.setupFlag = false;
|
||||
}
|
||||
},
|
||||
|
||||
// 初始化信息
|
||||
init() {
|
||||
this.getDataList();
|
||||
},
|
||||
// 点击分页
|
||||
// 分页 改变页码
|
||||
changePage(v) {
|
||||
this.searchForm.pageNumber = v;
|
||||
this.getDataList();
|
||||
this.clearSelectAll();
|
||||
},
|
||||
// 设置每页大小
|
||||
// 分页 改变页数
|
||||
changePageSize(v) {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = v;
|
||||
this.getDataList();
|
||||
},
|
||||
// 搜索
|
||||
handleSearch() {
|
||||
this.searchForm.pageNumber = 0;
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.getDataList();
|
||||
},
|
||||
|
|
|
@ -308,25 +308,26 @@
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
// 初始化数据
|
||||
init() {
|
||||
this.getSeckillMsg();
|
||||
},
|
||||
|
||||
// 分页 改变页码
|
||||
changePage(v) {
|
||||
this.searchForm.pageNumber = v - 1;
|
||||
this.searchForm.pageNumber = v;
|
||||
this.getDataList();
|
||||
this.clearSelectAll();
|
||||
},
|
||||
|
||||
// 分页 改变页数
|
||||
changePageSize(v) {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = v;
|
||||
this.getDataList();
|
||||
},
|
||||
|
||||
// 清除选中状态
|
||||
clearSelectAll() {
|
||||
this.$refs.table.selectAll(false);
|
||||
},
|
||||
|
||||
changeSelect(e) {
|
||||
// 获取选择数据
|
||||
this.selectList = e;
|
||||
|
@ -379,17 +380,15 @@
|
|||
}
|
||||
return hourArr;
|
||||
},
|
||||
// 格式化申请状态
|
||||
promotionApplyStatus(key) {
|
||||
switch (key) {
|
||||
case "APPLY":
|
||||
return "申请";
|
||||
break;
|
||||
case "PASS":
|
||||
return "通过";
|
||||
break;
|
||||
case "REFUSE":
|
||||
return "拒绝";
|
||||
break;
|
||||
}
|
||||
},
|
||||
pass(row) {
|
||||
|
@ -421,6 +420,7 @@
|
|||
}
|
||||
this.showModal = true;
|
||||
},
|
||||
// 确认审批
|
||||
sureAudit() {
|
||||
this.selectCount = this.selectList.length;
|
||||
// 批量审核
|
||||
|
@ -453,6 +453,7 @@
|
|||
}
|
||||
});
|
||||
},
|
||||
// 展示拒绝原因
|
||||
showReason(reason) {
|
||||
this.$Modal.info({
|
||||
title: "拒绝原因",
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
</div>
|
||||
</FormItem>
|
||||
</Form>
|
||||
<!-- 选择时间 -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -27,9 +26,8 @@ import { getSetting, setSetting } from "@/api/index";
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
templateShow:false,
|
||||
templateShow:false, // 设置是否显示
|
||||
submitLoading: false,
|
||||
selectedTime: [],
|
||||
times: [], //时间集合 1-24点
|
||||
form: {
|
||||
seckillRule: "",
|
||||
|
@ -107,7 +105,6 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 选中时间
|
||||
*/
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
<template>
|
||||
<Card>
|
||||
<Row class="operation">
|
||||
<Button @click="asyncRegion" :loading="asyncLoading" type="primary" icon="md-add"
|
||||
<Button @click="handleAsyncRegion" :loading="asyncLoading" type="primary" icon="md-add"
|
||||
>同步数据</Button
|
||||
>
|
||||
</Row>
|
||||
<div class="flex">
|
||||
<Spin size="large" fix v-if="spinShow"></Spin>
|
||||
<Tree
|
||||
class="tree"
|
||||
:data="data"
|
||||
|
@ -99,7 +98,6 @@ export default {
|
|||
asyncLoading:false, // 加载状态
|
||||
num: 10, // 更新倒计时
|
||||
modalFlag: false, // 新增编辑标识
|
||||
spinShow: false, // 全局加载状态
|
||||
timerNum: 10, // 定时器
|
||||
data: [], // 加载数据
|
||||
id: 0, // id
|
||||
|
@ -122,7 +120,6 @@ export default {
|
|||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
|
||||
center: [
|
||||
{
|
||||
required: true,
|
||||
|
@ -144,6 +141,7 @@ export default {
|
|||
this.init();
|
||||
},
|
||||
methods: {
|
||||
// 提交数据
|
||||
submit() {
|
||||
delete this.addValidate.children;
|
||||
addRegion(this.addValidate).then((res) => {
|
||||
|
@ -190,7 +188,7 @@ export default {
|
|||
this.addValidate.center = "";
|
||||
this.modalFlag = true;
|
||||
},
|
||||
|
||||
// 删除
|
||||
handleDel() {
|
||||
this.$Modal.confirm({
|
||||
title: "确定删除?",
|
||||
|
@ -227,11 +225,11 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 树结构点击事件
|
||||
changeTree(array, val) {
|
||||
this.formValidate = val;
|
||||
},
|
||||
|
||||
// 异步加载数据
|
||||
loadData(item, callback) {
|
||||
item.loading = true;
|
||||
console.log(item);
|
||||
|
@ -267,7 +265,7 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 初始化数据
|
||||
init() {
|
||||
getChildRegion(this.id).then((res) => {
|
||||
if (res.result) {
|
||||
|
@ -294,8 +292,8 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
|
||||
asyncRegion() {
|
||||
// 同步数据
|
||||
handleAsyncRegion() {
|
||||
this.num = 10;
|
||||
this.$Modal.confirm({
|
||||
title: "确定更新?",
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
||||
</Form>
|
||||
</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" class="mt_10"></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>
|
||||
|
@ -51,8 +51,6 @@
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
shopId: "", // 店铺id
|
||||
modalFlag: false, // 新增、编辑标识
|
||||
loading: true, // 表单加载状态
|
||||
searchForm: {
|
||||
// 搜索框初始化对象
|
||||
|
@ -64,16 +62,6 @@
|
|||
endDate: "", // 终止时间
|
||||
},
|
||||
selectDate: null, // 创建时间
|
||||
form: {
|
||||
// 添加或编辑表单对象初始化数据
|
||||
memberName: "",
|
||||
storeName: "",
|
||||
shopDisable: "",
|
||||
id: "",
|
||||
createTime: "",
|
||||
},
|
||||
selectList: [], // 多选数据
|
||||
selectCount: 0, // 多选计数
|
||||
columns: [
|
||||
// 表头
|
||||
{
|
||||
|
@ -264,52 +252,38 @@
|
|||
},
|
||||
|
||||
methods: {
|
||||
callbackShop() {
|
||||
this.init();
|
||||
},
|
||||
// 回调给父级
|
||||
callback(val) {
|
||||
this.$emit("callback", val);
|
||||
},
|
||||
// 初始化数据
|
||||
init() {
|
||||
this.getDataList();
|
||||
},
|
||||
// 分页 改变页码
|
||||
changePage(v) {
|
||||
this.searchForm.pageNumber = v;
|
||||
this.getDataList();
|
||||
this.clearSelectAll();
|
||||
},
|
||||
// 分页 改变页数
|
||||
changePageSize(v) {
|
||||
this.searchForm.pageNumber = 1;
|
||||
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;
|
||||
},
|
||||
// 起止时间从新赋值
|
||||
selectDateRange(v) {
|
||||
if (v) {
|
||||
this.searchForm.startDate = v[0];
|
||||
this.searchForm.endDate = v[1];
|
||||
}
|
||||
},
|
||||
|
||||
// 获取列表数据
|
||||
getDataList() {
|
||||
this.loading = true;
|
||||
// 带多条件搜索参数获取表单数据 请自行修改接口
|
||||
|
@ -324,16 +298,19 @@
|
|||
this.total = this.data.length;
|
||||
this.loading = false;
|
||||
},
|
||||
// 添加店铺
|
||||
add() {
|
||||
this.$router.push({ path: '/shop-operation'});
|
||||
},
|
||||
// 修改店铺
|
||||
edit(v) {
|
||||
this.$router.push({ path: '/shop-operation', query: { shopId: v.id } });
|
||||
},
|
||||
// 关闭店铺
|
||||
disable(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认禁用",
|
||||
content: "您确认要禁用店铺 " + v.storeName + " ?",
|
||||
title: "确认关闭",
|
||||
content: "您确认要关闭店铺 " + v.storeName + " ?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
disableShop(v.id).then((res) => {
|
||||
|
@ -346,6 +323,7 @@
|
|||
},
|
||||
});
|
||||
},
|
||||
// 审核店铺
|
||||
audit(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "审核店铺",
|
||||
|
@ -373,10 +351,11 @@
|
|||
},
|
||||
});
|
||||
},
|
||||
// 开启店铺
|
||||
enable(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认启用",
|
||||
content: "您确认要启用店铺 " + v.storeName + " ?",
|
||||
title: "确认开启",
|
||||
content: "您确认要开启店铺 " + v.storeName + " ?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
enableBrand(v.id).then((res) => {
|
||||
|
|
|
@ -121,6 +121,3 @@
|
|||
line-height: 16px;
|
||||
}
|
||||
}
|
||||
.point-data{
|
||||
|
||||
}
|
||||
|
|
|
@ -252,8 +252,6 @@
|
|||
:data="orderData"
|
||||
ref="table"
|
||||
class="mt_10"
|
||||
sortable="custom"
|
||||
@on-sort-change="orderChangeSort"
|
||||
>
|
||||
<!-- 订单详情格式化 -->
|
||||
<template slot="orderSlot" slot-scope="scope">
|
||||
|
@ -354,8 +352,6 @@
|
|||
:data="refundGoodsOrderData"
|
||||
ref="table"
|
||||
class="mt_10"
|
||||
sortable="custom"
|
||||
@on-sort-change="refundGoodsOrderChangeSort"
|
||||
>
|
||||
<!-- 商品栏目格式化 -->
|
||||
<template slot="goodsSlot" slot-scope="scope">
|
||||
|
@ -478,8 +474,6 @@
|
|||
:data="refundOrderData"
|
||||
ref="table"
|
||||
class="mt_10"
|
||||
sortable="custom"
|
||||
@on-sort-change="refundOrderChangeSort"
|
||||
>
|
||||
<!-- 商品栏目格式化 -->
|
||||
<template slot="goodsSlot" slot-scope="scope">
|
||||
|
@ -554,7 +548,6 @@
|
|||
storeInfo: {},//店铺信息
|
||||
checkAllGroup: [], //选中的经营分类
|
||||
selectDate: null, // 申请时间
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
|
||||
orderColumns: [
|
||||
{
|
||||
|
@ -902,21 +895,6 @@
|
|||
});
|
||||
this.loading = false;
|
||||
},
|
||||
detail(v) {
|
||||
let sn = v.sn;
|
||||
this.$router.push({
|
||||
name: "after-order-detail",
|
||||
query: {sn: sn},
|
||||
});
|
||||
|
||||
},
|
||||
//跳转到订单详情页面
|
||||
orderDetail(v) {
|
||||
this.$router.push({
|
||||
name: "order-detail",
|
||||
query: {sn: v},
|
||||
});
|
||||
},
|
||||
//查询分类
|
||||
getCategories() {
|
||||
getCategoryTree().then((res) => {
|
||||
|
@ -925,8 +903,6 @@
|
|||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
//售后单页数变化
|
||||
refundGoodsOrderChangePage(v) {
|
||||
this.refundGoodsOrderSearchForm.pageNumber = v;
|
||||
|
@ -936,15 +912,9 @@
|
|||
//售后单页数变化
|
||||
refundGoodsOrderChangePageSize(v) {
|
||||
this.refundGoodsOrderSearchForm.pageSize = v;
|
||||
this.refundGoodsOrderSearchForm.pageNumber = 1;
|
||||
this.getRefundGoodsOrderData();
|
||||
},
|
||||
//售后单
|
||||
refundGoodsOrderChangeSort(e) {
|
||||
this.refundGoodsOrderSearchForm.sort = e.key;
|
||||
this.refundGoodsOrderSearchForm.order = e.order;
|
||||
this.getRefundGoodsOrderData();
|
||||
},
|
||||
|
||||
//退款单页数变化
|
||||
refundOrderChangePage(v) {
|
||||
this.refundOrderSearchForm.pageNumber = v;
|
||||
|
@ -954,12 +924,7 @@
|
|||
//售后单页数变化
|
||||
refundOrderChangePageSize(v) {
|
||||
this.refundOrderSearchForm.pageSize = v;
|
||||
this.getRefundOrder();
|
||||
},
|
||||
//售后单
|
||||
refundOrderChangeSort(e) {
|
||||
this.refundOrderSearchForm.sort = e.key;
|
||||
this.refundOrderSearchForm.order = e.order;
|
||||
this.refundOrderSearchForm.pageNumber = 1;
|
||||
this.getRefundOrder();
|
||||
},
|
||||
//订单记录页数变化
|
||||
|
@ -971,25 +936,24 @@
|
|||
//订单记录页数变化
|
||||
orderChangePageSize(v) {
|
||||
this.orderSearchForm.pageSize = v;
|
||||
this.orderSearchForm.pageNumber = 1;
|
||||
this.getOrderData();
|
||||
},
|
||||
orderChangeSort(e) {
|
||||
this.orderSearchForm.sort = e.key;
|
||||
this.orderSearchForm.order = e.order;
|
||||
this.getOrderData();
|
||||
},
|
||||
// 起止时间格式化
|
||||
selectDateRange(v) {
|
||||
if (v) {
|
||||
this.orderSearchForm.startDate = v[0];
|
||||
this.orderSearchForm.endDate = v[1];
|
||||
}
|
||||
},
|
||||
// 起止时间格式化
|
||||
selectRefundGoodsDateRange(v) {
|
||||
if (v) {
|
||||
this.refundGoodsOrderSearchForm.startDate = v[0];
|
||||
this.refundGoodsOrderSearchForm.endDate = v[1];
|
||||
}
|
||||
},
|
||||
// 起止时间格式化
|
||||
selectRefundDateRange(v) {
|
||||
if (v) {
|
||||
this.refundOrderSearchForm.startDate = v[0];
|
||||
|
@ -997,12 +961,10 @@
|
|||
}
|
||||
},
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.id = this.$route.query.id;
|
||||
this.init();
|
||||
}
|
||||
,
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
@ -30,16 +30,16 @@
|
|||
<Option value="REFUSED">审核拒绝</Option>
|
||||
</Select>
|
||||
</Form-item>
|
||||
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
||||
<Form-item label="创建时间" prop="createTime">
|
||||
<DatePicker v-model="selectDate" type="datetimerange" format="yyyy-MM-dd HH:mm:ss" clearable @on-change="selectDateRange" placeholder="选择起始时间" style="width: 200px"></DatePicker>
|
||||
</Form-item>
|
||||
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
||||
</Form>
|
||||
</Row>
|
||||
<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>
|
||||
|
@ -55,16 +55,10 @@ import {
|
|||
enableBrand,
|
||||
shopAudit,
|
||||
} from "@/api/shops";
|
||||
import shopOperation from "./shopOperation";
|
||||
export default {
|
||||
name: "shop",
|
||||
components: {
|
||||
shopOperation,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
shopId: "", // 店铺id
|
||||
modalFlag: false, // 新增、编辑标识
|
||||
loading: true, // 表单加载状态
|
||||
searchForm: {
|
||||
// 搜索框初始化对象
|
||||
|
@ -76,17 +70,6 @@ export default {
|
|||
endDate: "", // 终止时间
|
||||
},
|
||||
selectDate: null, // 创建时间
|
||||
form: {
|
||||
// 添加或编辑表单对象初始化数据
|
||||
memberName: "",
|
||||
storeName: "",
|
||||
shopDisable: "",
|
||||
id: "",
|
||||
createTime: "",
|
||||
},
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
selectList: [], // 多选数据
|
||||
selectCount: 0, // 多选计数
|
||||
columns: [
|
||||
// 表头
|
||||
{
|
||||
|
@ -314,52 +297,39 @@ export default {
|
|||
},
|
||||
|
||||
methods: {
|
||||
callbackShop() {
|
||||
this.init();
|
||||
},
|
||||
// 回调给父级
|
||||
callback(val) {
|
||||
this.$emit("callback", val);
|
||||
},
|
||||
// 初始化数据
|
||||
init() {
|
||||
this.getDataList();
|
||||
},
|
||||
// 分页 改变页码
|
||||
changePage(v) {
|
||||
this.searchForm.pageNumber = v;
|
||||
this.getDataList();
|
||||
this.clearSelectAll();
|
||||
},
|
||||
// 分页 改变页数
|
||||
changePageSize(v) {
|
||||
this.searchForm.pageNumber = 1;
|
||||
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;
|
||||
},
|
||||
// 起止时间分别赋值
|
||||
selectDateRange(v) {
|
||||
if (v) {
|
||||
this.searchForm.startDate = v[0];
|
||||
this.searchForm.endDate = v[1];
|
||||
}
|
||||
},
|
||||
|
||||
// 获取列表数据
|
||||
getDataList() {
|
||||
this.loading = true;
|
||||
// 带多条件搜索参数获取表单数据 请自行修改接口
|
||||
|
@ -373,16 +343,19 @@ export default {
|
|||
this.total = this.data.length;
|
||||
this.loading = false;
|
||||
},
|
||||
// 添加店铺
|
||||
add() {
|
||||
this.$router.push({ path: '/shop-operation'});
|
||||
},
|
||||
// 修改店铺
|
||||
edit(v) {
|
||||
this.$router.push({ path: '/shop-operation', query: { shopId: v.id } });
|
||||
},
|
||||
// 关闭店铺
|
||||
disable(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认禁用",
|
||||
content: "您确认要禁用店铺 " + v.storeName + " ?",
|
||||
title: "确认关闭",
|
||||
content: "您确认要关闭店铺 " + v.storeName + " ?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
disableShop(v.id).then((res) => {
|
||||
|
@ -399,6 +372,7 @@ export default {
|
|||
detail(row){
|
||||
this.$router.push({ name: "shop-detail", query: { id: row.id } });
|
||||
},
|
||||
// 审核店铺
|
||||
audit(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "审核店铺",
|
||||
|
@ -426,10 +400,11 @@ export default {
|
|||
},
|
||||
});
|
||||
},
|
||||
// 启用店铺
|
||||
enable(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认启用",
|
||||
content: "您确认要启用店铺 " + v.storeName + " ?",
|
||||
title: "确认开启",
|
||||
content: "您确认要开启店铺 " + v.storeName + " ?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
enableBrand(v.id).then((res) => {
|
||||
|
|
|
@ -388,7 +388,7 @@ export default {
|
|||
},
|
||||
categories: [], // 分类
|
||||
|
||||
infoResult: "", // 店铺详情
|
||||
infoResult: {}, // 店铺详情
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
@ -452,30 +452,25 @@ export default {
|
|||
this.shopForm.salesConsigneeAddressPath = val[1];
|
||||
this.shopForm.salesConsigneeAddressId = val[0];
|
||||
},
|
||||
|
||||
// 选择图片modal
|
||||
handleCLickImg(val) {
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
this.picModalFlag = true;
|
||||
this.selectedFormBtnName = val;
|
||||
},
|
||||
|
||||
// 图片回显
|
||||
callbackSelected(val) {
|
||||
this.picModalFlag = false;
|
||||
this.shopForm[this.selectedFormBtnName] = val.url;
|
||||
},
|
||||
|
||||
// 初始化数据
|
||||
init() {
|
||||
this.getCategories();
|
||||
if (this.shopId) {
|
||||
this.getShopDetail();
|
||||
}
|
||||
},
|
||||
filterMethod(value, option) {
|
||||
if (value && option) {
|
||||
return option.toUpperCase().indexOf(value.toUpperCase()) !== -1;
|
||||
}
|
||||
},
|
||||
|
||||
// 获取店铺详情
|
||||
getShopDetail() {
|
||||
shopDetail(this.shopId).then((res) => {
|
||||
if (res.result) {
|
||||
|
@ -490,6 +485,7 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
// 保存
|
||||
save() {
|
||||
this.$refs.shopForm.validate((valid) => {
|
||||
//校验结算日是否已经确认完成
|
||||
|
@ -542,6 +538,7 @@ export default {
|
|||
this.$set(this.shopForm, "storeAddressPath", item.addr);
|
||||
this.$set(this.shopForm, "storeAddressIdPath", item.addrId);
|
||||
},
|
||||
// 全部选中
|
||||
handleCheckAll() {
|
||||
if (this.indeterminate) {
|
||||
this.checkAll = false;
|
||||
|
@ -558,6 +555,7 @@ export default {
|
|||
this.checkAllGroup = [];
|
||||
}
|
||||
},
|
||||
// 经营类目的选择
|
||||
checkAllGroupChange(data) {
|
||||
if (data.length === this.categories.length) {
|
||||
this.indeterminate = false;
|
||||
|
@ -570,6 +568,7 @@ export default {
|
|||
this.checkAll = false;
|
||||
}
|
||||
},
|
||||
// 获取所有分类
|
||||
getCategories() {
|
||||
getCategoryTree().then((res) => {
|
||||
if (res.success) {
|
||||
|
|
|
@ -11,8 +11,6 @@
|
|||
:columns="columns"
|
||||
:data="data"
|
||||
ref="table"
|
||||
sortable="custom"
|
||||
@on-sort-change="changeSort"
|
||||
@on-selection-change="changeSelect"
|
||||
></Table>
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
|
@ -59,8 +57,7 @@ import {
|
|||
updateSensitiveWords
|
||||
} from "@/api/index";
|
||||
export default {
|
||||
name: "bill",
|
||||
components: {},
|
||||
name: "sensitiveWords",
|
||||
data() {
|
||||
return {
|
||||
loading: true, // 表单加载状态
|
||||
|
@ -172,36 +169,25 @@ export default {
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
// 初始化数据
|
||||
init() {
|
||||
this.getDataList();
|
||||
},
|
||||
// 分页 改变页码
|
||||
changePage(v) {
|
||||
this.searchForm.pageNumber = v;
|
||||
this.getDataList();
|
||||
this.clearSelectAll();
|
||||
},
|
||||
// 分页 改变页数
|
||||
changePageSize(v) {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = v;
|
||||
this.getDataList();
|
||||
},
|
||||
// 搜索
|
||||
handleSearch() {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.getDataList();
|
||||
},
|
||||
handleReset() {
|
||||
this.$refs.searchForm.resetFields();
|
||||
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() {
|
||||
|
@ -211,7 +197,7 @@ export default {
|
|||
this.selectList = e;
|
||||
this.selectCount = e.length;
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
getDataList() {
|
||||
this.loading = true;
|
||||
|
||||
|
@ -225,6 +211,7 @@ export default {
|
|||
this.total = this.data.length;
|
||||
this.loading = false;
|
||||
},
|
||||
// 提交
|
||||
handleSubmit() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
|
@ -255,6 +242,7 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
// 添加敏感词
|
||||
add() {
|
||||
this.modalType = 0;
|
||||
this.modalTitle = "添加";
|
||||
|
@ -263,6 +251,7 @@ export default {
|
|||
|
||||
this.modalVisible = true;
|
||||
},
|
||||
// 修改
|
||||
detail(v) {
|
||||
this.modalType = 1;
|
||||
this.id = v.id;
|
||||
|
@ -270,6 +259,7 @@ export default {
|
|||
this.modalVisible = true;
|
||||
this.form.sensitiveWord = v.sensitiveWord;
|
||||
},
|
||||
// 删除
|
||||
remove(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认删除",
|
||||
|
@ -288,6 +278,7 @@ export default {
|
|||
},
|
||||
});
|
||||
},
|
||||
// 批量删除
|
||||
delAll() {
|
||||
if (this.selectCount <= 0) {
|
||||
this.$Message.warning("您还未选择要删除的数据");
|
||||
|
|
Loading…
Reference in New Issue