master
lion 3 years ago
parent 25a862442a
commit 8ce222aa13

@ -24,6 +24,17 @@ export function cancelCode(params){
})
}
export function getIdcard(baseURL,params){
return request({
idcards:baseURL,
url:'/ZKIDROnline/ScanReadIdCardInfo?OP-DEV=1&CMD-URL=4&REPEAT=1&READTYPE=1',
method:'get',
params
})
}
// http://127.0.0.1:24010/ZKIDROnline/ScanReadIdCardInfo?OP-DEV=1&CMD-URL=4&REPEAT=1&READTYPE=1
// export function show(params){
// return request({
// method:'get',

@ -21,6 +21,9 @@ const service = axios.create({
// request interceptor
service.interceptors.request.use(
config => {
if(config.idcards){
config.baseURL = config.idcards
}
if(config.isLoading){
loading = Loading.service({
lock:true,

@ -1,12 +1,19 @@
<template>
<div>
<div :style="{height:clientHeight+'px'}" class="gatewrap">
<div class="gatewrap">
<div class="gateRight">
<span>
{{gateName}}<span @click="gateShow = true">切换</span>
</span>
<span @click='screen'>{{fullscreen?'取消全屏':'打开全屏'}}</span>
</div>
<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;">
style="width:400px;vertical-align: middle;">
</el-date-picker>
</div>
<div>
@ -18,9 +25,10 @@
身份证件
<el-input clearable ref='idInput' size="mini" placeholder="请输入身份证" v-model="select.idcard"
style="width: 160px;margin-right: 10px;"></el-input>
<el-button type="primary" @click='getIdcard'>查询身份证</el-button>
</div>
<div>
<el-button type="primary" @click='getList'>查询</el-button>
<el-button class="getButton" type="primary" @click='getList'>查询</el-button>
</div>
</div>
</div>
@ -40,21 +48,26 @@
</div>
</template>
<script>
import Cookies from 'js-cookie'
import showVisit from '@/views/visit/component/showVisit'
import {
getList,
getUserList
getUserList,
getIdcard
} from '@/api/gate'
export default {
components: {
showVisit
},
data() {
return {
return {
fullscreen:false,
clientHeight: 0,
gateShow: false,
gateAdminId: '',
gateName: "",
gateData: [],
gateUser: {},
selectRange: [],
select: {
page: 1,
@ -76,7 +89,7 @@
},
created() {
this.init()
this.getIdcard()
this.getUserList()
this.getToday()
},
@ -92,7 +105,7 @@
this.select.end_date = nowDay
this.selectRange = [nowDay, nowDay]
},
selectRangeM(val) {
selectRangeM(val) {
console.log(val)
if (val) {
this.select.start_date = val[0]
@ -116,39 +129,87 @@
}
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')
}
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() {
this.gateUser = JSON.parse(Cookies.get("gateUser"))
console.log(this.gateUser)
let res = await getUserList()
this.gateData = res
this.gateShow = true
if (this.gateUser.gateAdminId) {
this.gateAdminId = this.gateUser.gateAdminId
this.gateName = this.gateUser.gateName
this.gateShow = false
return
} else {
this.gateShow = true
}
},
confirmGate() {
if (!this.gateAdminId) {
this.$successMessage("请先选择门岗", '', 'warning')
return
}
this.gateData.map(item => {
if (this.gateAdminId == item.id) {
this.gateName = item.name
}
})
Cookies.set('gateUser', {
gateName: this.gateName,
gateAdminId: this.gateAdminId
})
this.$nextTick(() => {
this.$refs.codeInput.focus()
})
this.gateShow = false
},
getIdcard() {
const idCard = getIdcard("/idcard")
console.log(idCard)
},
screen() {
let element = document.documentElement;
if (this.fullscreen) {
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.webkitCancelFullScreen) {
document.webkitCancelFullScreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.msExitFullscreen) {
document.msExitFullscreen();
}
} else {
if (element.requestFullscreen) {
element.requestFullscreen();
} else if (element.webkitRequestFullScreen) {
element.webkitRequestFullScreen();
} else if (element.mozRequestFullScreen) {
element.mozRequestFullScreen();
} else if (element.msRequestFullscreen) {
// IE11
element.msRequestFullscreen();
}
}
this.fullscreen = !this.fullscreen;
}
},
}
</script>
@ -156,7 +217,8 @@
<style scoped>
.gatewrap {
background-color: #fff;
position: relative;
position: relative;
height:100vh
}
.gatecode {
@ -172,22 +234,40 @@
.gatecode>div {
margin-bottom: 40px;
}
.gatecode>div:last-child {
margin-bottom: 0px;
}
.gateRight {
position: absolute;
right: 20px;
top: 20px;
font-size: 20px;
}
.gateRight span {
margin-right: 10px;
margin-left: 5px;
}
.gateRight span>span {
text-decoration: underline;
}
/deep/ .el-input {
width: 350px !important;
width: 400px !important;
}
/deep/ .el-input__inner {
font-size: 32px;
height: 45px;
width: 350px;
width: 400px;
}
/deep/ .el-button {
vertical-align: top;
height: 40px;
width: 90px;
border: none;
height: 45px;
width: 145px;
font-size: 20px;
}
/deep/ .el-range-editor .el-range-input {
@ -209,7 +289,7 @@
line-height: 38px;
}
.gatecode .el-button {
.gatecode .getButton.el-button {
width: 100%;
font-size: 32px;
height: 70px

@ -1,278 +0,0 @@
<template>
<div style="padding: 0 20px">
<div ref="lxHeader">
<lx-header icon="md-apps" text="拜访记录管理" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<slot>
<div style="display: flex;align-items: center;" class="selector">
<div style="margin-right: 10px;">关键词</div>
<el-input size="mini" placeholder="请输入关键词" v-model="select.keyword"
style="width: 160px;margin-right: 10px;"></el-input>
<div style="margin-right: 10px;">状态</div>
<el-select v-model="select.audit_status" clearable placeholder="请选择">
<el-option v-for="item in statusList" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
<div style="margin:0 10px;">起始时间</div>
<el-date-picker v-model="selectRange" @change="selectRangeM" value-format="yyyy-MM-dd" type="daterange" range-separator=""
start-placeholder="开始日期" end-placeholder="结束日期">
</el-date-picker>
<el-button @click="getList" slot="reference" size="medium" type="primary" style="margin-left: 10px">查询
</el-button>
<template>
<el-popover placement="right" width="250" v-model="visible" trigger='click'>
<p style="margin-bottom:10px">选择访客类型:</p>
<div style="display: flex;align-items: center;">
<el-button size="mini" type="primary"
@click="visible=false,$refs['addCommon'].isShow = true,$refs['addCommon'].type = 'add',$refs['addCommon'].visitType = 1">普通访客
</el-button>
<el-button type="primary" size="mini"
@click="visible=false,$refs['addCommon'].isShow = true,$refs['addCommon'].type = 'add',$refs['addCommon'].visitType = 2">施工访客
</el-button>
<el-button type="primary" size="mini"
@click="visible=false,$refs['addCommon'].isShow = true,$refs['addCommon'].type = 'add',$refs['addCommon'].visitType = 3">物流车辆</el-button>
</div>
<el-button slot="reference" size="medium" type="primary" style="margin-left: 10px">新增</el-button>
</el-popover>
</template>
<el-button @click="getList" slot="reference" size="medium" type="primary" style="margin-left: 10px">导出
</el-button>
</div>
</slot>
</lx-header>
</div>
<xy-table :table-item="table" :list="data" :total="total"
:auths="['edit','delete']"
@pageSizeChange="e => {select.rows = e;select.page = 1;getList()}"
@pageIndexChange="e => {select.page = e;getList()}" @delete="deleteStudy" @editor="editorStudy">
</xy-table>
<addCommon ref="addCommon" @refresh="getList"></addCommon>
<!-- <addBuild ref="addBuild" @refresh="getList"></addBuild>
<addPark ref="addPark" @refresh="getList"></addPark> -->
</div>
</template>
<script>
import {
getList,
destroy
} from '@/api/visit/record.js'
import addCommon from '@/views/visit/component/addCommon'
export default {
components: {
addCommon
},
data() {
return {
visible: false,
select: {
page: 1,
rows: 10,
keyword: "",
audit_status: "",
start_date: "",
end_date: "",
is_export: 0
},
selectRange: [],
statusList: [{
id: -1,
value: '待学习'
},
{
id: 0,
value: '待审核'
},
{
id: 1,
value: '通过(待进厂)'
},
{
id: 2,
value: '驳回'
},
{
id: 3,
value: '已进厂'
},
{
id: 4,
value: '已离厂'
}
],
total: 0,
data: [],
table: [{
label: '序号',
type: "index",
fixed: "left",
width: 80
},
{
label: '姓名',
sortable: false,
prop: 'name',
fixed: "left",
width: 120
},
{
label: '类型',
sortable: false,
prop: 'type_text',
width: 120
},
{
label: '状态',
sortable: false,
prop: 'audit_status_text',
width: 120
},
{
label: '是否随访',
sortable: false,
prop: 'follw_people',
width: 80,
formatter:(cell, data, value)=>{
return value?'是':'否'
}
},
{
label: '预约时间',
sortable: false,
prop: 'date',
width: 120
},
{
label: '证件类型',
sortable: false,
prop: 'credent',
width: 120,
formatter:(cell, data, value)=>{
return value==1?'身份证':'护照'
},
},
{
label: '证件号',
sortable: false,
prop: 'idcard',
width: 180
},
{
label: '手机号',
sortable: false,
prop: 'mobile',
width: 120
},
{
label: '单位名称',
sortable: false,
prop: 'company_name',
width: 180
},
{
label: '开始时间',
sortable: false,
prop: 'start_date',
width: 180
},
{
label: '结束时间',
sortable: false,
prop: 'end_date',
width: 180
},
{
label: '创建时间',
sortable: false,
prop: 'created_at',
width: 180
},
{
label: '创建人',
sortable: false,
prop: 'admin_id',
width: 120
}
]
}
},
computed: {},
mounted() {
this.getList()
},
methods: {
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 = ""
}
},
async getList() {
let res = await getList(this.select)
console.log(res)
this.data = res.data
this.total = res.total
},
deleteStudy(row) {
destroy({
id: row.id
}).then(res => {
this.$successMessage('destroy', '拜访记录')
this.getList()
})
},
editorStudy(row) {
// let addWhat = row.type == 1 ? "addCommon" : (row.type == 2 ? "addBuild" : (row.type == 3 ? "addPark" : ""))
let addWhat = "addCommon"
this.$refs[addWhat].id = row.id
this.$refs[addWhat].visitType=row.type
this.$refs[addWhat].type = 'editor'
this.$refs[addWhat].isShow = true
}
},
}
</script>
<style scoped lang="scss">
//::v-deep .el-button + .el-button{
// margin-left: 0 !important;
//}
::v-deep .el-button {
padding: 5px 8px !important;
}
.selector {
::v-deep .el-input--suffix .el-input__inner {
height: 28px;
}
::v-deep .el-select .el-input .el-select__caret {
line-height: 28px;
}
::v-deep .el-range-editor.el-input__inner {
height: 28px;
width: 250px
}
::v-deep .el-date-editor .el-range__icon {
line-height: 21px;
}
::v-deep .el-date-editor .el-range-separator {
line-height: 21px;
}
::v-deep .el-date-editor .el-range__close-icon {
line-height: 21px;
}
}
</style>

@ -25,7 +25,7 @@ module.exports = {
* Detail: https://cli.vuejs.org/config/#publicpath
*/
publicPath: '/admin/',
outputDir: '/Users/mac/Documents/朗业/2023/b-bd智能访客系统/szbd',
outputDir: '/Users/mac/Documents/朗业/2023/b-bd智能访客系统/bd-fangke/public/admin',
assetsDir: 'static',
css: {
loaderOptions: { // 向 CSS 相关的 loader 传递选项
@ -45,6 +45,14 @@ module.exports = {
},
//before: require('./mock/mock-server.js'),
proxy: {
'/idcard': {
target: 'http://127.0.0.1:24010',
changeOrigin: true, //配置跨域
"secure": false, // 接受运行在https上默认不接受
pathRewrite: {
'^/idcard':''
}
},
[process.env.VUE_APP_BASE_API]: {
target: process.env.VUE_APP_BASE_API,
changeOrigin: true, //配置跨域

Loading…
Cancel
Save