|
@@ -0,0 +1,215 @@
|
|
|
|
+<template>
|
|
|
|
+ <div id="">
|
|
|
|
+ <search-box-new
|
|
|
|
+ ref="searchBox"
|
|
|
|
+ :formData="formData"
|
|
|
|
+ :formList="formList"
|
|
|
|
+ @search="search"
|
|
|
|
+ @init="init"
|
|
|
|
+ />
|
|
|
|
+ <table-list
|
|
|
|
+ rowKey="storeId"
|
|
|
|
+ ref="tableList"
|
|
|
|
+ :tableSets="tableSet"
|
|
|
|
+ :tableData="tableData"
|
|
|
|
+ :navText="navText"
|
|
|
|
+ :loading="loading"
|
|
|
|
+ @addClick="addClick"
|
|
|
|
+ >
|
|
|
|
+ <template slot="customize">
|
|
|
|
+ <el-button type="warning" @click="remove"> 批量删除 </el-button>
|
|
|
|
+ </template>
|
|
|
|
+ <template slot="status" slot-scope="props">
|
|
|
|
+ <el-switch
|
|
|
|
+ v-model="props.scope.row.status"
|
|
|
|
+ active-color="#13ce66"
|
|
|
|
+ inactive-color="#ff4949"
|
|
|
|
+ :active-value="1"
|
|
|
|
+ :inactive-value="0"
|
|
|
|
+ @change="statusChange($event, props.scope.row)"
|
|
|
|
+ >
|
|
|
|
+ </el-switch>
|
|
|
|
+ </template>
|
|
|
|
+ <template slot="btn" slot-scope="props">
|
|
|
|
+ <el-button type="text" @click="addClick(props.scope.row)"
|
|
|
|
+ >编辑</el-button
|
|
|
|
+ ><el-button type="text" @click="del(props.scope.row)">删除</el-button>
|
|
|
|
+ </template>
|
|
|
|
+ </table-list>
|
|
|
|
+ <pagination
|
|
|
|
+ :total="total"
|
|
|
|
+ :pageSize.sync="formData.pageSize"
|
|
|
|
+ :currentPage.sync="formData.pageNum"
|
|
|
|
+ @search="search"
|
|
|
|
+ />
|
|
|
|
+ <dislog
|
|
|
|
+ :dialogVisible.sync="dialogVisible"
|
|
|
|
+ @search="search"
|
|
|
|
+ :storeId="storeId"
|
|
|
|
+ ></dislog>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+import dislog from "./dislog.vue";
|
|
|
|
+import searchBoxNew from "@/components/searchBoxNew";
|
|
|
|
+import tableList from "@/components/tableList";
|
|
|
|
+import pagination from "@/components/pagination";
|
|
|
|
+export default {
|
|
|
|
+ name: "StoreManageMent",
|
|
|
|
+ components: { searchBoxNew, tableList, pagination, dislog },
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ loading: false,
|
|
|
|
+ navText: {
|
|
|
|
+ title: "店铺管理",
|
|
|
|
+ index: 0,
|
|
|
|
+ ch: "条",
|
|
|
|
+ num: true,
|
|
|
|
+ choice: true,
|
|
|
|
+ addHide: false,
|
|
|
|
+ custom: false,
|
|
|
|
+ openCheckMore: true,
|
|
|
|
+ },
|
|
|
|
+ formList: [
|
|
|
|
+ {
|
|
|
|
+ prop: "merId",
|
|
|
|
+ placeholder: "请选择合作商户",
|
|
|
|
+ scope: "merList",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ prop: "storeName",
|
|
|
|
+ placeholder: "输入店铺简称",
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ formData: {},
|
|
|
|
+ tableSet: [
|
|
|
|
+ {
|
|
|
|
+ label: "店铺简称",
|
|
|
|
+ prop: "storeName",
|
|
|
|
+ hidden: true,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: "店铺地址",
|
|
|
|
+ prop: "address",
|
|
|
|
+ hidden: true,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: "合作商户",
|
|
|
|
+ prop: "merName",
|
|
|
|
+ hidden: true,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: "启用状态",
|
|
|
|
+ prop: "status",
|
|
|
|
+ hidden: true,
|
|
|
|
+ scope: "solt",
|
|
|
|
+ soltName: "status",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: "创建时间",
|
|
|
|
+ prop: "createTime",
|
|
|
|
+ hidden: true,
|
|
|
|
+ scope: "aTimeList",
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ tableData: [],
|
|
|
|
+ total: 0,
|
|
|
|
+ dialogVisible: false,
|
|
|
|
+ storeId: 0,
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ created() {
|
|
|
|
+ this.search(2);
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ remove() {
|
|
|
|
+ if (this.$refs.tableList.allCheckData.length === 0) {
|
|
|
|
+ this.$message.error("请勾选数据");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ this.$confirm("确定批量删除选中的数据吗?", "提示", {
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
+ type: "warning",
|
|
|
|
+ })
|
|
|
|
+ .then(() => {
|
|
|
|
+ this.$api
|
|
|
|
+ .mallstorebatchRemove({
|
|
|
|
+ storeIds: this.$refs.tableList.allCheckData.map((i) => i.storeId),
|
|
|
|
+ status: -1,
|
|
|
|
+ })
|
|
|
|
+ .then(() => {
|
|
|
|
+ this.$message.success("批量删除成功");
|
|
|
|
+ this.search(3);
|
|
|
|
+ });
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {});
|
|
|
|
+ },
|
|
|
|
+ addClick(data) {
|
|
|
|
+ this.storeId = data?.storeId || 0;
|
|
|
|
+ this.dialogVisible = true;
|
|
|
|
+ },
|
|
|
|
+ search(v) {
|
|
|
|
+ this.loading = true;
|
|
|
|
+ if (v === 2) {
|
|
|
|
+ this.formData = {
|
|
|
|
+ pageSize: 10,
|
|
|
|
+ pageNum: 1,
|
|
|
|
+ status: "0,1",
|
|
|
|
+ };
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.$refs.tableList.clearMoreActive();
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ if (v === 3) {
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.$refs.tableList.clearMoreActive();
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ this.$api
|
|
|
|
+ .mallstorelist(this.formData)
|
|
|
|
+ .then((res) => {
|
|
|
|
+ this.tableData = res.rows;
|
|
|
|
+ this.total = res.total;
|
|
|
|
+ this.navText.index = res.total;
|
|
|
|
+ })
|
|
|
|
+ .finally(() => {
|
|
|
|
+ this.loading = false;
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ statusChange(e, row) {
|
|
|
|
+ this.$api
|
|
|
|
+ .editmallstore({ storeId: row.storeId, merId: row.merId, status: e })
|
|
|
|
+ .then((res) => {
|
|
|
|
+ this.$message.success("操作成功");
|
|
|
|
+ row.status = e;
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {
|
|
|
|
+ return (row.status = e ? 0 : 1);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ init() {
|
|
|
|
+ this.search(2);
|
|
|
|
+ },
|
|
|
|
+ del(v) {
|
|
|
|
+ this.$confirm("确定删除此内容?", "提示", {
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
+ type: "warning",
|
|
|
|
+ })
|
|
|
|
+ .then(() => {
|
|
|
|
+ this.$api
|
|
|
|
+ .editmallmerchant({ storeId: row.storeId, status: -1 })
|
|
|
|
+ .then((res) => {
|
|
|
|
+ this.$message.success("删除成功");
|
|
|
|
+ this.search();
|
|
|
|
+ });
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {});
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+};
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style lang="scss" scoped></style>
|