deliveryNoteDetail.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  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="goBack"
  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="list-content">
  23. <view class="table-title">
  24. <span>明细清单</span>
  25. </view>
  26. <view v-if="cardList?.length > 0">
  27. <view
  28. v-for="item in cardList"
  29. :key="item.id"
  30. class="card-list-flexbox"
  31. @click="handleShowResetMaterialNumDialog(item)"
  32. >
  33. <view class="card-list-item">
  34. <text class="text-1 gui-color-gray">{{ item.saleOutNo }}</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.saleOrderNo }}</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.materialNo }}</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.materialName }}</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.boxNo }}</text>
  51. </view>
  52. <view class="card-list-item">
  53. <text class="text-1 gui-color-gray">数量</text>
  54. <text class="text-2" style="color: orange;font-weight: bold;">{{ item.boxQty }}</text>
  55. </view>
  56. <view class="card-list-item">
  57. <text class="text-1 gui-color-gray">单位</text>
  58. <text class="text-2 gui-color-gray">{{ item.unitCode }}</text>
  59. </view>
  60. </view>
  61. </view>
  62. <view v-else>
  63. <view class="bg-image">
  64. <image src="@/static/empty.png" mode="heightFix" />
  65. <text>这里什么都没有...</text>
  66. </view>
  67. </view>
  68. </view>
  69. </template>
  70. </gui-page>
  71. </template>
  72. <script>
  73. import {
  74. onReachBottom
  75. } from '@dcloudio/uni-app'
  76. import {
  77. ref,
  78. defineComponent,
  79. onMounted,
  80. onBeforeMount
  81. } from 'vue'
  82. export default defineComponent({
  83. setup(options) {
  84. const queryParams = ref({
  85. pageSize: 10,
  86. pageNo: 1,
  87. saleOrderNo: ''
  88. })
  89. const cardList = ref([])
  90. onMounted(() => {
  91. search()
  92. })
  93. onBeforeMount(() => {
  94. queryParams.value.saleOrderNo = options?.saleOrderNo
  95. })
  96. const search = function() {
  97. uni.$reqGet('getSaleOutOrderDetailPage', {
  98. ...queryParams.value
  99. })
  100. .then(({
  101. data
  102. }) => {
  103. cardList.value = data?.list
  104. })
  105. }
  106. const goBack = function() {
  107. uni.$goBack('/pages/workbranch/warehouse/deliveryNote/deliveryNoteList')
  108. }
  109. // uniapp移动端触底事件
  110. onReachBottom(() => {
  111. queryParams.value.pageNo += 1
  112. uni.$reqGet('getSaleOutOrderDetailPage', {
  113. ...queryParams.value
  114. })
  115. .then(({
  116. data
  117. }) => {
  118. Array.prototype.push.call(cardList.value, ...data?.list ?? [])
  119. })
  120. })
  121. return {
  122. goBack,
  123. cardList,
  124. search,
  125. queryParams
  126. }
  127. }
  128. })
  129. </script>
  130. <style lang="scss" scoped>
  131. .gui-header-leader-btns {
  132. color: black;
  133. font-size: 24px !important;
  134. margin-left: 24rpx;
  135. }
  136. .list-content {
  137. margin-top: 80px;
  138. background-color: #edeeee;
  139. }
  140. .card-list-flexbox {
  141. display: flex;
  142. flex-direction: row;
  143. align-items: center;
  144. flex-wrap: wrap;
  145. margin: 3px 2px;
  146. .card-list-item {
  147. width: 750rpx;
  148. min-height: 40px;
  149. margin: 2rpx 0;
  150. display: flex;
  151. flex-direction: row;
  152. align-items: center;
  153. justify-content: space-between;
  154. background-color: #fff;
  155. uni-text {
  156. font-size: 14px;
  157. min-height: 40px;
  158. text-align: left;
  159. padding: 0 12px;
  160. display: flex;
  161. flex-direction: row;
  162. align-items: center;
  163. }
  164. .text-1 {
  165. flex: 1;
  166. min-height: 40px;
  167. justify-content: flex-start;
  168. }
  169. .text-2 {
  170. flex: 3;
  171. min-height: 40px;
  172. justify-content: flex-end;
  173. margin-right: 4px;
  174. padding: 2px 6px;
  175. }
  176. }
  177. .card-list-item:nth-of-type(1) {
  178. .text-1 {
  179. flex: 9;
  180. font-weight: bold;
  181. color: black !important;
  182. }
  183. .text-2 {
  184. flex: 4;
  185. display: flex;
  186. flex-direction: row;
  187. justify-content: flex-end;
  188. align-items: center;
  189. color: limegreen !important;
  190. }
  191. }
  192. }
  193. .font-icons {
  194. width: 40px;
  195. font-size: 20px;
  196. }
  197. </style>