瀏覽代碼

增加详细地址自动获取功能

LuChongMei 1 年之前
父節點
當前提交
c8282de184

+ 12 - 2
src/views/activityMan/differentbelievers/ReligiousPeopleReportView.vue

@@ -54,7 +54,11 @@
       </van-cell-group>
       <van-cell-group>
         <van-field v-model="inputForm.currentResidenceDetail" center label="现居地详情:" placeholder="请填写现居地详情"
-          input-align="right" right-icon="location" />
+          input-align="right">
+          <template #right-icon>
+            <van-icon name="location" @click="getLocation" />
+          </template>
+        </van-field>
       </van-cell-group>
       <van-cell-group>
         <div class="rowTextArea">
@@ -175,6 +179,11 @@ export default {
       inputForm.value.currentResidenceLevel3 = selectedOptions[1].value ? selectedOptions[1].value : ''
       inputForm.value.currentResidenceLevel4 = selectedOptions[2].value ? selectedOptions[2].value : ''
     };
+    const getLocation = () => {
+      xm.getLocation().then(data => {
+        inputForm.value.currentResidenceDetail = data.POIName;
+      })
+    }
     // 籍贯选择
     let showArea = ref(false);
     // 全部选项选择完毕后,会触发 finish 事件
@@ -264,7 +273,8 @@ export default {
       fileList,
       submit,
       showCurrentArea,
-      showPlace
+      showPlace,
+      getLocation
     };
   },
 };

+ 48 - 176
src/views/activityMan/placeactivity/placeActivityView.vue

@@ -1,214 +1,83 @@
 <template>
-  <van-nav-bar
-    fixed
-    title="场所活动信息上报"
-    left-text=""
-    left-arrow
-    @click-left="onClickLeft"
-  />
+  <van-nav-bar fixed title="场所活动信息上报" left-text="" left-arrow @click-left="onClickLeft" />
   <van-loading size="16px" v-show="isLoading">加载中...</van-loading>
   <div class="main" v-show="!isLoading">
     <!-- <p class="title">场所活动上报</p> -->
-    <van-form
-      class="formArea"
-      @submit="submit"
-      show-error
-      :show-error-message="false"
-      validate-trigger="onChange"
-    >
+    <van-form class="formArea" @submit="submit" show-error :show-error-message="false" validate-trigger="onChange">
       <!-- <p class="miniTitle">基础信息</p> -->
       <van-cell-group>
-        <van-field
-          v-model="placeActivity.activityName"
-          center
-          clearable
-          label="活动名称:"
-          placeholder="请填写活动名称"
-          input-align="right"
-        />
+        <van-field v-model="placeActivity.activityName" center clearable label="活动名称:" placeholder="请填写活动名称"
+          input-align="right" />
       </van-cell-group>
       <van-cell-group>
-        <van-field
-          v-model="placeActivity.siteName.name"
-          readonly
-          required
-          :rules="[{ required: true }]"
-          label="场所名称:"
-          placeholder="请选择场所名称"
-          input-align="right"
-          right-icon="arrow-down"
-          @click="showPlace = true"
-        />
+        <van-field v-model="placeActivity.siteName.name" readonly required :rules="[{ required: true }]" label="场所名称:"
+          placeholder="请选择场所名称" input-align="right" right-icon="arrow-down" @click="showPlace = true" />
         <van-popup v-model:show="showPlace" round position="bottom">
-          <van-picker
-            title="活动场所"
-            :columns="places"
-            :columns-field-names="customFieldName"
-            @cancel="showPlace = false"
-            @confirm="getPlace"
-          />
+          <van-picker title="活动场所" :columns="places" :columns-field-names="customFieldName" @cancel="showPlace = false"
+            @confirm="getPlace" />
         </van-popup>
       </van-cell-group>
       <van-cell-group>
-        <van-field
-          v-model="placeActivity.activityTime"
-          center
-          readonly
-          label="活动时间:"
-          placeholder="请选择时间"
-          input-align="right"
-          right-icon="arrow-down"
-          @click="showAct = true"
-        />
+        <van-field v-model="placeActivity.activityTime" center readonly label="活动时间:" placeholder="请选择时间"
+          input-align="right" right-icon="arrow-down" @click="showAct = true" />
         <van-popup v-model:show="showAct" round position="bottom">
-          <van-picker-group
-            title="活动时间"
-            :tabs="['选择日期', '选择时间']"
-            next-step-text="下一步"
-            @confirm="getTime"
-            @cancel="showAct = false"
-          >
+          <van-picker-group title="活动时间" :tabs="['选择日期', '选择时间']" next-step-text="下一步" @confirm="getTime"
+            @cancel="showAct = false">
             <van-date-picker v-model="currentDate" />
