From ae9b400eae985f6b6f2e33f66ee1575f72675898 Mon Sep 17 00:00:00 2001
From: lyh <925863403@qq.com>
Date: 星期六, 09 八月 2025 00:18:41 +0800
Subject: [PATCH] 添加流程节点

---
 src/views/flowable/workflow/InspectionOrder/InspectionOrderHandle.vue |  923 +++++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 637 insertions(+), 286 deletions(-)

diff --git a/src/views/flowable/workflow/InspectionOrder/InspectionOrderHandle.vue b/src/views/flowable/workflow/InspectionOrder/InspectionOrderHandle.vue
index 156c30d..b699384 100644
--- a/src/views/flowable/workflow/InspectionOrder/InspectionOrderHandle.vue
+++ b/src/views/flowable/workflow/InspectionOrder/InspectionOrderHandle.vue
@@ -1,208 +1,226 @@
 <template>
-  <j-modal
-    :title="title"
-    :width="1200"
-    :visible="visible"
-    :okButtonProps="{ class:{'jee-hidden': disableSubmit||!hasInspectionDateArrived} }"
-    @ok="submitForm"
-    @cancel="handleCancel"
-    :mask-closable="false"
-    :confirmLoading="confirmLoading"
-    switchFullscreen
-    centered
-  >
+  <j-modal :title="title" :width="1200" :visible="visible"
+           :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" @ok="submitForm"
+           @cancel="handleCancel" :mask-closable="false" :confirmLoading="confirmLoading" fullscreen>
     <a-spin :spinning="spinning">
-      <a-form-model ref='form' :model='tableRowRecord' :labelCol="labelCol" :wrapperCol="wrapperCol"
-                    :rules="validatorRules">
-        <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> 鐐规鍩虹淇℃伅</a-divider>
+      <a-form-model ref='form' :model='model' :labelCol="labelCol" :wrapperCol="wrapperCol" :rules="validatorRules">
+        <a-row :gutter="48" id="outer-row">
+          <a-col :span="8" class="scroll-col">
+            <a-tabs>
+              <a-tab-pane tab="鍩虹淇℃伅">
+                <a-row>
+                  <a-col :span='span'>
+                    <a-form-model-item label="宸ュ崟鍙�">
+                      <a-input readOnly v-model="model.orderNum"/>
+                    </a-form-model-item>
+                  </a-col>
+                  <a-col :span='span'>
+                    <a-form-model-item label="璁惧缂栧彿">
+                      <MaintenanceEquipmentSelect v-model="model.equipmentId"
+                                                  :maintenanceCategory="'POINT_INSPECTION'"
+                                                  disabled @autocompleteForm="autoCompleteForm"/>
+                    </a-form-model-item>
+                  </a-col>
 
-        <a-row>
-          <a-col :span='span'>
-            <a-form-model-item label="宸ュ崟鍙�">
-              <a-input readOnly v-model="tableRowRecord.orderNum"/>
-            </a-form-model-item>
-          </a-col>
-          <a-col :span='span'>
-            <a-form-model-item label="璁惧缂栧彿">
-              <MaintenanceEquipmentSelect v-model="tableRowRecord.equipmentId"
-                                          :maintenanceCategory="'POINT_INSPECTION'" disabled
-                                          @autocompleteForm="autoCompleteForm"/>
-            </a-form-model-item>
-          </a-col>
-          <a-col :span='span'>
-            <a-form-model-item label="鏍囧噯鍚嶇О">
-              <a-input readOnly v-model="tableRowRecord.standardName"/>
-            </a-form-model-item>
-          </a-col>
-        </a-row>
+                </a-row>
 
-        <a-row>
-          <a-col :span='span'>
-            <a-form-model-item label="鏍囧噯缂栫爜">
-              <a-input readOnly v-model="tableRowRecord.standardCode"/>
-            </a-form-model-item>
-          </a-col>
-          <a-col :span='span'>
-            <a-form-model-item label="鐐规鏃ユ湡">
-              <a-input v-model="tableRowRecord.inspectionDate" readOnly/>
-            </a-form-model-item>
-          </a-col>
-          <a-col :span='span'>
-            <a-form-model-item label="鐐规杩囨湡鏃堕棿">
-              <a-input v-model="tableRowRecord.expirationTime" readOnly/>
-            </a-form-model-item>
-          </a-col>
-        </a-row>
+                <a-row>
+                  <a-col :span='span'>
+                    <a-form-model-item label="瑙勮寖鍚嶇О">
+                      <a-input readOnly v-model="model.standardName"/>
+                    </a-form-model-item>
+                  </a-col>
+                  <a-col :span='span'>
+                    <a-form-model-item label="瑙勮寖缂栫爜">
+                      <a-input readOnly v-model="model.standardCode"/>
+                    </a-form-model-item>
+                  </a-col>
 
-        <a-row>
-          <a-col :span='span'>
-            <a-form-model-item label="淇濆吇鍛ㄦ湡">
-              <a-input v-model="tableRowRecord.maintenancePeriod" readOnly/>
-            </a-form-model-item>
+                </a-row>
+
+                <a-row>
+                  <a-col :span='span'>
+                    <a-form-model-item label="鐐规鏃ユ湡">
+                      <a-input v-model="model.inspectionDate" readOnly/>
+                    </a-form-model-item>
+                  </a-col>
+                  <a-col :span='span'>
+                    <a-form-model-item label="杩囨湡鏃堕棿">
+                      <a-input v-model="model.expirationTime" readOnly/>
+                    </a-form-model-item>
+                  </a-col>
+                </a-row>
+
+                <a-row>
+                  <a-col :span='span'>
+                    <a-form-model-item label="淇濆吇鍛ㄦ湡">
+                      <a-input v-model="model.maintenancePeriod" readOnly/>
+                    </a-form-model-item>
+                  </a-col>
+                  <a-col :span='span'>
+                    <a-form-model-item label="鐐规浜�">
+                      <a-input v-model="model.operator_dictText" readOnly/>
+                    </a-form-model-item>
+                  </a-col>
+                </a-row>
+
+                <a-row>
+                  <a-col :span="span*2">
+                    <a-form-model-item label="澶囨敞" :labelCol="{span:4}" :wrapperCol="{span:20}">
+                      <a-textarea v-model="model.remark" rows="3" readOnly/>
+                    </a-form-model-item>
+                  </a-col>
+                </a-row>
+              </a-tab-pane>
+            </a-tabs>
           </a-col>
