Lou
2023-12-28 58d533b992d434f9e82cebf5771af488744aecb8
subPackage/workbench/views/cscj.vue
@@ -1,8 +1,6 @@
<template>
   <view class="container">
      <view class="wrap">
         <u-form labelWidth="70" :model="form" :rules="rules" ref="form">
            <view class="item">
               <!-- u-form-item v-if="!currentId" @click="showPicker = true" class="form-item" labelWidth="100" label="楼栋:"
@@ -16,18 +14,19 @@
               </view>
               <u-form-item class="form-item" labelWidth="100" label="场所名称:" :required="isRequiredPlace"
                  :disabled="isDisabled" prop="placeName">
                  <u--input  v-if="!currentId" border="none" v-model="form.placeName" placeholder="请输入">
                  <u--input v-if="!currentId" border="none" v-model="form.placeName" placeholder="请输入">
                  </u--input>
                  <view class="f-30"  v-if="currentId">
                  <view class="f-30" v-if="currentId">
                     {{form.placeName || "暂无数据"}}
                  </view>
               </u-form-item>
               <u-form-item @click="popup" class="form-item" labelWidth="100" label="标签:" :required="isRequired"
                  :disabled="isDisabled" prop="label">
                  <u--input border="none"  v-model="categoryValue"  disabled disabledColor="#ffffff" placeholder="请选择">
                  </u--input>
                  <u-icon slot="right" name="arrow-right"  v-if="!currentId"></u-icon>
                  <u-input border="none" v-model="categoryValue" disabled disabledColor="#ffffff"
                     placeholder="请选择">
                  </u-input>
                  <u-icon v-if="!currentId" slot="right" name="arrow-right"></u-icon>
               </u-form-item>
               <!-- <view v-if="showLabelList.length" class="label" style="border-bottom:1px solid eff1f3;">
                  <view v-for="(item,index) in showLabelList" :key="index" class="activeLabel">
@@ -35,24 +34,20 @@
                        @close="delTag(item)" :text="item.text"></u-tag>
                  </view>
               </view> -->
               <!-- <view v-if="categoryValue.length" class="label" style="border-bottom:1px solid eff1f3;">
                  <view v-for="(item,index) in categoryValue" :key="index" class="activeLabel">
                     <u-tag :closable="currentId?false:true"  size="mini"
                        @close="delTag()" :text="item.categoryName"></u-tag>
                  </view>
               </view> -->
               <u-form-item class="form-item" labelWidth="100" label="备注:" prop="remark">
                  <u--input  v-if="!currentId" border="none" v-model="form.remark" placeholder="请输入">
                  <u--input v-if="!currentId" border="none" v-model="form.remark" placeholder="请输入">
                  </u--input>
                  <view class="f-30"  v-if="currentId">
                  <view class="f-30" v-if="currentId">
                     {{form.remark || "暂无数据"}}
                  </view>
               </u-form-item>
               </u-form-item>
               <u-form-item label="经纬度:" prop="location" labelWidth="100">
                  <view class="address-row flex j-c-s-b a-i-c">
@@ -62,11 +57,18 @@
                     <view class="address-content f-28" v-if="!form.jwd" style="color: #c0c4cc;">
                        请选择地址
                     </view>
                     <view class="location-btn c-main f-24" @click="getLocation()"  v-if="!currentId">
                     <view class="location-btn c-main f-24" @click="getLocation()" v-if="!currentId">
                        获取地址
                     </view>
                  </view>
               </u-form-item>
               <u-form-item label="地址:" labelWidth="100" v-if="form.location">
                  <view class="address-row">
                     {{form.location}}
                  </view>
               </u-form-item>
            </view>
            <view class="item">
@@ -74,13 +76,13 @@
                  <box-title title="负责人信息"></box-title>
               </view>
               <u-form-item class="form-item" labelWidth="100" :required="isRequired" :disabled="isDisabled"
                  label="场所负责人:" prop="username">
                  <u--input border="none" v-model="form.username" placeholder="请输入">
                  label="场所负责人:" prop="principal">
                  <u--input border="none" v-model="form.principal" placeholder="请输入">
                  </u--input>
               </u-form-item>
               <u-form-item class="form-item" labelWidth="100" :required="isRequired" :disabled="isDisabled"
                  label="手机号:" prop="phone">
                  <u--input border="none" v-model="form.phone" placeholder="请输入">
                  label="手机号:" prop="principalPhone">
                  <u--input border="none" v-model="form.principalPhone" placeholder="请输入">
                  </u--input>
               </u-form-item>
            </view>
