Parcourir la source

Merge remote-tracking branch 'origin/stable' into stable

xzc il y a 2 jours
Parent
commit
89f9dbaece

+ 24 - 16
yudao-ui-admin-vue3/src/views/pressure2/acceptorder/boilerDetail.vue

@@ -199,13 +199,12 @@
             </el-form-item>
           </el-col>
         </el-row>
-        <template v-if="exceptionInfo.id">
-          <div class="check-info-label-title">异常信息</div>
-          <!-- <el-row class="m-b-20px">
-            <el-button v-if="!exceptionInfo.id" type="primary" @click="addExceptionInfo">添加异常单</el-button>
-            <el-button v-else type="primary" @click="deleteExceptionInfo">删除异常单</el-button>
-          </el-row> -->
-          <el-row class="form-group" :gutter="24">
+        <div class="check-info-label-title">异常信息</div>
+        <el-row class="m-b-20px">
+          <el-button v-if="!exceptionInfo.id" type="primary" @click="addExceptionInfo">添加异常单</el-button>
+          <el-button v-else type="primary" @click="deleteExceptionInfo">删除异常单</el-button>
+        </el-row>
+        <el-row v-if="exceptionInfo.id" class="form-group" :gutter="24">
             <el-col :span="8">
               <el-form-item label="有效日期调整原因" prop="effectiveDateAdjustReason">
                 <el-input v-model="exceptionInfo.effectiveDateAdjustReason" placeholder="请输入有效日期调整原因"/>
@@ -257,7 +256,6 @@
               </el-form-item>
             </el-col>
           </el-row>
-        </template>
         <div class="check-info-label-title">检验收费</div>
         <el-row class="form-group" :gutter="24">
           <el-col :span="24">
@@ -738,7 +736,7 @@
 </template>
 
 <script setup lang="tsx">
-import { ref, onMounted, computed, watch, nextTick } from 'vue'
+import { ref, onMounted, computed, watch, nextTick, unref } from 'vue'
 import { ElMessage, ElMessageBox } from 'element-plus'
 import { BoilerAcceptOrderApi } from '@/api/pressure2/boileracceptorder'
 import batchEditForm from '@/views/pressure2/planNew/components/batchEditForm.vue'
@@ -759,6 +757,7 @@ import FileUploadModal from '@/views/pressure2/orderConfirm/components/ImportFil
 import { buildFileUrl } from '@/utils'
 import { useRoute } from 'vue-router'
 import { Icon } from '@/components/Icon'
+import { cloneDeep } from 'lodash-es'
 import { UserQualificationsApi } from '@/api/pressure2/userQualifications'
 import { useUserStore } from '@/store/modules/user'
 const route = useRoute()
@@ -1357,7 +1356,10 @@ const handleGenerateAcceptance = () => {
         cancelButtonText: '取消',
         type: 'warning'
       }
