index.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <template>
  2. <view class="home padding-bottom">
  3. <cu-custom class="home-custom" bgColor=".bg-sancolor"
  4. bgImage="https://ahwgh.oss-cn-hangzhou.aliyuncs.com/enterprise/6525f808df760.png" :isBack="true">
  5. <block slot="content">任务列表</block>
  6. </cu-custom>
  7. <view class="padding-sm">
  8. <view class="cu-list menu margin-top taskDetail bg-white"
  9. v-for="(item, index) in taskListData" :key="index">
  10. <view class="cu-item">
  11. <view class="title text-black text-bold text-lg">
  12. <text class="cuIcon-titles text-green"></text>
  13. 抽样区域:{{ item.sampleUnitName }}
  14. </view>
  15. </view>
  16. <view class="content padding-sm detail solid-bottom">
  17. <view>
  18. <text class="text-green">
  19. 抽样批次数:
  20. <text class="text-xl text-bold">{{ item.batchNumber }}</text>
  21. </text>
  22. </view>
  23. <view>分配单位:{{ item.publishUnitName }}</view>
  24. <view>分配人员:{{ item.publishName }}</view>
  25. <view>分配时间:{{item.ahTasks.updateTime}}
  26. </view>
  27. </view>
  28. <view class="tools" style="justify-content: space-between">
  29. <view>
  30. </view>
  31. <view class="tool"
  32. @tap="handleRandomCmp(item)">
  33. <view class="text-blue text-df text-bold text">
  34. 抽取检查企业>>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. <view class="cu-load bg-green light text-sm" v-show="pageTotal > 0"
  41. :class="page > pageTotal?'over':'loading'"></view>
  42. <view class="radius shadow-warp bg-white margin-top text-lg" v-show="pageTotal === 0">
  43. <view class="cu-list menu-avatar">
  44. <view class="cu-item">
  45. <view class="content">
  46. <view class="text-sm text-center" style="justify-content: center;">
  47. <text class="text-cut">
  48. <text class="cuIcon-warn text-yellow margin-right-xs text-xl"></text>
  49. 未查询到相关数据
  50. </text>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. </template>
  58. <script>
  59. import {
  60. _zfyTaskList
  61. } from "./zf-task-list-model.js";
  62. export default {
  63. data() {
  64. return {
  65. page: 1,
  66. size: 10,
  67. pageTotal: 1,
  68. taskListData: [],
  69. curTask: {},
  70. taskId:null
  71. };
  72. },
  73. onReachBottom() {
  74. },
  75. onShow() {
  76. this.page = 1;
  77. this.pageTotal = 1;
  78. this.getCheckTaskListBySample();
  79. },
  80. onLoad(option){
  81. this.taskId = option.taskId;
  82. },
  83. methods: {
  84. getCheckTaskListBySample() {
  85. if (this.page === 1 || (this.page <= this.pageTotal)) {
  86. _zfyTaskList.getCheckTaskListBySample({
  87. pageNum: this.page,
  88. pageSize: this.size,
  89. taskId:this.taskId
  90. }, res => {
  91. const {data, message, code} = res;
  92. if (code === 200) {
  93. const {records, total} = data;
  94. this.pageTotal = Math.ceil(total / this.size);
  95. if (this.page === 1) {
  96. this.taskListData = records;
  97. } else {
  98. this.taskListData = this.taskListData.concat(records);
  99. }
  100. this.page++;
  101. } else {
  102. this.$msg(message);
  103. }
  104. });
  105. }
  106. },
  107. handleRandomCmp(item) {
  108. uni.navigateTo({
  109. url: "/pages/zf-task-list/sampleRandom/index?taskId=" + item.taskId +
  110. "&sampleCheckId=" + item.id+"&batchNumber="+ item.batchNumber+"&sampleId="+item.sampleId
  111. });
  112. },
  113. formatDate(dateTime) {
  114. return dateTime.substring(0, 10)
  115. }
  116. }
  117. };
  118. </script>
  119. <style scoped>
  120. .detail view {
  121. height: 2em;
  122. line-height: 2em !important;
  123. border: none;
  124. color: gray;
  125. }
  126. .tools {
  127. display: flex;
  128. align-items: center;
  129. justify-content: space-between;
  130. padding: 30upx;
  131. }
  132. .tool .text{
  133. font-size: 1.1em!important;
  134. }
  135. .taskDetail {
  136. /*border: 1rpx solid #8799a3;*/
  137. box-shadow: 0 0 25upx #aaa;
  138. border-radius: 10rpx;
  139. overflow: hidden;
  140. }
  141. .btn-item {
  142. display: flex;
  143. flex-direction: column;
  144. justify-content: center;
  145. align-items: center;
  146. }
  147. .cu-tag {
  148. padding: 20upx;
  149. border-radius: 10upx;
  150. }
  151. label {
  152. padding-left: .5em;
  153. }
  154. .text-content {
  155. line-height: 2em;
  156. white-space: pre-line;
  157. text-align: left;
  158. max-height: 60vh;
  159. overflow-y: scroll;
  160. /*padding-bottom: 100rpx;*/
  161. }
  162. </style>