zhangherong
2025-04-27 dbb3445dc720a8f36b3424e73f2e02a6b0f9deb6
src/views/flowable/workflow/InspectionOrder/InspectionOrderHandle.vue
@@ -1,133 +1,98 @@
<!--
 Description: 工作流-设备点检处理页面 List
 Author: 作者 liuyh
 Date:   2025-02-27
-->
<template>
  <a-modal
  <j-modal
    :title="title"
    :width="width"
    :width="1200"
    :visible="visible"
    :footer="null"
    @cancel="handCancel"
    :okButtonProps="{ class:{'jee-hidden': disableSubmit||!hasInspectionDateArrived} }"
    @ok="submitForm"
    @cancel="handleCancel"
    :mask-closable="false"
    :confirmLoading="confirmLoading"
    switchFullscreen
    centered
  >
    <a-card :bordered="false">
      <div>
        <b>{{ selectShenpiData.description }}</b>
        <br>
        <br>
        <a-tag color="blue">
          当前处理人 {{ selectShenpiData.assignee_dictText }}
        </a-tag>
        <a-tag color="blue">
          任务创建时间 {{ selectShenpiData.createTime }}
        </a-tag>
        <br>
        <br>
        <button @click="fetchAndShowBmp" class="btn-custom">打开流程图</button>
        <div v-if="imageSrc">
          <img :src="imageSrc" alt="Fetched Image" />
        </div>
        <hr class="shallow-hr">
      </div>
      <div>
        <b>点检工单详情</b>
        <br>
        <a-form :form='form'>
          <a-spin :spinning="spinning">
            <a-tabs default-active-key='1' @change='callback'>
              <a-tab-pane key='1' tab='基本信息'>
                <a-form-model ref='form' :model='tableRowRecord' :rules='validatorRules'>
                  <a-row>
                    <a-col :span='span'>
                      <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardCode" label="工单号">
                        <a-input placeholder="工单号自动生成" :disabled="true" v-model="tableRowRecord.orderNum" />
                      </a-form-model-item>
                    </a-col>
                    <a-col :span='span'>
                      <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId" label="设备编号">
                        <MaintenanceEquipmentSelect placeholder="请输入设备编号或名称搜索" v-model="tableRowRecord.equipmentId"
                                                    :maintenanceCategory="maintenanceCategory" :disabled="true"
                                                    @autocompleteForm="autocompleteForm"></MaintenanceEquipmentSelect>
                      </a-form-model-item>
                    </a-col>
    <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-row>
                  <a-row>
                    <a-col :span='span'>
                      <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardName" label="标准名称">
                        <a-input placeholder="请输入标准名称" disabled v-model="this.standardName" />
                      </a-form-model-item>
                    </a-col>
                    <a-col :span='span'>
                      <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardCode" label="标准编码">
                        <a-input placeholder="请输入标准编码" disabled v-model="this.standardCode" />
                      </a-form-model-item>
                    </a-col>
                  </a-row>
                  <a-row>
                    <a-col :span='span'>
                      <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maintenancePeriod" label="保养周期">
                        <a-input-number v-model="this.maintenancePeriod" :min="1" :precision="0" disabled style="width: 100%" />
                      </a-form-model-item>
                    </a-col>
                    <a-col :span='span'>
                      <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operator" label="点检人">
                        <j-dict-select-tag v-model="tableRowRecord.operator" placeholder="请选择用户" disabled dictCode="sys_user,realname,username,username!='admin' order by create_time"/>
                      </a-form-model-item>
                    </a-col>
                  </a-row>
                  <a-row>
                    <a-col :span='span'>
                      <a-form-model-item label="点检日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inspectionDate">
                        <j-date placeholder="请选择点检日期" v-model="tableRowRecord.inspectionDate" disabled  style="width: 100%" />
                      </a-form-model-item>
                    </a-col>
                    <a-col :span='span'>
                      <a-form-model-item label="点检过期时间" :labelCol="{span:6}" :wrapperCol="{span:15}" prop="expirationTime">
                        <j-date placeholder="请选择点检过期时间" v-model="tableRowRecord.expirationTime" disabled style="width: 100%" />
                      </a-form-model-item>
                    </a-col>
                  </a-row>
                  <a-row >
                    <a-col :span="24">
                      <a-form-model-item label="备注" :labelCol="{span:1}" :wrapperCol="{span:22}" prop="remark">
                        <a-textarea v-model="tableRowRecord.remark" rows="3" placeholder="请输入备注" disabled />
                      </a-form-model-item>
                    </a-col>
                  </a-row>
                </a-form-model>
              </a-tab-pane>
              <a-tab-pane key='2' 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>
            </a-tabs>
          </a-spin>
        </a-form>
      </div>
      <div>
        <hr class="shallow-hr">
        <br>
        <b>保养项明细</b>
        <br>
        <a-form-model ref="form" :model="approveData" :rules="validatorRules" slot="detail">
          <a-row :gutter="24">
        <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-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 v-model="tableRowRecord.maintenancePeriod" readOnly/>
            </a-form-model-item>
          </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-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>
        <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;">
          保养项信息
        </a-divider>
        <a-tabs v-model="activeTabKey">
          <a-tab-pane key="1" tab="保养项明细">
            <j-vxe-table
              ref="editableDetailTable"
              :rowNumber="false"
              :rowSelection="false"
              :rowSelection="true"
              :bordered="true"
              :alwaysEdit="true"
              :toolbar="false"
