Browse Source

高校联系人新增提交教材至工作联系人

cehn 7 months ago
parent
commit
eaf9e782c3

+ 64 - 44
projects/textbook/src/app/textbook/textbook.component.html

@@ -15,12 +15,7 @@
       ></ng-template>
     </div>
     @if (filterObj?.btns?.verify && count != 0) {
-    <div
-      class="sbt"
-      (click)="submitted()"
-    >
-      提交推荐教材列表
-    </div>
+    <div class="sbt" (click)="submitted()">提交推荐教材列表</div>
     }
   </div>
   <nz-table
@@ -206,6 +201,18 @@
                   <span nz-icon nzType="star" nzTheme="outline"></span>加入推荐
                 </button>
               </li>
+              }@if(filterObj.btns.beforSubmit){
+              <li nz-menu-item>
+                <button
+                  nz-button
+                  (click)="beforSubmit(data)"
+                  nzType="link"
+                  style="color: #231c1f"
+                >
+                  <span nz-icon nzType="upload" nzTheme="outline"></span
+                  >提交至工作联系人
+                </button>
+              </li>
               } @if(filterObj.btns.export){
               <li nz-menu-item>
                 <button
@@ -258,7 +265,7 @@
                   >提交教材
                 </button>
               </li>
-              } @if(filterObj.btns.isDelete){
+              }@if(filterObj.btns.isDelete){
               <li nz-menu-item>
                 <button
                   (click)="del(data)"
@@ -420,6 +427,18 @@
                   <span nz-icon nzType="star" nzTheme="outline"></span>加入推荐
                 </button>
               </li>
+              } @if(filterObj.btns.beforSubmit){
+              <li nz-menu-item>
+                <button
+                  nz-button
+                  (click)="beforSubmit(data)"
+                  nzType="link"
+                  style="color: #231c1f"
+                >
+                  <span nz-icon nzType="upload" nzTheme="outline"></span
+                  >提交至工作联系人
+                </button>
+              </li>
               } @if(filterObj.btns.export){
               <li nz-menu-item>
                 <button
@@ -484,20 +503,18 @@
                   >删除教材
                 </button>
               </li>
+              } @if(filterObj.btns.restore){
+              <li nz-menu-item>
+                <button
+                  (click)="restore(data)"
+                  nz-button
+                  nzType="link"
+                  style="color: #231c1f"
+                >
+                  <span nz-icon nzType="undo" nzTheme="outline"></span>恢复教材
+                </button>
+              </li>
               }
-              @if(filterObj.btns.restore){
-                <li nz-menu-item>
-                  <button
-                    (click)="restore(data)"
-                    nz-button
-                    nzType="link"
-                    style="color: #231c1f"
-                  >
-                    <span nz-icon nzType="undo" nzTheme="outline"></span
-                    >恢复教材
-                  </button>
-                </li>
-                }
             </ul>
           </nz-dropdown-menu>
           } @else { - }
