jiangping
2025-03-26 4ecdc50ae3deea4714b4638936ff8244f9839aff
h5/pages/visitorApplication/visitorApplication.vue
@@ -61,17 +61,12 @@
               <u-icon name="arrow-right" color="#CCCCCC" size="20"></u-icon>
            </view>
         </view>
         <view class="list_item">
         <!-- <view class="list_item">
            <view class="list_item_label">
               <text></text>
               <text>是否施工作业</text>
            </view>
            <view class="list_item_content">
               <!-- <switch color="#4e99a9" style="transform: scale(0.8)" @change="constructionChange" /> -->
<!--                <u-radio-group v-model="form1.type">
                  <u-radio label="是" :name="1" activeColor="#4d99a8" class="mr24" />
                  <u-radio label="否" :name="0" activeColor="#4d99a8" />
               </u-radio-group> -->
               <view class="checkbox_wrap">
                  <view class="check_item" @click="constructionChange(1)">
                     <text>是</text>
@@ -86,7 +81,7 @@
                  
               </view>
            </view>
         </view>
         </view> -->
         <view v-if="form1.type == '1'" class="list_item">
            <view class="list_item_label">
               <text></text>
@@ -430,7 +425,7 @@
            if (type === 'day') {
               return `${value}日`
            }
<<<<<<< HEAD
// <<<<<<< HEAD
            this.$forceUpdate()
            this.closeInput()
         },
@@ -555,10 +550,9 @@
                  title: '证件号码格式错误',
                  icon: 'none'
               })
=======
            }
            if (type === 'hour') {
               return `${value}时`
>>>>>>> f0f08cc1ff84d45de32d8bff4a40e6a7d0d7a9e6
            }
            if (type === 'minute') {
               return `${value}分`
@@ -791,7 +785,9 @@
         },
         selectedReason(e) {
            this.form1.reason = e.value[0].title
            this.form1.type = e.value[0].constructionType
            console.log(e.value[0].title)
            console.log(e.value[0].constructionType)
            this.showReason = false
         },
         submitCart() {
@@ -1442,329 +1438,6 @@
                  color: #222222;
               }
            }
<<<<<<< HEAD
            let arr = JSON.parse(JSON.stringify(this.withUserList))
            this.personnel.push(arr)
            this.show3 = false
            this.withUserList.name = ''
            this.withUserList.phone = ''
            this.withUserList.idcardType = ''
            this.withUserList.idcardTypeName = ''
            this.withUserList.companyName = ''
            this.withUserList.idcardNo = ''
            this.withUserList.faceImg = ''
            this.withUserList.faceImgUrl = ''
            this.withUserList.imgurl = ''
            this.withUserList.imgurlUrl = ''
         },
         upload(type) {
            this.type = type
            if (type === 'faceImg') {
               this.$refs.cropper.open()
               return
            }
            uni.chooseImage({
               success: (chooseImageRes) => {
                  // if (type === 'faceImg') {
                  //    this.photoSrc = chooseImageRes.tempFilePaths[0];
                  //    this.$refs.tlyPictureCut.showPop();
                  //    return
                  // }
                  uni.showLoading({ title: '上传中', mask: true });
                  for (let i = 0; i < chooseImageRes.tempFilePaths.length; i++) {
                     uni.uploadFile({
                        url: `${this.$baseUrl}public/api/uploadFtp.do`,
                        filePath: chooseImageRes.tempFilePaths[i],
                        name: 'file',
                        formData: {
                           folderCode: 'MEMBER_IMG'
                        },
                        success: (uploadFileRes) => {
                           let res = JSON.parse(uploadFileRes.data)
                           if (type === 'faceImg') {
                              this.withUserList.faceImg = res.data.halfPath
                              this.withUserList.faceImgUrl = res.data.prefixPath + res.data.folder + res.data.halfPath
                           } else {
                              this.withUserList.imgurl = res.data.halfPath
                              this.withUserList.imgurlUrl = res.data.prefixPath + res.data.folder + res.data.halfPath
                           }
                        },
                        complete() {
                           if (i === chooseImageRes.tempFilePaths.length - 1) {
                              uni.hideLoading();
                           }
                        }
                     });
                  }
               }
            });
         },
         seleIdcard(e) {
            this.withUserList.idcardType = e.value[0].id
            this.withUserList.idcardTypeName = e.value[0].name
            this.show6 = false
         },
         submitCart() {
            if (!this.carName) return uni.showToast({
               title: '请输入车牌号码',
               icon: 'none'
            })
            this.cars.push(this.carName)
            this.form1.carNos = this.cars.join(',')
            this.carName = ''
            this.show2 = false
         },
         deleCars(i) {
            this.cars.splice(i, 1)
            this.form1.carNos = this.cars.join(',')
         },
         submitMJ() {
            let arr = []
            let names = []
            this.columns.forEach(item => {
               if (item.active) {
                  arr.push(item.id)
                  names.push(item.name)
               }
            })
            if (arr.length === 0) return uni.showToast({
               title: '请选择门禁',
               icon: 'none'
            })
            this.form1.doorSelectName = names.join(',')
            this.form1.doors = arr.join(',')
            this.show = false
         },
         seleMJ(i) {
            this.columns.forEach((item,index) => {
               if (index === i) {
                  item.active = !item.active
               }
            })
         },
         openLC() {
            if (!this.form1.starttime) return uni.showToast({
               title: '请先选择入厂时间',
               icon: 'none'
            })
            this.show5 = true
         },
         setinDate(e) {
            this.form1.starttime = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM');
            this.maxTime = getDaysAfterDate(uni.$u.timeFormat(e.value, 'yyyy-mm-dd'), this.day - 1)
            this.show4 = false
         },
         setoutDate(e) {
            this.form1.endtime = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM');
            this.show5 = false
         },
         formatTimeStamp(date) {
             return Date.parse(new Date(`${date}`)) || Date.parse(new Date(`${date.replace(/-/g,'/')}`))
         },
         // 查询用户
         getUser() {
            if (this.verify === '0') {
               if (this.form1.phone1) {
                  this.$u.api.getVisitedMember({
                     mobile: this.form1.phone1
                  }).then(res => {
                     if (res.code === 200) {
                        this.form1.receptMemberId = res.data.id
                        this.form1.receptMemberName = res.data.name
                     }
                  })
               }
            } else {
               if (this.form1.phone1 && this.form1.receptMemberName) {
                  this.$u.api.getVisitedMember({
                     mobile: this.form1.phone1,
                     name: this.form1.receptMemberName
                  }).then(res => {
                     if (res.code === 200) {
                        this.form1.receptMemberId = res.data.id
                        this.form1.receptMemberName = res.data.name
                     }
                  })
               }
            }
         },
         // 被拜访人信息校验方式(0手机号单独校验 1手机号和姓名组合校验)
         getUserValid() {
            this.$u.api.getSystemDictData({
               dictCode: 'SYSTEM',
               label: 'BEVISITED_USER_VALID'
            }).then(res => {
               if (res.code === 200) {
                  this.verify = res.data.code
               }
            })
         },
         // 获取是否需要选择门禁/门禁列表
         getvisit() {
            this.$u.api.getSystemDictData({
               dictCode: 'SYSTEM',
               label: 'SELECT_DOORS_VISIT_REQUIRED'
            }).then(res => {
               if (res.code === 200) {
                  this.accessControl = res.data.code
                  if (res.data.code === '1') {
                     this.$u.api.deviceRoleList({ type: 1 })
                        .then(device => {
                           if (device.code === 200) {
                              if (device.data.length > 0) {
                                 device.data.forEach(item => {
                                    item.active = false
                                 })
                                 this.columns = device.data
                              }
                           }
                        })
                  }
               }
            })
         },
         confirm(e) {
            this.show = false
         }
      }
   }