@@ -136,311 +101,394 @@
              :loading="detail.loading"
              :dataSource="detail.dataSource"
              :columns="detail.columns"
              style="margin-top: 8px;" />
              @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>
              <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>
              <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-tab-pane key='3' tab='流程图'>
              <img :src="imageSrc" alt="Fetched Image"/>
            </a-tab-pane>
          </template>
          <a-button
            v-if="selectedRowKeys.length>0&&!isDisableOperation&&hasInspectionDateArrived&&activeTabKey==='1'"
            slot="tabBarExtraContent" type="primary"
            @click="handleSelectAllInspectionResult">批量点检正常
          </a-button>
          <!--<a-dropdown slot="tabBarExtraContent" v-if="selectedRowKeys.length>0">-->
          <!--<a-menu slot="overlay">-->
          <!--<a-menu-item key="1" @click="handleSelectAllInspectionResult('正常')">正常</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>
          <div class="table-operator" style="text-align: right;">
            <a-button  @click="handleQueXiaoTask" type="primary" icon="close">取消</a-button>
            <a-button @click="submitForm">提 交</a-button>
          </div>
        </a-form-model>
      </div>
    </a-card>
  </a-modal>
        </template>
      </a-form-model>
    </a-spin>
  </j-modal>
</template>
<script>
  import '@assets/less/TableExpand.less'
  import { getAction, deleteAction, postAction, downFile, httpAction } from '@api/manage'
  import MaintenanceEquipmentSelect from '@views/eam/equipment/modules/MaintenanceEquipmentSelect.vue'
  import { JVXETypes } from '@comp/jeecg/JVxeTable'
  import moment from 'moment'
