Browse Source

合同档案

chenc 3 years ago
parent
commit
a41c4f2fe9

+ 21 - 4
src/app/routes/contract-management/contract-file/contract-file.component.html

@@ -2,6 +2,7 @@
   <ng-template #phActionTpl>
     <!-- 新建 -->
     <button (click)="add()" nz-button nzType="primary">{{ 'new' | translate }}</button>
+    <button (click)="add2()" nz-button nzType="primary">测试</button>
   </ng-template>
 </page-header>
 <nz-card>
@@ -62,7 +63,7 @@
             <!-- 成交金额 -->
             <th>{{ 'deal.price' | translate }}</th>
             <!-- 操作 -->
-            <th>{{ 'table.operation"' | translate }}</th>
+            <th>{{ 'table.operation' | translate }}</th>
           </tr>
         </thead>
         <tbody>
@@ -76,13 +77,29 @@
             <td>{{ data.transactionAmount }}</td>
             <td>
               <!-- 详情 -->
-              <a (click)="view(data.id)">{{ 'table.view' | translate }}</a>
-              <nz-divider nzType="vertical"></nz-divider>
+              <!-- <a (click)="view(data.id)">{{ 'table.view' | translate }}</a>
+              <nz-divider nzType="vertical"></nz-divider> -->
               <!-- 修改 -->
               <a (click)="update(data.id)">{{ 'table.update' | translate }}</a>
               <nz-divider nzType="vertical"></nz-divider>
               <!-- 删除 -->
-              <a (click)="delete(data.id)">{{ 'table.delete' | translate }}</a>
+              <!-- <a (click)="delete(data.id)">{{ 'table.delete' | translate }}</a> -->
+              
+              <a nz-popconfirm nzTitle="{{ 'confirm.to.delete' | translate }}?" nzOkText="{{ 'yes' | translate }}"
+                nzCancelText="{{ 'no' | translate }}"
+                (nzOnConfirm)="delete(data.id)">{{ 'table.delete' | translate }}</a>
+                <!-- 更多 -->
+              <nz-divider nzType="vertical"></nz-divider>
+              <nz-dropdown>
+                <a nz-dropdown> {{'menu.more'|translate}} <i nz-icon type="down"></i> </a>
+                <ul nz-menu nzSelectable>
+                  <!-- 修改 -->
+                  <li nz-menu-item >
+                    <a href="javascript:;"
+                      (click)="submitProcess(data.id)">提交流程</a>
+                  </li>
+                </ul>
+              </nz-dropdown>
             </td>
           </tr>
         </tbody>

+ 71 - 40
src/app/routes/contract-management/contract-file/contract-file.component.ts

@@ -8,24 +8,27 @@ import { I18NService } from '@core';
 import { ContractFile } from 'app/entity/contract-management/contract-file';
 import { ContractFileService } from 'app/services/contract-management/contract-file.service';
 import { ContractManagementContractFileUpdateComponent } from './update/update.component';
+import { Router } from '@angular/router';
 
 @Component({
   selector: 'app-contract-management-contract-file',
   templateUrl: './contract-file.component.html',
 })
 export class ContractManagementContractFileComponent implements OnInit {
-  
-
-  constructor(private nzDrawerService:NzDrawerService,private i18NService:I18NService,
-    private contractFileService:ContractFileService,
-    private nzNotificationService:NzNotificationService) { }
+  constructor(
+    private nzDrawerService: NzDrawerService,
+    private i18NService: I18NService,
+    private contractFileService: ContractFileService,
+    private nzNotificationService: NzNotificationService,
+    private router:Router
+  ) {}
 
   ngOnInit() {
-    this.getList()
-   }
+    this.getList();
+  }
 
