|
|
@@ -6,33 +6,36 @@
|
|
|
<el-col :span="isLeftContentCollapsed ? 24 : 20" :xs="24">
|
|
|
<ContentWrap>
|
|
|
<!-- 搜索工作栏 -->
|
|
|
- <el-form
|
|
|
- class="-mb-15px"
|
|
|
- :model="queryParams"
|
|
|
- ref="queryFormRef"
|
|
|
- :inline="true"
|
|
|
- border
|
|
|
- label-width="68px"
|
|
|
- >
|
|
|
- <el-form-item label="姓名" prop="userName">
|
|
|
+ <el-form class="-mb-15px" :model="queryParams" ref="queryFormRef" :inline="true" border>
|
|
|
+ <el-form-item label="序号" prop="jsaXh">
|
|
|
<el-input
|
|
|
- v-model="queryParams.userName"
|
|
|
- placeholder="请输入姓名"
|
|
|
+ v-model="queryParams.jsaXh"
|
|
|
+ placeholder="请输入序号"
|
|
|
clearable
|
|
|
@keyup.enter="handleQuery"
|
|
|
- class="!w-240px"
|
|
|
+ class="!w-150px"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
|
|
|
- <el-form-item label="队伍名称" prop="deptName">
|
|
|
+ <el-form-item label="工作负责人" prop="jobDuty">
|
|
|
<el-input
|
|
|
- v-model="queryParams.deptName"
|
|
|
- placeholder="请输入队伍名称"
|
|
|
+ v-model="queryParams.jobDuty"
|
|
|
+ placeholder="请输入工作负责人"
|
|
|
clearable
|
|
|
@keyup.enter="handleQuery"
|
|
|
- class="!w-240px"
|
|
|
+ class="!w-150px"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
+
|
|
|
+ <!-- <el-form-item label="工作地点" prop="jobAddress">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.jobAddress"
|
|
|
+ placeholder="请输入工作地点"
|
|
|
+ clearable
|
|
|
+ @keyup.enter="handleQuery"
|
|
|
+ class="!w-150px"
|
|
|
+ />
|
|
|
+ </el-form-item> -->
|
|
|
<el-form-item>
|
|
|
<el-button @click="handleQuery" v-hasPermi="['rq:qhse-jsa:query']"
|
|
|
><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button
|
|
|
@@ -69,29 +72,42 @@
|
|
|
{{ scope.$index + 1 }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="项目部" align="center" prop="projectName" width="120" />
|
|
|
- <!-- <el-table-column label="部门名称" align="center" prop="deptName" /> -->
|
|
|
- <el-table-column label="队伍名称" align="center" prop="deptName" />
|
|
|
- <el-table-column
|
|
|
- label="观察日期"
|
|
|
- align="center"
|
|
|
- prop="observationDate"
|
|
|
- :formatter="dateFormatter"
|
|
|
- width="180px"
|
|
|
- />
|
|
|
|
|
|
- <el-table-column label="类型名称" align="center" prop="className" />
|
|
|
- <el-table-column label="姓名" align="center" prop="userName" />
|
|
|
- <el-table-column label="岗位" align="center" prop="post" />
|
|
|
+ <el-table-column label="序号" align="center" prop="jsaXh" />
|
|
|
+
|
|
|
+ <el-table-column label="日期" align="center" prop="jsaTime">
|
|
|
+ <template #default="{ row }">
|
|
|
+ {{ formatDate(row.jsaTime).substring(0, 10) }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="工作任务" align="center" prop="jobTask" />
|
|
|
+
|
|
|
+ <el-table-column label="工作地点" align="center" prop="jobAddress" />
|
|
|
+
|
|
|
+ <el-table-column label="工作负责人" align="center" prop="jobDuty" />
|
|
|
+
|
|
|
+ <el-table-column label="附件" align="center" prop="jsaFile">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <el-link
|
|
|
+ v-if="row.jsaFile"
|
|
|
+ :underline="false"
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ @click="viewFile(row.jsaFile)"
|
|
|
+ >查看</el-link
|
|
|
+ >
|
|
|
+ <span v-else>-</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
|
|
|
- <el-table-column label="备注" align="center" prop="remark" />
|
|
|
- <el-table-column
|
|
|
+ <el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
|
|
|
+ <!-- <el-table-column
|
|
|
label="创建时间"
|
|
|
align="center"
|
|
|
prop="createTime"
|
|
|
:formatter="dateFormatter"
|
|
|
width="180px"
|
|
|
- />
|
|
|
+ /> -->
|
|
|
|
|
|
<el-table-column label="操作" align="center" min-width="120px">
|
|
|
<template #default="scope">
|
|
|
@@ -99,7 +115,7 @@
|
|
|
link
|
|
|
type="primary"
|
|
|
@click="openForm('update', scope.row.id)"
|
|
|
- v-hasPermi="['rq:iot-soc-summary:update']"
|
|
|
+ v-hasPermi="['rq:qhse-jsa:update']"
|
|
|
>
|
|
|
编辑
|
|
|
</el-button>
|
|
|
@@ -107,7 +123,7 @@
|
|
|
link
|
|
|
type="danger"
|
|
|
@click="handleDelete(scope.row.id)"
|
|
|
- v-hasPermi="['rq:iot-soc-summary:delete']"
|
|
|
+ v-hasPermi="['rq:qhse-jsa:delete']"
|
|
|
>
|
|
|
删除
|
|
|
</el-button>
|
|
|
@@ -122,6 +138,30 @@
|
|
|
@pagination="getList"
|
|
|
/>
|
|
|
</ContentWrap>
|
|
|
+
|
|
|
+ <el-dialog v-model="dialogFileView" title="附件" width="500">
|
|
|
+ <div
|
|
|
+ v-for="(file, index) in fileList"
|
|
|
+ :key="index"
|
|
|
+ class="flex items-center justify-between mt-5"
|
|
|
+ >
|
|
|
+ <span class="file-name-text">{{ extractFileName(file) }}</span>
|
|
|
+ <div>
|
|
|
+ <el-button link type="primary" @click="viewFileInfo(file)">
|
|
|
+ <Icon icon="ep:view" class="mr-2px" />查看</el-button
|
|
|
+ >
|
|
|
+ <el-button link type="primary" @click="handleDownload(file)">
|
|
|
+ <Icon icon="ep:download" class="mr-2px" />下载</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer mt-10">
|
|
|
+ <el-button type="primary" @click="dialogFileView = false"> 确认 </el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
|
|
|
@@ -130,7 +170,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { dateFormatter } from '@/utils/formatTime'
|
|
|
+import { dateFormatter, formatDate } from '@/utils/formatTime'
|
|
|
import download from '@/utils/download'
|
|
|
import { QHSEJsaApi } from '@/api/pms/qhse/index'
|
|
|
import IotSocSummaryForm from './IotSocSummaryForm.vue'
|
|
|
@@ -149,16 +189,8 @@ const isLeftContentCollapsed = ref(false)
|
|
|
const queryParams = reactive({
|
|
|
pageNo: 1,
|
|
|
pageSize: 10,
|
|
|
- project: undefined,
|
|
|
- observationDate: [],
|
|
|
- socClass: undefined,
|
|
|
- className: undefined,
|
|
|
- userName: undefined,
|
|
|
- post: undefined,
|
|
|
- deptId: undefined,
|
|
|
- remark: undefined,
|
|
|
- createTime: [],
|
|
|
- deptName: 'test'
|
|
|
+ jsaXh: undefined,
|
|
|
+ jobDuty: undefined
|
|
|
})
|
|
|
const queryFormRef = ref() // 搜索的表单
|
|
|
const exportLoading = ref(false) // 导出的加载中
|
|
|
@@ -181,6 +213,52 @@ const handleDeptNodeClick = async (row) => {
|
|
|
getList()
|
|
|
}
|
|
|
|
|
|
+let dialogFileView = ref(false)
|
|
|
+let fileList = ref([])
|
|
|
+const viewFile = (file) => {
|
|
|
+ fileList.value = file.split(',')
|
|
|
+ dialogFileView.value = true
|
|
|
+ // window.open(file)
|
|
|
+}
|
|
|
+
|
|
|
+const viewFileInfo = (file) => {
|
|
|
+ window.open(
|
|
|
+ 'http://doc.deepoil.cc:8012/onlinePreview?url=' + encodeURIComponent(Base64.encode(file))
|
|
|
+ )
|
|
|
+}
|
|
|
+
|
|
|
+const extractFileName = (url: string): string => {
|
|
|
+ try {
|
|
|
+ // 移除查询参数和哈希
|
|
|
+ const cleanUrl = url.split('?')[0].split('#')[0]
|
|
|
+ // 获取最后一个斜杠后的内容
|
|
|
+ const parts = cleanUrl.split('/')
|
|
|
+ const fileName = parts[parts.length - 1]
|
|
|
+ // URL 解码
|
|
|
+ return decodeURIComponent(fileName) || url
|
|
|
+ } catch {
|
|
|
+ // 如果解析失败,返回原始 URL
|
|
|
+ return url
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const handleDownload = async (url) => {
|
|
|
+ try {
|
|
|
+ const response = await fetch(url)
|
|
|
+ const blob = await response.blob()
|
|
|
+ const downloadUrl = window.URL.createObjectURL(blob)
|
|
|
+
|
|
|
+ const link = document.createElement('a')
|
|
|
+ link.href = downloadUrl
|
|
|
+ link.download = url.split('/').pop() // 自动获取文件名:ml-citation{ref="3" data="citationList"}
|
|
|
+ link.click()
|
|
|
+
|
|
|
+ URL.revokeObjectURL(downloadUrl)
|
|
|
+ } catch (error) {
|
|
|
+ console.error('下载失败:', error)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
/** 搜索按钮操作 */
|
|
|
const handleQuery = () => {
|
|
|
queryParams.pageNo = 1
|
|
|
@@ -220,7 +298,7 @@ const handleExport = async () => {
|
|
|
// 发起导出
|
|
|
exportLoading.value = true
|
|
|
const data = await QHSEJsaApi.exportJsa(queryParams)
|
|
|
- download.excel(data, 'SOC卡汇总.xls')
|
|
|
+ download.excel(data, 'jsa.xls')
|
|
|
} catch {
|
|
|
} finally {
|
|
|
exportLoading.value = false
|