Przeglądaj źródła

updata:attachment

xll 8 miesięcy temu
rodzic
commit
3119625f09

+ 136 - 4
projects/textbook/src/modules/nav-author/components/attachment/attachment.component.html

@@ -1,9 +1,120 @@
 <div class="entry">
   <!-- <form nz-form [formGroup]="validateForm" class="login-form" (ngSubmit)="submitForm()"> -->
-  <div class="author-content">
+  
+  
+  
+    <div class="author-content">
+      <div class="title">所有作者政治审查意见</div>
+      <div class="text">
+        <span style="color: red;">*</span>
+        从本申报平台 
+        <a (click)="downloadFile('教材编写人员政治审查表.docx')">下载格式要求</a>
+         后,对应作者姓名上传“作者政治审查表”,支持 PDF、JPG、JPEG、PNG 格式,大小不超过 2M。作者单位党委对作者进行审查,对政治思想表现情况进行评价,确保作者的正确政治方向、价值取向,无违法违纪等记录。
+        教材编写成员涉及多个不同单位时需要各单位分别出具意见,并由所在单位党委盖章。</div>
+     
+
+
+
+        
+        <nz-table #basicTable [nzData]="authorList" [nzScroll]="{ x: (maxWidth || '1200') + 'px' }">
+          <thead>
+            <tr>
+              <th nzWidth="80px" nzLeft nzAlign="right">序号</th>
+              <th nzWidth="160px" nzLeft>姓名</th>
+              <th nzWidth="160px">单位</th>
+              <th nzWidth="160px">出生年月</th>
+              <th nzWidth="160px">国籍</th>
+              <th nzWidth="160px">职务</th>
+              <th nzWidth="160px">职称</th>
+              <th nzWidth="300px">手机号码</th>
+              <th nzWidth="160px">电子邮箱</th>
+              <th nzWidth="160px">分工</th>
+              <th nzWidth="120px" nzRight>
+                作者诚信承诺签名
+                <span style="color: red;">*</span>
+              </th>
+              <th nzWidth="120px" nzRight>
+                作者政治审查表
+                <span style="color: red;">*</span>
+              </th>
+              <th nzWidth="100px" nzRight>操作</th>
+            </tr>
+          </thead>
+          <tbody>
+            @for (data of authorList; track data.mobile;let index = $index) {
+            <tr>
+              <td nzLeft nzAlign="right">{{ index + 1 }}</td>
+              <td nzLeft>
+                {{data.name}}
+              </td>
+              <td>
+               {{data.unit}}
+              </td>
+              <td>
+                {{data.birth}}
+              </td>
+              <td>
+                {{data.nationality}}
+              </td>
+              <td>
+                {{data.job}}
+              </td>
+              <td>
+                {{data.title}}
+              </td>
+              <td>
+                {{data.mobile}}
+              </td>
+              <td>
+                {{data.email}}
+              </td>
+              <td>
+                {{data.work}}
+              </td>
+              <td nzRight>
+                @if (data.signature) {
+                  <a style="color: #3e49b3;" (click)="openFile(data.signature)">签名文件</a>
+                }
+                <app-comp-upload (change)="upload($event, 'signature',index)"></app-comp-upload>
+              </td>
+              <td nzRight>
+                @if (data.examine) {
+                <a style="color: #3e49b3;" (click)="openFile(data.examine)">政治审查表 </a>
+                }
+                <app-comp-upload (change)="upload($event,'examine',index)"></app-comp-upload>
+              </td>
+              <td nzRight>
+                <!-- <a (click)="onPush('authorList', index)"><span nz-icon style="font-size: 20px; margin-right: 10px"
+                    nzType="plus-circle" nzTheme="outline"></span></a> -->
+                <a (click)="onDel('authorList', index)"><span nz-icon style="font-size: 20px" nzType="delete"
+                    nzTheme="outline"></span></a>
+              </td>
+            </tr>
+            }
+          </tbody>
+        </nz-table>
+
+
+
+    </div>
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+    <div class="author-content">
     <div class="title">教材版权信息</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-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)">
