quilt-washing-send-page-control.service.ts 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import { Injectable } from '@angular/core';
  2. import { MainService } from 'src/app/services/main.service';
  3. import { map } from 'rxjs/operators';
  4. @Injectable({
  5. providedIn: 'root'
  6. })
  7. export class QuiltWashingSendPageControlService {
  8. constructor(
  9. private mainService: MainService,
  10. ) { }
  11. // 字典
  12. getDictionary(type) {
  13. return this.mainService.getDictionary("list", type);
  14. }
  15. // 获取配置列表
  16. getConfig(postData) {
  17. return this.mainService.getFetchDataList("simple/data", "taskTypeConfig", postData);
  18. }
  19. // 获取其他临床服务任务类型列表
  20. getTaskTypes(postData) {
  21. return this.mainService.getFetchDataList("simple/data", "taskType", postData).pipe(map((v:any) => {
  22. if(Array.isArray(v.list)){
  23. v.list = v.list.map(vv => ({id: vv.id, taskName: vv.taskName}));
  24. }else{
  25. v.list = [];
  26. }
  27. return v;
  28. }));
  29. }
  30. // 获取科室列表
  31. getDepts(postData) {
  32. return this.mainService.getFetchDataList("simple/data", "department", postData).pipe(map((v:any) => {
  33. if(Array.isArray(v.list)){
  34. v.list = v.list.map(vv => ({id: vv.id, dept: vv.dept}));
  35. }else{
  36. v.list = [];
  37. }
  38. return v;
  39. }));
  40. }
  41. // simple增删改
  42. simplePost(type, model, postData) {
  43. return this.mainService.simplePost(type, model, postData);
  44. }
  45. }