qushaowei
2023-12-12 6b24c28ba8a418c1efb46ed0576c9d6c3f5ab82c
Merge branch 'develop' of http://117.34.109.166:18448/r/vue_mdc_430 into develop
已修改4个文件
519 ■■■■■ 文件已修改
src/views/eam/modules/malfunctionRepair/AcceptModel.vue 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/repairorder/moudles/RepairOrderActualHoursReport.vue 137 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/repairorder/moudles/RepairOrderFaultAnalysisReport.vue 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/repairorder/repairOrderExcuteDrawer.vue 296 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/modules/malfunctionRepair/AcceptModel.vue
@@ -16,6 +16,17 @@
        :rules="validatorRules"
      >
        <a-row :gutter="24">
          <a-col :span='24'>
            <a-form-model-item
              label='验收人'
              prop='errUda3'
              :labelCol="labelCol"
              :wrapperCol="wrapperCol">
              <a-input v-model='model.errUda3'
              >
            </a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item
              label="验收意见"
@@ -23,7 +34,7 @@
              :wrapperCol="wrapperCol"
              prop="errUda5"
            >
               <a-textarea v-model="model.remark" rows="4" placeholder="验收意见" />
               <a-textarea v-model="model.errUda5" rows="4" placeholder="验收意见" />
            </a-form-model-item>
          </a-col>
        </a-row>