-            <van-time-picker
-              v-model="currentTime"
-              :columns-type="columnsType"
-            />
+            <van-time-picker v-model="currentTime" :columns-type="columnsType" />
           </van-picker-group>
         </van-popup>
       </van-cell-group>
       <van-cell-group>
-        <van-field
-          v-model="placeActivity.participantsNum"
-          center
-          clearable
-          label="参会人数:"
-          placeholder="请填写参会人数"
-          input-align="right"
-          type="digit"
-        />
+        <van-field v-model="placeActivity.participantsNum" center clearable label="参会人数:" placeholder="请填写参会人数"
+          input-align="right" type="digit" />
       </van-cell-group>
       <van-cell-group>
-        <van-field
-          v-model="placeActivity.knownList.name"
-          center
-          required
-          :rules="[{ required: true }]"
-          label="已知名单:"
-          placeholder="请选择参会已知名单"
-          input-align="right"
-          right-icon="arrow-down"
-          @click="showPerson = true"
-        />
-        <van-dialog
-          v-model:show="showPerson"
-          title="选择人员名单"
-          show-cancel-button
-          @confirm="reselected"
-        >
+        <van-field v-model="placeActivity.knownList.name" center required :rules="[{ required: true }]" label="已知名单:"
+          placeholder="请选择参会已知名单" input-align="right" right-icon="arrow-down" @click="showPerson = true" />
+        <van-dialog v-model:show="showPerson" title="选择人员名单" show-cancel-button @confirm="reselected">
           <person-list @selected="selected" :type="1"></person-list>
         </van-dialog>
       </van-cell-group>
       <van-cell-group>
-        <van-field
-          v-model="placeActivity.reporter.name"
-          center
-          readonly
-          label="报告人:"
-          placeholder="请选择报告人"
-          input-align="right"
-        />
+        <van-field v-model="placeActivity.reporter.name" center readonly label="报告人:" placeholder="请选择报告人"
+          input-align="right" />
       </van-cell-group>
       <van-cell-group>
-        <van-field
-          v-model="placeActivity.participation"
-          center
-          clearable
-          label="参加范围:"
-          placeholder="请填写参加范围"
-          input-align="right"
-        />
+        <van-field v-model="placeActivity.participation" center clearable label="参加范围:" placeholder="请填写参加范围"
+          input-align="right" />
       </van-cell-group>
       <van-cell-group>
-        <van-field
-          v-model="placeActivity.place"
-          center
-          readonly
-          label="活动地点:"
-          placeholder="请选择场所"
-          input-align="right"
-          right-icon="arrow-down"
-        />
+        <van-field v-model="placeActivity.place" center readonly label="活动地点:" placeholder="请选择场所" input-align="right"
+          right-icon="arrow-down" />
       </van-cell-group>
       <van-cell-group>
-        <van-field
-          v-model="placeActivity.placeDel"
-          center
-          readonly
-          label="详细地址:"
-          placeholder="请选择场所"
-          input-align="right"
-        >
+        <van-field v-model="placeActivity.placeDel" center readonly label="详细地址:" placeholder="请选择场所" input-align="right">
           <template #right-icon>
-            <van-icon name="location" />
+            <van-icon name="location" @click="getLocation" />
           </template>
         </van-field>
       </van-cell-group>
       <van-cell-group>
-        <van-field
-          v-model="placeActivity.sourceFunds"
-          center
-          clearable
-          label="经费来源:"
-          placeholder="请选择"
-          input-align="right"
-        />
+        <van-field v-model="placeActivity.sourceFunds" center clearable label="经费来源:" placeholder="请选择"
+          input-align="right" />
       </van-cell-group>
       <van-cell-group>
-        <van-field
-          v-model="placeActivity.activityPerson.name"
-          center
-          label="活动负责人:"
-          placeholder="请选择活动负责人"
-          input-align="right"
-          right-icon="arrow-down"
-          @click="showReport = true"
-        />
-        <van-dialog
-          v-model:show="showReport"
-          title="选择活动负责人"
-          show-cancel-button
-          @confirm="reselected"
-        >
-          <person-list
-            @selected="selected"
-            :type="0"
-            ref="person"
-          ></person-list>
+        <van-field v-model="placeActivity.activityPerson.name" center label="活动负责人:" placeholder="请选择活动负责人"
+          input-align="right" right-icon="arrow-down" @click="showReport = true" />
+        <van-dialog v-model:show="showReport" title="选择活动负责人" show-cancel-button @confirm="reselected">
+          <person-list @selected="selected" :type="0" ref="person"></person-list>
         </van-dialog>
       </van-cell-group>
       <van-cell-group>
