desperse.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <template>
  2. <div class="container-desperse">
  3. <div class="left">
  4. <div
  5. class="box-item"
  6. v-for="(box, index) in leftTrees"
  7. :key="index"
  8. :class="{ hoverEffect: index === leftTreeIndex }"
  9. @click="changeRightEl(box, index)"
  10. >
  11. {{ box.dictLabel }}
  12. </div>
  13. </div>
  14. <div class="right">
  15. <el-scrollbar>
  16. <div class="grid-container">
  17. <div
  18. v-for="(box, index) in merterielBoxes"
  19. :key="index"
  20. class="suit-box"
  21. @click="testClick(index)"
  22. >
  23. <div>
  24. <div class="suit-title">{{ box?.materialName }}</div>
  25. <div class="suit-desc">{{ box?.spec }}</div>
  26. </div>
  27. <div>
  28. <div>
  29. <span class="suit-count">{{ box?.totalNum }}</span>
  30. <span class="suit-desc">{{ box?.unit }}</span>
  31. </div>
  32. <div class="suit-desc">当前库存</div>
  33. </div>
  34. </div>
  35. </div>
  36. </el-scrollbar>
  37. </div>
  38. </div>
  39. <!-- <CallHistory ref="callHistoryRef" />
  40. <MarterielBoxDetail ref="materielBoxDetailRef" />
  41. <ChangeCount ref="changeCountRef" description="双面胶黑色" title="叫料数量" />
  42. <ConfirmMessage ref="confirmMessageRef" /> -->
  43. </template>
  44. <script lang="ts" setup>
  45. // import CallHistory from "@/views/pro-operation/call-materiel/components/call-history.vue";
  46. // import MarterielBoxDetail from "@/views/pro-operation/call-materiel/components/materiel-box-detail.vue";
  47. // import ChangeCount from "@/components/CommonDialogs/ChangeCount.vue";
  48. // import ConfirmMessage from "@/components/CommonDialogs/ConfirmMessage.vue";
  49. import { stockMaterialList, accessoriesList } from "@/api/process/callMateriel";
  50. import { useProcessStore } from "@/store/modules/processView";
  51. import { useDictionaryStore } from "@/store/modules/dictionary";
  52. const processStore = useProcessStore();
  53. const dictStore = useDictionaryStore();
  54. const leftTrees = ref<any[]>([]);
  55. const leftTreeIndex = ref(0);
  56. const merterielBoxes = ref<any>([]);
  57. const changeRightEl = (row, index) => {
  58. leftTreeIndex.value = index;
  59. accessoriesDataList(index);
  60. };
  61. const testClick = () => {
  62. console.log("here---in");
  63. };
  64. const accessoriesDataList = (index) => {
  65. const firstObj = leftTrees?.value[index];
  66. //dictLabel: "炼胶",dictSort: 1,dictValue: "1"
  67. const queryAccessoriesParam = {
  68. accessoriesType: firstObj.dictValue,
  69. pageNo: 0,
  70. pageSize: 1000,
  71. };
  72. // 获取数据
  73. accessoriesList(queryAccessoriesParam).then((res) => {
  74. // console.log("onMounted", res.data);
  75. merterielBoxes.value = res.data;
  76. });
  77. };
  78. onMounted(() => {
  79. console.log("dictS.dicts", dictStore.dicts.accessories_type);
  80. leftTrees.value = dictStore?.dicts?.accessories_type;
  81. if (leftTrees?.value) {
  82. accessoriesDataList(0);
  83. }
  84. });
  85. </script>
  86. <style lang="scss" scoped>
  87. .container-desperse {
  88. display: flex;
  89. .left {
  90. display: flex;
  91. justify-content: center;
  92. align-items: center;
  93. flex-direction: column;
  94. width: 300px;
  95. .box-item {
  96. border: 1px solid red;
  97. width: 100%;
  98. text-align: center;
  99. line-height: 80px;
  100. height: 80px;
  101. }
  102. .hoverEffect {
  103. color: blue;
  104. // text-decoration: underline;
  105. // background-color: red;
  106. }
  107. }
  108. .right {
  109. flex: 1;
  110. // margin-left: 12%;
  111. }
  112. }
  113. .grid-container {
  114. width: 100%;
  115. display: grid;
  116. /*行间距*/
  117. grid-row-gap: 24px;
  118. /*列间距*/
  119. grid-column-gap: 24px;
  120. grid-template-columns: 1fr 1fr 1fr;
  121. overflow-y: auto;
  122. .suit-box {
  123. height: 210px;
  124. background-color: white;
  125. border-radius: 16px 16px 16px 16px;
  126. padding: 24px 30px;
  127. display: flex;
  128. flex-direction: column;
  129. align-items: start;
  130. justify-content: space-between;
  131. position: relative;
  132. .suit-title {
  133. font-weight: 500;
  134. font-size: 20px;
  135. color: rgba(0, 0, 0, 0.9);
  136. text-align: left;
  137. }
  138. .suit-count {
  139. font-weight: bold;
  140. font-size: 38px;
  141. color: rgba(0, 0, 0, 0.9);
  142. text-align: left;
  143. }
  144. .suit-desc {
  145. font-size: 20px;
  146. color: rgba(0, 0, 0, 0.6);
  147. text-align: left;
  148. }
  149. }
  150. }
  151. </style>