Bladeren bron

-添加作废功能
-修改台账排序

jiangbiao 2 jaren geleden
bovenliggende
commit
41ca7df147
38 gewijzigde bestanden met toevoegingen van 230 en 7 verwijderingen
  1. 8 0
      master/src/main/java/com/ruoyi/project/base/controller/TBaseDeviceController.java
  2. 7 0
      master/src/main/java/com/ruoyi/project/base/controller/TBasePlantController.java
  3. 7 0
      master/src/main/java/com/ruoyi/project/base/controller/TBasePointController.java
  4. 7 0
      master/src/main/java/com/ruoyi/project/base/controller/TBaseRegionController.java
  5. 1 0
      master/src/main/java/com/ruoyi/project/base/mapper/TBaseDeviceMapper.java
  6. 2 0
      master/src/main/java/com/ruoyi/project/base/mapper/TBasePlantMapper.java
  7. 1 0
      master/src/main/java/com/ruoyi/project/base/mapper/TBasePointMapper.java
  8. 1 0
      master/src/main/java/com/ruoyi/project/base/mapper/TBaseRegionMapper.java
  9. 1 0
      master/src/main/java/com/ruoyi/project/base/service/ITBaseDeviceService.java
  10. 1 0
      master/src/main/java/com/ruoyi/project/base/service/ITBasePlantService.java
  11. 1 0
      master/src/main/java/com/ruoyi/project/base/service/ITBasePointService.java
  12. 1 0
      master/src/main/java/com/ruoyi/project/base/service/ITBaseRegionService.java
  13. 6 0
      master/src/main/java/com/ruoyi/project/base/service/impl/TBaseDeviceServiceImpl.java
  14. 6 0
      master/src/main/java/com/ruoyi/project/base/service/impl/TBasePlantServiceImpl.java
  15. 6 0
      master/src/main/java/com/ruoyi/project/base/service/impl/TBasePointServiceImpl.java
  16. 6 0
      master/src/main/java/com/ruoyi/project/base/service/impl/TBaseRegionServiceImpl.java
  17. 6 0
      master/src/main/resources/mybatis/base/TBaseDeviceMapper.xml
  18. 9 0
      master/src/main/resources/mybatis/base/TBasePlantMapper.xml
  19. 15 3
      master/src/main/resources/mybatis/base/TBasePointMapper.xml
  20. 8 0
      master/src/main/resources/mybatis/base/TBaseRegionMapper.xml
  21. 1 0
      master/src/main/resources/mybatis/check/TCheckCalibrationMapper.xml
  22. 1 0
      master/src/main/resources/mybatis/check/TCheckCheckpointsMapper.xml
  23. 1 0
      master/src/main/resources/mybatis/check/TCheckEnvironmentMapper.xml
  24. 1 0
      master/src/main/resources/mybatis/check/TCheckInstrumentMapper.xml
  25. 1 0
      master/src/main/resources/mybatis/check/TCheckInstrumentRecordMapper.xml
  26. 1 0
      master/src/main/resources/mybatis/check/TCheckRepairpointsMapper.xml
  27. 1 0
      master/src/main/resources/mybatis/check/TCheckStandardgasesMapper.xml
  28. 1 0
      master/src/main/resources/mybatis/task/TTaskInspectionMapper.xml
  29. 1 0
      master/src/main/resources/mybatis/task/TTaskInspectionPlanMapper.xml
  30. 1 0
      master/src/main/resources/mybatis/task/TTaskRepairMapper.xml
  31. 7 0
      ui/src/api/base/device.js
  32. 6 0
      ui/src/api/base/plant.js
  33. 7 0
      ui/src/api/base/point.js
  34. 8 0
      ui/src/api/base/region.js
  35. 21 1
      ui/src/views/base/device/index.vue
  36. 21 1
      ui/src/views/base/plant/index.vue
  37. 21 1
      ui/src/views/base/point/index.vue
  38. 29 1
      ui/src/views/base/region/index.vue

+ 8 - 0
master/src/main/java/com/ruoyi/project/base/controller/TBaseDeviceController.java

