<template>
|
<!-- 搜索 -->
|
<ContentWrap>
|
<el-form
|
class="-mb-15px"
|
:model="queryParams"
|
ref="queryFormRef"
|
:inline="true"
|
label-width="68px"
|
>
|
<el-tabs v-model="typeName" @tab-click="handleClick">
|
<el-tab-pane label="全部" name="first"/>
|
<el-tab-pane label="抄送给我" name="fifth"/>
|
<el-tab-pane label="我处理的" name="second"/>
|
<el-tab-pane label="我发起的" name="third"/>
|
</el-tabs>
|
<el-tabs v-model="activeName" @tab-click="handleClick">
|
<el-tab-pane label="全部" name="first"/>
|
<el-tab-pane label="待审核" name="fifth"/>
|
<el-tab-pane label="待处理" name="second"/>
|
<el-tab-pane label="处理中" name="third"/>
|
<el-tab-pane label="已完成" name="fourth"/>
|
</el-tabs>
|
<el-form-item label="开始时间">
|
<el-date-picker
|
size="mini"
|
v-model="queryParams.startTime"
|
format="YYYY-MM-DD HH:mm:00"
|
value-format="YYYY-MM-DD HH:mm:00"
|
type="datetime"
|
:clearable="false"
|
placeholder="选择日期时间"/>
|
</el-form-item>
|
<el-form-item label="结束时间">
|
<el-date-picker
|
size="mini"
|
v-model="queryParams.endTime"
|
format="YYYY-MM-DD HH:mm:00"
|
value-format="YYYY-MM-DD HH:mm:00"
|
type="datetime"
|
:clearable="false"
|
placeholder="选择日期时间"/>
|
</el-form-item>
|
<el-form-item label="工单类型" prop="xsmz">
|
<el-select
|
v-model="queryParams.xsmz"
|
class="!w-240px"
|
clearable
|
placeholder="请选择工单类型"
|
>
|
<el-option
|
v-for="dict in getIntDictOptions(DICT_TYPE.PMS_XSMZ)"
|
:key="dict.value"
|
:label="dict.label"
|
:value="dict.value"
|
/>
|
</el-select>
|
</el-form-item>
|
<el-form-item>
|
<el-input v-model="queryParams.orderNumber" placeholder="工单编号" clearable/>
|
</el-form-item>
|
<el-form-item>
|
<el-input v-model="queryParams.content" placeholder="工单内容" clearable/>
|
</el-form-item>
|
<el-form-item>
|
<el-button type="primary" @click="readHandle()" :disabled="disabled">批量已读</el-button>
|
</el-form-item>
|
<el-form-item>
|
<el-button @click="handleQuery">
|
<Icon icon="ep:search" class="mr-5px"/>
|
搜索
|
</el-button>
|
<el-button @click="resetQuery">
|
<Icon icon="ep:refresh" class="mr-5px"/>
|
重置
|
</el-button>
|
<el-button
|
type="primary"
|
plain
|
@click="openForm('create')"
|
v-hasPermi="['data:point:create']"
|
>
|
<Icon icon="ep:plus" class="mr-5px"/>
|
新增
|
</el-button>
|
</el-form-item>
|
</el-form>
|
</ContentWrap>
|
|
<!-- 列表 -->
|
<ContentWrap>
|
<el-table border stripe v-loading="loading" :data="list">
|
<el-table-column type="selection" header-align="center" align="center" width="50"/>
|
<!-- <el-table-column type="index" header-align="center" align="center" width="50" label="序号"/>-->
|
<el-table-column prop="statusName" header-align="center" align="center" width="80" label="状态">
|
<template #default="scope">
|
<el-tag v-if="scope.row.status === '0'" size="small" effect="dark" color="#b8d900"
|
style="border: 0px; padding-top: 1px">待处理
|
</el-tag>
|
<el-tag v-if="scope.row.status === '1'" size="small" effect="dark" color="#3290f9"
|
style="border: 0px; padding-top: 1px">处理中
|
</el-tag>
|
<el-tag v-if="scope.row.status === '2'" size="small" effect="dark" color="#00b5ad"
|
style="border: 0px; padding-top: 1px">已完成
|
</el-tag>
|
<el-tag v-if="scope.row.status === '3'" size="small" effect="dark" color="#ffb517"
|
style="border: 0px; padding-top: 1px">待审核
|
</el-tag>
|
</template>
|
</el-table-column>
|
<el-table-column prop="orderNumber" header-align="center" align="center" min-width="140"
|
label="工单编号"/>
|
<el-table-column prop="title" header-align="center" align="left" width="200" label="工单标题"/>
|
<el-table-column prop="content" header-align="center" align="left" min-width="300"
|
label="工单内容" show-overflow-tooltip/>
|
<el-table-column prop="publisherName" header-align="center" align="center" width="80"
|
label="发布人"/>
|
<el-table-column prop="assignerName" header-align="center" align="center" width="80"
|
label="办理人"/>
|
<el-table-column prop="publishTime" header-align="center" align="center" min-width="150"
|
label="发布时间"/>
|
<el-table-column prop="deadline" header-align="center" align="center" min-width="150"
|
label="截止时间"/>
|
<el-table-column prop="isTimeout" header-align="center" align="center" width="80"
|
label="是否超时">
|
<template #default="scope">
|
<el-tag v-if="scope.row.isTimeout === '0'">否</el-tag>
|
<el-tag v-if="scope.row.isTimeout === '1'" type="danger">是</el-tag>
|
</template>
|
</el-table-column>
|
<el-table-column prop="readStatus" header-align="center" align="center" width="80"
|
label="是否已读">
|
<template #default="scope">
|
<el-tag v-if="scope.row.readStatus === '0'" type="danger">否</el-tag>
|
<el-tag v-if="scope.row.readStatus === '1'">是</el-tag>
|
</template>
|
</el-table-column>
|
<el-table-column label="操作" fixed="right" header-align="center" align="center"
|
width="100" height="100%">
|
<template #default="scope">
|
<el-button type="text" size="small"
|
@click="orderTaskHandleView(scope.row.id, scope.row.orderType,scope.row.status)">
|
详情
|
</el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
<!-- 分页 -->
|
<Pagination
|
:total="total"
|
v-model:page="queryParams.pageNo"
|
v-model:limit="queryParams.pageSize"
|
@pagination="getList"
|
/>
|
</ContentWrap>
|
<!--电耗明细-->
|
<Form ref="formRef"/>
|
</template>
|
<script lang="ts" setup>
|
import {DICT_TYPE, getIntDictOptions} from '@/utils/dict'
|
import * as Task from '@/api/process/task'
|
import {ref} from "vue";
|
|
defineOptions({name: 'Task'})
|
|
const message = useMessage() // 消息弹窗
|
const {t} = useI18n() // 国际化
|
|
const loading = ref(true) // 列表的加载中
|
const total = ref(0) // 列表的总页数
|
const list = ref([]) // 列表的数据
|
const queryParams = reactive({
|
pageNo: 1,
|
pageSize: 10,
|
startDate: undefined,
|
endDate: undefined,
|
xsmz: undefined
|
})
|
const queryFormRef = ref() // 搜索的表单
|
|
/** 查询列表 */
|
const getList = async () => {
|
loading.value = true
|
try {
|
const page = await Task.getTaskPage(queryParams)
|
list.value = page.list
|
total.value = page.total
|
} finally {
|
loading.value = false
|
}
|
}
|
|
/** 搜索按钮操作 */
|
const handleQuery = () => {
|
queryParams.pageNo = 1
|
getList()
|
}
|
|
/** 查看数据操作 */
|
const chartView = ref()
|
const chartHandle = (raw: object) => {
|
chartView.value.open(raw)
|
}
|
|
/** 重置按钮操作 */
|
const resetQuery = () => {
|
queryFormRef.value.resetFields()
|
handleQuery()
|
}
|
|
/** 添加/修改操作 */
|
const formRef = ref()
|
const openForm = (type: string, id?: number) => {
|
formRef.value.open(type, id)
|
}
|
|
/** 删除按钮操作 */
|
const handleDelete = async (id: number) => {
|
try {
|
// 删除的二次确认
|
await message.delConfirm()
|
// 发起删除
|
await Task.deleteTask(id)
|
message.success(t('common.delSuccess'))
|
// 刷新列表
|
await getList()
|
} catch {
|
}
|
}
|
|
/** 初始化 **/
|
onMounted(async () => {
|
await getList()
|
})
|
</script>
|