xll 8 月之前
父節點
當前提交
e14e091f33

+ 5 - 154
projects/textbook/src/modules/nav-author/components/faith/faith.component.html

@@ -2,159 +2,7 @@
 
 
 
-  
- 
   <div class="author-content">
-    <div class="title">2.图书编校质量自查结果记录表(必须上传)</div>
-    <div class="text">
-      教材出版单位对申报教材的编校质量自查后,按要求提供图书编校质量自查结果记录表,并加盖出版社公章。全册教材的不同分册以不同文件分别上传。<a
-        (click)="downloadFile('图书编校质量自查结果记录表.docx')">下载模板</a>
-    </div>
-    <nz-form-item class="row" style="margin-bottom: 16px">
-      <nz-form-label class="label" [nzNoColon]="true" [nzSm]="10" [nzXs]="10" nzRequired>上传图书编校质量自查结果记录表</nz-form-label>
-      <nz-form-control class="val" nzErrorTip="请上图书编校质量自查结果记录表" style="width: 100%">
-        @if (selfResults?.url) {
-        <a style="color: #3e49b3;" (click)="openFile(selfResults?.url)">
-          <span nz-icon nzType="file" nzTheme="outline"></span>
-          自查结果记录表
-        </a>
-        }
-        <app-comp-upload [type]="'pdf'" [width]="320" (change)="upload($event, 'selfResults')"
-          title="上传PDF"></app-comp-upload>
-        <div class="text upText" style="margin: 10px 0">
-          支持上传PDF,大小不超过 2M
-        </div>
-      </nz-form-control>
-    </nz-form-item>
-  </div>
-  <div class="author-content">
-    <div class="title">3.专家审查意见表(必须上传)</div>
-    <div class="text">
-      由第一主编所在单位和出版机构邀请校内外相关学科专业领域专家,对教材进行思想性、学术性审核。专家不少于
-      3
-      名,其中半数以上为校外专家,专家分别实名评价并签字,并注明所在单位及专业身份。评价人不得是本教材的作者。<a (click)="downloadFile('专家审查意见表.docx')">下载模板</a>
-    </div>
-    <nz-form-item class="row" style="margin-bottom: 16px">
-      <nz-form-label class="label" [nzNoColon]="true" [nzSm]="10" [nzXs]="10" nzRequired>上传专家审查意见表</nz-form-label>
-      <nz-form-control class="val" nzErrorTip="请上传专家审查意见表" style="width: 100%">
-        @if (expertOpinion?.url) {
-        <a style="color: #3e49b3;" (click)="openFile(expertOpinion?.url)">
-          <span nz-icon nzType="file" nzTheme="outline"></span>
-          专家审查意见表
-        </a>
-        }
-        <app-comp-upload [type]="'pdf'" [width]="320" (change)="upload($event, 'expertOpinion')"
-          title="上传PDF"></app-comp-upload>
-        <div class="text upText" style="margin: 10px 0">
-          支持批量上传 PDF、JPG、JPEG、PNG 格式,单个大小不超过 2M
-        </div>
-      </nz-form-control>
-    </nz-form-item>
-  </div>
-  <div class="author-content">
-    <div class="title">4.教材使用情况证明材料(必须上传)</div>
-    <div class="text">
-      教材出版单位提供教材主要使用高校名单及使用情况证明材料,并加盖公章。
-      <!-- <a (click)="downloadFile('专家审查意见表.docx')">下载模板</a> -->
-    </div>
-    <nz-form-item class="row" style="margin-bottom: 16px">
-      <nz-form-label class="label" [nzNoColon]="true" [nzSm]="10" [nzXs]="10" nzRequired>教材使用情况证明材料</nz-form-label>
-      <nz-form-control class="val" nzErrorTip="请上教材使用情况证明材料" style="width: 100%">
-        @if (evidence?.url) {
-        <a style="color: #3e49b3;" (click)="openFile(evidence?.url)">
-          <span nz-icon nzType="file" nzTheme="outline"></span>
-          证明材料
-        </a>
-        }
-        <app-comp-upload [type]="'pdf'" [width]="320" (change)="upload($event, 'evidence')"
-          title="上传PDF"></app-comp-upload>
-        <div class="text upText" style="margin: 10px 0">
-          支持上传PDF,大小不超过 2M
-        </div>
-      </nz-form-control>
-    </nz-form-item>
-  </div>
-  <div class="author-content">
-    <div class="title">5.教材版权信息(必须上传)</div>
-    <nz-form-item class="row" style="margin-bottom: 16px">
-      <nz-form-label class="label" [nzNoColon]="true" [nzSm]="10" [nzXs]="10" nzRequired>版权页截图</nz-form-label>
-      <nz-form-control class="val" nzErrorTip="请上传版权页截图" style="width: 100%">
-        @if (copyrightImgUrl) {
-        <a style="color: #3e49b3;" (click)="openFile(copyrightImgUrl)">
-          <span nz-icon nzType="file" nzTheme="outline"></span>
-          版权页截图
-        </a>
-        }
-        <app-comp-upload [type]="'pdf'" [width]="320" [type]="'pdf'" (change)="upload($event, 'copyrightImgUrl')"
-          title="上传PDF"></app-comp-upload>
-
-        <div class="text upText" style="margin: 10px 0">
-          支持上传PDF,大小不超过 2M
-        </div>
-      </nz-form-control>
-    </nz-form-item>
-
-    <nz-form-item class="row" style="margin-bottom: 16px">
-      <nz-form-label class="label" [nzNoColon]="true" [nzSm]="10" [nzXs]="10" nzRequired>中国版本图书馆 CIP
-        查询截图</nz-form-label>
-      <nz-form-control class="val" nzErrorTip="请上传中国版本图书馆 CIP 查询截图" style="width: 100%">
-        @if (CIPImgUrl) {
-        <a style="color: #3e49b3;" (click)="openFile(CIPImgUrl)">
-          <span nz-icon nzType="file" nzTheme="outline"></span>
-          CIP 查询截图
-        </a>
-        }
-        <app-comp-upload [type]="'pdf'" [width]="320" (change)="upload($event, 'CIPImgUrl')"
-          title="上传PDF"></app-comp-upload>
-
-        <div class="text upText" style="margin: 10px 0">
-          支持批量上传 PDF 格式,单个文件大小不超过 2M。
-        </div>
-      </nz-form-control>
-    </nz-form-item>
-
-
-
-
-
-
-
-  <!-- <div class="author-content">
-    <div class="title">作者政治审核表</div>
-    <div class="text">
-      <span style="color: red;">*</span> 作者政治审核表
-      <a (click)="downloadFile('教材编写人员政治审查表.docx')">下载模板</a>
-    </div>
-    @if (examine.length>0) {
-    @for (url of examine; track $index) {
-    <p>
-      <a style="color: #3e49b3;font-size: 14px;" (click)="openFile(url?.url)">
-        <span nz-icon nzType="file" nzTheme="outline"></span>
-        作者政治审核表 {{$index+1}}
-      </a>
-    </p>
-    }
-    }
-    <app-comp-upload [type]="'pdf'" [width]="320" [maxlenght]="99" (change)="upload($event, 'examine')"
-      title="上传PDF"></app-comp-upload>
-
-    <div class="text upText" style="margin: 10px 0">
-      支持上传PDF,大小不超过 2M
-    </div>
-  </div> -->
-
-
-
-
-
-
-
-
-
-
-
-
-  <!-- <div class="author-content">
       <div class="nav"><b>申报单位承诺意见</b></div>
       <div class="text">
         作者 /
