Przeglądaj źródła

完善设备列表功能

yangguanjin 2 tygodni temu
rodzic
commit
059072d155

+ 20 - 0
src/api/ApiRouter/taskOrder.ts

@@ -32,6 +32,7 @@ import {
   updatePipeTaskOrder,
   getPipeOrderForm,
   addPipeMajorIssues,
+  batchSuspendPipeOrderItem
 } from '@/api/pipe/pipeTaskOrder'
 import {
   getBoilerTaskConfirmPage,
@@ -49,6 +50,7 @@ import {
   updateBoilerTaskOrder,
   getBoilerOrderForm,
   addBoilerMajorIssues,
+  batchSuspendBoilerOrderItem
 } from '@/api/boiler/boilerTaskOrder'
 
 type Adapter = {
@@ -75,6 +77,7 @@ export enum TaskOrderFuncName {
   MajorIssuesAuditList,
   GetOrderForm,
   AddMajorIssues,
+  BatchSuspendEquip,
 }
 
 // 接口注册表(按接口、设备类型调用对应接口)
@@ -380,6 +383,23 @@ const map = {
       outputAdapter: null,
     },
   },
+  [TaskOrderFuncName.BatchSuspendEquip]: {
+    [EquipmentType.BOILER]: {
+      inputAdapter: null,
+      reqFunction: batchSuspendBoilerOrderItem,
+      outputAdapter: null,
+    },
+    [EquipmentType.PIPE]: {
+      inputAdapter: null,
+      reqFunction: batchSuspendPipeOrderItem,
+      outputAdapter: null,
+    },
+    [EquipmentType.CONTAINER]: {
+      inputAdapter: null,
+      reqFunction: batchSuspendBoilerOrderItem,
+      outputAdapter: null,
+    },
+  }
 }
 
 export const requestFunc = (funcName: TaskOrderFuncName, equipType: EquipmentType, params: any) => {

+ 4 - 0
src/api/boiler/boilerEquip.ts

@@ -14,3 +14,7 @@ export const getEquipBoilerById = (params: any) => {
 export const updateEquipBoiler = (body: any) => {
   return httpPUT('/pressure2/equip-boiler/update', body)
 }
+
+export const updateEquipBoilerSecurityManager = (body: any) => {
+  return httpPUT('/pressure2/equip-boiler/updateSafetyManager', body)
+}

+ 5 - 0
src/api/boiler/boilerTaskOrder.ts

@@ -91,3 +91,8 @@ export const addBoilerMajorIssues = (data: any) => {
 export const updateBoilerOrderItemChecker = (data: any) => {
   return httpPUT('pressure2/boiler-task-order/boiler-order-item/report/update-users', data)
 }
+
+// 批量拒检
+export const batchSuspendBoilerOrderItem = (data: any) => {
+  return httpPost('/pressure2/boiler-task-order-item-suspend/suspend', data)
+}

+ 9 - 0
src/api/pipe/pipeTaskOrder.ts

@@ -93,3 +93,12 @@ export const addPipeMajorIssues = (data: any) => {
 export const updatePipeOrderItemChecker = (data: any) => {
   return httpPUT('pressure2/pipe-task-order/pipe-order-item/report/update-users', data)
 }
+
+// 批量拒检
+export const batchSuspendPipeOrderItem = (data: any) => {
+  return httpPost('/pressure2/pipe-task-order-item-suspend/suspend', data)
+}
+
+export const getPipeDetailByOrderItemId = (params: any) => {
+  return httpGet('/pressure2/pipe-task-order/getDetailByOrderItemId', params)
+}

+ 4 - 0
src/api/task.ts

@@ -209,6 +209,10 @@ export const notVerifyPageApi = (params: any = {}) => {
   return httpGet('/pressure/report-template/notVerifyPage', params)
 }
 
+export const pressure2NotVerifyPageApi = (params: any = {}) => {
+  return httpGet('/pressure2/report-template/notVerifyPage', params)
+}
+
 // 任务单详情:添加重大问题隐患 - 检验方案 - 操作指导书
 export const addMajorIssuesApi = (data: any = {}) => {
   return httpPost(`/pressure/task-order/order-item/addMajorIssues`, data)

+ 33 - 0
src/pages.json

@@ -81,6 +81,26 @@
         "navigationStyle": "custom"
       }
     },
+    {
+      "path": "pages/importanceEditor/importanceEditor",
+      "type": "page",
+      "layout": "default",
+      "style": {
+        "navigationBarTitleText": "",
+        "navigationStyle": "custom",
+        "disableScroll": true
+      }
+    },
+    {
+      "path": "pages/inspectionPlanAudit/inspectionPlanEditor",
+      "type": "page",
+      "layout": "default",
+      "style": {
+        "navigationBarTitleText": "",
+        "navigationStyle": "custom",
+        "disableScroll": true
+      }
+    },
     {
       "path": "pages/login/login",
       "type": "page",
@@ -177,6 +197,19 @@
         }
       }
     },
+    {
+      "path": "pages/taskOnline/TaskOnlinePipeEquipmentList",
+      "type": "page",
+      "layout": "default",
+      "style": {
+        "navigationBarTitleText": "管线集列表(分配项目)",
+        "navigationStyle": "custom",
+        "disableScroll": true,
+        "app-plus": {
+          "bounce": "none"
+        }
+      }
+    },
     {
       "path": "pages/taskOnlinePage/taskOnline",
       "type": "page",

+ 133 - 0
src/pages/importanceEditor/importanceEditor.vue

@@ -0,0 +1,133 @@
+<route lang="json5" type="page">
+{
+  layout: 'default',
+  style: {
+    navigationBarTitleText: '',
+    navigationStyle: 'custom',
+    disableScroll: true,
+  },
+}
+</route>
+
+<template>
+  <div>
+    <SpreadDesignerGeneric
+      :businessConfig="businessConfig"
+      :templateData="templateData"
+      :templateBlob="templateBlob"
+      @save="handleSave"
+      @cancel="handleCancel"
+    />
+  </div>
+</template>
+
+<script setup lang="ts">
+import { ref } from 'vue'
+import SpreadDesignerGeneric from '@/components/SpreadDesigner/spreadDesignerGeneric.vue'
+import { onLoad } from '@dcloudio/uni-app'
+import { buildFileUrl } from '@/utils/index'
+import { getStandardTemplate } from '@/api/index'
+import { getDynamicTbVal, saveDynamicTbVal } from '@/api/task'
+
+const businessConfig = ref({
+  businessType: 'ZDWT',
+  title: '重大问题线索告知表编辑',
+  disableNavigate: true,
+
+  ui: {
+    title: '重大问题线索告知表',
+    saveButtonText: '保存',
+    cancelButtonText: '取消',
+    showAdditionalToolbar: true,
+    customButtons: [],
+  },
+})
+const templateBlob = ref<string>('')
+const templateData = ref<any>({})
+
+let templateId: string = ''
+let refId: string = ''
+
+onLoad((options: any) => {
+  templateId = options.templateId
+  refId = options.refId
+  init()
+})
+
+const instId = ref<string>('')
+const init = async () => {
+  uni.hideLoading()
+  if (!templateId || !refId) {
+    return
+  }
+
+  const res = await getStandardTemplate({ id: templateId })
+  const resData = (res as any).data
+  const dataMap: any = {}
+
+  const dynamicTbValResp = await getDynamicTbVal({ refId })
+  const dynamicTb: any = dynamicTbValResp.data
+  instId.value = dynamicTb?.dynamicTbInsRespVO?.id || ''
+  for (let i = 0; i < dynamicTb.dynamicTbValRespVOList.length; i++) {
+    const item = dynamicTb.dynamicTbValRespVOList[i]
+    dataMap[item.colCode] = item.valValue
+  }
+
+  templateData.value = {
+    schema: resData.bindingPathSchema ? JSON.parse(resData.bindingPathSchema) : {},
+    data: {
+      ...dataMap,
+      templateId,
+      templateUrl: resData.fileUrl,
+    },
+    pathNameMapping: JSON.parse(resData.bindingPathNameJson),
+    template: templateId,
+    templateUrl: resData.fileUrl,
+  }
+
+  const fileUri = resData.fileUrl
+  const fileUrl = buildFileUrl(fileUri)
+  const fileBase64 = await downloadFileAsBase64(fileUrl)
+  templateBlob.value = fileBase64
+}
+
+const downloadFileAsBase64 = (fileUrl: string): Promise<string> => {
+  return new Promise((resolve, reject) => {
+    uni.request({
+      url: fileUrl,
+      method: 'GET',
+      responseType: 'arraybuffer',
+      success: (res) => {
+        if (res.statusCode === 200) {
+          const arrayBuffer = res.data as ArrayBuffer
+          const uint8Array = new Uint8Array(arrayBuffer)
+          const binaryString = uint8Array.reduce((data, byte) => {
+            return data + String.fromCharCode(byte)
+          }, '')
+          const base64 = btoa(binaryString)
+          resolve(base64)
+        } else {
+          reject(new Error(`Request failed with status ${res.statusCode}`))
+        }
+      },
+      fail: (err) => {
+        reject(err)
+      },
+    })
+  })
+}
+
+const handleSave = async (data: any) => {
+  const result = await saveDynamicTbVal({ params: data.dataJSON, instId: instId.value })
+  if (result?.code === 0 && result?.data) {
+    uni.showToast({ title: '保存成功', icon: 'success' })
+  } else {
+    const msg = result?.msg || '保存失败'
+    uni.showToast({ title: msg, icon: 'error' })
+  }
+}
+
+const handleCancel = () => {
+  uni.navigateBack()
+}
+</script>

+ 133 - 0
src/pages/inspectionPlanAudit/inspectionPlanEditor.vue

@@ -0,0 +1,133 @@
+<route lang="json5" type="page">
+{
+  layout: 'default',
+  style: {
+    navigationBarTitleText: '',
+    navigationStyle: 'custom',
+    disableScroll: true,
+  },
+}
+</route>
+
+<template>
+  <div>
+    <SpreadDesignerGeneric
+      :businessConfig="businessConfig"
+      :templateData="templateData"
+      :templateBlob="templateBlob"
+      @save="handleSave"
+      @cancel="handleCancel"
+    />
+  </div>
+</template>
+
+<script setup lang="ts">
+import { ref } from 'vue'
+import SpreadDesignerGeneric from '@/components/SpreadDesigner/spreadDesignerGeneric.vue'
+import { onLoad } from '@dcloudio/uni-app'
+import { buildFileUrl } from '@/utils/index'
+import { getStandardTemplate } from '@/api/index'
+import { getDynamicTbVal, saveDynamicTbVal } from '@/api/task'
+
+const businessConfig = ref({
+  businessType: 'JYFA',
+  title: '检验方案编辑',
+  disableNavigate: true,
+
+  ui: {
+    title: '检验方案',
+    saveButtonText: '保存',
+    cancelButtonText: '取消',
+    showAdditionalToolbar: true,
+    customButtons: [],
+  },
+})
+const templateBlob = ref<string>('')
+const templateData = ref<any>({})
+
+let templateId: string = ''
+let refId: string = ''
+
+onLoad((options: any) => {
+  templateId = options.templateId
+  refId = options.refId
+  init()
+})
+
+const instId = ref<string>('')
+const init = async () => {
+  uni.hideLoading()
+  if (!templateId || !refId) {
+    return
+  }
+
+  const res = await getStandardTemplate({ id: templateId })
+  const resData = (res as any).data
+  const dataMap: any = {}
+
+  const dynamicTbValResp = await getDynamicTbVal({ refId })
+  const dynamicTb: any = dynamicTbValResp.data
+  instId.value = dynamicTb?.dynamicTbInsRespVO?.id || ''
+  for (let i = 0; i < dynamicTb.dynamicTbValRespVOList.length; i++) {
+    const item = dynamicTb.dynamicTbValRespVOList[i]
+    dataMap[item.colCode] = item.valValue
+  }
+
+  templateData.value = {
+    schema: resData.bindingPathSchema ? JSON.parse(resData.bindingPathSchema) : {},
+    data: {
+      ...dataMap,
+      templateId,
+      templateUrl: resData.fileUrl,
+    },
+    pathNameMapping: JSON.parse(resData.bindingPathNameJson),
+    template: templateId,
+    templateUrl: resData.fileUrl,
+  }
+
+  const fileUri = resData.fileUrl
+  const fileUrl = buildFileUrl(fileUri)
+  const fileBase64 = await downloadFileAsBase64(fileUrl)
+  templateBlob.value = fileBase64
+}
+
+const downloadFileAsBase64 = (fileUrl: string): Promise<string> => {
+  return new Promise((resolve, reject) => {
+    uni.request({
+      url: fileUrl,
+      method: 'GET',
+      responseType: 'arraybuffer',
+      success: (res) => {
+        if (res.statusCode === 200) {
+          const arrayBuffer = res.data as ArrayBuffer
+          const uint8Array = new Uint8Array(arrayBuffer)
+          const binaryString = uint8Array.reduce((data, byte) => {
+            return data + String.fromCharCode(byte)
+          }, '')
+          const base64 = btoa(binaryString)
+          resolve(base64)
+        } else {
+          reject(new Error(`Request failed with status ${res.statusCode}`))
+        }
+      },
+      fail: (err) => {
+        reject(err)
+      },
+    })
+  })
+}
+
+const handleSave = async (data: any) => {
+  const result = await saveDynamicTbVal({ params: data.dataJSON, instId: instId.value })
+  if (result?.code === 0 && result?.data) {
+    uni.showToast({ title: '保存成功', icon: 'success' })
+  } else {
+    const msg = result?.msg || '保存失败'
+    uni.showToast({ title: msg, icon: 'error' })
+  }
+}
+
+const handleCancel = () => {
+  uni.navigateBack()
+}
+</script>

+ 155 - 285
src/pages/taskOnline/TaskOnlineEquipmentList.vue

@@ -108,20 +108,27 @@
         <text class="select-all-text">全选</text>
       </view>
       <view class="btn-group">
-        <button class="operate-btn blue-btn" @click="showMoreOperate = true">更多操作</button>
-        <!-- <button
-          class="operate-btn white-btn"
-          @click="showBatchClaimPopup({ text: '是否取消认领已选择的设备?', isClaim: true })"
+        <button
+          class="operate-btn blue-btn"
+          :style="!selectedEquipments.length ? { opacity: 0.5 } : {}"
+          @click="selectedEquipments.length && (showMoreOperate = true)"
         >
-          取消认领
-        </button> -->
+          更多操作
+        </button>
         <button
           class="operate-btn white-btn"
-          @click="showBatchClaimPopup({ text: '是否认领已选择的设备?', isClaim: false })"
+          :style="!selectedEquipments.length ? { opacity: 0.5 } : {}"
+          @click="selectedEquipments.length && showBatchClaimPopup({ text: '是否认领已选择的设备?', isClaim: false })"
         >
           批量认领
         </button>
-        <button class="operate-btn blue-btn" @click="showCheckProjectPopup">添加项目</button>
+        <button
+          class="operate-btn blue-btn"
+          :style="!selectedEquipments.length ? { opacity: 0.5 } : {}"
+          @click="selectedEquipments.length && showCheckProjectPopup()"
+        >
+          添加项目
+        </button>
       </view>
     </view>
 
@@ -137,17 +144,6 @@
 
     <view v-if="showMoreOperate" class="more-operate-overlay" @click="showMoreOperate = false">
       <view class="more-operate-panel" :class="{ 'more-panel-show': showMoreOperate }">
-        <view
-          class="more-btn-item"
-          :class="{ disabled: !canInform }"
-          @click="canInform && showAddSpacePopup()"
-        >
-          <view class="more-btn-inner">
-            <text class="more-btn-text" :style="{ color: canInform ? 'rgb(51,51,51)' : '#ccc' }">
-              添加有限空间记录
-            </text>
-          </view>
-        </view>
         <view
           class="more-btn-item"
           :class="{ disabled: !canInform }"
@@ -155,7 +151,7 @@
         >
           <view class="more-btn-inner more-btn-border">
             <text class="more-btn-text" :style="{ color: canInform ? 'rgb(51,51,51)' : '#ccc' }">
-              重大问题线索告知
+              重大问题线索
             </text>
           </view>
         </view>
@@ -186,13 +182,13 @@
         </view>
         <view
           class="more-btn-item"
-          :class="{ disabled: !canAddInspectionplan }"
-          @click="canAddInspectionplan && handleUpdateContact()"
+          :class="{ disabled: !canUpdateContact }"
+          @click="canUpdateContact && handleUpdateContact()"
         >
           <view class="more-btn-inner more-btn-border">
             <text
               class="more-btn-text"
-              :style="{ color: canAddInspectionplan ? 'rgb(51,51,51)' : '#ccc' }"
+              :style="{ color: canUpdateContact ? 'rgb(51,51,51)' : '#ccc' }"
             >
               修改安全管理员
             </text>
@@ -224,7 +220,7 @@
           <wd-picker
             v-model="selectedTemplateId"
             :columns="templateListColumn"
-            @change="onTemplateChange"
+            @confirm="onTemplateChange"
           />
         </view>
         <view class="form-item">
@@ -238,59 +234,20 @@
       </view>
     </view>
 
-    <view v-if="showUpdateContactPopup" class="popup-mask" @click="showUpdateContactPopup = false">
-      <view class="popup-content" @click.stop>
-        <UpdateContactPopup
-          :ids="selectedEquipIds"
-          :safe-manager="currentItem?.safeManager || ''"
-          :safe-manager-phone="currentItem?.safeManagerPhone || ''"
-          :safe-manager-id-number="currentItem?.safeManagerIdNumber || ''"
-          :operator-id-number="currentItem?.operatorIdNumber || ''"
-          @hide="showUpdateContactPopup = false"
-          @refresh="refreshList"
-        />
-      </view>
-    </view>
-
-    <view v-if="showSpaceTemplatePopup" class="popup-mask" @click="showSpaceTemplatePopup = false">
-      <view class="popup-content" @click.stop>
-        <text class="popup-title">选择模板</text>
-        <scroll-view scroll-y class="template-scroll">
-          <view
-            v-for="tpl in spaceTemplateList"
-            :key="tpl.id"
-            class="template-item"
-            :class="{ active: selectedSpaceTemplateId === tpl.id }"
-            @click="selectedSpaceTemplateId = tpl.id"
-          >
-            <text>{{ tpl.name }}</text>
-          </view>
-        </scroll-view>
-        <view class="popup-actions">
-          <button class="action-btn cancel-btn" @click="showSpaceTemplatePopup = false">
-            取消
-          </button>
-          <button class="action-btn confirm-btn" @click="confirmSpaceTemplate">确定</button>
-        </view>
-      </view>
-    </view>
+    <UpdateSafetyManagerPopup
+      v-if="showUpdateContactPopup"
+      :safe-manager="currentSafeManager.name"
+      :safe-manager-phone="currentSafeManager.phone"
+      @hide="showUpdateContactPopup = false"
+      @confirm="handleUpdateSafetyManagerConfirm"
+    />
   </view>
 </template>
 
 <script lang="ts" setup>
 import { ref, computed } from 'vue'
 import { onLoad, onShow } from '@dcloudio/uni-app'
-import {
-  getTaskEquipmentList,
-  cancelClaim,
-  confirmTaskClaim,
-  batchClaim,
-  orderItemMajorCheck,
-  getEquipmentsTemplateJSONData,
-  taskOrderItemSuspendApi,
-  notVerifyPageApi,
-  addMajorIssuesApi,
-} from '@/api/task'
+import { batchClaim, pressure2NotVerifyPageApi } from '@/api/task'
 import { useUserStore } from '@/store/user'
 import { useConfigStore } from '@/store/config'
 import {
@@ -298,13 +255,11 @@ import {
   PressureCheckerMyTaskStatusMap,
   EquipmentType,
 } from '@/utils/dictMap'
-// import { createBusinessConfig } from '@/pages/webview/common/config/businessEditorConfig'
-import { setSpreadsheetEditParams } from '@/common/global'
-import { formatDate } from '@/utils/index'
 import dayjs from 'dayjs'
-import UpdateContactPopup from '@/pages/unClaim/components/UpdateContactPopup.vue'
-import * as signApis from '@/api/sign'
+import UpdateSafetyManagerPopup from '@/pages/unClaim/components/UpdateSafetyManagerPopup.vue'
 import { TaskOrderFuncName, requestFunc } from '@/api/ApiRouter/taskOrder'
+import { getBoilerTaskItemListByOrderId } from '@/api/boiler/boilerTaskOrder'
+import { updateEquipBoilerSecurityManager } from '@/api/boiler/boilerEquip'
 import NavBar from '@/components/NavBar/NavBar.vue'
 
 interface PopupData {
@@ -330,6 +285,7 @@ const selectedMap = ref<Record<string, boolean>>({})
 const canInform = ref(false)
 const canSuspend = ref(false)
 const canAddInspectionplan = ref(false)
+const canUpdateContact = ref(false)
 
 const showTipsPopup = ref(false)
 const tipsPopupData = ref<PopupData>({ text: '', isClaim: false })
@@ -344,15 +300,24 @@ const selectedTemplate = ref<any>(null)
 const selectedTemplateId = ref('')
 const templateList = ref<any[]>([])
 const templateListColumn = computed(() => [
-  templateList.value.map((item) => ({ label: item.name, value: item.id })),
+  templateList.value.map((item) => ({ label: item.tbName, value: item.id })),
 ])
 
 const showUpdateContactPopup = ref(false)
 const currentItem = ref<any>({})
 
-const showSpaceTemplatePopup = ref(false)
-const spaceTemplateList = ref<any[]>([])
-const selectedSpaceTemplateId = ref('')
+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] || '',
+  }
+})
 
 onLoad((options: any) => {
   orderId.value = options?.orderId || ''
@@ -367,19 +332,9 @@ const selectedEquipIds = computed(() => selectedEquipments.value.map((item) => i
 
 const fetchCheckerOnlineEquipmentList = async () => {
   loading.value = true
-  const apiParams: any = {
-    orderId: orderId.value,
-    pageSize: 999,
-    pageNo: 1,
-    taskStatusList: [400, 500, 510],
-  }
   try {
-    const equipmentListData = await requestFunc(
-      TaskOrderFuncName.TaskEquipList,
-      equipType,
-      apiParams,
-    )
-    equipmentList.value = equipmentListData?.data?.list || []
+    const res = await getBoilerTaskItemListByOrderId({ id: orderId.value })
+    equipmentList.value = res?.data?.orderItems || []
   } catch (error) {
     console.error('获取设备列表失败:', error)
   } finally {
@@ -427,12 +382,9 @@ const handleSelectAll = () => {
 
 const updateOperateStatus = () => {
   canInform.value = selectedEquipments.value.length === 1
-  canAddInspectionplan.value = selectedEquipments.value.length > 0
-  const hasUnClaim =
-    selectedEquipments.value.length > 0
-      ? selectedEquipments.value.some((equipments) => !equipments.isClaim)
-      : true
-  canSuspend.value = !hasUnClaim
+  canAddInspectionplan.value = selectedEquipments.value.length >= 1
+  canUpdateContact.value = selectedEquipments.value.length === 1
+  canSuspend.value = selectedEquipments.value.length >= 1
 }
 
 const initSelect = () => {
@@ -488,9 +440,13 @@ const fetchClaimEquipments = async (equipmentId: string, isClaim: boolean) => {
   try {
     let result: any
     if (isClaim) {
-      result = await requestFunc(TaskOrderFuncName.EquipmentConfirmClaim, equipType, { id: equipmentId })
+      result = await requestFunc(TaskOrderFuncName.EquipmentConfirmClaim, equipType, {
+        id: equipmentId,
+      })
     } else {
-      result = await requestFunc(TaskOrderFuncName.EquipmentCancelClaim, equipType, { id: equipmentId })
+      result = await requestFunc(TaskOrderFuncName.EquipmentCancelClaim, equipType, {
+        id: equipmentId,
+      })
     }
     updateClaim(result, [equipmentId], !isClaim)
   } catch (error) {
@@ -544,7 +500,8 @@ const suspendCheck = async () => {
   uni.showLoading({ title: '加载中' })
   const ids = selectedEquipments.value.map((item: any) => item.id)
   try {
-    const result = await taskOrderItemSuspendApi({ orderItemIds: ids, reason: suspendReason.value })
+    const reqData = { orderItemIds: ids, reason: suspendReason.value, flag: 1 }
+    const result = await requestFunc(TaskOrderFuncName.BatchSuspendEquip, equipType, reqData)
     uni.hideLoading()
     if (result?.code === 0) {
       initSelect()
@@ -567,150 +524,47 @@ const createInform = async () => {
     return uni.showToast({ title: '无网络连接,请联网重试' })
   }
   if (!orderId.value) return
-  try {
-    showMoreOperate.value = false
-    const equipment = selectedEquipments.value[0]
-    const majorcheckres = await orderItemMajorCheck({ orderItemIds: [equipment?.id] })
-    const equipmentReportId =
-      (equipment.reportDOList || []).find((item: any) => item.reportType === 500)?.id || ''
-    if (majorcheckres.data[equipment?.id]) {
-      const item = majorcheckres.data[equipment?.id]
-      if (item.isSignature === '1') {
-        uni.redirectTo({
-          url: `/pages/sign-detail/index?orderId=${orderId.value}&type=ZXXX&orderItemId=${equipment?.id}&reportId=${equipmentReportId}`,
-        })
-      } else {
-        uni.redirectTo({
-          url: `/pages/sign/index?orderId=${orderId.value}&type=ZXXX&orderItemId=${equipment?.id}&reportId=${equipmentReportId}`,
-        })
-      }
-      return
-    }
-    const configRes = await signApis.getGcConfig(
-      {
-        orderId: orderId.value,
-        businessType: 400,
-        orderItemId: equipment.id,
-      },
-      userInfo.value,
-    )
-    if (configRes?.code === 0) {
-      const initJSONResult = await getEquipmentsTemplateJSONData({
-        taskOrderNo: orderNo.value,
-        templateId: configRes.data?.templateId,
-        equipCode: equipment?.equipCode,
-      })
-      const dataStr = initJSONResult?.data ? JSON.parse(initJSONResult.data) : {}
-      const { id, nickname, mobile } = userInfo.value || {}
-      const params = {
-        dataStr: JSON.stringify({
-          ...dataStr,
-          notifierSignName: nickname,
-          notifierSignDate: dayjs().format('YYYY年MM月DD日'),
-          notifierPhone: mobile,
-        }),
-        standardInitData: configRes.data?.standardInitData,
-        templateUrl: configRes.data?.templateUrl,
-        templateId: configRes.data?.templateId,
-        orderItemId: equipment.id,
-        prepareId: id || '',
-        prepareName: nickname || '',
-        translateInitData: '{}',
-        reportId: equipmentReportId,
-      }
-      const businessConfig = createBusinessConfig('ZXXX')
-      setSpreadsheetEditParams({
-        routeType: 'ZXXX',
-        orderId: orderId.value,
-        gcConfig: params,
-        businessConfig,
-      })
-      uni.navigateTo({
-        url: `/pages/webview/generic-webview?businessType=ZXXX&orderId=${orderId.value}&templateId=${configRes.data?.id}&useOnline=1`,
-      })
-    } else {
-      uni.showToast({ title: '获取配置信息失败' })
-    }
-  } catch (configError) {
-    console.error('获取葡萄城配置信息失败:', configError)
-    uni.showToast({ title: '获取配置信息失败,请重试' })
+
+  if(selectedEquipments.value.length !== 1) {
+    return uni.showToast({ title: '只能选择一个设备添加重大问题线索', icon: 'error' })
   }
-}
 
-const showAddSpacePopup = async () => {
-  if (!selectedEquipments.value.length) {
-    return uni.showToast({ title: '请先选择设备', icon: 'error' })
+  const selectedEquipment = selectedEquipments.value[0]
+  const majorIssue = selectedEquipment.reportDOList.find((item: any) => item.reportType == 500)
+  if (majorIssue) {
+    return uni.showToast({ title: '该设备已添加了重大问题线索', icon: 'error' })
   }
+
+
+  uni.showLoading({ title: '提交中...', mask: true })
   try {
-    const result = await notVerifyPageApi({ type: '10', status: 200, pageNo: 1, pageSize: 9999 })
-    const list = (result?.data?.list || []).map((item: any) => {
-      return { ...item, label: item.name || '', value: item.id || '' }
+    const orderFormResp = await requestFunc(TaskOrderFuncName.GetOrderForm, equipType, {
+      orderId: orderId.value,
+      businessType: 400,
+      orderItemId: selectedEquipment.id,
+    })
+    const templateId = orderFormResp?.data?.templateId || ''
+    const addMajorIssueResp = await requestFunc(TaskOrderFuncName.AddMajorIssues, equipType, {
+      orderFormEnterReqVO: {
+        businessType: 400,
+        modifiedReason: "",
+        orderId: orderId.value,
+        orderItemId: selectedEquipment.id,
+      },
+      orderId: orderId.value,
+      orderItemId: selectedEquipment.id,
+      prepareId: userInfo.value?.id || '',
+      prepareName: userInfo.value?.nickname || '',
+      templateId: templateId,
+    })
+    const refId = addMajorIssueResp?.data || ''
+    uni.navigateTo({
+      url: `/pages/importanceEditor/importanceEditor?templateId=${templateId}&refId=${refId}`,
     })
-    if (!list.length) {
-      return uni.showToast({ title: '暂无有限空间记录模板', icon: 'error' })
-    }
-    spaceTemplateList.value = list
-    selectedSpaceTemplateId.value = ''
-    showMoreOperate.value = false
-    showSpaceTemplatePopup.value = true
   } catch (error) {
-    uni.showToast({ title: '获取有限空间记录模板失败' })
-  }
-}
-
-const confirmSpaceTemplate = () => {
-  if (!selectedSpaceTemplateId.value) {
-    return uni.showToast({ title: '请选择一个模板', icon: 'error' })
-  }
-  const currentTemplate = spaceTemplateList.value.find(
-    (item) => item.id === selectedSpaceTemplateId.value,
-  )
-  if (!currentTemplate) {
-    return uni.showToast({ title: '模板不存在', icon: 'error' })
-  }
-  const currentRow = selectedEquipments.value[0]
-  const defaultDataSource: Record<string, any> = {
-    reportNo: currentTemplate.name,
-    jyName: userInfo.value?.nickname || '',
-    signName: userInfo.value?.nickname || '',
-    signDate: formatDate(new Date(), 'YYYY年MM月DD日'),
-  }
-  const reportRespVOList = currentRow?.reportDOList || []
-  const unitName = currentRow?.unitName || ''
-  defaultDataSource.reportNo = reportRespVOList[0]?.reportNo || ''
-  defaultDataSource.unitName = unitName
-  const params = {
-    dataStr: JSON.stringify({ ...defaultDataSource }),
-    standardInitData: currentTemplate?.bindingPathSchema,
-    templateUrl: currentTemplate?.recordTemplateUrl || '',
-    templateId: currentTemplate?.id,
-    orderId: orderId.value,
-    orderItemId: currentRow.id,
-    prepareId: userInfo.value?.id || '',
-    prepareName: userInfo.value?.nickname || '',
-    reportName: currentTemplate.name || '',
-    translateInitData: '{}',
-    cacheParams: {
-      objId: `${currentRow.id}_${currentTemplate.id}`,
-      type: 8,
-      cachTime: currentRow.updateTime || currentRow.createTime,
-    },
+    uni.hideLoading()
+    uni.showToast({ title: '操作失败', icon: 'error' })
   }
-  const businessConfig = createBusinessConfig('YXKJ')
-  setSpreadsheetEditParams({
-    routeType: 'YXKJ',
-    orderId: orderId.value,
-    gcConfig: params,
-    businessConfig,
-  })
-  showSpaceTemplatePopup.value = false
-  uni.navigateTo({
-    url: `/pages/webview/generic-webview?businessType=YXKJ&orderId=${orderId.value}&templateId=${currentTemplate.id}&useOnline=1`,
-  })
-}
-
-const createBusinessConfig = (name) => {
-
 }
 
 const showAddInspectionplanPopup = async () => {
@@ -722,8 +576,14 @@ const showAddInspectionplanPopup = async () => {
   inspectionplanName.value = ''
   selectedTemplate.value = null
   try {
-    const result = await notVerifyPageApi({ type: '1', status: 200, pageNo: 1, pageSize: 9999 })
-    templateList.value = result?.data?.list || []
+    const result = await pressure2NotVerifyPageApi({
+      type: '6',
+      reportType: 600,
+      status: 200,
+      pageNo: 1,
+      pageSize: 9999,
+    })
+    templateList.value = result?.data || []
   } catch (error) {
     console.error('获取模板列表失败:', error)
   }
@@ -733,61 +593,40 @@ const closeInspectionplanPopup = () => {
   showInspectionplanPopup.value = false
 }
 
-const onTemplateChange = ({ selected }) => {
-  const index = selected[0]
-  selectedTemplate.value = templateList.value[index]
-  selectedTemplateId.value = selectedTemplate.value?.id || ''
+const onTemplateChange = (selected) => {
+  selectedTemplate.value = selected.selectedItems.label
+  selectedTemplateId.value = selected.selectedItems.value
 }
 
 const addInspectionplanConfirm = async () => {
-  const templateId = selectedTemplate.value?.id
-  if (!templateId) {
+  if (!selectedTemplate.value) {
     return uni.showToast({ title: '请选择模板封面', icon: 'error' })
   }
   if (!inspectionplanName.value.trim()) {
     return uni.showToast({ title: '请输入检验方案名称', icon: 'error' })
   }
   closeInspectionplanPopup()
-  await handleSuccessInspectionplan({ templateId, reportName: inspectionplanName.value.trim() })
-}
-
-const handleSuccessInspectionplan = async (info: any) => {
+  uni.showLoading({ title: '提交中...', mask: true })
   try {
-    uni.showLoading({ title: '添加中' })
-    const resultData = await getEquipmentsTemplateJSONData({
-      taskOrderNo: orderNo.value,
-      templateId: info.templateId,
-      equipCode: selectedEquipments.value[0].equipCode,
-    })
-    const defaultUser: Record<string, any> = {
-      prepareName: userInfo.value?.nickname || '',
-      prepareDate: dayjs().format('YYYY年MM月DD日'),
-    }
-    const initJSONResult = resultData?.data || ''
-    const prepareJson = initJSONResult
-      ? { ...JSON.parse(initJSONResult), ...defaultUser }
-      : defaultUser
-    const addParams = {
+    const reqData = {
       orderId: orderId.value,
-      templateId: info.templateId,
-      prepareJson: JSON.stringify(prepareJson),
-      prepareId: userInfo.value?.id,
-      prepareName: userInfo.value?.nickname,
       orderItemIds: selectedEquipments.value.map((item) => item.id),
-      reportName: info.reportName,
-    }
-    const result = await addMajorIssuesApi(addParams)
-    const newReportId = result?.data || ''
-    if (!newReportId) {
-      uni.hideLoading()
-      return uni.showToast({ title: '添加失败', icon: 'error' })
+      prepareId: userInfo.value?.id || '',
+      prepareJson: JSON.stringify({
+        prepareName: userInfo.value?.nickname || '',
+        prepareDate: dayjs().format('YYYY年MM月DD日'),
+      }),
+      prepareName: userInfo.value?.nickname || '',
+      reportName: inspectionplanName.value.trim(),
+      templateId: selectedTemplateId.value,
     }
-    const url = `/pages/inspectionplanDetail/inspectionplanDetail?reportId=${newReportId}&reportName=${info.reportName}&orderId=${orderId.value}&templateId=${info.templateId}&prepareJson=${encodeURIComponent(JSON.stringify(prepareJson))}`
-    uni.navigateTo({ url })
+    const res = await requestFunc(TaskOrderFuncName.AddMajorIssues, equipType, reqData)
+    uni.navigateTo({
+      url: `/pages/inspectionPlanAudit/inspectionPlanEditor?templateId=${selectedTemplateId.value}&refId=${res?.data || ''}`,
+    })
   } catch (error) {
-    uni.showToast({ title: '添加检验方案失败', icon: 'error' })
-  } finally {
     uni.hideLoading()
+    uni.showToast({ title: '操作失败', icon: 'error' })
   }
 }
 
@@ -798,6 +637,41 @@ const handleUpdateContact = () => {
   showUpdateContactPopup.value = true
 }
 
+const handleUpdateSafetyManagerConfirm = async (params: { name: string; phone: string }) => {
+  if (selectedEquipIds.value.length < 1) {
+    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 results = await Promise.all(updatePromises)
+    uni.hideLoading()
+
+    const allSuccess = results.every((res: any) => res?.code === 0)
+    if (allSuccess) {
+      uni.showToast({ title: '修改成功', icon: 'success' })
+      showUpdateContactPopup.value = false
+      refreshList()
+    } else {
+      uni.showToast({ title: '部分修改失败', icon: 'none' })
+    }
+  } catch (error) {
+    uni.hideLoading()
+    console.error('修改安全管理员失败:', error)
+    uni.showToast({ title: '修改失败', icon: 'none' })
+  }
+}
+
 const handleRouteToEquipmentDetail = (item: any, pageType: string) => {
   uni.navigateTo({
     url: `/pages/equipment/detail/equipmentDetail?orderId=${orderId.value}&orderItemId=${item.id}&equipId=${item.equipId}&pageType=${pageType}&useOnline=1&canEdit=${true}`,
@@ -810,10 +684,6 @@ const handleCalcTotalFee = (reportDOList: any) => {
     .filter((x: any) => x.fee && !isNaN(x.fee) && typeof x.fee === 'number')
     .reduce((sum: number, item: any) => sum + item.fee, 0)
 }
-
-const goBack = () => {
-  uni.navigateBack()
-}
 </script>
 
 <style lang="scss" scoped>
@@ -1250,7 +1120,7 @@ const goBack = () => {
 }
 
 .form-input {
-  padding: 8px;
+  padding: 0px;
   font-size: 14px;
   background-color: #f5f5f5;
   border-radius: 4px;

Plik diff jest za duży
+ 1230 - 0
src/pages/taskOnline/TaskOnlinePipeEquipmentList.vue


+ 5 - 2
src/pages/unClaim/components/TaskItem.vue

@@ -166,9 +166,12 @@ const pushEquipmentList = () => {
       },
     })
   } else {
-    // 跳转到设备列表
+    const listPage =
+      equipType === EquipmentType.PIPE
+        ? '/pages/taskOnline/TaskOnlinePipeEquipmentList'
+        : '/pages/taskOnline/TaskOnlineEquipmentList'
     uni.navigateTo({
-      url: `/pages/taskOnline/TaskOnlineEquipmentList?orderId=${props.item.id}&orderNo=${props.item.orderNo}`,
+      url: `${listPage}?orderId=${props.item.id}&orderNo=${props.item.orderNo}`,
     })
   }
 }

+ 0 - 1
src/pages/unClaim/components/UpdateContactPopup.vue

@@ -88,7 +88,6 @@
 
 <script lang="ts" setup>
 import { ref, reactive, watch } from 'vue'
-import { updateTaskOrder } from '@/api/task'
 import { useConfigStore } from '@/store/config'
 import { TaskOrderFuncName, requestFunc } from '@/api/ApiRouter/taskOrder'
 

+ 175 - 0
src/pages/unClaim/components/UpdateSafetyManagerPopup.vue

@@ -0,0 +1,175 @@
+<template>
+  <wd-popup
+    v-model="showPopup"
+    position="center"
+    :close-on-click-modal="true"
+    custom-style="border-radius: 10px; width: 90%; max-width: 400px;"
+    @close="handleClose"
+  >
+    <view class="popup-container">
+      <view class="head-title">
+        <text class="head-title-text">修改安全管理员</text>
+      </view>
+
+      <view class="form-content">
+        <view class="form-item">
+          <text class="form-label">安全管理员:</text>
+          <input
+            class="form-input"
+            v-model="managerName"
+            placeholder="请输入安全管理员"
+          />
+        </view>
+        <view class="form-item">
+          <text class="form-label">联系电话:</text>
+          <input
+            class="form-input"
+            v-model="managerPhone"
+            placeholder="请输入联系电话"
+            type="number"
+          />
+        </view>
+      </view>
+
+      <view class="bottom-btn">
+        <button class="cancel-btn" @click="handleCancel">取消</button>
+        <button class="confirm-btn" @click="handleConfirm">确定</button>
+      </view>
+    </view>
+  </wd-popup>
+</template>
+
+<script lang="ts" setup>
+import { ref } from 'vue'
+
+interface Props {
+  safeManager?: string
+  safeManagerPhone?: string
+}
+
+const props = withDefaults(defineProps<Props>(), {
+  safeManager: '',
+  safeManagerPhone: '',
+})
+
+const emit = defineEmits<{
+  hide: []
+  confirm: [params: { name: string; phone: string }]
+}>()
+
+const showPopup = ref(true)
+const managerName = ref(props.safeManager || '')
+const managerPhone = ref(props.safeManagerPhone || '')
+
+const handleClose = () => {
+  emit('hide')
+}
+
+const handleCancel = () => {
+  showPopup.value = false
+  emit('hide')
+}
+
+const handleConfirm = () => {
+  if (!managerName.value.trim()) {
+    uni.showToast({ title: '请输入安全管理员', icon: 'none' })
+    return
+  }
+  if (!managerPhone.value.trim()) {
+    uni.showToast({ title: '请输入联系电话', icon: 'none' })
+    return
+  }
+
+  emit('confirm', {
+    name: managerName.value.trim(),
+    phone: managerPhone.value.trim(),
+  })
+}
+</script>
+
+<style lang="scss" scoped>
+.popup-container {
+  display: flex;
+  flex-direction: column;
+  background-color: #fff;
+}
+
+.head-title {
+  display: flex;
+  flex-shrink: 0;
+  justify-content: center;
+  padding: 12px 15px;
+  border-bottom: 1px solid rgb(187, 187, 187);
+}
+
+.head-title-text {
+  font-size: 18px;
+  color: rgb(51, 51, 51);
+}
+
+.form-content {
+  padding: 15px;
+}
+
+.form-item {
+  display: flex;
+  flex-direction: row;
+  gap: 8px;
+  align-items: center;
+  margin-bottom: 15px;
+}
+
+.form-item:last-child {
+  margin-bottom: 0;
+}
+
+.form-label {
+  flex-shrink: 0;
+  width: 90px;
+  font-size: 13px;
+  color: #333;
+  text-align: right;
+}
+
+.form-input {
+  flex: 1;
+  min-width: 0;
+  height: 36px;
+  padding: 0 8px;
+  font-size: 13px;
+  border: 1px solid #e0e0e0;
+  border-radius: 5px;
+}
+
+.bottom-btn {
+  display: flex;
+  flex-direction: row;
+  flex-shrink: 0;
+  justify-content: space-around;
+  padding: 10px;
+  border-top: 1px solid #eee;
+}
+
+.cancel-btn,
+.confirm-btn {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  width: 100px;
+  height: 40px;
+  font-size: 16px;
+  border: none;
+  border-radius: 4px;
+}
+
+.cancel-btn {
+  color: rgb(114, 114, 114);
+  background-color: #fff;
+  border: 1px solid rgb(187, 187, 187);
+}
+
+.confirm-btn {
+  color: rgb(241, 247, 255);
+  background-color: rgb(47, 142, 255);
+}
+</style>

+ 3 - 0
src/types/uni-pages.d.ts

@@ -8,6 +8,8 @@ interface NavigateToOptions {
        "/pages/aboutSystem/index" |
        "/pages/deviceExam/deviceExam" |
        "/pages/deviceExam/deviceExamDetail" |
+       "/pages/importanceEditor/importanceEditor" |
+       "/pages/inspectionPlanAudit/inspectionPlanEditor" |
        "/pages/login/login" |
        "/pages/securityCheck/securityCheckEditor" |
        "/pages/securityCheck/securityCheckList" |
@@ -17,6 +19,7 @@ interface NavigateToOptions {
        "/pages/sign-detail/index" |
        "/pages/systemFile/systemFile" |
        "/pages/taskOnline/TaskOnlineEquipmentList" |
+       "/pages/taskOnline/TaskOnlinePipeEquipmentList" |
        "/pages/taskOnlinePage/taskOnline" |
        "/pages/unClaim/unClaimList" |
        "/pages/unitQuery/unitQuery" |