index.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <template>
  2. <view class="mould-page">
  3. <navigation title="产品质检"></navigation>
  4. <!-- 搜索框 -->
  5. <view class="white-card">
  6. <!-- 搜索框 -->
  7. <!-- <uni-search-bar v-model="form.orderNum" :focus="true" placeholder="请输入工单名称,工单编号" ></uni-search-bar> -->
  8. <u-search placeholder="请输入工单名称,工单编号" v-model="form.taskName"
  9. @search="searchforfun" @custom="searchforfun" @clear="clearforfun">
  10. </u-search>
  11. </view>
  12. <view class="list-box" v-if="dataList.length>0">
  13. <view class="list-item" v-for="(item, index) in dataList" :key="index" @click="Jumpfun(item.id)">
  14. <view class="item-text flex-box">
  15. <view>订单名称:</view>
  16. <view>{{item.taskName}}</view>
  17. </view>
  18. <view class="item-text flex-box">
  19. <view>工单编号:</view>
  20. <view>{{item.orderNum}}</view>
  21. </view>
  22. <view class="item-text flex-box">
  23. <view>工单数量:</view>
  24. <view>{{item.orderAmounts || 0}}</view>
  25. </view>
  26. <view class="item-text flex-box">
  27. <view>合格数量:</view>
  28. <view>{{item.orderFinishNum || 0}}</view>
  29. </view>
  30. <view class="item-text flex-box">
  31. <view>缺陷数量:</view>
  32. <view>{{Number(item.orderAmounts) - Number(item.orderFinishNum) || 0}}</view>
  33. </view>
  34. <!-- <view class="btn-box">
  35. <view class="btn-item" >
  36. <view>卸载</view>
  37. </view>
  38. <view class="btn-item" >
  39. <view>换模</view>
  40. </view>
  41. </view> -->
  42. </view>
  43. </view>
  44. <empty v-else text="暂无数据"></empty>
  45. <view v-if="total !== 0 && dataList.length != 0" style="height: 60rpx;">
  46. <u-loadmore :status="status" />
  47. </view>
  48. </view>
  49. </template>
  50. <script>
  51. export default {
  52. data() {
  53. return {
  54. // 请求传递的参数
  55. form:{
  56. current:1,
  57. size:10,
  58. orderStatus:1
  59. },
  60. // 列表数据
  61. dataList:[],
  62. total:0,
  63. status: 'loadmore',
  64. }
  65. },
  66. onShow() {
  67. this.dataList = []
  68. this.productOrderlistfun()
  69. },
  70. onReachBottom() {
  71. this.status = 'loading'
  72. if (this.dataList.length < this.total) {
  73. this.page.current++
  74. this.productOrderlistfun()
  75. } else {
  76. this.status = 'nomore'
  77. }
  78. },
  79. methods: {
  80. // 跳转方法
  81. Jumpfun(orderId){
  82. uni.navigateTo({
  83. url: '/subPackages/qualityinspection/details?orderId=' + orderId
  84. });
  85. },
  86. // 搜索事件
  87. searchforfun(){
  88. this.form.current = 1
  89. this.dataList = []
  90. this.productOrderlistfun()
  91. },
  92. // 搜索清空
  93. clearforfun(){
  94. delete this.form.taskName
  95. this.form.current = 1
  96. this.dataList = []
  97. this.productOrderlistfun()
  98. },
  99. // 获取列表接口
  100. productOrderlistfun(){
  101. uni.showLoading({
  102. title: '加载中',
  103. mask: true
  104. });
  105. this.$api.productOrderlist(this.form).then(res=>{
  106. this.dataList = this.dataList.concat(res.rows)
  107. this.total = res.total
  108. if (this.dataList.length == res.total) {
  109. this.status = 'nomore'
  110. }
  111. uni.hideLoading();
  112. })
  113. },
  114. }
  115. }
  116. </script>
  117. <style lang="scss" scoped>
  118. .mould-page {
  119. .white-card {
  120. background-color: $uni-bg-color;
  121. padding: 20rpx;
  122. }
  123. .list-box {
  124. padding: 0 20rpx;
  125. color: $uni-text-color-list; // #666
  126. .list-item {
  127. background-color: $uni-bg-color; // #ffffff
  128. padding: 20rpx;
  129. border-radius: 20rpx;
  130. margin-top: 28rpx;
  131. .item-text {
  132. margin-top: 10rpx;
  133. font-size: 30rpx;
  134. padding: 10rpx 0;
  135. border-bottom: 1rpx solid rgba(0, 0, 0, .1);
  136. &:last-child {
  137. border: 0;
  138. }
  139. }
  140. .flex-box {
  141. display: flex;
  142. align-items: center;
  143. justify-content: space-between;
  144. }
  145. }
  146. .btn-box {
  147. display: flex;
  148. justify-content: flex-end;
  149. margin-top: 10rpx;
  150. .btn-item {
  151. width: 175rpx;
  152. height: 50rpx;
  153. line-height: 50rpx;
  154. text-align: center;
  155. border-radius: 24rpx;
  156. margin-left: 20rpx;
  157. border: 1px solid #43adfd;
  158. color: #43adfd;
  159. }
  160. }
  161. }
  162. }
  163. </style>