index.vue 5.1 KB

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