店铺管理

This commit is contained in:
墨大叔 2024-04-28 13:39:46 +08:00
parent 8d05fceead
commit 3c93e43fff
11 changed files with 801 additions and 99 deletions

View File

@ -42,6 +42,7 @@
"clipboard": "2.0.8", "clipboard": "2.0.8",
"core-js": "3.25.3", "core-js": "3.25.3",
"echarts": "5.4.0", "echarts": "5.4.0",
"element-china-area-data": "^6.1.0",
"element-ui": "2.15.14", "element-ui": "2.15.14",
"file-saver": "2.0.5", "file-saver": "2.0.5",
"fuse.js": "6.4.3", "fuse.js": "6.4.3",

44
src/api/ss/mchApply.js Normal file
View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询商家合作申请列表
export function listMchApply(query) {
return request({
url: '/ss/mchApply/list',
method: 'get',
params: query
})
}
// 查询商家合作申请详细
export function getMchApply(applyId) {
return request({
url: '/ss/mchApply/' + applyId,
method: 'get'
})
}
// 新增商家合作申请
export function addMchApply(data) {
return request({
url: '/ss/mchApply',
method: 'post',
data: data
})
}
// 修改商家合作申请
export function updateMchApply(data) {
return request({
url: '/ss/mchApply',
method: 'put',
data: data
})
}
// 删除商家合作申请
export function delMchApply(applyId) {
return request({
url: '/ss/mchApply/' + applyId,
method: 'delete'
})
}

View File

