lin.liu 1 неделя назад
Родитель
Сommit
76d10319af
16 измененных файлов с 463 добавлено и 280 удалено
  1. 20 0
      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/CheckRecordPO.java
  3. 0 5
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/CheckRevokePO.java
  4. 6 1
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/bo/GridCheckFormBo.java
  5. 14 0
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/vo/CheckRecordVO.java
  6. 4 0
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/response/check/ResCheckRecordItem.java
  7. 15 0
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/entity/response/check/ResListGrid4User.java
  8. 5 1
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/mapper/impl/CheckRecordMapperImpl.java
  9. 14 6
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/mapper/impl/CheckRevokeMapperImpl.java
  10. 126 1
      secure-producting-business/src/main/java/com/customs/cq/datacenter/business/service/CheckRecordService.java
  11. 1 0
      secure-producting-common/src/main/java/com/customs/cq/datacenter/common/model/ReqAudit.java
  12. 18 0
      secure-producting-vue/src/api/form/DangerCheckRecord.js
  13. 103 224
      secure-producting-vue/src/views/check/DangerCheckRecordMine.vue
  14. 118 31
      secure-producting-vue/src/views/grid/components/MyGridAndCheck.vue
  15. 12 11
      secure-producting-vue/src/views/grid/components/SubmitDangerCheck.vue
  16. 2 0
      sql/20240814.sql

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

@@ -30,7 +30,9 @@ 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.model.ReqAudit;
 import com.customs.cq.datacenter.common.model.ReqListId;
+import com.customs.cq.datacenter.common.model.ReqOperator;
 import com.customs.cq.datacenter.common.validator.ParameterValidateResult;
 import com.customs.cq.datacenter.common.validator.ParameterValidator;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -127,4 +129,22 @@ public class CheckRecordController extends BasicController {
     public ExecutedResult<ResCheckRecordDetail> submitAdmin(@PathVariable Long id) {
         return service.submitAdmin(id);
     }
+
+    /**
+     * 检查单撤回申请
+     * @author lin.liu
+     */
+    @PostMapping(value = "revoke")
+    public ExecutedResult<String> revoke(@RequestBody ReqOperator request) {
+        return service.revoke(request);
+    }
+
+    /**
+     * 检查单撤回审核
+     * @author lin.liu
+     */
+    @PostMapping(value = "revokeAudit")
+    public ExecutedResult<String> revokeAudit(@RequestBody ReqAudit request) {
+        return service.revokeAudit(request);
+    }
 }

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

