lyh
昨天 4385883dbddc36c5391cccc64021a45530839a6f
产品安全隐患流程与基础
已添加1个文件
已修改3个文件
602 ■■■■ 文件已修改
src/views/eam/repair/EamReportProductHazardsList.vue 147 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/repair/modules/EamReportProductHazardsModal.vue 102 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/flowable/workflow/FlowTodo.vue 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/flowable/workflow/repairOrder/ReportProductHazardsApprovalModal.vue 332 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/repair/EamReportProductHazardsList.vue
@@ -5,42 +5,27 @@
    <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="报修ID">
              <a-input placeholder="请输入报修ID" v-model="queryParam.reportId"></a-input>
          <a-col :xl="6" :lg="7" :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="12">
            <a-form-item label="确认状态">
              <j-dict-select-tag placeholder="请选择确认状态" v-model="queryParam.confirmStatus"
                                 dict-code="confirm_status"/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="设备ID">
              <a-input placeholder="请输入设备ID" v-model="queryParam.equipmentId"></a-input>
            <a-form-item label="产品损失情况">
              <j-dict-select-tag placeholder="请选择产品损失情况" v-model="queryParam.productLoss"
                                 dict-code="yn"/>
            </a-form-item>
          </a-col>
        <template v-if="toggleSearchStatus">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="操作工">
              <a-input placeholder="请输入操作工" v-model="queryParam.confirmer"></a-input>
            </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.confirmTime"></a-input>
            </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.productLoss"></a-input>
            </a-form-item>
          </a-col>
          </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 type="info" @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>
@@ -83,21 +68,22 @@
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        @change="handleTableChange">
        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">编辑</a>
      <span slot="action" slot-scope="text, record">
          <template v-if="record.confirmStatus==='PENDING_SUBMIT'">
             <a @click="handleEdit(record)">编辑</a>
             <a-divider type="vertical"/>
             <a-popconfirm title="确定提交吗?" @confirm="() => handleSubmit(record.id)">
               <a>提交</a>
             </a-popconfirm>
          </template>
          <a-divider type="vertical" />
          <a-dropdown>
            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
            <a-menu slot="overlay">
              <a-menu-item>
                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                  <a>删除</a>
                </a-popconfirm>
              </a-menu-item>
            </a-menu>
          </a-dropdown>
          <a v-else @click="handleDetail(record)">详情</a>
        </span>
        <!--字符串超长截取省略号显示-->
        <span slot="qualityAnalysis" slot-scope="text">
          <j-ellipsis :value="text" :length="8"/>
      </span>
      </a-table>
    </div>
@@ -105,6 +91,10 @@
    <!-- è¡¨å•区域 -->
    <eamReportProductHazards-modal ref="modalForm" @ok="modalFormOk"></eamReportProductHazards-modal>
    <!--审批窗口-->
    <report-product-hazards-approval-modal ref="reportProductHazardsApprovalModal"
                                              :selectShenpiData="selectedRowData"/>
  </a-card>
