lin.liu hace 1 semana
padre
commit
9252db73fa

+ 24 - 2
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/controller/CheckRecordController.java

@@ -22,6 +22,7 @@
 */
 package com.customs.cq.datacenter.business.controller;
 
+import com.customs.cq.datacenter.business.domain.GridPersonPO;
 import com.customs.cq.datacenter.business.domain.vo.CheckRecordVO;
 import com.customs.cq.datacenter.business.entity.request.checkrecord.ReqCreateCheckRecord;
 import com.customs.cq.datacenter.business.entity.request.checkrecord.ReqModifyCheckRecord;
@@ -30,6 +31,11 @@ import com.customs.cq.datacenter.business.service.CheckRecordService;
 import com.customs.cq.datacenter.common.ExecutedResult;
 import com.customs.cq.datacenter.common.PagerResult;
 import com.customs.cq.datacenter.common.core.controller.BasicController;
+import com.customs.cq.datacenter.common.core.domain.entity.SysUser;
+import com.customs.cq.datacenter.common.core.domain.model.LoginUser;
+import com.customs.cq.datacenter.common.enums.EResultCode;
+import com.customs.cq.datacenter.common.exception.ServiceException;
+import com.customs.cq.datacenter.common.helper.LoginHelper;
 import com.customs.cq.datacenter.common.model.ReqListId;
 import com.customs.cq.datacenter.common.utils.ParameterUtil;
 import com.customs.cq.datacenter.common.validator.ParameterValidateResult;
@@ -38,6 +44,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
+import java.util.Objects;
 
 /**
  * 2010.隐患检查记录
@@ -123,7 +130,7 @@ public class CheckRecordController extends BasicController {
      */
     @PostMapping(value = "search")
     public ExecutedResult<PagerResult<CheckRecordVO>> search(@RequestBody SearchCheckRecord request) {
-        return this.service.search(request);
+        return this.service.search(request, Boolean.FALSE);
     }
 
     /**
@@ -132,6 +139,21 @@ public class CheckRecordController extends BasicController {
      */
     @PostMapping(value = "listMine")
     public ExecutedResult<PagerResult<CheckRecordVO>> listMine(@RequestBody SearchCheckRecord request) {
-        return this.service.search(request);
+        LoginUser loginUser = LoginHelper.getLoginUser();
+        if (Objects.isNull(loginUser)) {
+            throw new ServiceException("尚未登陆.", EResultCode.UNAUTHORIZED.getCode());
+        }
+        // 指定用户查询
+        request.setCheckPerson(loginUser.getUserId().toString());
+        return this.service.search(request, Boolean.FALSE);
+    }
+
+    /**
+     * 我的隐患检查(网格管理员)
+     * @author lin.liu
+     */
+    @PostMapping(value = "listAdminMine")
+    public ExecutedResult<PagerResult<CheckRecordVO>> listAdminMine(@RequestBody SearchCheckRecord request) {
+        return this.service.search(request, Boolean.TRUE);
     }
 }

+ 10 - 5
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/search/SearchCheckRecord.java

