zhaowei
2 天以前 80a8050560fdd4cc18aee57c3ed176a9019dec2a
1、维修工单与故障报修开发
已添加1个文件
已修改10个文件
已删除6个文件
2709 ■■■■■ 文件已修改
src/views/eam/base/EamMaintenanceStandardList.vue 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/base/modules/EamMaintenanceStandardModal.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/equipment/modules/LxSearchEquipmentSelect.vue 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/maintenance/EamInspectionOrderList.vue 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/maintenance/modules/EamSecondMaintenanceBatchOrderModal.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/repair/EamRepairOrderList.vue 230 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/repair/EamReportRepairList.vue 333 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/repair/modules/EamRepairOrderList/EamRepairOrderModal.vue 202 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/repair/modules/EamRepairOrderList/ReceiveFaultModal.vue 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/repair/modules/EamRepairPersonModal.Style#Drawer.vue 146 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/repair/modules/EamReportAccidentsRegisterModal.Style#Drawer.vue 260 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/repair/modules/EamReportProductHazardsModal.Style#Drawer.vue 164 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/repair/modules/EamReportRepairList/AssignRepairReportModal.vue 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/repair/modules/EamReportRepairList/EamReportRepairModal.vue 364 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/repair/modules/EamReportThreeNoSpareModal.Style#Drawer.vue 155 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/flowable/workflow/FlowTodo.vue 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/flowable/workflow/repairOrder/RepairOrderApprovalModal.vue 609 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/base/EamMaintenanceStandardList.vue
@@ -50,15 +50,16 @@
                  @change="handleImportExcel">
          <a-button v-has="'standard:pointInspection'" type="primary" icon="import">点检标准导入</a-button>
        </a-upload>
        <a-button v-has="'standard:pointInspectionDownload'" type="primary" icon="download" @click="handleTemplateXlsDownload(url.inspectionXlsDownloadUrl)">
        <a-button v-has="'standard:pointInspectionDownload'" type="primary" icon="download"
                  @click="handleTemplateXlsDownload(url.inspectionXlsDownloadUrl)">
          ç‚¹æ£€æ ‡å‡†æ¨¡æ¿ä¸‹è½½
        </a-button>
        <a-upload name="file" :showUploadList="false" :multiple="true" :headers="tokenHeader"
                  :action="secondMaintenanceImportExcel"
                  @change="handleImportExcel">
          <a-button v-has="'standard:secondMaintenance'"  type="primary" icon="import">二保标准导入</a-button>
          <a-button v-has="'standard:secondMaintenance'" type="primary" icon="import">二保标准导入</a-button>
        </a-upload>
        <a-button v-has="'standard:secondMaintenanceDownload'"  type="primary" icon="download"
        <a-button v-has="'standard:secondMaintenanceDownload'" type="primary" icon="download"
                  @click="handleTemplateXlsDownload(url.secondMaintenanceXlsDownloadUrl)">二保标准模板下载
        </a-button>
        <a-upload name="file" :showUploadList="false" :multiple="true" :headers="tokenHeader"
@@ -66,7 +67,8 @@
                  @change="handleImportExcel">
          <a-button v-has="'standard:ThirdMaintenance'" type="primary" icon="import">三保标准导入</a-button>
        </a-upload>
        <a-button v-has="'standard:ThirdMaintenanceDownload'" type="primary" icon="download" @click="handleTemplateXlsDownload(url.thirdMaintenanceXlsDownloadUrl)">
        <a-button v-has="'standard:ThirdMaintenanceDownload'" type="primary" icon="download"
                  @click="handleTemplateXlsDownload(url.thirdMaintenanceXlsDownloadUrl)">
          ä¸‰ä¿æ ‡å‡†æ¨¡æ¿ä¸‹è½½
        </a-button>
        <a-dropdown v-if="selectedRowKeys.length > 0">
@@ -91,11 +93,12 @@
      </div>
      <a-table ref="table" size="middle" bordered rowKey="id" :columns="columns" :dataSource="dataSource"
               :pagination="ipagination" :loading="loading" class="j-table-force-nowrap"
               :pagination="ipagination" :loading="loading" :scroll="{x:'max-content'}"
               :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" :customRow='clickThenSelect'
               @change="handleTableChange">
        <span slot="action" slot-scope="text, record">
          <a v-has="'standard:upgrade'" v-if="record.standardStatus === 'START'" @click.stop="handleUpgrade(record)">升版</a>
          <a v-has="'standard:upgrade'" v-if="record.standardStatus === 'START'"
             @click.stop="handleUpgrade(record)">升版</a>
          <template v-if="record.standardStatus === 'WAIT_SUBMIT'">
              <a v-has="'standard:edit'" @click.stop="handleEdit(record)">编辑</a>
@@ -110,7 +113,7 @@
              <a-divider v-has="'standard:saveFlow'" type="vertical"/>
              <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                  <a  v-has="'standard:del'" @click.stop="event=>event.stopPropagation()">删除</a>
                  <a v-has="'standard:del'" @click.stop="event=>event.stopPropagation()">删除</a>
              </a-popconfirm>
          </template>
@@ -286,7 +289,9 @@
        title: '操作',
        dataIndex: 'action',
        align: 'center',
        scopedSlots: { customRender: 'action' }
        scopedSlots: { customRender: 'action' },
        width: 200,
        fixed: 'right'
      }
      this.columns = [...this.columns, operationColumn]
      this.loadData(1)
src/views/eam/base/modules/EamMaintenanceStandardModal.vue
@@ -1,5 +1,5 @@
<template>
  <j-modal :title="title" :width="1200" :visible="visible" :confirmLoading="confirmLoading" switchFullscreen centered
  <j-modal :title="title" :width="1200" :visible="visible" :confirmLoading="confirmLoading" switchFullscreen
           @ok="handleOk" @cancel="handleCancel" cancelText="关闭">
    <a-spin :spinning="spinning">
      <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol">
src/views/eam/equipment/modules/LxSearchEquipmentSelect.vue
@@ -11,7 +11,7 @@
    style="width: 100%"
    :filterOption="false"
    @change="handleAsyncChange"
    allowClear
    :allowClear="allowClear"
    :notFoundContent="loading ? undefined : null"
    mode="default"
  >
