zhaowei
6 天以前 a4674a75bfffc500a049beafb74daaec50c8f87f
src/views/eam/maintenance/modules/EamSecondMaintenanceOrderModal.vue
@@ -1,7 +1,6 @@
<template>
  <j-modal :title="title" :width="1200" :visible="visible" :confirmLoading="confirmLoading" switchFullscreen
  <j-modal :title="title" :width="1200" :visible="visible" :confirmLoading="confirmLoading" switchFullscreen centered
           :mask-closable="false" @ok="handleOk" @cancel="handleCancel" cancelText="关闭">
    <a-spin :spinning="spinning">
      <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol">
        <a-row>
@@ -26,12 +25,13 @@
        <a-row>
          <a-col :span="8">
            <a-form-model-item prop="maintenanceDate" label="保养日期">
              <a-date-picker v-model="model.maintenanceDate" value-format="YYYY-MM-DD" style="width: 100%"/>
              <a-date-picker v-model="model.maintenanceDate" value-format="YYYY-MM-DD" :allowClear="false"
                             style="width: 100%"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item label="保养周期">
              <a-input placeholder="选择设备后自动带出" v-model="model.maintenancePeriod" disabled/>
              <a-input v-model="model.maintenancePeriod" disabled/>
            </a-form-model-item>
          </a-col>
        </a-row>
@@ -68,7 +68,7 @@
      return {
        title: '操作',
        visible: false,
        editable: false,
        editable: true,
        model: {},
        labelCol: {
          xs: { span: 24 },
@@ -105,7 +105,6 @@
        detail: {
          operatorMaintenanceList: [],
          repairerMaintenanceList: [],
          dataSource: [],
          columns: [
            {
              title: 'ID',
@@ -144,7 +143,7 @@
      },
      edit(record) {
        this.model = Object.assign({}, record)
        this.model = Object.assign({ maintenancePeriod: 6 }, record)
        this.visible = true
        this.editable = false
        this.detail.operatorMaintenanceList = this.detail.repairerMaintenanceList = []
@@ -163,19 +162,17 @@
       * @param standardId 规范Id
       */
      loadStandardDetail(standardId) {
        if (standardId) {
          this.spinning = true
          getAction(this.url.standardDetail, { standardId })
            .then(res => {
              if (res.success) {
                this.detail.operatorMaintenanceList = res.result.filter(item => item.itemCategory == 'OPERATOR_MAINTENANCE')
                this.detail.repairerMaintenanceList = res.result.filter(item => item.itemCategory == 'REPAIRER_MAINTENANCE')
              }
            })
            .finally(() => {
              this.spinning = false
            })
        }
        this.spinning = true
        getAction(this.url.standardDetail, { standardId })
          .then(res => {
            if (res.success) {
              this.detail.operatorMaintenanceList = res.result.filter(item => item.itemCategory == 'OPERATOR_MAINTENANCE')
              this.detail.repairerMaintenanceList = res.result.filter(item => item.itemCategory == 'REPAIRER_MAINTENANCE')
            }
          })
          .finally(() => {
            this.spinning = false
          })
      },
      /**
@@ -183,14 +180,17 @@
       * @param orderId 工单Id
       */
      loadDetail(orderId) {
        if (orderId) {
          getAction(this.url.detail, { orderId })
            .then(res => {
              if (res.success) {
                this.detail.dataSource = [...res.result]
              }
            })
        }
        this.spinning = true
        getAction(this.url.detail, { orderId })
          .then(res => {
            if (res.success) {
              this.detail.operatorMaintenanceList = res.result.filter(item => item.itemCategory == 'OPERATOR_MAINTENANCE')
              this.detail.repairerMaintenanceList = res.result.filter(item => item.itemCategory == 'REPAIRER_MAINTENANCE')
            }
          })
          .finally(() => {
            this.spinning = false
          })
      },
      async handleOk() {