-          <a-col :span='span'>
-            <a-form-model-item label="鐐规浜�">
-              <a-input v-model="tableRowRecord.operator_dictText" readOnly/>
-            </a-form-model-item>
-          </a-col>
-        </a-row>
 
-        <a-row>
-          <a-col :span="span*3">
-            <a-form-model-item label="澶囨敞" :labelCol="{span:2}" :wrapperCol="{span:21}">
-              <a-textarea v-model="tableRowRecord.remark" rows="3" readOnly/>
-            </a-form-model-item>
-          </a-col>
-        </a-row>
+          <a-col :span="!isDisplayConfirm?16:10" class="scroll-col">
+            <a-tabs :active-key="activeTabKey" @change="handleTabChange">
+              <a-tab-pane key="1" tab="鏃ョ偣妫�">
+                <j-vxe-table ref="editableDetailTable1" :columns="getColumns()" :rowNumber="false" rowSelection bordered
+                             alwaysEdit :toolbar="false" keep-source :height="500"
+                             :dataSource="detail.dayInspectionList"
+                             @selectRowChange="handleTableSelectRowChange($event,'Day')">
+                  <template v-slot:inspectionResult="props">
+                    <j-dict-select-tag v-model="props.row.inspectionResult" dictCode="inspection_project_result"
+                                       :disabled="isDisableOperation" placeholder="璇烽�夋嫨鐐规缁撴灉"
+                                       @change="handleInspectionResultSelectChange($event,props.row)"
+                                       style="width: 100%"/>
+                  </template>
 
-        <a-row>
-          <a-form-model-item prop="imageFilesResult" label="鐐规鍥剧墖" :labelCol="{span:2}" :wrapperCol="{span:21}">
-            <lx-upload :returnUrl="false" :isMultiple="true" file-type="image" :number="3"
-                       :disabled="isDisableOperation||!hasInspectionDateArrived"
-                       v-model="tableRowRecord.fileList"/>
-          </a-form-model-item>
-        </a-row>
+                  <template v-slot:exceptionDescription="props">
+                    <a-textarea :rows="1" style="resize: none" v-model="props.row.exceptionDescription"
+                                :placeholder="props.row.inspectionResult&&props.row.inspectionResult!='NORMAL'?'璇疯緭鍏ュ紓甯告弿杩�':''"
+                                :disabled="isDisableOperation||!props.row.inspectionResult||props.row.inspectionResult=='NORMAL'"/>
+                  </template>
 
-        <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;">
-          淇濆吇椤逛俊鎭�
-        </a-divider>
+                  <template v-slot:reportFlag="props">
+                    <j-dict-select-tag v-model="props.row.reportFlag"
+                                       :disabled="true"
+                                       dictCode="yn" style="width: 100%"/>
+                  </template>
 
-        <a-tabs v-model="activeTabKey">
-          <a-tab-pane key="1" tab="淇濆吇椤规槑缁�">
-            <j-vxe-table
-              ref="editableDetailTable"
-              :rowNumber="false"
-              :rowSelection="true"
-              :bordered="true"
-              :alwaysEdit="true"
-              :toolbar="false"
-              keep-source
-              :height="300"
-              :loading="detail.loading"
-              :dataSource="detail.dataSource"
-              :columns="detail.columns"
-              @selectRowChange="handleTableSelectRowChange"
-            >
-              <template v-slot:inspectionResult="props">
-                <j-dict-select-tag v-model="props.row.inspectionResult" dictCode="eam_inspection_result"
-                                   :disabled="isDisableOperation"
-                                   placeholder="璇烽�夋嫨鐐规缁撴灉"
-                                   @change="handleInspectionResultSelectChange($event,props.row)"
-                                   style="width: 100%"/>
+                  <!-- 鎿嶄綔 -->
+                  <template v-slot:action="props">
+                    <a :class="{ 'disabled-link': shouldDisableRepairButton(props.row) }"
+                       @click="!shouldDisableRepairButton(props.row) && handleRepairReporting(props.row)">
+                      鎶ヤ慨濉姤
+                    </a>
+                  </template>
+
+                </j-vxe-table>
+              </a-tab-pane>
+
+              <a-tab-pane key="2" tab="鍛ㄧ偣妫�" forceRender>
+                <j-vxe-table ref="editableDetailTable2" :rowNumber="false" rowSelection bordered
+                             alwaysEdit :toolbar="false" keep-source :height="500"
+                             :dataSource="detail.weekInspectionList"  :columns="getColumns()"
+                             @selectRowChange="handleTableSelectRowChange($event,'Week')">
+                  <template v-slot:inspectionResult="props">
+                    <j-dict-select-tag v-model="props.row.inspectionResult" dictCode="inspection_project_result"
+                                       :disabled="isDisableOperation||detail.weekInspectionFinishedFlag"
+                                       placeholder="璇烽�夋嫨鐐规缁撴灉"
+                                       @change="handleInspectionResultSelectChange($event,props.row)"
+                                       style="width: 100%"/>
+                  </template>
+
+                  <template v-slot:exceptionDescription="props">
+                    <a-textarea :rows="1" style="resize: none" v-model="props.row.exceptionDescription"
+                                :placeholder="props.row.inspectionResult&&props.row.inspectionResult!='NORMAL'?'璇疯緭鍏ュ紓甯告弿杩�':''"
+                                :disabled="isDisableOperation||!props.row.inspectionResult||props.row.inspectionResult=='NORMAL'"/>
+                  </template>
+
+                  <template v-slot:reportFlag="props">
+                    <j-dict-select-tag v-model="props.row.reportFlag"
+                                       :disabled="true"
+                                       dictCode="yn" style="width: 100%"/>
+                  </template>
+
+
+                  <!-- 鎿嶄綔 -->
+                  <template v-slot:action="props">
+                    <a :class="{ 'disabled-link': shouldDisableRepairButton(props.row) }"
+                       @click="!shouldDisableRepairButton(props.row) && handleRepairReporting(props.row)">
+                      鎶ヤ慨濉姤
+                    </a>
+                  </template>
+
+                </j-vxe-table>
+              </a-tab-pane>
+
+              <template v-if="selectShenpiData.procInstId">
+                <a-tab-pane key='3' tab='娴佺▼鍥�'>
+                  <img :src="imageSrc" v-if="imageSrc"/>
+                </a-tab-pane>
               </template>
 