@@ -89,10 +91,10 @@
               <view class="box-title">
                  <box-title title="场所照片"></box-title>
               </view>
               <u-upload :fileList="form.images" :previewFullImage="uploadConfig.previewFullImage"
                  :accept="uploadConfig.acceptImg" :multiple="uploadConfig.multiple"
                  :maxCount="uploadConfig.maxCount" :capture="uploadConfig.capture"
@@ -105,7 +107,7 @@
         <view class="item">
         <view class="item" v-if="currentId">
            <view class="box-title">
               <box-title title="综治网格">
                  <template slot="titleMore">
@@ -135,7 +137,7 @@
         <view class="item">
         <view class="item" v-if="currentId">
            <view class="box-title">
               <box-title title="公安网格">
                  <template slot="titleMore">
@@ -165,8 +167,9 @@
         @cancel="showPicker = false"></u-picker>
      <u-picker :show="isShowCatePicker"  :defaultIndex="categoryIndex"  ref="catePicker" keyName="categoryName" :columns="categoryList"
         @confirm="confirmCategory" @change="changeCategory" @cancel="isShowCatePicker = false"></u-picker>
      <u-picker :show="isShowCatePicker" :defaultIndex="categoryIndex" ref="catePicker" keyName="categoryName"
         :columns="categoryList" @confirm="confirmCategory" @change="changeCategory"
         @cancel="isShowCatePicker = false"></u-picker>
   </view>
@@ -220,11 +223,11 @@
               remark: "",
               imageUrls: "",
               placeName: "",
               username: '',
               phone: '',
               principal: '',
               principalPhone: '',
               lat: '',
               lng: '',
               location:''
               location: ''
            },
            rules: {
               // 'buildingCode': {
@@ -338,7 +341,7 @@
                  }
               ],
               scene: [
                  // {
                  //    label: "消防照片",
                  //    useSlot: "pic",
@@ -383,7 +386,7 @@
            categoryIndex: [],
            firstId: "",
            secondId: "",
            categoryValue: []
            categoryValue: ""
         }
      },
      created() {
@@ -399,7 +402,7 @@
         if (option.addressType) {
            this.addressType = option.addressType
         }
         if (option.id) {
         if (option.id) {
            this.currentId = option.id;
         }
         if (option.houseCode) {
@@ -611,15 +614,17 @@
               this.form.jwd = `${Number(data.lng).toFixed(6)},${Number(data.lat).toFixed(6)}`
               this.form.building = arr.join("")
               this.firstId = data.placePoiLabelVOList[0].poiCode;
               this.categoryValue = data.placePoiLabelVOList[data.placePoiLabelVOList.length-1].labelName;
               this.categoryValue = data.placePoiLabelVOList[data.placePoiLabelVOList.length - 1].labelName;
               uni.$u.sleep(500).then(() => {
                  data.placePoiLabelVOList.forEach(item=>{
                    let firstIndex = this.categoryList[0].findIndex(i => i.categoryNo==item.poiCode)
                    let childIndex = this.categoryList[1].findIndex(i => i.categoryNo == item.poiCode)
                    this.categoryIndex = [firstIndex,childIndex]
                  })
                  data.placePoiLabelVOList.forEach(item => {
                     let firstIndex = this.categoryList[0].findIndex(i => i.categoryNo ==
                        item.poiCode)
                     let childIndex = this.categoryList[1].findIndex(i => i.categoryNo ==
                        item.poiCode)
                     this.categoryIndex = [firstIndex, childIndex]
                  })
               })
               Object.keys(this.comprehensiveData).forEach(key => {
                  this.comprehensiveData[key].forEach(item => {
                     if (!data[item.name]) {
@@ -720,7 +725,7 @@
               success: (res) => {
                  this.form.lat = res.latitude;
                  this.form.lng = res.longitude;
                  this.form.laction = res.address;
                  this.form.location = res.address;
                  this.form.jwd =
                     `${Number(res.longitude).toFixed(6)},${Number(res.latitude).toFixed(6)}`
               }
@@ -799,11 +804,12 @@
         //弹出层打开
         popup() {
            // this.$refs.uniPopup.open()
            if (this.currentId) return;
            this.isShowCatePicker = true;
         },
         labelClick(item) {