@@ -513,7 +530,7 @@
 </div>
 <!-- 全选操作:批量操作 -->
 @if (filterObj.isCheck && setOfCheckedId.size) {
-<div class="batch-toolbar-modal" [style.left]="'calc(50% - '+ calc+'px)'">
+<div class="batch-toolbar-modal" [style.left]="'calc(50% - ' + calc + 'px)'">
   <div class="batch-toolbar">
     <div class="styles_counter__18S08">
       <span>已选</span>
@@ -537,8 +554,7 @@
         批量推荐
       </button>
     </div>
-    } 
-    @if(filterObj.btns.remove){
+    } @if(filterObj.btns.remove){
     <div class="batch-toolbar-actions">
       <div class="ant-space ant-space-horizontal ant-space-align-center">
         <div class="ant-space-item" style="margin-right: 16px">
@@ -557,16 +573,14 @@
         </div>
       </div>
     </div>
-    }
-    @if(filterObj.btns.export){
-      <div class="styles_cancel__AARoT">
-        <button nz-button nzType="text" (click)="exportProcess()">
-          <span nz-icon nzType="export" nzTheme="outline"></span>
-          批量导出
-        </button>
-      </div>
-      } 
-    @if(filterObj.btns.isDelete){
+    } @if(filterObj.btns.export){
+    <div class="styles_cancel__AARoT">
+      <button nz-button nzType="text" (click)="exportProcess()">
+        <span nz-icon nzType="export" nzTheme="outline"></span>
+        批量导出
+      </button>
+    </div>
+    } @if(filterObj.btns.isDelete){
     <div class="batch-toolbar-actions">
       <div class="ant-space ant-space-horizontal ant-space-align-center">
         <div class="ant-space-item" style="margin-right: 16px">
@@ -584,19 +598,25 @@
         批量提交
       </button>
     </div>
-    }
-    @if(filterObj.btns.restore){
-      <div class="batch-toolbar-actions">
-        <div class="ant-space ant-space-horizontal ant-space-align-center">
-          <div class="ant-space-item" style="margin-right: 16px">
-            <button nz-button nzType="text" (click)="restore()">
-              <span nz-icon nzType="undo" nzTheme="outline"></span>
-              恢复教材
-            </button>
-          </div>
+    } @if(filterObj.btns.beforSubmit){
+    <div class="styles_cancel__AARoT">
+      <button nz-button nzType="text" (click)="beforSubmit()">
+        <span nz-icon nzType="upload" nzTheme="outline"></span>
+        批量提交
+      </button>
+    </div>
+    } @if(filterObj.btns.restore){
+    <div class="batch-toolbar-actions">
+      <div class="ant-space ant-space-horizontal ant-space-align-center">
+        <div class="ant-space-item" style="margin-right: 16px">
+          <button nz-button nzType="text" (click)="restore()">
+            <span nz-icon nzType="undo" nzTheme="outline"></span>
+            恢复教材
+          </button>
         </div>
       </div>
-      } 
+    </div>
+    }
     <div class="styles_cancel__AARoT">
       <button nz-button nzType="text" (click)="onAllChecked(false)">
         取消选中

+ 143 - 65
projects/textbook/src/app/textbook/textbook.component.ts

@@ -33,7 +33,7 @@ interface filter {
     NzEmptyModule,
   ],
   standalone: true,
