|
@@ -2,17 +2,17 @@
|
|
|
<div class="shopAdd">
|
|
|
<el-dialog width="600px" :title="title" destroy-on-close center :visible.sync="showVisible">
|
|
|
<el-form :model="form">
|
|
|
- <el-form-item label="门店名称" label-width="103px">
|
|
|
- <el-input v-model="form.name" placeholder="请输入店铺名称" autocomplete="off" style="width: 100%"></el-input>
|
|
|
+ <el-form-item label="商家名称" label-width="103px">
|
|
|
+ <el-input v-model="form.merchantName" placeholder="请输入店铺名称" autocomplete="off" style="width: 100%"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="主营类别" label-width="103px">
|
|
|
+ <el-form-item label="主营业务" label-width="103px">
|
|
|
<div class="category_box">
|
|
|
<div class="item" :class="form.categoryId == item.id ? 'active':''" v-for="(item,i) in products" :key="i" @click="$set(form,'categoryId',item.id)">
|
|
|
{{item.name}}
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="详细地址" label-width="103px">
|
|
|
+ <el-form-item label="商家地址" label-width="103px">
|
|
|
<el-input v-model="form.address" placeholder="请点击地图选择具体地址" disabled autocomplete="off" style="width: 100%">
|
|
|
<el-image @click="showMap" slot="append" class="map" src="../../../static/image/icon_map.png"></el-image>
|
|
|
</el-input>
|
|
@@ -40,6 +40,7 @@
|
|
|
<script>
|
|
|
import orderMap from "../components/orderComponents/orderAMap.vue";
|
|
|
import { merchantAdd, merchantDetail, merchantModify } from "../api/user.js";
|
|
|
+import bus from "../common/bus.js";
|
|
|
export default {
|
|
|
props: {
|
|
|
products: {
|
|
@@ -63,7 +64,7 @@ export default {
|
|
|
lat: "",
|
|
|
lng: "",
|
|
|
mobile: "",
|
|
|
- name: "",
|
|
|
+ merchantName: "",
|
|
|
street: "",
|
|
|
categoryId: "",
|
|
|
},
|
|
@@ -122,7 +123,7 @@ export default {
|
|
|
this.form.lat = lat;
|
|
|
},
|
|
|
save() {
|
|
|
- if (!this.form.name.trim()) {
|
|
|
+ if (!this.form.merchantName.trim()) {
|
|
|
return this.$message({
|
|
|
type: "error",
|
|
|
message: "请输入门店名称!",
|
|
@@ -164,9 +165,16 @@ export default {
|
|
|
if (res.code === 200) {
|
|
|
this.$message({
|
|
|
type: "success",
|
|
|
- message: `保存成功!`,
|
|
|
+ message: `已经修改成功,即将跳出重新登录!`,
|
|
|
});
|
|
|
- this.$emit("getData");
|
|
|
+
|
|
|
+ setTimeout(() => {
|
|
|
+ localStorage.clear();
|
|
|
+ bus.$emit("closeGetSoundMsg");
|
|
|
+ this.$router.push({
|
|
|
+ path: "/login",
|
|
|
+ });
|
|
|
+ }, 2000);
|
|
|
} else {
|
|
|
this.$message({
|
|
|
type: "error",
|
|
@@ -181,16 +189,22 @@ export default {
|
|
|
if (res.code === 200) {
|
|
|
this.$message({
|
|
|
type: "success",
|
|
|
- message: `新增成功!`,
|
|
|
+ message: `已经成为商家,即将跳出重新登录`,
|
|
|
});
|
|
|
- this.$emit("getData");
|
|
|
+
|
|
|
+ setTimeout(() => {
|
|
|
+ localStorage.clear();
|
|
|
+ bus.$emit("closeGetSoundMsg");
|
|
|
+ this.$router.push({
|
|
|
+ path: "/login",
|
|
|
+ });
|
|
|
+ }, 2000);
|
|
|
} else {
|
|
|
this.$message({
|
|
|
type: "error",
|
|
|
message: res.msg,
|
|
|
});
|
|
|
}
|
|
|
- this.showVisible = false;
|
|
|
this.loading = false;
|
|
|
});
|
|
|
}
|