master
lion 4 years ago
parent 94b780fbc4
commit 25a862442a

@ -1,26 +1,11 @@
import request from '@/utils/request' import request from '@/utils/request'
export function getCounts() {
return request({
url: '/api/admin/get-counts',
method: 'get'
})
}
export function getChartsData(params) {
return request({
url: '/api/admin/get-charts-data',
method: 'get',
params: params
})
}
export function getChartsHome(params) {
return request({ export function getChartsHome(params){
url: '/api/admin/chart/home', return request({
method: 'get', url:'/api/admin/chart/home',
params: params method:'get',
}) params
})
} }

@ -23,3 +23,12 @@ export function carList(params){
params params
}) })
} }
export function homeList(params){
return request({
url:'/api/admin/chart/home',
method:'get',
params
})
}

@ -1,8 +1,8 @@
@font-face { @font-face {
font-family: "iconfont"; /* Project id 3929791 */ font-family: "iconfont"; /* Project id 3929791 */
src: url('//at.alicdn.com/t/c/font_3929791_iu3lev7rupa.woff2?t=1678430674262') format('woff2'), src: url('//at.alicdn.com/t/c/font_3929791_sbvx2wsy0lk.woff2?t=1680504085128') format('woff2'),
url('//at.alicdn.com/t/c/font_3929791_iu3lev7rupa.woff?t=1678430674262') format('woff'), url('//at.alicdn.com/t/c/font_3929791_sbvx2wsy0lk.woff?t=1680504085128') format('woff'),
url('//at.alicdn.com/t/c/font_3929791_iu3lev7rupa.ttf?t=1678430674262') format('truetype'); url('//at.alicdn.com/t/c/font_3929791_sbvx2wsy0lk.ttf?t=1680504085128') format('truetype');
} }
.iconfont { .iconfont {
@ -13,6 +13,14 @@
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.icon-yunshuzhongwuliu-xianxing:before {
content: "\e882";
}
.icon-shigongdi:before {
content: "\e628";
}
.icon-cheliangdangan:before { .icon-cheliangdangan:before {
content: "\e616"; content: "\e616";
} }

@ -4,17 +4,24 @@
<div class="box box1"> <div class="box box1">
<div class="boxtitle"> <div class="boxtitle">
<span>普通访客</span> <span>普通访客</span>
<i class="el-icon-data-line statIcon"></i> <i class="el-icon-user statIcon"></i>
</div> </div>
<div class="bline"></div> <div class="bline"></div>
<div class="boxcontentsubtitle">总人数/总入厂人数</div> <div class="boxcontentsubtitle">总人数/总入厂人数</div>
<div class="boxcontent"> <div class="boxcontent">
<div class="boxcontentitem"> <div class="boxcontentitem">
<div class="boxcontentitem-big"> <div class="boxcontentitem-big">
<span>3000</span> <span>
<span>1500</span> <count-to separator="" :start-val="0" :end-val="totaldata.common_visit.total"
:duration="3600" />
</span>
<span>
<count-to separator="" :start-val="0" :end-val="totaldata.common_visit.enter_visit"
:duration="3600" />
</span>
</div> </div>
<div class="per">核销比:50%</div> <div class="per">核销比:{{toCaculateper(totaldata.common_visit.enter_visit,totaldata.common_visit.total)}}</div>
</div> </div>
</div> </div>
<div class="blinefull"></div> <div class="blinefull"></div>
@ -22,10 +29,16 @@
<div class="boxcontent"> <div class="boxcontent">
<div class="boxcontentitem"> <div class="boxcontentitem">
<div class="boxcontentitem-big"> <div class="boxcontentitem-big">
<span>80</span> <span>
<span>40</span> <count-to separator="" :start-val="0" :end-val="totaldata.common_visit.today_total"
:duration="3600" />
</span>
<span>
<count-to separator="" :start-val="0" :end-val="totaldata.common_visit.today_enter_visit"
:duration="3600" />
</span>
</div> </div>
<div class="per">核销比:50%</div> <div class="per">核销比:{{toCaculateper(totaldata.common_visit.today_enter_visit,totaldata.common_visit.today_total)}}</div>
</div> </div>
</div> </div>
</div> </div>
@ -34,17 +47,23 @@
<div class="boxtitle"> <div class="boxtitle">
<span>施工访客</span> <span>施工访客</span>
<i class="el-icon-user statIcon"></i> <i class="iconfont icon-banqianguanli statIcon"></i>
</div> </div>
<div class="bline"></div> <div class="bline"></div>
<div class="boxcontentsubtitle">总人数/总核销人数</div> <div class="boxcontentsubtitle">总人数/总核销人数</div>
<div class="boxcontent"> <div class="boxcontent">
<div class="boxcontentitem"> <div class="boxcontentitem">
<div class="boxcontentitem-big"> <div class="boxcontentitem-big">
<span>3000</span> <span>
<span>1500</span> <count-to separator="" :start-val="0" :end-val="totaldata.work_visit.total"
:duration="3600" />
</span>
<span>
<count-to separator="" :start-val="0" :end-val="totaldata.work_visit.enter_visit"
:duration="3600" />
</span>
</div> </div>
<div class="per">核销比:50%</div> <div class="per">核销比:{{toCaculateper(totaldata.work_visit.enter_visit,totaldata.work_visit.total)}}</div>
</div> </div>
</div> </div>
<div class="blinefull"></div> <div class="blinefull"></div>
@ -52,55 +71,40 @@
<div class="boxcontent"> <div class="boxcontent">
<div class="boxcontentitem"> <div class="boxcontentitem">
<div class="boxcontentitem-big"> <div class="boxcontentitem-big">
<span>80</span> <span>
<span>40</span> <count-to separator="" :start-val="0" :end-val="totaldata.work_visit.today_total"
:duration="3600" />
</span>
<span>
<count-to separator="" :start-val="0" :end-val="totaldata.work_visit.today_enter_visit"
:duration="3600" />
</span>
</div> </div>
<div class="per">核销比:50%</div> <div class="per">核销比:{{toCaculateper(totaldata.work_visit.today_enter_visit,totaldata.work_visit.today_total)}}</div>
</div> </div>
</div> </div>
</div> </div>
<!-- <div class="box box3">
<div class="boxtitle">
<span>客户统计</span>
<i class="el-icon-s-custom statIcon"></i>
</div>
<div class="bline"></div>
<div class="boxcontentsubtitle">活跃客户</div>
<div class="boxcontent">
<div class="boxcontentitem">
<div class="boxcontentitem-big">
{{totaldata.customer.active}}人
</div>
<div style="display: flex;justify-content: space-around;">
<div class="boxcontentitem-small">
<span>{{totaldata.customer.add}}</span>
<span>新增</span>
</div>
<div class="boxcontentitem-small">
<span>{{totaldata.customer.wash}}</span>
<span>流失</span>
</div>
</div>
</div>
</div>
</div>
-->
<div class="box box4"> <div class="box box4">
<div class="boxtitle"> <div class="boxtitle">
<span>物流车辆</span> <span>物流车辆</span>
<i class="el-icon-document statIcon"></i> <i class="iconfont icon-cheliangdangan statIcon"></i>
</div> </div>
<div class="bline"></div> <div class="bline"></div>
<div class="boxcontentsubtitle">总预约数/总核销人数</div> <div class="boxcontentsubtitle">总预约数/总核销人数</div>
<div class="boxcontent"> <div class="boxcontent">
<div class="boxcontentitem"> <div class="boxcontentitem">
<div class="boxcontentitem-big"> <div class="boxcontentitem-big">
<span>3000</span> <span>
<span>1500</span> <count-to separator="" :start-val="0" :end-val="totaldata.car_visit.total"
:duration="3600" />
</span>
<span>
<count-to separator="" :start-val="0" :end-val="totaldata.car_visit.enter_visit"
:duration="3600" />
</span>
</div> </div>
<div class="per">核销比:50%</div> <div class="per">核销比:{{toCaculateper(totaldata.car_visit.enter_visit,totaldata.car_visit.total)}}</div>
</div> </div>
</div> </div>
<div class="blinefull"></div> <div class="blinefull"></div>
@ -108,10 +112,16 @@
<div class="boxcontent"> <div class="boxcontent">
<div class="boxcontentitem"> <div class="boxcontentitem">
<div class="boxcontentitem-big"> <div class="boxcontentitem-big">
<span>80</span> <span>
<span>40</span> <count-to separator="" :start-val="0" :end-val="totaldata.car_visit.today_total"
:duration="3600" />
</span>
<span>
<count-to separator="" :start-val="0" :end-val="totaldata.car_visit.today_enter_visit"
:duration="3600" />
</span>
</div> </div>
<div class="per">核销比:50%</div> <div class="per">核销比:{{toCaculateper(totaldata.work_visit.today_enter_visit,totaldata.car_visit.today_total)}}</div>
</div> </div>
</div> </div>
</div> </div>
@ -133,26 +143,24 @@
type: Object, type: Object,
default: { default: {
"business": { "common_visit": {
"server_money_total": 0, "enter_visit": 0,
"nurse_money_total": 0, "today_enter_visit": 0,
"remain_money_total": 0 "today_total": 0,
}, "total":0
"person_efficiency": {
"server_time_total": "0",
"expect": 0,
"act": 0
},
"customer": {
"active": 0,
"add": 0,
"wash": 0
}, },
"order": { "work_visit": {
"server_total": 0, "enter_visit": 0,
"cycle_total": 0, "today_enter_visit": 0,
"unit_total": 0 "today_total": 0,
"total":0
}, },
"car_visit": {
"enter_visit": 0,
"today_enter_visit": 0,
"today_total": 0,
"total":0
}
} }
} }
}, },