@@ -176,7 +24,7 @@
           </div>
         </nz-form-control>
       </nz-form-item>
-    </div> -->
+    </div>
   <!-- </form> -->
 
 
@@ -188,6 +36,9 @@
     保存本页
   </button>
   <button nz-button nzType="default" style="margin-right: 20px" (click)="submitForm('pre')">
-    上一步
+    上一页
+  </button>
+  <button nz-button nzType="primary" style="background: #3e49b3; border: 1px #3e49b3" (click)="submitForm('next')">
+    下一页
   </button>
 </div>

+ 12 - 311
projects/textbook/src/modules/nav-author/components/faith/faith.component.ts

@@ -54,55 +54,12 @@ export class FaithComponent  implements OnInit {
   @Output() state: EventEmitter<any> = new EventEmitter<any>();
   @Output() save: EventEmitter<any> = new EventEmitter<any>();
 
-  //填写诚信承诺是否正确
-  confirmationValidator: ValidatorFn = (
-    control: AbstractControl
-  ): { [s: string]: boolean } => {
-    if (
-      control.value !=
-      '本人自愿参加此次申报,已认真填写并检查以上材料,保证内容真实'
-    ) {
-      return { required: true };
-    }
-    return {};
-  };
-
-
-  /** 版权页截图*/
-  copyrightImgUrl: string = ''
-  /** 中国版本图书馆CIP查询截图*/
-  CIPImgUrl: string = ''
-  /**cip证明材料 {name: '',url: '',} */
-  cipProveFile: Array<any> = []
-  /**图书编校质量自查结果记录表 */
-  selfResults: any = {
-    name: '',
-    url: '',
-  }
-  /** 专家审查意见表*/
-  expertOpinion: any = {
-    name: '',
-    url: '',
-  }
-  /** 教材使用情况证明材料*/
-  evidence: any = {
-    name: '',
-    url: '',
-  }
-  /**其他材料 {name: '',url: '',} */
-  moreMaterial: Array<any> = []
-
+  
   /**申报单位承诺意见 */
   unitMaterial: any = {
     name: '',
     url: '',
   }
-
-
-  // /**作者政治审核表 {name: '',url: '',} */
-  // examine: Array<any> = []
-
-
   constructor(
     public tbookSer: textbookServer,
     private msg: NzMessageService,
@@ -112,176 +69,25 @@ export class FaithComponent  implements OnInit {
   ) { }
   ngOnInit() {
     if (this.eduTextbook.id) {
-      this.copyrightImgUrl = this.eduTextbook?.get('copyrightImgUrl') || this.copyrightImgUrl
-      this.CIPImgUrl = this.eduTextbook?.get('CIPImgUrl') || this.CIPImgUrl
-      this.selfResults = this.eduTextbook?.get('selfResults') || this.selfResults
-      this.expertOpinion = this.eduTextbook?.get('expertOpinion') || this.expertOpinion
-      this.evidence = this.eduTextbook?.get('evidence') || this.evidence
-      this.moreMaterial = this.eduTextbook?.get('moreMaterial') || this.moreMaterial
-      this.cipProveFile = this.eduTextbook?.get('cipProveFile') || this.cipProveFile
       this.unitMaterial = this.eduTextbook?.get('unitMaterial') || this.unitMaterial
-      // this.examine = this.eduTextbook?.get('examine') || this.examine
-      this.authorList = this.eduTextbook?.get('authorList')
-    }
-  }
-
-  /**本页必填是否存在空项 */
-  examineNull() {
-    let isNull = false
-    let msgList = []
-    if (this.copyrightImgUrl == '' || !this.copyrightImgUrl) {
-      msgList.push('版权页截图')
-      isNull = true
-    }
-    // if (this.CIPImgUrl == '' || !this.CIPImgUrl) {
-    //   if (this.cipProveFile?.length > 0) {
-    //     let isExist = this.cipProveFile.every(item => item?.url == '' || !item?.url)
-    //     if (isExist) {
-    //       msgList.push('CIP 相关内容截图')
-    //       isNull = true
-    //     }
-    //   } else {
-    //       msgList.push('CIP 查询截图')
-    //       isNull = true
-    //   }
-    // } 
-    if (this.CIPImgUrl == '' || !this.CIPImgUrl) {
-      msgList.push('CIP查询截图')
-      isNull = true
     }
-    if (this.cipProveFile?.length > 0) {
-      let isExist = this.cipProveFile.every(item => item?.url == '' || !item?.url)
-      if (isExist) {
-        msgList.push('CIP证明材料')
-        isNull = true
-      }
-    }
-    if (this.selfResults.url == '' || !this.selfResults.url) {
-      msgList.push('自查结果记录表')
-      isNull = true
-    }
-    if (this.expertOpinion.url == '' || !this.expertOpinion.url) {
-      msgList.push('专家审查意见表')
-      isNull = true
-    }
-    if (this.evidence.url == '' || !this.evidence.url) {
-      msgList.push('证明材料')
-      isNull = true
-    }
-    if (this.moreMaterial?.length > 0) {
-      let isExist = this.moreMaterial.every(item => item?.url == '' || !item?.url)
-      if (isExist) {
-        msgList.push('其他材料')
-        isNull = true
-      }
-    }
-    // if (this.examine?.length <= 0) {
-    //   isNull = true
-    //   msgList.push('作者政治审核表')
-    // } else if (this.examine?.length > 0) {
-    //   let isExist = this.examine.every(item => item?.url == '' || !item?.url)
-    //   if (isExist) {
-    //     msgList.push('作者政治审核表')
-    //     isNull = true
-    //   }
-    // }
-    // if (this.unitMaterial.url == '' || !this.unitMaterial.url) {
-    //   msgList.push('申报单位承诺意见')
-    //   isNull = true
-    // }
-    // if (isNull) {
-    //   this.msg.create('error', `请上传完整 ${msgList.join()}`)
-    // }
-    return isNull
   }
 
-  /**判断是否存在未填字段 */
-  isIgnoreFiledNull() {
-    let selectList = this.eduTextbook?.get('characteristic')
-    let check = false
-    for (let i in selectList) {
-      if (selectList[i].label == '通识课' || selectList[i].label == '公共基础课' || selectList[i].label == '专业课') {
-        if (selectList[i].checked) {
-          check = true
-          break;
-        }
-      }
-    }
-    if (!check) {
-      // this.msg.create('warning', '请返回选择适用课程性质')
-      return true
-    }
-
-    let eduColumn = eduTextBook.EduTextbook.fields
-    let ignoreFiled = [
-      'typeNumber', 'code', 'editionNumber', 'importantProjectOther',
-      'textbookFiles', 'createdAt', 'updatedAt', 'copyright', 'authorSign',
-      'CIP', 'isDeleted', 'opinions', 'printNumber', 'printSum', 'render',
-      'importantProject', 'importantProjectOther', 'complete', 'links', 'recommend',
-      'printSun', 'discard', 'edition', 'eduProcess', 'authors', 'editor',
-      'copyrightImgUrl', 'CIPImgurl', 'selfResults', 'expertOpinion', 'evidence',
-      'moreMaterial', 'unitMaterial', 'approvedImgUrl', 'department','CIPImgUrl','cipProveFile',
-      'examine'
-    ] //非必填字段
-    let textBookJson = this.eduTextbook.toJSON()
-
 
-    let isVrifly = Object.keys(eduColumn).some((item: string) => {
-      if (!ignoreFiled.includes(item) && (textBookJson[item] === '' || textBookJson[item] === undefined || textBookJson[item] === null)) {
-        console.warn('字段未填写:' + item)
-        return true
-      }
-      return
-    })
-    /* 检验authorList字段是否留空 */
-    let authorListAuth
-    console.log(this.authorList);
-    authorListAuth = this.authorList.some((obj:any)=>{
-      return Object.keys(obj).some((item: string) => !obj[item])
-    })
-    // console.log(authorListAuth);
-
-    if (isVrifly || authorListAuth) {
-      // this.msg.warning('存在未填项')
-      return true
-    } else {
-      return false
-    }
-  }
 
   async submitForm(event?: string): Promise<void> {
     let params = {
-      copyrightImgUrl: this.copyrightImgUrl,
-      CIPImgUrl: this.CIPImgUrl,
-      cipProveFile: this.cipProveFile,
-      selfResults: this.selfResults,
-      expertOpinion: this.expertOpinion,
-      evidence: this.evidence,
-      moreMaterial: this.moreMaterial,
-      // examine: this.examine,
-      authorList:this.authorList
-      // unitMaterial: this.unitMaterial,
+      unitMaterial: this.unitMaterial,
     }
-    let isPageNull = this.examineNull()//检查本页空项
-    let isIgnoreFiled = this.isIgnoreFiledNull()//检查数据空项
-    // console.log(isPageNull, isIgnoreFiled);
     if (event == 'pre') {//上一步
       this.state.emit({ type: 'pre' });
       return;
     }
-    await this.saveEduTextbook(params, (!isPageNull && !isIgnoreFiled));
-    if (event == 'complete') {
-      this.state.emit({ type: 'complete', textBook: this.eduTextbook });
-      if (isPageNull || isIgnoreFiled) {
-        console.log('教材填写不完整');
-      } else {
-        this.eduTextbook.set('complete', true)
-        this.eduTextbook.set('status', '102')
-        await this.eduTextbook.save()
-        this.msg.success('已填写完成')
-      }
-      this.router.navigate(['/nav-author/manage/space'])
-    } else if (event == 'save') {
+    await this.saveEduTextbook(params);
+    if(event == 'next'){
+      this.state.emit({type:'next',textBook:this.eduTextbook});
+    }
+    else if (event == 'save') {
       this.modal.success({
         nzTitle: '保存成功',
         nzContent: '<p>已保存并且至空间</p>',
@@ -291,57 +97,28 @@ export class FaithComponent  implements OnInit {
     }
   }
 
-  async saveEduTextbook(params: any, isComplete: boolean) {
-    console.log(isComplete);
+  async saveEduTextbook(params: any) {
     if (!this.eduTextbook) {
       this.msg.error('请先创建教材');
       return;
     }
-    //如果填写未完整,仅保存,状态修改待完善101
-    if (this.eduTextbook.get('status') == '102' && !isComplete) {
-      this.eduTextbook?.set('status', '101');
-    } else if (!this.eduTextbook.get('status')) {
-      this.eduTextbook?.set('status', '101');
-    }
     this.eduTextbook?.set('user', Parse.User.current()?.toPointer());
     this.eduTextbook?.set('company', {
       __type: 'Pointer',
       className: 'Company',
       objectId: this.tbookSer.company,
     });
-    params.selfResults &&
-      this.eduTextbook?.set('selfResults', params.selfResults);
-    // params.unitMaterial &&
-    //   this.eduTextbook?.set('unitMaterial', params.unitMaterial);
-    params.expertOpinion &&
-      this.eduTextbook?.set('expertOpinion', params.expertOpinion);
-    params.evidence && this.eduTextbook?.set('evidence', params.evidence);
-    params.cipProveFile &&
-      this.eduTextbook?.set('cipProveFile', params.cipProveFile);
-    params.moreMaterial &&
-      this.eduTextbook?.set('moreMaterial', params.moreMaterial);
-    // params.examine &&
-    //   this.eduTextbook?.set('examine', params.examine);
-    this.eduTextbook?.set('copyrightImgUrl', params.copyrightImgUrl);
-    this.eduTextbook?.set('CIPImgUrl', params.CIPImgUrl);
-    this.eduTextbook?.set('authorList', params.authorList);
+    params.unitMaterial &&
+      this.eduTextbook?.set('unitMaterial', params.unitMaterial);
     await this.eduTextbook?.save();
     return;
   }
   upload(e: any, type: string, index?: any) {
     let file = e[(e?.length - 1) || 0];
-    if (type == 'copyrightImgUrl' || type == 'CIPImgUrl') {
-      this[type] = file?.url
-    } else if (type == 'selfResults' || type == 'expertOpinion' ||
-      type == 'evidence' || type == 'unitMaterial') { 
+    if(type=='unitMaterial'){
       this[type].url = file?.url
       this[type].name = file?.name
-    } else if (type == 'moreMaterial'  || type == 'cipProveFile') {
-      this[type] = [...(this[type] || []), { name: file.name, url: file.url }]
-    }else if (type == 'signature' || type == 'examine') {
-      this.authorList[index][type] = file?.url
     }
-    console.log(this.authorList)
   }
 
 
@@ -375,81 +152,5 @@ export class FaithComponent  implements OnInit {
   }
 
 
-  /**作者信息 */
-  authorList:Array<any>=[]
-
-   //添加作者信息
-   onPush(type: string, idx: number) {
-    switch (type) {
-      case 'authorList':
-        if (this.authorList?.length >= 6) {
-          this.msg.warning('最多添加6条');
-          break;
-        }
-        this.authorList.splice(idx + 1, 0, {
-          name: '',
-          unit: '',
-          birth: '',
-          nationality: '',
-          job: '',
-          title: '',
-          mobile: '',
-          email: '',
-          work: '',
-          signature: '',
-          examine: '',
-        });
-        break;
-      // case 'achievementOptions':
-      //   if (this.achievementOptions.length >= 5) {
-      //     this.msg.warning('最多添加5条');
-      //     return;
-      //   }
-      //   this.achievementOptions.splice(idx + 1, 0, {
-      //     name: '',
-      //     unit: '',
-      //     date: '',
-      //   });
-      //   break;
-    }
-  }
-   //删除作者信息
-   onDel(type: string, idx: number) {
-    switch (type) {
-      case 'authorList':
-        if (this.authorList.length == 1) {
-          this.authorList = [
-            {
-              name: '',
-              unit: '',
-              birth: '',
-              nationality: '',
-              job: '',
-              title: '',
-              mobile: '',
-              email: '',
-              work: '',
-              signature: '',
-              examine: '',
-            },
-          ];
-          return;
-        }
-        this.authorList.splice(idx, 1);
-        break;
-      // case 'achievementOptions':
-      //   if (this.achievementOptions.length == 1) {
-      //     this.achievementOptions = [
-      //       {
-      //         name: '',
-      //         unit: '',
-      //         date: '',
-      //       },
-      //     ];
-      //     return;
-      //   }
-      //   this.achievementOptions.splice(idx, 1);
-      //   break;
-    }
-  }
+ 
 }