提交 | 用户 | 时间
|
5cc1d9
|
1 |
<template> |
D |
2 |
<!-- 搜索 --> |
|
3 |
<ContentWrap> |
|
4 |
<el-form |
|
5 |
class="-mb-15px" |
|
6 |
:model="queryParams" |
|
7 |
ref="queryFormRef" |
|
8 |
:inline="true" |
|
9 |
label-width="68px" |
|
10 |
> |
|
11 |
<el-form-item label="开始时间"> |
|
12 |
<el-date-picker |
|
13 |
size="mini" |
|
14 |
v-model="queryParams.startTime" |
|
15 |
format="YYYY-MM-DD HH:mm:00" |
|
16 |
value-format="YYYY-MM-DD HH:mm:00" |
|
17 |
type="datetime" |
|
18 |
:clearable="false" |
|
19 |
placeholder="选择日期时间"/> |
|
20 |
</el-form-item> |
|
21 |
<el-form-item label="结束时间"> |
|
22 |
<el-date-picker |
|
23 |
size="mini" |
|
24 |
v-model="queryParams.endTime" |
|
25 |
format="YYYY-MM-DD HH:mm:00" |
|
26 |
value-format="YYYY-MM-DD HH:mm:00" |
|
27 |
type="datetime" |
|
28 |
:clearable="false" |
|
29 |
placeholder="选择日期时间"/> |
|
30 |
</el-form-item> |
|
31 |
<el-form-item label="日志内容" prop="rznr"> |
|
32 |
<el-input |
|
33 |
v-model="queryParams.rznr" |
|
34 |
placeholder="请输入日志内容" |
|
35 |
clearable |
|
36 |
@keyup.enter="handleQuery" |
|
37 |
class="!w-240px" |
|
38 |
/> |
|
39 |
</el-form-item> |
|
40 |
<el-form-item> |
|
41 |
<el-button @click="handleQuery"> |
|
42 |
<Icon icon="ep:search" class="mr-5px" /> |
|
43 |
搜索 |
|
44 |
</el-button> |
|
45 |
<el-button @click="resetQuery"> |
|
46 |
<Icon icon="ep:refresh" class="mr-5px" /> |
|
47 |
重置 |
|
48 |
</el-button> |
|
49 |
<el-button |
|
50 |
type="primary" |
|
51 |
plain |
|
52 |
@click="openForm('create')" |
|
53 |
v-hasPermi="['data:point:create']" |
|
54 |
> |
|
55 |
<Icon icon="ep:plus" class="mr-5px" /> |
|
56 |
新增 |
|
57 |
</el-button> |
|
58 |
<el-button |
|
59 |
type="warning" |
|
60 |
plain |
|
61 |
@click="handleImport" |
|
62 |
v-hasPermi="['data:point:import']" |
|
63 |
> |
|
64 |
<Icon icon="ep:upload" /> 导入 |
|
65 |
</el-button> |
|
66 |
<el-button |
|
67 |
type="success" |
|
68 |
plain |
|
69 |
@click="handleExport" |
|
70 |
:loading="exportLoading" |
|
71 |
v-hasPermi="['data:point:export']" |
|
72 |
> |
|
73 |
<Icon icon="ep:download" />导出 |
|
74 |
</el-button> |
|
75 |
</el-form-item> |
|
76 |
</el-form> |
|
77 |
</ContentWrap> |
|
78 |
|
|
79 |
<!-- 列表 --> |
|
80 |
<ContentWrap> |
|
81 |
<el-table border stripe v-loading="loading" :data="list"> |
|
82 |
<el-table-column type="index" header-align="center" align="center" min-width="50" label="序号"/> |
|
83 |
<el-table-column prop="lsh" header-align="center" align="center" label="流水号" min-width="160"/> |
|
84 |
<el-table-column prop="rqsj" header-align="center" align="center" label="日期" min-width="100"> |
|
85 |
<template #default="scope"> |
|
86 |
{{scope.row.rqsj.substr(0, 10)}} |
|
87 |
</template> |
|
88 |
</el-table-column> |
|
89 |
<el-table-column prop="rqsj" header-align="center" align="center" label="时间" min-width="155"> |
|
90 |
<template #default="scope"> |
|
91 |
{{scope.row.rqsj.substr(10, 16)}} |
|
92 |
</template> |
|
93 |
</el-table-column> |
|
94 |
<el-table-column prop="rzlbName" header-align="center" align="center" label="日志类别" min-width="100"/> |
|
95 |
<el-table-column prop="bcName" header-align="center" align="center" label="班次" min-width="100"/> |
|
96 |
<el-table-column prop="rzbt" header-align="center" align="center" label="日志标题" min-width="150"/> |
|
97 |
<el-table-column show-overflow-tooltip prop="rznr" header-align="center" align="center" label="日志内容" min-width="300"/> |
|
98 |
<el-table-column show-overflow-tooltip prop="bz" header-align="center" align="center" label="备注" min-width="300"/> |
c3134f
|
99 |
<el-table-column label="操作" fixed="right" header-align="center" align="center" width="100"> |
5cc1d9
|
100 |
<template #default="scope"> |
D |
101 |
<el-button type="text" size="small" @click="openForm(scope.row.id)">修改</el-button> |
|
102 |
<el-button type="text" size="small" @click="handleDelete(scope.row.id)">删除</el-button> |
|
103 |
</template> |
|
104 |
</el-table-column> |
|
105 |
</el-table> |
|
106 |
<!-- 分页 --> |
|
107 |
<Pagination |
|
108 |
:total="total" |
|
109 |
v-model:page="queryParams.pageNo" |
|
110 |
v-model:limit="queryParams.pageSize" |
|
111 |
@pagination="getList" |
|
112 |
/> |
|
113 |
</ContentWrap> |
|
114 |
<!--电耗明细--> |
|
115 |
<Form ref="formRef"/> |
|
116 |
</template> |
|
117 |
<script lang="ts" setup> |
|
118 |
import * as DispatchLog from '@/api/prod/dispatchLog' |
|
119 |
import {ref} from "vue"; |
|
120 |
import download from "@/utils/download"; |
|
121 |
import form from './form.vue' |
|
122 |
|
|
123 |
defineOptions({name: 'DispatchLog'}) |
|
124 |
|
|
125 |
const message = useMessage() // 消息弹窗 |
|
126 |
const {t} = useI18n() // 国际化 |
|
127 |
|
|
128 |
const loading = ref(true) // 列表的加载中 |
|
129 |
const total = ref(0) // 列表的总页数 |
|
130 |
const list = ref([]) // 列表的数据 |
|
131 |
const queryParams = reactive({ |
|
132 |
pageNo: 1, |
|
133 |
pageSize: 10, |
|
134 |
startDate: undefined, |
|
135 |
endDate: undefined, |
|
136 |
xt: undefined |
|
137 |
}) |
|
138 |
const queryFormRef = ref() // 搜索的表单 |
|
139 |
|
|
140 |
/** 查询列表 */ |
|
141 |
const getList = async () => { |
|
142 |
loading.value = true |
|
143 |
try { |
|
144 |
const page = await DispatchLog.getDispatchLogPage(queryParams) |
|
145 |
list.value = page.list |
|
146 |
total.value = page.total |
|
147 |
} finally { |
|
148 |
loading.value = false |
|
149 |
} |
|
150 |
} |
|
151 |
|
|
152 |
/** 搜索按钮操作 */ |
|
153 |
const handleQuery = () => { |
|
154 |
queryParams.pageNo = 1 |
|
155 |
getList() |
|
156 |
} |
|
157 |
|
|
158 |
/** 查看数据操作 */ |
|
159 |
const chartView = ref() |
|
160 |
const chartHandle = (raw: object) => { |
|
161 |
chartView.value.open(raw) |
|
162 |
} |
|
163 |
|
|
164 |
/** 重置按钮操作 */ |
|
165 |
const resetQuery = () => { |
|
166 |
queryFormRef.value.resetFields() |
|
167 |
handleQuery() |
|
168 |
} |
|
169 |
|
|
170 |
/** 添加/修改操作 */ |
|
171 |
const formRef = ref() |
|
172 |
const openForm = (type: string, id?: number) => { |
|
173 |
formRef.value.open(type, id) |
|
174 |
} |
|
175 |
|
|
176 |
/** 删除按钮操作 */ |
|
177 |
const handleDelete = async (id: number) => { |
|
178 |
try { |
|
179 |
// 删除的二次确认 |
|
180 |
await message.delConfirm() |
|
181 |
// 发起删除 |
|
182 |
await DispatchLog.deleteDispatchLog(id) |
|
183 |
message.success(t('common.delSuccess')) |
|
184 |
// 刷新列表 |
|
185 |
await getList() |
|
186 |
} catch { |
|
187 |
} |
|
188 |
} |
|
189 |
/** 测点导入 */ |
|
190 |
const importFormRef = ref() |
|
191 |
const handleImport = () => { |
|
192 |
importFormRef.value.open() |
|
193 |
} |
|
194 |
|
|
195 |
/** 导出按钮操作 */ |
|
196 |
const exportLoading = ref(false) |
|
197 |
const handleExport = async () => { |
|
198 |
try { |
|
199 |
// 导出的二次确认 |
|
200 |
await message.exportConfirm() |
|
201 |
// 发起导出 |
|
202 |
exportLoading.value = true |
|
203 |
const data = await DispatchLog.exportDispatchLog(queryParams) |
|
204 |
download.excel(data, '测点列表.xlsx') |
|
205 |
} catch { |
|
206 |
} finally { |
|
207 |
exportLoading.value = false |
|
208 |
} |
|
209 |
} |
|
210 |
/** 初始化 **/ |
|
211 |
onMounted(async () => { |
|
212 |
await getList() |
|
213 |
}) |
|
214 |
</script> |