MrShi
2024-01-16 c824e3bcb34f8b6f3c1435ddca91130367dc3729
h5/pages/visitorApplication/visitorApplication.vue
@@ -59,8 +59,17 @@
               <input type="text" v-model="form1.reason" placeholder="请输入来访事由,您来做什么的" placeholder-style="color: #999999;" />
            </view>
         </view>
         <view class="list_item">
            <view class="list_item_label">
               <text>随行车辆</text>
               <text></text>
            </view>
            <view class="list_item_content">
               <input type="text" placeholder="请输入车牌号" v-model="form1.carNos" maxlength="8" placeholder-style="color: #999999;" />
            </view>
         </view>
      </view>
      <view class="cate">
      <!-- <view class="cate">
         <view class="cate_head">车辆信息</view>
         <view class="cate_list">
            <view class="cate_list_item" v-for="(item, index) in cars" :key="index">
@@ -69,7 +78,7 @@
            </view>
         </view>
         <view class="cate_add" @click="show2 = true">+添加车辆</view>
      </view>
      </view> -->
      <view class="cate">
         <view class="cate_head">随访人员信息</view>
         <view class="cate_list">
@@ -101,7 +110,7 @@
         @confirm="setoutDate"
      ></u-datetime-picker>
      <!-- 门禁 -->
      <u-popup :show="show" :round="10" :safeAreaInsetBottom="true" :closeable="true" mode="bottom" @close="show = false">
      <u-popup :show="show" :round="10" :safeAreaInsetBottom="true" :closeable="true" mode="bottom" @close="closeMJ">
         <view class="menjin">
            <view class="respondent-title">
               选择门禁
@@ -109,12 +118,12 @@
            <scroll-view scroll-y class="list">
               <view class="list_item" v-for="(item, index) in columns" :key="index" @click="seleMJ(index)">
                  <text>{{item.name}}</text>
                  <image src="@/static/video@2x.png" mode="widthFix" v-show="!item.active"></image>
                  <image src="@/static/video_sel@2x.png" mode="widthFix" v-show="item.active"></image>
                  <image src="@/static/checkbox@2x.png" mode="widthFix" v-show="!item.active"></image>
                  <image src="@/static/checkbo1x_sel@2x.png" mode="widthFix" v-show="item.active"></image>
               </view>
            </scroll-view>
            <view class="menjin_footer">
               <view class="menjin_footer_item" @click="show = false">取消</view>
               <view class="menjin_footer_item" @click="closeMJ">取消</view>
               <view class="menjin_footer_item" @click="submitMJ">确认</view>
            </view>
         </view>
@@ -235,8 +244,8 @@
               <view class="adduser_list_item">
                  <view class="adduser_list_item_label1">
                     <text class="cc">人脸照片<b>*</b></text>
                     <text class="aa">1、请提供五官清晰,人脸居中的正面人脸免</text>
                     <text class="aa">2、照片无逆光、无PS、无过度美颜处理</text>
                     <text class="aa">1、请提供五官清晰,人脸居中的正面人脸免冠照片;</text>
                     <text class="aa">2、照片无逆光、无PS、无过度美颜处理;</text>
                  </view>
                  <view class="adduser_list_item_ipt">
                     <view class="adduser_list_item_ipt1_upload" @click="upload('faceImg')" v-if="!withUserList.faceImgUrl">
@@ -326,6 +335,12 @@
         this.getUserValid()
      },
      methods: {
         closeMJ() {
            this.show = false
            this.columns.forEach(item => {
               item.active = false
            })
         },
         submit() {
            if (!this.form1.receptMemberId) return uni.showToast({
               title: '被访人不能为空',
@@ -343,10 +358,12 @@
               title: '访问门禁不能为空',
               icon: 'none'
            })
            if (!this.form1.reason) return uni.showToast({
               title: '拜访事由不能为空',
               icon: 'none'
            })
            // if (!this.form1.reason) return uni.showToast({
            //    title: '拜访事由不能为空',
            //    icon: 'none'
            // })
            this.form1.starttime = this.form1.starttime + ':00'
            this.form1.endtime = this.form1.endtime + ':00'
            this.$u.api.createFk({
               ...this.form,
               ...this.form1,
@@ -381,6 +398,11 @@
               title: '手机号不能为空',
               icon: 'none'
            })
            const regExp = /^1[3456789]\d{9}$/;
            if (!regExp.test(this.withUserList.phone)) return uni.showToast({
               title: '手机号格式错误',
               icon: 'none'
            })
            if (!String(this.withUserList.idcardType)) return uni.showToast({
               title: '证件类型不能为空',
               icon: 'none'
@@ -389,6 +411,13 @@
               title: '证件号码不能为空',
               icon: 'none'
            })
            if (this.withUserList.idcardType === 0) {
               const regex = /^[1-9]\d{5}(19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2]\d|3[0-1])\d{3}[\dxX]$/;
               if (!regex.test(this.withUserList.idcardNo)) return uni.showToast({
                  title: '证件号码格式错误',
                  icon: 'none'
               })
            }
            if (!this.withUserList.faceImg) return uni.showToast({
               title: '人脸照片不能为空',
               icon: 'none'
@@ -489,11 +518,11 @@
            })
         },
         setinDate(e) {
            this.form1.starttime = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM:ss');
            this.form1.starttime = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM');
            this.show4 = false
         },
         setoutDate(e) {
            this.form1.endtime = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM:ss');
            this.form1.endtime = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM');
            this.show5 = false
         },
         // 查询用户
@@ -658,7 +687,7 @@
               align-items: center;
               justify-content: space-between;
               .adduser_list_item_label1 {
                  flex-shrink: 0;
                  flex: 1;
                  display: flex;
                  flex-direction: column;
                  .cc {
@@ -700,7 +729,7 @@
                  }
               }
               .adduser_list_item_ipt {
                  flex: 1;
                  flex-shrink: 0;
                  text-align: right;
                  font-size: 28rpx;
                  font-family: PingFangSC, PingFang SC;