huang_an пре 2 година
родитељ
комит
67c19427d4

+ 20 - 1
src/views/ledgerAssets/boat/components/boat-list.vue

@@ -38,6 +38,14 @@
   import { getBoatList, downloadCategory } from '@/api/ledgerAssets';
   // import { downloadAction } from '@/api/flowable/manage';
   import dictMixins from '@/mixins/dictMixins';
+  import axios from 'axios';
+  import {
+    API_BASE_URL,
+    TOKEN_HEADER_NAME,
+    LAYOUT_PATH
+  } from '@/config/setting';
+  import { download } from '@/utils/file';
+  import { getToken, setToken } from '@/utils/token-util';
   export default {
     mixins: [dictMixins],
     components: { BoatSearch },
@@ -179,7 +187,18 @@
           categoryLevelId: this.categoryId,
           rootCategoryLevelId: this.rootId
         };
-        downloadCategory(params, '舟皿台账导出数据');
+        // downloadCategory(params, '舟皿台账导出数据');
+        axios({
+          url: `${API_BASE_URL}/main/asset/page/export`,
+          method: 'post',
+          responseType: 'blob',
+          headers: {
+            Authorization: getToken()
+          },
+          data: params
+        }).then((res) => {
+          download(res.data, '舟皿台账导出数据');
+        });
       }
     },
     watch: {

+ 1 - 1
src/views/ledgerAssets/equipment/components/equipment-list.vue

@@ -87,7 +87,6 @@
 </template>
 
 <script>
-  import { getToken, setToken } from '@/utils/token-util';
   import EquipmentSearch from './equipment-search.vue';
   import DialogMoveto from './DialogMoveTo.vue';
   import {
@@ -104,6 +103,7 @@
     LAYOUT_PATH
   } from '@/config/setting';
   import { download } from '@/utils/file';
+  import { getToken, setToken } from '@/utils/token-util';
 
   export default {
     components: { EquipmentSearch, DialogMoveto },

+ 50 - 39
src/views/ledgerAssets/meter/components/data-list.vue

@@ -1,10 +1,6 @@
 <template>
   <div>
-    <user-search 
-      ref="searchRef"
-      @search="reload"
-      :isConsumer="isConsumer"
-    >
+    <user-search ref="searchRef" @search="reload" :isConsumer="isConsumer">
     </user-search>
     <!-- 数据表格 -->
     <ele-pro-table
@@ -18,16 +14,16 @@
     >
       <!-- 表头工具栏 -->
       <template v-slot:toolbar>
-          <el-checkbox v-model="isConsumer">显示已消耗</el-checkbox>
-          <el-button
-           size="small"
-           type="primary"
-           icon="el-icon-download"
-           class="ele-btn-icon"
-           @click="btnExport"
-         >
-           导出
-         </el-button>
+        <el-checkbox v-model="isConsumer">显示已消耗</el-checkbox>
+        <el-button
+          size="small"
+          type="primary"
+          icon="el-icon-download"
+          class="ele-btn-icon"
+          @click="btnExport"
+        >
+          导出
+        </el-button>
       </template>
 
       <!-- 编码列 -->
@@ -71,18 +67,23 @@
 
 <script>
   import UserSearch from './user-search.vue';
-  import {
-    getAssetList,
-    downloadAsset
-  } from '@/api/ledgerAssets';
+  import { getAssetList, downloadAsset } from '@/api/ledgerAssets';
   import dictMixins from '@/mixins/dictMixins';
+  import axios from 'axios';
+  import {
+    API_BASE_URL,
+    TOKEN_HEADER_NAME,
+    LAYOUT_PATH
+  } from '@/config/setting';
+  import { download } from '@/utils/file';
+  import { getToken, setToken } from '@/utils/token-util';
   export default {
     components: { UserSearch },
     mixins: [dictMixins],
     props: {
       // 类别id
       categoryId: [Number, String],
-      rootId: [Number, String],
+      rootId: [Number, String]
     },
     data() {
       return {
@@ -129,14 +130,14 @@
             label: '牌号',
             showOverflowTooltip: true,
             minWidth: 110,
-            slot:'brandNum'
+            slot: 'brandNum'
           },
           {
             prop: 'modelType',
             label: '型号',
             showOverflowTooltip: true,
             minWidth: 110,
-            slot:'modelType'
+            slot: 'modelType'
           },
           {
             prop: 'categoryLevelPath',
@@ -157,7 +158,7 @@
             showOverflowTooltip: true,
             minWidth: 110,
             formatter: (_row, _column, cellValue) => {
-              return this.getDictValue('生命周期',  _row.position[0].type)
+              return this.getDictValue('生命周期', _row.position[0].type);
             }
           },
           {
@@ -171,10 +172,10 @@
             fixed: 'right'
           }
         ],
-        isConsumer:false
+        isConsumer: false
       };
     },
-    created () {
+    created() {
       this.requestDict('生命周期');
     },
     methods: {
@@ -195,35 +196,45 @@
       },
 
       // 跳转到详情页
-      details ({ id }) {
+      details({ id }) {
         this.$router.push({
           path: '/ledgerAssets/mould/detail',
           query: {
             id
           }
-        })
+        });
       },
       // 跳转到编辑页
-      goEdit ({ id }) {
+      goEdit({ id }) {
         this.$router.push({
           path: '/ledgerAssets/mould/edit',
           query: {
             id
           }
-        })
+        });
       },