-  providers: [DatePipe]
+  providers: [DatePipe],
 })
 export class TextbookComponent implements OnInit {
   textbookList: Array<Parse.Object> = [];
@@ -55,7 +55,7 @@ export class TextbookComponent implements OnInit {
     showMore: false, //显示更多字段
     isCheck: true,
     noStared: false, //非推荐
-    team:false, //只获取当前部门或下级部门所属用户提交的教材
+    team: false, //只获取当前部门或下级部门所属用户的教材,且不限制是否提交
     btns: {
       edit: false, //编辑
       isDelete: false, //删除权限
@@ -64,6 +64,7 @@ export class TextbookComponent implements OnInit {
       star: false, //加入推荐
       remove: false, //移除推荐
       submit: false, //提交
+      beforSubmit: false, //高校联系人提交至工作联系人
       export: false,
       verify: false, //提交推荐权限
       restore: false, //恢复教材
@@ -105,9 +106,15 @@ export class TextbookComponent implements OnInit {
           value: '经中央有关部门审定的教材',
           text: '经中央有关部门审定的教材',
         },
-        { value: '首届全国教材建设奖优秀教材(高等教育类)教材', text: '首届全国教材建设奖优秀教材(高等教育类)教材' },
+        {
+          value: '首届全国教材建设奖优秀教材(高等教育类)教材',
+          text: '首届全国教材建设奖优秀教材(高等教育类)教材',
+        },
         { value: '“101计划”核心教材', text: '“101计划”核心教材' },
-        { value: '“四新”重点建设教材(含战略性新兴领域教材)', text: '“四新”重点建设教材(含战略性新兴领域教材)' },
+        {
+          value: '“四新”重点建设教材(含战略性新兴领域教材)',
+          text: '“四新”重点建设教材(含战略性新兴领域教材)',
+        },
         { value: '否', text: '否' },
       ],
       onChange: (data: any) => {
@@ -151,9 +158,9 @@ export class TextbookComponent implements OnInit {
   setOfCheckedId = new Set<string>();
   searchValue: string = '';
   manage: boolean = false;
-  calc:number = 120
+  calc: number = 120;
 
-  showLoading:boolean = false //全局
+  showLoading: boolean = false; //全局
 
   constructor(
     public tbookSer: textbookServer,
@@ -167,7 +174,7 @@ export class TextbookComponent implements OnInit {
   ngOnInit() {
     this.activeRoute.paramMap.subscribe(async (params) => {
       // this.eduProcessId = params.get('id');
-      this.calc += Object.values(this.filterObj?.btns).length * 70
+      this.calc += Object.values(this.filterObj?.btns).length * 70;
       this.getTextbook();
       if (Object.values(this.filterObj?.btns).some((item) => item)) {
         this.manage = true;
@@ -215,8 +222,10 @@ export class TextbookComponent implements OnInit {
     //   },
     // });
     let query = Parse.Query.or(query1);
-    if(this.filterObj.team){
-      let childrens = await this.tbookSer.getChild(this.tbookSer.profile.user.department?.objectId)
+    if (this.filterObj.team) {
+      let childrens = await this.tbookSer.getChild(
+        this.tbookSer.profile.user.department?.objectId
+      );
       let query3 = Parse.Query.fromJSON('EduTextbook', {
         where: {
           $or: [
@@ -224,7 +233,7 @@ export class TextbookComponent implements OnInit {
               user: {
                 $inQuery: {
                   where: {
-                    'department':{$in: [childrens],}
+                    department: { $in: [childrens] },
                   },
                   className: '_User',
                 },
@@ -232,11 +241,8 @@ export class TextbookComponent implements OnInit {
             },
           ],
         },
-      })
-      query = Parse.Query.and(
-        query3,
-        Parse.Query.or(query1)
-      )
+      });
+      query = Parse.Query.and(query3, Parse.Query.or(query1));
     }
     // }
     // this.uid && query.equalTo('user',this.tbookSer.profile.user?.objectId);
@@ -253,7 +259,7 @@ export class TextbookComponent implements OnInit {
     this.uid && query.equalTo('user', this.uid);
     query.descending('createdAt');
     query.notEqualTo('isDeleted', true);
-    if (!this.uid) {
+    if (!this.uid && !this.filterObj.team) {
       query.equalTo('render', true);
       // query.containedIn('status', ['200', '400']);
     }
@@ -366,7 +372,7 @@ export class TextbookComponent implements OnInit {
         if (data?.id) {
           data.set('status', '300');
           data.set('render', null);
-          data.set('code', null);
+          // data.set('code', null);
           await data.save();
         } else {
           let selectedList = this.textbookList.filter((item: any) =>
@@ -376,7 +382,7 @@ export class TextbookComponent implements OnInit {
             return new Promise((resolve) => {
               item.set('status', '300');
               item.set('render', null);
-              item.set('code', null);
+              // item.set('code', null);
               item.save().then(() => resolve(true));
             });
           });
@@ -457,7 +463,7 @@ export class TextbookComponent implements OnInit {
             this.getTextbook();
           } catch (err) {}
         }
-        this.onAllChecked(false)
+        this.onAllChecked(false);
         if (this.filterObj?.btns?.verify) {
           history.go();
         }
@@ -468,9 +474,9 @@ export class TextbookComponent implements OnInit {
   }
   //提交教材
   async submit(data?: Parse.Object) {
-    if(!this.tbookSer?.profile?.user?.department?.objectId){
-      this.message.error('当前账号暂未绑定所属单位')
-      return
+    if (!this.tbookSer?.profile?.user?.department?.objectId) {
+      this.message.error('当前账号暂未绑定所属单位');
+      return;
     }
     let parentMap = await this.tbookSer.formatNode(
       this.tbookSer?.profile?.user?.department?.objectId
@@ -481,10 +487,14 @@ export class TextbookComponent implements OnInit {
       this.message.warning('你的申报单位暂无进行的流程');
       return;
     }
-    let inviteUnit = parentMap[1]?.title //推荐单位
-    // if(parentMap[0]?.title == '省级教育行政部门' || parentMap[0]?.title == '有关部门(单位)教育司(局)'){
-    //   inviteUnit = parentMap[2]?.title
-    // }
+    let inviteUnit = parentMap[1]?.title; //推荐单位
+    let status = '200';
+    if (
+      parentMap[0]?.title == '省级教育行政部门' ||
+      parentMap[0]?.title == '有关部门(单位)教育司(局)'
+    ) {
+      status = '103';
+    }
     this.modal.confirm({
       nzTitle: '确认提交教材?',
       nzContent: `提交后,教材将不可编辑,并从「我的教材」移至「已提交评审教材」。`,
@@ -501,7 +511,7 @@ export class TextbookComponent implements OnInit {
             this.tbookSer.formatTime('YYYYmmdd', new Date()) +
             Math.random().toString().slice(-4);
           data.set('render', true);
-          data.set('status', '200');
+          data.set('status', status);
           data.set('code', t);
           data.set('eduProcess', {
             __type: 'Pointer',
@@ -534,7 +544,7 @@ export class TextbookComponent implements OnInit {
                   this.tbookSer.formatTime('YYYYmmdd', new Date()) +
                   Math.random().toString().slice(-4);
                 item.set('render', true);
-                item.set('status', '200');
+                item.set('status', status);
                 item.set('code', t);
                 item.set('eduProcess', {
                   __type: 'Pointer',
@@ -566,11 +576,9 @@ export class TextbookComponent implements OnInit {
                     failCount +
                     '条教材提交失败,请检查必填信息是否完整'
                 )
-              : this.message.success('已提交' +
-              count +
-              '条教材,' +
-              failCount +
-              '条教材提交失败');
+              : this.message.success(
+                  '已提交' + count + '条教材,' + failCount + '条教材提交失败'
+                );
             this.onAllChecked(false);
           } catch (err) {}
         }
@@ -580,6 +588,65 @@ export class TextbookComponent implements OnInit {
       nzOnCancel: () => console.log('Cancel'),
     });
   }
+
+  //高校联系人提交教材至工作联系人
+  async beforSubmit(data?: Parse.Object) {
+    if (this.eduProcess?.get('status') != '200') {
+      this.message.warning('当前流程状态非遴选中,不可此操作');
+      return;
+    }
+    this.modal.confirm({
+      nzTitle: '确认提交教材?',
+      nzContent: `将提交至工作联系人,并从「待提交教材」移至「待评审教材」。`,
+      nzOkText: '确认',
+      nzOkType: 'primary',
+      nzOkDanger: false,
+      nzOnOk: async () => {
+        if (data?.id) {
+          data.set('status', '200');
+          await data.save();
+          this.message.success('提交成功')
+        } else {
+          let count = 0,
+            failCount = 0;
+          let selectedList = this.textbookList.filter((item: any) =>
+            this.setOfCheckedId.has(item?.id)
+          );
+          let deletePromiseList = selectedList.map((item: any) => {
+            return new Promise((resolve) => {
+              if (item?.get('status') == '103') {
+                count++;
+                item.set('status', '200');
+                item.save().then(() => resolve(true));
+              } else {
+                failCount++;
+                resolve(true);
+              }
+            });
+          });
+          try {
+            await Promise.all(deletePromiseList);
+            failCount > 0
+              ? this.message.success(
+                  '已提交' +
+                    count +
+                    '条教材,' +
+                    failCount +
+                    '条教材提交失败,请检查教材是否已提交'
+                )
+              : this.message.success(
+                  '已提交' + count + '条教材,' + failCount + '条教材提交失败'
+                );
+            this.onAllChecked(false);
+          } catch (err) {}
+        }
+        this.getTextbook();
+      },
+      nzCancelText: '取消',
+      nzOnCancel: () => console.log('Cancel'),
+    });
+  }
+
   //恢复
   restore(data?: Parse.Object) {
     this.modal.confirm({
@@ -629,25 +696,24 @@ export class TextbookComponent implements OnInit {
   }
   //导出附件
   async exportProcess(data?: Parse.Object) {
-    if(this.showLoading) return
-    this.showLoading = true
-    try{
-      let bookList: Array<string> = []
-      if(data?.id){
-        bookList = [data?.id]
-      }else{
-        bookList = Array.from(this.setOfCheckedId)
+    if (this.showLoading) return;
+    this.showLoading = true;
+    try {
+      let bookList: Array<string> = [];
+      if (data?.id) {
+        bookList = [data?.id];
+      } else {
+        bookList = Array.from(this.setOfCheckedId);
       }
       // let processId = await this.getEduProcess(
       //   this.tbookSer.profile.user?.department?.objectId
       // );
-      await this.tbookSer.tbookExportReport({ bookList: bookList })
-      this.showLoading = false
-    }
-    catch(err){
-      this.message.error('导出超时,请稍后重试')
+      await this.tbookSer.tbookExportReport({ bookList: bookList });
+      this.showLoading = false;
+    } catch (err) {
+      this.message.error('导出超时,请稍后重试');
       console.log(err);
-      this.showLoading = false
+      this.showLoading = false;
     }
     // Parse.Cloud.run('tbookExportReport', { bookList: bookList }).then(
     //   (data) => {
@@ -673,10 +739,12 @@ export class TextbookComponent implements OnInit {
   }
   //报送
   async submitted() {
-    if(this.eduProcess?.get('status') == '400'){
-      this.message.warning('已提交报送,无需重复提交')
-      this.toUrl(`/nav-province-contact/manage/submitted/${this.eduProcess?.id}`)
-      return
+    if (this.eduProcess?.get('status') == '400') {
+      this.message.warning('已提交报送,无需重复提交');
+      this.toUrl(
+        `/nav-province-contact/manage/submitted/${this.eduProcess?.id}`
+      );
+      return;
     }
     // this.eduProcess?.set('status', '400');
     // this.eduProcess?.set('releaseDate', new Date());
@@ -694,7 +762,7 @@ export class TextbookComponent implements OnInit {
     ]);
     let count = await query.count();
     if (count > this.eduProcess?.get('num')) {
-      this.message.warning('当前推荐教材数量已超额')
+      this.message.warning('当前推荐教材数量已超额');
       return;
     }
     // await this.eduProcess?.save();
@@ -704,16 +772,16 @@ export class TextbookComponent implements OnInit {
     //   await item.save();
     // }
     // this.message.success('提交成功')
-    this.toUrl(`/nav-province-contact/manage/submitted/${this.eduProcess?.id}`)
+    this.toUrl(`/nav-province-contact/manage/submitted/${this.eduProcess?.id}`);
   }
   //导出表格
   async export() {
     console.log(this.eduProcess);
-    let query = new Parse.Query('EduProcess')
-    query.equalTo('objectId',this.eduProcess?.id)
-    query.include('profileSubmitted','profileSubmitted.user')
-    query.select('name','profileSubmitted')
-    let r = await query.first()
+    let query = new Parse.Query('EduProcess');
+    query.equalTo('objectId', this.eduProcess?.id);
+    query.include('profileSubmitted', 'profileSubmitted.user');
+    query.select('name', 'profileSubmitted');
+    let r = await query.first();
     let data: any = await this.getTextbook('', true);
     let table = `<table border="1px" cellspacing="0" cellpadding="0">
         <thead>
@@ -730,7 +798,9 @@ export class TextbookComponent implements OnInit {
             </tr>
             <tr>
                 <th></th><th></th>
-                <th style="font-size: 12px;font-family: '黑体';text-align: left;">单位名称(公章):${r?.get('name')}</th>
+                <th style="font-size: 12px;font-family: '黑体';text-align: left;">单位名称(公章):${r?.get(
+                  'name'
+                )}</th>
                 <th colspan="3"></th>
                 <th></th><th></th><th></th>
             </tr>
@@ -741,8 +811,14 @@ export class TextbookComponent implements OnInit {
             <tr>
                 <th></th><th></th>
                 <th style="font-size: 12px;font-family: '黑体';text-align: left;">申报工作联系人:</th>
-                <th colspan="2" style="font-size: 12px;font-family: '黑体';text-align: left;">姓名 ${r?.get('profileSubmitted')?.get('user')?.get('name')}</th>
-                <th colspan="2" style="font-size: 12px;font-family: '黑体';text-align: left;">电话 ${r?.get('profileSubmitted')?.get('user')?.get('phone')}</th>
+                <th colspan="2" style="font-size: 12px;font-family: '黑体';text-align: left;">姓名 ${r
+                  ?.get('profileSubmitted')
+                  ?.get('user')
+                  ?.get('name')}</th>
+                <th colspan="2" style="font-size: 12px;font-family: '黑体';text-align: left;">电话 ${r
+                  ?.get('profileSubmitted')
+                  ?.get('user')
+                  ?.get('phone')}</th>
                 <th></th><th></th><th></th>
             </tr>
             <tr>
@@ -768,7 +844,7 @@ export class TextbookComponent implements OnInit {
     for (var row = 0; row < data.length; row++) {
       _body += '<tr>';
       _body += '<td>';
-      _body += `${row+1}`;
+      _body += `${row + 1}`;
       _body += '</td>';
 
       _body += '<td>';
@@ -803,15 +879,17 @@ export class TextbookComponent implements OnInit {
       _body += `${data[row]?.get('editionUnit') || '-'}`;
       _body += '</td>';
 
-
       _body += '<td>';
-      _body += `${this.datePipe.transform(data[row]?.get('editionFirst'), 'yyyy-MM') || '-'}`;
+      _body += `${
+        this.datePipe.transform(data[row]?.get('editionFirst'), 'yyyy-MM') ||
+        '-'
+      }`;
       _body += '</td>';
 
       _body += '<td>';
       _body += `${data[row]?.get('carrierShape') || '-'}`;
       _body += '</td>';
-      
+
       _body += '</tr>';
     }
     table += _body;

+ 4 - 5
projects/textbook/src/modules/nav-admin/page-role/page-role.component.ts

@@ -568,18 +568,17 @@ export class PageRoleComponent implements OnInit {
   }
   //变更用户部门
   async showProfile(data: Parse.Object) {
+    let id = data?.get('user')?.get('department')?.id || data?.get('user')?.get('department')?.objectId
     let query = new Parse.Query('Department');
     query.include('parent', 'parent.parent');
-    let r = await query.get(data?.get('user')?.get('department')?.id);
-    this.parentMap = await this.tbookSer.formatNode(
-      data?.get('user')?.get('department')?.id
-    );
+    let r = await query.get(id);
+    this.parentMap = await this.tbookSer.formatNode(id);
     if (r?.get('parent')?.id) {
       this.parentList = await this.getDepart(r.get('parent').id);
     } else {
       this.parentList = this.parents;
     }
-    this.radio = data?.get('user')?.get('department')?.id;
+    this.radio = id;
     this.profileAccount = data;
     this.profileEdit = {
       //变更部门用户json

+ 5 - 1
projects/textbook/src/modules/nav-admin/user-edit/user-edit.component.ts

@@ -130,7 +130,11 @@ export class UserEditComponent implements OnInit {
         this.tbookSer.profile.identity == '工作联系人' &&
         arr.includes(this.profile.get('identity'))
       ) {
-        this.userType = ['教师', '评审专家', '高校联系人'];
+        if(this.tbookSer.profile.companyType == '省级教育行政部门' || this.tbookSer.profile.companyType == '有关部门(单位)教育司(局)'){
+          this.userType = ['教师', '评审专家', '高校联系人'];
+        }else{
+          this.userType = ['教师', '评审专家'];
+        }
         this.edit = true;
       } else if (
         this.tbookSer.profile.identity == '高校联系人' &&

+ 2 - 2
projects/textbook/src/modules/nav-author/space/space.component.ts

@@ -31,9 +31,9 @@ export class SpaceComponent implements OnInit {
     }
   }
   submitTextBook = {
-    status:['200','201','400'],
+    status:['103','200','201','400'],
     btns:{
-      review:true,//编辑
+      review:true,//查阅
     }
   }
   constructor(private router: Router, public tbookSer: textbookServer) {}

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

@@ -1,4 +1,4 @@
-@if (!editLoading && eduProcess?.id) {
+@if ((!editLoading && eduProcess?.id) || this.tbookSer.profile.identity == '高校联系人') {
 <nz-page-header>
   <nz-page-header-title
     >申报单位管理

+ 13 - 14
projects/textbook/src/modules/nav-province-contact/page-role/page-role.component.ts

@@ -158,15 +158,15 @@ export class PageRoleComponent implements OnInit {
       // history.back();
       return;
     }
-    let queryEduProcess = new Parse.Query('EduProcess');
-    queryEduProcess.notEqualTo('isDeleted', true);
-    queryEduProcess.equalTo('department', this.tbookSer.profile.user.department?.objectId)
     if(this.tbookSer.profile.identity == '工作联系人'){
+      let queryEduProcess = new Parse.Query('EduProcess');
+      queryEduProcess.notEqualTo('isDeleted', true);
+      queryEduProcess.equalTo('department', this.tbookSer.profile.user.department?.objectId)
       queryEduProcess.equalTo('profileSubmitted',this.tbookSer?.profile?.objectId)
+      queryEduProcess.select('objectId')
+      this.eduProcess = await queryEduProcess.first();
+      this.editLoading = false
     }
-    queryEduProcess.select('objectId')
-    this.eduProcess = await queryEduProcess.first();
-    this.editLoading = false
 
     let query = new Parse.Query('Department');
     query.equalTo('objectId', this.tbookSer.profile.user.department?.objectId);
@@ -527,7 +527,7 @@ export class PageRoleComponent implements OnInit {
       this.account.companyType = e.branch || e.title;
       if(this.tbookSer.profile.identity == '工作联系人'){
         this.userType = this.parents.some((item) => e.parent == item.id)
-        ? ['评审专家', '教师','高校联系人']
+        ? !e.type ? ['评审专家', '教师','高校联系人'] : ['评审专家', '教师']
         : e.type == '单位'
         ? ['评审专家', '高校联系人', '教师']
         : ['评审专家', '教师'];
@@ -537,7 +537,7 @@ export class PageRoleComponent implements OnInit {
       this.profileEdit.companyType = e.branch || e.title;
       if(this.tbookSer.profile.identity == '工作联系人'){
         this.userType = this.parents.some((item) => e.parent == item.id)
-        ? ['评审专家', '教师','高校联系人']
+        ? !e.type ? ['评审专家', '教师','高校联系人'] : ['评审专家', '教师']
         : e.type == '单位'
         ? ['评审专家', '高校联系人', '教师']
         : ['评审专家', '教师'];
@@ -615,17 +615,16 @@ export class PageRoleComponent implements OnInit {
 
   //变更用户部门
   async showProfile(data: Parse.Object) {
+    let id = data?.get('user')?.get('department')?.id || data?.get('user')?.get('department')?.objectId
     let query = new Parse.Query('Department');
     query.include('parent', 'parent.parent');
-    let r = await query.get(data?.get('user')?.get('department')?.id);
-    if(data?.get('user')?.get('department')?.id == this.tbookSer.profile.user.department?.objectId){
+    let r = await query.get(id);
+    if(id == this.tbookSer.profile.user.department?.objectId){
       this.parentList = this.nodes;
     }else{
       this.parentList = await this.getDepart(r.get('parent').id);
     }
-    this.parentMap = await this.tbookSer.formatNode(
-      data?.get('user')?.get('department')?.id
-    );
+    this.parentMap = await this.tbookSer.formatNode(id);
     let index = this.parentMap.findIndex(
       (item) => this.tbookSer.profile.user.department?.objectId == item.key
     );
@@ -637,7 +636,7 @@ export class PageRoleComponent implements OnInit {
       });
     }
 
-    this.radio = data?.get('user')?.get('department')?.id;
+    this.radio = id
     this.profileAccount = data;
     this.profileEdit = {
       //变更部门用户json

+ 14 - 7
projects/textbook/src/modules/nav-province-school-contact/page-textbook/page-textbook.component.html

@@ -19,17 +19,24 @@
   </nz-page-header-extra> -->
 </nz-page-header>
 <div class="conetent">
-  <!-- <nz-tabset [(nzSelectedIndex)]="active">
-    <nz-tab nzTitle="待评审教材">
+  <nz-tabset [(nzSelectedIndex)]="active">
+    <nz-tab nzTitle="草稿">
       @if (!active && eduProcess) {
+        <app-textbook
+        [filterObj]="draftFilterObj"
+      ></app-textbook>
+      }
+    </nz-tab>
+    <nz-tab nzTitle="待提交教材">
+      @if (active == 1 && eduProcess) {
         <app-textbook
         [eduProcess]="eduProcess"
         [filterObj]="beforeFilterObj"
       ></app-textbook>
       }
     </nz-tab>
-    <nz-tab nzTitle="推荐教材">
-      @if (active && eduProcess) {
+    <nz-tab nzTitle="待评审教材">
+      @if (active == 2 && eduProcess) {
         <app-textbook
         [filterObj]="afterFilterObj"
         [recommend]="true"
@@ -37,11 +44,11 @@
         ></app-textbook>
       }
     </nz-tab>
-  </nz-tabset> -->
-  @if (eduProcess) {
+  </nz-tabset>
+  <!-- @if (eduProcess) {
   <app-textbook
     [eduProcess]="eduProcess"
     [filterObj]="beforeFilterObj"
   ></app-textbook>
-  }
+  } -->
 </div>

+ 20 - 6
projects/textbook/src/modules/nav-province-school-contact/page-textbook/page-textbook.component.ts

@@ -36,24 +36,38 @@ export class PageTextbookComponent implements OnInit {
   active: number = 0;
 
   user: Parse.User | undefined;
-
-  //待审核
+  //草稿
+  draftFilterObj:any = {
+    showMore: true, //显示更多字段
+    isCheck: true,
+    status: ['101','102','300'],
+    team:true,
+    btns: {
+      export:true,
+      review:true,//查阅
+    },
+  }
+  //待提交教材
   beforeFilterObj: any = {
     showMore: true, //显示更多字段
     isCheck: true,
-    status: ['200','201','400'],
+    status: ['103'],
     team:true,
     btns: {
+      beforSubmit: true, //提交至工作联系人
+      reject: true, //退回教材
       export:true
     },
   };
-  //已加入推荐
+  //待评审教材
   afterFilterObj: any = {
     showMore: true, //显示更多字段
     isCheck: true,
-    status: ['200','201','400'],
+    status: ['200'],
+    team:true,
     btns: {
-      export:true
+      export:true,
+      review:true,//查阅
     },
   };
   eduProcess?:Parse.Object

+ 9 - 1
server/db/schemas/EduTextbook.js

@@ -2,7 +2,15 @@ export const EduTextbook = {
     "className": "EduTextbook",
     "fields": {
         "status": {
-            //状态 101:待完善资料 102:可提交状态 200:已提交遴选中 201:公示中 300:被打回 400:已报送
+            /*状态 
+            101:待完善资料  
+            102:可提交状态 
+            103:已提交至高校管理员
+            200:已提交遴选中 
+            201:公示中 
+            300:退回
+            400:已报送
+            */
             "type": "String",
             "required": false
         },