import '@assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { getAction, deleteAction, postAction, downFile, httpAction } from '@api/manage'
import MaintenanceEquipmentSelect from '@views/eam/equipment/modules/MaintenanceEquipmentSelect.vue'
import { JVXETypes } from '@comp/jeecg/JVxeTable'
export default {
  name: 'FlowShenPi',
  components: { MaintenanceEquipmentSelect },
  mixins: [mixinDevice],
  props: {
    selectShenpiData: {
      type: Object,
      required: true
    }
  },
  data() {
    return {
      form: this.$form.createForm(this),
      span: 12,
      span1: 8,
      coldisabled: true,
      spinning: false,
      tableRowRecord: {},
      assignFileStream:{},
      tableDataSource: [],
      usageDataSource: [],
      hitaskDataSource:[],
      bomForm: {},
      approveContent:"",
      imageSrc: null,
      drawerVisible: true,
      labelCol: {
        xs: { span: 24 },
        sm: { span: 5 }
      },
      wrapperCol: {
        xs: { span: 30 },
        sm: { span: 16 }
      },
      validatorRules: {
        status: {
          rules: [
            { required: true, message: '请选择审批状态!'},
  export default {
    name: 'InspectionOrderHandle',
    components: { MaintenanceEquipmentSelect },
    props: {
      selectShenpiData: {
        type: Object
      }
    },
    data() {
      return {
        span: 8,
        confirmLoading: false,
        spinning: false,
        tableRowRecord: {},
        assignFileStream: {},
        hitaskDataSource: [],
        validatorRules: {
          confirmDealType: [
            { required: true, message: '请选择处理类型' }
          ],
          confirmComment: [
            { required: true, message: '请输入处理意见' }
          ]
        },
      },
      approveData: {},
      flowData: {},
      title: '详情页面',
      width: 1000,
      visible: false,
      // 表头
      url: {
        queryBomDataById: '/eam/eamInspectionOrder/selectVoById',
        diagramView: '/assign/flow/diagramView',
        queryHisTaskList:'/dncFlow/dispatchFile/queryHisTaskList',
        approve:"/eam/eamInspectionOrder/approval",
        saveDispatchFile:"/dncFlow/dispatchFile/saveDispatchFile"
      },
      dictOptions: {},
      superFieldList: [],
      workflowSource: [],
      maintenanceCategory: 'POINT_INSPECTION',
      standardName:"",
      maintenancePeriod:"",
      standardCode:"",
      detail: {
        loading: false,
        dataSource: [],
        columns: [
          {
            title: '序号',
            key: 'itemCode',
            type: JVXETypes.normal,
            width: '10%',
            align:"center",
          },
          {
            title: '保养项',
            key: 'itemName',
            type: JVXETypes.normal,
            width: '20%',
            align:"center",
          },
          {
            title: '保养要求',
            key: 'itemDemand',
            type: JVXETypes.normal,
            width: '30%',
            align:"center",
          },
          {
            title: "点检结果"
            ,key: 'inspectionResult'
            ,type: JVXETypes.selectSearch
            ,dictCode:'eam_inspection_result'
            ,width: '20%'
            ,align:"center"
          },
          {
            title: '异常描述',
            key: 'exceptionDescription',
            type: JVXETypes.textarea,
            width: '30%',
            align:"center",
          },
          {
            title: '异常是否报修',
            key: 'reportFlag',
            type: JVXETypes.selectSearch,
            dictCode:'yn',
            width: '20%',
            align:"center",
          }
        ]
      }
    }
  },
  created() {
  },
  computed: {},
  methods: {
    callback() {
    },
    handCancel() {
      this.visible = false
    },
    clearTableSource() {
      this.tableDataSource = []
      this.usageDataSource = []
    },
    fetchAndShowBmp() {
      console.log('flowData----->', this.flowData)
      try {
        let parm = {
          processDefinitionId: this.flowData.processDefinitionId,
          processInstanceId:this.flowData.processInstanceId,
          TaskDefinitionKey:this.flowData.processDefinitionKey
        }
        downFile(this.url.diagramView,parm,'get').then((res=>{
          console.log('Pica------>',res)
          const urlObject = window.URL.createObjectURL(new Blob([res]))
          this.imageSrc = urlObject
        }))
      } catch (error) {
        console.error('Error fetching image blob:', error)
        alert('无法加载图片,请稍后再试。')
      }
    },
    handleQueXiaoTask(){
      this.visible = false
      this.routeReload()
    },
    autocompleteForm(selectObj) {
      this.standardName = selectObj.standardName
      this.maintenancePeriod=selectObj.maintenancePeriod
      this.standardCode=selectObj.standardCode
    },
    submitForm () {
      const that = this;
      // 触发表单验证
      this.form.validateFields((err, values) => {
        if (!err) {
          that.confirmLoading = true;
          let url=this.url.approve
          let method = 'post';
          let flowTaskVo = {}
          let tableData = that.$refs.editableDetailTable.getTableData()
          flowTaskVo.comment =that.assignFileStream.approveContent;
          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.tableDetailList=tableData
          console.log("表单提交数据",flowTaskVo)
          httpAction(url,flowTaskVo,method).then((res)=>{
            if(res.success){
              that.$message.success(res.message);
              that.visible = false
              //刷新表格
              that.$emit('searchReset')
            }else{
              that.$message.warning(res.message);
        imageSrc: null,
        labelCol: {
          xs: { span: 24 },
          sm: { span: 6 }
        },
        wrapperCol: {
          xs: { span: 30 },
          sm: { span: 16 }
        },
        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'
        },
        detail: {
          loading: false,
          dataSource: [],
          columns: [
            {
              title: '序号',
              key: 'itemCode',
              type: JVXETypes.normal,
              width: '5%',
              align: 'center',
              fixed: 'left'
            },
            {
              title: '保养项',
              key: 'itemName',
              type: JVXETypes.normal,
              width: '15%',
              align: 'center',
              fixed: 'left'
            },
            {
              title: '保养要求',
              key: 'itemDemand',
              type: JVXETypes.normal,
              width: '15%',
              align: 'center',
              fixed: 'left'
            },
            {
              title: '点检结果',
              key: 'inspectionResult',
              type: JVXETypes.slot,
              slotName: 'inspectionResult',
              width: '15%',
              align: 'center',
              validateRules: [
                { required: true, message: '${title}不能为空!' }
              ]
            },
            {
              title: '异常描述',
              key: 'exceptionDescription',
              type: JVXETypes.slot,
              slotName: 'exceptionDescription',
              width: '20%',
              align: 'center',
              validateRules: [
                { handler: this.customValidator }
              ]
            },
            {
              title: '异常是否报修',
              key: 'reportFlag',
              type: JVXETypes.slot,
              slotName: 'reportFlag',
              width: '20%',
              align: 'center',
              validateRules: [
                { handler: this.customValidator }
              ]
            }
          }).finally(() => {
            that.confirmLoading = false;
          })
        }
      })
          ]
        },
        selectedRowKeys: [],
        disableSubmit: false,
        activeTabKey: '1',
        title: ''
      }
    },
    getAllApproveData(item) {
      console.log('selectShenpiData----->', this.selectShenpiData)
      this.flowData = item
      let param = {
        'id': item.dataId
    computed: {
      hasInspectionDateArrived() {
        return moment(this.tableRowRecord.inspectionDate).diff(moment(), 'hours') <= 0
      },
      isDisplayConfirm() {
        return ['WAIT_CONFIRM', 'COMPLETE'].includes(this.tableRowRecord.inspectionStatus)
      },
      isDisableOperation() {
        return this.disableSubmit || this.tableRowRecord.inspectionStatus !== 'UNDER_INSPECTION'
      }
      let parmhis={
        'procInstId': item.procInstId
      }
      getAction(this.url.queryHisTaskList,parmhis).then(res=>{
        this.hitaskDataSource=res.result
        getAction(this.url.queryBomDataById, param).then((res => {
          if (res.success) {
            this.tableRowRecord = res.result[0]
            this.detail.dataSource=res.result[0].tableDetailList
            console.log('this.tableRowRecord----->', this.tableRowRecord[0])
    },
    methods: {
      /**
       * 获取流程节点和流程图
       * @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({
                message: '消息',
                description: res.message
              })
            })
        }
      },
      /**
       * 获取待办记录的基本信息
       * @param record 待办记录信息
       */
      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)
      },
      async submitForm() {
        let errMap = await this.$refs.editableDetailTable.validateTable()
        if (errMap) {
          console.log('err', errMap)
          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()
            const that = this
            console.log('表单提交数据', flowTaskVo)
            httpAction(this.url.approve, flowTaskVo, 'post')
              .then((res) => {
                if (res.success) {
                  that.$message.success(res.message)
                  //刷新表格
                  that.$emit('searchReset')
                  that.handleCancel()
                } else {
                  that.$message.warning(res.message)
                }
              })
              .finally(() => {
                that.confirmLoading = this.spinning = false
              })
          } else {
            return false
          }
        }))
      }).finally(
        this.visible = true,
        console.log('this.approveData---->', this.approveData)
      )
        })
      },
      autoCompleteForm({ standardName, maintenancePeriod, standardCode }) {
        this.$set(this.tableRowRecord, 'standardName', standardName)
        this.$set(this.tableRowRecord, 'maintenancePeriod', maintenancePeriod)
        this.$set(this.tableRowRecord, 'standardCode', standardCode)
      },
      // 批量选择所有点检结果
      handleSelectAllInspectionResult() {
        this.selectedRowKeys.forEach(key => {
          const dataItem = this.detail.dataSource.find(item => item.id === key)
          if (dataItem && dataItem.inspectionResult !== '1') {
            delete dataItem.exceptionDescription
            delete dataItem.reportFlag
            dataItem.inspectionResult = '1'
          }
        })
        this.$refs.editableDetailTable.clearCheckboxRow()
        this.selectedRowKeys = []
      },
      /**
       * 表格多选框发生改变时触发
       * @param {selectedRowIds} 表格中已选择的ID列表
       */
      handleTableSelectRowChange({ selectedRowIds }) {
        this.selectedRowKeys = selectedRowIds
      },
      /**
       * 点检结果选择器发生改变时触发
       * @param value 改变后的值
       * @param record 保养明细行记录
       */
      handleInspectionResultSelectChange(value, record) {
        if (record.exceptionDescription) delete record.exceptionDescription
        if (record.reportFlag) delete record.reportFlag
      },
      customValidator({ cellValue, row }, callback) {
        if (row.inspectionResult === '2') {
          if (!cellValue) {
            callback(false, '${title}不能为空!') // false = 未通过,可以跟自定义提示
          } else {
            callback(true) // true = 通过验证
          }
        } else {
          callback(true)
        }
      },
      handleCancel() {
        this.selectedRowKeys = []
        this.visible = false
      },
      //标准选择变化
      loadDetail(orderId) {
        if (orderId) {
          getAction(this.url.detailList, { orderId: orderId })
            .then(res => {
              if (res.success) {
                this.detail.dataSource = [...res.result]
              }
            })
            .finally(() => {
              this.spinning = false
            })
        }
      },
    }
  }
}
</script>
<style scoped>
.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; /* 圆角边框 */
}
  /deep/ .ant-select-dropdown-menu {
    text-align: left;
  }
.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;
}
@import '~@assets/less/common.less';
  @import '~@assets/less/common.less';
</style>