index.vue 4.3 KB

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