master
lion 2 weeks ago
parent d2b3b9908a
commit f2ccf3ff74

@ -7,7 +7,7 @@
<i class="el-icon-user statIcon"></i>
</div>
<div class="bline"></div>
<div class="boxcontentsubtitle">总人数/总入厂人数</div>
<div class="boxcontentsubtitle">总人数/总入厂人数/总离厂人数</div>
<div class="boxcontent">
<div class="boxcontentitem">
<div class="boxcontentitem-big">
@ -19,13 +19,17 @@
<count-to separator="" :start-val="0" :end-val="totaldata.common_visit.enter_visit"
:duration="3600" />
</span>
<span>
<count-to separator="" :start-val="0" :end-val="totaldata.common_visit.leave_total"
:duration="3600" />
</span>
</div>
<div class="per">核销比{{toCaculateper(totaldata.common_visit.enter_visit,totaldata.common_visit.total)}}</div>
</div>
</div>
<div class="blinefull"></div>
<div class="boxcontentsubtitle">今日人数/今日入厂人数</div>
<div class="boxcontentsubtitle">今日人数/今日入厂人数/今日离厂人数</div>
<div class="boxcontent">
<div class="boxcontentitem">
<div class="boxcontentitem-big">
@ -36,6 +40,10 @@
<span>
<count-to separator="" :start-val="0" :end-val="totaldata.common_visit.today_enter_visit"
:duration="3600" />
</span>
<span>
<count-to separator="" :start-val="0" :end-val="totaldata.common_visit.today_leave_total"
:duration="3600" />
</span>
</div>
<div class="per">核销比{{toCaculateper(totaldata.common_visit.today_enter_visit,totaldata.common_visit.today_total)}}</div>
@ -50,7 +58,7 @@
<i class="iconfont icon-banqianguanli statIcon"></i>
</div>
<div class="bline"></div>
<div class="boxcontentsubtitle">总人数/核销人数</div>
<div class="boxcontentsubtitle">总人数/入厂人数/总离厂人数</div>
<div class="boxcontent">
<div class="boxcontentitem">
<div class="boxcontentitem-big">
@ -62,12 +70,16 @@
<count-to separator="" :start-val="0" :end-val="totaldata.work_visit.enter_visit"
:duration="3600" />
</span>
<span>
<count-to separator="" :start-val="0" :end-val="totaldata.work_visit.leave_total"
:duration="3600" />
</span>
</div>
<div class="per">核销比{{toCaculateper(totaldata.work_visit.enter_visit,totaldata.work_visit.total)}}</div>
</div>
</div>
<div class="blinefull"></div>
<div class="boxcontentsubtitle">今日人数/今日核销人数</div>
<div class="boxcontentsubtitle">今日人数/今日入厂人数/今日离厂人数</div>
<div class="boxcontent">
<div class="boxcontentitem">
<div class="boxcontentitem-big">
@ -79,6 +91,10 @@
<count-to separator="" :start-val="0" :end-val="totaldata.work_visit.today_enter_visit"
:duration="3600" />
</span>
<span>
<count-to separator="" :start-val="0" :end-val="totaldata.work_visit.today_leave_total"
:duration="3600" />
</span>
</div>
<div class="per">核销比{{toCaculateper(totaldata.work_visit.today_enter_visit,totaldata.work_visit.today_total)}}</div>
</div>
@ -91,7 +107,7 @@
<i class="iconfont icon-cheliangdangan statIcon"></i>
</div>
<div class="bline"></div>
<div class="boxcontentsubtitle">总预约数/核销</div>
<div class="boxcontentsubtitle">总预约数/入厂人数/总离厂人</div>
<div class="boxcontent">
<div class="boxcontentitem">
<div class="boxcontentitem-big">
@ -103,12 +119,16 @@
<count-to separator="" :start-val="0" :end-val="totaldata.car_visit.enter_visit"
:duration="3600" />
</span>
<span>
<count-to separator="" :start-val="0" :end-val="totaldata.car_visit.leave_total"
:duration="3600" />
</span>
</div>
<div class="per">核销比{{toCaculateper(totaldata.car_visit.enter_visit,totaldata.car_visit.total)}}</div>
</div>
</div>
<div class="blinefull"></div>
<div class="boxcontentsubtitle">今日预约数/今日核销</div>
<div class="boxcontentsubtitle">今日预约数/今日入厂数/今日离厂人</div>
<div class="boxcontent">
<div class="boxcontentitem">
<div class="boxcontentitem-big">
@ -120,6 +140,10 @@
<count-to separator="" :start-val="0" :end-val="totaldata.car_visit.today_enter_visit"
:duration="3600" />
</span>
<span>
<count-to separator="" :start-val="0" :end-val="totaldata.car_visit.today_leave_total"
:duration="3600" />
</span>
</div>
<div class="per">核销比{{toCaculateper(totaldata.work_visit.today_enter_visit,totaldata.car_visit.today_total)}}</div>
</div>
@ -147,19 +171,25 @@
"enter_visit": 0,
"today_enter_visit": 0,
"today_total": 0,
"total":0
"total":0,
"leave_total":0,
"today_leave_total":0
},
"work_visit": {
"enter_visit": 0,
"today_enter_visit": 0,
"today_total": 0,
"total":0
"total":0,
"leave_total":0,
"today_leave_total":0
},
"car_visit": {
"enter_visit": 0,
"today_enter_visit": 0,
"today_total": 0,
"total":0
"total":0,
"leave_total":0,
"today_leave_total":0
}
}
}

