|
|
@@ -1,102 +1,150 @@
|
|
|
<template>
|
|
|
- <ContentWrap>
|
|
|
- <!-- 搜索工作栏 -->
|
|
|
- <el-form class="-mb-15px" :model="queryParams" ref="queryFormRef" :inline="true">
|
|
|
- <el-form-item label="检测/校准日期" prop="detectDate">
|
|
|
- <el-date-picker
|
|
|
- v-model="queryParams.detectDate"
|
|
|
- value-format="YYYY-MM-DD HH:mm:ss"
|
|
|
- type="daterange"
|
|
|
- start-placeholder="开始日期"
|
|
|
- end-placeholder="结束日期"
|
|
|
- :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
|
|
- class="!w-200px"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="检测/校准机构" prop="detectOrg">
|
|
|
- <el-input
|
|
|
- v-model="queryParams.detectOrg"
|
|
|
- placeholder="请输入检测/校准机构"
|
|
|
- clearable
|
|
|
- @keyup.enter="handleQuery"
|
|
|
- class="!w-150px"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="检测/校准有效期" prop="validityPeriod">
|
|
|
- <el-date-picker
|
|
|
- v-model="queryParams.validityPeriod"
|
|
|
- value-format="YYYY-MM-DD"
|
|
|
- type="date"
|
|
|
- placeholder="选择检测/校准有效期"
|
|
|
- clearable
|
|
|
- class="!w-150px"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="校准金额" prop="detectAmount">
|
|
|
- <el-input
|
|
|
- v-model="queryParams.detectAmount"
|
|
|
- placeholder="请输入校准金额"
|
|
|
- clearable
|
|
|
- @keyup.enter="handleQuery"
|
|
|
- class="!w-150px"
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col
|
|
|
+ :class="{ leftcontent: true, collapsed: isLeftContentCollapsed }"
|
|
|
+ :span="isLeftContentCollapsed ? 0 : 4"
|
|
|
+ :xs="24"
|
|
|
+ >
|
|
|
+ <ContentWrap class="h-1/1">
|
|
|
+ <DeptTree @node-click="handleDeptNodeClick" />
|
|
|
+ </ContentWrap>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col
|
|
|
+ class="rightcontent"
|
|
|
+ :span="isLeftContentCollapsed ? 24 : 20"
|
|
|
+ :xs="24"
|
|
|
+ style="position: relative; height: 100vh"
|
|
|
+ >
|
|
|
+ <!-- 图片形式的切换按钮 -->
|
|
|
+ <div
|
|
|
+ class="toggle-button"
|
|
|
+ :style="{ left: isLeftContentCollapsed ? '0px' : '-13px' }"
|
|
|
+ @click="toggleLeftContent"
|
|
|
+ @mouseover="handleMouseOver"
|
|
|
+ @mouseout="handleMouseOut"
|
|
|
+ >
|
|
|
+ <img
|
|
|
+ :src="isLeftContentCollapsed ? hideimage : showimage"
|
|
|
+ alt="切换按钮"
|
|
|
+ class="toggle-icon"
|
|
|
/>
|
|
|
- </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')">
|
|
|
- <Icon icon="ep:plus" class="mr-5px" /> 新增
|
|
|
- </el-button>
|
|
|
- <el-button type="success" plain @click="handleExport" :loading="exportLoading">
|
|
|
- <Icon icon="ep:download" class="mr-5px" /> 导出
|
|
|
- </el-button>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </ContentWrap>
|
|
|
-
|
|
|
- <!-- 列表 -->
|
|
|
- <ContentWrap>
|
|
|
- <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
|
|
- <el-table-column label="计量器具名称" align="center" prop="measureName" />
|
|
|
- <el-table-column label="证书编码" align="center" prop="measureCertNo" />
|
|
|
- <el-table-column label="检测/校准日期" align="center" prop="detectDate">
|
|
|
- <template #default="scope">
|
|
|
- <span>{{ formatDateCorrectly(scope.row.detectDate) }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="检测/校准机构" align="center" prop="detectOrg" />
|
|
|
- <el-table-column label="检测/校准标准" align="center" prop="detectStandard" />
|
|
|
- <el-table-column label="检测/校准内容" align="center" prop="detectContent">
|
|
|
- <template #default="scope">
|
|
|
- <div v-html="scope.row.detectContent"></div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="检测/校准有效期" align="center" prop="validityPeriod" width="180px">
|
|
|
- <template #default="scope">
|
|
|
- <span>{{ formatDateCorrectly(scope.row.validityPeriod) }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="校准金额" align="center" prop="detectAmount" />
|
|
|
-
|
|
|
- <el-table-column label="部门名称" align="center" prop="deptName" />
|
|
|
- <el-table-column label="操作" align="center" min-width="120px">
|
|
|
- <template #default="scope">
|
|
|
- <el-button link type="primary" @click="openForm('update', scope.row.id)">
|
|
|
- 编辑
|
|
|
- </el-button>
|
|
|
- <el-button link type="danger" @click="handleDelete(scope.row.id)"> 删除 </el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <!-- 分页 -->
|
|
|
- <Pagination
|
|
|
- :total="total"
|
|
|
- v-model:page="queryParams.pageNo"
|
|
|
- v-model:limit="queryParams.pageSize"
|
|
|
- @pagination="getList"
|
|
|
- />
|
|
|
- </ContentWrap>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <ContentWrap>
|
|
|
+ <!-- 搜索工作栏 -->
|
|
|
+ <el-form :model="queryParams" ref="queryFormRef" :inline="true">
|
|
|
+ <el-form-item label="检测/校准日期" prop="detectDate">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="queryParams.detectDate"
|
|
|
+ value-format="YYYY-MM-DD HH:mm:ss"
|
|
|
+ type="daterange"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
|
|
+ class="!w-200px"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="检测/校准机构" prop="detectOrg">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.detectOrg"
|
|
|
+ placeholder="请输入检测/校准机构"
|
|
|
+ clearable
|
|
|
+ @keyup.enter="handleQuery"
|
|
|
+ class="!w-150px"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="检测/校准有效期" prop="validityPeriod">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="queryParams.validityPeriod"
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
+ type="date"
|
|
|
+ placeholder="选择检测/校准有效期"
|
|
|
+ clearable
|
|
|
+ class="!w-150px"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="校准金额" prop="detectAmount">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.detectAmount"
|
|
|
+ placeholder="请输入校准金额"
|
|
|
+ clearable
|
|
|
+ @keyup.enter="handleQuery"
|
|
|
+ class="!w-150px"
|
|
|
+ />
|
|
|
+ </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')">
|
|
|
+ <Icon icon="ep:plus" class="mr-5px" /> 新增
|
|
|
+ </el-button>
|
|
|
+ <el-button type="success" plain @click="handleExport" :loading="exportLoading">
|
|
|
+ <Icon icon="ep:download" class="mr-5px" /> 导出
|
|
|
+ </el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </ContentWrap>
|
|
|
+
|
|
|
+ <!-- 列表 -->
|
|
|
+ <ContentWrap>
|
|
|
+ <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
|
|
+ <el-table-column label="计量器具名称" align="center" prop="measureName" min-width="160" />
|
|
|
+ <el-table-column label="证书编码" align="center" prop="measureCertNo" min-width="160" />
|
|
|
+ <el-table-column label="检测/校准日期" align="center" prop="detectDate" width="140">
|
|
|
+ <template #default="scope">
|
|
|
+ <span class="iot-md-date">{{ formatDateCorrectly(scope.row.detectDate) }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="检测/校准机构" align="center" prop="detectOrg" min-width="160" />
|
|
|
+ <el-table-column
|
|
|
+ label="检测/校准标准"
|
|
|
+ align="center"
|
|
|
+ prop="detectStandard"
|
|
|
+ min-width="160"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ label="检测/校准内容"
|
|
|
+ align="center"
|
|
|
+ prop="detectContent"
|
|
|
+ min-width="220"
|
|
|
+ >
|
|
|
+ <template #default="scope">
|
|
|
+ <div class="detect-content" v-html="scope.row.detectContent"></div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="检测/校准有效期" align="center" prop="validityPeriod" width="140">
|
|
|
+ <template #default="scope">
|
|
|
+ <span class="iot-md-date">{{ formatDateCorrectly(scope.row.validityPeriod) }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="校准金额" align="center" prop="detectAmount" width="120" />
|
|
|
+ <el-table-column label="部门名称" align="center" prop="deptName" min-width="140" />
|
|
|
+ <el-table-column label="操作" align="center" width="140" fixed="right">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-button link type="primary" @click="openForm('update', scope.row.id)">
|
|
|
+ 编辑
|
|
|
+ </el-button>
|
|
|
+ <el-button link type="danger" @click="handleDelete(scope.row.id)"> 删除 </el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div class="iot-md-pagination">
|
|
|
+ <Pagination
|
|
|
+ :total="total"
|
|
|
+ v-model:page="queryParams.pageNo"
|
|
|
+ v-model:limit="queryParams.pageSize"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </ContentWrap>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
|
|
|
<!-- 表单弹窗:添加/修改 -->
|
|
|
<IotMeasureDetectForm ref="formRef" @success="getList" />
|
|
|
@@ -107,11 +155,16 @@ import download from '@/utils/download'
|
|
|
import { IotMeasureDetectApi, IotMeasureDetectVO } from '@/api/pms/qhse/index'
|
|
|
import IotMeasureDetectForm from './IotMeasureDetectForm.vue'
|
|
|
import { formatDate } from '@/utils/formatTime'
|
|
|
+import DeptTree from '@/views/system/user/DeptTree.vue'
|
|
|
+import hideimage from '@/assets/imgs/leftTree-hide.png'
|
|
|
+import showimage from '@/assets/imgs/leftTree-show.png'
|
|
|
/** 计量器具-检测校准明细 列表 */
|
|
|
defineOptions({ name: 'IotMeasureDetect' })
|
|
|
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
const { t } = useI18n() // 国际化
|
|
|
+const isLeftContentCollapsed = ref(false)
|
|
|
+const hoverText = ref('')
|
|
|
|
|
|
const loading = ref(true) // 列表的加载中
|
|
|
const list = ref<IotMeasureDetectVO[]>([]) // 列表的数据
|
|
|
@@ -148,6 +201,26 @@ const handleQuery = () => {
|
|
|
queryParams.pageNo = 1
|
|
|
getList()
|
|
|
}
|
|
|
+
|
|
|
+const selectedDept = ref<{ id: number; name: string }>()
|
|
|
+
|
|
|
+const handleDeptNodeClick = async (row) => {
|
|
|
+ selectedDept.value = { id: row.id, name: row.name }
|
|
|
+ queryParams.deptId = row.id
|
|
|
+ await getList()
|
|
|
+}
|
|
|
+
|
|
|
+const toggleLeftContent = () => {
|
|
|
+ isLeftContentCollapsed.value = !isLeftContentCollapsed.value
|
|
|
+}
|
|
|
+
|
|
|
+const handleMouseOver = () => {
|
|
|
+ hoverText.value = isLeftContentCollapsed.value ? '展开' : '收起'
|
|
|
+}
|
|
|
+
|
|
|
+const handleMouseOut = () => {
|
|
|
+ hoverText.value = ''
|
|
|
+}
|
|
|
const formatDateCorrectly = (timestamp) => {
|
|
|
if (!timestamp) return ''
|
|
|
|
|
|
@@ -219,3 +292,61 @@ onMounted(() => {
|
|
|
getList()
|
|
|
})
|
|
|
</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+.leftcontent {
|
|
|
+ transition: width 0.3s ease;
|
|
|
+ position: relative;
|
|
|
+}
|
|
|
+
|
|
|
+.leftcontent.collapsed {
|
|
|
+ width: 0;
|
|
|
+ overflow: hidden;
|
|
|
+}
|
|
|
+
|
|
|
+.rightcontent {
|
|
|
+ position: relative;
|
|
|
+}
|
|
|
+
|
|
|
+.toggle-button {
|
|
|
+ position: absolute;
|
|
|
+ top: 44%;
|
|
|
+ transform: translate(6%, -50%);
|
|
|
+ /* width: 18px;
|
|
|
+ height: 40px;
|
|
|
+ cursor: pointer;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ z-index: 1;
|
|
|
+
|
|
|
+ border-radius: 8px;
|
|
|
+ background-color: #f0f0f0;
|
|
|
+ transition: all 0.3s ease; */
|
|
|
+}
|
|
|
+
|
|
|
+/* 图片样式 - 保持原始尺寸 */
|
|
|
+.toggle-icon {
|
|
|
+ width: auto; /* 自动宽度 */
|
|
|
+ height: auto; /* 自动高度 */
|
|
|
+ max-width: 100%; /* 不超过容器宽度 */
|
|
|
+ max-height: 100%; /* 不超过容器高度 */
|
|
|
+ /* filter: brightness(1); */
|
|
|
+ transition: all 0.3s ease;
|
|
|
+ z-index: 999;
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
+
|
|
|
+/* 鼠标悬停时图片颜色变深 */
|
|
|
+.toggle-button:hover .toggle-icon {
|
|
|
+ filter: brightness(0.9);
|
|
|
+}
|
|
|
+
|
|
|
+/* 确保图片在容器内居中 */
|
|
|
+.toggle-button img {
|
|
|
+ display: block;
|
|
|
+ margin: auto;
|
|
|
+ width: auto;
|
|
|
+ height: auto;
|
|
|
+}
|
|
|
+</style>
|