@@ -76,8 +87,13 @@
      confirmLoading: false,
      validatorRules: {
        remark: [
          { min: 0, max: 100, message: '长度不超过 100 个字符', trigger: 'blur' },
        errUda5: [
          {required:true,message:"请输入验收意见"},
          { min: 0, max: 100, message: '长度不超过 100 个字符' },
        ],
        errUda3 :[
          {required:true,message:"请输入名称"},
          { min: 0, max: 10, message: '名称不超过 10 个字符'},
        ],
      },
      url: {
@@ -92,7 +108,6 @@
  },
  methods: {
    add() {
      this
      this.edit(this.modelDefault);
    },
    edit(record) {
src/views/eam/modules/repairorder/moudles/RepairOrderActualHoursReport.vue
@@ -18,12 +18,9 @@
        slot-scope='text, record, index'
      >
        <div :key='col.dataIndex'>
          <a-input-search
            v-if="col.dataIndex == 'username'"
            enter-button
            @search='onSearchUser(index)'
          <a-input
            v-if="col.dataIndex == 'userId'"
            :value='text'
            :read-only='true'
            @change='(e) => handleChange(e, record.key, col, index)'
            :disabled="repairOrderStatus=='4'"
          />
@@ -40,12 +37,13 @@
          <!--                    v-if="col.dataIndex == 'principalContractor'" />-->
          <a-select default-value='0' :value='text' :disabled="repairOrderStatus=='4'"
                    v-if="col.dataIndex == 'principalContractor'"
                    style="width: 100%;"
                    @change='(e)=>handleChange(e, record.key, col, index)'>
            <a-select-opt-group>
              <a-select-option value='1'>
              <a-select-option value='1' style="width: 100%;">
                是
              </a-select-option>
              <a-select-option value='0'>
              <a-select-option value='0' style="width: 100%;">
                否
              </a-select-option>
            </a-select-opt-group>
@@ -111,13 +109,13 @@
        >
          取消
        </a-button>
        <a-button
        <!-- <a-button
          @click='handleOk(1)'
          type='primary'
          :style="{marginRight: '8px'}"
          :disabled="this.repairOrderStatus=='4' || this.repairOrderStatus=='2'"
        >暂存
        </a-button>
        </a-button> -->
        <a-button
          @click='handleOk(0)'
          type='primary'
@@ -161,7 +159,6 @@
    repairOrderId: {
      type: String,
      required: false,
      default: '-1'
    },
    repairOrderStatus: {
      type: String,
@@ -198,7 +195,7 @@
      validatorRules: {
        userId: {
          rules: [
            { required: true, message: '请选择人员!' }
            { required: true, message: '请填写人员!' }
          ]
        },
        actual_hour: {
@@ -233,25 +230,20 @@
          }
        },
        {
          title: '*人员编码',
          dataIndex: 'username',
          title: '*人员名称',
          dataIndex: 'userId',
          align: 'center',
          scopedSlots: { customRender: 'username' },
          scopedSlots: { customRender: 'userId' },
          className: 'red',
          width: 250
          width: 200
        },
        {
          title: '人员名称',
          dataIndex: 'realname',
          align: 'center',
          width: 150
        },
        {
          title: '主承修人',
          title: '*主承修人',
          dataIndex: 'principalContractor',
          align: 'center',
          scopedSlots: { customRender: 'principalContractor' },
          width: 100
          className: 'red',
          width: 150
        },
        {
          title: '*实际工时',
@@ -259,19 +251,22 @@
          align: 'center',
          className: 'red',
          scopedSlots: { customRender: 'actualHour' },
          width: 120
          width: 150
        },
        {
          title: '开始时间',
          dataIndex: 'startTime',
          scopedSlots: { customRender: 'startTime' },
          align: 'center'
          align: 'center',
          width: 200
        },
        {
          title: '结束时间',
          dataIndex: 'endTime',
          align: 'center',
          scopedSlots: { customRender: 'endTime' }
          scopedSlots: { customRender: 'endTime' },
          width: 200
        },
        {
@@ -279,12 +274,14 @@
          dataIndex: 'theoreticalTime',
          align: 'center'
          // scopedSlots: { customRender: 'theoreticalTime' },
          ,
          width: 150
        },
        {
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          width: 250,
          width: 150,
          scopedSlots: { customRender: 'action' }
        }
      ],
@@ -300,9 +297,11 @@
    repairOrderId: {
      immediate: true,
      handler(val) {
        this.clearList()
        this.queryParam['repairOrderId'] = val
        this.loadData(1)
        if(this.repairOrderId){
          this.clearList()
          this.queryParam['repairOrderId'] = val
          this.loadData(1)
        }
      }
    }
  },
@@ -332,7 +331,8 @@
      this.disableSubmit = false
      this.visible = false
    },
    handleDelete(text, record, index) {
    handleDelete(index) {
      console.log(index)
      this.dataSource.splice(index, 1)
    },
@@ -390,12 +390,18 @@
      const temp = [...that.dataSource]
      const target = temp[index]
      if (target) {
        target[column.dataIndex] = value
        if ('userId' == column.dataIndex) {
          target['userId'] = value
          target['userId'] = value.target.value
        }
        if ('principalContractor' == column.dataIndex) {
          target['principalContractor'] = value
          if(value==='1'){
            for(var i = 0;i<temp.length;i++){
                if(i!==index){
                  temp[i]['principalContractor']='0';
                }
            }
          }
        }
        if ('actualHour' == column.dataIndex) {
@@ -417,56 +423,55 @@
          if (target['endTime'] == null) {
            target['startTime'] = value
          } else if (target['startTime'] != null && target['endTime'] != null) {
            const diffInHours = this.getTimeDiff(target['startTime'], target['endTime'])
            if (diffInHours < 0) {
              target['startTime'] = ''
              target['theoreticalTime'] = ''
              that.$message.error('请检查第' + (index + 1) + '行开始时间不能小于结束时间,请重新选择')
            } else {
              target['startTime'] = value
              target['theoreticalTime'] = diffInHours
            }
          } else if (target['startTime'] == null && target['endTime'] != null) {
          } else  {
            const diffInHours = this.getTimeDiff(value, target['endTime'])
            if (diffInHours < 0) {
              target['startTime'] = ''
              target['theoreticalTime'] = ''
              that.$message.error('请检查第' + (index + 1) + '行开始时间不能小于结束时间,请重新选择')
              that.$message.error('开始时间不能小于结束时间,请重新选择')
            } else {
              target['startTime'] = value
              target['theoreticalTime'] = diffInHours
              if(target['actualHour']!==null){
                  if(diffInHours<target['actualHour']){
                    target['startTime'] = ''
                    target['theoreticalTime'] = ''
                    that.$message.error('实际工时不能小于理论工时,请重新填写')
                  }else{
                    target['startTime'] = value
                    target['theoreticalTime'] = diffInHours
                  }
              }else{
                target['startTime'] = value
                target['theoreticalTime'] = diffInHours
              }
            }
          }
          }
        }
        if ('endTime' == column.dataIndex) {
          if (target['startTime'] == null) {
            target['endTime'] = value
          } else if (target['startTime'] != null && target['endTime'] != null) {
            const diffInHours = this.getTimeDiff(target['startTime'], target['endTime'])
            if (diffInHours < 0) {
              target['endTime'] = ''
              target['theoreticalTime'] = ''
              that.$message.error('请检查第' + (index + 1) + '行开始时间不能小于结束时间,请重新选择')
            } else {
              target['endTime'] = value
              target['theoreticalTime'] = diffInHours
            }
          } else if (target['startTime'] != null && target['endTime'] == null) {
          } else {
            const diffInHours = this.getTimeDiff(target['startTime'], value)
            if (diffInHours < 0) {
              target['endTime'] = ''
              target['theoreticalTime'] = ''
              that.$message.error('请检查第' + (index + 1) + '行开始时间不能小于结束时间,请重新选择')
              that.$message.error('开始时间不能小于结束时间,请重新选择')
            } else {
              target['endTime'] = value
              target['theoreticalTime'] = diffInHours
              if(target['actualHour']!==null){
                  if(diffInHours<target['actualHour']){
                    target['endTime'] = ''
                    target['theoreticalTime'] = ''
                    that.$message.error('实际工时不能小于理论工时,请重新填写')
                  }else{
                    target['endTime'] = value
                    target['theoreticalTime'] = diffInHours
                  }
              }else{
                target['endTime'] = value
                target['theoreticalTime'] = diffInHours
              }
            }
          }
        }
        that.dataSource = temp
src/views/eam/modules/repairorder/moudles/RepairOrderFaultAnalysisReport.vue
@@ -19,7 +19,7 @@
                allow-clear
                placeholder='请输入故障现象'
                v-decorator="['repairOrderFaultAnalysisUda1', validatorRules.repairOrderFaultAnalysisUda1]"
                :disabled="isEdit"
                :disabled="disabledEdit"
              ></a-textarea>
            </a-form-item>
          </a-col>
@@ -32,7 +32,7 @@
              <a-textarea
                placeholder='请输入故障检查'
                v-decorator="['faultCause', validatorRules.faultCause]"
                :disabled="isEdit"
                :disabled="disabledEdit"
              ></a-textarea>
            </a-form-item>
          </a-col>
@@ -47,7 +47,7 @@
              <a-textarea
                placeholder='请输入故障维修'
                v-decorator="['maintenanceMeasures', validatorRules.maintenanceMeasures]"
                :disabled="isEdit"
                :disabled="disabledEdit"
              ></a-textarea>
            </a-form-item>
          </a-col>
@@ -60,7 +60,7 @@
              <a-textarea
                v-decorator="['suggestion', validatorRules.suggestion]"
                placeholder='请输入故障预防'
                :disabled="isEdit"
                :disabled="disabledEdit"
              ></a-textarea>
            </a-form-item>
          </a-col>
@@ -68,7 +68,7 @@
      <a-button
        :style="{marginRight: '8px'}"
        @click='handleEdit2()'
        :disabled="buttonStatus"
        :disabled="disabledButton||!disabledEdit"
        :loading='confirmLoading'
      >
       编辑
@@ -78,7 +78,7 @@
        @click='handleOk()'
        type='primary'
        :loading='confirmLoading'
        :disabled="buttonStatus"
        :disabled="disabledButton||disabledEdit"
      >保存
      </a-button>
      </a-form>
@@ -103,15 +103,26 @@
      'repairOrder.id':{
        immediate: true,
        handler(val) {
          this.form.resetFields();
          if(this.repairOrder.id!==undefined&&this.repairOrder.status==='3'){
            this.isEdit = false;
          this.loadData(val);
          if(this.repairOrder.id!==undefined&&this.repairOrder.id!==null&&this.repairOrder.id!==''){
            if(this.repairOrder.status!=='3'){
              this.disabledButton = true;
            }else{
              this.disabledButton = false;
            }
          }else{
            this.loadData(val);
            this.disabledButton = true;
          }
          if(this.repairOrder.status!=='3'){
            this.buttonStatus = true;
          }
        }
      },
      'repairOrder.status':{
        immediate: true,
        handler(val) {
            if(val!=='3'){
              this.disabledButton = true;
            }else{
              this.disabledButton = false;
            }
        }
      }
  },
@@ -127,7 +138,7 @@
        getInfo:'/eam/repairOrderFaultAnalysis/list',
      },
      dictOptions: {},
      isEdit:false,
      disabledEdit:false,
      validatorRules: {
        faultCause: {
          rules: [
@@ -161,7 +172,7 @@
        xs: { span: 24 },
        sm: { span: 16 }
      },
      buttonStatus:false
      disabledButton:false
    }
  },
  methods: {
@@ -182,7 +193,6 @@
          obj.then((res) => {
            if (res.success) {
              that.$message.success(res.message);
              that.isEdit = true;
            } else {
              that.$message.warning(res.message);
            }
@@ -194,23 +204,24 @@
      })
    },
    loadData(repairOrderId){
      let that = this;
      let that = this;
      getAction(that.url.getInfo,{repairOrderId:repairOrderId}).then(res=>{
                if(res.success){
                   if(res.result.records.length!==0){
                      that.isEdit=true;
                if(res.success&&res.result.records.length!==0){
                      that.disabledEdit=true;
                      that.form.setFieldsValue(pick(res.result.records[0], 'faultCause','repairOrderFaultAnalysisUda1', 'faultTypeId', 'suggestion', 'maintenanceMeasures','id'))
                      that.model = Object.assign({}, res.result.records[0]);
                   }else if(this.repairOrder.status==='3'){
                      that.isEdit=false;
                   }else{
                      that.isEdit=true;
                   }
                }else{
                  if(that.repairOrder.status==='3'){
                    that.disabledEdit=false;
                  }else{
                    that.disabledEdit=true;
                  }
                  that.form.resetFields();
                }
      })
    },
    handleEdit2(){
    this.isEdit=false;
    this.disabledEdit=false;
    }
  },
src/views/eam/modules/repairorder/repairOrderExcuteDrawer.vue
@@ -57,7 +57,7 @@
                :loading="confirmLoading"
                :disabled="repairOrder.status!='3'||repairOrder.repairOrderUda1==='needPart'||repairOrder.repairOrderUda1==='needSpare'"
                type="primary"
              >报工</a-button>
              >修完</a-button>
              <!-- <a-button
                :style="{marginRight: '8px'}"
                @click="handleRevoke"
@@ -68,6 +68,10 @@
            </a-row>
          </div>
          <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}">
            <a-divider
            orientation="center"
            style="font-size: large;font-style: italic;color: #66aeed;"
          > 基础信息 </a-divider>
            <a-row :gutter="24">
              <a-col :span="6">
                <a-form-item
