detail.vue 37 KB

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