Ver código fonte

调整检验方案审批、操作指导书审批列表字段显示;完善修改安全管理员按钮功能

yangguanjin 1 semana atrás
pai
commit
70dbd3e0b8

+ 4 - 0
src/api/pipe/pipeEquip.ts

@@ -18,3 +18,7 @@ export const getEquipPipeByTaskOrderId = (params: any) => {
 export const updateEquipPipe = (body: any) => {
   return httpPUT('/pressure2/equip-pipe/update', body)
 }
+
+export const updateEquipPipeSafetyManager = (body: any) => {
+  return httpPUT('/pressure2/equip-pipe/updateSafetyManager', body)
+}

+ 12 - 6
src/pages/equipment/detail/components/BoilerInspectProject.vue

@@ -519,12 +519,13 @@
 
     <view v-if="showSelectReportPopup" class="popup-overlay" @click="closeSelectReportPopup">
       <view class="popup-content" @click.stop>
-        <text class="popup-title">选择审核人</text>
+        <text class="popup-title">确认提交报告?</text>
+        <!-- <text class="popup-title">选择审核人</text>
         <picker :range="recheckUserGroupList" range-key="label" @change="onReportUserChange">
           <view class="picker-value">
             <text>{{ currentReckUser?.label || '请选择' }}</text>
           </view>
-        </picker>
+        </picker> -->
         <view class="popup-actions">
           <button class="action-btn cancel-btn" @click="closeSelectReportPopup">取消</button>
           <button class="action-btn confirm-btn" @click="handleSubmitReport">确定</button>
@@ -905,13 +906,18 @@ const handleRouteToInputWebview = (item: CheckItem) => {
 }
 
 const handleCalcFee = (item: CheckItem) => {
-  const userId =
+  const mainCheckerId =
     item.reportType === PressureReportType.MAIN
       ? props.equipment?.mainCheckerUser?.id
       : item?.checkUsers?.[0]?.id
 
-  if (userId && userId !== userInfo.value?.id) {
-    uni.showToast({ title: '已分配项目不支持费用录入', icon: 'error' })
+  if (mainCheckerId && mainCheckerId !== userInfo.value?.id) {
+    uni.showToast({ title: '只能主检人进行费用录入', icon: 'error' })
+    return
+  }
+
+  if (item.taskStatus === PressureCheckerMyTaskStatus.REPORT_END) {
+    uni.showToast({ title: '报告已办结,不能录入费用', icon: 'error' })
     return
   }
 
@@ -1041,7 +1047,7 @@ const showSelectReportUserPopup = async (item: CheckItem) => {
   }
 
   currentReportItem.value = item
-  await getAuditUserGroupList(item)
+  // await getAuditUserGroupList(item)
   showSelectReportPopup.value = true
 }
 

+ 5 - 4
src/pages/equipment/detail/components/PipeInspectProject.vue

@@ -281,12 +281,13 @@
 
     <view v-if="showSelectReportPopup" class="popup-overlay" @click="closeSelectReportPopup">
       <view class="popup-content" @click.stop>
-        <text class="popup-title">选择审核人</text>
-        <picker :range="recheckUserGroupList" range-key="label" @change="onReportUserChange">
+        <text class="popup-title">确认提交报告?</text>
+        <!-- <text class="popup-title">选择审核人</text> -->
+        <!-- <picker :range="recheckUserGroupList" range-key="label" @change="onReportUserChange">
           <view class="picker-value">
             <text>{{ currentReckUser?.label || '请选择' }}</text>
           </view>
-        </picker>
+        </picker> -->
         <view class="popup-actions">
           <button class="action-btn cancel-btn" @click="closeSelectReportPopup">取消</button>
           <button class="action-btn confirm-btn" @click="handleSubmitReport">确定</button>
@@ -761,7 +762,7 @@ const showSelectReportUserPopup = async (item: CheckItem) => {
   }
 
   currentReportItem.value = item
-  await getAuditUserGroupList(item)
+  // await getAuditUserGroupList(item)
   showSelectReportPopup.value = true
 }
 

+ 1 - 1
src/pages/inspectionPlanAudit/components/Item.vue

@@ -43,7 +43,7 @@
 
         <text class="title">
           使用单位:
-          <text class="text">{{ item.useUnitName }}</text>
+          <text class="text">{{ item.unitName }}</text>
         </text>
         <view class="row-center">
           <text class="title">

+ 10 - 20
src/pages/taskOnline/TaskOnlineEquipmentList.vue

@@ -336,16 +336,10 @@ const selectTemplates = ref<Record<string, any[]>>({})
 const currentSelectedCheckProjectItems = ref<any[]>([])
 const equipDataForPopup = ref<any>({})
 
-const fieldKeyMap: Record<string, { name: string; phone: string }> = {
-  [EquipmentType.BOILER]: { name: 'safery', phone: 'saferydh' },
-  [EquipmentType.CONTAINER]: { name: 'safery', phone: 'saferydh' },
-}
-
 const currentSafeManager = computed(() => {
-  const keys = fieldKeyMap[equipType] || fieldKeyMap[EquipmentType.BOILER]
   return {
-    name: currentItem.value?.[keys.name] || '',
-    phone: currentItem.value?.[keys.phone] || '',
+    name: currentItem.value?.safery || '',
+    phone: currentItem.value?.saferydh || '',
   }
 })
 
@@ -726,28 +720,24 @@ const handleUpdateSafetyManagerConfirm = async (params: { name: string; phone: s
     return uni.showToast({ title: '请选择设备', icon: 'error' })
   }
 
-  const keys = fieldKeyMap[equipType] || fieldKeyMap[EquipmentType.BOILER]
   try {
     uni.showLoading({ title: '提交中...' })
 
-    const updatePromises = selectedEquipments.value.map((item) => {
-      return updateEquipBoilerSecurityManager({
-        id: item.equipId,
-        [keys.name]: params.name,
-        [keys.phone]: params.phone,
-      })
+    const selectedEquip = selectedEquipments.value[0]
+    const results = await updateEquipBoilerSecurityManager({
+      id: selectedEquip.equipId,
+      safery: params.name,
+      saferydh: params.phone,
     })
-
-    const results = await Promise.all(updatePromises)
     uni.hideLoading()
 
-    const allSuccess = results.every((res: any) => res?.code === 0)
-    if (allSuccess) {
+    const isSuccess = results?.code === 0
+    if (isSuccess) {
       uni.showToast({ title: '修改成功', icon: 'success' })
       showUpdateContactPopup.value = false
       refreshList()
     } else {
-      uni.showToast({ title: '部分修改失败', icon: 'none' })
+      uni.showToast({ title: '修改失败', icon: 'none' })
     }
   } catch (error) {
     uni.hideLoading()

+ 9 - 12
src/pages/taskOnline/TaskOnlinePipeEquipmentList.vue

@@ -289,7 +289,7 @@ import dayjs from 'dayjs'
 import UpdateSafetyManagerPopup from '@/pages/unClaim/components/UpdateSafetyManagerPopup.vue'
 import { TaskOrderFuncName, requestFunc } from '@/api/ApiRouter/taskOrder'
 import { getPipeDetailByOrderItemId, getPipeTaskItemListByOrderId, addInspectProject } from '@/api/pipe/pipeTaskOrder'
-import { updateEquipPipe } from '@/api/pipe/pipeEquip'
+import { updateEquipPipeSafetyManager } from '@/api/pipe/pipeEquip'
 import NavBar from '@/components/NavBar/NavBar.vue'
 import PipeCheckProject from '@/pages/taskOnline/components/PipeCheckProject.vue'
 
@@ -749,24 +749,21 @@ const handleUpdateSafetyManagerConfirm = async (params: { name: string; phone: s
   try {
     uni.showLoading({ title: '提交中...' })
 
-    const updatePromises = selectedPipeSets.value.map((item) => {
-      return updateEquipPipe({
-        id: item.equipId,
-        securityMan: params.name,
-        securityManPhone: params.phone,
-      })
+    const selectedPipeSet = selectedPipeSets.value[0]
+    const results = await updateEquipPipeSafetyManager({
+      id: selectedPipeSet.id,
+      securityMan: params.name,
+      securityManPhone: params.phone,
     })
-
-    const results = await Promise.all(updatePromises)
     uni.hideLoading()
 
-    const allSuccess = results.every((res: any) => res?.code === 0)
-    if (allSuccess) {
+    const isSuccess = results?.code === 0
+    if (isSuccess) {
       uni.showToast({ title: '修改成功', icon: 'success' })
       showUpdateContactPopup.value = false
       refreshList()
     } else {
-      uni.showToast({ title: '部分修改失败', icon: 'none' })
+      uni.showToast({ title: '修改失败', icon: 'none' })
     }
   } catch (error) {
     uni.hideLoading()

+ 1 - 7
src/pages/workInstructionAudit/components/Item.vue

@@ -13,16 +13,10 @@
     <view class="item-center">
       <view>
         <view class="row-center">
-          <text class="title">
-            检验方案编号:
-            <text class="text">{{ item.reportNo || '-' }}</text>
-          </text>
           <text class="title">
             检验时间:
             <text class="text">{{ checkDate }}</text>
           </text>
-        </view>
-        <view class="row-center">
           <view class="row">
             <text class="title">状态:</text>
             <view class="status-badge">
@@ -43,7 +37,7 @@
 
         <text class="title">
           使用单位:
-          <text class="text">{{ item.useUnitName }}</text>
+          <text class="text">{{ item.unitName }}</text>
         </text>
         <view class="row-center">
           <text class="title">