Commit fb0a4f7d by chenwq

fix(addressCom): 修复地址选择组件中区域ID为空时的错误

当区域ID为空时,不再尝试将其加入省市区选择数组中,避免潜在的错误
1 parent 92311869
<template> <template>
<el-drawer class="shoppingCartDrawerCon" title="收货地址管理" size="500px" :visible.sync="dialogShow" <el-drawer class="shoppingCartDrawerCon" title="收货地址管理" size="500px" :visible.sync="dialogShow" :direction="direction">
:direction="direction"> <glsx-combi-form class="edit-form-container" ref="editFormRef" label-width="100px" default-width="350px" :form-ref="editChildRef" :form-obj="editForm" :form-data="editFormData" :form-rules="editRule">
<glsx-combi-form class="edit-form-container" ref="editFormRef" label-width="100px" default-width="350px"
:form-ref="editChildRef" :form-obj="editForm" :form-data="editFormData" :form-rules="editRule">
<span slot="provincesAndCities"> <span slot="provincesAndCities">
<!-- slot-scope="scope" --> <!-- slot-scope="scope" -->
<el-cascader v-model="editForm.provincesAndCities" size="mini" ref="cascader" placeholder="请选择 省/市/区" <el-cascader v-model="editForm.provincesAndCities" size="mini" ref="cascader" placeholder="请选择 省/市/区" style="width:350px" :options="provincesAndCities_options" :props="{ label: 'name', value: 'code', children: 'childrenList' }" />
style="width:350px" :options="provincesAndCities_options"
:props="{ label: 'name', value: 'code', children: 'childrenList' }" />
</span> </span>
</glsx-combi-form> </glsx-combi-form>
<div class="footer-btn"> <div class="footer-btn">
...@@ -113,7 +109,7 @@ export default { ...@@ -113,7 +109,7 @@ export default {
this.getAreaInfo() this.getAreaInfo()
if (this.addressInfo) { if (this.addressInfo) {
this.editForm = this.$common.utils.deepClone(this.addressInfo) this.editForm = this.$common.utils.deepClone(this.addressInfo)
this.editForm.provincesAndCities = [String(this.editForm.provinceId), String(this.editForm.cityId), String(this.editForm.areaId)] this.editForm.provincesAndCities = this.editForm.areaId ? [String(this.editForm.provinceId), String(this.editForm.cityId), String(this.editForm.areaId)] : [String(this.editForm.provinceId), String(this.editForm.cityId)]
} else { } else {
this.editForm = {} this.editForm = {}
} }
...@@ -170,7 +166,6 @@ export default { ...@@ -170,7 +166,6 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.shoppingCartDrawerCon { .shoppingCartDrawerCon {
// position: relative; // position: relative;
::v-deep .el-drawer__header { ::v-deep .el-drawer__header {
border-bottom: 1px solid #e7eaec; border-bottom: 1px solid #e7eaec;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!