修改了对应统计页面

This commit is contained in:
chenze 2024-08-18 14:03:26 +08:00
parent fa918ad9c0
commit e2551bb1c5
2 changed files with 76 additions and 18 deletions

View File

@ -61,3 +61,11 @@ export function floorStats (parameter) {
params: parameter
})
}
export function deviceTypeStats (parameter) {
return axios({
url: api.repairStats + '/deviceTypeStats',
method: 'get',
params: parameter
})
}

View File

@ -95,7 +95,7 @@
<div class="titleView">楼层负责人情况</div>
<div class="conditionView">
<a-select default-value="week" style="width: 120px;margin-right: 10px">
<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>
<a-month-picker placeholder="请选择时间" />
@ -144,21 +144,31 @@
<div class="headView">
<div class="titleView">故障统计</div>
<div class="conditionView">
<a-select default-value="week" style="width: 120px;margin-right: 10px">
<a-select-option value="week">按周</a-select-option>
<a-select style="width: 120px;margin-right: 10px" @change="selectWeek">
<a-select-option value="month">按月</a-select-option>
<a-select-option value="year">按年</a-select-option>
</a-select>
<a-date-picker placeholder="请选择时间" />
<a-date-picker
mode="year"
v-decorator="['year']"
placeholder="请输入年份"
format="YYYY"
style="width: 200px"
:open="yearShowOne"
v-model:value="deviceType"
@openChange="openChangeOne"
@panelChange="panelChangeOne" />
</div>
</div>
<div class="contentView">
<a-table
style="width: 100%"
:columns="columns"
:data-source="loadData"
showPagination="true"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
>
</a-table>
</div>
@ -169,7 +179,7 @@
<script>
import * as echarts from 'echarts'
import { repairAdminStats, repairStats, floorStats } from '@/api/admin/repair/repairStats'
import { repairAdminStats, repairStats, floorStats, deviceTypeStats } from '@/api/admin/repair/repairStats'
export default {
name: 'RepairStatistics',
@ -180,31 +190,48 @@ export default {
repairStatsCount: [],
finishCount: [],
timeout: [],
deviceTypeCount: [],
pj: [],
floorStatsCount: [],
//
queryParam: {},
selectedRowKeys: [],
selectedRows: [],
deviceType: '',
yearShowOne: false,
//
columns: [
{
title: 'Name',
dataIndex: 'name',
key: 'name',
scopedSlots: { customRender: 'name' }
title: '类型',
dataIndex: 'typename'
},
{
title: 'Age',
dataIndex: 'age',
key: 'age',
width: 80
title: '保修次数',
dataIndex: 'zs'
},
{
title: 'Address',
dataIndex: 'address',
key: 'address 1',
ellipsis: true
title: '维修次数',
dataIndex: 'closed'
},
{
title: '损坏最多品牌',
dataIndex: 'brand'
},
{
title: '维修完成率',
dataIndex: 'wcl'
},
{
title: '好评率',
dataIndex: 'hl'
},
{
title: '中评率',
dataIndex: 'ml'
},
{
title: '差评率',
dataIndex: 'll'
}
],
// Promise
@ -237,6 +264,7 @@ export default {
this.adminStats()
this.repairCount()
this.getfloorStats()
this.deviceStats()
// this.createEchartCake('echart2', {
// bottom: 10,
@ -257,11 +285,33 @@ export default {
})
},
methods: {
//
openChangeOne (status) {
if (status) {
this.yearShowOne = true
}
},
//
panelChangeOne (value) {
this.yearShowOne = false
this.deviceType = value
console.log(this.deviceType)
},
selectWeek (value) {
this.deviceType = value
console.log(this.deviceType)
},
adminStats () {
repairAdminStats().then(res => {
this.adminStatsCount = res.repairAdminStats
})
},
deviceStats () {
deviceTypeStats({ date: '2024-08' }).then(res => {
this.loadData = res.rows
})
},
getYearCount () {
this.type = 'year'
repairStats().then(res => {