boxList.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <template>
  2. <gui-page :custom-header="true" :header-class="['gui-theme-background-color']">
  3. <template #gHeader>
  4. <view style="height:44px;" class="gui-flex gui-nowrap gui-rows gui-align-items-center">
  5. <!-- 使用组件实现返回按钮及返回首页按钮 -->
  6. <text
  7. style="font-size:44rpx;"
  8. class="gui-header-leader-btns gui-color-white font-icons"
  9. @tap="goHome"
  10. >&#xe6c5;</text>
  11. <!-- 导航文本此处也可以是其他自定义内容 -->
  12. <text
  13. class="gui-h4 gui-blod gui-flex1 gui-text-center gui-ellipsis gui-color-white gui-primary-text"
  14. >功能列表</text>
  15. <!-- 此处加一个右侧展位元素与左侧同宽,实现标题居中 -->
  16. <!-- 实际宽度请根据自己情况设置 -->
  17. <view style="width:40px;" />
  18. <!-- 如果右侧有其他内容可以利用条件编译和定位来实现-->
  19. </view>
  20. </template>
  21. <template #gBody>
  22. <view class="card-list-flexbox">
  23. <!-- <view v-if="cardList.length > 0">
  24. <view class="card-list-flexbox" v-for="(item, index) in cardList">
  25. <view class="card-list-item">
  26. <text class="text-1 gui-color-gray">{{ item.productCode }}</text>
  27. </view>
  28. <view class="card-list-item">
  29. <text class="text-1 gui-color-gray">产品名称</text>
  30. <text class="text-2 gui-color-gray">{{ item.productName }}</text>
  31. </view>
  32. <view class="card-list-item">
  33. <text class="text-1 gui-color-gray">箱号</text>
  34. <text class="text-2 gui-color-gray">{{ item.caseNo }}</text>
  35. </view>
  36. <view class="card-list-item">
  37. <text class="text-1 gui-color-gray">区域</text>
  38. <text class="text-2 gui-color-gray">{{ item.areaCode }}</text>
  39. </view>
  40. <view class="card-list-item">
  41. <text class="text-1 gui-color-gray">货位</text>
  42. <text class="text-2 gui-color-gray">{{ item.locationCode }}</text>
  43. </view>
  44. <view class="card-list-item">
  45. <text class="text-1 gui-color-gray">装箱数量</text>
  46. <text class="text-2 gui-color-gray">{{ item.inQty }}</text>
  47. </view>
  48. <view class="card-list-item">
  49. <text class="text-1 gui-color-gray">检验结果</text>
  50. <text class="text-2 gui-color-gray">{{ item.testResult }}</text>
  51. </view>
  52. <view class="card-list-item">
  53. <text class="text-1 gui-color-gray">库位剩余容量</text>
  54. <text class="text-2 gui-color-gray">{{ item.remainderStorageQty }}</text>
  55. </view>
  56. </view>
  57. </view>
  58. <view v-else>
  59. <view class="bg-image">
  60. <image src="@/static/empty.png" mode="heightFix"></image>
  61. <text>这里什么都没有...</text>
  62. </view>
  63. </view> -->
  64. <view class="card">
  65. <div class="card-panel" style="background-color: #55aa7f;" @click="handleNavigateTo('装箱')">
  66. <text class="font-icons">&#xe64a;</text>
  67. <text>产品入箱</text>
  68. </div>
  69. </view>
  70. <view class="card">
  71. <div class="card-panel" style="background-color: #00a0e9;" @click="handleNavigateTo('拆箱')">
  72. <text class="font-icons">&#xecc6;</text>
  73. <text>拆箱作业</text>
  74. </div>
  75. </view>
  76. </view>
  77. </template>
  78. </gui-page>
  79. </template>
  80. <script>
  81. import {
  82. ref,
  83. defineComponent
  84. } from 'vue'
  85. import {
  86. onReachBottom
  87. } from '@dcloudio/uni-app'
  88. export default defineComponent({
  89. setup() {
  90. const cardList = ref([])
  91. const queryParams = ref({
  92. pageSize: 10,
  93. pageNo: 1
  94. })
  95. uni.$reqGet('getWmsBoxList', queryParams.value)
  96. .then(({
  97. data,
  98. msg
  99. }) => {
  100. cardList.value = data?.list ?? []
  101. })
  102. const goHome = function() {
  103. uni.$goHome()
  104. }
  105. const handleNavigateTo = function(name) {
  106. switch (name) {
  107. case '装箱':
  108. uni.navigateTo({
  109. url: '/pages/workbranch/warehouse/box/boxMerge'
  110. })
  111. break
  112. case '拆箱':
  113. uni.navigateTo({
  114. url: '/pages/workbranch/warehouse/box/boxSplit'
  115. })
  116. break
  117. }
  118. }
  119. // uniapp移动端触底事件
  120. onReachBottom(() => {
  121. queryParams.value.pageNo += 1
  122. // 生产发料主列表
  123. uni.$reqGet('getWmsBoxList', queryParams.value)
  124. .then(({
  125. data
  126. }) => {
  127. Array.prototype.push.call(cardList.value, ...data?.list ?? [])
  128. })
  129. })
  130. return {
  131. goHome,
  132. cardList,
  133. handleNavigateTo
  134. }
  135. }
  136. })
  137. </script>
  138. <style lang="scss" scoped>
  139. .gui-header-leader-btns {
  140. color: black;
  141. font-size: 24px !important;
  142. margin-left: 24rpx;
  143. }
  144. .card-list-flexbox {
  145. margin-top: 100px;
  146. display: grid;
  147. grid-template-columns: 1fr 1fr 1fr;
  148. .card {
  149. display: flex;
  150. justify-content: center;
  151. align-items: center;
  152. .card-panel {
  153. width: 85px;
  154. height: 85px;
  155. display: flex;
  156. flex-direction: column;
  157. justify-content: center;
  158. align-items: center;
  159. border-radius: 8px;
  160. box-shadow: 1px 1px 2px 3px #e9e9e9;
  161. text:nth-of-type(2) {
  162. margin-top: 4px;
  163. font-size: 12px;
  164. font-weight: bold;
  165. color: white;
  166. }
  167. }
  168. }
  169. }
  170. .font-icons {
  171. font-size: 36px;
  172. color: white;
  173. }
  174. </style>