detail.vue 36 KB

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