index.vue 27 KB

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