@ -1,6 +1,6 @@
<template> <template>
<div style="padding:20px"> <div style="padding:20px">
<PanelGroup></PanelGroup> <PanelGroup :totaldata='list'></PanelGroup>
<div class="tCharts"> <div class="tCharts">
<PieChart :chartData="pieData" :width="'30%'"></PieChart> <PieChart :chartData="pieData" :width="'30%'"></PieChart>
<LineChart :chartData="LineData" :width="'65%'"></LineChart> <LineChart :chartData="LineData" :width="'65%'"></LineChart>
@ -16,7 +16,8 @@
import LineChart from '@/components/morecharts/LineChart.vue' import LineChart from '@/components/morecharts/LineChart.vue'
import { import {
getChartsHome getChartsHome
} from "../../api/dashboard.js" } from "@/api/dashboard.js"
export default { export default {
components: { components: {
@ -88,24 +89,24 @@
await getChartsHome().then((res) => { await getChartsHome().then((res) => {
console.log(res); console.log(res);
this.list = res.list; this.list = res.list;
this.chartData = res; // this.chartData = res;
let _business_data = []; // let _business_data = [];
let _collect_data = []; // let _collect_data = [];
res.business_data.map(item => { // res.business_data.map(item => {
_business_data.push(item.server_money_total) // _business_data.push(item.server_money_total)
_collect_data.push(item.collect_money) // _collect_data.push(item.collect_money)
}) // })
this.business_data = _business_data; // this.business_data = _business_data;
this.collect_data = _collect_data; // this.collect_data = _collect_data;
let _customerArr = []; // let _customerArr = [];
let _orderArr = []; // let _orderArr = [];
res.order_data.map(item => { // res.order_data.map(item => {
_customerArr.push(item.active_customer) // _customerArr.push(item.active_customer)
_orderArr.push(item.order_total) // _orderArr.push(item.order_total)
}) // })
this.customerArr = _customerArr; // this.customerArr = _customerArr;
this.orderArr = _orderArr; // this.orderArr = _orderArr;
}).catch() }).catch()
}, },
init() { init() {
@ -215,7 +216,7 @@
}, },
created() { created() {
//this.loadData(); this.loadData();
}, },
mounted() { mounted() {

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

@ -0,0 +1,660 @@
<template>
<div>
<xy-dialog ref="dialog" :is-show.sync="isShow" type="form"
:title="type === 'add' ? `新增${typeName}记录` : `编辑${typeName}记录`" :form="form" :rules="rules" @submit="submit">
<template v-slot:visitinfo>
拜访信息
</template>
<template v-slot:date>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>到访日期:
</div>
<div class="xy-table-item-content">
<el-date-picker style="width:300px" v-model="form.date" value-format="yyyy-MM-dd" type="date"
placeholder="选择到访日期">
</el-date-picker>
</div>
</div>
</template>
<template v-slot:visit_time_id>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>到访时段:
</div>
<div class="xy-table-item-content">
<el-radio-group v-model="form.visit_time_id" style="width:300px">
<el-radio v-for="item in visitTimeList" :label="item.id">{{item.start_time}}-{{item.end_time}}</el-radio>
</el-radio-group>
</div>
</div>
</template>
<template v-slot:visit_area_id>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>前往区域:
</div>
<div class="xy-table-item-content">
<el-radio-group v-model="form.visit_area_id" style="width:300px">
<el-radio v-for="item in visitAreaList" :label="item.id">{{item.name}}</el-radio>
</el-radio-group>
</div>
</div>
</template>
<template v-slot:reason v-if="visitType==1">
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>到访事由:
</div>
<div class="xy-table-item-content">
<el-select v-model="form.reason" placeholder="请选择" style="width:300px">
<el-option v-for="item in reasonList" :key="item.value" :label="item.value" :value="item.value">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:workRange v-if="visitType==2">
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>施工时段:
</div>
<div class="xy-table-item-content">
<el-date-picker v-model="form.workRange" @change="changeworkrange" type="daterange" align="right" unlink-panels
value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间">
</el-date-picker>
</div>
</div>
</template>
<template v-slot:plate v-if="visitType==3">
<div class="xy-table-item">
<div class="xy-table-item-label">
停车区域:
</div>
<div class="xy-table-item-content">
<el-radio-group v-model="form.plate" style="width:300px">
<el-radio v-for="item in parkAreaList" :key="item.value" :label="item.value">{{item.value}}</el-radio>
</el-radio-group>
<!-- <el-input v-model="form.plate" placeholder="请输入车牌号"></el-input> -->
</div>
</div>
</template>
<template v-slot:remark>
<div class="xy-table-item">
<div class="xy-table-item-label">
备注:
</div>
<div class="xy-table-item-content">
<el-input :autosize="{minRows:2}" style="width:300px" type="textarea" v-model="form.remark"
placeholder="请输入备注" clearable></el-input>
</div>
</div>
</template>
<template v-slot:visitorinfo>
<div class="xy-table-item">
<div class="xy-table-item-content" style="width:400px">
拜访人信息:
</div>
</div>
</template>
<template v-slot:name>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>姓名:
</div>
<div class="xy-table-item-content">
<el-input v-model="form.name" placeholder="请输入姓名"></el-input>
</div>
</div>
</template>
<template v-slot:mobile>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>联系电话:
</div>
<div class="xy-table-item-content">
<el-input v-model="form.mobile" placeholder="请输入联系电话"></el-input>
</div>
</div>
</template>
<template v-slot:credent>
<div class="xy-table-item">
<div class="xy-table-item-label">证件类型:
</div>
<div class="xy-table-item-content">
<el-select v-model="form.credent" placeholder="请选择" style="width:100%">
<el-option v-for="item in credentList" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:idcard>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>证件号码:
</div>
<div class="xy-table-item-content">
<el-input v-model="form.idcard" placeholder="请输入证件号码"></el-input>
</div>
</div>
</template>
<template v-slot:company_name>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>单位名称:
</div>
<div class="xy-table-item-content">
<el-input v-model="form.company_name" placeholder="请输入单位名称"></el-input>
</div>
</div>
</template>
<!-- <template v-slot:cars v-if="visitType==3">
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>到访车辆:
</div>
<div class="xy-table-item-content">
<div v-for="(item,index) in form.cars">
<el-input v-model="form.cars[index]" placeholder="请输入到访车辆"></el-input>
</div>
</div>
</div>
</template> -->
<!-- <template v-slot:cars>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>到访车辆:
</div>
<div class="xy-table-item-content">
<Button type="primary" icon="md-add" style="margin-bottom: 10px"
@click="form.cars.push('')">新增车辆</Button>
<div class='carsitem' v-for="(item,index) in form.cars">
<el-input v-model="form.cars[index]" placeholder="请输入到访车辆"></el-input>
<Button size="small" type="primary" ghost @click="form.cars.splice(index,1)">删除</Button>
</div>
</div>
</div>
</template> -->
<template v-slot:follw_people v-if="visitType==1||visitType==2">
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>随访人员:
</div>
<div class="xy-table-item-content">
<Button type="primary" icon="md-add" style="margin-bottom: 10px"
@click="form.follw_people.push({ name:'',mobile:'',credent:1,idcard:'',credent_name:'身份证' })">新增随访人员</Button>
<xy-table style="width: 620px" :height="260" :is-page="false" :list="form.follw_people"
:table-item="followTable">
<template v-slot:btns>
<el-table-column label="操作" width="90" header-align="center" align="center">
<template v-slot:default="scope">
<Button size="small" type="primary" ghost
@click="form.follw_people.splice(scope.$index, 1)">删除</Button>
</template>
</el-table-column>
</template>
</xy-table>
</div>
</div>
</template>
<template v-slot:long_time>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>长访客申请:
</div>
<div class="xy-table-item-content" style="width:620px">
<el-radio-group v-model="form.long_time">
<el-radio v-for="item in longList" :label="item.id">{{item.value}}</el-radio>
</el-radio-group>
<div v-if="form.long_time==1" style="display: inline-block;vertical-align: middle;margin-left:10px">
<el-date-picker style="width:360px" @change="changelongrange" v-model="form.longrange" type="daterange" align="right" unlink-panels
value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
</el-date-picker>
</div>
</div>
</div>
</template>
<template v-slot:visitorinfos>
<div class="xy-table-item">
<div class="xy-table-item-content" style="width:400px">
被访人信息:
</div>
</div>
</template>
<!-- <template v-slot:accpet_department_id>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>部门:
</div>
<div class="xy-table-item-content">
<el-select v-model="form.accpet_department_id" placeholder="请选择" style="width:100%">
<el-option v-for="item in departmentList" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</div>
</div>
</template> -->
<template v-slot:accept_admin_id v-if="visitType==1||visitType==2">
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>人员:
</div>
<div class="xy-table-item-content">
<el-select filterable v-model="form.accept_admin_id" @change='changeAdmin' placeholder="请选择" style="width:100%">
<el-option v-for="item in adminList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:accept_goods_admin_id v-if="visitType==3">
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>收货人:
</div>
<div class="xy-table-item-content">
<el-select filterable v-model="form.accept_goods_admin_id" @change='changeGoods' placeholder="请选择" style="width:100%">
<el-option v-for="item in adminList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
show,
save
} from "@/api/visit/record.js"
import {
getparameter
} from "@/api/system/dictionary";
import {
getList as getTimeList
} from '@/api/resource/visittime.js'
import {
getList as getAreaList
} from '@/api/parameter/visitor.js'
import {
listCommonuser
} from "@/api/common.js"
export default {
components: {},
data() {
return {
isShow: false,
type: 'add',
id: '',
visitType: "",
typeName: '',
form: {
// type: 1,
visitinfo: "",
date: "",
visit_time_id: "",
visit_area_id: "",
workRange: "",
reason: "",
plate: "",
remark: "",
visitorinfo: "",
name: "",
mobile: "",
credent: 1,
idcard: "",
company_name: "",
cars: [''],
follw_people: [],
long_time: 0,
longrange: "",
visitorinfos: "",
accpet_department_id: "",
accept_admin_id: "",
accept_goods_admin_id: ""
},
// followList:[],
visitTimeList: [],
visitAreaList: [],
parkAreaList: [],
reasonList: [],
credentList: [{
id: 1,
value: "身份证"
},
{
id: 2,
value: "护照"
},
],
longList: [{
id: 0,
value: "否"
},
{
id: 1,
value: "是"
},
],
departmentList: [],
adminList: [],
carTable:[{
label: "车牌号",
prop: "car",
// width: 200,
customFn: (row, scope) => {
return (<el-input type="text" placeholder = "请填写车牌号"
v-model={row.car}>
</el-input>
)
}
}],
followTable: [{
label: "姓名",
prop: "name",
width: 200,
customFn: (row, scope) => {
return (<el-input type="text" placeholder = "请填写姓名"
v-model={row.name}>
</el-input>
)
}
},
{
label: "联系电话",
prop: "mobile",
width: 200,
customFn: (row, scope) => {
return (<el-input placeholder = "请填写联系电话"
v-model = {row.mobile} >
</el-input>
)
}
},
{
label: "证件类型",
// width: 180,
width: 200,
customFn: (row) => {
return (<el-select placeholder = "请选择证件类型"
style = "width: 140px"
value = {row.credent==1?'身份证':'护照'}
on = {
{
["change"]: (e) => (row.credent_name = e.value, row.credent = e.id),
}
} > {
this.credentList.map((item, index) => {
return (<el-option
// v-for={item in types}
value = {
item
}
key = {
item.id
}
label = {
item.value
} >
</el-option>
)
})
} </el-select>
);
},
}, {
label: "证件号码",
prop: "idcard",
width: 200,
customFn: (row, scope) => {
return (<el-input placeholder = "请填写证件号码"
v-model = {row.idcard}>
</el-input>
)
}
}
],
rules: {
date: [{
required: true,
message: '请选择到访日期'
}],
visit_time_id: [{
required: true,
message: '请选择到访时段'
}],
visit_area_id: [{
required: true,
message: '请选择到访区域'
}],
plate: [{
required: true,
message: '请选择停车区域'
}],
name: [{
required: true,
message: '请输入姓名'
}],
mobile: [{
required: true,
message: "请填写联系电话",
},
{
pattern: /^[1][3-9][\d]{9}/,
message: "手机号格式错误",
}
],
idcard: [{
required: true,
message: '请输入身份证号'
},{
pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/,
message: '身份证格式错误'
}],
company_name: [{
required: true,
message: '请输入单位名称'
}],
},
pickerOptions: {
shortcuts: [{
text: '最近一周',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit('pick', [start, end]);
}
}, {
text: '最近一个月',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit('pick', [start, end]);
}
}, {
text: '最近三个月',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit('pick', [start, end]);
}
}]
}
}
},
created() {
this.getVisitTime()
},
methods: {
async getDetail() {
const res = await show({
id: this.id
})
this.form = {
visitinfo: "",
date: res?.date,
visit_time_id: res?.visit_time_id,
visit_area_id: res?.visit_area_id,
workRange: res.work_start_time?[res.work_start_time,res.work_end_time]:"",
reason: res?.reason,
plate: res?.plate,
remark: res?.remark,
visitorinfo: "",
name: res?.name,
mobile: res?.mobile,
credent: res?.credent,
idcard: res?.idcard,
company_name: res?.company_name,
cars: res?.cars,
follw_people: res?.follw_people,
long_time: res?.long_time,
longrange: res.start_date?[res.start_date,res.end_date]:"",
visitorinfos: "",
accpet_department_id: res?.accpet_department_id,
accept_admin_id: res?.accept_admin_id,
accept_goods_admin_id: res?parseInt(res.accept_goods_admin_id):''
}
},
async getVisitTime() {
const res = await getTimeList()
this.visitTimeList = res.data
const resarea = await getAreaList()
this.visitAreaList = resarea.data
const resuser = await listCommonuser({page:1,page_size:999})
this.adminList = resuser.data
const reason = await getparameter({
number: "reasonList",
});
this.reasonList = reason?.detail;
const park = await getparameter({
number: "parkArea",
});
this.parkAreaList = park?.detail;
},
changelongrange(val){
this.form.start_date = val[0]
this.form.end_date = val[1]
},
changeworkrange(val){
this.form.work_start_time = val[0]
this.form.work_end_time = val[1]
},
changeAdmin(item){
if(item){
this.adminList.map(e=>{
if(e.id==item){
console.log(e)
this.form.accept_admin_id = e.id
this.form.accpet_department_id = e.department_id
}
})
}
},
changeGoods(item){
if(item){
this.adminList.map(e=>{
if(e.id==item){
console.log(e)
this.form.accept_admin_id = e.id
this.form.accept_goods_admin_id = e.id
this.form.accpet_department_id = e.department_id
}
})
}
},
submit() {
let that = this
if(this.visitType==3){
this.form.accept_admin_id = this.form.accept_goods_admin_id
}
if (this.type === 'editor') {
this.form.id = this.id
}else{
this.form.id = ""
}
console.log("that.form", that.form)
// return
save({
...that.form
}).then(res => {
this.$successMessage(this.type, this.typeName)
this.isShow = false
this.$emit('refresh')
})
}
},
watch: {
isShow(newVal) {
if (newVal) {
this.form.type = this.visitType
this.form.audit_status = 1
if (this.type === 'editor') {
this.getDetail()
}
} else {
this.id = ''
this.type = ''
this.visitType = 1
// this.followList = []
this.$refs['dialog'].reset()
}
},
visitType(val) {
if (val) {
this.typeName = val == 1 ? '普通访客' : (val == 2 ? '施工访客' : (val == 3 ? '物流车辆' : ''))
}
}
}
}
</script>
<style scoped lang="scss">
.xy-table-item-label {
width: 180px !important;
}
.xy-table-item-content {
width: 100%
}
.img__delete {
transform: scale(0.8, 0.8);
position: absolute;
top: 4px;
right: 4px;
}
.carsitem{
width:450px;margin-bottom:10px;margin-bottom: 10px;display: flex;align-items: center;justify-content: space-between;
}
.carsitem Button{
margin-left:10px
}
</style>

