2024-08-19 16:50:24 +08:00
|
|
|
<template>
|
2024-08-29 16:32:54 +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-19 16:50:24 +08:00
|
|
|
</a-form-item>
|
|
|
|
</a-col>
|
2024-08-29 16:32:54 +08:00
|
|
|
<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-19 16:50:24 +08:00
|
|
|
</span>
|
|
|
|
</a-col>
|
|
|
|
</a-row>
|
|
|
|
</a-form>
|
|
|
|
</div>
|
2024-08-29 16:32:54 +08:00
|
|
|
<a-tabs :default-active-key='tabKey' @change='callback'>
|
|
|
|
<a-tab-pane key='1' tab='全部信息'>
|
2024-08-19 16:50:24 +08:00
|
|
|
<a-table
|
2024-08-29 16:32:54 +08:00
|
|
|
size='default'
|
|
|
|
rowKey='id'
|
|
|
|
:columns='columns'
|
|
|
|
:data-source='workerData'
|
2024-08-19 16:50:24 +08:00
|
|
|
>
|
2024-08-29 16:32:54 +08:00
|
|
|
<span slot='name' slot-scope='text, record'>
|
|
|
|
<a-tag color='blue'>
|
2024-08-19 16:50:24 +08:00
|
|
|
消息提示
|
|
|
|
</a-tag>
|
|
|
|
</span>
|
2024-08-29 16:32:54 +08:00
|
|
|
<span slot='content' slot-scope='text, record'>
|
|
|
|
<a @click='toRepair(record.repairId)'>{{ record.content }}</a>
|
2024-08-19 16:50:24 +08:00
|
|
|
</span>
|
2024-08-29 16:32:54 +08:00
|
|
|
<span slot='action' slot-scope='text, record'>
|
|
|
|
<a v-if='editEnabel' @click='handleView(record.id)'>详情</a>
|
|
|
|
<a-divider type='vertical' />
|
2024-08-19 16:50:24 +08:00
|
|
|
</span>
|
|
|
|
</a-table>
|
|
|
|
</a-tab-pane>
|
2024-08-29 16:32:54 +08:00
|
|
|
<a-tab-pane key='2' tab='未读通知' force-render>
|
2024-08-19 16:50:24 +08:00
|
|
|
<a-table
|
2024-08-29 16:32:54 +08:00
|
|
|
size='default'
|
|
|
|
rowKey='id'
|
|
|
|
:columns='columns'
|
|
|
|
:data-source='noReadData'
|
2024-08-19 16:50:24 +08:00
|
|
|
>
|
2024-08-29 16:32:54 +08:00
|
|
|
<span slot='name' slot-scope='text, record'>
|
|
|
|
<a-tag color='blue'>
|
2024-08-19 16:50:24 +08:00
|
|
|
消息提示
|
|
|
|
</a-tag>
|
|
|
|
</span>
|
2024-08-29 16:32:54 +08:00
|
|
|
<span slot='content' slot-scope='text, record'>
|
|
|
|
<a @click='toRepair(record.repairId)'>{{ record.content }}</a>
|
2024-08-19 16:50:24 +08:00
|
|
|
</span>
|
2024-08-29 16:32:54 +08:00
|
|
|
<span slot='action' slot-scope='text, record'>
|
|
|
|
<a v-if='editEnabel' @click='handleView(record.id)'>详情</a>
|
|
|
|
<a-divider type='vertical' />
|
2024-08-19 16:50:24 +08:00
|
|
|
</span>
|
|
|
|
</a-table>
|
|
|
|
</a-tab-pane>
|
2024-08-29 16:32:54 +08:00
|
|
|
<a-tab-pane key='3' tab='已读通知' force-render>
|
2024-08-19 16:50:24 +08:00
|
|
|
<a-table
|
2024-08-29 16:32:54 +08:00
|
|
|
size='default'
|
|
|
|
rowKey='id'
|
|
|
|
:columns='columns'
|
|
|
|
:data-source='readData'
|
2024-08-19 16:50:24 +08:00
|
|
|
>
|
2024-08-29 16:32:54 +08:00
|
|
|
<span slot='name' slot-scope='text, record'>
|
|
|
|
<a-tag color='blue'>
|
2024-08-19 16:50:24 +08:00
|
|
|
消息提示
|
|
|
|
</a-tag>
|
|
|
|
</span>
|
2024-08-29 16:32:54 +08:00
|
|
|
<span slot='content' slot-scope='text, record'>
|
|
|
|
<a @click='toRepair(record.repairId)'>{{ record.content }}</a>
|
2024-08-19 16:50:24 +08:00
|
|
|
</span>
|
2024-08-29 16:32:54 +08:00
|
|
|
<span slot='action' slot-scope='text, record'>
|
|
|
|
<a v-if='editEnabel' @click='handleView(record.id)'>详情</a>
|
|
|
|
<a-divider type='vertical' />
|
2024-08-19 16:50:24 +08:00
|
|
|
</span>
|
|
|
|
</a-table>
|
|
|
|
</a-tab-pane>
|
|
|
|
</a-tabs>
|
|
|
|
</a-card>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { STable } from '@/components'
|
|
|
|
import { getRepairRemindList } from '@/api/admin/repair/repairRemind'
|
|
|
|
import { checkPermission } from '@/utils/permissions'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'TableList',
|
|
|
|
components: {
|
|
|
|
STable
|
|
|
|
},
|
2024-08-29 16:32:54 +08:00
|
|
|
data() {
|
2024-08-19 16:50:24 +08:00
|
|
|
return {
|
2024-08-29 16:32:54 +08:00
|
|
|
tabKey: '1',
|
2024-08-19 16:50:24 +08:00
|
|
|
labelCol: {
|
|
|
|
xs: { span: 24 },
|
|
|
|
sm: { span: 5 }
|
|
|
|
},
|
|
|
|
wrapperCol: {
|
|
|
|
xs: { span: 24 },
|
|
|
|
sm: { span: 16 }
|
|
|
|
},
|
|
|
|
form: this.$form.createForm(this),
|
|
|
|
mdl: {},
|
|
|
|
// 高级搜索 展开/关闭
|
|
|
|
advanced: false,
|
|
|
|
// 查询参数
|
|
|
|
queryParam: {},
|
|
|
|
// 表头
|
|
|
|
columns: [
|
|
|
|
{
|
|
|
|
title: '提醒类型',
|
|
|
|
dataIndex: 'name',
|
|
|
|
scopedSlots: { customRender: 'name' }
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '提醒内容',
|
|
|
|
dataIndex: 'content',
|
|
|
|
scopedSlots: { customRender: 'content' }
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '时间',
|
|
|
|
dataIndex: 'createTime'
|
|
|
|
}
|
|
|
|
],
|
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
|
// loadData: parameter => {
|
|
|
|
// return getRepairList(Object.assign(parameter, this.queryParam))
|
|
|
|
// },
|
|
|
|
addEnable: checkPermission('admin:repair:add'),
|
|
|
|
editEnabel: checkPermission('admin:repair:edit'),
|
|
|
|
removeEnable: checkPermission('admin:repair:list'),
|
|
|
|
readData: [],
|
|
|
|
workerData: [],
|
|
|
|
noReadData: []
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2024-08-29 16:32:54 +08:00
|
|
|
created() {
|
|
|
|
this.tabKey = this.$route.query.tabKey
|
2024-08-19 16:50:24 +08:00
|
|
|
this.workerList()
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
// admin/repair/stats/workerList
|
2024-08-29 16:32:54 +08:00
|
|
|
workerList() {
|
2024-08-19 16:50:24 +08:00
|
|
|
getRepairRemindList().then(res => {
|
|
|
|
this.workerData = res.rows
|
|
|
|
|
|
|
|
this.noReadData = res.rows.filter(item => item.read == 0)
|
|
|
|
|
|
|
|
this.readData = res.rows.filter(item => item.read == 1)
|
|
|
|
|
|
|
|
})
|
|
|
|
},
|
2024-08-29 16:32:54 +08:00
|
|
|
callback() {
|
2024-08-19 16:50:24 +08:00
|
|
|
|
|
|
|
},
|
|
|
|
|
2024-08-29 16:32:54 +08:00
|
|
|
handleAdd() {
|
2024-08-19 16:50:24 +08:00
|
|
|
this.$refs.modal.add()
|
|
|
|
},
|
2024-08-29 16:32:54 +08:00
|
|
|
handleView(workerId) {
|
2024-08-19 16:50:24 +08:00
|
|
|
this.$router.push({ name: 'repair', query: { repairUserId: workerId } })
|
|
|
|
},
|
|
|
|
|
2024-08-29 16:32:54 +08:00
|
|
|
toRepair(repairId) {
|
2024-08-19 16:50:24 +08:00
|
|
|
this.$router.push({ name: 'repairView', query: { repairId: repairId } })
|
|
|
|
},
|
|
|
|
|
2024-08-29 16:32:54 +08:00
|
|
|
handleEdit(record) {
|
2024-08-19 16:50:24 +08:00
|
|
|
this.$refs.modal.edit(record)
|
|
|
|
},
|
2024-08-29 16:32:54 +08:00
|
|
|
handleOk() {
|
2024-08-19 16:50:24 +08:00
|
|
|
this.$refs.table.refresh(true)
|
|
|
|
console.log('handleSaveOk')
|
|
|
|
},
|
2024-08-29 16:32:54 +08:00
|
|
|
handleComplete(id) {
|
2024-08-19 16:50:24 +08:00
|
|
|
const _this = this
|
|
|
|
this.$confirm({
|
|
|
|
title: '警告',
|
|
|
|
content: '确认要完成工单吗?',
|
|
|
|
okText: '是',
|
|
|
|
okType: 'warning',
|
|
|
|
cancelText: '否',
|
2024-08-29 16:32:54 +08:00
|
|
|
onOk() {
|
2024-08-19 16:50:24 +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 16:32:54 +08:00
|
|
|
onCancel() {
|
2024-08-19 16:50:24 +08:00
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
},
|
|
|
|
watch: {}
|
|
|
|
}
|
|
|
|
</script>
|