index.vue 27 KB

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