index.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. <template>
  2. <view class="quick-task" style="padding-bottom: 150upx">
  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="cu-bar search bg-white">
  8. <view class="text-center text-xxl text-bold padding-left-sm" @tap="scanQrCode">
  9. <text class="cuIcon-scan text-orange lg"></text>
  10. </view>
  11. <view class="search-form">
  12. <text class="cuIcon-search"></text>
  13. <input type="text" placeholder="输入抽样单号查询新抽样单" v-model="sampleSheetNumber" style="padding-right: 0;">
  14. <text class="cuIcon cuIcon-close endClass text-xxl text-bold" @tap="sampleSheetNumber = ''"
  15. v-show="sampleSheetNumber !== ''"></text>
  16. </view>
  17. <view class="action">
  18. <button class="cu-btn bg-green shadow-blur round" @tap="searchNewSample">查询</button>
  19. </view>
  20. </view>
  21. <view class="padding-sm quick-list" v-if="!searchSample.id">
  22. <view class="cu-list menu bg-white shadow" v-for="(item, index) in listData" :key="index">
  23. <view class="cu-item">
  24. <view class="title text-black text-bold text-lg">
  25. <text class="cuIcon-titles text-green"></text>
  26. {{ item.ahSampleDetailList.map(v => v.name).join(",") }}
  27. </view>
  28. <view class="action">
  29. <text class="text-orange text-bold text-lg"
  30. v-if="item.sampleStatus==='WAIT_ENTERPRISES_SUBMIT'">待确认
  31. </text>
  32. </view>
  33. </view>
  34. <view class="content padding-sm detail solid-bottom">
  35. <!-- <view>抽检产品:{{ }}</view>-->
  36. <view>抽样任务:{{ item.ahTasks.taskName }}</view>
  37. <view>任务编号:{{ item.ahTasks.taskNumber }}</view>
  38. <view>年度/季度:{{ item.ahTasks.taskYear.substr(0, 4) }}-{{
  39. item.ahTasks.taskBatch
  40. }}
  41. </view>
  42. <view>发布单位:{{ item.publishUnitName }}</view>
  43. <view>抽样单位:{{ item.sampleUnitName }}</view>
  44. <view class="text-gray">抽样人员:{{ item.samplingPeopleFirst }}、{{ item.samplingPeopleSecond }}</view>
  45. <view>抽样时间:{{ item.ahSampleDetailList[0].createTime }}</view>
  46. </view>
  47. <view class="tools padding-sm">
  48. <view>
  49. </view>
  50. <view style="display: flex;justify-content: space-between;gap:30upx">
  51. <view class="tool" @tap="toSampleDetail(item)">
  52. <view class="cu-btn bg-blue light text-df text-bold">
  53. {{ item.sampleStatus === 'WAIT_ENTERPRISES_SUBMIT' ? '去确认' : '查看' }}
  54. <text class="cuIcon-right lg"></text>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. <view class="radius shadow-warp bg-white text-lg" v-if="listData.length === 0">
  61. <view class="cu-list menu-avatar">
  62. <view class="cu-item">
  63. <view class="content">
  64. <view class="text-sm text-center" style="justify-content: center;">
  65. <text class="text-cut text-lg">
  66. <text class="cuIcon-warn text-yellow margin-right-xs text-xl"></text>
  67. 未查询到相关数据
  68. </text>
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. </view>
  75. <view class="padding-sm quick-list" v-if="searchSample.id">
  76. <view class="cu-list menu bg-white shadow">
  77. <view class="cu-item">
  78. <view class="title text-black text-bold text-lg">
  79. <text class="cuIcon-titles text-green"></text>
  80. {{ searchSample.bySampleUnitName }}
  81. </view>
  82. <view class="action">
  83. <!-- <text class="text-orange text-bold text-lg"
  84. v-if="item.sampleStatus==='WAIT_ENTERPRISES_SUBMIT'">待确认
  85. </text>-->
  86. </view>
  87. </view>
  88. <view class="content padding-sm detail solid-bottom">
  89. <view>抽样单编号:{{ searchSample.samplingNumber }}</view>
  90. <view>抽样样品:{{ searchSample.mustProductName }}</view>
  91. <view>抽样单位:{{ searchSample.sampleUnitName }}</view>
  92. <view class="text-gray">抽样人员:{{ searchSample.samplingPeopleFirst }}、{{ searchSample.samplingPeopleSecond }}</view>
  93. <view>抽样时间:{{ searchSample.updateTime }}</view>
  94. </view>
  95. <view class="tools padding-sm">
  96. <view>
  97. </view>
  98. <view style="display: flex;justify-content: space-between;gap:30upx">
  99. <view class="tool" @tap="toSampleDetail(searchSample.id)">
  100. <view class="cu-btn bg-blue light text-df text-bold">
  101. {{ searchSample.sampleStatus === 'WAIT_ENTERPRISES_SUBMIT' ? '去确认' : '查看' }}
  102. <text class="cuIcon-right lg"></text>
  103. </view>
  104. </view>
  105. </view>
  106. </view>
  107. </view>
  108. </view>
  109. </view>
  110. </template>
  111. <script>
  112. import {
  113. _checkModel
  114. } from "./check-model";
  115. export default {
  116. data() {
  117. return {
  118. curIndex: 1,
  119. listData: [],
  120. modalName: null,
  121. pageNum: 1,
  122. pageSize: 10,
  123. pageTotal: 1,
  124. sampleSheetNumber:'',
  125. searchSample:{}
  126. };
  127. },
  128. onShow() {
  129. this.pageNum = 1;
  130. this.pageSize = 10
  131. this.getList();
  132. },
  133. methods: {
  134. search() {
  135. this.pageNum = 1;
  136. this.getList()
  137. },
  138. getList() {
  139. // this.inSearching = true
  140. _checkModel.getSampleListByNJB({
  141. pageNum: this.pageNum,
  142. pageSize: this.pageSize
  143. }, res => {
  144. console.log(res);
  145. const {records, total} = res.data
  146. if (this.pageNum === 1) {
  147. this.listData = records
  148. } else {
  149. this.listData = this.listData.concat(records)
  150. }
  151. this.pageTotal = total
  152. // this.inSearching = false
  153. if (records.length > 0) {
  154. this.pageNum++
  155. }
  156. })
  157. },
  158. onReachBottom() {
  159. this.getList();
  160. },
  161. toSampleDetail(item) {
  162. // uni.setStorageSync("sampleDetail", item);
  163. uni.navigateTo({
  164. url: "/pages/sample-check-list/sample-detail/index?id="+item.id
  165. })
  166. },
  167. scanQrCode(){
  168. uni.scanCode({
  169. scanType:["qrCode"],
  170. success: res=>{
  171. this.sampleSheetNumber = res.result;
  172. this.searchNewSample();
  173. }
  174. });
  175. },
  176. searchNewSample(){
  177. if(!this.sampleSheetNumber){
  178. this.$msg("请输入或扫描抽样单号");
  179. return
  180. }
  181. _checkModel.getSampleInfoByNJB(this.sampleSheetNumber,res=>{
  182. const {code,data,message} = res;
  183. if(code === 200){
  184. if(data && data.ahSampleSheet){
  185. this.searchSample = data.ahSampleSheet;
  186. }else{
  187. this.$msg("未查询到抽样单信息");
  188. }
  189. }else{
  190. this.$msg(message);
  191. }
  192. })
  193. }
  194. }
  195. }
  196. </script>
  197. <style scoped>
  198. .quick-task {
  199. height: 100%;
  200. width: 100%;
  201. }
  202. .first-step {
  203. height: 100%;
  204. display: flex;
  205. flex-direction: column;
  206. justify-content: center;
  207. align-items: center;
  208. padding-top: 20vh;
  209. }
  210. .first-step button {
  211. width: 90%;
  212. margin-top: 20vh;
  213. }
  214. .first-step image {
  215. width: 60vw;
  216. margin-left: 10vw;
  217. }
  218. /*.quick-list {
  219. padding-top: 100px;
  220. }*/
  221. .tools {
  222. display: flex;
  223. align-items: center;
  224. justify-content: space-between;
  225. padding: 20 upx;
  226. }
  227. .detail view {
  228. height: 1.8em;
  229. line-height: 1.8em !important;
  230. border: none;
  231. color: gray;
  232. }
  233. .taskDetail {
  234. /*border: 1rpx solid #8799a3;*/
  235. box-shadow: 0 0 25 upx #aaa;
  236. border-radius: 10 rpx;
  237. overflow: hidden;
  238. }
  239. </style>