Browse Source

Merge branch 'master' into 对账单分类

lxf 1 năm trước cách đây
mục cha
commit
397b7a023a

+ 165 - 0
src/views/group/finance/check-bill/ExcelFile.vue

@@ -0,0 +1,165 @@
+<template>
+  <div style="max-height: calc(100vh - 184px); overflow-y: auto; overflow-x: hidden">
+    <byTable
+      :source="sourceList.data"
+      :pagination="sourceList.pagination"
+      :config="config"
+      :loading="loading"
+      highlight-current-row
+      :action-list="[
+        {
+          text: '刷新',
+          action: () => getList(),
+        },
+      ]"
+      @get-list="getList">
+    </byTable>
+  </div>
+</template>
+
+<script setup>
+import byTable from "/src/components/byTable/index";
+import { ElMessage, ElMessageBox } from "element-plus";
+
+const { proxy } = getCurrentInstance();
+const status = ref([
+  {
+    dictKey: 1,
+    dictValue: "数据处理中",
+  },
+  {
+    dictKey: 2,
+    dictValue: "Excel生成中",
+  },
+  {
+    dictKey: 3,
+    dictValue: "Excel上传OBS中",
+  },
+  {
+    dictKey: 4,
+    dictValue: "完成",
+  },
+  {
+    dictKey: 99,
+    dictValue: "异常",
+  },
+]);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 0,
+    pageNum: 1,
+    pageSize: 10,
+    code: "",
+    departmentId: "",
+    beginTime: "",
+    endTime: "",
+  },
+});
+const loading = ref(false);
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "文件名称",
+        prop: "excelName",
+      },
+    },
+    {
+      attrs: {
+        label: "状态",
+        prop: "status",
+        width: 160,
+      },
+      render(val) {
+        return proxy.dictKeyValue(val, status.value);
+      },
+    },
+    {
+      attrs: {
+        label: "创建时间",
+        prop: "createTime",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        width: 120,
+        align: "center",
+        fixed: "right",
+      },
+      renderHTML(row) {
+        return [
+          row.status == 4
+            ? {
+                attrs: {
+                  label: "下载",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  clickDownload(row);
+                },
+              }
+            : {},
+          row.status == 4
+            ? {
+                attrs: {
+                  label: "删除",
+                  type: "danger",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  clickDelete(row);
+                },
+              }
+            : {},
+        ];
+      },
+    },
+  ];
+});
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy.post("/excelGenerateLog/page", sourceList.value.pagination).then((res) => {
+    sourceList.value.data = res.rows;
+    sourceList.value.pagination.total = res.total;
+    setTimeout(() => {
+      loading.value = false;
+    }, 200);
+  });
+};
+getList();
+const clickDownload = (row) => {
+  fetch(row.obsFileUrl).then((res) =>
+    res.blob().then((blob) => {
+      var a = document.createElement("a");
+      var url = window.URL.createObjectURL(blob);
+      a.href = url;
+      a.download = row.excelName; // 下载名称
+      a.click();
+      window.URL.revokeObjectURL(url);
+    })
+  );
+};
+const clickDelete = (row) => {
+  ElMessageBox.confirm("你是否确认此操作", "提示", {
+    confirmButtonText: "确定",
+    cancelButtonText: "取消",
+    type: "warning",
+  })
+    .then(() => {
+      proxy.post("/excelGenerateLog/delete", { id: row.id }).then(() => {
+        ElMessage({ message: "删除成功", type: "success" });
+        getList();
+      });
+    })
+    .catch(() => {});
+};
+</script>
+
+<style lang="scss" scoped></style>

+ 25 - 3
src/views/group/finance/check-bill/index.vue

@@ -9,9 +9,13 @@
         :searchConfig="searchConfig"
         highlight-current-row
         :action-list="[
+          // {
+          //   text: '登记对账',
+          //   action: () => clickModal(),
+          // },
           {
-            text: '登记对账',
-            action: () => clickModal(),
+            text: 'Excel文件',
+            action: () => clickExcelFile(),
           },
         ]"
         @get-list="getList"
@@ -130,11 +134,18 @@
             <PrintBOM :rowData="rowData" :tabValues="{ activeName: activeName, tabsCard: tabsCard }" @clickCancel="openPrint = false"></PrintBOM>
           </el-tab-pane>
           <el-tab-pane label="订单对账单" name="order">
-            <PrintOrder :rowData="rowData" :tabValues="{ activeName: activeName, tabsCard: tabsCard }" @clickCancel="openPrint = false"></PrintOrder>
+            <PrintOrder :rowData="rowData" :tabValues="{ activeName: activeName, tabsCard: tabsCard }" @clickCancel="clickCancel"></PrintOrder>
           </el-tab-pane>
         </el-tabs>
       </div>
     </el-dialog>
+
+    <el-dialog title="Excel文件" v-if="openFileList" v-model="openFileList" width="60%">
+      <ExcelFile></ExcelFile>
+      <template #footer>
+        <el-button @click="openFileList = false" size="large">关 闭</el-button>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
@@ -147,6 +158,7 @@ import PrintSKU from "/src/views/group/finance/check-bill/printSKU.vue";
 import PrintBOM from "/src/views/group/finance/check-bill/printBOM.vue";
 import PrintOrder from "/src/views/group/finance/check-bill/printOrder.vue";
 import { copyText } from "vue3-clipboard";
