zhaowei
2 天以前 9f7fc23d9c90d333f67604d0be0576b44a2cbca6
解决设备台账增加固定表头功能导致表格样式错乱问题
已修改1个文件
281 ■■■■■ 文件已修改
src/views/eam/equipment/EamEquipmentList.vue 281 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/equipment/EamEquipmentList.vue
@@ -215,12 +215,14 @@
        @click="handleAdd"
        type="primary"
        icon="plus"
      >新增</a-button>
      >新增
      </a-button>
      <a-button
        type="primary"
        icon="download"
        @click="handleExportXls('设备台账')"
      >导出</a-button>
      >导出
      </a-button>
      <a-upload
        name="file"
        :showUploadList="false"
@@ -232,13 +234,15 @@
        <a-button
          type="primary"
          icon="import"
        >导入</a-button>
        >导入
        </a-button>
      </a-upload>
      <a-button
        type="primary"
        icon="download"
        @click="handleTemplateXlsDownload"
      >导入模板下载</a-button>
      >导入模板下载
      </a-button>
      <a-dropdown v-if="selectedRowKeys.length > 0">
        <a-menu slot="overlay">
          <!--          <a-menu-item key="1" @click="handleOpenNameplateModal(selectionRows)">-->
@@ -266,7 +270,8 @@
        class="ant-alert ant-alert-info"
        style="margin-bottom: 16px;"
      >
        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{
        selectedRowKeys.length }}</a>项
        <a
          style="margin-left: 24px"
          @click="onSelectChange([])"
@@ -281,37 +286,25 @@
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :scroll="{ x: 'max-content' }"
        :scroll="{ x: 'max-content',y:465 }"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        @change="handleTableChange"
        :customRow="customTableRow"
      >
        <span
          slot="processParametersFlag"
          slot-scope="text"
        >
          <lx-switch
            v-model="text"
            disabled
            checked-children="有"
            un-checked-children="无"
          />
        <!--需要超出省略的字段-->
        <template slot="ellipsisText" slot-scope="text">
          <template v-if="(text&&text.length<=6)||!text">{{text}}</template>
          <j-ellipsis v-else :value="text" :length="6"/>
        </template>
        <span slot="processParametersFlag" slot-scope="text">
          <lx-switch v-model="text" disabled checked-children="有" un-checked-children="无"/>
        </span>
        <span
          slot="precisionParametersFlag"
          slot-scope="text"
        >
          <lx-switch
            v-model="text"
            disabled
            checked-children="有"
            un-checked-children="无"
          />
        <span slot="precisionParametersFlag" slot-scope="text">
          <lx-switch v-model="text" disabled checked-children="有" un-checked-children="无"/>
        </span>
        <span
          slot="action"
          slot-scope="text, record"
        >
        <span slot="action" slot-scope="text, record">
          <a @click.stop="handleEdit(record)">编辑</a>
          <a-divider type="vertical" />
@@ -322,22 +315,13 @@
              <!--                <a href="javascript:;" @click="handleOpenNameplateModal([record])">铭牌</a>-->
              <!--              </a-menu-item>-->
              <a-menu-item>
                <a
                  href="javascript:;"
                  @click="handleOpenResumeDrawer(record)"
                >履历</a>
                <a href="javascript:;" @click="handleOpenResumeDrawer(record)">履历</a>
              </a-menu-item>
              <a-menu-item>
                <a
                  href="javascript:;"
                  @click="handleDetail(record)"
                >详情</a>
                <a href="javascript:;" @click="handleDetail(record)">详情</a>
              </a-menu-item>
              <a-menu-item v-if="isShowAuth('eam:equipment:delete')">
                <a-popconfirm
                  title="确定删除吗?"
                  @confirm="() => handleDelete(record.id)"
                >
                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                  <a>删除</a>
                </a-popconfirm>
              </a-menu-item>
