deebc8de88a86c7c61f505b8fab4c2b0d4956c58.svn-base 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. (function () {
  2. BemsWebApplication.FmsDailyStoredReleaseStatusViewViewModel = function (data) {
  3. this.SiteId = ko.observable();
  4. this.BusinessFieldId = ko.observable();
  5. this.MaterialId = ko.observable();
  6. this.MaterialCode = ko.observable();
  7. this.Name = ko.observable();
  8. this.Unit = ko.observable();
  9. this.StoredDate = ko.observable();
  10. this.MaterialStoredId = ko.observable();
  11. this.PurchaseOrderId = ko.observable();
  12. this.UnitCost = ko.observable();
  13. this.StockCount = ko.observable();
  14. this.StoredCount = ko.observable();
  15. this.IsApproval = ko.observable();
  16. this.IsUse = ko.observable();
  17. this.ReleaseDate = ko.observable();
  18. this.ReleaseTypeId = ko.observable();
  19. this.ReleaseCount = ko.observable();
  20. this.ReleaseTotalCost = ko.observable();
  21. this.StockRemainCount = ko.observable();
  22. this.StockRemainAmount = ko.observable();
  23. this.WarehouseId = ko.observable();
  24. this.WarehouseName = ko.observable();
  25. this.LocationInWarehouse = ko.observable();
  26. this.ReasonableStockCount = ko.observable();
  27. if (data)
  28. this.fromJS(data);
  29. };
  30. $.extend(BemsWebApplication.FmsDailyStoredReleaseStatusViewViewModel.prototype, {
  31. toJS: function () {
  32. return {
  33. SiteId: this.SiteId(),
  34. BusinessFieldId: this.BusinessFieldId(),
  35. MaterialId: this.MaterialId(),
  36. MaterialCode: this.MaterialCode(),
  37. Name: this.Name(),
  38. Unit: this.Unit(),
  39. StoredDate: this.StoredDate(),
  40. MaterialStoredId: this.MaterialStoredId(),
  41. PurchaseOrderId: this.PurchaseOrderId(),
  42. UnitCost: this.UnitCost(),
  43. StockCount: this.StockCount(),
  44. StoredCount: this.StoredCount(),
  45. IsApproval: this.IsApproval(),
  46. IsUse: this.IsUse(),
  47. ReleaseDate: this.ReleaseDate(),
  48. ReleaseTypeId: this.ReleaseTypeId(),
  49. ReleaseCount: this.ReleaseCount(),
  50. ReleaseTotalCost: this.ReleaseTotalCost(),
  51. StockRemainCount: this.StockRemainCount(),
  52. StockRemainAmount: this.StockRemainAmount(),
  53. WarehouseId: this.WarehouseId(),
  54. WarehouseName: this.WarehouseName(),
  55. LocationInWarehouse: this.LocationInWarehouse(),
  56. ReasonableStockCount: this.ReasonableStockCount()
  57. };
  58. },
  59. fromJS: function (data) {
  60. if (data) {
  61. this.SiteId(data.SiteId);
  62. this.BusinessFieldId(data.BusinessFieldId);
  63. this.MaterialId(data.MaterialId);
  64. this.MaterialCode(data.MaterialCode);
  65. this.Name(data.Name);
  66. this.Unit(data.Unit);
  67. this.StoredDate(data.StoredDate);
  68. this.MaterialStoredId(data.MaterialStoredId);
  69. this.PurchaseOrderId(data.PurchaseOrderId);
  70. this.UnitCost(data.UnitCost);
  71. this.StockCount(data.StockCount);
  72. this.StoredCount(data.StoredCount);
  73. this.IsApproval(data.IsApproval);
  74. this.IsUse(data.IsUse);
  75. this.ReleaseDate(data.ReleaseDate);
  76. this.ReleaseTypeId(data.ReleaseTypeId);
  77. this.ReleaseCount(data.ReleaseCount);
  78. this.ReleaseTotalCost(data.ReleaseTotalCost);
  79. this.StockRemainCount(data.StockRemainCount);
  80. this.StockRemainAmount(data.StockRemainAmount);
  81. this.WarehouseId(data.WarehouseId);
  82. this.WarehouseName(data.WarehouseName);
  83. this.LocationInWarehouse(data.LocationInWarehouse);
  84. this.ReasonableStockCount(data.ReasonableStockCount);
  85. }
  86. }
  87. });
  88. })();