detail.vue 30 KB

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