添加注释,删除无用代码,bug修改

This commit is contained in:
mabo
2021-07-26 18:12:13 +08:00
parent df9ea021b3
commit 87980277bf
38 changed files with 418 additions and 3550 deletions

View File

@@ -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) => {

View File

@@ -121,6 +121,3 @@
line-height: 16px;
}
}
.point-data{
}

View File

@@ -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>

View File

@@ -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) => {

View File

@@ -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) {