cehn 2 months ago
parent
commit
05b8bcc5e9

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

@@ -94,7 +94,7 @@
           [nzPopoverContent]="contentTemplateeditionUnit"
           #editionUnit
         >
-          {{ fromatFiled(data?.get("childrens"), "editionUnit") }}
+          {{ data?.get("department")?.get('title')}}
           <ng-template #contentTemplateeditionUnit>
             <div style="max-width: 400px">
               {{ editionUnit.innerText }}

+ 26 - 5
projects/textbook/src/modules/nav-province-contact/collect-file/collect-file.component.ts

@@ -6,7 +6,7 @@ import { ActivatedRoute, Router } from '@angular/router';
 import { NzMessageModule } from 'ng-zorro-antd/message';
 import { NzMessageService } from 'ng-zorro-antd/message';
 import Parse from 'parse';
-// import { textbookServer } from '../../../../services/textbook';
+import { textbookServer } from '../../../services/textbook';
 import { NzModalService } from 'ng-zorro-antd/modal';
 import { MatDialog } from '@angular/material/dialog';
 import { NzEmptyModule } from 'ng-zorro-antd/empty';
@@ -32,6 +32,7 @@ import { NzDatePickerModule } from 'ng-zorro-antd/date-picker';
 })
 export class CollectFileComponent implements OnInit {
   textbookList: Array<Parse.Object> = [];
+  eduProcess?:Parse.Object //流程
   count: number = 0;
   timeDefaultValue = setHours(new Date(), 0);
 
@@ -39,7 +40,6 @@ export class CollectFileComponent implements OnInit {
   pageIndex: number = 1;
   loading: boolean = false;
   @Input('maxWidth') maxWidth: any; //最大宽度
-  @Input('eduProcess') eduProcess?: Parse.Object; //流程id
   showModal: boolean = false;
 
   searchValue: string = '';
@@ -68,13 +68,26 @@ export class CollectFileComponent implements OnInit {
   }
   constructor(
     private msg: NzMessageService,
+    public tbookSer: textbookServer,
     public dialog: MatDialog,
     private route: Router,
     private datePipe: DatePipe,
     private modal: NzModalService
   ) {}
 
-  ngOnInit() {}
+  async ngOnInit() {
+    await this.getEduProcess()
+    this.getTextbook()
+  }
+  async getEduProcess(){
+    let query = new Parse.Query('EduProcess')
+    query.notEqualTo('isDeleted',true)
+    query.equalTo('profileSubmitted',this.tbookSer.profile.objectId)
+    query.containedIn('status',['400'])
+    let r = await query.first()
+    console.log(r);
+    this.eduProcess = r
+  }
 
   async getTextbook(val?: string, review?: boolean): Promise<any[] | void> {
     if (this.loading) return;
@@ -105,10 +118,18 @@ export class CollectFileComponent implements OnInit {
               },
             },
           ],
+          childrens: {
+            $inQuery: {
+              where: {
+                editionUnit:'民政部' || this.eduProcess?.get('name'),
+              },
+              className: 'EduTextbookVolume',
+            },
+          },
         },
       };
       let query = Parse.Query.fromJSON('EduTextbook', queryParams);
-      query.equalTo('eduProcess', this.eduProcess?.id);
+      // query.equalTo('eduProcess', this.eduProcess?.id);
       query.descending('updatedAt');
       query.notEqualTo('isDeleted', true);
       query.equalTo('status', '400');
@@ -116,7 +137,7 @@ export class CollectFileComponent implements OnInit {
       query.notEqualTo('discard', true);
       // query.exists('score');
       // query.equalTo('verify', true);
-      query.include('childrens');
+      query.include('childrens','department');
       this.count = await query.count();
       query.limit(this.limit);
       query.skip(this.limit * (this.pageIndex - 1));