|
@@ -229,7 +229,7 @@ export async function exportProcessReportDocs(processId,bookList) {
|
|
|
|
|
|
module.exports.exportProcessReportDocs = exportProcessReportDocs
|
|
|
|
|
|
-function fixVolumeData(json,volumeData,index){
|
|
|
+function fixVolumeData(json,volumeData,index,totalJson){
|
|
|
json.index = index + 1;
|
|
|
// 教材基本信息
|
|
|
|
|
@@ -325,9 +325,8 @@ function fixVolumeData(json,volumeData,index){
|
|
|
json.isBSQT = circleCheck[(importantProject?.indexOf("其他省部级")>-1)?1:0];
|
|
|
json.isFirstNot = circleCheck[volumeData?.importantProject?.length > 0?0:1];
|
|
|
// 作者列表 + 政治审查表
|
|
|
- json.examineList = json.examineList || []
|
|
|
- let examineMap = {}
|
|
|
- json.examineList.forEach(item=>examineMap[item]=true)
|
|
|
+ totalJson.examineList = totalJson.examineList || []
|
|
|
+ // console.log(volumeData?.authorList)
|
|
|
for (let index = 0; index < 6; index++) { // 补充空值
|
|
|
if(!volumeData?.authorList?.[index]){
|
|
|
volumeData.authorList.push({name:"",unit:"",birth:"",nationality:"",job:"",title:"",mobile:"",email:"",work:""})
|
|
@@ -337,17 +336,17 @@ function fixVolumeData(json,volumeData,index){
|
|
|
item.index = index + 1
|
|
|
item.birth = toYearMonth(item?.birth)
|
|
|
if(item?.examine){
|
|
|
- examineMap[item?.examine] = true;
|
|
|
+ totalJson.examineList = pushDistinctItem(totalJson.examineList,item)
|
|
|
}
|
|
|
return item
|
|
|
})
|
|
|
+ // console.log(totalJson.examineList)
|
|
|
json.authorList = volumeData?.authorList;
|
|
|
- json.examineList = Object.keys(examineMap)
|
|
|
|
|
|
// 其他编者政治审查表
|
|
|
- json.otherList = json.otherList || []
|
|
|
+ totalJson.otherList = totalJson.otherList || []
|
|
|
if(volumeData?.otherEditor){
|
|
|
- json.otherList.push(volumeData?.otherEditor)
|
|
|
+ totalJson.otherList = pushDistinctItem(totalJson.otherList,volumeData?.otherEditor)
|
|
|
}
|
|
|
|
|
|
// 成果列表
|
|
@@ -379,7 +378,19 @@ function fixVolumeData(json,volumeData,index){
|
|
|
json.courses = volumeData?.courses;
|
|
|
return json
|
|
|
}
|
|
|
-
|
|
|
+function pushDistinctItem(list,item){
|
|
|
+ let isDistinct = true
|
|
|
+ if(list?.indexOf(item)>-1){
|
|
|
+ isDistinct = false;
|
|
|
+ }
|
|
|
+ if(list?.find(old=>old?.name&&old?.name==item?.name)){
|
|
|
+ isDistinct = false;
|
|
|
+ }
|
|
|
+ if(isDistinct){
|
|
|
+ list.push(item);
|
|
|
+ }
|
|
|
+ return list
|
|
|
+}
|
|
|
function renderReportDocsByTextbook(textbook){
|
|
|
console.log("renderReportDocsByTextbook")
|
|
|
return new Promise(async (resolve)=>{
|
|
@@ -406,12 +417,12 @@ function renderReportDocsByTextbook(textbook){
|
|
|
// 教材适用
|
|
|
let characteristic = (json?.characteristic?.filter(item=>item?.checked).map(item=>item.label) || [])?.join(",")
|
|
|
|
|
|
- json = fixVolumeData(json,book1Data,0)
|
|
|
+ json = fixVolumeData(json,book1Data,0,json)
|
|
|
let volumeList = []
|
|
|
for (let index = 0; index < 12; index++) {
|
|
|
if(json?.childrens?.[index]){
|
|
|
let volumeData = json?.childrens?.[index]
|
|
|
- volumeData = fixVolumeData(volumeData,volumeData,index)
|
|
|
+ volumeData = fixVolumeData(volumeData,volumeData,index,json)
|
|
|
volumeList.push(volumeData)
|
|
|
}
|
|
|
}
|
|
@@ -450,9 +461,10 @@ function renderReportDocsByTextbook(textbook){
|
|
|
// console.log("json.examineList");
|
|
|
// console.log(json.examineList);
|
|
|
|
|
|
- json.examineList.forEach(fileurl=>{
|
|
|
- if(fileurl) mergeFiles.push(fileurl)
|
|
|
+ json.examineList.forEach(author=>{
|
|
|
+ if(author?.examine) mergeFiles.push(author?.examine)
|
|
|
})
|
|
|
+ // console.log(mergeFiles)
|
|
|
|
|
|
let otherMap = {}
|
|
|
json?.otherList?.forEach(item=>{ // 合并不重复其他编者政治审查表
|