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.

149 lines
3.7 KiB

3 years ago
<template>
3 years ago
<div>
<div :style="{height:clientHeight+'px'}" class="gatewrap">
<div class="gatecode">
核销码<el-input clearable ref='codeInput' size="mini" placeholder="请输入核销码或扫码" v-model="select.code"
style="width: 160px;margin-right: 10px;"></el-input>
<el-button type="primary" @click='getList'>查询</el-button>
</div>
</div>
<showVisit ref="showVisit" @refresh='clearCode'></showVisit>
3 years ago
<!-- 选择门岗人员 -->
<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>
3 years ago
</div>
</template>
<script>
import showVisit from '@/views/visit/component/showVisit'
import {
3 years ago
getList,
getUserList
3 years ago
} from '@/api/gate'
export default {
components: {
showVisit
},
data() {
3 years ago
return {
3 years ago
clientHeight:0,
gateShow:false,
3 years ago
gateAdminId:'',
gateData:[],
3 years ago
select: {
page: 1,
rows: 10,
keyword: "",
audit_status: "",
start_date: "",
end_date: "",
3 years ago
is_export: 0,
code:""
3 years ago
},
data: [],
}
},
computed: {},
mounted() {
},
3 years ago
created() {
3 years ago
this.init()
this.getUserList()
// this.getList()
3 years ago
},
3 years ago
methods: {
init(){
let clientHeight = document.documentElement.clientHeight;
this.clientHeight = clientHeight
this.$nextTick(() => {
this.$refs.codeInput.focus()
})
},
clearCode(){
this.select.code = ''
this.$nextTick(() => {
this.$refs.codeInput.focus()
})
3 years ago
},
async getList() {
let res = await getList(this.select)
3 years ago
this.data = res.data
if(this.data.length>0){
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("未查询到记录",'','warning')
}
3 years ago
},
async getUserList() {
let res = await getUserList()
this.gateData = res
3 years ago
this.gateShow = true
3 years ago
},
confirmGate(){
if(!this.gateAdminId){
this.$successMessage("请先选择门岗",'','warning')
return
}
this.gateShow = false
3 years ago
},
3 years ago
showVisitForm(row,type) {
3 years ago
this.$refs['showVisit'].form = row
this.$refs['showVisit'].formDataType = 'coderecord'
3 years ago
this.$refs['showVisit'].codeType = type
this.$refs['showVisit'].gateAdminId=this.gateAdminId
3 years ago
this.$refs['showVisit'].isShow = true
}
},
}
</script>
3 years ago
<style scoped>
.gatewrap{
background-color: #fff;
position: relative;
}
.gatecode{
font-size: 32px;
position: absolute;
top:50%;
left:50%;
transform: translate(-50%,-50%);
width: 100%;
text-align: center;
}
/deep/ .el-input{
width: 350px!important;
}
/deep/ .el-input__inner{
font-size: 32px;
height: 45px;
width: 350px;
}
/deep/ .el-button{
vertical-align: top;
height: 45px;
width: 90px;
border: none;
3 years ago
}
</style>