<template>
|
<!-- 搜索 -->
|
<ContentWrap>
|
<el-form
|
class="-mb-15px"
|
:model="queryParams"
|
ref="queryFormRef"
|
:inline="true"
|
label-width="68px"
|
>
|
<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 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-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="index" header-align="center" align="center" width="50" label="序号"/>
|
<el-table-column prop="orderNumber" header-align="center" align="center" label="工单编号"/>
|
<el-table-column prop="orderTypeName" header-align="center" align="center" label="工单类型"/>
|
<el-table-column prop="operation" header-align="center" align="center" label="操作类型"/>
|
<el-table-column prop="updateByName" header-align="center" align="center" width="100" label="操作人"/>
|
<el-table-column prop="createTime" header-align="center" align="center" label="操作时间"/>
|
</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 ProcessLog from '@/api/process/log'
|
import {ref} from "vue";
|
|
defineOptions({name: 'ProcessLog'})
|
|
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 ProcessLog.getProcessLogPage(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 ProcessLog.deleteProcessLog(id)
|
message.success(t('common.delSuccess'))
|
// 刷新列表
|
await getList()
|
} catch {
|
}
|
}
|
|
/** 初始化 **/
|
onMounted(async () => {
|
await getList()
|
})
|
</script>
|