jiangping
2024-05-15 ccf69ee82f77a2e67a565cec02f95e64324a283f
h5/pages/visitorApplication/visitorApplication.vue
@@ -2,13 +2,13 @@
   <view class="visit">
      <view class="head">拜访信息</view>
      <view class="list">
         <view class="list_item">
         <!-- <view class="list_item">
            <view class="list_item_label">
               <text>被访人手机</text>
               <text>*</text>
            </view>
            <view class="list_item_content">
               <input type="number" maxlength="11" v-model="form1.phone1" placeholder="请输入手机号" @blur="getUser" placeholder-style="color: #999999;" />
               <input type="number" maxlength="11" v-model="form1.phone1" :placeholder="verify == '0' ? '输入手机号后自动获取' : '请输入手机号'" @blur="getUser" placeholder-style="color: #999999;" />
            </view>
         </view>
         <view class="list_item">
@@ -18,6 +18,16 @@
            </view>
            <view class="list_item_content">
               <input type="text" placeholder="请输入姓名" v-model="form1.receptMemberName" @blur="getUser" 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" @click="showName = true">
               <text :style="{color: form1.name ? '#000000' : ''}">{{form1.name ? form1.name : '请选择'}}</text>
               <u-icon name="arrow-right" color="#CCCCCC" size="20"></u-icon>
            </view>
         </view>
         <view class="list_item">
@@ -35,7 +45,7 @@
               <text>离厂时间</text>
               <text>*</text>
            </view>
            <view class="list_item_content" @click="show5 = true">
            <view class="list_item_content" @click="openLC">
               <text :style="{color: form1.endtime ? '#000000' : ''}">{{form1.endtime ? form1.endtime : '请选择'}}</text>
               <u-icon name="arrow-right" color="#CCCCCC" size="20"></u-icon>
            </view>
@@ -51,13 +61,32 @@
               <u-icon name="arrow-right" color="#CCCCCC" size="20"></u-icon>
            </view>
         </view>
         <div class="empty"></div>
         <view class="list_item">
            <view class="list_item_label">
               <text>拜访事由</text>
               <text>*</text>
            </view>
            <view class="list_item_content">
               <input type="text" v-model="form1.reason" placeholder="请输入来访事由,您来做什么的" placeholder-style="color: #999999;" />
               <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">
               <switch color="#4e99a9" style="transform:scale(0.8)" @change="constructionChange" />
            </view>
         </view>
         <view class="list_item">
            <view class="list_item_label">
               <text>施工内容</text>
               <text>*</text>
            </view>
            <view class="list_item_content">
               <input type="text" v-model="form1.ss" placeholder="请输入施工内容" placeholder-style="color: #999999;" />
            </view>
         </view>
         <view class="list_item">
@@ -105,8 +134,9 @@
      ></u-datetime-picker>
      <!-- 离场时间 -->
      <u-datetime-picker
         v-if="form1.starttime"
         :show="show5"
         :minDate="new Date().getTime()"
         :minDate="formatTimeStamp(form1.starttime)"
         mode="datetime"
         @cancel="show5 = false"
         @confirm="setoutDate"
@@ -281,6 +311,7 @@
         </view>
      </u-popup>
      <u-picker keyName="name" :show="show6" :columns="columns1" @confirm="seleIdcard" @cancel="show6 = false"></u-picker>
      <u-picker keyName="name" :show="showName" :columns="columnsNames" @confirm="selectedName" @cancel="showName = false"></u-picker>
      <!-- <tly-picture-cut ref="tlyPictureCut" :pictureSrc="photoSrc" @createImg="uploadImg"></tly-picture-cut> -->
      <keyboardInput ref="keyboard" @export="setPlate" @close="closeInput" />
      <qf-image-cropper ref="cropper" :width="280" :height="280" :radius="30" @crop="uploadImg"></qf-image-cropper>
