Jelajahi Sumber

完善录入页面按钮功能

yangguanjin 1 bulan lalu
induk
melakukan
59a2c01f34

+ 32 - 2
src/pages.json

@@ -92,7 +92,7 @@
       }
     },
     {
-      "path": "pages/editor/importanceEditor",
+      "path": "pages/editor/inspectionPlanEditor",
       "type": "page",
       "layout": "default",
       "style": {
@@ -102,7 +102,7 @@
       }
     },
     {
-      "path": "pages/editor/inspectionPlanEditor",
+      "path": "pages/editor/mainQuestionEditor",
       "type": "page",
       "layout": "default",
       "style": {
@@ -131,6 +131,16 @@
         "disableScroll": true
       }
     },
+    {
+      "path": "pages/editor/workInstructionEditor",
+      "type": "page",
+      "layout": "default",
+      "style": {
+        "navigationBarTitleText": "",
+        "navigationStyle": "custom",
+        "disableScroll": true
+      }
+    },
     {
       "path": "pages/loading/index",
       "type": "page",
@@ -304,6 +314,26 @@
         "navigationStyle": "custom"
       }
     },
+    {
+      "path": "pages/equipment/detail/mainQuestionPreviewer",
+      "type": "page",
+      "layout": "default",
+      "style": {
+        "navigationBarTitleText": "操作指导书批准",
+        "navigationStyle": "custom",
+        "disableScroll": true
+      }
+    },
+    {
+      "path": "pages/equipment/detail/workInstructionPreviewer",
+      "type": "page",
+      "layout": "default",
+      "style": {
+        "navigationBarTitleText": "操作指导书批准",
+        "navigationStyle": "custom",
+        "disableScroll": true
+      }
+    },
     {
       "path": "pages/inspectionApproval/list/inspectionApprovalList",
       "type": "page",

+ 1 - 0
src/pages/editor/equipCheckRecordEditor.vue

@@ -9,6 +9,7 @@
 }
 </route>
 
+<!-- 检测记录编辑 -->
 <template>
   <view>
     <!-- 相比于 SpreadDesignerGeneric 悬浮输入框,有拍摄图片,但是导航栏没有扩展性 -->

+ 1 - 0
src/pages/editor/inspectionPlanEditor.vue

@@ -9,6 +9,7 @@
 }
 </route>
 
+<!-- 检验方案编辑 -->
 <template>
   <div>
     <SpreadDesignerGeneric

+ 1 - 0
src/pages/editor/importanceEditor.vue

@@ -9,6 +9,7 @@
 }
 </route>
 
+<!-- 重大问题线索编辑 -->
 <template>
   <div>
     <SpreadDesignerGeneric

+ 1 - 0
src/pages/editor/securityCheckEditor.vue

@@ -9,6 +9,7 @@
 }
 </route>
 
+<!-- 安全检查记录编辑 -->
 <template>
   <div>
     <SpreadDesignerGeneric

+ 1 - 1
src/pages/editor/serviceOrderEditor.vue

@@ -9,6 +9,7 @@
 }
 </route>
 
+<!-- 服务单/受理单编辑 -->
 <template>
   <div>
     <SpreadDesignerGeneric
@@ -31,7 +32,6 @@ import { getStandardTemplate } from '@/api/index'
 import { getDynamicTbVal, saveDynamicTbVal } from '@/api/task'
 
 const configStore = useConfigStore()
-const equipType = configStore.getEquipType()
 
 const businessConfig = ref({
   businessType: 'FWD',

+ 136 - 0
src/pages/editor/workInstructionEditor.vue

@@ -0,0 +1,136 @@
+<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: 'CZZD',
+  title: '指导书编辑',
+  disableNavigate: true, // 是否禁用跳转,默认不禁用
+
+  ui: {
+    title: '指导书编辑',
+    saveButtonText: '保存',
+    cancelButtonText: '取消',
+    showAdditionalToolbar: true,
+    customButtons: [],
+  },
+})
+const templateBlob = ref<string>('')
+const templateData = ref<any>({})
+
+let templateId: string = ''
+let orderId: string = ''
+let mode: 'edit' | 'create' = 'edit'
+let workInstructionId: string = ''
+
+onLoad((options: any) => {
+  templateId = options.templateId
+  orderId = options.orderId
+  mode = options.mode || 'edit'
+  workInstructionId = options.refId || ''
+  init()
+})
+
+const instId = ref<string>('')
+const init = async () => {
+  if (!templateId) {
+    return
+  }
+  const res = await getStandardTemplate({ id: templateId })
+  const resData = (res as any).data
+  const dataMap: any = {}
+
+  const dynamicTbValResp = await getDynamicTbVal({ refId: workInstructionId })
+  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) // 成功时 resolve Base64 字符串
+        } else {
+          reject(new Error(`Request failed with status ${res.statusCode}`))
+        }
+      },
+      fail: (err) => {
+        reject(err) // 失败时 reject 错误
+      },
+    })
+  })
+}
+
+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>

