lin.liu 1 hete
szülő
commit
dd4d402b9a
15 módosított fájl, 246 hozzáadás és 54 törlés
  1. 11 1
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/controller/CheckRecordController.java
  2. 5 0
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/CheckRecordItemPO.java
  3. 4 0
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/vo/CheckRecordVO.java
  4. 14 0
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/response/check/ResCheckRecordDetail.java
  5. 19 0
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/response/check/ResCheckRecordItem.java
  6. 1 1
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/search/SearchCheckRecord.java
  7. 14 6
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/mapper/impl/CheckRecordItemMapperImpl.java
  8. 8 2
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/mapper/impl/CheckRecordMapperImpl.java
  9. 20 0
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/mapper/impl/GridInfoMapperImpl.java
  10. 62 5
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/service/CheckRecordService.java
  11. 20 0
      secure-producting-common/src/main/java/com/customs/cq/datacenter/common/model/LabelValueDto.java
  12. 15 6
      secure-producting-vue/src/views/check/DangerCheckRecordMine.vue
  13. 40 11
      secure-producting-vue/src/views/grid/components/MyGridAndCheck.vue
  14. 11 22
      secure-producting-vue/src/views/grid/components/SubmitDangerCheck.vue
  15. 2 0
      sql/20240814.sql

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

@@ -24,6 +24,7 @@ package com.customs.cq.datacenter.business.controller;
 
 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.response.check.ResCheckRecordDetail;
 import com.customs.cq.datacenter.business.entity.search.SearchCheckRecord;
 import com.customs.cq.datacenter.business.service.CheckRecordService;
 import com.customs.cq.datacenter.common.ExecutedResult;
