index.vue 25 KB

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