@ -0,0 +1,107 @@
<template>
<el-cascader
style="width: 100%"
:options="pcaTextArr"
v-model="selectOptions"
@change="onChange"
:props="{ checkStrictly: checkStrictly }"
/>
</template>
<script>
import {pcaTextArr} from "element-china-area-data";
export default {
name: "AreaTextSelect",
props: {
//
province: {
type: String,
default: null,
},
//
city: {
type: String,
default: null,
},
//
county: {
type: String,
default: null,
},
//
checkStrictly: {
type: Boolean,
default: false
},
// 0
level: {
type: Number,
default: 2,
}
},
data() {
return {
pcaTextArr: []
}
},
computed: {
selectOptions: {
set(val) {
this.$emit('update:province', val.length > 0 ? val[0] : null);
this.$emit('update:city', val.length > 1 ? val[1] : null);
this.$emit('update:county', val.length > 2 ? val[2] : null);
},
get() {
let list = [];
if (this.province != null) {
list.push(this.province);
}
if (this.city != null) {
list.push(this.city);
}
if (this.county != null) {
list.push(this.county);
}
return list;
}
},
},
created() {
this.filterAreaByLevel(pcaTextArr, this.level);
},
methods: {
filterAreaByDepth(areaList, targetDepth, currentDepth = 0, maxDepth = targetDepth + 1) {
return areaList.reduce((filteredAreas, area) => {
const depth = currentDepth + 1;
if (depth <= maxDepth) {
filteredAreas.push(area); //
if (depth < maxDepth && Array.isArray(area.children) && area.children.length > 0) {
//
area.children = this.filterAreaByDepth(area.children, targetDepth, depth, maxDepth);
} else {
// children
delete area.children;
}
}
return filteredAreas;
}, []);
},
// :children
// arealevel
filterAreaByLevel(area, level) {
this.pcaTextArr = this.filterAreaByDepth(area, level);
},
onChange(val) {
this.$emit('change', val);
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,27 @@
<template>
<el-col :span="span">
<el-form-item :label="label" :prop="prop">
<slot></slot>
</el-form-item>
</el-col>
</template>
<script>
export default {
name: 'FormCol',
props: {
span: {
type: Number,
default: 24
},
label: {
type: String,
default: null
},
prop: {
type: String,
default: null
}
}
}
</script>

View File

@ -1,9 +1,22 @@
<template> <template>
<el-dialog :title="title" :visible="show" width="60%" top="2vh" @close="close" :append-to-body="true"> <el-dialog :title="title" :visible="show" width="70%" top="2vh" @close="close" :append-to-body="true">
<place-search-map height="500px" @select-changed="onSelectChange"/> <el-row v-if="selected != null" style="margin-bottom: 0.5em">
当前选择 {{selected.address}}, {{selected.lng}}, {{selected.lat}}
</el-row>
<place-search-map
v-if="show"
ref="map"
height="800px"
@select-changed="onSelectChange"
@map-geo="onMapGeo"
:init-lat="initLat"
:init-lng="initLng"
/>
<template #footer> <template #footer>
<el-button @click="onCancel()">取消</el-button>
<el-button type="primary" @click="onSubmit()">确定</el-button> <el-button type="primary" @click="onSubmit()">确定</el-button>
<el-button @click="onCancel()">取消</el-button>
</template> </template>
</el-dialog> </el-dialog>
</template> </template>
@ -23,16 +36,44 @@ export default {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
initLng: {
type: Number,
default: 120.250452
},
initLat: {
type: Number,
default: 27.101745
},
}, },
data() { data() {
return { return {
keyword: null,
selected: null, selected: null,
} }
}, },
methods: { methods: {
onSelectChange(data) { onMapGeo(data, lat, lng) {
console.log(data); console.log("onMapGeo", data)
let component = data.regeocode.addressComponent;
this.selected = {
address: data.regeocode.formattedAddress,
lng: lat,
lat: lng,
province: component.province,
city: component.city === '' ? '市辖区' : component.city,
county: component.district,
}
},
onSelectChange(addr) {
console.log("onSelectChange", addr)
let data = addr.selected.data;
this.selected = {
address: data.pname + (data.cityname === data.pname ? '' : data.cityname) + data.adname + data.address + data.name,
lng: data.location.lng,
lat: data.location.lat,
province: data.pname,
city: data.cityname === data.pname ? '市辖区' : data.cityname,
county: data.adname,
}
}, },
// //
onSubmit() { onSubmit() {
@ -45,6 +86,7 @@ export default {
}, },
// //
close() { close() {
this.selected = null;
this.$emit('update:show', false); this.$emit('update:show', false);
}, },
} }

View File

@ -1,11 +1,22 @@
<template> <template>
<div :style="{width: width, height: height}" v-loading="loading"> <div class="place-search-map" :style="{width: width, height: height}" v-loading="loading">
<el-form label-width="5em">
<el-form-item label="地址搜索">
<el-input v-model="keyword" placeholder="请输入地址关键词" @input="onInputSearch" />
</el-form-item>
</el-form>
<div id="container"></div> <div id="container"></div>
<el-row class="search-row" :gutter="8" type="flex">
<el-col :span="6">
<area-text-select
:level="1"
:province.sync="area.province"
:city.sync="area.city"
@change="onChangeArea"/>
</el-col>
<el-col :span="10">
<el-input v-model="keyword" placeholder="请输入地址关键词" />
</el-col>
<el-col>
<el-button type="primary" icon="el-icon-search" @click="doPlaceSearch(keyword)">搜索</el-button>
<el-button @click="doSearchNearByCenter(keyword)" >周边搜索</el-button>
</el-col>
</el-row>
<div id="panel"></div> <div id="panel"></div>
</div> </div>
</template> </template>
@ -13,9 +24,11 @@
import AMapLoader from "@amap/amap-jsapi-loader"; import AMapLoader from "@amap/amap-jsapi-loader";
import globalConfig from '@/utils/config/globalConfig' import globalConfig from '@/utils/config/globalConfig'
import { debounce } from '@/utils' import { debounce } from '@/utils'
import AreaTextSelect from '@/components/AreaTextSelect/index.vue'
export default { export default {
name: "PlaceSearchMap", name: "PlaceSearchMap",
components: { AreaTextSelect },
props: { props: {
width: { width: {
type: String, type: String,
@ -25,6 +38,14 @@ export default {
type: String, type: String,
default: "100%" default: "100%"
}, },
initLng: {
type: Number,
default: 120.250452
},
initLat: {
type: Number,
default: 27.101745
},
}, },
data() { data() {
return { return {
@ -33,27 +54,34 @@ export default {
placeSearch: null, // POI placeSearch: null, // POI
geocoder: null, // geocoder: null, //
loading: false, loading: false,
lng: null,
lat: null,
keyword: null, keyword: null,
//
result: {
lat: null,
lng: null,
address: null,
},
markers: [], markers: [],
area: {
province: '福建省',
city: '宁德市',
}
} }
}, },
mounted() { mounted() {
this.initAMap(); this.initAMap();
}, },
unmounted() { beforeDestroy() {
this.map?.destroy(); this.destroyMap();
}, },
methods: { methods: {
destroyMap() {
this.map?.destroy();
},
onChangeArea() {
this.loadPlaceSearch(this.area.province, this.area.city);
if (this.keyword != null) {
this.doPlaceSearch(this.keyword);
} else {
let city = this.area.city === '市辖区' ? this.area.province : this.area.city;
this.doPlaceSearch(city);
}
},
initAMap() { initAMap() {
let _this = this;
AMapLoader.load({ AMapLoader.load({
key: globalConfig.aMap.key, // WebKey load key: globalConfig.aMap.key, // WebKey load
version: "2.0", // JSAPI 1.4.15 version: "2.0", // JSAPI 1.4.15
@ -63,21 +91,44 @@ export default {
this.map = new AMap.Map("container", { this.map = new AMap.Map("container", {
// id // id
viewMode: "3D", // 3D viewMode: "3D", // 3D
zoom: 11, // zoom: 16, //
center: [120.250452, 27.101745], // center: [this.initLng == null ? 120.250452 : this.initLng, this.initLat == null ? 27.101745 : this.initLat], //
}); });
this.map.on('click', this.onClickMap); this.map.on('click', this.onClickMap);
// POI // POI
this.loadPlaceSearch(); this.loadPlaceSearch(this.area.province, this.area.city);
if (this.keyword != null) {
this.doPlaceSearch(this.keyword);
}
// //
this.loadGeoCoder(); this.loadGeoCoder();
//
this.initMarker();
}).catch((e) => { }).catch((e) => {
console.log(e); console.log(e);
}); });
}, },
async initMarker() {
this.removeAllMarker();
if (this.initLng != null && this.initLat != null) {
this.getGeoAddress(this.initLng, this.initLat).then(res => {
//
this.removeAllMarker();
this.addMarker(this.initLng, this.initLat, res.regeocode.formattedAddress);
this.$emit('map-geo', res, this.initLng, this.initLat);
//
let component = res.regeocode.addressComponent;
this.area = {
province: component.province,
city: component.city === '' ? '市辖区' : component.city,
}
}).finally(() => {
this.loading = false;
})
}
},
addMarker(lng, lat, title) { addMarker(lng, lat, title) {
// Marker // Marker
let marker = new AMap.Marker({ let marker = new AMap.Marker({
@ -88,6 +139,7 @@ export default {
this.map.add(marker); this.map.add(marker);
this.markers.push(marker); this.markers.push(marker);
}, },
//
removeAllMarker() { removeAllMarker() {
this.map.remove(this.markers); this.map.remove(this.markers);
this.markers = []; this.markers = [];
@ -95,22 +147,26 @@ export default {
// //
onClickMap(e) { onClickMap(e) {
console.log('clickMap', e); console.log('clickMap', e);
this.lng = e.lnglat.lng; let lng = e.lnglat.lng;
this.lat = e.lnglat.lat; let lat = e.lnglat.lat;
this.getGeoAddress(this.lng, this.lat).then(res => { this.changeMarker(lng, lat);
},
//
changeMarker(lng, lat) {
this.loading = true;
this.getGeoAddress(lng, lat).then(res => {
this.removeAllMarker(); this.removeAllMarker();
this.result.address = res.regeocode.formattedAddress; this.addMarker(lng, lat, res.regeocode.formattedAddress);
this.result.lng = this.lng; this.$emit('map-geo', res, lng, lat);
this.result.lat = this.lat; }).finally(() => {
this.addMarker(this.lng, this.lat, this.result.address); this.loading = false;
}) })
}, },
//
getGeoAddress(lng, lat) { getGeoAddress(lng, lat) {
return new Promise((resolve, reject) =>{ return new Promise((resolve, reject) =>{
this.geocoder.getAddress([lng, lat], (status, result) => { this.geocoder.getAddress([lng, lat], (status, result) => {
console.log("geoCode", status, result);
if (status === 'complete' && result.info === 'OK') { if (status === 'complete' && result.info === 'OK') {
// result
resolve(result); resolve(result);
} else { } else {
reject(status); reject(status);
@ -127,14 +183,20 @@ export default {
}) })
}, },
// POI // POI
loadPlaceSearch() { loadPlaceSearch(province, city) {
if (city == null) {
city = '北京市';
}
if (city === '市辖区') {
city = province;
}
AMap.plugin(["AMap.PlaceSearch"], () => { AMap.plugin(["AMap.PlaceSearch"], () => {
// //
this.placeSearch = new AMap.PlaceSearch({ this.placeSearch = new AMap.PlaceSearch({
pageSize: 5, // pageSize: 5, //
pageIndex: 1, // pageIndex: 1, //
city: "010", // city: city, //
citylimit: false, // citylimit: true, //
map: this.map, // map: this.map, //
panel: "panel", // panel: "panel", //
autoFitView: true, // 使 Marker autoFitView: true, // 使 Marker
@ -145,21 +207,33 @@ export default {
this.$emit('select-changed', data); this.$emit('select-changed', data);
}) })
}, },
//
doSearchNearBy(keyword, lng, lat) {
console.log('searchNearBy', keyword, lng, lat)
this.placeSearch.searchNearBy(keyword, [lng, lat], 200, (status, result) => {
console.log("POI", status, result);
});
},
// //
doPlaceSearch(keyword) { doPlaceSearch(keyword) {
if (keyword == null) {
return this.$message.warning("请输入关键词");
}
this.loading = true; this.loading = true;
this.placeSearch.search(keyword, (status, result) => { this.placeSearch.search(keyword, (status, result) => {
this.loading = false; this.loading = false;
console.log("POI", status, result); console.log("POI", status, result);
}); });
}, },
//
doSearchNearBy(keyword, lng, lat, radius = 200) {
if (keyword == null) {
return this.$message.warning("请输入关键词");
}
this.loading = true;
this.placeSearch.searchNearBy(keyword, [lng, lat], radius, (status, result) => {
this.loading = false;
console.log("POI NearBy", status, result);
})
},
//
doSearchNearByCenter(keyword) {
let center = this.map.getCenter();
this.doSearchNearBy(keyword, center.lng, center.lat, 1000);
},
// //
onInputSearch: debounce(function () { onInputSearch: debounce(function () {
this.doPlaceSearch(this.keyword) this.doPlaceSearch(this.keyword)
@ -167,19 +241,29 @@ export default {
}, },
}; };
</script> </script>
<style scoped> <style scoped lang="scss">
#container { .place-search-map {
width: 100%; position: relative;
height: 100%; overflow: hidden;
}
#panel { .search-row {
position: absolute; margin: 0.5em;
background-color: white; }
max-height: 90%; #container {
overflow-y: auto; position: absolute;
top: 10px; left: 0;
right: 10px; top: 0;
width: 280px; width: 100%;
height: 100%;
}
#panel {
position: absolute;
background-color: white;
max-height: 90%;
overflow-y: auto;
top: 10px;
right: 10px;
width: 280px;
}
} }
</style> </style>

View File

@ -37,6 +37,8 @@ import DictTag from '@/components/DictTag'
import VueMeta from 'vue-meta' import VueMeta from 'vue-meta'
// 字典数据组件 // 字典数据组件
import DictData from '@/components/DictData' import DictData from '@/components/DictData'
// 行内表单组件
import FormCol from '@/components/FormCol/index.vue'
// 过滤器 // 过滤器
import filter from "@/utils/filter"; import filter from "@/utils/filter";
filter(Vue); filter(Vue);
@ -61,6 +63,7 @@ Vue.component('Editor', Editor)
Vue.component('FileUpload', FileUpload) Vue.component('FileUpload', FileUpload)
Vue.component('ImageUpload', ImageUpload) Vue.component('ImageUpload', ImageUpload)
Vue.component('ImagePreview', ImagePreview) Vue.component('ImagePreview', ImagePreview)
Vue.component('FormCol', FormCol)
Vue.use(directive) Vue.use(directive)
Vue.use(plugins) Vue.use(plugins)

View File

@ -2,12 +2,12 @@ export default {
/** /**
* 高德地图配置 * 高德地图配置
*/ */
// aMap: {
// key: '11da89fddf9340d0a69d4fff53c0ec4b',
// secret: '32dca5ef246f3b96234cd8ef891e4d59'
// }
aMap: { aMap: {
key: "8cd2f6263fa49537ab9e9fbec328f1c4", key: '11da89fddf9340d0a69d4fff53c0ec4b',
secret: "4bb470e4c380afc28218fa36cdd43ab0", secret: '32dca5ef246f3b96234cd8ef891e4d59'
} }
// aMap: {
// key: "8cd2f6263fa49537ab9e9fbec328f1c4",
// secret: "4bb470e4c380afc28218fa36cdd43ab0",
// }
} }

View File

@ -0,0 +1,319 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="用户名称" prop="userId">
<el-input
v-model="queryParams.userName"
placeholder="请输入用户名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="姓名" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入姓名"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="手机号" prop="mobile">
<el-input
v-model="queryParams.mobile"
placeholder="请输入手机号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="审核人" prop="verifyBy">
<el-input
v-model="queryParams.verifyBy"
placeholder="请输入审核人"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['ss:mchApply:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['ss:mchApply:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="mchApplyList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="ID" align="center" prop="applyId" width="50"/>
<el-table-column label="用户名称" align="center" prop="userName" />
<el-table-column label="申请状态" align="center" prop="status">
<dict-tag slot-scope="d" :value="d.row.status" :options="dict.type.ss_mch_apply_status"/>
</el-table-column>
<el-table-column label="姓名" align="center" prop="name" />
<el-table-column label="手机号" align="center" prop="mobile" />
<el-table-column label="详细信息" align="center" prop="content" show-overflow-tooltip/>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="审核人" align="center" prop="verifyName" />
<el-table-column label="审核时间" align="center" prop="verifyTime" width="180"/>
<el-table-column label="审核备注" align="center" prop="verifyRemark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['ss:mchApply:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改商家合作申请对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="用户id" prop="userId">
<el-input v-model="form.userId" placeholder="请输入用户id" />
</el-form-item>
<el-form-item label="姓名" prop="name">
<el-input v-model="form.name" placeholder="请输入姓名" />
</el-form-item>
<el-form-item label="手机号" prop="mobile">
<el-input v-model="form.mobile" placeholder="请输入手机号" />
</el-form-item>
<el-form-item label="详细信息">
<editor v-model="form.content" :min-height="192"/>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
<el-form-item label="反馈信息" prop="callback">
<el-input v-model="form.callback" placeholder="请输入反馈信息" />
</el-form-item>
<el-form-item label="审核人id" prop="verifyBy">
<el-input v-model="form.verifyBy" placeholder="请输入审核人id" />
</el-form-item>
<el-form-item label="审核时间" prop="verifyTime">
<el-date-picker clearable
v-model="form.verifyTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择审核时间">
</el-date-picker>
</el-form-item>
<el-form-item label="审核备注" prop="verifyRemark">
<el-input v-model="form.verifyRemark" placeholder="请输入审核备注" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listMchApply, getMchApply, delMchApply, addMchApply, updateMchApply } from "@/api/ss/mchApply";
export default {
name: "MchApply",
dicts: ['ss_mch_apply_status'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
mchApplyList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
userId: null,
status: null,
name: null,
mobile: null,
content: null,
callback: null,
verifyBy: null,
verifyTime: null,
verifyRemark: null,
},
//
form: {},
//
rules: {
userId: [
{ required: true, message: "用户id不能为空", trigger: "blur" }
],
status: [
{ required: true, message: "申请状态不能为空", trigger: "change" }
],
name: [
{ required: true, message: "姓名不能为空", trigger: "blur" }
],
mobile: [
{ required: true, message: "手机号不能为空", trigger: "blur" }
],
content: [
{ required: true, message: "详细信息不能为空", trigger: "blur" }
],
createTime: [
{ required: true, message: "创建时间不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询商家合作申请列表 */
getList() {
this.loading = true;
listMchApply(this.queryParams).then(response => {
this.mchApplyList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
applyId: null,
userId: null,
status: null,
name: null,
mobile: null,
content: null,
remark: null,
callback: null,
verifyBy: null,
verifyTime: null,
verifyRemark: null,
createTime: null,
updateTime: null,
deleted: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.applyId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加商家合作申请";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const applyId = row.applyId || this.ids
getMchApply(applyId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改商家合作申请";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.applyId != null) {
updateMchApply(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addMchApply(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const applyIds = row.applyId || this.ids;
this.$modal.confirm('是否确认删除商家合作申请编号为"' + applyIds + '"的数据项?').then(function() {
return delMchApply(applyIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('ss/mchApply/export', {
...this.queryParams
}, `mchApply_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@ -17,14 +17,6 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="门店地址" prop="address">
<el-input
v-model="queryParams.address"
placeholder="请输入门店地址"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@ -79,14 +71,24 @@
<el-table v-loading="loading" :data="storeList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="storeList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="店铺id" align="center" prop="storeId" /> <el-table-column label="ID" align="center" prop="storeId" width="50"/>
<el-table-column label="用户名称" align="center" prop="userName" /> <el-table-column label="绑定用户" align="center" prop="userName" />
<el-table-column label="商户图片" align="center" prop="picture" width="100"> <el-table-column label="商户图片" align="center" prop="picture" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<image-preview :src="scope.row.picture" :width="50" :height="50"/> <image-preview :src="scope.row.picture" :width="50" :height="50"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="店铺名称" align="center" prop="name" /> <el-table-column label="店铺名称" align="center" prop="name" />
<el-table-column label="店铺类型" align="center" prop="type" width="100">
<template slot-scope="scope">
<dict-tag :value="scope.row.type" :options="dict.type.ss_store_type"/>
</template>
</el-table-column>
<el-table-column label="营业时间" align="center" min-width="100">
<template slot-scope="d">
{{d.row.businessTimeStart}} {{d.row.businessTimeEnd}}
</template>
</el-table-column>
<el-table-column label="门店地址" align="center" prop="address" /> <el-table-column label="门店地址" align="center" prop="address" />
<el-table-column label="创建时间" align="center" prop="createTime" /> <el-table-column label="创建时间" align="center" prop="createTime" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
@ -118,20 +120,49 @@
/> />
<!-- 添加或修改商户列表对话框 --> <!-- 添加或修改商户列表对话框 -->
<el-dialog :title="title" :visible.sync="open" width="60%" append-to-body> <el-dialog :title="title" :visible.sync="open" width="50%" append-to-body :close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="用户" prop="userId"> <el-row :gutter="8">
<user-input v-model="form.userId" /> <form-col label="绑定用户" prop="userId" :span="span * 2">
</el-form-item> <user-input v-model="form.userId" />
<el-form-item label="商户图片" prop="picture"> </form-col>
<image-upload v-model="form.picture"/> <form-col label="店铺图片" prop="picture" :span="span * 2">
</el-form-item> <image-upload v-model="form.picture"/>
<el-form-item label="店铺名称" prop="name"> </form-col>
<el-input v-model="form.name" placeholder="请输入店铺名称" /> <form-col label="店铺名称" prop="name" :span="span * 2">
</el-form-item> <el-input v-model="form.name" placeholder="请输入店铺名称" />
<el-form-item label="门店地址" prop="address"> </form-col>
<el-input v-model="form.address" placeholder="请输入门店地址" @focus="showPlaceSearchMap = true"/> <form-col label="店铺类型" prop="type" :span="span">
</el-form-item> <el-select v-model="form.type" placeholder="请选择店铺类型" style="width: 100%">
<el-option
v-for="opt of dict.type.ss_store_type"
:label="opt.label"
:key="opt.value"
:value="opt.value"
/>
</el-select>
</form-col>
<form-col label="营业时间" prop="businessTimeStart" :span="span">
<el-time-picker
is-range
v-model="formatBusinessTime"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
format="HH:mm"
value-format="HH:mm"
:clearable="false"
style="width: 100%"
placeholder="请选择营业时间范围">
</el-time-picker>
</form-col>
<form-col label="定位" prop="address" :span="span * 2">
<el-input :value="form.address" placeholder="请选择店铺地址" @focus="showPlaceSearchMap = true"/>
</form-col>
<form-col label="详细地址" prop="specificAddress" :span="span * 2">
<el-input v-model="form.specificAddress" placeholder="请输入详细地址"/>
</form-col>
</el-row>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm"> </el-button>
@ -139,7 +170,12 @@
</div> </div>
</el-dialog> </el-dialog>
<place-search-dialog :show.sync="showPlaceSearchMap" :keyword.sync="form.address" /> <place-search-dialog
:show.sync="showPlaceSearchMap"
:init-lat="form.lat"
:init-lng="form.lng"
@submit="onSubmitAddress"
/>
</div> </div>
</template> </template>
@ -148,10 +184,13 @@ import { listStore, getStore, delStore, addStore, updateStore } from "@/api/ss/s
import SmUserSelect from '@/components/Business/SmUser/smUserSelect.vue' import SmUserSelect from '@/components/Business/SmUser/smUserSelect.vue'
import UserInput from '@/components/Business/SmUser/UserInput.vue' import UserInput from '@/components/Business/SmUser/UserInput.vue'
import PlaceSearchDialog from '@/components/Map/PlaceSearch/PlaceSearchDialog.vue' import PlaceSearchDialog from '@/components/Map/PlaceSearch/PlaceSearchDialog.vue'
import AreaTextSelect from '@/components/AreaTextSelect/index.vue'
import { parseTime } from '../../../utils/ruoyi'
export default { export default {
name: "Store", name: "Store",
components: { PlaceSearchDialog, UserInput, SmUserSelect }, dicts: ['ss_store_type'],
components: { AreaTextSelect, PlaceSearchDialog, UserInput, SmUserSelect },
data() { data() {
return { return {
// //
@ -190,19 +229,49 @@ export default {
{ required: true, message: "用户不能为空", trigger: "change" } { required: true, message: "用户不能为空", trigger: "change" }
], ],
name: [ name: [
{ required: true, message: "店铺名称不能为空", trigger: "blur" } { required: true, message: "店铺名称不能为空", trigger: "change" }
], ],
address: [ address: [
{ required: true, message: "门店地址不能为空", trigger: "blur" } { required: true, message: "详细地址不能为空", trigger: "change" }
],
type: [
{ required: true, message: "详细地址不能为空", trigger: "change" }
],
businessTimeStart: [
{ required: true, message: "营业时间不允许为空", trigger: "change" }
], ],
}, },
showPlaceSearchMap: false, showPlaceSearchMap: false,
span: 12,
}; };
}, },
computed: {
formatBusinessTime: {
set(val) {
this.form.businessTimeStart = val[0];
this.form.businessTimeEnd = val[1];
},
get() {
if (this.form.businessTimeStart == null || this.form.businessTimeEnd == null) {
return null;
}
return [this.form.businessTimeStart, this.form.businessTimeEnd]
}
}
},
created() { created() {
this.getList(); this.getList();
}, },
methods: { methods: {
parseTime,
onSubmitAddress(addr) {
this.form.address = addr.address;
this.form.lat = addr.lat;
this.form.lng = addr.lng;
this.form.province = addr.province;
this.form.city = addr.city;
this.form.county = addr.county;
},
/** 查询商户列表列表 */ /** 查询商户列表列表 */
getList() { getList() {
this.loading = true; this.loading = true;
@ -225,7 +294,13 @@ export default {
picture: null, picture: null,
name: null, name: null,
address: null, address: null,
lon: null, specificAddress: null,
businessTimeStart: "08:00",
businessTimeEnd: "18:00",
province: null,
city: null,
county: null,
lng: null,
lat: null, lat: null,
createTime: null, createTime: null,
createBy: null, createBy: null,

View File

@ -1,10 +1,10 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="分组名称" prop="groupName"> <el-form-item label="店铺名称" prop="storeName">
<el-input <el-input
v-model="queryParams.groupName" v-model="queryParams.storeName"
placeholder="请输入分组名称" placeholder="请输入店铺名称"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
@ -329,7 +329,7 @@ export default {
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
groupName: null, storeName: null,
deviceName: null, deviceName: null,
model: null, model: null,
mac: null, mac: null,