Bladeren bron

签名页提醒短信通知

warrior 2 maanden geleden
bovenliggende
commit
4ba04b3165
1 gewijzigde bestanden met toevoegingen van 31 en 7 verwijderingen
  1. 31 7
      projects/textbook/src/app/textbook/textbook.component.ts

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

@@ -408,7 +408,7 @@ export class TextbookComponent implements OnInit {
       this.loading = false;
       return r;
     }
-    query.include('department', 'childrens');
+    query.include('department', 'childrens', 'user');
     this.count = await query.count();
     query.limit(this.limit);
     query.skip(this.limit * (this.pageIndex - 1));
@@ -582,6 +582,7 @@ export class TextbookComponent implements OnInit {
   }
   //加入/移除推荐
   updateStatus(data?: Parse.Object, recommend?: boolean) {
+    let prevents:any = []
     if (this.eduProcess?.get('status') != '200') {
       this.message.warning('当前流程状态非遴选中,不可此操作');
       return;
@@ -596,20 +597,20 @@ export class TextbookComponent implements OnInit {
         if (data?.id) {
           data.set('recommend', recommend);
           if(recommend && !data?.get('authorSignPDF')?.url){
-            this.message.warning('教材未上传作者诚信承诺文件');
+            prevents.push(data?.get('user'))
+            this.onSendMessage(prevents)
             return
           }
           await data.save();
           this.getTextbook();
         } else {
-          let passNum = 0
           let selectedList = this.textbookList.filter((item: any) =>
             this.setOfCheckedId.has(item?.id)
           );
           let deletePromiseList = selectedList.map((item: any) => {
             return new Promise((resolve) => {
               if(recommend && !item?.get('authorSignPDF')?.url){
-                passNum ++
+                prevents.push(item?.get('user'))
                 resolve(true)
                 return
               }
@@ -620,12 +621,13 @@ export class TextbookComponent implements OnInit {
           try {
             await Promise.all(deletePromiseList);
             this.getTextbook();
-            if(passNum){
-              this.message.warning(passNum + '条教材未上传作者诚信承诺文件');
-            }
           } catch (err) {}
         }
         this.onAllChecked(false);
+        if(prevents.length > 0){
+          this.onSendMessage(prevents)
+          return
+        }
         if (this.filterObj?.btns?.verify) {
           history.go();
         }
@@ -634,6 +636,28 @@ export class TextbookComponent implements OnInit {
       nzOnCancel: () => console.log('Cancel'),
     });
   }
+  onSendMessage(list:Array<Parse.Object>){
+    console.log(list);
+    this.modal.confirm({
+      nzTitle: '发送通知短信',
+      nzContent: `有${list.length}份教材申报书有附件未上传,暂时无法推荐,请通知教师登录系统补充上传签名附件`,
+      nzOkText: '发送通知',
+      nzOkType: 'primary',
+      nzOkDanger: false,
+      nzOnOk: async () => {
+        console.log('发送短信通知');
+        if (this.filterObj?.btns?.verify) {
+          history.go();
+        }
+      },
+      nzCancelText: '关闭窗口',
+      nzOnCancel: () => {
+        if (this.filterObj?.btns?.verify) {
+          history.go();
+        }
+      },
+    })
+  }
   //提交教材
   async submit(data?: Parse.Object) {
     if (!this.tbookSer?.profile?.user?.department?.objectId) {