-        <van-field
-          v-model="placeActivity.phone"
-          center
-          readonly
-          type="tel"
-          label="联系方式:"
-          placeholder="请填写联系方式"
-          input-align="right"
-        />
+        <van-field v-model="placeActivity.phone" center readonly type="tel" label="联系方式:" placeholder="请填写联系方式"
+          input-align="right" />
       </van-cell-group>
       <van-cell-group>
         <van-field name="uploader" label="安全预案:">
           <template #input>
-            <van-uploader
-              :after-read="afterRead"
-              v-model="fileList"
-              :max-count="5"
-              capture="camera"
-              accept=""
-              :preview-full-image="false"
-              :before-delete="deleteRead"
-            >
+            <van-uploader :after-read="afterRead" v-model="fileList" :max-count="5" capture="camera" accept=""
+              :preview-full-image="false" :before-delete="deleteRead">
               <van-button>上传文件</van-button>
             </van-uploader>
           </template>
@@ -217,18 +86,13 @@
       <van-cell-group>
         <van-field name="content" label="主题内容:" label-align="top">
           <template #input>
-            <wang-editor
-              ref="subjectContentEditor"
-              v-model="placeActivity.subjectContent"
-            />
+            <wang-editor ref="subjectContentEditor" v-model="placeActivity.subjectContent" />
           </template>
         </van-field>
       </van-cell-group>
       <div class="subbtn">
         <van-button type="primary" native-type="submit">提交</van-button>
-        <van-button type="default" hairline @click="onClickLeft"
-          >暂存</van-button
-        >
+        <van-button type="default" hairline @click="onClickLeft">暂存</van-button>
       </div>
     </van-form>
   </div>
@@ -245,6 +109,7 @@ import { useRoute } from "vue-router";
 import $base from "@/utils/config";
 // 富文本编辑器
 import WangEditor from "@/components/editor/WangEditor";
+import { xmNavTo } from "@/utils/onlineXm";
 
 export default {
   components: { personList, WangEditor },
@@ -323,7 +188,6 @@ export default {
             }
           });
           subjectContentEditor.value.init(placeActivity.value.subjectContent);
