Lou
2024-04-25 fa2f2580c2338938be1425f7efc431547d4c9e60
subPackage/school/security.vue
@@ -1,13 +1,13 @@
<template>
   <view class="wrap">
      <!-- <view class="info-row flex j-c-s-b a-i-c" @click="isShowPopup = true">
      <view class="info-row flex j-c-s-b a-i-c bgc-ff" @click="isShowPopup = true">
         <text class="f-28">场所名称</text>
         <view class="flex">
            <text class="mr-10">{{selectedPlace.placeName}}</text>
            <u-icon name="arrow-right"></u-icon>
         </view>
      </view> -->
      </view>
      <view class="section mb-20">
         <u-collapse :value="itemIndex" ref="collapse">
@@ -19,12 +19,12 @@
                     </view>
                     <u-form-item labelWidth="90" prop="gateStatus">
                        <view class="btn-group flex">
                           <view class="value-item" :class="i.state == 0?'active bgc-main c-ff':''"
                              @click="changeStatus(0,i,index,k)">
                              是
                           </view>
                           <view class="value-item" :class="i.state == 1?'active bgc-main c-ff':''"
                              @click="changeStatus(1,i,index,k)">
                              是
                           </view>
                           <view class="value-item" :class="i.state == 0?'active bgc-main c-ff':''"
                              @click="changeStatus(0,i,index,k)">
                              否
                           </view>
                        </view>
@@ -125,7 +125,8 @@
<script>
   import uploadMixin from "@/mixin/uploadMixinPlace";
   import {
      getPlaceCheckItem
      getPlaceCheckItem,
      getLocationRecord
   } from "@/api/place/place.js"
   import {
@@ -184,8 +185,8 @@
            dangerCount: 0, //隐患项数量
            isEdit: false,
            isShowPopup: false,
            selectedPlace: {}
            selectedPlace: {},
            placeList: [],
         }
      },
      async onLoad(option) {
@@ -195,10 +196,11 @@
            this.getDetail(option.taskId)
         } else {
            this.info.houseCode = "d8460d16ec5a40ccbfe64ba65d34159c7427";
            this.info.placeName = "塔水小学"
            this.info.placeName = "校学小学场所"
            // this.info.houseCode = uni.getStorageSync("siteInfo").houseCode;
            // this.info.placeName = uni.getStorageSync("siteInfo").name;
         }
         this.getPlaceList();
         // if (option.houseCode) {
         //    this.info.houseCode = option.houseCode;
         // }
@@ -206,6 +208,20 @@
      },
      methods: {
         getPlaceList() {
            getLocationRecord({
               roleName: uni.getStorageSync('activeRole').roleName,
               current: 1,
               size: 10,
               isPerfect: 2,
               placeName: this.placeName,
               isNine: 1
            }).then(res => {
               this.placeList = res.data.records;
            })
         },
         getDetail(id) {
            getPlaceCheckDetail({
@@ -295,7 +311,7 @@
                        // remark: this.questionList[i].children[k].remark || "",
                        type: 3
                     })
                     if (this.questionList[i].children[k].state == 1) {
                     if (this.questionList[i].children[k].state == 0) {
                        count += 1;
                     }
                  }
@@ -411,38 +427,38 @@
               })
               this.info.rectificationNoticeImgUrl = urls.join(",")
            }
            if (this.getSelected().length < this.count) {
               this.$showTips("还未完善");
               return;
            }
            this.info.taskPlaceRecordVOList = this.getSelected()
            if (this.dangerCount == 0) {
               this.info.status = 2;
               if (!this.form.images.length) {
                  this.$showTips("请上传整改文件");
                  return;
               }
               if (!this.info.rectificationEndTime) {
                  this.$showTips("请选择整改时间");
                  return;
               }
            }
            this.info.type = 2;
            if (this.isEdit) {
               auditPlaceCheck(this.info).then(res => {
                  uni.hideLoading();
                  uni.showToast({
                     icon: 'success',
                     title: '提交成功',
                     success() {
                        setTimeout(() => {
                           uni.navigateBack();
                        }, 300)
                     }
                  })
            savePlaceCheck(this.info).then(res => {
               uni.hideLoading();
               uni.showToast({
                  icon: 'success',
                  title: '提交成功',
                  success() {
                     setTimeout(() => {
                        uni.navigateBack();
                     }, 300)
                  }
               })
            } else {
               savePlaceCheck(this.info).then(res => {
                  uni.hideLoading();
                  uni.showToast({
                     icon: 'success',
                     title: '提交成功',
                     success() {
                        setTimeout(() => {
                           uni.navigateBack();
                        }, 300)
                     }
                  })
               })
            }
            })
         },
         previewImg() {
@@ -463,6 +479,24 @@
            })
         },
         searchPlace() {
            this.getPlaceList()
         },
         clearKeyword() {
            this.placeName = ""
            this.getPlaceList()
         },
         selectPlace(item) {
            this.selectedPlace = item;
            this.info.houseCode = item.houseCode;
            this.isShowPopup = false;
         },
      }
   }
</script>
@@ -478,6 +512,11 @@
         margin: 20rpx 20rpx 0;
         background-color: #fff;
      }
   }
   .info-row {
      margin: 20rpx 20rpx 0;
      padding: 20rpx;
   }
   .top {
@@ -638,4 +677,32 @@
      color: #fff;
      margin-top: 50rpx;
   }
   .popup-content {
      width: 100%;
      padding: 0 30rpx 30rpx;
      box-sizing: border-box;
      .popup-title {
         padding: 30rpx 0;
         text-align: center;
         font-weight: bold;
      }
      .popup-list {
         height: 650rpx;
      }
      .popup-list-item {
         padding: 20rpx 0;
         border-bottom: 1px solid #f1f1f1;
         position: relative;
      }
      .check-icon {
         position: absolute;
         right: 20rpx;
         top: 20rpx;
      }
   }
</style>