+ 1 - 1
src/pages/equipment/detail/components/BoilerInspectProject.vue

@@ -1224,7 +1224,7 @@ const handleConfirmTemplate = async () => {
     }
     
     uni.navigateTo({
-      url: `/pages/editor/equipCheckRecordEditor?userId=${userInfo.value?.id}&orderItemId=${props.orderItemId}&checkItemId=${newReportId}&templateId=${selectedTemplate.value.value}&equipCode=${props.equipment?.equipCode || ''}&useOnline=1&reportUrl=`,
+      url: `/pages/editor/workInstructionEditor?templateId=${selectedTemplate.value.value}&refId=${newReportId}`,
     })
   } catch (error) {
     uni.hideLoading()

+ 50 - 37
src/pages/equipment/detail/components/OtherReport.vue

@@ -114,6 +114,7 @@ interface GroupItem {
 }
 
 interface Props {
+  refreshDetail?: () => void
   otherReportList?: ReportItem[]
   useOnline?: string
   orderItemId?: string
@@ -123,11 +124,6 @@ const equipType = useConfigStore().getEquipType()
 const props = withDefaults(defineProps<Props>(), {
   otherReportList: () => [],
 })
-const emit = defineEmits<{
-  edit: [item: ReportItem]
-  viewDetail: [item: ReportItem]
-  handleEditWorkInstruction: [item: ReportItem]
-}>()
 
 const popupVisible = ref(false)
 const cancelReason = ref('')
@@ -182,7 +178,7 @@ const handleSelectItem = (item: ReportItem) => {
     selectedProjects.value.splice(index, 1)
   }
 
-  selectAll.value = selectedProjects.value.length === dataSource.value.length
+  selectAll.value = selectedProjects.value.length === (props.otherReportList || []).length
 }
 
 const handleSelectAll = () => {
@@ -229,9 +225,11 @@ const handlePopupConfirm = () => {
 const handleDelReport = async (reason: string) => {
   try {
     uni.showLoading({ title: '作废中...' })
-    const invalidItems =  selectedProjects.value.filter((item) => item.status !== 0)
+    const invalidItems = selectedProjects.value.filter(
+      (item) => item.reportType === PressureReportType.WORKINSTRUCTION && item.status !== 0,
+    )
     if (invalidItems.length) {
-      uni.showToast({ title: '只能作废待提交的项目', icon: 'error' })
+      uni.showToast({ title: '只能作废待提交的操作指导书', icon: 'error' })
       uni.hideLoading()
       return
     }
@@ -240,7 +238,11 @@ const handleDelReport = async (reason: string) => {
     let result = null
 
     if (props.useOnline === '1') {
-      const fetchResult = await requestFunc(TaskOrderFuncName.BatchCancelReport, equipType, cancelReportReq)
+      const fetchResult = await requestFunc(
+        TaskOrderFuncName.BatchCancelReport,
+        equipType,
+        cancelReportReq,
+      )
       result = fetchResult.data
     } else {
       uni.showToast({ title: '离线模式暂不支持作废', icon: 'none' })
@@ -254,6 +256,7 @@ const handleDelReport = async (reason: string) => {
       eventBus.emit('RefreshOnlineData')
       uni.showToast({ title: '作废成功', icon: 'success' })
       initSelected()
+      props.refreshDetail?.()
     } else {
       uni.showToast({ title: '作废失败', icon: 'error' })
     }
@@ -306,38 +309,48 @@ const canEdit = (item: ReportItem): boolean => {
 }
 
 const handleEdit = (item: ReportItem) => {
-  emit('edit', item)
-  emit('handleEditWorkInstruction', item)
+  switch (item.reportType) {
+    case PressureReportType.MAINQUESTION:
+      uni.navigateTo({
+        url: `/pages/editor/mainQuestionEditor?templateId=${item?.templateId}&refId=${item?.id}`,
+      })
+      break
+    case PressureReportType.WORKINSTRUCTION:
+      uni.navigateTo({
+        url: `/pages/editor/workInstructionEditor?templateId=${item?.templateId}&refId=${item?.id}`,
+      })
+      break
+    case PressureReportType.INSPECTIONPLAN:
+      uni.navigateTo({
+        url: `/pages/editor/inspectionPlanEditor?templateId=${item?.templateId}&refId=${item?.id}`,
+      })
+      break
+    default:
+      uni.showToast({ title: '不支持编辑该报告类型', icon: 'error' })
+      break
+  }
 }
 
 const handleViewDetail = async (item: ReportItem) => {
-  try {
-    uni.showLoading({ title: '加载中...' })
-
-    const { reportPreviewApi } = await import('@/api')
-
-    const params = {
-      reportId: item?.id,
-      equipCode: item?.equipCode,
-      type: 300,
-      fileType: 200,
-      isBase64: true,
-    }
-
-    const result = await reportPreviewApi(params)
-
-    uni.hideLoading()
-
-    if (result) {
-      const pdfUrl = `data:application/pdf;base64,${result}`
+  switch (item.reportType) {
+    case PressureReportType.WORKINSTRUCTION:
       uni.navigateTo({
-        url: `/pages/preViewPdf/PreViewPdf?title=${encodeURIComponent(item.reportName)}&url=${encodeURIComponent(pdfUrl)}`,
+        url: `/pages/equipment/detail/workInstructionPreviewer?templateId=${item?.templateId}&id=${item?.id}`,
       })
-    }
-  } catch (error) {
-    uni.hideLoading()
-    console.error('获取报告预览失败:', error)
-    uni.showToast({ title: '获取报告预览失败', icon: 'error' })
+      break
+    case PressureReportType.MAINQUESTION:
+      uni.navigateTo({
+        url: `/pages/equipment/detail/mainQuestionPreviewer?templateId=${item?.templateId}&id=${item?.id}`,
+      })
+      break
+    case PressureReportType.INSPECTIONPLAN:
+      uni.navigateTo({
+        url: `/pages/equipment/detail/inspectionPlanPreviewer?templateId=${item?.templateId}&id=${item?.id}`,
+      })
+      break
+    default:
+      uni.showToast({ title: '不支持查看该报告类型', icon: 'error' })
+      break
   }
 }
 </script>
@@ -628,6 +641,6 @@ const handleViewDetail = async (item: ReportItem) => {
 
 .confirm-btn-text {
   font-weight: 500;
-  color: #4B8CD9;
+  color: #4b8cd9;
 }
 </style>

+ 1 - 1
src/pages/equipment/detail/components/PipeInspectProject.vue

@@ -953,7 +953,7 @@ const handleConfirmTemplate = async () => {
     }
 
     uni.navigateTo({
-      url: `/pages/editor/equipCheckRecordEditor?userId=${userInfo.value?.id}&orderItemId=${props.orderItemId}&checkItemId=${newReportId}&templateId=${selectedTemplate.value.value}&equipCode=${props.equipment?.equipCode || ''}&useOnline=1&reportUrl=`,
+      url: `/pages/editor/workInstructionEditor?templateId=${selectedTemplate.value.value}&refId=${newReportId}`,
     })
   } catch (error) {
     uni.hideLoading()

+ 1 - 45
src/pages/equipment/detail/equipmentDetail.vue

@@ -93,11 +93,10 @@
       <!-- 记录文件 Tab -->
       <view v-if="currentTab === 3" class="tab-content">
         <OtherReport
+          :refresh-detail="refreshDetail"
           :other-report-list="dataSource?.otherReportList"
           :order-item-id="orderItemId"
           :use-online="useOnline"
-          @edit="handleEditOtherReport"
-          @viewDetail="handleViewDetailOtherReport"
         />
       </view>
     </view>
@@ -156,11 +155,7 @@
 import { ref, computed, onMounted, watch } from 'vue'
 import { onLoad, onShow } from '@dcloudio/uni-app'
 import {
-  getCheckerEquipmentDetailById,
   getFilterReport,
-  recheckApi,
-  getUserGroupUserList,
-  getApprovalDetail,
   getReportTemplateInfo,
   getReportTemplateBlob,
 } from '@/api/task'
@@ -403,45 +398,6 @@ const handleEquipmentInfoUpdate = (data: any) => {
   console.log('设备信息更新:', data)
 }
 
-// 编辑其他报告
-const handleEditOtherReport = (checkItem: any) => {
-  const { reportType } = checkItem
-  if (reportType === PressureReportType.WORKINSTRUCTION) {
-    handleEditWorkInstruction(checkItem)
-  } else if (reportType === PressureReportType.INSPECTIONPLAN) {
-    inspectionplanEditFn(checkItem)
-  }
-}
-
-// 查看详情
-const handleViewDetailOtherReport = async (item: any) => {
-  try {
-    uni.showLoading({ title: '加载中...' })
-
-    const params = {
-      reportId: item?.id,
-      equipCode: item?.equipCode,
-      type: 300,
-      fileType: 200,
-    }
-
-    const result = await getReportTemplateBlob(params)
-
-    uni.hideLoading()
-
-    if (result) {
-      const pdfUrl = `data:application/pdf;base64,${result}`
-      uni.navigateTo({
-        url: `/pages/preViewPdf/PreViewPdf?title=${encodeURIComponent(item.reportName)}&url=${encodeURIComponent(pdfUrl)}`,
-      })
-    }
-  } catch (error) {
-    uni.hideLoading()
-    console.error('获取报告预览失败:', error)
-    uni.showToast({ title: '获取报告预览失败', icon: 'error' })
-  }
-}
-
 // 显示选择校核人弹窗
 const showSelectUserPopupFn = async (checkItem: any) => {
   if (useOnline !== '1') {

+ 170 - 0
src/pages/equipment/detail/mainQuestionPreviewer.vue

@@ -0,0 +1,170 @@
+<route lang="json5" type="page">
+{
+  layout: 'default',
+  style: {
+    navigationBarTitleText: '操作指导书批准',
+    navigationStyle: 'custom',
+    disableScroll: true,
+  },
+}
+</route>
+
+<template>
+  <view class="preview-container">
+    <ReportNavBar />
+
+    <BackendPDFViewer
+      ref="backendPdfViewerRef"
+      :refId="refId"
+      :templateId="templateId"
+    />
+
+  </view>
+</template>
+
+<script lang="ts" setup>
+import { ref, watch } from 'vue'
+import { onLoad } from '@dcloudio/uni-app'
+import ReportNavBar from '@/components/NavBar/ReportNavBar.vue'
+import BackendPDFViewer from '@/components/BackendPDFViewer/index.vue'
+
+defineOptions({
+  name: 'WorkInstructionPreviewer',
+})
+
+const id = ref('')
+const templateIdFromRoute = ref('')
+
+const templateId = ref('')
+const refId = ref('')
+
+onLoad((options: any) => {
+  id.value = options?.id || ''
+  templateIdFromRoute.value = options?.templateId || ''
+})
+
+watch(id, (newVal) => {
+  if (newVal) {
+    loadPreviewData()
+  }
+})
+
+const loadPreviewData = async () => {
+  templateId.value = templateIdFromRoute.value
+  refId.value = id.value
+}
+
+</script>
+
+<style lang="scss" scoped>
+.preview-container {
+  display: flex;
+  flex-direction: column;
+  min-height: 100vh;
+  background-color: #f5f5f5;
+}
+
+.nav-btn {
+  padding: 4px 8px;
+  margin: 0 0 0 4px !important;
+  font-size: 12px;
+  line-height: 1.4;
+  color: #fff;
+  border: none;
+  border-radius: 3px;
+}
+
+.btn-orange {
+  background-color: #f5a623;
+}
+
+.btn-blue {
+  background-color: #2f8eff;
+}
+
+.popup-body {
+  width: 80vw;
+  background-color: #fff;
+  border-radius: 10px;
+  padding: 2vh 0 0 0;
+}
+
+.center-text {
+  font-size: 14px;
+  color: rgb(51, 51, 51);
+}
+
+.input-area {
+  flex: 1;
+  height: 80px;
+  border-radius: 6px;
+  border: 1px solid rgb(187, 187, 187);
+  padding: 8px;
+  font-size: 14px;
+}
+
+.popup-bottom-box {
+  display: flex;
+  flex-direction: row;
+  justify-content: space-between;
+  align-items: center;
+  margin-bottom: 20px;
+  padding: 0 20px;
+}
+
+.bottom-btn {
+  flex: 1;
+  height: 40px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  border-radius: 4px;
+  background-color: rgb(47, 142, 255);
+  color: rgb(241, 247, 255);
+  font-size: 15px;
+  line-height: 40px;
+  margin: 0;
+}
+
+.bottom-btn::after {
+  border: none;
+}
+
+.white-btn {
+  border: 1px solid rgb(187, 187, 187);
+  background-color: rgb(255, 255, 255);
+  color: rgb(51, 51, 51);
+  margin-right: 20px;
+}
+
+.row {
+  display: flex;
+  flex-direction: row;
+  align-items: flex-start;
+  padding: 0 20px;
+  margin-bottom: 2vh;
+}
+
+.picker-value {
+  display: flex;
+  align-items: center;
+  padding: 0 10px;
+  background-color: #f5f5f5;
+  border-radius: 4px;
+}
+.confirm-title {
+  font-size: 18px;
+  font-weight: bold;
+  text-align: center;
+  color: rgb(51, 51, 51);
+  margin-bottom: 20px;
+}
+
+.confirm-content {
+  font-size: 14px;
+  text-align: center;
+  color: rgb(102, 102, 102);
+  margin-bottom: 30px;
+  padding: 0 20px;
+}
+</style>

+ 170 - 0
src/pages/equipment/detail/workInstructionPreviewer.vue

@@ -0,0 +1,170 @@
+<route lang="json5" type="page">
+{
+  layout: 'default',
+  style: {
+    navigationBarTitleText: '操作指导书批准',
+    navigationStyle: 'custom',
+    disableScroll: true,
+  },
+}
+</route>
+
+<template>
+  <view class="preview-container">
+    <ReportNavBar />
+
+    <BackendPDFViewer
+      ref="backendPdfViewerRef"
+      :refId="refId"
+      :templateId="templateId"
+    />
+
+  </view>
+</template>
+
+<script lang="ts" setup>
+import { ref, watch } from 'vue'
+import { onLoad } from '@dcloudio/uni-app'
+import ReportNavBar from '@/components/NavBar/ReportNavBar.vue'
+import BackendPDFViewer from '@/components/BackendPDFViewer/index.vue'
+
+defineOptions({
+  name: 'WorkInstructionPreviewer',
+})
+
+const id = ref('')
+const templateIdFromRoute = ref('')
+
+const templateId = ref('')
+const refId = ref('')
+
+onLoad((options: any) => {
+  id.value = options?.id || ''
+  templateIdFromRoute.value = options?.templateId || ''
+})
+
+watch(id, (newVal) => {
+  if (newVal) {
+    loadPreviewData()
+  }
+})
+
+const loadPreviewData = async () => {
+  templateId.value = templateIdFromRoute.value
+  refId.value = id.value
+}
+
+</script>
+
+<style lang="scss" scoped>
+.preview-container {
+  display: flex;
+  flex-direction: column;
+  min-height: 100vh;
+  background-color: #f5f5f5;
+}
+
+.nav-btn {
+  padding: 4px 8px;
+  margin: 0 0 0 4px !important;
+  font-size: 12px;
+  line-height: 1.4;
+  color: #fff;
+  border: none;
+  border-radius: 3px;
+}
+
+.btn-orange {
+  background-color: #f5a623;
+}
+
+.btn-blue {
+  background-color: #2f8eff;
+}
+
+.popup-body {
+  width: 80vw;
+  background-color: #fff;
+  border-radius: 10px;
+  padding: 2vh 0 0 0;
+}
+
+.center-text {
+  font-size: 14px;
+  color: rgb(51, 51, 51);
+}
+
+.input-area {
+  flex: 1;
+  height: 80px;
+  border-radius: 6px;
+  border: 1px solid rgb(187, 187, 187);
+  padding: 8px;
+  font-size: 14px;
+}
+
+.popup-bottom-box {
+  display: flex;
+  flex-direction: row;
+  justify-content: space-between;
+  align-items: center;
+  margin-bottom: 20px;
+  padding: 0 20px;
+}
+
+.bottom-btn {
+  flex: 1;
+  height: 40px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  border-radius: 4px;
+  background-color: rgb(47, 142, 255);
+  color: rgb(241, 247, 255);
+  font-size: 15px;
+  line-height: 40px;
+  margin: 0;
+}
+
+.bottom-btn::after {
+  border: none;
+}
+
+.white-btn {
+  border: 1px solid rgb(187, 187, 187);
+  background-color: rgb(255, 255, 255);
+  color: rgb(51, 51, 51);
+  margin-right: 20px;
+}
+
+.row {
+  display: flex;
+  flex-direction: row;
+  align-items: flex-start;
+  padding: 0 20px;
+  margin-bottom: 2vh;
+}
+
+.picker-value {
+  display: flex;
+  align-items: center;
+  padding: 0 10px;
+  background-color: #f5f5f5;
+  border-radius: 4px;
+}
+.confirm-title {
+  font-size: 18px;
+  font-weight: bold;
+  text-align: center;
+  color: rgb(51, 51, 51);
+  margin-bottom: 20px;
+}
+
+.confirm-content {
+  font-size: 14px;
+  text-align: center;
+  color: rgb(102, 102, 102);
+  margin-bottom: 30px;
+  padding: 0 20px;
+}
+</style>

+ 6 - 2
src/pages/taskOnline/TaskOnlineEquipmentList.vue

@@ -530,7 +530,7 @@ const createInform = async () => {
   }
 
   const selectedEquipment = selectedEquipments.value[0]
-  const majorIssue = selectedEquipment.orderItems[0].reportRespVOList.find((item: any) => item.reportType == 500)
+  const majorIssue = selectedEquipment.reportRespVOList.find((item: any) => item.reportType == 500)
   if (majorIssue) {
     return uni.showToast({ title: '该设备已添加了重大问题线索', icon: 'error' })
   }
@@ -543,6 +543,10 @@ const createInform = async () => {
       businessType: 400,
       orderItemId: selectedEquipment.id,
     })
+    if (orderFormResp?.code !== 0) {
+      return uni.showToast({ title: orderFormResp?.msg || '获取模板失败', icon: 'error' })
+    }
+
     const templateId = orderFormResp?.data?.templateId || ''
     const addMajorIssueResp = await requestFunc(TaskOrderFuncName.AddMajorIssues, equipType, {
       orderFormEnterReqVO: {
@@ -559,7 +563,7 @@ const createInform = async () => {
     })
     const refId = addMajorIssueResp?.data || ''
     uni.navigateTo({
-      url: `/pages/editor/importanceEditor?templateId=${templateId}&refId=${refId}`,
+      url: `/pages/editor/mainQuestionEditor?templateId=${templateId}&refId=${refId}`,
     })
   } catch (error) {
     uni.hideLoading()

+ 4 - 1
src/types/uni-pages.d.ts

@@ -9,10 +9,11 @@ interface NavigateToOptions {
        "/pages/deviceExam/deviceExam" |
        "/pages/deviceExam/deviceExamDetail" |
        "/pages/editor/equipCheckRecordEditor" |
-       "/pages/editor/importanceEditor" |
        "/pages/editor/inspectionPlanEditor" |
+       "/pages/editor/mainQuestionEditor" |
        "/pages/editor/securityCheckEditor" |
        "/pages/editor/serviceOrderEditor" |
+       "/pages/editor/workInstructionEditor" |
        "/pages/loading/index" |
        "/pages/login/login" |
        "/pages/securityCheck/securityCheckList" |
@@ -29,6 +30,8 @@ interface NavigateToOptions {
        "/pages/uploadFile/UploadFile" |
        "/pages/user/index" |
        "/pages/equipment/detail/equipmentDetail" |
+       "/pages/equipment/detail/mainQuestionPreviewer" |
+       "/pages/equipment/detail/workInstructionPreviewer" |
        "/pages/inspectionApproval/list/inspectionApprovalList" |
        "/pages/inspectionApproval/preViewReport/index" |
        "/pages/inspectionPlanAudit/list/InspectionPlanAuditList" |