index.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. <template>
  2. <view class="content-box">
  3. <uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="领料单" background-color="#F7F9FA" color="#000"
  4. @clickLeft="back"></uni-nav-bar>
  5. <view class="list_box">
  6. <u-list @scrolltolower="scrolltolower" key="dataList" :preLoadScreen="page * 10">
  7. <view class="card_box cx-sc">
  8. <view class="title_box rx-sc">
  9. <view class="round">1</view>
  10. <view class="code">领料单号:62464462</view>
  11. </view>
  12. <view class="word_order ">工单编号:62464462</view>
  13. <view class="content_table" v-for="(item, idx) in dataList">
  14. <view class="item">
  15. <view class="lable rx-cc">编码</view>
  16. <view class="content">
  17. {{item.assetCode}}
  18. </view>
  19. </view>
  20. <view class="item">
  21. <view class="lable rx-cc">名称</view>
  22. <view class="content">{{item.assetName}}</view>
  23. </view>
  24. <view class="item" v-for="(itm, index) in tableH(4)" :key="index">
  25. <view class="lable rx-cc">{{ itm.label }}</view>
  26. <view class="content">{{ item[itm.prop] }}</view>
  27. </view>
  28. <view class="item">
  29. <view class="lable rx-cc">数量</view>
  30. <view class="content content_num">
  31. <input class="uni-input" v-model="item.demandQuantity"
  32. @blur='item.demandQuantity > item.number ? item.demandQuantity = item.number : item.needNum'
  33. type="digit"></input>
  34. <view class="unit">/{{item.unit}}</view>
  35. </view>
  36. </view>
  37. <view class="item">
  38. <view class="lable rx-cc">领料仓库</view>
  39. <view class="content ">
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. <u-list-item v-if="dataList.length === 0">
  45. <u-empty iconSize='150' style='margin-top: 20vh;' textSize='32' text='暂无工单'>
  46. </u-empty>
  47. </u-list-item>
  48. </u-list>
  49. </view>
  50. <view class="bottom-wrapper">
  51. <view class="btn_box" @click="save">一键报工</view>
  52. </view>
  53. </view>
  54. </template>
  55. <script>
  56. import {
  57. tableHeader
  58. } from '../../common.js'
  59. import {
  60. workorderPage
  61. } from '@/api/pda/workOrder.js'
  62. import {
  63. pickDetails
  64. } from '@/api/pda/picking.js'
  65. let [isEnd] = [false]
  66. export default {
  67. components: {
  68. },
  69. data() {
  70. return {
  71. page: 1,
  72. size: 5,
  73. ids: [],
  74. dataList: [],
  75. }
  76. },
  77. onLoad(option) {
  78. this.ids = [option.id]
  79. this.getList()
  80. },
  81. methods: {
  82. async getList() {
  83. isEnd = false
  84. const res = await pickDetails(this.ids)
  85. console.log(res)
  86. if (params.page === 1) {
  87. this.dataList = []
  88. }
  89. this.dataList.push(...res.list)
  90. isEnd = this.dataList.length >= res.count
  91. },
  92. scrolltolower() {
  93. if (isEnd) return
  94. this.page++
  95. this.getList()
  96. },
  97. tableH(type) {
  98. return tableHeader(type)
  99. },
  100. save() {},
  101. }
  102. }
  103. </script>
  104. <style lang="scss" scoped>
  105. .content-box {
  106. height: 100vh;
  107. overflow: hidden;
  108. display: flex;
  109. flex-direction: column;
  110. }
  111. .list_box {
  112. flex: 1;
  113. overflow: hidden;
  114. padding: 16rpx 0;
  115. .u-list {
  116. height: 100% !important;
  117. }
  118. }
  119. .bottom-wrapper {
  120. .btn_box {
  121. width: 750rpx;
  122. height: 88rpx;
  123. line-height: 88rpx;
  124. background: $theme-color;
  125. text-align: center;
  126. font-size: 36rpx;
  127. font-style: normal;
  128. font-weight: 400;
  129. color: #fff;
  130. }
  131. }
  132. .card_box {
  133. margin-top: 10rpx;
  134. .title_box {
  135. width: 702rpx;
  136. .round {
  137. width: 32rpx;
  138. height: 32rpx;
  139. line-height: 32rpx;
  140. border-radius: 50%;
  141. background: $theme-color;
  142. color: #fff;
  143. text-align: center;
  144. font-size: 20rpx;
  145. }
  146. .code {
  147. margin-left: 16rpx;
  148. font-family: PingFang SC;
  149. font-size: 28rpx;
  150. font-style: normal;
  151. font-weight: 400;
  152. color: $theme-color;
  153. }
  154. }
  155. .word_order {
  156. height: 64rpx;
  157. width: 750rpx;
  158. background: $theme-color;
  159. font-size: 28rpx;
  160. color: #fff;
  161. line-height: 64rpx;
  162. padding-left: 40rpx;
  163. }
  164. .content_table {
  165. margin-top: 10rpx;
  166. width: 702rpx;
  167. border: 2rpx solid $border-color;
  168. .item {
  169. display: flex;
  170. border-bottom: 2rpx solid $border-color;
  171. .lable {
  172. width: 132rpx;
  173. text-align: center;
  174. background-color: #F7F9FA;
  175. font-size: 26rpx;
  176. border-right: 2rpx solid $border-color;
  177. flex-shrink: 0;
  178. }
  179. .ww80 {
  180. width: 80rpx;
  181. }
  182. .content {
  183. width: 518rpx;
  184. min-height: 64rpx;
  185. font-size: 28rpx;
  186. line-height: 28rpx;
  187. font-style: normal;
  188. font-weight: 400;
  189. padding: 18rpx 8rpx;
  190. box-sizing: border-box;
  191. word-wrap: break-word;
  192. flex-grow: 1 !important;
  193. }
  194. .content_num {
  195. display: flex;
  196. align-items: center;
  197. padding: 0 4rpx;
  198. /deep/ .uni-input-input {
  199. width: 480rpx;
  200. border: 2rpx solid #F0F8F2;
  201. background: #F0F8F2;
  202. color: $theme-color;
  203. }
  204. .unit {
  205. padding: 0 4rpx;
  206. font-size: 24rpx;
  207. color: #404446;
  208. }
  209. }
  210. .pd4 {
  211. padding: 4rpx 8rpx;
  212. }
  213. &:last-child {
  214. border-bottom: none;
  215. }
  216. }
  217. .ww55 {
  218. width: 55%;
  219. }
  220. .ww45 {
  221. width: 45%;
  222. }
  223. }
  224. }
  225. </style>