-              <template v-slot:exceptionDescription="props">
-                <a-textarea style="height: 32px" v-model="props.row.exceptionDescription"
-                            :placeholder="props.row.inspectionResult==='2'?'璇疯緭鍏ュ紓甯告弿杩�':''"
-                            :disabled="isDisableOperation||!props.row.inspectionResult||props.row.inspectionResult==='1'"/>
-              </template>
+              <a-tab-pane key='4' tab='娴佽浆鑺傜偣'>
+                <a-card>
+                  <a-timeline style="padding:0 1% 0 12%" >
+                    <a-timeline-item color='white' v-for="(item,index1) in hitaskDataSource" :key="index1">
+                      <div class="bottom">
+                        <p>澶勭悊浜猴細{{item.assignee_dictText}}</p>
+                        <p v-if="index1 !==0">澶勭悊鏃堕暱锛歿{item.duration}}</p>
+                        <p v-if="item.name !== '鎻愪氦鐢宠'">澶勭悊绫诲瀷锛歿{item.sequenceFlowName}}</p>
+                        <p v-if="item.description != null">澶勭悊鎰忚锛歿{item.description}}</p>
+                        <div class="left_qiu"><span>{{item.taskName}}</span></div>
+                      </div>
+                    </a-timeline-item>
+                  </a-timeline>
+                </a-card>
+              </a-tab-pane>
 
-              <template v-slot:reportFlag="props">
-                <j-dict-select-tag v-model="props.row.reportFlag"
-                                   :placeholder="props.row.inspectionResult==='2'?'璇烽�夋嫨寮傚父鏄惁鎶ヤ慨':''"
-                                   :disabled="isDisableOperation||!props.row.inspectionResult||props.row.inspectionResult==='1'"
-                                   dictCode="yn"
-                                   style="width: 100%"/>
-              </template>
-            </j-vxe-table>
-          </a-tab-pane>
 
-          <template v-if="selectShenpiData.procInstId">
-            <a-tab-pane key='2' tab='娴佺▼鑺傜偣'>
-              <a-card :bordered="false">
-                <a-timeline>
-                  <a-timeline-item v-for="(item,index) in hitaskDataSource" :key="index">
-                    <div>
-                      <h3 style="font-weight: bold;">{{item.taskName}}</h3>
-                      <div>澶勭悊浜猴細{{item.assignee_dictText}}</div>
-                      <div v-if="index !==0">澶勭悊鏃堕暱锛歿{item.duration}}</div>
-                      <div v-if="item.name !== '鎻愪氦鐢宠'">澶勭悊绫诲瀷锛歿{item.sequenceFlowName}}</div>
-                      <div v-if="item.description">澶勭悊鎰忚锛歿{item.description}}</div>
-                    </div>
-                  </a-timeline-item>
-                </a-timeline>
-              </a-card>
-            </a-tab-pane>
+              <a-button
+                v-if="activeTabKey=='1'||activeTabKey=='2'"
+                :disabled="(activeTabKey=='1'&&selectedDayInspectionRowKeys.length==0)||(activeTabKey=='2'&&selectedWeekInspectionRowKeys.length==0)||(activeTabKey=='2'&&detail.weekInspectionFinishedFlag)||isDisableOperation"
+                slot="tabBarExtraContent" type="primary"
+                @click="handleSelectAllInspectionResult">鎵归噺鐐规姝e父
+              </a-button>
+            </a-tabs>
+          </a-col>
 
-            <a-tab-pane key='3' tab='娴佺▼鍥�'>
-              <img :src="imageSrc" alt="Fetched Image"/>
-            </a-tab-pane>
-          </template>
+          <a-col v-if="isDisplayConfirm" :span="6" class="scroll-col">
+            <a-tabs>
+              <a-tab-pane tab="缁翠慨宸ョ‘璁�">
+                <a-row>
+                  <a-col :span="24">
+                    <a-form-model-item prop="confirmDealType" label="澶勭悊绫诲瀷">
+                      <j-dict-select-tag type='radio' v-model='model.confirmDealType'
+                                         dictCode='approved_rejected'
+                                         :disabled="disableSubmit||model.inspectionStatus!=='WAIT_CONFIRM'"/>
+                    </a-form-model-item>
+                  </a-col>
 
