You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

218 lines
5.6 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<template>
<div>
<div :style="{height:clientHeight+'px'}" class="gatewrap">
<div class="gatecode">
<div>
拜访日期
<el-date-picker v-model="selectRange" @change="selectRangeM" value-format="yyyy-MM-dd" type="daterange"
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
style="width:350px;vertical-align: middle;">
</el-date-picker>
</div>
<div>
核验销码:
<el-input clearable ref='codeInput' size="mini" placeholder="请输入核销码或扫码" v-model="select.code"
style="width: 160px;margin-right: 10px;"></el-input>
</div>
<div>
身份证件:
<el-input clearable ref='idInput' size="mini" placeholder="请输入身份证" v-model="select.idcard"
style="width: 160px;margin-right: 10px;"></el-input>
</div>
<div>
<el-button type="primary" @click='getList'>查询</el-button>
</div>
</div>
</div>
<showVisit ref="showVisit" @refresh='clearCode'></showVisit>
<!-- 选择门岗人员 -->
<el-dialog title="请先选择门岗人员" :visible.sync="gateShow" width="60%" :close-on-click-modal='false' :show-close='false'>
<el-radio-group v-model="gateAdminId">
<el-radio v-for="item in gateData" :label="item.id" border>{{item.name}}</el-radio>
</el-radio-group>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="confirmGate"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import showVisit from '@/views/visit/component/showVisit'
import {
getList,
getUserList
} from '@/api/gate'
export default {
components: {
showVisit
},
data() {
return {
clientHeight: 0,
gateShow: false,
gateAdminId: '',
gateData: [],
selectRange: [],
select: {
page: 1,
rows: 10,
keyword: "",
audit_status: '',
start_date: "",
end_date: "",
is_export: 0,
code: "",
idcard: ''
},
data: [],
}
},
computed: {},
mounted() {
},
created() {
this.init()
this.getUserList()
this.getToday()
},
methods: {
init() {
let clientHeight = document.documentElement.clientHeight;
this.clientHeight = clientHeight
},
getToday() {
let now = new Date()
let nowDay = this.$moment(now).format("YYYY-MM-DD")
this.select.start_date = nowDay
this.select.end_date = nowDay
this.selectRange = [nowDay, nowDay]
},
selectRangeM(val) {
console.log(val)
if (val) {
this.select.start_date = val[0]
this.select.end_date = val[1]
} else {
this.select.start_date = ""
this.select.end_date = ""
}
},
clearCode() {
this.select.code = ''
this.select.idcard = ''
this.$nextTick(() => {
this.$refs.codeInput.focus()
})
},
async getList() {
if (this.select.code == '' && this.select.idcard == '') {
this.$successMessage("请输入核销码或身份证件", '', 'warning')
return
}
let res = await getList(this.select)
this.data = res.data
if (this.data.length > 0) {
for(var k of this.data){
if(k.audit_status==1||k.audit_status==3){
this.$refs['showVisit'].form = this.data[0]
this.$refs['showVisit'].formDataType = 'coderecord'
this.$refs['showVisit'].gateAdminId = this.gateAdminId
this.$refs['showVisit'].isShow = true
}else{
this.$successMessage(k.audit_status_text, '', 'success')
}
}
} else {
this.$successMessage("未查询到记录", '', 'warning')
}
},
async getUserList() {
let res = await getUserList()
this.gateData = res
this.gateShow = true
},
confirmGate() {
if (!this.gateAdminId) {
this.$successMessage("请先选择门岗", '', 'warning')
return
}
this.$nextTick(() => {
this.$refs.codeInput.focus()
})
this.gateShow = false
}
},
}
</script>
<style scoped>
.gatewrap {
background-color: #fff;
position: relative;
}
.gatecode {
font-size: 32px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: left;
display: inline-block;
}
.gatecode>div {
margin-bottom: 40px;
}
/deep/ .el-input {
width: 350px !important;
}
/deep/ .el-input__inner {
font-size: 32px;
height: 45px;
width: 350px;
}
/deep/ .el-button {
vertical-align: top;
height: 40px;
width: 90px;
border: none;
}
/deep/ .el-range-editor .el-range-input {
font-size: 20px;
}
/deep/ .el-date-editor .el-range-separator {
font-size: 20px;
line-height: 36px;
}
/deep/ .el-date-editor .el-range__icon {
font-size: 18px;
line-height: 38px;
}
/deep/ .el-date-editor .el-range__close-icon {
font-size: 18px;
line-height: 38px;
}
.gatecode .el-button {
width: 100%;
font-size: 32px;
height: 70px
}
</style>