-      
+
       // 导出
       btnExport() {
         let params = {
           ...this.$refs.searchRef.where,
-          exportType:3,
+          exportType: 3,
           categoryLevelId: this.categoryId,
-          rootCategoryLevelId:this.rootId
-        }
-        downloadAsset(params, '模具台账导出数据');
-      },
-
+          rootCategoryLevelId: this.rootId
+        };
+        // downloadAsset(params, '模具台账导出数据');
+        axios({
+          url: `${API_BASE_URL}/main/asset/page/export`,
+          method: 'post',
+          responseType: 'blob',
+          headers: {
+            Authorization: getToken()
+          },
+          data: params
+        }).then((res) => {
+          download(res.data, '仪表计量台账导出数据');
+        });
+      }
     },
     watch: {
       // 监听类别id变化
@@ -234,7 +245,7 @@
   };
 </script>
 <style lang="scss" scoped>
-   .ele-btn-icon{
-     margin-left: 20px;
-   }
+  .ele-btn-icon {
+    margin-left: 20px;
+  }
 </style>

+ 20 - 1
src/views/ledgerAssets/mould/components/mould-list.vue

@@ -70,6 +70,14 @@
   import MouldSearch from './mould-search.vue';
   import { getAssetList, downloadAsset } from '@/api/ledgerAssets';
   import dictMixins from '@/mixins/dictMixins';
+  import axios from 'axios';
+  import {
+    API_BASE_URL,
+    TOKEN_HEADER_NAME,
+    LAYOUT_PATH
+  } from '@/config/setting';
+  import { download } from '@/utils/file';
+  import { getToken, setToken } from '@/utils/token-util';
   export default {
     components: { MouldSearch },
     mixins: [dictMixins],
@@ -215,7 +223,18 @@
           categoryLevelId: this.categoryId,
           rootCategoryLevelId: this.rootId
         };
-        downloadAsset(params, '模具台账导出数据');
+        axios({
+          url: `${API_BASE_URL}/main/asset/page/export`,
+          method: 'post',
+          responseType: 'blob',
+          headers: {
+            Authorization: getToken()
+          },
+          data: params
+        }).then((res) => {
+          download(res.data, '模具台账导出数据');
+        });
+        // downloadAsset(params, '模具台账导出数据');
       }
     },
     watch: {

+ 50 - 39
src/views/ledgerAssets/office/components/data-list.vue

@@ -1,10 +1,6 @@
 <template>
   <div>
-    <user-search 
-      ref="searchRef"
-      @search="reload"
-      :isConsumer="isConsumer"
-    >
+    <user-search ref="searchRef" @search="reload" :isConsumer="isConsumer">
     </user-search>
     <!-- 数据表格 -->
     <ele-pro-table
@@ -18,16 +14,16 @@
     >
       <!-- 表头工具栏 -->
       <template v-slot:toolbar>
-          <el-checkbox v-model="isConsumer">显示已消耗</el-checkbox>
-          <el-button
-           size="small"
-           type="primary"
-           icon="el-icon-download"
-           class="ele-btn-icon"
-           @click="btnExport"
-         >
-           导出
-         </el-button>
+        <el-checkbox v-model="isConsumer">显示已消耗</el-checkbox>
+        <el-button
+          size="small"
+          type="primary"
+          icon="el-icon-download"
+          class="ele-btn-icon"
+          @click="btnExport"
+        >
+          导出
+        </el-button>
       </template>
 
       <!-- 编码列 -->
@@ -71,18 +67,23 @@
 
 <script>
   import UserSearch from './user-search.vue';
-  import {
-    getAssetList,
-    downloadAsset
-  } from '@/api/ledgerAssets';
+  import { getAssetList, downloadAsset } from '@/api/ledgerAssets';
   import dictMixins from '@/mixins/dictMixins';
+  import axios from 'axios';
+  import {
+    API_BASE_URL,
+    TOKEN_HEADER_NAME,
+    LAYOUT_PATH
+  } from '@/config/setting';
+  import { download } from '@/utils/file';
+  import { getToken, setToken } from '@/utils/token-util';
   export default {
     components: { UserSearch },
     mixins: [dictMixins],
     props: {
       // 类别id
       categoryId: [Number, String],
-      rootId: [Number, String],
+      rootId: [Number, String]
     },
     data() {
       return {
@@ -129,14 +130,14 @@
             label: '牌号',
             showOverflowTooltip: true,
             minWidth: 110,
-            slot:'brandNum'
+            slot: 'brandNum'
           },
           {
             prop: 'modelType',
             label: '型号',
             showOverflowTooltip: true,
             minWidth: 110,
-            slot:'modelType'
+            slot: 'modelType'
           },
           {
             prop: 'categoryLevelPath',
@@ -157,7 +158,7 @@
             showOverflowTooltip: true,
             minWidth: 110,
             formatter: (_row, _column, cellValue) => {
-              return this.getDictValue('生命周期',  _row.position[0].type)
+              return this.getDictValue('生命周期', _row.position[0].type);
             }
           },
           {
@@ -171,10 +172,10 @@
             fixed: 'right'
           }
         ],
-        isConsumer:false
+        isConsumer: false
       };
     },
