Browse Source

基本档案接口对接

chenc 4 years ago
parent
commit
67eb1d4a7e

+ 2 - 0
src/app/entity/basedata/base-archives-milestone.ts

@@ -9,5 +9,7 @@ export class BaseArchivesMilestone  extends Page{
     name?:string;//里程碑名称
     parentId?:string;//父级id
     type?:string;//类别-数据字典
+    typeId?:string;//类型id
     pkOrg?:string;//组织id
+
 }

+ 63 - 22
src/app/routes/basedata/base-archives-collection-line/add/add.component.ts

@@ -1,50 +1,91 @@
 import { Component, OnInit } from '@angular/core';
-import { NzModalRef, NzMessageService } from 'ng-zorro-antd';
+import { NzModalRef, NzMessageService, NzNotificationService } from 'ng-zorro-antd';
 import { _HttpClient } from '@delon/theme';
 import { FormBuilder, Validators, FormGroup } from '@angular/forms';
 import { BaseArchivesCollectionLine } from 'app/entity/basedata/base-archives-collection-line';
+import { BaseArchivesCollectionLineService } from 'app/services/basedata/base-archives-collection-line.service';
+import { I18NService } from '@core';
 
 @Component({
   selector: 'app-basedata-base-archives-collection-line-add',
   templateUrl: './add.component.html',
 })
 export class BasedataBaseArchivesCollectionLineAddComponent implements OnInit {
- 
-
   constructor(
     private modal: NzModalRef,
-    private fb: FormBuilder
-  ) { }
+    private fb: FormBuilder,
+    private baseArchivesCollectionLineService: BaseArchivesCollectionLineService,
+    private nzNotificationService: NzNotificationService,
+    private i18NService: I18NService,
+  ) {}
 
   ngOnInit(): void {
     //初始化表单
     this.validateForm = this.fb.group({
       code: [null, [Validators.required]],
-      name: [null, [Validators.required]]
+      name: [null, [Validators.required]],
     });
+    //修改进入
+    if(this.id){
+      this.baseArchivesCollectionLine.id=this.id;
+      this.getById();
+    }
   }
 
   validateForm!: FormGroup;
-  baseArchivesCollectionLine: BaseArchivesCollectionLine={}; //对象
-  id="";
+  baseArchivesCollectionLine: BaseArchivesCollectionLine = {}; //对象
+  id = '';
+
+  /**
+   * 根据id查询
+   */
+  getById(){
+    this.baseArchivesCollectionLineService.getById(this.id).then((response)=>{
+      this.baseArchivesCollectionLine=response.result;
+    })
+  }
+
   /**
    * 保存提交按钮
    */