</template>
@@ -112,11 +102,17 @@
  import '@/assets/less/TableExpand.less'
  import EamReportProductHazardsModal from './modules/EamReportProductHazardsModal'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import {getAction} from "@api/manage";
  import ReportProductHazardsApprovalModal
    from "@views/flowable/workflow/repairOrder/ReportProductHazardsApprovalModal.vue";
  import LxSearchEquipmentSelect from "@views/eam/equipment/modules/LxSearchEquipmentSelect.vue";
  export default {
    name: "EamReportProductHazardsList",
    mixins:[JeecgListMixin],
    components: {
      LxSearchEquipmentSelect,
      ReportProductHazardsApprovalModal,
      EamReportProductHazardsModal
    },
    props: {
@@ -164,10 +160,31 @@
            dataIndex: 'equipmentModel',
            fixed: 'left'
          },
          {
            title: '确认状态',
            align: 'center',
            dataIndex: 'confirmStatus_dictText',
            fixed: 'left'
          },
          {
            title: '批次号',
            align: 'center',
            dataIndex: 'batchNumber'
          },
          {
            title: '加工零件号',
            align: 'center',
            dataIndex: 'processingPart'
          },
          {
            title: '件数',
            align: 'center',
            dataIndex: 'quantity'
          },
               {
            title: '操作工',
            align:"center",
            dataIndex: 'confirmer'
            dataIndex: 'confirmer_dictText'
           },
               {
            title: '操作工确认时间',
@@ -175,19 +192,20 @@
            dataIndex: 'confirmTime'
           },
               {
            title: '产品损失情况;是 å¦',
            title: '产品损失情况',
            align:"center",
            dataIndex: 'productLoss'
            dataIndex: 'productLoss_dictText'
           },
               {
            title: '产品损失质量影响分析',
            align:"center",
            dataIndex: 'qualityAnalysis'
            dataIndex: 'qualityAnalysis',
            scopedSlots: { customRender: 'qualityAnalysis' }
           },
               {
            title: '主管工艺',
            align:"center",
            dataIndex: 'technologist'
            dataIndex: 'technologist_dictText'
           },
               {
            title: '主管工艺确认时间',
@@ -202,7 +220,7 @@
               {
            title: '部级领导',
            align:"center",
            dataIndex: 'deputyDepartment'
            dataIndex: 'deputyDepartment_dictText'
           },
               {
            title: '部级领导确认时间',
@@ -215,13 +233,14 @@
            dataIndex: 'deputyDepartmentComment'
           },
        ],
        selectRepairOrderData: {},
        selectedRowData: {},
            url: {
          list: "/eam/eamReportProductHazards/list",
          delete: "/eam/eamReportProductHazards/delete",
          deleteBatch: "/eam/eamReportProductHazards/deleteBatch",
          exportXlsUrl: "eam/eamReportProductHazards/exportXls",
          importExcelUrl: "eam/eamReportProductHazards/importExcel",
          submit:"/eam/eamReportProductHazards/submit",
       },
    }
  },
@@ -241,7 +260,41 @@
      this.loadData(1)
    },
    methods: {
      /**
       * ç‚¹å‡»æäº¤æ—¶è§¦å‘
       * @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
            }
          })
      },
      /**
       * ç‚¹å‡»è¯¦æƒ…时触发时触发
       * @param record
       */
      handleDetail(record) {
        this.selectedRowData = Object.assign({}, record)
        this.$refs.reportProductHazardsApprovalModal.title = '详情'
        this.$refs.reportProductHazardsApprovalModal.disableSubmit = true
        this.$refs.reportProductHazardsApprovalModal.visible = true
        this.$refs.reportProductHazardsApprovalModal.handleDetail(record)
      }
    }
  }
