|
@@ -3,7 +3,7 @@
|
|
|
<el-dialog @close="closeShop" 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-input v-model="form.shopName" placeholder="请输入店铺名称" autocomplete="off" style="width: 100%"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="主营类别" label-width="103px">
|
|
|
<div class="category_box">
|
|
@@ -18,14 +18,14 @@
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="门牌号" label-width="103px">
|
|
|
- <el-input v-model="form.street" placeholder="请填写门牌号" autocomplete="off" style="width: 100%">
|
|
|
+ <el-input v-model="form.houseNumber" placeholder="请填写门牌号" autocomplete="off" style="width: 100%">
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="联系人姓名" label-width="103px">
|
|
|
<el-input v-model="form.contactName" placeholder="请填写姓名" autocomplete="off" style="width: 40%"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="联系人电话" label-width="103px">
|
|
|
- <el-input v-model="form.mobile" placeholder="请填写手机号" autocomplete="off" style="width: 40%"></el-input>
|
|
|
+ <el-input v-model="form.contactPhone" placeholder="请填写手机号" autocomplete="off" style="width: 40%"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="已获运力" label-width="103px" v-if="form.id">
|
|
|
<div class="logo_box">
|
|
@@ -61,7 +61,13 @@
|
|
|
|
|
|
<script>
|
|
|
import orderMap from "../orderComponents/orderAMap.vue";
|
|
|
-import { getShopDetail, shopAdd, shopEdit } from "../../api/shop.js";
|
|
|
+import {
|
|
|
+ getShopDetail,
|
|
|
+ shopAdd,
|
|
|
+ shopEdit,
|
|
|
+ shopCreate,
|
|
|
+ shopUpdate,
|
|
|
+} from "../../api/shop.js";
|
|
|
export default {
|
|
|
props: {
|
|
|
products: {
|
|
@@ -82,11 +88,11 @@ export default {
|
|
|
cityName: "",
|
|
|
contactName: "",
|
|
|
districtName: "",
|
|
|
- lat: "",
|
|
|
- lng: "",
|
|
|
- mobile: "",
|
|
|
- name: "",
|
|
|
- street: "",
|
|
|
+ latitude: "",
|
|
|
+ longitude: "",
|
|
|
+ contactPhone: "",
|
|
|
+ shopName: "",
|
|
|
+ houseNumber: "",
|
|
|
categoryId: "",
|
|
|
},
|
|
|
deliveries: [],
|
|
@@ -105,9 +111,14 @@ export default {
|
|
|
if (e) {
|
|
|
this.title = "编辑门店";
|
|
|
getShopDetail({ shopId: e.id }).then((res) => {
|
|
|
- console.log(res);
|
|
|
+ console.log("门店详情:", res);
|
|
|
if (res.code === 200) {
|
|
|
this.form = res.data;
|
|
|
+ this.form.shopName = res.data.name;
|
|
|
+ this.form.contactPhone = res.data.mobile;
|
|
|
+ this.form.houseNumber = res.data.street;
|
|
|
+ this.form.longitude = res.data.lng;
|
|
|
+ this.form.latitude = res.data.lat;
|
|
|
this.deliveries = this.form.deliveries.filter((v) => {
|
|
|
return v.bindStatus === 1 && v.type !== 3;
|
|
|
});
|
|
@@ -168,11 +179,11 @@ export default {
|
|
|
this.form.cityName = v.city;
|
|
|
this.form.cityCode = v.citycode;
|
|
|
this.form.districtName = v.district;
|
|
|
- this.form.lng = lng;
|
|
|
- this.form.lat = lat;
|
|
|
+ this.form.longitude = lng;
|
|
|
+ this.form.latitude = lat;
|
|
|
},
|
|
|
save() {
|
|
|
- if (!this.form.name.trim()) {
|
|
|
+ if (!this.form.shopName.trim()) {
|
|
|
return this.$message({
|
|
|
type: "error",
|
|
|
message: "请输入门店名称!",
|
|
@@ -190,7 +201,7 @@ export default {
|
|
|
message: "请选择详细地址!",
|
|
|
});
|
|
|
}
|
|
|
- if (!this.form.street.trim()) {
|
|
|
+ if (!this.form.houseNumber.trim()) {
|
|
|
return this.$message({
|
|
|
type: "error",
|
|
|
message: "请输入门牌号!",
|
|
@@ -202,7 +213,7 @@ export default {
|
|
|
message: "请输入联系人姓名!",
|
|
|
});
|
|
|
}
|
|
|
- if (!this.form.mobile.trim()) {
|
|
|
+ if (!this.form.contactPhone.trim()) {
|
|
|
return this.$message({
|
|
|
type: "error",
|
|
|
message: "请输入联系人电话!",
|
|
@@ -210,7 +221,7 @@ export default {
|
|
|
}
|
|
|
this.loading = true;
|
|
|
if (this.form.id) {
|
|
|
- shopEdit(this.form).then((res) => {
|
|
|
+ shopUpdate(this.form).then((res) => {
|
|
|
if (res.code === 200) {
|
|
|
this.$message({
|
|
|
type: "success",
|
|
@@ -227,7 +238,7 @@ export default {
|
|
|
this.loading = false;
|
|
|
});
|
|
|
} else {
|
|
|
- shopAdd(this.form).then((res) => {
|
|
|
+ shopCreate(this.form).then((res) => {
|
|
|
if (res.code === 200) {
|
|
|
this.$message({
|
|
|
type: "success",
|