|
@@ -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")
|
|
|
+
|
|
|
+ }
|
|
|
}
|