gdcjstj.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808
  1. <template>
  2. <div style="width: 30vw; height: 50vh">
  3. <el-input v-model="input" />
  4. <el-button
  5. @click="handlePrint"
  6. >打印测试
  7. </el-button>
  8. </div>
  9. </template>
  10. <script>
  11. export default {
  12. name: 'Gdcjstj',
  13. }
  14. // 2工单超节损统计(按工序)
  15. import service from '@/utils/request'
  16. const getOrderSuperLossCount = (params) => {
  17. return service({
  18. url: '/mes_server/order_super_loss/getOrderSuperLossCount',
  19. method: 'get',
  20. params
  21. })
  22. }
  23. </script>
  24. <script setup>
  25. import { watch, ref, reactive, defineProps, defineEmits } from 'vue'
  26. import { hiprint, defaultElementTypeProvider } from 'vue-plugin-hiprint'
  27. const jsonData = {
  28. 'panels': [{
  29. 'index': 0,
  30. 'name': 1,
  31. 'paperType': 'A4',
  32. 'height': 210,
  33. 'width': 297,
  34. 'paperHeader': 108,
  35. 'paperFooter': 551.5151515151515,
  36. 'printElements': [{
  37. 'options': {
  38. 'left': 267.5,
  39. 'top': 17.5,
  40. 'height': 22,
  41. 'width': 294,
  42. 'title': '工单工序各班组超节损统计表',
  43. 'coordinateSync': false,
  44. 'widthHeightSync': false,
  45. 'fontSize': 12,
  46. 'color': '#000000',
  47. 'textAlign': 'center',
  48. 'textContentVerticalAlign': 'middle',
  49. 'textContentWrap': 'ellipsis',
  50. 'qrCodeLevel': 0,
  51. 'right': 560.5625381469727,
  52. 'bottom': 39.8125,
  53. 'vCenter': 413.56253814697266,
  54. 'hCenter': 28.8125,
  55. 'fontWeight': 600,
  56. }, 'printElementType': { 'title': '这是更新后的元素', 'type': 'text' },
  57. }, {
  58. 'options': {
  59. 'left': 157.5,
  60. 'top': 50,
  61. 'height': 14,
  62. 'width': 129,
  63. 'title': '成品代号',
  64. 'field': 'cpdh',
  65. 'coordinateSync': false,
  66. 'widthHeightSync': false,
  67. 'fontSize': 12,
  68. 'color': '#000000',
  69. 'textContentVerticalAlign': 'middle',
  70. 'textContentWrap': 'ellipsis',
  71. 'qrCodeLevel': 0,
  72. 'qid': 'gdbh_1',
  73. 'right': 285.562557220459,
  74. 'bottom': 63.99998092651367,
  75. 'vCenter': 221.06255722045898,
  76. 'hCenter': 56.99998092651367,
  77. }, 'printElementType': { 'title': '这是更新后的元素', 'type': 'text' },
  78. }, {
  79. 'options': {
  80. 'left': 17.5,
  81. 'top': 50,
  82. 'height': 14,
  83. 'width': 129,
  84. 'title': '工单编号',
  85. 'field': 'gdbh',
  86. 'coordinateSync': false,
  87. 'widthHeightSync': false,
  88. 'fontSize': 12,
  89. 'color': '#000000',
  90. 'textContentVerticalAlign': 'middle',
  91. 'textContentWrap': 'ellipsis',
  92. 'qrCodeLevel': 0,
  93. }, 'printElementType': { 'title': '这是更新后的元素', 'type': 'text' },
  94. }, {
  95. 'options': {
  96. 'left': 305,
  97. 'top': 50,
  98. 'height': 14,
  99. 'width': 507,
  100. 'title': '成品名称',
  101. 'field': 'cpmc',
  102. 'coordinateSync': false,
  103. 'widthHeightSync': false,
  104. 'fontSize': 12,
  105. 'color': '#000000',
  106. 'textContentVerticalAlign': 'middle',
  107. 'textContentWrap': 'ellipsis',
  108. 'qrCodeLevel': 0,
  109. 'qid': 'cpdh_1',
  110. 'right': 442.125057220459,
  111. 'bottom': 63.99998092651367,
  112. 'vCenter': 377.625057220459,
  113. 'hCenter': 56.99998092651367,
  114. }, 'printElementType': { 'title': '这是更新后的元素', 'type': 'text' },
  115. }, {
  116. 'options': {
  117. 'left': 15,
  118. 'top': 67.5,
  119. 'height': 42,
  120. 'width': 811.5,
  121. 'right': 824,
  122. 'bottom': 106.16669209798177,
  123. 'vCenter': 418.25,
  124. 'hCenter': 85.16669209798177,
  125. 'coordinateSync': false,
  126. 'widthHeightSync': false,
  127. }, 'printElementType': { 'title': '矩形', 'type': 'rect' },
  128. }, {
  129. 'options': {
  130. 'left': 207.5,
  131. 'top': 70,
  132. 'height': 14,
  133. 'width': 150,
  134. 'title': '订单数量',
  135. 'field': 'ddsl',
  136. 'coordinateSync': false,
  137. 'widthHeightSync': false,
  138. 'fontSize': 12,
  139. 'color': '#000000',
  140. 'textContentVerticalAlign': 'middle',
  141. 'textContentWrap': 'ellipsis',
  142. 'qrCodeLevel': 0,
  143. 'qid': 'xsddh_1',
  144. 'right': 365.8750190734863,
  145. 'bottom': 88.68750476837158,
  146. 'vCenter': 286.3750190734863,
  147. 'hCenter': 81.68750476837158,
  148. }, 'printElementType': { 'title': '这是更新后的元素', 'type': 'text' },
  149. }, {
  150. 'options': {
  151. 'left': 357.5,
  152. 'top': 70,
  153. 'height': 14,
  154. 'width': 160,
  155. 'title': '实际投料',
  156. 'field': 'sjtl',
  157. 'coordinateSync': false,
  158. 'widthHeightSync': false,
  159. 'fontSize': 12,
  160. 'color': '#000000',
  161. 'textContentVerticalAlign': 'middle',
  162. 'textContentWrap': 'ellipsis',
  163. 'qrCodeLevel': 0,
  164. 'qid': 'ddsl_1',
  165. 'right': 493.3333079020182,
  166. 'bottom': 88.16669209798177,
  167. 'vCenter': 425.8333079020182,
  168. 'hCenter': 81.16669209798177,
  169. }, 'printElementType': { 'title': '这是更新后的元素', 'type': 'text' },
  170. }, {
  171. 'options': {
  172. 'left': 520,
  173. 'top': 70,
  174. 'height': 14,
  175. 'width': 135,
  176. 'title': '入仓日期',
  177. 'field': 'rcrq',
  178. 'coordinateSync': false,
  179. 'widthHeightSync': false,
  180. 'fontSize': 12,
  181. 'color': '#000000',
  182. 'textContentVerticalAlign': 'middle',
  183. 'textContentWrap': 'ellipsis',
  184. 'qrCodeLevel': 0,
  185. 'qid': 'sstl_1',
  186. 'right': 654.1666412353516,
  187. 'bottom': 89.0000254313151,
  188. 'vCenter': 586.6666412353516,
  189. 'hCenter': 82.0000254313151,
  190. }, 'printElementType': { 'title': '这是更新后的元素', 'type': 'text' },
  191. }, {
  192. 'options': {
  193. 'left': 22.5,
  194. 'top': 70,
  195. 'height': 14,
  196. 'width': 172.5,
  197. 'title': '销售订单号',
  198. 'field': 'xsddh',
  199. 'coordinateSync': false,
  200. 'widthHeightSync': false,
  201. 'fontSize': 12,
  202. 'color': '#000000',
  203. 'textContentVerticalAlign': 'middle',
  204. 'textContentWrap': 'ellipsis',
  205. 'qrCodeLevel': 0,
  206. 'qid': 'gdbh_1',
  207. 'right': 195.0000254313151,
  208. 'bottom': 89.0000254313151,
  209. 'vCenter': 108.75002543131511,
  210. 'hCenter': 82.0000254313151,
  211. }, 'printElementType': { 'title': '这是更新后的元素', 'type': 'text' },
  212. }, {
  213. 'options': {
  214. 'left': 657.5,
  215. 'top': 70,
  216. 'height': 14,
  217. 'width': 135,
  218. 'title': '入仓合计',
  219. 'field': 'rchj',
  220. 'coordinateSync': false,
  221. 'widthHeightSync': false,
  222. 'fontSize': 12,
  223. 'color': '#000000',
  224. 'textContentVerticalAlign': 'middle',
  225. 'textContentWrap': 'ellipsis',
  226. 'qrCodeLevel': 0,
  227. 'qid': 'rcrq_1',
  228. 'right': 797.4999745686848,
  229. 'bottom': 87.33335876464844,
  230. 'vCenter': 729.9999745686848,
  231. 'hCenter': 80.33335876464844,
  232. }, 'printElementType': { 'title': '这是更新后的元素', 'type': 'text' },
  233. }, {
  234. 'options': {
  235. 'left': 15,
  236. 'top': 87.5,
  237. 'height': 9,
  238. 'width': 810,
  239. 'right': 106.66666666666667,
  240. 'bottom': 95.66669209798178,
  241. 'vCenter': 61.66666666666667,
  242. 'hCenter': 91.16669209798178,
  243. 'coordinateSync': false,
  244. 'widthHeightSync': false,
  245. 'borderWidth': 0.75,
  246. }, 'printElementType': { 'title': '横线', 'type': 'hline' },
  247. }, {
  248. 'options': {
  249. 'left': 300,
  250. 'top': 90,
  251. 'height': 14,
  252. 'width': 100,
  253. 'title': '制程废',
  254. 'field': 'zcf',
  255. 'coordinateSync': false,
  256. 'widthHeightSync': false,
  257. 'fontSize': 12,
  258. 'color': '#000000',
  259. 'textContentVerticalAlign': 'middle',
  260. 'textContentWrap': 'ellipsis',
  261. 'qrCodeLevel': 0,
  262. 'qid': 'ltcl_1',
  263. 'right': 439.5454476096413,
  264. 'bottom': 101.5000069358132,
  265. 'vCenter': 387.0454476096413,
  266. 'hCenter': 94.5000069358132,
  267. }, 'printElementType': { 'title': '这是更新后的元素', 'type': 'text' },
  268. }, {
  269. 'options': {
  270. 'left': 400,
  271. 'top': 90,
  272. 'height': 14,
  273. 'width': 100,
  274. 'title': '质检废',
  275. 'field': 'zjf',
  276. 'coordinateSync': false,
  277. 'widthHeightSync': false,
  278. 'fontSize': 12,
  279. 'color': '#000000',
  280. 'textContentVerticalAlign': 'middle',
  281. 'textContentWrap': 'ellipsis',
  282. 'qrCodeLevel': 0,
  283. 'qid': 'zcf_1',
  284. 'right': 504.5454614812677,
  285. 'bottom': 98.54545454545455,
  286. 'vCenter': 454.5454614812677,
  287. 'hCenter': 91.54545454545455,
  288. }, 'printElementType': { 'title': '这是更新后的元素', 'type': 'text' },
  289. }, {
  290. 'options': {
  291. 'left': 202.5,
  292. 'top': 90,
  293. 'height': 14,
  294. 'width': 100,
  295. 'title': '零头处理',
  296. 'field': 'ltcl',
  297. 'coordinateSync': false,
  298. 'widthHeightSync': false,
  299. 'fontSize': 12,
  300. 'color': '#000000',
  301. 'textContentVerticalAlign': 'middle',
  302. 'textContentWrap': 'ellipsis',
  303. 'qrCodeLevel': 0,
  304. 'qid': 'wff_1',
  305. 'right': 341.81818875399495,
  306. 'bottom': 101.5000069358132,
  307. 'vCenter': 289.31818875399495,
  308. 'hCenter': 94.5000069358132,
  309. }, 'printElementType': { 'title': '这是更新后的元素', 'type': 'text' },
  310. }, {
  311. 'options': {
  312. 'left': 500,
  313. 'top': 90,
  314. 'height': 14,
  315. 'width': 100,
  316. 'title': '无形损',
  317. 'field': 'wxs',
  318. 'coordinateSync': false,
  319. 'widthHeightSync': false,
  320. 'fontSize': 12,
  321. 'color': '#000000',
  322. 'textContentVerticalAlign': 'middle',
  323. 'textContentWrap': 'ellipsis',
  324. 'qrCodeLevel': 0,
  325. 'qid': 'zjf_1',
  326. 'right': 602.500021457672,
  327. 'bottom': 100.87499999999999,
  328. 'vCenter': 552.500021457672,
  329. 'hCenter': 93.87499999999999,
  330. }, 'printElementType': { 'title': '这是更新后的元素', 'type': 'text' },
  331. }, {
  332. 'options': {
  333. 'left': 117.5,
  334. 'top': 90,
  335. 'height': 14,
  336. 'width': 90,
  337. 'title': '外发废',
  338. 'field': 'wff',
  339. 'coordinateSync': false,
  340. 'widthHeightSync': false,
  341. 'fontSize': 12,
  342. 'color': '#000000',
  343. 'textContentVerticalAlign': 'middle',
  344. 'textContentWrap': 'ellipsis',
  345. 'qrCodeLevel': 0,
  346. 'qid': 'clf_1',
  347. 'right': 224.99999306418678,
  348. 'bottom': 100.81818875399503,
  349. 'vCenter': 177.49999306418678,
  350. 'hCenter': 93.81818875399503,
  351. }, 'printElementType': { 'title': '这是更新后的元素', 'type': 'text' },
  352. }, {
  353. 'options': {
  354. 'left': 597.5,
  355. 'top': 90,
  356. 'height': 14,
  357. 'width': 114,
  358. 'title': '目标合格率',
  359. 'field': 'mbhgl',
  360. 'coordinateSync': false,
  361. 'widthHeightSync': false,
  362. 'fontSize': 12,
  363. 'color': '#000000',
  364. 'textContentVerticalAlign': 'middle',
  365. 'textContentWrap': 'ellipsis',
  366. 'qrCodeLevel': 0,
  367. 'qid': 'wxs_1',
  368. 'right': 728.375021457672,
  369. 'bottom': 102.12499999999997,
  370. 'vCenter': 671.375021457672,
  371. 'hCenter': 95.12499999999997,
  372. }, 'printElementType': { 'title': '这是更新后的元素', 'type': 'text' },
  373. }, {
  374. 'options': {
  375. 'left': 22.5,
  376. 'top': 90,
  377. 'height': 14,
  378. 'width': 95,
  379. 'title': '材料废',
  380. 'field': 'clf',
  381. 'coordinateSync': false,
  382. 'widthHeightSync': false,
  383. 'fontSize': 12,
  384. 'color': '#000000',
  385. 'textContentVerticalAlign': 'middle',
  386. 'textContentWrap': 'ellipsis',
  387. 'qrCodeLevel': 0,
  388. 'qid': 'xsddh_1',
  389. 'right': 150.25001907348633,
  390. 'bottom': 85.25001430511475,
  391. 'vCenter': 85.75001907348633,
  392. 'hCenter': 78.25001430511475,
  393. }, 'printElementType': { 'title': '这是更新后的元素', 'type': 'text' },
  394. }, {
  395. 'options': {
  396. 'left': 712.5,
  397. 'top': 90,
  398. 'height': 14,
  399. 'width': 114,
  400. 'title': '实际合格率',
  401. 'field': 'sjhgl',
  402. 'coordinateSync': false,
  403. 'widthHeightSync': false,
  404. 'fontSize': 12,
  405. 'color': '#000000',
  406. 'textContentVerticalAlign': 'middle',
  407. 'textContentWrap': 'ellipsis',
  408. 'qrCodeLevel': 0,
  409. 'qid': 'mbhgl_1',
  410. 'right': 820.875021457672,
  411. 'bottom': 128.37499999999994,
  412. 'vCenter': 763.875021457672,
  413. 'hCenter': 121.37499999999996,
  414. }, 'printElementType': { 'title': '这是更新后的元素', 'type': 'text' },
  415. }, {
  416. 'options': {
  417. 'left': 15,
  418. 'top': 108.5,
  419. 'height': 442.5,
  420. 'width': 811.5,
  421. 'right': 813.6666666666666,
  422. 'bottom': 153.5000254313151,
  423. 'vCenter': 413.9166666666667,
  424. 'hCenter': 135.5000254313151,
  425. 'field': 'table',
  426. 'coordinateSync': false,
  427. 'widthHeightSync': false,
  428. 'fontSize': 10.5,
  429. 'tableHeaderRowHeight': 30,
  430. 'tableFooterRepeat': 'last',
  431. 'tableHeaderRepeat': 'page',
  432. 'columns': [[{
  433. 'width': 109.58270193697071,
  434. 'title': '印件及工序名称\n',
  435. 'titleSync': false,
  436. 'field': 'gxmc',
  437. 'checked': true,
  438. 'columnId': 'gxmc',
  439. 'fixed': false,
  440. 'rowspan': 1,
  441. 'colspan': 1,
  442. 'halign': 'center',
  443. 'tableQRCodeLevel': 0,
  444. 'tableSummaryTitle': true,
  445. 'tableSummaryText': '合计',
  446. 'tableSummary': '',
  447. 'tableSummaryAlign': 'right',
  448. }, {
  449. 'width': 53.99363831254071,
  450. 'title': '工序计划产量',
  451. 'titleSync': false,
  452. 'field': 'jhcl',
  453. 'checked': true,
  454. 'columnId': 'jhcl',
  455. 'fixed': false,
  456. 'rowspan': 1,
  457. 'colspan': 1,
  458. 'align': 'right',
  459. 'halign': 'center',
  460. 'tableQRCodeLevel': 0,
  461. 'tableSummaryTitle': true,
  462. 'tableSummary': '',
  463. }, {
  464. 'width': 53.99363831254071,
  465. 'title': '工序计划损耗',
  466. 'titleSync': false,
  467. 'field': 'jhsh',
  468. 'checked': true,
  469. 'columnId': 'jhsh',
  470. 'fixed': false,
  471. 'rowspan': 1,
  472. 'colspan': 1,
  473. 'align': 'right',
  474. 'halign': 'center',
  475. 'tableQRCodeLevel': 0,
  476. 'tableSummaryTitle': false,
  477. 'tableSummaryColspan': '0',
  478. 'tableSummary': 'sum',
  479. 'tableSummaryAlign': 'right',
  480. 'tableSummaryNumFormat': '0',
  481. }, {
  482. 'width': 53.99363831254071,
  483. 'title': '制程废',
  484. 'titleSync': false,
  485. 'field': 'zcf',
  486. 'checked': true,
  487. 'columnId': 'zcf',
  488. 'fixed': false,
  489. 'rowspan': 1,
  490. 'colspan': 1,
  491. 'align': 'right',
  492. 'halign': 'center',
  493. 'tableQRCodeLevel': 0,
  494. 'tableSummaryTitle': false,
  495. 'tableSummary': 'sum',
  496. 'tableSummaryAlign': 'right',
  497. 'tableSummaryNumFormat': '0',
  498. }, {
  499. 'width': 53.99363831254071,
  500. 'title': '质检废',
  501. 'titleSync': false,
  502. 'field': 'zjf',
  503. 'checked': true,
  504. 'columnId': 'zjf',
  505. 'fixed': false,
  506. 'rowspan': 1,
  507. 'colspan': 1,
  508. 'align': 'right',
  509. 'halign': 'center',
  510. 'tableQRCodeLevel': 0,
  511. 'tableSummaryTitle': false,
  512. 'tableSummary': 'sum',
  513. 'tableSummaryAlign': 'right',
  514. 'tableSummaryNumFormat': '0',
  515. }, {
  516. 'width': 53.99363831254071,
  517. 'title': '无形损',
  518. 'titleSync': false,
  519. 'field': 'wxs',
  520. 'checked': true,
  521. 'columnId': 'wxs',
  522. 'fixed': false,
  523. 'rowspan': 1,
  524. 'colspan': 1,
  525. 'align': 'right',
  526. 'halign': 'center',
  527. 'tableQRCodeLevel': 0,
  528. 'tableSummaryTitle': false,
  529. 'tableSummary': 'sum',
  530. 'tableSummaryAlign': 'right',
  531. 'tableSummaryNumFormat': '0',
  532. }, {
  533. 'width': 53.99363831254071,
  534. 'title': '报废合计',
  535. 'titleSync': false,
  536. 'field': 'bfhj',
  537. 'checked': true,
  538. 'columnId': 'bfhj',
  539. 'fixed': false,
  540. 'rowspan': 1,
  541. 'colspan': 1,
  542. 'align': 'right',
  543. 'halign': 'center',
  544. 'tableQRCodeLevel': 0,
  545. 'tableSummaryTitle': false,
  546. 'tableSummary': 'sum',
  547. 'tableSummaryAlign': 'right',
  548. 'tableSummaryNumFormat': '0',
  549. }, {
  550. 'width': 53.99363831254071,
  551. 'title': '工序节损数',
  552. 'titleSync': false,
  553. 'field': 'jss',
  554. 'checked': true,
  555. 'columnId': 'jss',
  556. 'fixed': false,
  557. 'rowspan': 1,
  558. 'colspan': 1,
  559. 'align': 'right',
  560. 'halign': 'center',
  561. 'tableQRCodeLevel': 0,
  562. 'tableSummaryTitle': false,
  563. 'tableSummary': 'sum',
  564. 'tableSummaryAlign': 'right',
  565. 'tableSummaryNumFormat': '0',
  566. }, {
  567. 'width': 53.99363831254071,
  568. 'title': '占投料报废率',
  569. 'titleSync': false,
  570. 'field': 'tlbfl',
  571. 'checked': true,
  572. 'columnId': 'tlbfl',
  573. 'fixed': false,
  574. 'rowspan': 1,
  575. 'colspan': 1,
  576. 'align': 'right',
  577. 'halign': 'center',
  578. 'tableQRCodeLevel': 0,
  579. 'tableSummaryTitle': true,
  580. 'tableSummary': '',
  581. }, {
  582. 'width': 53.99363831254071,
  583. 'title': '工序目标报废率',
  584. 'titleSync': false,
  585. 'field': 'mbbfl',
  586. 'checked': true,
  587. 'columnId': 'mbbfl',
  588. 'fixed': false,
  589. 'rowspan': 1,
  590. 'colspan': 1,
  591. 'align': 'right',
  592. 'halign': 'center',
  593. 'tableQRCodeLevel': 0,
  594. 'tableSummaryTitle': true,
  595. 'tableSummary': '',
  596. }, {
  597. 'width': 53.99363831254071,
  598. 'title': '工序实际报废率',
  599. 'titleSync': false,
  600. 'field': 'sjbfl',
  601. 'checked': true,
  602. 'columnId': 'sjbfl',
  603. 'fixed': false,
  604. 'rowspan': 1,
  605. 'colspan': 1,
  606. 'align': 'right',
  607. 'halign': 'center',
  608. 'tableQRCodeLevel': 0,
  609. 'tableSummaryTitle': true,
  610. 'tableSummary': '',
  611. }, {
  612. 'width': 53.99363831254071,
  613. 'title': '超节损承担比例',
  614. 'titleSync': false,
  615. 'field': 'cdbl',
  616. 'checked': true,
  617. 'columnId': 'cdbl',
  618. 'fixed': false,
  619. 'rowspan': 1,
  620. 'colspan': 1,
  621. 'align': 'right',
  622. 'halign': 'center',
  623. 'tableQRCodeLevel': 0,
  624. 'tableSummaryTitle': true,
  625. 'tableSummary': '',
  626. }, {
  627. 'width': 53.99363831254071,
  628. 'title': '工序超节损金额',
  629. 'titleSync': false,
  630. 'field': 'cjsje',
  631. 'checked': true,
  632. 'columnId': 'cjsje',
  633. 'fixed': false,
  634. 'rowspan': 1,
  635. 'colspan': 1,
  636. 'align': 'right',
  637. 'halign': 'center',
  638. 'tableQRCodeLevel': 0,
  639. 'tableSummaryTitle': false,
  640. 'tableSummary': 'sum',
  641. 'tableSummaryAlign': 'right',
  642. 'tableSummaryNumFormat': '1',
  643. }, {
  644. 'width': 53.99363831254071,
  645. 'title': '主管确认',
  646. 'titleSync': false,
  647. 'field': 'zgqr',
  648. 'checked': true,
  649. 'columnId': 'zgqr',
  650. 'fixed': false,
  651. 'rowspan': 1,
  652. 'colspan': 1,
  653. 'align': 'right',
  654. 'halign': 'center',
  655. 'tableQRCodeLevel': 0,
  656. 'tableSummaryTitle': true,
  657. 'tableSummary': '',
  658. }]],
  659. },
  660. 'printElementType': {
  661. 'title': '空白表格',
  662. 'type': 'table',
  663. 'editable': true,
  664. 'columnDisplayEditable': true,
  665. 'columnDisplayIndexEditable': true,
  666. 'columnTitleEditable': true,
  667. 'columnResizable': true,
  668. 'columnAlignEditable': true,
  669. 'isEnableEditField': true,
  670. 'isEnableContextMenu': true,
  671. 'isEnableInsertRow': true,
  672. 'isEnableDeleteRow': true,
  673. 'isEnableInsertColumn': true,
  674. 'isEnableDeleteColumn': true,
  675. 'isEnableMergeCell': true,
  676. },
  677. }, {
  678. 'options': {
  679. 'left': 301.5,
  680. 'top': 562.5,
  681. 'height': 19.5,
  682. 'width': 120,
  683. 'title': '复核:',
  684. 'coordinateSync': false,
  685. 'widthHeightSync': false,
  686. 'fontSize': 12,
  687. 'qrCodeLevel': 0,
  688. 'right': 292.5,
  689. 'bottom': 583.5000171661377,
  690. 'vCenter': 232.5,
  691. 'hCenter': 573.7500171661377,
  692. }, 'printElementType': { 'title': '文本', 'type': 'text' },
  693. }, {
  694. 'options': {
  695. 'left': 18,
  696. 'top': 562.5,
  697. 'height': 19.5,
  698. 'width': 120,
  699. 'title': '会签:',
  700. 'coordinateSync': false,
  701. 'widthHeightSync': false,
  702. 'fontSize': 12,
  703. 'qrCodeLevel': 0,
  704. 'right': 132,
  705. 'bottom': 582.0000171661377,
  706. 'vCenter': 72,
  707. 'hCenter': 572.2500171661377,
  708. }, 'printElementType': { 'title': '文本', 'type': 'text' },
  709. }, {
  710. 'options': {
  711. 'left': 643.5,
  712. 'top': 564,
  713. 'height': 19.5,
  714. 'width': 120,
  715. 'title': '审批:',
  716. 'coordinateSync': false,
  717. 'widthHeightSync': false,
  718. 'fontSize': 12,
  719. 'qrCodeLevel': 0,
  720. 'right': 190.5,
  721. 'bottom': 504.0000171661377,
  722. 'vCenter': 130.5,
  723. 'hCenter': 494.2500171661377,
  724. }, 'printElementType': { 'title': '文本', 'type': 'text' },
  725. }],
  726. 'paperNumberLeft': 816,
  727. 'paperNumberTop': 555,
  728. 'paperNumberContinue': true,
  729. 'backgroundColor': '#ffffff',
  730. 'orient': 2,
  731. 'overPrintOptions': { 'content': '', 'opacity': 0.7, 'type': 1 },
  732. 'watermarkOptions': {
  733. 'content': '',
  734. 'rotate': 25,
  735. 'timestamp': true,
  736. 'format': 'YYYY-MM-DD HH:mm',
  737. 'fillStyle': 'rgba(184, 184, 184, 0.3)',
  738. 'fontSize': '14px',
  739. 'width': 200,
  740. 'height': 200,
  741. },
  742. }],
  743. }
  744. const props = defineProps(['gdbh'])
  745. const input = ref(props?.['gdbh'])
  746. // 引入后使用示例
  747. hiprint.init()
  748. // 下列方法都是没有拖拽设计页面的, 相当于代码模式, 使用代码设计页面
  749. // 想要实现拖拽设计页面,请往下看 '自定义设计'
  750. const hiprintTemplate = new hiprint.PrintTemplate({ template: jsonData })
  751. const handlePrint = async() => {
  752. const params = {
  753. order: input.value,
  754. type: '1',
  755. }
  756. const res = await getOrderSuperLossCount(params)
  757. if (res['code'] === 0) {
  758. console.log(res['data'])
  759. const { data } = res
  760. const tableData = {
  761. 'gdbh': data['Gd_gdbh'],
  762. 'cpdh': data['成品代号'],
  763. 'cpmc': data['成品名称'],
  764. 'xsddh': data['销售订单号'],
  765. 'ddsl': data['订单数量'],
  766. 'sjtl': data['实际投料'],
  767. 'rcrq': data['warehousing_date'],
  768. 'rchj': data['warehousing_num'],
  769. 'clf': data['material_waste'],
  770. 'wff': data['waste_out'],
  771. 'ltcl': data['minor_processing'],
  772. 'zcf': data['zcfp'],
  773. 'zjf': data['waste_quality'],
  774. 'wxs': data['intangible_loss'],
  775. 'mbhgl': data['target_rate'],
  776. 'sjhgl': data['real_rate'],
  777. 'table': data['gy_data'].map(item => ({
  778. 'gxmc': `${item.Gy0_yjno}-${item.Gy0_gxh}-${item.Gy0_gxmc}-${item.Add_gxmc}`,
  779. 'jhcl': item['Gy0_计划接货数'],
  780. 'jhsh': item['Gy0_计划损耗'],
  781. 'zcf': item['total_fp'],
  782. 'zjf': item['waste_quality'],
  783. 'wxs': item['intangible_loss'],
  784. 'bfhj': item['total_waste'],
  785. 'jss': item['loss'],
  786. 'tlbfl': item['loss_rate'],
  787. 'mbbfl': item['target_loss_rate'],
  788. 'sjbfl': item['actual_loss_rate'],
  789. 'cdbl': item['超节损承担比例'],
  790. 'cjsje': item[''],
  791. 'zgqr': item[''],
  792. })),
  793. }
  794. hiprintTemplate.print(tableData)
  795. }
  796. }
  797. </script>
  798. <style scoped>
  799. </style>