@@ -151,6 +151,14 @@ public class TBaseDeviceController extends BaseController
         return toAjax(tBaseDeviceService.deleteTBaseDeviceByIds(ids));
     }
 
+    @PreAuthorize("@ss.hasPermi('base:region:remove')")
+    @Log(title = "设备/管线作废", businessType = BusinessType.DELETE)
+    @DeleteMapping("/handleDisabled/{id}")
+    public AjaxResult handleDisabled(@PathVariable Long id) {
+        return toAjax(tBaseDeviceService.disabledDevice(id));
+    }
+
+
     @Log(title = "受控设备台账导入", businessType = BusinessType.INSERT)
     @RepeatSubmit
     @PostMapping("/importData")

+ 7 - 0
master/src/main/java/com/ruoyi/project/base/controller/TBasePlantController.java

@@ -156,4 +156,11 @@ public class TBasePlantController extends BaseController
         }
         return AjaxResult.success();
     }
+
+    @PreAuthorize("@ss.hasPermi('base:plant:remove')")
+    @DeleteMapping("/handleDisabled/{id}")
+    @Log(title = "装置作废", businessType = BusinessType.DELETE)
+    public AjaxResult handleDisabled(@PathVariable("id") Long id){
+        return toAjax(tBasePlantService.disabledPlant(id));
+    }
 }

+ 7 - 0
master/src/main/java/com/ruoyi/project/base/controller/TBasePointController.java

@@ -199,6 +199,13 @@ public class TBasePointController extends BaseController {
         return toAjax(tBasePointService.deleteTBasePointByIds(ids));
     }
 
+    @PreAuthorize("@ss.hasPermi('base:point:remove')")
+    @Log(title = "密封点作废", businessType = BusinessType.DELETE)
+    @DeleteMapping("/handleDisabled/{id}")
+    public AjaxResult handleDisabled(@PathVariable Long id) {
+        return toAjax(tBasePointService.disabledPoint(id));
+    }
+
 
     @Log(title = "密封点台账导入", businessType = BusinessType.INSERT)
     @RepeatSubmit

+ 7 - 0
master/src/main/java/com/ruoyi/project/base/controller/TBaseRegionController.java

@@ -137,6 +137,13 @@ public class TBaseRegionController extends BaseController {
         return toAjax(tBaseRegionService.deleteTBaseRegionByIds(ids));
     }
 
+    @PreAuthorize("@ss.hasPermi('base:region:remove')")
+    @Log(title = "区域作废", businessType = BusinessType.DELETE)
+    @DeleteMapping("/handleDisabled/{id}")
+    public AjaxResult handleDisabled(@PathVariable Long id) {
+        return toAjax(tBaseRegionService.disabledRegion(id));
+    }
+
     @Log(title = "受控区域台账导入", businessType = BusinessType.INSERT)
     @RepeatSubmit
     @PostMapping("/importData")

+ 1 - 0
master/src/main/java/com/ruoyi/project/base/mapper/TBaseDeviceMapper.java

@@ -59,6 +59,7 @@ public interface TBaseDeviceMapper
      * @return 结果
      */
     public int deleteTBaseDeviceById(Long id);
+    public int disabledDevice(Long id);
 
     /**
      * 批量删除设备/管线

+ 2 - 0
master/src/main/java/com/ruoyi/project/base/mapper/TBasePlantMapper.java

@@ -52,6 +52,8 @@ public interface TBasePlantMapper
     public int updateTBasePlant(TBasePlant tBasePlant);
     public int updateTBasePlantByPlantIds(TBasePlant tBasePlant);
 
+    public int disabledPlant(Long id);
+
     /**
      * 删除装置
      *

+ 1 - 0
master/src/main/java/com/ruoyi/project/base/mapper/TBasePointMapper.java

@@ -63,6 +63,7 @@ public interface TBasePointMapper extends BaseMapper<TBasePoint>
      * @return 结果
      */
     public int deleteTBasePointById(Long id);
