lxf 1 ano atrás
pai
commit
04f25fc2e9
1 arquivos alterados com 28 adições e 2 exclusões
  1. 28 2
      src/views/group/data-board/turnover-rate/index.vue

+ 28 - 2
src/views/group/data-board/turnover-rate/index.vue

@@ -13,6 +13,10 @@
               text: '刷新',
               action: () => getList(),
             },
+            {
+              text: '导出Excel',
+              action: () => deriveExcel(),
+            },
           ]"
           @get-list="getList">
           <template #purchaseCode="{ item }">
@@ -22,8 +26,20 @@
           </template>
         </byTable>
       </el-col>
-      <el-col :span="12" style="padding-top: 34px">
-        <byTable :hidePagination="true" :source="sourceListTwo.data" :config="config" :loading="loadingTwo" highlight-current-row @get-list="getList">
+      <el-col :span="12">
+        <byTable
+          :hidePagination="true"
+          :source="sourceListTwo.data"
+          :config="config"
+          :loading="loadingTwo"
+          highlight-current-row
+          :action-list="[
+            {
+              text: '导出Excel',
+              action: () => deriveExcelTwo(),
+            },
+          ]"
+          @get-list="getList">
           <template #purchaseCode="{ item }">
             <div>
               <a style="color: #409eff; cursor: pointer; word-break: break-all" @click="clickPurchaseCode(item)">{{ item.purchaseCode }}</a>
@@ -96,6 +112,16 @@ const getList = () => {
   });
 };
 getList();
+const deriveExcel = () => {
+  proxy.postFile("/turnoverRateBoard/exportExcel", { bomClassify: "1" }).then((res) => {
+    proxy.downloadFile(res, "周转率-裸垫.xlsx");
+  });
+};
+const deriveExcelTwo = () => {
+  proxy.postFile("/turnoverRateBoard/exportExcel", { bomClassify: "2" }).then((res) => {
+    proxy.downloadFile(res, "周转率-裸砖.xlsx");
+  });
+};
 </script>
 
 <style lang="scss" scoped>