Browse Source

消息通知

yangyuxuan 6 months ago
parent
commit
50c941368d

+ 32 - 21
src/router/routes.ts

@@ -388,6 +388,31 @@ export const constantRoutes: Array<RouteRecordRaw> = [
       title: "任务消息详情",
       noCache: true
     }
+  },
+  {
+    path: "/common",
+    name: "Common",
+    component: Layout,
+    children: [
+      {
+        path: "duty",
+        name: "Duty",
+        component: () => import("@/views/duty/index.vue"),
+        meta: {
+          title: "值班管理",
+          noCache: true
+        }
+      },
+      {
+        path: "rollCallRecord2",
+        name: "rollCallRecord2",
+        component: () => import("@/views/onlineRollCall/rollCallRecord2.vue"),
+        meta: {
+          title: "点名记录",
+          noCache: true
+        }
+      }
+    ]
   }
 ];
 
@@ -530,7 +555,8 @@ export const leaderRoute: Array<RouteRecordRaw> = [
       {
         path: "earthquakeRapidReport",
         name: "EarthquakeRapidReport",
-        component: () => import("@/views/disasterRiskMonitor/earthquakeRapidReport/index.vue"),
+        component: () =>
+          import("@/views/disasterRiskMonitor/earthquakeRapidReport/index.vue"),
         meta: {
           title: "地震速报",
           noCache: true
@@ -539,7 +565,10 @@ export const leaderRoute: Array<RouteRecordRaw> = [
       {
         path: "EarthquakeRapidReportDetails",
         name: "EarthquakeRapidReportDetails",
-        component: () => import("@/views/disasterRiskMonitor/earthquakeRapidReport/earthquakeRapidReportDetail.vue"),
+        component: () =>
+          import(
+            "@/views/disasterRiskMonitor/earthquakeRapidReport/earthquakeRapidReportDetail.vue"
+          ),
         meta: {
           title: "地震速报",
           noCache: true
@@ -579,7 +608,7 @@ export const leaderRoute: Array<RouteRecordRaw> = [
         path: "cadreinformation",
         name: "CadreInformation",
         component: () =>
-            import("@/views/disasterRiskMonitor/cadreInformation.vue"),
+          import("@/views/disasterRiskMonitor/cadreInformation.vue"),
         meta: {
           title: "应急干部",
           noCache: true
@@ -648,24 +677,6 @@ export const workerRoute = [
           title: "数据管理"
         }
       },
-      {
-        path: "duty",
-        name: "Duty",
-        component: () => import("@/views/duty/index.vue"),
-        meta: {
-          title: "值班管理",
-          noCache: true
-        }
-      },
-      {
-        path: "rollCallRecord2",
-        name: "rollCallRecord2",
-        component: () => import("@/views/onlineRollCall/rollCallRecord2.vue"),
-        meta: {
-          title: "点名记录",
-          noCache: true
-        }
-      },
       {
         path: "my",
         name: "My",

+ 133 - 109
src/views/InformationReception/index.vue

@@ -19,10 +19,15 @@
         :options="opt_info_type"
         @change="change_info_type"
       />
-      <van-dropdown-item title="时间" ref="timeRef">
-        <van-picker-group title='发布时间' :tabs="['开始日期', '结束日期']" @confirm="onConfirmTime" @cancel="onCancelTime">
-          <van-date-picker v-model="queryParams.begin_time"/>
-          <van-date-picker v-model="queryParams.end_time"/>
+      <van-dropdown-item ref="timeRef" title="时间">
+        <van-picker-group
+          title="发布时间"
+          :tabs="['开始日期', '结束日期']"
+          @confirm="onConfirmTime"
+          @cancel="onCancelTime"
+        >
+          <van-date-picker v-model="queryParams.begin_time" />
+          <van-date-picker v-model="queryParams.end_time" />
         </van-picker-group>
       </van-dropdown-item>
       <van-dropdown-item
@@ -48,92 +53,105 @@
         class="event-list-item"
         @click="handleInfo(item)"
       >
-          <div class="item-title">
-            <div :class="['info_type', get_info_type_color(item.msg_type)]">
-              {{ item.msg_type }}
-            </div>
-            <div class="item-title-text">{{ item.title }}</div>
+        <div class="item-title">
+          <div :class="['info_type', get_info_type_color(item.msg_type)]">
+            {{ item.msg_type }}
           </div>
-          <!--预案通知-->
-          <div v-if="item.msg_type === '预案通知'" class="item-content">
-            <div class="line-item">
-              <div class="item-label">预案名称:</div>
-              <div class="item-value">{{ item.detail.plan_name }}</div>
-            </div>
-            <div class="line-item">
-              <div class="item-label">响应级别:</div>
-              <div class="item-value">{{ item.detail.response_level }}</div>
-            </div>
-            <div class="line-item">
-              <div class="item-label">发布时间:</div>
-              <div class="item-value">{{ item.detail.sent_time }}</div>
-            </div>
-            <div class="line-item">
-              <div class="item-label">任务内容:</div>
-              <div class="item-value">{{ item.detail.yzy_content || "暂无内容" }}</div>
-            </div>
+          <div class="item-title-text">{{ item.title }}</div>
+        </div>
+        <!--预案通知-->
+        <div v-if="item.msg_type === '预案通知'" class="item-content">
+          <div class="line-item">
+            <div class="item-label">预案名称:</div>
+            <div class="item-value">{{ item.detail.plan_name }}</div>
           </div>
-          <!-- 事件接报 -->
-          <div v-else-if="item.msg_type === '事件接报'" class="item-content">
-            <div class="line-item">
-              <div class="item-label">事件名称:</div>
-              <div class="item-value">{{ item.detail.event_title }}</div>
-            </div>
-            <div class="line-item">
-              <div class="item-label">事件等级:</div>
-              <div class="item-value">{{ item.detail.event_level }}</div>
-            </div>
-            <div class="line-item">
-              <div class="item-label">发生时间:</div>
-              <div class="item-value">{{ item.detail.event_time }}</div>
-            </div>
-            <div class="line-item">
-              <div class="item-label">事发地点:</div>
-              <div class="item-value">{{ item.detail.address }}</div>
-            </div>
+          <div class="line-item">
+            <div class="item-label">响应级别:</div>
+            <div class="item-value">{{ item.detail.response_level }}</div>
           </div>
-          <!-- 任务消息 -->
-          <div v-else-if="item.msg_type === '任务消息'" class="item-content">
-            <div class="line-item">
-              <div class="item-label">事件名称:</div>
-              <div class="item-value">{{ item.detail.event_title }}</div>
-            </div>
-            <div class="line-item">
-              <div class="item-label">发布时间:</div>
-              <div class="item-value">{{ item.detail.creation_time }}</div>
-            </div>
-            <div class="line-item">
-              <div class="item-label">任务内容:</div>
-              <div class="item-value">{{ item.detail.task_description }}</div>
-            </div>
+          <div class="line-item">
+            <div class="item-label">发布时间:</div>
+            <div class="item-value">{{ item.detail.sent_time }}</div>
           </div>
-          <!-- 在线点名 -->
-          <div v-else-if="item.msg_type === '在线点名'" class="item-content">
-            <div class="line-item">
-              {{ item.detail.call_title }}
-            </div>
-            <div class="line-item">
-              <div class="item-label">发送时间:</div>
-              <div class="item-value">{{ item.detail.create_time }}</div>
+          <div class="line-item">
+            <div class="item-label">任务内容:</div>
+            <div class="item-value">
+              {{ item.detail.yzy_content || "暂无内容" }}
             </div>
           </div>
-          <!-- 信息发布 -->
-          <div v-else-if="['预警信息', '灾情信息', '灾情信息', '指挥救援', '公众防范'].includes(item.msg_type)" class="item-content">
-            <div class="line-item">
-              <div class="item-label">发布时间:</div>
-              <div class="item-value">{{ item.recv_time }}</div>
-            </div>
-            <div class="line-item">
-              <div class="item-label">任务内容:</div>
-              <div class="item-value">{{ item.content }}</div>
-            </div>
+        </div>
+        <!-- 事件接报 -->
+        <div v-else-if="item.msg_type === '事件接报'" class="item-content">
+          <div class="line-item">
+            <div class="item-label">事件名称:</div>
+            <div class="item-value">{{ item.detail.event_title }}</div>
+          </div>
+          <div class="line-item">
+            <div class="item-label">事件等级:</div>
+            <div class="item-value">{{ item.detail.event_level }}</div>
+          </div>
+          <div class="line-item">
+            <div class="item-label">发生时间:</div>
+            <div class="item-value">{{ item.detail.event_time }}</div>
+          </div>
+          <div class="line-item">
+            <div class="item-label">事发地点:</div>
+            <div class="item-value">{{ item.detail.address }}</div>
+          </div>
+        </div>
+        <!-- 任务消息 -->
+        <div v-else-if="item.msg_type === '任务消息'" class="item-content">
+          <div class="line-item">
+            <div class="item-label">事件名称:</div>
+            <div class="item-value">{{ item.detail.event_title }}</div>
+          </div>
+          <div class="line-item">
+            <div class="item-label">发布时间:</div>
+            <div class="item-value">{{ item.detail.creation_time }}</div>
           </div>
+          <div class="line-item">
+            <div class="item-label">任务内容:</div>
+            <div class="item-value">{{ item.detail.task_description }}</div>
+          </div>
+        </div>
+        <!-- 在线点名 -->
+        <div v-else-if="item.msg_type === '在线点名'" class="item-content">
+          <div class="line-item">
+            {{ item.detail.call_title }}
+          </div>
+          <div class="line-item">
+            <div class="item-label">发送时间:</div>
+            <div class="item-value">{{ item.detail.create_time }}</div>
+          </div>
+        </div>
+        <!-- 信息发布 -->
+        <div
+          v-else-if="
+            [
+              '预警信息',
+              '灾情信息',
+              '灾情信息',
+              '指挥救援',
+              '公众防范'
+            ].includes(item.msg_type)
+          "
+          class="item-content"
+        >
+          <div class="line-item">
+            <div class="item-label">发布时间:</div>
+            <div class="item-value">{{ item.recv_time }}</div>
+          </div>
+          <div class="line-item">
+            <div class="item-label">任务内容:</div>
+            <div class="item-value">{{ item.content }}</div>
+          </div>
+        </div>
 
-          <div v-else class="item-content">
-            <div class="line-item">
-              {{ item.content }}
-            </div>
+        <div v-else class="item-content">
+          <div class="line-item">
+            {{ item.content }}
           </div>
+        </div>
       </div>
     </van-list>
   </div>
@@ -158,7 +176,7 @@ const opt_info_type = [
   { text: "隐患巡查", value: "隐患巡查" },
   { text: "风险排查", value: "风险排查" },
   { text: "数据采集", value: "数据采集" },
-  
+
   { text: "预警信息", value: "预警信息" },
   { text: "灾情信息", value: "灾情信息" },
   { text: "处置信息", value: "处置信息" },
@@ -175,25 +193,26 @@ const opt_info_order = [
   { text: "降序", value: "desc" }
 ];
 
-const get_info_type_color = (val) => {
-  if(val == "任务消息") {
-    return "info_type_2"
-  }
-  else if(['预警信息', '灾情信息', '灾情信息', '指挥救援', '公众防范'].includes(val)) {
-    return "info_type_3"
+const get_info_type_color = val => {
+  if (val == "任务消息") {
+    return "info_type_2";
+  } else if (
+    ["预警信息", "灾情信息", "灾情信息", "指挥救援", "公众防范"].includes(val)
+  ) {
+    return "info_type_3";
   }
-  return "info_type_0"
-}
+  return "info_type_0";
+};
 
 const onConfirmTime = () => {
   timeRef.value.toggle();
   queryParams.value.page = 0;
   getList();
-}
+};
 
 const onCancelTime = () => {
   timeRef.value.toggle();
-}
+};
 
 const timeRef = ref(null);
 const info_list = ref([]);
@@ -206,8 +225,8 @@ const queryParams = ref({
   page: 0,
   page_size: 5,
   info_type: "",
-  begin_time: dayjs().add(-3, 'month').format('YYYY-MM-DD').split("-"),
-  end_time: dayjs().format('YYYY-MM-DD').split("-"),
+  begin_time: dayjs().add(-3, "month").format("YYYY-MM-DD").split("-"),
+  end_time: dayjs().format("YYYY-MM-DD").split("-"),
   event_level: "",
   info_order: "desc",
   search_keyword: ""
@@ -235,16 +254,21 @@ const change_info_order = () => {
   getList();
 };
 
-const handleInfo = (item) => {
-  // router.push("/infoDetails?id=" + item.id);
-  router.push(item.detail.detail_url);
-}
+const handleInfo = item => {
+  if (item.msg_type === "值班消息") {
+    router.push({ name: "Duty" });
+  } else if (item.msg_type === "在线点名") {
+    router.push({ name: "rollCallRecord2" });
+  } else {
+    router.push(item.detail.detail_url);
+  }
+};
 
 const getList = () => {
   queryParams.value.page++;
   let params = queryParams.value;
-  params['begin_time_s'] = params.begin_time.join("-");
-  params['end_time_s'] = params.end_time.join("-");
+  params["begin_time_s"] = params.begin_time.join("-");
+  params["end_time_s"] = params.end_time.join("-");
   // console.log('params:', queryParams.value, params);
   MsgCenterList(params)
     .then(res => {
@@ -305,25 +329,25 @@ const getList = () => {
     padding: 0 12px 8px 90px;
     .item-title-text {
       font-size: 16px;
-      color: #414F64;
+      color: #414f64;
       font-weight: bold;
     }
 
     .info_type {
       font-size: 14px;
       padding: 3px 10px;
-      color:#fff;
+      color: #fff;
       position: absolute;
       top: 0;
       left: 0;
     }
 
     .info_type_0 {
-      background: #FFAF00;
+      background: #ffaf00;
     }
 
     .info_type_1 {
-      background: #FF1818;
+      background: #ff1818;
     }
 
     .info_type_2 {
@@ -331,17 +355,17 @@ const getList = () => {
     }
 
     .info_type_3 {
-      background: #FF9F9F;
+      background: #ff9f9f;
     }
 
     .info_type_4 {
-      background: #A4D3FF;
+      background: #a4d3ff;
     }
   }
   .item-content {
-      padding: 0 12px 12px;
-      font-size: 14px;
-      color: #414f64;
+    padding: 0 12px 12px;
+    font-size: 14px;
+    color: #414f64;
     .line-item {
       display: flex;
       padding: 3px 0;

+ 169 - 112
src/views/threePreventionResponsiblePerson/editPersonInformation.vue

@@ -2,10 +2,22 @@
   <div v-if="pageStatus === '0'" class="empty-box">
     <div class="empty-bg" />
     <div class="empty-text1">应急(三防)责任人信息填写</div>
-    <div class="empty-text2">为确保您能第一时间收到三防预警信息,请您花2-3<br/>分钟配合完成相关资料的填写,谢谢</div>
-    <van-button class="btn primary-btn2" :loading="submitting" type="primary" @click="pageStatus = '2'">开始填写</van-button>
+    <div class="empty-text2">
+      为确保您能第一时间收到三防预警信息,请您花2-3<br />分钟配合完成相关资料的填写,谢谢
+    </div>
+    <van-button
+      class="btn primary-btn2"
+      :loading="submitting"
+      type="primary"
+      @click="pageStatus = '2'"
+      >开始填写</van-button
+    >
   </div>
-  <person-information2 v-else-if="pageStatus === '1'" :form="form" @confirm="handleEdit" />
+  <person-information2
+    v-else-if="pageStatus === '1'"
+    :form="form"
+    @confirm="handleEdit"
+  />
   <div v-else class="common-form-container">
     <van-form @submit="onSubmit">
       <div class="form-item">
@@ -17,10 +29,10 @@
                 <div>姓名:</div>
               </div>
               <van-field
-                  v-model="form.name"
-                  class="common-field"
-                  placeholder="请输入姓名"
-                  :rules="rules.name"
+                v-model="form.name"
+                class="common-field"
+                placeholder="请输入姓名"
+                :rules="rules.name"
               />
             </div>
             <div class="item">
@@ -29,10 +41,10 @@
                 <div>手机号码:</div>
               </div>
               <van-field
-                  v-model="form.phone"
-                  class="common-field"
-                  placeholder="请输入手机号码"
-                  :rules="rules.phone"
+                v-model="form.phone"
+                class="common-field"
+                placeholder="请输入手机号码"
+                :rules="rules.phone"
               />
             </div>
             <div class="item">
@@ -41,15 +53,19 @@
                 <div>行政区划:</div>
               </div>
               <van-field
-                  v-model="form.area_name"
-                  class="common-field"
-                  placeholder="请选择行政区划"
-                  :rules="rules.area_code"
-                  :right-icon="selectIcon"
-                  readonly
-                  @click="showPicker = true"
+                v-model="form.area_name"
+                class="common-field"
+                placeholder="请选择行政区划"
+                :rules="rules.area_code"
+                :right-icon="selectIcon"
+                readonly
+                @click="showPicker = true"
+              />
+              <RegionSelect
+                v-model="showPicker"
+                :data="form.area_list"
+                @confirm="handleSelect"
               />
-              <RegionSelect v-model="showPicker" :data="form.area_list" @confirm="handleSelect" />
             </div>
             <div class="item">
               <div class="label-box">
@@ -57,10 +73,10 @@
                 <div>所属单位:</div>
               </div>
               <van-field
-                  v-model="form.unit_name"
-                  class="common-field"
-                  placeholder="请输入所属单位"
-                  :rules="rules.unit_name"
+                v-model="form.unit_name"
+                class="common-field"
+                placeholder="请输入所属单位"
+                :rules="rules.unit_name"
               />
             </div>
             <div class="item">
@@ -69,10 +85,10 @@
                 <div>职务:</div>
               </div>
               <van-field
-                  v-model="form.position"
-                  class="common-field"
-                  placeholder="请输入职务"
-                  :rules="rules.position"
+                v-model="form.position"
+                class="common-field"
+                placeholder="请输入职务"
+                :rules="rules.position"
               />
             </div>
             <div class="item">
@@ -81,10 +97,10 @@
                 <div>办公电话:</div>
               </div>
               <van-field
-                  v-model="form.telephone"
-                  class="common-field"
-                  placeholder="请输入办公电话"
-                  :rules="rules.telephone"
+                v-model="form.telephone"
+                class="common-field"
+                placeholder="请输入办公电话"
+                :rules="rules.telephone"
               />
             </div>
             <div class="item">
@@ -93,32 +109,52 @@
                 <div>责任类别:</div>
               </div>
               <van-field
-                  v-show="!responsibilityTypeText"
-                  v-model="responsibilityTypeText"
-                  class="common-field"
-                  :right-icon="selectIcon"
-                  readonly
-                  placeholder="请选择责任类别"
-                  :rules="rules.type_list"
-                  @click="showPicker2 = true"
+                v-show="!responsibilityTypeText"
+                v-model="responsibilityTypeText"
+                class="common-field"
+                :right-icon="selectIcon"
+                readonly
+                placeholder="请选择责任类别"
+                :rules="rules.type_list"
+                @click="showPicker2 = true"
               />
-              <div v-show="responsibilityTypeText" class="common-input" @click="showPicker2 = true">
-                <div v-for="(item, index) in form.type_list" :key="index" class="text-box">
+              <div
+                v-show="responsibilityTypeText"
+                class="common-input"
+                @click="showPicker2 = true"
+              >
+                <div
+                  v-for="(item, index) in form.type_list"
+                  :key="index"
+                  class="text-box"
+                >
                   <div class="text1">{{ item.type_parent }}</div>
                   <div class="text2">{{ getTypeLabel(item) }}</div>
                 </div>
               </div>
-              <responsibility-type v-model="showPicker2" :data="form.type_list" @confirm="onConfirm2" />
+              <responsibility-type
+                v-model="showPicker2"
+                :data="form.type_list"
+                @confirm="onConfirm2"
+              />
             </div>
           </div>
         </div>
       </div>
       <div v-if="pageStatus === '1'" class="common-form-footer">
-        <van-button class="btn primary-btn" type="primary" @click="handleEdit">编辑</van-button>
+        <van-button class="btn primary-btn" type="primary" @click="handleEdit"
+          >编辑</van-button
+        >
       </div>
       <div v-if="pageStatus === '2'" class="common-form-footer">
         <van-button class="btn" @click="onCancel">取消</van-button>
-        <van-button class="btn primary-btn" :loading="submitting" type="primary" native-type="submit">提交</van-button>
+        <van-button
+          class="btn primary-btn"
+          :loading="submitting"
+          type="primary"
+          native-type="submit"
+          >提交</van-button
+        >
       </div>
     </van-form>
   </div>
@@ -126,86 +162,96 @@
 
 <script lang="ts" setup name="EditPersonInformation">
 import selectIcon from "@/assets/images/selectIcon.png";
-import {showSuccessToast} from "vant";
+import { showSuccessToast } from "vant";
 import ResponsibilityType from "./responsibilityType.vue";
 import PersonInformation2 from "./personInformation2.vue";
-import {createPersonal, getPersonalSelfInfo, updatePersonal} from "@/api/persons";
-import {deepClone} from "@/utils";
+import {
+  createPersonal,
+  getPersonalSelfInfo,
+  updatePersonal
+} from "@/api/persons";
+import { deepClone } from "@/utils";
 
 // 页面状态 0缺省页 1详情 2新建、编辑
-let pageStatus = ref('1');
+let pageStatus = ref("1");
 // 表单数据
 const form = ref({
-  name: '',
-  phone: '',
-  area_code: '',
+  name: "",
+  phone: "",
+  area_code: "",
   area_list: [],
-  area_name: '',
-  unit_name: '',
-  position: '',
-  telephone: '',
+  area_name: "",
+  unit_name: "",
+  position: "",
+  telephone: "",
   type_list: []
 });
 // 表单校验规则
 const rules = reactive({
-  name: [{ required: true, message: '姓名不能为空' }],
-  phone: [{ required: true, message: '手机号码不能为空' }],
-  area_code: [{ required: true, message: '请选择行政区划' }],
-  unit_name: [{ required: true, message: '所属单位不能为空' }],
-  position: [{ required: true, message: '职务不能为空' }],
-  telephone: [{ required: true, message: '办公电话不能为空' }],
-  type_list: [{ required: true, message: '请选择责任类别' }]
+  name: [{ required: true, message: "姓名不能为空" }],
+  phone: [{ required: true, message: "手机号码不能为空" }],
+  area_code: [{ required: true, message: "请选择行政区划" }],
+  unit_name: [{ required: true, message: "所属单位不能为空" }],
+  position: [{ required: true, message: "职务不能为空" }],
+  telephone: [{ required: true, message: "办公电话不能为空" }],
+  type_list: [{ required: true, message: "请选择责任类别" }]
+});
+
+const props = defineProps({
+  isShowStructure: Boolean
 });
+const emits = defineEmits(["confirm"]);
 
 let showPicker = ref(false);
-const handleSelect = (data) => {
-  form.value.area_name = data.length > 0 ? data[data.length - 1].label : '';
-  form.value.area_code = data && data.length > 0 ? data[data.length - 1].id : '';
-}
+const handleSelect = data => {
+  form.value.area_name = data.length > 0 ? data[data.length - 1].label : "";
+  form.value.area_code =
+    data && data.length > 0 ? data[data.length - 1].id : "";
+};
 let showPicker2 = ref(false);
-let responsibilityTypeText = ref('');
+let responsibilityTypeText = ref("");
 // 选择责任类型
-const onConfirm2 = (data) => {
+const onConfirm2 = data => {
   showPicker2.value = false;
   if (data && data.length > 0) {
     form.value.type_list = data;
-    responsibilityTypeText.value = '1';
+    responsibilityTypeText.value = "1";
   } else {
     form.value.type_list = [data];
-    responsibilityTypeText.value = '';
+    responsibilityTypeText.value = "";
   }
 };
-const getTypeLabel = (item) => {
-  let str = !!item.labelData ? item.labelData.toString() : '';
+const getTypeLabel = item => {
+  let str = !!item.labelData ? item.labelData.toString() : "";
   if (!!item.dept_name) {
-    str += `(${item.dept_name})`
+    str += `(${item.dept_name})`;
   }
   if (!!item.denger_point_name) {
-    str += `(${item.denger_point_name})`
+    str += `(${item.denger_point_name})`;
   }
   if (!!item.other_type_2_name) {
-    str += `(${item.other_type_2_name})`
+    str += `(${item.other_type_2_name})`;
   }
   if (!!item.other_type_label && item.other_type_label.length > 0) {
-    str += '('
+    str += "(";
     item.other_type_label.forEach((item2, index2) => {
       if (index2 > 0) {
-        str += '、';
+        str += "、";
       }
       str += item2;
-    })
-    str += ')'
-  };
+    });
+    str += ")";
+  }
   return str;
 };
 const handleEdit = () => {
-  pageStatus.value = '2'
-}
+  pageStatus.value = "2";
+};
 // 是否在提交
 let submitting = ref(false);
 // 返回
 const onCancel = () => {
-  pageStatus.value = '1'
+  pageStatus.value = "1";
 };
 
 // 提交表单
@@ -213,31 +259,34 @@ const onSubmit = () => {
   if (submitting.value) return;
   submitting.value = true;
   const method = !form.value.id ? createPersonal : updatePersonal;
-  method(form.value).then(() => {
-    showSuccessToast('提交成功');
-    getInfo();
-  }).finally(() => {
-    submitting.value = false;
-  })
-}
+  method(form.value)
+    .then(() => {
+      showSuccessToast("提交成功");
+      getInfo();
+      emits("confirm");
+    })
+    .finally(() => {
+      submitting.value = false;
+    });
+};
 
 const getInfo = () => {
-  getPersonalSelfInfo().then((res) => {
+  getPersonalSelfInfo().then(res => {
     if (!!res.data && !!res.data.id) {
       if (res.data.type_list && res.data.type_list.length > 0) {
-        responsibilityTypeText.value = '1'
+        responsibilityTypeText.value = "1";
       }
       form.value = res.data;
-      pageStatus.value = '1';
+      pageStatus.value = "1";
     } else {
-      responsibilityTypeText.value = ''
-      pageStatus.value = '0';
+      responsibilityTypeText.value = "";
+      pageStatus.value = "0";
     }
-  })
-}
+  });
+};
 onMounted(() => {
-  getInfo()
-})
+  getInfo();
+});
 </script>
 
 <style lang="scss" scoped>
@@ -259,25 +308,32 @@ onMounted(() => {
       margin-right: 9px;
       flex-shrink: 0;
       .icon-name {
-        background: url('@/assets/images/threePreventionResponsiblePerson/name.png') no-repeat;
+        background: url("@/assets/images/threePreventionResponsiblePerson/name.png")
+          no-repeat;
       }
       .icon-phone {
-        background: url('@/assets/images/threePreventionResponsiblePerson/tel.png') no-repeat;
+        background: url("@/assets/images/threePreventionResponsiblePerson/tel.png")
+          no-repeat;
       }
       .icon-area {
-        background: url('@/assets/images/threePreventionResponsiblePerson/area.png') no-repeat;
+        background: url("@/assets/images/threePreventionResponsiblePerson/area.png")
+          no-repeat;
       }
       .icon-dept {
-        background: url('@/assets/images/threePreventionResponsiblePerson/dept.png') no-repeat;
+        background: url("@/assets/images/threePreventionResponsiblePerson/dept.png")
+          no-repeat;
       }
       .icon-duty {
-        background: url('@/assets/images/threePreventionResponsiblePerson/duty.png') no-repeat;
+        background: url("@/assets/images/threePreventionResponsiblePerson/duty.png")
+          no-repeat;
       }
       .icon-telephone {
-        background: url('@/assets/images/threePreventionResponsiblePerson/phone.png') no-repeat;
+        background: url("@/assets/images/threePreventionResponsiblePerson/phone.png")
+          no-repeat;
       }
       .icon-responsibility {
-        background: url('@/assets/images/threePreventionResponsiblePerson/responsibility.png') no-repeat;
+        background: url("@/assets/images/threePreventionResponsiblePerson/responsibility.png")
+          no-repeat;
       }
       .icon-name,
       .icon-phone,
@@ -311,7 +367,7 @@ onMounted(() => {
   }
 }
 .common-input {
-  border: 1px solid #DCE0EE;
+  border: 1px solid #dce0ee;
   border-radius: 2px;
   min-height: 30px;
   line-height: 30px;
@@ -319,7 +375,7 @@ onMounted(() => {
   padding: 0 18px 0 5px;
   position: relative;
   &::after {
-    content: '';
+    content: "";
     position: absolute;
     top: 50%;
     right: 0;
@@ -334,7 +390,7 @@ onMounted(() => {
   font-size: 16px;
   .text2 {
     font-size: 12px;
-    color: #A3A7AD;
+    color: #a3a7ad;
     letter-spacing: 0;
     line-height: 26px;
   }
@@ -347,7 +403,8 @@ onMounted(() => {
   .empty-bg {
     width: 220px;
     height: 190px;
-    background: url("@/assets/images/threePreventionResponsiblePerson/empty.png") no-repeat;
+    background: url("@/assets/images/threePreventionResponsiblePerson/empty.png")
+      no-repeat;
     background-size: 100% 100%;
   }
   .empty-text1 {
@@ -358,12 +415,12 @@ onMounted(() => {
   .empty-text2 {
     font-size: 14px;
     line-height: 26px;
-    color: #A3A7AD;
+    color: #a3a7ad;
     text-align: center;
     margin-bottom: 10px;
   }
   .primary-btn2 {
-     width: 320px;
+    width: 320px;
   }
 }
 </style>

+ 19 - 11
src/views/threePreventionResponsiblePerson/index.vue

@@ -10,7 +10,7 @@
     <div class="select-box">
       <div class="adress-box" @click="showStructure">
         <div class="blue-rectangle" />
-        <div class="block1" v-if="!!requestParameters.checkedId">
+        <div class="block1" v-if="!!requestParameters.area_code">
           <div>{{ upOneLevel }}</div>
           <div style="margin: 0 5px">{{ '>' }}</div>
           <div style="color: #1d92ff">{{ adressContent }}</div>
@@ -27,7 +27,7 @@
           is-link
           readonly
           placeholder="选择类型"
-          style="width: 122px"
+          class="choose"
           @click="showPicker = true"
         />
         <van-popup
@@ -99,7 +99,7 @@ import { getPersonalData, getPersonalType } from "@/api/persons";
 const router = useRouter();
 const keywords = ref("");
 let responsibility_type = ref([]);
-const fieldValue = ref("三防指挥部");
+const fieldValue = ref("所有类型");
 const showPicker = ref(false);
 const onConfirm = ({ selectedValues, selectedOptions }) => {
   showPicker.value = false; //用于控制 van-picker 组件的显示状态,将其设置为 false 表示隐藏选择器。
@@ -121,7 +121,7 @@ const requestParameters = ref({
   page: 1,
   pageSize: 10,
   Name: keywords,
-  checkedId: ""
+  area_code: ""
 });
 const persons = ref([]);
 const onLoad = () => {
@@ -146,11 +146,12 @@ const onLoad = () => {
   });
 };
 onMounted(() => {
-  getDicts("responsibility_type").then(res => {
-    res.data.unshift({ dictLabel: "所有类型", dictValue: "" });
-    responsibility_type.value = res.data;
-  });
+  // getDicts("responsibility_type").then(res => {
+  //   res.data.unshift({ dictLabel: "所有类型", dictValue: "" });
+  //   responsibility_type.value = res.data;
+  // });
   getPersonalType(requestParameters.value).then(res => {
+    res.data.unshift({ dictLabel: "所有类型", dictValue: "" });
     responsibility_type = res.data || [];
   });
 });
@@ -178,9 +179,13 @@ const filterNode = (value, data) => {
 };
 let selectedTreeId = ref([]);
 const handleSelect = (data) => {
-  adressContent.value = data.label;
-  upOneLevel.value = data.value;
-  requestParameters.value.checkedId = data.id;
+  if (data) {
+    adressContent.value = data.label;
+    upOneLevel.value = data.value;
+    requestParameters.value.area_code = data.id;
+  }
+  requestParameters.value.page = 1;
+  onLoad();
 };
 </script>
 
@@ -350,4 +355,7 @@ const handleSelect = (data) => {
   height: calc(100vh - 154px);
   overflow: scroll;
 }
+.choose {
+  width: 150px;
+}
 </style>

+ 3 - 3
src/views/threePreventionResponsiblePerson/organizationalStructure.vue

@@ -54,7 +54,7 @@
         </div>
       </div>
     </div>
-    <editPersonInformation v-if="isShowInformation" :isShowStructure="isShowStructure" @toHomepage="closeContent"/>
+    <editPersonInformation v-if="isShowInformation" :isShowStructure="isShowStructure" @confirm="closeContent" />
     <div class="footer">
       <div class="footer-item1">
         <img v-if="!isShowInformation" :src="archSel" style="height: 24px" />
@@ -93,7 +93,7 @@ import type Node from "element-plus/es/components/tree/src/model/node";
 import { getTree } from "@/api/tree";
 import EditPersonInformation from "@/views/threePreventionResponsiblePerson/editPersonInformation.vue";
 
-const propps = defineProps({
+const props = defineProps({
   isShowStructure: Boolean
 });
 const keywords = ref("");
@@ -135,8 +135,8 @@ const backToFram = () => {
   isShowInformation.value = false;
 };
 const closeContent = data1 => {
-  debugger;
   emits("update:isShowStructure", false);
+  emits("confirm");
 };
 
 interface Tree {

+ 1 - 10
src/views/threePreventionResponsiblePerson/personInformation.vue

@@ -31,7 +31,7 @@
                   {{ personalInformation.state === false ? "在线" : "离线" }}
                 </div>
               </div>
-              <div style="margin-top: 15px">行政区划:茂名市</div>
+              <div style="margin-top: 15px">行政区划:{{personalInformation.area_name}}</div>
             </div>
           </div>
         </div>
@@ -72,21 +72,12 @@ import { getPersonalCard } from "@/api/persons";
 
 const isShowInformation = ref(false);
 const personalInformation = ref({});
-const requestParameters = ref({
-  id: "",
-  name: "",
-  type: [],
-  type_parent_id: "",
-  checkedId: ""
-});
 const route = useRoute();
 const userId = ref(route.query.id);
 getPersonalCard(userId.value).then(res => {
   personalInformation.value = res.data || [];
 });
 
-
-// const personType = personalInformation.value.type.toString();
 const showPersonalInformation = item => {
   isShowInformation.value = true;
   personalInformation.value = item;