Lou
2024-02-01 24a04767b281739056ed0658bb956fccbe84cb1d
subPackage/workbench/views/cscj.vue
@@ -28,7 +28,7 @@
                  </u-input>
                  <u-icon slot="right" name="arrow-right"></u-icon>
               </u-form-item>
               <u-form-item label="九小场所" labelWidth="100" prop="isNine" :required="isRequired">
               <u-form-item label="九小场所:" labelWidth="100" prop="isNine" :required="isRequired">
                  <u-radio-group v-model="form.isNine" v-if="!currentId">
                     <u-radio :customStyle="{marginBottom: '8px'}" v-for="(item, index) in statusList"
                        :key="index" :label="item.name" :name="item.id">
@@ -45,8 +45,7 @@
                  </u-input>
                  <u-icon slot="right" name="arrow-right"></u-icon>
               </u-form-item>
               <u-form-item v-if="form.isNine == 1" label="阵地" labelWidth="100" prop="isFront"
                  :required="isRequired">
               <u-form-item label="阵地:" labelWidth="100" prop="isFront" :required="isRequired">
                  <u-radio-group v-model="form.isFront" v-if="!currentId">
                     <u-radio :customStyle="{marginBottom: '8px'}" v-for="(item, index) in statusList"
                        :key="index" :label="item.name" :name="item.id">
@@ -92,7 +91,8 @@
                     <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 && !isView)   || (isView && !form.jwd)">
                        获取地址
                     </view>
                  </view>
@@ -118,6 +118,11 @@
               <u-form-item class="form-item" labelWidth="100" :required="isRequired" :disabled="isDisabled"
                  label="手机号:" prop="principalPhone">
                  <u--input border="none" type="number" v-model="form.principalPhone" placeholder="请输入">
                  </u--input>
               </u-form-item>
               <u-form-item class="form-item" labelWidth="100" :required="isRequired" :disabled="isDisabled"
                  label="身份证号:" prop="principalIdCard">
                  <u--input border="none" type="idcard" v-model="form.principalIdCard" placeholder="请输入">
                  </u--input>
               </u-form-item>
            </view>
@@ -242,7 +247,8 @@
      minioBaseUrl
   } from "../../../common/setting";
   import {
      bizDictionary
      bizDictionary,
      bizDictionaryTree
   } from '@/api/system/dict.js'
   export default {
      mixins: [uploadMixin],
@@ -271,6 +277,7 @@
               placeName: "",
               principal: '',
               principalPhone: '',
               principalIdCard: '',
               lat: '',
               lng: '',
               location: '',
@@ -322,6 +329,22 @@
                     message: '手机号码不正确',
                     trigger: ['change', 'blur']
                  }
               ],
               'form.principalIdCard': [{
                     type: 'string',
                     required: false,
                     message: '请输入身份证号码',
                     trigger: ['change', 'blur']
                  },
                  {
                     validator: (rule, value, callback) => {
                        const idCardRegex =
                           /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/
                        return idCardRegex.test(value)
                     },
                     message: '身份证号码有误',
                     trigger: ['change', 'blur']
                  }
               ],
            },
@@ -468,7 +491,8 @@
            showNineTypePicker: false,
            showFrontTypePicker: false,
            nineTypeValue: "",
            frontTypeValue: ""
            frontTypeValue: "",
            isView: false
         }
@@ -479,7 +503,10 @@
      options: {
         styleIsolation: 'shared', // 解除样式隔离
      },
      onLoad(option) {
      async onLoad(option) {
         await this.getCategory();
         await this.getAllBizDict();
         this.getNineTypeList();
         const {
            type
         } = option
@@ -494,6 +521,7 @@
            this.form.houseCode = option.houseCode
         }
         if (option.id || option.houseCode) {
            this.isView = true;
            this.getBuildingDetail()
         }
         if (!!type || type != void 0) {
@@ -501,8 +529,8 @@
               title: '详情'
            })
         }
         this.getCategory();
         this.getAllBizDict();
      },
      watch: {
@@ -522,6 +550,14 @@
         //    },            
         //    immediate:true
         // }  
      },
      onReady() {
         this.$refs.form.setRules(this.rules)
      },
      onUnload() {
      },
@@ -593,6 +629,15 @@
               })
            })
         },
         getNineTypeList() {
            bizDictionaryTree({
               code: "nineType"
            }).then(res => {
               console.log(res.data);
            })
         },
         navTo(type) {
            if (type == 1) {
@@ -668,6 +713,7 @@
         },
         getBuildingDetail(params = {}) {
            let idorCodeParams = {}
            if (this.houseCode) {
               idorCodeParams = {
@@ -683,6 +729,9 @@
                  id: this.currentId
               }
            }
            uni.showLoading({
               title: "加载中..."
            })
            getPlaceDetail({
               ...params,
               ...idorCodeParams
@@ -690,6 +739,7 @@
               code,
               data
            }) => {
               uni.hideLoading();
               if (code !== 200) {
                  uni.showToast({
                     title: "数据加载失败",
@@ -739,7 +789,7 @@
                     this.nineTypeValue = name;
                  }
                  if (key == "isFrontType") {
                  if (key == "isFront") {
                     let {
                        index,
                        name
@@ -747,10 +797,8 @@
                     this.frontTypeIndex = index;
                     this.frontTypeValue = name;
                  }
               })
               this.form.jwd = `${Number(data.lng).toFixed(6)},${Number(data.lat).toFixed(6)}`
               this.$set(this.form, "jwd", `${Number(data.lng).toFixed(6)},${Number(data.lat).toFixed(6)}`)
               this.form.building = arr.join("")
               let labelList = data.placePoiLabelVOList;
               let tempLabelList = [];
@@ -762,13 +810,13 @@
               this.firstId = tempLabelList[0].poiCode;
               this.categoryValue = tempLabelList[1].labelName;
               this.form.label = tempLabelList[1].poiCode
               setTimeout(() => {
                  let firstIndex = this.categoryList[0].findIndex(i => i.categoryNo ==
                     tempLabelList[0].poiCode)
                  let childIndex = this.categoryList[1].findIndex(i => i.categoryNo ==
                     tempLabelList[1].poiCode)
                  this.categoryIndex = [firstIndex, childIndex]
               }, 500)
               // setTimeout(() => {
               let firstIndex = this.categoryList[0].findIndex(i => i.categoryNo ==
                  tempLabelList[0].poiCode)
               let childIndex = this.categoryList[1].findIndex(i => i.categoryNo ==
                  tempLabelList[1].poiCode)
               this.categoryIndex = [firstIndex, childIndex]
               // }, 500)
               Object.keys(this.comprehensiveData).forEach(key => {
@@ -857,18 +905,19 @@
            this.$set(this.pickColumns, index, data)
         },
         getLocation() {
            const that = this
         //获取当前位置信息
         getCurrentLocation() {
            uni.getLocation({
               type: 'wgs84', // 坐标系类型
               success: function(res) {
               type: 'gcj02', // 坐标系类型
               success: (res) => {
                  var latitude = res.latitude; // 维度
                  var longitude = res.longitude; // 经度
                  that.form.lng = longitude
                  that.form.lat = latitude
                  this.form.lng = longitude
                  this.form.lat = latitude
                  this.form.jwd =
                     `${Number(res.longitude).toFixed(6)},${Number(res.latitude).toFixed(6)}`
                  that.form.jwd = longitude + "," + latitude
               },
               fail: function(res) {
                  console.log('获取定位失败:' + res.errMsg);