@@ -205,6 +209,10 @@
                </a-form-item>
              </a-col>
            </a-row>
            <a-divider
            orientation="center"
            style="font-size: large;font-style: italic;color: #66aeed;"
          > 报修领取信息 </a-divider>
            <a-row :gutter="24">
              <a-col :span="6">
                <a-form-item
@@ -263,6 +271,10 @@
                </a-form-item>
              </a-col>
            </a-row>
            <a-divider
            orientation="center"
            style="font-size: large;font-style: italic;color: #66aeed;"
          > 维修信息 </a-divider>
            <a-row
              :gutter="24"
            >
@@ -301,7 +313,8 @@
                  label="维修时长"
                  class="hightColor"
                >
                  <span v-if="this.repairOrder != null">{{ this.repairOrder.actualHour }}</span>
                  <span v-if="this.repairOrder != null">{{this.formattedElapsedTime}}</span>
                  <span
                    v-else
                    class="frozenRowClass"
@@ -315,7 +328,7 @@
                  label="完成人"
                  class="hightColor"
                >
                  <span v-if="this.repairOrder != null">{{ this.repairOrder.recipientUserId_dictText }}</span>
                  <span v-if="this.repairOrder != null">{{ this.repairOrder.recipientUserId}}</span>
                  <span
                    v-else
                    class="frozenRowClass"
