OrderPrint.vue 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268
  1. <template>
  2. <ele-modal :visible.sync="visible" type="工单打印" width="1200px" :close-on-click-modal="false">
  3. <div class="print-container" ref="pagesRef">
  4. <el-row class="main-data">
  5. <el-col :span="6">
  6. <div class="bg"> 生产工单号 </div>
  7. <div class="code">条码区</div>
  8. <div class="value">{{ infoData.code }}</div>
  9. </el-col>
  10. <el-col :span="5">
  11. <div class="bg">生产版本</div>
  12. <div class="value">{{ infoData.produceVersionName }}</div>
  13. <div class="bg">物料编码</div>
  14. <div class="value">{{ infoData.productCode }}</div>
  15. </el-col>
  16. <el-col :span="5">
  17. <div class="bg">计划编号</div>
  18. <div class="value">{{ infoData.productionPlanCode }}</div>
  19. <div class="bg">产品名称</div>
  20. <div class="value">{{ infoData.productName }}</div>
  21. </el-col>
  22. <el-col :span="4">
  23. <div class="bg">计划类型</div>
  24. <div class="value">{{ typeList[infoData.planType] }}</div>
  25. <div class="bg">要求生产数量</div>
  26. <div class="value">{{ infoData.formingNum }}PCS</div>
  27. </el-col>
  28. <el-col :span="4">
  29. <div class="bg">工单状态</div>
  30. <div class="value">{{ statusList[infoData.status] }}</div>
  31. <div class="bg">要求生产重量</div>
  32. <div class="value">{{ infoData.formingWeight }}KG</div>
  33. </el-col>
  34. </el-row>
  35. <template v-for="(item, index) in processList">
  36. <el-row
  37. class="processes-data"
  38. :key="index"
  39. v-if="item.taskTypeName === '挤压生产'"
  40. >
  41. <el-col :span="24" class="bg top">
  42. <div class="title">{{ index + 1 }}0 挤压生产</div>
  43. </el-col>
  44. <!-- <el-col :span="10" class="bg top">备注:</el-col> -->
  45. <template v-for="(itm, idx) in item.list || []">
  46. <el-col
  47. :span="t.span"
  48. class="border-dashed-right border-dashed-bottom"
  49. v-for="(t, i) in extrusion"
  50. :key="i + '-' + idx"
  51. >
  52. {{ t.label }}:{{
  53. (t.formatter && t.formatter(itm)) || itm[t.key]
  54. }}
  55. </el-col>
  56. </template>
  57. <el-col :span="24" v-if="!(item.list && item.list.length)">
  58. <div class="no-data">暂无数据</div>
  59. </el-col>
  60. </el-row>
  61. <el-row
  62. class="processes-data"
  63. :key="index"
  64. v-else-if="item.taskTypeName === '自然干燥'"
  65. >
  66. <el-col :span="24" class="bg top">
  67. <div class="title">{{ index + 1 }}0 自然干燥</div>
  68. </el-col>
  69. <!-- <el-col :span="10" class="bg top">备注:</el-col> -->
  70. <template v-for="(itm, idx) in item.list || []">
  71. <el-col
  72. :span="t.span"
  73. class="border-dashed-right border-dashed-bottom"
  74. v-for="(t, i) in drying"
  75. :key="i + '-' + idx"
  76. >
  77. {{ t.label }}:{{
  78. (t.formatter && t.formatter(itm)) || itm[t.key]
  79. }}
  80. </el-col>
  81. </template>
  82. <el-col :span="24" v-if="!(item.list && item.list.length)">
  83. <div class="no-data">暂无数据</div>
  84. </el-col>
  85. </el-row>
  86. <el-row
  87. class="processes-data"
  88. :key="index"
  89. v-else-if="item.taskTypeName === '升温干燥'"
  90. >
  91. <el-col :span="24" class="bg top">
  92. <div class="title">{{ index + 1 }}0 升温干燥</div>
  93. </el-col>
  94. <!-- <el-col :span="10" class="bg top">备注:</el-col> -->
  95. <template v-for="(itm, idx) in item.list || []">
  96. <el-col
  97. :span="t.span"
  98. class="border-dashed-right border-dashed-bottom"
  99. v-for="(t, i) in temperature"
  100. :key="i + '-' + idx"
  101. >
  102. {{ t.label }}:{{
  103. (t.formatter && t.formatter(itm)) || itm[t.key]
  104. }}
  105. </el-col>
  106. </template>
  107. <el-col :span="24" v-if="!(item.list && item.list.length)">
  108. <div class="no-data">暂无数据</div>
  109. </el-col>
  110. </el-row>
  111. <el-row
  112. class="processes-data"
  113. :key="index"
  114. v-else-if="item.taskTypeName.includes('定长')"
  115. >
  116. <el-col :span="24" class="bg top">
  117. <div class="title">{{ index + 1 }}0 半加定长</div>
  118. </el-col>
  119. <!-- <el-col :span="10" class="bg top">备注:</el-col> -->
  120. <template v-for="(itm, idx) in item.list || []">
  121. <el-col
  122. :span="t.span"
  123. class="border-dashed-right border-dashed-bottom"
  124. v-for="(t, i) in halflong"
  125. :key="i + '-' + idx"
  126. >
  127. {{ t.label }}:{{
  128. (t.formatter && t.formatter(itm)) || itm[t.key]
  129. }}
  130. </el-col>
  131. </template>
  132. <el-col :span="24" v-if="!(item.list && item.list.length)">
  133. <div class="no-data">暂无数据</div>
  134. </el-col>
  135. </el-row>
  136. <el-row
  137. class="processes-data"
  138. :key="index"
  139. v-else-if="item.taskTypeName === '备炉'"
  140. >
  141. <el-col :span="24" class="bg top">
  142. <div class="title">{{ index + 1 }}0 备炉</div>
  143. </el-col>
  144. <!-- <el-col :span="10" class="bg top">备注:</el-col> -->
  145. <template v-for="(itm, idx) in item.list || []">
  146. <el-col
  147. :span="t.span"
  148. class="border-dashed-right border-dashed-bottom"
  149. v-for="(t, i) in furnace"
  150. :key="i + '-' + idx"
  151. >
  152. {{ t.label }}:{{
  153. (t.formatter && t.formatter(itm)) || itm[t.key]
  154. }}
  155. </el-col>
  156. </template>
  157. <el-col :span="24" v-if="!(item.list && item.list.length)">
  158. <div class="no-data">暂无数据</div>
  159. </el-col>
  160. </el-row>
  161. <el-row
  162. class="processes-data"
  163. :key="index"
  164. v-else-if="item.taskTypeName === '烧结'"
  165. >
  166. <el-col :span="24" class="bg top">
  167. <div class="title">{{ index + 1 }}0 烧结</div>
  168. </el-col>
  169. <!-- <el-col :span="10" class="bg top">备注:</el-col> -->
  170. <template v-for="(itm, idx) in item.list || []">
  171. <el-col
  172. :span="t.span"
  173. class="border-dashed-right border-dashed-bottom"
  174. v-for="(t, i) in sinter"
  175. :key="i + '-' + idx"
  176. >
  177. {{ t.label }}:{{
  178. (t.formatter && t.formatter(itm)) || itm[t.key]
  179. }}
  180. </el-col>
  181. </template>
  182. <el-col :span="24" v-if="!(item.list && item.list.length)">
  183. <div class="no-data">暂无数据</div>
  184. </el-col>
  185. </el-row>
  186. <el-row
  187. class="processes-data"
  188. :key="index"
  189. v-else-if="item.taskTypeName === '质检'"
  190. >
  191. <el-col :span="24" class="bg top">
  192. <div class="title">{{ index + 1 }}0 质检</div>
  193. </el-col>
  194. <!-- <el-col :span="10" class="bg top">备注:</el-col> -->
  195. <template v-for="(itm, idx) in item.list || []">
  196. <el-col
  197. :span="t.span"
  198. class="border-dashed-right border-dashed-bottom"
  199. v-for="(t, i) in quality"
  200. :key="i + '-' + idx"
  201. >
  202. {{ t.label }}:{{
  203. (t.formatter && t.formatter(itm)) || itm[t.key]
  204. }}
  205. </el-col>
  206. </template>
  207. <el-col :span="24" v-if="!(item.list && item.list.length)">
  208. <div class="no-data">暂无数据</div>
  209. </el-col>
  210. </el-row>
  211. <el-row
  212. class="processes-data"
  213. :key="index"
  214. v-else-if="item.taskTypeName === '包装'"
  215. >
  216. <el-col :span="24" class="bg top">
  217. <div class="title">{{ index + 1 }}0 包装</div>
  218. </el-col>
  219. <!-- <el-col :span="10" class="bg top">备注:</el-col> -->
  220. <template v-for="(itm, idx) in item.list || []">
  221. <el-col
  222. :span="t.span"
  223. class="border-dashed-right border-dashed-bottom"
  224. v-for="(t, i) in packageOpt"
  225. :key="i + '-' + idx"
  226. >
  227. {{ t.label }}:{{
  228. (t.formatter && t.formatter(itm)) || itm[t.key]
  229. }}
  230. </el-col>
  231. <el-col
  232. v-for="material in itm.workReportCategoryList.filter(
  233. (i) => i.rootCategoryLevelId == 10
  234. )"
  235. :span="24"
  236. style="padding-left: 0"
  237. :key="material.code"
  238. >
  239. <el-col :span="8" class="border-dashed-right border-dashed-bottom"
  240. >物料名称:{{ material.name }}
  241. </el-col>
  242. <el-col :span="4" class="border-dashed-right border-dashed-bottom"
  243. >物料编码:{{ material.code }}
  244. </el-col>
  245. <el-col :span="4" class="border-dashed-right border-dashed-bottom"
  246. >物料数量:{{ material.number }}
  247. </el-col>
  248. <el-col :span="8" class="border-dashed-right border-dashed-bottom"
  249. >批次号:{{ material.batchNo }}
  250. </el-col>
  251. </el-col>
  252. </template>
  253. <el-col :span="24" v-if="!(item.list && item.list.length)">
  254. <div class="no-data">暂无数据</div>
  255. </el-col>
  256. </el-row>
  257. <el-row
  258. :key="index"
  259. class="processes-data"
  260. v-else-if="item.taskTypeName.includes('库')"
  261. >
  262. <el-col :span="24" class="bg top">
  263. <div class="title">{{ index + 1 }}0 入库</div>
  264. </el-col>
  265. <!-- <el-col :span="10" class="bg top">备注:</el-col> -->
  266. <template v-for="(itm, idx) in item.list || []">
  267. <el-col
  268. :span="t.span"
  269. class="border-dashed-right border-dashed-bottom"
  270. v-for="(t, i) in preStorage"
  271. :key="i + '-' + idx"
  272. >
  273. {{ t.label }}:{{
  274. (t.formatter && t.formatter(itm)) || itm[t.key]
  275. }}
  276. </el-col>
  277. </template>
  278. <el-col :span="24" v-if="!(item.list && item.list.length)">
  279. <div class="no-data">暂无数据</div>
  280. </el-col>
  281. </el-row>
  282. <el-row class="processes-data" :key="index" v-else>
  283. <el-col :span="24" class="bg top">
  284. <div class="title"
  285. >{{ index + 1 }}0
  286. {{
  287. item.taskTypeName === '深加工'
  288. ? '深加工(精磨)'
  289. : item.taskTypeName
  290. }}</div
  291. >
  292. </el-col>
  293. <!-- <el-col :span="10" class="bg top">备注:</el-col> -->
  294. <template v-for="(itm, idx) in item.list || []">
  295. <el-col
  296. :span="t.span"
  297. class="border-dashed-right border-dashed-bottom"
  298. v-for="(t, i) in deepProcesse"
  299. :key="i + '-' + idx"
  300. >
  301. {{ t.label }}:{{
  302. (t.formatter && t.formatter(itm)) || itm[t.key]
  303. }}
  304. </el-col>
  305. </template>
  306. <el-col :span="24" v-if="!(item.list && item.list.length)">
  307. <div class="no-data">暂无数据</div>
  308. </el-col>
  309. </el-row>
  310. </template>
  311. </div>
  312. <div slot="footer">
  313. <el-button type="primary" @click="handlePrint">打印</el-button>
  314. <el-button @click="cancel">取消</el-button>
  315. </div>
  316. </ele-modal>
  317. </template>
  318. <script>
  319. import {
  320. downloadPDF,
  321. canvasSplit,
  322. a4Height,
  323. a4Width,
  324. margin
  325. } from '@/utils/pdf.js';
  326. import { printWorkOrderInfo } from '@/api/produceOrder/index.js';
  327. export default {
  328. props: {
  329. infoData: {
  330. type: Object,
  331. default: () => ({})
  332. },
  333. processList: {
  334. type: Array,
  335. default: () => []
  336. },
  337. workOrderId: {
  338. type: String,
  339. default: ''
  340. }
  341. },
  342. data() {
  343. return {
  344. visible: false,
  345. typeList: {
  346. 1: '内销订单',
  347. 2: '外销订单',
  348. 3: '预制订单'
  349. },
  350. statusList: {
  351. 4: '待生产',
  352. 5: '生产中',
  353. 6: '已完成',
  354. 7: '已延期'
  355. },
  356. // 挤压生产
  357. extrusion: [
  358. {
  359. label: '原料牌号',
  360. key: 'brandNo',
  361. span: 8,
  362. class: 'border-dashed-right border-dashed-bottom',
  363. formatter(itm) {
  364. return itm.workReportCategoryList[0]?.brandNum;
  365. }
  366. },
  367. {
  368. label: '原料批次号',
  369. key: 'xxx',
  370. span: 4,
  371. class: 'border-dashed-right border-dashed-bottom',
  372. formatter(itm) {
  373. return itm.workReportCategoryList[0]?.batchNo;
  374. }
  375. },
  376. {
  377. label: '投料重量(KG)',
  378. key: 'feedingWeight',
  379. span: 4,
  380. class: 'border-dashed-right border-dashed-bottom',
  381. formatter(itm) {
  382. return (
  383. itm.workReportCategoryList[0]?.number ||
  384. itm.workReportCategoryList[0]?.totalWeight
  385. );
  386. }
  387. },
  388. {
  389. label: '合格数',
  390. key: 'standardNum',
  391. span: 4,
  392. class: 'border-dashed-right border-dashed-bottom',
  393. formatter(itm) {
  394. return itm.productInfo?.standardNum + '';
  395. }
  396. },
  397. {
  398. label: '不合格数',
  399. key: 'noStandardNum',
  400. span: 4,
  401. class: 'border-dashed-bottom',
  402. formatter(itm) {
  403. return itm.productInfo?.noStandardNum || '0';
  404. }
  405. },
  406. {
  407. label: '设备号',
  408. key: 'deviceCode',
  409. span: 8,
  410. class: 'border-dashed-right border-dashed-bottom',
  411. formatter(itm) {
  412. const obj = (itm.workReportDeviceList || []).find(
  413. (i) => i.rootCategoryLevelId == 4
  414. );
  415. return obj?.code;
  416. }
  417. },
  418. {
  419. label: '模具编号/型号',
  420. key: 'xxx',
  421. span: 8,
  422. class: 'border-dashed-right border-dashed-bottom',
  423. formatter(itm) {
  424. const obj = (itm.workReportDeviceList || []).find(
  425. (i) => i.rootCategoryLevelId == 5
  426. );
  427. return obj && obj.code + '/' + obj.model;
  428. }
  429. },
  430. {
  431. label: '舟皿名称',
  432. key: 'xxx',
  433. span: 4,
  434. class: 'border-dashed-right border-dashed-bottom',
  435. formatter(itm) {
  436. const obj = (itm.workReportDeviceList || []).find(
  437. (i) => i.rootCategoryLevelId == 8
  438. );
  439. return obj?.name;
  440. }
  441. },
  442. {
  443. label: '舟皿数量',
  444. key: 'boatNum',
  445. span: 4,
  446. class: 'border-dashed-bottom',
  447. formatter(itm) {
  448. const obj = (itm.workReportDeviceList || []).find(
  449. (i) => i.rootCategoryLevelId == 8
  450. );
  451. return obj?.extraField?.boatNum || '0';
  452. }
  453. },
  454. {
  455. label: '冲压次数',
  456. key: 'stampingTimes',
  457. span: 4,
  458. class: 'border-dashed-right border-dashed-bottom',
  459. formatter(itm) {
  460. const obj = (itm.workReportDeviceList || []).find(
  461. (i) => i.rootCategoryLevelId == 5
  462. );
  463. return obj?.extraField?.stampingTimes;
  464. }
  465. },
  466. {
  467. label: '员工号',
  468. key: 'executorJobNum',
  469. span: 4,
  470. class: 'border-dashed-right border-dashed-bottom'
  471. },
  472. {
  473. label: '日期',
  474. key: 'executeTime',
  475. span: 4,
  476. class: 'border-dashed-right border-dashed-bottom'
  477. },
  478. {
  479. label: '备注',
  480. key: 'remark',
  481. span: 12,
  482. class: 'border-dashed-right border-dashed-bottom'
  483. }
  484. // {
  485. // label: '清缸时长',
  486. // key: 'xxx',
  487. // span: 8
  488. // }
  489. ],
  490. // 自然干燥
  491. drying: [
  492. {
  493. label: '干燥时长(分钟)',
  494. key: 'dryingDuration',
  495. span: 8,
  496. class: 'border-dashed-right border-dashed-bottom',
  497. formatter(itm) {
  498. return itm.workReportArea?.extraField?.dryTime;
  499. }
  500. },
  501. {
  502. label: '合格数',
  503. key: 'standardNum',
  504. span: 4,
  505. class: 'border-dashed-right border-dashed-bottom',
  506. formatter(itm) {
  507. return itm.productInfo?.standardNum + '';
  508. }
  509. },
  510. {
  511. label: '不合格数',
  512. key: 'noStandardNum',
  513. span: 4,
  514. class: 'border-dashed-bottom',
  515. formatter(itm) {
  516. return itm.productInfo?.noStandardNum || '0';
  517. }
  518. },
  519. {
  520. label: '区域编号',
  521. key: 'areaCode',
  522. span: 8,
  523. class: 'border-dashed-bottom',
  524. formatter(itm) {
  525. return itm.workReportArea?.code;
  526. }
  527. },
  528. {
  529. label: '舟皿编码',
  530. key: 'xxx',
  531. span: 8,
  532. class: 'border-dashed-right ',
  533. formatter(itm) {
  534. const obj = (itm.workReportDeviceList || []).find(
  535. (i) => i.rootCategoryLevelId == 8
  536. );
  537. return obj?.code;
  538. }
  539. },
  540. {
  541. label: '员工号',
  542. key: 'executorJobNum',
  543. span: 4,
  544. class: 'border-dashed-right'
  545. },
  546. {
  547. label: '日期',
  548. key: 'executeTime',
  549. span: 4,
  550. class: 'border-dashed-right'
  551. },
  552. {
  553. label: '备注',
  554. key: 'remark',
  555. span: 4,
  556. class: 'border-dashed-right'
  557. }
  558. ],
  559. // 升温燥
  560. temperature: [
  561. {
  562. label: '升温曲线',
  563. key: 'temperatureRamp',
  564. span: 8,
  565. class: 'border-dashed-right border-dashed-bottom',
  566. formatter(itm) {
  567. const obj = (itm.workReportDeviceList || []).find(
  568. (i) => i.rootCategoryLevelId == 4
  569. );
  570. return obj?.extraField?.temperatureRamp;
  571. }
  572. },
  573. // {
  574. // label: '干燥时长(分钟)',
  575. // key: 'xxx',
  576. // span: 4,
  577. // class: 'border-dashed-right border-dashed-bottom'
  578. // },
  579. {
  580. label: '合格数',
  581. key: 'standardNum',
  582. span: 4,
  583. class: 'border-dashed-right border-dashed-bottom',
  584. formatter(itm) {
  585. return itm.productInfo?.standardNum + '';
  586. }
  587. },
  588. {
  589. label: '不合格数',
  590. key: 'noStandardNum',
  591. span: 4,
  592. class: 'border-dashed-bottom',
  593. formatter(itm) {
  594. return itm.productInfo?.noStandardNum || '0';
  595. }
  596. },
  597. {
  598. label: '设备号',
  599. key: 'deviceCode',
  600. span: 8,
  601. class: ' border-dashed-bottom',
  602. formatter(itm) {
  603. const obj = (itm.workReportDeviceList || []).find(
  604. (i) => i.rootCategoryLevelId == 4
  605. );
  606. return obj?.code;
  607. }
  608. },
  609. {
  610. label: '舟皿编码',
  611. key: 'xxx',
  612. span: 8,
  613. class: 'border-dashed-right',
  614. formatter(itm) {
  615. const obj = (itm.workReportDeviceList || []).find(
  616. (i) => i.rootCategoryLevelId == 8
  617. );
  618. return obj?.code;
  619. }
  620. },
  621. {
  622. label: '员工号',
  623. key: 'executorJobNum',
  624. span: 4,
  625. class: 'border-dashed-right'
  626. },
  627. {
  628. label: '日期',
  629. key: 'executeTime',
  630. span: 4,
  631. class: 'border-dashed-right'
  632. },
  633. {
  634. label: '备注',
  635. key: 'remark',
  636. span: 8,
  637. class: 'border-dashed-right'
  638. }
  639. ],
  640. // 半加定长
  641. halflong: [
  642. // {
  643. // label: '长度(mm)',
  644. // key: 'xxx',
  645. // span: 8,
  646. // class: 'border-dashed-right border-dashed-bottom'
  647. // },
  648. {
  649. label: '合格数',
  650. key: 'standardNum',
  651. span: 4,
  652. class: 'border-dashed-right border-dashed-bottom',
  653. formatter(itm) {
  654. return itm.productInfo?.standardNum + '';
  655. }
  656. },
  657. {
  658. label: '不合格数',
  659. key: 'noStandardNum',
  660. span: 4,
  661. class: 'border-dashed-bottom',
  662. formatter(itm) {
  663. return itm.productInfo?.noStandardNum || '0';
  664. }
  665. },
  666. {
  667. label: '设备号',
  668. key: 'deviceCode',
  669. span: 8,
  670. class: ' border-dashed-bottom',
  671. formatter(itm) {
  672. const obj = (itm.workReportDeviceList || []).find(
  673. (i) => i.rootCategoryLevelId == 4
  674. );
  675. return obj?.code;
  676. }
  677. },
  678. {
  679. label: '舟皿名称',
  680. key: 'xxx',
  681. span: 4,
  682. class: 'border-dashed-right',
  683. formatter(itm) {
  684. const obj = (itm.workReportDeviceList || []).find(
  685. (i) => i.rootCategoryLevelId == 8
  686. );
  687. return obj?.name;
  688. }
  689. },
  690. {
  691. label: '舟皿数量',
  692. key: 'boatNum',
  693. span: 4,
  694. class: 'border-dashed-right',
  695. formatter(itm) {
  696. const obj = (itm.workReportDeviceList || []).find(
  697. (i) => i.rootCategoryLevelId == 8
  698. );
  699. return obj?.extraField?.boatNum || '0';
  700. }
  701. },
  702. {
  703. label: '员工号',
  704. key: 'executorJobNum',
  705. span: 4,
  706. class: 'border-dashed-right'
  707. },
  708. {
  709. label: '日期',
  710. key: 'executeTime',
  711. span: 4,
  712. class: 'border-dashed-right'
  713. },
  714. {
  715. label: '备注',
  716. key: 'remark',
  717. span: 4,
  718. class: 'border-dashed-right'
  719. }
  720. ],
  721. // 备炉
  722. furnace: [
  723. {
  724. label: '产品数量',
  725. key: 'xxx',
  726. span: 8,
  727. class: 'border-dashed-right',
  728. formatter(itm) {
  729. const obj = itm.workReportCategoryList.find(
  730. (i) => i.rootCategoryLevelId == 9
  731. );
  732. return obj?.number;
  733. }
  734. },
  735. {
  736. label: '设备号',
  737. key: 'deviceCode',
  738. span: 4,
  739. class: 'border-dashed-right',
  740. formatter(itm) {
  741. const obj = (itm.workReportDeviceList || []).find(
  742. (i) => i.rootCategoryLevelId == 4
  743. );
  744. return obj?.code;
  745. }
  746. },
  747. {
  748. label: '员工号',
  749. key: 'executorJobNum',
  750. span: 4,
  751. class: 'border-dashed-right'
  752. },
  753. {
  754. label: '日期',
  755. key: 'executeTime',
  756. span: 8,
  757. class: 'border-dashed-right'
  758. }
  759. // {
  760. // label: '备注',
  761. // key: 'remark',
  762. // span: 4,
  763. // class: 'border-dashed-right'
  764. // }
  765. ],
  766. // 烧结
  767. sinter: [
  768. // {
  769. // label: '烧结曲线',
  770. // key: 'sinteringCurve',
  771. // span: 4,
  772. // class: 'border-dashed-right border-dashed-bottom'
  773. // },
  774. {
  775. label: '合格数',
  776. key: 'standardNum',
  777. span: 4,
  778. class: 'border-dashed-right border-dashed-bottom',
  779. formatter(itm) {
  780. return itm.productInfo?.standardNum + '';
  781. }
  782. },
  783. {
  784. label: '不合格数',
  785. key: 'noStandardNum',
  786. span: 4,
  787. class: 'border-dashed-bottom border-dashed-right',
  788. formatter(itm) {
  789. return itm.productInfo?.noStandardNum || '0';
  790. }
  791. },
  792. {
  793. label: '设备号',
  794. key: 'deviceCode',
  795. span: 4,
  796. class: 'border-dashed-right border-dashed-bottom',
  797. formatter(itm) {
  798. const obj = (itm.workReportDeviceList || []).find(
  799. (i) => i.rootCategoryLevelId == 4
  800. );
  801. return obj?.code;
  802. }
  803. },
  804. {
  805. label: '员工号',
  806. key: 'executorJobNum',
  807. span: 4,
  808. class: 'border-dashed-right border-dashed-bottom'
  809. },
  810. {
  811. label: '日期',
  812. key: 'executeTime',
  813. span: 4,
  814. class: 'border-dashed-right'
  815. },
  816. {
  817. label: '备注',
  818. key: 'remark',
  819. span: 4,
  820. class: 'border-dashed-right'
  821. }
  822. ],
  823. // 质检
  824. // quality: [
  825. // {
  826. // label: '半检结果',
  827. // key: 'xxx',
  828. // span: 12,
  829. // class: 'border-dashed-right border-dashed-bottom'
  830. // },
  831. // {
  832. // label: '员工号',
  833. // key: 'executorJobNum',
  834. // span: 4,
  835. // class: 'border-dashed-right'
  836. // },
  837. // {
  838. // label: '日期',
  839. // key: 'executeTime',
  840. // span: 4,
  841. // class: 'border-dashed-right'
  842. // },
  843. // {
  844. // label: '成检结果',
  845. // key: 'xxx',
  846. // span: 12,
  847. // class: 'border-dashed-right border-dashed-bottom'
  848. // },
  849. // {
  850. // label: '员工号',
  851. // key: 'executorJobNum',
  852. // span: 4,
  853. // class: 'border-dashed-right'
  854. // },
  855. // {
  856. // label: '日期',
  857. // key: 'executeTime',
  858. // span: 4,
  859. // class: 'border-dashed-right'
  860. // },
  861. // {
  862. // label: '外径',
  863. // key: 'xxx',
  864. // span: 4,
  865. // class: 'border-dashed-right border-dashed-bottom'
  866. // },
  867. // {
  868. // label: '长度',
  869. // key: 'xxx',
  870. // span: 4,
  871. // class: 'border-dashed-right border-dashed-bottom'
  872. // },
  873. // {
  874. // label: '垂直度',
  875. // key: 'xxx',
  876. // span: 4,
  877. // class: 'border-dashed-right border-dashed-bottom'
  878. // },
  879. // {
  880. // label: '圆度',
  881. // key: 'xxx',
  882. // span: 4,
  883. // class: 'border-dashed-right border-dashed-bottom'
  884. // },
  885. // {
  886. // label: '跳动',
  887. // key: 'xxx',
  888. // span: 4,
  889. // class: 'border-dashed-bottom'
  890. // },
  891. // {
  892. // label: '抗拆/损伤',
  893. // key: 'xxx',
  894. // span: 4,
  895. // class: 'border-dashed-right border-dashed-bottom'
  896. // },
  897. // {
  898. // label: '直线度',
  899. // key: 'xxx',
  900. // span: 4,
  901. // class: 'border-dashed-right border-dashed-bottom'
  902. // },
  903. // {
  904. // label: '粗糙度',
  905. // key: 'xxx',
  906. // span: 4,
  907. // class: 'border-dashed-right border-dashed-bottom'
  908. // },
  909. // {
  910. // label: '其它',
  911. // key: 'xxx',
  912. // span: 4,
  913. // class: ' border-dashed-bottom border-dashed-right '
  914. // },
  915. // {
  916. // label: '合格数',
  917. // key: 'standardNum',
  918. // span: 4,
  919. // class: 'border-dashed-right border-dashed-bottom'
  920. // },
  921. // {
  922. // label: '合格数',
  923. // key: 'noStandardNum',
  924. // span: 4,
  925. // class: 'border-dashed-right border-dashed-bottom'
  926. // },
  927. // {
  928. // label: '待处理',
  929. // key: 'xxx',
  930. // span: 4,
  931. // class: 'border-dashed-right border-dashed-bottom'
  932. // },
  933. // {
  934. // label: '让步',
  935. // key: 'xxx',
  936. // span: 4,
  937. // class: 'border-dashed-right border-dashed-bottom'
  938. // },
  939. // {
  940. // label: '可修',
  941. // key: 'xxx',
  942. // span: 4,
  943. // class: 'border-dashed-bottom'
  944. // },
  945. // {
  946. // label: '员工号',
  947. // key: 'executorJobNum',
  948. // span: 4,
  949. // class: 'border-dashed-right'
  950. // },
  951. // {
  952. // label: '日期',
  953. // key: 'executeTime',
  954. // span: 4,
  955. // class: 'border-dashed-right'
  956. // },
  957. // {
  958. // label: '备注',
  959. // key: 'remark',
  960. // span: 4,
  961. // class: 'border-dashed-right'
  962. // }
  963. // ],
  964. // 深加工
  965. deepProcesse: [
  966. {
  967. label: '合格数',
  968. key: 'standardNum',
  969. span: 4,
  970. class: 'border-dashed-right border-dashed-bottom',
  971. formatter(itm) {
  972. return itm.productInfo?.standardNum + '';
  973. }
  974. },
  975. {
  976. label: '不合格数',
  977. key: 'noStandardNum',
  978. span: 4,
  979. class: 'border-dashed-bottom',
  980. formatter(itm) {
  981. return itm.productInfo?.noStandardNum || '0';
  982. }
  983. },
  984. {
  985. label: '设备号',
  986. key: 'deviceCode',
  987. span: 4,
  988. class: 'border-dashed-right',
  989. formatter(itm) {
  990. const obj = (itm.workReportDeviceList || []).find(
  991. (i) => i.rootCategoryLevelId == 4
  992. );
  993. return obj?.code;
  994. }
  995. },
  996. {
  997. label: '员工号',
  998. key: 'executorJobNum',
  999. span: 4,
  1000. class: 'border-dashed-right'
  1001. },
  1002. {
  1003. label: '日期',
  1004. key: 'executeTime',
  1005. span: 4,
  1006. class: 'border-dashed-right'
  1007. },
  1008. {
  1009. label: '备注',
  1010. key: 'remark',
  1011. span: 4,
  1012. class: 'border-dashed-right'
  1013. }
  1014. ],
  1015. // 包装
  1016. packageOpt: [
  1017. {
  1018. label: '包装要求',
  1019. key: 'xxx',
  1020. span: 8,
  1021. class: 'border-dashed-right border-dashed-bottom',
  1022. formatter(itm) {
  1023. return itm?.packInfo?.packDemand;
  1024. }
  1025. },
  1026. {
  1027. label: '包装单位',
  1028. key: 'xxx',
  1029. span: 4,
  1030. class: 'border-dashed-right border-dashed-bottom',
  1031. formatter(itm) {
  1032. return itm?.packInfo?.packUnit;
  1033. }
  1034. },
  1035. {
  1036. label: '包装数量',
  1037. key: 'xxx',
  1038. span: 4,
  1039. class: 'border-dashed-right border-dashed-bottom',
  1040. formatter(itm) {
  1041. return itm?.packInfo?.packNum;
  1042. }
  1043. },
  1044. {
  1045. label: '最小包装单元',
  1046. key: 'xxx',
  1047. span: 4,
  1048. class: 'border-dashed-right border-dashed-bottom',
  1049. formatter(itm) {
  1050. return `${itm.packInfo.minPackNum}PCS/${itm.packInfo.packUnit}`;
  1051. }
  1052. },
  1053. {
  1054. label: '净重',
  1055. key: 'xxx',
  1056. span: 4,
  1057. class: 'border-dashed-right border-dashed-bottom',
  1058. formatter(itm) {
  1059. return itm?.packInfo?.netWeight;
  1060. }
  1061. },
  1062. {
  1063. label: '毛重',
  1064. key: 'xxx',
  1065. span: 4,
  1066. class: ' border-dashed-bottom',
  1067. formatter(itm) {
  1068. return itm?.packInfo?.roughWeight;
  1069. }
  1070. },
  1071. {
  1072. label: '尾料',
  1073. key: 'xxx',
  1074. span: 4,
  1075. class: 'border-dashed-right border-dashed-bottom',
  1076. formatter(itm) {
  1077. return itm?.packInfo?.surplusNum;
  1078. }
  1079. },
  1080. {
  1081. label: '员工号',
  1082. key: 'executorJobNum',
  1083. span: 4,
  1084. class: 'border-dashed-right'
  1085. },
  1086. {
  1087. label: '日期',
  1088. key: 'executeTime',
  1089. span: 12,
  1090. class: 'border-dashed-right'
  1091. }
  1092. // {
  1093. // label: '备注',
  1094. // key: 'remark',
  1095. // span: 12,
  1096. // class: 'border-dashed-right'
  1097. // }
  1098. ],
  1099. // 预缴库
  1100. preStorage: [
  1101. {
  1102. label: '产品数量',
  1103. key: 'xxx',
  1104. span: 4,
  1105. class: 'border-dashed-right border-dashed-bottom',
  1106. formatter(itm) {
  1107. const obj = (itm.workReportDeviceList || []).find(
  1108. (i) => i.rootCategoryLevelId == 9
  1109. );
  1110. return obj?.number;
  1111. }
  1112. },
  1113. {
  1114. label: '员工号',
  1115. key: 'executorJobNum',
  1116. span: 8,
  1117. class: 'border-dashed-right'
  1118. },
  1119. {
  1120. label: '日期',
  1121. key: 'executeTime',
  1122. span: 12,
  1123. class: 'border-dashed-right'
  1124. }
  1125. ]
  1126. };
  1127. },
  1128. methods: {
  1129. open() {
  1130. this.visible = true;
  1131. this.init();
  1132. },
  1133. init() {
  1134. for (const p of this.processList) {
  1135. this.$set(p, 'list', []);
  1136. }
  1137. printWorkOrderInfo(this.workOrderId).then((res) => {
  1138. for (const t of res.taskInfo) {
  1139. for (const p of this.processList) {
  1140. if (t.taskName === p.taskTypeName && t.taskCode === p.taskCode) {
  1141. p.list.push(t);
  1142. }
  1143. }
  1144. }
  1145. });
  1146. },
  1147. cancel() {
  1148. this.visible = false;
  1149. },
  1150. //打印
  1151. handlePrint() {
  1152. this.PrintLoading = true;
  1153. const page = this.$refs.pagesRef;
  1154. const pHeight = page.offsetHeight;
  1155. const pWidth = page.offsetWidth;
  1156. const lineHeight = 36;
  1157. const onePageHeight = (a4Height / a4Width) * pWidth;
  1158. const maxPageHeight = Math.min(
  1159. Math.floor(onePageHeight / lineHeight) * lineHeight,
  1160. pHeight
  1161. );
  1162. let leftH = pHeight;
  1163. const splitPos = [];
  1164. do {
  1165. splitPos.push(
  1166. (splitPos[splitPos.length - 1] || 0) +
  1167. (leftH > maxPageHeight ? maxPageHeight : leftH)
  1168. );
  1169. leftH -= maxPageHeight;
  1170. } while (leftH > 0);
  1171. downloadPDF(page, splitPos, '生产工单').then(
  1172. () => (this.PrintLoading = false)
  1173. );
  1174. }
  1175. }
  1176. };
  1177. </script>
  1178. <style scoped lang="scss">
  1179. $heihgt: 36px;
  1180. $border: 1px solid #ddd;
  1181. * {
  1182. box-sizing: border-box !important;
  1183. }
  1184. .bg {
  1185. background-color: #f1f1f1;
  1186. line-height: $heihgt - 2px;
  1187. height: $heihgt;
  1188. }
  1189. .border-dashed-right {
  1190. border-right: $border;
  1191. }
  1192. .border-dashed-bottom {
  1193. border-bottom: $border;
  1194. }
  1195. .main-data {
  1196. .bg {
  1197. text-align: center;
  1198. border-right: $border;
  1199. border-bottom: $border;
  1200. }
  1201. .value {
  1202. line-height: $heihgt - 2px;
  1203. height: $heihgt;
  1204. border-right: $border;
  1205. border-bottom: $border;
  1206. padding-left: 10px;
  1207. }
  1208. .code {
  1209. line-height: 2 * $heihgt;
  1210. height: 2 * $heihgt;
  1211. border-right: $border;
  1212. border-bottom: $border;
  1213. text-align: center;
  1214. color: rgba(0, 0, 0, 0.3);
  1215. font-size: 18px;
  1216. }
  1217. }
  1218. .print-container {
  1219. border-top: $border;
  1220. border-left: $border;
  1221. border-right: $border;
  1222. font-size: 14px;
  1223. }
  1224. .processes-data {
  1225. .title {
  1226. color: #000;
  1227. font-weight: bold;
  1228. }
  1229. :deep(.el-col) {
  1230. line-height: $heihgt - 2px;
  1231. height: $heihgt;
  1232. padding-left: 10px;
  1233. }
  1234. .top {
  1235. border-top: $border;
  1236. border-bottom: $border;
  1237. }
  1238. }
  1239. </style>