+    public int disabledPoint(Long id);
 
     /**
      * 批量删除密封点

+ 1 - 0
master/src/main/java/com/ruoyi/project/base/mapper/TBaseRegionMapper.java

@@ -57,6 +57,7 @@ public interface TBaseRegionMapper
      * @return 结果
      */
     public int deleteTBaseRegionById(Long id);
+    public int disabledRegion(Long id);
 
     /**
      * 批量删除区域

+ 1 - 0
master/src/main/java/com/ruoyi/project/base/service/ITBaseDeviceService.java

@@ -61,4 +61,5 @@ public interface ITBaseDeviceService
      * @return 结果
      */
     public int deleteTBaseDeviceById(Long id);
+    public int disabledDevice(Long id);
 }

+ 1 - 0
master/src/main/java/com/ruoyi/project/base/service/ITBasePlantService.java

@@ -45,6 +45,7 @@ public interface ITBasePlantService
      */
     public int updateTBasePlant(TBasePlant tBasePlant);
     public int updateTBasePlantByPlantIds(TBasePlant tBasePlant);
+    public int disabledPlant(Long id);
 
     /**
      * 批量删除装置

+ 1 - 0
master/src/main/java/com/ruoyi/project/base/service/ITBasePointService.java

@@ -68,4 +68,5 @@ public interface ITBasePointService {
      * @return 结果
      */
     public int deleteTBasePointById(Long id);
+    public int disabledPoint(Long id);
 }

+ 1 - 0
master/src/main/java/com/ruoyi/project/base/service/ITBaseRegionService.java

@@ -61,4 +61,5 @@ public interface ITBaseRegionService
      * @return 结果
      */
     public int deleteTBaseRegionById(Long id);
+    public int disabledRegion(Long id);
 }

+ 6 - 0
master/src/main/java/com/ruoyi/project/base/service/impl/TBaseDeviceServiceImpl.java

@@ -105,4 +105,10 @@ public class TBaseDeviceServiceImpl implements ITBaseDeviceService
     {
         return tBaseDeviceMapper.deleteTBaseDeviceById(id);
     }
+
+    @Override
+    public int disabledDevice(Long id)
+    {
+        return tBaseDeviceMapper.disabledDevice(id);
+    }
 }

+ 6 - 0
master/src/main/java/com/ruoyi/project/base/service/impl/TBasePlantServiceImpl.java

@@ -84,6 +84,12 @@ public class TBasePlantServiceImpl implements ITBasePlantService
         return tBasePlantMapper.updateTBasePlantByPlantIds(tBasePlant);
     }
 
