index.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <template>
  2. <view class="uni-column" style="height: 100%; background-color: #f5f5f5;">
  3. <scroll-view class="scroll-container" scroll-y>
  4. <view v-for="(item, index) in listData" :key="index" class="list-item">
  5. <view class="title-container uni-row" style="justify-content: flex-start;">
  6. <view class="title uni-row">
  7. <text class="label">批次号:</text>
  8. <text class="label code">{{ item['batchNumber'] }}</text>
  9. </view>
  10. <view class=" uni-row" style="margin-left: 16rpx;">
  11. <view v-if="item['status'] == 0" class="tag"><text class="label">进行中</text></view>
  12. <view v-else-if="item['status'] == 1" class="tag turnover "><text class="label">周转中</text>
  13. </view>
  14. <view v-else type="default" class="tag finished"><text class="label">已完成</text></view>
  15. </view>
  16. </view>
  17. <view class="item-info uni-row">
  18. <text class="label">箱号</text>
  19. <text class="label right">{{ item['caseNumber'] }}</text>
  20. </view>
  21. <view class="item-info uni-row">
  22. <text class="label">总工时</text>
  23. <text class="label right">{{ item['totalWorkingHours']}}h</text>
  24. </view>
  25. <view class="item-info uni-row">
  26. <text class="label">合格数/投入数</text>
  27. <text class="label right">{{ item['qualifiedQuantity'] }}/{{item['invest']}}</text>
  28. </view>
  29. <view class="item-info uni-row">
  30. <text class="label">上道工序</text>
  31. <text class="label right">{{ item['previousProcess'] }}</text>
  32. </view>
  33. <view class="item-info uni-row">
  34. <text class="label">当前工序</text>
  35. <text class="label right">{{ item['currentProcess']}}</text>
  36. </view>
  37. <view class="item-info uni-row">
  38. <text class="label">下道工序</text>
  39. <text class="label right">{{ item['NextProcess'] }}</text>
  40. </view>
  41. <view class="status-btn uni-row">
  42. <view v-if="item['status'] == 0" class=" uni-row">
  43. <button class="turnover-tag" size="mini" @click="handleShowTurnoverApplication(null)">周转申请</button>
  44. <button class="reporting-tag" size="mini">去报工</button>
  45. </view>
  46. <view v-else-if="item['status'] == 1" class=" uni-row">
  47. <button class="turnover-tag" size="mini">取消周转</button>
  48. </view>
  49. </view>
  50. </view>
  51. </scroll-view>
  52. <view class="bottom uni-row">
  53. <button class="start-batch-btn" @click="handleShowLotDialog(null)">开始新批次</button>
  54. </view>
  55. <dialog-lot ref="lotDialog"/>
  56. <dialog-turnoverApplication ref="turnoverApplicationDialog" />
  57. </view>
  58. </template>
  59. <script setup>
  60. import { ref } from 'vue'
  61. import { onLoad, onReady } from '@dcloudio/uni-app'
  62. onLoad(() => {
  63. })
  64. const turnoverApplicationDialog = ref(null)
  65. const lotDialog = ref(null)
  66. const listData = ref([])
  67. const handleShowTurnoverApplication = (data) => {
  68. let _data = data ?? {}
  69. // 调用子组件中的方法
  70. turnoverApplicationDialog.value.open(_data)
  71. }
  72. const handleShowLotDialog = (data) => {
  73. let _data = data ?? {}
  74. // 调用子组件中的方法
  75. lotDialog.value.open(_data)
  76. }
  77. const init = () = > {
  78. }
  79. </script>
  80. <style lang="scss">
  81. .scroll-container {
  82. width: 92%;
  83. margin: 24rpx auto 0 auto;
  84. height: 90%;
  85. }
  86. .list-item {
  87. background-color: #fff;
  88. position: relative;
  89. padding: 16rpx;
  90. padding-bottom: 24rpx;
  91. margin-bottom: 24rpx;
  92. .title-container {
  93. margin-top: 8rpx;
  94. margin-bottom: 16rpx;
  95. .title {
  96. height: 48rpx;
  97. align-items: center;
  98. .label {
  99. font-size: 32rpx;
  100. font-weight: bold;
  101. &.code {
  102. margin-left: 8rpx;
  103. }
  104. }
  105. }
  106. .tag {
  107. border: 1px solid #1CE5B0;
  108. background-color: #F6FFFD;
  109. padding: 8rpx;
  110. border-radius: 8rpx;
  111. .label {
  112. color: #1CE5B0;
  113. font-size: 24rpx;
  114. }
  115. &.finished {
  116. border: 1px solid #BBBBBB;
  117. background-color: #F5F5F5;
  118. .label {
  119. color: #BBBBBB;
  120. }
  121. }
  122. &.turnover {
  123. border: 1px solid #FF7901;
  124. background-color: #F6FFFD;
  125. .label {
  126. color: #FF7901;
  127. }
  128. }
  129. }
  130. }
  131. .item-info {
  132. margin-bottom: 8rpx;
  133. .label {
  134. font-size: 28rpx;
  135. width: 220rpx;
  136. color: #808080;
  137. &.right {
  138. flex: 1;
  139. color: #000000;
  140. }
  141. }
  142. }
  143. .status-btn {
  144. justify-content: flex-end;
  145. align-items: center;
  146. .turnover-tag {
  147. padding-right: 12rpx;
  148. padding-left: 12rpx;
  149. border-radius: 8rpx;
  150. border: 1rpx solid #FF7901;
  151. background-color: #FF7901;
  152. font-size: 28rpx;
  153. color: #FFFFFF;
  154. }
  155. .reporting-tag {
  156. padding-right: 12rpx;
  157. padding-left: 12rpx;
  158. border-radius: 8rpx;
  159. margin-left: 16rpx;
  160. border: 1rpx solid #1684fc;
  161. background-color: #1684fc;
  162. font-size: 28rpx;
  163. color: #FFFFFF;
  164. }
  165. }
  166. }
  167. .bottom {
  168. height: 10%;
  169. position: absolute;
  170. right: 0;
  171. bottom: 0;
  172. left: 0;
  173. height: 80rpx;
  174. border-top: 1px solid #999999;
  175. padding: 16rpx 32rpx;
  176. align-items: center;
  177. background-color: #fff;
  178. .start-batch-btn {
  179. flex: 1;
  180. background-color: #1684fc;
  181. height: 100%;
  182. justify-content: center;
  183. align-items: center;
  184. border-radius: 8rpx;
  185. color: #FFFFFF;
  186. font-size: 28rpx;
  187. }
  188. }
  189. </style>