Parcourir la source

增加场所消防列表页

guoqing il y a 1 an
Parent
commit
15d6e0bb11

+ 9 - 0
src/api/placeFirefighting/placeFirefighting.js

@@ -0,0 +1,9 @@
+import request from "@/utils/request";
+export default class placeFirefighting {
+    placeFirefightingList(params) {
+        return request.get(
+            `/religioussites/fire/fireEquipment/list`,
+            params
+        )
+    };
+}

+ 193 - 4
src/views/placeManage/placeFirefighting/placeFirefightingList.vue

@@ -1,13 +1,202 @@
 <template>
-  
+  <van-nav-bar
+    fixed
+    title="场所消防"
+    left-text=""
+    left-arrow
+    @click-left="onClickLeft"
+    @click-right="onClickright"
+    :style="{ 'background-color': selectColor }"
+  >
+    <template #right>
+      <van-icon name="plus" size="18" />
+    </template>
+  </van-nav-bar>
+
+  <div class="main">
+    <van-search
+      v-model="value"
+      show-action
+      label="设备名称"
+      placeholder="请输入搜索关键词"
+      @search="onSearch"
+    >
+      <template #action>
+        <div @click="onClickButton">搜索</div>
+      </template>
+    </van-search>
+    <van-list
+      v-model:loading="loading"
+      :finished="finished"
+      finished-text="没有更多了"
+      @load="onLoad"
+    >
+      <van-swipe-cell v-for="item in list" :key="item">
+        <div class="list-item" @click="placeFirefightingInfo(item.id)">
+          <div class="item_top">
+            <div class="item_top_left">
+              {{ item.name }}
+            </div>
+            <div class="item_top_right">
+              <span v-if="item.equipmentType == 0">灭火器</span>
+              <span v-if="item.equipmentType == 1">消防栓</span>
+              <span v-if="item.equipmentType == 2">自动喷淋</span>
+              <span v-if="item.equipmentType == 3">消防排烟口</span>
+              <span v-if="item.equipmentType == 4">消防通道</span>
+              <span v-if="item.equipmentType == 5">安全出口标示牌</span>
+              <span v-if="item.equipmentType == 6">防火卷帘门</span>
+              <span v-if="item.equipmentType == 7">烟感器</span>
+              <span v-if="item.equipmentType == 8">温感器</span>
+              <span v-if="item.equipmentType == 9">报警钟</span>
+              <span v-if="item.equipmentType == 10">应急灯</span>
+            </div>
+          </div>
+          <div class="item_center">
+            {{ item.position }}
+          </div>
+          <div class="item_down">
+            <div class="item_down_left">
+              {{ item.siteName }}
+            </div>
+            <div class="item_down_right">
+              {{ item.personInChargeName }}
+            </div>
+          </div>
+        </div>
+      </van-swipe-cell>
+    </van-list>
+  </div>
 </template>
 
 <script>
+import { onMounted, ref } from "vue";
+import { useRouter } from "vue-router";
+import placeFirefighting from "@/api/placeFirefighting/placeFirefighting";
 export default {
-
-}
+  setup() {
+    // 导航栏颜色
+    const selectColor = ref(window.localStorage.getItem("MZ_COLOR"));
+    //返回取消按钮
+    const onClickLeft = () => {
+      history.back();
+    };
+    //搜索
+    const value = ref("");
+    //初始化列表
+    const list = ref([]);
+    const loading = ref(false);
+    const finished = ref(false);
+    let index = 0;
+    const onLoad = () => {
+      loading.value = true;
+      finished.value = false;
+      // 异步更新数据
+      new placeFirefighting()
+        .placeFirefightingList({
+          current: index + 1,
+          size: 10,
+        })
+        .then(({ records, pages }) => {
+          list.value = list.value.concat(records);
+          // 加载状态结束
+          loading.value = false;
+          if (index + 1 >= pages) {
+            finished.value = true;
+          }
+          index++;
+        });
+    };
+    // 进入消防设备添加页面
+    let router = useRouter();
+    const onClickright = () => {
+      router.push("/placeFirefightingView");
+    };
+    //进入消防设备详情页面
+    const placeFirefightingInfo = (item) => {
+      var data = JSON.stringify(item);
+      router.push({
+        path: "/placeFirefightingInfo",
+        query: { id: data },
+      });
+    };
+    return {
+      selectColor,
+      onClickLeft,
+      onClickright,
+      //搜索
+      value,
+      //初始化列表
+      list,
+      loading,
+      finished,
+      onLoad,
+      //进入详情页
+      placeFirefightingInfo,
+    };
+  },
+};
 </script>
 
-<style>
+<style lang='less'>
+body,
+html {
+  margin: 0;
+  padding: 0;
+  background-color: #f2f2f2;
+}
+.main {
+  .list-item {
+    background-color: #fff;
+    padding: 10px;
+    margin-bottom: 5px;
+    overflow: hidden;
+    .item_top {
+      width: 100%;
+      overflow: hidden;
+      .item_top_left {
+        float: left;
+        width: 80%;
+        font-size: 16px;
+        font-weight: 700;
 
+      }
+      .item_top_right {
+        float: right;
+        width: 20%;
+        font-size: 16px;
+        color: #000000;
+        white-space: nowrap;
+        overflow: hidden;
+        text-overflow: ellipsis;
+      }
+    }
+    .item_center {
+      width: 100%;
+      font-size: 16px;
+      color: #a2a2a2;
+      text-align: left;
+      padding: 10px 0;
+      overflow: hidden;
+    }
+    .item_down {
+      overflow: hidden;
+      width: 100%;
+      font-size: 16px;
+      border-bottom: 1px solid #f5f5f5;
+      .item_down_left {
+        width: 70%;
+        float: left;
+        color: #000000;
+        white-space: nowrap;
+        overflow: hidden;
+        text-overflow: ellipsis;
+      }
+      .item_down_right {
+        width: 30%;
+        text-align: center;
+        float: left;
+      }
+    }
+  }
+}
 </style>

