From d203a15b341c7427522c9f643d9fd280c7dad75b Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期一, 26 二月 2024 18:37:37 +0800
Subject: [PATCH] mrshi
---
h5/pages/visitorApplication/visitorApplication.vue | 14 +++-
admin/src/views/index.vue | 130 ++++++++++++++++++++++++++++++++-----------
admin/src/api/business/staging.js | 21 +++++++
admin/src/views/business/visits.vue | 3
4 files changed, 128 insertions(+), 40 deletions(-)
diff --git a/admin/src/api/business/staging.js b/admin/src/api/business/staging.js
new file mode 100644
index 0000000..ef02d7c
--- /dev/null
+++ b/admin/src/api/business/staging.js
@@ -0,0 +1,21 @@
+import request from '../../utils/request'
+
+// 涓讳綋鏁版嵁
+export function body () {
+ return request.get('/business/staging/body')
+}
+
+// 澶撮儴鏁版嵁
+export function head () {
+ return request.get('/business/staging/head')
+}
+
+// 涓讳綋鏁版嵁
+export function timeoutPage (data) {
+ return request.post('/business/staging/timeoutPage', data)
+}
+
+// 瓒呮椂棰勮浜哄憳绂诲満
+export function level (visitId) {
+ return request.get(`/business/staging/level?visitId=${visitId}`)
+}
diff --git a/admin/src/views/business/visits.vue b/admin/src/views/business/visits.vue
index 7041eee..0e35462 100644
--- a/admin/src/views/business/visits.vue
+++ b/admin/src/views/business/visits.vue
@@ -59,8 +59,7 @@
</el-table-column>
<el-table-column label="闅忚杞﹁締" min-width="100px">
<template slot-scope="{row}">
- <span v-if="row.carNos">{{row.carNos.split(',').length}}</span>
- <span v-else>-</span>
+ <span>{{row.carNum}}</span>
</template>
</el-table-column>
<el-table-column prop="status" fixed="right" label="鐘舵��" min-width="100px">
diff --git a/admin/src/views/index.vue b/admin/src/views/index.vue
index c7438de..31b1e0c 100644
--- a/admin/src/views/index.vue
+++ b/admin/src/views/index.vue
@@ -4,31 +4,31 @@
<div class="home_total_head">鍦ㄥ巶浜哄憳鎬昏</div>
<div class="home_total_list">
<div class="home_total_list_item a">
- <span>352</span>
+ <span>{{head && head.workerCount ? head.workerCount : 0}}</span>
<span>鍐呴儴鍛樺伐</span>
</div>
<div class="home_total_list_item b">
- <span>352</span>
+ <span>{{head && head.visitorCount ? head.visitorCount : 0}}</span>
<span>璁垮</span>
</div>
<div class="home_total_list_item c">
- <span>352</span>
+ <span>{{head && head.lwCount ? head.lwCount : 0}}</span>
<span>鍔冲姟浜哄憳</span>
</div>
<div class="home_total_list_item d">
- <span>352</span>
+ <span>{{head && head.presenceCarCount ? head.presenceCarCount : 0}}</span>
<span>鍦ㄥ満杞﹁締</span>
</div>
<div class="home_total_list_item e">
- <span>352</span>
- <span>璁垮杞﹁締</span>
+ <span>{{head && head.longCarCount ? head.longCarCount : 0}}</span>
+ <span>闀挎湡杞﹁締</span>
</div>
<div class="home_total_list_item f">
- <span>352</span>
- <span>鍔冲姟杞﹁締</span>
+ <span>{{head && head.visitorCarCount ? head.visitorCarCount : 0}}</span>
+ <span>棰勭害杞﹁締</span>
</div>
<div class="home_total_list_item g">
- <span>352</span>
+ <span>{{head && head.supplierCount ? head.supplierCount : 0}}</span>
<span>渚涘簲鍟�</span>
</div>
</div>
@@ -44,7 +44,7 @@
</div>
</div>
<div class="home_table">
- <div class="home_table_head">瓒呮椂棰勮浜哄憳(3)</div>
+ <div class="home_table_head">瓒呮椂棰勮浜哄憳({{total}})</div>
<div class="home_table_box">
<el-table
:data="list"
@@ -52,47 +52,54 @@
border
style="width: 100%">
<el-table-column
- prop="date"
+ prop="name"
label="璁垮濮撳悕">
</el-table-column>
<el-table-column
- prop="name"
+ prop="phone"
label="璁垮鐢佃瘽">
</el-table-column>
<el-table-column
- prop="address"
+ prop="companyName"
label="璁垮鍏徃">
</el-table-column>
<el-table-column
prop="address"
- label="鍏徃绫诲瀷">
+ label="浜哄憳绫诲瀷">
+ <template slot-scope="{row}">
+ <span v-if="row.memberType === 0">鍔冲姟璁垮</span>
+ <span v-if="row.memberType === 1">鏅�氳瀹�</span>
+ <span v-if="row.memberType === 2">鍐呴儴浜哄憳</span>
+ </template>
</el-table-column>
<el-table-column
- prop="address"
+ prop="endtime"
label="鎺堟潈鍒版湡鏃堕棿">
</el-table-column>
<el-table-column
- prop="address"
label="鐘舵��">
+ <template slot-scope="{row}">
+ <span v-if="row.outStatus === 0">鏈秴鏃�</span>
+ <span style="color: red;" v-if="row.outStatus === 1">宸茶秴鏃�</span>
+ <span v-if="row.outStatus === 2">鍗冲皢瓒呮椂</span>
+ </template>
</el-table-column>
<el-table-column
prop="address"
label="澶勭悊"
width="80">
<template slot-scope="scope">
- <el-button type="text">绂诲満</el-button>
+ <el-button type="text" @click="departure(scope.row.id)">绂诲満</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
style="margin-top: 20px;"
- @size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="page"
- :page-sizes="[100, 200, 300, 400]"
- :page-size="100"
- layout="total, sizes, prev, pager, next, jumper"
- :total="400">
+ :page-size="10"
+ layout="total, prev, pager, next, jumper"
+ :total="total">
</el-pagination>
</div>
</div>
@@ -101,24 +108,83 @@
<script>
import * as echarts from 'echarts'
+import { body, head, timeoutPage, level } from '@/api/business/staging'
export default {
name: 'Index',
data () {
return {
+ head: null,
list: [],
+ total: 0,
+ data1: [],
+ data2: [[],[]],
page: 1
}
},
+ created () {
+ this.getHeader()
+ this.getData()
+ },
mounted () {
- this.getcharts1()
- this.getcharts2()
+ // this.getcharts2()
},
methods: {
- handleSizeChange () {
+ departure(id) {
+ this.$confirm('纭畾绂诲満鍚�, 鏄惁缁х画?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ level(id)
+ .then(res => {
+ this.page = 1
+ this.getData()
+ })
+ }).catch(() => {
+ });
},
- handleCurrentChange () {
-
+ getData() {
+ timeoutPage({
+ capacity: 10,
+ page: this.page,
+ model: {}
+ }).then(res => {
+ this.list = res.records
+ this.total = res.total
+ })
+ },
+ getHeader() {
+ head().then(res => {
+ this.head = res
+ })
+ body().then(res => {
+ this.data1 = res.retentionUsers.map(item => {
+ let name = ''
+ if (item.memberType === 0) {
+ name = '鍔冲姟璁垮'
+ } else if (item.memberType === 1) {
+ name = '鏅�氳瀹�'
+ } else if (item.memberType === 2) {
+ name = '鍐呴儴鍛樺伐'
+ }
+ return {
+ value: item.memberCount,
+ name
+ }
+ })
+ let arr1 = res.companyUsers.map(item => item.companyName)
+ let arr2 = res.companyUsers.map(item => item.memberCount)
+ if (arr1.length > 0) {
+ this.data2 = [arr1, arr2]
+ this.getcharts2()
+ }
+ this.getcharts1()
+ })
+ },
+ handleCurrentChange (page) {
+ this.page = page
+ this.getData()
},
getcharts1 () {
const myChart = echarts.init(document.getElementById('chart1'))
@@ -143,11 +209,7 @@
label: {
formatter: '{b} {d}%'
},
- data: [
- { value: 1048, name: '鍔冲姟浜哄憳' },
- { value: 735, name: '鍐呴儴鍛樺伐' },
- { value: 580, name: '璁垮' }
- ],
+ data: this.data1,
itemStyle: {
normal: {
color: function (colors) {
@@ -186,13 +248,13 @@
},
yAxis: {
type: 'category',
- data: ['娴峰悍濞佽', '鍐滀笟鏈夐檺鍏徃', '瀛楀箷涔熸湁闄愬叕鍙�', '涓囪揪鑲′唤鏈夐檺鍏徃', '闃块噷宸村反闆嗗洟鏈夐檺鍏徃', '鑵捐闆嗗洟鏈夐檺鍏徃']
+ data: this.data2[0]
},
series: [
{
realtimeSort: true,
type: 'bar',
- data: [1, 2, 3, 4, 5, 6],
+ data: this.data2[1],
itemStyle: {
normal: {
color: '#fc8251'
diff --git a/h5/pages/visitorApplication/visitorApplication.vue b/h5/pages/visitorApplication/visitorApplication.vue
index 7e447e2..ebc9fc7 100644
--- a/h5/pages/visitorApplication/visitorApplication.vue
+++ b/h5/pages/visitorApplication/visitorApplication.vue
@@ -343,7 +343,7 @@
},
submit() {
if (!this.form1.receptMemberId) return uni.showToast({
- title: '琚浜轰笉鑳戒负绌�',
+ title: '璇峰~鍐欐湁鏁堢殑璁块棶浜�',
icon: 'none'
})
if (!this.form1.starttime) return uni.showToast({
@@ -362,16 +362,22 @@
// title: '鎷滆浜嬬敱涓嶈兘涓虹┖',
// icon: 'none'
// })
- this.form1.starttime = this.form1.starttime + ':00'
- this.form1.endtime = this.form1.endtime + ':00'
+ // this.form1.starttime = this.form1.starttime + ':00'
+ // this.form1.endtime = this.form1.endtime + ':00'
+ let data = JSON.parse(JSON.stringify(this.form1))
+ data.starttime = data.starttime + ':00'
+ data.endtime = data.endtime + ':00'
this.$u.api.createFk({
...this.form,
- ...this.form1,
+ ...data,
openid: this.$store.state.openId,
withUserList: this.personnel
}).then(res => {
if (res.code === 200) {
console.log(res)
+ uni.reLaunch({
+ url: `/pages/appointmentDetails/appointmentDetails?id=${res.data}`
+ })
}
})
},
--
Gitblit v1.9.3