</script>
src/views/eam/repair/modules/EamReportProductHazardsModal.vue
@@ -1,54 +1,40 @@
<template>
  <j-modal
    :title="title"
    :width="800"
    :visible="visible"
    :confirmLoading="confirmLoading"
    switchFullscreen
    @ok="handleOk"
    @cancel="handleCancel"
    cancelText="关闭">
  <j-modal :title="title" :width="1200" :visible="visible" :confirmLoading="confirmLoading" switchFullscreen
           @ok="handleOk" @cancel="handleCancel" cancelText="关闭">
    <a-spin :spinning="confirmLoading">
      <a-form-model ref="form" :model="model" :rules="validatorRules">
        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="reportId" label="报修ID">
          <a-input placeholder="请输入报修ID" v-model="model.reportId" />
        </a-form-model-item>
        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId" label="设备ID">
          <a-input placeholder="请输入设备ID" v-model="model.equipmentId" />
        </a-form-model-item>
        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmer" label="操作工">
          <a-input placeholder="请输入操作工" v-model="model.confirmer" />
        </a-form-model-item>
        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmTime" label="操作工确认时间">
          <a-input placeholder="请输入操作工确认时间" v-model="model.confirmTime" />
        </a-form-model-item>
        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productLoss" label="产品损失情况;是 å¦">
          <a-input placeholder="请输入产品损失情况;是 å¦" v-model="model.productLoss" />
        </a-form-model-item>
        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="qualityAnalysis" label="产品损失质量影响分析">
          <a-input placeholder="请输入产品损失质量影响分析" v-model="model.qualityAnalysis" />
        </a-form-model-item>
        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="technologist" label="主管工艺">
          <a-input placeholder="请输入主管工艺" v-model="model.technologist" />
        </a-form-model-item>
        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="technologistTime" label="主管工艺确认时间">
          <a-input placeholder="请输入主管工艺确认时间" v-model="model.technologistTime" />
        </a-form-model-item>
        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="technologistComment" label="主管工艺确认意见">
          <a-input placeholder="请输入主管工艺确认意见" v-model="model.technologistComment" />
        </a-form-model-item>
        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deputyDepartment" label="部级领导">
          <a-input placeholder="请输入部级领导" v-model="model.deputyDepartment" />
        </a-form-model-item>
        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deputyDepartmentTime" label="部级领导确认时间">
          <a-input placeholder="请输入部级领导确认时间" v-model="model.deputyDepartmentTime" />
        </a-form-model-item>
        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deputyDepartmentComment" label="部级领导确认意见">
          <a-input placeholder="请输入部级领导确认意见" v-model="model.deputyDepartmentComment" />
        </a-form-model-item>
      <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="batchNumber">
              <a-input placeholder="请输入批次号" v-model="model.batchNumber"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="customSpan">
            <a-form-model-item label="加工零件号" prop="processingPart">
              <a-input 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  placeholder="请输入件数" v-model="model.quantity"
                              :min="0" style="width: 100%"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="customSpan">
            <a-form-model-item prop="productLoss" label="产品损失情况">
            <j-dict-select-tag dict-code="yn" type="radio"
                               placeholder="请输入产品损失情况"
                               v-model="model.productLoss"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item :labelCol="labelColLong"
                               :wrapperCol="wrapperColLong" prop="qualityAnalysis" label="产品损失质量影响分析">
              <a-textarea placeholder="请输入产品损失质量影响分析" v-model="model.qualityAnalysis"/>
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-form-model>
    </a-spin>
  </j-modal>
