detail.vue 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292
  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 }}PCS
  124. </li>
  125. <li>
  126. <span class="label">累计投料重量</span>
  127. {{ countMsg.feedMaterielWeight }}PCS
  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 }}PCS
  143. </li>
  144. <li>
  145. <span class="label">累计投料产品重量</span>
  146. {{ countMsg.feedProductWeight }}PCS
  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 }}PCS
  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 }}PCS
  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 res = await reportCount({
  1160. taskCode: this.taskCode,
  1161. workOrderId: this.workOrderId
  1162. });
  1163. this.countMsg = res;
  1164. },
  1165. openOther() {
  1166. this.$refs.otherMissionRef.open();
  1167. },
  1168. // 冲销
  1169. writeOff(row) {
  1170. const h = this.$createElement;
  1171. this.$confirm('', {
  1172. message: h('div', null, [
  1173. h('i', {
  1174. class: 'el-icon-question',
  1175. style: 'color:#f90;font-size:30px;'
  1176. }),
  1177. h(
  1178. 'span',
  1179. {
  1180. style:
  1181. 'margin-left:10px;font-size:16px;line-height:30px;font-weight:600;vertical-align:top;'
  1182. },
  1183. '提示'
  1184. ),
  1185. h(
  1186. 'p',
  1187. { style: 'margin:10px 0 0 40px;color:red' },
  1188. '是否要撤销本次报工?'
  1189. )
  1190. ]),
  1191. confirmButtonText: '确定',
  1192. cancelButtonText: '取消'
  1193. })
  1194. .then(() => {
  1195. const data = {
  1196. taskCode: this.taskCode,
  1197. taskName: this.chooseItem,
  1198. reportId: row.id,
  1199. writeOffNum: row.standardNum
  1200. ? row.standardNum
  1201. : row.actualQuantity,
  1202. ...this.request
  1203. };
  1204. writeOffWork(data).then((res) => {
  1205. if (res == 1) {
  1206. this.$message.success('冲销成功');
  1207. this.reload({
  1208. workOrderId: this.workOrderId,
  1209. taskCode: this.taskCode
  1210. });
  1211. this.refreshData();
  1212. } else if (res == 0) {
  1213. this.$confirm('', {
  1214. message: h('div', null, [
  1215. h('i', {
  1216. class: 'el-icon-question',
  1217. style: 'color:#f90;font-size:30px;'
  1218. }),
  1219. h(
  1220. 'span',
  1221. {
  1222. style:
  1223. 'margin-left:10px;font-size:16px;line-height:30px;font-weight:600;vertical-align:top;color:red'
  1224. },
  1225. '冲销失败'
  1226. ),
  1227. h(
  1228. 'p',
  1229. { style: 'margin:10px 0 0 40px' },
  1230. '冲销后的总数不可小于下道工序的总数'
  1231. )
  1232. ]),
  1233. confirmButtonText: '确定',
  1234. showCancelButton: false
  1235. })
  1236. .then(() => {})
  1237. .catch(() => {});
  1238. } else {
  1239. this.$message.error('接口异常');
  1240. }
  1241. });
  1242. })
  1243. .catch(() => {});
  1244. },
  1245. check(row) {
  1246. this.$refs.bomListRef.open(row);
  1247. },
  1248. async refreshData() {
  1249. this.getReportCount();
  1250. const res = await getInfoById(this.workOrderId);
  1251. this.infoData = res;
  1252. if (typeof res.taskTypeProcessDiagrams == 'string') {
  1253. this.tabList = [];
  1254. } else {
  1255. this.tabList = res.taskTypeProcessDiagrams;
  1256. }
  1257. this.setData();
  1258. }
  1259. }
  1260. };
  1261. </script>
  1262. <style lang="scss" scoped>
  1263. .el-tabs {
  1264. margin-top: 20px;
  1265. }
  1266. .tips-box {
  1267. display: flex;
  1268. justify-content: space-between;
  1269. align-items: center;
  1270. padding-right: 20px;
  1271. ul {
  1272. list-style: none;
  1273. display: flex;
  1274. justify-content: flex-start;
  1275. li {
  1276. margin-right: 40px;
  1277. }
  1278. }
  1279. }
  1280. </style>