修改了对应统计页面

This commit is contained in:
chenze 2024-08-17 16:31:37 +08:00
parent 80fbcaf0fd
commit fa918ad9c0
4 changed files with 276 additions and 131 deletions

View File

@ -12,6 +12,14 @@ export function getWorkerList (parameter) {
}) })
} }
export function oneWorkerList (parameter) {
return axios({
url: api.repairStats + '/oneWorkerList',
method: 'get',
params: parameter
})
}
export function getFloorList (parameter) { export function getFloorList (parameter) {
return axios({ return axios({
url: api.repairStats + '/floorList', url: api.repairStats + '/floorList',
@ -19,3 +27,37 @@ export function getFloorList (parameter) {
params: parameter params: parameter
}) })
} }
export function oneFloorList (parameter) {
return axios({
url: api.repairStats + '/oneFloorList',
method: 'get',
params: parameter
})
}
// 第一行 管理员 工单与 通知统计
export function repairAdminStats (parameter) {
return axios({
url: api.repairStats + '/repairAdminStats',
method: 'get',
params: parameter
})
}
// 第二、三行 工单统计、工单完成情况、评价情况
export function repairStats (parameter) {
return axios({
url: api.repairStats + '/repairStats',
method: 'get',
params: parameter
})
}
export function floorStats (parameter) {
return axios({
url: api.repairStats + '/floorStats',
method: 'get',
params: parameter
})
}

View File

@ -43,6 +43,7 @@
<script> <script>
import { STable } from '@/components' import { STable } from '@/components'
import { getRepairList, complete } from '@/api/admin/repair' import { getRepairList, complete } from '@/api/admin/repair'
import { oneWorkerList, oneFloorList } from '@/api/admin/repair/repairStats'
import RepairModal from './modules/RepairModal.vue' import RepairModal from './modules/RepairModal.vue'
import { checkPermission } from '@/utils/permissions' import { checkPermission } from '@/utils/permissions'
@ -142,23 +143,26 @@ export default {
}, },
methods: { methods: {
getRepairList () { getRepairList () {
let datas = {} if (this.$route.query.repairUserId != null) {
if (this.$route.query.repairUserId) { console.log(1111)
datas = { oneWorkerList({ workerId: this.$route.query.repairUserId }).then(res =>{
'menu': 5, this.loadData = res.rows
'type': 'all', })
'workerId': this.$route.query.repairUserId } else if (this.$route.query.floorId !=null) {
} console.log(222)
oneFloorList({ floorId: this.$route.query.floorId }).then(res =>{
this.loadData = res.rows
})
} else { } else {
datas = { let datas = {
'menu': 7, 'menu': 7,
'type': 'all' 'type': 'all'
} }
}
getRepairList(datas).then(res => { getRepairList(datas).then(res => {
this.loadData = res.rows this.loadData = res.rows
}) })
}
}, },
handleAdd () { handleAdd () {
this.$refs.modal.add() this.$refs.modal.add()

View File

@ -47,7 +47,7 @@
{{ text | statusFilter }} {{ text | statusFilter }}
</span> </span>
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<a v-if="editEnabel" @click="handleView(record.id)">详情</a> <a v-if="editEnabel" @click="handleFloorView(record.id)">详情</a>
<!-- <a v-if="editEnabel" @click="handleEdit(record)">指派</a>--> <!-- <a v-if="editEnabel" @click="handleEdit(record)">指派</a>-->
<!-- <a-divider type="vertical" />--> <!-- <a-divider type="vertical" />-->
</span> </span>
@ -59,7 +59,7 @@
<script> <script>
import { STable } from '@/components' import { STable } from '@/components'
import { getWorkerList,getFloorList } from '@/api/admin/repair/repairStats' import { getWorkerList, getFloorList } from '@/api/admin/repair/repairStats'
import { checkPermission } from '@/utils/permissions' import { checkPermission } from '@/utils/permissions'
export default { export default {
@ -224,6 +224,11 @@ export default {
handleView (workerId) { handleView (workerId) {
this.$router.push({ name: 'repair', query: { repairUserId: workerId } }) this.$router.push({ name: 'repair', query: { repairUserId: workerId } })
}, },
handleFloorView( floorId ){
console.log(floorId)
this.$router.push({ name: 'repair', query: { floorId: floorId } })
},
handleEdit (record) { handleEdit (record) {
this.$refs.modal.edit(record) this.$refs.modal.edit(record)
}, },

View File

@ -1,128 +1,158 @@
<template> <template>
<div class='container'> <div class="container">
<div class='topHeadView'> <div class="topHeadView">
<div class='itemView' v-for='item in 4'> <div class="itemView">
<div class='imgView'></div> <div class="imgView"></div>
<div class='label'>待派单</div> <div class="label">待派单</div>
<div class='num'>10</div> <div class="num">{{ adminStatsCount.wait }}</div>
</div>
<div class="itemView">
<div class="imgView"></div>
<div class="label">重派单</div>
<div class="num">{{ adminStatsCount.anew }}</div>
</div>
<div class="itemView">
<div class="imgView"></div>
<div class="label">未查看通知</div>
<div class="num">{{ adminStatsCount.newnotice }}</div>
</div>
<div class="itemView">
<div class="imgView"></div>
<div class="label">已查看通知</div>
<div class="num">{{ adminStatsCount.oldnotice }}</div>
</div> </div>
</div> </div>
<div class='caseStatisticsView'> <div class="caseStatisticsView">
<div class='headView'> <div class="headView">
<div class='titleView'>工单统计</div> <div class="titleView">工单统计</div>
<div class='typeView'> <div class="typeView">
<div class='type activity'>本周</div> <div :class="type=='month' ? 'activity' : ''" class="type " @click="repairCount">本月</div>
<div class='type'>本月</div> <div :class="type=='year' ? 'activity' : ''" class="type" @click="getYearCount">本年</div>
<div class='type'>本年</div>
</div> </div>
</div> </div>
<div class='contentView'> <div class="contentView">
<div class='itemView' v-for='item in 6'> <div class="itemView">
<div class='label'>维修工单</div> <div class="label">维修工单</div>
<div class='value'>100</div> <div class="value">{{ repairStatsCount.zs }}</div>
</div>
<div class="itemView">
<div class="label">待维修工单</div>
<div class="value">{{ repairStatsCount.wait }}</div>
</div>
<div class="itemView">
<div class="label">超时量</div>
<div class="value">{{ repairStatsCount.timeout }}</div>
</div>
<div class="itemView">
<div class="label">差评量</div>
<div class="value">{{ repairStatsCount.l }}</div>
</div>
<div class="itemView">
<div class="label">中评量</div>
<div class="value">{{ repairStatsCount.m }}</div>
</div>
<div class="itemView">
<div class="label">好评量</div>
<div class="value">{{ repairStatsCount.h }}</div>
</div> </div>
</div> </div>
</div> </div>
<div class='statusView'> <div class="statusView">
<div class='caseStatusView'> <div class="caseStatusView">
<div class='headView'> <div class="headView">
<div class='titleView'>工单完成情况</div> <div class="titleView">工单完成情况</div>
<div class='typeView'> <!-- <div class="typeView">-->
<div class='type activity'>本周</div> <!-- <div class="type activity">本周</div>-->
<div class='type'>本年</div> <!-- <div class="type">本年</div>-->
<!-- </div>-->
</div> </div>
<div class="contentView">
<div class="circularView">
<div id="echart1" style="width: 400px; height: 300px"></div>
</div> </div>
<div class='contentView'> <div class="centerLine"></div>
<div class='circularView'> <div class="circularView">
<div id='echart1' style='width: 400px; height: 300px'></div> <div id="echart2" style="width: 400px; height: 300px"></div>
</div>
<div class='centerLine'></div>
<div class='circularView'>
<div id='echart2' style='width: 400px; height: 300px'></div>
</div> </div>
</div> </div>
</div> </div>
<div class='evaluateView'> <div class="evaluateView">
<div class='headView'> <div class="headView">
<div class='titleView'>评价情况</div> <div class="titleView">评价情况</div>
</div> </div>
<div class='contentView'> <div class="contentView">
<div id='echart3' style='width: 400px; height: 300px'></div> <div id="echart3" style="width: 400px; height: 300px"></div>
</div> </div>
</div> </div>
</div> </div>
<div class="faultView">
<div class="floorView">
<div class='faultView'> <div class="headView">
<div class='floorView'> <div class="titleView">楼层负责人情况</div>
<div class='headView'> <div class="conditionView">
<div class='titleView'>楼层负责人情况</div> <a-select default-value="week" style="width: 120px;margin-right: 10px">
<div class='conditionView'> <a-select-option value="month" >按月</a-select-option>
<a-select default-value='week' style='width: 120px;margin-right: 10px'> <a-select-option value="year">按年</a-select-option>
<a-select-option value='week'>按周</a-select-option>
<a-select-option value='month'>按月</a-select-option>
<a-select-option value='year'>按年</a-select-option>
</a-select> </a-select>
<a-date-picker placeholder='请选择时间' /> <a-month-picker placeholder="请选择时间" />
<a-year-picker placeholder="请选择时间" />
</div> </div>
</div> </div>
<div class='contentView'> <div class="contentView">
<div id='echart4' style='width: 550px; height: 600px'></div> <div id="echart4" style="width: 550px; height: 600px"></div>
</div> </div>
</div> </div>
<div class='rightView'> <div class="rightView">
<div class='blockView'> <div class="blockView">
<div class='headView'> <div class="headView">
<div class='titleView'>故障统计</div> <div class="titleView">故障统计</div>
<div class='conditionView'> <div class="conditionView">
<a-select default-value='week' style='width: 120px;margin-right: 10px'> <a-select default-value="week" style="width: 120px;margin-right: 10px">
<a-select-option value='week'>按周</a-select-option> <a-select-option value="month">按月</a-select-option>
<a-select-option value='month'>按月</a-select-option> <a-select-option value="year">按年</a-select-option>
<a-select-option value='year'>按年</a-select-option>
</a-select> </a-select>
<a-date-picker placeholder='请选择时间' /> <a-date-picker placeholder="请选择时间" />
</div> </div>
</div> </div>
<div class='contentView'> <div class="contentView">
<div id='echart5' style='width: 700px; height: 327px'></div> <div id="echart5" style="width: 700px; height: 327px"></div>
</div> </div>
</div> </div>
<div class='blockView'> <div class="blockView">
<div class='headView'> <div class="headView">
<div class='titleView'>故障类型</div> <div class="titleView">故障类型</div>
<div class='conditionView'> <div class="conditionView">
<a-select default-value='week' style='width: 120px;margin-right: 10px'> <a-select default-value="week" style="width: 120px;margin-right: 10px">
<a-select-option value='week'>按周</a-select-option> <a-select-option value="month">按月</a-select-option>
<a-select-option value='month'>按月</a-select-option> <a-select-option value="year">按年</a-select-option>
<a-select-option value='year'>按年</a-select-option>
</a-select> </a-select>
<a-date-picker placeholder='请选择时间' /> <a-date-picker placeholder="请选择时间" />
</div> </div>
</div> </div>
<div class='contentView'> <div class="contentView">
<div id='echart6' style='width: 700px; height: 327px'></div> <div id="echart6" style="width: 700px; height: 327px"></div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class='tableView'> <div class="tableView">
<div class='headView'> <div class="headView">
<div class='titleView'>故障统计</div> <div class="titleView">故障统计</div>
<div class='conditionView'> <div class="conditionView">
<a-select default-value='week' style='width: 120px;margin-right: 10px'> <a-select default-value="week" style="width: 120px;margin-right: 10px">
<a-select-option value='week'>按周</a-select-option> <a-select-option value="week">按周</a-select-option>
<a-select-option value='month'>按月</a-select-option> <a-select-option value="month">按月</a-select-option>
<a-select-option value='year'>按年</a-select-option> <a-select-option value="year">按年</a-select-option>
</a-select> </a-select>
<a-date-picker placeholder='请选择时间' /> <a-date-picker placeholder="请选择时间" />
</div> </div>
</div> </div>
<div class='contentView'> <div class="contentView">
<a-table <a-table
:columns="columns" :columns="columns"
:data-source="loadData" :data-source="loadData"
@ -139,11 +169,19 @@
<script> <script>
import * as echarts from 'echarts' import * as echarts from 'echarts'
import { repairAdminStats, repairStats, floorStats } from '@/api/admin/repair/repairStats'
export default { export default {
name: 'RepairStatistics', name: 'RepairStatistics',
data () { data () {
return { return {
type: '',
adminStatsCount: [],
repairStatsCount: [],
finishCount: [],
timeout: [],
pj: [],
floorStatsCount: [],
// //
queryParam: {}, queryParam: {},
selectedRowKeys: [], selectedRowKeys: [],
@ -154,19 +192,19 @@ export default {
title: 'Name', title: 'Name',
dataIndex: 'name', dataIndex: 'name',
key: 'name', key: 'name',
scopedSlots: { customRender: 'name' }, scopedSlots: { customRender: 'name' }
}, },
{ {
title: 'Age', title: 'Age',
dataIndex: 'age', dataIndex: 'age',
key: 'age', key: 'age',
width: 80, width: 80
}, },
{ {
title: 'Address', title: 'Address',
dataIndex: 'address', dataIndex: 'address',
key: 'address 1', key: 'address 1',
ellipsis: true, ellipsis: true
} }
], ],
// Promise // Promise
@ -176,41 +214,40 @@ export default {
name: 'John Brown', name: 'John Brown',
age: 32, age: 32,
address: 'New York No. 1 Lake Park, New York No. 1 Lake Park', address: 'New York No. 1 Lake Park, New York No. 1 Lake Park',
tags: ['nice', 'developer'], tags: ['nice', 'developer']
}, },
{ {
key: '2', key: '2',
name: 'Jim Green', name: 'Jim Green',
age: 42, age: 42,
address: 'London No. 2 Lake Park, London No. 2 Lake Park', address: 'London No. 2 Lake Park, London No. 2 Lake Park',
tags: ['loser'], tags: ['loser']
}, },
{ {
key: '3', key: '3',
name: 'Joe Black', name: 'Joe Black',
age: 32, age: 32,
address: 'Sidney No. 1 Lake Park, Sidney No. 1 Lake Park', address: 'Sidney No. 1 Lake Park, Sidney No. 1 Lake Park',
tags: ['cool', 'teacher'], tags: ['cool', 'teacher']
}, }
], ]
} }
}, },
mounted() { mounted () {
this.createEchartCake('echart1', { this.adminStats()
bottom: 10, this.repairCount()
left: 'right', this.getfloorStats()
orient: 'vertical'
}) // this.createEchartCake('echart2', {
this.createEchartCake('echart2', { // bottom: 10,
bottom: 10, // left: 'right',
left: 'right', // orient: 'vertical'
orient: 'vertical' // })
}) // this.createEchartCake('echart3', {
this.createEchartCake('echart3', { // bottom: 10,
bottom: 10, // left: 'right',
left: 'right', // orient: 'vertical'
orient: 'vertical' // })
})
this.createEchartLine('echart4') this.createEchartLine('echart4')
this.createColumnEcharrt('echart5') this.createColumnEcharrt('echart5')
this.createEchartCake('echart6', { this.createEchartCake('echart6', {
@ -220,11 +257,74 @@ export default {
}) })
}, },
methods: { methods: {
adminStats () {
repairAdminStats().then(res => {
this.adminStatsCount = res.repairAdminStats
})
},
getYearCount () {
this.type = 'year'
repairStats().then(res => {
this.repairStatsCount = res.currentYear.stats
this.finishCount = res.currentYear.wc
this.timeout = res.currentYear.timeout
this.pj = res.currentYear.pj
this.createEchartCake('echart1', {
bottom: 10,
left: 'right',
orient: 'vertical'
}, this.finishCount)
this.createEchartCake('echart2', {
bottom: 10,
left: 'right',
orient: 'vertical'
}, this.timeout)
this.createEchartCake('echart3', {
bottom: 10,
left: 'right',
orient: 'vertical'
}, this.pj)
})
},
repairCount () {
repairStats().then(res => {
this.type = 'month'
console.log(res.currentMonth.wc)
this.repairStatsCount = res.currentMonth.stats
this.finishCount = res.currentMonth.wc
this.timeout = res.currentMonth.timeout
this.pj = res.currentMonth.pj
this.createEchartCake('echart1', {
bottom: 10,
left: 'right',
orient: 'vertical'
}, this.finishCount)
this.createEchartCake('echart2', {
bottom: 10,
left: 'right',
orient: 'vertical'
}, this.timeout)
this.createEchartCake('echart3', {
bottom: 10,
left: 'right',
orient: 'vertical'
}, this.pj)
})
},
//
getfloorStats () {
floorStats().then(res => {
console.log(res)
})
},
onSelectChange (selectedRowKeys, selectedRows) { onSelectChange (selectedRowKeys, selectedRows) {
this.selectedRowKeys = selectedRowKeys this.selectedRowKeys = selectedRowKeys
this.selectedRows = selectedRows this.selectedRows = selectedRows
}, },
createEchartCake(id, legend) { createEchartCake (id, legend, data) {
console.log(data)
// domecharts // domecharts
let myChart = echarts.init(document.getElementById(id)) let myChart = echarts.init(document.getElementById(id))
// //
@ -235,7 +335,7 @@ export default {
legend: legend, legend: legend,
series: [ series: [
{ {
name: 'Access From', name: '完成率',
type: 'pie', type: 'pie',
radius: ['40%', '70%'], radius: ['40%', '70%'],
avoidLabelOverlap: false, avoidLabelOverlap: false,
@ -258,20 +358,14 @@ export default {
labelLine: { labelLine: {
show: false show: false
}, },
data: [ data: data
{ value: 1048, name: 'Search ' },
{ value: 735, name: 'Direct' },
{ value: 580, name: 'Email' },
{ value: 484, name: 'Union ' },
{ value: 300, name: 'Video ' }
]
} }
] ]
} }
// 使 // 使
myChart.setOption(option) myChart.setOption(option)
}, },
createEchartLine(id) { createEchartLine (id) {
// domecharts // domecharts
let myChart = echarts.init(document.getElementById(id)) let myChart = echarts.init(document.getElementById(id))
let option = { let option = {
@ -315,7 +409,7 @@ export default {
// 使 // 使
myChart.setOption(option) myChart.setOption(option)
}, },
createColumnEcharrt(id) { createColumnEcharrt (id) {
// domecharts // domecharts
let myChart = echarts.init(document.getElementById(id)) let myChart = echarts.init(document.getElementById(id))
// There should not be negative values in rawData // There should not be negative values in rawData