Commit f97584b1 by chenwq

fix(addRecruitment): 更新省市选择组件,修复地址显示问题

1 parent f97f8cbc
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
@click.native="selectTown(item)"></el-option> @click.native="selectTown(item)"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="embedMode ? '' : detailAddressLabel"> <el-form-item v-if="mapView" :label="embedMode ? '' : detailAddressLabel">
<el-input size="small" v-if="mapView" readonly placeholder="请选择详细地址" v-model="provinceForm.fullAddress" <el-input size="small" readonly placeholder="请选择详细地址" v-model="provinceForm.fullAddress"
class="map-input" @blur.native="$emit('merchant-address-part-blur')"> class="map-input" @blur.native="$emit('merchant-address-part-blur')">
<el-button size="small" slot="append" @click="hanleSelectMap" icon="el-icon-location-outline"> <el-button size="small" slot="append" @click="hanleSelectMap" icon="el-icon-location-outline">
<!-- <img src="@/assets/map.png" alt="" class="map-icon" /> --> <!-- <img src="@/assets/map.png" alt="" class="map-icon" /> -->
......
...@@ -32,8 +32,15 @@ ...@@ -32,8 +32,15 @@
</div> </div>
</template> </template>
<template #merchantAddressHtml> <template #merchantAddressHtml>
<ProvinceCity ref="provinceCityRef" default-width="125px" :subdistrict="2" <!-- <ProvinceCity ref="provinceCityRef" default-width="125px" :subdistrict="2"
@selectCity="handleSelectCity" @selectProvince="handleSelectProvince" /> @selectCity="handleSelectCity" @selectProvince="handleSelectProvince" /> -->
<ProvinceCity ref="provinceCityRef"
province-label="门店地址:"
:mapView="mapView"
:subdistrict="2"
@selectCity="handleSelectCity"
@selectProvince="handleSelectProvince">
</ProvinceCity>
</template> </template>
</glsx-combi-form> </glsx-combi-form>
</div> </div>
...@@ -57,7 +64,7 @@ import { ...@@ -57,7 +64,7 @@ import {
getDictList, getDictList,
} from "@api/recruitment"; } from "@api/recruitment";
import { deepClone, Util } from "@/common/util"; import { deepClone, Util } from "@/common/util";
import ProvinceCity from "@/components/glsx-combi-form/provinceCity.vue"; import ProvinceCity from "@/components/province-city/index.vue";
export default { export default {
name: "AddRecruitment", name: "AddRecruitment",
...@@ -85,6 +92,7 @@ export default { ...@@ -85,6 +92,7 @@ export default {
data() { data() {
return { return {
btnLoding: false, btnLoding: false,
mapView: false,
addForm: { addForm: {
merchantName: "", merchantName: "",
merchantId: "", merchantId: "",
...@@ -137,7 +145,7 @@ export default { ...@@ -137,7 +145,7 @@ export default {
isHide: true, isHide: true,
}, },
{ {
label: "门店地址", label: "",
name: "merchantAddress", name: "merchantAddress",
addHtml: "merchantAddressHtml", addHtml: "merchantAddressHtml",
isHide: true, isHide: true,
...@@ -477,15 +485,15 @@ export default { ...@@ -477,15 +485,15 @@ export default {
this.$refs[this.editChildRef] && this.$refs[this.editChildRef].$refs.form.clearValidate(); this.$refs[this.editChildRef] && this.$refs[this.editChildRef].$refs.form.clearValidate();
}, },
handleSelectProvince(val) { handleSelectProvince(val) {
this.addForm.provinceCode = val.provinceCode; this.addForm.provinceCode = val.code;
this.addForm.province = val.provinceName; this.addForm.province = val.name;
this.addForm.cityCode = ""; this.addForm.cityCode = "";
this.addForm.cityName = ""; this.addForm.cityName = "";
this.addForm.merchantAddress = val.provinceName; this.addForm.merchantAddress = val.name;
}, },
handleSelectCity(val) { handleSelectCity(val) {
this.addForm.provinceCityCode = this.addForm.provinceCode + "/" + val.cityCode; this.addForm.provinceCityCode = this.addForm.provinceCode + "/" + val.code;
this.addForm.merchantAddress = this.addForm.province + "" + val.cityName; this.addForm.merchantAddress = this.addForm.province + "" + val.name;
}, },
getBrandName() { getBrandName() {
console.log(this.addForm.brand); console.log(this.addForm.brand);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!