-    created () {
+    created() {
       this.requestDict('生命周期');
     },
     methods: {
@@ -195,35 +196,45 @@
       },
 
       // 跳转到详情页
-      details ({ id }) {
+      details({ id }) {
         this.$router.push({
           path: '/ledgerAssets/mould/detail',
           query: {
             id
           }
-        })
+        });
       },
       // 跳转到编辑页
-      goEdit ({ id }) {
+      goEdit({ id }) {
         this.$router.push({
           path: '/ledgerAssets/mould/edit',
           query: {
             id
           }
-        })
+        });
       },
-      
+
       // 导出
       btnExport() {
         let params = {
           ...this.$refs.searchRef.where,
-          exportType:3,
+          exportType: 3,
           categoryLevelId: this.categoryId,
-          rootCategoryLevelId:this.rootId
-        }
-        downloadAsset(params, '模具台账导出数据');
-      },
-
+          rootCategoryLevelId: this.rootId
+        };
+        // downloadAsset(params, '模具台账导出数据');
+        axios({
+          url: `${API_BASE_URL}/main/asset/page/export`,
+          method: 'post',
+          responseType: 'blob',
+          headers: {
+            Authorization: getToken()
+          },
+          data: params
+        }).then((res) => {
+          download(res.data, '办公设备台账导出数据');
+        });
+      }
     },
     watch: {
       // 监听类别id变化
@@ -234,7 +245,7 @@
   };
 </script>
 <style lang="scss" scoped>
-   .ele-btn-icon{
-     margin-left: 20px;
-   }
+  .ele-btn-icon {
+    margin-left: 20px;
+  }
 </style>

+ 21 - 1
src/views/ledgerAssets/sparepart/components/sparepart-list.vue

@@ -69,6 +69,15 @@
   import SparepartSearch from './sparepart-search.vue';
   import { getAssetList, downloadAsset } from '@/api/ledgerAssets';
   import dictMixins from '@/mixins/dictMixins';
+  import axios from 'axios';
+  import {
+    API_BASE_URL,
+    TOKEN_HEADER_NAME,
+    LAYOUT_PATH
+  } from '@/config/setting';
+  import { download } from '@/utils/file';
+  import { getToken, setToken } from '@/utils/token-util';
+
   export default {
     components: { SparepartSearch },
     mixins: [dictMixins],
@@ -214,7 +223,18 @@
           categoryLevelId: this.categoryId,
           rootCategoryLevelId: this.rootId
         };
-        downloadAsset(params, '备品备件台账导出数据');
+        // downloadAsset(params, '备品备件台账导出数据');
+        axios({
+          url: `${API_BASE_URL}/main/asset/page/export`,
+          method: 'post',
+          responseType: 'blob',
+          headers: {
+            Authorization: getToken()
+          },
+          data: params
+        }).then((res) => {
+          download(res.data, '备品备件台账导出数据');
+        });
       }
     },
     watch: {

+ 20 - 1
src/views/ledgerAssets/turnoverCar/components/turnovercar-list.vue

@@ -62,6 +62,14 @@
   import { getAssetList, downloadAsset } from '@/api/ledgerAssets';
   import dictMixins from '@/mixins/dictMixins';
   // import { downloadAction } from '@/api/flowable/manage';
+  import axios from 'axios';
+  import {
+    API_BASE_URL,
+    TOKEN_HEADER_NAME,
+    LAYOUT_PATH
+  } from '@/config/setting';
+  import { download } from '@/utils/file';
+  import { getToken, setToken } from '@/utils/token-util';
 
   export default {
     components: { TurnovercarSearch },
@@ -216,7 +224,18 @@
           categoryLevelId: this.categoryId,
           rootCategoryLevelId: this.rootId
         };
-        downloadAsset(params, '周转车台账导出数据');
+        // downloadAsset(params, '周转车台账导出数据');
+        axios({
+          url: `${API_BASE_URL}/main/asset/page/export`,
+          method: 'post',
+          responseType: 'blob',
+          headers: {
+            Authorization: getToken()
+          },
+          data: params
+        }).then((res) => {
+          download(res.data, '周转车台账导出数据');
+        });
       }
     },
     watch: {