-          <a-button
-            v-if="selectedRowKeys.length>0&&!isDisableOperation&&hasInspectionDateArrived&&activeTabKey==='1'"
-            slot="tabBarExtraContent" type="primary"
-            @click="handleSelectAllInspectionResult">鎵归噺鐐规姝e父
-          </a-button>
-
-          <!--<a-dropdown slot="tabBarExtraContent" v-if="selectedRowKeys.length>0">-->
-          <!--<a-menu slot="overlay">-->
-          <!--<a-menu-item key="1" @click="handleSelectAllInspectionResult('姝e父')">姝e父</a-menu-item>-->
-          <!--<a-menu-item key="2" @click="handleSelectAllInspectionResult('寮傚父')">寮傚父</a-menu-item>-->
-          <!--</a-menu>-->
-
-          <!--<a-button> 鎵归噺閫夋嫨鐐规缁撴灉-->
-          <!--<a-icon type="down"/>-->
-          <!--</a-button>-->
-          <!--</a-dropdown>-->
-        </a-tabs>
-
-        <template v-if="isDisplayConfirm">
-          <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> 绠$悊鍛樼‘璁や俊鎭�
-          </a-divider>
-
-          <a-row :gutter="24">
-            <a-col :span="12">
-              <a-form-model-item prop="confirmDealType" label="澶勭悊绫诲瀷">
-                <j-dict-select-tag type='radio' v-model='tableRowRecord.confirmDealType' dictCode='approved_rejected'
-                                   :disabled="disableSubmit||tableRowRecord.inspectionStatus!=='WAIT_CONFIRM'"/>
-              </a-form-model-item>
-            </a-col>
-
-            <a-col :span="12">
-              <a-form-model-item prop="confirmComment" label="澶勭悊鎰忚">
-                <a-textarea placeholder="璇疯緭鍏ュ鐞嗘剰瑙�"
-                            :disabled="disableSubmit||tableRowRecord.inspectionStatus!=='WAIT_CONFIRM'"
-                            v-model="tableRowRecord.confirmComment"/>
-              </a-form-model-item>
-            </a-col>
-          </a-row>
-        </template>
+                  <a-col :span="24">
+                    <a-form-model-item label="澶勭悊鎰忚">
+                      <a-textarea placeholder="璇疯緭鍏ユ剰瑙�"
+                                  :disabled="disableSubmit||model.inspectionStatus!=='WAIT_CONFIRM'"
+                                  v-model="model.confirmComment"/>
+                    </a-form-model-item>
+                  </a-col>
+                </a-row>
+              </a-tab-pane>
+            </a-tabs>
+          </a-col>
+        </a-row>
       </a-form-model>
+      <eamReportRepair-modal ref="modalForm"  @ok="handleRepairComplete" @close="handleRepairClose"/>
     </a-spin>
   </j-modal>
 </template>
 
 <script>
-  import '@assets/less/TableExpand.less'
-  import { getAction, deleteAction, postAction, downFile, httpAction } from '@api/manage'
+  import { getAction, postAction, downFile } from '@api/manage'
   import MaintenanceEquipmentSelect from '@views/eam/equipment/modules/MaintenanceEquipmentSelect.vue'
   import { JVXETypes } from '@comp/jeecg/JVxeTable'
   import moment from 'moment'
