warehouse.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const common_assets = require("../../common/assets.js");
  4. if (!Math) {
  5. warehouseInfo();
  6. }
  7. const warehouseInfo = () => "./components/warehouseInfo/warehouseInfo.js";
  8. const _sfc_main = {
  9. __name: "warehouse",
  10. setup(__props) {
  11. const navList = [
  12. {
  13. state: 0,
  14. text: "仓房基本信息",
  15. loadingType: "more",
  16. orderList: []
  17. },
  18. {
  19. state: 1,
  20. text: "库区基本信息",
  21. loadingType: "more",
  22. orderList: []
  23. }
  24. ];
  25. const tabCurrentIndex = common_vendor.ref(0);
  26. const tabClick = (index) => {
  27. tabCurrentIndex.value = index;
  28. };
  29. const warehouses = common_vendor.ref([
  30. {
  31. name: "1-1",
  32. address: "XXXXXXXXXX",
  33. capacity: "1500吨",
  34. rooms: "10个",
  35. emptyRooms: "5个",
  36. selected: false
  37. },
  38. {
  39. name: "XXXXX",
  40. address: "XXXXXXXXXX",
  41. capacity: "1500吨",
  42. rooms: "10个",
  43. emptyRooms: "5个",
  44. selected: false
  45. },
  46. {
  47. name: "XXXXX",
  48. address: "XXXXXXXXXX",
  49. capacity: "1500吨",
  50. rooms: "10个",
  51. emptyRooms: "5个",
  52. selected: false
  53. }
  54. ]);
  55. const toggleSelection = (index) => {
  56. warehouses.value[index].selected = !warehouses.value[index].selected;
  57. };
  58. const selectAll = () => {
  59. warehouses.value.forEach((warehouse) => {
  60. warehouse.selected = true;
  61. });
  62. };
  63. const confirmSelection = () => {
  64. };
  65. return (_ctx, _cache) => {
  66. return {
  67. a: common_vendor.f(navList, (item, index, i0) => {
  68. return {
  69. a: common_vendor.t(item.text),
  70. b: index,
  71. c: tabCurrentIndex.value === index ? 1 : "",
  72. d: common_vendor.o(($event) => tabClick(index), index)
  73. };
  74. }),
  75. b: common_vendor.f(warehouses.value, (warehouse, index, i0) => {
  76. return {
  77. a: common_vendor.t(warehouse.name),
  78. b: warehouse.selected,
  79. c: common_vendor.o(($event) => toggleSelection(index), index),
  80. d: common_vendor.t(warehouse.emptyRooms),
  81. e: common_vendor.t(warehouse.selected ? "1个" : "0个"),
  82. f: common_vendor.t(warehouse.capacity),
  83. g: common_vendor.t(warehouse.rooms),
  84. h: common_vendor.t(warehouse.emptyRooms),
  85. i: common_vendor.t(warehouse.selected ? "1个" : "0个"),
  86. j: index
  87. };
  88. }),
  89. c: common_assets._imports_0$2,
  90. d: common_vendor.o(selectAll),
  91. e: common_vendor.o(confirmSelection),
  92. f: tabCurrentIndex.value,
  93. g: common_vendor.o((...args) => _ctx.changeTab && _ctx.changeTab(...args))
  94. };
  95. };
  96. }
  97. };
  98. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-41554ef3"]]);
  99. wx.createPage(MiniProgramPage);
  100. //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/warehouse/warehouse.js.map