Переглянути джерело

feat: 处理门店管理、多频多台、协议管理、反馈类型、多添加一层谨慎操作提示

Damon 9 місяців тому
батько
коміт
74b2e03eb6

+ 12 - 0
src/utils/DialogUtil.js

@@ -0,0 +1,12 @@
+// 列表
+export function dialogCallBack(that, callBack) {
+  that.$alert(`删除后数据不可恢复,请谨慎进行该操作!`, "温馨提示:", {
+    confirmButtonText: "我已了解"
+  }).then(() => {
+    setTimeout(() => {
+      if (callBack != null) {
+        callBack();
+      }
+    }, 200);
+  });
+}

+ 127 - 77
src/views/operation/agreement/index.vue

@@ -1,30 +1,60 @@
+<!-- 运营管理 协议管理 -->
 <template>
-  <div class='app-container'>
-    <el-button type="primary" icon="el-icon-plus" size="mini" @click="getDetail()"
-      v-hasPermi="['operation:agreement:add']">新增</el-button>
+  <div class="app-container">
+    <el-button
+      type="primary"
+      icon="el-icon-plus"
+      size="mini"
+      @click="getDetail()"
+      v-hasPermi="['operation:agreement:add']"
+      >新增</el-button
+    >
+
     <!-- 列表 -->
     <el-table :data="tableData" v-loading="loading">
       <el-table-column label="序号" align="center" type="index" />
       <el-table-column label="协议名称" align="center" prop="name" />
-      <el-table-column label="协议类型" align="center" prop="type" :formatter="typeFormatter" />
+      <el-table-column
+        label="协议类型"
+        align="center"
+        prop="type"
+        :formatter="typeFormatter"
+      />
       <el-table-column label="更新时间" align="center" prop="updateTime" />
       <el-table-column label="创建时间" align="center" prop="createTime" />
       <el-table-column label="操作" align="center">
         <template slot-scope="scope">
-          <el-button type="text" @click="getDetail(scope.row.id, true)">查看</el-button>
-          <el-button type="text" @click="getDetail(scope.row.id)" v-hasPermi="['operation:agreement:edit']">编辑</el-button>
-          <el-button type="delete" @click="getDelete(scope.row)"
-            v-hasPermi="['operation:agreement:delete']">删除</el-button>
+          <el-button type="text" @click="getDetail(scope.row.id, true)"
+            >查看</el-button
+          >
+          <el-button
+            type="text"
+            @click="getDetail(scope.row.id)"
+            v-hasPermi="['operation:agreement:edit']"
+            >编辑</el-button
+          >
+          <el-button
+            type="delete"
+            @click="getDelete(scope.row)"
+            v-hasPermi="['operation:agreement:delete']"
+            >删除</el-button
+          >
         </template>
       </el-table-column>
     </el-table>
-    <pagination v-show="total > 0" :total="total" :page.sync="form.pageNum" :limit.sync="form.pageSize"
-      @pagination="getList" />
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="form.pageNum"
+      :limit.sync="form.pageSize"
+      @pagination="getList"
+    />
   </div>
 </template>
 
 <script>
