xll 8 月之前
父節點
當前提交
616427b0c0

+ 4 - 1
projects/textbook/src/modules/nav-author/components/attachment/attachment.component.ts

@@ -208,7 +208,10 @@ export class AttachmentComponent implements OnInit {
       this.msg.create('warning', '请返回选择适用课程性质')
       return true
     }
-
+    if(this.eduTextbook?.get('accept')!='本人自愿参加此次申报,已认真填写并检查以上材料,保证内容真实。'){
+      this.msg.create('warning', '请返回输入诚信承诺')
+      return true
+    }
     let eduColumn = eduTextBook.EduTextbook.fields
     let ignoreFiled = [
       'typeNumber', 'code', 'editionNumber', 'importantProjectOther',

+ 21 - 4
projects/textbook/src/modules/nav-author/components/faith/faith.component.html

@@ -25,7 +25,18 @@
         </nz-form-control>
       </nz-form-item>
     </div> -->
-  <form nz-form [formGroup]="validateForm" nzLayout="vertical">
+
+
+    <div class="author-content">
+      <div class="nav"><b>教材作者诚信承诺</b></div>
+      <p>输入诚信承诺:本人自愿参加此次申报,已认真填写并检查以上材料,保证内容真实。</p>
+      <input [(ngModel)]="value" (ngModelChange)="changeAccept()" nz-input placeholder="请输入承诺内容" />
+
+    </div>
+
+
+
+  <!-- <form nz-form [formGroup]="validateForm" nzLayout="vertical">
     <div class="author-content">
       <div class="nav"><b>教材作者诚信承诺</b></div>
       <p>输入诚信承诺:本人自愿参加此次申报,已认真填写并检查以上材料,保证内容真实。</p>
@@ -35,7 +46,7 @@
         </nz-form-control>
       </nz-form-item>
     </div>
-    <!-- <div class="author-content">
+    <div class="author-content">
       <div class="nav"><b>申报单位承诺意见</b></div>
       <div class="text">
         高校主管领导输入以下承诺:已对教材有关信息及填报的内容进行核实,保证真实性。经对该教材评审评价,同意该教材申报。并在导出函报文件后签字加盖高校公章;
@@ -49,9 +60,15 @@
           </nz-textarea-count>
         </nz-form-control>
       </nz-form-item>
-    </div> -->
-  </form>
+    </div>
+  </form> -->
 </div>
+
+
+
+
+
+
 <div class="footer">
   <button nz-button nzType="default" style="margin-right: 20px" (click)="submitForm('save')">
     保存本页

+ 70 - 55
projects/textbook/src/modules/nav-author/components/faith/faith.component.ts

@@ -72,19 +72,27 @@ export class FaithComponent  implements OnInit {
   ) { }
   ngOnInit() {
     if (this.eduTextbook.id) {
-      this.validateForm = this.fb.group({
-        unitMaterial: [this.eduTextbook.get('unitMaterial')?.text||'' , [Validators.maxLength(200)]],
-        accept: [this.eduTextbook.get('accept') || '', [Validators.required]],
-      });
+
+      this.value = this.eduTextbook.get('accept') || ''
+
+
+      // this.validateForm = this.fb.group({
+      //   // unitMaterial: [this.eduTextbook.get('unitMaterial')?.text||'' , [Validators.maxLength(200)]],
+      //   accept: [this.eduTextbook.get('accept') || '', [Validators.required]],
+      // });
     }
   }
   value:string=''
 
 
   async submitForm(event?: string): Promise<void> {
-
-    let params: any = this.validateForm.value;
-    console.log(params)
+    if(this.value!='本人自愿参加此次申报,已认真填写并检查以上材料,保证内容真实。'){
+      this.msg.error('诚信承诺输入错误,请正确输入');
+      // return
+    }
+    // let params: any = this.validateForm.value;
+    // console.log(params)
+    let params = {accept:this.value}
     await this.saveEduTextbook(params);
 
     if (event == 'pre') {//上一步
@@ -107,6 +115,7 @@ export class FaithComponent  implements OnInit {
   }
 
   async saveEduTextbook(params: any) {
+    
     if (!this.eduTextbook) {
       this.msg.error('请先创建教材');
       return;
@@ -117,59 +126,65 @@ export class FaithComponent  implements OnInit {
       className: 'Company',
       objectId: this.tbookSer.company,
     });
-    params.unitMaterial &&
-      this.eduTextbook?.set('unitMaterial',{text:params.unitMaterial} );
+    // params.unitMaterial &&
+    //   this.eduTextbook?.set('unitMaterial',{text:params.unitMaterial} );
       params.accept &&
       this.eduTextbook?.set('accept', params.accept);
     await this.eduTextbook?.save();
     return;
   }
-  upload(e: any, type: string, index?: any) {
-    let file = e[(e?.length - 1) || 0];
-    if(type=='unitMaterial'){
-      this[type].url = file?.url
-      this[type].name = file?.name
+  // upload(e: any, type: string, index?: any) {
+  //   let file = e[(e?.length - 1) || 0];
+  //   if(type=='unitMaterial'){
+  //     this[type].url = file?.url
+  //     this[type].name = file?.name
+  //   }
+  // }
+
+
+
+  // /**获取文件名 */
+  // getFileName(url: string) {
+  //   if (!url) return ''
+  //   let str = url?.split('/')[5]
+  //   let index = str?.indexOf('-')
+  //   let result = decodeURIComponent(str?.substring(index + 1))
+  //   return result || '未知文件名'
+  // }
+
+  // downloadFile(fileName: string) {
+  //   // let fileName = '十四五”普通高等教育本科国家级规划教材第一次遴选推荐申报表.docx'
+  //   const fileUrl = `../../../../../public/file/${fileName}`;
+  //   this.http.get(fileUrl, { responseType: 'blob' }).subscribe((blob) => {
+  //     const url = window.URL.createObjectURL(blob);
+  //     const a = document.createElement('a');
+  //     a.href = url;
+  //     a.download = fileName;
+  //     document.body.appendChild(a);
+  //     a.click();
+  //     document.body.removeChild(a);
+  //     window.URL.revokeObjectURL(url);
+  //   })
+  // }
+  // openFile(url: string) {
+  //   console.log(url);
+  //   window.open(url)
+  // }
+
+
+  // validateForm: FormGroup<{
+  //   // unitMaterial: FormControl<string | null>;
+  //   accept: FormControl<string | null>;
+  // }> = this.formBuilder.group({
+  //   // unitMaterial: ['', [Validators.maxLength(200)]],
+  //   accept: ['', [Validators.maxLength(100)]]
+
+  // });
+  changeAccept(){
+    console.log(this.value)
+    let str = '本人自愿参加此次申报,已认真填写并检查以上材料,保证内容真实。'
+    if(str.indexOf(this.value)==-1){
+      this.msg.create('warning','请正确输入内容')
     }
   }
-
-
-
-  /**获取文件名 */
-  getFileName(url: string) {
-    if (!url) return ''
-    let str = url?.split('/')[5]
-    let index = str?.indexOf('-')
-    let result = decodeURIComponent(str?.substring(index + 1))
-    return result || '未知文件名'
-  }
-
-  downloadFile(fileName: string) {
-    // let fileName = '十四五”普通高等教育本科国家级规划教材第一次遴选推荐申报表.docx'
-    const fileUrl = `../../../../../public/file/${fileName}`;
-    this.http.get(fileUrl, { responseType: 'blob' }).subscribe((blob) => {
-      const url = window.URL.createObjectURL(blob);
-      const a = document.createElement('a');
-      a.href = url;
-      a.download = fileName;
-      document.body.appendChild(a);
-      a.click();
-      document.body.removeChild(a);
-      window.URL.revokeObjectURL(url);
-    })
-  }
-  openFile(url: string) {
-    console.log(url);
-    window.open(url)
-  }
-
-
-  validateForm: FormGroup<{
-    unitMaterial: FormControl<string | null>;
-    accept: FormControl<string | null>;
-  }> = this.formBuilder.group({
-    unitMaterial: ['', [Validators.maxLength(200)]],
-    accept: ['', [Validators.maxLength(100)]]
-
-  });
-
 }