</script>
<style>
   page {
      background-color: #F7F7F7 !important;
   }
   .u-upload__button {
      margin: 0 !important;
   }
</style>
<style lang="scss" scoped>
   .visit {
      width: 100%;
      .menjin {
         width: 100%;
         .respondent-title {
            width: 100%;
            height: 100rpx;
            line-height: 100rpx;
            text-align: center;
            font-size: 32rpx;
            font-weight: 500;
            color: #222222;
         }
         .list {
            width: 100%;
            height: 400rpx;
            display: flex;
            flex-direction: column;
            .list_item {
               width: 100%;
=======
            .checkbox_wrap{
>>>>>>> f0f08cc1ff84d45de32d8bff4a40e6a7d0d7a9e6
               display: flex;
               align-items: center;
               .check_item{
                  display: flex;
                  align-items: center;
                  margin-left: 20rpx;
               }
               image{
                  width: 42rpx;
                  height: 42rpx;
                  margin-left: 10rpx;
               }
            }
         }
      }
      .cate {
         width: 100%;
         padding: 30rpx;
         box-sizing: border-box;
         background-color: #ffffff;
         .cate_head {
            font-size: 32rpx;
            font-family: PingFangSC, PingFang SC;
            font-weight: 600;
            color: #222222;
         }
         .cate_list {
            width: 100%;
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            margin-top: 30rpx;
            .cate_list_item {
               height: 64rpx;
               padding: 0 20rpx;
               box-sizing: border-box;
               background-color: #eeeeee;
               border-radius: 4rpx;
               margin-right: 20rpx;
               margin-bottom: 20rpx;
               display: flex;
               align-items: center;
               &:last-child {
                  margin-right: 0 !important;
               }
               text {
                  font-size: 26rpx;
                  font-family: PingFangSC, PingFang SC;
                  font-weight: 400;
                  color: #333333;
                  margin-right: 30rpx;
               }
            }
         }
         .cate_add {
            width: 200rpx;
            height: 50rpx;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(2, 94, 239, 0);
            border-radius: 25rpx;
            border: 1rpx solid #4c99a8;
            font-size: 22rpx;
            font-family: PingFangSC, PingFang SC;
            font-weight: 400;
            margin-top: 20rpx;
            color: #4c99a8;
            margin: 0 auto;
         }
      }
      .zw {
         width: 100%;
         height: calc(env(safe-area-inset-bottom) + 118rpx);
      }
      .footer {
         width: 100%;
         padding: 0 30rpx;
         padding-bottom: env(safe-area-inset-bottom);
         box-sizing: border-box;
         margin-top: 80rpx;
         // position: fixed;
         // left: 0;
         // bottom: 30rpx;
         .footer_btn {
            width: 100%;
            height: 88rpx;
            line-height: 88rpx;
            text-align: center;
            background: #4c99a8;
            border-radius: 44rpx;
            font-size: 32rpx;
            font-weight: 600;
            color: #ffffff;
         }
      }
   }