zhangherong
2025-05-27 ae36cbb17356f8f92c7bc5920e1b50789725317c
art: 设备管理-三保-审批页面
已修改1个文件
156 ■■■■ 文件已修改
src/views/flowable/workflow/thirdMaintenance/ThirdMaintenanceApprovalModal.vue 156 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/flowable/workflow/thirdMaintenance/ThirdMaintenanceApprovalModal.vue
@@ -74,7 +74,7 @@
        </a-divider>
        <a-row :gutter="24">
          <a-tabs v-model="activeTabKey">
            <a-tab-pane key="1" tab="保养项明细">
            <a-tab-pane key="1" tab="保养项明细" v-if="!isPrecisionCheck">
              <j-vxe-table
                ref="editableDetailTable"
                :rowNumber="false"
@@ -110,6 +110,25 @@
                </template>
              </j-vxe-table>
            </a-tab-pane>
            <a-tab-pane key='4' tab='精度检验' v-if="!isMaintenance">
              <j-vxe-table
                ref="editablePrecisionDetailTable"
                :rowNumber="true"
                :rowSelection="true"
                :bordered="true"
                :alwaysEdit="true"
                :toolbar="false"
                :toolbarConfig="precisionDetail.toolbarConfig"
                keep-source
                :height="300"
                :dataSource="precisionDetail.dataSource"
                :columns="precisionDetail.columns"
                style="margin-top: 8px;" >
                <template v-slot:actualValue="props">
                  <a-input-number v-model="props.row.actualValue" :disabled="disableSubmit || confirmDisable" style="width: 100%" />
                </template>
              </j-vxe-table>
            </a-tab-pane>
            <template v-if="selectShenpiData.procInstId">
              <a-tab-pane key='2' tab='流程节点'>
                <a-card :bordered="false">
@@ -139,14 +158,8 @@
          <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="confirmDealType" label="确认类型">
                <j-dict-select-tag type='radio' v-model='model.confirmDealType' dictCode='approved_rejected'
                                   placeholder="请选择处理类型" :disabled="disableSubmit || leaderConfirmDisable"/>
              </a-form-model-item>
            </a-col>
            <a-col :span="12">
              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmComment" label="确认意见">
            <a-col :span="24">
              <a-form-model-item :labelCol="labelColLong" :wrapperCol="wrapperColLong" prop="confirmComment" label="确认意见">
                <a-textarea placeholder="请输入意见" v-model="model.confirmComment"
                            :disabled="disableSubmit || leaderConfirmDisable"/>
              </a-form-model-item>
@@ -222,9 +235,6 @@
        imageSrc: null,
        activeTabKey: '1',
        validatorRules: {
          confirmDealType: [
            { required: true, message: '请选择通过或驳回!' }
          ],
          confirmComment: [
            { required: true, message: '请输入确认意见!' }
          ],
@@ -238,7 +248,8 @@
          approval: '/eam/thirdMaintenanceOrder/approval',
          userSelect: '/eam/user_select/list',
          queryHisTaskList: '/assign/flow/queryHisTaskList',
          diagramView: '/assign/flow/diagramView'
          diagramView: '/assign/flow/diagramView',
          precisionCheckDetail: '/eam/precisionCheckDetail/queryList',
        },
        disableSubmit: false,
        taskData: [],
@@ -327,6 +338,70 @@
            // add 新增按钮;remove 删除按钮;clearSelection 清空选择按钮
            btn: ['clearSelection']
          }
        },
        precisionDetail: {
          loading: false,
          dataSource: [],
          columns: [
            {
              title: 'ID',
              key: 'id',
              type: JVXETypes.hidden
            },
            {
              title: 'orderId',
              key: 'orderId',
              type: JVXETypes.hidden
            },
            {
              title: 'equipmentId',
              key: 'equipmentId',
              type: JVXETypes.hidden
            },
            {
              title: 'parameterId',
              key: 'parameterId',
              type: JVXETypes.hidden
            },
            {
              title: '检测项目',
              key: 'parameterId_dictText',
              type: JVXETypes.normal,
              width: '25%',
              align: 'center'
            },
            {
              title: '参数编码',
              key: 'parameterCode_dictText',
              type: JVXETypes.normal,
              width: '20%',
              align: 'center',
            },
            {
              title: '允差值',
              key: 'parameterValue',
              type: JVXETypes.normal,
              width: '15%',
              align: 'center',
            },
            {
              title: '实测值',
              key: 'actualValue',
              type: JVXETypes.slot,
              width: '15%',
              align: 'center',
              slotName: 'actualValue',
              validateRules: [
                { required: true, message: '请输入实测值!' }
              ]
            }
          ],
          toolbarConfig: {
            // prefix 前缀;suffix 后缀
            slot: ['prefix', 'suffix'],
            // add 新增按钮;remove 删除按钮;clearSelection 清空选择按钮
            btn: ['add', 'remove', 'clearSelection']
          }
        }
      }
    },
