index.vue 27 KB

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