index.vue 30 KB

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