materiel-box-detail.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <template>
  2. <div>
  3. <el-dialog
  4. id="custom-dialog"
  5. v-model="visible"
  6. :close-on-click-modal="false"
  7. :title="null"
  8. close-icon="null"
  9. >
  10. <div class="top-title">{{ boxObj?.vehicleName }}</div>
  11. <div class="desc-title">{{ boxObj?.vehicleCode }}</div>
  12. <div class="center-content">
  13. <el-scrollbar>
  14. <div
  15. v-for="(item, index) in materielListData"
  16. :key="index"
  17. class="item-container"
  18. >
  19. <div>
  20. <div class="item-header">{{ item?.materialName }}</div>
  21. <div class="item-describe">{{ item?.spec }}</div>
  22. </div>
  23. <div>
  24. <span class="item-count">{{ item?.num }}</span>
  25. <span class="item-unit">{{ item?.unit }}个</span>
  26. </div>
  27. </div>
  28. </el-scrollbar>
  29. </div>
  30. <div class="bottom-btns">
  31. <el-button class="cancelBtn" @click="visible = false">取消</el-button>
  32. <el-button class="sureBtn" type="primary" @click="sure"
  33. >确认取出
  34. </el-button>
  35. </div>
  36. </el-dialog>
  37. </div>
  38. </template>
  39. <script lang="ts" setup>
  40. const visible = ref(false);
  41. let callBack: Function | null = null;
  42. const materielListData = ref<any[]>([]);
  43. const boxObj = ref<any>({});
  44. const showDialog = (
  45. box: object,
  46. listData: any[],
  47. callback: Function | null
  48. ) => {
  49. boxObj.value = box;
  50. visible.value = true;
  51. materielListData.value = listData;
  52. callBack = callback;
  53. };
  54. const sure = () => {
  55. callBack && callBack();
  56. visible.value = false;
  57. };
  58. defineExpose({
  59. showDialog,
  60. });
  61. </script>
  62. <style lang="scss" scoped>
  63. :deep(.el-dialog) {
  64. background: #f1f3f5;
  65. box-shadow: 0px 0px 80px 10px rgba(0, 0, 0, 0.25);
  66. border-radius: 16px;
  67. }
  68. #custom-dialog {
  69. background: #f1f3f5;
  70. box-shadow: 0px 0px 80px 10px rgba(0, 0, 0, 0.25);
  71. border-radius: 16px 16px 16px 16px;
  72. width: 924px;
  73. max-height: 80vh;
  74. .top-title {
  75. width: 100%;
  76. font-weight: 500;
  77. font-size: 38px;
  78. color: rgba(0, 0, 0, 0.9);
  79. text-align: center;
  80. }
  81. .desc-title {
  82. font-weight: 400;
  83. font-size: 20px;
  84. color: rgba(0, 0, 0, 0.6);
  85. text-align: center;
  86. }
  87. .center-content {
  88. margin-top: 24px;
  89. width: 100%;
  90. height: 500px;
  91. font-size: 24px;
  92. overflow-y: auto;
  93. color: rgba(0, 0, 0, 0.9);
  94. border-radius: 16px 16px 16px 16px;
  95. border: 1px solid rgba(0, 0, 0, 0.2);
  96. }
  97. .bottom-btns {
  98. display: flex;
  99. justify-content: center;
  100. margin-top: 20px;
  101. margin-bottom: 20px;
  102. .button {
  103. margin-right: 20px;
  104. }
  105. .cancelBtn {
  106. width: 292px;
  107. height: 80px;
  108. background: rgba(0, 0, 0, 0.06);
  109. border-radius: 76px 76px 76px 76px;
  110. }
  111. .sureBtn {
  112. width: 292px;
  113. height: 80px;
  114. background: #0a59f7;
  115. border-radius: 76px 76px 76px 76px;
  116. }
  117. }
  118. }
  119. .item-container {
  120. width: 100%;
  121. display: flex;
  122. justify-content: space-between;
  123. align-items: center;
  124. padding-left: 30px;
  125. padding-right: 20px;
  126. height: 80px;
  127. }
  128. .item-header {
  129. font-weight: 500;
  130. font-size: 24px;
  131. color: rgba(0, 0, 0, 0.9);
  132. text-align: left;
  133. }
  134. .item-describe {
  135. font-weight: 400;
  136. font-size: 20px;
  137. color: rgba(0, 0, 0, 0.6);
  138. text-align: left;
  139. }
  140. .item-count {
  141. font-weight: bold;
  142. font-size: 38px;
  143. color: rgba(0, 0, 0, 0.9);
  144. text-align: right;
  145. }
  146. .item-unit {
  147. font-weight: 500;
  148. font-size: 20px;
  149. color: rgba(0, 0, 0, 0.6);
  150. text-align: right;
  151. }
  152. </style>