+    @Override
+    public int disabledPlant(Long id)
+    {
+        return tBasePlantMapper.disabledPlant(id);
+    }
+
     /**
      * 批量删除装置
      *

+ 6 - 0
master/src/main/java/com/ruoyi/project/base/service/impl/TBasePointServiceImpl.java

@@ -77,6 +77,7 @@ public class TBasePointServiceImpl implements ITBasePointService {
     public int updateTBasePoint(TBasePoint tBasePoint) {
         return tBasePointMapper.updateTBasePoint(tBasePoint);
     }
+
     @Override
     public int updateTBasePointByPointIds(TBasePoint tBasePoint) {
         return tBasePointMapper.updateTBasePointByPointIds(tBasePoint);
@@ -108,4 +109,9 @@ public class TBasePointServiceImpl implements ITBasePointService {
     public int deleteTBasePointById(Long id) {
         return tBasePointMapper.deleteTBasePointById(id);
     }
+
+    @Override
+    public int disabledPoint(Long id) {
+        return tBasePointMapper.disabledPoint(id);
+    }
 }

+ 6 - 0
master/src/main/java/com/ruoyi/project/base/service/impl/TBaseRegionServiceImpl.java

@@ -105,4 +105,10 @@ public class TBaseRegionServiceImpl implements ITBaseRegionService
     {
         return tBaseRegionMapper.deleteTBaseRegionById(id);
     }
+
+    @Override
+    public int disabledRegion(Long id)
+    {
+        return tBaseRegionMapper.disabledRegion(id);
+    }
 }

+ 6 - 0
master/src/main/resources/mybatis/base/TBaseDeviceMapper.xml

@@ -55,10 +55,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
         <!-- 数据范围过滤 -->
         ${params.dataScopePlant}
+        order by d.createdate desc
     </select>
 
     <select id="selectAllDeviceByRegionId" parameterType="long" resultMap="TBaseDeviceResult">
         select d.dev_id, concat(d.dev_code, '+',d.dev_describe) `dev_describe` from t_base_device d where d.region_id=#{regionId} and d.del_flag=0  and d.approve_status=2
+        order by d.createdate desc
     </select>
 
     <select id="selectTBaseDeviceByCode" parameterType="TBasePoint" resultMap="TBaseDeviceResult">
@@ -148,6 +150,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <delete id="deleteTBaseDeviceById" parameterType="Long">
         update t_base_device set del_flag=1 where dev_id = #{devId}
     </delete>
+    <delete id="disabledDevice" parameterType="Long">
+        update t_base_device set approve_status=-1 where dev_id = #{devId};
+        update t_base_point set approve_status=-1 where dev_id = #{devId};
+    </delete>
 
     <delete id="deleteTBaseDeviceByIds" parameterType="String">
         update t_base_device set del_flag=1 where dev_id in

+ 9 - 0
master/src/main/resources/mybatis/base/TBasePlantMapper.xml

@@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
         <!-- 数据范围过滤 -->
         ${params.dataScopePlant}
+        order by d.createdate desc
     </select>
 
     <select id="selectTBasePlantList" parameterType="TBasePlant" resultMap="TBasePlantResult">
@@ -59,6 +60,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
         <!-- 数据范围过滤 -->
         ${params.dataScopePlant}
+        order by d.createdate desc
     </select>
 
     <select id="selectTBasePlantById" parameterType="Long" resultMap="TBasePlantResult">
@@ -154,4 +156,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             </if>
         </where>
     </update>
+
+    <delete id="disabledPlant" parameterType="long">
+        update t_base_plant set approve_status=-1 where plant_id=#{plantId};
+        update t_base_device set approve_status=-1 where plant_id=#{plantId};
+        update t_base_point set approve_status=-1 where plant_id=#{plantId};
+        update t_base_region set approve_status=-1 where plant_id=#{plantId};
+    </delete>
 </mapper>

+ 15 - 3
master/src/main/resources/mybatis/base/TBasePointMapper.xml

@@ -104,6 +104,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
         <!-- 数据范围过滤 -->
         ${params.dataScopePlant}
+        order by d.createdate desc
     </select>
 
     <select id="selectTBasePointListByPlan" parameterType="TBasePoint" resultMap="TBasePointResult">
@@ -129,9 +130,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                  left join t_base_plant bp on bp.plant_id = d.plant_id
                  left join t_base_region br on br.region_id = d.region_id
                  left join t_base_device bd on bd.dev_id = d.dev_id
-        where point_id not in (select point_id
-                           from t_check_checkpoints
-                           where plan_id = #{planId}) and d.del_flag=0 and d.plant_id= #{plantId}
+        <where>
+            and point_id not in (select point_id
+            from t_check_checkpoints
+            where plan_id = #{planId})
+            and d.del_flag=0
+            and d.plant_id= #{plantId}
+            and d.approve_status=2
+        </where>
+        <!-- 数据范围过滤 -->
+        ${params.dataScopePlant}
     </select>
 
     <select id="selectTBasePointById" parameterType="Long" resultMap="TBasePointResult">
@@ -282,6 +290,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         update t_base_point set del_flag=1 where point_id = #{pointId}
     </delete>
 
+    <delete id="disabledPoint" parameterType="Long">
+        update t_base_point set approve_status=-1 where point_id = #{pointId}
+    </delete>
+
     <delete id="deleteTBasePointByIds" parameterType="String">
         update t_base_point set del_flag=1 where point_id in
         <foreach item="pointId" collection="array" open="(" separator="," close=")">

+ 8 - 0
master/src/main/resources/mybatis/base/TBaseRegionMapper.xml

@@ -50,9 +50,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
         <!-- 数据范围过滤 -->
         ${params.dataScopePlant}
+        order by d.createdate desc
     </select>
     <select id="selectAllRegionByPlantId" parameterType="long"  resultMap="TBaseRegionResult">
         select d.region_id, d.region_code, d.region_name from t_base_region d where d.plant_id=#{plantId} and d.del_flag=0 and d.approve_status=2
+        order by d.createdate desc
     </select>
 
     <select id="selectTBaseRegionById" parameterType="Long" resultMap="TBaseRegionResult">
@@ -120,6 +122,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         update t_base_region set del_flag=1 where region_id = #{regionId}
     </delete>
 
+    <delete id="disabledRegion" parameterType="Long">
+        update t_base_region set approve_status=-1 where region_id = #{regionId};
+        update t_base_device set approve_status=-1 where region_id = #{regionId};
+        update t_base_point set approve_status=-1 where region_id = #{regionId};
+    </delete>
+
     <delete id="deleteTBaseRegionByIds" parameterType="String">
         update t_base_region set del_flag=1 where region_id in
         <foreach item="regionId" collection="array" open="(" separator="," close=")">

+ 1 - 0
master/src/main/resources/mybatis/check/TCheckCalibrationMapper.xml

@@ -58,6 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null "> and d.updatedate = #{updatedate}</if>
         and d.del_flag = 0
         </where>
+        order by d.createdate desc
     </select>
 
     <select id="selectTCheckCalibrationById" parameterType="Long" resultMap="TCheckCalibrationResult">

+ 1 - 0
master/src/main/resources/mybatis/check/TCheckCheckpointsMapper.xml

@@ -152,6 +152,7 @@
             </foreach>
             and d.approve_status=2
         </where>
+        order by d.createdate desc
     </select>
 
     <select id="selectTCheckCheckpointsByCheckId" parameterType="Long" resultMap="TCheckCheckpointsResult">

+ 1 - 0
master/src/main/resources/mybatis/check/TCheckEnvironmentMapper.xml

@@ -64,6 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
         <!-- 数据范围过滤 -->
         ${params.dataScopePlant}
+        order by d.createdate desc
     </select>
 
     <select id="selectTCheckEnvironmentListByYear" parameterType="TCheckEnvironment" resultMap="TCheckEnvironmentResult">

+ 1 - 0
master/src/main/resources/mybatis/check/TCheckInstrumentMapper.xml

@@ -46,6 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null "> and d.updatedate = #{updatedate}</if>
         and d.del_flag = 0
         </where>
+        order by d.createdate desc
     </select>
 
     <select id="selectTCheckInstrumentById" parameterType="Long" resultMap="TCheckInstrumentResult">

+ 1 - 0
master/src/main/resources/mybatis/check/TCheckInstrumentRecordMapper.xml

@@ -39,6 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null "> and d.updatedate = #{updatedate}</if>
         and d.del_flag = 0
         </where>
+        order by d.createdate desc
     </select>
 
     <select id="selectTCheckInstrumentRecordById" parameterType="Long" resultMap="TCheckInstrumentRecordResult">

+ 1 - 0
master/src/main/resources/mybatis/check/TCheckRepairpointsMapper.xml

@@ -123,6 +123,7 @@
         </where>
         <!-- 数据范围过滤 -->
         ${params.dataScopePlant}
+        order by d.createdate desc
     </select>
 
     <select id="selectTCheckRepairpointsByCheckId" parameterType="Long" resultMap="TCheckRepairpointsResult">

+ 1 - 0
master/src/main/resources/mybatis/check/TCheckStandardgasesMapper.xml

@@ -45,6 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null "> and updatedate = #{updatedate}</if>
         and d.del_flag = 0
         </where>
+        order by d.createdate desc
     </select>
 
     <select id="selectAllStandardgases"  resultMap="TCheckStandardgasesResult">

+ 1 - 0
master/src/main/resources/mybatis/task/TTaskInspectionMapper.xml

@@ -62,6 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
         <!-- 数据范围过滤 -->
         ${params.dataScopePlant}
+        order by d.createdate desc
     </select>
 
     <select id="selectTTaskInspectionById" parameterType="Long" resultMap="TTaskInspectionResult">

+ 1 - 0
master/src/main/resources/mybatis/task/TTaskInspectionPlanMapper.xml

@@ -56,6 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
         <!-- 数据范围过滤 -->
         ${params.dataScopePlant}
+        order by d.createdate desc
     </select>
 
     <select id="selectAllPlan" resultMap="TTaskInspectionPlanResult">

+ 1 - 0
master/src/main/resources/mybatis/task/TTaskRepairMapper.xml

@@ -58,6 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
         <!-- 数据范围过滤 -->
         ${params.dataScopePlant}
+        order by d.createdate desc
     </select>
 
     <select id="selectTTaskRepairById" parameterType="Long" resultMap="TTaskRepairResult">

+ 7 - 0
ui/src/api/base/device.js

@@ -56,3 +56,10 @@ export function handleApprove(data) {
       method: 'delete'
     })
   }
+
+export function handleDisabled(id) {
+  return request({
+    url: '/base/device/handleDisabled/'+id,
+    method: 'delete'
+  })
+}

+ 6 - 0
ui/src/api/base/plant.js

@@ -56,3 +56,9 @@ export function handleApprove(data) {
     data:data
   })
 }
+export function handleDisabled(id) {
+  return request({
+    url: '/base/plant/handleDisabled/'+id,
+    method: 'delete'
+  })
+}

+ 7 - 0
ui/src/api/base/point.js

@@ -72,3 +72,10 @@ export function delPoint(id) {
     method: 'delete'
   })
 }
+
+export function handleDisabled(id) {
+  return request({
+    url: '/base/point/handleDisabled/'+id,
+    method: 'delete'
+  })
+}

+ 8 - 0
ui/src/api/base/region.js

@@ -56,3 +56,11 @@ export function handleApprove(data) {
     data: data
   })
 }
+
+
+export function handleDisabled(id) {
+  return request({
+    url: '/base/region/handleDisabled/'+id,
+    method: 'delete'
+  })
+}

+ 21 - 1
ui/src/views/base/device/index.vue

@@ -151,6 +151,7 @@
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
             v-hasPermi="['base:device:edit']"
+            v-if="scope.row.approveStatus==0"
           >修改
           </el-button>
           <el-button
@@ -159,8 +160,18 @@
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
             v-hasPermi="['base:device:remove']"
+            v-if="scope.row.approveStatus==0"
           >删除
           </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-circle-close"
+            @click="handleDisabled(scope.row.devId)"
+            v-hasPermi="['base:device:remove']"
+            v-if="scope.row.approveStatus==2"
+          >作废
+          </el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -265,7 +276,7 @@
 </template>
 
 <script>
-import {addDevice, delDevice, getDevice, handleApprove, listDevice, updateDevice} from "@/api/base/device";
+import {addDevice, delDevice, getDevice, handleApprove, listDevice, updateDevice, handleDisabled} from "@/api/base/device";
 import {getAllPlantName} from "@/api/base/plant";
 import {getAllRegion} from "@/api/base/region";
 import {MessageBox} from 'element-ui'
@@ -532,6 +543,15 @@ export default {
         }
       });
     },
+    handleDisabled(id){
+      this.$modal.confirm('是否确认作废数据项?注意!该操作不可逆!作废后该设备下的所有密封点都将一并作废!').then(function () {
+        return handleDisabled(id);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("作废成功");
+      }).catch(() => {
+      });
+    },
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.devId || this.ids;

+ 21 - 1
ui/src/views/base/plant/index.vue

@@ -140,6 +140,7 @@
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
             v-hasPermi="['base:plant:edit']"
+            v-if="scope.row.approveStatus==0"
           >修改
           </el-button>
           <el-button
@@ -148,8 +149,18 @@
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
             v-hasPermi="['base:plant:remove']"
+            v-if="scope.row.approveStatus==0"
           >删除
           </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-circle-close"
+            @click="handleDisabled(scope.row.plantId)"
+            v-hasPermi="['base:plant:remove']"
+            v-if="scope.row.approveStatus==2"
+          >作废
+          </el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -200,7 +211,7 @@
 </template>
 
 <script>
-import {listPlant, getPlant, delPlant, addPlant, updatePlant, handleApprove} from "@/api/base/plant";
+import {listPlant, getPlant, delPlant, addPlant, updatePlant, handleApprove, handleDisabled} from "@/api/base/plant";
 import {MessageBox} from "element-ui";
 
 export default {
@@ -405,6 +416,15 @@ export default {
         }
       });
     },
+    handleDisabled(id){
+      this.$modal.confirm('是否确认作废数据项?注意!该操作不可逆!作废后该装置下的所有区域、设备、密封点都将一并作废!').then(function () {
+        return handleDisabled(id);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("作废成功");
+      }).catch(() => {
+      });
+    },
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.plantId || this.ids;

+ 21 - 1
ui/src/views/base/point/index.vue

@@ -310,6 +310,7 @@
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
             v-hasPermi="['base:point:edit']"
+            v-if="scope.row.approveStatus==0"
           >修改
           </el-button>
           <el-button
@@ -318,8 +319,18 @@
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
             v-hasPermi="['base:point:remove']"
+            v-if="scope.row.approveStatus==0"
           >删除
           </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-circle-close"
+            @click="handleDisabled(scope.row.pointId)"
+            v-hasPermi="['base:point:remove']"
+            v-if="scope.row.approveStatus==2"
+          >作废
+          </el-button>
           <el-button
             size="mini"
             type="text"
@@ -641,7 +652,7 @@ import {
   updatePoint,
   handleApprove,
   handleApproveAll,
-  handleUpload
+  handleUpload, handleDisabled
 } from "@/api/base/point";
 import {getAllPlantName} from "@/api/base/plant";
 import {getAllRegion} from "@/api/base/region";
@@ -1115,6 +1126,15 @@ export default {
         }
       });
     },
+    handleDisabled(id){
+      this.$modal.confirm('是否确认作废数据项?注意!该操作不可逆!').then(function () {
+        return handleDisabled(id);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("作废成功");
+      }).catch(() => {
+      });
+    },
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.pointId || this.ids;

+ 29 - 1
ui/src/views/base/region/index.vue

@@ -136,6 +136,7 @@
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
             v-hasPermi="['base:region:edit']"
+            v-if="scope.row.approveStatus==0"
           >修改</el-button>
           <el-button
             size="mini"
@@ -143,7 +144,17 @@
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
             v-hasPermi="['base:region:remove']"
+            v-if="scope.row.approveStatus==0"
           >删除</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-circle-close"
+            @click="handleDisabled(scope.row.regionId)"
+            v-hasPermi="['base:region:remove']"
+            v-if="scope.row.approveStatus==2"
+          >作废
+          </el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -227,7 +238,15 @@
 </template>
 
 <script>
-import { listRegion, getRegion, delRegion, addRegion, updateRegion, handleApprove } from "@/api/base/region";
+import {
+  addRegion,
+  delRegion,
+  getRegion,
+  handleApprove,
+  handleDisabled,
+  listRegion,
+  updateRegion
+} from "@/api/base/region";
 import {getAllPlantName} from "@/api/base/plant";
 import {MessageBox} from "element-ui";
 import {getToken} from "@/utils/auth";
@@ -462,6 +481,15 @@ export default {
         }
       });
     },
+    handleDisabled(id){
+      this.$modal.confirm('是否确认作废数据项?注意!该操作不可逆!作废后该区域下的所有设备、密封点都将一并作废!').then(function () {
+        return handleDisabled(id);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("作废成功");
+      }).catch(() => {
+      });
+    },
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.regionId || this.ids;