index.vue 29 KB

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