detail.vue 37 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300
  1. <template>
  2. <div class="ele-body">
  3. <div class="page-title">
  4. <el-page-header @back="$router.go(-1)">
  5. <div slot="content" class="pageContent">
  6. <div>详情</div>
  7. </div>
  8. </el-page-header>
  9. <el-button @click="handlePrint">打印工单</el-button>
  10. </div>
  11. <progressBox
  12. v-if="tabList.length"
  13. :list="tabList"
  14. :total="infoData.formingNum"
  15. />
  16. <el-card>
  17. <el-descriptions title="" direction="vertical" :column="7" border>
  18. <el-descriptions-item label="工单号">{{
  19. infoData.code
  20. }}</el-descriptions-item>
  21. <el-descriptions-item label="生产版本">{{
  22. infoData.produceVersionName
  23. }}</el-descriptions-item>
  24. <!-- <el-descriptions-item label="工单类型">苏州市</el-descriptions-item> -->
  25. <el-descriptions-item label="产线">{{
  26. infoData.productLine
  27. }}</el-descriptions-item>
  28. <el-descriptions-item label="工艺路线版本">{{
  29. infoData.routingVersion
  30. }}</el-descriptions-item>
  31. <el-descriptions-item label="计划编号">{{
  32. infoData.productionPlanCode
  33. }}</el-descriptions-item>
  34. <el-descriptions-item label="计划类型">{{
  35. typeList[infoData.planType]
  36. }}</el-descriptions-item>
  37. <el-descriptions-item label="物料编码">{{
  38. infoData.productCode
  39. }}</el-descriptions-item>
  40. <el-descriptions-item label="产品名称">{{
  41. infoData.productName
  42. }}</el-descriptions-item>
  43. <el-descriptions-item label="牌号 | 型号"
  44. >{{ infoData.brandNo }} | {{ infoData.model }}</el-descriptions-item
  45. >
  46. <el-descriptions-item label="要求成型数量(PCS)">{{
  47. infoData.formingNum
  48. }}</el-descriptions-item>
  49. <el-descriptions-item label="要求成型重量(KG)">{{
  50. infoData.formingWeight
  51. }}</el-descriptions-item>
  52. <el-descriptions-item label="计划开始时间">{{
  53. infoData.planStartTime
  54. }}</el-descriptions-item>
  55. <el-descriptions-item label="实际开始时间">{{
  56. infoData.startTime
  57. }}</el-descriptions-item>
  58. <el-descriptions-item label="已成型数量(PCS)">{{
  59. infoData.formedNum
  60. }}</el-descriptions-item>
  61. <el-descriptions-item label="已成型重量(KG)">{{
  62. infoData.formedWeight
  63. }}</el-descriptions-item>
  64. <el-descriptions-item label="已交付数量(PCS)">{{
  65. infoData.deliveredQuantity
  66. }}</el-descriptions-item>
  67. <el-descriptions-item label="已交付重量(KG)">{{
  68. infoData.deliveredWeight
  69. }}</el-descriptions-item>
  70. <el-descriptions-item label="工单状态">{{
  71. statusList[infoData.status]
  72. }}</el-descriptions-item>
  73. <el-descriptions-item label="完成时间">{{
  74. infoData.completeTime
  75. }}</el-descriptions-item>
  76. <el-descriptions-item label="生产周期">{{
  77. infoData.productionCycle
  78. }}</el-descriptions-item>
  79. </el-descriptions>
  80. </el-card>
  81. <el-card v-if="tabList.length">
  82. <el-tabs v-model="activeName" type="card" @tab-click="handleTabClick">
  83. <el-tab-pane
  84. :label="item.taskTypeName"
  85. :name="JSON.stringify(index)"
  86. v-for="(item, index) in tabList"
  87. :key="item.taskCode"
  88. ></el-tab-pane>
  89. <!-- <el-tab-pane label="挤压成型" name="1"> </el-tab-pane>
  90. <el-tab-pane label="自然干燥" name="2"></el-tab-pane>
  91. <el-tab-pane label="升温干燥" name="3"></el-tab-pane>
  92. <el-tab-pane label="半加定长" name="4"></el-tab-pane>
  93. <el-tab-pane label="备炉" name="5"></el-tab-pane>
  94. <el-tab-pane label="烧结" name="6"></el-tab-pane>
  95. <el-tab-pane label="深加工" name="7"></el-tab-pane>
  96. <el-tab-pane label="包装" name="8"></el-tab-pane>
  97. <el-tab-pane label="入库" name="9"></el-tab-pane> -->
  98. </el-tabs>
  99. <ele-pro-table
  100. :columns="columns"
  101. :datasource="datasource"
  102. :key="activeName"
  103. :cache-key="`produceDetal${activeName}`"
  104. :initLoad="false"
  105. ref="table"
  106. >
  107. <template v-slot:toolbar>
  108. <div class="tips-box">
  109. <ul
  110. v-if="
  111. chooseItem == '挤压成型' ||
  112. chooseItem.includes('模压') ||
  113. chooseItem.includes('挤压') ||
  114. (chooseItem.includes('等静压') && activeName == 0)
  115. "
  116. >
  117. <li>
  118. <span class="label">累计合格品数量</span>
  119. {{ countMsg.standardTotalNum }}PCS
  120. </li>
  121. <li>
  122. <span class="label">累计合格品重量</span>
  123. {{ countMsg.standardTotalWeight }}KG
  124. </li>
  125. <li>
  126. <span class="label">累计投料重量</span>
  127. {{ countMsg.feedMaterielWeight }}KG
  128. </li>
  129. </ul>
  130. <ul
  131. v-else-if="
  132. ['自然干燥', '升温干燥', '半加定长'].includes(chooseItem) ||
  133. chooseItem.includes('半加')
  134. "
  135. >
  136. <li>
  137. <span class="label">累计合格品数量</span>
  138. {{ countMsg.standardTotalNum }}PCS
  139. </li>
  140. <li>
  141. <span class="label">累计合格品重量</span>
  142. {{ countMsg.standardTotalWeight }}KG
  143. </li>
  144. <li>
  145. <span class="label">累计投料产品重量</span>
  146. {{ countMsg.feedProductWeight }}KG
  147. </li>
  148. </ul>
  149. <ul v-else-if="['备炉'].includes(chooseItem)">
  150. <li>
  151. <span class="label">累计交接数量</span>
  152. {{ countMsg.joinTotalNum }}PCS
  153. </li>
  154. <li>
  155. <span class="label">累计实际数量</span>
  156. {{ countMsg.joinTotalNum }}PCS
  157. </li>
  158. </ul>
  159. <ul v-else-if="['烧结', '质检'].includes(chooseItem)">
  160. <li>
  161. <span class="label">累计合格品数量</span>
  162. {{ countMsg.standardTotalNum }}PCS
  163. </li>
  164. <li>
  165. <span class="label">累计合格品重量</span>
  166. {{ countMsg.standardTotalWeight }}KG
  167. </li>
  168. <li>
  169. <span class="label">累计投料数量</span>
  170. {{ countMsg.joinTotalNum }}PCS
  171. </li>
  172. </ul>
  173. <ul v-else-if="['包装'].includes(chooseItem)">
  174. <li>
  175. <span class="label">累计交接数量</span>
  176. {{ countMsg.joinTotalNum }}PCS
  177. </li>
  178. <li>
  179. <span class="label">累计实际数量</span>
  180. {{ countMsg.joinTotalNum }}PCS
  181. </li>
  182. <li>
  183. <span class="label">累计包装数量</span>
  184. {{ countMsg.packTotalNum }}PCS
  185. </li>
  186. <li>
  187. <span class="label">累计包装产品数量</span>
  188. {{ countMsg.packProductTotalNum }}PCS
  189. </li>
  190. </ul>
  191. <ul v-else-if="['入库'].includes(chooseItem)">
  192. <li>
  193. <span class="label">累计交接数量</span>
  194. {{ countMsg.joinTotalNum }}PCS
  195. </li>
  196. <li>
  197. <span class="label">累计批次数量</span>
  198. {{ countMsg.inStoreBatchNum }}PCS
  199. </li>
  200. <li>
  201. <span class="label">累计产品数量</span>
  202. {{ countMsg.joinTotalNum }}PCS
  203. </li>
  204. </ul>
  205. <ul v-else>
  206. <li>
  207. <span class="label">累计合格品数量</span>
  208. {{ countMsg.standardTotalNum }}PCS
  209. </li>
  210. <li>
  211. <span class="label">累计合格品重量</span>
  212. {{ countMsg.standardTotalWeight }}KG
  213. </li>
  214. <li>
  215. <span class="label">累计投料数量</span>
  216. {{ countMsg.joinTotalNum }}PCS
  217. </li>
  218. </ul>
  219. <!-- <el-link type="primary" v-if="activeName == 1" @click="openOther"
  220. >其他任务记录</el-link
  221. > -->
  222. </div>
  223. </template>
  224. <template v-slot:bom="{ row }">
  225. <el-link type="primary" @click="check(row)">查看</el-link>
  226. </template>
  227. <template v-slot:action="{ row }">
  228. <el-link type="primary" @click="writeOff(row)">冲销</el-link>
  229. </template>
  230. </ele-pro-table>
  231. </el-card>
  232. <otherMission ref="otherMissionRef" />
  233. <bomList ref="bomListRef" />
  234. <OrderPrint
  235. ref="orderPrintRef"
  236. :workOrderId="workOrderId"
  237. :infoData="infoData"
  238. :processList="tabList"
  239. />
  240. </div>
  241. </template>
  242. <script>
  243. import progressBox from './components/progressBox';
  244. import otherMission from './components/otherMission';
  245. import OrderPrint from '@/components/print/OrderPrint';
  246. import bomList from './components/bomList';
  247. import dictMixins from '@/mixins/dictMixins';
  248. import {
  249. reportPage,
  250. getInfoById,
  251. reportCount,
  252. writeOffWork
  253. } from '@/api/produceOrder/index.js';
  254. export default {
  255. mixins: [dictMixins],
  256. components: {
  257. OrderPrint,
  258. otherMission,
  259. progressBox,
  260. bomList
  261. },
  262. data() {
  263. return {
  264. infoData: {},
  265. descriptionsShow: true,
  266. activeName: '0',
  267. tabList: [],
  268. columnOpt: {
  269. 挤压成型: [
  270. {
  271. label: '序号',
  272. type: 'index',
  273. width: 55,
  274. align: 'center'
  275. },
  276. {
  277. label: '投料时间',
  278. prop: 'feedingTime',
  279. minWidth: 100,
  280. align: 'center'
  281. },
  282. {
  283. label: '投料重量',
  284. prop: 'feedingWeight',
  285. minWidth: 100,
  286. align: 'center'
  287. },
  288. {
  289. label: '投料执行人',
  290. prop: 'feedingOperator',
  291. minWidth: 100,
  292. align: 'center'
  293. },
  294. {
  295. label: '设备编码',
  296. prop: 'deviceCode',
  297. minWidth: 100,
  298. align: 'center'
  299. },
  300. {
  301. label: '设备名称',
  302. prop: 'deviceName',
  303. minWidth: 100,
  304. align: 'center'
  305. },
  306. {
  307. label: '报工时间',
  308. prop: 'reportWorkTime',
  309. minWidth: 100,
  310. align: 'center'
  311. },
  312. {
  313. label: '报工执行人',
  314. prop: 'reportingOperator',
  315. minWidth: 100,
  316. align: 'center'
  317. },
  318. // {
  319. // label: '周转车编码',
  320. // prop: 'transferCarCode'
  321. // },
  322. {
  323. label: '合格品数量',
  324. prop: 'standardNum',
  325. minWidth: 100,
  326. align: 'center'
  327. },
  328. {
  329. label: '合格品重量',
  330. prop: 'standardWeight',
  331. minWidth: 100,
  332. align: 'center'
  333. },
  334. {
  335. label: '不合格品数量',
  336. prop: 'noStandardNum',
  337. minWidth: 120,
  338. align: 'center'
  339. },
  340. {
  341. label: '不合格品重量',
  342. prop: 'noStandardWeight',
  343. minWidth: 120,
  344. align: 'center'
  345. },
  346. {
  347. label: '副产品重量',
  348. prop: 'secondaryProductWeight',
  349. minWidth: 100,
  350. align: 'center'
  351. },
  352. {
  353. label: '操作',
  354. slot: 'action'
  355. }
  356. ],
  357. 自然干燥: [
  358. {
  359. label: '序号',
  360. type: 'index',
  361. width: 55,
  362. align: 'center'
  363. },
  364. {
  365. label: '投料时间',
  366. prop: 'feedingTime',
  367. minWidth: 100,
  368. align: 'center'
  369. },
  370. {
  371. label: '投料执行人',
  372. prop: 'feedingOperator',
  373. minWidth: 100,
  374. align: 'center'
  375. },
  376. {
  377. label: '产品数量',
  378. prop: 'productNum',
  379. minWidth: 100,
  380. align: 'center'
  381. },
  382. // {
  383. // label: '周转车编码',
  384. // prop: 'transferCarCode'
  385. // },
  386. {
  387. label: '区域编码',
  388. prop: 'areaCode',
  389. minWidth: 100,
  390. align: 'center'
  391. },
  392. {
  393. label: '干燥时长',
  394. prop: 'dryingDuration',
  395. minWidth: 100,
  396. align: 'center'
  397. },
  398. {
  399. label: '报工时间',
  400. prop: 'reportWorkTime',
  401. minWidth: 100,
  402. align: 'center'
  403. },
  404. {
  405. label: '报工执行人',
  406. prop: 'reportingOperator',
  407. minWidth: 100,
  408. align: 'center'
  409. },
  410. {
  411. label: '合格品数量',
  412. prop: 'standardNum',
  413. minWidth: 100,
  414. align: 'center'
  415. },
  416. {
  417. label: '合格品重量',
  418. prop: 'standardWeight',
  419. minWidth: 100,
  420. align: 'center'
  421. },
  422. {
  423. label: '不合格品数量',
  424. prop: 'noStandardNum',
  425. minWidth: 100,
  426. align: 'center'
  427. },
  428. {
  429. label: '不合格品重量',
  430. prop: 'noStandardWeight',
  431. minWidth: 100,
  432. align: 'center'
  433. },
  434. {
  435. label: '副产品重量',
  436. prop: 'secondaryProductWeight',
  437. minWidth: 100,
  438. align: 'center'
  439. },
  440. {
  441. label: '操作',
  442. slot: 'action'
  443. }
  444. ],
  445. 升温干燥: [
  446. {
  447. label: '序号',
  448. type: 'index',
  449. width: 55,
  450. align: 'center'
  451. },
  452. {
  453. label: '投料时间',
  454. prop: 'feedingTime',
  455. minWidth: 100,
  456. align: 'center'
  457. },
  458. {
  459. label: '投料执行人',
  460. prop: 'feedingOperator',
  461. minWidth: 100,
  462. align: 'center'
  463. },
  464. {
  465. label: '产品数量',
  466. prop: 'productNum',
  467. minWidth: 100,
  468. align: 'center'
  469. },
  470. // {
  471. // label: '周转车编码',
  472. // prop: 'transferCarCode'
  473. // },
  474. {
  475. label: '设备编码',
  476. prop: 'deviceCode',
  477. minWidth: 100,
  478. align: 'center'
  479. },
  480. {
  481. label: '设备名称',
  482. prop: 'deviceName',
  483. minWidth: 100,
  484. align: 'center'
  485. },
  486. {
  487. label: '升温曲线',
  488. prop: 'temperatureRamp',
  489. minWidth: 100,
  490. align: 'center'
  491. },
  492. {
  493. label: '报工时间',
  494. prop: 'reportWorkTime',
  495. minWidth: 100,
  496. align: 'center'
  497. },
  498. {
  499. label: '报工执行人',
  500. prop: 'reportingOperator',
  501. minWidth: 100,
  502. align: 'center'
  503. },
  504. {
  505. label: '合格品数量',
  506. prop: 'standardNum',
  507. minWidth: 100,
  508. align: 'center'
  509. },
  510. {
  511. label: '合格品重量',
  512. prop: 'standardWeight',
  513. minWidth: 100,
  514. align: 'center'
  515. },
  516. {
  517. label: '不合格品数量',
  518. prop: 'noStandardNum',
  519. minWidth: 100,
  520. align: 'center'
  521. },
  522. {
  523. label: '不合格品重量',
  524. prop: 'noStandardWeight',
  525. minWidth: 100,
  526. align: 'center'
  527. },
  528. {
  529. label: '副产品重量',
  530. prop: 'secondaryProductWeight',
  531. minWidth: 100,
  532. align: 'center'
  533. },
  534. {
  535. label: '操作',
  536. slot: 'action'
  537. }
  538. ],
  539. 半加定长: [
  540. {
  541. label: '序号',
  542. type: 'index',
  543. width: 55,
  544. align: 'center'
  545. },
  546. {
  547. label: '投料时间',
  548. prop: 'feedingTime',
  549. minWidth: 100,
  550. align: 'center'
  551. },
  552. {
  553. label: '投料执行人',
  554. prop: 'feedingOperator',
  555. minWidth: 100,
  556. align: 'center'
  557. },
  558. {
  559. label: '产品数量',
  560. prop: 'productNum',
  561. minWidth: 100,
  562. align: 'center'
  563. },
  564. // {
  565. // label: '周转车编码',
  566. // prop: 'transferCarCode'
  567. // },
  568. {
  569. label: '设备编码',
  570. prop: 'deviceCode',
  571. minWidth: 100,
  572. align: 'center'
  573. },
  574. {
  575. label: '设备名称',
  576. prop: 'deviceName',
  577. minWidth: 100,
  578. align: 'center'
  579. },
  580. {
  581. label: '报工时间',
  582. prop: 'reportWorkTime',
  583. minWidth: 100,
  584. align: 'center'
  585. },
  586. {
  587. label: '报工执行人',
  588. prop: 'reportingOperator',
  589. minWidth: 100,
  590. align: 'center'
  591. },
  592. {
  593. label: '合格品数量',
  594. prop: 'standardNum',
  595. minWidth: 100,
  596. align: 'center'
  597. },
  598. {
  599. label: '合格品重量',
  600. prop: 'standardWeight',
  601. minWidth: 100,
  602. align: 'center'
  603. },
  604. {
  605. label: '不合格品数量',
  606. prop: 'noStandardNum',
  607. minWidth: 100,
  608. align: 'center'
  609. },
  610. {
  611. label: '不合格品重量',
  612. prop: 'noStandardWeight',
  613. minWidth: 100,
  614. align: 'center'
  615. },
  616. {
  617. label: '副产品重量',
  618. prop: 'secondaryProductWeight',
  619. minWidth: 100,
  620. align: 'center'
  621. },
  622. {
  623. label: '操作',
  624. slot: 'action'
  625. }
  626. ],
  627. 备炉: [
  628. {
  629. label: '序号',
  630. type: 'index',
  631. width: 55,
  632. align: 'center'
  633. },
  634. {
  635. label: '交接时间',
  636. prop: 'handoverTime',
  637. minWidth: 100,
  638. align: 'center'
  639. },
  640. {
  641. label: '交接执行人',
  642. prop: 'handoverOperator',
  643. minWidth: 100,
  644. align: 'center'
  645. },
  646. // {
  647. // label: '交接数量',
  648. // prop: 'handoverQuantity',
  649. // minWidth: 100,
  650. // align: 'center'
  651. // },
  652. {
  653. label: '实际数量',
  654. prop: 'billOfMaterials',
  655. minWidth: 100,
  656. align: 'center'
  657. },
  658. {
  659. label: '执行时间',
  660. prop: 'executionTime',
  661. minWidth: 100,
  662. align: 'center'
  663. },
  664. {
  665. label: '执行人',
  666. prop: 'executor',
  667. minWidth: 100,
  668. align: 'center'
  669. },
  670. {
  671. label: '设备编码',
  672. prop: 'deviceCode',
  673. minWidth: 100,
  674. align: 'center'
  675. },
  676. {
  677. label: '设备名称',
  678. prop: 'deviceName',
  679. minWidth: 100,
  680. align: 'center'
  681. },
  682. {
  683. label: '烧结曲线',
  684. prop: 'sinteringCurve',
  685. minWidth: 100,
  686. align: 'center'
  687. },
  688. {
  689. label: '操作',
  690. slot: 'action'
  691. }
  692. ],
  693. 烧结: [
  694. {
  695. label: '序号',
  696. type: 'index',
  697. width: 55,
  698. align: 'center'
  699. },
  700. {
  701. label: '报工时间',
  702. prop: 'reportWorkTime',
  703. minWidth: 100,
  704. align: 'center'
  705. },
  706. {
  707. label: '报工执行人',
  708. prop: 'reportingOperator',
  709. minWidth: 100,
  710. align: 'center'
  711. },
  712. {
  713. label: '合格品数量',
  714. prop: 'standardNum',
  715. minWidth: 100,
  716. align: 'center'
  717. },
  718. {
  719. label: '合格品重量',
  720. prop: 'standardWeight',
  721. minWidth: 100,
  722. align: 'center'
  723. },
  724. {
  725. label: '不合格品数量',
  726. prop: 'noStandardNum',
  727. minWidth: 100,
  728. align: 'center'
  729. },
  730. {
  731. label: '不合格品重量',
  732. prop: 'noStandardWeight',
  733. minWidth: 100,
  734. align: 'center'
  735. },
  736. {
  737. label: '副产品重量',
  738. prop: 'secondaryProductWeight',
  739. minWidth: 100,
  740. align: 'center'
  741. },
  742. {
  743. label: '操作',
  744. slot: 'action'
  745. }
  746. ],
  747. 质检: [
  748. {
  749. label: '序号',
  750. type: 'index',
  751. width: 55,
  752. align: 'center'
  753. },
  754. {
  755. label: '报工时间',
  756. prop: 'reportWorkTime',
  757. minWidth: 100,
  758. align: 'center'
  759. },
  760. {
  761. label: '报工执行人',
  762. prop: 'reportingOperator',
  763. minWidth: 100,
  764. align: 'center'
  765. },
  766. {
  767. label: '合格品数量',
  768. prop: 'standardNum',
  769. minWidth: 100,
  770. align: 'center'
  771. },
  772. {
  773. label: '合格品重量',
  774. prop: 'standardWeight',
  775. minWidth: 100,
  776. align: 'center'
  777. },
  778. {
  779. label: '不合格品数量',
  780. prop: 'noStandardNum',
  781. minWidth: 100,
  782. align: 'center'
  783. },
  784. {
  785. label: '不合格品重量',
  786. prop: 'noStandardWeight',
  787. minWidth: 100,
  788. align: 'center'
  789. },
  790. {
  791. label: '副产品重量',
  792. prop: 'secondaryProductWeight',
  793. minWidth: 100,
  794. align: 'center'
  795. },
  796. {
  797. label: '操作',
  798. slot: 'action'
  799. }
  800. ],
  801. 深加工: [
  802. {
  803. label: '序号',
  804. type: 'index',
  805. width: 55,
  806. align: 'center'
  807. },
  808. {
  809. label: '交接时间',
  810. prop: 'handoverTime',
  811. minWidth: 100,
  812. align: 'center'
  813. },
  814. {
  815. label: '交接执行人',
  816. prop: 'handoverOperator',
  817. minWidth: 120,
  818. align: 'center'
  819. },
  820. // {
  821. // label: '交接数量',
  822. // prop: 'handoverQuantity'
  823. // },
  824. // {
  825. // label: '实际数量',
  826. // prop: 'billOfMaterials'
  827. // },
  828. {
  829. label: '投料时间',
  830. prop: 'feedingTime',
  831. minWidth: 100,
  832. align: 'center'
  833. },
  834. {
  835. label: '投料执行人',
  836. prop: 'feedingOperator',
  837. minWidth: 100,
  838. align: 'center'
  839. },
  840. {
  841. label: '设备编码',
  842. prop: 'deviceCode',
  843. minWidth: 100,
  844. align: 'center'
  845. },
  846. {
  847. label: '设备名称',
  848. prop: 'deviceName',
  849. minWidth: 100,
  850. align: 'center'
  851. },
  852. {
  853. label: '报工时间',
  854. prop: 'reportWorkTime',
  855. minWidth: 100,
  856. align: 'center'
  857. },
  858. {
  859. label: '报工执行人',
  860. prop: 'reportingOperator',
  861. minWidth: 100,
  862. align: 'center'
  863. },
  864. {
  865. label: '合格品数量',
  866. prop: 'standardNum',
  867. minWidth: 100,
  868. align: 'center'
  869. },
  870. {
  871. label: '合格品重量',
  872. prop: 'standardWeight',
  873. minWidth: 100,
  874. align: 'center'
  875. },
  876. {
  877. label: '不合格品数量',
  878. prop: 'noStandardNum',
  879. minWidth: 120,
  880. align: 'center'
  881. },
  882. {
  883. label: '不合格品重量',
  884. prop: 'noStandardWeight',
  885. minWidth: 120,
  886. align: 'center'
  887. },
  888. {
  889. label: '副产品重量',
  890. prop: 'secondaryProductWeight',
  891. minWidth: 100,
  892. align: 'center'
  893. },
  894. {
  895. label: '操作',
  896. slot: 'action'
  897. }
  898. ],
  899. 包装: [
  900. {
  901. label: '序号',
  902. type: 'index',
  903. width: 55,
  904. align: 'center'
  905. },
  906. {
  907. label: '交接时间',
  908. prop: 'handoverTime',
  909. minWidth: 100,
  910. align: 'center'
  911. },
  912. {
  913. label: '交接执行人',
  914. prop: 'handoverOperator',
  915. minWidth: 100,
  916. align: 'center'
  917. },
  918. // {
  919. // label: '交接数量',
  920. // prop: 'handoverQuantity',
  921. // minWidth: 100,
  922. // align: 'center'
  923. // },
  924. {
  925. label: '实际数量',
  926. prop: 'billOfMaterials',
  927. minWidth: 100,
  928. align: 'center'
  929. },
  930. {
  931. label: '报工时间',
  932. prop: 'reportWorkTime',
  933. minWidth: 100,
  934. align: 'center'
  935. },
  936. {
  937. label: '报工执行人',
  938. prop: 'reportingOperator',
  939. minWidth: 100,
  940. align: 'center'
  941. },
  942. {
  943. label: '包装数量',
  944. prop: 'packNum',
  945. minWidth: 100,
  946. align: 'center'
  947. },
  948. {
  949. label: '包装产品数量',
  950. prop: 'packagedProductQuantity',
  951. minWidth: 100,
  952. align: 'center'
  953. },
  954. {
  955. label: '尾料数量',
  956. prop: 'surplusNum',
  957. minWidth: 100,
  958. align: 'center'
  959. },
  960. {
  961. label: '物料清单',
  962. prop: 'materialList',
  963. minWidth: 100,
  964. align: 'center',
  965. slot: 'bom'
  966. },
  967. {
  968. label: '操作',
  969. slot: 'action'
  970. }
  971. ],
  972. 入库: [
  973. {
  974. label: '序号',
  975. type: 'index',
  976. width: 55,
  977. align: 'center'
  978. },
  979. {
  980. label: '交接时间',
  981. prop: 'handoverTime',
  982. minWidth: 100,
  983. align: 'center'
  984. },
  985. {
  986. label: '交接执行人',
  987. prop: 'handoverOperator',
  988. minWidth: 100,
  989. align: 'center'
  990. },
  991. // {
  992. // label: '交接数量',
  993. // prop: 'handoverQuantity',
  994. // minWidth: 100,
  995. // align: 'center'
  996. // },
  997. {
  998. label: '实际数量',
  999. prop: 'billOfMaterials',
  1000. minWidth: 100,
  1001. align: 'center'
  1002. },
  1003. {
  1004. label: '报工时间',
  1005. prop: 'reportWorkTime',
  1006. minWidth: 100,
  1007. align: 'center'
  1008. },
  1009. {
  1010. label: '报工执行人',
  1011. prop: 'reportingOperator',
  1012. minWidth: 100,
  1013. align: 'center'
  1014. },
  1015. {
  1016. label: '批次数量',
  1017. prop: 'batchQuantity',
  1018. minWidth: 100,
  1019. align: 'center'
  1020. },
  1021. {
  1022. label: '入库数量',
  1023. prop: 'inboundQuantity',
  1024. minWidth: 100,
  1025. align: 'center'
  1026. },
  1027. {
  1028. label: '交货仓库',
  1029. prop: 'storageCode',
  1030. minWidth: 100,
  1031. align: 'center',
  1032. formatter: (_row, _column, cellValue) => {
  1033. return this.getDictValue('仓库', _row.storageCode);
  1034. }
  1035. },
  1036. {
  1037. label: '操作',
  1038. slot: 'action'
  1039. }
  1040. ]
  1041. },
  1042. workOrderId: '',
  1043. taskCode: '',
  1044. typeList: {
  1045. 1: '内销订单',
  1046. 2: '外销订单',
  1047. 3: '预制订单'
  1048. },
  1049. statusList: {
  1050. 4: '待生产',
  1051. 5: '生产中',
  1052. 6: '已完成',
  1053. 7: '已延期'
  1054. },
  1055. countMsg: {},
  1056. chooseIndex: 0,
  1057. chooseItem: '',
  1058. request: {
  1059. isLast: 0,
  1060. nextCompleteNum: 0,
  1061. completeNum: 0
  1062. }
  1063. };
  1064. },
  1065. created() {
  1066. this.workOrderId = this.$route.params.id;
  1067. this.getInfo(this.workOrderId);
  1068. this.requestDict('仓库');
  1069. },
  1070. computed: {
  1071. columns() {
  1072. const { taskTypeName: name } = this.tabList[this.activeName];
  1073. if (name.includes('半加')) {
  1074. return this.columnOpt['半加定长'];
  1075. }
  1076. if (
  1077. (name.includes('模压') ||
  1078. name.includes('挤压') ||
  1079. name.includes('等静压')) &&
  1080. this.activeName == 0
  1081. ) {
  1082. return this.columnOpt['挤压成型'];
  1083. }
  1084. return (
  1085. this.columnOpt[this.tabList[this.activeName].taskTypeName] ||
  1086. this.columnOpt['深加工']
  1087. );
  1088. }
  1089. },
  1090. methods: {
  1091. handlePrint() {
  1092. this.$refs.orderPrintRef.open();
  1093. },
  1094. handleTabClick(tab) {
  1095. if (this.chooseIndex != tab.index) {
  1096. this.chooseIndex = Number(tab.index);
  1097. const chooseItem = this.tabList[this.chooseIndex];
  1098. this.chooseItem = this.tabList[this.chooseIndex].taskTypeName;
  1099. this.activeName = tab.index;
  1100. this.taskCode = chooseItem.taskCode || '';
  1101. this.reload({
  1102. workOrderId: this.workOrderId,
  1103. taskCode: this.taskCode
  1104. });
  1105. this.getReportCount();
  1106. this.setData();
  1107. }
  1108. },
  1109. setData() {
  1110. this.request.completeNum = this.tabList[this.chooseIndex].number;
  1111. if (this.chooseIndex == this.tabList.length - 1) {
  1112. this.request.isLast = 1;
  1113. } else {
  1114. this.request.isLast = 0;
  1115. this.request.nextCompleteNum =
  1116. this.tabList[this.chooseIndex + 1].number;
  1117. }
  1118. },
  1119. async datasource({ page, limit, where }) {
  1120. const res = await reportPage({ ...where, pageNum: page, size: limit });
  1121. if (typeof res.list == 'string') {
  1122. res.list = [];
  1123. }
  1124. return res;
  1125. },
  1126. /* 刷新表格 */
  1127. reload(where) {
  1128. this.$nextTick(() =>
  1129. this.$refs.table.reload({ page: 1, limit: 10, where })
  1130. );
  1131. },
  1132. async getInfo(id) {
  1133. const res = await getInfoById(id);
  1134. this.infoData = res;
  1135. if (typeof res.taskTypeProcessDiagrams == 'string') {
  1136. this.tabList = [];
  1137. } else {
  1138. const list = res.taskTypeProcessDiagrams.filter(
  1139. (i) => !i.taskTypeName?.includes('工具')
  1140. );
  1141. const index = list.findIndex((i) =>
  1142. i.taskTypeName.includes('挤压干燥')
  1143. );
  1144. if (index > -1) {
  1145. list[index].taskTypeName = '升温干燥';
  1146. }
  1147. this.tabList = list;
  1148. }
  1149. // this.activeName = this.tabList[0]?.taskTypeName || ''
  1150. this.chooseItem = this.tabList[0]?.taskTypeName;
  1151. this.activeName = 0;
  1152. this.taskCode = this.tabList[0]?.taskCode || '';
  1153. this.chooseIndex = 0;
  1154. this.reload({ workOrderId: this.workOrderId, taskCode: this.taskCode });
  1155. this.getReportCount();
  1156. this.setData();
  1157. },
  1158. async getReportCount() {
  1159. const index = this.tabList.findIndex(
  1160. (item) => item.taskCode === this.taskCode
  1161. );
  1162. let lastTaskCode = this.taskCode;
  1163. if (index > 0) {
  1164. lastTaskCode = this.tabList[index - 1].taskCode;
  1165. }
  1166. const res = await reportCount({
  1167. lastTaskCode,
  1168. taskCode: this.taskCode,
  1169. workOrderId: this.workOrderId
  1170. });
  1171. this.countMsg = res;
  1172. },
  1173. openOther() {
  1174. this.$refs.otherMissionRef.open();
  1175. },
  1176. // 冲销
  1177. writeOff(row) {
  1178. const h = this.$createElement;
  1179. this.$confirm('', {
  1180. message: h('div', null, [
  1181. h('i', {
  1182. class: 'el-icon-question',
  1183. style: 'color:#f90;font-size:30px;'
  1184. }),
  1185. h(
  1186. 'span',
  1187. {
  1188. style:
  1189. 'margin-left:10px;font-size:16px;line-height:30px;font-weight:600;vertical-align:top;'
  1190. },
  1191. '提示'
  1192. ),
  1193. h(
  1194. 'p',
  1195. { style: 'margin:10px 0 0 40px;color:red' },
  1196. '是否要撤销本次报工?'
  1197. )
  1198. ]),
  1199. confirmButtonText: '确定',
  1200. cancelButtonText: '取消'
  1201. })
  1202. .then(() => {
  1203. const data = {
  1204. taskCode: this.taskCode,
  1205. taskName: this.chooseItem,
  1206. reportId: row.id,
  1207. writeOffNum: row.standardNum
  1208. ? row.standardNum
  1209. : row.actualQuantity,
  1210. ...this.request
  1211. };
  1212. writeOffWork(data).then((res) => {
  1213. if (res == 1) {
  1214. this.$message.success('冲销成功');
  1215. this.reload({
  1216. workOrderId: this.workOrderId,
  1217. taskCode: this.taskCode
  1218. });
  1219. this.refreshData();
  1220. } else if (res == 0) {
  1221. this.$confirm('', {
  1222. message: h('div', null, [
  1223. h('i', {
  1224. class: 'el-icon-question',
  1225. style: 'color:#f90;font-size:30px;'
  1226. }),
  1227. h(
  1228. 'span',
  1229. {
  1230. style:
  1231. 'margin-left:10px;font-size:16px;line-height:30px;font-weight:600;vertical-align:top;color:red'
  1232. },
  1233. '冲销失败'
  1234. ),
  1235. h(
  1236. 'p',
  1237. { style: 'margin:10px 0 0 40px' },
  1238. '冲销后的总数不可小于下道工序的总数'
  1239. )
  1240. ]),
  1241. confirmButtonText: '确定',
  1242. showCancelButton: false
  1243. })
  1244. .then(() => {})
  1245. .catch(() => {});
  1246. } else {
  1247. this.$message.error('接口异常');
  1248. }
  1249. });
  1250. })
  1251. .catch(() => {});
  1252. },
  1253. check(row) {
  1254. this.$refs.bomListRef.open(row);
  1255. },
  1256. async refreshData() {
  1257. this.getReportCount();
  1258. const res = await getInfoById(this.workOrderId);
  1259. this.infoData = res;
  1260. if (typeof res.taskTypeProcessDiagrams == 'string') {
  1261. this.tabList = [];
  1262. } else {
  1263. this.tabList = res.taskTypeProcessDiagrams;
  1264. }
  1265. this.setData();
  1266. }
  1267. }
  1268. };
  1269. </script>
  1270. <style lang="scss" scoped>
  1271. .el-tabs {
  1272. margin-top: 20px;
  1273. }
  1274. .tips-box {
  1275. display: flex;
  1276. justify-content: space-between;
  1277. align-items: center;
  1278. padding-right: 20px;
  1279. ul {
  1280. list-style: none;
  1281. display: flex;
  1282. justify-content: flex-start;
  1283. li {
  1284. margin-right: 40px;
  1285. }
  1286. }
  1287. }
  1288. </style>