|
@@ -0,0 +1,100 @@
|
|
1
|
+import { Component, OnInit } from "@angular/core";
|
|
2
|
+import { ToolService } from 'src/app/services/tool.service';
|
|
3
|
+import { NzMessageService } from 'ng-zorro-antd';
|
|
4
|
+import { PerformanceAllocationService } from './performance-allocation.service';
|
|
5
|
+
|
|
6
|
+@Component({
|
|
7
|
+ selector: "app-performance-allocation",
|
|
8
|
+ templateUrl: "./performance-allocation.component.html",
|
|
9
|
+ styleUrls: ["./performance-allocation.component.less"],
|
|
10
|
+})
|
|
11
|
+export class PerformanceAllocationComponent implements OnInit {
|
|
12
|
+ loading:boolean = false; //页面加载的loading
|
|
13
|
+ btnLoading:boolean = false; //提交按钮的loading
|
|
14
|
+ tabModalName:string = 'characteristics'; //当前选中的tab
|
|
15
|
+ hosId = this.tool.getCurrentHospital().id; //当前院区
|
|
16
|
+
|
|
17
|
+ // 起点科室绩效计算方式
|
|
18
|
+ startCalculate:any = null;
|
|
19
|
+ // 终点科室绩效计算方式
|
|
20
|
+ endCalculate:any = null;
|
|
21
|
+ // 配置
|
|
22
|
+ configs:any = {};
|
|
23
|
+ constructor(private otherPageControlService: PerformanceAllocationService, private tool: ToolService, private msg: NzMessageService) {}
|
|
24
|
+
|
|
25
|
+ ngOnInit():void {
|
|
26
|
+ this.getIntegralCalculationMethod();
|
|
27
|
+ }
|
|
28
|
+
|
|
29
|
+ //获取绩效计算方式
|
|
30
|
+ grade_calculates:any = [];
|
|
31
|
+ dLoading = false;
|
|
32
|
+ getIntegralCalculationMethod() {
|
|
33
|
+ this.dLoading = true;
|
|
34
|
+ this.otherPageControlService
|
|
35
|
+ .getDictionary("grade_calculate")
|
|
36
|
+ .subscribe((data) => {
|
|
37
|
+ this.dLoading = false;
|
|
38
|
+ this.grade_calculates = data;
|
|
39
|
+ this.getConfig();
|
|
40
|
+ });
|
|
41
|
+ }
|
|
42
|
+
|
|
43
|
+ // 切换tab
|
|
44
|
+ tabModal(tabModalName:string){
|
|
45
|
+ this.tabModalName = tabModalName;
|
|
46
|
+ }
|
|
47
|
+
|
|
48
|
+ // 保存
|
|
49
|
+ submitForm() {
|
|
50
|
+ if(!this.startCalculate){
|
|
51
|
+ this.msg.create("warning", "请选择起点科室绩效计算方式!");
|
|
52
|
+ return;
|
|
53
|
+ }
|
|
54
|
+ if(!this.endCalculate){
|
|
55
|
+ this.msg.create("warning", "请选择终点科室绩效计算方式!");
|
|
56
|
+ return;
|
|
57
|
+ }
|
|
58
|
+ let postData:any = {
|
|
59
|
+ id: this.configs.id,
|
|
60
|
+ hosId: this.hosId,
|
|
61
|
+ startCalculate: this.startCalculate ? { id: this.startCalculate } : undefined,
|
|
62
|
+ endCalculate: this.endCalculate ? { id: this.endCalculate } : undefined,
|
|
63
|
+ };
|
|
64
|
+ this.btnLoading = true;
|
|
65
|
+ this.otherPageControlService
|
|
66
|
+ .simplePost("addData", "workOrderGradeBase", postData)
|
|
67
|
+ .subscribe((result) => {
|
|
68
|
+ this.btnLoading = false;
|
|
69
|
+ if (result.status == 200) {
|
|
70
|
+ this.getConfig();
|
|
71
|
+ }
|
|
72
|
+ });
|
|
73
|
+ }
|
|
74
|
+
|
|
75
|
+ // 获取配置
|
|
76
|
+ getConfig() {
|
|
77
|
+ this.loading = true;
|
|
78
|
+ let postData = {
|
|
79
|
+ idx: 0,
|
|
80
|
+ sum: 10,
|
|
81
|
+ workOrderGradeBase: {
|
|
82
|
+ hosId: this.hosId,
|
|
83
|
+ }
|
|
84
|
+ };
|
|
85
|
+ this.otherPageControlService
|
|
86
|
+ .getConfig(postData)
|
|
87
|
+ .subscribe((result) => {
|
|
88
|
+ this.loading = false;
|
|
89
|
+ if (result.status == 200) {
|
|
90
|
+ this.configs = result.list[0] || {};
|
|
91
|
+ let original_dept = this.grade_calculates.find(v => v.value == 'original_dept');
|
|
92
|
+ this.startCalculate = this.configs.startCalculate ? this.configs.startCalculate.id : (original_dept ? original_dept.id : undefined);
|
|
93
|
+ this.endCalculate = this.configs.endCalculate ? this.configs.endCalculate.id : (original_dept ? original_dept.id : undefined);
|
|
94
|
+ }
|
|
95
|
+ });
|
|
96
|
+ }
|
|
97
|
+}
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|