index.vue 26 KB

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