Bladeren bron

自动派单接口联调

seimin 1 jaar geleden
bovenliggende
commit
afcf932311

+ 2 - 4
src/app/views/quick-combination/quick-combination.component.html

@@ -198,8 +198,7 @@
198 198
             <nz-form-label [nzSm]="24" [nzXs]="24" nzRequired nzFor="quickCombinationDispatchMethod">派单方式</nz-form-label>
199 199
             <nz-form-control nzErrorTip="请选择派单方式!">
200 200
               <nz-radio-group formControlName="quickCombinationDispatchMethod" (ngModelChange)="radioDispatchMethod($event)">
201
-                <label nz-radio nzValue="1">抢派单结合</label>
202
-                <label nz-radio nzValue="2">自动派单</label>
201
+                <label nz-radio [nzValue]="item.value" *ngFor="let item of dispatchMethods">{{item.name}}</label>
203 202
               </nz-radio-group>
204 203
             </nz-form-control>
205 204
           </nz-form-item>
@@ -207,8 +206,7 @@
207 206
             <nz-form-label [nzSm]="24" [nzXs]="24" nzRequired nzFor="quickCombinationDispatchType">自动派单类型</nz-form-label>
208 207
             <nz-form-control nzErrorTip="请选择自动派单类型!">
209 208
               <nz-radio-group formControlName="quickCombinationDispatchType">
210
-                <label nz-radio nzValue="1">顺序派单</label>
211
-                <label nz-radio nzValue="2">最优路径</label>
209
+                <label nz-radio [nzValue]="item.value" *ngFor="let item of dispatchTypes">{{item.name}}</label>
212 210
               </nz-radio-group>
213 211
             </nz-form-control>
214 212
           </nz-form-item>

+ 35 - 3
src/app/views/quick-combination/quick-combination.component.ts

@@ -87,6 +87,8 @@ export class QuickCombinationComponent implements OnInit {
87 87
     this.currentHospital = this.tool.getCurrentHospital();
88 88
     this.initForm();
89 89
     this.getList(1);
90
+    this.getDispatchMethods();
91
+    this.getDispatchTypes();
90 92
   }
91 93
   // 重置
