Sfoglia il codice sorgente

修复导出主副规格,副规格重复问题

MY 1 giorno fa
parent
commit
13eef77757
1 ha cambiato i file con 26 aggiunte e 3 eliminazioni
  1. 26 3
      JLHWEB/src/views/quote/mattressQuote/index.vue

+ 26 - 3
JLHWEB/src/views/quote/mattressQuote/index.vue

@@ -674,10 +674,33 @@ const action: detailAction[] = [
     label: t("common.dataTransmission"),
     power: 72,
     clickFunc: item => {
-      // alert("功能维护中!");
-      const { $table } = getCurrentRecords(vxeTableRef.value);
+      const $table = vxeTableRef.value.element;
+
+      const _records = $table.getCheckboxRecords() ?? [];
+      const _cRecords = $table.getCurrentRecord() ?? null;
+
+      let curRecords = [];
+      if ($table) {
+        if (_records.length) {
+          // 获取勾选列表
+          curRecords = _records;
+        } else if (_cRecords) {
+          // 获取当前选中数据
+          curRecords = [_cRecords];
+        } else {
+          // 默认获取全部数据
+          let fullData = $table.getTableData().fullData;
+          if (fullData.length) {
+            curRecords = fullData;
+          }
+        }
+      }
       const now = new Date();
-      $table?.openExport({ filename: `床垫报价_${formatTime(now, "{y}-{m}-{d}", false)}` });
+      $table.openExport({
+        filename: `床垫报价_${formatTime(now, "{y}-{m}-{d}", false)}`,
+        data: curRecords,
+        isAllExpand: true
+      });
     }
   }),
   buttonDefault({