+  import EamReportRepairModal from "@views/eam/repair/modules/EamReportRepairList/EamReportRepairModal.vue";
 
   export default {
     name: 'InspectionOrderHandle',
-    components: { MaintenanceEquipmentSelect },
+    components: {EamReportRepairModal, MaintenanceEquipmentSelect },
     props: {
       selectShenpiData: {
         type: Object
@@ -210,24 +228,20 @@
     },
     data() {
       return {
-        span: 8,
+        span: 12,
         confirmLoading: false,
         spinning: false,
-        tableRowRecord: {},
-        assignFileStream: {},
-        hitaskDataSource: [],
+        model: {},
+        currentRepairRow: null,
         validatorRules: {
           confirmDealType: [
             { required: true, message: '璇烽�夋嫨澶勭悊绫诲瀷' }
-          ],
-          confirmComment: [
-            { required: true, message: '璇疯緭鍏ュ鐞嗘剰瑙�' }
           ]
         },
         imageSrc: null,
         labelCol: {
           xs: { span: 24 },
-          sm: { span: 6 }
+          sm: { span: 8 }
         },
         wrapperCol: {
           xs: { span: 30 },
@@ -236,22 +250,20 @@
         visible: false,
         // 琛ㄥご
         url: {
-          // queryBomDataById: '/eam/eamInspectionOrder/selectVoById',
           diagramView: '/assign/flow/diagramView',
           queryHisTaskList: '/assign/flow/queryHisTaskList',
           approve: '/eam/eamInspectionOrder/approval',
           queryById: '/eam/eamInspectionOrder/queryById',
-          detailList: '/eam/eamInspectionOrderDetail/queryList'
+          detailList: '/eam/eamInspectionOrderDetail/queryList',
+          weekInspectionOrderList: '/eam/eamWeekInspectionDetail/queryStandardList'
         },
         detail: {
-          loading: false,
-          dataSource: [],
           columns: [
             {
               title: '搴忓彿',
               key: 'itemCode',
               type: JVXETypes.normal,
-              width: '5%',
+              width: 60,
               align: 'center',
               fixed: 'left'
             },
@@ -259,7 +271,6 @@
               title: '淇濆吇椤�',
               key: 'itemName',
               type: JVXETypes.normal,
-              width: '15%',
               align: 'center',
               fixed: 'left'
             },
@@ -267,7 +278,6 @@
               title: '淇濆吇瑕佹眰',
               key: 'itemDemand',
               type: JVXETypes.normal,
-              width: '15%',
               align: 'center',
               fixed: 'left'
             },
@@ -276,10 +286,9 @@
               key: 'inspectionResult',
               type: JVXETypes.slot,
               slotName: 'inspectionResult',
-              width: '15%',
               align: 'center',
               validateRules: [
-                { required: true, message: '${title}涓嶈兘涓虹┖锛�' }
+                { required: true, message: '${title}涓嶈兘涓虹┖' }
               ]
             },
             {
@@ -287,7 +296,6 @@
               key: 'exceptionDescription',
               type: JVXETypes.slot,
               slotName: 'exceptionDescription',
-              width: '20%',
               align: 'center',
               validateRules: [
                 { handler: this.customValidator }
@@ -298,111 +306,263 @@
               key: 'reportFlag',
               type: JVXETypes.slot,
               slotName: 'reportFlag',
-              width: '20%',
               align: 'center',
               validateRules: [
                 { handler: this.customValidator }
               ]
+            },
+            {
+              title: '鎿嶄綔',
+              align: 'center',
+              type: JVXETypes.slot,
+              slotName: 'action',
+              fixed: 'right'
             }
-          ]
+          ],
+          dayInspectionList: [],
+          weekInspectionList: [],
+          weekInspectionFinishedFlag: false
         },
-        selectedRowKeys: [],
+        selectedDayInspectionRowKeys: [],
+        selectedWeekInspectionRowKeys: [],
+        hitaskDataSource:[],
         disableSubmit: false,
         activeTabKey: '1',
-        title: ''
+        title: '',
       }
     },
     computed: {
-      hasInspectionDateArrived() {
-        return moment(this.tableRowRecord.inspectionDate).diff(moment(), 'hours') <= 0
-      },
       isDisplayConfirm() {
-        return ['WAIT_CONFIRM', 'COMPLETE'].includes(this.tableRowRecord.inspectionStatus)
+        return ['WAIT_CONFIRM', 'COMPLETE'].includes(this.model.inspectionStatus)
       },
       isDisableOperation() {
-        return this.disableSubmit || this.tableRowRecord.inspectionStatus !== 'UNDER_INSPECTION'
+        return this.disableSubmit || this.model.inspectionStatus !== 'UNDER_INSPECTION'
+      },
+      // 娣诲姞鎿嶄綔鍒楁樉绀烘潯浠�
+      shouldShowActionColumn() {
+        return this.model.inspectionStatus === 'UNDER_INSPECTION';
       }
     },
     methods: {
+      // 娣诲姞鑾峰彇鍒楃殑鏂规硶
+      getColumns() {
+        const columns = [
+          // 鍩虹鍒楀畾涔夛紙搴忓彿銆佷繚鍏婚」绛夛級
+          {
+            title: '搴忓彿',
+            key: 'itemCode',
+            type: JVXETypes.normal,
+            width: 60,
+            align: 'center',
+            fixed: 'left'
+          },
+          {
+            title: '淇濆吇椤�',
+            key: 'itemName',
+            type: JVXETypes.normal,
+            align: 'center',
+            fixed: 'left'
+          },
+          {
+            title: '淇濆吇瑕佹眰',
+            key: 'itemDemand',
+            type: JVXETypes.normal,
+            align: 'center',
+            fixed: 'left'
+          },
+          {
+            title: '鐐规缁撴灉',
+            key: 'inspectionResult',
+            type: JVXETypes.slot,
+            slotName: 'inspectionResult',
+            align: 'center',
+            validateRules: [
+              { required: true, message: '${title}涓嶈兘涓虹┖' }
+            ]
+          },
+          {
+            title: '寮傚父鎻忚堪',
+            key: 'exceptionDescription',
+            type: JVXETypes.slot,
+            slotName: 'exceptionDescription',
+            align: 'center',
+            validateRules: [
+              { handler: this.customValidator }
+            ]
+          },
+          {
+            title: '寮傚父鏄惁鎶ヤ慨',
+            key: 'reportFlag',
+            type: JVXETypes.slot,
+            slotName: 'reportFlag',
+            align: 'center',
+            validateRules: [
+              { handler: this.customValidator }
+            ]
+          }
+        ];
+
+        // 浠呭湪鐐规涓姸鎬佷笅娣诲姞鎿嶄綔鍒�
+        if (this.shouldShowActionColumn) {
+          columns.push({
+            title: '鎿嶄綔',
+            align: 'center',
+            type: JVXETypes.slot,
+            width: 150,
+            slotName: 'action',
+            fixed: 'right'
+          });
+        }
+        return columns;
+      },
+
+      handleApprove(record) {
+        this.spinning = true
+        this.activeTabKey = '1'
+        this.detail.dayInspectionList = this.detail.weekInspectionList = []
+        this.getBasicInformationByApi(record)
+        this.getFlowChartImageByApi(record)
+        this.getFlowTaskListByApi(record)
+      },
+
+      handleDetail(record) {
+        this.spinning = true
+        this.activeTabKey = '1'
+        this.detail.dayInspectionList = this.detail.weekInspectionList = []
+        this.model = Object.assign({}, record)
+        this.getDayInspectionOrderListByApi(record.id)
+        this.getWeekInspectionOrderListByApi(record.standardId)
+        this.getFlowTaskListByApi(record)
+      },
+
       /**
-       * 鑾峰彇娴佺▼鑺傜偣鍜屾祦绋嬪浘
-       * @param record 寰呭姙璁板綍淇℃伅
+       * 鑾峰彇鍩虹淇℃伅
+       * @param record 涓婚〉闈㈠垪琛ㄨ璁板綍
        */
-      getAllApproveData(record) {
-        if (record.procInstId) {
-          const { processDefinitionId, processInstanceId, processDefinitionKey, procInstId } = record
-          const param = { procInstId }
-          const imageParam = { processDefinitionId, processInstanceId, TaskDefinitionKey: processDefinitionKey }
-          const that = this
-
-          getAction(this.url.queryHisTaskList, param)
-            .then(res => {
-              that.hitaskDataSource = res.result
-            })
-
-          downFile(this.url.diagramView, imageParam, 'get')
-            .then((res => {
-              const urlObject = window.URL.createObjectURL(new Blob([res]))
-              that.imageSrc = urlObject
-            }))
-            .catch(err => {
-              that.$notification.error({
+      getBasicInformationByApi(record) {
+        const that = this
+        getAction(this.url.queryById, { id: record.dataId })
+          .then(res => {
+            if (res.success) {
+              that.model = Object.assign({}, res.result)
+              that.model.dataId = record.dataId
+              that.model.taskId = record.id
+              that.model.userId = record.assignee
+              that.model.instanceId = record.procInstId
+              this.getDayInspectionOrderListByApi(record.dataId)
+              this.getWeekInspectionOrderListByApi(this.model.standardId)
+            }
+            else {
+              that.$notification.warning({
                 message: '娑堟伅',
                 description: res.message
               })
+            }
+          })
+      },
+
+      /**
+       * 鑾峰彇娴佺▼鍥�
+       * @param record 涓婚〉闈㈠垪琛ㄨ璁板綍
+       */
+      getFlowChartImageByApi(record) {
+        const { processDefinitionId, processInstanceId, processDefinitionKey } = record
+        const imageParam = { processDefinitionId, processInstanceId, TaskDefinitionKey: processDefinitionKey }
+        const that = this
+
+        downFile(this.url.diagramView, imageParam, 'get')
+          .then((res => {
+            that.imageSrc = window.URL.createObjectURL(new Blob([res]))
+          }))
+          .catch(err => {
+            that.$notification.error({
+              message: '娑堟伅',
+              description: err.message
+            })
+          })
+      },
+
+      /**
+       * 鑾峰彇鐐规宸ュ崟涓殑鏃ョ偣妫�鍒楄〃
+       * @param orderId 宸ュ崟鍙�
+       */
+      getDayInspectionOrderListByApi(orderId) {
+        if (orderId) {
+          getAction(this.url.detailList, { orderId })
+            .then(res => {
+              if (res.success) {
+                this.detail.dayInspectionList = res.result
+              }
+            })
+            .finally(() => {
+              this.spinning = false
             })
         }
       },
 
       /**
-       * 鑾峰彇寰呭姙璁板綍鐨勫熀鏈俊鎭�
-       * @param record 寰呭姙璁板綍淇℃伅
+       * 鑾峰彇鐐规宸ュ崟涓殑鍛ㄧ偣妫�鍒楄〃
+       * @param standardId 瑙勮寖id
        */
-      async getBasicInformation(record) {
-        this.activeTabKey = '1'
-        this.detail.dataSource = []
-        this.spinning = true
-        const param = { id: record.dataId }
-        let res = await getAction(this.url.queryById, param);
-        this.tableRowRecord = Object.assign({}, res.result);
-        if (this.tableRowRecord.imageFiles) {
-          let obj = JSON.parse(this.tableRowRecord.imageFiles)
-          this.tableRowRecord.fileList = [...obj]
-        }
-        await this.loadDetail(record.dataId)
+      getWeekInspectionOrderListByApi(standardId) {
+        getAction(this.url.weekInspectionOrderList, { standardId, inspectionDate: this.model.inspectionDate })
+          .then(res => {
+            if (res.success) {
+              this.detail.weekInspectionList = res.result.list
+              this.detail.weekInspectionFinishedFlag = res.result.weekInsFlag
+            }
+          })
+          .finally(() => {
+            this.spinning = false
+          })
       },
 
+      /**
+       * tab鏍忓垏鎹㈡椂瑙﹀彂
+       * @param tabKey 鍒囨崲鍚庣殑tabKey
+       */
+      handleTabChange(tabKey) {
+        if (this.activeTabKey == '1') this.$refs.editableDetailTable1.clearValidate()
+        this.activeTabKey = tabKey
+      },
+
+      // 鎻愪氦浜嬩欢
       async submitForm() {
-        let errMap = await this.$refs.editableDetailTable.validateTable()
+        let errMap = await this.$refs.editableDetailTable1.validateTable()
         if (errMap) {
-          console.log('err', errMap)
+          if (this.activeTabKey != '1') {
+            this.activeTabKey = '1'
+            // 鍐呴儴鏍¢獙鎻愮ず鍥爐ab鍒囨崲鏃跺畾浣嶅嚭鐜伴棶棰樺洜姝ゅ湪姝ゅ娓呮鍐呴儴鏍¢獙鎻愮ず锛屽鍔爊otification鎻愮ず
+            this.$refs.editableDetailTable1.clearValidate()
+            this.$notification.warning({
+              message: '娑堟伅',
+              description: '鏃ョ偣妫�缁撴灉涓嶈兘涓虹┖'
+            })
+          }
           return
         }
 
         this.$refs.form.validate(valid => {
           if (valid) {
             this.confirmLoading = this.spinning = true
-            const flowTaskVo = {}
-            flowTaskVo.dataId = this.selectShenpiData.dataId
-            flowTaskVo.taskId = this.selectShenpiData.id
-            flowTaskVo.userId = this.selectShenpiData.assignee
-            flowTaskVo.instanceId = this.selectShenpiData.procInstId
-            flowTaskVo.values = this.selectShenpiData.variables
-            flowTaskVo.confirmDealType = this.tableRowRecord.confirmDealType
-            flowTaskVo.confirmComment = this.tableRowRecord.confirmComment
-            flowTaskVo.fileList = this.tableRowRecord.fileList
-            flowTaskVo.tableDetailList = this.$refs.editableDetailTable.getTableData()
+            this.model.tableDetailList = this.$refs.editableDetailTable1.getTableData()
+            if (!this.detail.weekInspectionFinishedFlag) this.model.tableWeekDetailList = this.$refs.editableDetailTable2.getTableData()
             const that = this
-            console.log('琛ㄥ崟鎻愪氦鏁版嵁', flowTaskVo)
-            httpAction(this.url.approve, flowTaskVo, 'post')
+            postAction(this.url.approve, this.model)
               .then((res) => {
                 if (res.success) {
-                  that.$message.success(res.message)
+                  that.$notification.success({
+                    message: '娑堟伅',
+                    description: res.message
+                  })
                   //鍒锋柊琛ㄦ牸
-                  that.$emit('searchReset')
+                  that.$emit('modalFormOk')
                   that.handleCancel()
                 } else {
-                  that.$message.warning(res.message)
+                  that.$notification.warning({
+                    message: '娑堟伅',
+                    description: res.message
+                  })
                 }
               })
               .finally(() => {
@@ -415,31 +575,44 @@
       },
 
       autoCompleteForm({ standardName, maintenancePeriod, standardCode }) {
-        this.$set(this.tableRowRecord, 'standardName', standardName)
-        this.$set(this.tableRowRecord, 'maintenancePeriod', maintenancePeriod)
-        this.$set(this.tableRowRecord, 'standardCode', standardCode)
+        this.$set(this.model, 'standardName', standardName)
+        this.$set(this.model, 'maintenancePeriod', maintenancePeriod)
+        this.$set(this.model, 'standardCode', standardCode)
       },
 
       // 鎵归噺閫夋嫨鎵�鏈夌偣妫�缁撴灉
       handleSelectAllInspectionResult() {
-        this.selectedRowKeys.forEach(key => {
-          const dataItem = this.detail.dataSource.find(item => item.id === key)
-          if (dataItem && dataItem.inspectionResult !== '1') {
+        let selectedRowKeys, prefix
+        if (this.activeTabKey == '1') {
+          selectedRowKeys = this.selectedDayInspectionRowKeys
+          prefix = 'day'
+        }
+        else if (this.activeTabKey == '2') {
+          selectedRowKeys = this.selectedWeekInspectionRowKeys
+          prefix = 'week'
+        }
+        else selectedRowKeys = []
+        if (selectedRowKeys.length == 0) return
+
+        selectedRowKeys.forEach(key => {
+          const dataItem = this.detail[prefix + 'InspectionList'].find(item => item.id === key)
+          if (dataItem && dataItem.inspectionResult !== 'NORMAL') {
             delete dataItem.exceptionDescription
             delete dataItem.reportFlag
-            dataItem.inspectionResult = '1'
+            dataItem.inspectionResult = 'NORMAL'
           }
         })
-        this.$refs.editableDetailTable.clearCheckboxRow()
-        this.selectedRowKeys = []
+        this.$refs['editableDetailTable' + this.activeTabKey].clearCheckboxRow()
+        this['selected' + prefix.charAt(0).toUpperCase() + prefix.slice(1) + 'InspectionRowKeys'] = []
       },
 
       /**
        * 琛ㄦ牸澶氶�夋鍙戠敓鏀瑰彉鏃惰Е鍙�
        * @param {selectedRowIds} 琛ㄦ牸涓凡閫夋嫨鐨処D鍒楄〃
+       * @param key 鐐规鍖哄垎key
        */
-      handleTableSelectRowChange({ selectedRowIds }) {
-        this.selectedRowKeys = selectedRowIds
+      handleTableSelectRowChange({ selectedRowIds }, key) {
+        this['selected' + key + 'InspectionRowKeys'] = selectedRowIds
       },
 
       /**
@@ -452,10 +625,16 @@
         if (record.reportFlag) delete record.reportFlag
       },
 
+      /**
+       * 寮傚父鎻忚堪涓庡紓甯告槸鍚︿繚淇瓧娈佃嚜瀹氫箟鏍¢獙鏂规硶
+       * @param cellValue  鍗曞厓鏍煎唴鐨勫��
+       * @param row  褰撳墠琛岃褰�
+       * @param callback 缁撴灉鍥炶皟鍑芥暟
+       */
       customValidator({ cellValue, row }, callback) {
-        if (row.inspectionResult === '2') {
+        if (this.activeTabKey == '1' && row.inspectionResult == 'ANOMALY') {
           if (!cellValue) {
-            callback(false, '${title}涓嶈兘涓虹┖锛�') // false = 鏈�氳繃锛屽彲浠ヨ窡鑷畾涔夋彁绀�
+            callback(false, '璇疯緭鍏�${title}') // false = 鏈�氳繃锛屽彲浠ヨ窡鑷畾涔夋彁绀�
           } else {
             callback(true) // true = 閫氳繃楠岃瘉
           }
@@ -464,31 +643,203 @@
         }
       },
 
-      handleCancel() {
-        this.selectedRowKeys = []
-        this.visible = false
+      /**
+       * 鑾峰彇娴佽浆鑺傜偣
+       * @param record
+       */
+      getFlowTaskListByApi(record) {
+        let parmhis={
+          'procInstId': record.procInstId
+        }
+        getAction(this.url.queryHisTaskList,parmhis).then(res=>{
+          this.hitaskDataSource=res.result
+        }).finally(
+          this.visible = true,
+          console.log('this.approveData---->', this.approveData)
+        )
       },
-      //鏍囧噯閫夋嫨鍙樺寲
-      loadDetail(orderId) {
-        if (orderId) {
-          getAction(this.url.detailList, { orderId: orderId })
-            .then(res => {
-              if (res.success) {
-                this.detail.dataSource = [...res.result]
-              }
-            })
-            .finally(() => {
-              this.spinning = false
-            })
+
+      // 娣诲姞绂佺敤鏉′欢鍒ゆ柇鏂规硶
+      shouldDisableRepairButton(row) {
+        return this.model.inspectionStatus !== 'UNDER_INSPECTION' ||
+          row.inspectionResult !== 'ANOMALY';
+      },
+
+      /**
+       * 寮傚父鎻忚堪濉姤鏁呴殰鎶ヤ慨
+       * @param exceptionDescription
+       */
+      handleRepairReporting(row) {
+        this.currentRepairRow = row; // 瀛樺偍褰撳墠鎿嶄綔琛�
+        let record = {
+          faultDescription: row.exceptionDescription,
+          equipmentId: this.model.equipmentId
+        }
+        this.$refs.modalForm.handleRepair(record)
+      },
+
+      handleRepairClose(success) {
+        if (!success && this.currentRepairRow) {
+          this.currentRepairRow = null; // 娓呴櫎鏈垚鍔熺殑鎿嶄綔
         }
       },
+
+      handleRepairComplete(success) {
+        if (success && this.currentRepairRow) {
+          this.$set(this.currentRepairRow, 'reportFlag', '1');
+          this.$message.success("鎶ヤ慨宸叉垚鍔熸彁浜�");
+        }
+        this.currentRepairRow = null;
+      },
+
+      handleCancel() {
+        this.selectedDayInspectionRowKeys = this.selectedWeekInspectionRowKeys = []
+        this.visible = false
+      }
     }
   }
 </script>
-<style scoped>
+<style scoped lang="less">
   /deep/ .ant-select-dropdown-menu {
     text-align: left;
   }
 
-  @import '~@assets/less/common.less';
+  /deep/ .ant-spin-nested-loading {
+    height: 100%;
+
+    .ant-spin-container {
+      height: 100%;
+
+      .ant-form {
+        height: 100%;
+
+        #outer-row {
+          height: 100%;
+
+          .scroll-col {
+            height: 100%;
+            overflow: auto;
+          }
+        }
+      }
+    }
+  }
+  /* 鍏ㄥ眬绂侀�夋牱寮� - 浣滅敤浜庢暣涓〉闈� */
+  html.submitting,
+  html.submitting body {
+    pointer-events: none !important;
+    cursor: wait !important;
+  }
+
+  /* 钂欏眰鏁堟灉澧炲己 */
+  html.submitting::before {
+    content: '';
+    position: fixed;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+    background: rgba(255, 255, 255, 0.5);
+    z-index: 9998;
+  }
+
+  /* 鍔犺浇鎸囩ず鍣� - 鏇存槑鏄剧殑瑙嗚鍙嶉 */
+  html.submitting::after {
+    content: '鎻愪氦涓�...';
+    position: fixed;
+    top: 50%;
+    left: 50%;
+    transform: translate(-50%, -50%);
+    background: #1890ff;
+    color: white;
+    padding: 10px 20px;
+    border-radius: 4px;
+    z-index: 9999;
+  }
+
+  /* 绂佺敤鐘舵�佹寜閽牱寮� */
+  .disabled-btn {
+    opacity: 0.6;
+    cursor: not-allowed !important;
+  }
+
+  .shallow-hr {
+    border: 0;
+    height: 1px; /* 鍒嗙晫绾跨殑楂樺害 */
+    background-color: rgba(0, 0, 0, 0.1); /* 浣跨敤 RGBA 棰滆壊锛屽苟璁剧疆杈冧綆鐨勯�忔槑搴� */
+    margin: 20px 0; /* 鍒嗙晫绾夸笂涓嬬殑澶栬竟璺� */
+  }
+  .btn-custom {
+    background-color: #4CAF50; /* 缁胯壊鑳屾櫙 */
+    color: white; /* 鐧借壊鏂囧瓧 */
+    border: none; /* 鏃犺竟妗� */
+    padding: 5px 15px; /* 鍐呰竟璺� */
+    text-align: center; /* 鏂囧瓧灞呬腑 */
+    text-decoration: none; /* 鏃犱笅鍒掔嚎 */
+    display: inline-block; /* 琛屽唴鍧楀厓绱� */
+    font-size: 12px; /* 瀛椾綋澶у皬 */
+    margin: 4px 2px; /* 澶栬竟璺� */
+    cursor: pointer; /* 榧犳爣鎮仠鏃舵樉绀烘墜鍨� */
+    border-radius: 4px; /* 鍦嗚杈规 */
+  }
+
+  .bold-large-label {
+    font-weight: bold;
+    font-size: 20px; /* 鎴栦綘闇�瑕佺殑浠讳綍澶у皬 */
+  }
+  .left_qiu{
+    position: absolute;
+    left: -74px;
+    top: 0;
+    width:54px;
+    border-radius: 50%;
+    height:54px;
+    font-size: 13px;
+    margin: auto;
+    display: flex;
+    flex-wrap: wrap;
+    align-items: center;
+    justify-content: center;
+    background: #0099ff;
+    transform: translate(0, 0);
+  }
+  /deep/ .ant-timeline-item-tail{
+    left: -29px !important;
+  }
+  .left_qiu span{
+    width: 3em;
+    display: block;
+    color: #fff;
+    text-align: center;
+  }
+  .img{
+    width: 75%;
+  }
+
+  .wrap{
+    clear: both;
+    width: 100%;
+    display: flex;
+    height: 50px;
+    border: 1px solid #ccc;
+    /* background-color: aqua; */
+  }
+  .box{
+    width:21%;
+    height:50px;
+    border-right: 1px solid #ccc;
+    line-height: 50px;
+    /* background: red; */
+    text-align:center;
+    margin: auto;
+  }
+
+
+  /* 娣诲姞绂佺敤鏍峰紡 */
+  .disabled-link {
+    color: #999;
+    cursor: not-allowed;
+    pointer-events: none;
+    text-decoration: none;
+  }
 </style>
\ No newline at end of file

--
Gitblit v1.9.3