@@ -349,110 +333,42 @@
    </div>
    <!-- table区域-end -->
    <a-tabs
      v-model="activeTabKey"
      @change="handleTabChange"
    >
      <a-tab-pane
        tab="设备文档"
        :key="1"
      >
    <a-tabs v-model="activeTabKey" @change="handleTabChange">
      <a-tab-pane tab="设备文档" :key="1">
        <eam-equipment-attachment-list ref="tabPaneTableListRef1" />
      </a-tab-pane>
      <a-tab-pane
        tab="点检工单"
        :key="2"
      >
        <eam-inspection-order-list
          ref="tabPaneTableListRef2"
          :isDisplayOperation="false"
        />
      <a-tab-pane tab="点检工单" :key="2">
        <eam-inspection-order-list ref="tabPaneTableListRef2" :isDisplayOperation="false"/>
      </a-tab-pane>
      <!--      <a-tab-pane tab="周保工单" :key="3">
        <eam-week-maintenance-order-list ref="tabPaneTableListRef3" :isDisplayOperation="false"/>
      </a-tab-pane>-->
      <a-tab-pane
        tab="二保工单"
        :key="3"
      >
        <eam-second-maintenance-order-list
          ref="tabPaneTableListRef3"
          :isDisplayOperation="false"
        />
      <a-tab-pane tab="二保工单" :key="3">
        <eam-second-maintenance-order-list ref="tabPaneTableListRef3" :isDisplayOperation="false"/>
      </a-tab-pane>
      <a-tab-pane
        tab="三保工单"
        :key="4"
      >
        <eam-third-maintenance-order-list
          ref="tabPaneTableListRef4"
          :isDisplayOperation="false"
        />
      <a-tab-pane tab="三保工单" :key="4">
        <eam-third-maintenance-order-list ref="tabPaneTableListRef4" :isDisplayOperation="false"/>
      </a-tab-pane>
      <a-tab-pane
        tab="维修工单"
        :key="5"
      >
        <eam-repair-order-list
          ref="tabPaneTableListRef5"
          :isDisplayOperation="false"
        />
      <a-tab-pane tab="维修工单" :key="5">
        <eam-repair-order-list ref="tabPaneTableListRef5" :isDisplayOperation="false"/>
      </a-tab-pane>
      <a-tab-pane
        tab="保养标准"
        :key="6"
      >
        <eam-maintenance-standard-list
          ref="tabPaneTableListRef6"
          :isDisplayOperation="false"
        />
      <a-tab-pane tab="保养标准" :key="6">
        <eam-maintenance-standard-list ref="tabPaneTableListRef6" :isDisplayOperation="false"/>
      </a-tab-pane>
      <a-tab-pane
        tab="工艺参数"
        :key="7"
        v-if="isOpenProcess"
      >
        <eam-equipment-process-list
          ref="tabPaneTableListRef7"
          :isDisplayOperation="false"
        />
      <a-tab-pane tab="工艺参数" :key="7" v-if="isOpenProcess">
        <eam-equipment-process-list ref="tabPaneTableListRef7" :isDisplayOperation="false"/>
      </a-tab-pane>
      <a-tab-pane
        tab="设备精度"
        :key="8"
        v-if="isOpenPrecision"
      >
        <eam-equipment-precision-list
          ref="tabPaneTableListRef8"
          :isDisplayOperation="false"
        />
      <a-tab-pane tab="设备精度" :key="8" v-if="isOpenPrecision">
        <eam-equipment-precision-list ref="tabPaneTableListRef8" :isDisplayOperation="false"/>
      </a-tab-pane>
      <a-tab-pane
        tab="设备油液"
        :key="9"
      >
        <eam-equipment-fluid-list
          ref="tabPaneTableListRef9"
          :isDisplayOperation="false"
        />
      <a-tab-pane tab="设备油液" :key="9">
        <eam-equipment-fluid-list ref="tabPaneTableListRef9" :isDisplayOperation="false"/>
      </a-tab-pane>
    </a-tabs>
    <!-- 表单区域 -->
    <eamEquipment-modal
      ref="modalForm"
      @ok="modalFormOk"
    ></eamEquipment-modal>
    <eamEquipment-modal ref="modalForm" @ok="modalFormOk"/>
    <!--铭牌弹窗-->
    <nameplate-modal
      ref="nameplateModalRef"
      :printedRows="printedRows"
    />
    <nameplate-modal ref="nameplateModalRef" :printedRows="printedRows"/>
    <!--履历弹窗-->
    <resume-drawer
      ref="resumeDrawerRef"
      :currentTableRowRecord="currentTableRowRecord"
    />
    <resume-drawer ref="resumeDrawerRef" :currentTableRowRecord="currentTableRowRecord"/>
  </a-card>