@ -165,21 +165,29 @@
</div> </div>
</template> --> </template> -->
<template v-slot:cars> <template v-slot:cars>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label"> <div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>到访车辆: <span style="color: red;font-weight: 600;padding-right: 4px;"></span>到访车辆:
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<Button type="primary" icon="md-add" style="margin-bottom: 10px" <Button type="primary" icon="md-add" style="margin-bottom: 10px"
@click="form.cars.push('')">新增车辆</Button> @click="carsList.push({car:''})">新增到访车辆</Button>
<div class='carsitem' v-for="(item,index) in form.cars">
<el-input v-model="form.cars[index]" placeholder="请输入到访车辆"></el-input> <xy-table style="width: 620px" :height="180" :is-page="false" :list="carsList"
<Button size="small" type="primary" ghost @click="form.cars.splice(index,1)">删除</Button> :table-item="carTable">
</div> <template v-slot:btns>
</div> <el-table-column label="操作" width="90" header-align="center" align="center">
<template v-slot:default="scope">
<Button size="small" type="primary" ghost
@click="carsList.splice(scope.$index, 1)">删除</Button>
</template>
</el-table-column>
</template>
</xy-table>
</div> </div>
</template> </div>
</template>
<template v-slot:follw_people v-if="visitType==1||visitType==2"> <template v-slot:follw_people v-if="visitType==1||visitType==2">
@ -189,15 +197,15 @@
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<Button type="primary" icon="md-add" style="margin-bottom: 10px" <Button type="primary" icon="md-add" style="margin-bottom: 10px"
@click="form.follw_people.push({ name:'',mobile:'',credent:1,idcard:'',credent_name:'身份证' })">新增随访人员</Button> @click="followList.push({ name:'',mobile:'',credent:1,idcard:'',credent_name:'身份证' })">新增随访人员</Button>
<xy-table style="width: 620px" :height="260" :is-page="false" :list="form.follw_people" <xy-table style="width: 620px" :height="260" :is-page="false" :list="followList"
:table-item="followTable"> :table-item="followTable">
<template v-slot:btns> <template v-slot:btns>
<el-table-column label="操作" width="90" header-align="center" align="center"> <el-table-column label="操作" width="90" header-align="center" align="center">
<template v-slot:default="scope"> <template v-slot:default="scope">
<Button size="small" type="primary" ghost <Button size="small" type="primary" ghost
@click="form.follw_people.splice(scope.$index, 1)">删除</Button> @click="followList.splice(scope.$index, 1)">删除</Button>
</template> </template>
</el-table-column> </el-table-column>
</template> </template>
@ -246,7 +254,7 @@
<template v-slot:accept_admin_id v-if="visitType==1||visitType==2"> <template v-slot:accept_admin_id v-if="visitType==1||visitType==2">
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label"> <div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>人员: <span style="color: red;font-weight: 600;padding-right: 4px;">*</span>人员:
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-select filterable v-model="form.accept_admin_id" @change='changeAdmin' placeholder="请选择" style="width:100%"> <el-select filterable v-model="form.accept_admin_id" @change='changeAdmin' placeholder="请选择" style="width:100%">
@ -259,7 +267,7 @@
<template v-slot:accept_goods_admin_id v-if="visitType==3"> <template v-slot:accept_goods_admin_id v-if="visitType==3">
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label"> <div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>收货人: <span style="color: red;font-weight: 600;padding-right: 4px;">*</span>收货人:
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-select filterable v-model="form.accept_goods_admin_id" @change='changeGoods' placeholder="请选择" style="width:100%"> <el-select filterable v-model="form.accept_goods_admin_id" @change='changeGoods' placeholder="请选择" style="width:100%">
@ -319,7 +327,7 @@
credent: 1, credent: 1,
idcard: "", idcard: "",
company_name: "", company_name: "",
cars: [''], cars: [],
follw_people: [], follw_people: [],
long_time: 0, long_time: 0,
longrange: "", longrange: "",
@ -328,7 +336,8 @@
accept_admin_id: "", accept_admin_id: "",
accept_goods_admin_id: "" accept_goods_admin_id: ""
}, },
// followList:[], followList:[],
carsList:[],
visitTimeList: [], visitTimeList: [],
visitAreaList: [], visitAreaList: [],
parkAreaList: [], parkAreaList: [],
@ -380,7 +389,7 @@
prop: "mobile", prop: "mobile",
width: 200, width: 200,
customFn: (row, scope) => { customFn: (row, scope) => {
return (<el-input placeholder = "请填写联系电话" return (<el-input type="text" placeholder = "请填写联系电话"
v-model = {row.mobile} > v-model = {row.mobile} >
</el-input> </el-input>
) )
@ -423,7 +432,7 @@
prop: "idcard", prop: "idcard",
width: 200, width: 200,
customFn: (row, scope) => { customFn: (row, scope) => {
return (<el-input placeholder = "请填写证件号码" return (<el-input type="text" placeholder = "请填写证件号码"
v-model = {row.idcard}> v-model = {row.idcard}>
</el-input> </el-input>
) )
@ -471,7 +480,16 @@
company_name: [{ company_name: [{
required: true, required: true,
message: '请输入单位名称' message: '请输入单位名称'
}], }],
accept_admin_id: [{
required: true,
message: '请选择被访人'
}],
accept_goods_admin_id: [{
required: true,
message: '请选择收货人'
}]
}, },
pickerOptions: { pickerOptions: {
shortcuts: [{ shortcuts: [{
@ -503,7 +521,7 @@
} }
}, },
created() { created() {
this.getVisitTime() this.getLabel()
}, },
methods: { methods: {
@ -534,9 +552,13 @@
accpet_department_id: res?.accpet_department_id, accpet_department_id: res?.accpet_department_id,
accept_admin_id: res?.accept_admin_id, accept_admin_id: res?.accept_admin_id,
accept_goods_admin_id: res?parseInt(res.accept_goods_admin_id):'' accept_goods_admin_id: res?parseInt(res.accept_goods_admin_id):''
}
this.followList = res?.follw_people
for(var k of res?.cars){
this.carsList.push({car:k})
} }
}, },
async getVisitTime() { async getLabel() {
const res = await getTimeList() const res = await getTimeList()
this.visitTimeList = res.data this.visitTimeList = res.data
const resarea = await getAreaList() const resarea = await getAreaList()
@ -566,7 +588,6 @@
if(item){ if(item){
this.adminList.map(e=>{ this.adminList.map(e=>{
if(e.id==item){ if(e.id==item){
console.log(e)
this.form.accept_admin_id = e.id this.form.accept_admin_id = e.id
this.form.accpet_department_id = e.department_id this.form.accpet_department_id = e.department_id
} }
@ -578,7 +599,6 @@
if(item){ if(item){
this.adminList.map(e=>{ this.adminList.map(e=>{
if(e.id==item){ if(e.id==item){
console.log(e)
this.form.accept_admin_id = e.id this.form.accept_admin_id = e.id
this.form.accept_goods_admin_id = e.id this.form.accept_goods_admin_id = e.id
this.form.accpet_department_id = e.department_id this.form.accpet_department_id = e.department_id
@ -589,6 +609,10 @@
}, },
submit() { submit() {
let that = this let that = this
that.form.follw_people = that.followList
for(var k of that.carsList){
that.form.cars.push(k.car)
}
if(this.visitType==3){ if(this.visitType==3){
this.form.accept_admin_id = this.form.accept_goods_admin_id this.form.accept_admin_id = this.form.accept_goods_admin_id
} }
@ -597,7 +621,6 @@
}else{ }else{
this.form.id = "" this.form.id = ""
} }
console.log("that.form", that.form)
// return // return
save({ save({
...that.form ...that.form
@ -620,7 +643,8 @@
this.id = '' this.id = ''
this.type = '' this.type = ''
this.visitType = 1 this.visitType = 1
// this.followList = [] this.followList = []
this.carsList = []
this.$refs['dialog'].reset() this.$refs['dialog'].reset()
} }
}, },

@ -25,13 +25,14 @@
<template v-slot:codeType v-if="formDataType=='coderecord'"> <template v-slot:codeType v-if="formDataType=='coderecord'">
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label" style="font-size: 32px;width: 280px!important;"> <div class="xy-table-item-label" style="font-size: 32px;width: 280px!important;">
核销类型: 核销状态:
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<div style="font-size: 32px;padding: 25px;width:400px"> <div style="font-size: 32px;padding: 25px;width:400px">
<el-radio-group v-model="codeForm.type"> <el-radio-group v-model="codeForm.type">
<el-radio :label="item.id" v-for="item in codeTypeList">{{item.value}}</el-radio> <el-radio :label="item.id" v-for="item in codeTypeList">{{item.value}}</el-radio>
</el-radio-group> </el-radio-group>
<!-- {{form.audit_status_text}} -->
</div> </div>
</div> </div>
</div> </div>
@ -446,8 +447,9 @@
} }
if (this.formDataType == 'coderecord') { if (this.formDataType == 'coderecord') {
this.codeForm.code = parseInt(this.form.code) this.codeForm.code = this.form.code
this.codeForm.admin_id = parseInt(this.gateAdminId) this.codeForm.admin_id = parseInt(this.gateAdminId)
this.codeForm.type=this.form.audit_status==1?1:(this.form.audit_status==3?2:'')
} }
} else { } else {
this.reset() this.reset()

Loading…
Cancel
Save