@ -266,6 +266,9 @@ import xyTinymce from "@/components/XyTinymce/index.vue";
}, {
id: 270,
value: '九个月'
}, {
id: 365,
value: '一年'
}]
}

@ -8,12 +8,13 @@
<div class="box-center">
<pan-thumb :image="user.avatar" :height="'100px'" :width="'100px'" :hoverable="false">
<div>Hello</div>
{{ user.role }}
<!-- {{ user.role }} -->
{{ user.name }}
</pan-thumb>
</div>
<div class="box-center">
<div class="user-name text-center">{{ user.name }}</div>
<div class="user-role text-center text-muted">{{ user.role | uppercaseFirst }}</div>
<!-- <div class="user-role text-center text-muted">{{ user.role | uppercaseFirst }}</div> -->
</div>
</div>
@ -24,7 +25,7 @@
</div>
<div class="user-bio-section-body">
<div class="text-muted">
{{user.department||"暂无"}}
{{user.department?user.department.name:"暂无"}}
</div>
</div>
</div>
@ -115,4 +116,4 @@
}
}
}
</style>
</style>

@ -35,7 +35,7 @@
import {
getInfo
} from '../../api/user.js'
} from '../../api/user.js'
export default {
name: 'Profile',
@ -61,18 +61,19 @@
this.getUser()
},
methods: {
getUser() {
getInfo().then(res => {
this.user = {
name:res.name,
username:res.username,
role: this.roles.join(' | '),
avatar: this.avatar
}
getUser() {
getInfo().then(res => {
this.user = {
name:res.name,
username:res.username,
role: this.roles.join(' | '),
avatar: this.avatar,
department: res.department
}
})
}
}
}
</script>
</script>

@ -259,7 +259,7 @@
<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>收货
<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%">

@ -30,7 +30,27 @@
</div>
</div>
</template>
<template v-slot: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">
<el-time-picker
v-model="form.time"
format="HH:mm"
value-format="HH:mm"
:picker-options="{
start: '08:30',
step: '00:30',
end: '17:00'
}"
placeholder="选择到访时间">
</el-time-picker>
</div>
</div>
</template>
<template v-slot:visit_time_id>
<div class="xy-table-item">
<div class="xy-table-item-label">
@ -164,7 +184,7 @@
</div>
</div>
</template>
<template v-slot:cda v-if="visitType==1&&visitAreaText=='生产区'">
<!-- <template v-slot:cda v-if="visitType==1&&visitAreaText=='生产区'">
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>CDA编号
@ -173,7 +193,7 @@
<el-input v-model="form.cda" placeholder="请输入CDA编号(如无注明原因)"></el-input>
</div>
</div>
</template>
</template> -->
<!-- <template v-slot:cars v-if="visitType==3">
<div class="xy-table-item">
@ -297,7 +317,7 @@
</div>
</div>
</template>
<template v-slot:visitorinfos1 v-if="visitAreaText=='生产区'">
<!-- <template v-slot:visitorinfos1 v-if="visitAreaText=='生产区'">
<div class="xy-table-item">
<div class="xy-table-item-content" style="width:400px">
陪同人信息
@ -316,11 +336,11 @@
</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>收货
<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%">
@ -369,7 +389,8 @@
// type: 1,
visitinfo: "",
date: "",
end_date:'',
end_date:'',
time:'',
visit_time_id: "",
visit_area_id: "",
workRange: "",
@ -382,7 +403,7 @@
credent: 1,
idcard: "",
company_name: "",
cda:'',
// cda:'',
cars: [],
carsno:[],
follw_people: [],
@ -533,25 +554,25 @@
required: true,
message: '请输入单位名称'
}],
cda:[{
required: true,
message: '请输入CDA编号'
}],
// cda:[{
// required: true,
// message: 'CDA'
// }],
// cars: [{
// required: true,
// message: ''
// }],
accompany_id: [{
required: true,
message: '请选择陪同人'
}],
// accompany_id: [{
// required: true,
// message: ''
// }],
accept_admin_id: [{
required: true,
message: '请选被访人'
}],
accept_goods_admin_id: [{
required: true,
message: '请选择收货人'
message: '请选择被访人'
}]
},
@ -596,7 +617,8 @@
this.form = {
visitinfo: "",
date: res?.date,
end_date: res?.end_date,
end_date: res?.end_date,
time:res?.time,
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]:"",
@ -609,7 +631,7 @@
credent: res?.credent,
idcard: res?.idcard,
company_name: res?.company_name,
cda:res?.cda,
// cda:res?.cda,
cars:[],
carsno: [],
follw_people: res?.follw_people,
@ -679,10 +701,11 @@
this.adminList.map(e=>{
if(e.id==item){
this.form.accept_admin_id = e.id
this.form.accpet_department_id = e.department_id
if(this.visitAreaText=='非生产区'){
this.form.accompany_id = e.id
}
this.form.accpet_department_id = e.department_id
this.form.accompany_id = e.id
// if(this.visitAreaText==''){
// this.form.accompany_id = e.id
// }
}
})

