瀏覽代碼

巡检模块优化

fanghuisheng 1 年之前
父節點
當前提交
a8bed03613

+ 2 - 2
src/App.vue

@@ -132,13 +132,13 @@ uni-page-refresh {
 
 //默认头部导航title样式
 :deep(.uni-page-head__title) {
-  font-size: 16px;
+  font-size: $uni-font-size-lg;
   font-weight: bold;
 }
 
 //uview-plus导航栏title样式
 :deep(.u-navbar__content__title) {
-  font-size: 16px;
+  font-size: $uni-font-size-lg;
   font-weight: bold;
 }
 

+ 3 - 3
src/components/list-test/list-test.vue

@@ -24,7 +24,7 @@
             <view class="text-grey site-tit">
               <text style="width: 260rpx" class="inOneLine">{{ item.siteName }}</text>
 
-              <text style="font-size: 28rpx; text-align: right"> ( 共{{ item.siteAlarmCount }}个未处理告警 ) </text>
+              <text style="font-size: 14px; text-align: right"> ( 共{{ item.siteAlarmCount }}个未处理告警 ) </text>
             </view>
           </view>
 
@@ -168,7 +168,7 @@ export default {
 };
 </script>
 
-<style>
+<style lang="scss">
 .showDetail {
   position: absolute;
   background: #fff;
@@ -178,6 +178,6 @@ export default {
   top: 42rpx;
   right: 0%;
   z-index: 3000000;
-  font-size: 28rpx;
+  font-size: $uni-font-size-base;
 }
 </style>

+ 1 - 1
src/components/oa-tabbar/index.vue

@@ -44,7 +44,7 @@ const tabbarList = ref([
     iconPath: "/static/images/tabBar/tab-info.png",
     selectedIconPath: "/static/images/tabBar/tab-info-blue.png",
     text: "消息",
-    dot: true,
+    dot: false,
   },
   {
     pagePath: "/pages/mine",

+ 6 - 2
src/components/oa-timeLine-item/index.vue

@@ -8,7 +8,7 @@
         <view class="title">
           {{ titleValue }}
         </view>
-        <view style="margin: auto"> </view>
+        <!-- <view style="margin: auto"> </view> -->
         <view class="time">
           {{ timeValue }}
         </view>
@@ -60,17 +60,21 @@ const { titleValue, timeValue, iconColor } = toRefs(props);
 
     .oa-timeLine-item-header-cont {
       display: flex;
-      width: 100%;
+      width: calc(100% - 18px - 15px);
       margin-left: 15px;
 
       .title {
         font-size: 15px;
         color: #000000;
+        overflow: hidden; //超出的文本隐藏
+        text-overflow: ellipsis; //溢出用省略号显示
+        white-space: nowrap; // 默认不换行;
       }
 
       .time {
         font-size: 14px;
         color: #b5b5b5;
+        margin-left: auto;
       }
     }
   }

+ 13 - 2
src/components/oa-upload/index.vue

@@ -3,7 +3,7 @@
   <view class="oa-upload" v-if="uploadCount == 1">
     <view v-if="uploadImage" class="uploadView" :style="uploadStyle">
       <view class="uploadUimage">
-        <u-image width="100%" height="100%" :src="uploadImage"></u-image>
+        <u-image width="100%" height="100%" :src="uploadImage" @click="handlePreviewImage(uploadImage)"></u-image>
       </view>
 
       <view v-if="!uploadCloseStatus" class="uploadViewClose" @click="uploadViewClose()">
@@ -19,7 +19,7 @@
   <view class="oa-upload" v-if="uploadCount > 1">
     <view class="uploadView" :style="uploadStyle" v-for="up in uploadList" :key="up">
       <view class="uploadUimage">
-        <u-image width="100%" height="100%" :src="up[uploadListSrc]"></u-image>
+        <u-image width="100%" height="100%" :src="up[uploadListSrc]" @click="handlePreviewImage(up[uploadListSrc])"></u-image>
       </view>
 
       <view v-if="!uploadCloseStatus" class="uploadViewClose" @click="uploadViewClose(up)">
@@ -82,6 +82,17 @@ const props = defineProps({
 
 const { uploadImage, uploadList, uploadListSrc, uploadStyle, uploadIconSize, uploadCloseStatus, uploadCount } = toRefs(props);
 
+/**
+ * @查看图片
+ * @点击事件
+ */
+function handlePreviewImage(url) {
+  uni.previewImage({
+    urls: [url],
+    current: url,
+  });
+}
+
 /**
  * @upload图片上传
  * @点击事件

+ 0 - 14
src/pages.json

@@ -106,20 +106,6 @@
             "enablePullDownRefresh": false
           }
         },
-        {
-          "path": "authority/index",
-          "style": {
-            "navigationBarTitleText": "授权",
-            "enablePullDownRefresh": false
-          }
-        },
-        {
-          "path": "test/index",
-          "style": {
-            "navigationBarTitleText": "",
-            "enablePullDownRefresh": false
-          }
-        },
         {
           "path": "invoicing/index",
           "style": {

+ 9 - 8
src/pages/business/mhxf/xunJian/plan/components/content.vue

@@ -18,7 +18,7 @@
                   checkboxChange(val, index);
                 }
               "
-              :disabled="xunJianStore.contentArray.siteList.inspectionStatus == 2"
+              :disabled="xunJianStore.inspectionStatus == 2"
               :activeColor="proxy.$settingStore.themeColor.color"
             >
               <view class="flex" style="width: 100%; flex-wrap: wrap">
@@ -31,37 +31,37 @@
 
             <view v-if="con.remarksBool == true" style="display: flex; height: 32px; line-height: 32px; white-space: nowrap">
               <span>备注:</span>
-              <u-input v-model="con.remarks" placeholder="请输入备注" :disabled="xunJianStore.contentArray.siteList.inspectionStatus == 2" customStyle="height:32px;"></u-input>
+              <u-input v-model="con.remarks" placeholder="请输入备注" :disabled="xunJianStore.inspectionStatus == 2" customStyle="height:32px;"></u-input>
             </view>
           </view>
           <view class="mt15" v-if="con.submissionMethod == 2">
             <u-radio-group placement="row" v-model="con.contentOptionListValue" :activeColor="proxy.$settingStore.themeColor.color">
               <view class="flex" style="width: 100%; flex-wrap: wrap">
                 <view class="mb15" style="width: 50%" v-for="option in con.contentOptionList" :key="option">
-                  <u-radio :disabled="xunJianStore.contentArray.siteList.inspectionStatus == 2" :label="option.optionName" :name="option.id"> </u-radio>
+                  <u-radio :disabled="xunJianStore.inspectionStatus == 2" :label="option.optionName" :name="option.id"> </u-radio>
                 </view>
               </view>
             </u-radio-group>
 
             <view v-if="con.remarksBool == true" style="display: flex; height: 32px; line-height: 32px; white-space: nowrap">
               <span>备注:</span>
-              <u-input v-model="con.remarks" placeholder="请输入备注" :disabled="xunJianStore.contentArray.siteList.inspectionStatus == 2" customStyle="height:32px;"></u-input>
+              <u-input v-model="con.remarks" placeholder="请输入备注" :disabled="xunJianStore.inspectionStatus == 2" customStyle="height:32px;"></u-input>
             </view>
           </view>
           <view class="mt15" v-if="con.submissionMethod == 3">
             <view class="mb15">
-              <u-textarea v-model="con.contentOptionListValue" placeholder="请输入" maxlength="30" :disabled="xunJianStore.contentArray.siteList.inspectionStatus == 2"></u-textarea>
+              <u-textarea v-model="con.contentOptionListValue" placeholder="请输入" maxlength="30" :disabled="xunJianStore.inspectionStatus == 2"></u-textarea>
             </view>
 
             <view v-if="con.remarksBool == true" style="display: flex; height: 32px; line-height: 32px; white-space: nowrap">
               <span>备注:</span>
-              <u-input v-model="con.remarks" placeholder="请输入备注" :disabled="xunJianStore.contentArray.siteList.inspectionStatus == 2" customStyle="height:32px;"></u-input>
+              <u-input v-model="con.remarks" placeholder="请输入备注" :disabled="xunJianStore.inspectionStatus == 2" customStyle="height:32px;"></u-input>
             </view>
           </view>
         </view>
       </view>
     </view>
-    <view class="app-button-fixed" v-if="xunJianStore.contentArray.siteList.inspectionStatus == 1">
+    <view class="app-button-fixed" v-if="xunJianStore.inspectionStatus == 1">
       <view class="app-flex">
         <u-button class="app-buttom" style="margin-right: 15px" shape="circle" @click="buttonClick(1)"> 上一步 </u-button>
 
@@ -167,6 +167,7 @@ async function buttonClick(type) {
       latitude: xunJianStore.contentArray.siteList.latitude,
       planSonId: xunJianStore.contentArray.siteList.planSonId,
       siteId: xunJianStore.contentArray.siteList.id,
+      remarks: xunJianStore.contentArray.siteList.remarks,
       recordPictureList: xunJianStore.contentArray.siteList.recordPictureList,
       recordOptionList: recordOptionList,
     };
@@ -185,7 +186,7 @@ async function buttonClick(type) {
 onLoad((options) => {
   contentList.value = xunJianStore.contentArray.contentList;
 
-  if (xunJianStore.contentArray.siteList.inspectionStatus == 2) {
+  if (xunJianStore.inspectionStatus == 2) {
     if (contentList.value.length > 0) {
       contentList.value.forEach((el) => {
         el.contentOptionListValue1 = [];

+ 56 - 11
src/pages/business/mhxf/xunJian/plan/components/drawer.vue

@@ -1,24 +1,23 @@
 <template>
-  <u-popup :show="scanBool" @close="close" @open="open" mode="bottom">
+  <u-popup class="porup-container" :show="scanBool" @close="close" @open="open" mode="bottom">
     <template #default>
-      <view class="mb15 mt15">
-        <h4 style="font-size: 16px; color: #149eff; text-align: center; margin-bottom: 10px">请选择计划</h4>
-        <view style="font-size: 12px; color: #b7b7b7; text-align: center"> 当前地点存在于多个计划,请选择目标计划 </view>
+      <view class="header-area mb15 mt15">
+        <h4 class="header-area-title">请选择计划</h4>
+        <view class="header-area-content"> 当前地点存在于多个计划,请选择目标计划 </view>
       </view>
-      <scroll-view scroll-y class="pl15 pr15" style="height: calc(100vh - 30rem)">
+      <scroll-view class="operate-area pl15 pr15" scroll-y>
         <view v-for="(scan, index) in scanArray" :key="index">
-          <view style="display: flex; font-size: 15px; height: 50px; line-height: 50px">
-            <view style="margin-right: 15px">
+          <view class="operate-area-content">
+            <view class="operate-area-content-icon">
               <img src="@/static/images/xunjian/plan-scan-drawer.png" alt="" />
             </view>
-            <view>{{ scan.planName }} </view>
-            <view style="margin: auto"></view>
-            <view style="margin: auto 0">
+            <view class="operate-area-content-title">{{ scan.planName }} </view>
+            <view class="operate-area-content-btn">
               <u-button type="primary" shape="circle" style="height: 25px; font-size: 13px" @click="reportClick(scan.siteId, scan.id)"> 上报 </u-button>
             </view>
           </view>
 
-          <view style="border-bottom: 1.5px #dad7d7 solid"></view>
+          <view class="operate-area-divider"></view>
         </view>
       </scroll-view>
     </template>
@@ -86,3 +85,49 @@ onLoad((options) => {});
 
 onMounted(() => {});
 </script>
+<style lang="scss" scoped>
+.porup-container {
+  .header-area {
+    &-title {
+      font-size: 16px;
+      color: #149eff;
+      text-align: center;
+      margin-bottom: 10px;
+    }
+
+    &-content {
+      font-size: 12px;
+      color: #b7b7b7;
+      text-align: center;
+    }
+  }
+  .operate-area {
+    height: calc(100vh - 30rem);
+    &-content {
+      display: flex;
+      font-size: 15px;
+      height: 50px;
+      line-height: 50px;
+
+      &-icon {
+        margin-right: 15px;
+      }
+
+      &-title {
+        max-width: 200px;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        white-space: nowrap;
+      }
+
+      &-btn {
+        margin: auto 0 auto auto;
+      }
+    }
+
+    &-divider {
+      border-bottom: 1px #dad7d7 solid;
+    }
+  }
+}
+</style>

+ 5 - 31
src/pages/business/mhxf/xunJian/plan/components/report.vue

@@ -21,8 +21,6 @@
           >
             {{ cu.inspectionStatus == 1 ? "未巡检" : "已巡检" }}
           </view>
-
-          <!-- "inspectionStatus": 2 //巡检状态(1 未巡检,2 已巡检) -->
         </view>
         <view style="font-size: 13px; color: #a1a1a1; margin-bottom: 5px"> 描述:{{ cu.siteDescribe == "" || cu.siteDescribe == null ? "无" : cu.siteDescribe }} </view>
         <view style="font-size: 13px; color: #a1a1a1">
@@ -74,38 +72,14 @@ const xunJianStore = xunJianStores(); //全局变量值Store
 
 function pulicClick(obj) {
   if (obj.inspectionStatus == 2) {
-    xunJianStore.contentArray = {};
-
-    recordList({
-      siteId: obj.id,
-      planSonId: xunJianStore.planSonId,
-    }).then((res) => {
-      if (res.status == "SUCCESS") {
-        if (res.data.length > 0) {
-          recordOption({
-            siteId: res.data[0].siteId,
-            recordId: res.data[0].id,
-          }).then((res1) => {
-            res.data[0].inspectionStatus = 2;
-            res.data[0].pictureUrl = obj.pictureUrl;
-
-            xunJianStore.contentArray = {
-              contentList: [res1.data.contentList],
-              siteList: res.data[0],
-            };
-            xunJianStore.siteId = "";
-            xunJianStore.siteNubmber = "";
+    xunJianStore.inspectionStatus = 2;
+    xunJianStore.siteId = obj.id;
 
-            uni.navigateTo({
-              url: "/pages/business/mhxf/xunJian/plan/components/siteDetails",
-            });
-          });
-        }
-      } else {
-      }
+    uni.navigateTo({
+      url: "/pages/business/mhxf/xunJian/plan/components/siteDetails",
     });
   } else {
-    xunJianStore.contentArray = {};
+    xunJianStore.inspectionStatus = 1;
     xunJianStore.siteId = obj.id;
     xunJianStore.siteNubmber = "";
 

+ 26 - 11
src/pages/business/mhxf/xunJian/plan/components/siteDetails.vue

@@ -28,7 +28,7 @@
             width: 'calc(33% - 10px)',
             height: '110px',
           }"
-          :uploadCloseStatus="siteList.inspectionStatus == 2"
+          :uploadCloseStatus="xunJianStore.inspectionStatus == 2"
           @uploadSuccessChange="uploadSuccessChange"
           @uploadDeleteChange="uploadDeleteChange"
         ></oa-upload>
@@ -38,24 +38,24 @@
         <uni-section class="block mb10" title="备注" type="line"></uni-section>
 
         <view style="height: calc(100% - 25px)">
-          <span v-if="siteList.inspectionStatus == 2">
+          <span v-if="xunJianStore.inspectionStatus == 2">
             {{ siteList.remarks }}
           </span>
 
-          <u-textarea v-if="siteList.inspectionStatus == 1" style="height: 100%" v-model="siteList.remarks" placeholder="请输入备注" maxlength="50"></u-textarea>
+          <u-textarea v-if="xunJianStore.inspectionStatus == 1" style="height: 100%" v-model="siteList.remarks" placeholder="请输入备注" maxlength="50"></u-textarea>
         </view>
       </view>
 
       <view class="bg-white p15 mb15">
-        <uni-section class="block mb10" title="消防设施分布图" type="line"></uni-section>
+        <uni-section class="block mb10" title="点位分布" type="line"></uni-section>
 
         <u-image width="100%" :src="siteList.pictureUrl"></u-image>
       </view>
     </view>
     <view class="app-button-fixed">
-      <u-button v-if="siteList.inspectionStatus == 1" class="app-buttom" type="primary" @click="buttonClick()" shape="circle"> 下一步 </u-button>
+      <u-button v-if="xunJianStore.inspectionStatus == 1" class="app-buttom" type="primary" @click="buttonClick()" shape="circle"> 下一步 </u-button>
 
-      <u-button v-if="siteList.inspectionStatus == 2" class="app-buttom" type="primary" @click="buttonClick()" shape="circle"> 查看巡检项 </u-button>
+      <u-button v-if="xunJianStore.inspectionStatus == 2" class="app-buttom" type="primary" @click="buttonClick()" shape="circle"> 查看巡检项 </u-button>
     </view>
   </scroll-view>
 </template>
@@ -65,7 +65,7 @@ import { onLoad, onShow } from "@dcloudio/uni-app";
 import { ref, onMounted, reactive, computed, getCurrentInstance, toRefs, inject, shallowRef } from "vue";
 import { useStores, commonStores, xunJianStores } from "@/store/modules/index";
 
-import { siteDetails } from "@/api/business/mhxf/xunJian/plan.js";
+import { recordList, recordOption, siteDetails } from "@/api/business/mhxf/xunJian/plan.js";
 
 const xunJianStore = xunJianStores(); //全局变量值Store
 
@@ -134,11 +134,26 @@ function uploadDeleteChange(e) {
 }
 
 onLoad((options) => {
-  if (JSON.stringify(xunJianStore.contentArray) == "{}") {
+  if (xunJianStore.inspectionStatus == 1) {
     selectAPI();
-  } else {
-    contentList.value = xunJianStore.contentArray.contentList[0];
-    siteList.value = xunJianStore.contentArray.siteList;
+  } else if (xunJianStore.inspectionStatus == 2) {
+    recordList({
+      siteId: xunJianStore.siteId,
+      planSonId: xunJianStore.planSonId,
+    }).then((res) => {
+      if (res.status == "SUCCESS") {
+        if (res.data.length > 0) {
+          recordOption({
+            siteId: res.data[0].siteId,
+            recordId: res.data[0].id,
+          }).then((res1) => {
+            contentList.value = res1.data.contentList;
+            siteList.value = res.data[0];
+          });
+        }
+      } else {
+      }
+    });
   }
 });
 

+ 11 - 28
src/pages/business/mhxf/xunJian/plan/index.vue

@@ -146,39 +146,20 @@ function monthSwitch(e) {
  * @点击事件
  */
 function reportClick(obj) {
+  xunJianStore.inspectionStatus = null;
+
   if (tabPosition.value == 0) {
     xunJianStore.planSonId = obj.id;
     uni.navigateTo({
       url: "/pages/business/mhxf/xunJian/plan/components/report",
     });
   } else if (tabPosition.value == 1) {
-    recordList({
-      siteId: obj.id,
-      planSonId: obj.planSonId,
-    }).then((res) => {
-      if (res.status == "SUCCESS") {
-        if (res.data.length > 0) {
-          recordOption({
-            siteId: res.data[0].siteId,
-            recordId: res.data[0].id,
-          }).then((res1) => {
-            res.data[0].inspectionStatus = 2;
-            res.data[0].pictureUrl = obj.pictureUrl;
-
-            xunJianStore.contentArray = {
-              contentList: [res1.data.contentList],
-              siteList: res.data[0],
-            };
-            xunJianStore.siteId = undefined;
-            xunJianStore.siteNubmber = undefined;
-
-            uni.navigateTo({
-              url: "/pages/business/mhxf/xunJian/plan/components/siteDetails",
-            });
-          });
-        }
-      } else {
-      }
+    xunJianStore.siteId = obj.siteId;
+    xunJianStore.planSonId = obj.planSonId;
+    xunJianStore.inspectionStatus = 2;
+
+    uni.navigateTo({
+      url: "/pages/business/mhxf/xunJian/plan/components/siteDetails",
     });
   }
 }
@@ -292,10 +273,12 @@ function activitiesApi() {
       if (res.status == "SUCCESS") {
         res.data.forEach((el) => {
           activities.value.push({
+            siteId: el.siteId,
+            planSonId: el.planSonId,
             areaName: el.areaName,
             siteName: el.siteName,
             contentCount: el.contentCount,
-            createTime: el.createTime.replace("T", " "),
+            createTime: el.createTime ? el.createTime.replace("T", " ") : el.createTime,
             siteStatus: el.siteStatus,
           });
         });

+ 0 - 13
src/pages/common/authority/index.vue

@@ -1,13 +0,0 @@
-<template>
-  <view style="text-align: center; padding-top: 100rpx">
-    <image src="@/static/images/index/chart3-2.png" style="width: 100rpx; height: 100rpx"></image>
-    <br />
-    <br />
-    <view>该用户权限尚未开通,请联系管理员!</view>
-  </view>
-</template>
-
-<script setup>
-</script>
-
-<style></style>

+ 0 - 103
src/pages/common/test/index.vue

@@ -1,103 +0,0 @@
-<template>
-  <view>
-    <view @tap="goCamera()" class="cameraButton"> 拍照按钮 </view>
-
-    <view class="uni-list list-pd">
-      <view class="uni-uploader__files">
-        <view v-for="(image, index) in imageList" :key="index" class="abc">
-          <view class="uni-uploader__file" style="inline-block">
-            <view class="delete" :style="{ 'z-index': 99 }" @tap="onDeleteClick(index)">x</view>
-            <view class="images-one">
-              <image class="uni-uploader__img image-bg" :src="image" :data-src="image" @tap="previewImage"></image>
-            </view>
-          </view>
-        </view>
-        <view class="uni-uploader__input-box" v-show="imageList.length > 0">
-          <view class="uni-uploader__input" @tap="onGetImgClick"></view>
-        </view>
-      </view>
-    </view>
-  </view>
-</template>
-
-<script>
-export default {
-  data() {
-    return {
-      imageList: [],
-    };
-  },
-  mounted() {},
-
-  //拍照
-  methods: {
-    // 删除图片
-    onDeleteClick(index) {
-      this.imageList.splice(index, 1);
-    },
-    // previewImage() {
-    // 	// 预览功能,相关博客有
-    // },
-
-    goCamera() {
-      const that = this;
-      uni.chooseImage({
-        count: 2, // 最多可以选择的图片张数,默认9
-        sizeType: ["original", "compressed"], //original 原图,compressed 压缩图,默认二者都有
-        sourceType: ["camera"], //album 从相册选图,camera 使用相机,默认二者都有。如需直接开相机或直接选相册,请只使用一个选项
-        success: function (res) {
-          var tempFilePaths = res.tempFilePaths[0];
-          alert(tempFilePaths);
-          const len = that.imageList.length;
-          if (len >= 2) {
-            uni.showToast({
-              title: "图片最多上传2张",
-            });
-          } else {
-            for (let i = 0; i < 2 - len; i++) {
-              if (res.tempFilePaths[i]) that.imageList.push(res.tempFilePaths[i]);
-            }
-          }
-        },
-      });
-    },
-  },
-};
-</script>
-
-<style>
-.cameraButton {
-  border: 1px solid red;
-  display: inline-block;
-  border-radius: 10rpx;
-  padding: 10rpx;
-}
-
-.images-one {
-  white-space: nowrap;
-  position: relative;
-  width: 150rpx;
-  height: 150rpx;
-  background-size: cover;
-  background-position: center;
-  vertical-align: middle;
-  font-size: 1.5em;
-  display: inline-block;
-  margin-right: 20rpx;
-}
-
-.image-bg {
-  position: absolute;
-  z-index: -1;
-  left: 0;
-  right: 0;
-  bottom: 0;
-  right: 0;
-  width: 100%;
-  height: 100%;
-}
-
-.abc {
-  display: inline-block;
-}
-</style>

+ 1 - 0
src/permission.js

@@ -19,6 +19,7 @@ const whiteList = [
   "/pages/common/repairReport/index",//报修申请
   "/pages/common/repairReport/record",//报修历史
   "/pages/common/evaluate/record",//服务评价
+  "/pages/common/NFC/index",//NFC读取
 ];
 
 // 检查地址白名单

+ 0 - 12
src/static/scss/global.scss

@@ -2,18 +2,6 @@
   text-align: center;
 }
 
-.font-13 {
-  font-size: 13px;
-}
-
-.font-12 {
-  font-size: 12px;
-}
-
-.font-11 {
-  font-size: 11px;
-}
-
 .text-grey1 {
   color: #888;
 }

+ 1 - 0
src/store/modules/xunJian.js

@@ -8,6 +8,7 @@ const xunJianStore = defineStore("xunJian", {
     planSonId1: null, //巡检计划页 子计划id
     siteNubmber: null, //巡检计划页 站点号码
     siteStatus: null, //巡检详情页 定位状态
+    inspectionStatus: null,//巡检页 是否已巡检状态 1.未巡检 2.已巡检
     contentArray: {},
 
     collectDataList: [], //巡检采集