dbd-meeting-html/src/views/admin/repair/PerformanceList.vue

343 lines
8.4 KiB
Vue
Raw Normal View History

2024-08-08 14:23:25 +08:00
<template>
2024-08-30 00:42:34 +08:00
<a-card :bordered="false">
<div class="table-page-search-wrapper">
<a-form layout="inline">
<a-row :gutter="48">
2024-08-30 12:01:32 +08:00
<a-col :md="7" :sm="15">
2024-08-30 00:42:34 +08:00
<a-form-item label="时间范围">
<a-range-picker v-model="timeRange" @change="selectTime" />
2024-08-29 17:18:22 +08:00
</a-form-item>
</a-col>
2024-08-30 00:42:34 +08:00
<a-col :md="8" :sm="24">
<span class="table-page-search-submitButtons">
<a-button type="primary" @click="selectList()">查询</a-button>
<a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</a-button>
2024-08-08 14:23:25 +08:00
</span>
</a-col>
</a-row>
</a-form>
</div>
2024-08-30 00:42:34 +08:00
<a-tabs default-active-key="1" @change="callback">
2024-08-30 12:10:49 +08:00
<a-tab-pane key="2" tab="网格区域" force-render>
<a-table
2024-08-30 00:42:34 +08:00
size="default"
ref="table"
rowKey="id"
2024-08-30 12:10:49 +08:00
:columns="floorColumns"
:data-source="floorData"
2024-08-08 16:13:30 +08:00
>
2024-08-30 00:42:34 +08:00
<span slot="status" slot-scope="text">
2024-08-08 14:23:25 +08:00
{{ text | statusFilter }}
</span>
2024-08-30 00:42:34 +08:00
<span slot="action" slot-scope="text, record">
2024-08-30 12:10:49 +08:00
<a v-if="editEnabel" @click="handleFloorView(record.id)">详情</a>
2024-08-08 14:23:25 +08:00
</span>
</a-table>
2024-08-08 16:13:30 +08:00
</a-tab-pane>
2024-08-30 12:10:49 +08:00
<a-tab-pane key="3" tab="网格长">
<a-table
2024-08-30 00:42:34 +08:00
size="default"
ref="table"
rowKey="id"
2024-08-30 12:10:49 +08:00
:columns="floorCreateColumns"
:data-source="floorCreateData"
2024-08-08 16:13:30 +08:00
>
2024-08-30 00:42:34 +08:00
<span slot="status" slot-scope="text">
2024-08-08 16:13:30 +08:00
{{ text | statusFilter }}
</span>
2024-08-30 00:42:34 +08:00
<span slot="action" slot-scope="text, record">
2024-08-30 12:10:49 +08:00
<a v-if="editEnabel" @click="handleFloorCreateView(record.id)">详情</a>
2024-08-29 00:04:46 +08:00
</span>
</a-table>
</a-tab-pane>
2024-08-30 12:10:49 +08:00
<a-tab-pane key="1" tab="维修人员">
2024-08-29 00:04:46 +08:00
<a-table
2024-08-30 00:42:34 +08:00
size="default"
ref="table"
rowKey="id"
2024-08-30 12:10:49 +08:00
:columns="columns"
:data-source="workerData"
2024-08-29 00:04:46 +08:00
>
2024-08-30 00:42:34 +08:00
<span slot="status" slot-scope="text">
2024-08-29 00:04:46 +08:00
{{ text | statusFilter }}
</span>
2024-08-30 00:42:34 +08:00
<span slot="action" slot-scope="text, record">
2024-08-30 12:10:49 +08:00
<a v-if="editEnabel" @click="handleView(record.id)">详情</a>
2024-08-08 16:13:30 +08:00
</span>
</a-table>
2024-08-08 16:13:30 +08:00
</a-tab-pane>
2024-08-30 12:10:49 +08:00
2024-08-08 16:13:30 +08:00
</a-tabs>
2024-08-08 14:23:25 +08:00
</a-card>
</template>
<script>
import { STable } from '@/components'
2024-08-29 00:04:46 +08:00
import { getWorkerList, getFloorList, getFloorCreateList } from '@/api/admin/repair/repairStats'
2024-08-08 14:23:25 +08:00
import { checkPermission } from '@/utils/permissions'
export default {
name: 'TableList',
components: {
2024-08-29 17:18:22 +08:00
STable
2024-08-08 14:23:25 +08:00
},
2024-08-30 00:42:34 +08:00
data () {
2024-08-08 14:23:25 +08:00
return {
labelCol: {
xs: { span: 24 },
sm: { span: 5 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 }
},
form: this.$form.createForm(this),
mdl: {},
// 高级搜索 展开/关闭
advanced: false,
// 查询参数
queryParam: {},
2024-08-29 00:04:46 +08:00
floorCreateColumns: [
{
title: '网格长',
dataIndex: 'name'
},
{
title: '发现问题',
dataIndex: 'zs'
},
{
title: '已完成',
dataIndex: 'closed'
},
{
title: '未解决',
dataIndex: 'unresolved'
},
{
title: '处理中',
dataIndex: 'process'
},
{
title: '好评数量好评率',
dataIndex: 'h'
},
{
title: '中评数量中评率',
dataIndex: 'm'
},
{
title: '差评数量差评率',
dataIndex: 'l'
},
{
title: '操作',
width: '200px',
dataIndex: 'action',
scopedSlots: { customRender: 'action' }
}
],
2024-08-08 16:13:30 +08:00
floorColumns: [
{
title: '楼层负责人',
dataIndex: 'name'
2024-08-08 16:13:30 +08:00
},
{
title: '所属楼层',
dataIndex: 'adr'
2024-08-08 16:13:30 +08:00
},
{
title: '工单总数',
dataIndex: 'zs'
2024-08-08 16:13:30 +08:00
},
{
title: '已完成',
dataIndex: 'closed'
2024-08-08 16:13:30 +08:00
},
{
title: '未解决',
dataIndex: 'unresolved'
2024-08-08 16:13:30 +08:00
},
{
title: '处理中',
dataIndex: 'process'
2024-08-08 16:13:30 +08:00
},
{
title: '好评数量好评率',
dataIndex: 'h'
2024-08-08 16:13:30 +08:00
},
{
title: '中评数量中评率',
dataIndex: 'm'
2024-08-08 16:13:30 +08:00
},
{
title: '差评数量差评率',
dataIndex: 'l'
2024-08-08 16:13:30 +08:00
},
{
title: '操作',
width: '200px',
dataIndex: 'action',
scopedSlots: { customRender: 'action' }
}
],
2024-08-08 14:23:25 +08:00
// 表头
columns: [
{
title: '用户姓名',
dataIndex: 'username'
2024-08-08 14:23:25 +08:00
},
{
title: '所属分类',
dataIndex: 'typename'
2024-08-08 14:23:25 +08:00
},
{
title: '工单数量',
dataIndex: 'zs'
2024-08-08 14:23:25 +08:00
},
{
title: '已完成',
dataIndex: 'closed'
2024-08-08 14:23:25 +08:00
},
{
title: '未解决',
dataIndex: 'unresolved'
2024-08-08 14:23:25 +08:00
},
{
title: '处理中',
dataIndex: 'process'
2024-08-08 14:23:25 +08:00
},
{
title: '好评数量好评率',
dataIndex: 'h'
2024-08-08 14:23:25 +08:00
},
{
title: '中评数量中评率',
dataIndex: 'm'
2024-08-08 14:23:25 +08:00
},
{
title: '差评数量差评率',
dataIndex: 'l'
2024-08-08 14:23:25 +08:00
},
{
title: '操作',
width: '200px',
dataIndex: 'action',
scopedSlots: { customRender: 'action' }
}
],
// 加载数据方法 必须为 Promise 对象
// loadData: parameter => {
// return getRepairList(Object.assign(parameter, this.queryParam))
// },
2024-08-08 14:23:25 +08:00
addEnable: checkPermission('admin:repair:add'),
editEnabel: checkPermission('admin:repair:edit'),
removeEnable: checkPermission('admin:repair:list'),
loadData: [],
2024-08-30 00:42:34 +08:00
timeRange: '',
workerData: [],
2024-08-29 00:04:46 +08:00
floorData: [],
floorCreateData: []
2024-08-08 14:23:25 +08:00
}
},
filters: {
2024-08-30 00:42:34 +08:00
statusFilter (status) {
2024-08-08 14:23:25 +08:00
const statusMap = {
'PENDING_ASSIGN': '待分配',
'PENDING_PROCESS': '待处理',
'COMPLETED': '已完成',
'CANCELED': '已取消',
'SCORE': '已评价'
}
return statusMap[status]
}
},
2024-08-30 00:42:34 +08:00
created () {
this.workerList()
this.floorList()
2024-08-29 00:04:46 +08:00
this.floorCreateList()
2024-08-08 14:23:25 +08:00
},
methods: {
2024-08-30 00:42:34 +08:00
selectList () {
this.workerList(this.queryParam)
this.floorList(this.queryParam)
this.floorCreateList(this.queryParam)
},
2024-08-29 17:18:22 +08:00
// 切换时间
2024-08-30 00:42:34 +08:00
selectTime (value, dateString) {
this.queryParam.startDate = dateString[0]
this.queryParam.endDate = dateString[1]
2024-08-29 17:18:22 +08:00
console.log('this.queryParam', this.queryParam)
},
// admin/repair/stats/workerList
2024-08-30 00:42:34 +08:00
workerList (query) {
getWorkerList(query).then(res => {
this.workerData = res.rows
})
},
2024-08-30 00:42:34 +08:00
floorList (query) {
getFloorList(query).then(res => {
this.floorData = res.rows
})
},
2024-08-30 00:42:34 +08:00
floorCreateList (query) {
getFloorCreateList(query).then(res => {
2024-08-29 00:04:46 +08:00
this.floorCreateData = res.rows
})
},
2024-08-30 00:42:34 +08:00
callback () {
2024-08-08 16:13:30 +08:00
},
2024-08-30 00:42:34 +08:00
handleAdd () {
2024-08-08 14:23:25 +08:00
this.$refs.modal.add()
},
2024-08-30 00:42:34 +08:00
handleView (workerId) {
this.$router.push({ name: 'repair', query: { repairUserId: workerId } })
2024-08-08 14:23:25 +08:00
},
2024-08-30 00:42:34 +08:00
handleFloorView (floorId) {
2024-08-17 16:31:37 +08:00
console.log(floorId)
this.$router.push({ name: 'repair', query: { floorId: floorId } })
},
2024-08-30 00:42:34 +08:00
handleFloorCreateView (floorId) {
2024-08-29 00:04:46 +08:00
this.$router.push({ name: 'repair', query: { floorCreateId: floorId } })
},
2024-08-30 00:42:34 +08:00
handleEdit (record) {
2024-08-08 14:23:25 +08:00
this.$refs.modal.edit(record)
},
2024-08-30 00:42:34 +08:00
handleOk () {
2024-08-08 14:23:25 +08:00
this.$refs.table.refresh(true)
console.log('handleSaveOk')
},
2024-08-30 00:42:34 +08:00
handleComplete (id) {
2024-08-08 14:23:25 +08:00
const _this = this
this.$confirm({
title: '警告',
content: '确认要完成工单吗?',
okText: '是',
okType: 'warning',
cancelText: '否',
2024-08-30 00:42:34 +08:00
onOk () {
2024-08-08 14:23:25 +08:00
complete(id).then(res => {
if (res.code === 0) {
_this.$message.success('操作成功')
_this.$refs.table.refresh(true)
} else {
_this.$message.error(res.msg)
}
}).catch(() => {
this.$message.error('系统错误,请稍后再试')
})
},
2024-08-30 00:42:34 +08:00
onCancel () {
2024-08-29 17:18:22 +08:00
}
2024-08-08 14:23:25 +08:00
})
}
},
2024-08-29 17:18:22 +08:00
watch: {}
2024-08-08 14:23:25 +08:00
}
</script>