@ -101,6 +101,16 @@
{{form.end_date}}
</div>
</div>
</template>
<template v-slot: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">
{{form.time?form.time:''}}
</div>
</div>
</template>
<template v-slot:visit_time_id>
<div class="xy-table-item">
@ -219,7 +229,7 @@
</div>
</div>
</template>
<template v-slot:cda v-if="form.type==1 && form.visit_area && form.visit_area.name=='生产区'">
<!-- <template v-slot:cda v-if="form.type==1 && form.visit_area && form.visit_area.name=='生产区'">
<div class="xy-table-item">
<div class="xy-table-item-label">
CDA编号
@ -228,7 +238,7 @@
{{form.cda}}
</div>
</div>
</template>
</template> -->
<template v-slot:cars>
<div class="xy-table-item">
<div class="xy-table-item-label">
@ -286,7 +296,7 @@
</div>
</div>
</template>
<template v-slot:visitorinfos1 v-if="form.visit_area && form.visit_area.name=='生产区'">
<!-- <template v-slot:visitorinfos1 v-if="form.visit_area && form.visit_area.name=='生产区'">
<div class="xy-table-item">
<div class="xy-table-item-content" style="width:400px">
陪同人信息
@ -302,12 +312,12 @@
{{form.accompany?form.accompany.name:''}}
</div>
</div>
</template>
</template> -->
<template v-slot:accept_goods_admin_id v-if="form.type==3">
<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">
{{form.accept_goods_admin?form.accept_goods_admin.name:''}}
@ -430,7 +440,8 @@
visitinfo: "",
date: "",
end_date:'',
end_date:'',
time:'',
visit_time_id: "",
visit_area_id: "",
workRange: "",
@ -443,7 +454,7 @@
credent: 1,
idcard: "",
company_name: "",
cda:'',
// cda:'',
cars: "",
follw_people: [],
long_time: 0,
@ -679,11 +690,11 @@
let that = this
console.log(this.codeForm)
console.log(this.codeForm.person_no)
if(this.codeForm.type==0){
this.$successMessage('请提醒陪同人签字','','warning')
this.isShow = false
return
}
// if(this.codeForm.type==0){
// this.$successMessage('','','warning')
// this.isShow = false
// return
// }
cancelCode({
...that.codeForm
}).then(res => {

@ -169,13 +169,28 @@
<el-tag :type="currentDetail.follw_people && currentDetail.follw_people.length > 0 ? 'success' : 'info'" size="small">
{{ currentDetail.follw_people && currentDetail.follw_people.length > 0 ? '是' : '否' }}
</el-tag>
<span v-if="currentDetail.follw_people && currentDetail.follw_people.length > 0" style="margin-left: 10px;">
随访人员{{ currentDetail.follw_people.join('、') }}
</span>
</span>
</div>
</el-col>
</el-row>
<el-row v-if="currentDetail.follw_people && currentDetail.follw_people.length > 0" :gutter="20" class="detail-row">
<el-col :span="24">
<div class="detail-item">
<span class="detail-label">随访人员</span>
<div class="detail-value follow-table">
<el-table
:data="currentDetail.follw_people"
border
size="mini"
style="width: 100%">
<el-table-column prop="name" label="姓名" align="center"></el-table-column>
<el-table-column prop="mobile" label="联系方式" align="center"></el-table-column>
<el-table-column prop="idcard" label="身份证" align="center"></el-table-column>
</el-table>
</div>
</div>
</el-col>
</el-row>
<el-row :gutter="20" class="detail-row">
<el-col :span="12">
<div class="detail-item">

@ -15,14 +15,52 @@
</lx-header>
</div>
<xy-table :table-item="table" :list="data" :total="total"
<xy-table :table-item="table" :list="data" :total="total"
:auths="[]"
@pageSizeChange="e => {select.page_size = e;select.page = 1;getList()}"
@pageIndexChange="e => {select.page = e;getList()}">
<template v-slot:btns>
<div></div>
@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">
<el-button type="primary" size="medium" @click="showRecord(scope.row)"></el-button>
</template>
</el-table-column>
</template>
</xy-table>
<el-dialog
title="答题记录"
:visible.sync="recordVisible"
width="700px"
:close-on-click-modal="false">
<div v-if="currentRecord && currentRecord.length > 0" class="record-list">
<div
v-for="(question, index) in currentRecord"
:key="index"
class="record-item">
<div class="record-header">
<span class="record-index">{{ index + 1 }}.</span>
<span class="record-title">{{ question.title }}</span>
<span class="record-type">{{ getQuestionType(question.type) }}</span>
<span class="record-answer">正确答案{{ getCorrectAnswer(question) }}</span>
</div>
<div class="record-options" v-if="question.answer && question.answer.length">
<span
v-for="(option, optIdx) in question.answer"
:key="optIdx"
:class="['option-chip', getOptionClass(index, option)]">
{{ getOptionLabel(optIdx) }}. {{ option.content }}
</span>
</div>
<div class="record-options" v-else>
暂无选项
</div>
</div>
</div>
<div v-else style="text-align: center; color: #999;">暂无答题记录</div>
<span slot="footer" class="dialog-footer">
<el-button @click="recordVisible = false">关闭</el-button>
</span>
</el-dialog>
</div>
</template>
@ -40,6 +78,9 @@
},
total: 0,
data: [],
recordVisible: false,
currentRecord: [],
currentAnswers: [],
table: [{
label: '序号',
type: "index",
@ -51,53 +92,53 @@
sortable: false,
prop: 'user_id',
width: 120
},
{
label: '姓名',
sortable: false,
prop: 'name',
width: 120
},
{
label: '身份证',
sortable: false,
prop: 'idcard',
// width: 120
},
{
label: '联系方式',
sortable: false,
prop: 'mobile',
width: 120
},
{
label: '学习类型',
sortable: false,
prop: 'type',
width: 120,
formatter:(cell, data, value)=>{
if(value==1){
return '普通访客'
}else if(value==2){
return '施工人员'
}else if(value==3){
return '物流司机'
}else{
return '未知'
}
}
},
{
label: '学习时间',
sortable: false,
prop: 'updated_at',
width: 180
},
{
label: '有效期',
sortable: false,
prop: 'expire_day',
width: 180
},
{
label: '姓名',
sortable: false,
prop: 'name',
width: 120
},
{
label: '身份证',
sortable: false,
prop: 'idcard',
// width: 120
},
{
label: '联系方式',
sortable: false,
prop: 'mobile',
width: 120
},
{
label: '学习类型',
sortable: false,
prop: 'type',
width: 120,
formatter:(cell, data, value)=>{
if(value==1){
return '普通访客'
}else if(value==2){
return '施工人员'
}else if(value==3){
return '物流司机'
}else{
return '未知'
}
}
},
{
label: '学习时间',
sortable: false,
prop: 'updated_at',
width: 180
},
{
label: '有效期',
sortable: false,
prop: 'expire_day',
width: 180
},
]
}
@ -112,6 +153,70 @@
console.log(res)
this.data = res.data
this.total = res.total
},
showRecord(row) {
this.currentRecord = Array.isArray(row.ask) ? row.ask : []
this.currentAnswers = Array.isArray(row.content) ? row.content : []
this.recordVisible = true
},
getQuestionType(type) {
if (type === 1) {
return '单选'
}
if (type === 2) {
return '多选'
}
return '未知'
},
getCorrectAnswer(question) {
if (!question.answer || !question.answer.length) {
return '-'
}
const correct = question.answer
.map((option, index) => option.result === 1 ? `${this.getOptionLabel(index)}. ${option.content}` : null)
.filter(Boolean)
return correct.length ? correct.join('') : '-'
},
getOptionLabel(index) {
return String.fromCharCode(65 + index)
},
getOptionClass(questionIndex, option) {
const answered = this.isQuestionAnswered(questionIndex)
const isCorrect = option.result === 1
const isSelected = this.isUserSelected(questionIndex, option.content)
if (answered && isCorrect) {
return 'is-correct'
}
if (answered && isSelected && !isCorrect) {
return 'is-wrong'
}
return ''
},
isUserSelected(questionIndex, optionContent) {
if (!this.currentAnswers || !this.currentAnswers.length) {
return false
}
const selection = this.currentAnswers[questionIndex]
if (Array.isArray(selection)) {
return selection.includes(optionContent)
}
if (typeof selection === 'string') {
return selection.split(',').map(item => item.trim()).includes(optionContent)
}
return false
},
isQuestionAnswered(questionIndex) {
if (!this.currentAnswers || !this.currentAnswers.length) {
return false
}
const selection = this.currentAnswers[questionIndex]
if (Array.isArray(selection)) {
return selection.length > 0
}
if (typeof selection === 'string') {
return selection.trim() !== ''
}
return Boolean(selection)
}
},
}
@ -151,4 +256,68 @@
line-height: 21px;
}
}
</style>
.record-list {
max-height: 60vh;
overflow-y: auto;
}
.record-item {
padding: 10px 0;
border-bottom: 1px solid #f0f0f0;
}
.record-item:last-child {
border-bottom: none;
}
.record-header {
display: flex;
flex-wrap: wrap;
align-items: baseline;
font-weight: 500;
color: #333;
}
.record-index {
margin-right: 6px;
}
.record-title {
margin-right: 6px;
}
.record-type {
margin-right: 10px;
color: #666;
}
.record-answer {
color: #0f9674;
}
.record-options {
margin-top: 6px;
display: flex;
flex-wrap: wrap;
gap: 6px 12px;
line-height: 22px;
}
.option-chip {
padding: 2px 6px;
border-radius: 4px;
background: #f5f5f5;
}
.option-chip.is-correct {
background: #e8f8f0;
color: #0f9674;
border: 1px solid #0f9674;
}
.option-chip.is-wrong {
background: #fdecec;
color: #d93025;
border: 1px solid #d93025;
}
</style>

Loading…
Cancel
Save