2024-01-23 17:05:40 +08:00
|
|
|
<template>
|
|
|
|
<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="报修单号">
|
2024-08-15 17:33:04 +08:00
|
|
|
<a-input placeholder="请输入报修单号" v-model="queryParam.sn" />
|
2024-01-23 17:05:40 +08:00
|
|
|
</a-form-item>
|
|
|
|
</a-col>
|
2024-08-20 16:35:26 +08:00
|
|
|
<a-col :md="5" :sm="15">
|
|
|
|
<a-form-item label="报修名称">
|
|
|
|
<a-input placeholder="请输入报修名称" v-model="queryParam.name" />
|
|
|
|
</a-form-item>
|
|
|
|
</a-col>
|
|
|
|
<a-col :md="5" :sm="15">
|
|
|
|
<a-form-item label="分类名称">
|
|
|
|
<a-input placeholder="请输入分类名称" v-model="queryParam.typeName" />
|
|
|
|
</a-form-item>
|
|
|
|
</a-col>
|
|
|
|
<a-col :md="5" :sm="15">
|
|
|
|
<a-form-item label="设备名称">
|
|
|
|
<a-input placeholder="请输入设备名称" v-model="queryParam.deviceName" />
|
|
|
|
</a-form-item>
|
|
|
|
</a-col>
|
2024-01-23 17:05:40 +08:00
|
|
|
<a-col :md="8" :sm="24">
|
|
|
|
<span class="table-page-search-submitButtons">
|
2024-08-20 16:35:26 +08:00
|
|
|
<a-button type="primary" @click="getRepairList()">查询</a-button>
|
2024-01-23 17:05:40 +08:00
|
|
|
<a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</a-button>
|
|
|
|
</span>
|
|
|
|
</a-col>
|
|
|
|
</a-row>
|
|
|
|
</a-form>
|
|
|
|
</div>
|
2024-08-05 15:32:46 +08:00
|
|
|
<div class="table-operator">
|
|
|
|
<a-button v-if="addEnable" type="primary" icon="plus" @click="$refs.modal.add()">新建</a-button>
|
|
|
|
</div>
|
2024-08-15 17:33:04 +08:00
|
|
|
<a-table
|
2024-01-23 17:05:40 +08:00
|
|
|
size="default"
|
|
|
|
ref="table"
|
|
|
|
rowKey="id"
|
|
|
|
:columns="columns"
|
2024-08-15 17:33:04 +08:00
|
|
|
:data-source="loadData"
|
2024-01-23 17:05:40 +08:00
|
|
|
>
|
|
|
|
<span slot="status" slot-scope="text">
|
|
|
|
{{ text | statusFilter }}
|
|
|
|
</span>
|
|
|
|
<span slot="action" slot-scope="text, record">
|
|
|
|
<a v-if="editEnabel" @click="handleView(record.id)">详情</a>
|
2024-08-15 17:33:04 +08:00
|
|
|
<!-- <a v-if="editEnabel" @click="handleEdit(record)">指派</a>-->
|
|
|
|
<!-- <a-divider type="vertical" />-->
|
2024-01-23 17:05:40 +08:00
|
|
|
</span>
|
2024-08-15 17:33:04 +08:00
|
|
|
</a-table>
|
|
|
|
<repair-modal ref="modal" @ok="handleOk" />
|
2024-01-23 17:05:40 +08:00
|
|
|
</a-card>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { STable } from '@/components'
|
|
|
|
import { getRepairList, complete } from '@/api/admin/repair'
|
2024-08-17 16:31:37 +08:00
|
|
|
import { oneWorkerList, oneFloorList } from '@/api/admin/repair/repairStats'
|
2024-01-23 17:05:40 +08:00
|
|
|
import RepairModal from './modules/RepairModal.vue'
|
|
|
|
import { checkPermission } from '@/utils/permissions'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'TableList',
|
|
|
|
components: {
|
|
|
|
STable,
|
|
|
|
RepairModal
|
|
|
|
},
|
|
|
|
data () {
|
|
|
|
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-16 11:07:18 +08:00
|
|
|
loadData: [],
|
2024-01-23 17:05:40 +08:00
|
|
|
// 表头
|
|
|
|
columns: [
|
|
|
|
{
|
|
|
|
title: '维修单号',
|
|
|
|
dataIndex: 'sn'
|
|
|
|
},
|
|
|
|
{
|
2024-08-05 15:32:46 +08:00
|
|
|
title: '报修名称',
|
2024-08-07 09:56:31 +08:00
|
|
|
dataIndex: 'repairName'
|
2024-01-23 17:05:40 +08:00
|
|
|
},
|
|
|
|
{
|
2024-08-07 09:56:31 +08:00
|
|
|
title: '所属分类',
|
|
|
|
dataIndex: 'typeName'
|
2024-01-23 17:05:40 +08:00
|
|
|
},
|
|
|
|
{
|
2024-08-05 15:32:46 +08:00
|
|
|
title: '设备名称',
|
2024-08-15 17:33:04 +08:00
|
|
|
dataIndex: 'deviceName'
|
2024-01-23 17:05:40 +08:00
|
|
|
},
|
2024-08-07 09:56:31 +08:00
|
|
|
|
2024-01-23 17:05:40 +08:00
|
|
|
{
|
2024-08-05 15:32:46 +08:00
|
|
|
title: '工单状态',
|
|
|
|
dataIndex: 'status',
|
|
|
|
scopedSlots: { customRender: 'status' }
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '故障等级',
|
2024-08-07 09:56:31 +08:00
|
|
|
dataIndex: 'repairLevel'
|
2024-01-23 17:05:40 +08:00
|
|
|
},
|
2024-08-05 15:32:46 +08:00
|
|
|
{
|
|
|
|
title: '提交人',
|
2024-08-15 17:33:04 +08:00
|
|
|
dataIndex: 'name'
|
2024-08-05 15:32:46 +08:00
|
|
|
},
|
2024-01-23 17:05:40 +08:00
|
|
|
{
|
|
|
|
title: '报修时间',
|
|
|
|
dataIndex: 'repairTime',
|
|
|
|
sorter: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
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-01-23 17:05:40 +08:00
|
|
|
addEnable: checkPermission('admin:repair:add'),
|
|
|
|
editEnabel: checkPermission('admin:repair:edit'),
|
|
|
|
removeEnable: checkPermission('admin:repair:list')
|
|
|
|
}
|
|
|
|
},
|
|
|
|
filters: {
|
2024-08-15 17:33:04 +08:00
|
|
|
// 状态:1 待派单,3 重新派单,5 已派单,7 处理中, 9已完成 待评价, 11 已关闭 13 已评价
|
2024-01-23 17:05:40 +08:00
|
|
|
statusFilter (status) {
|
|
|
|
const statusMap = {
|
2024-08-15 17:33:04 +08:00
|
|
|
'1': '待分配',
|
|
|
|
'3': '重新派单',
|
|
|
|
'5': '已派单',
|
|
|
|
'7': '处理中',
|
|
|
|
'9': '已完成,待评价',
|
|
|
|
'11': '已关闭',
|
|
|
|
'13': '已评价'
|
2024-01-23 17:05:40 +08:00
|
|
|
}
|
|
|
|
return statusMap[status]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
created () {
|
2024-08-15 17:33:04 +08:00
|
|
|
this.getRepairList()
|
2024-01-23 17:05:40 +08:00
|
|
|
},
|
|
|
|
methods: {
|
2024-08-15 17:33:04 +08:00
|
|
|
getRepairList () {
|
2024-08-17 16:31:37 +08:00
|
|
|
if (this.$route.query.repairUserId != null) {
|
|
|
|
oneWorkerList({ workerId: this.$route.query.repairUserId }).then(res =>{
|
|
|
|
this.loadData = res.rows
|
|
|
|
})
|
|
|
|
} else if (this.$route.query.floorId !=null) {
|
|
|
|
oneFloorList({ floorId: this.$route.query.floorId }).then(res =>{
|
|
|
|
this.loadData = res.rows
|
|
|
|
})
|
2024-08-16 11:07:18 +08:00
|
|
|
} else {
|
2024-08-17 16:31:37 +08:00
|
|
|
let datas = {
|
2024-08-16 11:07:18 +08:00
|
|
|
'menu': 7,
|
2024-08-20 16:35:26 +08:00
|
|
|
'type': 'all',
|
|
|
|
'sn': this.queryParam.sn,
|
|
|
|
'name': this.queryParam.name,
|
|
|
|
'typeName': this.queryParam.typeName,
|
|
|
|
'deviceName': this.queryParam.deviceName
|
2024-08-16 11:07:18 +08:00
|
|
|
}
|
2024-08-17 16:31:37 +08:00
|
|
|
getRepairList(datas).then(res => {
|
|
|
|
this.loadData = res.rows
|
|
|
|
})
|
2024-08-15 17:33:04 +08:00
|
|
|
}
|
2024-08-16 11:07:18 +08:00
|
|
|
|
2024-08-15 17:33:04 +08:00
|
|
|
},
|
2024-01-23 17:05:40 +08:00
|
|
|
handleAdd () {
|
|
|
|
this.$refs.modal.add()
|
|
|
|
},
|
|
|
|
handleView (repairId) {
|
|
|
|
this.$router.push({ name: 'repairView', query: { repairId: repairId } })
|
|
|
|
},
|
|
|
|
handleEdit (record) {
|
|
|
|
this.$refs.modal.edit(record)
|
|
|
|
},
|
|
|
|
handleOk () {
|
|
|
|
this.$refs.table.refresh(true)
|
|
|
|
console.log('handleSaveOk')
|
|
|
|
},
|
|
|
|
handleComplete (id) {
|
|
|
|
const _this = this
|
|
|
|
this.$confirm({
|
|
|
|
title: '警告',
|
|
|
|
content: '确认要完成工单吗?',
|
|
|
|
okText: '是',
|
|
|
|
okType: 'warning',
|
|
|
|
cancelText: '否',
|
|
|
|
onOk () {
|
|
|
|
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-15 17:33:04 +08:00
|
|
|
onCancel () {
|
|
|
|
}
|
2024-01-23 17:05:40 +08:00
|
|
|
})
|
|
|
|
}
|
|
|
|
},
|
2024-08-15 17:33:04 +08:00
|
|
|
watch: {}
|
2024-01-23 17:05:40 +08:00
|
|
|
}
|
|
|
|
</script>
|