@@ -76,7 +77,7 @@ public class CheckRecordController extends BasicController {
      * @description 获取[隐患检查记录]
      */
     @GetMapping(value = "get/{id}")
-    public ExecutedResult<CheckRecordVO> get(@PathVariable Long id) {
+    public ExecutedResult<ResCheckRecordDetail> get(@PathVariable Long id) {
         return this.service.get(id);
     }
 
@@ -117,4 +118,13 @@ public class CheckRecordController extends BasicController {
     public ExecutedResult<PagerResult<CheckRecordVO>> listAdminMine(@RequestBody SearchCheckRecord request) {
         return this.service.search(request, Boolean.TRUE);
     }
+
+    /**
+     * 提交到网格管理员
+     * @author lin.liu
+     */
+    @PostMapping(value = "submitAdmin/{id}")
+    public ExecutedResult<ResCheckRecordDetail> submitAdmin(@PathVariable Long id) {
+        return service.submitAdmin(id);
+    }
 }

+ 5 - 0
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/CheckRecordItemPO.java

@@ -86,6 +86,11 @@ public class CheckRecordItemPO {
 	 */
 	@TableField(value = "ITEM_NAME")
 	private String itemName;
+	/**
+	 * 检查项描述
+	 */
+	@TableField(value = "ITEM_DESCRIPTION")
+	private String itemDescription;
 	/**
 	 * 检查时间
 	 */

+ 4 - 0
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/vo/CheckRecordVO.java

@@ -39,6 +39,10 @@ import java.util.Objects;
  */
 @Data
 public class CheckRecordVO extends CheckRecordPO implements BasicVO {
+    /**
+     * 网格名称
+     */
+    private String gridName;
 
     @Override
     public String getCreateTimeView() {

+ 14 - 0
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/response/check/ResCheckRecordDetail.java

@@ -0,0 +1,14 @@
+package com.customs.cq.datacenter.business.entity.response.check;
+
+import com.customs.cq.datacenter.business.domain.vo.CheckRecordVO;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class ResCheckRecordDetail extends CheckRecordVO {
+    /**
+     * 检查项列表
+     */
+    private List<ResCheckRecordItem> listItem;
+}

+ 19 - 0
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/response/check/ResCheckRecordItem.java

@@ -0,0 +1,19 @@
+package com.customs.cq.datacenter.business.entity.response.check;
+
+import lombok.Data;
+
+@Data
+public class ResCheckRecordItem {
+    /**
+     * 检查记录-检查项id
+     */
+    private Long id;
+    /**
+     * 检查项名称
+     */
+    private String itemName;
+    /**
+     * 检查项描述
+     */
+    private String itemDescription;
+}

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

@@ -37,7 +37,7 @@ public class SearchCheckRecord extends SearchBasicDTO {
 	/**
 	 * 所属部门
 	 */
-	private List<Long> listDepartment;
+	private List<String> listDepartment;
 	/**
 	 * 关区代码
 	 */

+ 14 - 6
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/mapper/impl/CheckRecordItemMapperImpl.java

@@ -3,17 +3,19 @@ package com.customs.cq.datacenter.business.mapper.impl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.customs.cq.datacenter.business.domain.CheckRecordItemPO;
+import com.customs.cq.datacenter.business.entity.search.SearchCheckRecordItem;
+import com.customs.cq.datacenter.business.mapper.CheckRecordItemMapper;
+import com.customs.cq.datacenter.common.core.mapper.BasicMapper;
 import com.customs.cq.datacenter.common.enums.EOrderBy;
 import com.customs.cq.datacenter.common.enums.EYesOrNo;
-import com.customs.cq.datacenter.common.utils.ListUtil;
-import com.customs.cq.datacenter.common.utils.NumericUtil;
-import com.customs.cq.datacenter.common.core.mapper.BasicMapper;
 import com.customs.cq.datacenter.common.model.OrderByDTO;
 import com.customs.cq.datacenter.common.model.SearchBasicDTO;
+import com.customs.cq.datacenter.common.utils.ListUtil;
+import com.customs.cq.datacenter.common.utils.NumericUtil;
 import org.springframework.stereotype.Repository;
-import com.customs.cq.datacenter.business.entity.search.SearchCheckRecordItem;
-import com.customs.cq.datacenter.business.domain.CheckRecordItemPO;
-import com.customs.cq.datacenter.business.mapper.CheckRecordItemMapper;
+
+import java.util.List;
 
 /**
  * 隐患检查-检查项
@@ -97,4 +99,10 @@ public class CheckRecordItemMapperImpl extends BasicMapper<CheckRecordItemPO> {
         }
         return mapper.selectPage(new Page<>(search.getPage(), search.getLimit()), queryWrapper);
     }
+
+    public List<CheckRecordItemPO> list4CheckRecord(Long id) {
+        LambdaQueryWrapper<CheckRecordItemPO> queryWrapper = this.getQuery();
+        queryWrapper.eq(CheckRecordItemPO::getCheckRecordId, id);
+        return mapper.selectList(queryWrapper);
+    }
 }

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

@@ -69,8 +69,14 @@ public class CheckRecordMapperImpl extends BasicMapper<CheckRecordPO> {
         queryWrapper.in(ListUtil.isNotNullOrEmpty(search.getListGridCategory()), CheckRecordPO::getGridCategory, search.getListGridCategory());
         // 隐患分类
         queryWrapper.in(ListUtil.isNotNullOrEmpty(search.getListDangerCategory()), CheckRecordPO::getDangerCategory, search.getListDangerCategory());
-        // 所属部门
-        queryWrapper.in(ListUtil.isNotNullOrEmpty(search.getListDepartment()), CheckRecordPO::getDepartment, search.getListDepartment());
+        // 部门列表
+        if (ListUtil.isNotNullOrEmpty(search.getListDepartment())) {
+            queryWrapper.and(q -> {
+                for (String dept : search.getListDepartment()) {
+                    q.or().like(CheckRecordPO::getDepartment, "#" + dept + "#");
+                }
+            });
+        }
 
         // 关区代码
         queryWrapper.like(StringUtil.isNotNullOrEmpty(search.getCustoms()), CheckRecordPO::getCustoms, search.getCustoms());

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

@@ -9,6 +9,7 @@ import com.customs.cq.datacenter.business.mapper.GridInfoMapper;
 import com.customs.cq.datacenter.common.core.mapper.BasicMapper;
 import com.customs.cq.datacenter.common.enums.EOrderBy;
 import com.customs.cq.datacenter.common.enums.EYesOrNo;
+import com.customs.cq.datacenter.common.model.LabelValueDto;
 import com.customs.cq.datacenter.common.model.OrderByDTO;
 import com.customs.cq.datacenter.common.model.SearchBasicDTO;
 import com.customs.cq.datacenter.common.utils.ListUtil;
@@ -16,6 +17,11 @@ import com.customs.cq.datacenter.common.utils.NumericUtil;
 import com.customs.cq.datacenter.common.utils.StringUtil;
 import org.springframework.stereotype.Repository;
 
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
 /**
  * 网格信息
  * @author lin.liu
@@ -111,4 +117,18 @@ public class GridInfoMapperImpl extends BasicMapper<GridInfoPO> {
         }
         return mapper.selectPage(new Page<>(search.getPage(), search.getLimit()), queryWrapper);
     }
+
+    public Map<Long, LabelValueDto<Long>> map4Id(List<Long> listId) {
+        List<String> listColumn = new ArrayList<>();
+        listColumn.add("ID");
+        listColumn.add("GRID_NAME");
+
+        LambdaQueryWrapper<GridInfoPO> queryWrapper = this.getQuery();
+        queryWrapper.select(GridInfoPO.class, c -> listColumn.contains(c.getColumn()));
+        queryWrapper.in(GridInfoPO::getId, listId);
+        return mapper.selectMaps(queryWrapper)
+                .stream()
+                .map(c -> new LabelValueDto<>(c.get("GRID_NAME").toString(), NumericUtil.tryParseLong(c.get("ID"))))
+                .collect(Collectors.toMap(LabelValueDto::getValue, c -> c));
+    }
 }

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

@@ -29,6 +29,8 @@ import com.customs.cq.datacenter.business.domain.bo.GridCheckFormBo;
 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.checkrecorditem.ReqCreateCheckRecordItem;
+import com.customs.cq.datacenter.business.entity.response.check.ResCheckRecordDetail;
+import com.customs.cq.datacenter.business.entity.response.check.ResCheckRecordItem;
 import com.customs.cq.datacenter.business.entity.response.check.ResListGrid4User;
 import com.customs.cq.datacenter.business.entity.search.SearchCheckRecord;
 import com.customs.cq.datacenter.business.mapper.impl.*;
@@ -41,6 +43,7 @@ import com.customs.cq.datacenter.common.core.service.BasicService;
 import com.customs.cq.datacenter.common.enums.*;
 import com.customs.cq.datacenter.common.exception.ServiceException;
 import com.customs.cq.datacenter.common.helper.LoginHelper;
+import com.customs.cq.datacenter.common.model.LabelValueDto;
 import com.customs.cq.datacenter.common.model.Tuple;
 import com.customs.cq.datacenter.common.utils.*;
 import com.customs.cq.datacenter.system.mapper.SysDictDataMapper;
@@ -201,12 +204,15 @@ public class CheckRecordService extends BasicService {
         }
     }
 
-    public ExecutedResult<CheckRecordVO> get(Long id) {
-        CheckRecordVO result = new CheckRecordVO();
+    public ExecutedResult<ResCheckRecordDetail> get(Long id) {
+        ResCheckRecordDetail result = new ResCheckRecordDetail();
 
         CheckRecordPO find = dao.selectById(id);
         if (null != find) {
-            result = CopierUtil.mapTo(find, CheckRecordVO.class);
+            // 查找检查项
+            List<CheckRecordItemPO> list = checkRecordItemMapper.list4CheckRecord(id);
+            result = CopierUtil.mapTo(find, ResCheckRecordDetail.class);
+            result.setListItem(CopierUtil.mapTo(list, ResCheckRecordItem.class));
         }
         return ExecutedResult.success(result);
     }
@@ -275,8 +281,18 @@ public class CheckRecordService extends BasicService {
         IPage<CheckRecordPO> pageList = dao.search(search);
         List<CheckRecordPO> list = pageList.getRecords();
         if (ListUtil.isNotNullOrEmpty(list)) {
-            // 转换vo
-            listVo = CopierUtil.mapTo(list, CheckRecordVO.class);
+            List<Long> listGridId = list.stream().map(CheckRecordPO::getGridId).distinct()
+                    .collect(Collectors.toList());
+            Map<Long, LabelValueDto<Long>> map4Grid = gridInfoMapper.map4Id(listGridId);
+            for (CheckRecordPO item : list) {
+                // 转换vo
+                CheckRecordVO vo = CopierUtil.mapTo(item, CheckRecordVO.class);
+                vo.setGridName("");
+                if (map4Grid.containsKey(item.getGridId())) {
+                    vo.setGridName(map4Grid.get(item.getGridId()).getLabel());
+                }
+                listVo.add(vo);
+            }
         }
         PagerResult<CheckRecordVO> result = new PagerResult<>(pageList.getSize(), pageList.getCurrent(), pageList.getTotal(), listVo);
         return ExecutedResult.success(result);
@@ -410,6 +426,7 @@ public class CheckRecordService extends BasicService {
                 checkItem.setCustoms("");
                 checkItem.setCustomsName("");
                 checkItem.setItemName(c.getItemName());
+                checkItem.setItemDescription(c.getDescription());
                 checkItem.setCheckTime(0L);
                 checkItem.setCheckPerson("");
                 checkItem.setCheckResult(0);
@@ -445,4 +462,44 @@ public class CheckRecordService extends BasicService {
             throw new Exception("添加检查记录失败");
         }
     }
+
+    // 提交到网格管理员
+    public ExecutedResult<ResCheckRecordDetail> submitAdmin(Long id) {
+        LoginUser loginUser = LoginHelper.getLoginUser();
+        if (Objects.isNull(loginUser)) {
+            throw new ServiceException("尚未登陆.", EResultCode.UNAUTHORIZED.getCode());
+        }
+        // 获取用户
+        SysUser user = userMapper.selectById(loginUser.getUserId());
+
+        // 校验是否存在
+        ExecutedResult<CheckRecordPO> checkExists = this.check4Id(id);
+        if (checkExists.isFailed()) {
+            return ExecutedResult.failed(checkExists.getMsg());
+        }
+        CheckRecordPO find = checkExists.getData();
+        if (!Objects.equals(find.getStatus(), ECheckFormStatus.STAGING.getValue())) {
+            return ExecutedResult.success();
+        }
+
+        // 查询网格管理的网格员
+        List<GridPersonPO> listPerson = gridPersonMapper.list4Grid(find.getGridId());
+        if (listPerson.stream().noneMatch(c -> Objects.equals(c.getUserGuid(), user.getUserGuid()))) {
+            return ExecutedResult.failed("当前用户没有权限!");
+        }
+
+        CheckRecordPO item = new CheckRecordPO();
+        item.setId(id);
+        item.setStatus(ECheckFormStatus.SUBMITTED.getValue());
+        // 修改人信息
+        item.setUpdateBy(loginUser.getUserId().toString());
+        item.setUpdateByName(loginUser.getUsername());
+        item.setUpdateTime(LocalDateTimeUtil.getTimeStamp(LocalDateTimeUtil.nowTimeStamp()));
+
+        int result = dao.updateById(item);
+        if (result != 1) {
+            return ExecutedResult.failed("检查单提交操作失败");
+        }
+        return ExecutedResult.success();
+    }
 }

+ 20 - 0
secure-producting-common/src/main/java/com/customs/cq/datacenter/common/model/LabelValueDto.java

@@ -0,0 +1,20 @@
+package com.customs.cq.datacenter.common.model;
+
+import lombok.Data;
+
+@Data
+public class LabelValueDto<T> {
+    /**
+     * 名称
+     */
+    private String label;
+    /**
+     * 值
+     */
+    private T value;
+
+    public LabelValueDto(String label, T value) {
+        this.label = label;
+        this.value = value;
+    }
+}

+ 15 - 6
secure-producting-vue/src/views/check/DangerCheckRecordMine.vue

@@ -142,22 +142,31 @@
       @selection-change="handleSelectionChange"
       @row-dblclick="handleDetail"
     >
-      <el-table-column label="检查时间" width="96" align="center" prop="checkTimeView">
+      <el-table-column label="任务日期" width="96" align="center" prop="createTimeView">
         <template #default="scope">
-          {{ parseTime(scope.row.checkTimeView, '{y}-{m}-{d}') }}
+          {{ parseTime(scope.row.createTimeView, '{y}-{m}-{d}') }}
         </template>
       </el-table-column>
+      <el-table-column label="检查表" width="300" align="left" prop="checkFormName">
+        <template #default="scope">
+          {{ scope.row.gridName + " - " +  scope.row.checkFormName}}
+        </template>
+      </el-table-column>
+      <el-table-column label="检查时间" width="158" align="center" prop="checkTimeView" />
       <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="检查单号" width="231" align="left" prop="checkFormNo" />
+      <el-table-column label="所属部门" width="320" align="left" 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="89" align="center" prop="hasDangerTxt">
+        <template #default="scope">
+          {{ scope.row.status === 0 ? '-' : scope.row.hasDangerTxt}}
+        </template>
+      </el-table-column>
       <el-table-column label="整改期限" width="96" align="center" prop="rectifyDeadlineView">
         <template #default="scope">
           {{ parseTime(scope.row.rectifyDeadlineView, '{y}-{m}-{d}') }}

+ 40 - 11
secure-producting-vue/src/views/grid/components/MyGridAndCheck.vue

@@ -1,22 +1,29 @@
 <template>
   <div class="app-container">
     <el-card shadow="hover" header="今日隐患检查" style="margin-bottom: 5px">
-      <el-table :data="listMineGrid" stripe style="width: 100%" empty-text="当前帐号没有网格归属,请联系管理员!">
-        <el-table-column prop="checkFormName" label="检查表信息" :show-overflow-tooltip="true">
+      <el-table :data="listMineGrid" stripe style="width: 100%" empty-text="当前帐号没有待检检查表!">
+        <el-table-column label="检查表信息" prop="checkFormName" :show-overflow-tooltip="true">
           <template #default="scope">
             {{ scope.row.gridName + ' - ' + scope.row.checkFormName }}
           </template>
         </el-table-column>
-        <el-table-column prop="statusTxt" label="状态" />
+        <el-table-column label="状态" prop="statusTxt" />
         <el-table-column label="操作">
-          <template #default="scope">                                
+          <template #default="scope">
             <el-button
-              v-if="scope.row.status === 1"
+              v-if="scope.row.status === 20"
               link
-              type="primary"
+              type="info"
               icon="View"
               @click="handleDetail(scope.row)"
             >查看</el-button>
+            <el-button
+              v-if="scope.row.status === 20"
+              link
+              type="warning"
+              icon="View"
+              @click="revoke(scope.row)"
+            >撤回</el-button>
             <el-button
               v-if="scope.row.status === 0"
               link
@@ -24,6 +31,13 @@
               icon="Edit"
               @click="handleDoForm(scope.row)"
             >填报</el-button>
+            <el-button
+              v-if="scope.row.status === 10"
+              link
+              type="danger"
+              icon="Promotion"
+              @click="onSubmitAdmin(scope.row.id)"
+            >提交</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -31,7 +45,7 @@
 
     <!-- 提交检查表模态框 -->
     <el-dialog
-      title="隐患检查表"
+      :title="titleSubmit"
       v-model="showSubmitCheck"
       width="900px"
       append-to-body
@@ -42,9 +56,8 @@
             <submit-danger-check
               ref="refSubmitCheck"
               v-if="showSubmitCheck"
-              :gridId="submitItem.gridId"
-              :checkFormId="submitItem.checkFormId"
-              :checkFormName="submitItem.checkFormName"
+              :checkRecordId="submitItem.id"
+              :checkFormNo="submitItem.checkFormNo"
               @closeCallback="submitCallBack"
             ></submit-danger-check>
           </el-scrollbar>
@@ -65,6 +78,7 @@
 
 <script setup name="MyGridAndCheck">
 import { listMine } from '@/api/grid/GridIndex';
+import { submitAdmin } from '@/api/form/DangerCheckRecord';
 import SubmitDangerCheck from '@/views/grid/components/SubmitDangerCheck';
 
 const { proxy } = getCurrentInstance();
@@ -73,6 +87,7 @@ const listMineGrid = ref([]);
 const showSubmitCheck = ref(false);
 const submitItem = ref({});
 const loadingSubmitCheck = ref(false);
+const titleSubmit = ref('');
 
 /** 获取当前登录用户的网格和今日填报情况 */
 function getListPerson() {
@@ -84,9 +99,12 @@ function getListPerson() {
   });;
 }
 
-/** 指定网格-今日填报详情 */
+/** 隐患检查单-填报详情 */
 function handleDetail(row) {
 }
+/** 隐患检查单-撤回 */
+function revoke(row) {
+}
 
 /** 指定网格-填报 */
 function handleDoForm(row) {
@@ -96,6 +114,7 @@ function handleDoForm(row) {
   }
   submitItem.value = row;
   showSubmitCheck.value = true;
+  titleSubmit.value = '隐患检查单 - ' + row.checkFormNo;
 }
 
 function submitCheck() {
@@ -108,5 +127,15 @@ function submitCallBack() {
   getListPerson();
 }
 
+/** 隐患检查单,提交到网格管理员 */
+function onSubmitAdmin(id) {
+  submitAdmin(id).then((response) => {
+    getListPerson();
+  })
+  .finally(() => {
+    //createLoading.value = false;
+  });;
+}
+
 getListPerson();
 </script>

+ 11 - 22
secure-producting-vue/src/views/grid/components/SubmitDangerCheck.vue

@@ -8,7 +8,7 @@
     >
       <el-form-item label="检查表名称" prop="categoryName">
         <el-input v-model="formSubmit.id" type="hidden" />
-        {{ checkFormName }}
+        {{ formDetail.checkFormName }}
       </el-form-item>
       <el-form-item label="关区代码" prop="customs">
         <span class="form-line-left">
@@ -42,7 +42,7 @@
       </el-form-item>
       <div class="check-container">
         <el-row class="check-title">
-          <el-col :md="24" class="check-col">{{ checkFormName }}</el-col>
+          <el-col :md="24" class="check-col">{{ formDetail.checkFormName }}</el-col>
         </el-row>
         <el-row class="check-title">
           <el-col :md="2" class="check-col">序号</el-col>
@@ -66,7 +66,7 @@
             <span v-if="(item.checkResult === 1 && item.isRectify === 0)" @click="submitRectify(item)" class="opt opt-wait" title="有隐患,需要填写整改措施">待</span>
             <span>{{ item.itemName }}</span>
             </el-col>
-          <el-col :md="8" class="check-col check-item-desc" :title="item.description">{{ item.description }}</el-col>
+          <el-col :md="8" class="check-col check-item-desc" :title="item.itemDescription">{{ item.itemDescription }}</el-col>
         </el-row>
       </div>
       <el-form-item label="提交至网格管理员" prop="isSubmit">
@@ -166,26 +166,19 @@
 import { getUserProfile } from '@/api/system/user.js';
 import { getToken } from '@/utils/auth';
 import { listMine } from '@/api/grid/GridIndex';
-import { detail } from "@/api/form/DangerCheckForm";
-import { submit } from "@/api/form/DangerCheckRecord";
+import { submit, detail } from "@/api/form/DangerCheckRecord";
 import { parseTime } from '@/utils/ruoyi'
 import { getDicts } from '@/api/system/dict/data'
 
 const { proxy } = getCurrentInstance();
 
 const props = defineProps({
-    // 网格id
-    gridId: {
+    // 隐患检查单id
+    checkRecordId: {
         type: String,
         default: '',
     },
-    // 隐患检查表id
-    checkFormId: {
-        type: String,
-        default: '',
-    },
-    // 隐患检查表名称
-    checkFormName: {
+    checkFormNo: {
         type: String,
         default: '',
     }
@@ -211,8 +204,7 @@ const formDetail = ref({});
 
 const loadingSubmit = ref(false);
 const formSubmit = ref({
-  gridId: props.gridId,
-  checkFormId: props.checkFormId,
+  id: props.checkRecordId,
   customs: undefined,
   checkTime: parseTime(new Date(), '{y}-{m}-{d}'),
   checkPersonName: '',
@@ -307,9 +299,6 @@ function showRectify(item) {
 }
 /** 提交检查表 */
 function submitCheck() {
-  let that = this;
-
-  console.log(formSubmit.value);
   proxy.$refs["refFormSubmit"].validate((valid) => {
     if (valid) {
       loadingSubmit.value = true;
@@ -350,21 +339,21 @@ function initListDictData() {
 }
 /** 检查表详情 */
 function getFormDetail() {
-  detail(props.checkFormId)
+  detail(props.checkRecordId)
   .then((response) => {
     formDetail.value = response.data;
     for (let index = 0; index < response.data.listItem.length; index++) {
       let item = response.data.listItem[index];
       let value = {...item};
-      value.checkFormId = props.checkFormId;
       //value.itemName = '';
-      //value.description = '';
+      //value.itemDescription = '';
       value.checkResult = undefined;
       value.isRectify = 0;
       value.rectifyPlan = '';
       value.rectifyDeadline = 0;
       formSubmit.value.listItem.push(value);
     }
+    console.log(JSON.stringify(formSubmit.value.listItem));
   });
 }
 

+ 2 - 0
sql/20240814.sql

@@ -421,6 +421,7 @@ CREATE TABLE "SECURE_PRODUCTING"."SP_CHECK_RECORD_ITEM"(
   "CUSTOMS" VARCHAR(50) NOT NULL DEFAULT '',
   "CUSTOMS_NAME" VARCHAR(200) NOT NULL DEFAULT '',
   "ITEM_NAME" VARCHAR(200) NOT NULL DEFAULT '',
+  "ITEM_DESCRIPTION" VARCHAR(500) NOT NULL DEFAULT '',
   "CHECK_TIME" BIGINT NOT NULL DEFAULT 0,
   "CHECK_PERSON" VARCHAR(50) NOT NULL DEFAULT '',
   "CHECK_RESULT" TINYINT NOT NULL DEFAULT 0,
@@ -461,6 +462,7 @@ COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_CHECK_RECORD_ITEM"."DEPARTMENT_NAME"
 COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_CHECK_RECORD_ITEM"."CUSTOMS" IS '所属关区';
 COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_CHECK_RECORD_ITEM"."CUSTOMS_NAME" IS '关区名称';
 COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_CHECK_RECORD_ITEM"."ITEM_NAME" IS '检查项';
+COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_CHECK_RECORD_ITEM"."ITEM_DESCRIPTION" IS '检查项描述';
 COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_CHECK_RECORD_ITEM"."CHECK_TIME" IS '检查时间';
 COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_CHECK_RECORD_ITEM"."CHECK_PERSON" IS '检查人员';
 COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_CHECK_RECORD_ITEM"."CHECK_RESULT" IS '检查结果 ECheckResult';