Prechádzať zdrojové kódy

fix: 添加巡检报告列表

拎壶冲 5 mesiacov pred
rodič
commit
6fe1281cd9

+ 3 - 3
src/views/hl/check/index.vue

@@ -84,8 +84,8 @@
 import {chkcCheck, listChkc} from "@/api/check/chkc"
 import {onMounted} from "vue";
 import {Loading} from "@element-plus/icons-vue";
-import nCheckReport from "./widget/nCheckReport.vue"
 import nCheckList from "./widget/nCheckList.vue"
+import nReportList from "./widget/nReportList.vue"
 
 const checkList = ref([])
 const listData = ref([])
@@ -98,7 +98,7 @@ const checkFlag = ref(false)
 const isComponent = ref({
   visible: false,
   title: "",
-  component: nCheckReport
+  component: nReportList
 })
 
 const colors = [
@@ -121,7 +121,7 @@ const handleDialog = (action) => {
     isComponent.value = {
       visible: true,
       title: "巡检报告查看",
-      component: nCheckReport
+      component: nReportList
     }
   } else {
     isComponent.value = {

+ 1 - 2
src/views/hl/check/widget/nCheckReport.vue

@@ -20,7 +20,6 @@
 <script setup lang="ts">
 import {chkcResult} from "@/api/check/chkc"
 import axios from "axios";
-import {onMounted} from "vue";
 import { getToken } from '@/utils/auth'
 const props = defineProps({
   crId: {
@@ -54,7 +53,7 @@ const getReport = async () => {
   reportData.value = res.data.detailList
 }
 
-onMounted(()=>{
+watch(()=>props.crId,()=>{
   getReport()
 })
 

+ 62 - 0
src/views/hl/check/widget/nReportList.vue

@@ -0,0 +1,62 @@
+<template>
+  <el-table :data="tableData" border max-height="70vh">
+    <el-table-column label="#" width="80" type="index" align="center"/>
+    <el-table-column label="巡检结果" align="left" prop="checkResult"/>
+    <el-table-column label="巡检日期" align="center" prop="checkTime" width="150"/>
+    <el-table-column label="操作" align="center" width="120">
+      <template #default="{row}">
+        <el-button type="text" @click="onShowReport(row)">查看报告</el-button>
+      </template>
+    </el-table-column>
+  </el-table>
+  <pagination
+      v-show="totalNum>0"
+      :total="totalNum"
+      v-model:page="queryParams.page"
+      v-model:limit="queryParams.pageSize"
+      @pagination="getList"
+  />
+
+  <el-dialog v-model="visible" title="巡检报告" width="80%" append-to-body style="margin-top:1vh!important">
+    <n-check-report :cr-id="crId" :span-method="spanMethod"/>
+  </el-dialog>
+
+</template>
+<script setup lang="ts">
+import {listChkr} from "@/api/check/chkr"
+import {onMounted} from "vue";
+import nCheckReport from "./nCheckReport.vue"
+
+const tableData = ref([])
+const totalNum = ref(0)
+const queryParams = ref({
+  page: 1,
+  pageSize: 20
+})
+const visible = ref(false)
+const crId = ref(0)
+
+const props = defineProps({
+  spanMethod: {
+    type: Function
+  }
+})
+
+const onShowReport = (row) => {
+  crId.value = row.crId
+  visible.value = true
+}
+
+const getList = async () => {
+  const {total, rows} = await listChkr({...queryParams.value})
+  tableData.value = rows
+  totalNum.value = total
+}
+
+onMounted(() => {
+  getList()
+})
+
+</script>
+<style scoped lang="scss">
+</style>