@@ -12,6 +12,16 @@ import java.util.List;
  */
 @Data
 public class SearchCheckRecord extends SearchBasicDTO {
+	/**
+	 * 检查人员
+	 * @ignore
+	 */
+	private String checkPerson;
+	/**
+	 * 网格列表
+	 * @ignore
+	 */
+	private List<Long> listGridId;
 	/**
 	 * 检查单号
 	 */
@@ -46,11 +56,6 @@ public class SearchCheckRecord extends SearchBasicDTO {
 	 * @ignore
 	 */
 	private Long checkTimeEnd;
-	/**
-	 * 检查人员
-	 * @ignore
-	 */
-	private String checkPerson;
 	/**
 	 * 检查人员名称
 	 */

+ 8 - 0
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/mapper/impl/GridPersonMapperImpl.java

@@ -120,6 +120,14 @@ public class GridPersonMapperImpl extends BasicMapper<GridPersonPO> {
         return mapper.selectMaps(where).stream().map(c -> NumericUtil.tryParseLong(c.get("GRID_ID"))).collect(Collectors.toList());
     }
 
+    public List<Long> listGrid4AdminUser(String userGuid) {
+        LambdaQueryWrapper<GridPersonPO> where = super.getQuery();
+        where.select(GridPersonPO.class, c -> c.getColumn().equals("GRID_ID"));
+        where.eq(GridPersonPO::getUserGuid, userGuid);
+        where.eq(GridPersonPO::getIsAdmin, EYesOrNo.YES.getValue());
+        return mapper.selectMaps(where).stream().map(c -> NumericUtil.tryParseLong(c.get("GRID_ID"))).collect(Collectors.toList());
+    }
+
     public List<GridPersonPO> listGridInfo4User(String userGuid) {
         LambdaQueryWrapper<GridPersonPO> where = super.getQuery();
         where.eq(GridPersonPO::getUserGuid, userGuid);

+ 16 - 10
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/service/CheckRecordService.java

@@ -222,16 +222,23 @@ public class CheckRecordService extends BasicService {
         return ExecutedResult.success(result);
     }
 
-    public ExecutedResult<PagerResult<CheckRecordVO>> search(SearchCheckRecord search) {
-        LoginUser loginUser = LoginHelper.getLoginUser();
-        if (Objects.isNull(loginUser)) {
-            throw new ServiceException("尚未登陆.", EResultCode.UNAUTHORIZED.getCode());
-        }
-        // 获取用户
-        SysUser user = userMapper.selectUserById(Long.parseLong(loginUser.getLoginId()));
-        // 获取网格员信息
-        List<GridPersonPO> listGrid = gridPersonMapper.listGridInfo4User(user.getUserGuid());
+    public ExecutedResult<PagerResult<CheckRecordVO>> search(SearchCheckRecord search, boolean isGridAdmin) {
+        List<CheckRecordVO> listVo = new ArrayList<>();
 
+        if (isGridAdmin) {
+            LoginUser loginUser = LoginHelper.getLoginUser();
+            if (Objects.isNull(loginUser)) {
+                throw new ServiceException("尚未登陆.", EResultCode.UNAUTHORIZED.getCode());
+            }
+            // 获取用户
+            SysUser user = userMapper.selectUserById(Long.parseLong(loginUser.getLoginId()));
+            // 获取当前登录用户是网格管理员的网格id
+            List<Long> listGrid = gridPersonMapper.listGrid4AdminUser(user.getUserGuid());
+            if (ListUtil.isNullOrEmpty(listGrid)) {
+                return ExecutedResult.success(new PagerResult<>(search.getLimit(), search.getPage(), 0L, listVo));
+            }
+            search.setListGridId(listGrid);
+        }
         // 处理创建时间范围-查询参数
         Tuple<String, String> createTimeRange = ParameterUtil.getTimeRange(search.getCreateTimeRange());
         if (StringUtil.isNotNullOrEmpty(createTimeRange.getItem1())) {
@@ -250,7 +257,6 @@ public class CheckRecordService extends BasicService {
         }
 
         IPage<CheckRecordPO> pageList = dao.search(search);
-        List<CheckRecordVO> listVo = new ArrayList<>();
         List<CheckRecordPO> list = pageList.getRecords();
         if (ListUtil.isNotNullOrEmpty(list)) {
             // 转换vo

+ 13 - 13
secure-producting-common/src/main/java/com/customs/cq/datacenter/common/PagerResult.java

@@ -13,11 +13,11 @@ public class PagerResult<T> {
     /**
      * 页大小(每页返回的记录条数)
      **/
-    private Long limit = 10L;
+    private Number limit = 10L;
     /**
      * 页号(第几页, 从1开始)
      **/
-    private Long page = 1L;
+    private Number page = 1L;
     /**
      * 记录总条数
      **/
@@ -41,29 +41,29 @@ public class PagerResult<T> {
      * @param total 记录总条数
      * @param list 数据包
      */
-    public PagerResult(Long limit, Long page, Number total, List<T> list) {
+    public PagerResult(Number limit, Number page, Number total, List<T> list) {
         this.limit = limit;
         this.page = page;
         this.total = total;
         this.list = list;
     }
 
-    public Long getLimit() {
+    public Number getLimit() {
         return limit;
     }
-    public void setLimit(Long limit) {
+    public void setLimit(Number limit) {
         this.limit = limit;
     }
 
-    public Long getPage() {
+    public Number getPage() {
         return page;
     }
 
-    public void setPage(Long page) {
+    public void setPage(Number page) {
         this.page = page;
     }
 
-    public Long getTotal() {
+    public Number getTotal() {
         return total.longValue();
     }
 
@@ -82,9 +82,9 @@ public class PagerResult<T> {
     /**
      * 总页数
      */
-    public Long getTotalPage() {
-        Long page = this.total.longValue() / this.limit;
-        if(this.total.longValue() % this.limit != 0){
+    public Number getTotalPage() {
+        Long page = this.total.longValue() / this.limit.longValue();
+        if(this.total.longValue() % this.limit.longValue() != 0){
             page++;
         }
         return page;
@@ -94,13 +94,13 @@ public class PagerResult<T> {
      * 是否还有上一页
      */
     public boolean getIsHasPrePage() {
-        return this.getPage() > 1;
+        return this.getPage().longValue() > 1L;
     }
 
     /**
      * 是否还有下一页
      */
     public boolean getIsHasNextPage() {
-        return this.getPage() < this.getTotalPage().intValue();
+        return this.getPage().longValue() < this.getTotalPage().longValue();
     }
 }

+ 18 - 0
secure-producting-vue/src/api/form/DangerCheckRecord.js

@@ -34,3 +34,21 @@ export function modify(data) {
     data: data
   })
 }
+
+// 我的隐患检查
+export function listMine(data) {
+  return request({
+    url: '/checkRecord/listMine',
+    method: 'post',
+    data: data
+  })
+}
+
+// 我的隐患检查(网格管理员)
+export function listAdminMine(data) {
+  return request({
+    url: '/checkRecord/listAdminMine',
+    method: 'post',
+    data: data
+  })
+}

+ 7 - 1
secure-producting-vue/src/router/index.js

@@ -245,7 +245,13 @@ export const dynamicRoutes = [
         path: 'dangerCheckRecord',
         component: () => import('@/views/form/DangerCheckRecord'),
         name: 'DangerCheckRecord',
-        meta: { title: '隐患检查表', activeMenu: '/form/dangerCheckRecord' }
+        meta: { title: '检查记录', activeMenu: '/check/dangerCheckRecord' }
+      },
+      {
+        path: 'dangerCheckRecordMine',
+        component: () => import('@/views/check/DangerCheckRecordMine'),
+        name: 'DangerCheckRecordMine',
+        meta: { title: '我的检查', activeMenu: '/check/dangerCheckRecordMine' }
       }
     ]
   },

+ 562 - 0
secure-producting-vue/src/views/check/DangerCheckRecordMine.vue

@@ -0,0 +1,562 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryRef" :inline="true">
+      <el-form-item label="检查单号" prop="checkFormNo">
+        <el-input
+          v-model="queryParams.checkFormNo"
+          placeholder="请输入"
+          clearable
+          style="width: 200px"
+          @keyup.enter="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="关区代码" prop="customs">
+        <el-input
+          v-model="queryParams.customs"
+          placeholder="请输入"
+          clearable
+          style="width: 200px"
+          @keyup.enter="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="检查时间">
+        <el-date-picker
+          v-model="dateRangeCheckTime"
+          value-format="YYYY-MM-DD HH:mm:ss"
+          type="daterange"
+          range-separator="-"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          :default-time="[
+            new Date(2000, 1, 1, 0, 0, 0),
+            new Date(2000, 1, 1, 23, 59, 59),
+          ]"
+          style="width:240px"
+        ></el-date-picker>
+      </el-form-item>
+      <el-form-item label="检查单状态" prop="listStatus">
+        <el-select
+          v-model="queryParams.listStatus"
+          multiple
+          clearable
+          placeholder="请选择"
+          style="max-width:240px"
+        >
+          <el-option
+            v-for="item in checkFormStatusList"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="检查人员" prop="checkPersonName">
+        <el-input
+          v-model="queryParams.checkPersonName"
+          placeholder="请输入"
+          clearable
+          style="width:200px"
+          @keyup.enter="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="是否有隐患" prop="hasDanger">
+        <el-radio-group v-model="queryParams.hasDanger">
+          <el-radio :label="0">无隐患</el-radio>
+          <el-radio :label="1">有隐患</el-radio>
+        </el-radio-group>
+      </el-form-item>
+      <el-form-item label="网格类型" prop="ListGridCategory">
+        <el-select
+          v-model="queryParams.ListGridCategory"
+          multiple
+          clearable
+          placeholder="请选择"
+          style="max-width:240px"
+        >
+          <el-option
+            v-for="item in gridCategoryList"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="隐患分类" prop="listDangerCategory">
+        <el-select
+          v-model="queryParams.listDangerCategory"
+          multiple
+          clearable
+          placeholder="请选择"
+          style="max-width:240px"
+        >
+          <el-option
+            v-for="item in dangerCategoryList"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="所属部门" prop="listDepartment">
+        <el-tree-select
+          v-model="queryParams.listDepartment"
+          :data="deptOptions"
+          multiple
+          clearable
+          collapse-tags
+          collapse-tags-tooltip
+          :max-collapse-tags="3"
+          check-strictly
+          :props="{ value: 'id', label: 'label', children: 'children' }"
+          style="width:220px"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="search" @click="handleQuery">搜索</el-button>
+        <el-button icon="Refresh" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8" v-if="false">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="Plus"
+          @click="handleAdd"
+          >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="Edit"
+          :disabled="single"
+          @click="handleUpdate"
+          >修改</el-button>
+      </el-col>
+    </el-row>
+
+    <el-table
+      :data="dataList"
+      @selection-change="handleSelectionChange"
+      @row-dblclick="handleDetail"
+    >
+      <el-table-column label="检查时间" width="96" align="center" prop="checkTimeView">
+        <template #default="scope">
+          {{ parseTime(scope.row.checkTimeView, '{y}-{m}-{d}') }}
+        </template>
+      </el-table-column>
+      <el-table-column label="状态" width="60" align="center" prop="status">
+        <template #default="scope">
+          {{ getStatusTxt(scope.row.status) }}
+        </template>
+      </el-table-column>
+      <el-table-column label="检查单号" width="231" align="center" prop="checkFormNo" />
+      <el-table-column label="检查表名称" width="300" align="left" prop="checkFormName" />
+      <el-table-column label="所属部门" align="center" prop="departmentTxt" />
+      <el-table-column label="所属关区" align="center" prop="customsName" />
+      <el-table-column label="检查人员" align="center" prop="checkPersonName" />
+      <el-table-column label="是否有隐患" width="89" align="center" prop="hasDangerTxt" />
+      <el-table-column label="整改期限" width="96" align="center" prop="rectifyDeadlineView">
+        <template #default="scope">
+          {{ parseTime(scope.row.rectifyDeadlineView, '{y}-{m}-{d}') }}
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="操作"
+        align="center"
+        width="150"
+        fixed="right"
+        class-name="small-padding fixed-width"
+      >
+        <template #default="scope">
+          <el-button
+            link
+            type="primary"
+            @click="handleDetail(scope.row)"
+            >详情</el-button>
+          <el-button
+            link
+            type="primary"
+            icon="Edit"
+            @click="handleUpdate(scope.row)"
+            >修改</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      v-model:page="queryParams.page"
+      v-model:limit="queryParams.limit"
+      @pagination="getList"
+    />
+
+  <!-- 添加对话框 -->
+  <el-dialog
+    :title="title"
+    v-model="dialogOpenCreate"
+    width="750px"
+    append-to-body
+  >
+    <el-form
+      ref="formCrateRef"
+      :model="formCreate"
+      :rules="rulesCreate"
+      label-width="135px"
+    >
+      <el-form-item label="分类名称" prop="categoryName">
+        <el-input v-model="formCreate.categoryName" placeholder="请输入分类名称" />
+      </el-form-item>
+      <el-form-item label="检查频率" prop="checkCycle">
+        <el-select
+          v-model="formCreate.checkCycle"
+          placeholder="请选择"
+          style="width: 240px"
+        >
+          <el-option
+            v-for="item in checkCycleList"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="描述" prop="description">
+        <el-input v-model="formCreate.description" type="textarea" :autosize="{ minRows: 2, maxRows: 4 }" placeholder="请输入描述" />
+      </el-form-item>
+    </el-form>
+    <template #footer>
+      <div class="dialog-footer">
+        <el-button
+          :loading="createLoading"
+          type="primary"
+          @click="submitCreate"
+          >确 定</el-button>
+        <el-button @click="cancelCreate">取 消</el-button>
+      </div>
+    </template>
+  </el-dialog>
+
+  <!-- 修改对话框 -->
+  <el-dialog
+    :title="title"
+    v-model="dialogOpenModify"
+    width="750px"
+    append-to-body
+  >
+    <el-form
+      :disabled="isDetail"
+      ref="formModifyRef"
+      :model="formModify"
+      :rules="rulesModify"
+      label-width="135px"
+    >
+      <el-form-item label="分类名称" prop="categoryName">
+        <el-input v-model="formModify.id" type="hidden" />
+        <el-input v-model="formModify.categoryName" placeholder="请输入分类名称" />
+      </el-form-item>
+      <el-form-item label="检查频率" prop="checkCycle">
+        <el-select
+          v-model="formModify.checkCycle"
+          placeholder="请选择"
+          style="width: 240px"
+        >
+          <el-option
+            v-for="item in checkCycleList"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="描述" prop="description">
+        <el-input v-model="formModify.description" type="textarea" :autosize="{ minRows: 2, maxRows: 4 }" placeholder="请输入描述" />
+      </el-form-item>
+    </el-form>
+    <template #footer>
+      <div class="dialog-footer">
+        <el-button
+          v-if="isDetail === false"
+          :loading="modifyLoading"
+          type="primary"
+          @click="submitModify"
+          >确 定</el-button>
+        <el-button @click="cancelModify">{{cancelModifyTxt}}</el-button>
+        <el-button type="primary" v-if="isDetail" @click="changeModify">编 辑</el-button>
+      </div>
+    </template>
+  </el-dialog>
+  </div>
+</template>
+
+<script setup name="DangerCheckRecordMine">
+import { deptTreeSelect } from "@/api/system/user";
+import { listAllGridCategory } from "@/api/grid/GridCategory";
+import { listAllDangerCategory } from "@/api/danger/DangerCategory";
+import { listEnumValue } from "@/api/system/base"
+import {
+  submit, detail, modify, listMine, listAdminMine
+} from "@/api/form/DangerCheckRecord";
+import { parseTime } from "@/utils/ruoyi"
+
+const { proxy } = getCurrentInstance();
+
+const getAdminList = ref(false);
+
+const deptOptions = ref(undefined);
+const gridCategoryList = ref([]);
+const dangerCategoryList = ref([]);
+const checkFormStatusList = ref([]);
+const dataList = ref([]);
+
+const createLoading = ref(false);
+const dialogOpenCreate = ref(false);
+
+const modifyLoading = ref(false);
+const dialogOpenModify = ref(false);
+
+const total = ref(0);
+const dateRangeCheckTime = ref([]);
+const ids = ref([]);
+const single = ref(true);
+const multiple = ref(true);
+const title = ref("");
+const cancelModifyTxt = ref("取 消");
+const isDetail = ref(false);
+
+const queryParams = ref({
+  page: 1,
+  limit: 10,
+  listStatus: undefined,
+  checkTimeRange: "",
+  checkFormNo: undefined,
+  ListGridCategory: undefined,
+  listDangerCategory: undefined,
+  listDepartment: undefined,
+  customs: undefined,
+  hasDanger: undefined
+});
+
+const formCreate = ref({});
+const rulesCreate = ref({
+  categoryName: [
+    { required: true, message: "分类名称不能为空", trigger: "blur" },
+    { max: 100, message: '分类名称字符长度不能超过100', trigger: 'blur' }
+  ],
+  description: [{ max: 200, message: '分类描述字符长度不能超过200', trigger: 'blur' }],
+});
+
+const formModify = ref({});
+const rulesModify = ref({
+  categoryName: [
+    { required: true, message: "分类名称不能为空", trigger: "blur" },
+    { max: 100, message: '分类名称字符长度不能超过1200', trigger: 'blur' }
+  ],
+  description: [{ max: 200, message: '分类描述字符长度不能超过500', trigger: 'blur' }],
+});
+
+
+
+/** 查询列表 */
+function getList() {
+  if (
+    dateRangeCheckTime &&
+    dateRangeCheckTime.value &&
+    dateRangeCheckTime.value[0]
+  ) {
+    queryParams.value.checkTimeRange = dateRangeCheckTime.value.join(" ~ ");
+  }
+  if (getAdminList.value) {
+    listAdminMine(queryParams.value).then((response) => {
+        dataList.value = response.data.list;
+        total.value = response.data.total;
+    });
+  } else {
+    listMine(queryParams.value).then((response) => {
+        dataList.value = response.data.list;
+        total.value = response.data.total;
+    });
+  }
+};
+/** 搜索按钮操作 */
+function handleQuery() {
+  queryParams.value.page = 1;
+  getList();
+}
+/** 重置按钮操作 */
+function resetQuery() {
+  dateRangeCheckTime.value = [];
+  proxy.resetForm("queryRef");
+  handleQuery();
+}
+/** 选择条数  */
+function handleSelectionChange(selection) {
+  ids.value = selection.map((item) => item.id);
+  single.value = selection.length != 1;
+  multiple.value = !selection.length;
+}
+/** 取消新增按钮 */
+function cancelCreate() {
+  dialogOpenCreate.value = false;
+  resetCreate();
+}
+/** 新增表单重置 */
+function resetCreate() {
+  formCreate.value = {
+    categoryName: undefined,
+    description: undefined,
+  };
+  proxy.resetForm("formCrateRef");
+}
+/** 新增按钮 */
+function handleAdd() {
+  resetCreate();
+  dialogOpenCreate.value = true;
+  title.value = "提交隐患检查";
+}
+/** 新增提交 */
+function submitCreate() {
+  proxy.$refs["formCrateRef"].validate((valid) => {
+    if (valid) {
+      createLoading.value = true;
+
+      create(formCreate.value)
+        .then((response) => {
+          proxy.$modal.msgSuccess("提交成功");
+          dialogOpenCreate.value = false;
+          getList();
+        })
+        .finally(() => {
+          createLoading.value = false;
+        });
+    }
+  });
+}
+/** 取消编辑按钮 */
+function cancelModify() {
+  dialogOpenModify.value = false;
+  resetModify();
+}
+/** 编辑表单重置 */
+function resetModify() {
+  formModify.value = {
+    id: undefined,
+    categoryName: undefined,
+    description: undefined,
+  };
+  proxy.resetForm("formModifyRef");
+}
+/** 详情按钮 */
+function handleDetail(row) {
+  modifyLoading.value = true;
+  resetModify();
+  const id = row.id || ids.value[0];
+  detail(id).then((response) => {
+    isDetail.value = true;
+    modifyLoading.value = false;
+
+    formModify.value = response.data;
+    formModify.value.checkCycle = formModify.value.checkCycle + '';
+
+    dialogOpenModify.value = true;
+    title.value = "隐患检查单";
+    cancelModifyTxt.value = '关 闭';
+  });
+}
+/** 详情编辑 */
+function changeModify() {
+  isDetail.value = false;
+  title.value = "修改隐患检查单";
+}
+/** 修改按钮 */
+function handleUpdate(row) {
+  modifyLoading.value = true;
+  resetModify();
+  const id = row.id || ids.value[0];
+  detail(id).then((response) => {
+    isDetail.value = false;
+    modifyLoading.value = false;
+
+    formModify.value = response.data;
+    formModify.value.checkCycle = formModify.value.checkCycle + '';
+
+    dialogOpenModify.value = true;
+    title.value = "修改隐患检查单";
+    cancelModifyTxt.value = '取 消';
+  });
+}
+/** 修改提交 */
+function submitModify() {
+  proxy.$refs["formModifyRef"].validate((valid) => {
+    if (valid) {
+      modifyLoading.value = true;
+
+      modify(formModify.value)
+        .then((response) => {
+          proxy.$modal.msgSuccess("修改成功");
+          dialogOpenModify.value = false;
+          getList();
+        })
+        .finally(() => {
+          modifyLoading.value = false;
+        });
+    }
+  });
+}
+
+
+function getStatusTxt(status) {
+  let find = checkFormStatusList.value.find(c => parseInt(c.value) === status);
+  if (find) {
+    return find.label;
+  }
+  return '未知';
+}
+
+
+
+/** 获取检查单状态下拉树结构 */
+function getCheckFormStatus() {  
+  listEnumValue('ECheckFormStatus').then(response => {
+    checkFormStatusList.value = response.data;
+  });
+};
+/** 查询部门下拉树结构 */
+function getDeptTree() {
+  deptTreeSelect().then(response => {
+    deptOptions.value = response.data;
+  });
+};
+/** 初始化网格类型下拉框数据 */
+function initListGridCategory() {
+  listAllGridCategory().then((response) => {
+    gridCategoryList.value = response.data;
+  });
+}
+/** 初始化隐患分类下拉框数据 */
+function initListDangerCategory() {
+  listAllDangerCategory().then((response) => {
+    dangerCategoryList.value = response.data;
+  });
+}
+
+
+
+// 调用获取检查单状态下拉树结构
+getCheckFormStatus();
+// 调用初始化部门下拉框数据
+getDeptTree();
+// 调用初始化网格类型下拉框数据
+initListGridCategory();
+// 调用初始化隐患分类下拉框数据
+initListDangerCategory();
+
+/** 页面加载完毕 */
+onMounted(async () => {
+  // 获取列表数据
+  getList();
+});
+</script>