+import ExcelFile from "/src/views/group/finance/check-bill/ExcelFile.vue";
 
 const { proxy } = getCurrentInstance();
 const departmentList = ref([{ dictKey: "0", dictValue: "胜德体育" }]);
@@ -638,6 +650,16 @@ const clickCopyWLNCode = (row) => {
     });
   });
 };
+const openFileList = ref(false);
+const clickCancel = (status) => {
+  openPrint.value = false;
+  if (status) {
+    openFileList.value = true;
+  }
+};
+const clickExcelFile = () => {
+  openFileList.value = true;
+};
 </script>
 
 <style lang="scss" scoped>

+ 3 - 4
src/views/group/finance/check-bill/printOrder.vue

@@ -22,7 +22,6 @@
 
 <script setup>
 import { cloneVNode } from "vue";
-import { ElMessage } from "element-plus";
 
 const { proxy } = getCurrentInstance();
 const props = defineProps({
@@ -128,11 +127,11 @@ const clickCancel = () => {
   emit("clickCancel", "");
 };
 const deriveExcel = () => {
-  ElMessage("导出文件中,请稍后");
   loading.value = true;
   proxy.getFile("/statementOfAccount/exportDocumentByOrder", { id: props.rowData.id }).then(
-    (res) => {
-      proxy.downloadFile(res, "订单对账单.xlsx");
+    () => {
+      emit("clickCancel", true);
+      // proxy.downloadFile(res, "订单对账单.xlsx");
       loading.value = false;
     },
     (err) => {

+ 27 - 3
src/views/group/finance/summary/index.vue

@@ -8,6 +8,12 @@
         :loading="loading"
         :searchConfig="searchConfig"
         highlight-current-row
+        :action-list="[
+          {
+            text: 'Excel文件',
+            action: () => clickExcelFile(),
+          },
+        ]"
         @get-list="getList"
         @clickReset="clickReset"
         @changeRadioGroup="changeRadioGroup">
@@ -21,17 +27,24 @@
       <div style="padding: 0 10px">
         <el-tabs v-model="activeName">
           <el-tab-pane label="SKU对账单" name="sku">
-            <PrintSKU :rowData="rowData" :activeName="activeName" :tabsCard="tabsCard" @clickCancel="openPrint = false"></PrintSKU>
+            <PrintSKU :rowData="rowData" :tabValues="{ activeName: activeName, tabsCard: tabsCard }" @clickCancel="openPrint = false"></PrintSKU>
           </el-tab-pane>
           <el-tab-pane label="BOM对账单" name="bom">
-            <PrintBOM :rowData="rowData" :activeName="activeName" :tabsCard="tabsCard" @clickCancel="openPrint = false"></PrintBOM>
+            <PrintBOM :rowData="rowData" :tabValues="{ activeName: activeName, tabsCard: tabsCard }" @clickCancel="openPrint = false"></PrintBOM>
           </el-tab-pane>
           <el-tab-pane label="订单对账单" name="order">
-            <PrintOrder :rowData="rowData" :activeName="activeName" :tabsCard="tabsCard" @clickCancel="openPrint = false"></PrintOrder>
+            <PrintOrder :rowData="rowData" :tabValues="{ activeName: activeName, tabsCard: tabsCard }" @clickCancel="clickCancel"></PrintOrder>
           </el-tab-pane>
         </el-tabs>
       </div>
     </el-dialog>
+    
+    <el-dialog title="Excel文件" v-if="openFileList" v-model="openFileList" width="60%">
+      <ExcelFile></ExcelFile>
+      <template #footer>
+        <el-button @click="openFileList = false" size="large">关 闭</el-button>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
@@ -42,6 +55,7 @@ import PrintBOM from "/src/views/group/finance/summary/printBOM.vue";
 import PrintOrder from "/src/views/group/finance/summary/printOrder.vue";
 import { copyText } from "vue3-clipboard";
 import { ElMessage } from "element-plus";
+import ExcelFile from "/src/views/group/finance/check-bill/ExcelFile.vue";
 
 const { proxy } = getCurrentInstance();
 const departmentList = ref([{ dictKey: "0", dictValue: "胜德体育" }]);
@@ -260,6 +274,16 @@ const clickCopyWLNCode = (row) => {
     });
   }
 };
+const openFileList = ref(false);
+const clickCancel = (status) => {
+  openPrint.value = false;
+  if (status) {
+    openFileList.value = true;
+  }
+};
+const clickExcelFile = () => {
+  openFileList.value = true;
+};
 </script>
 
 <style lang="scss" scoped>

+ 3 - 5
src/views/group/finance/summary/printOrder.vue

@@ -22,8 +22,6 @@
 
 <script setup>
 import { cloneVNode } from "vue";
-import { ElMessage } from "element-plus";
-
 const { proxy } = getCurrentInstance();
 const props = defineProps({
   rowData: Object,
@@ -128,7 +126,6 @@ const clickCancel = () => {
   emit("clickCancel", "");
 };
 const deriveExcel = () => {
-  ElMessage("导出文件中,请稍后");
   loading.value = true;
   proxy
     .getFile("/statementOfAccountMerge/exportDocumentByOrder", {
@@ -137,8 +134,9 @@ const deriveExcel = () => {
       beginDate: props.rowData.dimensionality,
     })
     .then(
-      (res) => {
-        proxy.downloadFile(res, "订单对账单.xlsx");
+      () => {
+        emit("clickCancel", true);
+        // proxy.downloadFile(res, "订单对账单.xlsx");
         loading.value = false;
       },
       (err) => {

+ 25 - 1
src/views/subsidiary/finance/check-bill/index.vue

@@ -8,6 +8,12 @@
         :loading="loading"
         :searchConfig="searchConfig"
         highlight-current-row
+        :action-list="[
+          {
+            text: 'Excel文件',
+            action: () => clickExcelFile(),
+          },
+        ]"
         @get-list="getList"
         @clickReset="clickReset">
         <template #timePeriod="{ item }">
@@ -52,10 +58,17 @@
           <PrintBOM :rowData="rowData" :activeName="activeName" @clickCancel="openPrint = false"></PrintBOM>
         </el-tab-pane>
         <el-tab-pane label="订单对账单" name="order">
-          <PrintOrder :rowData="rowData" :activeName="activeName" @clickCancel="openPrint = false"></PrintOrder>
+          <PrintOrder :rowData="rowData" :activeName="activeName" @clickCancel="clickCancel"></PrintOrder>
         </el-tab-pane>
       </el-tabs>
     </el-dialog>
+    
+    <el-dialog title="Excel文件" v-if="openFileList" v-model="openFileList" width="60%">
+      <ExcelFile></ExcelFile>
+      <template #footer>
+        <el-button @click="openFileList = false" size="large">关 闭</el-button>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
@@ -64,6 +77,7 @@ import byTable from "/src/components/byTable/index";
 import PrintSKU from "/src/views/group/finance/check-bill/printSKU.vue";
 import PrintBOM from "/src/views/group/finance/check-bill/printBOM.vue";
 import PrintOrder from "/src/views/group/finance/check-bill/printOrder.vue";
+import ExcelFile from "/src/views/group/finance/check-bill/ExcelFile.vue";
 
 const { proxy } = getCurrentInstance();
 const sourceList = ref({
@@ -224,6 +238,16 @@ const clickPrint = (row) => {
   rowData.value = row;
   openPrint.value = true;
 };
+const openFileList = ref(false);
+const clickCancel = (status) => {
+  openPrint.value = false;
+  if (status) {
+    openFileList.value = true;
+  }
+};
+const clickExcelFile = () => {
+  openFileList.value = true;
+};
 </script>
 
 <style lang="scss" scoped>

+ 25 - 1
src/views/subsidiary/finance/summary/index.vue

@@ -8,6 +8,12 @@
         :loading="loading"
         :searchConfig="searchConfig"
         highlight-current-row
+        :action-list="[
+          {
+            text: 'Excel文件',
+            action: () => clickExcelFile(),
+          },
+        ]"
         @get-list="getList"
         @clickReset="clickReset"
         @changeRadioGroup="changeRadioGroup">
@@ -23,10 +29,17 @@
           <PrintBOM :rowData="rowData" :activeName="activeName" @clickCancel="openPrint = false"></PrintBOM>
         </el-tab-pane>
         <el-tab-pane label="订单对账单" name="order">
-          <PrintOrder :rowData="rowData" :activeName="activeName" @clickCancel="openPrint = false"></PrintOrder>
+          <PrintOrder :rowData="rowData" :activeName="activeName" @clickCancel="clickCancel"></PrintOrder>
         </el-tab-pane>
       </el-tabs>
     </el-dialog>
+    
+    <el-dialog title="Excel文件" v-if="openFileList" v-model="openFileList" width="60%">
+      <ExcelFile></ExcelFile>
+      <template #footer>
+        <el-button @click="openFileList = false" size="large">关 闭</el-button>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
@@ -35,6 +48,7 @@ import byTable from "/src/components/byTable/index";
 import PrintSKU from "/src/views/group/finance/summary/printSKU.vue";
 import PrintBOM from "/src/views/group/finance/summary/printBOM.vue";
 import PrintOrder from "/src/views/group/finance/summary/printOrder.vue";
+import ExcelFile from "/src/views/group/finance/check-bill/ExcelFile.vue";
 
 const { proxy } = getCurrentInstance();
 const sourceList = ref({
@@ -184,6 +198,16 @@ const clickPrint = (row) => {
   rowData.value = row;
   openPrint.value = true;
 };
+const openFileList = ref(false);
+const clickCancel = (status) => {
+  openPrint.value = false;
+  if (status) {
+    openFileList.value = true;
+  }
+};
+const clickExcelFile = () => {
+  openFileList.value = true;
+};
 </script>
 
 <style lang="scss" scoped>