@@ -43,6 +43,11 @@
      default: 20,
      required: false
    },
    allowClear:{
      type:Boolean,
      default:()=>true,
      required:false
    }
  },
  data() {
    this.loadData = debounce(this.loadData, 800)//消抖
src/views/eam/maintenance/EamInspectionOrderList.vue
@@ -304,20 +304,23 @@
      handleAbolish(id) {
        var that = this
        getAction(that.url.cancelInspectionOrder, { id: id }).then((res) => {
          if (res.success) {
            that.$notification.success({
              message: '消息',
              description: res.message
            })
            that.loadData()
          } else {
            that.$notification.warning({
              message: '消息',
              description: res.message
            })
          }
        })
        this.loading = true
        getAction(that.url.cancelInspectionOrder, { id })
          .then((res) => {
            if (res.success) {
              that.$notification.success({
                message: '消息',
                description: res.message
              })
              that.loadData()
            } else {
              that.$notification.warning({
                message: '消息',
                description: res.message
              })
              this.loading = false
            }
          })
      },
      batchZf(type) {
src/views/eam/maintenance/modules/EamSecondMaintenanceBatchOrderModal.vue
@@ -14,7 +14,7 @@
        <!-- ä¿å…»æ—¥æœŸ-->
        <template v-slot:maintenanceDate="props">
          <a-date-picker v-model="props.row.maintenanceDate" value-format="YYYY-MM-DD"/>
          <a-date-picker v-model="props.row.maintenanceDate" value-format="YYYY-MM-DD" :allow-clear="false"/>
        </template>
        <!-- æ“ä½œ-->
src/views/eam/repair/EamRepairOrderList.vue
@@ -6,35 +6,26 @@
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="工单编号">
              <a-input placeholder="请输入工单编号" v-model="queryParam.repairCode"></a-input>
            <a-form-item label="统一编码">
              <lx-search-equipment-select placeholder="请输入统一编码或名称搜索" v-model="queryParam.equipmentId"/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="设备编号">
              <!--<a-input placeholder="请输入设备编号" v-model="queryParam.equipmentId"/>-->
              <lx-search-equipment-select placeholder="请输入设备编号或名称搜索" v-model="queryParam.equipmentId"/>
            <a-form-item label="工单号">
              <a-input placeholder="请输入工单号" v-model="queryParam.repairCode"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="单据状态">
              <a-select placeholder="请选择单据状态" v-model="queryParam.repairStatus" allow-clear>
                <a-select-option v-for="item in report_repair_status_list" :key="item.value">{{ item.label }}
                </a-select-option>
              </a-select>
            <a-form-item label="维修状态">
              <j-dict-select-tag placeholder="请选择维修状态" v-model="queryParam.repairStatus"
                                 dict-code="repair_status"/>
            </a-form-item>
          </a-col>
          <template v-if="toggleSearchStatus">
          </template>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
              <!--<a @click="handleToggleSearch" style="margin-left: 8px">-->
              <!--{{ toggleSearchStatus ? '收起' : '展开' }}-->
              <!--<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>-->
              <!--</a>-->
            </span>
          </a-col>
@@ -44,8 +35,6 @@
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <div class="table-operator" v-if="isDisplayOperation">
      <a-button @click="handleOpenReceiveFaultModal" type="primary" icon="plus">领取</a-button>
      <!--<a-button type="primary" icon="download" @click="handleExportXls('维修工单')">导出</a-button>-->
      <a-dropdown v-if="selectedRowKeys.length > 0">
        <a-menu slot="overlay">
          <a-menu-item key="1" @click="batchDel">
@@ -67,48 +56,45 @@
        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
      </div>
      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        class="j-table-force-nowrap"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        @change="handleTableChange"
        :scroll="{x:'max-content'}"
      >
      <a-table ref="table" size="middle" bordered rowKey="id" :columns="columns" :dataSource="dataSource"
               :pagination="ipagination" :loading="loading"
               :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" @change="handleTableChange"
               :scroll="{x:'max-content'}">
        <span slot="action" slot-scope="text, record">
          <a @click="handleFillIn(record)">填报</a>
          <a-divider type="vertical"/>
          <a-popconfirm title="确定提交吗?" @confirm="() => handleSubmit(record.id)">
             <a>提交</a>
          </a-popconfirm>
          <a-divider type="vertical"/>
          <a @click="handleDetail(record)">详情</a>
        </span>
      </a-table>
    </div>
    <!-- table区域-end -->
    <receive-fault-modal ref="receiveFaultModalRef" @ok="loadData"/>
    <!--维修工单填报窗口-->
    <eam-repair-order-modal ref="modalForm" @ok="modalFormOk"/>
    <!--维修工单审批窗口-->
    <repair-order-approval-modal ref="repairOrderApprovalModal" :selectShenpiData="selectRepairOrderData"/>
  </a-card>
</template>
<script>
  import '@/assets/less/TableExpand.less'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import ReceiveFaultModal from './modules/EamRepairOrderList/ReceiveFaultModal'
  import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api'
  import LxSearchEquipmentSelect from '../equipment/modules/LxSearchEquipmentSelect'
  import RepairOrderApprovalModal from '../../flowable/workflow/repairOrder/RepairOrderApprovalModal'
  import EamRepairOrderModal from './modules/EamRepairOrderList/EamRepairOrderModal'
  import { getAction } from '@/api/manage'
  export default {
    name: 'EamRepairOrderList',
    mixins: [JeecgListMixin],
    components: {
      EamRepairOrderModal,
      RepairOrderApprovalModal,
      LxSearchEquipmentSelect,
      ReceiveFaultModal
      LxSearchEquipmentSelect
    },
    props: {
      isDisplayOperation: {
@@ -131,41 +117,36 @@
            customRender: function(t, r, index) {
              return parseInt(index) + 1
            },
            fixed: 'left',
          },
          {
            title: '工单编号',
            align: 'center',
            dataIndex: 'repairCode',
            width: 120,
            fixed: 'left'
          },
          {
            title: '设备编号',
            title: '统一编码',
            align: 'center',
            dataIndex: 'equipmentCode',
            width: 120,
            fixed: 'left'
          },
          {
            title: '设备名称',
            align: 'center',
            dataIndex: 'equipmentName',
            width: 200,
            fixed: 'left'
          },
          {
            title: '状态',
            title: '设备型号',
            align: 'center',
            dataIndex: 'repairStatus_dictText',
            fixed: 'left',
            width: 100
            dataIndex: 'equipmentModel',
            fixed: 'left'
          },
          {
            title: '维修负责人',
            title: '维修状态',
            align: 'center',
            dataIndex: 'repairer',
            width: 100
            dataIndex: 'repairStatus_dictText',
            fixed: 'left'
          },
          {
            title: '工单号',
            align: 'center',
            dataIndex: 'repairCode'
          },
          {
            title: '维修开始时间',
@@ -180,106 +161,104 @@
            width: 200
          },
          {
            title: '维修确认',
            align: 'center',
            dataIndex: 'repairConfirm_dictText'
          },
          {
            title: '维修确认时间',
            align: 'center',
            dataIndex: 'repairConfirmTime',
            width: 200
          },
          {
            title: '故障原因',
            align: 'center',
            dataIndex: 'faultReason'
          },
          {
            title: '维修结果描述',
            title: '故障分析',
            align: 'center',
            dataIndex: 'repairDescription'
            // width: 300
            dataIndex: 'faultAnalysis'
          },
          {
            title: '排故过程',
            align: 'center',
            dataIndex: 'faultProcess'
          },
          {
            title: '预防措施',
            align: 'center',
            dataIndex: 'faultPrevent'
          },
          {
            title: '操作工',
            align: 'center',
            dataIndex: 'confirmer_dictText'
          },
          {
            title: '操作工确认时间',
            align: 'center',
            dataIndex: 'confirmTime',
            width: 200
          }
          // {
          //   title: '维修图片',
          //   align: 'center',
          //   dataIndex: 'imageFiles',
          //   width: 100
          // },
          // {
          //   title: '是否委外',
          //   align: 'center',
          //   dataIndex: 'outsourcedFlag',
          //   width: 100
          // },
          // {
          //   title: '委外维修描述',
          //   align: 'center',
          //   dataIndex: 'outsourcedRepairDecription',
          //   width: 300
          // },
          // {
          //   title: '委外维修开始时间',
          //   align: 'center',
          //   dataIndex: 'outsourcedStartTime',
          //   width: 200
          // },
          // {
          //   title: '委外维修结束时间',
          //   align: 'center',
          //   dataIndex: 'outsourcedEndTime',
          //   width: 200
          // },
          // {
          //   title: '委外负责人',
          //   align: 'center',
          //   dataIndex: 'outsourcedPerson',
          //   width: 100
          // },
        ],
        report_repair_status_list: [],
        selectRepairOrderData: {},
        url: {
          list: '/eam/eamRepairOrder/list',
          submit: '/eam/eamRepairOrder/submit',
          delete: '/eam/eamRepairOrder/delete',
          deleteBatch: '/eam/eamRepairOrder/deleteBatch',
          exportXlsUrl: 'eam/eamRepairOrder/exportXls'
          deleteBatch: '/eam/eamRepairOrder/deleteBatch'
        }
      }
    },
    computed: {
      importExcelUrl: function() {
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
      }
    },
    created() {
      if (!this.isDisplayOperation) {
        return
      }
      this.initDictData('report_repair_status')
      const operationColumn = {
        title: '操作',
        dataIndex: 'action',
        align: 'center',
        width: 100,
        scopedSlots: { customRender: 'action' }
        width: 200,
        scopedSlots: { customRender: 'action' },
        fixed: 'right'
      }
      this.columns = [...this.columns, operationColumn]
      this.loadData(1)
    },
    methods: {
      /**
       * èŽ·å–æ•°æ®å­—å…¸å€¼
       * @param dictCode æ•°æ®å­—典对应记录编码
       * ç‚¹å‡»å¡«æŠ¥æ—¶è§¦å‘
       * @param record
       */
      initDictData(dictCode) {
        // //优先从缓存中读取字典配置
        if (getDictItemsFromCache(dictCode)) {
          this[dictCode + '_list'] = getDictItemsFromCache(dictCode)
          return
        }
        //根据字典Code, åˆå§‹åŒ–字典数组
        ajaxGetDictItems(dictCode, null).then((res) => {
          if (res.success) {
            this[dictCode + '_list'] = res.result
            return
          }
        })
      handleFillIn(record) {
        this.$refs.modalForm.title = '填报'
        this.$refs.modalForm.handleFillIn(record)
      },
      // å¼€å¯é¢†å–故障保修单弹窗
      handleOpenReceiveFaultModal() {
        this.$refs.receiveFaultModalRef.visible = true
      /**
       * ç‚¹å‡»æäº¤æ—¶è§¦å‘
       * @param id
       */
      handleSubmit(id) {
        this.loading = true
        getAction(this.url.submit, { id })
          .then(res => {
            if (res.success) {
              this.$notification.success({
                message: '消息',
                description: res.message
              })
              this.loadData()
            } else {
              this.$notification.warning({
                message: '消息',
                description: res.message
              })
              this.loading = false
            }
          })
      },
      /**
@@ -296,7 +275,4 @@
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>
</script>
src/views/eam/repair/EamReportRepairList.vue
@@ -1,69 +1,44 @@
<template>
  <a-card :bordered="false">
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="设备编号">
              <!--<a-input placeholder="请输入设备编号" v-model="queryParam.equipmentId"/>-->
              <lx-search-equipment-select placeholder="请输入设备编号或名称搜索" v-model="queryParam.equipmentId"/>
          <a-col :xl="5" :lg="6" :md="8" :sm="12">
            <a-form-item label="统一编码">
              <lx-search-equipment-select placeholder="请输入统一编码或名称搜索" v-model="queryParam.equipmentId"/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24" v-if="isDisplayOperation">
          <a-col :xl="4" :lg="6" :md="8" :sm="12">
            <a-form-item label="报修状态">
              <a-select placeholder="请选择报修状态" v-model="queryParam.reportStatus" allow-clear>
                <a-select-option v-for="item in report_repair_status_list" :key="item.value">{{ item.label }}
                </a-select-option>
              </a-select>
              <j-dict-select-tag dict-code="report_repair_status" placeholder="请选择报修状态"
                                 v-model="queryParam.reportStatus"/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="故障描述">
              <a-input placeholder="请输入故障描述" v-model="queryParam.faultDescription" allow-clear/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
          <a-col :xl="5" :lg="6" :md="8" :sm="12">
            <a-form-item label="故障时间">
              <a-range-picker showTime v-model="faultTimeRange" value-format="YYYY-MM-DD HH:mm:ss"
                              @change="handleTimeRangeChange"
              <a-range-picker v-model="queryParam.dates" value-format="YYYY-MM-DD" @change="handleTimeRangeChange"
                              style="width: 100%"/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
          <a-col :xl="4" :lg="6" :md="8" :sm="12">
            <a-form-item label="是否停机">
              <a-radio-group v-model="queryParam.breakdownFlag">
                <a-radio v-for="item in breakdown_flag_list" :value="item.value">{{ item.label }}</a-radio>
              </a-radio-group>
              <j-dict-select-tag type="radio" v-model="queryParam.breakdownFlag" dict-code="yn"/>
            </a-form-item>
          </a-col>
          <template v-if="toggleSearchStatus">
          </template>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
              <!--              <a @click="handleToggleSearch" style="margin-left: 8px">-->
              <!--                {{ toggleSearchStatus ? '收起' : '展开' }}-->
              <!--                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>-->
              <!--              </a>-->
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <div class="table-operator" v-if="isDisplayOperation">
      <a-button @click="handleAdd" type="primary" icon="plus" >新增</a-button>
      <!--<a-button type="primary" icon="download" @click="handleExportXls('故障报修')">导出</a-button>-->
      <!--<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"-->
      <!--@change="handleImportExcel">-->
      <!--<a-button type="primary" icon="import">导入</a-button>-->
      <!--</a-upload>-->
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
      <a-dropdown v-if="selectedRowKeys.length > 0">
        <a-menu slot="overlay">
          <a-menu-item key="1" @click="batchDel">
@@ -85,68 +60,63 @@
        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
      </div>
      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        class="j-table-force-nowrap"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type:isDisplayOperation?'checkbox':'radio',getCheckboxProps:getCheckboxProps}"
        @change="handleTableChange">
        <template slot="imageFiles" slot-scope="text, record" v-if="text">
          <a @click="handlePreviewImages(record)">预览</a>
      <a-table ref="table" size="middle" bordered rowKey="id" :columns="columns" :dataSource="dataSource"
               :pagination="ipagination" :loading="loading" :scroll="{x:'max-content'}"
               :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type:isDisplayOperation?'checkbox':'radio',getCheckboxProps:getCheckboxProps}"
               @change="handleTableChange">
        <!--统一编码-->
        <template slot="equipmentCode" slot-scope="text,record">
          <a href="#" @click="navigateTo('EamRepairOrderList')">{{text}}</a>
        </template>
        <span slot="action" slot-scope="text, record" v-if="record.reportStatus=='WAIT_REPAIR'">
        <!--是否加工-->
        <template slot="isProcessed" slot-scope="text,record">
          <a href="#" @click="navigateTo('EamReportProductHazardsList')" :disabled="!Boolean(+text)">{{record.isProcessed_dictText}}</a>
        </template>
        <!--是否停机-->
        <template slot="breakdownFlag" slot-scope="text">
          <a-switch checked-children="是" un-checked-children="否" :checked="Boolean(+text)" disabled/>
        </template>
        <!--设备事故-->
        <template slot="isAccidentsRegister" slot-scope="text,record">
          <a href="#" @click="navigateTo('EamReportAccidentsRegisterList')" :disabled="!Boolean(+text)">{{record.isAccidentsRegister_dictText}}</a>
        </template>
        <!--变动因素-->
        <template slot="variableFactors" slot-scope="text">
          <a-switch checked-children="是" un-checked-children="否" :checked="Boolean(+text)" disabled/>
        </template>
        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">编辑</a>
          <a-divider type="vertical"/>
          <a @click="handleAssign(record)" >指派</a>
          <a-divider type="vertical" />
          <a-popconfirm title="确定作废吗?" @confirm="() => handleDelete(record.id)" >
          <a-popconfirm title="确定作废吗?" @confirm="() => handleAbolish(record.id)">
            <a>作废</a>
          </a-popconfirm>
        </span>
      </a-table>
    </div>
    <!-- table区域-end -->
    <!-- è¡¨å•区域 -->
    <eamReportRepair-modal ref="modalForm" :breakdownFlagList="breakdown_flag_list" :faultReasonList="faultReasonList"
                           @ok="modalFormOk"/>
    <!-- å›¾ç‰‡é¢„览弹窗 -->
    <images-preview-modal ref="imagesPreviewModalRef" :imageListUrl="currentImageListUrl"/>
    <!--指派报修弹窗-->
    <assign-repair-report-modal ref="assignRepairReportModalRef" @ok="modalFormOk"/>
    <eamReportRepair-modal ref="modalForm" @ok="modalFormOk"/>
  </a-card>
</template>
<script>
  import '@/assets/less/TableExpand.less'
  import EamReportRepairModal from './modules/EamReportRepairList/EamReportRepairModal'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue'
  import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api'
  import ImagesPreviewModal from '@views/eam/repair/modules/ImagesPreviewModal.vue'
  import { getAction } from '@/api/manage'
  import AssignRepairReportModal from './modules/EamReportRepairList/AssignRepairReportModal'
  export default {
    name: 'EamReportRepairList',
    mixins: [JeecgListMixin],
    components: {
      AssignRepairReportModal,
      ImagesPreviewModal,
      LxSearchEquipmentSelect,
      EamReportRepairModal
    },
@@ -173,92 +143,128 @@
            align: 'center',
            customRender: function(t, r, index) {
              return parseInt(index) + 1
            }
            },
            fixed: 'left'
          },
          {
            title: '设备编号',
            title: '统一编码',
            align: 'center',
            dataIndex: 'equipmentCode',
            width: 200
            fixed: 'left',
            scopedSlots: { customRender: 'equipmentCode' }
          },
          {
            title: '设备名称',
            align: 'center',
            dataIndex: 'equipmentName',
            width: 200
            fixed: 'left'
          },
          {
            title: '设备型号',
            align: 'center',
            dataIndex: 'equipmentModel',
            fixed: 'left'
          },
          {
            title: '报修状态',
            align: 'center',
            dataIndex: 'reportStatus_dictText',
            width: 100
          },
          {
            title: '故障简称',
            align: 'center',
            dataIndex: 'faultName',
            width: 100
          },
          {
            title: '故障分类',
            align: 'center',
            dataIndex: 'faultType_dictText',
            width: 100
          },
          {
            title: '故障描述',
            align: 'center',
            dataIndex: 'faultDescription',
            width: 200
            fixed: 'left'
          },
          {
            title: '故障开始时间',
            align: 'center',
            dataIndex: 'faultStartTime',
            width: 200
            dataIndex: 'faultStartTime'
          },
          {
            title: '故障现象',
            align: 'center',
            dataIndex: 'faultDescription'
          },
          {
            title: '是否停机',
            align: 'center',
            dataIndex: 'breakdownFlag_dictText',
            width: 100
            dataIndex: 'breakdownFlag',
            scopedSlots: { customRender: 'breakdownFlag' }
          },
          {
            title: '报修图片',
            title: '是否加工',
            align: 'center',
            dataIndex: 'imageFiles',
            scopedSlots: { customRender: 'imageFiles' },
            width: 100
            dataIndex: 'isProcessed',
            scopedSlots: { customRender: 'isProcessed' }
          },
          {
            title: '备注',
            title: '批次号',
            align: 'center',
            dataIndex: 'remark'
            dataIndex: 'batchNumber'
          },
          {
            title: '加工零件号',
            align: 'center',
            dataIndex: 'processingPart'
          },
          {
            title: '件数',
            align: 'center',
            dataIndex: 'quantity'
          },
          {
            title: '设备事故',
            align: 'center',
            dataIndex: 'isAccidentsRegister',
            scopedSlots: { customRender: 'isAccidentsRegister' }
          },
          {
            title: '废品件号',
            align: 'center',
            dataIndex: 'scrapPartNumber'
          },
          {
            title: '废品件数',
            align: 'center',
            dataIndex: 'scrapPartQuantity'
          },
          {
            title: '废品价值',
            align: 'center',
            dataIndex: 'scrapPartValue'
          },
          {
            title: '变动因素',
            align: 'center',
            dataIndex: 'variableFactors',
            scopedSlots: { customRender: 'variableFactors' }
          },
          {
            title: '变动因素内容',
            align: 'center',
            dataIndex: 'variableFactorsValue_dictText'
          },
          {
            title: '事故现象',
            align: 'center',
            dataIndex: 'accidentPhenomenon'
          },
          {
            title: '采取措施',
            align: 'center',
            dataIndex: 'measure'
          },
          {
            title: '造成结果',
            align: 'center',
            dataIndex: 'causingResults'
          }
        ],
        breakdown_flag_list: [],
        report_repair_status_list: [],
        faultTimeRange: [],
        faultReasonList: [],
        currentImageListUrl: '',
        url: {
          list: '/eam/eamReportRepair/list',
          delete: '/eam/eamReportRepair/abolish',
          deleteBatch: '/eam/eamReportRepair/abolishBatch',
          exportXlsUrl: 'eam/eamReportRepair/exportXls',
          importExcelUrl: 'eam/eamReportRepair/importExcel',
          faultReasonList: '/eam/equipmentFaultReason/list'
          abolish: '/eam/eamReportRepair/abolish',
          abolishBatch: '/eam/eamReportRepair/abolishBatch'
        }
      }
    },
    computed: {
      importExcelUrl: function() {
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
      }
    },
    created() {
      this.initDictData('breakdown_flag')
      this.initDictData('report_repair_status')
      if (!this.isDisplayOperation) this.queryParam = Object.assign({}, this.propsQueryParam)
      else {
        const operationColumn = {
@@ -266,43 +272,14 @@
          dataIndex: 'action',
          align: 'center',
          scopedSlots: { customRender: 'action' },
          width: 200
          width: 200,
          fixed: 'right'
        }
        this.columns = [...this.columns, operationColumn]
        this.getFaultReasonListByApi()
      }
      this.loadData(1)
    },
    methods: {
      /**
       * èŽ·å–æ•°æ®å­—å…¸å€¼
       * @param dictCode æ•°æ®å­—典对应记录编码
       */
      initDictData(dictCode) {
        // //优先从缓存中读取字典配置
        if (getDictItemsFromCache(dictCode)) {
          this[dictCode + '_list'] = getDictItemsFromCache(dictCode)
          return
        }
        //根据字典Code, åˆå§‹åŒ–字典数组
        ajaxGetDictItems(dictCode, null).then((res) => {
          if (res.success) {
            this[dictCode + '_list'] = res.result
            return
          }
        })
      },
      // è°ƒç”¨æŽ¥å£èŽ·å–æ•…éšœåŽŸå› åˆ—è¡¨
      getFaultReasonListByApi() {
        const that = this
        getAction(this.url.faultReasonList)
          .then(res => {
            console.log('res', res)
            that.faultReasonList = res.result.records
          })
      },
      /**
       * æ•…障时间选择器变化时触发
       * @param valueArray
@@ -310,24 +287,6 @@
      handleTimeRangeChange(valueArray) {
        this.queryParam.startTime = valueArray[0]
        this.queryParam.endTime = valueArray[1]
      },
      /**
       * é¢„览图片
       * @param imageFiles è¡¨æ ¼è¡Œå›¾ç‰‡åœ°å€
       */
      handlePreviewImages({ imageFiles }) {
        this.currentImageListUrl = imageFiles
        this.$refs.imagesPreviewModalRef.visible = true
      },
      /**
       * æŒ‡æ´¾æŠ¥ä¿®å•
       * @param record è¡¨æ ¼è¡Œä¿¡æ¯
       */
      handleAssign(record) {
        this.$refs.assignRepairReportModalRef.visible = true
        this.$refs.assignRepairReportModalRef.model = Object.assign({}, { id: record.id })
      },
      getCheckboxProps(record) {
@@ -338,15 +297,41 @@
        }
      },
      /**
       * ç‚¹å‡»ä½œåºŸæ—¶è§¦å‘
       * @param id
       */
      handleAbolish(id) {
        var that = this
        this.loading = true
        getAction(that.url.abolish, { id })
          .then((res) => {
            if (res.success) {
              that.$notification.success({
                message: '消息',
                description: res.message
              })
              that.loadData()
            } else {
              that.$notification.warning({
                message: '消息',
                description: res.message
              })
              this.loading = false
            }
          })
      },
      // è·³è½¬é¡µé¢
      navigateTo(href) {
        this.$router.push('/eam/repair/' + href)
      },
      searchReset() {
        if (this.isDisplayOperation) this.queryParam = {}
        else this.queryParam = Object.assign({}, this.propsQueryParam)
        this.faultTimeRange = []
        this.loadData(1)
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>
</script>
src/views/eam/repair/modules/EamRepairOrderList/EamRepairOrderModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,202 @@
<template>
  <j-modal :title="title" :width="1200" :visible="visible" :confirmLoading="confirmLoading" @ok="handleOk"
           @cancel="handleCancel" cancelText="关闭" centered>
    <a-spin :spinning="spinning">
      <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol">
        <a-row>
          <a-col :span="customSpan">
            <a-form-model-item label="维修开始时间" prop="actualStartTime" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-date-picker show-time v-model="model.actualStartTime" :allowClear="false"
                             value-format="YYYY-MM-DD HH:mm:ss"
                             style="width:100%"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="customSpan">
            <a-form-model-item label="维修结束时间" prop="actualEndTime" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-date-picker show-time v-model="model.actualEndTime" :allowClear="false"
                             value-format="YYYY-MM-DD HH:mm:ss"
                             style="width:100%"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="customSpan">
            <a-form-model-item label="故障原因">
              <a-textarea placeholder="请输入故障原因" v-model="model.faultReason"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="customSpan">
            <a-form-model-item label="故障分析">
              <a-textarea placeholder="请输入故障分析" v-model="model.faultAnalysis"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="customSpan">
            <a-form-model-item label="排故过程">
              <a-textarea placeholder="请输入排故过程" v-model="model.faultProcess"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="customSpan">
            <a-form-model-item label="预防措施">
              <a-textarea placeholder="请输入预防措施" v-model="model.faultPrevent"/>
            </a-form-model-item>
          </a-col>
        </a-row>
        <j-vxe-table ref="editableDetailTable" rowNumber rowSelection bordered alwaysEdit toolbar
                     :toolbarConfig="detail.toolbarConfig" keep-source :height="300"
                     :dataSource="detail.dataSource" :columns="detail.columns">
        </j-vxe-table>
      </a-form-model>
    </a-spin>
  </j-modal>
</template>
<script>
  import { postAction, getAction } from '@/api/manage'
  import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue'
  import { JVXETypes } from '@comp/jeecg/JVxeTable'
  export default {
    name: 'EamRepairOrderModal',
    components: { LxSearchEquipmentSelect },
    data() {
      return {
        title: '操作',
        visible: false,
        model: {},
        customSpan: 12,
        labelCol: {
          xs: { span: 24 },
          sm: { span: 6 }
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 }
        },
        confirmLoading: false,
        spinning: false,
        validatorRules: {
          actualStartTime: [{ required: true, message: '请选择维修开始时间', trigger: 'change' }],
          actualEndTime: [{ required: true, message: '请选择维修结束时间', trigger: 'change' }]
        },
        detail: {
          dataSource: [],
          columns: [
            {
              title: 'ID',
              key: 'id',
              type: JVXETypes.hidden
            },
            {
              title: '维修人',
              key: 'repairUser',
              align: 'center',
              placeholder: '请输入${title}',
              type: JVXETypes.input,
              validateRules: [{ required: true, message: '请输入${title}' }]
            },
            {
              title: '是否是主维修人',
              key: 'repairPrimary',
              align: 'center',
              type: JVXETypes.select,
              placeholder: '请选择${title}',
              dictCode: 'yn',
              validateRules: [{ required: true, message: '请选择${title}' }]
            },
            {
              title: '维修时长',
              key: 'repairDuration',
              align: 'center',
              placeholder: '请输入${title}',
              type: JVXETypes.inputNumber,
              validateRules: [{ required: true, message: '请输入${title}' }]
            },
            {
              title: '备注',
              key: 'remark',
              align: 'center',
              type: JVXETypes.textarea,
              placeholder: '请输入${title}'
            }
          ],
          toolbarConfig: {
            // prefix å‰ç¼€ï¼›suffix åŽç¼€
            slot: ['prefix', 'suffix'],
            // add æ–°å¢žæŒ‰é’®ï¼›remove åˆ é™¤æŒ‰é’®ï¼›clearSelection æ¸…空选择按钮
            btn: ['add', 'remove', 'clearSelection']
          }
        },
        url: {
          report: '/eam/eamRepairOrder/report',
          detail: '/eam/eamRepairPerson/list'
        }
      }
    },
    methods: {
      handleFillIn(record) {
        this.visible = true
        this.model = Object.assign({}, record)
        this.getRepairDetailByApi(record.id)
      },
      getRepairDetailByApi(repairId) {
        this.spinning = true
        this.detail.dataSource = []
        getAction(this.url.detail, { repairId })
          .then(res => {
            if (res.success) this.detail.dataSource = res.result
          })
          .finally(() => {
            this.spinning = false
          })
      },
      async handleOk() {
        const errMap = await this.$refs.editableDetailTable.validateTable()
        if (errMap) return
        const that = this
        // è§¦å‘表单验证
        this.$refs.form.validate(valid => {
          if (valid) {
            that.confirmLoading = that.spinning = true
            that.model.eamRepairPersonList = that.$refs.editableDetailTable.getTableData()
            postAction(that.url.report, that.model)
              .then((res) => {
                if (res.success) {
                  that.$notification.success({
                    message: '消息',
                    description: res.message
                  })
                  that.$emit('ok')
                  that.close()
                } else {
                  that.$notification.warning({
                    message: '消息',
                    description: res.message
                  })
                }
              })
              .finally(() => {
                that.confirmLoading = that.spinning = false
              })
          } else {
            return false
          }
        })
      },
      close() {
        this.$emit('close')
        this.visible = false
        if (this.$refs.form) this.$refs.form.clearValidate()
      },
      handleCancel() {
        this.close()
      }
    }
  }
</script>
src/views/eam/repair/modules/EamRepairOrderList/ReceiveFaultModal.vue
ÎļþÒÑɾ³ý
src/views/eam/repair/modules/EamRepairPersonModal.Style#Drawer.vue
ÎļþÒÑɾ³ý
src/views/eam/repair/modules/EamReportAccidentsRegisterModal.Style#Drawer.vue
ÎļþÒÑɾ³ý
src/views/eam/repair/modules/EamReportProductHazardsModal.Style#Drawer.vue
ÎļþÒÑɾ³ý
src/views/eam/repair/modules/EamReportRepairList/AssignRepairReportModal.vue
ÎļþÒÑɾ³ý
src/views/eam/repair/modules/EamReportRepairList/EamReportRepairModal.vue
@@ -1,62 +1,62 @@
<template>
  <j-modal
    :title="title"
    fullscreen
    :visible="visible"
    centered
    :confirmLoading="confirmLoading"
    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
    @ok="handleOk"
    @cancel="handleCancel"
    cancelText="关闭">
  <j-modal :title="title" fullscreen :visible="visible" :confirmLoading="confirmLoading"
           :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" @ok="handleOk" @cancel="handleCancel"
           cancelText="关闭">
    <a-spin :spinning="confirmLoading">
      <j-form-container :disabled="disableSubmit">
        <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol"
                      :wrapperCol="wrapperCol" slot="detail">
          <a-row>
            <a-col :span="customSpan">
              <a-form-model-item prop="equipmentId" label="设备编号">
                <lx-search-equipment-select placeholder="请输入设备编号或名称搜索" v-model="model.equipmentId"/>
              </a-form-model-item>
            </a-col>
            <a-col :span="customSpan">
              <a-form-model-item label="是否加工">
                <j-dict-select-tag dict-code="is_processed" type="radio" v-model="model.isProcessed"
                                   @change="handleRadioChange($event,'faultStartTime,breakdownFlag,' +
                                    'faultDescription,batchNumber,processingPart,quantity')"/>
              </a-form-model-item>
            </a-col>
            <a-col :span="customSpan">
              <a-form-model-item label="故障开始时间">
                <a-date-picker :disabled="!Boolean(+model.isProcessed)" v-model="model.faultStartTime" value-format="YYYY-MM-DD" style="width:100%"/>
              </a-form-model-item>
            </a-col>
            <a-col :span="customSpan">
              <a-form-model-item label="是否停机">
                <j-dict-select-tag :disabled="!Boolean(+model.isProcessed)" dict-code="yn" placeholder="请选择是否停机" v-model="model.breakdownFlag"/>
              <a-form-model-item prop="equipmentId" label="统一编码">
                <lx-search-equipment-select placeholder="请输入统一编码或名称搜索" v-model="model.equipmentId" :allowClear="false"/>
              </a-form-model-item>
            </a-col>
          </a-row>
          <a-row>
            <a-col :span="customSpan">
              <a-form-model-item label="故障现象">
                <a-input  :disabled="!Boolean(+model.isProcessed)" placeholder="请输入故障现象" v-model="model.faultDescription"/>
              <a-form-model-item label="是否停机">
                <j-dict-select-tag type="radio" dict-code="yn" placeholder="请选择是否停机" v-model="model.breakdownFlag"/>
              </a-form-model-item>
            </a-col>
            <a-col :span="customSpan">
              <a-form-model-item label="批次号">
                <a-input  :disabled="!Boolean(+model.isProcessed)" placeholder="请输入批次号" v-model="model.batchNumber"/>
              <a-form-model-item label="故障开始时间" prop="faultStartTime">
                <a-date-picker v-model="model.faultStartTime" :allowClear="false" value-format="YYYY-MM-DD"
                               style="width:100%"/>
              </a-form-model-item>
            </a-col>
            <a-col :span="12">
              <a-form-model-item label="故障现象" prop="faultDescription" :labelCol="labelColLong"
                                 :wrapperCol="wrapperColLong">
                <a-textarea placeholder="请输入故障现象" v-model="model.faultDescription"/>
              </a-form-model-item>
            </a-col>
          </a-row>
          <a-row>
            <a-col :span="customSpan">
              <a-form-model-item label="是否加工">
                <j-dict-select-tag dict-code="yn" type="radio" v-model="model.isProcessed"
                                   @change="handleRadioChange($event,'batchNumber,processingPart,quantity')"/>
              </a-form-model-item>
            </a-col>
            <a-col :span="customSpan">
              <a-form-model-item label="加工零件号">
                <a-input  :disabled="!Boolean(+model.isProcessed)" placeholder="请输入加工零件号" v-model="model.processingPart"/>
              <a-form-model-item label="批次号" prop="batchNumber">
                <a-input :disabled="!Boolean(+model.isProcessed)" placeholder="请输入批次号" v-model="model.batchNumber"/>
              </a-form-model-item>
            </a-col>
            <a-col :span="customSpan">
              <a-form-model-item label="件数">
                <a-input-number  :disabled="!Boolean(+model.isProcessed)" placeholder="请输入件数" v-model="model.quantity" :min="0" style="width: 100%"/>
              <a-form-model-item label="加工零件号" prop="processingPart">
                <a-input :disabled="!Boolean(+model.isProcessed)" placeholder="请输入加工零件号"
                         v-model="model.processingPart"/>
              </a-form-model-item>
            </a-col>
            <a-col :span="customSpan">
              <a-form-model-item label="件数" prop="quantity">
                <a-input-number :disabled="!Boolean(+model.isProcessed)" placeholder="请输入件数" v-model="model.quantity"
                                :min="0" style="width: 100%"/>
              </a-form-model-item>
            </a-col>
          </a-row>
@@ -64,22 +64,28 @@
          <a-row>
            <a-col :span="customSpan">
              <a-form-model-item label="设备事故">
                <j-dict-select-tag dict-code="yn" placeholder="请选择设备事故" v-model="model.isAccidentsRegister"/>
                <j-dict-select-tag dict-code="yn" type="radio" placeholder="请选择设备事故"
                                   v-model="model.isAccidentsRegister" @change="handleRadioChange($event,'scrapPartNumber,scrapPartQuantity,' +
                                    'scrapPartValue,operationCertificate,powerOffRestart,batchFirstPiece,variableFactors,variableFactorsValue,'+
                                    'executeNc,accidentPhenomenon,measure,causingResults')"/>
              </a-form-model-item>
            </a-col>
            <a-col :span="customSpan">
              <a-form-model-item label="废品件号">
                <a-input placeholder="请输入废品件号" v-model="model.scrapPartNumber"/>
              <a-form-model-item label="废品件号" prop="scrapPartNumber">
                <a-input placeholder="请输入废品件号" :disabled="!Boolean(+model.isAccidentsRegister)"
                         v-model="model.scrapPartNumber"/>
              </a-form-model-item>
            </a-col>
            <a-col :span="customSpan">
              <a-form-model-item label="废品件数">
                <a-input-number placeholder="请输入废品件数" v-model="model.scrapPartQuantity" :min="0" style="width: 100%"/>
              <a-form-model-item label="废品件数" prop="scrapPartQuantity">
                <a-input-number placeholder="请输入废品件数" :disabled="!Boolean(+model.isAccidentsRegister)"
                                v-model="model.scrapPartQuantity" :min="0" style="width: 100%"/>
              </a-form-model-item>
            </a-col>
            <a-col :span="customSpan">
              <a-form-model-item label="废品价值">
                <a-input placeholder="请输入废品价值" v-model="model.scrapPartValue"/>
              <a-form-model-item label="废品价值" prop="scrapPartValue">
                <a-input-number placeholder="请输入废品价值" :disabled="!Boolean(+model.isAccidentsRegister)"
                                v-model="model.scrapPartValue" style="width: 100%"/>
              </a-form-model-item>
            </a-col>
          </a-row>
@@ -87,63 +93,79 @@
          <a-row>
            <a-col :span="customSpan">
              <a-form-model-item label="是否有设备操作证">
                <j-dict-select-tag dict-code="yn" placeholder="请选择是否有设备操作证" v-model="model.operationCertificate"/>
                <j-dict-select-tag dict-code="yn" type="radio" :disabled="!Boolean(+model.isAccidentsRegister)"
                                   placeholder="请选择是否有设备操作证"
                                   v-model="model.operationCertificate"/>
              </a-form-model-item>
            </a-col>
            <a-col :span="customSpan">
              <a-form-model-item label="是否断电重启">
                <j-dict-select-tag dict-code="yn" placeholder="请选择是否断电重启" v-model="model.powerOffRestart"/>
                <j-dict-select-tag dict-code="yn" type="radio" :disabled="!Boolean(+model.isAccidentsRegister)"
                                   placeholder="请选择是否断电重启" v-model="model.powerOffRestart"/>
              </a-form-model-item>
            </a-col>
            <a-col :span="customSpan">
              <a-form-model-item label="是否为批次首件">
                <j-dict-select-tag dict-code="yn" placeholder="请选择是否为批次首件" v-model="model.batchFirstPiece"/>
                <j-dict-select-tag dict-code="yn" type="radio" :disabled="!Boolean(+model.isAccidentsRegister)"
                                   placeholder="请选择是否为批次首件"
                                   v-model="model.batchFirstPiece"/>
              </a-form-model-item>
            </a-col>
            <a-col :span="customSpan">
              <a-form-model-item label="变动因素">
                <j-dict-select-tag dict-code="yn" placeholder="请选择变动因素" v-model="model.variableFactors"/>
              <a-form-model-item label="变动因素" prop="variableFactors">
                <j-dict-select-tag type="radio" dict-code="yn" :disabled="!Boolean(+model.isAccidentsRegister)"
                                   placeholder="请选择变动因素" v-model="model.variableFactors"
                                   @change="handleRadioChange($event,'variableFactorsValue')"/>
              </a-form-model-item>
            </a-col>
          </a-row>
          <a-row>
            <a-col :span="customSpan">
              <a-form-model-item label="变动因素内容">
                <j-dict-select-tag dict-code="variable_factors_value" placeholder="请选择变动因素内容" v-model="model.variableFactorsValue"/>
              <a-form-model-item label="变动因素内容" prop="variableFactorsValue">
                <j-dict-select-tag dict-code="variable_factors_value" :disabled="!Boolean(+model.variableFactors)"
                                   placeholder="请选择变动因素内容"
                                   v-model="model.variableFactorsValue"/>
              </a-form-model-item>
            </a-col>
            <a-col :span="customSpan">
              <a-form-model-item label="执行程序">
                <a-input placeholder="请输入执行程序" v-model="model.executeNc"/>
                <a-input placeholder="请输入执行程序" v-model="model.executeNc"
                         :disabled="!Boolean(+model.isAccidentsRegister)"/>
              </a-form-model-item>
            </a-col>
            <a-col :span="customSpan">
              <a-form-model-item label="事故现象">
                <a-input placeholder="请输入事故现象" v-model="model.accidentPhenomenon"/>
              </a-form-model-item>
            </a-col>
            <a-col :span="customSpan">
              <a-form-model-item label="采取措施">
                <a-input placeholder="请输入采取措施" v-model="model.measure"/>
            <a-col :span="12">
              <a-form-model-item label="事故现象" prop="accidentPhenomenon" :labelCol="labelColLong"
                                 :wrapperCol="wrapperColLong">
                <a-textarea placeholder="请输入事故现象" v-model="model.accidentPhenomenon"
                            :disabled="!Boolean(+model.isAccidentsRegister)"/>
              </a-form-model-item>
            </a-col>
          </a-row>
          <a-row>
            <a-col :span="customSpan">
              <a-form-model-item label="造成结果">
                <a-input placeholder="请输入造成结果" v-model="model.causingResults"/>
            <a-col :span="12">
              <a-form-model-item label="采取措施" prop="measure" :labelCol="labelColLong" :wrapperCol="wrapperColLong">
                <a-textarea placeholder="请输入采取措施" v-model="model.measure"
                            :disabled="!Boolean(+model.isAccidentsRegister)"/>
              </a-form-model-item>
            </a-col>
            <a-col :span="customSpan">
              <a-form-model-item label="备注">
                <a-input placeholder="请输入备注" v-model="model.measure"/>
            <a-col :span="12">
              <a-form-model-item label="造成结果" prop="causingResults" :labelCol="labelColLong"
                                 :wrapperCol="wrapperColLong">
                <a-textarea placeholder="请输入造成结果" v-model="model.causingResults"
                            :disabled="!Boolean(+model.isAccidentsRegister)"/>
              </a-form-model-item>
            </a-col>
          </a-row>
          <a-row>
            <a-col :span="12">
              <a-form-model-item label="备注" :labelCol="labelColLong" :wrapperCol="wrapperColLong">
                <a-textarea placeholder="请输入备注" v-model="model.remark"/>
              </a-form-model-item>
            </a-col>
          </a-row>
        </a-form-model>
      </j-form-container>
    </a-spin>
@@ -153,19 +175,10 @@
<script>
  import { httpAction } from '@/api/manage'
  import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue'
  import moment from 'moment'
  export default {
    name: 'EamReportRepairModal',
    components: { LxSearchEquipmentSelect },
    props: {
      breakdownFlagList: {
        type: Array
      },
      faultReasonList: {
        type: Array
      }
    },
    data() {
      return {
        title: '操作',
@@ -192,21 +205,60 @@
        },
        confirmLoading: false,
        validatorRules: {
          faultStartTime: [
            { required: true, message: '请选择故障开始时间' }
          ],
          breakdownFlag: [
            { required: true, message: '请选择是否停机' }
          ],
          equipmentId: [
            { required: true, message: '请输入设备编号或名称搜索' }
          ],
          faultName: [
            { required: true, message: '请选择故障简称' }
          ],
          faultDescription: [
            { required: true, message: '请输入故障描述' }
          ]
          equipmentId: [{ required: true, message: '请输入统一编码或名称搜索', trigger: 'change' }],
          faultStartTime: [{ required: true, message: '请选择故障开始时间', trigger: 'change' }],
          faultDescription: [{ required: true, message: '请输入故障现象', trigger: 'change' }],
          batchNumber: [{
            validator: this.isProcessedRelatedValidator,
            message: '请输入批次号',
            trigger: 'change'
          }],
          processingPart: [{
            validator: this.isProcessedRelatedValidator,
            message: '请输入加工零件号',
            trigger: 'change'
          }],
          quantity: [{
            validator: this.isProcessedRelatedValidator,
            message: '请输入件数',
            trigger: 'change'
          }],
          scrapPartNumber: [{
            validator: this.isAccidentsRegisterRelatedValidator,
            message: '请输入废品件号',
            trigger: 'change'
          }],
          scrapPartQuantity: [{
            validator: this.isAccidentsRegisterRelatedValidator,
            message: '请输入废品件数',
            trigger: 'change'
          }],
          scrapPartValue: [{
            validator: this.isAccidentsRegisterRelatedValidator,
            message: '请输入废品价值',
            trigger: 'change'
          }],
          variableFactors: [{
            validator: this.isAccidentsRegisterRelatedValidator,
            message: '请选择变动因素',
            trigger: 'change'
          }],
          variableFactorsValue: [{
            validator: this.variableFactorsValueValidator,
            message: '请选择变动因素内容',
            trigger: 'change'
          }],
          accidentPhenomenon: [{
            validator: this.isAccidentsRegisterRelatedValidator,
            message: '请输入事故现象',
            trigger: 'change'
          }],
          measure: [{ validator: this.isAccidentsRegisterRelatedValidator, message: '请输入采取措施', trigger: 'change' }],
          causingResults: [{
            validator: this.isAccidentsRegisterRelatedValidator,
            message: '请输入造成结果',
            trigger: 'change'
          }]
        },
        url: {
          add: '/eam/eamReportRepair/add',
@@ -219,21 +271,16 @@
        this.editable = true
        //初始化默认值
        this.model = {
          isProcessed: 0,
          breakdownFlag: '1',
          isProcessed: '0',
          isAccidentsRegister: '0'
        }
        this.visible = true
      },
      edit(record) {
        this.model = Object.assign({}, record, { imageFilesResult: record.imageFiles && this.isJSON(record.imageFiles) ? JSON.parse(record.imageFiles) : null })
        this.model = Object.assign({}, record)
        this.visible = true
      },
      handleFaultNameChange(value) {
        const faultReasonItem = this.faultReasonList.find(item => item.faultName === value)
        this.model.faultType = faultReasonItem.faultCategory
        this.model.faultType_dictText = faultReasonItem.faultCategory_dictText
        this.model.faultDescription = faultReasonItem.faultDescription
      },
      handleOk() {
@@ -252,31 +299,29 @@
              httpUrl += this.url.edit
              method = 'put'
            }
            httpAction(httpUrl, this.model, method).then((res) => {
              if (res.success) {
                that.$message.success(res.message)
                that.$emit('ok')
              } else {
                that.$message.warning(res.message)
              }
            }).finally(() => {
              that.confirmLoading = false
              that.close()
            })
            httpAction(httpUrl, this.model, method)
              .then((res) => {
                if (res.success) {
                  that.$notification.success({
                    message: '消息',
                    description: res.message
                  })
                  that.$emit('ok')
                  that.close()
                } else {
                  that.$notification.warning({
                    message: '消息',
                    description: res.message
                  })
                }
              })
              .finally(() => {
                that.confirmLoading = false
              })
          } else {
            return false
          }
        })
      },
      // åˆ¤æ–­æ˜¯ä¸æ˜¯JSON字符串
      isJSON(str) {
        try {
          JSON.parse(str)
          return true // å¦‚果这里没有抛出异常,说明是JSON格式的字符串
        } catch (e) {
          return false // å¦‚果抛出异常,说明不是JSON格式的字符串
        }
      },
      /**\
@@ -289,39 +334,66 @@
        if (key.includes(',')) {
          const keys = key.split(',')
          keys.forEach(key => {
            if (value === '0') delete this.model[key]
            if (value != '1') delete this.model[key]
            this.$refs.form.clearValidate(key)
          })
        }else {
          if (value === '0') delete this.model[key]
        } else {
          if (value != '1') delete this.model[key]
          this.$refs.form.clearValidate(key)
        }
      },
      /**
       * ç¦ç”¨æ—¥æœŸ
       * @params current è¢«ç¦ç”¨çš„æ—¶é—´
       * æ ¹æ®æ˜¯å¦åŠ å·¥å­—æ®µæ ¡éªŒç›¸å…³å­—æ®µ
       * @param rule
       * @param value ç›¸å…³å­—段值
       * @param callback ç»“果回调函数
       */
      disabledDate(current) {
        // Can not select days after today
        return current > moment().endOf('day')
      },
      /**
       * ç¦ç”¨æ—¥æœŸä¸­çš„æ—¶é—´
       * @returns {{disabledHours: (function(): Array), disabledMinutes: (function(): Array)}}
       */
      disabledTime() {
        function range(start, end) {
          const result = []
          for (let i = start; i < end; i++) {
            result.push(i)
      isProcessedRelatedValidator(rule, value, callback) {
        if (this.model.isProcessed == '1') {
          if (!value) {
            callback(new Error())
          } else {
            callback()
          }
          return result
        } else {
          callback()
        }
      },
        return {
          disabledHours: () => range(moment().hour() + 1, 24),
          disabledMinutes: () => range(moment().minute() + 1, 60),
          disabledSeconds: () => range(moment().second() + 1, 60)
      /**
       * æ ¹æ®è®¾å¤‡äº‹æ•…字段校验相关字段
       * @param rule
       * @param value ç›¸å…³å­—段值
       * @param callback ç»“果回调函数
       */
      isAccidentsRegisterRelatedValidator(rule, value, callback) {
        if (this.model.isAccidentsRegister == '1') {
          if (!value) {
            callback(new Error())
          } else {
            callback()
          }
        } else {
          callback()
        }
      },
      /**
       * å˜åŠ¨å› ç´ å†…å®¹æ ¡éªŒ
       * @param rule
       * @param value å˜åŠ¨å› ç´ å†…å®¹å­—æ®µå€¼
       * @param callback ç»“果回调函数
       */
      variableFactorsValueValidator(rule, value, callback) {
        if (this.model.variableFactors == '1') {
          if (!value) {
            callback(new Error())
          } else {
            callback()
          }
        } else {
          callback()
        }
      },
@@ -332,7 +404,7 @@
      },
      handleCancel() {
        this.close()
      },
      }
    }
  }
