diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts
index 4be5791..c9efb56 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts
@@ -6,6 +6,7 @@ import {NotifierService} from 'angular-notifier';
import {ListPdComponent} from './../list-pd.component';
import {PdTrigerService} from '../../../pd-service/pd-triger.service';
import { PdStatusChangeDialogueComponent } from '../pd-status-change-dialogue/pd-status-change-dialogue.component';
+import { FormComponent } from './forms/form/form.component';
@Component({
selector: 'app-start-pd',
@@ -104,12 +105,13 @@ export class StartPdComponent implements OnInit, OnDestroy {
data => {
// console.log("after reponse = ", data);
if (data.status == 200) {
- this.pdMasterList=data.records.pdmaster_details;
+ this.pdMasterList=data.records.pdmaster_details[0]
// this.categoryList=data.records.question_answers;
let filterApplicantName= data.records.pdapplicants_detials.filter(item => item.applicant_type == 1);
this.mainApplicantName = filterApplicantName.length > 0 ? filterApplicantName[0].applicant_name : '';
this.currentPDStatus = data.records.pdmaster_details.pd_status=='INPROGRESS' ? true : data.records.pdmaster_details.pd_status=='SCHEDULED' ? true :data.records.pdmaster_details.pd_status=='ALLOCATED' ? true : false;
- this.categoryFormButtons = Object.keys(data.records.template_forms).map((item)=>data.records.template_forms[item]).filter(item=>item.isAnswerable===true);
+ // this.categoryFormButtons = Object.keys(data.records.template_forms).map((item)=>data.records.template_forms[item]).filter(item=>item.isAnswerable===true);
+ this.categoryFormButtons = data.records.template_details
// this.categoryFormButtons = this.categoryFormButtons.filter(item=>item.isAnswerable===true);
this.actualQuestions = this.categoryFormButtons.length;
let getAnsweredFormsCount = this.categoryFormButtons.filter(item=>item.isAnswered===true);
@@ -168,7 +170,45 @@ export class StartPdComponent implements OnInit, OnDestroy {
}
});
}
-
+ OnSelectDirectForms(details: any) {
+ // console.log(details)
+ // this.formsCategoryEnable = true;
+ this.selectedFormsCategory = details;
+ let curr_vendor_ans_fetch_status = null
+ if(this.pdMasterList.fk_pd_type == '2') {
+ if(this.vendor_status_arr && this.vendor_status_arr.length > 0 && this.selectedFormsCategory.form_id != 13) {
+ console.log(this.vendor_status_arr,this.selectedFormsCategory)
+ curr_vendor_ans_fetch_status =this.vendor_status_arr.filter(val=>val.fk_form_id == String(this.selectedFormsCategory.form_id))
+ if(curr_vendor_ans_fetch_status.length > 0) {
+ curr_vendor_ans_fetch_status = curr_vendor_ans_fetch_status[0].form_status
+ }
+ else {
+ curr_vendor_ans_fetch_status = null
+ }
+ }
+ }
+ this.pdFullDetails.pdmaster_details.curr_vendor_ans_fetch_status = curr_vendor_ans_fetch_status
+ this.pdFullDetails.form_id= this.selectedFormsCategory.fk_form_id
+ this.pdFullDetails.is_answered = this.selectedFormsCategory.is_answered
+ console.log(this.pdFullDetails);
+ const dialogRef = this.dialog.open(FormComponent, {
+ data: this.pdFullDetails,
+ // position: { right: '0'},
+ maxWidth: '100vw',
+ maxHeight: '100vh',
+ height: '100%',
+ width: '100%',
+ disableClose: true,
+ closeOnNavigation:true,
+ panelClass:'no-padding'
+ });
+ dialogRef.afterClosed()
+ .subscribe(dataresult => {
+ // this.notifier.notify('success', 'Successfully allocated.!');
+ this.loadTemplates(this.startPD,2,this.randomString);
+ });
+ }
+
// start
// direct form based questions
// OnSelectDirectForms(details: any) {
@@ -536,7 +576,7 @@ export class StartPdComponent implements OnInit, OnDestroy {
}
// load pd view component
loadPdViewCompoent() {
- this.router.navigate(['../../../../viewpd', this.pdMasterList.parent_pd_id,this.randomString], {relativeTo: this.route});
+ this.router.navigate(['../../../../../viewpd', this.pdMasterList.parent_pd_id,this.randomString], {relativeTo: this.route});
}
}
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.module.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.module.ts
index e7fa795..bbe3172 100644
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.module.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.module.ts
@@ -6,6 +6,13 @@ import { StartPdComponent } from './start-pd.component';
import { SharedModule } from 'app/shared/shared.module';
import { DemoMaterialModule } from 'app/shared/demo.module';
import { NotifierModule, NotifierOptions } from 'angular-notifier';
+import { FormComponent } from './forms/form/form.component';
+import { DynamicFormComponent } from './forms/dynamic-form/dynamic-form/dynamic-form.component';
+import { FormsModule, ReactiveFormsModule } from '@angular/forms';
+import { FlexLayoutModule } from '@angular/flex-layout';
+import { DynamicQuestionTemplateComponent } from './forms/dynamic-form/dynamic-question-template/dynamic-question-template.component';
+import { NgxMatSelectSearchModule } from 'ngx-mat-select-search';
+import { MatIconModule } from '@angular/material';
const pdCustomNotifierOptions: NotifierOptions = {
position: {
@@ -54,9 +61,14 @@ const pdCustomNotifierOptions: NotifierOptions = {
StartPdRoutingModule,
SharedModule,
DemoMaterialModule,
+ ReactiveFormsModule,
+ FormsModule,
+ FlexLayoutModule,
NotifierModule.withConfig(pdCustomNotifierOptions),
+ NgxMatSelectSearchModule,
+ MatIconModule
],
- declarations: [StartPdComponent],
- entryComponents:[]
+ declarations: [StartPdComponent, FormComponent,DynamicFormComponent,DynamicQuestionTemplateComponent],
+ entryComponents:[FormComponent]
})
export class StartPdModule { }
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html
index 19ef20e..dfacff8 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html
@@ -142,6 +142,7 @@
+
-
+
@@ -197,7 +198,7 @@
-
+