@@ -323,6 +336,110 @@
                </a-form-item>
              </a-col>
            </a-row>
            <a-divider
            orientation="center"
            style="font-size: large;font-style: italic;color: #66aeed;"
          > 等采购件 </a-divider>
            <a-row
            :gutter="24"
            >
            <a-col :span="6">
                <a-form-item
                  :labelCol="labelCol"
                  :wrapperCol="wrapperCol"
                  label="等采购件开始"
                  class="hightColor"
                >
                  <span v-if="this.repairOrder != null">{{ this.repairOrder.repairOrderUda2}}</span>
                  <span
                    v-else
                    class="frozenRowClass"
                  >-</span>
                </a-form-item>
              </a-col>
              <a-col :span="6">
                <a-form-item
                  :labelCol="labelCol"
                  :wrapperCol="wrapperCol"
                  label="等采购件结束"
                  class="hightColor"
                >
                  <span v-if="this.repairOrder != null">{{ this.repairOrder.repairOrderUda3 }}</span>
                  <span
                    v-else
                    class="frozenRowClass"
                  >-</span>
                </a-form-item>
              </a-col>
              <a-col :span="6">
                <a-form-item
                  :labelCol="labelCol"
                  :wrapperCol="wrapperCol"
                  label="累计时长"
                  class="hightColor"
                >
                  <span v-if="this.repairOrder != null">{{ this.time1 }}</span>
                  <span
                    v-else
                    class="frozenRowClass"
                  >-</span>
                </a-form-item>
              </a-col>
            </a-row>
            <a-divider
            orientation="center"
            style="font-size: large;font-style: italic;color: #66aeed;"
          > 等加工件 </a-divider>
            <a-row
            :gutter="24"
            >
            <a-col :span="6">
                <a-form-item
                  :labelCol="labelCol"
                  :wrapperCol="wrapperCol"
                  label="等加工件开始"
                  class="hightColor"
                >
                  <span v-if="this.repairOrder != null">{{ this.repairOrder.repairOrderUda4 }}</span>
                  <span
                    v-else
                    class="frozenRowClass"
                  >-</span>
                </a-form-item>
              </a-col>
              <a-col :span="6">
                <a-form-item
                  :labelCol="labelCol"
                  :wrapperCol="wrapperCol"
                  label="等加工件结束"
                  class="hightColor"
                >
                  <span v-if="this.repairOrder != null">{{ this.repairOrder.repairOrderUda5 }}</span>
                  <span
                    v-else
                    class="frozenRowClass"
                  >-</span>
                </a-form-item>
              </a-col>
              <a-col :span="6">
                <a-form-item
                  :labelCol="labelCol"
                  :wrapperCol="wrapperCol"
                  label="累计时长"
                  class="hightColor"
                >
                  <span v-if="this.repairOrder != null">{{ this.time2 }}</span>
                  <span
                    v-else
                    class="frozenRowClass"
                  >-</span>
                </a-form-item>
              </a-col>
            </a-row>
            <a-divider
            orientation="center"
            style="font-size: large;font-style: italic;color: #66aeed;"
          > 验收信息 </a-divider>
            <a-row
              :gutter="24"
            >
