| | |
| | | <box-title title="基础信息"></box-title>
|
| | | </view>
|
| | | <view class="item">
|
| | | <u-form-item @click="showPicker = true" class="form-item" labelWidth="100" label="楼栋:"
|
| | | <u-form-item v-if="!currentId" @click="showPicker = true" class="form-item" labelWidth="100" label="楼栋:"
|
| | | :required="isRequired" :disabled="isDisabled" prop="buildingCode">
|
| | | <u--input border="none" disabledColor="#ffffff" v-model="form.building" placeholder="请选择">
|
| | | </u--input>
|
| | |
| | |
|
| | | <lineItem :dataInfo="comprehensiveData.scene">
|
| | | <template v-slot:pic="{scope}">
|
| | | <view class="image" v-if="scope.value !== ''"> |
| | | <u--image @click="imgPreview(scope.value)" width="200rpx" height="200rpx" :src="scope.value"></u--image> |
| | | <view class="image" v-if="scope.value !== ''">
|
| | | <u--image @click="imgPreview(scope.value)" width="200rpx" height="200rpx"
|
| | | :src="scope.value"></u--image>
|
| | | </view>
|
| | | </template>
|
| | | </lineItem>
|
| | |
| | |
|
| | | <view class="bottom">
|
| | | <view class="btn">
|
| | | <u-button @click="submit" type="primary" text="提交"></u-button>
|
| | | <u-button @click="submit" type="primary" text="提交" v-if="!currentId"></u-button>
|
| | | </view>
|
| | | </view>
|
| | |
|
| | |
| | | getDoorplateAddressList
|
| | | } from "@/api/doorplateAddress/doorplateAddress";
|
| | | import {
|
| | | getPlaceDetail
|
| | | } from '@/api/place/place.js'
|
| | | import {
|
| | | add
|
| | | } from "@/api/place/place";
|
| | | import {
|
| | | format
|
| | | } from "echarts";
|
| | | export default {
|
| | | mixins: [uploadMixin],
|
| | | components: {
|
| | |
| | | buildingCode: "",
|
| | | label: "",
|
| | | remark: "",
|
| | | imageUrls: "", |
| | | placeName: ""
|
| | | imageUrls: "",
|
| | | placeName: "",
|
| | | },
|
| | | rules: {
|
| | | 'buildingCode': {
|
| | |
| | | ],
|
| | | scene: [{
|
| | | label: "消防照片",
|
| | | value: "",
|
| | | useSlot: "pic",
|
| | | },
|
| | | {
|
| | |
| | |
|
| | | activeIds: [],
|
| | | showLabelList: [],
|
| | |
|
| | | stdId: "",
|
| | | houseCode: "",
|
| | | currentId: ""
|
| | | }
|
| | | },
|
| | | watch: {
|
| | |
| | | handler(newVal) {
|
| | | console.log(newVal)
|
| | | }
|
| | | }, |
| | | showLabelList(newVal) { |
| | | console.log(newVal); |
| | | }
|
| | |
|
| | | },
|
| | |
| | | styleIsolation: 'shared', // 解除样式隔离
|
| | | },
|
| | | onLoad(option) {
|
| | | this.stdId = option.stdId
|
| | | console.log(this.stdId, "----------")
|
| | | if (this.stdId) {
|
| | | const {
|
| | | houseCode,
|
| | | id
|
| | | } = option
|
| | | this.houseCode = houseCode
|
| | | this.currentId = id
|
| | | if (this.currentId || this.houseCode) {
|
| | | this.getBuildingDetail()
|
| | | }
|
| | |
|
| | |
| | | },
|
| | | methods: {
|
| | |
|
| | | getBuildingDetail(params = {}) {
|
| | | getDoorplateAddressDetail(Object.assign(params, {
|
| | | stdId: this.stdId
|
| | | })).then(res => {
|
| | | let data = res.data
|
| | | this.form.buildingCode = data.buildingCode
|
| | | // getBuildingDetail(params = {}) {
|
| | | // getDoorplateAddressDetail(Object.assign(params, {
|
| | | // stdId: this.stdId
|
| | | // })).then(res => {
|
| | | // let data = res.data
|
| | | // this.form.buildingCode = data.buildingCode
|
| | |
|
| | | let buildingNameArr = [data.townStreetName, data.neiName, data.streetRuName, data.aoiName,
|
| | | data.buildingName
|
| | | // let buildingNameArr = [data.townStreetName, data.neiName, data.streetRuName, data.aoiName,
|
| | | // data.buildingName
|
| | | // ]
|
| | | // let arr = buildingNameArr.filter(e => {
|
| | | // return e != null || e != ''
|
| | | // })
|
| | |
|
| | | // // 赋值
|
| | | // // this.form.placeName = data['placeName']
|
| | | // Object.keys(this.form).forEach(key => {
|
| | | // if (!data[key]) {
|
| | | // this.form[key] = data.place[key]
|
| | | // } else {
|
| | | // this.form[key] = data[key]
|
| | | // }
|
| | | // })
|
| | |
|
| | | // this.form.building = arr.join("")
|
| | |
|
| | | // Object.keys(this.comprehensiveData).forEach(key => {
|
| | | // this.comprehensiveData[key].forEach(item => {
|
| | | // if (!data[item.name]) {
|
| | | // item.value = data.place[item.name] || '未完善'
|
| | | // } else {
|
| | | // item.value = data[item.name] || '未完善'
|
| | | // }
|
| | | // })
|
| | | // this.publicData[key].forEach(item => {
|
| | | // if (!data[item.name]) {
|
| | | // item.value = data.place[item.name] || '未完善'
|
| | | // } else {
|
| | | // item.value = data[item.name] || '未完善'
|
| | | // }
|
| | | // })
|
| | | // })
|
| | | // })
|
| | | // },
|
| | |
|
| | | getBuildingDetail(params = {}) {
|
| | | let idorCodeParams = {}
|
| | | if (this.houseCode) {
|
| | | idorCodeParams = {
|
| | | houseCode: this.houseCode
|
| | | }
|
| | | }
|
| | | if (this.currentId) {
|
| | | idorCodeParams = {
|
| | | id: this.currentId
|
| | | }
|
| | | }
|
| | | getPlaceDetail({
|
| | | ...params,
|
| | | ...idorCodeParams
|
| | | }).then(({
|
| | | code,
|
| | | data
|
| | | }) => {
|
| | | if (code !== 200) {
|
| | | uni.showToast({
|
| | | title: "数据加载失败",
|
| | | icon: 'error'
|
| | | })
|
| | | return
|
| | | }
|
| | | const dpaEntity = data.doorplateAddressEntity
|
| | | this.form.buildingCode = dpaEntity?.buildingCode
|
| | | let buildingNameArr = [
|
| | | dpaEntity?.townStreetName,
|
| | | dpaEntity?.neiName,
|
| | | dpaEntity?.streetRuName,
|
| | | dpaEntity?.aoiName,
|
| | | dpaEntity?.buildingName
|
| | | ]
|
| | | let arr = buildingNameArr.filter(e => {
|
| | | return e != null || e != ''
|
| | | })
|
| | | |
| | | // 赋值 |
| | | // this.form.placeName = data['placeName'] |
| | | Object.keys(this.form).forEach(key => { |
| | | if (!data[key]) { |
| | | this.form[key] = data.place[key] |
| | | } else { |
| | | this.form[key] = data[key] |
| | | } |
| | | this.form.placeName = data['placeName']
|
| | | Object.keys(this.form).forEach(key => {
|
| | | this.form[key] = data[key] || data.doorplateAddressEntity[key] || '未完善'
|
| | | if (key === "images") {
|
| | | this.form[key] = []
|
| | | }
|
| | | })
|
| | |
|
| | | this.form.building = arr.join("")
|
| | |
|
| | | Object.keys(this.comprehensiveData).forEach(key => {
|
| | | console.log(key);
|
| | | this.comprehensiveData[key].forEach(item => {
|
| | | item.value = data[item.name] || data.doorplateAddressEntity[item
|
| | | .name] || '未完善'
|
| | | })
|
| | | this.publicData[key].forEach(item => {
|
| | | item.value = data[item.name] || data.doorplateAddressEntity[item
|
| | | .name] || '未完善'
|
| | | })
|
| | | }) |
| | | |
| | | this.form.building = arr.join("") |
| | | |
| | | Object.keys(this.comprehensiveData).forEach(key => {
|
| | | this.comprehensiveData[key].forEach(item => {
|
| | | if (!data[item.name]) {
|
| | | item.value = data.place[item.name] || '未完善'
|
| | | } else {
|
| | | item.value = data[item.name] || '未完善'
|
| | | }
|
| | | }) |
| | | this.publicData[key].forEach(item => { |
| | | if (!data[item.name]) { |
| | | item.value = data.place[item.name] || '未完善' |
| | | } else { |
| | | item.value = data[item.name] || '未完善' |
| | | } |
| | | })
|
| | | data.placePoiLabelVOList.forEach(item => { |
| | | const label = this.labelList[0].children.find(sl => sl.text === item.labelName) |
| | | label.isClose = false |
| | | this.showLabelList.push(label) |
| | | })
|
| | |
|
| | | })
|
| | | },
|
| | |
|
| | |
| | | const that = this
|
| | | this.$refs.form.validate().then(valid => {
|
| | | if (valid) {
|
| | | if (this.form.images.length > 0) {
|
| | | if (this.form?.images?.length > 0) {
|
| | | let urls = []
|
| | | this.form.images.forEach(e => {
|
| | | urls.push(e.name)
|
| | |
| | | this.showLabelList = this.showLabelList.filter(e => e.id != label.id)
|
| | | this.activeIds = this.activeIds.filter(e => e != label.id)
|
| | |
|
| | | }, |
| | | imgPreview(value) { |
| | | uni.previewImage({ |
| | | urls: [value], |
| | | }) |
| | | },
|
| | | imgPreview(value) {
|
| | | uni.previewImage({
|
| | | urls: [value],
|
| | | })
|
| | | },
|
| | | }
|
| | | }
|
| | |
| | | background-color: #ffffff;
|
| | | padding: 40rpx 30rpx;
|
| | | }
|
| | | |
| | | .image { |
| | | padding: 20rpx; |
| | | } |
| | | |
| | |
|
| | | .image {
|
| | | padding: 20rpx;
|
| | | }
|
| | |
|
| | | .bottom {
|
| | | padding: 20rpx;
|
| | | background-color: #ffffff;
|