| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | getQrCodeDetail |
| | | } from "@/api/system/index" |
| | | import selectBus from "@/components/my-components/selectBus.vue" |
| | | import uploadMixin from "@/mixin/uploadMixin"; |
| | | import { |
| | |
| | | this.addOrUpdateTitle = "保存" |
| | | await this.getAllBizDict() |
| | | this.setCardTypeDefault() |
| | | this.getHouseDetail(); |
| | | } |
| | | if (data.type == 2) { |
| | | this.isEdit = true; |
| | |
| | | }, |
| | | |
| | | methods: { |
| | | |
| | | getHouseDetail() { |
| | | getQrCodeDetail({ |
| | | roleName: uni.getStorageSync("activeRole").roleName, |
| | | addressCode: this.houseCode || uni.getStorageSync("siteInfo").houseCode, |
| | | }).then(res => { |
| | | console.log(res); |
| | | this.homeRegion = res.data.townStreetName; |
| | | this.form.currentAddress = res.data.addressName; |
| | | console.log("===>", this.getHouseRegion(res.data.townStreetName)); |
| | | this.form.homeAdcode = this.getHouseRegion(res.data.townStreetName).code; |
| | | this.homeIndex = this.getHouseRegion(res.data.townStreetName).index; |
| | | |
| | | }) |
| | | }, |
| | | |
| | | setRegionDefault() { |
| | | getQrCodeDetail({ |
| | | roleName: uni.getStorageSync("activeRole").roleName, |
| | | addressCode: this.houseCode || uni.getStorageSync("siteInfo").houseCode, |
| | | }).then(res => { |
| | | this.homeRegion = res.townStreetName; |
| | | this.form.homeAdcode = this.getHouseRegion(res.townStreetName).code; |
| | | this.homeIndex = this.getHouseRegion(res.townStreetName).index; |
| | | |
| | | }) |
| | | }, |
| | | |
| | | |
| | | |
| | | getHouseRegion(name) { |
| | | for (let i = 0, ii = this.regionList.length; i < ii; i++) { |
| | | if (this.regionList[i].name == name) { |
| | | return { |
| | | index: i, |
| | | code: this.regionList[i].code |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | |
| | | |
| | | showLabel() { |
| | | let arr = [] |
| | | for (let i of this.form.householdLabelList) { |
| | |
| | | } = this.findObjValue(data.homeAdcode, this.regionList, "code") |
| | | this.homeIndex = index; |
| | | this.homeRegion = name; |
| | | } else { |
| | | this.setRegionDefault(); |
| | | } |
| | | } |
| | | }) |