master
lion 3 years ago
parent bd5c4d3bfc
commit 80adbcdf96

@ -2,7 +2,7 @@ import request from "@/utils/request";
export function getList(params){
return request({
url:'/api/admin/study/index',
url:'/api/admin/visit_audit/index',
method:'get',
params
})
@ -11,7 +11,7 @@ export function getList(params){
export function show(params){
return request({
method:'get',
url:'/api/admin/study/show',
url:'/api/admin/visit_audit/show',
params
})
}
@ -19,15 +19,7 @@ export function show(params){
export function save(data){
return request({
method:'post',
url:'/api/admin/study/save',
data
})
}
export function store(data){
return request({
method:'post',
url:'/api/admin/study/store',
url:'/api/admin/visit_audit/save',
data
})
}
@ -35,7 +27,7 @@ export function store(data){
export function destroy(data){
return request({
method:'post',
url:'/api/admin/study/destroy',
url:'/api/admin/visit_audit/destroy',
data
})
}

@ -0,0 +1,92 @@
import axios from 'axios'
import { getToken } from '@/utils/auth'
import { Loading, Message } from 'element-ui'
/*
* @params {string} url 请求拼接地址
* @params {object} info 请求参数params或data
*/
let loading;
export async function download(url,method='get',info,filename){
loading = Loading.service({
lock:true,
background:"rgba(0,0,0,0.4)",
text:"文件正在生成中..."
})
let options = {
baseURL:process.env.VUE_APP_BASE_API,
url,
method,
responseType: 'blob',
timeout:10000,
headers: {
Accept: 'application/json','Content-Type':'application/json; charset=utf-8',
withCredentials: true,
Authorization:"Bearer " + getToken()
},
}
if(method === 'get'){
Object.defineProperty(options,'params',{
value:info,
enumerable:true,
writable:false
})
}
if(method === 'post'){
Object.defineProperty(options,'data',{
value:info,
enumerable:true,
writable:false
})
}
try {
const response = await axios.request(options)
loading.close()
// 提取文件名
if(!filename){
filename = response.headers['content-disposition']?.match(
/filename=(.*)/
)[1] || ''
}
// 将二进制流转为blob
const blob = new Blob([response.data], { type: 'application/octet-stream' })
if (typeof window.navigator.msSaveBlob !== 'undefined') {
// 兼容IEwindow.navigator.msSaveBlob以本地方式保存文件
window.navigator.msSaveBlob(blob, decodeURI(filename))
} else {
// 创建新的URL并指向File对象或者Blob对象的地址
const blobURL = window.URL.createObjectURL(blob)
// 创建a标签用于跳转至下载链接
const tempLink = document.createElement('a')
tempLink.style.display = 'none'
tempLink.href = blobURL
tempLink.setAttribute('download', decodeURI(filename))
// 兼容某些浏览器不支持HTML5的download属性
if (typeof tempLink.download === 'undefined') {
tempLink.setAttribute('target', '_blank')
}
// 挂载a标签
document.body.appendChild(tempLink)
tempLink.click()
document.body.removeChild(tempLink)
// 释放blob URL地址
window.URL.revokeObjectURL(blobURL)
}
}catch (err){
console.error(err)
loading.close()
Message({
type:'error',
message:err
})
}
}

@ -12,17 +12,17 @@
</div>
</div>
</template>
<template v-slot:check_list>
<template v-slot:audit_admin>
<div class="xy-table-item">
<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 class="xy-table-item-content">
<Button
type="primary"
icon="md-add"
style="margin-bottom: 10px"
@click="form.check_list.push({ name:'',type:'',person:'',type_name:'' })"
@click="addRow"
>添加审核人节点</Button
>
@ -30,7 +30,7 @@
style="width: 620px"
:height="260"
:is-page="false"
:list="form.check_list"
:list="form.audit_admin"
:table-item="contentTable"
>
<template v-slot:btns>
@ -45,7 +45,7 @@
size="small"
type="primary"
ghost
@click="form.check_list.splice(scope.$index, 1)"
@click="form.audit_admin.splice(scope.$index, 1)"
>删除</Button
>
</template>
@ -56,13 +56,13 @@
</div>
</template>
<template v-slot:recommend2>
<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}" type="textarea" v-model="form.recommend2" placeholder="请输入学习内容" clearable
<el-input :autosize="{minRows:2}" type="textarea" v-model="form.remark" placeholder="请输入备注" clearable
style="width: 300px;"></el-input>
</div>
</div>
@ -80,7 +80,8 @@
store,
show,
save
} from "@/api/parameter/visitor.js"
} from "@/api/parameter/visitor.js"
import {listCommonuser} from "@/api/common.js"
export default {
components: {},
data() {
@ -90,63 +91,57 @@
id: '',
form: {
studyName:"",
check_list:[{
name:"",
type:"",
person:"",
type_name:""
}],
recommend2:""
name:"",
audit_admin:[],
remark:""
},
checkList:['一级审核人','二级审核人','三级审核人'],
rules:{
name:[
{
required:true,
message:'请输入区域名称'
}
]
},
//
chenckTypes:[
{
id:1,
id:0,
value:'上级'
},
{
id:2,
id:1,
value:'指定审核人'
}
],
checkAdmin:[],
contentTable: [
{
label:"审核名称",
prop:"name",
customFn: (row,scope) => {
return(
<el-input
placeholder="请填写审核名称"
value={row.name}
// value={row.id}
>
</el-input>
this.checkList[scope.$index]
)
}
},
{
label: "审核类别",
width: 180,
customFn: (row) => {
customFn: (row,scope) => {
return (
<el-select
placeholder="请选择审核类别"
style="width: 140px"
value={row.type_name}
on={{
["change"]: (e) => (row.type_name=e.value,row.type = e.id),
["change"]: (e) => (row.type_name=e.value,row.type = e.id,row.level = scope.$index>0&&e.id!=0?scope.$index:e.id,row.admin_id=row.level==0?'':row.admin_id,row.admin_name=''),
}}
>
{
this.chenckTypes.map((item,index)=>{
return(
<el-option
// v-for={item in types}
value={item}
key={item.id}
label={item.value}
@ -163,26 +158,25 @@
label: "审核人",
width: 180,
customFn: (row) => {
if(row.type==1){
if(row.type==0){
return
}
return (
<el-select
placeholder="请选择审核人"
style="width: 140px"
value={row.type_name}
value={row.admin_name}
on={{
["change"]: (e) => (row.type_name=e.value,row.type = e.id),
["change"]: (e) => (row.admin_name = e.name,row.admin_id = e.id),
}}
>
{
this.chenckTypes.map((item,index)=>{
this.checkAdmin.map((item,index)=>{
return(
<el-option
// v-for={item in types}
value={item}
key={item.id}
label={item.value}
label={item.name}
>
</el-option>
)
@ -196,42 +190,44 @@
}
},
created() {
this.getUser()
},
methods: {
async getUser(){
const res = await listCommonuser()
this.checkAdmin = res.data
},
async getDetail() {
const res = await show({
id: this.id
})
this.form = {
name:res?.name,
audit_admin:res?.audit_admin,
remark:res?.remark
}
},
addRow(){
if(this.form.audit_admin.length==3){
return
}
this.form.audit_admin.push({ type:'',admin_id:'',level:'',type_name:'',admin_name:'' })
},
submit() {
if (this.type === 'add') {
console.log(this.form)
// return
store({
}).then(res => {
this.$successMessage('add', '访客区域')
this.isShow = false
this.$emit('refresh')
})
return
}
if (this.type === 'editor') {
save({
id: this.id,
}).then(res => {
this.$successMessage('editor', '访客区域')
this.isShow = false
this.$emit('refresh')
})
}
console.log(this.form)
// return
let that = this
if (this.type === 'editor') {
this.form.id = this.id
}
save({
...that.form
}).then(res => {
this.$successMessage(this.type, '访客区域')
this.isShow = false
this.$emit('refresh')
})
}
},
watch: {

@ -30,7 +30,7 @@
<script>
import {getList,destory} from '@/api/parameter/visitor.js'
import {getList,destroy} from '@/api/parameter/visitor.js'
import addVisitor from '@/views/parameter/component/addVisitor'
export default {
components: {
@ -46,29 +46,35 @@ export default {
data:[],
table:[
{
label:'区域名称',
sortable:false,
prop:'start_time'
},
{
label:'审核类型',
sortable:false,
prop:'end_time',
label:'序号',
type:"index"
},
{
label:'备注',
label:'区域名称',
sortable:false,
prop:'end_time',
prop:'name'
},
// {
// label:'',
// sortable:false,
// prop:'end_time',
// },
// {
// label:'',
// sortable:false,
// prop:'end_time',
// },
{
label:'创建时间',
sortable:false,
prop:'end_time',
prop:'created_at',
width:180
},
{
label:'创建人',
sortable:false,
prop:'end_time',
prop:'admin',
width:180
}
]
}

@ -66,11 +66,22 @@
prop: 'name',
width:240,
align:'left'
},
{
label: '面向对象',
sortable: false,
prop: 'type',
formatter: (cell, data, value) => {
return value=="1"?"普通访客":(value=="2"?"施工访客":"物流车辆")
}
},
{
label: '测验有效期',
sortable: false,
prop: 'expire_day'
prop: 'expire_day',
formatter: (cell, data, value) => {
return `${value}`
}
},
{
@ -89,7 +100,8 @@
{
prop: 'created_at',
label: '创建时间',
sortable: false,
sortable: false,
width:180,
},
{
label: '创建人',
@ -105,13 +117,8 @@
},
methods: {
async getList() {
let res = await getList(this.select)
this.data = res.data
// for(var item in studyDates){
// if(value==item.id){
// return item.value
// }
// }
let res = await getList(this.select)
this.data = res.data
this.total = res.total
},
deleteRow(row) {

@ -1,163 +1,287 @@
<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;">
<div style="margin-right: 10px;">关键词</div>
<el-input size="mini" placeholder="请输入关键词" v-model="select.keyword" style="width: 160px;margin-right: 10px;"></el-input>
<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"
@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} from '@/api/visit/record.js'
import addCommon from '@/views/visit/component/addCommon'
import addBuild from '@/views/visit/component/addBuild'
import addPark from '@/views/visit/component/addPark'
export default {
components: {
addCommon,
addBuild,
addPark
},
data() {
return {
visible:false,
select:{
page:1,
rows:10
<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-switch
v-model="select.myself_accept"
active-color="#004593"
inactive-color="#ddd"
:active-value="1"
:inactive-value="0"
>
</el-switch>
<div style="margin:0 10px;">只看自己审核记录</div>
<el-switch
v-model="select.myself_audit"
active-color="#004593"
inactive-color="#ddd"
:active-value="1"
:inactive-value="0"
>
</el-switch>
<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"
@pageSizeChange="e => {select.rows = e;select.page = 1;getList()}"
@pageIndexChange="e => {select.page = e;getList()}">
<template v-slot:btns>
<el-table-column fixed="right" label="操作" width="180" header-align="center">
<template slot-scope="scope">
<i-button
style="margin-right:6px"
type="primary"
size="small"
@click="checkRecords(scope.row)"
>
审核
</i-button>
<Poptip
confirm
:transfer="true"
title="确认要删除吗"
@on-ok="deleteStudy(scope.row)"
>
<i-button
style="margin-right:6px"
type="error"
size="small"
>
删除
</i-button>
</Poptip>
</template>
</el-table-column>
</template>
</xy-table>
<checkRecord ref="checkRecord" @refresh="getList"></checkRecord>
<!-- <addBuild ref="addBuild" @refresh="getList"></addBuild>
<addPark ref="addPark" @refresh="getList"></addPark> -->
</div>
</template>
<script>
import {
getList,
destroy
} from '@/api/visit/check.js'
import checkRecord from '@/views/visit/component/checkRecord'
export default {
components: {
checkRecord
},
data() {
return {
visible: false,
select: {
page: 1,
rows: 10,
keyword: "",
audit_status: "",
myself_accept: 0,
myself_audit: 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: {
async getList() {
let res = await getList(this.select)
console.log(res)
this.data = res.data
this.total = res.total
},
deleteStudy(row) {
console.log(row)
destroy({
id: row.id
}).then(res => {
this.$successMessage('destroy', '拜访记录')
this.getList()
})
},
total:0,
data:[],
table:[
{
label:'姓名',
sortable:false,
prop:'start_time',
fixed:"left",
align:"left"
},
{
label:'类型',
sortable:false,
prop:'end_time',
},
{
label:'状态',
sortable:false,
prop:'end_time',
},
{
label:'是否随访',
sortable:false,
prop:'end_time',
},
{
label:'预约时间',
sortable:false,
prop:'end_time',
},
{
label:'证件类型',
sortable:false,
prop:'end_time',
},
{
label:'证件号',
sortable:false,
prop:'end_time',
},
{
label:'状态',
sortable:false,
prop:'end_time',
},
{
label:'单位名称',
sortable:false,
prop:'end_time',
},
{
label:'手机号',
sortable:false,
prop:'end_time',
},
{
label:'开始时间',
sortable:false,
prop:'end_time',
},
{
label:'结束时间',
sortable:false,
prop:'end_time',
},
{
label:'创建时间',
sortable:false,
prop:'end_time',
},
{
label:'创建人',
sortable:false,
prop:'end_time',
}
]
}
},
computed: {},
mounted() {
// this.getList()
},
methods: {
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":""))
this.$refs[addWhat].id = row.id
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;
}
checkRecords(row){
this.$refs['checkRecord'].isShow = true
this.$refs['checkRecord'].id = row.id
}
},
}
</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>

@ -231,28 +231,6 @@
this.isShow = false
this.$emit('refresh')
})
// if (this.type === 'add') {
// console.log(this.form)
// // return
// store({
// this.form
// }).then(res => {
// this.$successMessage('add', '')
// this.isShow = false
// this.$emit('refresh')
// })
// return
// }
// if (this.type === 'editor') {
// save({
// id: this.id,
// }).then(res => {
// this.$successMessage('editor', '')
// this.isShow = false
// this.$emit('refresh')
// })
// }
}
},
watch: {

@ -1,507 +0,0 @@
<template>
<div>
<xy-dialog ref="dialog" :is-show.sync="isShow" type="form" :title="type === 'add' ? '新增施工访客记录' : '编辑施工访客记录'" :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
v-model="form.date"
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">
<el-radio v-for="item in visitTimeList" :label="item.id">{{item.value}}</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">
<el-radio v-for="item in visitAreaList" :label="item.id">{{item.value}}</el-radio>
</el-radio-group>
</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}" type="textarea" v-model="form.remark" placeholder="请输入备注" clearable
style="width:300px" ></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">
姓名
</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">
联系电话
</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">
证件号码
</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">
单位名称
</div>
<div class="xy-table-item-content">
<el-input v-model="form.company_name" placeholder="请输入单位名称"
></el-input>
</div>
</div>
</template>
<template v-slot:cars>
<div class="xy-table-item">
<div class="xy-table-item-label">
到访车辆
</div>
<div class="xy-table-item-content">
<el-input v-model="form.cars" placeholder="请输入到访车辆"
></el-input>
</div>
</div>
</template>
<template v-slot:follow_list>
<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.follow_list.push({ name:'',mobile:'',credent:1,idcard:'',credent_name:'身份证' })"
>新增随访人员</Button
>
<xy-table
style="width: 620px"
:height="260"
:is-page="false"
:list="form.follow_list"
: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.follow_list.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
v-model="longrange"
type="daterange"
align="right"
unlink-panels
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:picker-options="pickerOptions">
</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>
<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.accept_admin_id" placeholder="请选择" style="width:100%">
<el-option
v-for="item in adminList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
store,
show,
save
} from "@/api/visit/record.js"
import pickerOptions from "@/utils/common.js"
export default {
components: {},
data() {
return {
isShow: false,
type: 'add',
id: '',
form: {
type:2,
visitinfo:"",
date:"",
visit_time_id:"",
visit_area_id:"",
remark:"",
visitorinfo:"",
name:"",
mobile:"",
credent:1,
idcard:"",
company_name:"",
cars:"",
follow_list:[
{ name:'',mobile:'',credent:1,idcard:'',credent_name:"身份证" }
],
long_time:0,
visitorinfos:"",
accpet_department_id:"",
accept_admin_id:""
},
longrange:[],
visitTimeList:[{
id:1,
value:"9:00-11:00"
},{
id:1,
value:"9:00-11:00"
},{
id:1,
value:"9:00-11:00"
},{
id:1,
value:"9:00-11:00"
}],
visitAreaList:[{
id:1,
value:"9:00-11:00"
}],
reasonList:[{
value:1,
label:"9:00-11:00"
}],
credentList:[
{
id:1,
value:"身份证"
},
{
id:2,
value:"护照"
},
],
longList:[
{
id:0,
value:"否"
},
{
id:1,
value:"是"
},
],
departmentList:[],
adminList:[],
followTable:[{
label:"姓名",
prop:"name",
width:200,
customFn: (row,scope) => {
return(
<el-input
placeholder="请填写姓名"
value={row.name}
>
</el-input>
)
}
},
{
label:"联系电话",
prop:"mobile",
width:200,
customFn: (row,scope) => {
return(
<el-input
placeholder="请填写联系电话"
value={row.mobile}
>
</el-input>
)
}
},
{
label: "证件类型",
// width: 180,
width:200,
customFn: (row) => {
return (
<el-select
placeholder="请选择证件类型"
style="width: 140px"
value={row.credent_name}
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="请填写证件号码"
value={row.idcard}
>
</el-input>
)
}
}],
rules:{
},
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() {
},
methods: {
async getDetail() {
const res = await show({
id: this.id
})
this.form = {
}
},
submit() {
if (this.type === 'add') {
console.log(this.form)
// return
store({
}).then(res => {
this.$successMessage('add', '时段')
this.isShow = false
this.$emit('refresh')
})
return
}
if (this.type === 'editor') {
save({
id: this.id,
}).then(res => {
this.$successMessage('editor', '时段')
this.isShow = false
this.$emit('refresh')
})
}
}
},
watch: {
isShow(newVal) {
if (newVal) {
if (this.type === 'editor') {
this.getDetail()
}
} else {
this.id = ''
this.type = ''
this.$refs['dialog'].reset()
}
}
}
}
</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;
}
</style>

@ -1,9 +1,9 @@
<template>
<div>
<xy-dialog ref="dialog" :is-show.sync="isShow" type="form" :title="type === 'add' ? `新增${typeName}记录` : `编辑${typeName}记录`"
:form="form" :rules="rules" @submit="submit">
<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>
拜访信息 {{visitType}}
拜访信息
</template>
<template v-slot:date>
<div class="xy-table-item">
@ -11,7 +11,8 @@
<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 style="width:300px" v-model="form.date" value-format="yyyy-MM-dd" type="date"
placeholder="选择到访日期">
</el-date-picker>
</div>
</div>
@ -36,7 +37,7 @@
</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.value}}</el-radio>
<el-radio v-for="item in visitAreaList" :label="item.id">{{item.name}}</el-radio>
</el-radio-group>
</div>
</div>
@ -53,29 +54,29 @@
</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="workRange" type="datetimerange" align="right" unlink-panels value-format="yyyy-MM-dd HH:mm:ss"
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-input v-model="form.plate" placeholder="请输入车牌号"></el-input>
</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-input v-model="form.plate" placeholder="请输入车牌号"></el-input>
</div>
</div>
</template>
<template v-slot:remark>
<div class="xy-table-item">
@ -83,8 +84,8 @@
备注
</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>
<el-input :autosize="{minRows:2}" style="width:300px" type="textarea" v-model="form.remark"
placeholder="请输入备注" clearable></el-input>
</div>
</div>
</template>
@ -98,7 +99,7 @@
<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>
@ -108,7 +109,7 @@
<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>
@ -158,22 +159,22 @@
</div>
</template>
<template v-slot:follow_list v-if="visitType==1||visitType==2">
<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="followList.push({ name:'',mobile:'',credent:1,idcard:'',credent_name:'身份证' })">新增随访人员</Button>
@click="form.follw_people.push({ name:'',mobile:'',credent:1,idcard:'',credent_name:'身份证' })">新增随访人员</Button>
<xy-table style="width: 620px" :height="260" :is-page="false" :list="followList"
<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="followList.splice(scope.$index, 1)">删除</Button>
@click="form.follw_people.splice(scope.$index, 1)">删除</Button>
</template>
</el-table-column>
</template>
@ -192,8 +193,8 @@
<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" v-model="longrange" type="daterange" align="right" unlink-panels value-format="yyyy-MM-dd"
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
<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>
@ -206,7 +207,7 @@
</div>
</div>
</template>
<!-- <template v-slot:accpet_department_id>
<!-- <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>部门
@ -226,25 +227,25 @@
</div>
<div class="xy-table-item-content">
<el-select v-model="form.accept_admin_id" placeholder="请选择" style="width:100%">
<el-option v-for="item in adminList" :key="item.value" :label="item.label" :value="item.value">
<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 v-model="form.accept_goods_admin_id" placeholder="请选择" style="width:100%">
<el-option v-for="item in adminList" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</div>
</div>
</template>
</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 v-model="form.accept_goods_admin_id" 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>
@ -255,35 +256,39 @@
<script>
import {
store,
show,
save
} from "@/api/visit/record.js"
import {
getparameter
} from "@/api/visit/record.js"
import {
getparameter
} from "@/api/system/dictionary";
import {
getList as getTimeList
} from '@/api/resource/visittime.js'
import pickerOptions from "@/utils/common.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:1,
typeName:'',
id: '',
visitType: 1,
typeName: '',
form: {
// type: 1,
visitinfo: "",
date: "",
visit_time_id: "",
visit_area_id: "",
workRange:"",
reason: "",
plate:"",
visit_area_id: "",
workRange: "",
reason: "",
plate: "",
remark: "",
visitorinfo: "",
name: "",
@ -292,20 +297,17 @@
idcard: "",
company_name: "",
cars: "",
follow_list: [],
long_time: 0,
follw_people: [],
long_time: 0,
longrange: "",
visitorinfos: "",
accpet_department_id: "",
accept_admin_id: "",
accept_goods_admin_id:""
},
followList:[],
longrange: [],
accept_admin_id: "",
accept_goods_admin_id: ""
},
// followList:[],
visitTimeList: [],
visitAreaList: [{
id: 1,
value: "9:00-11:00"
}],
visitAreaList: [],
reasonList: [],
credentList: [{
id: 1,
@ -332,10 +334,8 @@
prop: "name",
width: 200,
customFn: (row, scope) => {
return ( <el-input placeholder = "请填写姓名"
value = {
row.name
} >
return (<el-input type="text" placeholder = "请填写姓名"
v-model={row.name}>
</el-input>
)
}
@ -345,10 +345,8 @@
prop: "mobile",
width: 200,
customFn: (row, scope) => {
return ( <el-input placeholder = "请填写联系电话"
value = {
row.mobile
} >
return (<el-input placeholder = "请填写联系电话"
v-model = {row.mobile} >
</el-input>
)
}
@ -358,19 +356,16 @@
// width: 180,
width: 200,
customFn: (row) => {
return ( <el-select placeholder = "请选择证件类型"
return (<el-select placeholder = "请选择证件类型"
style = "width: 140px"
value = {
row.credent_name
}
value = {row.credent_name}
on = {
{
["change"]: (e) => (row.credent_name = e.value, row.credent = e.id),
}
} >
{
} > {
this.credentList.map((item, index) => {
return ( <el-option
return (<el-option
// v-for={item in types}
value = {
item
@ -393,17 +388,41 @@
prop: "idcard",
width: 200,
customFn: (row, scope) => {
return ( <el-input placeholder = "请填写证件号码"
value = {
row.idcard
} >
return (<el-input placeholder = "请填写证件号码"
v-model = {row.idcard}>
</el-input>
)
}
}
],
rules: {},
rules: {
date: [{
required: true,
message: '请选择到访日期'
}],
visit_time_id: [{
required: true,
message: '请选择到访时段'
}],
visit_area_id: [{
required: true,
message: '请选择到访区域'
}],
name: [{
required: true,
message: '请输入姓名'
}],
mobile: [{
required: true,
message: "请填写联系电话",
},
{
pattern: /^[1][3-9][\d]{9}/,
message: "手机号格式错误",
}
],
},
pickerOptions: {
shortcuts: [{
text: '最近一周',
@ -434,8 +453,7 @@
}
},
created() {
this.getVisitTime()
console.log(this.form)
this.getVisitTime()
},
methods: {
@ -443,25 +461,60 @@
const res = await show({
id: this.id
})
this.form = {
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?parseInt(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 reason = await getparameter({
number: "reasonList",
});
this.reasonList = reason?.detail;
this.visitTimeList = res.data
const resarea = await getAreaList()
this.visitAreaList = resarea.data
const resuser = await listCommonuser()
this.adminList = resuser.data
const reason = await getparameter({
number: "reasonList",
});
this.reasonList = reason?.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]
},
submit() {
let that = this
if (this.type === 'editor') {
this.form.id = this.id
}
console.log("that.form",that.form)
return
}
console.log("that.form", that.form)
// return
save({
...that.form
}).then(res => {
@ -470,28 +523,29 @@
this.$emit('refresh')
})
}
},
watch: {
isShow(newVal) {
if (newVal) {
if (this.type === 'editor') {
this.getDetail()
},
watch: {
isShow(newVal) {
if (newVal) {
this.form.type = this.visitType
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 ? '物流车辆' : ''))
}
} 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>

@ -1,509 +0,0 @@
<template>
<div>
<xy-dialog ref="dialog" :is-show.sync="isShow" type="form" :title="type === 'add' ? '新增物流车辆记录' : '编辑物流车辆记录'" :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
v-model="form.date"
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">
<el-radio v-for="item in visitTimeList" :label="item.id">{{item.value}}</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">
<el-radio v-for="item in visitAreaList" :label="item.id">{{item.value}}</el-radio>
</el-radio-group>
</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}" type="textarea" v-model="form.remark" placeholder="请输入备注" clearable
style="width:300px" ></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">
姓名
</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">
联系电话
</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">
证件号码
</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">
单位名称
</div>
<div class="xy-table-item-content">
<el-input v-model="form.company_name" placeholder="请输入单位名称"
></el-input>
</div>
</div>
</template>
<template v-slot:cars>
<div class="xy-table-item">
<div class="xy-table-item-label">
到访车辆
</div>
<div class="xy-table-item-content">
<el-input v-model="form.cars" placeholder="请输入到访车辆"
></el-input>
</div>
</div>
</template>
<!-- <template v-slot:follow_list>
<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.follow_list.push({ name:'',mobile:'',credent:1,idcard:'',credent_name:'身份证' })"
>新增随访人员</Button
>
<xy-table
style="width: 620px"
:height="260"
:is-page="false"
:list="form.follow_list"
: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.follow_list.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
v-model="longrange"
type="daterange"
align="right"
unlink-panels
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:picker-options="pickerOptions">
</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>
<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.accept_admin_id" placeholder="请选择" style="width:100%">
<el-option
v-for="item in adminList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
store,
show,
save
} from "@/api/visit/record.js"
import pickerOptions from "@/utils/common.js"
export default {
components: {},
data() {
return {
isShow: false,
type: 'add',
id: '',
form: {
type:3,
visitinfo:"",
date:"",
visit_time_id:"",
visit_area_id:"",
reason:"",
remark:"",
visitorinfo:"",
name:"",
mobile:"",
credent:1,
idcard:"",
company_name:"",
cars:"",
follow_list:[
{ name:'',mobile:'',credent:1,idcard:'',credent_name:"身份证" }
],
long_time:0,
visitorinfos:"",
accpet_department_id:"",
accept_admin_id:""
},
longrange:[],
visitTimeList:[{
id:1,
value:"9:00-11:00"
},{
id:1,
value:"9:00-11:00"
},{
id:1,
value:"9:00-11:00"
},{
id:1,
value:"9:00-11:00"
}],
visitAreaList:[{
id:1,
value:"9:00-11:00"
}],
reasonList:[{
value:1,
label:"9:00-11:00"
}],
credentList:[
{
id:1,
value:"身份证"
},
{
id:2,
value:"护照"
},
],
longList:[
{
id:0,
value:"否"
},
{
id:1,
value:"是"
},
],
departmentList:[],
adminList:[],
followTable:[{
label:"姓名",
prop:"name",
width:200,
customFn: (row,scope) => {
return(
<el-input
placeholder="请填写姓名"
value={row.name}
>
</el-input>
)
}
},
{
label:"联系电话",
prop:"mobile",
width:200,
customFn: (row,scope) => {
return(
<el-input
placeholder="请填写联系电话"
value={row.mobile}
>
</el-input>
)
}
},
{
label: "证件类型",
// width: 180,
width:200,
customFn: (row) => {
return (
<el-select
placeholder="请选择证件类型"
style="width: 140px"
value={row.credent_name}
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="请填写证件号码"
value={row.idcard}
>
</el-input>
)
}
}],
rules:{
},
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() {
},
methods: {
async getDetail() {
const res = await show({
id: this.id
})
this.form = {
}
},
submit() {
if (this.type === 'add') {
console.log(this.form)
// return
store({
}).then(res => {
this.$successMessage('add', '时段')
this.isShow = false
this.$emit('refresh')
})
return
}
if (this.type === 'editor') {
save({
id: this.id,
}).then(res => {
this.$successMessage('editor', '时段')
this.isShow = false
this.$emit('refresh')
})
}
}
},
watch: {
isShow(newVal) {
if (newVal) {
if (this.type === 'editor') {
this.getDetail()
}
} else {
this.id = ''
this.type = ''
this.$refs['dialog'].reset()
}
}
}
}
</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;
}
</style>

@ -0,0 +1,123 @@
<template>
<div>
<xy-dialog ref="dialog" :is-show.sync="isShow" type="form" title="审核记录"
:form="form" :rules="rules" @submit="submit">
<template v-slot:status>
<div class="xy-table-item">
<div class="xy-table-item-label">状态
</div>
<div class="xy-table-item-content">
<el-select v-model="form.status" placeholder="请选择" style="width:300px">
<el-option v-for="item in statusList" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:reason>
<div class="xy-table-item">
<div class="xy-table-item-label">
备注
</div>
<div class="xy-table-item-content">
<el-input type="textarea" v-model="form.reason" placeholder="请输入备注" style="width:300px"></el-input>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
show
} from "@/api/visit/record.js"
export default {
components: {},
data() {
return {
isShow: false,
id: '',
recordform:{},
form: {
status:"",
reason:"",
level:""
},
statusList: [{
id: 0,
value: "待审核"
},
{
id: 1,
value: "通过"
},
{
id: 2,
value: "驳回"
},
],
rules: {
},
}
},
created() {
},
methods: {
async getDetail() {
const res = await show({
id: this.id
})
this.recordform = {
}
},
submit() {
let that = this
// this.form.id = this.id
save({
...that.form
}).then(res => {
this.$successMessage('审核')
this.isShow = false
this.$emit('refresh')
})
}
},
watch: {
isShow(newVal) {
if (newVal) {
this.getDetail()
} else {
this.id = ''
this.$refs['dialog'].reset()
}
}
}
}
</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;
}
</style>

@ -14,7 +14,7 @@
</el-option>
</el-select>
<div style="margin:0 10px;">起始时间</div>
<el-date-picker v-model="selectRange" value-format="yyyy-MM-dd" type="daterange" range-separator=""
<el-date-picker v-model="selectRange" @change="selectRanges" 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">查询
@ -35,7 +35,7 @@
<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 @click="downloadExel" slot="reference" size="medium" type="primary" style="margin-left: 10px">导出
</el-button>
</div>
@ -43,7 +43,8 @@
</lx-header>
</div>
<xy-table :table-item="table" :list="data" :total="total"
<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>
@ -58,14 +59,13 @@
getList,
destroy
} from '@/api/visit/record.js'
import addCommon from '@/views/visit/component/addCommon'
import addBuild from '@/views/visit/component/addBuild'
import addPark from '@/views/visit/component/addPark'
import addCommon from '@/views/visit/component/addCommon'
import {
download
} from '@/utils/downloadRequest'
export default {
components: {
addCommon,
addBuild,
addPark
addCommon
},
data() {
return {
@ -136,7 +136,10 @@
label: '是否随访',
sortable: false,
prop: 'follw_people',
width: 80
width: 80,
formatter:(cell, data, value)=>{
return value?'是':'否'
}
},
{
label: '预约时间',
@ -148,7 +151,10 @@
label: '证件类型',
sortable: false,
prop: 'credent',
width: 120
width: 120,
formatter:(cell, data, value)=>{
return value==1?'身份证':'护照'
},
},
{
label: '证件号',
@ -199,7 +205,7 @@
},
computed: {},
mounted() {
// this.getList()
this.getList()
},
methods: {
async getList() {
@ -207,6 +213,25 @@
console.log(res)
this.data = res.data
this.total = res.total
},
selectRanges(val){
if(val){
this.select.start_date = val[0]
this.select.end_date = val[1]
}else{
this.select.start_date = ''
this.select.end_date = ''
}
},
downloadExel() {
this.select.is_export = 1
download(
'/api/admin/visit/index',
'get', {
...this.select
},
'拜访记录列表.xlsx')
this.select.is_export = 0
},
deleteStudy(row) {
destroy({
@ -220,7 +245,6 @@
// 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

@ -1,164 +1,268 @@
<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;">
<div style="margin-right: 10px;">关键词</div>
<el-input size="mini" placeholder="请输入关键词" v-model="select.keyword" style="width: 160px;margin-right: 10px;"></el-input>
<el-button @click="getList" slot="reference" size="medium" type="primary" style="margin-left: 10px">查询</el-button>
<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"
@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} from '@/api/visit/record.js'
import addCommon from '@/views/visit/component/addCommon'
import addBuild from '@/views/visit/component/addBuild'
import addPark from '@/views/visit/component/addPark'
export default {
components: {
addCommon,
addBuild,
addPark
},
data() {
return {
visible:false,
select:{
page:1,
rows:10
},
total:0,
data:[],
table:[
{
label:'姓名',
sortable:false,
prop:'start_time',
fixed:"left",
align:"left"
},
{
label:'类型',
sortable:false,
prop:'end_time',
},
{
label:'状态',
sortable:false,
prop:'end_time',
},
{
label:'是否随访',
sortable:false,
prop:'end_time',
},
{
label:'预约时间',
sortable:false,
prop:'end_time',
},
{
label:'证件类型',
sortable:false,
prop:'end_time',
},
{
label:'证件号',
sortable:false,
prop:'end_time',
},
{
label:'状态',
sortable:false,
prop:'end_time',
},
{
label:'单位名称',
sortable:false,
prop:'end_time',
},
{
label:'手机号',
sortable:false,
prop:'end_time',
},
{
label:'开始时间',
sortable:false,
prop:'end_time',
},
{
label:'结束时间',
sortable:false,
prop:'end_time',
},
{
label:'创建时间',
sortable:false,
prop:'end_time',
},
{
label:'创建人',
sortable:false,
prop:'end_time',
}
]
}
},
computed: {},
mounted() {
// this.getList()
},
methods: {
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":""))
this.$refs[addWhat].id = row.id
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;
}
<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" 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: {
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>

Loading…
Cancel
Save