92 94
   reset() {
@@ -466,7 +468,12 @@ export class QuickCombinationComponent implements OnInit {
466 468
       this.validateForm.get("quickCombinationDispatchMethod")!.markAsDirty();
467 469
     }
468 470
     this.validateForm.get("quickCombinationDispatchMethod")!.updateValueAndValidity();
469
-    this.validateForm.controls.quickCombinationDispatchMethod.setValue(null);
471
+    if(this.add){
472
+      this.validateForm.controls.quickCombinationDispatchMethod.setValue(null);
473
+    }else{
474
+      this.validateForm.controls.quickCombinationDispatchMethod.setValue(this.info.dispatchMethod ? this.info.dispatchMethod.value : null);
475
+    }
476
+    
470 477
     // ------
471 478
     if (!(this.queryParamsType == 1 && this.quickCombinationModel == 1 && this.validateForm.value.quickCombinationDispatchMethod == 2)) {
472 479
       this.validateForm.get("quickCombinationDispatchType")!.clearValidators();
@@ -482,10 +489,32 @@ export class QuickCombinationComponent implements OnInit {
482 489
       this.validateForm.get("quickCombinationDispatchWeight")!.markAsDirty();
483 490
     }
484 491
     this.validateForm.get("quickCombinationDispatchType")!.updateValueAndValidity();
485
-    this.validateForm.controls.quickCombinationDispatchType.setValue(null);
492
+    if(this.add){
493
+      this.validateForm.controls.quickCombinationDispatchType.setValue(null);
494
+    }else{
495
+      this.validateForm.controls.quickCombinationDispatchType.setValue(this.info.dispatchType ? this.info.dispatchType.value : null);
496
+    }
486 497
 
487 498
     this.validateForm.get("quickCombinationDispatchWeight")!.updateValueAndValidity();
488
-    this.validateForm.controls.quickCombinationDispatchWeight.setValue(0);
499
+    if(this.add){
500
+      this.validateForm.controls.quickCombinationDispatchWeight.setValue(0);
501
+    }else{
502
+      this.validateForm.controls.quickCombinationDispatchWeight.setValue(this.info.maxWeight || null);
503
+    }
504
+  }
505
+  //获取派单方式
506
+  dispatchMethods:any[] = [];
507
+  getDispatchMethods() {
508
+    this.mainService.getDictionary("list", "dispatchMethod").subscribe((data) => {
509
+      this.dispatchMethods = data;
510
+    });
511
+  }
512
+  //获取派单类型
513
+  dispatchTypes:any[] = [];
514
+  getDispatchTypes() {
515
+    this.mainService.getDictionary("list", "dispatchType").subscribe((data) => {
516
+      this.dispatchTypes = data;
517
+    });
489 518
   }
490 519
   // 选择派单方式
491 520
   radioDispatchMethod(){
@@ -1026,6 +1055,9 @@ export class QuickCombinationComponent implements OnInit {
1026 1055
         taskTypes: taskTypesIds,
1027 1056
         ruleType: this.quickCombinationModelComputed,
1028 1057
         workSchemeId: this.queryParamsId,
1058
+        dispatchMethod: this.dispatchMethods.find(v => v.value == this.validateForm.value.quickCombinationDispatchMethod),
1059
+        dispatchType: this.validateForm.value.quickCombinationDispatchMethod == 2 ? (this.dispatchTypes.find(v => v.value == this.validateForm.value.quickCombinationDispatchType)) : undefined,
1060
+        maxWeight: this.validateForm.value.quickCombinationDispatchMethod == 2 ? this.validateForm.value.quickCombinationDispatchWeight : undefined,
1029 1061
       },
1030 1062
     };
1031 1063
     //添加科室字段,绑定人字段

+ 8 - 4
src/app/views/task-type-management/task-type-management.component.html

@@ -262,12 +262,16 @@
262 262
           <nz-checkbox-group class="handlerType" [nzDisabled]="isRemarks == 1" [(ngModel)]="carryEquipmentIds"></nz-checkbox-group>
263 263
         </div>
264 264
         <div nz-row>
265
-          <nz-form-label class="label" nzRequired>急单权重</nz-form-label>
266
-          <input nz-input type="number" min="0" class="mb8" [(ngModel)]="urgentWeight" placeholder="请填写急单权重" nzSize="default" />
265
+          <nz-form-label class="label">急单权重</nz-form-label>
266
+          <input nz-input type="number" min="0" class="mb8" [(ngModel)]="urgeWeight" placeholder="请填写急单权重" nzSize="default" />
267 267
         </div>
268 268
         <div nz-row>
269
-          <nz-form-label class="label" nzRequired>普单权重</nz-form-label>
270
-          <input nz-input type="number" min="0" class="mb8" [(ngModel)]="generalWeight" placeholder="请填写普单权重" nzSize="default" />
269
+          <nz-form-label class="label">普单权重</nz-form-label>
270
+          <input nz-input type="number" min="0" class="mb8" [(ngModel)]="commonWeight" placeholder="请填写普单权重" nzSize="default" />
271
+        </div>
272
+        <div nz-row>
273
+          <nz-form-label class="label">统计备注</nz-form-label>
274
+          <input nz-input type="text" min="0" class="mb8" [(ngModel)]="countRemark" placeholder="请填写统计备注" nzSize="default" />
271 275
         </div>
272 276
       </div>
273 277
       <!-- 规则信息 -->

+ 12 - 2
src/app/views/task-type-management/task-type-management.component.ts

@@ -83,8 +83,9 @@ export class TaskTypeManagementComponent implements OnInit {
83 83
   allScheduleClass; //班次列表
84 84
   //基础信息详情字段
85 85
   taskName; //任务名称
86
-  urgentWeight:number = 0; //急单权重
87
-  generalWeight:number = 0; //普单权重
86
+  urgeWeight:any; //急单权重
87
+  commonWeight:any; //普单权重
88
+  countRemark:string = ''; //统计备注
88 89
   association: any = {
89 90
     id: "",
90 91
     value: "",
@@ -828,6 +829,9 @@ export class TaskTypeManagementComponent implements OnInit {
828 829
     };
829 830
     this.taskData.taskType["id"] = data.id;
830 831
     this.taskName = data.taskName;
832
+    this.urgeWeight = data.urgeWeight;
833
+    this.commonWeight = data.commonWeight;
834
+    this.countRemark = data.countRemark || '';
831 835
     this.association = {
832 836
       id: data.associationType.id + "",
833 837
       value: data.associationType.value,
@@ -1132,6 +1136,9 @@ export class TaskTypeManagementComponent implements OnInit {
1132 1136
     } else {
1133 1137
       this.taskData.taskType["taskName"] = this.taskName;
1134 1138
     }
1139
+    this.taskData.taskType["urgeWeight"] = this.urgeWeight;
1140
+    this.taskData.taskType["commonWeight"] = this.commonWeight;
1141
+    this.taskData.taskType["countRemark"] = this.countRemark;
1135 1142
     if (this.association.id) {
1136 1143
       this.taskData.taskType["associationType"] = this.association;
1137 1144
     } else {
@@ -1455,6 +1462,9 @@ export class TaskTypeManagementComponent implements OnInit {
1455 1462
     this.departmentIds = "";
1456 1463
     this.departmentTypeIds = "";
1457 1464
     this.taskName = ""; //任务名称
1465
+    this.urgeWeight = ''; 
1466
+    this.commonWeight = ''; 
1467
+    this.countRemark = ''; 
1458 1468
     this.association = {
1459 1469
       id: null,
1460 1470
       value: "",