-  contractFile:ContractFile={}//合同对象
-  listOfData:ContractFile[]=[];//合同对象
+  contractFile: ContractFile = {}; //合同对象
+  listOfData: ContractFile[] = []; //合同对象
   page = {
     total: 0,
     current: 0,
@@ -35,7 +38,7 @@ export class ContractManagementContractFileComponent implements OnInit {
   /**
    * 查询按钮
    */
-  query(){
+  query() {
     this.contractFile.pageNo = 1;
     this.getList();
   }
@@ -49,46 +52,45 @@ export class ContractManagementContractFileComponent implements OnInit {
   /**
    * 查询
    */
-  getList(){
-    return new Promise((resolve)=>{
-      this.isSpinning=true;
-      this.contractFile.pkOrg=sessionStorage.getItem("pkOrg");//组织
-      this.contractFileService.getPageList(this.contractFile).then((response)=>{
-        if(response.success){
-          this.listOfData=JSON.parse(JSON.stringify((response.result.records)));
-          this.page=JSON.parse(JSON.stringify(response.result))
-          this.isSpinning=false;
-          resolve()
+  getList() {
+    return new Promise(resolve => {
+      this.isSpinning = true;
+      this.contractFile.pkOrg = sessionStorage.getItem('pkOrg'); //组织
+      this.contractFileService.getPageList(this.contractFile).then(response => {
+        if (response.success) {
+          this.listOfData = JSON.parse(JSON.stringify(response.result.records));
+          this.page = JSON.parse(JSON.stringify(response.result));
+          this.isSpinning = false;
+          resolve();
         }
-      })
-    })
+      });
+    });
   }
 
   /**
    * 详情
    */
-  view(id){
-
-  }
+  view(id) {}
 
   /**
    * 修改
    */
-  update(id){
+  update(id) {
     const drawerRef = this.nzDrawerService.create({
-      nzTitle: this.i18NService.fanyi("table.update"),//修改标题
+      nzTitle: this.i18NService.fanyi('table.update'), //修改标题
       nzContent: ContractManagementContractFileUpdateComponent,
       nzWidth: window.innerWidth,
       nzBodyStyle: { height: 'calc(100% - 55px)', overflow: 'auto', 'padding-bottom': '53px' },
       nzContentParams: {
         //合同id
-        id: id
-      }
+        id: id,
+      },
     });
 
     //关闭抽屉的回调
-    drawerRef.afterClose.subscribe((isRefresh) => {
-      if (isRefresh) {//刷新list列表
+    drawerRef.afterClose.subscribe(isRefresh => {
+      if (isRefresh) {
+        //刷新list列表
         this.getList();
       }
     });
@@ -97,9 +99,9 @@ export class ContractManagementContractFileComponent implements OnInit {
   /**
    * 删除
    */
-  delete(id){
-    return new Promise((resolve)=>{
-      this.contractFileService.deleteMainAndChild(id).then((response)=>{
+  delete(id) {
+    return new Promise(resolve => {
+      this.contractFileService.deleteMainAndChild(id).then(response => {
         if (response.success) {
           //删除成功
           this.nzNotificationService.success(this.i18NService.fanyi('successful.deletion'), '');
@@ -108,16 +110,16 @@ export class ContractManagementContractFileComponent implements OnInit {
           //删除失败
           this.nzNotificationService.error(this.i18NService.fanyi('delete.failed'), '');
         }
-      })
-    })
+      });
+    });
   }
 
   add() {
     const drawerRef = this.nzDrawerService.create({
-      nzTitle: this.i18NService.fanyi("button.add"),//新增标题
+      nzTitle: this.i18NService.fanyi('button.add'), //新增标题
       nzContent: ContractManagementContractFileAddComponent,
       nzWidth: window.innerWidth,
-      nzBodyStyle: { height: 'calc(100% - 55px)', overflow: 'auto', 'padding-bottom': '53px' }
+      nzBodyStyle: { height: 'calc(100% - 55px)', overflow: 'auto', 'padding-bottom': '53px' },
       // nzContentParams: {
       //   //模板id
       //   quotationId: item.id
@@ -125,11 +127,40 @@ export class ContractManagementContractFileComponent implements OnInit {
     });
 
     //关闭抽屉的回调
-    drawerRef.afterClose.subscribe((isRefresh) => {
-      if (isRefresh) {//刷新list列表
+    drawerRef.afterClose.subscribe(isRefresh => {
+      if (isRefresh) {
+        //刷新list列表
         this.getList();
       }
     });
   }
 
+  /**
+   * 提交流程
+   */
+  submitProcess(id) {
+    return new Promise(resolve => {
+      this.isSpinning=true;
+      this.contractFileService.submitProcess(id).then(response => {
+        if (response.success) {
+          //提交成功
+          this.nzNotificationService.success("提交成功", '');
+          this.getList();
+          this.isSpinning=false;
+          resolve()
+        } else {
+          //提交失败
+          this.nzNotificationService.error("提交失败", '');
+          this.isSpinning=false;
+        }
+      });
+    });
+  }
+
+  add2(){
+    // this.router.navigateByUrl("/contract-management/contract-process-view")
+    // this.router.navigateByUrl("/passport/register")
+    window.open("/contract-management/contract-process-view")
+
+  }
 }

+ 7 - 0
src/app/services/contract-management/contract-file.service.ts

@@ -73,4 +73,11 @@ export class ContractFileService {
     return await this.http.put<BaseResponse<any>>('contract.file/contractFile/updateMainAndChild', body).toPromise();
   }
 
+  //提交流程
+  async submitProcess(id: string): Promise<BaseResponse<any>> {
+    return await this.http
+      .get<BaseResponse<any>>('contract.file/contractFile/submitProcess', { params: { id: id } })
+      .toPromise();
+  }
+
 }