Browse Source

up-预约管理,导出平铺人数数据。增加身份证信息

shaogen1995 2 years ago
parent
commit
eb24b32caa
1 changed files with 32 additions and 11 deletions
  1. 32 11
      后台管理/src/pages/A1Order/index.tsx

+ 32 - 11
后台管理/src/pages/A1Order/index.tsx

@@ -231,19 +231,40 @@ function A1Order() {
     });
 
     if (res.code === 0) {
+      const tepmArr: any[] = [];
+
+      res.data.records.forEach((v: any) => {
+        // contact 字段 多人预约 信息 平铺展示
+        if (v.contact && v.contact.includes(",")) {
+          const arrAll = v.contact.split(",");
+
+          arrAll.forEach((v2: any) => {
+            const arr1 = v2.split("-");
+
+            tepmArr.push({
+              ...v,
+              name: arr1[0] || "暂无",
+              phone: arr1[1] || "暂无",
+              IDCard: arr1[2] || "暂无",
+              time: v.bookDay + " " + v.bootTimeScope,
+            });
+          });
+        } else {
+          tepmArr.push({
+            ...v,
+            name: resField(v.contact)[0],
+            phone: resField(v.contact)[1],
+            IDCard: resField(v.contact)[2],
+            time: v.bookDay + " " + v.bootTimeScope,
+          });
+        }
+      });
+
       const option = {
         fileName: name,
         datas: [
           {
-            sheetData: res.data.records.map((v: A1TableType) => {
-              return {
-                ...v,
-                name: resField(v.contact)[0],
-                phone: resField(v.contact)[1],
-                rNum: v.contact.split(",").length,
-                time: v.bookDay + " " + v.bootTimeScope,
-              };
-            }),
+            sheetData: tepmArr,
             sheetName: name,
             sheetFilter: [
               "createTime",
@@ -251,7 +272,7 @@ function A1Order() {
               "organ",
               "name",
               "phone",
-              "rNum",
+              "IDCard",
               "time",
               "description",
             ],
@@ -261,7 +282,7 @@ function A1Order() {
               "所在单位",
               "姓名",
               "联系电话",
-              "人数",
+              "身份证",
               "预约时间",
               "备注",
             ],