ソースを参照

基本档案接口

chenc 4 年 前
コミット
9596be6bdf

+ 9 - 8
src/app/routes/basedata/customer/customer.component.ts

@@ -48,6 +48,7 @@ export class BasedataCustomerComponent implements OnInit, OnDestroy {
   //查询全部
   getList() {
     this.isSpinning = true;
+    this.customer.pkOrg=sessionStorage.getItem("pkOrg");
     this.customerService.getCustomer1(this.customer).then(response => {
       this.listOfData = response.result.records;
       this.page = response.result;
@@ -100,12 +101,12 @@ export class BasedataCustomerComponent implements OnInit, OnDestroy {
   //删除档案
   delete(id) {
     //根据客户id查询报价是否有对应的客户
-    this.customerService.getProjectIsCustomer(id).then(responseIsCustomer => {
-      //是否找到
-      if (responseIsCustomer.result) {
-        //报价中已使用客户,不能被删除
-        this.notification.warning(this.i18Nservice.fanyi('Customer.used.in.quotation.cannot.be.deleted'), '');
-      } else {
+    // this.customerService.getProjectIsCustomer(id).then(responseIsCustomer => {
+    //   //是否找到
+    //   if (responseIsCustomer.result) {
+    //     //报价中已使用客户,不能被删除
+    //     this.notification.warning(this.i18Nservice.fanyi('Customer.used.in.quotation.cannot.be.deleted'), '');
+    //   } else {
         this.customerService.deleteCustomer(id).then(response => {
           if (response.success) {
             this.message.success(this.i18Nservice.fanyi('successful.deletion'));
@@ -114,8 +115,8 @@ export class BasedataCustomerComponent implements OnInit, OnDestroy {
             this.message.success(this.i18Nservice.fanyi('delete.failed'));
           }
         });
-      }
-    });
+    //   }
+    // });
   }
 
   /**

+ 3 - 0
src/app/routes/basedata/customer/edit/edit.component.ts

@@ -51,6 +51,7 @@ export class BasedataCustomerEditComponent implements OnInit {
     email: '',
     zipCode: '',
     postalAddress: '',
+    pkOrg:''
   };
   listOfData = []; //客户联系人集合
   enable = false; //是否停用
@@ -355,6 +356,7 @@ export class BasedataCustomerEditComponent implements OnInit {
       //查询条件
       let customer = new Customer();
       customer.abbreviation = this.customer.abbreviation;
+      customer.pkOrg=sessionStorage.getItem("pkOrg");
       //查询是否存在同样客户缩写
       this.customerService.isAbbreviation(customer).then(response => {
         let customerResult: Customer = JSON.parse(JSON.stringify(response.result));
@@ -427,6 +429,7 @@ export class BasedataCustomerEditComponent implements OnInit {
 
   addCustomerServerce() {
     this.isLoading = true;
+    this.customer.pkOrg=sessionStorage.getItem("pkOrg");
     this.customerService.addCustomer(this.customer).then(response => {
       if (response.success) {
         // this.message.success(this.i18NService.fanyi("newsuccess"));

+ 2 - 2
src/app/routes/basedata/post/add/add.component.html

@@ -17,11 +17,11 @@
       </nz-form-explain>
     </nz-form-control>
   </nz-form-item>
-  <nz-form-item>
+  <!-- <nz-form-item>
     <nz-form-label nzRequired [nzSm]="6" [nzXs]="24">是否启用
     </nz-form-label>
     <nz-form-control [nzSm]="14" [nzXs]="24">
       <nz-switch [ngModelOptions]="{standalone: true}" [(ngModel)]="status" name="status" nzCheckedChildren="是" nzUnCheckedChildren="否"></nz-switch>
     </nz-form-control>
-  </nz-form-item>
+  </nz-form-item> -->
 </form>

+ 40 - 24
src/app/routes/basedata/post/add/add.component.ts

@@ -1,57 +1,73 @@
 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 { FormGroup, FormBuilder, Validators } from '@angular/forms';
 import { BaseArchivesPost } from 'app/entity/basedata/base-archives-post';
+import { BaseArchivesPostService } from 'app/services/basedata/base-archives-post.service';
 
 @Component({
   selector: 'app-basedata-post-add',
   templateUrl: './add.component.html',
 })
 export class BasedataPostAddComponent implements OnInit {
-  
   constructor(
     private modal: NzModalRef,
-    private fb: FormBuilder
-  ) { }
+    private fb: FormBuilder,
+    private baseArchivesPostService: BaseArchivesPostService,
+    private nzNotificationService: NzNotificationService
+  ) {}
 
   ngOnInit(): void {
     //初始化表单
     this.validateForm = this.fb.group({
       code: [null, [Validators.required]],
       name: [null, [Validators.required]],
-      status:[null]
+      // status: [null],
     });
-    
+    if(this.parentId){
+      this.baseArchivesPost.parentId=this.parentId;
+    }
   }
 
   validateForm!: FormGroup;
-  parentId="";//父级id
-  status=true;
+  parentId = ''; //父级id
+  status = true;
 
   /**
    * 提交按钮
    */
-  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.status){
-        this.baseArchivesPost.status="1"
-      }else{
-        this.baseArchivesPost.status="0"
+  submitForm(): any {
+    return new Promise(resolve => {
+      for (const i in this.validateForm.controls) {
+        this.validateForm.controls[i].markAsDirty();
+        this.validateForm.controls[i].updateValueAndValidity();
       }
-      alert(this.parentId)
-    }
+      let valid = this.validateForm.valid;
+      if (valid) {
+        //格式化是否期用
+        if (this.status) {
+          this.baseArchivesPost.status = '1';
+        } else {
+          this.baseArchivesPost.status = '0';
+        }
+        //组织
+        this.baseArchivesPost.pkOrg=sessionStorage.getItem("pkOrg");
+        this.baseArchivesPostService.add(this.baseArchivesPost).then(response => {
+          if (response.success) {
+            this.nzNotificationService.success('新增成功', '');
+            resolve();
+            this.modal.destroy();
+          } else {
+            this.nzNotificationService.error('新增失败', response.message);
+          }
+        });
+      }
+    });
   }
 
   //实体
-  baseArchivesPost:BaseArchivesPost={};
-  
+  baseArchivesPost: BaseArchivesPost = {};
+
   /**
    * 关闭按钮
    */

+ 2 - 2
src/app/routes/basedata/post/post.component.html

@@ -85,13 +85,13 @@
               </nz-form-explain>
           </nz-form-control>
         </nz-form-item>
-        <nz-form-item>
+        <!-- <nz-form-item>
           <nz-form-label nzRequired [nzSm]="8" [nzXs]="24">是否启用
           </nz-form-label>
           <nz-form-control [nzSm]="14" [nzXs]="24">
             <nz-switch [ngModelOptions]="{standalone: true}" [(ngModel)]="status" name="status" nzCheckedChildren="是" nzUnCheckedChildren="否"></nz-switch>
           </nz-form-control>
-        </nz-form-item>
+        </nz-form-item> -->
         <!-- <nz-form-item style="margin-bottom:8px;">
           <nz-form-control [nzSpan]="14" [nzOffset]="8">
             <button nzType="primary" (click)="reset()" nz-button ><span>{{ 'button.reset' | translate }}</span></button>

+ 32 - 7
src/app/routes/basedata/post/post.component.ts

@@ -2,7 +2,7 @@ import { Component, OnInit, ViewChild, TemplateRef } from '@angular/core';
 import { _HttpClient, ModalHelper, SettingsService } from '@delon/theme';
 import { STColumn, STComponent } from '@delon/abc';
 import { SFSchema } from '@delon/form';
-import { NzTreeNode, NzFormatEmitEvent, NzDropdownService, NzDropdownContextComponent, NzModalService } from 'ng-zorro-antd';
+import { NzTreeNode, NzFormatEmitEvent, NzDropdownService, NzDropdownContextComponent, NzModalService, NzNotificationService } from 'ng-zorro-antd';
 import { BaseArchivesPost } from 'app/entity/basedata/base-archives-post';
 import { BasedataPostAddComponent } from './add/add.component';
 import { FormBuilder, FormGroup, Validators } from '@angular/forms';
@@ -20,7 +20,8 @@ export class BasedataPostComponent implements OnInit {
     private modalService:NzModalService,
     private fb: FormBuilder,
     private baseArchivesPostService:BaseArchivesPostService,
-    public settings: SettingsService
+    public settings: SettingsService,
+    private nzNotificationService: NzNotificationService
   ) { }
 
   ngOnInit() {
@@ -40,7 +41,10 @@ export class BasedataPostComponent implements OnInit {
 
   //查询tree合同类型
   getListContractTree() {
-    this.baseArchivesPostService.getTreeList(null).then((response)=>{
+    //查询条件
+    let baseArchivesPost=new BaseArchivesPost();
+    baseArchivesPost.pkOrg=sessionStorage.getItem("pkOrg");//组织
+    this.baseArchivesPostService.getTreeList(baseArchivesPost).then((response)=>{
       this.nodes=response.result  ;
     })
     
@@ -108,7 +112,9 @@ export class BasedataPostComponent implements OnInit {
           type: "primary",
           // loading:this.modelSaveLoading,
           onClick: addModel => {
-            addModel.submitForm()
+            addModel.submitForm().then(()=>{
+              this.getListContractTree();
+            })
           }
         }
       ]
@@ -139,7 +145,9 @@ export class BasedataPostComponent implements OnInit {
           type: "primary",
           // loading:this.modelSaveLoading,
           onClick: addModel => {
-            addModel.submitForm()
+            addModel.submitForm().then(()=>{
+              this.getListContractTree();
+            })
           }
         }
       ]
@@ -154,7 +162,17 @@ export class BasedataPostComponent implements OnInit {
    * 删除
    */
   delete(){
-
+    let baseArchivesPost=new BaseArchivesPost();
+    baseArchivesPost.id=this.id;
+    this.baseArchivesPostService.delete(baseArchivesPost).then((response)=>{
+      if(response.success){
+        this.dropdown.close()
+        this.nzNotificationService.success("删除成功","");
+        this.getListContractTree();
+      }else{
+        this.nzNotificationService.error("删除失败",response.message);
+      }
+    })
   }
   /**
    * 修改保存
@@ -172,7 +190,14 @@ export class BasedataPostComponent implements OnInit {
       }else{
         this.baseArchivesPost.status="0"
       }
-      alert(this.baseArchivesPost.code)
+      this.baseArchivesPostService.update(this.baseArchivesPost).then((response)=>{
+        if(response.success){
+          this.nzNotificationService.success("修改成功","");
+          this.getListContractTree();
+        }else{
+          this.nzNotificationService.error("修改失败",response.message);
+        }
+      })
     }
   }
 }

+ 45 - 25
src/app/routes/basedata/project-approval/add/add.component.ts

@@ -1,57 +1,77 @@
 import { Component, OnInit } from '@angular/core';
-import { NzModalRef, NzMessageService } from 'ng-zorro-antd';
+import { NzModalRef, NzMessageService, NzNotificationService, NzI18nService } from 'ng-zorro-antd';
 import { _HttpClient } from '@delon/theme';
 import { FormBuilder, Validators, FormGroup } from '@angular/forms';
 import { BaseArchivesProjectApproval } from 'app/entity/basedata/base-archives-project-approval';
+import { BaseArchivesProjectApprovalService } from 'app/services/basedata/base-archives-project-approval.service';
+import { I18NService } from '@core';
 
 @Component({
   selector: 'app-basedata-project-approval-add',
   templateUrl: './add.component.html',
 })
 export class BasedataProjectApprovalAddComponent implements OnInit {
-  
   constructor(
     private modal: NzModalRef,
-    private fb: FormBuilder
-  ) { }
+    private fb: FormBuilder,
+    private baseArchivesProjectApprovalService: BaseArchivesProjectApprovalService,
+    private nzNotificationService: NzNotificationService,
+    private i18NService: I18NService,
+  ) {}
 
   ngOnInit(): void {
     //初始化表单
     this.validateForm = this.fb.group({
-      code: [{value:"",disabled:true},[]],
+      code: [{ value: '', disabled: true }, []],
       name: [null, [Validators.required]],
-      status:[null]
-
+      status: [null],
     });
+    //新增子集获取父节点id
+    // if(this.parentId&&this.parentId!=="0"){
+    this.baseArchivesProjectApproval.parentId = this.parentId;
+    // }
   }
 
   validateForm!: FormGroup;
-  parentId="";//父级id
-  status=true;
+  parentId = '0'; //父级id
+  status = true;
 
   /**
    * 提交按钮
    */
-  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.status){
-        this.baseArchivesProjectApproval.status="1"
-      }else{
-        this.baseArchivesProjectApproval.status="0"
+  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.status) {
+          this.baseArchivesProjectApproval.status = '1';
+        } else {
+          this.baseArchivesProjectApproval.status = '0';
+        }
+        this.baseArchivesProjectApproval.pkOrg = sessionStorage.getItem('pkOrg'); //组织
+        this.baseArchivesProjectApprovalService.add(this.baseArchivesProjectApproval).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'), '');
+          }
+        });
       }
-      alert(this.parentId)
-    }
+    });
   }
 
   //实体
