index.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. <template>
  2. <view class="uni-column" style="padding: 24rpx">
  3. <view class="box-bg uni-row">
  4. <view class="input-view uni-row">
  5. <uni-icons class="input-uni-icon" type="search" size="18" color="#999" />
  6. <input class="nav-bar-input" type="text" v-model="keywords" placeholder="输入搜索关键词" />
  7. </view>
  8. <view class="search" @click="handleSearch">
  9. 搜索
  10. </view>
  11. </view>
  12. <view v-for="(item, index) in listData" :key="index" @click="handleToBatchReporting(item)" class="list-item">
  13. <view class="title-container uni-row">
  14. <view class="title uni-row">
  15. <text class="label">生产计划单号</text>
  16. <text class="label code">{{ item['productionPlanNo'] }}</text>
  17. </view>
  18. <view v-if="item['dayWorkList'].length > 0" class="tag"><text class="label">进行中</text></view>
  19. <view v-else type="default" class="tag not-start"><text class="label">未开始</text></view>
  20. </view>
  21. <view class="item-info uni-row">
  22. <text class="label">产品描述</text>
  23. <text class="label right">{{ item['productDescription'] }}</text>
  24. </view>
  25. <view class="item-info uni-row">
  26. <text class="label">总批数</text>
  27. <text class="label right">{{ item['totalLotNumber'] }}</text>
  28. </view>
  29. <!-- <view class="item-info uni-row">
  30. <text class="label">完成批数</text>
  31. <text class="label right">{{ item['equiment'] }}</text>
  32. </view> -->
  33. <view class="item-info uni-row">
  34. <text class="label">投产数</text>
  35. <text class="label right">{{ item['productionQuantity'] }}</text>
  36. </view>
  37. <view class="item-info uni-row">
  38. <text class="label">单批量</text>
  39. <text class="label right">{{ item['oneLotQuantity'] }}</text>
  40. </view>
  41. </view>
  42. </view>
  43. </template>
  44. <script setup>
  45. import { getPlanDetailsList } from '@/api/business/planDetails.js'
  46. import {
  47. ref
  48. } from 'vue'
  49. import {
  50. onReady,
  51. onLoad,
  52. onUnload,
  53. onPullDownRefresh
  54. } from '@dcloudio/uni-app'
  55. import {
  56. getToken
  57. } from '@/utils/auth'
  58. import {
  59. store
  60. } from '@/store/index.js'
  61. import {
  62. getUserProcess
  63. } from '@/api/process/process.js'
  64. const listData = ref([])
  65. const keywords = ref('')
  66. const initReqParam = ref({})
  67. onLoad(() => {
  68. console.log(store.curDeptDetails)
  69. initReqParam.value = {
  70. deptId: store.curDeptDetails
  71. }
  72. init(initReqParam.value);
  73. // dayworkItem数据更改后刷新数据
  74. uni.$on('dayworkItemUpdate', reflush);
  75. })
  76. onUnload(() => {
  77. // uni.$off('dayworkItemUpdate', reflush)
  78. })
  79. /**
  80. * 监听下拉刷新
  81. */
  82. onPullDownRefresh(() => {
  83. init(initReqParam.value);
  84. setTimeout(function() {
  85. uni.stopPullDownRefresh();
  86. }, 3000);
  87. })
  88. function reflush() {
  89. init(initReqParam.value);
  90. }
  91. function init(data) {
  92. uni.showLoading({
  93. title: '加载中'
  94. });
  95. getPlanDetailsList({
  96. deptId: Number(store.curDeptDetails)
  97. }).then(res => {
  98. if(res.code == 200){
  99. listData.value = res.data;
  100. uni.hideLoading();
  101. }
  102. uni.hideLoading();
  103. })
  104. }
  105. function handleToBatchReporting(item) {
  106. store.planDetails = item
  107. uni.navigateTo({
  108. url: '/pages/batchReporting/index'
  109. })
  110. }
  111. function handleSearch() {
  112. let reqParam = {
  113. keywords: keywords.value
  114. }
  115. reqParam.tenantId = !store.tenantId ? store.userInfo.tenantId : store.tenantId;
  116. init(reqParam)
  117. }
  118. </script>
  119. <style lang="scss">
  120. $nav-height: 60rpx;
  121. .box-bg {
  122. width: 100%;
  123. background-color: #F5F5F5;
  124. padding: 5rpx 0;
  125. justify-content: space-around;
  126. align-items: center;
  127. .input-view {
  128. width: 100%;
  129. flex: 4;
  130. background-color: #f8f8f8;
  131. height: $nav-height;
  132. border: 1rpx solid #999;
  133. border-radius: 15rpx;
  134. padding: 0 15rpx;
  135. flex-wrap: nowrap;
  136. margin: 20rpx 10rpx;
  137. line-height: $nav-height;
  138. .input-uni-icon {
  139. line-height: $nav-height;
  140. }
  141. .nav-bar-input {
  142. width: 80%;
  143. height: $nav-height;
  144. line-height: $nav-height;
  145. padding: 0 5rpx;
  146. background-color: #f8f8f8;
  147. }
  148. }
  149. .search {
  150. width: 20%;
  151. text-align: center;
  152. color: #808080;
  153. }
  154. }
  155. .uni-column {
  156. background-color: rgba(245, 245, 245, 1);
  157. height: 100%;
  158. overflow: auto;
  159. }
  160. .list-item {
  161. background-color: #fff;
  162. position: relative;
  163. padding: 16rpx;
  164. padding-bottom: 24rpx;
  165. border-radius: 24rpx;
  166. margin-bottom: 24rpx;
  167. .title-container {
  168. justify-content: space-between;
  169. margin-top: 8rpx;
  170. margin-bottom: 16rpx;
  171. .title {
  172. height: 48rpx;
  173. align-items: center;
  174. .label {
  175. font-size: 32rpx;
  176. font-weight: bold;
  177. &.code {
  178. margin-left: 8rpx;
  179. }
  180. }
  181. }
  182. .tag {
  183. border: 1px solid #1ce5b0;
  184. background-color: #f6fffd;
  185. padding: 8rpx;
  186. border-radius: 8rpx;
  187. .label {
  188. color: #1ce5b0;
  189. font-size: 24rpx;
  190. }
  191. &.not-start {
  192. border: 1px solid #bbbbbb;
  193. background-color: #f5f5f5;
  194. .label {
  195. color: #bbbbbb;
  196. }
  197. }
  198. }
  199. }
  200. .item-info {
  201. margin-bottom: 8rpx;
  202. .label {
  203. font-size: 28rpx;
  204. width: 220rpx;
  205. color: #808080;
  206. &.right {
  207. flex: 1;
  208. color: #000000;
  209. }
  210. }
  211. }
  212. }
  213. </style>