index.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  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. let [isEnd] = [false]
  63. export default {
  64. components: {
  65. },
  66. data() {
  67. return {
  68. page: 1,
  69. size: 5,
  70. dataList: [],
  71. }
  72. },
  73. onShow() {
  74. this.getList()
  75. },
  76. methods: {
  77. async getList() {
  78. let params = {
  79. pageNum: this.page,
  80. size: this.size,
  81. status: [4, 5, 6, 7],
  82. ...this.searchFrom
  83. }
  84. isEnd = false
  85. const res = await workorderPage(params)
  86. console.log(res)
  87. if (params.page === 1) {
  88. this.dataList = []
  89. }
  90. this.dataList.push(...res.list)
  91. isEnd = this.dataList.length >= res.count
  92. },
  93. scrolltolower() {
  94. if (isEnd) return
  95. this.page++
  96. this.getList()
  97. },
  98. handleDetail(item) {
  99. let url = '/pages/pda/workOrder/extrusionMolding/index'
  100. url += `?id=${item.id}&title=${item.taskName}`
  101. console.log(url)
  102. uni.navigateTo({
  103. url
  104. })
  105. },
  106. tableH(type) {
  107. return tableHeader(type)
  108. },
  109. save() {},
  110. }
  111. }
  112. </script>
  113. <style lang="scss" scoped>
  114. .content-box {
  115. height: 100vh;
  116. overflow: hidden;
  117. display: flex;
  118. flex-direction: column;
  119. }
  120. .list_box {
  121. flex: 1;
  122. overflow: hidden;
  123. padding: 16rpx 0;
  124. .u-list {
  125. height: 100% !important;
  126. }
  127. }
  128. .bottom-wrapper {
  129. .btn_box {
  130. width: 750rpx;
  131. height: 88rpx;
  132. line-height: 88rpx;
  133. background: $theme-color;
  134. text-align: center;
  135. font-size: 36rpx;
  136. font-style: normal;
  137. font-weight: 400;
  138. color: #fff;
  139. }
  140. }
  141. .card_box {
  142. margin-top: 10rpx;
  143. .title_box {
  144. width: 702rpx;
  145. .round {
  146. width: 32rpx;
  147. height: 32rpx;
  148. line-height: 32rpx;
  149. border-radius: 50%;
  150. background: $theme-color;
  151. color: #fff;
  152. text-align: center;
  153. font-size: 20rpx;
  154. }
  155. .code {
  156. margin-left: 16rpx;
  157. font-family: PingFang SC;
  158. font-size: 28rpx;
  159. font-style: normal;
  160. font-weight: 400;
  161. color: $theme-color;
  162. }
  163. }
  164. .word_order{
  165. height: 64rpx;
  166. width: 750rpx;
  167. background: $theme-color;
  168. font-size: 28rpx;
  169. color: #fff;
  170. line-height: 64rpx;
  171. padding-left: 40rpx;
  172. }
  173. .content_table {
  174. margin-top: 10rpx;
  175. width: 702rpx;
  176. border: 2rpx solid $border-color;
  177. .item {
  178. display: flex;
  179. border-bottom: 2rpx solid $border-color;
  180. .lable {
  181. width: 132rpx;
  182. text-align: center;
  183. background-color: #F7F9FA;
  184. font-size: 26rpx;
  185. border-right: 2rpx solid $border-color;
  186. flex-shrink: 0;
  187. }
  188. .ww80 {
  189. width: 80rpx;
  190. }
  191. .content {
  192. width: 518rpx;
  193. min-height: 64rpx;
  194. font-size: 28rpx;
  195. line-height: 28rpx;
  196. font-style: normal;
  197. font-weight: 400;
  198. padding: 18rpx 8rpx;
  199. box-sizing: border-box;
  200. word-wrap: break-word;
  201. flex-grow: 1 !important;
  202. }
  203. .content_num {
  204. display: flex;
  205. align-items: center;
  206. padding: 0 4rpx;
  207. /deep/ .uni-input-input {
  208. width: 480rpx;
  209. border: 2rpx solid #F0F8F2;
  210. background: #F0F8F2;
  211. color: $theme-color;
  212. }
  213. .unit {
  214. padding: 0 4rpx;
  215. font-size: 24rpx;
  216. color: #404446;
  217. }
  218. }
  219. .pd4 {
  220. padding: 4rpx 8rpx;
  221. }
  222. &:last-child {
  223. border-bottom: none;
  224. }
  225. }
  226. .ww55 {
  227. width: 55%;
  228. }
  229. .ww45 {
  230. width: 45%;
  231. }
  232. }
  233. }
  234. </style>