@@ -361,99 +478,7 @@
                  label="故障时长"
                  class="hightColor"
                >
                  <span v-if="this.repairOrder != null">{{ this.repairOrder.faultHour }}</span>
                  <span
                    v-else
                    class="frozenRowClass"
                  >-</span>
                </a-form-item>
              </a-col>
            </a-row>
            <a-row
            :gutter="24"
            >
            <a-col :span="6">
                <a-form-item
                  :labelCol="labelCol"
                  :wrapperCol="wrapperCol"
                  label="等采购件开始"
                  class="hightColor"
                >
                  <span v-if="this.repairOrder != null">{{ this.repairOrder.repairOrderUda2}}</span>
                  <span
                    v-else
                    class="frozenRowClass"
                  >-</span>
                </a-form-item>
              </a-col>
              <a-col :span="6">
                <a-form-item
                  :labelCol="labelCol"
                  :wrapperCol="wrapperCol"
                  label="等采购件结束"
                  class="hightColor"
                >
                  <span v-if="this.repairOrder != null">{{ this.repairOrder.repairOrderUda3 }}</span>
                  <span
                    v-else
                    class="frozenRowClass"
                  >-</span>
                </a-form-item>
              </a-col>
              <a-col :span="6">
                <a-form-item
                  :labelCol="labelCol"
                  :wrapperCol="wrapperCol"
                  label="累计时间"
                  class="hightColor"
                >
                  <span v-if="this.repairOrder != null">{{ this.repairOrder.spareTime }}</span>
                  <span
                    v-else
                    class="frozenRowClass"
                  >-</span>
                </a-form-item>
              </a-col>
            </a-row>
            <a-row
            :gutter="24"
            >
            <a-col :span="6">
                <a-form-item
                  :labelCol="labelCol"
                  :wrapperCol="wrapperCol"
                  label="等加工件开始"
                  class="hightColor"
                >
                  <span v-if="this.repairOrder != null">{{ this.repairOrder.repairOrderUda4 }}</span>
                  <span
                    v-else
                    class="frozenRowClass"
                  >-</span>
                </a-form-item>
              </a-col>
              <a-col :span="6">
                <a-form-item
                  :labelCol="labelCol"
                  :wrapperCol="wrapperCol"
                  label="等加工件结束"
                  class="hightColor"
                >
                  <span v-if="this.repairOrder != null">{{ this.repairOrder.repairOrderUda5 }}</span>
                  <span
                    v-else
                    class="frozenRowClass"
                  >-</span>
                </a-form-item>
              </a-col>
              <a-col :span="6">
                <a-form-item
                  :labelCol="labelCol"
                  :wrapperCol="wrapperCol"
                  label="累计时间"
                  class="hightColor"
                >
                  <span v-if="this.repairOrder != null">{{ this.repairOrder.partTime }}</span>
                  <span v-if="this.repairOrder != null">{{ this.time3 }}</span>
                  <span
                    v-else
                    class="frozenRowClass"
