washing-batch.service.ts 1022 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 WashingBatchService {
  8. constructor(
  9. private mainService: MainService,
  10. ) { }
  11. // simple增删改
  12. simplePost(type, model, postData) {
  13. return this.mainService.simplePost(type, model, postData);
  14. }
  15. // 查询
  16. getFetchDataList(postData) {
  17. return this.mainService.getFetchDataList("simple/data", "clothesBatch", postData).pipe(map((v:any) => {
  18. if(Array.isArray(v.list)){
  19. v.list = v.list.map(vv => ({
  20. ...vv,
  21. buildingListNames: vv.buildingList ? vv.buildingList.map(v => v.buildingName).toString() : '',
  22. deptListNames: vv.deptList ? vv.deptList.map(v => v.dept).toString() : '',
  23. }));
  24. }else{
  25. v.list = [];
  26. }
  27. return v;
  28. }));;
  29. }
  30. // 字典
  31. getDictionary(type) {
  32. return this.mainService.getDictionary("list", type);
  33. }
  34. }