@@ -291,12 +322,14 @@
   import tlyPictureCut from "@/components/tly-picture-cut/tlyPictureCut.vue";
   import keyboardInput from "@/components/keyboard-input/keyboard-input.vue";
   import QfImageCropper from '@/uni_modules/qf-image-cropper/components/qf-image-cropper/qf-image-cropper.vue';
   import { getDaysAfterDate } from '@/utils/utils.js'
   export default {
      data() {
         return {
            photoSrc: '',
            type: '',
            inputType: '',
            showName: false,
            show: false,
            show1: false,
            show2: false,
@@ -306,9 +339,16 @@
            show6: false,
            show7: false,
            fileList: [],
            columns1: [[{name: '身份证', id: 0}, {name: '港澳证件', id: 1},{name: '护照', id: 2}]],
            columns1: [
               [{name: '身份证', id: 0}, {name: '港澳证件', id: 1},{name: '护照', id: 2}],
            ],
            columnsNames: [
               [{name: '张三', id: 0},{name: '张三', id: 1},{name: '张三', id: 2},]
            ],
            columns: [],
            cars: [],
            day: null,
            maxTime: '',
            carName: '',
            personnel: [],
            userAnswerId: '',
@@ -346,9 +386,9 @@
         if (options.data) {
            this.form = JSON.parse(options.data)
         }
         this.getvisit()
         this.getVisit1()
         this.getUserValid()
         // this.getvisit()
         // this.getVisit1()
         // this.getUserValid()
      },
      methods: {
         openInput(type) {
@@ -367,11 +407,14 @@
         closeInput() {
            this.$refs.keyboard.close()
         },
         constructionChange(e) {
            console.log(e.detail.value);
         },
         uploadImg(file) {
            this.$refs.cropper.close()
            uni.showLoading({ title: '上传中', mask: true });
            uni.uploadFile({
               url: `${this.$baseUrl}public/api/uploadFtp.do`,
               url: `${this.$baseUrl}visitsAdmin/cloudService/web/public/uploadFtp.do`,
               filePath: file.tempFilePath,
               name: 'file',
               formData: {
@@ -445,6 +488,16 @@
                  this.visit = res.data.code
               }
            })
            // 起始时间时长
            this.$u.api.getSystemDictData({
               dictCode: 'VISIT_CONFIG',
               label: 'VALIDATE_VISIT'
            }).then(res => {
               if (res.code === 200) {
                  this.day = Number(res.data.code)
                  // console.log(nextDay('after', true, this.day))
               }
            })
         },
         submitUser() {
            if (!this.withUserList.name) return uni.showToast({
@@ -511,15 +564,10 @@
            }
            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`,
                        url: `${this.$baseUrl}visitsAdmin/cloudService/web/public/uploadFtp.do`,
                        filePath: chooseImageRes.tempFilePaths[i],
                        name: 'file',
                        formData: {
@@ -549,6 +597,11 @@
            this.withUserList.idcardType = e.value[0].id
            this.withUserList.idcardTypeName = e.value[0].name
            this.show6 = false
         },
         selectedName(e) {
            this.form1.name = e.value[0].name
            this.form1.id = e.value[0].id
            this.showName = false
         },
         submitCart() {
            if (!this.carName) return uni.showToast({
@@ -588,13 +641,26 @@
               }
            })
         },
         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 hh:MM'), this.day)
            this.maxTime = this.form1.starttime
            console.log(this.form1.starttime);
            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() {
@@ -835,7 +901,7 @@
            align-items: center;
            justify-content: space-between;
            .t {
               background: #025EEF !important;
               background: #4d99a9 !important;
               color: #ffffff !important;
            }
            .adduser_footer_item {
@@ -844,11 +910,11 @@
               line-height: 88rpx;
               text-align: center;
               border-radius: 44rpx;
               border: 1rpx solid #025EEF;
               border: 1rpx solid #4d99a9;
               font-size: 32rpx;
               font-family: PingFangSC, PingFang SC;
               font-weight: 400;
               color: #025EEF;
               color: #4d99a9;
               margin-right: 18rpx;
               &:last-child {
                  margin: 0 !important;
@@ -892,7 +958,7 @@
            justify-content: space-between;
            margin-top: 60rpx;
            .t {
               background: #025EEF !important;
               background: #4d99a9 !important;
               color: #ffffff !important;
            }
            .addcar_footer_item {
@@ -1086,10 +1152,17 @@
         padding: 0 30rpx;
         box-sizing: border-box;
         background-color: #ffffff;
         .empty{
            width: 750rpx;
            height: 20rpx;
            background-color: #f7f7f7;
            margin: 0 -30rpx;
         }
         .list_item {
            width: 100%;
            height: 98rpx;
            // min-height: 98rpx;
            padding: 30rpx 0;
            box-sizing: border-box;
            display: flex;
            align-items: center;
            justify-content: space-between;
@@ -1147,8 +1220,6 @@
         padding: 30rpx;
         box-sizing: border-box;
         background-color: #ffffff;
         margin-top: 20rpx;
         .cate_head {
            font-size: 32rpx;
            font-family: PingFangSC, PingFang SC;
@@ -1196,12 +1267,12 @@
            justify-content: center;
            background: rgba(2, 94, 239, 0);
            border-radius: 25rpx;
            border: 1rpx solid #025EEF;
            border: 1rpx solid #4c99a8;
            font-size: 22rpx;
            font-family: PingFangSC, PingFang SC;
            font-weight: 400;
            margin-top: 20rpx;
            color: #025EEF;
            color: #4c99a8;
            margin: 0 auto;
         }
      }
@@ -1225,7 +1296,7 @@
            height: 88rpx;
            line-height: 88rpx;
            text-align: center;
            background: #025EEF;
            background: #4c99a8;
            border-radius: 44rpx;
            font-size: 32rpx;
            font-weight: 500;