index.vue 5.1 KB

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