</script>
src/views/eam/repair/modules/EamReportThreeNoSpareModal.Style#Drawer.vue
ÎļþÒÑɾ³ý
src/views/flowable/workflow/FlowTodo.vue
@@ -102,6 +102,10 @@
    <technical-status-evaluation-order-change-approval-modal ref="evaluationOrderChangeApprovalModal"
                                                             :selectShenpiData="selectedRowData"
                                                             @modalFormOk="modalFormOk"/>
    <!--维修工单-->
    <repair-order-approval-modal ref="repairOrderApprovalModal" :selectShenpiData="selectedRowData"
                                 @modalFormOk="modalFormOk"/>
  </a-card>
</template>
@@ -116,11 +120,13 @@
  import ThirdMaintenanceApprovalModal from './thirdMaintenance/ThirdMaintenanceApprovalModal'
  import TechnicalStatusEvaluationOrderChangeApprovalModal
    from './TechnicalStatusEvaluation/TechnicalStatusEvaluationOrderChangeApprovalModal'
  import RepairOrderApprovalModal from './repairOrder/RepairOrderApprovalModal'
  export default {
    name: 'FlowTodo',
    mixins: [JeecgListMixin],
    components: {
      RepairOrderApprovalModal,
      TechnicalStatusEvaluationOrderChangeApprovalModal,
      ThirdMaintenanceApprovalModal,
      SecondMaintenanceApprovalModal,
@@ -215,9 +221,6 @@
          case 'sbdjApproval':
            this.handInspectionOrder(record)
            break
          case 'eam_repair':
            this.handleRepairOrder(record)
            break
          case 'second_maintenance':
            this.handleSecondMaintenance(record)
            break
@@ -229,6 +232,9 @@
            break
          case 'EVALUATION_ORDER_CHANGE_PROCESS':
            this.handleEvaluationOrderChange(record)
            break
          case 'eam_repair_order':
            this.handleRepairOrder(record)
            break
          default:
            alert('没找到该流程')
@@ -303,11 +309,10 @@
       * @param record
       */
      handleRepairOrder(record) {
        this.selectRepairOrderData = Object.assign({}, record)
        this.selectedRowData = Object.assign({}, record)
        this.$refs.repairOrderApprovalModal.visible = true
        this.$refs.repairOrderApprovalModal.title = record.name
        this.$refs.repairOrderApprovalModal.getAllApproveData(record)
        this.$refs.repairOrderApprovalModal.getBasicInformation(record)
        this.$refs.repairOrderApprovalModal.handleDetail(record)
      },
      batchHandle() {
src/views/flowable/workflow/repairOrder/RepairOrderApprovalModal.vue
@@ -1,268 +1,97 @@
<template>
  <j-modal
    :width="1200"
    :visible="visible"
    :title="title"
    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
    @cancel="handCancel"
    @ok="submitForm"
    :mask-closable="false"
    :confirmLoading="confirmLoading"
    centered
  >
  <j-modal :width="1200" :visible="visible" :title="title" :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
           @cancel="handCancel" @ok="submitForm" :mask-closable="false" :confirmLoading="confirmLoading" fullscreen>
    <a-spin :spinning="spinning">
      <a-form-model ref="form" :model='tableRowRecord' :rules='validatorRules' :labelCol='labelCol'
                    :wrapperCol='wrapperCol'>
        <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;">报修基础信息</a-divider>
      <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelColLong"
                    :wrapperCol="wrapperColLong">
        <a-row :gutter="24" id="outer-row">
          <a-col :span="8" class="scroll-col">
            <a-tabs>
              <a-tab-pane tab="基础信息">
                <a-row>
                  <a-col :span="12">
                    <a-form-model-item label="维修开始时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
                      <a-input v-model="model.actualStartTime" readOnly/>
                    </a-form-model-item>
                  </a-col>
                  <a-col :span="12">
                    <a-form-model-item label="维修结束时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
                      <a-input v-model="model.actualEndTime" readOnly/>
                    </a-form-model-item>
                  </a-col>
                  <a-col :span="24">
                    <a-form-model-item label="故障原因">
                      <a-textarea v-model="model.faultReason" readOnly/>
                    </a-form-model-item>
                  </a-col>
                  <a-col :span="24">
                    <a-form-model-item label="故障分析">
                      <a-textarea v-model="model.faultAnalysis" readOnly/>
                    </a-form-model-item>
                  </a-col>
                  <a-col :span="24">
                    <a-form-model-item label="排故过程">
                      <a-textarea v-model="model.faultProcess" readOnly/>
                    </a-form-model-item>
                  </a-col>
                  <a-col :span="24">
                    <a-form-model-item label="预防措施">
                      <a-textarea v-model="model.faultPrevent" readOnly/>
                    </a-form-model-item>
                  </a-col>
                </a-row>
              </a-tab-pane>
            </a-tabs>
          </a-col>
        <a-row>
          <a-col :span='threeColSpan'>
            <a-form-model-item label='工单编号'>
              <a-input :readOnly='inputReadOnly' v-model='tableRowRecord.repairCode'/>
            </a-form-model-item>
          <!--维修人明细-->
          <a-col class="scroll-col" :span="10">
            <a-tabs v-model="activeTabKey">
              <a-tab-pane key="1" tab="维修人明细">
                <j-vxe-table ref="editableDetailTable" rowNumber bordered keep-source :dataSource="detail.dataSource"
                             :columns="detail.columns"/>
              </a-tab-pane>
              <template v-if="selectShenpiData.procInstId">
                <a-tab-pane key='2' tab='流程图'>
                  <img :src="imageSrc" alt="Fetched Image"/>
                </a-tab-pane>
              </template>
            </a-tabs>
          </a-col>
          <a-col :span='threeColSpan'>
            <a-form-model-item label='设备编号'>
              <lx-search-equipment-select disabled v-model='tableRowRecord.equipmentId'/>
            </a-form-model-item>
          </a-col>
          <a-col :span='threeColSpan'>
            <a-form-model-item label='维修负责人'>
              <a-input :readOnly='inputReadOnly' v-model='tableRowRecord.repairer'/>
            </a-form-model-item>
          <!--右侧审批列-->
          <a-col :span="6" class="scroll-col">
            <a-tabs>
              <a-tab-pane tab="操作工确认">
                <a-row>
                  <a-col :span="24">
                    <a-form-model-item prop="confirmResult" label="确认类型">
                      <j-dict-select-tag type='radio' v-model='model.confirmResult' dictCode='approve_reject'
                                         placeholder="请选择确认类型"
                                         :disabled="disableSubmit || model.repairStatus!='PENDING_CONFIRMATION'"/>
                    </a-form-model-item>
                  </a-col>
                  <a-col :span="24">
                    <a-form-model-item label="确认意见">
                      <a-textarea placeholder="请输入意见" v-model="model.confirmComment"
                                  :disabled="disableSubmit || model.repairStatus!='PENDING_CONFIRMATION'"/>
                    </a-form-model-item>
                  </a-col>
                </a-row>
              </a-tab-pane>
            </a-tabs>
          </a-col>
        </a-row>
        <a-row>
          <a-col :span="threeColSpan">
            <a-form-model-item label="故障开始时间">
              <a-input :readOnly='inputReadOnly' v-model="tableRowRecord.faultStartTime"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="threeColSpan">
            <a-form-model-item label="是否停机">
              <j-dict-select-tag type='radio' v-model='tableRowRecord.breakdownFlag' dictCode='breakdown_flag'
                                 disabled/>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row>
          <a-col :span='threeColSpan*3'>
            <a-form-model-item label='报修图片' :labelCol='labelColLong' :wrapperCol='wrapperColLong'>
              <lx-upload :returnUrl="false" :isMultiple="true" file-type="image" disabled :number="3"
                         v-model="tableRowRecord.reportImageFiles"/>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-tabs v-model="activeTabKey">
          <a-tab-pane key="1" tab="维修处理">
            <div v-if="repairConfirm">
              <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 :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repairConfirm" label="是否内部可维修">
                    <j-dict-select-tag type='radio' v-model='tableRowRecord.repairConfirm' dictCode='yn'
                                       placeholder="请选择" :disabled="disableSubmit || tableRowRecord.repairStatus !== 'WAIT_INTERNAL_CONFIRM'"/>
                  </a-form-model-item>
                </a-col>
                <a-col :span="12">
                  <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repairConfirmComment" label="维修确认意见">
                    <a-textarea placeholder="请输入意见" v-model="tableRowRecord.repairConfirmComment"
                                :readOnly="disableSubmit || tableRowRecord.repairStatus !== 'WAIT_INTERNAL_CONFIRM'"/>
                  </a-form-model-item>
                </a-col>
              </a-row>
            </div>
            <div v-if="underInternalRepair && tableRowRecord.repairConfirm === '1'">
              <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;">维修结果</a-divider>
              <a-row>
                <a-col :span="twoColSpan*2">
                  <a-form-model-item label="故障原因" prop="faultReason" :labelCol="labelColLong" :wrapperCol="wrapperColLong">
                    <a-input :readOnly="disableSubmit||tableRowRecord.repairStatus!=='UNDER_INTERNAL_REPAIR'"
                             v-model="tableRowRecord.faultReason" rows="4"
                             placeholder="请输入故障原因"/>
                  </a-form-model-item>
                </a-col>
                <a-col :span="twoColSpan*2">
                  <a-form-model-item label="维修结果描述" prop="repairDescription" :labelCol="labelColLong" :wrapperCol="wrapperColLong">
                    <a-textarea :readOnly="disableSubmit||tableRowRecord.repairStatus!=='UNDER_INTERNAL_REPAIR'"
                                v-model="tableRowRecord.repairDescription"
                                placeholder="请输入维修结果描述"/>
                  </a-form-model-item>
                </a-col>
                <a-col :span="twoColSpan*2">
                  <a-form-model-item label="维修图片" :labelCol="labelColLong" :wrapperCol="wrapperColLong">
                    <lx-upload :returnUrl="false" :isMultiple="true" file-type="image" :number="3"
                               :disabled="disableSubmit||tableRowRecord.repairStatus!=='UNDER_INTERNAL_REPAIR'"
                               v-model="tableRowRecord.imageFiles"/>
                  </a-form-model-item>
                </a-col>
              </a-row>
            </div>
            <div v-if="leaderConfirm && tableRowRecord.repairConfirm === '0'">
              <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 :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leaderConfirm" label="是否同意外部维修">
                    <j-dict-select-tag type='radio' v-model='tableRowRecord.leaderConfirm' dictCode='approved_rejected'
                                       placeholder="请选择" :disabled="disableSubmit || tableRowRecord.repairStatus!=='WAIT_LEADER_CONFIRM'"/>
                  </a-form-model-item>
                </a-col>
                <a-col :span="12">
                  <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leaderConfirmComment" label="确认意见">
                    <a-textarea placeholder="请输入意见" v-model="tableRowRecord.leaderConfirmComment"
                                :readOnly="disableSubmit || tableRowRecord.repairStatus!=='WAIT_LEADER_CONFIRM'"/>
                  </a-form-model-item>
                </a-col>
              </a-row>
            </div>
            <div v-if="underInternalRepair && tableRowRecord.leaderConfirm === '2'">
              <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;">维修结果</a-divider>
              <a-row>
                <a-col :span="twoColSpan*2">
                  <a-form-model-item label="故障原因" prop="faultReason" :labelCol="labelColLong" :wrapperCol="wrapperColLong">
                    <a-input :readOnly="disableSubmit||tableRowRecord.repairStatus!=='UNDER_INTERNAL_REPAIR'"
                             v-model="tableRowRecord.faultReason" rows="4"
                             placeholder="请输入故障原因"/>
                  </a-form-model-item>
                </a-col>
                <a-col :span="twoColSpan*2">
                  <a-form-model-item label="维修结果描述" prop="repairDescription" :labelCol="labelColLong" :wrapperCol="wrapperColLong">
                    <a-textarea :readOnly="disableSubmit||tableRowRecord.repairStatus!=='UNDER_INTERNAL_REPAIR'"
                                v-model="tableRowRecord.repairDescription"
                                placeholder="请输入维修结果描述"/>
                  </a-form-model-item>
                </a-col>
                <a-col :span="twoColSpan*2">
                  <a-form-model-item label="维修图片" :labelCol="labelColLong" :wrapperCol="wrapperColLong">
                    <lx-upload :returnUrl="false" :isMultiple="true" file-type="image" :number="3"
                               :disabled="disableSubmit||tableRowRecord.repairStatus!=='UNDER_INTERNAL_REPAIR'"
                               v-model="tableRowRecord.imageFiles"/>
                  </a-form-model-item>
                </a-col>
              </a-row>
            </div>
            <div v-if="externalConfirm && tableRowRecord.leaderConfirm === '1'">
              <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 :labelCol="labelCol" :wrapperCol="wrapperCol" prop="externalConfirm" label="机动办是否可维修">
                    <j-dict-select-tag type='radio' v-model='tableRowRecord.externalConfirm' dictCode='yn'
                                       placeholder="请选择" :disabled="disableSubmit||tableRowRecord.repairStatus!=='WAIT_EXTERNAL_CONFIRM'"/>
                  </a-form-model-item>
                </a-col>
                <a-col :span="12">
                  <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="externalConfirmComment" label="确认意见">
                    <a-textarea placeholder="请输入意见" v-model="tableRowRecord.externalConfirmComment"
                                :readOnly="disableSubmit || tableRowRecord.repairStatus!=='WAIT_EXTERNAL_CONFIRM'"/>
                  </a-form-model-item>
                </a-col>
              </a-row>
            </div>
            <div v-if="underExternalRepair && tableRowRecord.externalConfirm === '1'">
              <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;">机动办维修结果</a-divider>
              <a-row>
                <a-col :span="twoColSpan*2">
                  <a-form-model-item label="故障原因" prop="faultReason" :labelCol="labelColLong" :wrapperCol="wrapperColLong">
                    <a-input :readOnly="disableSubmit||tableRowRecord.repairStatus!=='UNDER_EXTERNAL_REPAIR'"
                             v-model="tableRowRecord.faultReason" rows="4"
                             placeholder="请输入故障原因"/>
                  </a-form-model-item>
                </a-col>
                <a-col :span="twoColSpan*2">
                  <a-form-model-item label="维修结果描述" prop="repairDescription" :labelCol="labelColLong" :wrapperCol="wrapperColLong">
                    <a-textarea :readOnly="disableSubmit||tableRowRecord.repairStatus!=='UNDER_EXTERNAL_REPAIR'"
                                v-model="tableRowRecord.repairDescription"
                                placeholder="请输入维修结果描述"/>
                  </a-form-model-item>
                </a-col>
                <a-col :span="twoColSpan*2">
                  <a-form-model-item label="维修图片" :labelCol="labelColLong" :wrapperCol="wrapperColLong">
                    <lx-upload :returnUrl="false" :isMultiple="true" file-type="image" :number="3"
                               :disabled="disableSubmit||tableRowRecord.repairStatus!=='UNDER_EXTERNAL_REPAIR'"
                               v-model="tableRowRecord.imageFiles"/>
                  </a-form-model-item>
                </a-col>
              </a-row>
            </div>
            <div v-if="underOutsideRepair && tableRowRecord.externalConfirm === '0'">
              <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;">委外维修结果</a-divider>
              <a-row>
                <a-col :span="twoColSpan*2">
                  <a-form-model-item label="故障原因" prop="faultReason" :labelCol="labelColLong" :wrapperCol="wrapperColLong">
                    <a-input :readOnly="disableSubmit||tableRowRecord.repairStatus!=='UNDER_OUTSIDE_REPAIR'"
                             v-model="tableRowRecord.faultReason" rows="4"
                             placeholder="请输入故障原因"/>
                  </a-form-model-item>
                </a-col>
                <a-col :span="twoColSpan*2">
                  <a-form-model-item label="维修结果描述" prop="repairDescription" :labelCol="labelColLong" :wrapperCol="wrapperColLong">
                    <a-textarea :readOnly="disableSubmit||tableRowRecord.repairStatus!=='UNDER_OUTSIDE_REPAIR'"
                                v-model="tableRowRecord.repairDescription"
                                placeholder="请输入维修结果描述"/>
                  </a-form-model-item>
                </a-col>
                <a-col :span="twoColSpan*2">
                  <a-form-model-item label="维修图片" :labelCol="labelColLong" :wrapperCol="wrapperColLong">
                    <lx-upload :returnUrl="false" :isMultiple="true" file-type="image" :number="3"
                               :disabled="disableSubmit||tableRowRecord.repairStatus!=='UNDER_OUTSIDE_REPAIR'"
                               v-model="tableRowRecord.imageFiles"/>
                  </a-form-model-item>
                </a-col>
              </a-row>
            </div>
            <div v-if="operatorConfirm">
              <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;">操作工确认</a-divider>
              <a-row :gutter="24">
                <a-col :span="24">
                  <a-form-model-item :labelCol="labelColLong" :wrapperCol="wrapperColLong" prop="confirmComment" label="确认意见">
                    <a-textarea placeholder="请输入意见" v-model="tableRowRecord.confirmComment"
                                :readOnly="disableSubmit || tableRowRecord.repairStatus!=='WAIT_CONFIRM'"/>
                  </a-form-model-item>
                </a-col>
              </a-row>
            </div>
          </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-tabs>
      </a-form-model>
    </a-spin>
  </j-modal>
</template>
<script>
  import '@assets/less/TableExpand.less'
  import { getAction, downFile, httpAction } from '@api/manage'
  import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect'
  import { JVXETypes } from '@comp/jeecg/JVxeTable'
  export default {
    name: 'RepairOrderApprovalModal',
@@ -276,151 +105,170 @@
    data() {
      return {
        title: '',
        threeColSpan: 8,
        twoColSpan: 12,
        inputReadOnly: true,
        disableSubmit: false,
        confirmLoading: false,
        spinning: false,
        tableRowRecord: {},
        hitaskDataSource: [],
        model: {},
        imageSrc: null,
        activeTabKey: '1',
        labelCol: {
          xs: { span: 24 },
          sm: { span: 6 }
          sm: { span: 10 }
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 }
          sm: { span: 14 }
        },
        labelColLong: {
          xs: { span: 24 },
          sm: { span: 2 }
          sm: { span: 5 }
        },
        wrapperColLong: {
          xs: { span: 24 },
          sm: { span: 20 }
          sm: { span: 19 }
        },
        validatorRules: {
          repairConfirm: [
            { required: true, message: '请选择是否内部可维修!' }
        validatorRules: { confirmResult: [{ required: true, message: '请选择确认类型' }] },
        detail: {
          dataSource: [],
          columns: [
            {
              title: 'ID',
              key: 'id',
              type: JVXETypes.hidden
            },
            {
              title: '维修人',
              key: 'repairUser',
              align: 'center',
              type: JVXETypes.normal
            },
            {
              title: '是否是主维修人',
              key: 'repairPrimary_dictText',
              align: 'center',
              type: JVXETypes.normal
            },
            {
              title: '维修时长',
              key: 'repairDuration',
              align: 'center',
              type: JVXETypes.normal
            },
            {
              title: '备注',
              key: 'remark',
              align: 'center',
              type: JVXETypes.normal
            }
          ],
          repairConfirmComment: [
            { required: true, message: '请输入维修确认意见' }
          ],
          leaderConfirm: [
            { required: true, message: '请选择是否同意外部维修!' }
          ],
          leaderConfirmComment: [
            { required: true, message: '请输入领导确认意见' }
          ],
          externalConfirm: [
            { required: true, message: '请选择机动办是否可维修!' }
          ],
          externalConfirmComment: [
            { required: true, message: '请输入机动办确认意见' }
          ],
          confirmComment: [
            { required: true, message: '请输入操作工确认意见' }
          ],
          faultReason: [
            { required: true, message: '请输入故障原因' }
          ],
          repairDescription: [
            { required: true, message: '请输入维修结果描述' }
          ]
          toolbarConfig: {
            // prefix å‰ç¼€ï¼›suffix åŽç¼€
            slot: ['prefix', 'suffix'],
            // add æ–°å¢žæŒ‰é’®ï¼›remove åˆ é™¤æŒ‰é’®ï¼›clearSelection æ¸…空选择按钮
            btn: ['add', 'remove', 'clearSelection']
          }
        },
        approveData: {},
        visible: false,
        // è¡¨å¤´
        url: {
          queryBomDataById: '/eam/eamRepairOrder/queryById',
          queryById: '/eam/eamRepairOrder/queryByReportId',
          diagramView: '/assign/flow/diagramView',
          queryHisTaskList: '/assign/flow/queryHisTaskList',
          approve: '/eam/eamRepairOrder/perform'
          approve: '/eam/eamRepairOrder/perform',
          detail: '/eam/eamRepairPerson/list'
        }
      }
    },
    computed: {
      repairConfirm() {
        return ['WAIT_INTERNAL_CONFIRM', 'UNDER_INTERNAL_REPAIR', 'WAIT_LEADER_CONFIRM', 'WAIT_EXTERNAL_CONFIRM', 'UNDER_EXTERNAL_REPAIR', 'UNDER_OUTSIDE_REPAIR', 'WAIT_CONFIRM', 'COMPLETE'].includes(this.tableRowRecord.repairStatus)
      },
      underInternalRepair() {
        return ['UNDER_INTERNAL_REPAIR', 'WAIT_CONFIRM', 'COMPLETE'].includes(this.tableRowRecord.repairStatus)
      },
      leaderConfirm() {
        return ['UNDER_INTERNAL_REPAIR', 'WAIT_LEADER_CONFIRM', 'WAIT_EXTERNAL_CONFIRM', 'UNDER_EXTERNAL_REPAIR', 'UNDER_OUTSIDE_REPAIR', 'WAIT_CONFIRM', 'COMPLETE'].includes(this.tableRowRecord.repairStatus)
      },
      externalConfirm() {
        return ['WAIT_EXTERNAL_CONFIRM', 'UNDER_EXTERNAL_REPAIR', 'UNDER_OUTSIDE_REPAIR', 'WAIT_CONFIRM', 'COMPLETE'].includes(this.tableRowRecord.repairStatus)
      },
      underExternalRepair() {
        return ['UNDER_EXTERNAL_REPAIR', 'WAIT_CONFIRM', 'COMPLETE'].includes(this.tableRowRecord.repairStatus)
      },
      underOutsideRepair() {
        return ['UNDER_OUTSIDE_REPAIR', 'WAIT_CONFIRM', 'COMPLETE'].includes(this.tableRowRecord.repairStatus)
      },
      operatorConfirm() {
        return ['WAIT_CONFIRM', 'COMPLETE'].includes(this.tableRowRecord.repairStatus)
        return ['WAIT_CONFIRM', 'COMPLETE'].includes(this.model.repairStatus)
      }
    },
    methods: {
      /**
       * èŽ·å–æµç¨‹èŠ‚ç‚¹å’Œæµç¨‹å›¾
       * @param record å¾…办记录信息
       * ä¸»é¡µé¢ç‚¹å‡»æ‰§è¡Œå®¡æ‰¹æ—¶è§¦å‘
       * @param record ä¸»é¡µé¢åˆ—表行记录
       */
      getAllApproveData(record) {
        if (!record.procInstId) return
        console.log('record----->', record)
        const { procInstId, processDefinitionId, processInstanceId, processDefinitionKey } = record
        const param = { procInstId }
        const imageParam = { processDefinitionId, processInstanceId, TaskDefinitionKey: processDefinitionKey }
      async handleDetail(record) {
        this.spinning = true
        this.activeTabKey = '1'
        this.model = {}
        this.getBasicInformationByApi(record)
        this.getFlowChartImageByApi(record)
        this.loadDetail(record.dataId)
      },
      /**
       * ä¸»é¡µé¢ç‚¹å‡»è¯¦æƒ…时触发
       * @param record ä¸»é¡µé¢åˆ—表行记录
       */
      recordDetail(record) {
        this.spinning = true
        this.activeTabKey = 1
        this.model = Object.assign({}, record)
        this.loadDetail(record.id)
      },
      /**
       * èŽ·å–åŸºç¡€ä¿¡æ¯
       * @param record ä¸»é¡µé¢åˆ—表行记录
       */
      getBasicInformationByApi(record) {
        const that = this
        getAction(this.url.queryHisTaskList, param)
        getAction(this.url.queryById, { id: record.dataId })
          .then(res => {
            that.hitaskDataSource = res.result
            if (res.success) {
              that.model = Object.assign({}, res.result[0])
              that.model.dataId = record.dataId
              that.model.taskId = record.id
              that.model.userId = record.assignee
              that.model.instanceId = record.procInstId
            }
            else {
              that.$notification.warning({
                message: '消息',
                description: res.message
              })
            }
          })
      },
        downFile(this.url.diagramView, imageParam, 'get')
      /**
       * èŽ·å–æµç¨‹å›¾
       * @param record ä¸»é¡µé¢åˆ—表行记录
       */
      getFlowChartImageByApi(record) {
        const { processDefinitionId, processInstanceId, processDefinitionKey } = record
        downFile(this.url.diagramView, {
          processDefinitionId,
          processInstanceId,
          TaskDefinitionKey: processDefinitionKey
        }, 'get')
          .then((res => {
            const urlObject = window.URL.createObjectURL(new Blob([res]))
            that.imageSrc = urlObject
            this.imageSrc = window.URL.createObjectURL(new Blob([res]))
          }))
          .catch(err => {
            that.$notification.error({
            this.$notification.error({
              message: '消息',
              description: res.message
              description: err.message
            })
          })
      },
      /**
       * èŽ·å–å¾…åŠžè®°å½•çš„åŸºæœ¬ä¿¡æ¯
       * @param record å¾…办记录信息
       * èŽ·å–ç»´ä¿®äººæ˜Žç»†
       * @param repairId
       */
      getBasicInformation(record) {
        this.spinning = true
        const that = this
        const param = { id: record.dataId }
        this.tableRowRecord = {}
        this.activeTabKey = '1'
        getAction(this.url.queryBomDataById, param)
          .then((res => {
            if (res.success) {
              that.tableRowRecord = Object.assign({}, res.result, {
                isUseSpare: res.result.isUseSpare === null ? 0 : res.result.isUseSpare,
                imageFiles: JSON.parse(res.result.imageFiles),
                reportImageFiles: JSON.parse(res.result.reportImageFiles)
              })
              console.log('this.tableRowRecord----->', that.tableRowRecord)
            }
          }))
      loadDetail(repairId) {
        getAction(this.url.detail, { repairId })
          .then(res => {
            if (res.success) this.detail.dataSource = res.result
          })
          .finally(() => {
            that.spinning = false
            this.spinning = false
          })
      },
      submitForm() {
        const that = this
@@ -428,41 +276,25 @@
        this.$refs.form.validate(valid => {
          if (valid) {
            that.confirmLoading = that.spinning = true
            const { confirmComment, externalConfirm, externalConfirmComment, repairConfirm, repairConfirmComment, leaderConfirm, leaderConfirmComment, faultReason, repairDescription, imageFiles, equipmentId } = that.tableRowRecord
            const { dataId, id, procInstId, taskDefKey, variables } = that.selectShenpiData
            const flowTaskVo = {}
            flowTaskVo.repairConfirm = repairConfirm
            flowTaskVo.repairConfirmComment = repairConfirmComment
            flowTaskVo.leaderConfirm = leaderConfirm
            flowTaskVo.leaderConfirmComment = leaderConfirmComment
            flowTaskVo.externalConfirm = externalConfirm
            flowTaskVo.externalConfirmComment = externalConfirmComment
            flowTaskVo.confirmComment = confirmComment
            flowTaskVo.faultReason = faultReason
            flowTaskVo.repairDescription = repairDescription
            flowTaskVo.imageFilesResult = imageFiles
            flowTaskVo.equipmentId = equipmentId
            flowTaskVo.id = dataId
            flowTaskVo.dataId = dataId
            flowTaskVo.taskId = id
            flowTaskVo.instanceId = procInstId
            flowTaskVo.targetKey = taskDefKey
            flowTaskVo.values = variables
            console.log('表单提交数据', flowTaskVo)
            httpAction(this.url.approve, flowTaskVo, 'post')
            httpAction(this.url.approve, that.model, 'post')
              .then((res) => {
                if (res.success) {
                  that.$message.success(res.message)
                  that.$notification.success({
                    message: '消息',
                    description: res.message
                  })
                  that.handCancel()
                  that.$emit('searchReset')
                  that.$emit('modalFormOk')
                } else {
                  that.$message.warning(res.message)
                  that.$notification.warning({
                    message: '消息',
                    description: res.message
                  })
                }
              }).finally(() => {
              that.confirmLoading = that.spinning = false
            })
              })
              .finally(() => {
                that.confirmLoading = that.spinning = false
              })
          } else {
            return false
          }
@@ -475,4 +307,27 @@
      }
    }
  }
</script>
</script>
<style scoped lang="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;
          }
        }
      }
    }
  }
</style>