lxf 1 жил өмнө
parent
commit
82c4be536e

+ 109 - 63
src/views/group/data-board/turnover-rate/index.vue

@@ -12,6 +12,106 @@
               highlight-current-row
               :action-list="[
                 {
+                  text: '刷新(30天)',
+                  action: () => getData('30'),
+                },
+                {
+                  text: '导出Excel',
+                  action: () => deriveExcel('30'),
+                },
+              ]"
+              @get-list="getList">
+              <template #bomSpecName="{ item }">
+                <div>
+                  <el-tooltip class="box-item" effect="dark" placement="bottom">
+                    <template #content>
+                      <div style="max-width: 600px; word-break: break-all">{{ item.bomSpecName }}</div>
+                    </template>
+                    <div style="cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis">
+                      {{ item.bomSpecName }}
+                    </div>
+                  </el-tooltip>
+                </div>
+              </template>
+            </byTable>
+          </el-col>
+          <el-col :span="8">
+            <byTable
+              :hidePagination="true"
+              :source="sourceList.data60"
+              :config="config"
+              :loading="sourceList.loading60"
+              highlight-current-row
+              :action-list="[
+                {
+                  text: '刷新(60天)',
+                  action: () => getData('60'),
+                },
+                {
+                  text: '导出Excel',
+                  action: () => deriveExcel('30'),
+                },
+              ]"
+              @get-list="getList">
+              <template #bomSpecName="{ item }">
+                <div>
+                  <el-tooltip class="box-item" effect="dark" placement="bottom">
+                    <template #content>
+                      <div style="max-width: 600px; word-break: break-all">{{ item.bomSpecName }}</div>
+                    </template>
+                    <div style="cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis">
+                      {{ item.bomSpecName }}
+                    </div>
+                  </el-tooltip>
+                </div>
+              </template>
+            </byTable>
+          </el-col>
+          <el-col :span="8">
+            <byTable
+              :hidePagination="true"
+              :source="sourceList.data90"
+              :config="config"
+              :loading="sourceList.loading90"
+              highlight-current-row
+              :action-list="[
+                {
+                  text: '刷新(90天)',
+                  action: () => getData('90'),
+                },
+                {
+                  text: '导出Excel',
+                  action: () => deriveExcel('30'),
+                },
+              ]"
+              @get-list="getList">
+              <template #bomSpecName="{ item }">
+                <div>
+                  <el-tooltip class="box-item" effect="dark" placement="bottom">
+                    <template #content>
+                      <div style="max-width: 600px; word-break: break-all">{{ item.bomSpecName }}</div>
+                    </template>
+                    <div style="cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis">
+                      {{ item.bomSpecName }}
+                    </div>
+                  </el-tooltip>
+                </div>
+              </template>
+            </byTable>
+          </el-col>
+        </el-row>
+      </el-tab-pane>
+      <el-tab-pane label="瑜伽砖" :name="'2'">
+        <el-row :gutter="10">
+          <el-col :span="8">
+            <byTable
+              :hidePagination="true"
+              :source="sourceList.data30"
+              :config="config"
+              :loading="sourceList.loading30"
+              highlight-current-row
+              :action-list="[
+                {
                   text: '刷新',
                   action: () => getData('30'),
                 },
@@ -101,56 +201,7 @@
           </el-col>
         </el-row>
       </el-tab-pane>
-      <el-tab-pane label="瑜伽砖" :name="'2'"> </el-tab-pane>
     </el-tabs>
-    <!-- <el-row :gutter="10">
-      <el-col :span="12">
-        <byTable
-          :hidePagination="true"
-          :source="sourceList.data"
-          :config="config"
-          :loading="loading"
-          highlight-current-row
-          :action-list="[
-            {
-              text: '刷新',
-              action: () => getList(),
-            },
-            {
-              text: '导出Excel',
-              action: () => deriveExcel(),
-            },
-          ]"
-          @get-list="getList">
-          <template #purchaseCode="{ item }">
-            <div>
-              <a style="color: #409eff; cursor: pointer; word-break: break-all" @click="clickPurchaseCode(item)">{{ item.purchaseCode }}</a>
-            </div>
-          </template>
-        </byTable>
-      </el-col>
-      <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>
-            </div>
-          </template>
-        </byTable>
-      </el-col>
-    </el-row> -->
   </el-card>
 </template>
 
@@ -167,10 +218,6 @@ const sourceList = ref({
   loading90: false,
   data90: [],
 });
-const sourceListTwo = ref({
-  data: [],
-});
-const loadingTwo = ref(false);
 const config = computed(() => {
   return [
     {
@@ -190,14 +237,14 @@ const config = computed(() => {
       attrs: {
         label: "周转率",
         prop: "turnoverRate",
-        width: 80,
+        width: 90,
       },
     },
     {
       attrs: {
         label: "库存数量",
         prop: "quantity",
-        width: 80,
+        width: 90,
       },
     },
   ];
@@ -217,14 +264,13 @@ const getList = () => {
   getData("90");
 };
 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");
+const deriveExcel = (days) => {
+  proxy.postFile("/turnoverRateBoard/exportExcel", { bomClassify: activeName.value, days: days, sortField: 1 }).then((res) => {
+    if (activeName.value == "1") {
+      proxy.downloadFile(res, "周转率-裸砖-" + days + "天.xlsx");
+    } else {
+      proxy.downloadFile(res, "周转率-裸垫-" + days + "天.xlsx");
+    }
   });
 };
 </script>