+ 83 - 4
src/views/placeManage/placeFirefighting/placeFirefightingView.vue

@@ -1,13 +1,92 @@
 <template>
-  
+  <van-nav-bar
+    fixed
+    title="消防设备添加"
+    left-text=""
+    left-arrow
+    @click-left="onClickLeft"
+    :style="{ 'background-color': selectColor }"
+  >
+  </van-nav-bar>
+  <div class="main">
+    <van-form @submit="submit" show-error :show-error-message="false">
+      <van-cell-group>
+        <van-field
+          v-model="inputForm.name"
+          center
+          required
+          :rules="[{ required: true }]"
+          label="设备名称:"
+          placeholder="请填写设备名称"
+          input-align="right"
+        />
+      </van-cell-group>
+      <div class="subbtn">
+        <van-button type="primary" native-type="submit">提交</van-button>
+        <van-button @click="onClickLeft" type="default" hairline
+          >取消</van-button
+        >
+      </div>
+    </van-form>
+  </div>
 </template>
 
 <script>
+import { onMounted, ref } from "vue";
+import { useRouter } from "vue-router";
+import placeFirefighting from "@/api/placeFirefighting/placeFirefighting";
 export default {
-
-}
+  setup() {
+    const inputForm = ref({
+      id: "",
+      name: "",
+      siteId: "",
+      personInCharge: "",
+      contactInformation: "",
+      equipmentType: "",
+      devicePicture: "",
+      effectiveDate: [],
+      effectiveDateStart: "",
+      effectiveDateEnd: "",
+      nextMaintenanceDate: "",
+      position: "",
+    });
+    // 导航栏颜色
+    const selectColor = ref(window.localStorage.getItem("MZ_COLOR"));
+    //返回取消按钮
+    const onClickLeft = () => {
+      history.back();
+    };
+    //数据提交
+    const submit = () => {
+      //保存前附件处理
+      inputForm.value.workPicture = fileImg.value
+        .map((option) => option.id)
+        .join("|");
+      new placePerson().save(inputForm.value).then((res) => {
+        console.log(res);
+        if (res.status == 200) {
+          xm.showToast({
+            message: "人员添加成功",
+          });
+          router.push({
+            path: "/placePerson",
+          });
+        } else {
+          xm.showToast({
+            message: "人员添加失败",
+          });
+        }
+      });
+    };
+    return {
+      selectColor,
+      onClickLeft,
+      submit,
+    };
+  },
+};
 </script>
 
 <style>
-
 </style>

+ 0 - 2
src/views/placeManage/placeRegister/placeRegister.vue

@@ -378,8 +378,6 @@
               <van-field
                 v-model="inputForm.teachingStaff"
                 center
-                required
-                :rules="[{ required: true }]"
                 clearable
                 label-width="7em"
                 label="主要教职人员:"

+ 0 - 2
src/views/placeManage/placeRegister/placeRegisterInfo.vue

@@ -382,9 +382,7 @@
               <van-field
                 v-model="dataitem.teachingStaff"
                 center
-                required
                 clearable
-                :rules="[{ required: true }]"
                 label-width="7em"
                 label="主要教职人员:"
                 input-align="right"

+ 0 - 2
src/views/placeManage/placeRegister/placeRegisterList.vue

@@ -162,12 +162,10 @@ export default {
     //搜索事件
     const show = ref(false);
     const searchList = ref([]);
-
     const search1 = () => {
       searchList.value = [];
       search();
     }
-
     const search = () => {
       loading.value = true;
       finished.value = false;

+ 0 - 6
src/views/placeManage/placeTablet/placeTabletAdd.vue

@@ -102,8 +102,6 @@
       <van-field
         v-model="inputForm.udCard"
         center
-        required
-        :rules="[{ required: true }]"
         label="身份证号:"
         placeholder="请填写身份证号"
         input-align="right"
@@ -113,8 +111,6 @@
       <van-field
         v-model="inputForm.nativePlace"
         readonly
-        required
-        :rules="[{ required: true }]"
         label="籍贯:"
         placeholder="请选择籍贯地区"
         input-align="right"
@@ -136,8 +132,6 @@
         v-model="inputForm.currentResidence"
         center
         readonly
-        required
-        :rules="[{ required: true }]"
         label="现居地:"
         placeholder="请填写现居地"
         input-align="right"

+ 0 - 4
src/views/placeManage/placeTablet/placeTabletInfo.vue

@@ -107,8 +107,6 @@
         <van-field
           v-model="dataitem.udCard"
           center
-          required
-          :rules="[{ required: true }]"
           label="身份证号:"
           placeholder="请填写身份证号"
           input-align="right"
@@ -118,7 +116,6 @@
         <van-field
           v-model="dataitem.nativePlace"
           readonly
-          :rules="[{ required: true }]"
           label="籍贯:"
           placeholder="请选择籍贯地区"
           input-align="right"
@@ -140,7 +137,6 @@
           v-model="dataitem.currentResidence"
           center
           readonly
-          :rules="[{ required: true }]"
           label="现居地:"
           placeholder="请填写现居地"
           input-align="right"