index.vue 5.1 KB

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