libushang 2 tygodni temu
rodzic
commit
d46dbcc293

+ 18 - 0
src/api/duty/eventing.ts

@@ -77,3 +77,21 @@ export function getEventCasualties(data) {
     data: data
   });
 }
+
+
+// 列出应急干部
+export function listContact(params) {
+  return request({
+    url: "/api/emergency_plan/contact/list",
+    method: "get",
+    params: params
+  });
+}
+
+// 列出应急干部详情
+export function listInfo(id) {
+  return request({
+    url: "/api/emergency_plan/contact/info/"+id,
+    method: "get"
+  });
+}

+ 9 - 4
src/views/disasterRiskMonitor/cadreInformation.vue

@@ -22,7 +22,7 @@
             <div style="margin: 30px 15px">
               <div class="online-box">
                 <div style="font-size: 18px; font-weight: bold">
-                  {{ personalInformation.name }}
+                  {{ personalInformation.contactName }}
                 </div>
                 <div
                   class="isOnline"
@@ -37,7 +37,7 @@
         </div>
         <div class="unit1-box">
           <div class="text" style="margin: 5px 0">所属单位</div>
-          <div class="info-content">{{ personalInformation.unit_name }}</div>
+          <div class="info-content">{{ personalInformation.unitName }}</div>
         </div>
         <div class="unit1-box">
           <div class="text" style="margin: 5px 0">职务</div>
@@ -56,7 +56,7 @@
                   src="@/assets/images/index/videoImage2.png"
                   style="height: 20px"
               />
-              <div style="color: #5991d0; margin-left: 5px">视频</div>
+              <div style="color: #5991d0; margin-left: 5px" @click="callVideo(personalInformation.phone)">视频</div>
             </div>
           </div>
 
@@ -72,6 +72,7 @@ import profile from "@/assets/images/tempImage/用户.png";
 import offlineUser from "@/assets/images/threePreventionResponsiblePerson/offlineUsers.png";
 import onlineUser from "@/assets/images/threePreventionResponsiblePerson/onlineUsers.png";
 import { getPersonalCard } from "@/api/persons";
+import { listInfo } from "@/api/duty/eventing";
 
 const isShowInformation = ref(false);
 const personalInformation = ref({});
@@ -84,7 +85,7 @@ const requestParameters = ref({
 });
 const route = useRoute();
 const userId = ref(route.query.id);