-    ).then(() => {
+    ).then(async () => {
+      if(exceptionInfo.value.id){
+        await handleSaveException()
+      }
       // 确认后提交
       submitAcceptance()
     }).catch(() => {
@@ -1420,6 +1422,12 @@ const submitAcceptance = async () => {
       }, []),
       useUnitName: formData.value?.useUnitName?.name,
     }
+    if(exceptionInfo.value.id){
+      submitData.boilerOrderExceptionSaveReqVO = cloneDeep({
+        ...exceptionInfo.value,
+        adjustEffectiveDate: unref(exceptionInfo).adjustEffectiveDate && unref(exceptionInfo).adjustEffectiveDate.split('-').map(item=>Number(item)),
+      })
+    }
 
     // 调用API提交受理单
     await BoilerAcceptOrderApi.resubmitAcceptOrder(submitData)
@@ -1522,9 +1530,9 @@ const getExceptionItem = (field: string, fieldAttr: string)=>{
           <div class="ml-10px">
             <el-link href={fileUrl} underline={false} download target="_blank" type="primary">下载</el-link>
           </div>
-          {/* <div class="ml-10px">
+          <div class="ml-10px">
             <el-button link type="danger" onClick={()=>handleRemove(field, fieldAttr)}>删除</el-button>
-          </div> */}
+          </div>
         </div>
       </>
     )
@@ -1539,15 +1547,15 @@ const getExceptionItem = (field: string, fieldAttr: string)=>{
 }
 
 const addExceptionInfo = () => {
-  const orderId = formData.value.id || route.query?.id;
+  const orderId = orderDetail.value?.id || props.id;
   if(!orderId) {
     // ElMessage.error('请先保存订单')
     return
   }
 
   BoilerAppointmentConfirmOrderApi.createExceptionInfo({
-    orderId: formData.value.id || route.query?.id,
-    orderType: 100,
+    orderId: orderDetail.value?.id || props.id,
+    orderType: 200,
   }).then((res) => {
     if(res) {
       ElMessage.success('生成成功')
@@ -1594,7 +1602,7 @@ const handleSaveException=()=>{
 
 const getExceptionInfoList = () => {
   BoilerAppointmentConfirmOrderApi.getExceptionInfoList({
-    orderId: formData.value.id || route.query?.id,
+    orderId: orderDetail.value?.id || props.id,
   }).then(res=>{
     console.log('getExceptionInfoList:',res)
   })

+ 31 - 22
yudao-ui-admin-vue3/src/views/pressure2/acceptorder/pipeDetail.vue

@@ -199,13 +199,12 @@
             </el-form-item>
           </el-col>
         </el-row>
-        <template v-if="exceptionInfo.id">
-          <div class="check-info-label-title">异常信息</div>
-          <!-- <el-row class="m-b-20px">
-            <el-button v-if="!exceptionInfo.id" type="primary" @click="addExceptionInfo">添加异常单</el-button>
-            <el-button v-else type="primary" @click="deleteExceptionInfo">删除异常单</el-button>
-          </el-row> -->
-          <el-row class="form-group" :gutter="24">
+        <div class="check-info-label-title">异常信息</div>
+        <el-row class="m-b-20px">
+          <el-button v-if="!exceptionInfo.id" type="primary" @click="addExceptionInfo">添加异常单</el-button>
+          <el-button v-else type="primary" @click="deleteExceptionInfo">删除异常单</el-button>
+        </el-row>
+        <el-row v-if="exceptionInfo.id" class="form-group" :gutter="24">
             <el-col :span="8">
               <el-form-item label="有效日期调整原因" prop="effectiveDateAdjustReason">
                 <el-input v-model="exceptionInfo.effectiveDateAdjustReason" placeholder="请输入有效日期调整原因"/>
@@ -257,7 +256,6 @@
               </el-form-item>
             </el-col>
           </el-row>
-        </template>
         <div class="check-info-label-title">检验收费</div>
         <el-row class="form-group" :gutter="24">
           <el-col :span="24">
@@ -674,11 +672,11 @@
 </template>
 
 <script setup lang="tsx">
-import { ref, onMounted, computed, watch } from 'vue'
+import { ref, onMounted, computed, watch, unref } from 'vue'
 import { ElMessage, ElMessageBox } from 'element-plus'
 import { BoilerAcceptOrderApi } from '@/api/pressure2/boileracceptorder'
 import PipeBatchEditForm from '@/views/pressure2/planNew/components/PipeBatchEditForm.vue'
-import { BoilerAppointmentConfirmOrderEquipmentVO, BoilerAppointmentConfirmOrderApi } from '@/api/pressure2/appointmentconfirmorder'
+import { BoilerAppointmentConfirmOrderEquipmentVO } from '@/api/pressure2/appointmentconfirmorder'
 import { type CheckerItem } from '@/views/pressure2/components/CheckerSelect'
 import dayjs from 'dayjs'
 import { getStrDictOptions, DICT_TYPE } from '@/utils/dict'
@@ -695,12 +693,14 @@ import FileUploadModal from '@/views/pressure2/orderConfirm/components/ImportFil
 import { buildFileUrl } from '@/utils'
 import { useRoute } from 'vue-router'
 import { Icon } from '@/components/Icon'
+import { cloneDeep } from 'lodash-es'
 import {
   PipeEquipmentApi,
   PipeEquipmentDetailVO,
   PipeEquipmentVO
 } from "@/api/pressure2/pipeequipment";
 import {PipeAcceptOrderApi} from "@/api/pressure2/pipeacceptorder";
+import {PipeAppointmentConfirmOrderApi} from "@/api/pressure2/pipeappointmentconfirmorder";
 import {UserQualificationsApi} from "@/api/pressure2/userQualifications";
 import { useUserStore } from '@/store/modules/user'
 import {PressurePipeCheckTypeMap} from "../../../utils/constants";
@@ -1419,7 +1419,10 @@ const handleGenerateAcceptance = () => {
         cancelButtonText: '取消',
         type: 'warning'
       }
-    ).then(() => {
+    ).then(async () => {
+      if(exceptionInfo.value.id){
+        await handleSaveException()
+      }
       // 确认后提交
       submitAcceptance()
     }).catch(() => {
@@ -1483,6 +1486,12 @@ const submitAcceptance = async () => {
         return acc;
       }, [])
     }
+    if(exceptionInfo.value.id){
+      submitData.boilerOrderExceptionSaveReqVO = cloneDeep({
+        ...exceptionInfo.value,
+        adjustEffectiveDate: unref(exceptionInfo).adjustEffectiveDate && unref(exceptionInfo).adjustEffectiveDate.split('-').map(item=>Number(item)),
+      })
+    }
 
     // 调用API提交受理单
     await PipeAcceptOrderApi.resubmitAcceptOrder(submitData)
@@ -1585,9 +1594,9 @@ const getExceptionItem = (field: string, fieldAttr: string)=>{
           <div class="ml-10px">
             <el-link href={fileUrl} underline={false} download target="_blank" type="primary">下载</el-link>
           </div>
-          {/* <div class="ml-10px">
+          <div class="ml-10px">
             <el-button link type="danger" onClick={()=>handleRemove(field, fieldAttr)}>删除</el-button>
-          </div> */}
+          </div>
         </div>
       </>
     )
@@ -1602,15 +1611,15 @@ const getExceptionItem = (field: string, fieldAttr: string)=>{
 }
 
 const addExceptionInfo = () => {
-  const orderId = formData.value.id || route.query?.id;
+  const orderId = orderDetail.value?.id || props.id;
   if(!orderId) {
     // ElMessage.error('请先保存订单')
     return
   }
 
-  BoilerAppointmentConfirmOrderApi.createExceptionInfo({
-    orderId: formData.value.id || route.query?.id,
-    orderType: 100,
+  PipeAppointmentConfirmOrderApi.createExceptionInfo({
+    orderId: orderDetail.value?.id || props.id,
+    orderType: 200,
   }).then((res) => {
     if(res) {
       ElMessage.success('生成成功')
@@ -1627,7 +1636,7 @@ const deleteExceptionInfo = () => {
     cancelButtonText: '取消',
     type: 'warning',
   }).then(() => {
-    BoilerAppointmentConfirmOrderApi.deleteExceptionInfo(exceptionInfo.value.id).then(res=>{
+    PipeAppointmentConfirmOrderApi.deleteExceptionInfo(exceptionInfo.value.id).then(res=>{
       if(res) {
         ElMessage.success('删除成功')
         exceptionInfo.value = {}
@@ -1647,7 +1656,7 @@ const handleSaveException=()=>{
       ...exceptionInfo.value,
       adjustEffectiveDate: adjustEffectiveDate && adjustEffectiveDate.split('-').map(item=>Number(item)),
     }
-    BoilerAppointmentConfirmOrderApi.updateExceptionInfo(params).then(res=>{
+    PipeAppointmentConfirmOrderApi.updateExceptionInfo(params).then(res=>{
       resolve(res)
     }).catch((error)=>{
       reject(error)
@@ -1656,8 +1665,8 @@ const handleSaveException=()=>{
 }
 
 const getExceptionInfoList = () => {
-  BoilerAppointmentConfirmOrderApi.getExceptionInfoList({
-    orderId: formData.value.id || route.query?.id,
+  PipeAppointmentConfirmOrderApi.getExceptionInfoList({
+    orderId: orderDetail.value?.id || props.id,
   }).then(res=>{
     console.log('getExceptionInfoList:',res)
   })
@@ -1665,7 +1674,7 @@ const getExceptionInfoList = () => {
 
 
 const handleGetExceptionInfo = (id: string) => {
-  BoilerAppointmentConfirmOrderApi.getExceptionInfo(id).then((res) => {
+  PipeAppointmentConfirmOrderApi.getExceptionInfo(id).then((res) => {
     if(res) exceptionInfo.value = {
       ...res,
       adjustEffectiveDate: res.adjustEffectiveDate?.join('-')

+ 1 - 0
yudao-ui-admin-vue3/src/views/pressure2/boilerchecker/components/StatusOperationPanel.vue

@@ -1462,6 +1462,7 @@ const ectificationMaterialsVisible = ref(false)
 
 const handleRectificationMaterials = () => {
   ectificationMaterialsVisible.value = true
+  checkBookDetail.value.id =  props.selectedItem?.id
 }
 
 // 获取检验员名称

+ 28 - 62
yudao-ui-admin-vue3/src/views/pressure2/inspectionOpinion/indexBoilerTab.vue

@@ -214,11 +214,10 @@
         <template #default="{ row }">
           <div class="flex justify-center">
 <!--            <el-button link type="primary" v-if="filerFileUrlShowFn(row)" @click="handleFilePreview(row)"> 查看附件 </el-button>-->
-            <el-button link type="primary" @click="fiePreviewEmitFn(row)"> 消息推送 </el-button>
+            <el-button link type="primary" @click="handleRePush(row)"> 消息推送 </el-button>
             <el-button link type="primary" @click="() => handleFollowRecord(row)">
               跟进记录
             </el-button>
-            <el-button link type="primary" @click="handleViewPdf(row)"> 预览 </el-button>
             <el-button
               link
               type="primary"
@@ -657,11 +656,16 @@
 
  <unitContainerForm ref="unitContainerFormRef" />
 
-  <!-- PDF预览弹窗 -->
-  <PdfPreviewDialog
-    v-model="pdfPreviewVisible"
-    :pdfBlob="currentPdfBlob"
-    @close="handlePdfPreviewClose"
+  <!-- PDF预览 + 消息推送弹窗 -->
+  <FilePreview
+    v-if="previewVisible"
+    v-model="previewVisible"
+    :id="currentPreviewId"
+    :reportId="currentReportId"
+    :filename="currentFilename"
+    :title="'检验意见通知书'"
+    @close="handlePreviewClose"
+    @sbmit="fiePreviewEmitFn"
   />
 
 </template>
@@ -698,7 +702,6 @@ import { cloneDeep } from 'lodash-es'
 import { useUserStoreWithOut } from '@/store/modules/user'
 import { buildFileUrl } from '@/utils'
 import {PipeInputApi} from "@/api/pressure2/pipeInput";
-import PdfPreviewDialog from "@/views/pressure2/boilertaskorder/PdfPreviewDialog.vue";
 
 const currentPreviewId = ref<string>('')
 const currentFilename = ref<string>('')
@@ -891,17 +894,24 @@ const handleRePush = async (row) => {
   recipientType.value = 'single'
   currentReportId.value = row.opinionReportedUrl
   currentPreviewId.value = row.id
-  recipientDialogVisible.value = true
-
+  currentFilename.value = '检验意见通知书.pdf'
+  // 重置上次推送的接收人信息
+  recipientFormData.recipient = ''
+  recipientFormData.recipientPhone = ''
+  previewVisible.value = true
 }
-const fiePreviewEmitFn = (row) => {
-  recipientRow.value = row
-  recipientType.value = 'single'
-  currentReportId.value = row.opinionReportedUrl
-  currentPreviewId.value = row.id
-
-  recipientFormData.recipient = row.defaultRecipient || ''
-  recipientFormData.recipientPhone = row.defaultRecipientPhone || ''
+const fiePreviewEmitFn = async () => {
+  try {
+    recipientFormData.recipient = (recipientRow.value as any).recipient || (recipientRow.value as any).defaultRecipient || ''
+    recipientFormData.recipientPhone = (recipientRow.value as any).recipientPhone || (recipientRow.value as any).defaultRecipientPhone || ''
+  } catch (e) {
+    console.warn('获取推送接收人信息失败,使用默认值', e)
+  }
+  // 兜底使用行数据中的默认值
+  if (!recipientFormData.recipient) {
+    recipientFormData.recipient = (recipientRow.value as any).defaultRecipient || ''
+    recipientFormData.recipientPhone = (recipientRow.value as any).defaultRecipientPhone || ''
+  }
   recipientDialogVisible.value = true
 }
 const handleFilePreview = (row) => {
@@ -1236,50 +1246,6 @@ const downloadFile = async (blob, filename) => {
   }
 }
 
-// PDF预览相关
-const pdfPreviewVisible = ref(false)
-const currentPdfBlob = ref<Blob | null>(null)
-const handleViewPdf = async (row) => {
-
-  let data: any[] = []
-  data.push({
-    taskStatus: 100,
-    resultTemplateId: '',
-    templateId: row.templateId,
-    id: row.reportId,
-  })
-
-  const loadingInstance = ElLoading.service({
-    fullscreen: true,
-    text: '正在生成...'
-  })
-
-  try {
-    // 调用 API 获取 ZIP blob
-    const pdfBlob = await PipeInputApi.handlePrint(data)
-
-    if (pdfBlob) {
-
-      currentPdfBlob.value = pdfBlob
-      pdfPreviewVisible.value = true
-
-    } else {
-      ElMessage.error('获取文件失败')
-    }
-  } catch (error) {
-    console.error('预览失败:', error)
-    ElMessage.error('预览失败')
-  } finally {
-    loadingInstance.close()
-  }
-
-}
-
-// PDF预览关闭处理
-const handlePdfPreviewClose = () => {
-  currentPdfBlob.value = null
-}
-
 const handleRowDownload = async (row) => {
 
   let data: any[] = []

+ 28 - 62
yudao-ui-admin-vue3/src/views/pressure2/inspectionOpinion/indexPipeTab.vue

@@ -214,11 +214,10 @@
         <template #default="{ row }">
           <div class="flex justify-center">
 <!--            <el-button link type="primary" v-if="filerFileUrlShowFn(row)" @click="handleFilePreview(row)"> 查看附件 </el-button>-->
-            <el-button link type="primary" @click="fiePreviewEmitFn(row)"> 消息推送 </el-button>
+            <el-button link type="primary" @click="handleRePush(row)"> 消息推送 </el-button>
             <el-button link type="primary" @click="() => handleFollowRecord(row)">
               跟进记录
             </el-button>
-            <el-button link type="primary" @click="handleViewPdf(row)"> 预览 </el-button>
             <el-button
               link
               type="primary"
@@ -657,11 +656,16 @@
 
  <unitContainerForm ref="unitContainerFormRef" />
 
-  <!-- PDF预览弹窗 -->
-  <PdfPreviewDialog
-    v-model="pdfPreviewVisible"
-    :pdfBlob="currentPdfBlob"
-    @close="handlePdfPreviewClose"
+  <!-- PDF预览 + 消息推送弹窗 -->
+  <FilePreview
+    v-if="previewVisible"
+    v-model="previewVisible"
+    :id="currentPreviewId"
+    :reportId="currentReportId"
+    :filename="currentFilename"
+    :title="'检验意见通知书'"
+    @close="handlePreviewClose"
+    @sbmit="fiePreviewEmitFn"
   />
 
 </template>
@@ -698,7 +702,6 @@ import { cloneDeep } from 'lodash-es'
 import { useUserStoreWithOut } from '@/store/modules/user'
 import { buildFileUrl } from '@/utils'
 import {PipeInputApi} from "@/api/pressure2/pipeInput";
-import PdfPreviewDialog from "@/views/pressure2/boilertaskorder/PdfPreviewDialog.vue";
 
 const currentPreviewId = ref<string>('')
 const currentFilename = ref<string>('')
@@ -891,17 +894,24 @@ const handleRePush = async (row) => {
   recipientType.value = 'single'
   currentReportId.value = row.opinionReportedUrl
   currentPreviewId.value = row.id
-  recipientDialogVisible.value = true
-
+  currentFilename.value = '检验意见通知书.pdf'
+  // 重置上次推送的接收人信息
+  recipientFormData.recipient = ''
+  recipientFormData.recipientPhone = ''
+  previewVisible.value = true
 }
-const fiePreviewEmitFn = (row) => {
-  recipientRow.value = row
-  recipientType.value = 'single'
-  currentReportId.value = row.opinionReportedUrl
-  currentPreviewId.value = row.id
-
-  recipientFormData.recipient = row.defaultRecipient || ''
-  recipientFormData.recipientPhone = row.defaultRecipientPhone || ''
+const fiePreviewEmitFn = async () => {
+  try {
+    recipientFormData.recipient = (recipientRow.value as any).recipient || (recipientRow.value as any).defaultRecipient || ''
+    recipientFormData.recipientPhone = (recipientRow.value as any).recipientPhone || (recipientRow.value as any).defaultRecipientPhone || ''
+  } catch (e) {
+    console.warn('获取推送接收人信息失败,使用默认值', e)
+  }
+  // 兜底使用行数据中的默认值
+  if (!recipientFormData.recipient) {
+    recipientFormData.recipient = (recipientRow.value as any).defaultRecipient || ''
+    recipientFormData.recipientPhone = (recipientRow.value as any).defaultRecipientPhone || ''
+  }
   recipientDialogVisible.value = true
 }
 const handleFilePreview = (row) => {
@@ -1236,50 +1246,6 @@ const downloadFile = async (blob, filename) => {
   }
 }
 
-// PDF预览相关
-const pdfPreviewVisible = ref(false)
-const currentPdfBlob = ref<Blob | null>(null)
-const handleViewPdf = async (row) => {
-
-  let data: any[] = []
-  data.push({
-    taskStatus: 100,
-    resultTemplateId: '',
-    templateId: row.templateId,
-    id: row.reportId,
-  })
-
-  const loadingInstance = ElLoading.service({
-    fullscreen: true,
-    text: '正在生成...'
-  })
-
-  try {
-    // 调用 API 获取 ZIP blob
-    const pdfBlob = await PipeInputApi.handlePrint(data)
-
-    if (pdfBlob) {
-
-      currentPdfBlob.value = pdfBlob
-      pdfPreviewVisible.value = true
-
-    } else {
-      ElMessage.error('获取文件失败')
-    }
-  } catch (error) {
-    console.error('预览失败:', error)
-    ElMessage.error('预览失败')
-  } finally {
-    loadingInstance.close()
-  }
-
-}
-
-// PDF预览关闭处理
-const handlePdfPreviewClose = () => {
-  currentPdfBlob.value = null
-}
-
 const handleRowDownload = async (row) => {
 
   let data: any[] = []

+ 1 - 1
yudao-ui-admin-vue3/src/views/pressure2/orderConfirm/boilerDetail.vue

@@ -628,7 +628,7 @@
     <div class="flex justify-center pb-4">
       <el-button @click="handleClose" :loading="loading">关闭</el-button>
       <el-button v-if="!route.query.id || orderDetail?.createAcceptOrder === false" type="primary" :loading="loading" @click="handleGenerateAcceptance">
-        生成受理
+        生产任务
       </el-button>
       <el-button type="primary" @click="handleSave" :loading="loading">保存</el-button>
     </div>

+ 1 - 1
yudao-ui-admin-vue3/src/views/pressure2/orderConfirm/pipeDetail.vue

@@ -672,7 +672,7 @@
     <div class="flex justify-center pb-4">
       <el-button @click="handleClose" :loading="loading">关闭</el-button>
       <el-button v-if="!route.query.id || orderDetail?.createAcceptOrder === false" type="primary" :loading="loading" @click="handleGenerateAcceptance">
-        生成受理
+        生产任务
       </el-button>
       <el-button type="primary" @click="handleSave" :loading="loading">保存</el-button>
     </div>

+ 1 - 0
yudao-ui-admin-vue3/src/views/pressure2/pipechecker/components/StatusOperationPanel.vue

@@ -1416,6 +1416,7 @@ const ectificationMaterialsVisible = ref(false)
 
 const handleRectificationMaterials = () => {
   ectificationMaterialsVisible.value = true
+  checkBookDetail.value.id =  props.selectedItem?.id
 }
 
 // 获取检验员名称