浏览代码

工作联系人创建评审

cehn 8 月之前
父节点
当前提交
503e760bca

+ 7 - 2
projects/textbook/src/app/textbook/textbook.component.ts

@@ -1,4 +1,4 @@
-import { Component, Input, OnInit } from '@angular/core';
+import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
 import { FormsModule, ReactiveFormsModule } from '@angular/forms';
 import { CommonCompModule } from '../../services/common.modules';
 import { Router, ActivatedRoute } from '@angular/router';
@@ -49,6 +49,7 @@ export class TextbookComponent implements OnInit {
   @Input('path') path: string = '/common/textbook/details';
   @Input('discard') discard: Boolean = false; //是否删除
   @Input('eduProcess') eduProcess?: Parse.Object; //流程id,verify存在时需要
+  @Output() updateCheck: EventEmitter<any> = new EventEmitter<any>();
 
   //相关权限配置
   @Input('filterObj') filterObj: any = {
@@ -337,6 +338,7 @@ export class TextbookComponent implements OnInit {
     // query.include('user')
     this.textbookList = await query.find();
     console.log(this.textbookList);
+    this.checkedAll = this.textbookList.every(item=> this.setOfCheckedId.has(item.id))
     this.loading = false;
   }
   async getDepartment(all?: boolean): Promise<any> {
@@ -375,6 +377,7 @@ export class TextbookComponent implements OnInit {
     this.getTextbook(this.searchValue);
   }
   onSearch(e: string) {
+    this.pageIndex = 1;
     console.log(e);
     this.getTextbook(e);
   }
@@ -387,7 +390,7 @@ export class TextbookComponent implements OnInit {
   //切换分页条数
   onPageSizeChange($event:any): void {
     console.log(this.limit);
-    this.onAllChecked(false)
+    // this.onAllChecked(false)
     this.pageIndex = 1
     this.getTextbook()
   }
@@ -405,6 +408,7 @@ export class TextbookComponent implements OnInit {
       this.setOfCheckedId = new Set<string>();
     }
     this.checkedAll = checked;
+    this.updateCheck.emit() //选项变更触发传递事件父组建
   }
   //单选
   onItemChecked(id: string, e: boolean) {
@@ -416,6 +420,7 @@ export class TextbookComponent implements OnInit {
     this.checkedAll = this.textbookList.every((item) =>
       this.setOfCheckedId.has(item.id)
     );
+    this.updateCheck.emit() //选项变更触发传递事件父组建
   }
   //退回
   reject(data?: Parse.Object) {

+ 1 - 1
projects/textbook/src/modules/nav-province-contact/activity/activity.component.html

@@ -67,7 +67,7 @@
               <p>更新时间:{{item?.get('updatedAt')|date:'yyyy-MM-dd HH:mm:ss'}}</p>
             </div>
             <div>
-              <button class="btn replay" nz-button nzType="primary">编辑</button><br>
+              <button class="btn replay" nz-button nzType="primary" (click)="goUrl('/nav-province-contact/manage/review-edit/'+item.id)">编辑</button><br>
               <button (click)="deleteGroup($index)" nz-button nzType="text" nzDanger>删除</button>
             </div>
           </li>

+ 22 - 5
projects/textbook/src/modules/nav-province-contact/activity/activity.component.ts

@@ -23,6 +23,7 @@ import { FormsModule } from '@angular/forms';
 import { NzSpinModule } from 'ng-zorro-antd/spin';
 import { MatDialogRef } from '@angular/material/dialog';
 import { DatePipe } from '@angular/common';
+import { NzModalService } from 'ng-zorro-antd/modal';
 
 @Component({
   selector: 'app-activity',
@@ -57,7 +58,8 @@ export class ActivityComponent implements OnInit {
     public tbookSer: textbookServer,
     private router: Router,
     private msg: NzMessageService,
-    public dialog: MatDialog
+    public dialog: MatDialog,
+    private modal: NzModalService
   ) { }
 
   saveLoading = true
@@ -169,14 +171,26 @@ export class ActivityComponent implements OnInit {
     let query = new Parse.Query('ExpertGroup')
     query.equalTo('eduProcess', this.eduProcess?.id)
     query.notEqualTo('isDeleted', true)
-    query.descending('createdAt')//大到小
+    query.descending('updatedAt')//大到小
     this.expertGroupList = await query.find()
     console.log(this.expertGroupList)
   }
   async deleteGroup(index: number) {
-    this.expertGroupList[index].set('isDeleted', true)
-    await this.expertGroupList[index].save()
-    this.expertGroupList.splice(index, 1)
+    this.modal.confirm({
+      nzTitle: '删除评审组',
+      nzContent: '你确定删除该评审组吗,删除后将不可撤销',
+      nzOkText: '确认',
+      nzOkType: 'primary',
+      nzOkDanger: true,
+      nzOnOk:async () => {
+        this.expertGroupList[index].set('isDeleted', true)
+        await this.expertGroupList[index].save()
+        this.expertGroupList.splice(index, 1)
+      },
+      nzCancelText: '取消',
+      nzOnCancel: () => console.log('Cancel')
+    });
+
     
   }
   /**创建评审组弹框 */
@@ -202,6 +216,9 @@ export class ActivityComponent implements OnInit {
 
     });
   }
+  goUrl(url:string){
+    this.router.navigate([url])
+  }
 }
 
 

+ 28 - 2
projects/textbook/src/modules/nav-province-contact/activity/review-edit/review-edit.component.html

@@ -4,7 +4,9 @@
       <span nz-icon nzType="left" nzTheme="outline"></span>返回
     </div>
   </nz-breadcrumb>
-  <nz-page-header-title>{{expertGroup?.get('name') || '-'}} </nz-page-header-title>
+  <nz-page-header-title
+    >{{ expertGroup?.get("name") || "-" }}
+  </nz-page-header-title>
 </nz-page-header>
 <div class="edit-content">
   <div class="edit-comp">
@@ -23,8 +25,32 @@
         [filterObj]="filterObj"
         [eduProcess]="eduProcess"
         [setOfCheckedId]="setOfCheckedTextbookAll"
+        (updateCheck)="updateCheck()"
         #textbook
-      ></app-textbook>
+      >
+      </app-textbook>
+      <div class="text-list">
+        <div class="list">
+          <div class="text">已选教材:</div>
+          @for (item of allTextbook; track $index) { @if (!showAll) {
+          <div [hidden]="$index >= 8" class="text-name">
+            {{ item.get("title") }}
+            <span [hidden]="$index >= 8-1 || $index == allTextbook.length - 1"
+              >;</span
+            >
+          </div>
+          }@else {
+          <div class="text-name">
+            {{ item.get("title") }}
+            <span [hidden]="$index == allTextbook.length - 1">;</span>
+          </div>
+          } } @if (allTextbook.length > 8) {
+          <div class="show-text" (click)="showAll = !showAll">
+            {{ showAll ? "合起教材" : "展开全部" }}
+          </div>
+          }
+        </div>
+      </div>
       }
     </div>
     <div class="fonter">

+ 35 - 5
projects/textbook/src/modules/nav-province-contact/activity/review-edit/review-edit.component.scss

@@ -8,10 +8,10 @@
 }
 
 .edit-content {
-  margin   : 0 0 20px;
-  padding  : 0 24px;
+  margin      : 0 0 20px;
+  padding     : 0 24px;
   // height   : calc(100% - 250px);
-  min-width: 1000px;
+  min-width   : 1000px;
 
   .title {
     font-family  : PingFang SC;
@@ -24,8 +24,38 @@
 
   .textbook {
     // height: 200px;
-    margin       : 10px auto;
+    margin: 10px auto;
+
     // background: aliceblue;
+    .text-list {
+      display: flex;
+
+      .list {
+        display  : flex;
+        flex-wrap: wrap;
+        flex     : 1;
+        font-size: 14px;
+
+        .text {
+          font-family: PingFang SC;
+          font-weight: 400;
+          line-height: 22px;
+          text-align : left;
+          color      : #231C1F99;
+        }
+
+        .text-name {
+          margin-left: 10px;
+        }
+
+        .show-text {
+          cursor: pointer;
+          color : #066BE7;
+          margin-left: 20px;
+          flex-shrink: 0;
+        }
+      }
+    }
   }
 
   .dep-comp {
@@ -56,7 +86,7 @@
           line-height: 22px;
           text-align : right;
           color      : #B21A39;
-          cursor: pointer;
+          cursor     : pointer;
         }
       }
     }

+ 19 - 1
projects/textbook/src/modules/nav-province-contact/activity/review-edit/review-edit.component.ts

@@ -32,7 +32,7 @@ export class ReviewEditComponent implements OnInit {
   eduProcess?: Parse.Object;
   expertGroup?: Parse.Object;
   setOfCheckedTextbookAll = new Set<string>(); //所有已选择教材
-  setOfCheckedProfileAll = new Set<string>(); //所有已选择教材
+  setOfCheckedProfileAll = new Set<string>(); //所有已选择评委
   get checkProfileListLeng(): number {
     return Array.from(this.setOfCheckedProfileAll).length;
   }
@@ -57,6 +57,9 @@ export class ReviewEditComponent implements OnInit {
   loading = false;
   showTextbook:boolean = false
 
+  allTextbook:Array<any> = [] //已选择教材列表
+  showAll:boolean = false
+
   constructor(
     private activeRoute: ActivatedRoute,
     public tbookSer: textbookServer,
@@ -90,10 +93,20 @@ export class ReviewEditComponent implements OnInit {
       await this.getExpertGroup()
       this.radio = res?.get('checkTextbook') ?? 'all';
       this.getProfile()
+      this.getTextName()
       this.radioReview = res?.get('checkReview') ?? 'all';
       this.showTextbook = true
     }
   }
+  //获取所有已选择教材名称展示
+  async getTextName(){
+    let query = new Parse.Query('EduTextbook');
+    query.notEqualTo('isDeleted', true);
+    query.containedIn('objectId', Array.from(this.setOfCheckedTextbookAll));
+    query.select('title')
+    let r = await query.find()
+    this.allTextbook = r
+  }
   //重置
   reset() {
     this.refresh();
@@ -187,6 +200,11 @@ export class ReviewEditComponent implements OnInit {
       ? this.setOfCheckedProfileAll.delete($event.id)
       : this.setOfCheckedProfileAll.add($event.id);
   }
+  updateCheck(){
+    console.log(this.textbook.setOfCheckedId);
+    this.setOfCheckedTextbookAll = this.textbook.setOfCheckedId
+    this.getTextName()
+  }
   /* 保存 */
   async onSave(type: string) {
     if (type == 'eduTextbook') {

+ 52 - 4
projects/textbook/src/modules/nav-province-contact/page-process/page-process.component.html

@@ -1,7 +1,9 @@
 <nz-page-header>
   <nz-breadcrumb nz-page-header-breadcrumb>
     <nz-breadcrumb-item>教材申报</nz-breadcrumb-item>
-    <nz-breadcrumb-item>申报流程</nz-breadcrumb-item>
+    <nz-breadcrumb-item>
+      <a (click)="back()">申报流程</a>
+    </nz-breadcrumb-item>
     <nz-breadcrumb-item
       ><a>{{
         eduProcess?.get("department")?.get("name") || "未选择申报单位"
@@ -23,20 +25,66 @@
       <app-process-create [isEdit]="true"></app-process-create>
       }
     </nz-tab>
+    <nz-tab nzTitle="评审活动">
+      <div class="examine">
+        <div class="title">{{ activity?.get("name") || "暂未设置" }}</div>
+        <div class="row">
+          <div class="lable">开始时间:</div>
+          <div class="val">{{ this.activity?.get("startDate") | date : "yyyy-MM-dd HH:mm" }}</div>
+        </div>
+        <div class="row">
+          <div class="lable">结束时间:</div>
+          <div class="val">{{ this.activity?.get("deadline") | date : "yyyy-MM-dd HH:mm" }}</div>
+        </div>
+        <div class="row">
+          <div class="lable">评审数量:</div>
+          <div class="val">{{ expertGroupLength || 0 }}</div>
+        </div>
+        <div class="examine-fonter">
+          <button
+            style="background: #3e49b3; border: 1px #3e49b3; margin-right: 50px"
+            nz-button
+            nzType="primary"
+            [disabled]="!activity?.id"
+          >
+            启动
+          </button>
+          <button
+            style="background: #a2a2a2; border: 1px #a2a2a2; margin-right: 50px"
+            nz-button
+            nzType="primary"
+            (click)="
+              toUrl('/nav-province-contact/manage/activity/' + eduProcess?.id)
+            "
+          >
+            编辑
+          </button>
+          @if (authCompute) {
+            <button
+            nzDanger
+            nz-button
+            nzType="primary"
+          >
+            计算平均分
+          </button>
+          }
+        </div>
+      </div>
+    </nz-tab>
     <nz-tab nzTitle="教材列表">
-      @if (active == 1 && eduProcess) {
+      @if (active == 2 && eduProcess) {
       <div class="title">待评审教材列表</div>
       <app-textbook
         [filterObj]="beforeFilterObj"
         [eduProcess]="eduProcess"
-        ></app-textbook>
+      ></app-textbook>
       <br />
       <div class="title">推荐教材列表</div>
       <app-textbook
         [filterObj]="afterFilterObj"
         [recommend]="true"
         [eduProcess]="eduProcess"
-        ></app-textbook>
+      ></app-textbook>
       }
     </nz-tab>
   </nz-tabset>

+ 23 - 0
projects/textbook/src/modules/nav-province-contact/page-process/page-process.component.scss

@@ -20,6 +20,29 @@
     text-align: left;
     margin-bottom: 16px;
   }
+  .examine{
+    border: 1px solid #e4e4e4d9;
+    padding: 20px;
+    .title{
+      font-weight: 600;
+      font-size: 18px;
+      line-height: 32px;
+    }
+    .row{
+      width: 200px;
+      display: flex;
+      justify-content: space-between;
+      margin-top: 10px;
+      color: rgba(0, 0, 0, 0.4509803922);
+      font-size: 14px;
+      font-weight: normal;
+      line-height: 1.5715;
+    }
+    .examine-fonter{
+      display: flex;
+      margin: 20px auto;
+    }
+  }
 }
 ::ng-deep .ant-page-header-heading-title {
   white-space: normal;

+ 35 - 2
projects/textbook/src/modules/nav-province-contact/page-process/page-process.component.ts

@@ -9,6 +9,8 @@ import { CompTableListComponent } from '../../../app/comp-table/comp-table-list/
 import { ProcessCreateComponent } from './process-create/process-create.component';
 import { TextbookComponent } from '../../../app/textbook/textbook.component';
 import { textbookServer } from '../../../services/textbook';
+import { DatePipe } from '@angular/common';
+
 @Component({
   selector: 'app-page-process',
   templateUrl: './page-process.component.html',
@@ -21,8 +23,10 @@ import { textbookServer } from '../../../services/textbook';
     ProcessCreateComponent,
     CompTableListComponent,
     TextbookComponent,
+    DatePipe,
   ],
   standalone: true,
+  providers: [DatePipe],
 })
 export class PageProcessComponent implements OnInit {
   active: number = 0;
@@ -52,7 +56,10 @@ export class PageProcessComponent implements OnInit {
       export: true,
     },
   };
-
+  activity?: Parse.Object
+  get authCompute():boolean{
+    return this.activity?.get("startDate") < new Date()
+  }
   constructor(
     private activeRoute: ActivatedRoute,
     public tbookSer: textbookServer,
@@ -88,14 +95,40 @@ export class PageProcessComponent implements OnInit {
           }
         }
         this.eduProcess = res;
+        this.getActivity()
+        this.getExpertGroup()
       }
     });
   }
-
+  async getActivity() {
+    let query = new Parse.Query('Activity')
+    query.notEqualTo('isDeleted', true)
+    query.equalTo('eduProcess', this.eduProcess?.id)
+    this.activity = await query.first()
+  }
+  /**评审组 */
+  expertGroupLength: Number = 0
+  async getExpertGroup() {
+    let query = new Parse.Query('ExpertGroup')
+    query.equalTo('eduProcess', this.eduProcess?.id)
+    query.notEqualTo('isDeleted', true)
+    query.descending('updatedAt')//大到小
+    this.expertGroupLength = await query.count()
+  }
   onCreateProcess() {
     this.router.navigate([
       '/nav-admin/manage/process/create',
       { cid: this.eduProcess?.id },
     ]);
   }
+  toUrl(url: string, params?: object) {
+    if (params) {
+      this.router.navigate([url, params]);
+    } else {
+      this.router.navigate([url]);
+    }
+  }
+  back() {
+    history.back();
+  }
 }

+ 4 - 4
projects/textbook/src/modules/nav-province-contact/page-process/process-list/process-list.component.html

@@ -10,8 +10,8 @@
   <nz-page-header-extra> </nz-page-header-extra>
 </nz-page-header>
 <div class="edit-content">
-  <nz-tabset [(nzSelectedIndex)]="active">
-    <nz-tab nzTitle="待评审教材">
+  <!-- <nz-tabset [(nzSelectedIndex)]="active">
+    <nz-tab nzTitle="待评审教材"> -->
       <div class="tool">
         <div class="tool-left">
           <!-- <div class="search">
@@ -204,7 +204,7 @@
           </ng-template>
         </div>
       </div>
-    </nz-tab>
+    <!-- </nz-tab>
     <nz-tab nzTitle="评审活动">
       <div class="examine">
         <div class="title">北京市评审活动</div>
@@ -248,7 +248,7 @@
         </div>
       </div>
     </nz-tab>
-  </nz-tabset>
+  </nz-tabset> -->
 </div>
 <!-- 全选操作:批量操作 -->
 <!-- <div class="batch-toolbar-modal" *ngIf="setOfCheckedId?.size">