hyingbo
昨天 4ba27c99841134d0389589af25737fa1ce3aa3c7
设备台账统计
已添加1个文件
已修改1个文件
209 ■■■■■ 文件已修改
src/views/eam/equipment/EamEquipmentList.vue 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/equipment/modules/EquipmentCategoryStatisticsList.vue 194 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/eam/equipment/EamEquipmentList.vue
@@ -243,6 +243,11 @@
        @click="handleTemplateXlsDownload"
      >导入模板下载
      </a-button>
      <a-button
        @click="EquipmentCategoryStatistics"
        type="primary"
        icon="area-chart"
      >台账统计</a-button>
      <a-dropdown v-if="selectedRowKeys.length > 0">
        <a-menu slot="overlay">
          <!--          <a-menu-item key="1" @click="handleOpenNameplateModal(selectionRows)">-->
@@ -369,6 +374,9 @@
    <nameplate-modal ref="nameplateModalRef" :printedRows="printedRows"/>
    <!--履历弹窗-->
    <resume-drawer ref="resumeDrawerRef" :currentTableRowRecord="currentTableRowRecord"/>
    <!--台账统计-->
    <equipment-category-statistics-list ref="EquipmentCategoryStatistics"/>
  </a-card>
</template>
@@ -389,11 +397,13 @@
  import EamSecondMaintenanceOrderList from '@views/eam/maintenance/EamSecondMaintenanceOrderList.vue'
  import EamThirdMaintenanceOrderList from '@views/eam/maintenance/EamThirdMaintenanceOrderList.vue'
  import EamEquipmentFluidList from '@views/eam/equipment/modules/EamEquipmentFluidList.vue'
  import EquipmentCategoryStatisticsList from '@views/eam/equipment/modules/EquipmentCategoryStatisticsList.vue'
  export default {
    name: 'EamEquipmentList',
    mixins: [JeecgListMixin],
    components: {
      EquipmentCategoryStatisticsList,
      EamInspectionOrderList,
      EamRepairOrderList,
      EamMaintenanceStandardList,
@@ -820,6 +830,11 @@
        templateXlsDownload(this.url.templateXlsDownloadUrl)
      },
      EquipmentCategoryStatistics() {
        this.$refs.EquipmentCategoryStatistics.visible = true; // æ˜¾ç¤ºå¼¹çª—
        this.$refs.EquipmentCategoryStatistics.loadData()
      },
      loadAppHomeUrlConfigValue() {
        let params = { settingKey: 'app_home_url' }
        getSystemConfigValue(params).then(res => {
src/views/eam/equipment/modules/EquipmentCategoryStatisticsList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,194 @@
<template>
  <j-modal
    :title="title"
    :width="width"
    :visible="visible"
    :confirmLoading="confirmLoading"
    switchFullscreen
    cancelText="关闭"
    @cancel="handleCancel"
  >
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <!-- æŸ¥è¯¢åŒºåŸŸ-END -->
    <div class="table-operator">
      <a-button
        type="primary"
        icon="download"
        @click="handleExportXls('台账统计')"
      >导出</a-button>
    </div>
    <!-- table区域-begin -->
    <div>
      <a-table
        ref="table"
        size="middle"
        bordered
        class="j-table-force-nowrap"
        :scroll="{x:true}"
        @change="handleTableChange"
        :columns="columns"
        :dataSource="dataSource"
        :loading="loading">
      </a-table>
    </div>
    <div slot="footer">
      <a-button @click="handleCancel">关闭</a-button>
    </div>
  </j-modal>
</template>
<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { downFile, getAction } from '@/api/manage'
import '@/assets/less/TableExpand.less'
export default {
  name: "EquipmentCategoryStatisticsList",
  mixins:[JeecgListMixin],
  components: {},
  data() {
    return {
      title: '台账统计',
      width: 1200,
      visible: false,
      confirmLoading: false,
      // è¡¨å¤´
      columns: [
        {
          title: '设备种类',
          align: "center",
          dataIndex: 'equipmentType',
        },
        {
          title: '设备总数',
          align: "left",
          dataIndex: 'equipmentCount'
        },
        {
          title: '总原值',
          align: "center",
          dataIndex: 'originalValue',
          // æ ¼å¼åŒ–数值显示
          render: (text) => {
            return text.toFixed(2)
          }
        },
        {
          title: '高精度总数',
          align: "center",
          dataIndex: 'highPrecisionCount'
        },
        {
          title: '高精度原值',
          align: "center",
          dataIndex: 'highPrecisionOriginalValue',
          render: (text) => {
            return text.toFixed(2)
          }
        },
        {
          title: '国产总数',
          align: "left",
          dataIndex: 'domesticCount'
        },
        {
          title: '国产原值',
          align: "left",
          dataIndex: 'domesticOriginalValue',
          render: (text) => {
            return text.toFixed(2)
          }
        },
        {
          title: '进口总数',
          align: "left",
          dataIndex: 'importCount'
        },
        {
          title: '进口原值',
          align: "left",
          dataIndex: 'importOriginalValue',
          render: (text) => {
            return text.toFixed(2)
          }
        },
        {
          title: '完好总数',
          align: "left",
          dataIndex: 'intactCount'
        },
        {
          title: '完好原值',
          align: "left",
          dataIndex: 'intactOriginalValue',
          render: (text) => {
            return text.toFixed(2)
          }
        }
      ],
      url: {
        list: "/eam/equipment/queryLedgerStatistics",
        exportXlsUrl: "/eam/equipment/exportLedgerStatisticsXls"
      },
    }
  },
  created() {
  },
  computed: {},
  methods: {
    handleExportXls(fileName) {
      if (!fileName || typeof fileName != "string") {
        fileName = "导出文件"
      }
      downFile(this.url.exportXlsUrl).then((data) => {
        if (!data) {
          this.$message.warning("文件下载失败")
          return
        }
        if (typeof window.navigator.msSaveBlob !== 'undefined') {
          window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xls')
        } else {
          let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
          let link = document.createElement('a')
          link.style.display = 'none'
          link.href = url
          link.setAttribute('download', fileName + '.xls')
          document.body.appendChild(link)
          link.click()
          document.body.removeChild(link); //下载完成移除元素
          window.URL.revokeObjectURL(url); //释放掉blob对象
        }
      })
    },
    loadData() {
      if (!this.url.list) {
        this.$message.error("请设置url.list属性!")
        return
      }
      this.onClearSelected()
      this.loading = true;
      getAction(this.url.list).then((res) => {
        if (res.success) {
          // ä¿®å¤æ•°æ®è®¿é—®è·¯å¾„,直接使用res.result而非res.result.records
          this.dataSource = res.result;
        }
        if (res.code === 510) {
          this.$message.warning(res.message)
        }
        this.loading = false;
      })
    },
    handleCancel() {
      this.$emit('close');
      this.visible = false;
    },
  }
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>