index.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. <template>
  2. <view class="mainBox">
  3. <uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="质检工单" @clickLeft="back">
  4. </uni-nav-bar>
  5. <view class="top-wrapper">
  6. <uni-section>
  7. <uni-easyinput prefixIcon="search" style="width: 460rpx" v-model="searchVal" placeholder="名称、批次号">
  8. </uni-easyinput>
  9. </uni-section>
  10. <button class="search_btn" @click="doSearch">搜索</button>
  11. </view>
  12. <div style="height:100rpx;width: 475rpx;"></div>
  13. <view class="wrapper">
  14. <u-list @scrolltolower="scrolltolower" class="listContent">
  15. <view v-for="(item, index) in tableList" :key="item.id" style="position: relative;" >
  16. <view class="item">
  17. <view class="herder_item">
  18. <view class="herder_text"></view>
  19. <view class="herder_view">
  20. {{ getDictValue('质检计划类型', item.qualityType+'')}}/{{item.code}}/{{item.productCode}}/{{item.productName}}
  21. </view>
  22. </view>
  23. <view class="text">检验项目:</view>
  24. <view class="item_value">
  25. <view v-for="(row,_index) in item.templateList" :key="index+'_'+_index" :style="{background:row.status==1?'#19be6b':row.status==2?'#ff9900':row.status==3?'#ff9900':'#909399'}">
  26. {{row.inspectionName}}
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. <view style="width:100%;height:40rpx"></view>
  32. <view style='margin-top: 20vh;' v-if="tableList.length==0">
  33. <u-empty iconSize='150' textSize='32' text='暂无数据'>
  34. </u-empty>
  35. </view>
  36. </u-list>
  37. </view>
  38. <u-toast ref="uToast"></u-toast>
  39. </view>
  40. </template>
  41. <script>
  42. import dictMixns from '@/mixins/dictMixins'
  43. import {
  44. getList,
  45. } from '@/api/inspectionWork/index.js'
  46. export default {
  47. components: {},
  48. mixins: [dictMixns],
  49. data() {
  50. return {
  51. tableList: [],
  52. page: 1,
  53. size: 10,
  54. isEnd: false,
  55. searchVal: ''
  56. }
  57. },
  58. computed: {
  59. },
  60. onLoad() {
  61. this.requestDict('质检计划类型')
  62. this.getList()
  63. },
  64. onShow() {
  65. this.isEnd = false
  66. this.page = 1
  67. // this.getList()
  68. },
  69. methods: {
  70. doSearch() {
  71. this.isEnd = false
  72. this.page = 1
  73. this.getList()
  74. },
  75. //获取列表信息
  76. getList() {
  77. if (this.isEnd) {
  78. return
  79. }
  80. uni.showLoading({
  81. title: '加载中'
  82. })
  83. let data = {
  84. pageNum: this.page,
  85. size: this.size,
  86. partaName: this.searchVal,
  87. recordingMethod:1
  88. }
  89. getList(data).then(res => {
  90. if (this.page === 1) {
  91. this.tableList = res.list
  92. } else {
  93. this.tableList.push(...res.list)
  94. }
  95. this.page += 1
  96. this.isEnd = this.tableList.length >= res.count
  97. }).then(() => {
  98. uni.hideLoading()
  99. })
  100. },
  101. scrolltolower() {
  102. if (this.isEnd) {
  103. return
  104. }
  105. this.getList();
  106. },
  107. }
  108. }
  109. </script>
  110. <style lang="scss" scoped>
  111. .mainBox {
  112. background-color: #f3f8fb
  113. }
  114. // .wrapper{
  115. // }
  116. .top-wrapper {
  117. background-color: #fff;
  118. display: flex;
  119. width: 750rpx;
  120. height: 88rpx;
  121. padding: 16rpx 32rpx;
  122. align-items: center;
  123. gap: 16rpx;
  124. position: fixed;
  125. z-index: 999;
  126. /deep/.uni-section {
  127. margin-top: 0px;
  128. }
  129. /deep/.uni-section-header {
  130. padding: 0px;
  131. }
  132. .search_btn {
  133. width: 120rpx;
  134. height: 70rpx;
  135. line-height: 70rpx;
  136. padding: 0 24rpx;
  137. background: $theme-color;
  138. font-size: 32rpx;
  139. color: #fff;
  140. margin: 0;
  141. margin-left: 26rpx;
  142. }
  143. .menu_icon {
  144. width: 44rpx;
  145. height: 44rpx;
  146. margin-left: 14rpx;
  147. }
  148. }
  149. .item {
  150. width: 720rpx;
  151. // height:400rpx;
  152. margin: 20rpx auto 0;
  153. padding: 26rpx;
  154. border-radius: 30rpx;
  155. .text{
  156. margin-top:20rpx;
  157. }
  158. background: #fff;
  159. }
  160. .item_value{
  161. width: 100%;
  162. display:flex;
  163. flex-wrap: wrap;
  164. margin-left: -10rpx;
  165. >view{
  166. font-size: 24rpx;
  167. color:#fff;
  168. padding:12rpx;
  169. border-radius:10rpx;
  170. background:#979797;
  171. margin-left: 10rpx;
  172. margin-top:20rpx;
  173. }
  174. }
  175. .herder_item {
  176. display: flex;
  177. // align-items: center;
  178. font-size: 28rpx;
  179. font-weight: bold;
  180. .herder_view {
  181. width: calc(100% - 20rpx);
  182. word-break: break-all;
  183. }
  184. .herder_text {
  185. min-width: 10rpx;
  186. height: 32rpx;
  187. border-radius: 10rpx;
  188. background: #00c0a1;
  189. margin-right: 12rpx;
  190. margin-top: 5rpx;
  191. }
  192. }
  193. </style>