-import { list, remove } from '@/api/operation/agreement'
+import { list, remove } from "@/api/operation/agreement";
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
   data() {
     return {
@@ -33,69 +63,83 @@ export default {
       // 表单
       form: {
         pageNum: 1,
-        pageSize: 10
+        pageSize: 10,
       },
       // 列表
       tableData: [],
       // 总数据
       total: 0,
       // 协议类型
-      typeOptions: [{
-        value: 0,
-        label: '用户协议'
-      }, {
-        value: 1,
-        label: '隐私协议'
-      }, {
-        value: 2,
-        label: '音乐服务许可协议'
-      }, {
-        value: 3,
-        label: '儿童隐私保护指南'
-      }, {
-        value: 4,
-        label: 'VIP音乐服务协议'
-      }, {
-        value: 5,
-        label: '爱听付费协议'
-      }, {
-        value: 6,
-        label: '关于我们'
-      }, {
-        value: 7,
-        label: '第三方信息共享清单'
-      },{
-        value: 8,
-        label: '已收集个人信息清单'
-      }, {
-        value: 9,
-        label: '连接设备提示'
-      }, {
-        value: 10,
-        label: '联通认证服务协议'
-      }, {
-        value: 11,
-        label: '电信认证服务协议'
-      }, {
-        value: 12,
-        label: '移动认证服务协议'
-      }]
-    }
+      typeOptions: [
+        {
+          value: 0,
+          label: "用户协议",
+        },
+        {
+          value: 1,
+          label: "隐私协议",
+        },
+        {
+          value: 2,
+          label: "音乐服务许可协议",
+        },
+        {
+          value: 3,
+          label: "儿童隐私保护指南",
+        },
+        {
+          value: 4,
+          label: "VIP音乐服务协议",
+        },
+        {
+          value: 5,
+          label: "爱听付费协议",
+        },
+        {
+          value: 6,
+          label: "关于我们",
+        },
+        {
+          value: 7,
+          label: "第三方信息共享清单",
+        },
+        {
+          value: 8,
+          label: "已收集个人信息清单",
+        },
+        {
+          value: 9,
+          label: "连接设备提示",
+        },
+        {
+          value: 10,
+          label: "联通认证服务协议",
+        },
+        {
+          value: 11,
+          label: "电信认证服务协议",
+        },
+        {
+          value: 12,
+          label: "移动认证服务协议",
+        },
+      ],
+    };
   },
   mounted() {
-    this.getList()
+    this.getList();
   },
   methods: {
     // 列表
     getList() {
-      this.loading = true
-      list(this.form).then(res => {
+      this.loading = true;
+      list(this.form).then((res) => {
         if (res.code === 0) {
-          this.tableData = res.data.records
-          this.total = res.data.total
-          this.loading = false
+          this.tableData = res.data.records;
+          this.total = res.data.total;
+          this.loading = false;
         }
-      })
+      });
     },
 
     // 详情
@@ -104,29 +148,35 @@ export default {
         path: `/operation/agreement/detail`,
         query: {
           id: id,
-          boolean: boolean
-        }
-      })
+          boolean: boolean,
+        },
+      });
     },
 
     // 删除
     getDelete(row) {
-      this.$confirm(`是否删除${row.name}?`, '提示', {
-        type: 'warning'
-      }).then(() => {
-        remove(row.id).then(res => {
-          if (res.code === 0) {
-            this.$message.success('删除成功!')
-            this.getList()
-          }
-        })
-      }).catch(() => { })
+      var that = this;
+      dialogCallBack(that, function () {
+        that
+          .$confirm(`是否删除${row.name}?`, "提示", {
+            type: "warning",
+          })
+          .then(() => {
+            remove(row.id).then((res) => {
+              if (res.code === 0) {
+                that.$message.success("删除成功!");
+                that.getList();
+              }
+            });
+          })
+          .catch(() => {});
+      });
     },
 
     // 字典翻译
     typeFormatter(row) {
-      return this.selectDictLabel(this.typeOptions, row.type)
-    }
-  }
-}
+      return this.selectDictLabel(this.typeOptions, row.type);
+    },
+  },
+};
 </script>

+ 2 - 2
src/views/operation/channel/index.vue

