index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706
  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">{{ getType(item.type) }}</text>
  187. </view>
  188. <view class="item-info uni-row" style="margin-top: 16rpx;"> <text class="label ">工序:</text>
  189. <text class="label right">{{ item['processAlias'] }}</text>
  190. </view>
  191. <view class="item-info uni-row"> <text class="label">检查员:</text>
  192. <text class="label right ">{{ item['nickName'] }}</text>
  193. </view>
  194. <view v-for="(info, index) in item.processInspectionDetails" :key="index">
  195. <view class="item-info uni-row">
  196. <text class="label">检测项目:</text>
  197. <text class="label right">{{ info['checkStandard']}}</text>
  198. </view>
  199. <view class="item-info uni-row">
  200. <text class="label">检测结果:</text>
  201. <text class="label right">{{ info['checkResult'] !=""?info['checkResult'] :'-'}}</text>
  202. </view>
  203. <view v-if="item.type =='outsourcedInspection '" class="item-info uni-row">
  204. <text class="label">废品数量:</text>
  205. <text class="label right">{{ info['rejectNum']}}</text>
  206. </view>
  207. </view>
  208. <view v-for="(data, index) in item.dayworkItemConsults" :key="index">
  209. <view class="item-info uni-row">
  210. <text class="label">咨询信息:</text>
  211. <text class="label right">{{ data['content']}}</text>
  212. </view>
  213. <view class="item-info uni-row">
  214. <text class="label">咨询结果:</text>
  215. <text class="label right">{{ data['status'] == 0?"未回复":data['status'] == 1?"不合格":"合格"}}</text>
  216. </view>
  217. <view class="item-info uni-row">
  218. <text class="label">技术人员:</text>
  219. <text class="label right">{{ data['technicianName']}}</text>
  220. </view>
  221. </view>
  222. <view class="item-info uni-row">
  223. <text class="label">备注:</text>
  224. <text class="label right">{{ item['remark'] !="" ?item['remark']:'-'}}</text>
  225. </view>
  226. <view class="item-info uni-row">
  227. <text class="label">检查结果:</text>
  228. <text class="label right">{{ item['status'] == 0?"待确认":item['status'] == 1?"合格":"不合格"}}</text>
  229. </view>
  230. <view v-if="index!=inspectionData.length -1" class='middle'>
  231. <view class='segment'></view>
  232. <view class='segment'></view>
  233. </view>
  234. </view>
  235. </view>
  236. <!-- 分选信息 -->
  237. <view id="item5" class="scroll-item">
  238. <view> <text style="font-size: 32rpx;display: flex;justify-content: center;">分选信息</text></view>
  239. <view v-if="sortData.length == 0" class="no-date">
  240. <text>暂无数据</text>
  241. </view>
  242. <view v-else v-for="(item, index) in sortData" :key="index" class="list-item" id="sortData">
  243. <view class="item-info uni-row" style="margin-top: 16rpx;"> <text class="label ">工序:</text>
  244. <text class="label right">{{ item['processAlias'] }}</text>
  245. </view>
  246. <view class="item-info uni-row"> <text class="label">分选人员:</text>
  247. <text class="label right ">{{ item['nickName'] }}</text>
  248. </view>
  249. <view v-for="(info, index) in item.rejectList" :key="index">
  250. <view class="item-info uni-row">
  251. <text class="label">检测项目:</text>
  252. <text class="label right">{{ info['checkStandard']}}</text>
  253. </view>
  254. <view class="item-info uni-row">
  255. <text class="label">检测结果:</text>
  256. <text class="label right">{{ info['reason'] !=""?info['reason'] :'-'}}</text>
  257. </view>
  258. <view class="item-info uni-row">
  259. <text class="label">废品数量:</text>
  260. <text class="label right">{{ info['rejectNum']}}</text>
  261. </view>
  262. </view>
  263. <view v-for="(data, index) in item.consults" :key="index">
  264. <view class="item-info uni-row">
  265. <text class="label">咨询信息:</text>
  266. <text class="label right">{{ data['content']}}</text>
  267. </view>
  268. <view class="item-info uni-row">
  269. <text class="label">咨询结果:</text>
  270. <text class="label right">{{ data['status'] == 0?"未回复":data['status'] == 1?"不合格":"合格"}}</text>
  271. </view>
  272. <view class="item-info uni-row">
  273. <text class="label">技术人员:</text>
  274. <text class="label right">{{ data['technicianName']}}</text>
  275. </view>
  276. </view>
  277. <view class="item-info uni-row">
  278. <text class="label">备注:</text>
  279. <text class="label right">{{ item['remark'] !="" ?item['remark']:'-'}}</text>
  280. </view>
  281. <view v-if="index!=sortData.length -1" class='middle'>
  282. <view class='segment'></view>
  283. <view class='segment'></view>
  284. </view>
  285. </view>
  286. </view>
  287. <uni-drawer ref="showRight" mode="right" :mask-click="true">
  288. <view style="text-align: center; font-size: 48rpx; padding: 48rpx 0 24rpx 0;">工艺列表</view>
  289. <view style="font-size: 24rpx;text-align: center;color: red; margin-bottom: 16rpx;">
  290. 蓝色工序为当前工序
  291. </view>
  292. <scroll-view scroll-y="true" style="height: 82%;" @touchmove.stop>
  293. <view v-for="(item,index) in curProcessAfte" :key="index"
  294. style="padding: 8rpx 5% 8rpx 14%; border-top: 1px solid #cccccc">
  295. <text :style="{ color: showStatusColor(item) }">{{ index + 1 }}.{{item.processAlias}}</text>
  296. </view>
  297. </scroll-view>
  298. </uni-drawer>
  299. </scroll-view>
  300. <view class="bottom-btn-container uni-row">
  301. <button class="bottom-btn" @click="init()">扫码查询</button>
  302. </view>
  303. <dialog-selectLot ref="selectLotDialog" @submit="handleDoIt" />
  304. </template>
  305. <script setup>
  306. import {
  307. ref
  308. } from 'vue'
  309. import {
  310. onLoad,
  311. onReady,
  312. onUnload,
  313. onShow
  314. } from '@dcloudio/uni-app'
  315. import {
  316. getLotInformation
  317. } from '@/api/business/dayWork.js'
  318. import {
  319. getFurnaceNoInfoByDaywork
  320. } from '@/api/business/furnaceNoInfo.js'
  321. import {
  322. getDayworkCarrierByCarrierCode
  323. } from '@/api/business/dayworkCarrier.js'
  324. import {
  325. getDayworkItemByDayworkId,
  326. getSortItemByDayworkId
  327. } from '@/api/business/dayWorkItem.js'
  328. import {
  329. getProcessInspectionByDayworkId
  330. } from '@/api/business/processInspection.js'
  331. const scrollTop = ref(0)
  332. // scrollToId 默认值为空
  333. const scrollToId = ref('')
  334. const selectLotDialog = ref(null)
  335. const selectedInfo = ref({})
  336. const curProcessAfte = ref([])
  337. const lotData = ref(null) //批次信息
  338. const furnaceData = ref(null) //领料信息
  339. const historyData = ref([]) //历史报工
  340. const inspectionData = ref([]) //检查信息
  341. const sortData = ref([]) //分选信息
  342. const showRight = ref(null) // 抽屉
  343. const dayworkId = ref(null)
  344. const isActiveId = ref(1)
  345. // 查询主对象
  346. let query = null
  347. // 定义tab2的【SelectorQuery】对象
  348. let item2Query = null
  349. // 定义tab3的【SelectorQuery】对象
  350. let item3Query = null
  351. // 定义tab4的【SelectorQuery】对象
  352. let item4Query = null
  353. onLoad(() => {
  354. init();
  355. })
  356. function init() {
  357. handleScanCode()
  358. }
  359. onReady(() => {
  360. query = uni.createSelectorQuery().in(this)
  361. // 获取 tab2 的【SelectorQuery】,一定要在页面加载完之后,获取该对象,不要在【滚动】事件中获取,
  362. // 那会创建很多个【SelectorQuery】,导致效率低下
  363. item2Query = query.select("#item2").boundingClientRect((data) => {
  364. if (data.top >= 32 && data.top <= 80) {
  365. isActiveId.value = 2
  366. }
  367. })
  368. item3Query = query.select("#item3").boundingClientRect((data) => {
  369. if (data.top >= 32 && data.top <= 80) {
  370. isActiveId.value = 3
  371. }
  372. })
  373. item4Query = query.select("#item4").boundingClientRect((data) => {
  374. if (data.top >= 32 && data.top <= 80) {
  375. isActiveId.value = 4
  376. }
  377. })
  378. })
  379. //扫码
  380. function handleScanCode() {
  381. //引入原生插件
  382. const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
  383. if (mpaasScanModule) {
  384. // 调用插件的 mpaasScan 方法
  385. mpaasScanModule.mpaasScan({
  386. // 扫码识别类型,参数可多选,qrCode、barCode,
  387. // 如不设置,默认识别所有扫码类型,可能有些许影响识别效率
  388. scanType: ["qrCode", "barCode"],
  389. // 是否隐藏相册,默认false不隐藏
  390. hideAlbum: false,
  391. },
  392. (ret) => {
  393. console.log(ret);
  394. let vehicleObj = {
  395. carrierCode: ret.resp_result
  396. };
  397. if (!vehicleObj.carrierCode || vehicleObj.carrierCode == "") {
  398. uni.showToast({
  399. icon: "none",
  400. title: "请扫载具码",
  401. duration: 1000
  402. })
  403. return;
  404. }
  405. getDayworkCarrierByCarrierCode({
  406. carrierCode: vehicleObj.carrierCode,
  407. }).then(response => {
  408. if (response.code == 200) {
  409. if (response.data.length > 0) {
  410. if (response.data.length > 1) {
  411. selectLotDialog.value.open(response.data);
  412. } else {
  413. handleDoIt(response.data[0])
  414. }
  415. } else {
  416. uni.showToast({
  417. icon: 'none',
  418. title: "该箱未绑定批次,请重新扫码",
  419. duration: 2000
  420. })
  421. }
  422. }
  423. })
  424. }
  425. );
  426. } else {
  427. // 测试时用
  428. getDayworkCarrierByCarrierCode({
  429. carrierCode: '000390'
  430. }).then(res => {
  431. if (res.code == 200) {
  432. if (res.data.length > 0) {
  433. if (res.data.length > 1) {
  434. selectLotDialog.value.open(res.data);
  435. } else {
  436. handleDoIt(res.data[0])
  437. }
  438. } else {
  439. uni.showToast({
  440. icon: 'none',
  441. title: "该箱未绑定批次,请重新扫码",
  442. duration: 2000
  443. })
  444. }
  445. }
  446. })
  447. }
  448. }
  449. function handleDoIt(data) {
  450. dayworkId.value = data.value
  451. getLotInfo()
  452. getFurnaceInfo()
  453. getHistoryReport()
  454. getInspection()
  455. getSortReport()
  456. }
  457. //查询批次信息
  458. function getLotInfo() {
  459. getLotInformation({
  460. id: dayworkId.value,
  461. }).then(response => {
  462. if (response.code == 200) {
  463. lotData.value = response.data
  464. }
  465. })
  466. }
  467. //查询领料信息
  468. function getFurnaceInfo() {
  469. getFurnaceNoInfoByDaywork({
  470. dayworkId: dayworkId.value
  471. }).then(response => {
  472. if (response.code == 200) {
  473. furnaceData.value = response.data
  474. }
  475. })
  476. }
  477. //查询历史报工
  478. function getHistoryReport() {
  479. getDayworkItemByDayworkId({
  480. dayworkId: dayworkId.value
  481. }).then(response => {
  482. if (response.code == 200) {
  483. historyData.value = response.data
  484. }
  485. })
  486. }
  487. //查询检查信息
  488. function getInspection() {
  489. getProcessInspectionByDayworkId({
  490. dayworkId: dayworkId.value
  491. }).then(response => {
  492. if (response.code == 200) {
  493. inspectionData.value = response.data
  494. }
  495. })
  496. }
  497. //查询分选信息
  498. function getSortReport() {
  499. getSortItemByDayworkId({
  500. dayworkId: dayworkId.value
  501. }).then(response => {
  502. if (response.code == 200) {
  503. sortData.value = response.data
  504. }
  505. })
  506. }
  507. function handleClickProcessList(item) {
  508. let curProcessAfterList = [];
  509. console.log("工序列表", item)
  510. let nextIndex = 0;
  511. // for (let i = 0; i < item.processSequence.length; i++) {
  512. // if (item.currentProcess.processStepNumber == item.processSequence[i].processStepNumber) {
  513. // nextIndex = i;
  514. // }
  515. // }
  516. // for (let i = 0; i < item.processSequence.length; i++) {
  517. // if (i >= nextIndex) {
  518. // curProcessAfterList.push(item.processSequence[i]);
  519. // }
  520. // }
  521. // if (item.status == 3) {
  522. // curProcessAfterList.splice(0, 1)
  523. // }
  524. // console.log(curProcessAfterList)
  525. // curProcessAfte.value = curProcessAfterList;
  526. curProcessAfte.value = item.processSequence
  527. showRight.value.open();
  528. }
  529. //获得检测类型
  530. function getType(data) {
  531. if (data == "outsourcedInspection") {
  532. return "外协检"
  533. } else if (data == "patrolInspection") {
  534. return "巡检"
  535. } else if (data == "deliveryInspection") {
  536. return "交检"
  537. } else if (data == "factoryInspection") {
  538. return "出厂检"
  539. } else if (data == "firstArticleInspection") {
  540. return "首件检"
  541. } else {
  542. return "仪器室检"
  543. }
  544. }
  545. const showStatusColor = (item) => {
  546. // console.log(status)
  547. console.log(item, 111)
  548. console.log(lotData.value, 222)
  549. if (item.processStepNumber == lotData.value.currentProcess.processStepNumber) {
  550. return '#3482ff'
  551. }
  552. }
  553. const handleClickTab = (val) => {
  554. //scrollTop.value = top
  555. scrollToId.value = 'item' + val
  556. isActiveId.value = val
  557. }
  558. const handleScrollToUpper = () => {
  559. isActiveId.value = 1
  560. }
  561. const handleScrollToLower = () => {
  562. isActiveId.value = 5
  563. }
  564. const handleScroll = () => {
  565. // 在滚动时候,把scrollToId的值清空,否则,会有点击tab,页面不滚动的情况,比如:先点击了tab1,然后滚动到最低端,这时候,再点击tab1,将没反应。
  566. // 原因是:scroll-view 的 【scroll-into-view】属性值未改变时,将不会触发滚动
  567. scrollToId.value = ''
  568. // 这里的item2Query……等对象,必须在最外层定义好,滚动的时候,只获取结果,执行回调
  569. item2Query.exec()
  570. item3Query.exec()
  571. item4Query.exec()
  572. }
  573. </script>
  574. <style lang="scss">
  575. .tab-container {
  576. display: flex;
  577. flex-direction: row;
  578. height: 32px;
  579. .tab-item {
  580. display: flex;
  581. flex-direction: row;
  582. flex: 1;
  583. font-size: 14px;
  584. color: #666;
  585. align-items: center;
  586. justify-content: center;
  587. }
  588. }
  589. .scroll-container {
  590. height: calc(100% - 82px);
  591. background-color: #f5f5f5;
  592. }
  593. .tab-item.active {
  594. color: rgba(25, 137, 250, 1);
  595. font-weight: 700;
  596. }
  597. .scroll-item {
  598. background-color: #fff;
  599. padding: 24rpx;
  600. margin: 0 24rpx;
  601. margin-top: 24rpx;
  602. margin-bottom: 24rpx;
  603. border-radius: 8rpx;
  604. .no-date {
  605. text-align: center;
  606. font-size: 12px;
  607. color: #666;
  608. padding-top: 16px;
  609. }
  610. .title-container {
  611. justify-content: space-between;
  612. margin-top: 8rpx;
  613. margin-bottom: 16rpx;
  614. .title {
  615. height: 48rpx;
  616. align-items: center;
  617. .label {
  618. color: #1684fc;
  619. font-size: 32rpx;
  620. font-weight: bold;
  621. &.code {
  622. color: #000000;
  623. margin-left: 32rpx;
  624. }
  625. }
  626. }
  627. }
  628. .middle {
  629. display: flex;
  630. flex-direction: row;
  631. align-items: center;
  632. justify-content: center
  633. }
  634. .segment {
  635. width: 80%;
  636. background-color: rgba(213, 213, 213, 1);
  637. border: 1rpx solid rgba(213, 213, 213, 1);
  638. margin: 16px 0;
  639. }
  640. .item-info {
  641. margin-bottom: 16rpx;
  642. .label {
  643. font-size: 28rpx;
  644. width: 160rpx;
  645. color: #808080;
  646. &.right {
  647. flex: 1;
  648. color: #000000;
  649. }
  650. }
  651. }
  652. .right-info {
  653. justify-content: flex-end;
  654. margin-top: 2rpx;
  655. .label {
  656. font-size: 28rpx;
  657. color: #808080;
  658. }
  659. }
  660. }
  661. .bottom-btn-container {
  662. height: 50px;
  663. border-top: 1px solid #999999;
  664. padding: 0 32px;
  665. align-items: center;
  666. background-color: #fff;
  667. .bottom-btn {
  668. flex: 1;
  669. font-size: 28rpx;
  670. color: #FFFFFF;
  671. background-color: #1684fc;
  672. }
  673. }
  674. </style>