@@ -341,11 +416,21 @@
      },
      completionDisable: function() {
        return ['COMPLETE', 'ABOLISH'].includes(this.model.maintenanceStatus)
      }
      },
      isMaintenance: function() {
        return this.selectShenpiData && this.selectShenpiData.taskDefKey === 'maintenance_execution';
      },
      isPrecisionCheck: function() {
        return this.selectShenpiData && this.selectShenpiData.taskDefKey === 'precision_check';
      },
    },
    methods: {
      async handleDetail(item) {
        this.initParams()
        //重新计算defaultKey
        if(item && item.taskDefKey === 'precision_check') {
          this.activeTabKey = '4';
        }
        this.model = {}
        if (item.procInstId) {
          const { processDefinitionId, processInstanceId, processDefinitionKey, procInstId } = item
@@ -381,6 +466,7 @@
        this.model.instanceId = item.procInstId
        this.model.values = item.variables
        await this.loadDetail(item.dataId)
        await this.loadPrecisionDetail(item.dataId);
      },
      recordDetail(record) {
@@ -392,28 +478,40 @@
          this.model.imageFilesResult = [...obj]
        }
        this.loadDetail(record.id)
        this.loadPrecisionDetail(record.id);
      },
      initParams() {
        this.detail.dataSource = []
        this.visible = true
        this.activeTabKey = '1'
        this.activeTabKey = '1';
        if(this.selectShenpiData &&  this.selectShenpiData.taskDefKey === 'precision_check') {
          this.activeTabKey = '4';
        }
        this.spinning = true
      },
      async handleOk() {
        const that = this
        let errMap = await that.$refs.editableDetailTable.validateTable()
        if (errMap) {
          this.$message.warning('数据校验失败!')
          return
        if(that.$refs.editableDetailTable) {
          let errMap = await that.$refs.editableDetailTable.validateTable()
          if (errMap) {
            this.$message.warning('数据校验失败!')
            return
          }
        }
        // 触发表单验证
        this.$refs.form.validate(valid => {
          if (valid) {
            that.confirmLoading = that.spinning = true
            let tableData = that.$refs.editableDetailTable.getTableData()
            let tableData = [];
            let precisionTableData = [];
            if(that.$refs.editableDetailTable) {
              tableData = that.$refs.editableDetailTable.getTableData()
            }
            if(that.$refs.editablePrecisionDetailTable) {
              precisionTableData = that.$refs.editablePrecisionDetailTable.getTableData()
            }
            that.model.tableDetailList = [...tableData]
            that.model.precisionDetailList = [...precisionTableData]
            let httpurl = this.url.approval
            let method = 'put'
@@ -433,7 +531,6 @@
          }
        })
      },
      autocompleteForm(selectObj) {
        this.$set(this.model, 'standardName', selectObj.standardName)
        this.$set(this.model, 'maintenancePeriod', selectObj.maintenancePeriod)
@@ -445,7 +542,6 @@
        }
        this.loadMaintenanceOperatorList(this.model.equipmentId)
      },
      //标准选择变化
      loadDetail(orderId) {
        if (orderId) {
@@ -460,7 +556,15 @@
            })
        }
      },
      loadPrecisionDetail(orderId) {
        if (orderId) {
          getAction(this.url.precisionCheckDetail, { orderId: orderId }).then(res => {
            if (res.success) {
              this.precisionDetail.dataSource = [...res.result]
            }
          })
        }
      },
      loadMaintenanceOperatorList(equipmentId) {
        this.maintenanceOperatorOptions = []
        let params = { positionCode: 'PCR0001' }
@@ -477,12 +581,10 @@
          }
        })
      },
      handleInspectionResultSelectChange(value, record) {
        if (record.exceptionDescription) delete record.exceptionDescription
        if (record.reportFlag) delete record.reportFlag
      },
      // 批量选择所有点检结果
      handleSelectAllInspectionResult() {
        this.selectedRowKeys.forEach(key => {