@@ -64,18 +50,32 @@
      return {
        title:"操作",
        visible: false,
        customSpan: 6,
        model: {},
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
          sm: { span: 9 }
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
          sm: { span: 12 }
        },
        labelColLong: {
          xs: { span: 24 },
          sm: { span: 3 }
        },
        wrapperColLong: {
          xs: { span: 24 },
          sm: { span: 20 }
        },
        confirmLoading: false,
        validatorRules:{
          batchNumber: [{ required: true, message: '请输入批次号', trigger: 'change' }],
          processingPart: [{ required: true, message: '请输入加工零件号', trigger: 'change' }],
          quantity: [{ required: true, message: '请输入件数', trigger: 'change' }],
          productLoss: [{ required: true, message: '请输入产品损失情况', trigger: 'change' }],
          qualityAnalysis: [{ required: true, message: '请输入产品损失质量影响分析', trigger: 'change' }],
        },
        url: {
          add: "/eam/eamReportProductHazards/add",
src/views/flowable/workflow/FlowTodo.vue
@@ -135,6 +135,11 @@
    <report-accidents-register-approval-modal ref="reportAccidentsRegisterApprovalModal"
                                              :selectShenpiData="selectedRowData"
                                              @modalFormOk="modalFormOk"/>
    <!--产品安全确认-->
    <eam-report-product-hazards-modal ref="reportProductHazardsApprovalModal"
                                                :selectShenpiData="selectedRowData"
                                                @modalFormOk="modalFormOk"/>
  </a-card>
</template>
@@ -157,11 +162,13 @@
  import ThirdMaintenanceOrderChangeApprovalModal from './thirdMaintenance/ThirdMaintenanceOrderChangeApprovalModal'
  import ThirdMaintenanceFurnaceApprovalModal from './thirdMaintenance/ThirdMaintenanceFurnaceApprovalModal'
  import ReportAccidentsRegisterApprovalModal from './repairOrder/ReportAccidentsRegisterApprovalModal'
  import EamReportProductHazardsModal from "./repairOrder/ReportProductHazardsApprovalModal.vue";
  export default {
    name: 'FlowTodo',
    mixins: [JeecgListMixin],
    components: {
      EamReportProductHazardsModal,
      ReportAccidentsRegisterApprovalModal,
      ThirdMaintenanceFurnaceApprovalModal,
      ThirdMaintenanceOrderChangeApprovalModal,
@@ -295,6 +302,9 @@
            break
          case 'eam_report_accidents_register':
            this.handleAccidentsRegister(record)
            break
          case 'eam_report_product_hazards':
            this.handleProductHazard(record)
            break
          default:
            alert('没找到该流程')
@@ -444,6 +454,17 @@
        this.$refs.reportAccidentsRegisterApprovalModal.handleApprove(record)
      },
      /**
       * ç‚¹å‡»äº§å“å®‰å…¨é𐿂£ç¡®è®¤æµç¨‹å®¡æ‰¹æ—¶è§¦å‘
       * @param record
       */
      handleProductHazard(record){
        this.selectedRowData = Object.assign({}, record)
        this.$refs.reportProductHazardsApprovalModal.visible = true
        this.$refs.reportProductHazardsApprovalModal.title = record.name
        this.$refs.reportProductHazardsApprovalModal.handleApprove(record)
      },
      batchHandle() {
        const categorySet = new Set(this.selectionRows.map(item => item.category))
        const nameSet = new Set(this.selectionRows.map(item => item.name))
src/views/flowable/workflow/repairOrder/ReportProductHazardsApprovalModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,332 @@
<template>
  <j-modal :title="title" :visible="visible" :confirmLoading="confirmLoading" :width="1300"
           :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" fullscreen @ok="handleOk"
           @cancel="handleCancel" centered cancelText="关闭">
    <a-spin :spinning="spinning">
      <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol">
        <a-row id="outer-row" :gutter="24">
          <!--左侧基础信息列-->
          <a-col :span="selectShenpiData.procInstId?8:12" class="scroll-col">
            <a-tabs>
              <a-tab-pane tab="基础信息">
                <a-row>
                  <a-col :span="12">
                    <a-form-model-item label="统一编码">
                      <lx-search-equipment-select v-model="model.equipmentId" disabled/>
                    </a-form-model-item>
                  </a-col>
                  <a-col :span="12">
                    <a-form-model-item label="批次号">
                      <a-input v-model="model.batchNumber" readOnly/>
                    </a-form-model-item>
                  </a-col>
                </a-row>
                <a-row>
                  <a-col :span="12">
                    <a-form-model-item label="加工零件号">
                      <a-input v-model="model.processingPart" readOnly/>
                    </a-form-model-item>
                  </a-col>
                  <a-col :span="12">
                    <a-form-model-item label="件数">
                      <a-input-number v-model="model.quantity" disabled/>
                    </a-form-model-item>
                  </a-col>
                </a-row>
                <a-row>
                  <a-col :span="12">
                    <a-form-model-item label="产品损失情况">
                      <j-dict-select-tag dict-code="yn" type="radio" v-model="model.productLoss" disabled/>
                    </a-form-model-item>
                  </a-col>
                </a-row>
                <a-row>
                  <a-col :span="24">
                    <a-form-model-item label="产品损失质量影响分析" :labelCol="labelColLong" :wrapperCol="wrapperColLong">
                      <a-textarea v-model="model.qualityAnalysis" readOnly/>
                    </a-form-model-item>
                  </a-col>
                </a-row>
              </a-tab-pane>
            </a-tabs>
          </a-col>
          <!-- ä¸­é—´æ˜Žç»†é¡¹åˆ—-->
          <a-col v-if="selectShenpiData.procInstId" :span="10" class="scroll-col">
            <a-tabs default-active-key="1">
              <a-tab-pane key='1' tab='流程图'>
                <img :src="imageSrc" v-if="imageSrc" style="width: 100%"/>
              </a-tab-pane>
            </a-tabs>
          </a-col>
          <!--右侧审批列-->
          <a-col :span="selectShenpiData.procInstId?6:12" class="scroll-col">
            <a-tabs v-if="displayRegionalManagerFlag">
              <a-tab-pane tab="主管工艺确认">
                <a-row>
                  <a-col :span="24">
                    <a-form-model-item prop="technologistResult" label="确认类型"
                                       :labelCol="rightColLabelCol" :wrapperCol="rightColWrapperCol">
                      <j-dict-select-tag type='radio' v-model='model.technologistResult'
                                         dictCode='approve_reject'
                                         :disabled="disableSubmit||(model.confirmStatus&&model.confirmStatus!=='PENDING_SUPERIOR_TECHNICAL_CONFIRMATION')"/>
                    </a-form-model-item>
                  </a-col>
                  <a-col :span="24">
                    <a-form-model-item label="确认意见" :labelCol="rightColLabelCol" :wrapperCol="rightColWrapperCol">
                      <a-textarea placeholder="请输入意见" v-model="model.technologistComment"
                                  :disabled="disableSubmit||(model.confirmStatus&&model.confirmStatus!=='PENDING_SUPERIOR_TECHNICAL_CONFIRMATION')"/>
                    </a-form-model-item>
                  </a-col>
                </a-row>
              </a-tab-pane>
            </a-tabs>
            <a-tabs v-if="displayRepairRegionalManagerFlag">
              <a-tab-pane tab="副部级领导确认">
                <a-row>
                  <a-col :span="24">
                    <a-form-model-item prop="deputyDepartmentResult" label="确认类型"
                                       :labelCol="rightColLabelCol" :wrapperCol="rightColWrapperCol">
                      <j-dict-select-tag type='radio' v-model='model.deputyDepartmentResult'
                                         dictCode='approve_reject'
                                         :disabled="disableSubmit||(model.confirmStatus&&model.confirmStatus!=='PENDING_DEPARTMENT_LEADER_CONFIRMATION')"/>
                    </a-form-model-item>
                  </a-col>
                  <a-col :span="24">
                    <a-form-model-item label="确认意见" :labelCol="rightColLabelCol" :wrapperCol="rightColWrapperCol">
                      <a-textarea placeholder="请输入意见" v-model="model.deputyDepartmentComment"
                                  :disabled="disableSubmit||(model.confirmStatus&&model.confirmStatus!=='PENDING_DEPARTMENT_LEADER_CONFIRMATION')"/>
                    </a-form-model-item>
                  </a-col>
                </a-row>
              </a-tab-pane>
            </a-tabs>
          </a-col>
        </a-row>
      </a-form-model>
    </a-spin>
  </j-modal>
</template>
<script>
  import { downFile, getAction, httpAction } from '@/api/manage'
  import TechnicalStatusEquipmentSelect from '../../../eam/equipment/modules/TechnicalStatusEquipmentSelect'
  import LxSearchEquipmentSelect from '../../../eam/equipment/modules/LxSearchEquipmentSelect'
  export default {
    name: 'reportProductHazardsApprovalModal',
    components: {
      LxSearchEquipmentSelect,
      TechnicalStatusEquipmentSelect
    },
    props: {
      selectShenpiData: {
        type: Object
      }
    },
    data() {
      return {
        title: '操作',
        visible: false,
        model: {},
        labelCol: {
          xs: { span: 24 },
          sm: { span: 10 }
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 14 }
        },
        labelColLong: {
          xs: { span: 24 },
          sm: { span: 5 }
        },
        wrapperColLong: {
          xs: { span: 24 },
          sm: { span: 19 }
        },
        rightColLabelCol: {
          xs: { span: 24 },
          sm: { span: 8 }
        },
        rightColWrapperCol: {
          xs: { span: 24 },
          sm: { span: 15 }
        },
        confirmLoading: false,
        spinning: false,
        imageSrc: null,
        validatorRules: {
          technicalDirectorLeaderResult: [{ required: true, message: '请选择确认类型' }],
          technicalDirectorPartResult: [{ required: true, message: '请选择确认类型' }]
        },
        url: {
          queryById: '/eam/eamReportProductHazards/queryById',
          approval: '/eam/eamReportProductHazards/perform',
          diagramView: '/assign/flow/diagramView'
        },
        disableSubmit: false
      }
    },
    computed: {
      displayRegionalManagerFlag() {
        return this.model.confirmStatus && ['PENDING_SUPERIOR_TECHNICAL_CONFIRMATION', 'PENDING_DEPARTMENT_LEADER_CONFIRMATION','REPAIR_COMPLETED', 'REJECTED'].includes(this.model.confirmStatus)
      },
      displayRepairRegionalManagerFlag() {
        return this.model.confirmStatus && ['PENDING_DEPARTMENT_LEADER_CONFIRMATION','REPAIR_COMPLETED', 'REJECTED'].includes(this.model.confirmStatus)
      },
    },
    methods: {
      /**
       * ä¸»é¡µé¢ç‚¹å‡»æ‰§è¡Œå®¡æ‰¹æ—¶è§¦å‘
       * @param record ä¸»é¡µé¢åˆ—表行记录
       */
      async handleApprove(record) {
        this.model = {}
        this.getBasicInformationByApi(record)
        this.getFlowChartImageByApi(record)
      },
      /**
       * ä¸»é¡µé¢ç‚¹å‡»è¯¦æƒ…时触发
       * @param record ä¸»é¡µé¢åˆ—表行记录
       */
      handleDetail(record) {
        this.model = Object.assign({}, record)
      },
      /**
       * èŽ·å–åŸºç¡€ä¿¡æ¯
       * @param record ä¸»é¡µé¢åˆ—表行记录
       */
      getBasicInformationByApi(record) {
        this.spinning = true
        const that = this
        getAction(this.url.queryById, { id: record.dataId })
          .then(res => {
            if (res.success) {
              that.model = Object.assign({}, res.result, { repairConfirmResult: '1' })
              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
              })
            }
          })
          .finally(() => {
            that.spinning = false
          })
      },
      /**
       * èŽ·å–æµç¨‹å›¾
       * @param record ä¸»é¡µé¢åˆ—表行记录
       */
      getFlowChartImageByApi(record) {
        const { processDefinitionId, processInstanceId, processDefinitionKey } = record
        downFile(this.url.diagramView, {
          processDefinitionId,
          processInstanceId,
          TaskDefinitionKey: processDefinitionKey
        }, 'get')
          .then((res => {
            this.imageSrc = window.URL.createObjectURL(new Blob([res]))
          }))
          .catch(err => {
            this.$notification.error({
              message: '消息',
              description: err.message
            })
          })
      },
      async handleOk() {
        const that = this
        // è§¦å‘表单验证
        this.$refs.form.validate(valid => {
          if (valid) {
            that.confirmLoading = that.spinning = true
            httpAction(that.url.approval, that.model, 'post')
              .then((res) => {
                if (res.success) {
                  that.$notification.success({
                    message: '消息',
                    description: res.message
                  })
                  that.$emit('modalFormOk')
                  that.close()
                } else {
                  that.$notification.warning({
                    message: '消息',
                    description: res.message
                  })
                }
              })
              .finally(() => {
                that.confirmLoading = that.spinning = false
              })
          } else {
            return false
          }
        })
      },
      /**
       * åŽŸå› åˆ†æžæ ¸å¯¹å€¼å‘ç”Ÿæ”¹å˜æ—¶è§¦å‘
       * @param value
       */
      handleCheckAgreeChange(value) {
        if (value === '1') delete this.model.disagreeReason
      },
      handleCancel() {
        this.close()
      },
      close() {
        this.$emit('close')
        this.visible = false
        if (this.$refs.form) this.$refs.form.clearValidate()
      }
    }
  }
</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>