master
lion 1 week ago
parent dc37f4822e
commit a34129c6cf

@ -2,5 +2,5 @@
ENV = 'development' ENV = 'development'
# base api与测试/正式环境同一后端域名) # base api与测试/正式环境同一后端域名)
VUE_APP_BASE_API = http://yxbd-fangke.ali251.langye.net VUE_APP_BASE_API = https://yxbd-fangke.ali251.langye.net
VUE_APP_UPLOAD_API = http://yxbd-fangke.ali251.langye.net/api/admin/upload-file VUE_APP_UPLOAD_API = https://yxbd-fangke.ali251.langye.net/api/admin/upload-file

@ -1,8 +1,8 @@
<template> <template>
<div> <div>
<div class="gatewrap"> <div class="gatewrap">
<div class="gateLeft"> <div class="gateLeft">
<span @click='openList'>今日访客</span> <span @click='openList'>今日访客</span>
</div> </div>
<div class="gateRight"> <div class="gateRight">
<span> <span>
@ -51,9 +51,9 @@
</div> </div>
</template> </template>
<script> <script>
import Cookies from 'js-cookie' import Cookies from 'js-cookie'
import axios from 'axios' import axios from 'axios'
import showVisit from '@/views/visit/component/showVisit' import showVisit from '@/views/visit/component/showVisit'
import list from '@/views/gate/components/list.vue' import list from '@/views/gate/components/list.vue'
import { import {
getList, getList,
@ -61,8 +61,8 @@
} from '@/api/gate' } from '@/api/gate'
export default { export default {
components: { components: {
showVisit, showVisit,
list list
}, },
data() { data() {
@ -99,9 +99,9 @@
this.getToday() this.getToday()
// this.enterfullscreen() // this.enterfullscreen()
}, },
methods: { methods: {
openList(){ openList(){
this.$refs.list.listShow = true this.$refs.list.listShow = true
}, },
getToday() { getToday() {
let now = new Date() let now = new Date()
@ -140,7 +140,7 @@
this.$refs['showVisit'].form = k this.$refs['showVisit'].form = k
this.$refs['showVisit'].formDataType = 'coderecord' this.$refs['showVisit'].formDataType = 'coderecord'
this.$refs['showVisit'].gateAdminId = this.gateAdminId this.$refs['showVisit'].gateAdminId = this.gateAdminId
this.$refs['showVisit'].isShow = true this.$refs['showVisit'].isShow = true
return return
} else { } else {
this.$successMessage(k.audit_status_text, '', 'success') this.$successMessage(k.audit_status_text, '', 'success')
@ -148,8 +148,8 @@
} }
} else { } else {
this.$successMessage("未查询到记录", '', 'warning') this.$successMessage("未查询到记录", '', 'warning')
} }
this.select.code = '' this.select.code = ''
this.select.idcard = '' this.select.idcard = ''
}, },
async getUserList() { async getUserList() {
@ -187,27 +187,27 @@
}) })
this.gateShow = false this.gateShow = false
}, },
getIdcard() { getIdcard() {
let that = this let that = this
axios.get('https://127.0.0.1:24011/ZKIDROnline/ScanReadIdCardInfo?OP-DEV=1&CMD-URL=4&REPEAT=1&READTYPE=1',{ axios.get('https://127.0.0.1:24011/ZKIDROnline/ScanReadIdCardInfo?OP-DEV=1&CMD-URL=4&REPEAT=1&READTYPE=1',{
'headers':{ 'headers':{
"Content-Type":'application/json' "Content-Type":'application/json'
} }
}) })
.then(res=>{ .then(res=>{
console.log(res) console.log(res)
console.log(res.data) console.log(res.data)
if(!res.data){ if(!res.data){
return return
} }
let data1 = res.data?res.data.split('"IDNumber"'):'' let data1 = res.data?res.data.split('"IDNumber"'):''
let data2= data1[1].split(",") let data2= data1[1].split(",")
let data3 =data2[0].replace(/[^\d]/g, "") let data3 =data2[0].replace(/[^\d]/g, "")
that.select.idcard = data3 that.select.idcard = data3
that.getList() that.getList()
}).catch(err=>{ }).catch(err=>{
console.log(err) console.log(err)
this.$successMessage(err.statusText, '', 'warning') this.$successMessage(err.statusText, '', 'warning')
}) })
}, },
screen() { screen() {
@ -309,15 +309,15 @@
margin-left: 5px; margin-left: 5px;
} }
.gateRight span>span { .gateRight span>span {
text-decoration: underline; text-decoration: underline;
color:#004593 color:#004593
} }
.gateLeft{ .gateLeft{
position: absolute; position: absolute;
left: 20px; left: 20px;
top: 20px; top: 20px;
font-size: 20px; font-size: 20px;
color:#004593 color:#004593
} }
/deep/ .el-input { /deep/ .el-input {
width: 400px !important; width: 400px !important;
@ -360,4 +360,4 @@
font-size: 32px; font-size: 32px;
height: 70px height: 70px
} }
</style> </style>

@ -642,6 +642,12 @@
this.getLabel() this.getLabel()
}, },
methods: { methods: {
syncCarsToForm() {
//
this.form.cars = (this.carsList || [])
.map(item => (item && item.car ? String(item.car).trim() : ""))
.filter(Boolean)
},
async getDetail() { async getDetail() {
const res = await show({ const res = await show({
@ -818,6 +824,7 @@
}, },
submit() { submit() {
let that = this let that = this
this.syncCarsToForm()
if(that.form.credent==1){ if(that.form.credent==1){
const regtest = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/ const regtest = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/
if(!regtest.test(that.form.idcard)){ if(!regtest.test(that.form.idcard)){
@ -833,11 +840,7 @@
} }
} }
that.form.follw_people = that.followList that.form.follw_people = that.followList
let _car = [] this.syncCarsToForm()
for(var k of that.carsList){
_car.push(k.car)
}
this.form.cars = _car
console.log("this.form.cars",this.form.cars) console.log("this.form.cars",this.form.cars)
// return // return
if(this.visitType==3){ if(this.visitType==3){
@ -859,6 +862,12 @@
} }
}, },
watch: { watch: {
carsList: {
deep: true,
handler() {
this.syncCarsToForm()
}
},
isShow(newVal) { isShow(newVal) {
if (newVal) { if (newVal) {
console.log("this.visitType",this.visitType) console.log("this.visitType",this.visitType)

Loading…
Cancel
Save