index.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  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. {
  68. batchNumber: "DC23727410070",
  69. caseNumber: "X12522、X522、X15522、J5211、J5112",
  70. totalWorkingHours: 135.5,
  71. qualifiedQuantity: 600,
  72. invest: 1000,
  73. previousProcess: "NC车1",
  74. currentProcess: "热处理",
  75. NextProcess: "清洗",
  76. status: 0
  77. },
  78. {
  79. batchNumber: "DC23727410070",
  80. caseNumber: "X12522、X522、X15522、J5211、J5112",
  81. totalWorkingHours: 135.5,
  82. qualifiedQuantity: 600,
  83. invest: 1000,
  84. previousProcess: "NC车1",
  85. currentProcess: "热处理",
  86. NextProcess: "清洗",
  87. status: 1
  88. },
  89. {
  90. batchNumber: "DC23727410070",
  91. caseNumber: "X12522、X522、X15522、J5211、J5112",
  92. totalWorkingHours: 135.5,
  93. qualifiedQuantity: 600,
  94. invest: 1000,
  95. previousProcess: "NC车1",
  96. currentProcess: "热处理",
  97. NextProcess: "清洗",
  98. status: 2
  99. }
  100. ])
  101. const handleShowTurnoverApplication = (data) => {
  102. let _data = data ?? {}
  103. // 调用子组件中的方法
  104. turnoverApplicationDialog.value.open(_data)
  105. }
  106. const handleShowLotDialog = (data) => {
  107. let _data = data ?? {}
  108. // 调用子组件中的方法
  109. lotDialog.value.open(_data)
  110. }
  111. </script>
  112. <style lang="scss">
  113. .scroll-container {
  114. width: 92%;
  115. margin: 24rpx auto 0 auto;
  116. height: 90%;
  117. }
  118. .list-item {
  119. background-color: #fff;
  120. position: relative;
  121. padding: 16rpx;
  122. padding-bottom: 24rpx;
  123. margin-bottom: 24rpx;
  124. .title-container {
  125. margin-top: 8rpx;
  126. margin-bottom: 16rpx;
  127. .title {
  128. height: 48rpx;
  129. align-items: center;
  130. .label {
  131. font-size: 32rpx;
  132. font-weight: bold;
  133. &.code {
  134. margin-left: 8rpx;
  135. }
  136. }
  137. }
  138. .tag {
  139. border: 1px solid #1CE5B0;
  140. background-color: #F6FFFD;
  141. padding: 8rpx;
  142. border-radius: 8rpx;
  143. .label {
  144. color: #1CE5B0;
  145. font-size: 24rpx;
  146. }
  147. &.finished {
  148. border: 1px solid #BBBBBB;
  149. background-color: #F5F5F5;
  150. .label {
  151. color: #BBBBBB;
  152. }
  153. }
  154. &.turnover {
  155. border: 1px solid #FF7901;
  156. background-color: #F6FFFD;
  157. .label {
  158. color: #FF7901;
  159. }
  160. }
  161. }
  162. }
  163. .item-info {
  164. margin-bottom: 8rpx;
  165. .label {
  166. font-size: 28rpx;
  167. width: 220rpx;
  168. color: #808080;
  169. &.right {
  170. flex: 1;
  171. color: #000000;
  172. }
  173. }
  174. }
  175. .status-btn {
  176. justify-content: flex-end;
  177. align-items: center;
  178. .turnover-tag {
  179. padding-right: 12rpx;
  180. padding-left: 12rpx;
  181. border-radius: 8rpx;
  182. border: 1rpx solid #FF7901;
  183. background-color: #FF7901;
  184. font-size: 28rpx;
  185. color: #FFFFFF;
  186. }
  187. .reporting-tag {
  188. padding-right: 12rpx;
  189. padding-left: 12rpx;
  190. border-radius: 8rpx;
  191. margin-left: 16rpx;
  192. border: 1rpx solid #1684fc;
  193. background-color: #1684fc;
  194. font-size: 28rpx;
  195. color: #FFFFFF;
  196. }
  197. }
  198. }
  199. .bottom {
  200. height: 10%;
  201. position: absolute;
  202. right: 0;
  203. bottom: 0;
  204. left: 0;
  205. height: 80rpx;
  206. border-top: 1px solid #999999;
  207. padding: 16rpx 32rpx;
  208. align-items: center;
  209. background-color: #fff;
  210. .start-batch-btn {
  211. flex: 1;
  212. background-color: #1684fc;
  213. height: 100%;
  214. justify-content: center;
  215. align-items: center;
  216. border-radius: 8rpx;
  217. color: #FFFFFF;
  218. font-size: 28rpx;
  219. }
  220. }
  221. </style>