</template>
@@ -468,7 +384,6 @@
import EamRepairOrderList from '../repair/EamRepairOrderList'
import EamInspectionOrderList from '../maintenance/EamInspectionOrderList'
import EamEquipmentAttachmentList from '@views/eam/equipment/EamEquipmentAttachmentList.vue'
// import EamWeekMaintenanceOrderList from '@views/eam/maintenance/EamWeekMaintenanceOrderList.vue'
import EamEquipmentProcessList from '@views/eam/equipment/modules/EamEquipmentProcessList.vue'
import EamEquipmentPrecisionList from '@views/eam/equipment/modules/EamEquipmentPrecisionList.vue'
import EamSecondMaintenanceOrderList from '@views/eam/maintenance/EamSecondMaintenanceOrderList.vue'
@@ -486,7 +401,6 @@
    NameplateModal,
    EamEquipmentModal,
    EamEquipmentAttachmentList,
    // EamWeekMaintenanceOrderList,
    EamEquipmentProcessList,
    EamEquipmentPrecisionList,
    EamSecondMaintenanceOrderList,
@@ -512,24 +426,23 @@
        {
          title: '设备编号',
          align: 'center',
          width: 100,
            width: 150,
          dataIndex: 'equipmentCode',
          ellipsis: true,
          fixed: 'left',
          sorter: true
        },
        {
          title: '设备名称',
          align: 'center',
          width: 100,
            width: 150,
          dataIndex: 'equipmentName',
          ellipsis: true,
            scopedSlots: { customRender: 'ellipsisText' },
          fixed: 'left'
        },
        {
          title: '设备型号',
          align: 'center',
          width: 200,
            width: 150,
          dataIndex: 'equipmentModel'
        },
        {
@@ -547,12 +460,13 @@
        {
          title: '原值(元)',
          align: 'center',
          dataIndex: 'originalValue'
            dataIndex: 'originalValue',
            width: 120
        },
        {
          title: '使用车间',
          align: 'center',
          width: 100,
            width: 150,
          dataIndex: 'orgId_dictText'
        },
        {
@@ -588,8 +502,8 @@
        {
          title: '管理分类',
          align: 'center',
          width: 120,
          dataIndex: 'equipmentImportance_dictText',
            width: 100,
            dataIndex: 'equipmentImportance_dictText'
        },
        {
          title: '技术状态',
@@ -606,17 +520,19 @@
        {
          title: '设备类别',
          align: 'center',
          dataIndex: 'equipmentCategory_dictText'
            dataIndex: 'equipmentCategory_dictText',
            width: 100
        },
        {
          title: '设备种类',
          align: 'center',
          dataIndex: 'equipmentType_dictText'
            dataIndex: 'equipmentType_dictText',
            width: 150
        },
        {
          title: '设备规格',
          align: 'center',
          width: 100,
            width: 150,
          dataIndex: 'equipmentSpecification'
        },
        {
@@ -640,21 +556,22 @@
        {
          title: '安装位置',
          align: 'center',
          width: 100,
          ellipsis: true,
          dataIndex: 'installationPosition'
            width: 150,
            dataIndex: 'installationPosition',
            scopedSlots: { customRender: 'ellipsisText' }
        },
        {
          title: '出厂编号',
          align: 'center',
          dataIndex: 'factoryNumber'
            dataIndex: 'factoryNumber',
            width: 150
        },
        {
          title: '机床厂家',
          align: 'center',
          width: 300,
          ellipsis: true,
          dataIndex: 'manufacturingEnterprise'
            width: 150,
            dataIndex: 'manufacturingEnterprise',
            scopedSlots: { customRender: 'ellipsisText' }
        },
        {
          title: '来源国家',
@@ -665,8 +582,8 @@
        {
          title: '设备供应商',
          align: 'center',
          width: 100,
          ellipsis: true,
            width: 150,
            scopedSlots: { customRender: 'ellipsisText' },
          dataIndex: 'supplier'
        },
        {
@@ -686,24 +603,28 @@
        {
          title: '外形尺寸',
          align: 'center',
          dataIndex: 'overallDimensions'
            dataIndex: 'overallDimensions',
            width: 120
        },
        {
          title: '资金来源',
          align: 'center',
          dataIndex: 'fundingSource'
            dataIndex: 'fundingSource',
            width: 120
        },
        {
          title: '功能用途',
          align: 'center',
          ellipsis: true,
          dataIndex: 'functionUse'
            scopedSlots: { customRender: 'ellipsisText' },
            dataIndex: 'functionUse',
            width: 150
        },
        {
          title: '性能指标',
          align: 'center',
          ellipsis: true,
          dataIndex: 'performanceIndicators'
            dataIndex: 'performanceIndicators',
            width: 120
        },
        {
          title: '入帐时间',
@@ -726,17 +647,21 @@
        {
          title: '更新人',
          align: 'center',
          dataIndex: 'updateBy_dictText'
            dataIndex: 'updateBy_dictText',
            width: 100
        },
        {
          title: '更新时间',
          align: 'center',
          dataIndex: 'updateTime'
            dataIndex: 'updateTime',
            width: 200
        },
        {
          title: '备注',
          align: 'center',
          dataIndex: 'remark'
            dataIndex: 'remark',
            width: 150,
            scopedSlots: { customRender: 'ellipsisText' }
        },
        {
          title: '操作',
@@ -765,13 +690,13 @@
      isOpenPrecision: false,
      treeDataAlias: [],
      leaveFactoryDate: [],
      acceptanceCheckDate: [],
        acceptanceCheckDate: []
    }
  },
  computed: {
    importExcelUrl: function () {
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
    },
      }
  },
  created() {
    this.loadAllProductionTree()
@@ -869,7 +794,7 @@
      this.$refs['tabPaneTableListRef' + this.activeTabKey].dataSource = []
      this.$refs['tabPaneTableListRef' + this.activeTabKey].onClearSelected()
      if (selectedRowKeys.length === 1) {
        let row = this.dataSource.find(row => row.id === selectedRowKeys[0]);
          let row = this.dataSource.find(row => row.id === selectedRowKeys[0])
        if (row) {
          this.isOpenProcess = (row.processParametersFlag === '1')
          this.isOpenPrecision = (row.precisionParametersFlag === '1')
@@ -884,10 +809,10 @@
      }
      //tab标签被销毁了,返回第一个tab
      if (!this.isOpenProcess && this.activeTabKey === 6) {
        this.activeTabKey = 1;
          this.activeTabKey = 1
      }
      if (!this.isOpenPrecision && this.activeTabKey === 7) {
        this.activeTabKey = 1;
          this.activeTabKey = 1
      }
    },
@@ -906,33 +831,33 @@
    deepCopyAndModify(arr) {
      // 如果当前元素不是数组或对象,直接返回
      if (!Array.isArray(arr) && typeof arr !== 'object' || arr === null || arr.length === 0) {
        return arr;
          return arr
      }
      // 如果是数组,创建一个新数组并递归处理每个元素
      if (Array.isArray(arr)) {
        const newArray = [];
          const newArray = []
        for (let i = 0; i < arr.length; i++) {
          newArray.push(this.deepCopyAndModify(arr[i]));
            newArray.push(this.deepCopyAndModify(arr[i]))
        }
        return newArray;
          return newArray
      }
      // 如果是对象,创建一个新对象并递归处理每个属性
      const newObj = {};
        const newObj = {}
      for (const key in arr) {
        if (arr.hasOwnProperty(key)) {
          if (key === 'selectable') {
            newObj[key] = true;
              newObj[key] = true
          } else if (key === 'children') {
            newObj[key] = this.deepCopyAndModify(arr[key]);
              newObj[key] = this.deepCopyAndModify(arr[key])
          } else {
            newObj[key] = arr[key];
              newObj[key] = arr[key]
          }
        }
      }
      return newObj;
        return newObj
    },
    searchReset() {
      this.leaveFactoryDate = []
@@ -940,8 +865,8 @@
      this.queryParam = {}
      this.onClearSelected()
      this.loadTabPaneTableData('-1')
      this.loadData(1);
    },
        this.loadData(1)
      }
  }
}
</script>