2 Commits e70766c509 ... f9679af7bb

Author SHA1 Message Date
  zzs f9679af7bb Merge branch 'master' of http://219.147.85.210:8080/gmcs/HongHu-PSM 2 months ago
  zzs e060d59e8d 新导出专家评审表 2 months ago
2 changed files with 637 additions and 188 deletions
  1. 366 87
      ruoyi-ui/src/utils/markExcel.js
  2. 271 101
      ruoyi-ui/src/views/tender/tender1/components/CompEval.vue

+ 366 - 87
ruoyi-ui/src/utils/markExcel.js

@@ -5,7 +5,6 @@ import dayjs from "dayjs";
  * @param {*} sName 项目名称
  * @param {*} kaibiaoTime 开标时间
  * @param {*} kaibiaoAddress 开标地点
- * @param {*} hName 供应商名称
  * @param {*} tableData 数据
  */
 export const genExamineExcel = (
@@ -13,14 +12,14 @@ export const genExamineExcel = (
   sName,
   kaibiaoTime,
   kaibiaoAddress,
-  hName,
-  tableData
+  tableData,
+  page
 ) => {
-  const worksheet = workbook.addWorksheet("资格审查", {
-    pageSetup:{paperSize: 9, orientation:'landscape'}
+  const worksheet = workbook.addWorksheet(`资格审查-${page}`, {
+    pageSetup: { paperSize: 9, orientation: "landscape" },
   });
 
-  const columnWidth = [6.07, 29.47, 59.47, 27.26];
+  const columnWidth = [6.07, 29.47, 59.47, 27.26, 27.26, 27.26, 27.26];
   for (let cw = 1; cw <= columnWidth.length; cw++) {
     worksheet.getColumn(cw).width = columnWidth[cw - 1] + 0.62;
   }
@@ -51,19 +50,37 @@ export const genExamineExcel = (
   row3.font = { name: "宋体", family: 4, size: 10 };
 
   worksheet.addRow([`开标地点:${kaibiaoAddress}`]);
-  worksheet.mergeCells("A4:C4");
+  worksheet.mergeCells("A4:G4");
   worksheet.getCell("A4").alignment = { vertical: "middle" };
   const row4 = worksheet.getRow(4);
   row4.height = 19;
   row4.font = { name: "宋体", family: 4, size: 10 };
 
-  worksheet.addRow(["序号", "审查内容", "得分标准", "投标单位"]);
+  worksheet.addRow([
+    "序号",
+    "审查内容",
+    "得分标准",
+    "投标单位",
+    "投标单位",
+    "投标单位",
+    "投标单位",
+  ]);
 
   const row5 = worksheet.getRow(5);
   row5.height = 19;
   row5.font = { name: "宋体", family: 4, size: 10 };
 
-  worksheet.addRow(["", "", "", hName]);
+  let hName0 = "";
+  let hName1 = "";
+  let hName2 = "";
+  let hName3 = "";
+  if (tableData.length > 0) {
+    hName0 = tableData[0].hName0 || "";
+    hName1 = tableData[0].hName1 || "";
+    hName2 = tableData[0].hName2 || "";
+    hName3 = tableData[0].hName3 || "";
+  }
+  worksheet.addRow(["", "", "", hName0, hName1, hName2, hName3]);
 
   worksheet.getCell("A6").alignment = {
     vertical: "middle",
@@ -76,7 +93,19 @@ export const genExamineExcel = (
   worksheet.mergeCells("B5:B6");
   worksheet.mergeCells("C5:C6");
 
-  const tableHeader = ["A5", "B5", "C5", "D5", "D6"];
+  const tableHeader = [
+    "A5",
+    "B5",
+    "C5",
+    "D5",
+    "D6",
+    "E5",
+    "E6",
+    "F5",
+    "F6",
+    "G5",
+    "G6",
+  ];
   for (let th of tableHeader) {
     worksheet.getCell(th).alignment = {
       vertical: "middle",
@@ -91,15 +120,21 @@ export const genExamineExcel = (
   }
   const tableStartNum = 7;
 
-  const tbody = ["A", "B", "C", "D"];
+  const tbody = ["A", "B", "C", "D", "E", "F", "G"];
 
-  let isOk = true;
+  let isOk0 = 1;
+  let isOk1 = 1;
+  let isOk2 = 1;
+  let isOk3 = 1;
   for (let i = 0; i < tableData.length; i++) {
     const data = [
       i + 1,
       tableData[i].content || "",
       tableData[i].standard || "",
-      tableData[i].isOk || "",
+      tableData[i].isOk0 || "",
+      tableData[i].isOk1 || "",
+      tableData[i].isOk2 || "",
+      tableData[i].isOk3 || "",
     ];
     for (let j = 0; j < data.length; j++) {
       const td = tbody[j];
@@ -135,8 +170,39 @@ export const genExamineExcel = (
         alignment = { vertical: "middle", horizontal: "center" };
         value = data[j];
         if (td == "D") {
-          if (data[j] != "合格") {
-            isOk = false;
+          if (hName0) {
+            if (data[j] == "不合格") {
+              isOk0 = 2;
+            }
+          } else {
+            isOk0 = 3;
+          }
+        }
+        if (td == "E") {
+          if (hName1) {
+            if (data[j] == "不合格") {
+              isOk1 = 2;
+            }
+          } else {
+            isOk1 = 3;
+          }
+        }
+        if (td == "F") {
+          if (hName2) {
+            if (data[j] == "不合格") {
+              isOk2 = 2;
+            }
+          } else {
+            isOk2 = 3;
+          }
+        }
+        if (td == "G") {
+          if (hName3) {
+            if (data[j] == "不合格") {
+              isOk3 = 2;
+            }
+          } else {
+            isOk3 = 3;
           }
         }
       }
@@ -154,8 +220,15 @@ export const genExamineExcel = (
 
   const denfenRowNum = tableData.length + tableStartNum;
   worksheet.mergeCells(`A${denfenRowNum}:C${denfenRowNum}`);
-  const denFenTd = ["A", "D"];
-  const denFenData = ["是否合格", isOk ? "合格" : "不合格"];
+  const okStatus = { 1: "合格", 2: "不合格", 3: "" };
+  const denFenTd = ["A", "D", "E", "F", "G"];
+  const denFenData = [
+    "是否合格",
+    okStatus[isOk0],
+    okStatus[isOk1],
+    okStatus[isOk2],
+    okStatus[isOk3],
+  ];
   for (let i = 0; i < denFenData.length; i++) {
     const td = denFenTd[i];
     worksheet.getCell(`${td + denfenRowNum}`).border = {
@@ -181,7 +254,7 @@ export const genExamineExcel = (
 
   const lastRowNum = denfenRowNum + 1;
   worksheet.addRow(["评审小组成员签字:"]);
-  worksheet.mergeCells(`A${lastRowNum}:E${lastRowNum}`);
+  worksheet.mergeCells(`A${lastRowNum}:G${lastRowNum}`);
   worksheet.getCell(`A${lastRowNum}`).alignment = { vertical: "middle" };
   const rowLast = worksheet.getRow(lastRowNum);
   rowLast.height = 23;
@@ -194,7 +267,6 @@ export const genExamineExcel = (
  * @param {*} sName 项目名称
  * @param {*} kaibiaoTime 开标时间
  * @param {*} kaibiaoAddress 开标地点
- * @param {*} hName 供应商名称
  * @param {*} tableData 数据
  */
 export const genRespondExcel = (
@@ -202,13 +274,13 @@ export const genRespondExcel = (
   sName,
   kaibiaoTime,
   kaibiaoAddress,
-  hName,
-  tableData
+  tableData,
+  page
 ) => {
-  const worksheet = workbook.addWorksheet("响应性", {
-    pageSetup:{paperSize: 9, orientation:'landscape'}
+  const worksheet = workbook.addWorksheet(`响应性-${page}`, {
+    pageSetup: { paperSize: 9, orientation: "landscape" },
   });
-  const columnWidth = [6.07, 29.47, 59.47, 27.26];
+  const columnWidth = [6.07, 29.47, 59.47, 27.26, 27.26, 27.26, 27.26];
   for (let cw = 1; cw <= columnWidth.length; cw++) {
     worksheet.getColumn(cw).width = columnWidth[cw - 1] + 0.62;
   }
@@ -245,13 +317,31 @@ export const genRespondExcel = (
   row4.height = 19;
   row4.font = { name: "宋体", family: 4, size: 10 };
 
-  worksheet.addRow(["序号", "审查内容", "得分标准", "投标单位"]);
+  worksheet.addRow([
+    "序号",
+    "审查内容",
+    "得分标准",
+    "投标单位",
+    "投标单位",
+    "投标单位",
+    "投标单位",
+  ]);
 
   const row5 = worksheet.getRow(5);
   row5.height = 19;
   row5.font = { name: "宋体", family: 4, size: 10 };
 
-  worksheet.addRow(["", "", "", hName]);
+  let hName0 = "";
+  let hName1 = "";
+  let hName2 = "";
+  let hName3 = "";
+  if (tableData.length > 0) {
+    hName0 = tableData[0].hName0 || "";
+    hName1 = tableData[0].hName1 || "";
+    hName2 = tableData[0].hName2 || "";
+    hName3 = tableData[0].hName3 || "";
+  }
+  worksheet.addRow(["", "", "", hName0, hName1, hName2, hName3]);
 
   worksheet.getCell("A6").alignment = {
     vertical: "middle",
@@ -264,7 +354,19 @@ export const genRespondExcel = (
   worksheet.mergeCells("B5:B6");
   worksheet.mergeCells("C5:C6");
 
-  const tableHeader = ["A5", "B5", "C5", "D5", "D6"];
+  const tableHeader = [
+    "A5",
+    "B5",
+    "C5",
+    "D5",
+    "D6",
+    "E5",
+    "E6",
+    "F5",
+    "F6",
+    "G5",
+    "G6",
+  ];
   for (let th of tableHeader) {
     worksheet.getCell(th).alignment = {
       vertical: "middle",
@@ -279,15 +381,21 @@ export const genRespondExcel = (
   }
   const tableStartNum = 7;
 
-  const tbody = ["A", "B", "C", "D"];
+  const tbody = ["A", "B", "C", "D", "E", "F", "G"];
 
-  let isOk = true;
+  let isOk0 = 1;
+  let isOk1 = 1;
+  let isOk2 = 1;
+  let isOk3 = 1;
   for (let i = 0; i < tableData.length; i++) {
     const data = [
       i + 1,
       tableData[i].content || "",
       tableData[i].standard || "",
-      tableData[i].isOk || "",
+      tableData[i].isOk0 || "",
+      tableData[i].isOk1 || "",
+      tableData[i].isOk2 || "",
+      tableData[i].isOk3 || "",
     ];
     for (let j = 0; j < data.length; j++) {
       const td = tbody[j];
@@ -323,8 +431,39 @@ export const genRespondExcel = (
         alignment = { vertical: "middle", horizontal: "center" };
         value = data[j];
         if (td == "D") {
-          if (data[j] != "合格") {
-            isOk = false;
+          if (hName0) {
+            if (data[j] == "不合格") {
+              isOk0 = 2;
+            }
+          } else {
+            isOk0 = 3;
+          }
+        }
+        if (td == "E") {
+          if (hName1) {
+            if (data[j] == "不合格") {
+              isOk1 = 2;
+            }
+          } else {
+            isOk1 = 3;
+          }
+        }
+        if (td == "F") {
+          if (hName2) {
+            if (data[j] == "不合格") {
+              isOk2 = 2;
+            }
+          } else {
+            isOk2 = 3;
+          }
+        }
+        if (td == "G") {
+          if (hName3) {
+            if (data[j] == "不合格") {
+              isOk3 = 2;
+            }
+          } else {
+            isOk3 = 3;
           }
         }
       }
@@ -342,8 +481,16 @@ export const genRespondExcel = (
 
   const denfenRowNum = tableData.length + tableStartNum;
   worksheet.mergeCells(`A${denfenRowNum}:C${denfenRowNum}`);
-  const denFenTd = ["A", "D"];
-  const denFenData = ["是否合格", isOk ? "合格" : "不合格"];
+
+  const okStatus = { 1: "合格", 2: "不合格", 3: "" };
+  const denFenTd = ["A", "D", "E", "F", "G"];
+  const denFenData = [
+    "是否合格",
+    okStatus[isOk0],
+    okStatus[isOk1],
+    okStatus[isOk2],
+    okStatus[isOk3],
+  ];
   for (let i = 0; i < denFenData.length; i++) {
     const td = denFenTd[i];
     worksheet.getCell(`${td + denfenRowNum}`).border = {
@@ -369,7 +516,7 @@ export const genRespondExcel = (
 
   const lastRowNum = denfenRowNum + 1;
   worksheet.addRow(["评审小组成员签字:"]);
-  worksheet.mergeCells(`A${lastRowNum}:E${lastRowNum}`);
+  worksheet.mergeCells(`A${lastRowNum}:G${lastRowNum}`);
   worksheet.getCell(`A${lastRowNum}`).alignment = { vertical: "middle" };
   const rowLast = worksheet.getRow(lastRowNum);
   rowLast.height = 23;
@@ -382,7 +529,6 @@ export const genRespondExcel = (
  * @param {*} sName 项目名称
  * @param {*} kaibiaoTime 开标时间
  * @param {*} kaibiaoAddress 开标地点
- * @param {*} hName 供应商名称
  * @param {*} tableData 数据
  */
 export const genTechExcel = (
@@ -390,14 +536,16 @@ export const genTechExcel = (
   sName,
   kaibiaoTime,
   kaibiaoAddress,
-  hName,
   tableData,
   sheetName
 ) => {
   const worksheet = workbook.addWorksheet(sheetName, {
-    pageSetup:{paperSize: 9, orientation:'landscape'}
+    pageSetup: { paperSize: 9, orientation: "landscape" },
   });
-  const columnWidth = [3.88, 16.19, 5.47, 65.53, 15.04, 15.04];
+  const columnWidth = [
+    3.88, 16.19, 5.47, 65.53, 15.04, 15.04, 15.04, 15.04, 15.04, 15.04, 15.04,
+    15.04,
+  ];
   for (let cw = 1; cw <= columnWidth.length; cw++) {
     worksheet.getColumn(cw).width = columnWidth[cw - 1] + 0.62;
   }
@@ -434,15 +582,59 @@ export const genTechExcel = (
   row4.height = 21;
   row4.font = { name: "宋体", family: 4, size: 10 };
 
-  worksheet.addRow(["序号", "审查内容", "分值", "得分标准", "投标单位"]);
+  worksheet.addRow([
+    "序号",
+    "审查内容",
+    "分值",
+    "得分标准",
+    "投标单位",
+    "",
+    "投标单位",
+    "",
+    "投标单位",
+    "",
+    "投标单位",
+    "",
+  ]);
   worksheet.mergeCells("E5:F5");
+  worksheet.mergeCells("G5:H5");
+  worksheet.mergeCells("I5:J5");
+  worksheet.mergeCells("K5:L5");
 
   const row5 = worksheet.getRow(5);
   row5.height = 17;
   row5.font = { name: "宋体", family: 4, size: 10 };
 
-  worksheet.addRow(["", "", "", "", hName]);
+  let hName0 = "";
+  let hName1 = "";
+  let hName2 = "";
+  let hName3 = "";
+  if (tableData.length > 0) {
+    console.log(tableData[0]);
+    hName0 = tableData[0].hName0 || "";
+    hName1 = tableData[0].hName1 || "";
+    hName2 = tableData[0].hName2 || "";
+    hName3 = tableData[0].hName3 || "";
+  }
+  worksheet.addRow([
+    "",
+    "",
+    "",
+    "",
+    hName0,
+    "",
+    hName1,
+    "",
+    hName2,
+    "",
+    hName3,
+    "",
+  ]);
   worksheet.mergeCells("E6:F6");
+  worksheet.mergeCells("G6:H6");
+  worksheet.mergeCells("I6:J6");
+  worksheet.mergeCells("K6:L6");
+
   worksheet.getCell("A6").alignment = {
     vertical: "middle",
     horizontal: "center",
@@ -451,7 +643,20 @@ export const genTechExcel = (
   row6.height = 29;
   row6.font = { name: "宋体", family: 4, size: 10 };
 
-  worksheet.addRow(["", "", "", "", "得分", "扣分原因"]);
+  worksheet.addRow([
+    "",
+    "",
+    "",
+    "",
+    "得分",
+    "扣分原因",
+    "得分",
+    "扣分原因",
+    "得分",
+    "扣分原因",
+    "得分",
+    "扣分原因",
+  ]);
 
   worksheet.getCell("A7").alignment = {
     vertical: "middle",
@@ -465,7 +670,28 @@ export const genTechExcel = (
   worksheet.mergeCells("C5:C7");
   worksheet.mergeCells("D5:D7");
 
-  const tableHeader = ["A5", "B5", "C5", "D5", "E5", "E6", "E7", "F7"];
+  const tableHeader = [
+    "A5",
+    "B5",
+    "C5",
+    "D5",
+    "E5",
+    "E6",
+    "E7",
+    "F7",
+    "G5",
+    "G6",
+    "G7",
+    "H7",
+    "I5",
+    "I6",
+    "I7",
+    "J7",
+    "K5",
+    "K6",
+    "K7",
+    "L7",
+  ];
   for (let th of tableHeader) {
     worksheet.getCell(th).alignment = {
       vertical: "middle",
@@ -481,16 +707,25 @@ export const genTechExcel = (
 
   const tableStartNum = 8;
 
-  const tbody = ["A", "B", "C", "D", "E", "F"];
-  let total = 0;
+  const tbody = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L"];
+  let total0 = 0;
+  let total1 = 0;
+  let total2 = 0;
+  let total3 = 0;
   for (let i = 0; i < tableData.length; i++) {
     const data = [
       i + 1,
       tableData[i].content || "",
       tableData[i].value || "",
       tableData[i].standard || "",
-      tableData[i].score || "",
-      tableData[i].reason || "",
+      tableData[i].score0,
+      tableData[i].reason0 || "",
+      tableData[i].score1,
+      tableData[i].reason1 || "",
+      tableData[i].score2,
+      tableData[i].reason2 || "",
+      tableData[i].score3,
+      tableData[i].reason3 || "",
     ];
     for (let j = 0; j < data.length; j++) {
       const td = tbody[j];
@@ -526,7 +761,16 @@ export const genTechExcel = (
         alignment = { vertical: "middle", horizontal: "center" };
         value = data[j];
         if (td == "E") {
-          total += Number(data[j]);
+          total0 += Number(data[j]);
+        }
+        if (td == "G") {
+          total1 += Number(data[j]);
+        }
+        if (td == "I") {
+          total2 += Number(data[j]);
+        }
+        if (td == "K") {
+          total3 += Number(data[j]);
         }
       }
       worksheet.getCell(`${td}${i + tableStartNum}`).alignment = alignment;
@@ -543,8 +787,18 @@ export const genTechExcel = (
 
   const denfenRowNum = tableData.length + tableStartNum;
   worksheet.mergeCells(`A${denfenRowNum}:D${denfenRowNum}`);
-  const denFenTd = ["A", "E", "F"];
-  const denFenData = ["得分", total, ""];
+  const denFenTd = ["A", "E", "F", "G", "H", "I", "J", "K", "L"];
+  const denFenData = [
+    "得分",
+    hName0 ? total0 : "",
+    "",
+    hName1 ? total1 : "",
+    "",
+    hName2 ? total2 : "",
+    "",
+    hName3 ? total3 : "",
+    "",
+  ];
   for (let i = 0; i < denFenData.length; i++) {
     const td = denFenTd[i];
     worksheet.getCell(`${td + denfenRowNum}`).border = {
@@ -570,7 +824,7 @@ export const genTechExcel = (
 
   const lastRowNum = denfenRowNum + 1;
   worksheet.addRow(["评审小组成员签字:"]);
-  worksheet.mergeCells(`A${lastRowNum}:E${lastRowNum}`);
+  worksheet.mergeCells(`A${lastRowNum}:L${lastRowNum}`);
   worksheet.getCell(`A${lastRowNum}`).alignment = { vertical: "middle" };
   const rowLast = worksheet.getRow(lastRowNum);
   rowLast.height = 20;
@@ -584,9 +838,9 @@ export const genTechExcel = (
  */
 export const genBidScoreExcel = (workbook, tableData, materialId, sName) => {
   const worksheet = workbook.addWorksheet("报价得分", {
-    pageSetup:{paperSize: 9, orientation:'landscape'}
+    pageSetup: { paperSize: 9, orientation: "landscape" },
   });
-  worksheet.pageSetup.printArea = 'A1:F11';
+  worksheet.pageSetup.printArea = "A1:F11";
 
   const columnWidth = [5, 34.5, 21.13, 21.13, 21.13, 21.13];
   for (let cw = 1; cw <= columnWidth.length; cw++) {
@@ -727,9 +981,9 @@ export const genBidScoreExcel = (workbook, tableData, materialId, sName) => {
  */
 export const genTotalScoreExcel = (workbook, tableData, zjNames) => {
   const worksheet = workbook.addWorksheet("评分汇总", {
-    pageSetup:{paperSize: 9, orientation:'landscape'}
+    pageSetup: { paperSize: 9, orientation: "landscape" },
   });
-  worksheet.pageSetup.printArea = 'A1:K9';
+  worksheet.pageSetup.printArea = "A1:K9";
   const columnWidth = [
     4.57, 35.25, 11.75, 11.75, 11.75, 11.75, 11.75, 9.48, 9.48, 9.48, 7.88,
   ];
@@ -942,12 +1196,18 @@ export const genIdeaExcel = (
   sName,
   kaibiaoTime,
   kaibiaoAddress,
-  idea
+  ideas
 ) => {
-  const worksheet = workbook.addWorksheet("评委意见表", {
-    pageSetup:{paperSize: 9, orientation:'portrait', showGridLines: true, fitToPage: true, fitToHeight: 1}
+  const worksheet = workbook.addWorksheet(`评委意见表`, {
+    pageSetup: {
+      paperSize: 9,
+      orientation: "portrait",
+      showGridLines: true,
+      fitToPage: true,
+      fitToHeight: 1,
+    },
   });
-  worksheet.pageSetup.printArea = 'A1:B6';
+  worksheet.pageSetup.printArea = "A1:B6";
 
   const columnWidth = [40.97, 39.63];
   for (let cw = 1; cw <= columnWidth.length; cw++) {
@@ -987,11 +1247,19 @@ export const genIdeaExcel = (
   row4.font = { name: "宋体", family: 4, size: 10 };
 
   let value = "";
-  const alignment = { vertical: "top" };
-  console.log({ idea });
-  if (idea) {
+  const alignment = { vertical: "top", wrapText: true };
+  if (ideas) {
+    let str = "";
+    for (let idea of ideas) {
+      str += idea.idea + "\r\n";
+    }
     value = {
-      richText: [{ font: { name: "宋体", family: 4, size: 10 }, text: idea }],
+      richText: [
+        {
+          font: { name: "宋体", family: 4, size: 10 },
+          text: str,
+        },
+      ],
     };
   }
   worksheet.mergeCells("A5:B5");
@@ -1008,38 +1276,49 @@ export const genIdeaExcel = (
   rowLast.font = { name: "宋体", family: 4, size: 10 };
 };
 
-export const genEvaluationDocx = (plan, tender, uKaiTime, totalScore1, zjNames, quoteScore) => {
-  const toubiaodanwei = totalScore1.map(item => item.hName).join('、');
-  const zhuanjia = zjNames.filter(name => name).join('、');
+export const genEvaluationDocx = (
+  plan,
+  tender,
+  uKaiTime,
+  totalScore1,
+  zjNames,
+  quoteScore
+) => {
+  const toubiaodanwei = totalScore1.map((item) => item.hName).join("、");
+  const zhuanjia = zjNames.filter((name) => name).join("、");
   const yuzhongbiao = {
-    name: '',
-    price: 0
+    name: "",
+    price: 0,
   };
 
-  let quoteScoreContent = `<p style="margin-top:0pt; margin-bottom:0pt; text-align:justify; line-height:150%; widows:0; orphans:0; font-size:10.5pt">开标记录:</p>`
-  quoteScore.forEach(element => {
+  let quoteScoreContent = `<p style="margin-top:0pt; margin-bottom:0pt; text-align:justify; line-height:150%; widows:0; orphans:0; font-size:10.5pt">开标记录:</p>`;
+  quoteScore.forEach((element) => {
     quoteScoreContent += `<p style="margin-top:0pt; margin-bottom:0pt; text-align:justify; line-height:150%; widows:0; orphans:0; font-size:10.5pt">
     <span style="width:238pt; display:inline-block">投标单位: ${element.hName}</span>
-    <span style="width:80pt; display:inline-block">  投标报价: ${element.quotePrice}  元</span></p>`
+    <span style="width:80pt; display:inline-block">  投标报价: ${element.quotePrice}  元</span></p>`;
   });
 
-  let scoreRankContent = `<p style="margin-top:0pt; margin-bottom:0pt; text-align:justify; line-height:150%; widows:0; orphans:0; font-size:10.5pt">得分排名:</p>`
-  totalScore1.forEach(element => {
+  let scoreRankContent = `<p style="margin-top:0pt; margin-bottom:0pt; text-align:justify; line-height:150%; widows:0; orphans:0; font-size:10.5pt">得分排名:</p>`;
+  totalScore1.forEach((element) => {
     if (element.size == 1) {
-      yuzhongbiao.name = element.hName
-      yuzhongbiao.price = quoteScore.find(item => item.hid === element.hid).quotePrice;
+      yuzhongbiao.name = element.hName;
+      yuzhongbiao.price = quoteScore.find(
+        (item) => item.hid === element.hid
+      ).quotePrice;
     }
-    scoreRankContent += `<p style="margin-top:0pt; margin-bottom:0pt; text-align:justify; line-height:150%; widows:0; orphans:0; font-size:10.5pt">第${element.size}名: ${element.hName}    得分: ${element.totalScore}</p>`
+    scoreRankContent += `<p style="margin-top:0pt; margin-bottom:0pt; text-align:justify; line-height:150%; widows:0; orphans:0; font-size:10.5pt">第${element.size}名: ${element.hName}    得分: ${element.totalScore}</p>`;
   });
-  
-  let content = `<p style="width: 100%;text-align: center;font-size: 35pt;margin-top: 100pt">评 标 决 议</p><p style="font-size: 12pt;margin-top: 30pt;text-align: center;">项目名称: ${plan.aName}</p>`;
-      content += `<p style="font-size: 12pt;margin-top: 30pt;text-align: center;">采 购 人: ${tender.sUnit}</p>`;
-      content += `<p style="font-size: 12pt;text-align: center;">代理机构: 黑龙江省国辰工程项目管理有限责任公司</p>`;
-      content += `<p style="font-size: 12pt;text-align: center;">开标日期: ${dayjs(uKaiTime).format("YYYY年MM月DD日")}</p>`;
-      content += `<div style="page-break-after:always"></div>`
 
-    // 创建一个表格的 HTML 字符串
-    const tableHTML = `<table cellspacing="0" cellpadding="0" style="border-collapse:collapse">
+  let content = `<p style="width: 100%;text-align: center;font-size: 35pt;margin-top: 100pt">评 标 决 议</p><p style="font-size: 12pt;margin-top: 30pt;text-align: center;">项目名称: ${plan.aName}</p>`;
+  content += `<p style="font-size: 12pt;margin-top: 30pt;text-align: center;">采 购 人: ${tender.sUnit}</p>`;
+  content += `<p style="font-size: 12pt;text-align: center;">代理机构: 黑龙江省国辰工程项目管理有限责任公司</p>`;
+  content += `<p style="font-size: 12pt;text-align: center;">开标日期: ${dayjs(
+    uKaiTime
+  ).format("YYYY年MM月DD日")}</p>`;
+  content += `<div style="page-break-after:always"></div>`;
+
+  // 创建一个表格的 HTML 字符串
+  const tableHTML = `<table cellspacing="0" cellpadding="0" style="border-collapse:collapse">
       <tr style="height:22.9pt">
           <td colspan="2" style="width:101.6pt; border-style:solid; border-width:0.75pt; padding-right:5.03pt; padding-left:5.03pt; vertical-align:middle">
               <p style="margin-top:0pt; margin-bottom:0pt; font-size:10.5pt">
@@ -1264,7 +1543,7 @@ export const genEvaluationDocx = (plan, tender, uKaiTime, totalScore1, zjNames,
           </td>
       </tr>
     </table>`;
-    content += tableHTML
+  content += tableHTML;
 
-    return content
-}
+  return content;
+};

+ 271 - 101
ruoyi-ui/src/views/tender/tender1/components/CompEval.vue

@@ -74,7 +74,7 @@
 <script>
 import { updateTender, getTender } from '@/api/system/tender/tender'
 import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
-import { getMarkAll, getQuoteScore, getTotal, getIdeas } from '@/api/mark/mark'
+import { getMarkAll, getQuoteScore, getTotal } from '@/api/mark/mark'
 import ExcelJS from 'exceljs'
 import JSZip from 'jszip'
 import { saveAs } from 'file-saver'
@@ -124,7 +124,11 @@ export default {
       totalScore: [],
       ZjNames: [],
 
-      canDownload: true
+      canDownload: true,
+      ideas: [],
+      examines: [],
+      responds: [],
+      techs: [],
     };
   },
   created () {
@@ -138,7 +142,6 @@ export default {
       this.getMarks()
       this.getQuoteScore()
       this.getTotal()
-      this.getIdea()
     }
   },
   methods: {
@@ -176,138 +179,243 @@ export default {
       const res = await getMarkAll({ sid: this.$route.query.sid })
 
       const data = res.data || []
+
       this.sName = data.sName
       this.uKaiPosition = data.uKaiPosition
       this.uKaiTime = data.uKaiTime
+
+
+      //所有供应商
+      const bidQuotes = data.bidQuotes
+      //每页数量
+      const pageSize = 4
+      //总页数
+      const totalPage = Math.ceil(bidQuotes.length / pageSize)
+
+      //专家意见
+      const bidIdeas = data.bidIdeas
+      this.ideas = bidIdeas
       //资格审查
       const examineList = data.examineList
       const bidExpertExamines = data.bidExpertExamines
-      for (let examine of bidExpertExamines) {
-        examine.content = ''
-        examine.standard = ''
-        const expertExamine = examineList.find(item => item.id == examine.eid)
-        if (expertExamine) {
-          examine.content = expertExamine.content;
-          examine.standard = expertExamine.standard;
-        }
-      }
 
       //响应性
       const bidRespondList = data.bidRespondList
       const bidExpertResponds = data.bidExpertResponds
 
-      for (let xiangying of bidExpertResponds) {
-        xiangying.content = ''
-        xiangying.standard = ''
-        const expertRespond = bidRespondList.find(item => item.id == xiangying.rid)
-        if (expertRespond) {
-          xiangying.content = expertRespond.content;
-          xiangying.standard = expertRespond.standard;
-        }
-      }
 
-      //技术标
-      const bidTechList = data.bidTechList
-      const bidExpertTeches = data.bidExpertTeches
 
-      for (let jishu of bidExpertTeches) {
-        jishu.content = ''
-        jishu.standard = ''
-        jishu.value = ''
-        const expertTech = bidTechList.find(item => item.id == jishu.tid)
-        if (expertTech) {
-          jishu.content = expertTech.content;
-          jishu.standard = expertTech.standard;
-          jishu.value = expertTech.value;
-        }
-      }
+      //定义意见数组
+      // let ideas = []
+
+      //定义资格审查二维数组,进行分页
+      let examines = []
 
+      //定义响应性二维数组,进行分页
+      let responds = []
 
-      const supplier = {}
-      for (let item of bidExpertExamines) {
-        if (!supplier[item.hid]) {
-          supplier[item.hid] = {
-            hName: item.hName,
+      for (let i = 0; i < totalPage; i++) {
+        //获取每页的供应商数据
+        const currentBidQuotes = bidQuotes.slice(i * pageSize, i * pageSize + pageSize)
+        const currentBidQuotesLength = currentBidQuotes.length
+        //每页数据不足时,补充空数据
+        if (currentBidQuotesLength < pageSize) {
+          for (let k = 0; k < pageSize - currentBidQuotesLength; k++) {
+            currentBidQuotes.push({ hName: '', hid: '' })
           }
         }
-        if (!supplier[item.hid]['bidExpertExamines']) {
-          supplier[item.hid]['bidExpertExamines'] = [item]
-        } else {
-          supplier[item.hid]['bidExpertExamines'].push(item)
-        }
-      }
-      for (let item of bidExpertResponds) {
-        if (!supplier[item.hid]) {
-          supplier[item.hid] = {
-            hName: item.hName,
+
+        //定义的意见数组
+        // for (let idea of bidIdeas) {
+        //   const hName = currentBidQuotes.find(item => item.hid == idea.hid).hName
+        //   ideas.push({
+        //     hName,
+        //     idea: idea.idea,
+        //   })
+        // }
+
+
+        //定义每页的资格审查数组
+        const tempExamineArr = []
+        for (let examine of examineList) {
+          const tempExamineObj = {
+            content: examine.content,
+            standard: examine.standard,
+          }
+          //循环当前页的供应商数据,添加到每页的资格审查数组
+          for (let j = 0; j < currentBidQuotes.length; j++) {
+            tempExamineObj['hName' + j] = currentBidQuotes[j].hName
+            if (currentBidQuotes[j].hid) {
+              const expertExamine = bidExpertExamines.find(item => item.eid == examine.id && item.hid == currentBidQuotes[j].hid)
+              tempExamineObj['isOk' + j] = expertExamine?.isOk || ''
+            } else {
+              tempExamineObj['isOk' + j] = ''
+            }
           }
+          tempExamineArr.push(tempExamineObj)
         }
-        if (!supplier[item.hid]['bidExpertResponds']) {
-          supplier[item.hid]['bidExpertResponds'] = [item]
-        } else {
-          supplier[item.hid]['bidExpertResponds'].push(item)
+        examines = examines.concat([])
+        examines[i] = tempExamineArr
+
+        //定义每页的响应性数组
+        const tempRespondArr = []
+        for (let respond of bidRespondList) {
+          const tempRespondObj = {
+            content: respond.content,
+            standard: respond.standard,
+          }
+          //循环当前页的供应商数据,添加到每页的响应性数组
+          for (let j = 0; j < currentBidQuotes.length; j++) {
+            tempRespondObj['hName' + j] = currentBidQuotes[j].hName
+            if (currentBidQuotes[j].hid) {
+              const expertRespond = bidExpertResponds.find(item => item.rid == respond.id && item.hid == currentBidQuotes[j].hid)
+              tempRespondObj['isOk' + j] = expertRespond?.isOk || ''
+            } else {
+              tempRespondObj['isOk' + j] = ''
+            }
+          }
+          tempRespondArr.push(tempRespondObj)
         }
+        responds = responds.concat([])
+        responds[i] = tempRespondArr
       }
 
-      for (let item of bidExpertTeches) {
 
-        if (!supplier[item.hid]) {
-          supplier[item.hid] = {
-            hName: item.hName,
+      // this.ideas = ideas
+      this.examines = examines
+
+      this.responds = responds
+
+
+      //技术标
+      const bidTechList = data.bidTechList
+      const bidExpertTeches = data.bidExpertTeches
+
+      //评分的专家
+      const expertTeches = data.expertTeches
+
+      //合格供应商
+      let okSupplier = []
+      for (let quote of bidQuotes) {
+        let isOk = true
+        for (let expertExamine of bidExpertExamines) {
+          if (expertExamine.hid == quote.hid) {
+            if (expertExamine.isOk == '不合格') {
+              isOk = false
+              break
+            }
+          }
+        }
+        if (isOk) {
+          for (let expertRespond of bidExpertResponds) {
+            if (expertRespond.hid == quote.hid) {
+              if (expertRespond.isOk == '不合格') {
+                isOk = false
+                break
+              }
+            }
           }
         }
-        if (!supplier[item.hid]['bidExpertTeches']) {
-          supplier[item.hid]['bidExpertTeches'] = {}
+        if (isOk) {
+          okSupplier.push({
+            hid: quote.hid,
+            hName: quote.hName,
+          })
         }
-        if (!supplier[item.hid]['bidExpertTeches'][item.jName]) {
-          supplier[item.hid]['bidExpertTeches'][item.jName] = [item]
-        } else {
-          supplier[item.hid]['bidExpertTeches'][item.jName].push(item)
+      }
+
+      const totalOkSupplierPage = Math.ceil(okSupplier.length / pageSize)
+
+      const techs = []
+      for (let expert of expertTeches) {
+        const tempExpert = {
+          jid: expert.jid,
+          jName: expert.jName,
+          techs: []
         }
 
+        for (let i = 0; i < totalOkSupplierPage; i++) {
+          //获取每页的供应商数据
+          const currentSupplier = okSupplier.slice(i * pageSize, i * pageSize + pageSize)
+          const currentSupplierLength = currentSupplier.length
+          //每页数据不足时,补充空数据
+          if (currentSupplierLength < pageSize) {
+            for (let k = 0; k < pageSize - currentSupplierLength; k++) {
+              currentSupplier.push({ hName: '', hid: '' })
+            }
+          }
+
+          const tempTechArr = []
+          for (let tech of bidTechList) {
+            const tempTechObj = {
+              content: tech.content,
+              value: tech.value,
+              standard: tech.standard,
+            }
+
+            for (let j = 0; j < currentSupplier.length; j++) {
+              tempTechObj['hName' + j] = currentSupplier[j].hName
+              if (currentSupplier[j].hid) {
+                const expertTech = bidExpertTeches.find(item => item.tid == tech.id && item.hid == currentSupplier[j].hid && item.jid == expert.jid)
+                if (expertTech) {
+                  tempTechObj['score' + j] = expertTech.score
+                  tempTechObj['reason' + j] = expertTech.reason
+                } else {
+                  tempTechObj['score' + j] = ''
+                  tempTechObj['reason' + j] = ''
+                }
+
+              } else {
+                tempTechObj['score' + j] = ''
+                tempTechObj['reason' + j] = ''
+              }
+            }
+            tempTechArr.push(tempTechObj)
+          }
+
+          tempExpert.techs = tempExpert.techs.concat([])
+          tempExpert.techs[i] = tempTechArr
+
+        }
+        techs.push(tempExpert)
       }
-      this.supplier = supplier
-      console.log(supplier);
-    },
-    async getIdea () {
-      const res = await getIdeas({ sid: this.$route.query.sid })
-      this.ideas = res.data || []
-      console.log(res.data);
+      console.log({ techs });
+      this.techs = techs
     },
     async getQuoteScore () {
       const res = await getQuoteScore({ sid: this.$route.query.sid })
       this.quoteScore = res.data || []
 
     },
-    async getTotal () {
-      await getTotal({ sid: this.$route.query.sid })
-      .then(res => {
-        if (res.data) {
-          const data = res.data || []
-          let ZjNames = []
-          for (let i = 0; i < data.length; i++) {
-            const item = data[i]
-            const techList = item.techList
-
-            const techListLength = techList.length
-            if (techListLength < 5) {
-              for (let j = 0; j < 5 - techListLength; j++) {
-                techList.push({ score: '', jName: '' })
+    getTotal () {
+      getTotal({ sid: this.$route.query.sid })
+        .then(res => {
+          if (res.data) {
+            const data = res.data || []
+            let ZjNames = []
+            for (let i = 0; i < data.length; i++) {
+              const item = data[i]
+              const techList = item.techList
+
+              const techListLength = techList.length
+              if (techListLength < 5) {
+                for (let j = 0; j < 5 - techListLength; j++) {
+                  techList.push({ score: '', jName: '' })
+                }
+              }
+              if (i == 0) {
+                ZjNames = techList.map(tech => tech.jName)
               }
             }
-            if (i == 0) {
-              ZjNames = techList.map(tech => tech.jName)
-            }
+            this.totalScore = data
+            this.ZjNames = ZjNames
+            this.canDownload = false
           }
-          this.totalScore = data
-          this.ZjNames = ZjNames
-          this.canDownload = false
-        }
-      })
+        })
     },
     async handleDownloadExcel () {
       var zip = new JSZip();
-      
+
       await this.genEvaluationExcel(zip)
       await this.genPingshenExcel(zip)
       await this.genScoreExcel(zip)
@@ -316,7 +424,7 @@ export default {
         saveAs(content, "专家评审表.zip");
       })
     },
-    async genEvaluationExcel(zip) {
+    async genEvaluationExcel (zip) {
       const plan = this.plan
       const tender = this.tender
       const quoteScore = this.quoteScore
@@ -327,7 +435,7 @@ export default {
       const content = genEvaluationDocx(plan, tender, this.uKaiTime, totalScore, zjNames, quoteScore)
 
       let blob = htmlDocx.asBlob(content);
-      
+
       zip.file(`评标报告.docx`, blob);
     },
 
@@ -364,15 +472,77 @@ export default {
       const sName = this.sName
       const uKaiPosition = this.uKaiPosition
       const uKaiTime = this.uKaiTime
+
+      const workbook = new ExcelJS.Workbook()
+
+      //意见
+      const ideas = this.ideas
+      genIdeaExcel(workbook, sName, uKaiTime, uKaiPosition, ideas)
+
+      //资格审查
+      const examines = this.examines
+      for (let i = 0; i < examines.length; i++) {
+        const pageExamines = examines[i]
+
+        genExamineExcel(workbook, sName, uKaiTime, uKaiPosition, pageExamines, i + 1)
+      }
+
+      //响应性
+      const responds = this.responds
+      for (let i = 0; i < responds.length; i++) {
+        const pageResponds = responds[i]
+        genRespondExcel(workbook, sName, uKaiTime, uKaiPosition, pageResponds, i + 1)
+      }
+
+      //技术标
+      const techs = this.techs
+      for (let i = 0; i < techs.length; i++) {
+        for (let j = 0; j < techs[i].techs.length; j++) {
+          const pageTechs = techs[i].techs[j]
+          genTechExcel(workbook, sName, uKaiTime, uKaiPosition, pageTechs, techs[i].jName + "-" + (j + 1) + "-技术标")
+        }
+      }
+      const buffer = await workbook.xlsx.writeBuffer();
+      zip.file(`专家评审表.xlsx`, new Blob([buffer], { type: 'application/octet-stream' }));
+      // const supplier = this.supplier
+      // const hHidKeys = Object.keys(supplier)
+
+
+      // for (let hidKey of hHidKeys) {
+      //   const hName = supplier[hidKey].hName
+      //   const workbook = new ExcelJS.Workbook()
+      //   const idea = this.ideas.find(item => item.hid == hidKey)
+
+      //   genIdeaExcel(workbook, sName, uKaiTime, uKaiPosition, idea?.idea)
+      //   const expertExamines = supplier[hidKey].bidExpertExamines
+      //   genExamineExcel(workbook, sName, uKaiTime, uKaiPosition, hName, expertExamines)
+      //   const expertResponds = supplier[hidKey].bidExpertResponds
+      //   genRespondExcel(workbook, sName, uKaiTime, uKaiPosition, hName, expertResponds)
+      //   const expertTeches = supplier[hidKey].bidExpertTeches || {}
+      //   const jNamesKeys = Object.keys(expertTeches)
+      //   for (let jNameKey of jNamesKeys) {
+      //     const tech = expertTeches[jNameKey]
+      //     genTechExcel(workbook, sName, uKaiTime, uKaiPosition, hName, tech, jNameKey + '-技术标')
+      //   }
+
+      //   const buffer = await workbook.xlsx.writeBuffer();
+
+      //   zip.file(`专家评审表-${hName}.xlsx`, new Blob([buffer], { type: 'application/octet-stream' }));
+      // }
+    },
+    async genPingshenExcelOld (zip) {
+      const sName = this.sName
+      const uKaiPosition = this.uKaiPosition
+      const uKaiTime = this.uKaiTime
       const supplier = this.supplier
       const hHidKeys = Object.keys(supplier)
-      
-     
+
+
       for (let hidKey of hHidKeys) {
         const hName = supplier[hidKey].hName
         const workbook = new ExcelJS.Workbook()
         const idea = this.ideas.find(item => item.hid == hidKey)
-        
+
         genIdeaExcel(workbook, sName, uKaiTime, uKaiPosition, idea?.idea)
         const expertExamines = supplier[hidKey].bidExpertExamines
         genExamineExcel(workbook, sName, uKaiTime, uKaiPosition, hName, expertExamines)
@@ -384,9 +554,9 @@ export default {
           const tech = expertTeches[jNameKey]
           genTechExcel(workbook, sName, uKaiTime, uKaiPosition, hName, tech, jNameKey + '-技术标')
         }
-        
+
         const buffer = await workbook.xlsx.writeBuffer();
-    
+
         zip.file(`专家评审表-${hName}.xlsx`, new Blob([buffer], { type: 'application/octet-stream' }));
       }
     },