@@ -269,7 +269,7 @@ export default {
       var that = this;
       dialogCallBack(that, function () {
         that
-          .$confirm(`是否删除${row.name}?`, "提示", {
+          .$confirm(`是否删除${row.name}?`, "提示", {
             type: "warning",
           })
           .then(() => {
@@ -379,4 +379,4 @@ export default {
     },
   },
 };
-</script>
+</script>

+ 27 - 18
src/views/operation/channels/index.vue

@@ -1,4 +1,4 @@
-<!-- 多频多台 -->
+<!-- 运营管理 多频多台 -->
 <template>
   <div class="app-container">
     <el-button
@@ -9,6 +9,7 @@
       v-hasPermi="['operation:channels:add']"
       >新增多频多台</el-button
     >
+
     <el-table :data="tableData" v-loading="loading">
       <el-table-column label="频道名称" align="center" prop="name" />
       <el-table-column label="设备" align="center">
@@ -285,6 +286,8 @@ list,
 remove,
 submit,
 } from "@/api/operation/channels";
+
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
   data() {
     return {
@@ -365,12 +368,15 @@ export default {
 
     // 删除频道规则
     getRemove(row) {
-      this.$confirm(`是否删除${row.name}?`, "提示").then(() => {
-        remove(row.id).then((res) => {
-          if (res.code === 0) {
-            this.$message.success("删除成功!");
-            this.getList();
-          }
+      var that = this;
+      dialogCallBack(that, function () {
+        that.$confirm(`是否有删除${row.name}?`, "提示").then(() => {
+          remove(row.id).then((res) => {
+            if (res.code === 0) {
+              that.$message.success("删除成功!");
+              that.getList();
+            }
+          });
         });
       });
     },
@@ -387,7 +393,6 @@ export default {
       }
     },
 
-    // console.log("列表弹窗展示===00===" + JSON.stringify(res));
     //弹窗 详情
     getDetail() {
       detail(this.row.id).then((res) => {
@@ -502,16 +507,20 @@ export default {
 
     // 删除
     getDelete(item) {
-      this.$confirm(`是否删除${item.channelTypeName}?`, "提示")
-        .then(() => {
-          classRemove(item.channelTypeId).then((res) => {
-            if (res.code === 0) {
-              this.$message.success("删除成功!");
-              this.getDetail();
-            }
-          });
-        })
-        .catch(() => {});
+      var that = this;
+      dialogCallBack(that, function () {
+        that
+          .$confirm(`是否有删除${item.channelTypeName}?`, "提示")
+          .then(() => {
+            classRemove(item.channelTypeId).then((res) => {
+              if (res.code === 0) {
+                that.$message.success("删除成功!");
+                that.getDetail();
+              }
+            });
+          })
+          .catch(() => {});
+      });
     },
 
     // 12频道详情

+ 122 - 61
src/views/operation/feedbacktype/index.vue

@@ -1,28 +1,74 @@
+<!-- 运营管理 意见反馈 反馈类型 -->
 <template>
-  <div class='app-container'>
-    <el-button type="primary" icon="el-icon-plus" size="mini" @click="getDialog('新增')"
-      v-hasPermi="['operation:feedbacktype:add']">新增</el-button>
+  <div class="app-container">
+    <el-button
+      type="primary"
+      icon="el-icon-plus"
+      size="mini"
+      @click="getDialog('新增')"
+      v-hasPermi="['operation:feedbacktype:add']"
+      >新增</el-button
+    >
     <!-- 列表 -->
     <el-table :data="tableData" v-loading="loading">
-      <el-table-column label="序号" type="index" align="center"></el-table-column>
-      <el-table-column label="排序" prop="sort" align="center"></el-table-column>
-      <el-table-column label="类型名称" prop="name" align="center"></el-table-column>
-      <el-table-column label="创建时间" prop="createTime" align="center"></el-table-column>
+      <el-table-column
+        label="序号"
+        type="index"
+        align="center"
+      ></el-table-column>
+      <el-table-column
+        label="排序"
+        prop="sort"
+        align="center"
+      ></el-table-column>
+      <el-table-column
+        label="类型名称"
+        prop="name"
+        align="center"
+      ></el-table-column>
+      <el-table-column
+        label="创建时间"
+        prop="createTime"
+        align="center"
+      ></el-table-column>
       <el-table-column label="操作" align="center">
         <template slot-scope="scope">
-          <el-button type="text" @click="getDialog('编辑', scope.row.id)"
-            v-hasPermi="['operation:feedbacktype:edit']">编辑</el-button>
-          <el-button type="delete" @click="getDelete(scope.row)"
-            v-hasPermi="['operation:feedbacktype:delete']">删除</el-button>
+          <el-button
+            type="text"
+            @click="getDialog('编辑', scope.row.id)"
+            v-hasPermi="['operation:feedbacktype:edit']"
+            >编辑</el-button
+          >
+          <el-button
+            type="delete"
+            @click="getDelete(scope.row)"
+            v-hasPermi="['operation:feedbacktype:delete']"
+            >删除</el-button
+          >
         </template>
       </el-table-column>
     </el-table>
-    <pagination v-show="total > 0" :total="total" :page.sync="form.pageNum" :limit.sync="form.pageSize"
-      @pagination="getList" />
-      
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="form.pageNum"
+      :limit.sync="form.pageSize"
+      @pagination="getList"
+    />
+
     <!-- 弹窗 -->
-    <el-dialog :visible.sync="dialogVisible" :title="title" width="500px" :before-close="close">
-      <el-form :model="dialogForm" ref="dialogForm" :rules="rules" label-width="100px">
+    <el-dialog
+      :visible.sync="dialogVisible"
+      :title="title"
+      width="500px"
+      :before-close="close"
+    >
+      <el-form
+        :model="dialogForm"
+        ref="dialogForm"
+        :rules="rules"
+        label-width="100px"
+      >
         <el-form-item label="类型名称:" prop="name">
           <el-input v-model="dialogForm.name" placeholder="请输入类型名称" />
         </el-form-item>
@@ -39,7 +85,8 @@
 </template>
 
 <script>
-import { list, detail, remove, submit } from '@/api/operation/feedbacktype'
+import { detail, list, remove, submit } from "@/api/operation/feedbacktype";
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
   data() {
     return {
@@ -48,7 +95,7 @@ export default {
       // 表单
       form: {
         pageNum: 1,
-        pageSize: 10
+        pageSize: 10,
       },
       // 总数据
       total: 0,
@@ -57,83 +104,97 @@ export default {
       // 弹窗
       dialogVisible: false,
       // 弹窗标题
-      title: '新增',
+      title: "新增",
       // 弹窗表单
       dialogForm: {},
       // 校验
       rules: {
-        name: [{
-          required: true, message: '请输入类型名称', trigger: 'blur'
-        }],
-        sort: [{
-          required: true, message: '请输入排序', trigger: 'blur'
-        }]
-      }
-    }
+        name: [
+          {
+            required: true,
+            message: "请输入类型名称",
+            trigger: "blur",
+          },
+        ],
+        sort: [
+          {
+            required: true,
+            message: "请输入排序",
+            trigger: "blur",
+          },
+        ],
+      },
+    };
   },
   mounted() {
-    this.getList()
+    this.getList();
   },
   methods: {
     // 列表
     getList() {
-      this.loading = true
-      list(this.form).then(res => {
+      this.loading = true;
+      list(this.form).then((res) => {
         if (res.code === 0) {
-          this.tableData = res.data.records
-          this.total = res.data.total
-          this.loading = false
+          this.tableData = res.data.records;
+          this.total = res.data.total;
+          this.loading = false;
         }
-      })
+      });
     },
 
     // 删除
     getDelete(row) {
-      this.$confirm(`是否删除${row.name}?`, '提示', {
-        type: "warning"
-      }).then(() => {
-        remove(row.id).then(res => {
-          if (res.code === 0) {
-            this.$message.success('删除成功!')
-            this.getList()
-          }
-        })
-      }).catch(() => { })
+      var that = this;
+      dialogCallBack(that, function () {
+        that
+          .$confirm(`是否删除${row.name}?`, "提示", {
+            type: "warning",
+          })
+          .then(() => {
+            remove(row.id).then((res) => {
+              if (res.code === 0) {
+                that.$message.success("删除成功!");
+                that.getList();
+              }
+            });
+          })
+          .catch(() => {});
+      });
     },
 
     // 弹窗
     getDialog(title, id) {
-      this.dialogVisible = true
-      this.title = title
+      this.dialogVisible = true;
+      this.title = title;
       if (id) {
-        detail(id).then(res => {
-          this.dialogForm = res.data
-        })
+        detail(id).then((res) => {
+          this.dialogForm = res.data;
+        });
       }
     },
 
     // 关闭
     close() {
-      this.dialogVisible = false
-      this.dialogForm = {}
+      this.dialogVisible = false;
+      this.dialogForm = {};
     },
 
     // 确定
     getSubmit() {
       this.$refs.dialogForm.validate((valid) => {
         if (valid) {
-          submit(this.dialogForm).then(res => {
+          submit(this.dialogForm).then((res) => {
             if (res.code === 0) {
-              this.$message.success('提交成功!')
-              this.close()
-              this.getList()
+              this.$message.success("提交成功!");
+              this.close();
+              this.getList();
             }
-          })
+          });
         } else {
-          return false
+          return false;
         }
-      })
-    }
-  }
-}
+      });
+    },
+  },
+};
 </script>

+ 99 - 52
src/views/operation/map/detail.vue

@@ -1,18 +1,39 @@
 <template>
-  <div class='app-container'>
-    <el-form :model="form" ref="form" :rules="rules" label-width="100px" :disabled="disabled">
+  <div class="app-container">
+    <el-form
+      :model="form"
+      ref="form"
+      :rules="rules"
+      label-width="100px"
+      :disabled="disabled"
+    >
       <el-form-item label="门店名称:" prop="name">
         <el-input v-model="form.name" placeholder="请输入门店名称" />
       </el-form-item>
       <el-form-item label="门店图片:" prop="icon">
-        <Upload list-type="picture-card" :url="form.icon" @upload="upload" :disabled="disabled" />
+        <Upload
+          list-type="picture-card"
+          :url="form.icon"
+          @upload="upload"
+          :disabled="disabled"
+        />
       </el-form-item>
       <el-form-item label="联系电话:">
         <el-input v-model="form.linkPhone" placeholder="请输入联系电话" />
       </el-form-item>
       <el-form-item label="城市筛选:" prop="cascader">
-        <el-cascader style="width: 100%" v-model="form.cascader" :options="mapOptions" placeholder="请选择省市区"
-          :props="{ value: 'id', label: 'name', children: 'childList', checkStrictly: true }" />
+        <el-cascader
+          style="width: 100%"
+          v-model="form.cascader"
+          :options="mapOptions"
+          placeholder="请选择省市区"
+          :props="{
+            value: 'id',
+            label: 'name',
+            children: 'childList',
+            checkStrictly: true,
+          }"
+        />
       </el-form-item>
       <el-form-item label="详细地址:" prop="address">
         <el-input v-model="form.address" placeholder="请输入详细地址" />
@@ -26,100 +47,126 @@
     </el-form>
     <div class="form-btn">
       <el-button @click="cancel">取消</el-button>
-      <el-button v-if="!disabled" type="primary" @click="getSubmit">确定</el-button>
+      <el-button v-if="!disabled" type="primary" @click="getSubmit"
+        >确定</el-button
+      >
     </div>
   </div>
 </template>
 
 <script>
-import { mapMixin } from '@/mixin/index'
-import { detail, submit } from '@/api/operation/map'
+import { detail, submit } from "@/api/operation/map";
+import { mapMixin } from "@/mixin/index";
 export default {
   mixins: [mapMixin],
   data() {
     return {
       // 表单
       form: {
-        icon: '',
-        status: 0
+        icon: "",
+        status: 0,
       },
       // 校验
       rules: {
-        name: [{
-          required: true, message: '请输入门店名称', trigger: 'blur'
-        }],
-        icon: [{
-          required: true, message: '请上传门店图片', trigger: 'change'
-        }],
-        cascader: [{
-          required: true, message: '请选择省市区', trigger: 'change'
-        }],
-        address: [{
-          required: true, message: '请输入详细地址', trigger: 'blur'
-        }],
-        latitude: [{
-          required: true, message: '请输入纬度', trigger: 'blur'
-        }],
-        longitude: [{
-          required: true, message: '请输入经度', trigger: 'blur'
-        }]
+        name: [
+          {
+            required: true,
+            message: "请输入门店名称",
+            trigger: "blur",
+          },
+        ],
+        icon: [
+          {
+            required: true,
+            message: "请上传门店图片",
+            trigger: "change",
+          },
+        ],
+        cascader: [
+          {
+            required: true,
+            message: "请选择省市区",
+            trigger: "change",
+          },
+        ],
+        address: [
+          {
+            required: true,
+            message: "请输入详细地址",
+            trigger: "blur",
+          },
+        ],
+        latitude: [
+          {
+            required: true,
+            message: "请输入纬度",
+            trigger: "blur",
+          },
+        ],
+        longitude: [
+          {
+            required: true,
+            message: "请输入经度",
+            trigger: "blur",
+          },
+        ],
       },
       // 只读
-      disabled: false
-    }
+      disabled: false,
+    };
   },
   mounted() {
     if (this.$route.query.id) {
-      this.getDetail()
-      this.disabled = Boolean(this.$route.query.boolean)
+      this.getDetail();
+      this.disabled = Boolean(this.$route.query.boolean);
     }
   },
   methods: {
     // 详情
     getDetail() {
-      detail(this.$route.query.id).then(res => {
+      detail(this.$route.query.id).then((res) => {
         if (res.code === 0) {
-          this.form = res.data
-          this.$set(this.form, 'cascader', [res.data.province])
+          this.form = res.data;
+          this.$set(this.form, "cascader", [res.data.province]);
           if (res.data.city) {
-            this.form.cascader[1] = res.data.city
+            this.form.cascader[1] = res.data.city;
           }
           if (res.data.area) {
-            this.form.cascader[2] = res.data.area
+            this.form.cascader[2] = res.data.area;
           }
         }
-      })
+      });
     },
 
     // 上传
     upload(e) {
-      this.form.icon = e.file
+      this.form.icon = e.file;
     },
 
     cancel() {
-      this.$tab.closeOpenPage("/operation/map")
+      this.$tab.closeOpenPage("/operation/map");
     },
 
     // 提交
     getSubmit() {
       this.$refs.form.validate((valid) => {
         if (valid) {
-          this.form.province = this.form.cascader[0]
-          this.form.city = this.form.cascader[1] ? this.form.cascader[1] : null
-          this.form.area = this.form.cascader[2] ? this.form.cascader[2] : null
-          submit(this.form).then(res => {
+          this.form.province = this.form.cascader[0];
+          this.form.city = this.form.cascader[1] ? this.form.cascader[1] : null;
+          this.form.area = this.form.cascader[2] ? this.form.cascader[2] : null;
+          submit(this.form).then((res) => {
             if (res.code === 0) {
-              this.$message.success('提交成功!')
-              this.cancel()
+              this.$message.success("提交成功!");
+              this.cancel();
             }
-          })
+          });
         } else {
-          return false
+          return false;
         }
-      })
-    }
-  }
-}
+      });
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>

+ 146 - 71
src/views/operation/map/index.vue

@@ -1,33 +1,62 @@
+<!-- 运营管理 门店管理 -->
 <template>
-  <div class='app-container'>
+  <div class="app-container">
     <!-- 搜索 -->
     <el-form inline size="mini">
       <el-form-item label="门店名称:">
         <el-input v-model="form.name" placeholder="请输入门店名称" clearable />
       </el-form-item>
       <el-form-item label="城市筛选:">
-        <el-cascader v-model="form.list" :options="mapOptions" placeholder="请选择省市区" clearable
-          :props="{ value: 'id', label: 'name', children: 'childList', checkStrictly: true }" />
+        <el-cascader
+          v-model="form.list"
+          :options="mapOptions"
+          placeholder="请选择省市区"
+          clearable
+          :props="{
+            value: 'id',
+            label: 'name',
+            children: 'childList',
+            checkStrictly: true,
+          }"
+        />
       </el-form-item>
       <el-form-item label="当前状态:">
         <el-select v-model="form.status" placeholder="请选择当前状态" clearable>
-          <el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.value" />
+          <el-option
+            v-for="item in statusOptions"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
         </el-select>
       </el-form-item>
       <el-form-item>
-        <el-button type="primary" icon="el-icon-search" @click="getSearch">搜索</el-button>
+        <el-button type="primary" icon="el-icon-search" @click="getSearch"
+          >搜索</el-button
+        >
         <el-button icon="el-icon-refresh" @click="getRefresh">重置</el-button>
-        <el-button type="primary" icon="el-icon-plus" plain @click="getDetail()"
-          v-hasPermi="['operation:map:add']">新增</el-button>
+        <el-button
+          type="primary"
+          icon="el-icon-plus"
+          plain
+          @click="getDetail()"
+          v-hasPermi="['operation:map:add']"
+          >新增</el-button
+        >
       </el-form-item>
     </el-form>
     <!-- 列表 -->
     <el-table :data="tableData" v-loading="loading">
       <el-table-column label="序号" type="index" align="center" />
-      <el-table-column label="门店名称" prop="name" align="center" show-overflow-tooltip />
+      <el-table-column
+        label="门店名称"
+        prop="name"
+        align="center"
+        show-overflow-tooltip
+      />
       <el-table-column label="联系电话" prop="linkPhone" align="center">
         <template slot-scope="scope">
-          {{ scope.row.linkPhone ? scope.row.linkPhone : '暂无联系电话' }}
+          {{ scope.row.linkPhone ? scope.row.linkPhone : "暂无联系电话" }}
         </template>
       </el-table-column>
       <el-table-column label="门店图片" align="center" width="100px">
@@ -36,31 +65,69 @@
         </template>
       </el-table-column>
       <el-table-column label="地区" align="center" :formatter="areaFormatter" />
-      <el-table-column label="详细地址" prop="address" align="center" show-overflow-tooltip />
-      <el-table-column label="当前状态" prop="status" align="center" :formatter="statusFormatter" />
+      <el-table-column
+        label="详细地址"
+        prop="address"
+        align="center"
+        show-overflow-tooltip
+      />
+      <el-table-column
+        label="当前状态"
+        prop="status"
+        align="center"
+        :formatter="statusFormatter"
+      />
       <el-table-column label="创建时间" prop="createTime" align="center" />
       <el-table-column label="操作" align="center">
         <template slot-scope="scope">
-          <el-button type="text" @click="getDetail(scope.row.id, true)">查看</el-button>
-          <el-button v-if="scope.row.status === 0" type="text" @click="getChange(scope.row.id, 1, '禁用')"
-            v-hasPermi="['operation:map:down']">禁用</el-button>
-          <span v-else style="margin-left: 10px;">
-            <el-button type="text" @click="getDetail(scope.row.id)" v-hasPermi="['operation:map:edit']">编辑</el-button>
-            <el-button type="text" @click="getChange(scope.row.id, 0, '启用')"
-              v-hasPermi="['operation:map:up']">启用</el-button>
-            <el-button type="delete" @click="getDelete(scope.row)" v-hasPermi="['operation:map:delete']">删除</el-button>
+          <el-button type="text" @click="getDetail(scope.row.id, true)"
+            >查看</el-button
+          >
+          <el-button
+            v-if="scope.row.status === 0"
+            type="text"
+            @click="getChange(scope.row.id, 1, '禁用')"
+            v-hasPermi="['operation:map:down']"
+            >禁用</el-button
+          >
+          <span v-else style="margin-left: 10px">
+            <el-button
+              type="text"
+              @click="getDetail(scope.row.id)"
+              v-hasPermi="['operation:map:edit']"
+              >编辑</el-button
+            >
+            <el-button
+              type="text"
+              @click="getChange(scope.row.id, 0, '启用')"
+              v-hasPermi="['operation:map:up']"
+              >启用</el-button
+            >
+            <el-button
+              type="delete"
+              @click="getDelete(scope.row)"
+              v-hasPermi="['operation:map:delete']"
+              >删除</el-button
+            >
           </span>
         </template>
       </el-table-column>
     </el-table>
-    <pagination v-show="total > 0" :total="total" :page.sync="form.pageNum" :limit.sync="form.pageSize"
-      @pagination="getList" />
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="form.pageNum"
+      :limit.sync="form.pageSize"
+      @pagination="getList"
+    />
   </div>
 </template>
 
+
 <script>
-import { mapMixin } from '@/mixin/index'
-import { list, change, remove } from '@/api/operation/map'
+import { change, list, remove } from "@/api/operation/map";
+import { mapMixin } from "@/mixin/index";
+import { dialogCallBack } from "@/utils/DialogUtil";
 export default {
   mixins: [mapMixin],
   data() {
@@ -71,58 +138,61 @@ export default {
       form: {
         pageNum: 1,
         pageSize: 10,
-        list: []
+        list: [],
       },
       // 总数据
       total: 0,
       // 列表
       tableData: [],
       // 当前状态
-      statusOptions: [{
-        value: 0,
-        label: '启用'
-      }, {
-        value: 1,
-        label: '禁用'
-      }]
-    }
+      statusOptions: [
+        {
+          value: 0,
+          label: "启用",
+        },
+        {
+          value: 1,
+          label: "禁用",
+        },
+      ],
+    };
   },
   watch: {
-    'form.list'(val) {
-      this.form.province = val[0]
-      this.form.city = val[1]
-      this.form.area = val[2]
-    }
+    "form.list"(val) {
+      this.form.province = val[0];
+      this.form.city = val[1];
+      this.form.area = val[2];
+    },
   },
   mounted() {
-    this.getList()
+    this.getList();
   },
   methods: {
     // 列表
     getList() {
-      this.loading = true
-      list(this.form).then(res => {
+      this.loading = true;
+      list(this.form).then((res) => {
         if (res.code === 0) {
-          this.tableData = res.data.records
-          this.total = res.data.total
-          this.loading = false
+          this.tableData = res.data.records;
+          this.total = res.data.total;
+          this.loading = false;
         }
-      })
+      });
     },
 
     // 搜索
     getSearch() {
-      this.form.pageNum = 1
-      this.getList()
+      this.form.pageNum = 1;
+      this.getList();
     },
 
     // 重置
     getRefresh() {
       this.form = {
         pageNum: 1,
-        pageSize: 10
-      }
-      this.getList()
+        pageSize: 10,
+      };
+      this.getList();
     },
 
     // 新增、 编辑、 查看
@@ -131,39 +201,44 @@ export default {
         path: `/operation/map/detail`,
         query: {
           id: id,
-          boolean: boolean
-        }
-      })
+          boolean: boolean,
+        },
+      });
     },
 
     // 启用 禁用
     getChange(id, status, title) {
-      change(id, status).then(res => {
+      change(id, status).then((res) => {
         if (res.code === 0) {
-          this.$message.success(`${title}成功!`)
-          this.getList()
+          this.$message.success(`${title}成功!`);
+          this.getList();
         }
-      })
+      });
     },
 
     // 删除
     getDelete(row) {
-      this.$confirm(`是否删除${row.name}?`, '提示', {
-        type: 'warning'
-      }).then(() => {
-        remove(row.id).then(res => {
-          if (res.code === 0) {
-            this.$message.success('删除成功!')
-            this.getList()
-          }
-        })
-      })
+      var that = this;
+      dialogCallBack(that, function () {
+        that
+          .$confirm(`是否有删除${row.name}?`, "提示", {
+            type: "warning",
+          })
+          .then(() => {
+            remove(row.id).then((res) => {
+              if (res.code === 0) {
+                that.$message.success("删除成功!");
+                that.getList();
+              }
+            });
+          });
+      });
     },
 
     // 字典翻译
     statusFormatter(row) {
-      return this.selectDictLabel(this.statusOptions, row.status)
-    }
-  }
-}
-</script>
+      return this.selectDictLabel(this.statusOptions, row.status);
+    },
+  },
+};
+</script>