From 44849db20d8a63feb00611a3aec0cc7f2f28a116 Mon Sep 17 00:00:00 2001
From: lifizer <913626195@qq.com>
Date: Sun, 23 Jun 2024 11:39:24 +0800
Subject: [PATCH] =?UTF-8?q?Fix(=E5=85=A5=E9=A9=BB):[#1845,=20#1757]?=
=?UTF-8?q?=E7=B1=BB=E5=9E=8B=E9=80=89=E6=8B=A9=E5=AD=98=E5=9C=A8=E5=85=BC?=
=?UTF-8?q?=E5=AE=B9=E6=80=A7=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pkg_join/views/shop.vue | 62 ++++++++++----------
pkg_join/views/supplier.vue | 109 ++++++++++++++++++++----------------
2 files changed, 90 insertions(+), 81 deletions(-)
diff --git a/pkg_join/views/shop.vue b/pkg_join/views/shop.vue
index 2e48110..9f4118e 100644
--- a/pkg_join/views/shop.vue
+++ b/pkg_join/views/shop.vue
@@ -149,20 +149,25 @@
-
+
*
-
-
+
+
+
+
-
-
-
@@ -430,7 +435,6 @@ export default {
trigger: ['blur', 'change']
}
},
- showType: false,
columnsType: [],
indexType: [0],
district: [],
@@ -455,9 +459,6 @@ export default {
this.$refs.shopForm.setRules(this.rules);
},
methods: {
- changeType(state){
- this.showType=state
- },
changeRemove(state){
this.showRemove=state
},
@@ -487,14 +488,13 @@ export default {
init() {
getCity().then(({data}) => {
- this.district = data;
- });
-
+ this.district = data
+ })
getShopData().then(({data}) => {
- this.columnsType.push(data.hotelTypeList);
- this.notice = data.merchantApplyNotice;
- this.initInfo();
- });
+ this.columnsType = data.hotelTypeList
+ this.notice = data.merchantApplyNotice
+ this.initInfo()
+ })
},
initInfo() {
@@ -530,9 +530,9 @@ export default {
}
})
}
- this.indexType = this.columnsType[0].findIndex(item => item.id === this.form.type);
- if (this.indexType != -1) {
- this.form.typeText = this.columnsType[0][this.indexType].name;
+ this.indexType = this.columnsType.findIndex(item => item.id === this.form.type)
+ if (this.indexType !== -1) {
+ this.form.typeText = this.columnsType[this.indexType].name
}
this.form.position = this.$forceToDecimal(this.form.longitude, 6) + ',' + this.$forceToDecimal(this.form.latitude, 6);
this.form.area = `${this.form.provinceName} ${this.form.cityName} ${this.form.areaName}`;
@@ -595,17 +595,15 @@ export default {
})
}
},
-
- // 回调参数为包含column indexs、value、values
- confirmType(e) {
- this.indexType = e.indexs;
- this.form.type = e.value[0].id;
- this.form.typeText = e.value[0].name;
- this.showType = false;
- },
-
- cancelType() {
- this.showType = false;
+ typeChange(e) {
+ const idx = parseInt(e.detail.value)
+ this.columnsType.map((item, index) => {
+ if (index === idx) {
+ this.form.typeText = item.name
+ this.indexType = index
+ this.form.type = item.id
+ }
+ })
},
// 省市区
diff --git a/pkg_join/views/supplier.vue b/pkg_join/views/supplier.vue
index e574080..8a3980f 100644
--- a/pkg_join/views/supplier.vue
+++ b/pkg_join/views/supplier.vue
@@ -120,21 +120,26 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -287,20 +292,26 @@
-
+
*
-
-
+
+
+
+
-
-
@@ -456,7 +467,7 @@ export default {
subType: "",
area: "",
address: "",
- position: "",
+ position: ""
},
form: {
name: "",
@@ -596,14 +607,10 @@ export default {
trigger: ['blur', 'change']
}
},
-
- showType: false,
columnsType: [],
- indexType: [0],
-
- showSupplierType: false,
+ indexType: 0,
columnsSupplierType: [],
- indexSupplierType: [0],
+ indexSupplierType: 0,
district: [],
@@ -641,9 +648,6 @@ export default {
this.$refs.supplierForm.setRules(this.rulesSupplier);
},
methods: {
- changeType(state){
- this.showType=state
- },
changeRemove(state){
this.showRemove=state
},
@@ -677,8 +681,8 @@ export default {
});
getShopData().then(({data}) => {
- this.columnsType.push(data.hotelTypeList);
- this.columnsSupplierType.push(data.supplierTypeList);
+ this.columnsType = data.hotelTypeList
+ this.columnsSupplierType = data.supplierTypeList
this.notice = data.merchantApplyNotice;
this.initInfo();
});
@@ -718,8 +722,8 @@ export default {
}
})
}
- this.indexType = this.columnsType[0].findIndex(item => item.id === this.form.type);
- this.form.typeText = this.columnsType[0][this.indexType].name;
+ this.indexType = this.columnsType.findIndex(item => item.id === this.form.type);
+ this.form.typeText = this.columnsType[this.indexType].name;
this.form.position = this.$forceToDecimal(this.form.longitude, 6) + ',' + this.$forceToDecimal(this.form.latitude, 6);
this.form.area = `${this.form.provinceName} ${this.form.cityName} ${this.form.areaName}`;
if (data.hotelInfo.coverType === 2) {
@@ -733,8 +737,8 @@ export default {
if (this.infoTitle === "文玩" && data.applyType !== 3) return;
this.formSupplier = data.supplierInfo;
- this.indexSupplierType = this.columnsSupplierType[0].findIndex(item => item.key === this.formSupplier.subType);
- this.formSupplier.typeText = this.columnsSupplierType[0][this.indexSupplierType].value;
+ this.indexSupplierType = this.columnsSupplierType.findIndex(item => item.key === this.formSupplier.subType);
+ this.formSupplier.typeText = this.columnsSupplierType[this.indexSupplierType].value;
this.formSupplier.position = this.$forceToDecimal(this.formSupplier.longitude, 6) + ',' + this.$forceToDecimal(this.formSupplier.latitude, 6);
this.formSupplier.area = `${this.formSupplier.provinceName} ${this.formSupplier.cityName} ${this.formSupplier.areaName}`;
}
@@ -810,24 +814,31 @@ export default {
}
},
- // 回调参数为包含column indexs、value、values
- confirmType(e) {
- this.indexType = e.indexs;
- this.form.type = e.value[0].id;
- this.form.typeText = e.value[0].name;
- this.showType = false;
- },
-
confirmSupplierType(e) {
this.indexSupplierType = e.indexs;
this.formSupplier.subType = e.value[0].key;
this.formSupplier.typeText = e.value[0].value;
this.showSupplierType = false;
},
-
- cancelType() {
- this.showType = false;
- this.showSupplierType = false;
+ typeChange(e) {
+ const idx = parseInt(e.detail.value)
+ this.columnsType.map((item, index) => {
+ if (index === idx) {
+ this.form.typeText = item.name
+ this.indexType = index
+ this.form.type = item.id
+ }
+ })
+ },
+ supplierTypeChange(e) {
+ const idx = parseInt(e.detail.value)
+ this.columnsSupplierType.map((item, index) => {
+ if (index === idx) {
+ this.formSupplier.typeText = item.value
+ this.indexSupplierType = index
+ this.formSupplier.type = item.key
+ }
+ })
},
resultSupplier(values) {