|
@@ -100,12 +100,14 @@ export async function exportProcessReportDocs(processId,bookList) {
|
|
|
let textbookList
|
|
|
if(processId){ // 流程读取教材列表
|
|
|
let query = new Parse.Query("EduTextbook")
|
|
|
+ query.include("childrens")
|
|
|
query.equalTo("recommend",true);
|
|
|
query.equalTo("eduProcess",processId);
|
|
|
textbookList = await query.find();
|
|
|
}
|
|
|
if(bookList?.length){ // 直接导出教材列表
|
|
|
let query = new Parse.Query("EduTextbook")
|
|
|
+ query.include("childrens")
|
|
|
query.containedIn("objectId",bookList);
|
|
|
textbookList = await query.find();
|
|
|
}
|
|
@@ -152,6 +154,15 @@ function renderReportDocsByTextbook(textbook){
|
|
|
let json = textbook.toJSON();
|
|
|
let bookid = json.code || json?.objectId;
|
|
|
|
|
|
+ // 默认单册为第一分册
|
|
|
+ let book1Data = json?.childrens?.[0]
|
|
|
+ if(book1Data){
|
|
|
+ Object.keys(book1Data).forEach(key=>{
|
|
|
+ json[key] = book1Data[key] || json[key] || ""
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
// console.log(json)
|
|
|
// 圆圈选中未选 ○ 未选 ● 选中
|
|
|
let circleCheck = ["○","●"];
|
|
@@ -180,20 +191,21 @@ function renderReportDocsByTextbook(textbook){
|
|
|
let is101 = circleCheck[(json?.approval?.indexOf("101计划")>-1)?1:0]; // 2024新重点
|
|
|
let isZY = circleCheck[(json?.approval?.indexOf("中央")>-1)?1:0];
|
|
|
let isSX = circleCheck[(json?.approval?.indexOf("四新")>-1)?1:0];
|
|
|
- let isJS = circleCheck[(importantProject?.indexOf("建设")>-1)?1:0];
|
|
|
+ let isJS = circleCheck[(json?.approval?.indexOf("建设")>-1)?1:0];
|
|
|
+
|
|
|
|
|
|
let isNotImpt = (json?.approval?.indexOf("101计划")==-1) && (json?.approval?.indexOf("中央")==-1) && (json?.approval?.indexOf("四新")==-1) && (json?.approval?.indexOf("建设")==-1)
|
|
|
isNotImpt = circleCheck[isNotImpt?1:0];
|
|
|
// 初版时间
|
|
|
- let firstDate = new Date(textbook?.get("editionFirst"));
|
|
|
+ let firstDate = new Date(book1Data?.editionFirst.iso);
|
|
|
let firstYear = firstDate?.getFullYear();
|
|
|
let firstMonth = firstDate?.getMonth()+1;
|
|
|
// 本版时间印次
|
|
|
- let currentDate = new Date(textbook?.get("editionDate"));
|
|
|
+ let currentDate = new Date(book1Data?.editionDate.iso);
|
|
|
let currentYear = currentDate?.getFullYear();
|
|
|
let currentMonth = currentDate?.getMonth()+1;
|
|
|
// 最新时间印次
|
|
|
- let latestDate = new Date(textbook?.get("printDate"));
|
|
|
+ let latestDate = new Date(book1Data?.printDate.iso);
|
|
|
let latestYear = latestDate?.getFullYear();
|
|
|
let latestMonth = latestDate?.getMonth()+1;
|
|
|
// 初版至今重点项目
|
|
@@ -303,7 +315,7 @@ function renderReportDocsByTextbook(textbook){
|
|
|
firstMonth:firstMonth,
|
|
|
isZZ:circleCheck[(json?.carrierShape?.indexOf("纸质")>-1)?1:0],
|
|
|
isDZ:circleCheck[(json?.carrierShape?.indexOf("电子")>-1)?1:0],
|
|
|
- isSZ:circleCheck[(json?.carrierShape?.indexOf("数字")>-1)?1:0],
|
|
|
+ isSZ:circleCheck[(json?.carrierShape?.indexOf("数字")>-1 || json?.carrierShape?.indexOf("电子")>-1)?1:0],
|
|
|
isQT:circleCheck[(json?.carrierShape?.indexOf("附带")>-1)?1:0],
|
|
|
isFD:circleCheck[(json?.carrierShape?.indexOf("其他")>-1)?1:0],
|
|
|
latestY:latestYear,
|
|
@@ -350,8 +362,9 @@ function renderReportDocsByTextbook(textbook){
|
|
|
|
|
|
}
|
|
|
let bookData = json;
|
|
|
+
|
|
|
Object.keys(fixData).forEach(key=>{
|
|
|
- bookData[key] = fixData[key]
|
|
|
+ bookData[key] = fixData[key] || bookData[key] || ""
|
|
|
})
|
|
|
// console.log(bookData)
|
|
|
// console.log(json)
|