-  baseArchivesProjectApproval:BaseArchivesProjectApproval={};
-  
+  baseArchivesProjectApproval: BaseArchivesProjectApproval = {};
+
   /**
    * 关闭按钮
    */

+ 44 - 36
src/app/routes/basedata/project-approval/project-approval.component.ts

@@ -2,10 +2,12 @@ import { Component, OnInit, ViewChild, TemplateRef } from '@angular/core';
 import { _HttpClient, ModalHelper } from '@delon/theme';
 import { STColumn, STComponent } from '@delon/abc';
 import { SFSchema } from '@delon/form';
-import { NzDropdownService, NzModalService, NzDropdownContextComponent, NzTreeNode, NzFormatEmitEvent } from 'ng-zorro-antd';
+import { NzDropdownService, NzModalService, NzDropdownContextComponent, NzTreeNode, NzFormatEmitEvent, NzNotificationService } from 'ng-zorro-antd';
 import { FormBuilder, Validators, FormGroup } from '@angular/forms';
 import { BaseArchivesProjectApproval } from 'app/entity/basedata/base-archives-project-approval';
 import { BasedataProjectApprovalAddComponent } from './add/add.component';
+import { BaseArchivesProjectApprovalService } from 'app/services/basedata/base-archives-project-approval.service';
+import { I18NService } from '@core';
 
 @Component({
   selector: 'app-basedata-project-approval',
@@ -16,7 +18,10 @@ export class BasedataProjectApprovalComponent implements OnInit {
   constructor(
     private nzDropdownService: NzDropdownService,
     private modalService:NzModalService,
-    private fb: FormBuilder
+    private fb: FormBuilder,
+    private baseArchivesProjectApprovalService:BaseArchivesProjectApprovalService,
+    private nzNotificationService:NzNotificationService,
+    private i18NService:I18NService
   ) { }
 
   ngOnInit() {
@@ -40,35 +45,11 @@ export class BasedataProjectApprovalComponent implements OnInit {
     // this.contractClassService.getAllContractClass1().then((response) => {
     //   this.nodes = response.result
     // })
-    this.nodes=[
-      {
-        code: "001",
-      createBy: "admin",
-      createTime: "2019-05-17 12:01:32",
-      isLeaf: false,
-      key: "604d450067afc7b7f52a8987d60bd745",
-      parentId: "",
-      parentIds: null,
-      title: "产品",
-      value: "604d450067afc7b7f52a8987d60bd745",
-      status:"1",
-      children:[
-        {
-          code: "0001",
-          createBy: "admin",
-          createTime: "2019-05-17 12:01:32",
-          isLeaf: true,
-          key: "2",
-          parentId: "604d450067afc7b7f52a8987d60bd745",
-          parentIds: null,
-          title: "架构",
-          value: "2",
-          status:"0",
-          children:null
-        }
-      ]
-      }
-    ]
+    let baseArchivesProjectApproval=new BaseArchivesProjectApproval();
+    baseArchivesProjectApproval.pkOrg=sessionStorage.getItem("pkOrg");
+    this.baseArchivesProjectApprovalService.getTreeList(baseArchivesProjectApproval).then((response)=>{
+      this.nodes=response.result;
+    })
   }
 
   //双击节点自动打开树分支
@@ -99,10 +80,12 @@ export class BasedataProjectApprovalComponent implements OnInit {
     }else{
       this.status=true;
     }
+    //赋值给修改表单
     this.baseArchivesProjectApproval = {
       name: getdDepart.title,
       code: getdDepart.code,
-      id: getdDepart.key
+      id: getdDepart.key,
+      parentId:getdDepart.parentId
     }
   }
 
@@ -137,7 +120,9 @@ export class BasedataProjectApprovalComponent implements OnInit {
           type: "primary",
           // loading:this.modelSaveLoading,
           onClick: addModel => {
-            addModel.submitForm()
+            addModel.submitForm().then(()=>{
+              this.getListContractTree();
+            })
           }
         }
       ]
@@ -168,7 +153,9 @@ export class BasedataProjectApprovalComponent implements OnInit {
           type: "primary",
           // loading:this.modelSaveLoading,
           onClick: addModel => {
-            addModel.submitForm()
+            addModel.submitForm().then(()=>{
+              this.getListContractTree();
+            })
           }
         }
       ]
@@ -183,7 +170,19 @@ export class BasedataProjectApprovalComponent implements OnInit {
    * 删除
    */
   delete(){
-
+    let baseArchivesProjectApproval=new BaseArchivesProjectApproval();
+    baseArchivesProjectApproval.id=this.id;
+    this.baseArchivesProjectApprovalService.delete(baseArchivesProjectApproval).then((response)=>{
+      if (response.success) {
+        //删除成功
+        this.nzNotificationService.success(this.i18NService.fanyi('successful.deletion'), '');
+        this.dropdown.close()
+        this.getListContractTree();
+      } else {
+        //删除失败
+        this.nzNotificationService.error(this.i18NService.fanyi('delete.failed'), '');
+      }
+    })
   }
   /**
    * 修改保存
@@ -201,7 +200,16 @@ export class BasedataProjectApprovalComponent implements OnInit {
       }else{
         this.baseArchivesProjectApproval.status="0"
       }
-      alert(this.baseArchivesProjectApproval.code)
+      this.baseArchivesProjectApprovalService.update(this.baseArchivesProjectApproval).then((response)=>{
+        if (response.success) {
+          //保存成功
+          this.nzNotificationService.success(this.i18NService.fanyi('save.ok'), '');
+          this.getListContractTree();
+        } else {
+          //保存失败
+          this.nzNotificationService.error(this.i18NService.fanyi('save.not'), '');
+        }
+      })
     }
   }
 }

+ 1 - 0
src/app/routes/system/dict/add/add.component.ts

@@ -50,6 +50,7 @@ export class SystemDictAddComponent implements OnInit {
   //保存
   save() {
     if (this.dict.id == "" || this.dict.id == null) {
+      this.dict.pkOrg=sessionStorage.getItem("pkOrg");
       //添加
       this.dictService.addDict(this.dict).then((response) => {
         if (response.success == true) {

+ 1 - 0
src/app/routes/system/dict/dict.component.ts

@@ -48,6 +48,7 @@ export class SystemDictComponent implements OnInit {
   getListDict(pageNo) {
     this.isSpinning = true;
     this.dict.pageNo = pageNo;//当前页码
+    this.dict.pkOrg=sessionStorage.getItem("pkOrg");
     this.dictService.getAllDict1(this.dict).then((response) => {
       this.listOfData = response.result.records;
       this.page = response.result;

+ 1 - 1
src/app/routes/system/menu/menu.component.ts

@@ -143,7 +143,7 @@ export class SystemMenuComponent implements OnInit {
   getMenus() {
     this.isSpinning = true;
     let menu=new Menu();
-    menu.pkOrg=sessionStorage.getItem("pkOrg");
+    // menu.pkOrg=sessionStorage.getItem("pkOrg");
     this.menuService.getMenus1(menu).then((response) => {
       this.listOfMapData = response.result;
       this.listOfMapData.forEach(item => {

+ 1 - 0
src/app/routes/system/serial-pattern/add/add.component.ts

@@ -58,6 +58,7 @@ export class SystemSerialPatternAddComponent implements OnInit {
   //保存
   save() {
     if (this.serialPattern.id === "" || this.serialPattern.id === null) {
+      this.serialPattern.pkOrg=sessionStorage.getItem("pkOrg");
       //添加
       this.serialPatternService.add(this.serialPattern).then((response) => {
         if (response.success === true) {

+ 1 - 0
src/app/routes/system/serial-pattern/serial-pattern.component.ts

@@ -55,6 +55,7 @@ export class SystemSerialPatternComponent implements OnInit {
   list(pageNo) {
     this.isSpinning = true;
     this.serialPattern.pageNo = pageNo;//当前页码
+    this.serialPattern.pkOrg=sessionStorage.getItem("pkOrg");
     this.serialPatternService.list1(this.serialPattern).then((response) => {
       this.listOfData = response.result.records;
       this.page = response.result;

+ 1 - 0
src/app/routes/system/timed-task/add/add.component.ts

@@ -112,6 +112,7 @@ export class SystemTimedTaskAddComponent implements OnInit {
     this.timedTask.cronExpression = "0 "+cronExpression1+" "+cronExpression2+"  * * ?";
 
     if (this.timedTask.id === "" || this.timedTask.id === null) {
+      this.timedTask.pkOrg=sessionStorage.getItem("pkOrg");
       //添加
       this.timedTaskService.add(this.timedTask).then((response) => {
         if (response.success === true) {

+ 1 - 0
src/app/routes/system/timed-task/timed-task.component.ts

@@ -57,6 +57,7 @@ export class SystemTimedTaskComponent implements OnInit {
   list(pageNo) {
     this.isSpinning = true;
     this.timedTask.pageNo = pageNo;//当前页码
+    this.timedTask.pkOrg=sessionStorage.getItem("pkOrg");
     this.timedTaskService.list(this.timedTask).then((response) => {
       this.listOfData = response.result.records;
       this.page = response.result;

+ 27 - 7
src/app/services/basedata/base-archives-post.service.ts

@@ -2,24 +2,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 { BaseArchivesPost } from 'app/entity/basedata/base-archives-post';
 
 @Injectable({
-  providedIn: 'root'
+  providedIn: 'root',
 })
 /**
  * 职务档案
  */
 export class BaseArchivesPostService {
-
-  constructor(private http:HttpClient) { }
+  constructor(private http: HttpClient) {}
 
   //查詢全部
-  async getList(body:any): Promise<BaseResponse<Result<any>>> {
-    return await this.http.get<BaseResponse<Result<any>>>('/base/archivesPost/list',{params:body}).toPromise();
+  async getList(body: any): Promise<BaseResponse<Result<any>>> {
+    return await this.http.get<BaseResponse<Result<any>>>('/base/archivesPost/list', { params: body }).toPromise();
   }
 
   //查詢Tree
-  async getTreeList(body:any): Promise<BaseResponse<Result<any>>> {
-    return await this.http.get<BaseResponse<Result<any>>>('/base/archivesPost/list',{params:body}).toPromise();
+  async getTreeList(body: any): Promise<BaseResponse<Result<any>>> {
+    return await this.http.get<BaseResponse<Result<any>>>('/base/archivesPost/list', { params: body }).toPromise();
+  }
+
+  //新增
+  async add(body: BaseArchivesPost): Promise<BaseResponse<any>> {
+    return await this.http.post<BaseResponse<any>>('base/archivesPost/add', body).toPromise();
+  }
+
+  //修改
+  async update(body: BaseArchivesPost): Promise<BaseResponse<any>> {
+    return await this.http.post<BaseResponse<any>>('base/archivesPost/edit', body).toPromise();
+  }
+
+  //根据id查询
+  async getById(id: string): Promise<BaseResponse<BaseArchivesPost>> {
+    return await this.http.get<BaseResponse<BaseArchivesPost>>("base/archivesPost/queryById", { params: { id: id } }).toPromise();
+  }
+
+  //删除
+  async delete(body:any):Promise<BaseResponse<any>>{
+    return await this.http.post<BaseResponse<any>>('base/archivesPost/delete',body).toPromise();
   }
 }

+ 27 - 0
src/app/services/basedata/base-archives-project-approval.service.ts

@@ -1,5 +1,8 @@
 import { Injectable } from '@angular/core';
 import { HttpClient } from '@angular/common/http';
+import { BaseResponse } from 'app/entity/baseResponse';
+import { Result } from 'app/entity/Result';
+import { BaseArchivesProjectApproval } from 'app/entity/basedata/base-archives-project-approval';
 
 @Injectable({
   providedIn: 'root'
@@ -10,4 +13,28 @@ import { HttpClient } from '@angular/common/http';
 export class BaseArchivesProjectApprovalService {
 
   constructor(private http:HttpClient) { }
+  //查詢Tree
+  async getTreeList(body: any): Promise<BaseResponse<Result<any>>> {
+    return await this.http.get<BaseResponse<Result<any>>>('/basedata/projectApproval/list', { params: body }).toPromise();
+  }
+
+  //新增
+  async add(body: BaseArchivesProjectApproval): Promise<BaseResponse<any>> {
+    return await this.http.post<BaseResponse<any>>('basedata/projectApproval/add', body).toPromise();
+  }
+
+  //修改
+  async update(body: BaseArchivesProjectApproval): Promise<BaseResponse<any>> {
+    return await this.http.post<BaseResponse<any>>('basedata/projectApproval/edit', body).toPromise();
+  }
+
+  //根据id查询
+  async getById(id: string): Promise<BaseResponse<BaseArchivesProjectApproval>> {
+    return await this.http.get<BaseResponse<BaseArchivesProjectApproval>>("basedata/projectApproval/queryById", { params: { id: id } }).toPromise();
+  }
+
+  //删除
+  async delete(body:any):Promise<BaseResponse<any>>{
+    return await this.http.post<BaseResponse<any>>('basedata/projectApproval/delete',body).toPromise();
+  }
 }