-getPersonalCard(userId.value).then(res => {
+listInfo(userId.value).then(res => {
   personalInformation.value = res.data || [];
 });
 
@@ -93,6 +94,10 @@ const showPersonalInformation = item => {
   isShowInformation.value = true;
   personalInformation.value = item;
 };
+
+const callVideo = (number) => {
+  window.location.href = `weixin://dl/call?phone=${number}&type=video`;
+};
 </script>
 
 <style scoped lang="scss">

+ 42 - 9
src/views/disasterRiskMonitor/emergencyOfficials.vue

@@ -34,7 +34,7 @@
           finished-text="没有更多了"
           @load="onLoad"
       >
-        <div v-for="(item, index) in list" :key="item.id">
+        <div v-for="(item, index) in persons" :key="item.id">
           <div class="person-box2" @click="personInform(item)">
             <div class="circle">
               <img :src="onlineUser" alt="" />
@@ -74,7 +74,9 @@ import searchImg from "@/assets/images/search.png";
 import closeImg from "@/assets/images/close.png";
 import OrganizationalStructure from "@/views/threePreventionResponsiblePerson/organizationalStructure.vue";
 import { getPersonalData, getPersonalType } from "@/api/persons";
+import { listContact } from "@/api/duty/eventing";
 
+/*
 const list = ref([
   {
     id: "1",
@@ -157,6 +159,7 @@ const list = ref([
     expertType: "其它突发事件"
   }
 ]);
+*/
 const router = useRouter();
 const keywords = ref("");
 let responsibility_type = ref([]);
@@ -181,7 +184,7 @@ const requestParameters = ref({
   type_parent_id: "",
   page: 1,
   pageSize: 10,
-  Name: keywords,
+  contactName: keywords,
   checkedId: ""
 });
 const personInform = item => {
@@ -189,6 +192,7 @@ const personInform = item => {
 };
 const persons = ref([]);
 const onLoad = () => {
+  /*
   getPersonalData(requestParameters.value).then(res => {
     var item = res.data || [];
     // 重置 persons 数组(如果是第一页)
@@ -208,15 +212,44 @@ const onLoad = () => {
     requestParameters.value.page++;
     loading.value = false;
   });
+  */
+  listContact(requestParameters.value).then(res => {
+    var item = res.data || [];
+    // 重置 persons 数组(如果是第一页)
+    if (requestParameters.value.page == 1) {
+      persons.value = [];
+    }
+
+    // 将新数据添加到 persons 数组中
+    item.forEach((i)=>{
+      persons.value.push({
+        id: i.id,
+        name: i.contactName,
+        unit: i.unitName,
+        position: i.position,
+        phone:i.phone
+      })
+    });
+
+    // 检查是否加载了所有数据
+    if (persons.value.length >= res.total) {
+      finished.value = true;
+    } else {
+      finished.value = false;
+    }
+    requestParameters.value.page++;
+    loading.value = false;
+  });
 };
 onMounted(() => {
-  getDicts("responsibility_type").then(res => {
-    res.data.unshift({ dictLabel: "所有类型", dictValue: "" });
-    responsibility_type.value = res.data;
-  });
-  getPersonalType(requestParameters.value).then(res => {
-    responsibility_type = res.data || [];
-  });
+  // getDicts("responsibility_type").then(res => {
+  //   res.data.unshift({ dictLabel: "所有类型", dictValue: "" });
+  //   responsibility_type.value = res.data;
+  // });
+  //getPersonalType(requestParameters.value).then(res => {
+  //  responsibility_type = res.data || [];
+  //});
+  onLoad();
 });
 const onSearch = keywords => {
   requestParameters.value.page = 1;

+ 17 - 2
src/views/disasterRiskMonitor/expertinformation.vue

@@ -62,11 +62,11 @@
       <div class="button-style">
         <div class="button-one">
           <img src="@/assets/images/index/phoneImage.png" style="height: 30px" />
-          <div style="color: #546ee4">电话</div>
+          <div style="color: #546ee4" @click="callPhone(inform.mobile_phone)">电话</div>
         </div>
         <div class="button-two">
           <img src="@/assets/images/index/videoImage.png" style="height: 30px" />
-          <div style="color: #ffffff; margin-left: 5px">视频通话</div>
+          <div style="color: #ffffff; margin-left: 5px" @click="callVideo(inform.mobile_phone)">视频通话</div>
         </div>
       </div>
     </div>
@@ -77,9 +77,24 @@
 import onlineUser from "@/assets/images/threePreventionResponsiblePerson/onlineUsers.png";
 import offlineUser from "@/assets/images/threePreventionResponsiblePerson/offlineUsers.png";
 import {getExpertInfo} from "@/api/expert";
+import {showToast} from "vant";
+
 const route = useRoute();
 const inform = ref({});
 
+const callPhone = (number) => {
+  if (number == '') {
+    showToast('手机号码为空');
+  }
+  else {
+    window.location.href = `tel:${number}`;
+  }
+};
+
+const callVideo = (number) => {
+  window.location.href = `weixin://dl/call?phone=${number}&type=video`;
+};
+
 onMounted(() => {
   getExpertInfo(route.query.id).then((res) => {
     inform.value = res.data;

+ 2 - 2
src/views/worker/inspectionWork/patorlTaskResultAdd.vue

@@ -30,9 +30,9 @@
                 :rules="[{ required: false, message: '请填写备注信息'  }]"
             />
 
-            <van-field name="fileList" label="现场照片" label-align="top">
+            <van-field name="fileList" label="现场照片或视频" label-align="top">
                 <template #input>
-                    <ImageUpload v-model="point.fileList" :fileType="['png', 'jpeg', 'jpg']"/>
+                    <ImageUpload v-model="point.fileList" :fileType="['png', 'jpeg', 'jpg', 'mp4']"/>
                 </template>
             </van-field>
         </div>