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