Explorar o código

feat(pressure2): 添加客户端单位豁免状态功能

- 在锅炉计划调度对话框中引入ClientUnitApi用于获取客户单位信息
- 在管道计划调度对话框中引入ClientUnitApi用于获取客户单位信息
- 根据任务中的unitId查询客户单位的豁免状态
- 将查询到的豁免状态设置到表单数据中的inIsExempt、outIsExempt和preIsExempt字段
- 将查询到的豁免状态设置到表单数据中的yearIsExempt和legalIsExempt字段
- 实现基于客户单位豁免状态的动态表单填充功能
xuzhancheng hai 1 mes
pai
achega
a7e788b03f

+ 9 - 0
yudao-ui-admin-vue3/src/views/pressure2/equipboilerscheduling/components/BoilerPlanScheduleDialog.vue

@@ -442,6 +442,7 @@ import {processInspectorGroups} from './inspector'
 import type {ProcessedDeptData} from './inspector'
 import {InspectionNatureTypeApi} from "@/api/pressure2/inspectionnaturetype";
 import {getDept} from "@/api/system/dept";
+import {ClientUnitApi} from "../../../../api/system/clientunit";
 
 const message = useMessage()
 const {queryCheckItemList, querySchedulingCheckItemList} = BoilerTaskOrderApi
@@ -1161,6 +1162,14 @@ const handleQueryCheckItemList = async () => {
       return
     }
   }
+  const unitId = allTasks.length > 0 ? allTasks[0].unitId : undefined
+  if (unitId){
+    ClientUnitApi.getClientUnit(unitId).then(res => {
+      formData.value.inIsExempt = res.isExempt
+      formData.value.outIsExempt = res.isExempt
+      formData.value.preIsExempt = res.isExempt
+    })
+  }
 
   // 获取统一的设备类型,如果列表为空则设为 undefined
   const equipType = allTasks.length > 0 ? allTasks[0].type : undefined

+ 8 - 0
yudao-ui-admin-vue3/src/views/pressure2/pipescheduling/components/PipePlanScheduleDialog.vue

@@ -339,6 +339,7 @@ import {processInspectorGroups} from '@/views/pressure2/equipboilerscheduling/co
 import type {ProcessedDeptData} from '@/views/pressure2/equipboilerscheduling/components/inspector'
 import {useUserStoreWithOut} from '@/store/modules/user'
 import {InspectionNatureTypeApi} from "@/api/pressure2/inspectionnaturetype";
+import {ClientUnitApi} from "../../../../api/system/clientunit";
 
 const message = useMessage()
 const {queryCheckItemList, querySchedulingCheckItemList} = PipeTaskOrderApi
@@ -862,6 +863,13 @@ const handleQueryCheckItemList = async () => {
       return
     }
   }
+  const unitId = allTasks.length > 0 ? allTasks[0].unitId : undefined
+  if (unitId){
+   ClientUnitApi.getClientUnit(unitId).then(res => {
+    formData.value.yearIsExempt = res.isExempt
+    formData.value.legalIsExempt = res.isExempt
+   })
+  }
 
   // 获取统一的设备类型,如果列表为空则设为 undefined
   const equipType = allTasks.length > 0 ? allTasks[0].pipeCategory : undefined