Browse Source

安全检查记录签名页面

yangguanjin 1 tuần trước cách đây
mục cha
commit
c8a35c86dd

+ 12 - 0
src/pages/securityCheck/components/Item.vue

@@ -32,6 +32,9 @@
 
     <view class="task-btn">
       <view class="row">
+        <button class="task-btn-box sign-btn" @click="handleSign">
+          <text class="task-btn-text">签名</text>
+        </button>
         <button class="task-btn-box delete-btn" @click="handleDelete">
           <text class="task-btn-text">删除</text>
         </button>
@@ -56,6 +59,7 @@ const props = withDefaults(defineProps<Props>(), {
 const emit = defineEmits<{
   viewDetail: []
   delete: []
+  sign: []
 }>()
 
 const date = computed(() => {
@@ -77,6 +81,10 @@ const handleViewDetail = () => {
 const handleDelete = () => {
   emit('delete')
 }
+
+const handleSign = () => {
+  emit('sign')
+}
 </script>
 
 <style lang="scss" scoped>
@@ -172,6 +180,10 @@ const handleDelete = () => {
   background-color: rgb(255, 79, 79);
 }
 
+.sign-btn {
+  background-color: #00a811;
+}
+
 .task-btn-text {
   color: #fff;
   font-size: 12px;

+ 16 - 0
src/pages/securityCheck/securityCheckList.vue

@@ -25,6 +25,7 @@
           operate-text="审核"
           @view-detail="handleModifySavetyRecord(item)"
           @delete="handleDeleteSavetyRecord(item)"
+          @sign="handleSign(item)"
         />
       </view>
 
@@ -162,6 +163,21 @@ const handleModifySavetyRecord = (item: any) => {
   })
 }
 
+const handleSign = async (securityCheckRecord: any) => {
+  // 检查网络状态
+  const networkType = uni.getNetworkType()
+  if (networkType === 'none') {
+    return uni.showToast({ title: '无网络连接,请联网重试', icon: 'error' })
+  }
+  try {
+    uni.navigateTo({
+      url: `/pages/sign/index?orderId=${orderId.value}&securityCheckId=${securityCheckRecord.id}&type=AQJC&unitContact=${unitContact.value || ''}&unitPhone=${unitPhone.value || ''}&receiverEmail=${receiverEmail.value || ''}`,
+    })
+  } catch (error) {
+    console.error('获取详情失败:', error)
+  }
+}
+
 // 页面显示时刷新
 onShow(() => {
   refreshList()

+ 14 - 3
src/pages/sign/index.vue

@@ -174,6 +174,10 @@ import { getTaskOrderReport } from '@/api/orderReport'
 import { buildFileUrl } from '@/utils/index'
 import { SignFuncName, requestFunc } from '@/api/ApiRouter/sign'
 import { TaskOrderFuncName, requestFunc as taskOrderRequestFunc } from '@/api/ApiRouter/taskOrder'
+import {
+  requestFunc as SecurityRequestFunc,
+  SecurityCheckFuncName,
+} from '@/api/ApiRouter/taskOrderSecurityCheck'
 import { EquipmentType } from '@/utils/dictMap'
 
 const equipType = useConfigStore().getEquipType()
@@ -304,8 +308,7 @@ const getPreviewData = async () => {
   })
   const signFileList = orderDetail.data.signFileList || []
   const targetBusinessType = businessTypeMap[routeType.value]
-  const signFile =
-    signFileList.find((row: any) => row.businessType === targetBusinessType)
+  const signFile = signFileList.find((row: any) => row.businessType === targetBusinessType)
   if (signFile == null || signFile.isSignature == '0') {
     isSigned.value = '0'
   } else {
@@ -346,9 +349,17 @@ const getPreviewData = async () => {
       } else {
         templateId.value = notificationformReport?.templateId || ''
         refId.value = notificationformReport?.id || ''
-        orderReportId.value = notificationformReport?.id || ''
       }
       break
+    case 'AQJC':
+      const defaultTemplateResp = await SecurityRequestFunc(
+        SecurityCheckFuncName.getTemplate,
+        equipType,
+        { orderId: orderId.value },
+      )
+      templateId.value = defaultTemplateResp.data?.templateId
+      refId.value = securityCheckId.value
+      break
     default:
       uni.showToast({ title: '请选择正确的签字文件类型', icon: 'error' })
       break