修改了对应统计页面

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