From 4ba27c99841134d0389589af25737fa1ce3aa3c7 Mon Sep 17 00:00:00 2001
From: hyingbo <1363390067@qq.com>
Date: 星期五, 05 九月 2025 11:14:17 +0800
Subject: [PATCH] 设备台账统计

---
 src/views/eam/equipment/modules/EquipmentCategoryStatisticsList.vue |  194 ++++++++++++++++++++++++++++++++++++++++++++++++
 src/views/eam/equipment/EamEquipmentList.vue                        |   15 +++
 2 files changed, 209 insertions(+), 0 deletions(-)

diff --git a/src/views/eam/equipment/EamEquipmentList.vue b/src/views/eam/equipment/EamEquipmentList.vue
index d057ec4..4cc5160 100644
--- a/src/views/eam/equipment/EamEquipmentList.vue
+++ b/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 => {
diff --git a/src/views/eam/equipment/modules/EquipmentCategoryStatisticsList.vue b/src/views/eam/equipment/modules/EquipmentCategoryStatisticsList.vue
new file mode 100644
index 0000000..335564a
--- /dev/null
+++ b/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); //閲婃斁鎺塨lob瀵硅薄
+        }
+      })
+    },
+    loadData() {
+      if (!this.url.list) {
+        this.$message.error("璇疯缃畊rl.list灞炴��!")
+        return
+      }
+      this.onClearSelected()
+      this.loading = true;
+      getAction(this.url.list).then((res) => {
+        if (res.success) {
+          // 淇鏁版嵁璁块棶璺緞锛岀洿鎺ヤ娇鐢╮es.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>

--
Gitblit v1.9.3