-  submitForm(): void {
-    for (const i in this.validateForm.controls) {
-      this.validateForm.controls[i].markAsDirty();
-      this.validateForm.controls[i].updateValueAndValidity();
-    }
-    let valid = this.validateForm.valid;
-    if(valid){
-      if(!this.id){
-        //新增
-        alert("新增")
-      }else{
-        //修改
-        alert("修改")
+  submitForm(): any {
+    return new Promise(resolve => {
+      for (const i in this.validateForm.controls) {
+        this.validateForm.controls[i].markAsDirty();
+        this.validateForm.controls[i].updateValueAndValidity();
       }
-    }
+      let valid = this.validateForm.valid;
+      if (valid) {
+        if (!this.id) {
+          this.baseArchivesCollectionLine.pkOrg=sessionStorage.getItem("pkOrg");//组织
+          //新增
+          this.baseArchivesCollectionLineService.add(this.baseArchivesCollectionLine).then((response)=>{
+            if (response.success) {
+              //保存成功
+              this.nzNotificationService.success(this.i18NService.fanyi('save.ok'), '');
+              this.modal.destroy();
+              resolve();
+            } else {
+              //保存失败
+              this.nzNotificationService.error(this.i18NService.fanyi('save.not'), '');
+            }
+          })
+        } else {
+          //修改
+          this.baseArchivesCollectionLineService.update(this.baseArchivesCollectionLine).then((response)=>{
+            if (response.success) {
+              //保存成功
+              this.nzNotificationService.success(this.i18NService.fanyi('save.ok'), '');
+              this.modal.destroy();
+              resolve();
+            } else {
+              //保存失败
+              this.nzNotificationService.error(this.i18NService.fanyi('save.not'), '');
+            }
+          })
+        }
+      }
+    });
   }
 
   close() {

+ 29 - 6
src/app/routes/basedata/base-archives-collection-line/base-archives-collection-line.component.ts

@@ -3,8 +3,10 @@ import { _HttpClient, ModalHelper } from '@delon/theme';
 import { STColumn, STComponent } from '@delon/abc';
 import { SFSchema } from '@delon/form';
 import { BaseArchivesCollectionLine } from 'app/entity/basedata/base-archives-collection-line';
-import { NzModalService } from 'ng-zorro-antd';
+import { NzModalService, NzNotificationService } from 'ng-zorro-antd';
 import { BasedataBaseArchivesCollectionLineAddComponent } from './add/add.component';
+import { BaseArchivesCollectionLineService } from 'app/services/basedata/base-archives-collection-line.service';
+import { I18NService } from '@core';
 
 @Component({
   selector: 'app-basedata-base-archives-collection-line',
@@ -14,7 +16,10 @@ export class BasedataBaseArchivesCollectionLineComponent implements OnInit {
   
 
   constructor(
-    private modalService:NzModalService
+    private modalService:NzModalService,
+    private baseArchivesCollectionLineService:BaseArchivesCollectionLineService,
+    private nzNotificationService:NzNotificationService,
+    private i18NService:I18NService
   ) { }
 
   ngOnInit() {
@@ -41,7 +46,10 @@ export class BasedataBaseArchivesCollectionLineComponent implements OnInit {
    */
   getList(){
     // this.isSpinning=true;
-    this.listOfData=[{id:"1"}]
+    this.baseArchivesCollectionLine.pkOrg=sessionStorage.getItem("pkOrg");//组织
+    this.baseArchivesCollectionLineService.getList(this.baseArchivesCollectionLine).then((response)=>{
+      this.listOfData=response.result.records
+    })
   }
 
   /**
@@ -76,7 +84,9 @@ export class BasedataBaseArchivesCollectionLineComponent implements OnInit {
           type: "primary",
           // loading:this.modelSaveLoading,
           onClick: addModel => {
-            addModel.submitForm()
+            addModel.submitForm().then(()=>{
+              this.getList();
+            })
           }
         }
       ]
@@ -107,7 +117,9 @@ export class BasedataBaseArchivesCollectionLineComponent implements OnInit {
           type: "primary",
           // loading:this.modelSaveLoading,
           onClick: addModel => {
-            addModel.submitForm()
+            addModel.submitForm().then(()=>{
+              this.getList();
+            })
           }
         }
       ]
@@ -118,7 +130,18 @@ export class BasedataBaseArchivesCollectionLineComponent implements OnInit {
    * 删除按钮
    */
   delete(id){
-    alert("删除成功")
+    let baseArchivesCollectionLine=new BaseArchivesCollectionLine();
+    baseArchivesCollectionLine.id=id;
+    this.baseArchivesCollectionLineService.delete(id).then((response)=>{
+      if (response.success) {
+        //删除成功
+        this.nzNotificationService.success(this.i18NService.fanyi('successful.deletion'), '');
+        this.getList();
+      } else {
+        //删除失败
+        this.nzNotificationService.error(this.i18NService.fanyi('delete.failed'), '');
+      }
+    })
   }
 
 }

+ 63 - 21
src/app/routes/basedata/base-archives-cost/add/add.component.ts

@@ -1,9 +1,11 @@
 import { Component, OnInit } from '@angular/core';
-import { NzModalRef, NzMessageService } from 'ng-zorro-antd';
+import { NzModalRef, NzMessageService, NzNotificationService } from 'ng-zorro-antd';
 import { _HttpClient } from '@delon/theme';
 import { FormBuilder, Validators, FormGroup } from '@angular/forms';
 import { BaseArchivesCollectionLine } from 'app/entity/basedata/base-archives-collection-line';
 import { BaseArchivesCost } from 'app/entity/basedata/base-archives-cost';
+import { BaseArchivesCostService } from 'app/services/basedata/base-archives-cost.service';
+import { I18NService } from '@core';
 
 @Component({
   selector: 'app-basedata-base-archives-cost-add',
@@ -15,39 +17,79 @@ export class BasedataBaseArchivesCostAddComponent implements OnInit {
 
   constructor(
     private modal: NzModalRef,
-    private fb: FormBuilder
-  ) { }
+    private fb: FormBuilder,
+    private baseArchivesCostService: BaseArchivesCostService,
+    private nzNotificationService: NzNotificationService,
+    private i18NService: I18NService,
+  ) {}
 
   ngOnInit(): void {
     //初始化表单
     this.validateForm = this.fb.group({
-      code: [{value:"",disabled:true}],
-      name: [null, [Validators.required]]
+      code: [{ value: '', disabled: true }],
+      name: [null, [Validators.required]],
     });
+    //修改进入获取id
+    if(this.id){
+      this.baseArchivesCost.id=this.id;
+      this.getById();
+    }
   }
 
   validateForm!: FormGroup;
-  baseArchivesCost: BaseArchivesCost={}; //对象
-  id="";
+  baseArchivesCost: BaseArchivesCost = {}; //对象
+  id = '';
+
+  /**
+   * 根据id查询
+   */
+  getById(){
+    this.baseArchivesCostService.getById(this.id).then((response)=>{
+      this.baseArchivesCost=response.result;
+    })
+  }
 
   /**
    * 保存提交按钮
    */
-  submitForm(): void {
-    for (const i in this.validateForm.controls) {
-      this.validateForm.controls[i].markAsDirty();
-      this.validateForm.controls[i].updateValueAndValidity();
-    }
-    let valid = this.validateForm.valid;
-    if(valid){
-      if(!this.id){
-        //新增
-        alert("新增")
-      }else{
-        //修改
-        alert("修改")
+  submitForm(): any {
+    return new Promise(resolve => {
+      for (const i in this.validateForm.controls) {
+        this.validateForm.controls[i].markAsDirty();
+        this.validateForm.controls[i].updateValueAndValidity();
       }
-    }
+      let valid = this.validateForm.valid;
+      if (valid) {
+        if (!this.id) {
+          this.baseArchivesCost.pkOrg = sessionStorage.getItem('pkOrg');
+          //新增
+          this.baseArchivesCostService.add(this.baseArchivesCost).then(response => {
+            if (response.success) {
+              //保存成功
+              this.nzNotificationService.success(this.i18NService.fanyi('save.ok'), '');
+              this.modal.destroy();
+              resolve();
+            } else {
+              //保存失败
+              this.nzNotificationService.error(this.i18NService.fanyi('save.not'), '');
+            }
+          });
+        } else {
+          //修改
+          this.baseArchivesCostService.update(this.baseArchivesCost).then(response => {
+            if (response.success) {
+              //保存成功
+              this.nzNotificationService.success(this.i18NService.fanyi('save.ok'), '');
+              this.modal.destroy();
+              resolve();
+            } else {
+              //保存失败
+              this.nzNotificationService.error(this.i18NService.fanyi('save.not'), '');
+            }
+          });
+        }
+      }
+    });
   }
 
   close() {

+ 29 - 6
src/app/routes/basedata/base-archives-cost/base-archives-cost.component.ts

@@ -2,9 +2,11 @@ import { Component, OnInit, ViewChild } from '@angular/core';
 import { _HttpClient, ModalHelper } from '@delon/theme';
 import { STColumn, STComponent } from '@delon/abc';
 import { SFSchema } from '@delon/form';
-import { NzModalService } from 'ng-zorro-antd';
+import { NzModalService, NzNotificationService } from 'ng-zorro-antd';
 import { BaseArchivesCost } from 'app/entity/basedata/base-archives-cost';
 import { BasedataBaseArchivesCostAddComponent } from './add/add.component';
+import { BaseArchivesCostService } from 'app/services/basedata/base-archives-cost.service';
+import { I18NService } from '@core';
 
 @Component({
   selector: 'app-basedata-base-archives-cost',
@@ -14,7 +16,10 @@ export class BasedataBaseArchivesCostComponent implements OnInit {
  
 
   constructor(
-    private modalService:NzModalService
+    private modalService:NzModalService,
+    private baseArchivesCostService:BaseArchivesCostService,
+    private nzNotificationService:NzNotificationService,
+    private i18NService:I18NService
   ) { }
 
   ngOnInit() {
@@ -41,7 +46,10 @@ export class BasedataBaseArchivesCostComponent implements OnInit {
    */
   getList(){
     // this.isSpinning=true;
-    this.listOfData=[{id:"1"}]
+    this.baseArchivesCost.pkOrg=sessionStorage.getItem("pkOrg");//组织
+    this.baseArchivesCostService.getList(this.baseArchivesCost).then((response)=>{
+      this.listOfData=response.result.records
+    })
   }
 
   /**
@@ -76,7 +84,9 @@ export class BasedataBaseArchivesCostComponent implements OnInit {
           type: "primary",
           // loading:this.modelSaveLoading,
           onClick: addModel => {
-            addModel.submitForm()
+            addModel.submitForm().then(()=>{
+              this.getList();
+            })
           }
         }
       ]
@@ -107,7 +117,9 @@ export class BasedataBaseArchivesCostComponent implements OnInit {
           type: "primary",
           // loading:this.modelSaveLoading,
           onClick: addModel => {
-            addModel.submitForm()
+            addModel.submitForm().then(()=>{
+              this.getList();
+            })
           }
         }
       ]
@@ -118,7 +130,18 @@ export class BasedataBaseArchivesCostComponent implements OnInit {
    * 删除按钮
    */
   delete(id){
-    alert("删除成功")
+    let baseArchivesCost=new BaseArchivesCost();
+    baseArchivesCost.id=id;
+    this.baseArchivesCostService.delete(baseArchivesCost).then((response)=>{
+      if (response.success) {
+        //删除成功
+        this.nzNotificationService.success(this.i18NService.fanyi('successful.deletion'), '');
+        this.getList();
+      } else {
+        //删除失败
+        this.nzNotificationService.error(this.i18NService.fanyi('delete.failed'), '');
+      }
+    })
   }
 
 

+ 1 - 1
src/app/routes/basedata/base-archives-milestone/add/add.component.html

@@ -20,7 +20,7 @@
   <nz-form-item>
     <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="name">类别</nz-form-label>
     <nz-form-control [nzSm]="14" [nzXs]="24" >
-      <nz-select style="widows: 100%;" nzShowSearch nzAllowClear formControlName="type" name="type" [(ngModel)]="baseArchivesMilestone.type"
+      <nz-select style="widows: 100%;" nzShowSearch nzAllowClear formControlName="typeId" name="typeId" [(ngModel)]="baseArchivesMilestone.typeId"
               nzPlaceHolder="请选择">
               <nz-option *ngFor="let i of typeList" [nzValue]="i.value" [nzLabel]="i.text"></nz-option>
             </nz-select>

+ 71 - 34
src/app/routes/basedata/base-archives-milestone/add/add.component.ts

@@ -1,43 +1,52 @@
 import { Component, OnInit } from '@angular/core';
-import { NzModalRef, NzMessageService } from 'ng-zorro-antd';
+import { NzModalRef, NzMessageService, NzNotificationService } from 'ng-zorro-antd';
 import { _HttpClient } from '@delon/theme';
 import { BaseArchivesMilestone } from 'app/entity/basedata/base-archives-milestone';
 import { FormBuilder, Validators, FormGroup } from '@angular/forms';
 import { DictService } from 'app/services/dict.service';
+import { BaseArchivesMilestoneService } from 'app/services/basedata/base-archives-milestone.service';
+import { I18NService } from '@core';
 
 @Component({
   selector: 'app-basedata-base-archives-milestone-add',
   templateUrl: './add.component.html',
 })
 export class BasedataBaseArchivesMilestoneAddComponent implements OnInit {
-  
-
   constructor(
     private modal: NzModalRef,
     private fb: FormBuilder,
-    private dictService:DictService
-  ) { }
+    private dictService: DictService,
+    private baseArchivesMilestoneService: BaseArchivesMilestoneService,
+    private nzNotificationService: NzNotificationService,
+    private i18NService: I18NService,
+  ) {}
 
   ngOnInit(): void {
     //初始化表单
     this.validateForm = this.fb.group({
       code: [null, [Validators.required]],
       name: [null, [Validators.required]],
-      type:[null,[Validators.required]]
+      typeId: [null, [Validators.required]],
     });
     //获取类别数据字典
     this.getTypeList();
     //id不等于空则是修改,需要查询修改数据
-    if(this.id){
+    if (this.id) {
       this.getById();
     }
+    //如果不为空则获取类型id
+    if (this.typeId) {
+      this.baseArchivesMilestone.typeId = this.typeId;
+    }
+    this.baseArchivesMilestone.parentId = this.parentId;
   }
 
   validateForm!: FormGroup;
-  parentId="";//父级id
-  id="";//主键
+  parentId = '0'; //父级id
+  id = ''; //主键
+  typeId = ''; //类型id
   //里程碑档案实体
-  baseArchivesMilestone:BaseArchivesMilestone={};
+  baseArchivesMilestone: BaseArchivesMilestone = {};
 
   /**
    * 获取类别数据字典
@@ -52,36 +61,64 @@ export class BasedataBaseArchivesMilestoneAddComponent implements OnInit {
   /**
    * 根据id查询里程碑对象
    */
-  getById(){
-    this.baseArchivesMilestone={
-        key: `1-1`,
-        code: '001',
-        name: '启动1',
-        type: '1'
-    }
+  getById() {
+    this.baseArchivesMilestoneService.getById(this.id).then((response)=>{
+      this.baseArchivesMilestone=response.result
+    })
+    // this.baseArchivesMilestone = {
+    //   key: `1-1`,
+    //   code: '001',
+    //   name: '启动1',
+    //   type: '1',
+    // };
   }
 
   /**
    * 保存提交按钮
    */
-  submitForm(): void {
-    for (const i in this.validateForm.controls) {
-      this.validateForm.controls[i].markAsDirty();
-      this.validateForm.controls[i].updateValueAndValidity();
-    }
-    let valid = this.validateForm.valid;
-    if(valid){
-      if(!this.id){
-        //新增
-        alert(this.parentId)
-        alert("新增")
-      }else{
-        //修改
-        alert(this.parentId)
-        alert("修改")
+  submitForm(): any {
+    return new Promise(resolve => {
+      for (const i in this.validateForm.controls) {
+        this.validateForm.controls[i].markAsDirty();
+        this.validateForm.controls[i].updateValueAndValidity();
       }
-      
-    }
+      let valid = this.validateForm.valid;
+      if (valid) {
+        if (!this.id) {
+          //类型名称
+          this.typeList.forEach(element => {
+            if(this.baseArchivesMilestone.typeId===element.value){
+              this.baseArchivesMilestone.type=element.text
+            }
+          });
+          this.baseArchivesMilestone.pkOrg=sessionStorage.getItem("pkOrg");//组织
+          //新增
+          this.baseArchivesMilestoneService.add(this.baseArchivesMilestone).then(response => {
+            if (response.success) {
+              //保存成功
+              this.nzNotificationService.success(this.i18NService.fanyi('save.ok'), '');
+              this.modal.destroy();
+              resolve();
+            } else {
+              //保存失败
+              this.nzNotificationService.error(this.i18NService.fanyi('save.not'), '');
+            }
+          });
+        } else {
+          this.baseArchivesMilestoneService.update(this.baseArchivesMilestone).then((response)=>{
+            if (response.success) {
+              //保存成功
+              this.nzNotificationService.success(this.i18NService.fanyi('save.ok'), '');
+              this.modal.destroy();
+              resolve();
+            } else {
+              //保存失败
+              this.nzNotificationService.error(this.i18NService.fanyi('save.not'), '');
+            }
+          })
+        }
+      }
+    });
   }
 
   /**

+ 1 - 1
src/app/routes/basedata/base-archives-milestone/base-archives-milestone.component.html

@@ -11,7 +11,7 @@
         <nz-form-item>
           <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>类别</nz-form-label>
           <nz-form-control [nzSm]="14" [nzXs]="24">
-            <nz-select style="widows: 100%;" nzShowSearch nzAllowClear name="type" [(ngModel)]="baseArchivesMilestone.type"
+            <nz-select style="widows: 100%;" nzShowSearch nzAllowClear name="typeId" [(ngModel)]="baseArchivesMilestone.typeId"
               nzPlaceHolder="请选择">
               <nz-option *ngFor="let i of typeList" [nzValue]="i.value" [nzLabel]="i.text"></nz-option>
             </nz-select>

+ 63 - 30
src/app/routes/basedata/base-archives-milestone/base-archives-milestone.component.ts

@@ -7,6 +7,8 @@ import { DictService } from 'app/services/dict.service';
 import { Dict } from 'app/entity/dict';
 import { NzNotificationService, NzModalService } from 'ng-zorro-antd';
 import { BasedataBaseArchivesMilestoneAddComponent } from './add/add.component';
+import { BaseArchivesMilestoneService } from 'app/services/basedata/base-archives-milestone.service';
+import { I18NService } from '@core';
 export interface TreeNodeInterface {
   key: string;
   code: string;
@@ -23,13 +25,15 @@ export interface TreeNodeInterface {
 })
 export class BasedataBaseArchivesMilestoneComponent implements OnInit {
   constructor(private dictService: DictService, private nzNotificationService: NzNotificationService,
-    private modalService:NzModalService
+    private modalService:NzModalService,
+    private baseArchivesMilestoneService:BaseArchivesMilestoneService,
+    private i18NService:I18NService
     ) {}
 
   ngOnInit() {
     this.getTypeList();
   }
-  listOfMapData: TreeNodeInterface[] = [];
+  listOfMapData:any = [];
   //里程碑档案实体
   baseArchivesMilestone: BaseArchivesMilestone = {};
 
@@ -47,7 +51,7 @@ export class BasedataBaseArchivesMilestoneComponent implements OnInit {
    * 查询按钮
    */
   query() {
-    if (this.baseArchivesMilestone.type) {
+    if (this.baseArchivesMilestone.typeId) {
       this.getTreeList();
     } else {
       this.nzNotificationService.warning('请选择类别', '');
@@ -58,28 +62,38 @@ export class BasedataBaseArchivesMilestoneComponent implements OnInit {
    * 获取树形集合
    */
   getTreeList() {
-    this.listOfMapData = [
-      {
-        key: `1`,
-        code: '001',
-        name: '项目启动',
-        type: '开发',
-        children: [
-          {
-            key: `1-1`,
-            code: '001',
-            name: '启动1',
-            type: '开发',
-          },
-        ],
-      },
-      {
-        key: `2`,
-        code: '002',
-        name: '蓝图设计',
-        type: '实施',
-      },
-    ];
+    this.baseArchivesMilestone.pkOrg=sessionStorage.getItem("pkOrg");//组织
+    this.baseArchivesMilestoneService.getTreeList(this.baseArchivesMilestone).then((response)=>{
+      this.listOfMapData=response.result
+      this.getLoding();
+    })
+
+    // this.listOfMapData = [
+    //   {
+    //     key: `1`,
+    //     code: '001',
+    //     name: '项目启动',
+    //     type: '开发',
+    //     children: [
+    //       {
+    //         key: `1-1`,
+    //         code: '001',
+    //         name: '启动1',
+    //         type: '开发',
+    //       },
+    //     ],
+    //   },
+    //   {
+    //     key: `2`,
+    //     code: '002',
+    //     name: '蓝图设计',
+    //     type: '实施',
+    //   },
+    // ];
+    
+  }
+
+  getLoding(){
     this.listOfMapData.forEach(item => {
       this.mapOfExpandedData[item.key] = this.convertTreeToList(item);
     });
@@ -95,6 +109,7 @@ export class BasedataBaseArchivesMilestoneComponent implements OnInit {
       nzWidth: 600,
       nzComponentParams:{
         // parentId:this.id
+        typeId:this.baseArchivesMilestone.typeId
       },
       nzFooter: [
         {
@@ -109,7 +124,9 @@ export class BasedataBaseArchivesMilestoneComponent implements OnInit {
           type: "primary",
           // loading:this.modelSaveLoading,
           onClick: addModel => {
-            addModel.submitForm()
+            addModel.submitForm().then(()=>{
+              this.getTreeList();
+            })
           }
         }
       ]
@@ -126,7 +143,8 @@ export class BasedataBaseArchivesMilestoneComponent implements OnInit {
       nzContent: BasedataBaseArchivesMilestoneAddComponent,
       nzWidth: 600,
       nzComponentParams:{
-        parentId:item.key
+        parentId:item.key,
+        typeId:this.baseArchivesMilestone.typeId
       },
       nzFooter: [
         {
@@ -141,7 +159,9 @@ export class BasedataBaseArchivesMilestoneComponent implements OnInit {
           type: "primary",
           // loading:this.modelSaveLoading,
           onClick: addModel => {
-            addModel.submitForm()
+            addModel.submitForm().then(()=>{
+              this.getTreeList();
+            })
           }
         }
       ]
@@ -173,7 +193,9 @@ export class BasedataBaseArchivesMilestoneComponent implements OnInit {
           type: "primary",
           // loading:this.modelSaveLoading,
           onClick: addModel => {
-            addModel.submitForm()
+            addModel.submitForm().then(()=>{
+              this.getTreeList();
+            })
           }
         }
       ]
@@ -184,7 +206,18 @@ export class BasedataBaseArchivesMilestoneComponent implements OnInit {
    * 删除按钮
    */
   delete(id){
-    alert("删除成功")
+    let baseArchivesMilestone=new BaseArchivesMilestone();
+    baseArchivesMilestone.id=id
+    this.baseArchivesMilestoneService.delete(baseArchivesMilestone).then((response)=>{
+      if (response.success) {
+        //删除成功
+        this.nzNotificationService.success(this.i18NService.fanyi('successful.deletion'), '');
+        this.getTreeList();
+      } else {
+        //删除失败
+        this.nzNotificationService.error(this.i18NService.fanyi('delete.failed'), '');
+      }
+    })
   }
 
   ///////////////////////////树形配置

+ 35 - 0
src/app/services/basedata/base-archives-collection-line.service.ts

@@ -1,10 +1,45 @@
 import { Injectable } from '@angular/core';
 import { HttpClient } from '@angular/common/http';
+import { BaseResponse } from 'app/entity/baseResponse';
+import { Result } from 'app/entity/Result';
+import { BaseArchivesCollectionLine } from 'app/entity/basedata/base-archives-collection-line';
 
 @Injectable({
   providedIn: 'root'
 })
+/**
+ * 收付款条线档案
+ */
 export class BaseArchivesCollectionLineService {
 
   constructor(private http:HttpClient) { }
+
+  //查詢Tree
+  async getList(body: any): Promise<BaseResponse<Result<any>>> {
+    return await this.http
+      .get<BaseResponse<Result<any>>>('/basedata/baseArchivesCollectionLine/list', { params: body })
+      .toPromise();
+  }
+
+  //新增
+  async add(body: BaseArchivesCollectionLine): Promise<BaseResponse<any>> {
+    return await this.http.post<BaseResponse<any>>('basedata/baseArchivesCollectionLine/add', body).toPromise();
+  }
+
+  //根据id查询
+  async getById(id: string): Promise<BaseResponse<any>> {
+    return await this.http
+      .get<BaseResponse<any>>('basedata/baseArchivesCollectionLine/queryById', { params: { id: id } })
+      .toPromise();
+  }
+
+  //修改
+  async update(body: BaseArchivesCollectionLine): Promise<BaseResponse<any>> {
+    return await this.http.put<BaseResponse<any>>('basedata/baseArchivesCollectionLine/edit', body).toPromise();
+  }
+
+  //删除
+  async delete(id: any): Promise<BaseResponse<any>> {
+    return await this.http.delete<BaseResponse<any>>('basedata/baseArchivesCollectionLine/delete', {params:{id:id}}).toPromise();
+  }
 }

+ 35 - 0
src/app/services/basedata/base-archives-cost.service.ts

@@ -1,10 +1,45 @@
 import { Injectable } from '@angular/core';
 import { HttpClient } from '@angular/common/http';
+import { BaseResponse } from 'app/entity/baseResponse';
+import { Result } from 'app/entity/Result';
+import { BaseArchivesCost } from 'app/entity/basedata/base-archives-cost';
 
 @Injectable({
   providedIn: 'root'
 })
+/**
+ * 费用档案
+ */
 export class BaseArchivesCostService {
 
   constructor(private http:HttpClient) { }
+
+  //分页查询
+  async getList(body: any): Promise<BaseResponse<Result<any>>> {
+    return await this.http
+      .get<BaseResponse<Result<any>>>('/basedata/baseArchivesCost/list', { params: body })
+      .toPromise();
+  }
+
+  //新增
+  async add(body: BaseArchivesCost): Promise<BaseResponse<any>> {
+    return await this.http.post<BaseResponse<any>>('basedata/baseArchivesCost/add', body).toPromise();
+  }
+
+  //根据id查询
+  async getById(id: string): Promise<BaseResponse<any>> {
+    return await this.http
+      .get<BaseResponse<any>>('basedata/baseArchivesCost/queryById', { params: { id: id } })
+      .toPromise();
+  }
+
+  //修改
+  async update(body: BaseArchivesCost): Promise<BaseResponse<any>> {
+    return await this.http.post<BaseResponse<any>>('basedata/baseArchivesCost/edit', body).toPromise();
+  }
+
+  //删除
+  async delete(body: any): Promise<BaseResponse<any>> {
+    return await this.http.post<BaseResponse<any>>('basedata/baseArchivesCost/delete', body).toPromise();
+  }
 }

+ 33 - 2
src/app/services/basedata/base-archives-milestone.service.ts

@@ -1,13 +1,44 @@
 import { Injectable } from '@angular/core';
 import { HttpClient } from '@angular/common/http';
+import { BaseResponse } from 'app/entity/baseResponse';
+import { Result } from 'app/entity/Result';
+import { BaseArchivesMilestone } from 'app/entity/basedata/base-archives-milestone';
 
 @Injectable({
-  providedIn: 'root'
+  providedIn: 'root',
 })
 /**
  * 里程碑档案
  */
 export class BaseArchivesMilestoneService {
+  constructor(private http: HttpClient) {}
 
-  constructor(private http:HttpClient) { }
+  //查詢Tree
+  async getTreeList(body: any): Promise<BaseResponse<Result<any>>> {
+    return await this.http
+      .get<BaseResponse<Result<any>>>('/basedata/baseArchivesMilestone/list', { params: body })
+      .toPromise();
+  }
+
+  //新增
+  async add(body: BaseArchivesMilestone): Promise<BaseResponse<any>> {
+    return await this.http.post<BaseResponse<any>>('basedata/baseArchivesMilestone/add', body).toPromise();
+  }
+
+  //根据id查询
+  async getById(id: string): Promise<BaseResponse<any>> {
+    return await this.http
+      .get<BaseResponse<any>>('basedata/baseArchivesMilestone/queryById', { params: { id: id } })
+      .toPromise();
+  }
+
+  //修改
+  async update(body: BaseArchivesMilestone): Promise<BaseResponse<any>> {
+    return await this.http.post<BaseResponse<any>>('basedata/baseArchivesMilestone/edit', body).toPromise();
+  }
+
+  //删除
+  async delete(body: any): Promise<BaseResponse<any>> {
+    return await this.http.post<BaseResponse<any>>('basedata/baseArchivesMilestone/delete', body).toPromise();
+  }
 }