index.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  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['process'] }}</text>
  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['lotNumber'] }}</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'] }}/{{ item['invest'] }}</text>
  40. </view>
  41. <view class="item-info uni-row">
  42. <text class="label">设备</text>
  43. <text class="label right">{{ item['equipmentName'] }}</text>
  44. </view>
  45. <!-- <view class="item-info uni-row">
  46. <text class="label">操作人</text>
  47. <text class="label right">{{ item['operator'] }}</text>
  48. </view> -->
  49. </view>
  50. </view>
  51. </template>
  52. <script setup>
  53. import {
  54. getListByUserEquipment
  55. } from '@/api/business/subPlanDetails'
  56. import {
  57. ref
  58. } from 'vue'
  59. import {
  60. onReady,
  61. onLoad,
  62. onPullDownRefresh
  63. } from '@dcloudio/uni-app'
  64. import {
  65. getToken
  66. } from '@/utils/auth'
  67. import { store } from '@/store/index.js'
  68. const listData = ref([])
  69. const keywords = ref('')
  70. onLoad(() => {
  71. init()
  72. })
  73. /**
  74. * 监听下拉刷新
  75. */
  76. onPullDownRefresh(() => {
  77. init();
  78. setTimeout(function() {
  79. uni.stopPullDownRefresh();
  80. }, 3000);
  81. })
  82. function init(data={}) {
  83. uni.showLoading({
  84. title: '加载中'
  85. });
  86. getListByUserEquipment(data).then((res) => {
  87. console.log(res)
  88. if (res.code === 200) {
  89. listData.value = res.rows;
  90. uni.hideLoading()
  91. } else if (res.code === 401) {
  92. uni.showToast({
  93. icon: 'none',
  94. title: '未登录或登录状态已超时',
  95. duration: 1500
  96. })
  97. } else if (res.code === 500) {
  98. uni.showToast({
  99. icon: 'none',
  100. title: '系统错误,请联系管理员',
  101. duration: 1500
  102. })
  103. } else {
  104. uni.showToast({
  105. icon: 'none',
  106. title: res.msg,
  107. duration: 1500
  108. })
  109. }
  110. })
  111. }
  112. function handleToBatchReporting(item) {
  113. store.planSubDetails = item
  114. uni.navigateTo({
  115. url: '/pages/batchReporting/index'
  116. })
  117. }
  118. function handleSearch(){
  119. let reqParam = {
  120. keywords: keywords.value
  121. }
  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: 20rpx 10rpx;
  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. }
  160. }
  161. .uni-column {
  162. background-color: rgba(245, 245, 245, 1);
  163. height: 100%;
  164. overflow: auto;
  165. }
  166. .list-item {
  167. background-color: #fff;
  168. position: relative;
  169. padding: 16rpx;
  170. padding-bottom: 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>