index.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689
  1. <template>
  2. <view class="tab-container">
  3. <view :class="['tab-item', isActiveId === 1 ? 'active': '']" @click="handleClickTab(1)">批次信息</view>
  4. <view :class="['tab-item', isActiveId === 2 ? 'active': '']" @click="handleClickTab(2)">领料信息</view>
  5. <view :class="['tab-item', isActiveId === 3 ? 'active': '']" @click="handleClickTab(3)">历史报工</view>
  6. <view :class="['tab-item', isActiveId === 4 ? 'active': '']" @click="handleClickTab(4)">检查信息</view>
  7. <view :class="['tab-item', isActiveId === 5 ? 'active': '']" @click="handleClickTab(5)">分选信息</view>
  8. </view>
  9. <scroll-view class="scroll-container" scroll-y scroll-with-animation :scroll-into-view="scrollToId"
  10. :scroll-top="scrollTop" @scrolltoupper="handleScrollToUpper" @scrolltolower="handleScrollToLower"
  11. @scroll="handleScroll">
  12. <!-- 批次信息 -->
  13. <view id="item1" class="scroll-item">
  14. <view> <text style="font-size: 32rpx;display: flex;justify-content: center;">批次信息</text>
  15. </view>
  16. <view v-if="lotData==null" class="no-date">
  17. <text>暂无数据</text>
  18. </view>
  19. <view v-else >
  20. <view class="item-info uni-row" style="margin-top: 16rpx;"> <text class="label">批次号:</text>
  21. <text class="label right" style="font-size: 30rpx;color: black;">{{ lotData['lotCode'] }}</text>
  22. </view>
  23. <view class="item-info uni-row"> <text class="label">产品描述:</text>
  24. <text class="label right ">{{ lotData['productDescription'] }}</text>
  25. </view>
  26. <view class="item-info uni-row">
  27. <text class="label">箱号:</text>
  28. <text class="label right">{{ lotData['carrierName']}}</text>
  29. </view>
  30. <view class="item-info uni-row">
  31. <text class="label">投产量:</text>
  32. <text
  33. class="label right">{{ lotData['prevProcess'] ? lotData['processQualifiedNum'] : lotData['productionQuantity']}}</text>
  34. </view>
  35. <view class="item-info uni-row">
  36. <text class="label">合格数量:</text>
  37. <text class="label right">{{ lotData['totalQuantityNum']}}</text>
  38. </view>
  39. <view class="item-info uni-row">
  40. <text class="label">上道工序:</text>
  41. <text
  42. class="label right">{{ lotData.prevProcess && lotData['prevProcess'] != "" ? lotData['prevProcess'].processAlias : '-'}}</text>
  43. </view>
  44. <view class="item-info uni-row">
  45. <text class="label">当前工序:</text>
  46. <view class="label right uni-row">
  47. <text
  48. class="label right">{{ lotData.currentProcess && lotData['currentProcess'] != "" ? lotData['currentProcess'].processAlias : '-'}}</text>
  49. (<view style="color: #1684fc;" @click.stop="handleClickProcessList(lotData)">&nbsp;工艺列表&nbsp;
  50. </view>)
  51. </view>
  52. </view>
  53. <view class="item-info uni-row">
  54. <text class="label">下道工序:</text>
  55. <text
  56. class="label right">{{ lotData.nextProcess && lotData['nextProcess'] != "" ? lotData['nextProcess'].processAlias : '-'}}</text>
  57. </view>
  58. <view class="item-info uni-row">
  59. <text class="label">当前设备:</text>
  60. <text
  61. class="label right">{{ lotData['currentEquipmentCode'] && lotData['currentEquipmentCode'] != "" ? lotData['currentEquipmentCode'] : '-'}}</text>
  62. </view>
  63. <view class="item-info uni-row">
  64. <text class="label">当前操作者:</text>
  65. <text class="label right">{{ lotData['currentNickName']}}</text>
  66. </view>
  67. <view class="item-info uni-row">
  68. <text class="label">批次状态:</text>
  69. <text
  70. class="label right">{{ lotData['status'] == 1 ?"进行中":lotData['status'] == 3?"周转中":lotData['status'] == 2?"待周转":lotData['status'] == 4?"已送达":lotData['status'] == 5?"已完成":"未开始"}}</text>
  71. </view>
  72. </view>
  73. </view>
  74. <!-- 领料信息 -->
  75. <view id="item2" class="scroll-item">
  76. <view> <text style="font-size: 32rpx;display: flex;justify-content: center;">领料信息</text></view>
  77. <view v-if="furnaceData==null" class="no-date">
  78. <text>暂无数据</text>
  79. </view>
  80. <view v-else>
  81. <view class="item-info uni-row" style="margin-top: 16rpx;">
  82. <text class="label">炉号</text>
  83. <text id="manufacturer"
  84. class="label right">{{furnaceData['furnaceNumber'] ? furnaceData['furnaceNumber'] : '-'}}</text>
  85. </view>
  86. <view class="item-info uni-row">
  87. <text class="label">计划单号</text>
  88. <text id="manufacturer"
  89. class="label right">{{ furnaceData['productionPlanNo'] ? furnaceData['productionPlanNo'] : '-'}}</text>
  90. </view>
  91. <view class="item-info uni-row">
  92. <text class="label">序号</text>
  93. <text class="label right">{{ furnaceData['lineNumber'] ? furnaceData['lineNumber'] : '-'}}</text>
  94. </view>
  95. <view class="item-info uni-row">
  96. <text class="label">厂家</text>
  97. <text class="label right">{{ furnaceData['factory'] ? furnaceData['factory'] : '-'}}</text>
  98. </view>
  99. <view class="item-info uni-row">
  100. <text class="label">牌号</text>
  101. <text class="label right">{{ furnaceData['brandNumber'] ?furnaceData['brandNumber'] : '-' }}</text>
  102. </view>
  103. <view class="item-info uni-row">
  104. <text class="label">规格</text>
  105. <text class="label right">{{ furnaceData['spec'] ?furnaceData['spec'] : '-' }}</text>
  106. </view>
  107. <view class="item-info uni-row">
  108. <text class="label">形状</text>
  109. <text class="label right">{{ furnaceData['shape'] ?furnaceData['shape'] : '-'}}</text>
  110. </view>
  111. <view class="item-info uni-row">
  112. <text class="label">材料直径</text>
  113. <text class="label right">{{ furnaceData['diameter'] ? furnaceData['diameter'] : '-' }}</text>
  114. </view>
  115. <view class="item-info uni-row">
  116. <text class="label">原料编码</text>
  117. <text
  118. class="label right">{{ furnaceData['rawMaterialCode'] ? furnaceData['rawMaterialCode'] : '-' }}</text>
  119. </view>
  120. <view class="item-info uni-row">
  121. <text class="label">来料日期</text>
  122. <text
  123. class="label right">{{ furnaceData['incomingDate'] ? furnaceData['incomingDate'] : '-' }}</text>
  124. </view>
  125. <view class="item-info uni-row">
  126. <text class="label">技术要求1</text>
  127. <text
  128. class="label right">{{ furnaceData['firstTechnicalRequirement'] ? furnaceData['firstTechnicalRequirement'] : '-' }}</text>
  129. </view>
  130. <view class="item-info uni-row">
  131. <text class="label">技术要求2</text>
  132. <text
  133. class="label right">{{ furnaceData['secondTechnicalRequirement'] ?furnaceData['secondTechnicalRequirement'] : '-' }}</text>
  134. </view>
  135. </view>
  136. </view>
  137. <!-- 历史报工 -->
  138. <view id="item3" class="scroll-item">
  139. <view> <text style="font-size: 32rpx;display: flex;justify-content: center;">历史报工</text></view>
  140. <view v-if="historyData.length == 0" class="no-date">
  141. <text>暂无数据</text>
  142. </view>
  143. <view v-for="(item, index) in historyData" :key="index" class="list-item" id="historyData">
  144. <view class="item-info uni-row" style="margin-top: 16rpx;"> <text class="label ">工序:</text>
  145. <text class="label right">{{ item['processAlias'] }}</text>
  146. </view>
  147. <view class="item-info uni-row"> <text class="label">投产量:</text>
  148. <text class="label right ">{{ item['prodNum'] }}</text>
  149. </view>
  150. <view class="item-info uni-row">
  151. <text class="label">合格数量:</text>
  152. <text class="label right">{{ item['qualifiedNum']}}</text>
  153. </view>
  154. <view v-for="(info, index) in item.rejectList" :key="index">
  155. <view class="item-info uni-row">
  156. <text class="label">废品信息:</text>
  157. <text class="label right">{{ info['reason']!=""?info['reason']:'-'}}</text>
  158. </view>
  159. <view class="item-info uni-row">
  160. <text class="label">废品数量:</text>
  161. <text class="label right">{{ info['rejectNum']}}</text>
  162. </view>
  163. </view>
  164. <view class="item-info uni-row">
  165. <text class="label">设备:</text>
  166. <text class="label right">{{ item['equipmentDetailCode'] ?item['equipmentDetailCode']:'-'}}</text>
  167. </view>
  168. <view class="item-info uni-row">
  169. <text class="label">操作者:</text>
  170. <text class="label right">{{ item['nickName']}}</text>
  171. </view>
  172. <view v-if="index!=historyData.length-1" class='middle'>
  173. <view class='segment'></view>
  174. <view class='segment'></view>
  175. </view>
  176. </view>
  177. </view>
  178. <!-- 检查信息 -->
  179. <view id="item4" class="scroll-item">
  180. <view> <text style="font-size: 32rpx;display: flex;justify-content: center;">检查信息</text></view>
  181. <view v-if="inspectionData.length == 0" class="no-date">
  182. <text>暂无数据</text>
  183. </view>
  184. <view v-else v-for="(item, index) in inspectionData" :key="index" class="list-item" id="inspectionData">
  185. <view class="item-info uni-row" style="margin-top: 16rpx;"> <text class="label ">工序:</text>
  186. <text class="label right">{{ item['processAlias'] }}</text>
  187. </view>
  188. <view class="item-info uni-row"> <text class="label">检查员:</text>
  189. <text class="label right ">{{ item['nickName'] }}</text>
  190. </view>
  191. <view v-for="(info, index) in item.processInspectionDetails" :key="index">
  192. <view class="item-info uni-row">
  193. <text class="label">检测项目:</text>
  194. <text class="label right">{{ info['checkStandard']}}</text>
  195. </view>
  196. <view class="item-info uni-row">
  197. <text class="label">检测结果:</text>
  198. <text class="label right">{{ info['checkResult'] !=""?info['checkResult'] :'-'}}</text>
  199. </view>
  200. <view class="item-info uni-row">
  201. <text class="label">废品数量:</text>
  202. <text class="label right">{{ info['rejectNum']}}</text>
  203. </view>
  204. </view>
  205. <view v-for="(data, index) in item.dayworkItemConsults" :key="index">
  206. <view class="item-info uni-row">
  207. <text class="label">咨询信息:</text>
  208. <text class="label right">{{ data['content']}}</text>
  209. </view>
  210. <view class="item-info uni-row">
  211. <text class="label">咨询结果:</text>
  212. <text class="label right">{{ data['status'] == 0?"未回复":data['status'] == 1?"不合格":"合格"}}</text>
  213. </view>
  214. <view class="item-info uni-row">
  215. <text class="label">技术人员:</text>
  216. <text class="label right">{{ data['technicianName']}}</text>
  217. </view>
  218. </view>
  219. <view class="item-info uni-row">
  220. <text class="label">备注:</text>
  221. <text class="label right">{{ item['remark'] !="" ?item['remark']:'-'}}</text>
  222. </view>
  223. <view class="item-info uni-row">
  224. <text class="label">序检结果:</text>
  225. <text class="label right">{{ item['status'] == 0?"待确认":item['status'] == 1?"合格":"不合格"}}</text>
  226. </view>
  227. <view v-if="index!=inspectionData.length -1" class='middle'>
  228. <view class='segment'></view>
  229. <view class='segment'></view>
  230. </view>
  231. </view>
  232. </view>
  233. <!-- 分选信息 -->
  234. <view id="item5" class="scroll-item">
  235. <view> <text style="font-size: 32rpx;display: flex;justify-content: center;">分选信息</text></view>
  236. <view v-if="sortData.length == 0" class="no-date">
  237. <text>暂无数据</text>
  238. </view>
  239. <view v-else v-for="(item, index) in sortData" :key="index" class="list-item" id="sortData">
  240. <view class="item-info uni-row" style="margin-top: 16rpx;"> <text class="label ">工序:</text>
  241. <text class="label right">{{ item['processAlias'] }}</text>
  242. </view>
  243. <view class="item-info uni-row"> <text class="label">分选人员:</text>
  244. <text class="label right ">{{ item['nickName'] }}</text>
  245. </view>
  246. <view v-for="(info, index) in item.rejectList" :key="index">
  247. <view class="item-info uni-row">
  248. <text class="label">检测项目:</text>
  249. <text class="label right">{{ info['checkStandard']}}</text>
  250. </view>
  251. <view class="item-info uni-row">
  252. <text class="label">检测结果:</text>
  253. <text class="label right">{{ info['reason'] !=""?info['reason'] :'-'}}</text>
  254. </view>
  255. <view class="item-info uni-row">
  256. <text class="label">废品数量:</text>
  257. <text class="label right">{{ info['rejectNum']}}</text>
  258. </view>
  259. </view>
  260. <view v-for="(data, index) in item.consults" :key="index">
  261. <view class="item-info uni-row">
  262. <text class="label">咨询信息:</text>
  263. <text class="label right">{{ data['content']}}</text>
  264. </view>
  265. <view class="item-info uni-row">
  266. <text class="label">咨询结果:</text>
  267. <text class="label right">{{ data['status'] == 0?"未回复":data['status'] == 1?"不合格":"合格"}}</text>
  268. </view>
  269. <view class="item-info uni-row">
  270. <text class="label">技术人员:</text>
  271. <text class="label right">{{ data['technicianName']}}</text>
  272. </view>
  273. </view>
  274. <view class="item-info uni-row">
  275. <text class="label">备注:</text>
  276. <text class="label right">{{ item['remark'] !="" ?item['remark']:'-'}}</text>
  277. </view>
  278. <view v-if="index!=sortData.length -1" class='middle'>
  279. <view class='segment'></view>
  280. <view class='segment'></view>
  281. </view>
  282. </view>
  283. </view>
  284. <uni-drawer ref="showRight" mode="right" :mask-click="true">
  285. <view style="text-align: center; font-size: 48rpx; padding: 48rpx 0 24rpx 0;">工艺列表</view>
  286. <view style="font-size: 24rpx;text-align: center;color: red; margin-bottom: 16rpx;">
  287. 蓝色工序为当前工序
  288. </view>
  289. <scroll-view scroll-y="true" style="height: 82%;" @touchmove.stop>
  290. <view v-for="(item,index) in curProcessAfte" :key="index"
  291. style="padding: 8rpx 5% 8rpx 14%; border-top: 1px solid #cccccc">
  292. <text :style="{ color: showStatusColor(item) }">{{ index + 1 }}.{{item.processAlias}}</text>
  293. </view>
  294. </scroll-view>
  295. </uni-drawer>
  296. </scroll-view>
  297. <view class="bottom-btn-container uni-row">
  298. <button class="bottom-btn" @click="init()">扫码查询</button>
  299. </view>
  300. <dialog-selectLot ref="selectLotDialog" @submit="handleDoIt" />
  301. </template>
  302. <script setup>
  303. import {
  304. ref
  305. } from 'vue'
  306. import {
  307. onLoad,
  308. onReady,
  309. onUnload,
  310. onShow
  311. } from '@dcloudio/uni-app'
  312. import {
  313. getLotInformation
  314. } from '@/api/business/dayWork.js'
  315. import {
  316. getFurnaceNoInfoByDaywork
  317. } from '@/api/business/furnaceNoInfo.js'
  318. import {
  319. getDayworkCarrierByCarrierCode
  320. } from '@/api/business/dayworkCarrier.js'
  321. import {
  322. getDayworkItemByDayworkId,
  323. getSortItemByDayworkId
  324. } from '@/api/business/dayWorkItem.js'
  325. import {
  326. getProcessInspectionByDayworkId
  327. } from '@/api/business/processInspection.js'
  328. const scrollTop = ref(0)
  329. // scrollToId 默认值为空
  330. const scrollToId = ref('')
  331. const selectLotDialog = ref(null)
  332. const selectedInfo = ref({})
  333. const curProcessAfte = ref([])
  334. const lotData = ref(null) //批次信息
  335. const furnaceData = ref(null) //领料信息
  336. const historyData = ref([]) //历史报工
  337. const inspectionData = ref([]) //检查信息
  338. const sortData = ref([]) //分选信息
  339. const showRight = ref(null) // 抽屉
  340. const dayworkId = ref(null)
  341. const isActiveId = ref(1)
  342. // 查询主对象
  343. let query = null
  344. // 定义tab2的【SelectorQuery】对象
  345. let item2Query = null
  346. // 定义tab3的【SelectorQuery】对象
  347. let item3Query = null
  348. // 定义tab4的【SelectorQuery】对象
  349. let item4Query = null
  350. onLoad(() => {
  351. init();
  352. })
  353. function init() {
  354. handleScanCode()
  355. }
  356. onReady(() => {
  357. query = uni.createSelectorQuery().in(this)
  358. // 获取 tab2 的【SelectorQuery】,一定要在页面加载完之后,获取该对象,不要在【滚动】事件中获取,
  359. // 那会创建很多个【SelectorQuery】,导致效率低下
  360. item2Query = query.select("#item2").boundingClientRect((data) => {
  361. if (data.top >= 32 && data.top <= 80) {
  362. isActiveId.value = 2
  363. }
  364. })
  365. item3Query = query.select("#item3").boundingClientRect((data) => {
  366. if (data.top >= 32 && data.top <= 80) {
  367. isActiveId.value = 3
  368. }
  369. })
  370. item4Query = query.select("#item4").boundingClientRect((data) => {
  371. if (data.top >= 32 && data.top <= 80) {
  372. isActiveId.value = 4
  373. }
  374. })
  375. })
  376. //扫码
  377. function handleScanCode() {
  378. //引入原生插件
  379. const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
  380. if (mpaasScanModule) {
  381. // 调用插件的 mpaasScan 方法
  382. mpaasScanModule.mpaasScan({
  383. // 扫码识别类型,参数可多选,qrCode、barCode,
  384. // 如不设置,默认识别所有扫码类型,可能有些许影响识别效率
  385. scanType: ["qrCode", "barCode"],
  386. // 是否隐藏相册,默认false不隐藏
  387. hideAlbum: false,
  388. },
  389. (ret) => {
  390. console.log(ret);
  391. let vehicleObj = {
  392. carrierCode: ret.resp_result
  393. };
  394. if (!vehicleObj.carrierCode || vehicleObj.carrierCode == "") {
  395. uni.showToast({
  396. icon: "none",
  397. title: "请扫载具码",
  398. duration: 1000
  399. })
  400. return;
  401. }
  402. getDayworkCarrierByCarrierCode({
  403. carrierCode: vehicleObj.carrierCode,
  404. }).then(response => {
  405. if (response.code == 200) {
  406. if(response.data.length>0) {
  407. if(response.data.length > 1){
  408. selectLotDialog.value.open(response.data);
  409. }else{
  410. handleDoIt(response.data[0])
  411. }
  412. }
  413. else {
  414. uni.showToast({
  415. icon: 'none',
  416. title: "该箱未绑定批次,请重新扫码",
  417. duration: 2000
  418. })
  419. }
  420. }
  421. })
  422. }
  423. );
  424. } else {
  425. // 测试时用
  426. getDayworkCarrierByCarrierCode({
  427. carrierCode: '000880'
  428. }).then(res => {
  429. if (res.code == 200) {
  430. if (res.data.length > 0) {
  431. if(res.data.length > 1){
  432. selectLotDialog.value.open(res.data);
  433. }else{
  434. handleDoIt(res.data[0])
  435. }
  436. } else {
  437. uni.showToast({
  438. icon: 'none',
  439. title: "该箱未绑定批次,请重新扫码",
  440. duration: 2000
  441. })
  442. }
  443. }
  444. })
  445. }
  446. }
  447. function handleDoIt(data) {
  448. dayworkId.value = data.value
  449. getLotInfo()
  450. getFurnaceInfo()
  451. getHistoryReport()
  452. getInspection()
  453. getSortReport()
  454. }
  455. //查询批次信息
  456. function getLotInfo() {
  457. getLotInformation({
  458. id: dayworkId.value,
  459. }).then(response => {
  460. if (response.code == 200) {
  461. lotData.value = response.data
  462. }
  463. })
  464. }
  465. //查询领料信息
  466. function getFurnaceInfo() {
  467. getFurnaceNoInfoByDaywork({
  468. dayworkId: dayworkId.value
  469. }).then(response => {
  470. if (response.code == 200) {
  471. furnaceData.value = response.data
  472. }
  473. })
  474. }
  475. //查询历史报工
  476. function getHistoryReport() {
  477. getDayworkItemByDayworkId({
  478. dayworkId: dayworkId.value
  479. }).then(response => {
  480. if (response.code == 200) {
  481. historyData.value = response.data
  482. }
  483. })
  484. }
  485. //查询检查信息
  486. function getInspection() {
  487. getProcessInspectionByDayworkId({
  488. dayworkId: dayworkId.value
  489. }).then(response => {
  490. if (response.code == 200) {
  491. inspectionData.value = response.data
  492. }
  493. })
  494. }
  495. //查询分选信息
  496. function getSortReport() {
  497. getSortItemByDayworkId({
  498. dayworkId: dayworkId.value
  499. }).then(response => {
  500. if (response.code == 200) {
  501. sortData.value = response.data
  502. }
  503. })
  504. }
  505. function handleClickProcessList(item) {
  506. let curProcessAfterList = [];
  507. console.log("工序列表", item)
  508. let nextIndex = 0;
  509. // for (let i = 0; i < item.processSequence.length; i++) {
  510. // if (item.currentProcess.processStepNumber == item.processSequence[i].processStepNumber) {
  511. // nextIndex = i;
  512. // }
  513. // }
  514. // for (let i = 0; i < item.processSequence.length; i++) {
  515. // if (i >= nextIndex) {
  516. // curProcessAfterList.push(item.processSequence[i]);
  517. // }
  518. // }
  519. // if (item.status == 3) {
  520. // curProcessAfterList.splice(0, 1)
  521. // }
  522. // console.log(curProcessAfterList)
  523. // curProcessAfte.value = curProcessAfterList;
  524. curProcessAfte.value = item.processSequence
  525. showRight.value.open();
  526. }
  527. const showStatusColor = (item) => {
  528. // console.log(status)
  529. console.log(item,111)
  530. console.log(lotData.value,222)
  531. if(item.processStepNumber == lotData.value.currentProcess.processStepNumber){
  532. return '#3482ff'
  533. }
  534. }
  535. const handleClickTab = (val) => {
  536. //scrollTop.value = top
  537. scrollToId.value = 'item' + val
  538. isActiveId.value = val
  539. }
  540. const handleScrollToUpper = () => {
  541. isActiveId.value = 1
  542. }
  543. const handleScrollToLower = () => {
  544. isActiveId.value = 5
  545. }
  546. const handleScroll = () => {
  547. // 在滚动时候,把scrollToId的值清空,否则,会有点击tab,页面不滚动的情况,比如:先点击了tab1,然后滚动到最低端,这时候,再点击tab1,将没反应。
  548. // 原因是:scroll-view 的 【scroll-into-view】属性值未改变时,将不会触发滚动
  549. scrollToId.value = ''
  550. // 这里的item2Query……等对象,必须在最外层定义好,滚动的时候,只获取结果,执行回调
  551. item2Query.exec()
  552. item3Query.exec()
  553. item4Query.exec()
  554. }
  555. </script>
  556. <style lang="scss">
  557. .tab-container {
  558. display: flex;
  559. flex-direction: row;
  560. height: 32px;
  561. .tab-item {
  562. display: flex;
  563. flex-direction: row;
  564. flex: 1;
  565. font-size: 14px;
  566. color: #666;
  567. align-items: center;
  568. justify-content: center;
  569. }
  570. }
  571. .scroll-container {
  572. height: calc(100% - 82px);
  573. background-color: #f5f5f5;
  574. }
  575. .tab-item.active {
  576. color: rgba(25, 137, 250, 1);
  577. font-weight: 700;
  578. }
  579. .scroll-item {
  580. background-color: #fff;
  581. padding: 24rpx;
  582. margin: 0 24rpx;
  583. margin-top: 24rpx;
  584. margin-bottom: 24rpx;
  585. border-radius: 8rpx;
  586. .no-date {
  587. text-align: center;
  588. font-size: 12px;
  589. color: #666;
  590. padding-top: 16px;
  591. }
  592. .title-container {
  593. justify-content: space-between;
  594. margin-top: 8rpx;
  595. margin-bottom: 16rpx;
  596. .title {
  597. height: 48rpx;
  598. align-items: center;
  599. .label {
  600. color: #1684fc;
  601. font-size: 32rpx;
  602. font-weight: bold;
  603. &.code {
  604. color: #000000;
  605. margin-left: 32rpx;
  606. }
  607. }
  608. }
  609. }
  610. .middle {
  611. display: flex;
  612. flex-direction: row;
  613. align-items: center;
  614. justify-content: center
  615. }
  616. .segment {
  617. width: 80%;
  618. background-color: rgba(213, 213, 213, 1);
  619. border: 1rpx solid rgba(213, 213, 213, 1);
  620. margin:16px 0;
  621. }
  622. .item-info {
  623. margin-bottom: 16rpx;
  624. .label {
  625. font-size: 28rpx;
  626. width: 160rpx;
  627. color: #808080;
  628. &.right {
  629. flex: 1;
  630. color: #000000;
  631. }
  632. }
  633. }
  634. .right-info {
  635. justify-content: flex-end;
  636. margin-top: 2rpx;
  637. .label {
  638. font-size: 28rpx;
  639. color: #808080;
  640. }
  641. }
  642. }
  643. .bottom-btn-container {
  644. height: 50px;
  645. border-top: 1px solid #999999;
  646. padding: 0 32px;
  647. align-items: center;
  648. background-color: #fff;
  649. .bottom-btn {
  650. flex: 1;
  651. font-size: 28rpx;
  652. color: #FFFFFF;
  653. background-color: #1684fc;
  654. }
  655. }
  656. </style>