index.vue 5.2 KB

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