index.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  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" @click="handleToreportingForWork">
  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['productionPlanNo'] }}</text>
  9. </view>
  10. <view class=" uni-row" style="margin-left: 16rpx;">
  11. <view v-if="item['status'] == 1" class="tag"><text class="label">进行中</text></view>
  12. <view v-else-if="item['status'] == 2" class="tag turnover "><text class="label">周转中</text></view>
  13. <view v-else-if="item['status'] == 0" class="tag turnover "><text class="label">未开始</text></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'] == 1" class=" uni-row">
  43. <!-- <button class="turnover-tag" size="mini" @click="handleShowTurnoverApplication(null)">周转申请</button> -->
  44. <button class="reporting-tag" size="mini" @click="handleToreportingForWork" >去报工</button>
  45. </view>
  46. <view v-else-if="item['status'] == 2" 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(listData)">开始新批次</button>
  54. </view>
  55. <dialog-lot ref="lotDialog"/>
  56. <dialog-turnoverApplication ref="turnoverApplicationDialog" />
  57. </view>
  58. </template>
  59. <script setup>
  60. import { reactive, ref } from 'vue'
  61. import { onLoad, onReady } from '@dcloudio/uni-app'
  62. import { getDayWorkList } from '@/api/business/dayWork.js'
  63. const turnoverApplicationDialog = ref(null)
  64. const lotDialog = ref(null)
  65. const listData = ref([])
  66. const bizDayworkObj = ref({})
  67. onLoad((options) => {
  68. init(options.id);
  69. })
  70. const handleShowTurnoverApplication = (data) => {
  71. let _data = data ?? {}
  72. // 调用子组件中的方法
  73. turnoverApplicationDialog.value.open(_data)
  74. }
  75. const handleShowLotDialog = (data) => {
  76. // if(data){
  77. // lotDialog.value.open(data)
  78. // }else{
  79. uni.navigateTo({
  80. url:"/pages/addNewBatch/index"
  81. })
  82. // }
  83. // let _data = data ?? {}
  84. // 调用子组件中的方法
  85. }
  86. function init(id){
  87. uni.showLoading({
  88. title: '加载中'
  89. });
  90. let reqData = {};
  91. reqData.productionPlanDetailSubDetailId = id;
  92. console.log(reqData)
  93. getDayWorkList(reqData).then(res => {
  94. listData.value = res.rows;
  95. uni.hideLoading();
  96. })
  97. }
  98. function handleToreportingForWork(){
  99. uni.navigateTo({
  100. url:"/pages/reportingForWork/index"
  101. })
  102. }
  103. </script>
  104. <style lang="scss">
  105. .scroll-container {
  106. width: 92%;
  107. margin: 24rpx auto 0 auto;
  108. height: 90%;
  109. }
  110. .list-item {
  111. background-color: #fff;
  112. position: relative;
  113. padding: 16rpx;
  114. padding-bottom: 24rpx;
  115. margin-bottom: 24rpx;
  116. border-radius: 10rpx;
  117. .title-container {
  118. margin-top: 8rpx;
  119. margin-bottom: 16rpx;
  120. .title {
  121. height: 48rpx;
  122. align-items: center;
  123. .label {
  124. font-size: 32rpx;
  125. font-weight: bold;
  126. &.code {
  127. margin-left: 8rpx;
  128. }
  129. }
  130. }
  131. .tag {
  132. border: 1px solid #1CE5B0;
  133. background-color: #F6FFFD;
  134. padding: 8rpx;
  135. border-radius: 8rpx;
  136. .label {
  137. color: #1CE5B0;
  138. font-size: 24rpx;
  139. }
  140. &.finished {
  141. border: 1px solid #BBBBBB;
  142. background-color: #F5F5F5;
  143. .label {
  144. color: #BBBBBB;
  145. }
  146. }
  147. &.turnover {
  148. border: 1px solid #FF7901;
  149. background-color: #F6FFFD;
  150. .label {
  151. color: #FF7901;
  152. }
  153. }
  154. }
  155. }
  156. .item-info {
  157. margin-bottom: 8rpx;
  158. .label {
  159. font-size: 28rpx;
  160. width: 220rpx;
  161. color: #808080;
  162. &.right {
  163. flex: 1;
  164. color: #000000;
  165. }
  166. }
  167. }
  168. .status-btn {
  169. justify-content: flex-end;
  170. align-items: center;
  171. .turnover-tag {
  172. padding-right: 12rpx;
  173. padding-left: 12rpx;
  174. border-radius: 8rpx;
  175. border: 1rpx solid #FF7901;
  176. background-color: #FF7901;
  177. font-size: 28rpx;
  178. color: #FFFFFF;
  179. }
  180. .reporting-tag {
  181. padding-right: 12rpx;
  182. padding-left: 12rpx;
  183. border-radius: 8rpx;
  184. margin-left: 16rpx;
  185. border: 1rpx solid #1684fc;
  186. background-color: #1684fc;
  187. font-size: 28rpx;
  188. color: #FFFFFF;
  189. }
  190. }
  191. }
  192. .bottom {
  193. height: 10%;
  194. position: fixed;
  195. right: 0;
  196. bottom: 0;
  197. left: 0;
  198. height: 80rpx;
  199. border-top: 1px solid #999999;
  200. padding: 16rpx 32rpx;
  201. align-items: center;
  202. background-color: #fff;
  203. .start-batch-btn {
  204. flex: 1;
  205. background-color: #1684fc;
  206. height: 100%;
  207. justify-content: center;
  208. align-items: center;
  209. border-radius: 8rpx;
  210. color: #FFFFFF;
  211. font-size: 28rpx;
  212. }
  213. }
  214. </style>