<template>
|
<div id="detailContent">
|
<el-col :md="12" :lg="8" v-if="province.visible">
|
<el-form-item :label="province.filedDescription + ':'">
|
<!-- <el-input v-model="provinceVal" readonly="readonly"></el-input> -->
|
<p class="content">{{provinceVal === ''? '--' : provinceVal}}</p>
|
</el-form-item>
|
</el-col>
|
<el-col :md="12" :lg="8" v-if="citys.visible">
|
<el-form-item :label="citys.filedDescription + ':'">
|
<!-- <el-input v-model="citysVal" readonly="readonly"></el-input> -->
|
<p class="content">{{citysVal === ''? '--' : citysVal}}</p>
|
</el-form-item>
|
</el-col>
|
<el-col :md="12" :lg="8" v-if="county.visible">
|
<el-form-item :label="county.filedDescription + ':'">
|
<!-- <el-input v-model="countyVal" readonly="readonly"></el-input> -->
|
<p class="content">{{countyVal === ''? '--' : countyVal}}</p>
|
</el-form-item>
|
</el-col>
|
</div>
|
</template>
|
|
<script>
|
import { getProvinceCodeList, getCityCodeList, getAreaCodeList } from '@/api/area'
|
export default {
|
props: ['province', 'citys', 'county'],
|
data: function() {
|
return {
|
provinceVal: '',
|
citysVal: '',
|
countyVal: '',
|
}
|
},
|
watch: {
|
'province.value': {
|
immediate: true,
|
handler(newVal) {
|
if (!this._.isEmpty(newVal)) {
|
this.getProvince(newVal)
|
}
|
}
|
},
|
},
|
methods: {
|
async getProvince(value) {
|
let provinceRes = await getProvinceCodeList({})
|
this.provinceVal = this._.find(provinceRes.result, { itemno: value }).itemname
|
let params = {
|
codeNo: 'AreaCode',
|
itmeNo: this.province.value
|
}
|
let citysRes = await getCityCodeList(params)
|
this.citysVal = this._.find(citysRes.result, { itemno: this.citys.value }).itemname
|
let countyParams = {
|
codeNo: 'AreaCode',
|
itmeNo: this.citys.value
|
}
|
let countyRes = await getAreaCodeList(countyParams)
|
this.countyVal = this._.find(countyRes.result, { itemno: this.county.value }).itemname
|
}
|
}
|
}
|
</script>
|
|
<style lang="stylus" scoped>
|
#detailContent
|
>>> .el-form-item
|
height 48px
|
margin-bottom 0px
|
.content
|
// width 220px
|
word-wrap break-word
|
line-height 16px
|
</style>
|