|
@@ -18,58 +18,58 @@
|
|
|
:wrapper-col="formItemLayout.wrapperCol"
|
|
|
>
|
|
|
<a-form-model-item label="收货人" prop="consigneeName">
|
|
|
- <a-input
|
|
|
- id="editAddress-name"
|
|
|
- :maxLength="30"
|
|
|
- v-model="form.consigneeName"
|
|
|
- placeholder="请输入收货人(最多30个字符)"
|
|
|
- allowClear />
|
|
|
+ <a-input
|
|
|
+ id="editAddress-name"
|
|
|
+ :maxLength="30"
|
|
|
+ v-model="form.consigneeName"
|
|
|
+ placeholder="请输入收货人(最多30个字符)"
|
|
|
+ allowClear />
|
|
|
</a-form-model-item>
|
|
|
<a-form-model-item label="手机号码" prop="consigneeTel">
|
|
|
- <a-input
|
|
|
- id="editAddress-phone"
|
|
|
- :maxLength="11"
|
|
|
- v-model="form.consigneeTel"
|
|
|
- placeholder="请输入手机号码(最多11个字符)"
|
|
|
- allowClear />
|
|
|
+ <a-input
|
|
|
+ id="editAddress-phone"
|
|
|
+ :maxLength="11"
|
|
|
+ v-model="form.consigneeTel"
|
|
|
+ placeholder="请输入手机号码(最多11个字符)"
|
|
|
+ allowClear />
|
|
|
</a-form-model-item>
|
|
|
<a-form-model-item label="所在地区" required style="margin: 0;">
|
|
|
- <a-row :gutter="20">
|
|
|
- <!-- 所在地区 -->
|
|
|
- <a-col span="8">
|
|
|
- <a-form-model-item prop="provinceSn">
|
|
|
- <a-select id="editAddress-provinceSn" @change="getCityList" v-model="form.provinceSn" placeholder="请选择省">
|
|
|
- <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
|
|
|
- </a-select>
|
|
|
- </a-form-model-item>
|
|
|
- </a-col>
|
|
|
- <a-col span="8">
|
|
|
- <a-form-model-item prop="citySn">
|
|
|
- <a-select id="editAddress-citySn" @change="getAreaList" v-model="form.citySn" placeholder="请选择市">
|
|
|
- <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
|
|
|
- </a-select>
|
|
|
- </a-form-model-item>
|
|
|
- </a-col>
|
|
|
- <a-col span="8">
|
|
|
- <a-form-model-item prop="countySn">
|
|
|
- <a-select id="editAddress-countySn" @change="areaCharged" v-model="form.countySn" placeholder="请选择区/县">
|
|
|
- <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
|
|
|
- </a-select>
|
|
|
- </a-form-model-item>
|
|
|
- </a-col>
|
|
|
- </a-row>
|
|
|
+ <a-row :gutter="20">
|
|
|
+ <!-- 所在地区 -->
|
|
|
+ <a-col span="8">
|
|
|
+ <a-form-model-item prop="provinceSn">
|
|
|
+ <a-select id="editAddress-provinceSn" @change="getCityList" v-model="form.provinceSn" placeholder="请选择省">
|
|
|
+ <a-select-option v-for="item in addrProvinceList" :value="item.id" :key="item.id + 'a'">{{ item.name }}</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col span="8">
|
|
|
+ <a-form-model-item prop="citySn">
|
|
|
+ <a-select id="editAddress-citySn" @change="getAreaList" v-model="form.citySn" placeholder="请选择市">
|
|
|
+ <a-select-option v-for="item in addrCityList" :value="item.id" :key="item.id + 'b'">{{ item.name }}</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col span="8">
|
|
|
+ <a-form-model-item prop="countySn">
|
|
|
+ <a-select id="editAddress-countySn" @change="areaCharged" v-model="form.countySn" placeholder="请选择区/县">
|
|
|
+ <a-select-option v-for="item in addrDistrictList" :value="item.id" :key="item.id + 'c'">{{ item.name }}</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
</a-form-model-item>
|
|
|
<a-form-model-item label="详细地址" prop="addr">
|
|
|
- <a-input
|
|
|
- id="editAddress-address"
|
|
|
- :maxLength="60"
|
|
|
- v-model="form.addr"
|
|
|
- placeholder="请输入详细地址(最多60个字符)"
|
|
|
- allowClear />
|
|
|
+ <a-input
|
|
|
+ id="editAddress-address"
|
|
|
+ :maxLength="60"
|
|
|
+ v-model="form.addr"
|
|
|
+ placeholder="请输入详细地址(最多60个字符)"
|
|
|
+ allowClear />
|
|
|
</a-form-model-item>
|
|
|
<a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;">
|
|
|
- <a-button type="primary" @click="handleSubmit" id="editAddress-btn-submit">保存</a-button>
|
|
|
- <a-button @click="isShow=false" style="margin-left: 15px" id="editAddress-btn-back">返回</a-button>
|
|
|
+ <a-button type="primary" @click="handleSubmit" id="editAddress-btn-submit">保存</a-button>
|
|
|
+ <a-button @click="isShow=false" style="margin-left: 15px" id="editAddress-btn-back">返回</a-button>
|
|
|
</a-form-model-item>
|
|
|
</a-form-model>
|
|
|
</a-spin>
|
|
@@ -209,11 +209,20 @@ export default {
|
|
|
Promise.all([getArea({ type: '2' }), getArea({ parentId: data.provinceSn, type: '3' }), getArea({ parentId: data.citySn, type: '4' })]).then(res => {
|
|
|
console.log(res)
|
|
|
this.addrProvinceList = res[0].data
|
|
|
- this.form.provinceName = this.addrProvinceList.find(item => item.id == data.provinceSn).name
|
|
|
+ const provinceName = this.addrProvinceList.find(item => item.id == data.provinceSn)
|
|
|
+ if (provinceName && provinceName.name) {
|
|
|
+ this.form.provinceName = provinceName.name
|
|
|
+ }
|
|
|
this.addrCityList = res[1].data
|
|
|
- this.form.cityName = this.addrCityList.find(item => item.id == data.citySn).name
|
|
|
+ const cityName = this.addrCityList.find(item => item.id == data.citySn)
|
|
|
+ if (cityName && cityName.name) {
|
|
|
+ this.form.cityName = cityName.name
|
|
|
+ }
|
|
|
this.addrDistrictList = res[2].data
|
|
|
- this.form.countyName = this.addrDistrictList.find(item => item.id == data.countySn).name
|
|
|
+ const countyName = this.addrDistrictList.find(item => item.id == data.countySn)
|
|
|
+ if (countyName && countyName.name) {
|
|
|
+ this.form.countyName = countyName.name
|
|
|
+ }
|
|
|
this.form = Object.assign({}, this.form, data)
|
|
|
})
|
|
|
}
|