index.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. <template>
  2. <view class="uni-column container" >
  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">
  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. .container {
  106. height: 100%;
  107. background-color: #f5f5f5;
  108. }
  109. .scroll-container {
  110. width: 92%;
  111. margin: 24rpx auto 0 auto;
  112. height: 90%;
  113. }
  114. .list-item {
  115. background-color: #fff;
  116. position: relative;
  117. padding: 16rpx;
  118. padding-bottom: 24rpx;
  119. margin-bottom: 24rpx;
  120. border-radius: 10rpx;
  121. .title-container {
  122. justify-content: flex-start;
  123. margin-top: 8rpx;
  124. margin-bottom: 16rpx;
  125. .title {
  126. height: 48rpx;
  127. align-items: center;
  128. .label {
  129. font-size: 32rpx;
  130. font-weight: bold;
  131. &.code {
  132. margin-left: 8rpx;
  133. }
  134. }
  135. }
  136. .tag {
  137. border: 1px solid #1CE5B0;
  138. background-color: #F6FFFD;
  139. padding: 8rpx;
  140. border-radius: 8rpx;
  141. .label {
  142. color: #1CE5B0;
  143. font-size: 24rpx;
  144. }
  145. &.finished {
  146. border: 1px solid #BBBBBB;
  147. background-color: #F5F5F5;
  148. .label {
  149. color: #BBBBBB;
  150. }
  151. }
  152. &.turnover {
  153. border: 1px solid #FF7901;
  154. background-color: #F6FFFD;
  155. .label {
  156. color: #FF7901;
  157. }
  158. }
  159. }
  160. }
  161. .item-info {
  162. margin-bottom: 8rpx;
  163. .label {
  164. font-size: 28rpx;
  165. width: 220rpx;
  166. color: #808080;
  167. &.right {
  168. flex: 1;
  169. color: #000000;
  170. }
  171. }
  172. }
  173. .status-btn {
  174. justify-content: flex-end;
  175. align-items: center;
  176. .turnover-tag {
  177. padding-right: 12rpx;
  178. padding-left: 12rpx;
  179. border-radius: 8rpx;
  180. border: 1rpx solid #FF7901;
  181. background-color: #FF7901;
  182. font-size: 28rpx;
  183. color: #FFFFFF;
  184. }
  185. .reporting-tag {
  186. padding-right: 12rpx;
  187. padding-left: 12rpx;
  188. border-radius: 8rpx;
  189. margin-left: 16rpx;
  190. border: 1rpx solid #1684fc;
  191. background-color: #1684fc;
  192. font-size: 28rpx;
  193. color: #FFFFFF;
  194. }
  195. }
  196. }
  197. .bottom {
  198. height: 10%;
  199. position: fixed;
  200. right: 0;
  201. bottom: 0;
  202. left: 0;
  203. height: 80rpx;
  204. border-top: 1px solid #999999;
  205. padding: 16rpx 32rpx;
  206. align-items: center;
  207. background-color: #fff;
  208. .start-batch-btn {
  209. flex: 1;
  210. background-color: #1684fc;
  211. height: 100%;
  212. justify-content: center;
  213. align-items: center;
  214. border-radius: 8rpx;
  215. color: #FFFFFF;
  216. font-size: 28rpx;
  217. }
  218. }
  219. </style>