@@ -141,6 +141,11 @@ public class CheckRecordPO {
 	 */
 	@TableField(value = "STATUS")
 	private Integer status;
+	/**
+	 * 撤回申请状态 EApprovalState
+	 */
+	@TableField(value = "REVOKE_STATUS")
+	private Integer revokeStatus;
 	/**
 	 * 备注
 	 */

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

@@ -81,11 +81,6 @@ public class CheckRevokePO {
 	 */
 	@TableField(value = "AUDITOR_NAME")
 	private String auditorName;
-	/**
-	 * 审核结果
-	 */
-	@TableField(value = "AUDIT_RESULT")
-	private Integer auditResult;
 	/**
 	 * 审核时间
 	 */

+ 6 - 1
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/domain/bo/GridCheckFormBo.java

@@ -38,8 +38,12 @@ public class GridCheckFormBo implements Serializable {
      * 状态 ECheckFormStatus
      */
     private Integer status;
+    /**
+     * 撤回申请状态 EApprovalState
+     */
+    private Integer revokeStatus;
 
-    public GridCheckFormBo(Long id, String checkFormNo, Long gridId, Long dangerCategory, Long checkFormId, String checkFormName, Long createTime, Integer status) {
+    public GridCheckFormBo(Long id, String checkFormNo, Long gridId, Long dangerCategory, Long checkFormId, String checkFormName, Long createTime, Integer status, Integer revokeStatus) {
         this.id = id;
         this.checkFormNo = checkFormNo;
         this.gridId = gridId;
@@ -48,5 +52,6 @@ public class GridCheckFormBo implements Serializable {
         this.checkFormName = checkFormName;
         this.createTime = createTime;
         this.status = status;
+        this.revokeStatus = revokeStatus;
     }
 }

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

@@ -24,6 +24,8 @@ package com.customs.cq.datacenter.business.domain.vo;
 
 import com.customs.cq.datacenter.business.domain.CheckRecordPO;
 import com.customs.cq.datacenter.common.core.vo.BasicVO;
+import com.customs.cq.datacenter.common.enums.EApprovalState;
+import com.customs.cq.datacenter.common.enums.ECheckFormStatus;
 import com.customs.cq.datacenter.common.enums.EYesOrNo;
 import com.customs.cq.datacenter.common.utils.LocalDateTimeUtil;
 import com.customs.cq.datacenter.common.utils.NumericUtil;
@@ -91,4 +93,16 @@ public class CheckRecordVO extends CheckRecordPO implements BasicVO {
     public String getHasDangerTxt() {
         return EYesOrNo.getByValue(this.getHasDanger()).getDesc();
     }
+
+    public String getStatusTxt() {
+        return ECheckFormStatus.getByValue(this.getStatus()).getDesc();
+    }
+
+    public String getRevokeStatusTxt() {
+        EApprovalState status = EApprovalState.getByValue(this.getRevokeStatus());
+        if (Objects.isNull(status)) {
+            return "未申请";
+        }
+        return status.getDesc();
+    }
 }

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

@@ -16,4 +16,8 @@ public class ResCheckRecordItem {
      * 检查项描述
      */
     private String itemDescription;
+    /**
+     * 检查结果 ECheckResult
+     */
+    private Integer checkResult;
 }

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

@@ -1,8 +1,11 @@
 package com.customs.cq.datacenter.business.entity.response.check;
 
+import com.customs.cq.datacenter.common.enums.EApprovalState;
 import com.customs.cq.datacenter.common.enums.ECheckFormStatus;
 import lombok.Data;
 
+import java.util.Objects;
+
 @Data
 public class ResListGrid4User {
     /**
@@ -33,8 +36,20 @@ public class ResListGrid4User {
      * 检查单状态
      */
     private Integer status;
+    /**
+     * 撤回申请状态 EApprovalState
+     */
+    private Integer revokeStatus;
 
     public String getStatusTxt() {
         return ECheckFormStatus.getByValue(this.getStatus()).getDesc();
     }
+
+    public String getRevokeStatusTxt() {
+        EApprovalState status = EApprovalState.getByValue(this.getRevokeStatus());
+        if (Objects.isNull(status)) {
+            return "未申请";
+        }
+        return status.getDesc();
+    }
 }

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

@@ -69,6 +69,8 @@ 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.getListGridId()), CheckRecordPO::getGridId, search.getListGridId());
         // 部门列表
         if (ListUtil.isNotNullOrEmpty(search.getListDepartment())) {
             queryWrapper.and(q -> {
@@ -145,6 +147,7 @@ public class CheckRecordMapperImpl extends BasicMapper<CheckRecordPO> {
         listColumn.add("CHECK_FORM_NAME");
         listColumn.add("CREATE_TIME");
         listColumn.add("STATUS");
+        listColumn.add("REVOKE_STATUS");
 
         LambdaQueryWrapper<CheckRecordPO> where = super.getQuery();
         where.select(CheckRecordPO.class, c -> listColumn.contains(c.getColumn()));
@@ -161,7 +164,8 @@ public class CheckRecordMapperImpl extends BasicMapper<CheckRecordPO> {
                 NumericUtil.tryParseLong(c.get("CHECK_FORM_ID")),
                 c.get("CHECK_FORM_NAME").toString(),
                 NumericUtil.tryParseLong(c.get("CREATE_TIME")),
-                NumericUtil.tryParseInt(c.get("STATUS"))
+                NumericUtil.tryParseInt(c.get("STATUS")),
+                NumericUtil.tryParseInt(c.get("REVOKE_STATUS"))
         )).collect(Collectors.toList());
     }
 

+ 14 - 6
secure-producting-business/src/main/java/com/customs/cq/datacenter/business/mapper/impl/CheckRevokeMapperImpl.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.CheckRevokePO;
+import com.customs.cq.datacenter.business.entity.search.SearchCheckRevoke;
+import com.customs.cq.datacenter.business.mapper.CheckRevokeMapper;
+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.SearchCheckRevoke;
-import com.customs.cq.datacenter.business.domain.CheckRevokePO;
-import com.customs.cq.datacenter.business.mapper.CheckRevokeMapper;
+
+import java.util.List;
 
 /**
  * 隐患检查单撤回申请
@@ -97,4 +99,10 @@ public class CheckRevokeMapperImpl extends BasicMapper<CheckRevokePO> {
         }
         return mapper.selectPage(new Page<>(search.getPage(), search.getLimit()), queryWrapper);
     }
+
+    public List<CheckRevokePO> list4CheckRecord(Long checkRecordId) {
+        LambdaQueryWrapper<CheckRevokePO> where = this.getQuery();
+        where.eq(CheckRevokePO::getCheckRecordId, checkRecordId);
+        return mapper.selectList(where);
+    }
 }

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

@@ -44,6 +44,8 @@ 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.ReqAudit;
+import com.customs.cq.datacenter.common.model.ReqOperator;
 import com.customs.cq.datacenter.common.model.Tuple;
 import com.customs.cq.datacenter.common.utils.*;
 import com.customs.cq.datacenter.system.mapper.SysDictDataMapper;
@@ -84,6 +86,8 @@ public class CheckRecordService extends BasicService {
     private DangerCheckItemMapperImpl checkItemMapper;
     @Autowired
     private SysUserMapper userMapper;
+    @Autowired
+    private CheckRevokeMapperImpl checkRevokeMapper;
 
     @Autowired
     private GridInfoService gridInfoService;
@@ -172,7 +176,7 @@ public class CheckRecordService extends BasicService {
             checkItem.setCustomsName(item.getCustomsName());
             checkItem.setCheckTime(item.getCheckTime());
             checkItem.setCheckPerson(item.getCheckPerson());
-            checkItem.setRectifyStatus(c.getCheckResult());
+            checkItem.setCheckResult(c.getCheckResult());
             checkItem.setDangerDescription(c.getDangerDescription());
             checkItem.setRectifyPlan(c.getRectifyPlan());
             checkItem.setRectifyDeadline(c.getRectifyDeadline());
@@ -502,4 +506,125 @@ public class CheckRecordService extends BasicService {
         }
         return ExecutedResult.success();
     }
+    private void updateRevokeStatus(Long gridId, EApprovalState status) {
+        CheckRecordPO item = new CheckRecordPO();
+        item.setId(gridId);
+        item.setRevokeStatus(status.getValue());
+
+        int rowCount = dao.updateById(item);
+        if (rowCount != 1) {
+            throw new ServiceException("修改隐患检查单状态失败", EResultCode.FAILED.getCode());
+        }
+    }
+
+    // 检查单撤回申请
+    public ExecutedResult<String> revoke(ReqOperator request) {
+        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(request.getId());
+        if (checkExists.isFailed()) {
+            return ExecutedResult.failed(checkExists.getMsg());
+        }
+        CheckRecordPO find = checkExists.getData();
+        // 检查单撤回申请状态为待审核,返回成功
+        if (Objects.equals(find.getRevokeStatus(), EApprovalState.WAITING.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("当前用户没有权限!");
+        }
+
+        // 修改检查单撤回申请状态
+        this.updateRevokeStatus(request.getId(), EApprovalState.WAITING);
+
+        List<CheckRevokePO> list = checkRevokeMapper.list4CheckRecord(request.getId());
+        // 已有待审核的撤回申请,返回成功
+        if (list.stream().anyMatch(c -> Objects.equals(c.getStatus(), EApprovalState.WAITING.getValue()))) {
+            return ExecutedResult.success();
+        }
+
+        // 添加申请记录
+        CheckRevokePO item = new CheckRevokePO();
+        item.setCheckRecordId(request.getId());
+        item.setGridId(find.getGridId());
+        item.setCheckFormId(find.getCheckFormId());
+        item.setCheckFormName(find.getCheckFormName());
+        // 申请人信息
+        item.setApplyUser(loginUser.getUserId().toString());
+        item.setApplyUserName(loginUser.getUsername());
+        // 创建时间
+        item.setCreateTime(LocalDateTimeUtil.nowTimeStamp());
+
+        int rowCount = checkRevokeMapper.insert(item);
+        if (rowCount != 1) {
+            return ExecutedResult.failed("检查单撤回申请失败");
+        }
+        return ExecutedResult.success();
+    }
+
+    // 检查单撤回审核
+    public ExecutedResult<String> revokeAudit(ReqAudit request) {
+        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(request.getId());
+        if (checkExists.isFailed()) {
+            return ExecutedResult.failed(checkExists.getMsg());
+        }
+        CheckRecordPO find = checkExists.getData();
+        // 检查单撤回状态,非待审核,返回成功
+        if (!Objects.equals(find.getRevokeStatus(), EApprovalState.WAITING.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("当前用户没有权限!");
+        }
+
+        // 修改检查单撤回申请状态
+        this.updateRevokeStatus(request.getId(), EApprovalState.WAITING);
+
+        List<CheckRevokePO> list = checkRevokeMapper.list4CheckRecord(request.getId());
+        // 没有待审核的撤回申请,返回成功
+        if (list.stream().noneMatch(c -> Objects.equals(c.getStatus(), EApprovalState.WAITING.getValue()))) {
+            return ExecutedResult.success();
+        }
+
+        Long now = LocalDateTimeUtil.nowTimeStamp();
+        // 修改审核结果
+        List<CheckRevokePO> listRevoke = list.stream().map(c -> {
+            CheckRevokePO item = new CheckRevokePO();
+            item.setId(c.getId());
+            // 审核人信息
+            item.setAuditor(loginUser.getUserId().toString());
+            item.setAuditorName(loginUser.getUsername());
+            // 审核信息
+            item.setStatus(Objects.equals(request.getResult(), EAuditResult.PASS.getValue()) ? EApprovalState.PASSED.getValue() : EApprovalState.REFUSED.getValue());
+            item.setAuditComment(request.getComment());
+            item.setAuditTime(now);
+
+            return item;
+        }).collect(Collectors.toList());
+        boolean insertRevoke = checkRevokeMapper.update(listRevoke);
+        if (insertRevoke) {
+            return ExecutedResult.success();
+        }
+        return ExecutedResult.failed("检查单撤回申请失败");
+    }
 }

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

@@ -12,6 +12,7 @@ public class ReqAudit {
 
     /**
      * 审核结果 EAuditResult
+     * @required
      */
     private Integer result;
 

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

@@ -52,3 +52,21 @@ export function listAdminMine(data) {
     data: data
   })
 }
+
+// 提交到网格管理员
+export function submitAdmin(id) {
+  return request({
+    url: '/checkRecord/submitAdmin/' + id,
+    method: 'post',
+    data: {}
+  })
+}
+
+// 检查单撤回申请
+export function revoke(data) {
+  return request({
+    url: '/checkRecord/revoke',
+    method: 'post',
+    data: data
+  })
+}

+ 103 - 224
secure-producting-vue/src/views/check/DangerCheckRecordMine.vue

@@ -147,17 +147,18 @@
           {{ parseTime(scope.row.createTimeView, '{y}-{m}-{d}') }}
         </template>
       </el-table-column>
-      <el-table-column label="检查表" width="300" align="left" prop="checkFormName">
+      <el-table-column label="检查表" width="200" 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="70" align="center" prop="statusTxt" />
+        <el-table-column label="撤回申请" width="80" prop="revokeStatusTxt">
+          <template #default="scope">
+            {{ scope.row.revokeStatus === 0 ? '-' : scope.row.revokeStatusTxt }}
+          </template>
+        </el-table-column>
       <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" />
@@ -174,23 +175,39 @@
       </el-table-column>
       <el-table-column
         label="操作"
-        align="center"
+        align="left"
         width="150"
         fixed="right"
         class-name="small-padding fixed-width"
       >
         <template #default="scope">
           <el-button
+            v-if="scope.row.status === 20"
             link
             type="primary"
             @click="handleDetail(scope.row)"
             >详情</el-button>
           <el-button
+            v-if="(scope.row.status === 20 && (scope.row.revokeStatus == 0 || scope.row.revokeStatus === 30))"
+            link
+            type="warning"
+            icon="View"
+            @click="onRevoke(scope.row)"
+          >撤回</el-button>
+          <el-button
+            v-if="scope.row.status === 0"
             link
             type="primary"
             icon="Edit"
-            @click="handleUpdate(scope.row)"
-            >修改</el-button>
+            @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>
@@ -203,101 +220,35 @@
       @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-dialog
+      :title="titleRevoke"
+      v-model="showRevoke"
+      width="900px"
+      append-to-body
     >
-      <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>
+      <el-form
+        ref="refFormRevoke"
+        :model="formRevoke"
+        :rules="rulesRevoke"
+        label-width="85px"
+      >
+        <el-form-item label="撤回理由" prop="comment">          
+          <el-input v-model="formRevoke.id" type="hidden" />
+          <el-input v-model="formRevoke.comment" 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"
+          :loading="loadingRevoke"
           type="primary"
-          @click="submitModify"
-          >确 定</el-button>
-        <el-button @click="cancelModify">{{cancelModifyTxt}}</el-button>
-        <el-button type="primary" v-if="isDetail" @click="changeModify">编 辑</el-button>
+          @click="revokeSubmit"
+        >提 交</el-button>
+        <el-button @click="showRevoke = false">取 消</el-button>
       </div>
-    </template>
-  </el-dialog>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
@@ -321,11 +272,22 @@ 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 titleRevoke = ref('');
+const showRevoke = ref(false);
+const loadingRevoke = ref(false);
+const formRevoke = ref({
+  id: undefined,
+  comment: undefined
+});
+const rulesRevoke = ref({
+  comment: [
+    { required: true, message: "撤回说明不能为空", trigger: "blur" },
+    { max: 500, message: '撤回说明字符长度不能超过500', trigger: 'blur' }
+  ]
+});
+
 
 const total = ref(0);
 const dateRangeCheckTime = ref([]);
@@ -349,24 +311,6 @@ const queryParams = ref({
   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' }],
-});
-
 
 
 /** 查询列表 */
@@ -407,122 +351,57 @@ function handleSelectionChange(selection) {
   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 onRevoke(row) {
+  formRevoke.value = {
+    id: row.id,
+    comment: undefined
+  };
+  
+  showRevoke.value = true;
+  titleRevoke.value = '检查单撤回 - ' + row.checkFormNo;
 }
-/** 修改提交 */
-function submitModify() {
-  proxy.$refs["formModifyRef"].validate((valid) => {
+/** 隐患检查单-撤回-提交 */
+function revokeSubmit() {  
+  proxy.$refs["refFormRevoke"].validate((valid) => {
     if (valid) {
-      modifyLoading.value = true;
-
-      modify(formModify.value)
-        .then((response) => {
-          proxy.$modal.msgSuccess("修改成功");
-          dialogOpenModify.value = false;
-          getList();
-        })
-        .finally(() => {
-          modifyLoading.value = false;
-        });
+      loadingRevoke.value = true;
+      revoke(formRevoke.value).then((response) => {
+        getListPerson();
+      })
+      .finally(() => {
+        showRevoke.value = false;
+        loadingRevoke.value = false;
+      });
     }
   });
 }
 
 
-function getStatusTxt(status) {
-  let find = checkFormStatusList.value.find(c => parseInt(c.value) === status);
-  if (find) {
-    return find.label;
-  }
-  return '未知';
+
+/** 隐患检查单,提交到网格管理员 */
+function onSubmitAdmin(id) {  
+  proxy.$modal.confirm('确认要提交到网格管理员吗?')
+  .then(() => {
+    submitAdmin(id).then((response) => {
+      getListPerson();
+    })
+    .finally(() => {
+      //createLoading.value = false;
+    });
+  })
+  .catch((action) => {
+    if (action === 'cancel') {
+    proxy.$modal.msg('取消操作');
+    }
+  });
 }
 
 

+ 118 - 31
secure-producting-vue/src/views/grid/components/MyGridAndCheck.vue

@@ -2,13 +2,16 @@
   <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 label="检查表信息" prop="checkFormName" :show-overflow-tooltip="true">
+        <el-table-column label="检查单号" width="210" prop="checkFormNo" />
+        <el-table-column label="网格" width="100" prop="gridName" />
+        <el-table-column label="检查表" width="140" prop="checkFormName" :show-overflow-tooltip="true" />
+        <el-table-column label="状态" width="70" prop="statusTxt" />
+        <el-table-column label="撤回申请" width="80" prop="revokeStatusTxt">
           <template #default="scope">
-            {{ scope.row.gridName + ' - ' + scope.row.checkFormName }}
+            {{ scope.row.revokeStatus === 0 ? '-' : scope.row.revokeStatusTxt }}
           </template>
         </el-table-column>
-        <el-table-column label="状态" prop="statusTxt" />
-        <el-table-column label="操作">
+        <el-table-column label="操作" width="145">
           <template #default="scope">
             <el-button
               v-if="scope.row.status === 20"
@@ -18,11 +21,11 @@
               @click="handleDetail(scope.row)"
             >查看</el-button>
             <el-button
-              v-if="scope.row.status === 20"
+              v-if="(scope.row.status === 20 && (scope.row.revokeStatus == 0 || scope.row.revokeStatus === 30))"
               link
               type="warning"
               icon="View"
-              @click="revoke(scope.row)"
+              @click="onRevoke(scope.row)"
             >撤回</el-button>
             <el-button
               v-if="scope.row.status === 0"
@@ -52,24 +55,56 @@
     >
       <!-- 设置对话框内容高度 -->
       <div style="height:70vh;">
-          <el-scrollbar>
-            <submit-danger-check
-              ref="refSubmitCheck"
-              v-if="showSubmitCheck"
-              :checkRecordId="submitItem.id"
-              :checkFormNo="submitItem.checkFormNo"
-              @closeCallback="submitCallBack"
-            ></submit-danger-check>
-          </el-scrollbar>
-        </div>
+        <el-scrollbar>
+          <submit-danger-check
+            ref="refSubmitCheck"
+            v-if="showSubmitCheck"
+            :checkRecordId="submitItem.id"
+            :checkFormNo="submitItem.checkFormNo"
+            :showDetail="showDetail"
+            @closeCallback="submitCallBack"
+          ></submit-danger-check>
+        </el-scrollbar>
+      </div>
       <template #footer>
       <div class="dialog-footer">
-          <el-button
-            :loading="loadingSubmitCheck"
-            type="primary"
-            @click="submitCheck"
-          >提 交</el-button>
-          <el-button @click="showSubmitCheck = false">取 消</el-button>
+        <el-button
+          v-if="!showDetail"
+          :loading="loadingSubmitCheck"
+          type="primary"
+          @click="submitCheck"
+        >提 交</el-button>
+        <el-button @click="showSubmitCheck = false">取 消</el-button>
+      </div>
+      </template>
+    </el-dialog>
+
+    <!-- 撤回申请模态框 -->
+    <el-dialog
+      :title="titleRevoke"
+      v-model="showRevoke"
+      width="900px"
+      append-to-body
+    >
+      <el-form
+        ref="refFormRevoke"
+        :model="formRevoke"
+        :rules="rulesRevoke"
+        label-width="85px"
+      >
+        <el-form-item label="撤回理由" prop="comment">          
+          <el-input v-model="formRevoke.id" type="hidden" />
+          <el-input v-model="formRevoke.comment" type="textarea" :autosize="{ minRows: 2, maxRows: 4 }" placeholder="请输入" />
+        </el-form-item>
+      </el-form>
+      <template #footer>
+      <div class="dialog-footer">
+        <el-button
+          :loading="loadingRevoke"
+          type="primary"
+          @click="revokeSubmit"
+        >提 交</el-button>
+        <el-button @click="showRevoke = false">取 消</el-button>
       </div>
       </template>
     </el-dialog>
@@ -78,8 +113,9 @@
 
 <script setup name="MyGridAndCheck">
 import { listMine } from '@/api/grid/GridIndex';
-import { submitAdmin } from '@/api/form/DangerCheckRecord';
+import { submitAdmin, revoke } from '@/api/form/DangerCheckRecord';
 import SubmitDangerCheck from '@/views/grid/components/SubmitDangerCheck';
+import { ref } from 'vue';
 
 const { proxy } = getCurrentInstance();
 
@@ -88,6 +124,22 @@ const showSubmitCheck = ref(false);
 const submitItem = ref({});
 const loadingSubmitCheck = ref(false);
 const titleSubmit = ref('');
+const showDetail = ref(false);
+
+
+const titleRevoke = ref('');
+const showRevoke = ref(false);
+const loadingRevoke = ref(false);
+const formRevoke = ref({
+  id: undefined,
+  comment: undefined
+});
+const rulesRevoke = ref({
+  comment: [
+    { required: true, message: "撤回说明不能为空", trigger: "blur" },
+    { max: 500, message: '撤回说明字符长度不能超过500', trigger: 'blur' }
+  ]
+});
 
 /** 获取当前登录用户的网格和今日填报情况 */
 function getListPerson() {
@@ -101,9 +153,35 @@ function getListPerson() {
 
 /** 隐患检查单-填报详情 */
 function handleDetail(row) {
+  submitItem.value = row;
+  showSubmitCheck.value = true;
+  showDetail.value = true;
+  titleSubmit.value = '隐患检查单 - ' + row.checkFormNo;
+}
+/** 隐患检查单-撤回-按钮 */
+function onRevoke(row) {
+  formRevoke.value = {
+    id: row.id,
+    comment: undefined
+  };
+  
+  showRevoke.value = true;
+  titleRevoke.value = '检查单撤回 - ' + row.checkFormNo;
 }
-/** 隐患检查单-撤回 */
-function revoke(row) {
+/** 隐患检查单-撤回-提交 */
+function revokeSubmit() {  
+  proxy.$refs["refFormRevoke"].validate((valid) => {
+    if (valid) {
+      loadingRevoke.value = true;
+      revoke(formRevoke.value).then((response) => {
+        getListPerson();
+      })
+      .finally(() => {
+        showRevoke.value = false;
+        loadingRevoke.value = false;
+      });
+    }
+  });
 }
 
 /** 指定网格-填报 */
@@ -114,6 +192,7 @@ function handleDoForm(row) {
   }
   submitItem.value = row;
   showSubmitCheck.value = true;
+  showDetail.value = false;
   titleSubmit.value = '隐患检查单 - ' + row.checkFormNo;
 }
 
@@ -128,13 +207,21 @@ function submitCallBack() {
 }
 
 /** 隐患检查单,提交到网格管理员 */
-function onSubmitAdmin(id) {
-  submitAdmin(id).then((response) => {
-    getListPerson();
+function onSubmitAdmin(id) {  
+  proxy.$modal.confirm('确认要提交到网格管理员吗?')
+  .then(() => {
+    submitAdmin(id).then((response) => {
+      getListPerson();
+    })
+    .finally(() => {
+      //createLoading.value = false;
+    });
   })
-  .finally(() => {
-    //createLoading.value = false;
-  });;
+  .catch((action) => {
+    if (action === 'cancel') {
+    proxy.$modal.msg('取消操作');
+    }
+  });
 }
 
 getListPerson();

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

@@ -4,6 +4,7 @@
       ref="refFormSubmit"
       :model="formSubmit"
       :rules="rulesSubmit"
+      :disabled="props.showDetail"
       label-width="135px"
     >
       <el-form-item label="检查表名称" prop="categoryName">
@@ -112,7 +113,6 @@
         ref="refFormCheckItemRectify"
         :model="formCheckItemRectify"
         :rules="rulesCheckItemRectify"
-        :disabled="isDetail"
         label-width="85px"
       >
         <el-form-item label="检查项" prop="itemName">
@@ -136,11 +136,11 @@
       </el-form>
       <template #footer>
         <div class="dialog-footer">
-            <el-button
-              type="primary"
-              @click="submitCheckItemRectify"
-            >提 交</el-button>
-            <el-button @click="dialogCheckItemRectify = false">取 消</el-button>
+          <el-button
+            type="primary"
+            @click="submitCheckItemRectify"
+          >提 交</el-button>
+          <el-button @click="dialogCheckItemRectify = false">取 消</el-button>
         </div>
       </template>
     </el-dialog>
@@ -181,6 +181,11 @@ const props = defineProps({
     checkFormNo: {
         type: String,
         default: '',
+    },
+    // 是否是查看详情
+    showDetail: {
+      type: Boolean,
+      default: false
     }
 });
 
@@ -237,7 +242,6 @@ const rulesCheckItemRectify = ref({
 });
 const dialogCheckItemRectify = ref(false);
 const titleCheckItemRectify = ref('');
-const isDetail = ref(false);
 
 
 
@@ -272,12 +276,11 @@ function onSubmitUploadExceed(files) {
 function onSubmitUploadRemove(item) {
   console.log('移除文件: ' + JSON.stringify(item));
 }
-/** 检查项存在隐患,填写整改措施 */
+/** 检查项存在隐患,填写整改措施 */
 function submitRectify(item) {
   formCheckItemRectify.value = item;
   titleCheckItemRectify.value = item.itemName + ' - 整改措施方案';
   dialogCheckItemRectify.value = true;
-  isDetail.value = false;
 }
 function submitCheckItemRectify() {
   proxy.$refs["refFormCheckItemRectify"].validate((valid) => {
@@ -295,7 +298,6 @@ function showRectify(item) {
   formCheckItemRectify.value = item;
   titleCheckItemRectify.value = item.itemName + ' - 整改措施方案';
   dialogCheckItemRectify.value = true;
-  //isDetail.value = true;
 }
 /** 提交检查表 */
 function submitCheck() {
@@ -353,7 +355,6 @@ function getFormDetail() {
       value.rectifyDeadline = 0;
       formSubmit.value.listItem.push(value);
     }
-    console.log(JSON.stringify(formSubmit.value.listItem));
   });
 }
 

+ 2 - 0
sql/20240814.sql

@@ -350,6 +350,7 @@ CREATE TABLE "SECURE_PRODUCTING"."SP_CHECK_RECORD"(
   "RECTIFY_SUBMIT_TIME" BIGINT NOT NULL DEFAULT 0,
   "RECTIFY_DEADLINE" BIGINT NOT NULL DEFAULT 0,
   "STATUS" TINYINT NOT NULL DEFAULT 0,
+  "REVOKE_STATUS" TINYINT NOT NULL DEFAULT 0,
   "REMARK" VARCHAR(500) NOT NULL DEFAULT '',
   "CREATE_TIME" BIGINT NOT NULL DEFAULT 0,
   "UPDATE_TIME" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(),
@@ -396,6 +397,7 @@ COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_CHECK_RECORD"."HAS_RECTIFY_PLAN" IS '
 COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_CHECK_RECORD"."RECTIFY_SUBMIT_TIME" IS '整改措施提交时间';
 COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_CHECK_RECORD"."RECTIFY_DEADLINE" IS '整改期限';
 COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_CHECK_RECORD"."STATUS" IS '状态 ECheckFormStatus';
+COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_CHECK_RECORD"."REVOKE_STATUS" IS '撤回申请状态 EApprovalState';
 COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_CHECK_RECORD"."REMARK" IS '备注';
 COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_CHECK_RECORD"."CREATE_TIME" IS '数据创建时间';
 COMMENT ON COLUMN "SECURE_PRODUCTING". "SP_CHECK_RECORD"."UPDATE_TIME" IS '最后更新时间';