2024-08-08 14:23:25 +08:00
|
|
|
<template>
|
2024-08-29 17:18:22 +08:00
|
|
|
<a-card :bordered='false'>
|
|
|
|
<div class='table-page-search-wrapper'>
|
|
|
|
<a-form layout='inline'>
|
|
|
|
<a-row :gutter='48'>
|
|
|
|
<a-col :md='5' :sm='15'>
|
|
|
|
<a-form-item label='报修单号'>
|
|
|
|
<a-input placeholder='请输入报修单号' v-model='queryParam.sn' />
|
2024-08-08 14:23:25 +08:00
|
|
|
</a-form-item>
|
|
|
|
</a-col>
|
2024-08-29 17:18:22 +08:00
|
|
|
<a-col :md='5' :sm='15'>
|
|
|
|
<a-form-item label='时间范围'>
|
|
|
|
<a-range-picker v-model='queryParam.timeRange' @change='selectTime' />
|
|
|
|
</a-form-item>
|
|
|
|
</a-col>
|
|
|
|
<a-col :md='8' :sm='24'>
|
|
|
|
<span class='table-page-search-submitButtons'>
|
|
|
|
<a-button type='primary' @click='$refs.table.refresh(true)'>查询</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-29 17:18:22 +08:00
|
|
|
<a-tabs default-active-key='1' @change='callback'>
|
|
|
|
<a-tab-pane key='1' tab='维修人员'>
|
2024-08-15 17:33:04 +08:00
|
|
|
<a-table
|
2024-08-29 17:18:22 +08:00
|
|
|
size='default'
|
|
|
|
ref='table'
|
|
|
|
rowKey='id'
|
|
|
|
:columns='columns'
|
|
|
|
:data-source='workerData'
|
2024-08-08 16:13:30 +08:00
|
|
|
>
|
2024-08-29 17:18:22 +08:00
|
|
|
<span slot='status' slot-scope='text'>
|
2024-08-08 14:23:25 +08:00
|
|
|
{{ text | statusFilter }}
|
|
|
|
</span>
|
2024-08-29 17:18:22 +08:00
|
|
|
<span slot='action' slot-scope='text, record'>
|
|
|
|
<a v-if='editEnabel' @click='handleView(record.id)'>详情</a>
|
2024-08-08 14:23:25 +08:00
|
|
|
</span>
|
2024-08-15 17:33:04 +08:00
|
|
|
</a-table>
|
2024-08-08 16:13:30 +08:00
|
|
|
</a-tab-pane>
|
2024-08-29 17:18:22 +08:00
|
|
|
<a-tab-pane key='2' tab='网格区域' force-render>
|
2024-08-15 17:33:04 +08:00
|
|
|
<a-table
|
2024-08-29 17:18:22 +08:00
|
|
|
size='default'
|
|
|
|
ref='table'
|
|
|
|
rowKey='id'
|
|
|
|
:columns='floorColumns'
|
|
|
|
:data-source='floorData'
|
2024-08-08 16:13:30 +08:00
|
|
|
>
|
2024-08-29 17:18:22 +08:00
|
|
|
<span slot='status' slot-scope='text'>
|
2024-08-08 16:13:30 +08:00
|
|
|
{{ text | statusFilter }}
|
|
|
|
</span>
|
2024-08-29 17:18:22 +08:00
|
|
|
<span slot='action' slot-scope='text, record'>
|
|
|
|
<a v-if='editEnabel' @click='handleFloorView(record.id)'>详情</a>
|
2024-08-29 00:04:46 +08:00
|
|
|
</span>
|
|
|
|
</a-table>
|
|
|
|
</a-tab-pane>
|
2024-08-29 17:18:22 +08:00
|
|
|
<a-tab-pane key='3' tab='网格长'>
|
2024-08-29 00:04:46 +08:00
|
|
|
<a-table
|
2024-08-29 17:18:22 +08:00
|
|
|
size='default'
|
|
|
|
ref='table'
|
|
|
|
rowKey='id'
|
|
|
|
:columns='floorCreateColumns'
|
|
|
|
:data-source='floorCreateData'
|
2024-08-29 00:04:46 +08:00
|
|
|
>
|
2024-08-29 17:18:22 +08:00
|
|
|
<span slot='status' slot-scope='text'>
|
2024-08-29 00:04:46 +08:00
|
|
|
{{ text | statusFilter }}
|
|
|
|
</span>
|
2024-08-29 17:18:22 +08:00
|
|
|
<span slot='action' slot-scope='text, record'>
|
|
|
|
<a v-if='editEnabel' @click='handleFloorCreateView(record.id)'>详情</a>
|
2024-08-08 16:13:30 +08:00
|
|
|
</span>
|
2024-08-15 17:33:04 +08:00
|
|
|
</a-table>
|
2024-08-08 16:13:30 +08:00
|
|
|
</a-tab-pane>
|
|
|
|
</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-29 17:18:22 +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: '楼层负责人',
|
2024-08-16 11:07:18 +08:00
|
|
|
dataIndex: 'name'
|
2024-08-08 16:13:30 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '所属楼层',
|
2024-08-16 11:07:18 +08:00
|
|
|
dataIndex: 'adr'
|
2024-08-08 16:13:30 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '工单总数',
|
2024-08-16 11:07:18 +08:00
|
|
|
dataIndex: 'zs'
|
2024-08-08 16:13:30 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
title: '已完成',
|
2024-08-16 11:07:18 +08:00
|
|
|
dataIndex: 'closed'
|
2024-08-08 16:13:30 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '未解决',
|
2024-08-16 11:07:18 +08:00
|
|
|
dataIndex: 'unresolved'
|
2024-08-08 16:13:30 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '处理中',
|
2024-08-16 11:07:18 +08:00
|
|
|
dataIndex: 'process'
|
2024-08-08 16:13:30 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '好评数量好评率',
|
2024-08-16 11:07:18 +08:00
|
|
|
dataIndex: 'h'
|
2024-08-08 16:13:30 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '中评数量中评率',
|
2024-08-16 11:07:18 +08:00
|
|
|
dataIndex: 'm'
|
2024-08-08 16:13:30 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '差评数量差评率',
|
2024-08-16 11:07:18 +08:00
|
|
|
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: '用户姓名',
|
2024-08-16 11:07:18 +08:00
|
|
|
dataIndex: 'username'
|
2024-08-08 14:23:25 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '所属分类',
|
2024-08-16 11:07:18 +08:00
|
|
|
dataIndex: 'typename'
|
2024-08-08 14:23:25 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '工单数量',
|
2024-08-16 11:07:18 +08:00
|
|
|
dataIndex: 'zs'
|
2024-08-08 14:23:25 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
title: '已完成',
|
2024-08-16 11:07:18 +08:00
|
|
|
dataIndex: 'closed'
|
2024-08-08 14:23:25 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '未解决',
|
2024-08-16 11:07:18 +08:00
|
|
|
dataIndex: 'unresolved'
|
2024-08-08 14:23:25 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '处理中',
|
2024-08-16 11:07:18 +08:00
|
|
|
dataIndex: 'process'
|
2024-08-08 14:23:25 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '好评数量好评率',
|
2024-08-16 11:07:18 +08:00
|
|
|
dataIndex: 'h'
|
2024-08-08 14:23:25 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '中评数量中评率',
|
2024-08-16 11:07:18 +08:00
|
|
|
dataIndex: 'm'
|
2024-08-08 14:23:25 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '差评数量差评率',
|
2024-08-16 11:07:18 +08:00
|
|
|
dataIndex: 'l'
|
2024-08-08 14:23:25 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '操作',
|
|
|
|
width: '200px',
|
|
|
|
dataIndex: 'action',
|
|
|
|
scopedSlots: { customRender: 'action' }
|
|
|
|
}
|
|
|
|
],
|
|
|
|
// 加载数据方法 必须为 Promise 对象
|
2024-08-15 17:33:04 +08:00
|
|
|
// 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'),
|
2024-08-15 17:33:04 +08:00
|
|
|
removeEnable: checkPermission('admin:repair:list'),
|
2024-08-16 11:07:18 +08:00
|
|
|
loadData: [],
|
|
|
|
workerData: [],
|
2024-08-29 00:04:46 +08:00
|
|
|
floorData: [],
|
|
|
|
floorCreateData: []
|
2024-08-08 14:23:25 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
filters: {
|
2024-08-29 17:18:22 +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-29 17:18:22 +08:00
|
|
|
created() {
|
2024-08-16 11:07:18 +08:00
|
|
|
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-29 17:18:22 +08:00
|
|
|
// 切换时间
|
|
|
|
selectTime(value, dateString) {
|
|
|
|
this.queryParam.startTime = dateString[0]
|
|
|
|
this.queryParam.endTime = dateString[1]
|
|
|
|
console.log('this.queryParam', this.queryParam)
|
|
|
|
},
|
2024-08-16 11:07:18 +08:00
|
|
|
// admin/repair/stats/workerList
|
2024-08-29 17:18:22 +08:00
|
|
|
workerList() {
|
2024-08-16 11:07:18 +08:00
|
|
|
getWorkerList().then(res => {
|
|
|
|
this.workerData = res.rows
|
|
|
|
})
|
|
|
|
},
|
2024-08-29 17:18:22 +08:00
|
|
|
floorList() {
|
2024-08-16 11:07:18 +08:00
|
|
|
getFloorList().then(res => {
|
|
|
|
this.floorData = res.rows
|
|
|
|
})
|
|
|
|
},
|
2024-08-29 17:18:22 +08:00
|
|
|
floorCreateList() {
|
2024-08-29 00:04:46 +08:00
|
|
|
getFloorCreateList().then(res => {
|
|
|
|
this.floorCreateData = res.rows
|
|
|
|
})
|
|
|
|
},
|
2024-08-29 17:18:22 +08:00
|
|
|
callback() {
|
2024-08-08 16:13:30 +08:00
|
|
|
|
|
|
|
},
|
2024-08-29 17:18:22 +08:00
|
|
|
handleAdd() {
|
2024-08-08 14:23:25 +08:00
|
|
|
this.$refs.modal.add()
|
|
|
|
},
|
2024-08-29 17:18:22 +08:00
|
|
|
handleView(workerId) {
|
2024-08-16 11:07:18 +08:00
|
|
|
this.$router.push({ name: 'repair', query: { repairUserId: workerId } })
|
2024-08-08 14:23:25 +08:00
|
|
|
},
|
2024-08-29 17:18:22 +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-29 17:18:22 +08:00
|
|
|
handleFloorCreateView(floorId) {
|
2024-08-29 00:04:46 +08:00
|
|
|
this.$router.push({ name: 'repair', query: { floorCreateId: floorId } })
|
|
|
|
},
|
2024-08-29 17:18:22 +08:00
|
|
|
handleEdit(record) {
|
2024-08-08 14:23:25 +08:00
|
|
|
this.$refs.modal.edit(record)
|
|
|
|
},
|
2024-08-29 17:18:22 +08:00
|
|
|
handleOk() {
|
2024-08-08 14:23:25 +08:00
|
|
|
this.$refs.table.refresh(true)
|
|
|
|
console.log('handleSaveOk')
|
|
|
|
},
|
2024-08-29 17:18:22 +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-29 17:18:22 +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-29 17:18:22 +08:00
|
|
|
onCancel() {
|
|
|
|
}
|
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>
|