@@ -511,6 +536,7 @@
<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { putAction } from '@/api/manage'
import dayjs from 'dayjs'
import Tooltip from 'ant-design-vue/es/tooltip'
import RepairOrderActualMaterialList from './moudles/RepairOrderActualMaterialReport'
import RepairOrderActualWorkHoursList from './moudles/RepairOrderActualHoursReport'
@@ -523,7 +549,8 @@
    Tooltip,
    RepairOrderActualMaterialList,
    RepairOrderActualWorkHoursList,
    RepairOrderFaultAnalysisList
    RepairOrderFaultAnalysisList,
    dayjs
  },
  props: {
    repairOrder: {
@@ -552,11 +579,11 @@
      dataSource: [],
      labelCol: {
        xs: { span: 24 },
        sm: { span: 6 },
        sm: { span: 12 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 18 },
        sm: { span: 12 },
      },
      url: {
        orderStart: "eam/repairOrder/start",
@@ -569,13 +596,26 @@
        handlePartStop:"/eam/repairOrder/handlePartStop",
        getInfo:'/eam/repairOrderFaultAnalysis/list',
      },
      elapsedTime: 0, // 记录已过去的时间(单位:毫秒)
      formattedElapsedTime: '0秒',
      time1:'0秒',
      time2:'0秒',
      time3:'0秒',
      timer:null // 格式化后的已过去时间
    }
  },
  mounted() {
    this.$bus.$on('closeDrawer', (data) => {
      this.handleCancel()
    })
    // this.$bus.$on('closeDrawer', (data) => {
    //   this.handleCancel()
    // })
    this.timer = setInterval(() => {
      this.updateElapsedTime();
    }, 1000);
  },
  beforeDestroy() {
    // 在组件销毁前清除计时器
    clearInterval(this.timer);
  },
  methods: {
@@ -627,6 +667,7 @@
    },
    //报工
    handleReportPro(){
      let that = this;
      getAction(that.url.getInfo,{repairOrderId:this.repairOrder.id}).then(res=>{
                if(res.success){
@@ -658,11 +699,10 @@
          putAction(that.url.orderReport, that.repairOrder).then(res => {
            if (res.result) {
              that.$message.success('报工成功');
              that.repairOrder.status = '4'
              that.reload();
              that.$emit('loadData');
            } else {
              that.$message.error('报工出现异常')
              that.$message.error(res.message)
            }
          }).finally(() => {
            that.confirmLoading = false;
@@ -684,7 +724,6 @@
          putAction(that.url.orderRevoke, that.repairOrder).then(res => {
            if (res.result) {
              that.$message.success('撤销成功');
              that.repairOrder.status = '3'
              that.$emit('loadData');
            } else {
              that.$message.error('撤销出现异常')
@@ -798,7 +837,52 @@
          this.repairOrder = res.result.records[0];
        }
      })
    }
    },
    updateElapsedTime() {
      const stardand = new Date();
      if(this.repairOrder.actualEndTime!==null&&this.repairOrder.actualEndTime!==undefined&&this.repairOrder.actualEndTime!==''){
        this.formattedElapsedTime = this.repairOrder.actualHour+'时';
      }else if(this.repairOrder.actualStartTime!==null&&this.repairOrder.actualStartTime!==undefined&&this.repairOrder.actualStartTime!==''){
        const startDateTime = dayjs(this.repairOrder.actualStartTime, { format: 'YYYY-MM-DD HH:mm:ss' });
        this.elapsedTime = stardand-startDateTime;
        this.formattedElapsedTime = this.formatTime(this.elapsedTime);
      }else{
        this.formattedElapsedTime="开工后计算时长";
      }
      if(this.repairOrder.repairOrderUda3!==null&&this.repairOrder.repairOrderUda3!==undefined&&this.repairOrder.repairOrderUda3!==''){
        this.time1 = this.repairOrder.spareTime+'时';
      }else if(this.repairOrder.repairOrderUda2!==null&&this.repairOrder.repairOrderUda2!==undefined&&this.repairOrder.repairOrderUda2!==''){
        const startDateTime1 = dayjs(this.repairOrder.repairOrderUda2, { format: 'YYYY-MM-DD HH:mm:ss' });
        this.time1 = this.formatTime(stardand-startDateTime1);
      }else{
        this.time1 = "等采购件后计算时长"
      }
      if(this.repairOrder.repairOrderUda5!==null&&this.repairOrder.repairOrderUda5!==undefined&&this.repairOrder.repairOrderUda5!==''){
        this.time2 = this.repairOrder.partTime+'时';
      }else if(this.repairOrder.repairOrderUda4!==null&&this.repairOrder.repairOrderUda4!==undefined&&this.repairOrder.repairOrderUda4!==''){
        const startDateTime2 = dayjs(this.repairOrder.repairOrderUda4, { format: 'YYYY-MM-DD HH:mm:ss' });
        this.time2 = this.formatTime(stardand-startDateTime2);
      }else{
        this.time2 = "等加工件后计算时长"
      }
      if(this.repairOrder.acceptTime!==null&&this.repairOrder.acceptTime!==undefined&&this.repairOrder.acceptTime!==''){
        this.time3 = this.repairOrder.faultHour+'时';
      }else if(this.repairOrder.faultTime!==null&&this.repairOrder.faultTime!==undefined&&this.repairOrder.faultTime!==''){
        const startDateTime3 = dayjs(this.repairOrder.faultTime, { format: 'YYYY-MM-DD HH:mm:ss' });
        this.time3 = this.formatTime(stardand-startDateTime3);
      }else{
        this.time3 = "验收后计算时长"
      }
    },
    formatTime(timeInMilliseconds) {
      // 将毫秒转换为更友好的格式(例如:x小时x分钟x秒)
      // 这里只是一个简单的实现,你可能需要根据需求进行更改
      const seconds = Math.floor(timeInMilliseconds / 1000);
      const minutes = Math.floor(seconds / 60);
      const hours = Math.floor(minutes / 60);
      return `${hours}时 ${minutes % 60}分 ${seconds % 60}秒`;
    },
  },
}