zhangherong
2025-06-02 f3c4270223d6349c16c1d0e4c20c7c146b2dfd0d
src/views/flowable/workflow/InspectionOrder/InspectionOrderHandle.vue
@@ -23,10 +23,23 @@
            </a-form-model-item>
          </a-col>
          <a-col :span='span'>
            <a-form-model-item label="工单状态">
              <a-input readOnly v-model="tableRowRecord.inspectionStatus_dictText"/>
            </a-form-model-item>
          </a-col>
          <a-col :span='span'>
            <a-form-model-item label="设备编号">
              <MaintenanceEquipmentSelect v-model="tableRowRecord.equipmentId"
                                          :maintenanceCategory="'POINT_INSPECTION'" disabled
                                          @autocompleteForm="autoCompleteForm"/>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row>
          <a-col :span='span'>
            <a-form-model-item label="安装位置">
              <a-input readOnly v-model="tableRowRecord.installationPosition_dictText"/>
            </a-form-model-item>
          </a-col>
          <a-col :span='span'>
@@ -34,12 +47,17 @@
              <a-input readOnly v-model="tableRowRecord.standardName"/>
            </a-form-model-item>
          </a-col>
          <a-col :span='span'>
            <a-form-model-item label="标准编码">
              <a-input readOnly v-model="tableRowRecord.standardCode"/>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row>
          <a-col :span='span'>
            <a-form-model-item label="标准编码">
              <a-input readOnly v-model="tableRowRecord.standardCode"/>
            <a-form-model-item label="保养周期">
              <a-input v-model="tableRowRecord.maintenancePeriod" readOnly/>
            </a-form-model-item>
          </a-col>
          <a-col :span='span'>
@@ -55,14 +73,20 @@
        </a-row>
        <a-row>
          <a-col :span='span'>
            <a-form-model-item label="保养周期">
              <a-input v-model="tableRowRecord.maintenancePeriod" readOnly/>
            <a-form-model-item label="点检人">
              <a-input v-model="tableRowRecord.operator_dictText" readOnly/>
            </a-form-model-item>
          </a-col>
          <a-col :span='span'>
            <a-form-model-item label="点检人">
              <a-input v-model="tableRowRecord.operator" readOnly/>
            <a-form-model-item label="点检人电话">
              <a-input v-model="tableRowRecord.operatorPhone_dictText" readOnly/>
            </a-form-model-item>
          </a-col>
          <a-col :span='span'>
            <a-form-model-item label="作业指导">
              <a-button  @click="handlePreview(tableRowRecord.referenceFile)" type="primary" icon="eye">预览</a-button>
            </a-form-model-item>
          </a-col>
        </a-row>
@@ -119,7 +143,7 @@
              <template v-slot:reportFlag="props">
                <j-dict-select-tag v-model="props.row.reportFlag"
                                   :placeholder="props.row.inspectionResult==='2'?'请选择异常是否保修':''"
                                   :placeholder="props.row.inspectionResult==='2'?'请选择异常是否报修':''"
                                   :disabled="isDisableOperation||!props.row.inspectionResult||props.row.inspectionResult==='1'"
                                   dictCode="yn"
                                   style="width: 100%"/>
@@ -145,7 +169,7 @@
            </a-tab-pane>
            <a-tab-pane key='3' tab='流程图'>
              <img :src="imageSrc" alt="Fetched Image"/>-->
              <img :src="imageSrc" alt="Fetched Image"/>
            </a-tab-pane>
          </template>
@@ -190,6 +214,8 @@
        </template>
      </a-form-model>
    </a-spin>
    <lx-file-preview ref="lxFilePreview" :fileUrl="fileUrl"></lx-file-preview>
  </j-modal>
</template>
@@ -236,10 +262,12 @@
        visible: false,
        // 表头
        url: {
          queryBomDataById: '/eam/eamInspectionOrder/selectVoById',
          // queryBomDataById: '/eam/eamInspectionOrder/selectVoById',
          diagramView: '/assign/flow/diagramView',
          queryHisTaskList: '/assign/flow/queryHisTaskList',
          approve: '/eam/eamInspectionOrder/approval'
          approve: '/eam/eamInspectionOrder/approval',
          queryById: '/eam/eamInspectionOrder/queryById',
          detailList: '/eam/eamInspectionOrderDetail/queryList'
        },
        detail: {
          loading: false,
@@ -307,7 +335,8 @@
        selectedRowKeys: [],
        disableSubmit: false,
        activeTabKey: '1',
        title: ''
        title: '',
        fileUrl: '',
      }
    },
    computed: {
@@ -356,22 +385,18 @@
       * 获取待办记录的基本信息
       * @param record 待办记录信息
       */
      getBasicInformation(record) {
      async getBasicInformation(record) {
        this.activeTabKey = '1'
        this.tableRowRecord = {}
        this.detail.dataSource = []
        this.spinning = true
        const param = { id: record.dataId }
        const that = this
        getAction(this.url.queryBomDataById, param)
          .then((res => {
            if (res.success) {
              that.tableRowRecord = { ... res.result[0], fileList: JSON.parse(res.result[0].imageFiles) }
              if (!this.hasInspectionDateArrived && !this.disableSubmit) this.title += `(未到点检日期不能提前点检)`
              that.detail.dataSource = res.result[0].tableDetailList
              console.log('that.tableRowRecord----->', that.tableRowRecord)
            }
          }))
        let res = await getAction(this.url.queryById, param);
        this.tableRowRecord = Object.assign({}, res.result);
        if (this.tableRowRecord.imageFiles) {
          let obj = JSON.parse(this.tableRowRecord.imageFiles)
          this.tableRowRecord.fileList = [...obj]
        }
        await this.loadDetail(record.dataId)
      },
      async submitForm() {
@@ -416,11 +441,11 @@
        })
      },
      autoCompleteForm({ standardName, maintenancePeriod, standardCode }) {
      autoCompleteForm({ standardName, maintenancePeriod, standardCode, referenceFile }) {
        this.$set(this.tableRowRecord, 'standardName', standardName)
        this.$set(this.tableRowRecord, 'maintenancePeriod', maintenancePeriod)
        this.$set(this.tableRowRecord, 'standardCode', standardCode)
        this.spinning = false
        this.$set(this.tableRowRecord, 'referenceFile', referenceFile)
      },
      // 批量选择所有点检结果
@@ -470,16 +495,38 @@
      handleCancel() {
        this.selectedRowKeys = []
        this.visible = false
      }
      },
      //标准选择变化
      loadDetail(orderId) {
        if (orderId) {
          getAction(this.url.detailList, { orderId: orderId })
            .then(res => {
              if (res.success) {
                this.detail.dataSource = [...res.result]
              }
            })
            .finally(() => {
              this.spinning = false
            })
        }
      },
      handlePreview: function (fileJson) {
        if(fileJson) {
          let obj = JSON.parse(fileJson)
          if(obj.filePath) {
            this.$refs.lxFilePreview.preview(obj.filePath);
          }else {
            that.$message.warning('没有上传操作指导图片')
          }
        }else {
          that.$message.warning('没有上传操作指导图片')
        }
      },
    }
  }
</script>
<style scoped>
  .btn-custom {
    background-color: #4CAF50; /* 绿色背景 */
    color: #fff; /* 白色文字 */
  }
  /deep/ .ant-select-dropdown-menu {
    text-align: left;
  }