From 17efddc6a667670dca682bf36b51a43e99615e6d Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期三, 16 十月 2024 15:59:38 +0800
Subject: [PATCH] 代码初始化
---
h5/pages/staff/visitorReport.vue | 1294 +++++++++++++++++++++++++++++-----------------------------
1 files changed, 646 insertions(+), 648 deletions(-)
diff --git a/h5/pages/staff/visitorReport.vue b/h5/pages/staff/visitorReport.vue
index f13cb68..fcb4b2e 100644
--- a/h5/pages/staff/visitorReport.vue
+++ b/h5/pages/staff/visitorReport.vue
@@ -1,674 +1,672 @@
<template>
- <view class="visit">
- <view class="list">
- <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.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="show4 = true">
- <text :style="{ color: form1.starttime ? '#000000' : '' }">{{ form1.starttime ? form1.starttime : '璇烽�夋嫨' }}</text>
- <u-icon name="arrow-right" color="#CCCCCC" size="20"></u-icon>
- </view>
- </view>
- <view class="list_item">
- <view class="list_item_label">
- <text>*</text>
- <text>绂诲巶鏃堕棿</text>
- </view>
- <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>
- </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;" /></view>
- </view>
- <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="'璇疯緭鍏ヨ仈绯讳汉鎵嬫満鍙�'"
- 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" 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" @click="openInput(1)">
- <text :style="{ color: form1.carNos ? '#000000' : '' }">{{ form1.carNos ? form1.carNos : '璇疯緭鍏ヨ溅鐗屽彿鐮�' }}</text>
- <!-- <input type="text" placeholder="璇疯緭鍏ヨ溅鐗屽彿" v-model="form1.carNos" maxlength="8" 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" 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" v-model="form1.reason" placeholder="璇疯緭鍏ユ潵璁夸簨鐢�" placeholder-style="color: #999999;" /></view>
- </view>
- </view>
- <view class="zw"></view>
- <view class="footer"><view class="footer_btn" @click="submit">鎻愪氦</view></view>
- <!-- 鍏ュ満鏃堕棿 -->
- <u-datetime-picker :show="show4" :minDate="new Date().getTime()" mode="datetime" @cancel="show4 = false" @confirm="setinDate"></u-datetime-picker>
- <!-- 绂诲満鏃堕棿 -->
- <u-datetime-picker
- v-if="form1.starttime"
- :show="show5"
- :minDate="formatTimeStamp(form1.starttime)"
- :maxDate="formatTimeStamp(maxTime)"
- mode="datetime"
- @cancel="show5 = false"
- @confirm="setoutDate"
- ></u-datetime-picker>
- <!-- 杞﹁締 -->
- <u-popup :show="show2" :round="10" :safeAreaInsetBottom="true" :closeable="true" mode="bottom" @close="show2 = false">
- <view class="addcar">
- <view class="addcar_head">娣诲姞杞﹁締</view>
- <view class="addcar_ipt"><input type="text" v-model="carName" placeholder="璇疯緭鍏ヨ溅鐗屽彿" /></view>
- <view class="addcar_footer">
- <view class="addcar_footer_item" @click="show2 = false">鍙栨秷</view>
- <view class="addcar_footer_item t" @click="submitCart">鎻愪氦</view>
- </view>
- </view>
- </u-popup>
- <u-picker keyName="name" :show="show6" :columns="columns1" @confirm="seleIdcard" @cancel="show6 = 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>
- </view>
+ <view class="visit">
+ <view class="list">
+ <view class="list_item">
+ <view class="list_item_label">
+ <text>*</text>
+ <text>琚浜哄鍚�</text>
+ </view>
+ <!-- <view class="list_item_content" @click="showName = true"> -->
+ <view class="list_item_content">
+ <text :style="{ color: form1.receptMemberName ? '#000000' : '' }">{{
+ form1.receptMemberName
+ ? form1.receptMemberName + " " + form1.receptCompanyName
+ : "璇烽�夋嫨"
+ }}</text>
+ <!-- <u-icon name="arrow-right" color="#CCCCCC" size="20"></u-icon> -->
+ </view>
+ </view>
+ <view class="list_item">
+ <view class="list_item_label">
+ <text>*</text>
+ <text>鍏ュ洯鏃堕棿</text>
+ </view>
+ <view class="list_item_content" @click="show4 = true">
+ <text :style="{ color: form1.starttime ? '#000000' : '' }">{{
+ form1.starttime ? form1.starttime : "璇烽�夋嫨"
+ }}</text>
+ <u-icon name="arrow-right" color="#CCCCCC" size="20"></u-icon>
+ </view>
+ </view>
+ <view class="list_item">
+ <view class="list_item_label">
+ <text>*</text>
+ <text>绂诲洯鏃堕棿</text>
+ </view>
+ <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>
+ </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.name"
+ 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="number"
+ maxlength="13"
+ v-model="form1.phone"
+ :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"
+ v-model="form1.companyName"
+ 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" @click="openInput(1)">
+ <text :style="{ color: form1.carNos ? '#000000' : '' }">{{
+ form1.carNos ? form1.carNos : "璇疯緭鍏ヨ溅鐗屽彿鐮�"
+ }}</text>
+ <!-- <input type="text" placeholder="璇疯緭鍏ヨ溅鐗屽彿" v-model="form1.carNos" maxlength="8" 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="number"
+ v-model="form1.memberNum"
+ 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"
+ v-model="form1.reason"
+ placeholder="璇疯緭鍏ユ潵璁夸簨鐢�"
+ placeholder-style="color: #999999;"
+ /></view>
+ </view>
+ </view>
+ <view class="zw"></view>
+ <view class="footer"
+ ><view class="footer_btn" @click="submit">鎻愪氦</view></view
+ >
+ <!-- 鍏ュ洯鏃堕棿 -->
+ <u-datetime-picker
+ :show="show4"
+ :minDate="new Date().getTime()"
+ mode="datetime"
+ @cancel="show4 = false"
+ @confirm="setinDate"
+ ></u-datetime-picker>
+ <!-- 绂诲洯鏃堕棿 -->
+ <u-datetime-picker
+ v-if="form1.starttime"
+ :show="show5"
+ :minDate="formatTimeStamp(form1.starttime)"
+ :maxDate="formatTimeStamp(maxTime)"
+ mode="datetime"
+ @cancel="show5 = false"
+ @confirm="setoutDate"
+ ></u-datetime-picker>
+ <!-- 杞﹁締 -->
+ <u-popup
+ :show="show2"
+ :round="10"
+ :safeAreaInsetBottom="true"
+ :closeable="true"
+ mode="bottom"
+ @close="show2 = false"
+ >
+ <view class="addcar">
+ <view class="addcar_head">娣诲姞杞﹁締</view>
+ <view class="addcar_ipt"
+ ><input type="text" v-model="carName" placeholder="璇疯緭鍏ヨ溅鐗屽彿"
+ /></view>
+ <view class="addcar_footer">
+ <view class="addcar_footer_item" @click="show2 = false">鍙栨秷</view>
+ <view class="addcar_footer_item t" @click="submitCart">鎻愪氦</view>
+ </view>
+ </view>
+ </u-popup>
+ <u-picker
+ keyName="name"
+ :show="showName"
+ closeOnClickOverlay
+ :columns="memberList"
+ @confirm="seleteName"
+ @cancel="showName = false"
+ @close="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>
+ </view>
</template>
<script>
-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';
+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'
+import { createVisit, getVisitedMember } from '@/api'
export default {
- data() {
- return {
- photoSrc: '',
- type: '',
- inputType: '',
- show1: false,
- show2: false,
- show4: false,
- show5: false,
- show6: false,
- show7: false,
- fileList: [],
- 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: '',
- form1: {
- phone1: '',
- receptMemberId: '',
- receptMemberName: '',
- starttime: '',
- endtime: '',
- doors: '',
- doorSelectName: '',
- reason: '',
- carNos: ''
- },
- withUserList: {
- name: '',
- phone: '',
- idcardType: '',
- idcardTypeName: '',
- companyName: '',
- idcardNo: '',
- faceImg: '',
- faceImgUrl: '',
- imgurl: '',
- imgurlUrl: ''
- },
- visit: '',
- form: {},
- accessControl: '',
- verify: ''
- };
- },
- components: { tlyPictureCut, keyboardInput, QfImageCropper },
- onLoad(options) {
- if (options.data) {
- this.form = JSON.parse(options.data);
- }
- // this.getvisit()
- // this.getVisit1()
- // this.getUserValid()
- },
- methods: {
- openInput(type) {
- this.inputType = type;
- this.$refs.keyboard.open();
- },
- setPlate(e) {
- if (this.inputType === 1) {
- this.form1.carNos = e;
- } else if (this.inputType === 2) {
- this.withUserList.carNos = e;
- }
- this.$forceUpdate();
- this.closeInput();
- },
- closeInput() {
- this.$refs.keyboard.close();
- },
- uploadImg(file) {
- this.$refs.cropper.close();
- uni.showLoading({ title: '涓婁紶涓�', mask: true });
- uni.uploadFile({
- url: `${this.$baseUrl}visitsAdmin/cloudService/web/public/uploadFtp.do`,
- filePath: file.tempFilePath,
- name: 'file',
- formData: {
- folderCode: 'MEMBER_IMG'
- },
- success: uploadFileRes => {
- let res = JSON.parse(uploadFileRes.data);
- this.withUserList.faceImg = res.data.halfPath;
- this.withUserList.faceImgUrl = res.data.prefixPath + res.data.folder + res.data.halfPath;
- },
- complete() {
- uni.hideLoading();
- }
- });
- },
- submit() {
- if (!this.form1.receptMemberId)
- return uni.showToast({
- title: '璇峰~鍐欐湁鏁堢殑璁块棶浜�',
- icon: 'none'
- });
- if (!this.form1.starttime)
- return uni.showToast({
- title: '鍏ュ満鏃堕棿涓嶈兘涓虹┖',
- icon: 'none'
- });
- if (!this.form1.endtime)
- return uni.showToast({
- title: '绂诲満鏃堕棿涓嶈兘涓虹┖',
- icon: 'none'
- });
- if (!this.form1.doorSelectName && this.accessControl == 1)
- 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'
- let data = JSON.parse(JSON.stringify(this.form1));
- data.starttime = data.starttime + ':00';
- data.endtime = data.endtime + ':00';
- this.$u.api
- .createFk({
- ...this.form,
- ...data,
- openid: this.$store.state.openId,
- withUserList: this.personnel
- })
- .then(res => {
- if (res.code === 200) {
- uni.reLaunch({
- url: `/pages/appointmentDetails/appointmentDetails?id=${res.data}`
- });
- }
- });
- },
- deleUser(i) {
- this.personnel.splice(i, 1);
- },
- getVisit1() {
- // 鏄惁闇�瑕佺瓟棰�
- this.$u.api
- .getSystemDictData({
- dictCode: 'SYSTEM',
- label: 'HEALTH_CARD'
- })
- .then(res => {
- if (res.code === 200) {
- 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))
- }
- });
- },
- 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}visitsAdmin/cloudService/web/public/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(',');
- },
- 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 hh:MM'), this.day)
- this.maxTime = this.form1.starttime.slice(0, 11) + '23:59'
- this.form1.endtime = ''
- 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;
- }
- }
- });
- }
- }
- });
- }
- }
+ data() {
+ return {
+ photoSrc: '',
+ type: '',
+ inputType: '',
+ show1: false,
+ show2: false,
+ show4: false,
+ show5: false,
+ show7: false,
+ showName: false,
+ fileList: [],
+ memberList: [[{ 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: '',
+ form1: {
+ receptMemberId: '',
+ receptMemberName: '',
+ starttime: '',
+ endtime: '',
+ reason: '',
+ carNos: ''
+ },
+ visit: '',
+ form: {},
+ accessControl: '',
+ verify: ''
+ }
+ },
+ components: { tlyPictureCut, keyboardInput, QfImageCropper },
+ onLoad(options) {
+ if (options.data) {
+ this.form = JSON.parse(options.data)
+ }
+ this.getUser()
+ const userInfo = uni.getStorageSync('userInfo') || {}
+ this.$set(this.form1, 'receptMemberName', userInfo.realname)
+ this.$set(this.form1, 'receptMemberId', userInfo.id || '')
+ this.$set(this.form1, 'receptCompanyName', userInfo.company.name || '')
+ // this.getvisit()
+ // this.getVisit1()
+ // this.getUserValid()
+ },
+ methods: {
+ openInput(type) {
+ this.inputType = type
+ this.$refs.keyboard.open()
+ },
+ setPlate(e) {
+ if (this.inputType === 1) {
+ this.form1.carNos = e
+ } else if (this.inputType === 2) {
+ this.withUserList.carNos = e
+ }
+ this.$forceUpdate()
+ this.closeInput()
+ },
+ seleteName(e) {
+ this.$set(this.form1, 'receptMemberName', e.value[0].name)
+ this.$set(this.form1, 'receptMemberId', e.value[0].id)
+ this.$set(this.form1, 'receptCompanyName', e.value[0].companyName)
+ this.showName = false
+ },
+ getUser() {
+ getVisitedMember().then(res => {
+ this.memberList = [res.data || []]
+ })
+ },
+ closeInput() {
+ this.$refs.keyboard.close()
+ },
+ submit() {
+ const { form1 } = this
+ if (!this.form1.receptMemberId)
+ return uni.showToast({
+ title: '璇烽�夋嫨鏈夋晥鐨勮璁夸汉',
+ icon: 'none'
+ })
+ if (!this.form1.starttime)
+ return uni.showToast({
+ title: '鍏ュ洯鏃堕棿涓嶈兘涓虹┖',
+ icon: 'none'
+ })
+ if (!this.form1.endtime)
+ return uni.showToast({
+ title: '绂诲洯鏃堕棿涓嶈兘涓虹┖',
+ icon: 'none'
+ })
+ if (!this.form1.name) return uni.showToast({
+ title: '鑱旂郴浜轰笉鑳戒负绌�',
+ icon: 'none'
+ })
+ if (!this.form1.phone) return uni.showToast({
+ title: '鎵嬫満鍙蜂笉鑳戒负绌�',
+ icon: 'none'
+ })
+ var re = /^1[3,4,5,6,7,8,9][0-9]{9}$/;
+ var result = re.test(this.form1.phone);
+ if (!result) return uni.showToast({
+ title: '鎵嬫満鍙锋牸寮忎笉姝g‘',
+ icon: 'none'
+ })
+ if (!this.form1.companyName) return uni.showToast({
+ title: '鏉ヨ鍗曚綅涓嶈兘涓虹┖',
+ icon: 'none'
+ })
+ if (!this.form1.carNos) return uni.showToast({
+ title: '鍏ュ洯杞﹁締涓嶈兘涓虹┖',
+ icon: 'none'
+ })
+ if (!this.form1.memberNum) 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'
+ let data = JSON.parse(JSON.stringify(this.form1))
+ data.starttime = data.starttime + ':00'
+ data.endtime = data.endtime + ':00'
+ createVisit({
+ ...data,
+ type: '2',
+ openid: this.$store.state.openId
+ })
+ .then(res => {
+ if (res.code === 200) {
+ setTimeout(() => {
+ uni.showToast({
+ title: '鎻愪氦鎴愬姛',
+ icon: 'success'
+ })
+ })
+ uni.reLaunch({
+ url: `/pages/staff/index`
+ })
+ }
+ })
+ },
+ deleUser(i) {
+ this.personnel.splice(i, 1)
+ },
+ getVisit1() {
+ // 鏄惁闇�瑕佺瓟棰�
+ this.$u.api
+ .getSystemDictData({
+ dictCode: 'SYSTEM',
+ label: 'HEALTH_CARD'
+ })
+ .then(res => {
+ if (res.code === 200) {
+ 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))
+ }
+ })
+ },
+ 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(',')
+ },
+ 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 hh:MM'), this.day)
+ this.maxTime = this.form1.starttime.slice(0, 11) + '23:59'
+ this.form1.endtime = ''
+ 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, '/')}`))
+ },
+ // 琚嫓璁夸汉淇℃伅鏍¢獙鏂瑰紡锛�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
+ }
+ }
+ })
+ }
+ }
+ })
+ }
+ }
};
</script>
-<style>
+<style lang="scss">
page {
- background-color: #f7f7f7 !important;
+ background-color: #f7f7f7 !important;
}
.u-upload__button {
- margin: 0 !important;
+ margin: 0 !important;
}
</style>
<style lang="scss" scoped>
.visit {
- width: 100%;
- padding-top: 10rpx 0;
- .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%;
- display: flex;
- align-items: center;
- justify-content: space-between;
- text {
- font-size: 28rpx;
- color: #000000;
- }
- image {
- width: 30rpx;
- height: 30rpx;
- }
- }
- }
- .menjin_footer {
- width: 100%;
- padding: 30rpx;
- box-sizing: border-box;
- display: flex;
- align-items: center;
- justify-content: space-between;
- .menjin_footer_item {
- flex: 1;
- height: 80rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- border-radius: 10rpx;
- background-color: #025eef;
- color: #ffffff;
- font-size: 26rpx;
- margin-left: 30rpx;
- &:first-child {
- margin-left: 0 !important;
- }
- }
- }
- }
+ width: 100%;
+ padding-top: 10rpx 0;
+ .menjin {
+ width: 100%;
+ .respondent-title {
+ width: 100%;
+ height: 100rpx;
+ line-height: 100rpx;
+ text-align: center;
+ font-size: 32rpx;
+ font-weight: 600;
+ color: #222222;
+ }
+ .list {
+ width: 100%;
+ height: 400rpx;
+ display: flex;
+ flex-direction: column;
+ .list_item {
+ width: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ text {
+ font-size: 28rpx;
+ color: #000000;
+ }
+ image {
+ width: 30rpx;
+ height: 30rpx;
+ }
+ }
+ }
+ .menjin_footer {
+ width: 100%;
+ padding: 30rpx;
+ box-sizing: border-box;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ .menjin_footer_item {
+ flex: 1;
+ height: 80rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ border-radius: 10rpx;
+ background-color: #025eef;
+ color: #ffffff;
+ font-size: 26rpx;
+ margin-left: 30rpx;
+ &:first-child {
+ margin-left: 0 !important;
+ }
+ }
+ }
+ }
- .addcar {
- padding: 30rpx;
- width: 100%;
- box-sizing: border-box;
- .addcar_head {
- text-align: center;
- font-size: 32rpx;
- font-family: PingFangSC, PingFang SC;
- font-weight: 500;
- color: #222222;
- }
- .addcar_ipt {
- width: 100%;
- height: 100rpx;
- line-height: 100rpx;
- text-align: center;
- background: #f7f7f7;
- border-radius: 50rpx;
- margin-top: 60rpx;
- input {
- width: 100%;
- height: 100%;
- font-size: 28rpx;
- font-weight: 400;
- color: #000000;
- text-align: center;
- }
- }
- .addcar_footer {
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-top: 60rpx;
- .t {
- background: #025eef !important;
- color: #ffffff !important;
- }
- .addcar_footer_item {
- flex: 1;
- height: 88rpx;
- line-height: 88rpx;
- font-size: 32rpx;
- font-weight: 400;
- color: #025eef;
- text-align: center;
- border-radius: 44rpx;
- border: 1rpx solid #025eef;
- margin-right: 18rpx;
- &:last-child {
- margin-right: 0 !important;
- }
- }
- }
- }
- .list {
- width: 100%;
- 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%;
- // min-height: 98rpx;
- padding: 30rpx 0;
- box-sizing: border-box;
- display: flex;
- align-items: center;
- justify-content: space-between;
- border-bottom: 1rpx solid #e5e5e5;
+ .addcar {
+ padding: 30rpx;
+ width: 100%;
+ box-sizing: border-box;
+ .addcar_head {
+ text-align: center;
+ font-size: 32rpx;
+ font-family: PingFangSC, PingFang SC;
+ font-weight: 600;
+ color: #222222;
+ }
+ .addcar_ipt {
+ width: 100%;
+ height: 100rpx;
+ line-height: 100rpx;
+ text-align: center;
+ background: #f7f7f7;
+ border-radius: 50rpx;
+ margin-top: 60rpx;
+ input {
+ width: 100%;
+ height: 100%;
+ font-size: 28rpx;
+ font-weight: 400;
+ color: #000000;
+ text-align: center;
+ }
+ }
+ .addcar_footer {
+ width: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ margin-top: 60rpx;
+ .t {
+ background: #025eef !important;
+ color: #ffffff !important;
+ }
+ .addcar_footer_item {
+ flex: 1;
+ height: 88rpx;
+ line-height: 88rpx;
+ font-size: 32rpx;
+ font-weight: 400;
+ color: #025eef;
+ text-align: center;
+ border-radius: 44rpx;
+ border: 1rpx solid #025eef;
+ margin-right: 18rpx;
+ &:last-child {
+ margin-right: 0 !important;
+ }
+ }
+ }
+ }
+ .list {
+ width: 100%;
+ 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%;
+ // min-height: 98rpx;
+ padding: 30rpx 0;
+ box-sizing: border-box;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ border-bottom: 1rpx solid #e5e5e5;
- .list_item_label {
- flex-shrink: 0;
- display: flex;
- align-items: center;
+ .list_item_label {
+ flex-shrink: 0;
+ display: flex;
+ align-items: center;
- text {
- &:nth-child(2) {
- font-size: 30rpx;
- font-weight: 400;
- color: #222222;
- }
+ text {
+ &:nth-child(2) {
+ font-size: 30rpx;
+ font-weight: 400;
+ color: #222222;
+ }
- &:nth-child(1) {
- font-size: 30rpx;
- font-weight: 400;
- color: #e42d2d;
- }
- }
- }
+ &:nth-child(1) {
+ font-size: 30rpx;
+ font-weight: 400;
+ color: #e42d2d;
+ }
+ }
+ }
- .list_item_content {
- flex: 1;
- height: 100%;
- margin-left: 30rpx;
- display: flex;
- align-items: center;
- justify-content: flex-end;
+ .list_item_content {
+ flex: 1;
+ height: 100%;
+ margin-left: 30rpx;
+ display: flex;
+ align-items: center;
+ justify-content: flex-end;
- text {
- font-size: 28rpx;
- font-weight: 400;
- color: #999999;
- margin-right: 6rpx;
- }
+ text {
+ font-size: 28rpx;
+ font-weight: 400;
+ color: #999999;
+ margin-right: 6rpx;
+ }
- input {
- width: 100%;
- height: 100%;
- text-align: right;
- font-size: 28rpx;
- font-weight: 400;
- color: #222222;
- }
- }
- }
- }
+ input {
+ width: 100%;
+ height: 100%;
+ text-align: right;
+ font-size: 28rpx;
+ font-weight: 400;
+ color: #222222;
+ }
+ }
+ }
+ }
- .zw {
- width: 100%;
- height: calc(env(safe-area-inset-bottom) + 118rpx);
- }
+ .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;
- position: fixed;
- left: 0;
- bottom: 68rpx;
+ .footer {
+ width: 100%;
+ padding: 0 30rpx;
+ padding-bottom: env(safe-area-inset-bottom);
+ box-sizing: border-box;
+ position: fixed;
+ left: 0;
+ bottom: 68rpx;
- .footer_btn {
- width: 100%;
- height: 88rpx;
- line-height: 88rpx;
- text-align: center;
- background: #4e99a9;
- border-radius: 44rpx;
- font-size: 32rpx;
- color: #ffffff;
- }
- }
+ .footer_btn {
+ width: 100%;
+ height: 88rpx;
+ line-height: 88rpx;
+ text-align: center;
+ background: $uni-color-primary;
+ border-radius: 44rpx;
+ font-size: 32rpx;
+ color: #ffffff;
+ }
+ }
}
</style>
--
Gitblit v1.9.3