6c9e9acc15aa11c678ac81ecfc60a908ca9cb7a4.svn-base 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. 
  2. (function () {
  3. BemsWebApplication.FmsConstructionEstimationViewModel = function (data) {
  4. this.SiteId = ko.observable();
  5. this.ConstructionId = ko.observable();
  6. this.EstimateDate = ko.observable();
  7. this.EstimateUserId = ko.observable();
  8. this.Safety01_CleanUp = ko.observable();
  9. this.Safety02_PersonalProtection = ko.observable();
  10. this.Safety03_FireExtinguisher = ko.observable();
  11. this.Safety04_HighPlaceWork = ko.observable();
  12. this.Safety05_Weld = ko.observable();
  13. this.Safety06_SurroundingCleanUp = ko.observable();
  14. this.Safety07_SurroundingHealthy = ko.observable();
  15. this.Safety08_Noise = ko.observable();
  16. this.Safety09_FacilityProtection = ko.observable();
  17. this.Safety10_Waste = ko.observable();
  18. this.Safety11_Execution = ko.observable();
  19. this.Safety12_Announcement = ko.observable();
  20. this.Ability01_Compliance = ko.observable();
  21. this.Ability02_Fault = ko.observable();
  22. this.Ability03_SkillLevel = ko.observable();
  23. this.Ability04_ProcessManagement = ko.observable();
  24. this.Ability05_Collaboration = ko.observable();
  25. this.Service01_Compliance = ko.observable();
  26. this.Service02_SkillLevel = ko.observable();
  27. this.Comment = ko.observable();
  28. this.TotalEstimateScore = ko.observable();
  29. this.SafetyScore = ko.observable();
  30. this.AbilityScore = ko.observable();
  31. this.ServiceScore = ko.observable();
  32. if (data)
  33. this.fromJS(data);
  34. };
  35. $.extend(BemsWebApplication.FmsConstructionEstimationViewModel.prototype, {
  36. toJS: function () {
  37. return {
  38. SiteId: this.SiteId(),
  39. ConstructionId: this.ConstructionId(),
  40. EstimateDate: this.EstimateDate(),
  41. EstimateUserId: this.EstimateUserId(),
  42. Safety01_CleanUp: this.Safety01_CleanUp(),
  43. Safety02_PersonalProtection: this.Safety02_PersonalProtection(),
  44. Safety03_FireExtinguisher: this.Safety03_FireExtinguisher(),
  45. Safety04_HighPlaceWork: this.Safety04_HighPlaceWork(),
  46. Safety05_Weld: this.Safety05_Weld(),
  47. Safety06_SurroundingCleanUp: this.Safety06_SurroundingCleanUp(),
  48. Safety07_SurroundingHealthy: this.Safety07_SurroundingHealthy(),
  49. Safety08_Noise: this.Safety08_Noise(),
  50. Safety09_FacilityProtection: this.Safety09_FacilityProtection(),
  51. Safety10_Waste: this.Safety10_Waste(),
  52. Safety11_Execution: this.Safety11_Execution(),
  53. Safety12_Announcement: this.Safety12_Announcement(),
  54. Ability01_Compliance: this.Ability01_Compliance(),
  55. Ability02_Fault: this.Ability02_Fault(),
  56. Ability03_SkillLevel: this.Ability03_SkillLevel(),
  57. Ability04_ProcessManagement: this.Ability04_ProcessManagement(),
  58. Ability05_Collaboration: this.Ability05_Collaboration(),
  59. Service01_Compliance: this.Service01_Compliance(),
  60. Service02_SkillLevel: this.Service02_SkillLevel(),
  61. Comment: this.Comment(),
  62. TotalEstimateScore: this.TotalEstimateScore(),
  63. SafetyScore: this.SafetyScore(),
  64. AbilityScore: this.AbilityScore(),
  65. ServiceScore: this.ServiceScore(),
  66. };
  67. },
  68. fromJS: function (data) {
  69. if (data) {
  70. this.SiteId(data.SiteId);
  71. this.ConstructionId(data.ConstructionId);
  72. this.EstimateDate(data.EstimateDate);
  73. this.EstimateUserId(data.EstimateUserId);
  74. this.Safety01_CleanUp(data.Safety01_CleanUp);
  75. this.Safety02_PersonalProtection(data.Safety02_PersonalProtection);
  76. this.Safety03_FireExtinguisher(data.Safety03_FireExtinguisher);
  77. this.Safety04_HighPlaceWork(data.Safety04_HighPlaceWork);
  78. this.Safety05_Weld(data.Safety05_Weld);
  79. this.Safety06_SurroundingCleanUp(data.Safety06_SurroundingCleanUp);
  80. this.Safety07_SurroundingHealthy(data.Safety07_SurroundingHealthy);
  81. this.Safety08_Noise(data.Safety08_Noise);
  82. this.Safety09_FacilityProtection(data.Safety09_FacilityProtection);
  83. this.Safety10_Waste(data.Safety10_Waste);
  84. this.Safety11_Execution(data.Safety11_Execution);
  85. this.Safety12_Announcement(data.Safety12_Announcement);
  86. this.Ability01_Compliance(data.Ability01_Compliance);
  87. this.Ability02_Fault(data.Ability02_Fault);
  88. this.Ability03_SkillLevel(data.Ability03_SkillLevel);
  89. this.Ability04_ProcessManagement(data.Ability04_ProcessManagement);
  90. this.Ability05_Collaboration(data.Ability05_Collaboration);
  91. this.Service01_Compliance(data.Service01_Compliance);
  92. this.Service02_SkillLevel(data.Service02_SkillLevel);
  93. this.Comment(data.Comment);
  94. this.TotalEstimateScore(data.TotalEstimateScore);
  95. this.SafetyScore(data.SafetyScore);
  96. this.AbilityScore(data.AbilityScore);
  97. this.ServiceScore(data.ServiceScore);
  98. }
  99. }
  100. });
  101. })();