@@ -151,7 +262,12 @@
       支持上传PDF,大小不超过 2M
     </div>
   </div>
-  <div class="author-content">
+
+
+
+
+
+  <!-- <div class="author-content">
     <div class="title">作者政治审核表</div>
     <div class="text">
       <span style="color: red;">*</span> 作者政治审核表
@@ -173,7 +289,19 @@
     <div class="text upText" style="margin: 10px 0">
       支持上传PDF,大小不超过 2M
     </div>
-  </div>
+  </div> -->
+
+
+
+
+
+
+
+
+
+
+
+
   <!-- <div class="author-content">
       <div class="nav"><b>申报单位承诺意见</b></div>
       <div class="text">
@@ -198,6 +326,10 @@
       </nz-form-item>
     </div> -->
   <!-- </form> -->
+
+
+
+
 </div>
 <div class="footer">
   <button nz-button nzType="default" style="margin-right: 20px" (click)="submitForm('save')">

+ 110 - 22
projects/textbook/src/modules/nav-author/components/attachment/attachment.component.ts

@@ -95,8 +95,8 @@ export class AttachmentComponent implements OnInit {
   }
 
 
-  /**作者政治审核表 {name: '',url: '',} */
-  examine: Array<any> = []
+  // /**作者政治审核表 {name: '',url: '',} */
+  // examine: Array<any> = []
 
 
   constructor(
@@ -116,7 +116,8 @@ export class AttachmentComponent implements OnInit {
       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.examine = this.eduTextbook?.get('examine') || this.examine
+      this.authorList = this.eduTextbook?.get('authorList')
     }
   }
 
@@ -170,16 +171,16 @@ export class AttachmentComponent implements OnInit {
         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.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
@@ -231,9 +232,9 @@ export class AttachmentComponent implements OnInit {
     /* 检验authorList字段是否留空 */
     let authorListAuth
     // console.log(textBookJson.authorList);
-    // authorListAuth = textBookJson.authorList.some((obj:any)=>{
-    //   return Object.keys(obj).some((item: string) => !obj[item])
-    // })
+    authorListAuth = textBookJson.authorList.some((obj:any)=>{
+      return Object.keys(obj).some((item: string) => !obj[item])
+    })
     // console.log(authorListAuth);
 
     if (isVrifly || authorListAuth) {
@@ -253,7 +254,8 @@ export class AttachmentComponent implements OnInit {
       expertOpinion: this.expertOpinion,
       evidence: this.evidence,
       moreMaterial: this.moreMaterial,
-      examine: this.examine,
+      // examine: this.examine,
+      authorList:this.authorList
       // unitMaterial: this.unitMaterial,
     }
     let isPageNull = this.examineNull()//检查本页空项
@@ -313,25 +315,32 @@ export class AttachmentComponent implements OnInit {
       this.eduTextbook?.set('cipProveFile', params.cipProveFile);
     params.moreMaterial &&
       this.eduTextbook?.set('moreMaterial', params.moreMaterial);
-    params.examine &&
-      this.eduTextbook?.set('examine', params.examine);
+    // 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);
     await this.eduTextbook?.save();
     return;
   }
-  upload(e: any, type: string) {
+  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') {
+      type == 'evidence' || type == 'unitMaterial') { 
       this[type].url = file?.url
       this[type].name = file?.name
-    } else if (type == 'moreMaterial' || type == 'examine' || type == 'cipProveFile') {
+    } 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)
   }
+
+
+
   /**获取文件名 */
   getFileName(url: string) {
     if (!url) return ''
@@ -359,4 +368,83 @@ export class AttachmentComponent implements OnInit {
     console.log(url);
     window.open(url)
   }
+
+
+  /**作者信息 */
+  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;
+    }
+  }
 }