Explorar el Código

spc八大控制图数据模板下载修改

luofeng hace 1 mes
padre
commit
7303c51560

+ 15 - 0
src/hooks/userCrud.ts

@@ -394,6 +394,21 @@ export const useCrud = (config?: UseCrudConfig) => {
       });
       Utils.downloadFile(response);
     },
+
+    /**
+     * 根据搜索项导出数据
+     */
+    downloadSPCTemplate: async (urlStr: string, filePath: string) => {
+      handleSearchData();
+      const response = await request({
+        url: urlStr,
+        method: "post",
+        data: search.value,
+        params: { filePath: filePath },
+        responseType: "arraybuffer",
+      });
+      Utils.downloadFile(response);
+    },
   };
 
   return {

+ 2 - 2
src/views/analysis/process/CList.vue

@@ -35,7 +35,7 @@
                 size="small"
                 class="btn"
                 @click="
-                  exportData(
+                  downloadSPCTemplate(
                     '/api/v1/spc/downloadTemplate',
                     '/spc/template/C控制图数据导入模版.xlsx'
                   )
@@ -130,7 +130,7 @@ import { useCrud } from "@/hooks/userCrud";
 const { Utils } = useCrud({
   src: "/api/v1/spc/pDownloadTemplate",
 });
-const { exportData } = Utils;
+const { downloadSPCTemplate } = Utils;
 
 // 定义 props
 const props = defineProps({

+ 2 - 2
src/views/analysis/process/EWMAList.vue

@@ -35,7 +35,7 @@
                 size="small"
                 class="btn"
                 @click="
-                  exportData(
+                  downloadSPCTemplate(
                     '/api/v1/spc/downloadTemplate',
                     '/spc/template/EWMA控制图数据导入模版.xlsx'
                   )
@@ -130,7 +130,7 @@ import { useCrud } from "@/hooks/userCrud";
 const { Utils } = useCrud({
   src: "/api/v1/spc/pDownloadTemplate",
 });
-const { exportData } = Utils;
+const { downloadSPCTemplate } = Utils;
 
 // 定义 props
 const props = defineProps({

+ 2 - 2
src/views/analysis/process/I-MRList.vue

@@ -35,7 +35,7 @@
                 size="small"
                 class="btn"
                 @click="
-                  exportData(
+                  downloadSPCTemplate(
                     '/api/v1/spc/downloadTemplate',
                     '/spc/template/I-MR控制图数据导入模版.xlsx'
                   )
@@ -130,7 +130,7 @@ import { useCrud } from "@/hooks/userCrud";
 const { Utils } = useCrud({
   src: "/api/v1/spc/pDownloadTemplate",
 });
-const { exportData } = Utils;
+const { downloadSPCTemplate } = Utils;
 
 // 定义 props
 const props = defineProps({

+ 2 - 2
src/views/analysis/process/NPList.vue

@@ -35,7 +35,7 @@
                 size="small"
                 class="btn"
                 @click="
-                  exportData(
+                  downloadSPCTemplate(
                     '/api/v1/spc/downloadTemplate',
                     '/spc/template/NP控制图数据导入模版.xlsx'
                   )
@@ -130,7 +130,7 @@ import { useCrud } from "@/hooks/userCrud";
 const { Utils } = useCrud({
   src: "/api/v1/spc/pDownloadTemplate",
 });
-const { exportData } = Utils;
+const { downloadSPCTemplate } = Utils;
 
 // 定义 props
 const props = defineProps({

+ 2 - 2
src/views/analysis/process/PList.vue

@@ -35,7 +35,7 @@
                 size="small"
                 class="btn"
                 @click="
-                  exportData(
+                  downloadSPCTemplate(
                     '/api/v1/spc/downloadTemplate',
                     '/spc/template/P控制图数据导入模版.xlsx'
                   )
@@ -130,7 +130,7 @@ import { useCrud } from "@/hooks/userCrud";
 const { Utils } = useCrud({
   src: "/api/v1/spc/pDownloadTemplate",
 });
-const { exportData } = Utils;
+const { downloadSPCTemplate } = Utils;
 
 // 定义 props
 const props = defineProps({

+ 2 - 2
src/views/analysis/process/UList.vue

@@ -35,7 +35,7 @@
                 size="small"
                 class="btn"
                 @click="
-                  exportData(
+                  downloadSPCTemplate(
                     '/api/v1/spc/downloadTemplate',
                     '/spc/template/U控制图数据导入模版.xlsx'
                   )
@@ -130,7 +130,7 @@ import { useCrud } from "@/hooks/userCrud";
 const { Utils } = useCrud({
   src: "/api/v1/spc/pDownloadTemplate",
 });
-const { exportData } = Utils;
+const { downloadSPCTemplate } = Utils;
 
 // 定义 props
 const props = defineProps({

+ 2 - 2
src/views/analysis/process/Xbar-RList.vue

@@ -37,7 +37,7 @@
                 size="small"
                 class="btn"
                 @click="
-                  exportData(
+                  downloadSPCTemplate(
                     '/api/v1/spc/downloadTemplate',
                     '/spc/template/XBarR控制图数据导入模版.xlsx'
                   )
@@ -352,7 +352,7 @@ import { useCrud } from "@/hooks/userCrud";
 const { Utils } = useCrud({
   src: "/api/v1/spc/pDownloadTemplate",
 });
-const { exportData } = Utils;
+const { downloadSPCTemplate } = Utils;
 const emit = defineEmits([
   "tableData",
   "update:addStatus",

+ 2 - 2
src/views/analysis/process/Xbar-SList.vue

@@ -37,7 +37,7 @@
                 size="small"
                 class="btn"
                 @click="
-                  exportData(
+                  downloadSPCTemplate(
                     '/api/v1/spc/downloadTemplate',
                     '/spc/template/XBarS控制图数据导入模版.xlsx'
                   )
@@ -331,7 +331,7 @@ import { useCrud } from "@/hooks/userCrud";
 const { Utils } = useCrud({
   src: "/api/v1/spc/pDownloadTemplate",
 });
-const { exportData } = Utils;
+const { downloadSPCTemplate } = Utils;
 
 const emit = defineEmits([
   "tableData",