-          console.log("修改数据", placeActivity.value);
           isLoading.value = false;
         });
       } else {
@@ -358,6 +222,11 @@ export default {
       placeActivity.value.place = selectedOptions[0].placeSelectName;
       placeActivity.value.placeDel = selectedOptions[0].place;
     };
+    const getLocation = () => {
+      xm.getLocation().then(data => {
+        placeActivity.value.placeDel = data.AOIName;
+      })
+    }
     // 获取活动时间
     let showAct = ref(false);
     let currentDate = ref(["" + new Date().getFullYear(), "01", "01"]);
@@ -429,7 +298,7 @@ export default {
       for (let index = 0; index < fileList.value.length; index++) {
         if (file.file.name == fileList.value[index].file.name) {
           let delurl = fileupList.value[index].url;
-          new tools().uploadFiledelete("", delurl).then(({ data }) => {});
+          new tools().uploadFiledelete("", delurl).then(({ data }) => { });
           fileupList.value.splice(index, 1);
           fileList.value.splice(index, 1);
         }
@@ -459,6 +328,7 @@ export default {
       showPlace,
       places,
       getPlace,
+      getLocation,
       // 活动时间
       showAct,
       columnsType,
@@ -489,10 +359,12 @@ export default {
   color: #36a7f3;
   top: -4px;
 }
+
 .van-dialog {
   width: 80%;
   top: 50%;
 }
+
 .van-loading {
   text-align: center;
   margin-top: 80px;

+ 33 - 87
src/views/activityMan/selfMeetingReport/selfMeetingView.vue

@@ -1,110 +1,44 @@
 <template>
-  <van-nav-bar
-    fixed
-    title="私设聚会点信息上报"
-    left-text=""
-    left-arrow
-    @click-left="onClickLeft"
-  />
+  <van-nav-bar fixed title="私设聚会点信息上报" left-text="" left-arrow @click-left="onClickLeft" />
   <van-loading size="16px" v-show="isLoading">加载中...</van-loading>
   <div class="main" v-show="!isLoading">
     <!-- <p class="title">私设聚会点上报</p> -->
-    <van-form
-      class="formArea"
-      @submit="submit"
-      show-error
-      :show-error-message="false"
-    >
+    <van-form class="formArea" @submit="submit" show-error :show-error-message="false">
       <!-- <p class="miniTitle">基础信息</p> -->
       <van-cell-group>
-        <van-field
-          v-model="inputForm.placeSelectName"
-          center
-          readonly
-          required
-          :rules="[{ required: true }]"
-          label="地点:"
-          placeholder="请填写参加地点"
-          input-align="right"
-          right-icon="arrow-down"
-          @click="showArea = true"
-        />
+        <van-field v-model="inputForm.placeSelectName" center readonly required :rules="[{ required: true }]" label="地点:"
+          placeholder="请填写参加地点" input-align="right" right-icon="arrow-down" @click="showArea = true" />
         <van-popup v-model:show="showArea" round position="bottom">
-          <van-cascader
-            v-model="cascaderValue"
-            title="请选择所在地区"
-            :options="options"
-            @close="showArea = false"
-            @finish="onFinish"
-            :field-names="fieldNames"
-          />
+          <van-cascader v-model="cascaderValue" title="请选择所在地区" :options="options" @close="showArea = false"
+            @finish="onFinish" :field-names="fieldNames" />
         </van-popup>
       </van-cell-group>
       <van-cell-group>
-        <van-field
-          v-model="inputForm.placeDel"
-          center
-          label="详细地址:"
-          placeholder="请填写具体地址"
-          input-align="right"
-          right-icon="location"
-        />
+        <van-field v-model="inputForm.placeDel" center label="详细地址:" placeholder="请填写具体地址" input-align="right">
+          <template #right-icon>
+            <van-icon name="location" @click="getLocation" />
+          </template>
+        </van-field>
       </van-cell-group>
 
       <van-cell-group>
-        <van-field
-          v-model="inputForm.frequency"
-          center
-          label="频次:"
-          placeholder="请填写频次"
-          input-align="right"
-          type="digit"
-        />
+        <van-field v-model="inputForm.frequency" center label="频次:" placeholder="请填写频次" input-align="right"
+          type="digit" />
       </van-cell-group>
       <van-cell-group>
-        <van-field
-          v-model="inputForm.partyTime"
-          center
-          readonly
-          label="时间:"
-          placeholder="请选择时间"
-          input-align="right"
-          right-icon="arrow-down"
-          @click="showAct = true"
-        />
+        <van-field v-model="inputForm.partyTime" center readonly label="时间:" placeholder="请选择时间" input-align="right"
+          right-icon="arrow-down" @click="showAct = true" />
         <van-popup v-model:show="showAct" round position="bottom">
-          <van-picker-group
-            :tabs="['选择日期', '选择时间']"
-            next-step-text="下一步"
-            @confirm="getTime"
-            @cancel="showAct = false"
-          >
+          <van-picker-group :tabs="['选择日期', '选择时间']" next-step-text="下一步" @confirm="getTime" @cancel="showAct = false">
             <van-date-picker v-model="currentDate" />
-            <van-time-picker
-              v-model="currentTime"
-              :columns-type="columnsType"
-            />
+            <van-time-picker v-model="currentTime" :columns-type="columnsType" />
           </van-picker-group>
         </van-popup>
       </van-cell-group>
       <van-cell-group>
-        <van-field
-          v-model="inputForm.relatedPersons.name"
-          center
-          required
-          :rules="[{ required: true }]"
-          label="相关人:"
-          placeholder="请选择相关人"
-          input-align="right"
-          right-icon="arrow-down"
-          @click="showPerson = true"
-        />
-        <van-dialog
-          v-model:show="showPerson"
-          title="选择人员"
-          show-cancel-button
-          @confirm="reselected"
-        >
+        <van-field v-model="inputForm.relatedPersons.name" center required :rules="[{ required: true }]" label="相关人:"
+          placeholder="请选择相关人" input-align="right" right-icon="arrow-down" @click="showPerson = true" />
+        <van-dialog v-model:show="showPerson" title="选择人员" show-cancel-button @confirm="reselected">
           <person-list @selected="selected" :type="1"></person-list>
         </van-dialog>
       </van-cell-group>
@@ -123,7 +57,7 @@
   </div>
 </template>
   
-  <script>
+<script>
 import { ref, onMounted } from "vue";
 import personList from "../personList.vue";
 import tools from "@/api/sys/tools";
@@ -196,6 +130,7 @@ export default {
         "-"
       )} ${currentTime.value.join(":")}`;
     };
+
     // 相关人
     let showPerson = ref(false);
     let list = {
@@ -237,7 +172,17 @@ export default {
       inputForm.value.placeSelectName = selectedOptions
         .map((option) => option.name)
         .join("/");
+      inputForm.value.place = selectedOptions
+        .map((option) => option.code)
+        .join("/");
+      inputForm.value.placeSelectType4 = selectedOptions[1].code
+      inputForm.value.placeSelectType5 = selectedOptions[2].code
     };
+    const getLocation = () => {
+      xm.getLocation().then(data => {
+        inputForm.value.placeDel = data.POIName;
+      })
+    }
     const submit = () => {
       isLoading.value = true;
       new PrivatePartyPointService().save(inputForm.value).then((res) => {
@@ -269,6 +214,7 @@ export default {
       fieldNames,
       options,
       onFinish,
+      getLocation,
       cascaderValue,
       contentEditor,
       // change,