You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1774 lines
68 KiB

2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
1 year ago
11 months ago
2 years ago
2 years ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
11 months ago
2 years ago
1 year ago
11 months ago
1 year ago
11 months ago
11 months ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
11 months ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
11 months ago
2 years ago
2 years ago
2 years ago
11 months ago
1 year ago
2 years ago
1 year ago
11 months ago
1 year ago
1 year ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
11 months ago
2 years ago
2 years ago
11 months ago
2 years ago
11 months ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
1 year ago
2 years ago
2 years ago
11 months ago
2 years ago
11 months ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
11 months ago
11 months ago
11 months ago
11 months ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
1 year ago
2 years ago
1 year ago
2 years ago
11 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
11 months ago
2 years ago
2 years ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
11 months ago
2 years ago
11 months ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
11 months ago
1 year ago
2 years ago
  1. <script>
  2. import PictureModule from '../part/picture/picture.vue'
  3. import {getExternalPartCustomerList, getExternalPartCustomerPage} from '../../../api/part/externalPartCustomer'
  4. import {getExternalPartPictureList} from '../../../api/part/externalPartPicture'
  5. import ExternalPart from '../part/external.vue'
  6. import CustomerInfo from '../customer/info.vue'
  7. import {getExternalPartManufacturerList} from '../../../api/part/externalPartManufacturer'
  8. import {
  9. getLabelFormatUserDefaultList,
  10. selectLabelFormatUserDefaultListByUserId
  11. } from '../../../api/label/labelFormatUserDefault'
  12. import LinkedFormat from './format/linkedFormat.vue'
  13. import {Decimal} from 'decimal.js'
  14. import {savePrintLabelRecord} from '../../../api/label/printLabelRecord'
  15. import dayjs from 'dayjs'
  16. import {printAlphaHardTagLabel} from '../../../printFormat/alphaHardTagPrintFormat'
  17. import {printAntennaLabel} from '../../../printFormat/antenna'
  18. import {printRF_RFIDLabel} from '../../../printFormat/RF_RFID'
  19. import getLodop from '@/utils/LodopFuncs.js'
  20. import {getTableDefaultListLanguage, getTableUserListLanguage} from '../../../api/table'
  21. import {getCategory, getCategoryList} from '../../../api/category/category'
  22. import QrCode from './QrCode.vue'
  23. import {savePrintRollLabelRecord} from '../../../api/label/printRollLabelRecord'
  24. import {print_roll_label} from '../../../printFormat/roll_label'
  25. import {saveLogisticLabelRecord} from '../../../api/label/LogisticLabelRecord'
  26. import {printLogisticLabel} from '../../../printFormat/logisticLabel'
  27. import {queryExternalLabelTemplate} from '../../../api/part/externalLabelTemplate'
  28. import {download} from '../../../api/oss/oss'
  29. import {savePartInfoByExcel} from '../../../api/part/external'
  30. import {importSerialNumber} from '../../../api/print/print'
  31. const printer = {
  32. customerNo: '',
  33. customerName: '',
  34. partNo: '',
  35. partDesc: '',
  36. active: 'Y',
  37. category: '',
  38. qtyPerCarton: 0,
  39. totalShipQty: 0,
  40. cartonCount: 1,
  41. manufacturerTime: '',
  42. manufacturerNo: '',
  43. moldCode: '',
  44. serialNumber: '',
  45. manufacturerRequired: '',
  46. moldCodeRequired: '',
  47. serialNumberRequired: '',
  48. qtyPerRoll: 0,
  49. rollsPerCarton: 0,
  50. orderNo: '',
  51. templateNo:'',
  52. printLabelType:0,
  53. }
  54. export default {
  55. name: 'printer',
  56. components: {QrCode, LinkedFormat, CustomerInfo, ExternalPart, PictureModule},
  57. props:{
  58. height:{
  59. type:Number,
  60. default:300
  61. },
  62. },
  63. data(){
  64. return{
  65. no:1,
  66. size:50,
  67. total:0,
  68. rowSpan: 8,
  69. printerSetupList:[],
  70. currentPrinter: '',
  71. printType: 'alphaHardTag',
  72. printLoading:false,
  73. searchPrinter: {
  74. ...printer
  75. },
  76. partCategoryList:[
  77. ],
  78. partVisible:false,
  79. customerVisible:false,
  80. printerList:[],
  81. activeName:"picture",
  82. currentPart:{
  83. },
  84. printCurrentPart:{
  85. ...printer
  86. },
  87. printVisible:false,
  88. pictureList:[],
  89. printRules:{
  90. moldCode: [{required: true, message: 'Please input Mold Code', trigger: ['blur','change']}],
  91. manufacturerNo: [{required: true, message: 'Please input Manufacturer', trigger: ['blur','change']}],
  92. serialNumber: [{required: true, message: 'Please input Serial Number', trigger: ['blur','change']}],
  93. qtyPerCarton: [{required: true, message: 'Please input Qty Per Carton', trigger: ['blur','change']}],
  94. rollsPerCarton: [{required: true, message: 'Please input Rolls Per Carton', trigger: ['blur','change']}],
  95. qtyPerRoll: [{required: true, message: 'Please input Qty Per Roll', trigger: ['blur','change']}],
  96. totalShipQty: [{required: true, message: 'Please input Total Ship Qty', trigger: ['blur','change']}],
  97. cartonCount: [{required: true, message: 'Please input Carton Count', trigger: ['blur','change']}],
  98. manufacturerTime: [{required: true, message: 'Please input Manufacturer Date', trigger: ['blur','change']}],
  99. orderNo: [{required: true, message: 'Please input PO', trigger: ['blur','change']}],
  100. poNo: [{required: true, message: 'Please input PO No', trigger: ['blur','change']}],
  101. invoiceNo: [{required: true, message: 'Please input Invoice No', trigger: ['blur','change']}],
  102. unitQtyPerPallet: [{required: true, message: 'Please input Unit Qty Per Pallet', trigger: ['blur','change']}],
  103. countOfPallets: [{required: true, message: 'Please input Count Of Pallets', trigger: ['blur','change']}],
  104. },
  105. columnList:[
  106. {
  107. userId: this.$store.state.user.name,
  108. functionId: 30004,
  109. serialNumber: '30004TableCustomerNo',
  110. tableId: "30004Table",
  111. tableName: "Part Customer Table",
  112. columnProp: "customerNo",
  113. headerAlign: "center",
  114. align: "left",
  115. columnLabel: "Customer No",
  116. columnHidden: false,
  117. columnImage: false,
  118. columnSortable: false,
  119. sortLv: 10,
  120. status: true,
  121. fixed: '',
  122. columnWidth: 80
  123. },{
  124. userId: this.$store.state.user.name,
  125. functionId: 30004,
  126. serialNumber: '30004TableCustomerName',
  127. tableId: "30004Table",
  128. tableName: "Part Customer Table",
  129. columnProp: "customerName",
  130. headerAlign: "center",
  131. align: "left",
  132. columnLabel: "Customer Name",
  133. columnHidden: false,
  134. columnImage: false,
  135. columnSortable: false,
  136. sortLv: 10,
  137. status: true,
  138. fixed: '',
  139. columnWidth: 120
  140. },{
  141. userId: this.$store.state.user.name,
  142. functionId: 30004,
  143. serialNumber: '30004TablePartNo',
  144. tableId: "30004Table",
  145. tableName: "Part Customer Table",
  146. columnProp: "partNo",
  147. headerAlign: "center",
  148. align: "left",
  149. columnLabel: "Part No",
  150. columnHidden: false,
  151. columnImage: false,
  152. columnSortable: false,
  153. sortLv: 10,
  154. status: true,
  155. fixed: '',
  156. columnWidth: 120
  157. },{
  158. userId: this.$store.state.user.name,
  159. functionId: 30004,
  160. serialNumber: '30004TablePartDesc',
  161. tableId: "30004Table",
  162. tableName: "Part Customer Table",
  163. columnProp: "partDesc",
  164. headerAlign: "center",
  165. align: "left",
  166. columnLabel: "Part Description",
  167. columnHidden: false,
  168. columnImage: false,
  169. columnSortable: false,
  170. sortLv: 10,
  171. status: true,
  172. fixed: '',
  173. columnWidth: 120
  174. },{
  175. userId: this.$store.state.user.name,
  176. functionId: 30004,
  177. serialNumber: '30004TableRev',
  178. tableId: "30004Table",
  179. tableName: "Part Customer Table",
  180. columnProp: "rev",
  181. headerAlign: "center",
  182. align: "left",
  183. columnLabel: "Part REV",
  184. columnHidden: false,
  185. columnImage: false,
  186. columnSortable: false,
  187. sortLv: 10,
  188. status: true,
  189. fixed: '',
  190. columnWidth: 80
  191. },{
  192. userId: this.$store.state.user.name,
  193. functionId: 30004,
  194. serialNumber: '30004TableCategory',
  195. tableId: "30004Table",
  196. tableName: "Part Customer Table",
  197. columnProp: "category",
  198. headerAlign: "center",
  199. align: "left",
  200. columnLabel: "Part Category",
  201. columnHidden: false,
  202. columnImage: false,
  203. columnSortable: false,
  204. sortLv: 10,
  205. status: true,
  206. fixed: '',
  207. columnWidth: 120
  208. },{
  209. userId: this.$store.state.user.name,
  210. functionId: 30004,
  211. serialNumber: '30004TableUmName',
  212. tableId: "30004Table",
  213. tableName: "Part Customer Table",
  214. columnProp: "umName",
  215. headerAlign: "center",
  216. align: "left",
  217. columnLabel: "UM",
  218. columnHidden: false,
  219. columnImage: false,
  220. columnSortable: false,
  221. sortLv: 10,
  222. status: true,
  223. fixed: '',
  224. columnWidth: 120
  225. },{
  226. userId: this.$store.state.user.name,
  227. functionId: 30004,
  228. serialNumber: '30004TableFreeInfo',
  229. tableId: "30004Table",
  230. tableName: "Part Customer Table",
  231. columnProp: "freeInfo",
  232. headerAlign: "center",
  233. align: "left",
  234. columnLabel: "Free Info",
  235. columnHidden: false,
  236. columnImage: false,
  237. columnSortable: false,
  238. sortLv: 10,
  239. status: true,
  240. fixed: '',
  241. columnWidth: 120
  242. },{
  243. userId: this.$store.state.user.name,
  244. functionId: 30004,
  245. serialNumber: '30004TableFreeInfo2',
  246. tableId: "30004Table",
  247. tableName: "Part Customer Table",
  248. columnProp: "freeInfo2",
  249. headerAlign: "center",
  250. align: "left",
  251. columnLabel: "OOC",
  252. columnHidden: false,
  253. columnImage: false,
  254. columnSortable: false,
  255. sortLv: 10,
  256. status: true,
  257. fixed: '',
  258. columnWidth: 120
  259. },
  260. {
  261. userId: this.$store.state.user.name,
  262. functionId: 30004,
  263. serialNumber: '30004TableTradingMark',
  264. tableId: "30004Table",
  265. tableName: "Part Customer Table",
  266. columnProp: "tradingMark",
  267. headerAlign: "center",
  268. align: "left",
  269. columnLabel: "Trading Mark",
  270. columnHidden: false,
  271. columnImage: false,
  272. columnSortable: false,
  273. sortLv: 10,
  274. status: true,
  275. fixed: '',
  276. columnWidth: 120
  277. },{
  278. userId: this.$store.state.user.name,
  279. functionId: 30004,
  280. serialNumber: '30004TablePackingWeight',
  281. tableId: "30004Table",
  282. tableName: "Part Customer Table",
  283. columnProp: "packingWeight",
  284. headerAlign: "center",
  285. align: "left",
  286. columnLabel: "Packing Weight",
  287. columnHidden: false,
  288. columnImage: false,
  289. columnSortable: false,
  290. sortLv: 10,
  291. status: true,
  292. fixed: '',
  293. columnWidth: 120
  294. },{
  295. userId: this.$store.state.user.name,
  296. functionId: 30004,
  297. serialNumber: '30004TableWeightUM',
  298. tableId: "30004Table",
  299. tableName: "Part Customer Table",
  300. columnProp: "weightUmName",
  301. headerAlign: "center",
  302. align: "left",
  303. columnLabel: "Weight UM",
  304. columnHidden: false,
  305. columnImage: false,
  306. columnSortable: false,
  307. sortLv: 10,
  308. status: true,
  309. fixed: '',
  310. columnWidth: 120
  311. },
  312. {
  313. userId: this.$store.state.user.name,
  314. functionId: 30004,
  315. serialNumber: '30004TableActive',
  316. tableId: "30004Table",
  317. tableName: "Part Customer Table",
  318. columnProp: "active",
  319. headerAlign: "center",
  320. align: "left",
  321. columnLabel: "Active",
  322. columnHidden: false,
  323. columnImage: false,
  324. columnSortable: false,
  325. sortLv: 10,
  326. status: true,
  327. fixed: '',
  328. columnWidth: 120
  329. }
  330. ],
  331. pictureColumnList:[
  332. {
  333. userId: this.$store.state.user.name,
  334. functionId: 30004,
  335. serialNumber: '30004Table2PictureNo',
  336. tableId: "30004Table2",
  337. tableName: "外部料号图片信息表",
  338. columnProp: "certificationNo",
  339. headerAlign: "center",
  340. align: "left",
  341. columnLabel: "Certification Code",
  342. columnHidden: false,
  343. columnImage: false,
  344. columnSortable: false,
  345. sortLv: 10,
  346. status: true,
  347. fixed: '',
  348. columnWidth: 80
  349. },{
  350. userId: this.$store.state.user.name,
  351. functionId: 30004,
  352. serialNumber: '30004Table2PictureDesc',
  353. tableId: "30004Table2",
  354. tableName: "外部料号图片信息表",
  355. columnProp: "pictureDesc",
  356. headerAlign: "center",
  357. align: "left",
  358. columnLabel: "Certification Desc",
  359. columnHidden: false,
  360. columnImage: false,
  361. columnSortable: false,
  362. sortLv: 10,
  363. status: true,
  364. fixed: '',
  365. columnWidth: 180
  366. },{
  367. userId: this.$store.state.user.name,
  368. functionId: 30004,
  369. serialNumber: '30004Table2CreateBy',
  370. tableId: "30004Table2",
  371. tableName: "外部料号图片信息表",
  372. columnProp: "createBy",
  373. headerAlign: "center",
  374. align: "left",
  375. columnLabel: "Created By",
  376. columnHidden: false,
  377. columnImage: false,
  378. columnSortable: false,
  379. sortLv: 10,
  380. status: true,
  381. fixed: '',
  382. columnWidth: 80
  383. },{
  384. userId: this.$store.state.user.name,
  385. functionId: 30004,
  386. serialNumber: '30004Table2CreateTime',
  387. tableId: "30004Table2",
  388. tableName: "外部料号图片信息表",
  389. columnProp: "createTime",
  390. headerAlign: "center",
  391. align: "center",
  392. columnLabel: "Created Time",
  393. columnHidden: false,
  394. columnImage: false,
  395. columnSortable: false,
  396. sortLv: 10,
  397. status: true,
  398. fixed: '',
  399. columnWidth: 180
  400. },{
  401. userId: this.$store.state.user.name,
  402. functionId: 30004,
  403. serialNumber: '30004Table2UpdateBy',
  404. tableId: "30004Table2",
  405. tableName: "外部料号图片信息表",
  406. columnProp: "updateBy",
  407. headerAlign: "center",
  408. align: "left",
  409. columnLabel: "Updated By",
  410. columnHidden: false,
  411. columnImage: false,
  412. columnSortable: false,
  413. sortLv: 10,
  414. status: true,
  415. fixed: '',
  416. columnWidth: 80
  417. },{
  418. userId: this.$store.state.user.name,
  419. functionId: 30004,
  420. serialNumber: '30004Table2UpdateTime',
  421. tableId: "30004Table2",
  422. tableName: "外部料号图片信息表",
  423. columnProp: "updateTime",
  424. headerAlign: "center",
  425. align: "center",
  426. columnLabel: "Updated Time",
  427. columnHidden: false,
  428. columnImage: false,
  429. columnSortable: false,
  430. sortLv: 10,
  431. status: true,
  432. fixed: '',
  433. columnWidth: 180
  434. },
  435. ],
  436. formatColumnList:[
  437. {
  438. userId: this.$store.state.user.name,
  439. functionId: 30004,
  440. serialNumber: '30004Table3LabelType',
  441. tableId: "30004Table3",
  442. tableName: "标签模板信息表",
  443. columnProp: "labelType",
  444. headerAlign: "center",
  445. align: "center",
  446. columnLabel: "Label Type",
  447. columnHidden: false,
  448. columnImage: false,
  449. columnSortable: false,
  450. sortLv: 10,
  451. status: true,
  452. fixed: '',
  453. columnWidth: 80
  454. },{
  455. userId: this.$store.state.user.name,
  456. functionId: 30004,
  457. serialNumber: '30004Table3FormatId',
  458. tableId: "30004Table3",
  459. tableName: "标签模板信息表",
  460. columnProp: "formatId",
  461. headerAlign: "center",
  462. align: "left",
  463. columnLabel: "Format ID",
  464. columnHidden: false,
  465. columnImage: false,
  466. columnSortable: false,
  467. sortLv: 10,
  468. status: true,
  469. fixed: '',
  470. columnWidth: 180
  471. },{
  472. userId: this.$store.state.user.name,
  473. functionId: 30004,
  474. serialNumber: '30004Table3FormatDesc',
  475. tableId: "30004Table3",
  476. tableName: "标签模板信息表",
  477. columnProp: "formatDesc",
  478. headerAlign: "center",
  479. align: "left",
  480. columnLabel: "Format Desc",
  481. columnHidden: false,
  482. columnImage: false,
  483. columnSortable: false,
  484. sortLv: 10,
  485. status: true,
  486. fixed: '',
  487. columnWidth: 180
  488. },{
  489. userId: this.$store.state.user.name,
  490. functionId: 30004,
  491. serialNumber: '30004Table3DefaultFormat',
  492. tableId: "30004Table3",
  493. tableName: "标签模板信息表",
  494. columnProp: "defaultFlag",
  495. headerAlign: "center",
  496. align: "center",
  497. columnLabel: "Default Format",
  498. columnHidden: false,
  499. columnImage: false,
  500. columnSortable: false,
  501. sortLv: 10,
  502. status: true,
  503. fixed: '',
  504. columnWidth: 80
  505. },{
  506. userId: this.$store.state.user.name,
  507. functionId: 30004,
  508. serialNumber: '30004Table3Remark',
  509. tableId: "30004Table3",
  510. tableName: "标签模板信息表",
  511. columnProp: "remark",
  512. headerAlign: "center",
  513. align: "left",
  514. columnLabel: "Remark",
  515. columnHidden: false,
  516. columnImage: false,
  517. columnSortable: false,
  518. sortLv: 10,
  519. status: true,
  520. fixed: '',
  521. columnWidth: 180
  522. },{
  523. userId: this.$store.state.user.name,
  524. functionId: 30004,
  525. serialNumber: '30004Table3DefaultPrinterName',
  526. tableId: "30004Table3",
  527. tableName: "标签模板信息表",
  528. columnProp: "defaultPrinterName",
  529. headerAlign: "center",
  530. align: "left",
  531. columnLabel: "Default Printer Name",
  532. columnHidden: false,
  533. columnImage: false,
  534. columnSortable: false,
  535. sortLv: 10,
  536. status: true,
  537. fixed: '',
  538. columnWidth: 180
  539. },
  540. ],
  541. manufacturerList:[],
  542. labelFormatList:[],
  543. base64List:[],
  544. status:0,
  545. currentPartLogistic:{
  546. site:this.$store.state.user.site,
  547. partNo:'',
  548. partDesc:'',
  549. poNo:'',
  550. unitQtyPerPallet:1,
  551. countOfPallets:1,
  552. umName:'',
  553. customerNo:'',
  554. invoiceNo:'',
  555. },
  556. logisticVisible:false,
  557. templateList:[],
  558. printTest:false,
  559. serialNumberList:[],
  560. scanSerialNumberList:[],
  561. serialNumberVisible:false,
  562. scanObj:{
  563. serialNumber:'',
  564. },
  565. importExcelVisible:false,
  566. fileList:[],
  567. importExcelLoading:false,
  568. }
  569. },
  570. watch:{
  571. currentPart(newVal,oldVal){
  572. this.getExternalPartPictureList();
  573. this.selectLabelFormatUserDefaultListByUserId();
  574. },
  575. "searchPrinter.customerNo"(newVal,oldVal){
  576. this.searchPrinter.customerNo = newVal.toUpperCase();
  577. },
  578. "searchPrinter.partNo"(newVal,oldVal){
  579. this.searchPrinter.partNo = newVal.toUpperCase();
  580. },
  581. "printCurrentPart.cartonCount"(newVal,oldVal){
  582. if (newVal && newVal > 0){
  583. this.printCurrentPart.cartonCount = Math.ceil(newVal)
  584. }
  585. this.printCurrentPart.totalShipQty = this.totalShipQty();
  586. },
  587. "printCurrentPart.qtyPerRoll"(newVal,oldVal){
  588. this.printCurrentPart.qtyPerCarton = this.qtyPerCarton();
  589. },
  590. "printCurrentPart.rollsPerCarton"(newVal,oldVal){
  591. this.printCurrentPart.qtyPerCarton = this.qtyPerCarton();
  592. },
  593. "printCurrentPart.qtyPerCarton"(newVal,oldVal){
  594. this.printCurrentPart.totalShipQty = this.totalShipQty();
  595. },
  596. printVisible(newVal,oldVal){
  597. if (newVal === false){
  598. this.printTest = false;
  599. this.serialNumberList = [];
  600. }
  601. },
  602. logisticVisible(newVal,oldVal){
  603. if (newVal === false){
  604. this.printTest = false;
  605. }
  606. },
  607. serialNumberVisible(newVal,oldVal){
  608. if (newVal === false){
  609. this.scanObj.serialNumber = '';
  610. this.scanSerialNumberList = [];
  611. }
  612. },
  613. importExcelVisible(newVal,oldVal){
  614. if (newVal === false){
  615. this.$refs.uploadFile.clearFiles();
  616. this.importExcelLoading = false;
  617. }
  618. },
  619. printLoading(newVal,oldVal){
  620. if (newVal === true){
  621. setTimeout(()=>{
  622. this.printLoading = false
  623. },5000)
  624. }
  625. }
  626. },
  627. methods:{
  628. rowStyle({row}){
  629. if (row.site === this.currentPart.site && row.partNo === this.currentPart.partNo && row.customerNo === this.currentPart.customerNo){
  630. return {background: 'rgb(232,246,246)',}
  631. }
  632. },
  633. handleClick(row){
  634. this.currentPart = {...row};
  635. },
  636. getExternalPartCustomerList(){
  637. let params = {
  638. ...this.searchPrinter,
  639. site:this.$store.state.user.site
  640. }
  641. getExternalPartCustomerList(params).then(({data})=>{
  642. if (data && data.code === 0){
  643. this.printerList = data.rows;
  644. if (this.printerList.length > 0){
  645. this.currentPart = {...this.printerList[0]}
  646. }
  647. }else {
  648. this.$message.warning(data.msg)
  649. }
  650. }).catch((error)=>{
  651. this.$message.error(error)
  652. })
  653. },
  654. getExternalPartPictureList(){
  655. let params = {
  656. partNo: this.currentPart.partNo,
  657. site: this.currentPart.site,
  658. pictureClassify:'BoxPicture'
  659. }
  660. getExternalPartPictureList(params).then(({data})=>{
  661. if (data && data.code === 0){
  662. this.pictureList = data.rows;
  663. this.convertToBase64(this.pictureList.map((item)=>item.pictureUrl))
  664. }else {
  665. this.$message.warning(data.msg)
  666. }
  667. }).catch((error)=>{
  668. this.$message.error(error)
  669. })
  670. },
  671. handlePrintLogisticLabel(){
  672. let labelList = this.labelFormatList.filter((item)=> item.labelType === 'Logistic Label')
  673. if (labelList.length === 0){
  674. this.$message.warning("There is no maintenance of print label format")
  675. return
  676. }
  677. this.getExternalPartPictureList();
  678. this.selectLabelFormatUserDefaultListByUserId();
  679. this.currentPartLogistic = {
  680. site:this.currentPart.site,
  681. partNo:this.currentPart.partNo,
  682. partDesc:this.currentPart.partDesc,
  683. poNo:'',
  684. category:this.currentPart.category,
  685. unitQtyPerPallet:1,
  686. countOfPallets:1,
  687. umName: this.currentPart.umName,
  688. customerNo:this.currentPart.customerNo,
  689. invoiceNo:'',
  690. }
  691. this.logisticVisible = true;
  692. },
  693. handlePrint(status){
  694. this.printCurrentPart = JSON.parse(JSON.stringify(this.currentPart))
  695. let labelList = [];
  696. if (status === 1){
  697. labelList = this.labelFormatList.filter((item)=> item.labelType === 'Roll Label')
  698. this.printCurrentPart.rollsPerCarton = 1;
  699. this.$set(this.printCurrentPart,'orderNo','')
  700. }else if (status === 0){
  701. labelList = this.labelFormatList.filter((item)=> item.labelType === 'Shipment Carton')
  702. }
  703. if (labelList.length === 0){
  704. this.$message.warning("There is no maintenance of print label format")
  705. return
  706. }
  707. for (let label of labelList) {
  708. if (!label.defaultPrinterName){
  709. this.$message.warning("The default printer name is not set")
  710. return
  711. }
  712. }
  713. this.status = status;
  714. this.$set(this.printCurrentPart,'cartonCount',1)
  715. this.$set(this.printCurrentPart,'manufacturerNo','')
  716. this.$set(this.printCurrentPart,'totalShipQty',undefined)
  717. this.$set(this.printCurrentPart,'moldCode','')
  718. this.$set(this.printCurrentPart,'serialNumber',undefined)
  719. this.$set(this.printCurrentPart,'manufacturerTime',dayjs().format('YYYY-MM-DD HH:mm:ss'))
  720. if (this.currentPart.serialNumberRequired === 'Y'){
  721. this.printCurrentPart.qtyPerRoll = 1;
  722. this.printCurrentPart.rollsPerCarton = 1;
  723. this.printCurrentPart.qtyPerCarton = 1;
  724. this.printCurrentPart.totalShipQty = 1;
  725. }else {
  726. this.printCurrentPart.qtyPerCarton = this.currentPart.qtyPerCarton;
  727. this.printCurrentPart.qtyPerRoll = this.currentPart.qtyPerRoll;
  728. this.printCurrentPart.rollsPerCarton = this.currentPart.rollsPerCarton;
  729. this.printCurrentPart.totalShipQty = this.totalShipQty();
  730. }
  731. if (this.currentPart.manufacturerRequired === 'Y'){
  732. // 查询所有的 manufacturer
  733. this.getExternalPartManufacturerList();
  734. }
  735. if (this.currentPart.moldCodeRequired === 'Y'){
  736. this.printCurrentPart.moldCode = this.currentPart.moldCode;
  737. }
  738. if (this.printCurrentPart.category === 'Hardware(Antenna)-Serials'){
  739. this.$set(this.printCurrentPart,'printLabelType',0)
  740. this.handleQueryTemplate();
  741. }
  742. this.handleQueryCategory();
  743. },
  744. handleQueryTemplate(){
  745. let params = {
  746. partNo: this.currentPart.partNo,
  747. site: this.currentPart.site,
  748. }
  749. this.templateList = [];
  750. queryExternalLabelTemplate(params).then(({data})=>{
  751. if (data && data.code === 0){
  752. this.templateList = data.rows;
  753. if (this.templateList.length > 0){
  754. this.$set(this.printCurrentPart,'templateNo',this.templateList[0].templateNo)
  755. }
  756. }else {
  757. this.$message.warning(data.msg)
  758. }
  759. }).catch((error)=>{
  760. this.$message.error(error)
  761. })
  762. },
  763. handleQueryCategory(){
  764. // 获取 category
  765. let params = {
  766. categoryValue: this.currentPart.category,
  767. }
  768. getCategory(params).then(({data})=>{
  769. if (data && data.code === 0){
  770. this.$set(this.printCurrentPart,'qtyPerRollLabel',data.data.qtyPerRollLabel)
  771. this.$set(this.printCurrentPart,'cartonCountLabel',data.data.cartonCountLabel)
  772. this.$set(this.printCurrentPart,'rollCountLabel',data.data.rollCountLabel)
  773. this.$set(this.printCurrentPart,'showCartonQtyPerRoll',data.data.showCartonQtyPerRoll)
  774. this.$set(this.printCurrentPart,'showCartonRollsPerCarton',data.data.showCartonRollsPerCarton)
  775. this.$set(this.printCurrentPart,'showRollQtyPerRoll',data.data.showRollQtyPerRoll)
  776. this.$set(this.printCurrentPart,'editQtyPerCarton',data.data.editQtyPerCarton)
  777. this.printRules.qtyPerRoll[0].message = `Please input ${data.data.qtyPerRollLabel}`
  778. if (this.status === 0){
  779. if (data.data.showCartonRollsPerCarton === 'N' && data.data.showCartonQtyPerRoll === 'N'){
  780. this.rowSpan = 8
  781. }else if (data.data.showCartonRollsPerCarton === 'N' || data.data.showCartonQtyPerRoll === 'N'){
  782. this.rowSpan = 6
  783. }else {
  784. this.rowSpan = 5
  785. }
  786. this.printRules.cartonCount[0].message = `Please input ${data.data.cartonCountLabel}`
  787. }else {
  788. if (data.data.showRollQtyPerRoll === 'N'){
  789. this.rowSpan = 12
  790. }else {
  791. this.rowSpan = 8
  792. }
  793. this.printRules.cartonCount[0].message = `Please input ${data.data.rollCountLabel}`
  794. }
  795. this.getExternalPartPictureList();
  796. this.selectLabelFormatUserDefaultListByUserId();
  797. this.printVisible = true;
  798. }else {
  799. this.$message.warning(data.msg)
  800. }
  801. }).catch((error)=>{
  802. this.$message.error(error)
  803. })
  804. },
  805. getExternalPartManufacturerList(){
  806. let params = {
  807. site: this.currentPart.site,
  808. partNo: this.currentPart.partNo,
  809. }
  810. getExternalPartManufacturerList(params).then(({data})=>{
  811. if (data && data.code === 0){
  812. this.manufacturerList = data.rows;
  813. if (this.manufacturerList.length > 0){
  814. this.printCurrentPart.manufacturerNo = this.manufacturerList[0].manufacturerNo;
  815. }
  816. }else {
  817. this.$message.warning(data.msg)
  818. }
  819. }).catch((error)=>{
  820. this.$message.error(error)
  821. })
  822. },
  823. handlePrintOrSave(){
  824. if ((this.printCurrentPart.category !== 'Hardware(Antenna)-Serials' || this.$store.state.user.autoSerialNumber !== 'Y') &&this.printCurrentPart.serialNumberRequired === 'Y' && this.serialNumberList.length <= 0){
  825. this.$message.warning("Please input Serial Number")
  826. return
  827. }
  828. this.$refs.printForm.validate((valid,obj) => {
  829. if (valid){
  830. if(this.status === 0){
  831. this.savePrintLabelRecord();
  832. }else if (this.status === 1){
  833. this.savePrintRollLabelRecord();
  834. }
  835. }else {
  836. for (let i = 0; i < Object.keys(obj).length; i++) {
  837. this.$message.warning(obj[Object.keys(obj)[i]][0].message)
  838. return
  839. }
  840. }
  841. })
  842. },
  843. savePrintLabelRecord(){
  844. let params = {
  845. ...this.printCurrentPart,
  846. serialNumberList:this.serialNumberList.map((item)=>{return item.serialNumber}),
  847. createBy: this.$store.state.user.name
  848. }
  849. this.printLoading = true;
  850. savePrintLabelRecord(params).then(({data})=>{
  851. if (data && data.code === 0) {
  852. let labelList = data.rows
  853. let icons = this.base64List.map((item)=>{return{icon: item,}})
  854. for (let i = 0; i < labelList.length; i++) {
  855. let item = labelList[i];
  856. let params = {
  857. qrCode: `(00)${item.partNo}(01)${item.qtyPerCarton}(02)${item.umName}(03)${item.manufacturerDate}(04)${item.serialNumber? item.serialNumber : ''}(05)${item.manufacturerNo? item.manufacturerNo : ''}(06)${item.moldCode? item.moldCode : ''}(07)${item.boxNo? item.boxNo : ''}(08)(09)(10)`,
  858. ref: item.partNo,
  859. productRev: item.rev,
  860. qty: item.qtyPerCarton,
  861. uom: item.umName,
  862. desc: item.partDesc,
  863. rollCount: item.qtyPerRoll,
  864. date: item.manufacturerDate,
  865. manufacturer: item.manufacturerNo,
  866. moldCode: item.moldCode,
  867. sn: item.serialNumber,
  868. freeInfo2: item.freeInfo2,
  869. tradingMark: item.tradingMark,
  870. weightUmName: item.weightUmName,
  871. pictureMap:item.pictureMap,
  872. printLabelType:item.printLabelType,
  873. templateNo:item.templateNo,
  874. dateStr:item.dateStr,
  875. printStr1:item.printStr1,
  876. printStr2:item.printStr2,
  877. printStr3:item.printStr3,
  878. offsetX:item.offsetX,
  879. offsetY:item.offsetY,
  880. direction:item.direction,
  881. showPound:this.$store.state.user.showPound === 'Y'?item.showPound:'N',
  882. }
  883. if (item.packingWeight){
  884. params.weight = new Decimal(item.packingWeight).mul(item.qtyPerCarton).toNumber();
  885. }
  886. let qrCodeList = this.$refs.qrCode.init([params.qrCode])
  887. params.qrCode = qrCodeList[0]
  888. if (item.printType === 'Alpha/Hard Tag'){
  889. printAlphaHardTagLabel([params],icons,item.printerName,this.printTest)
  890. }else if (item.printType === 'Hardware(Antenna)'){
  891. if (this.printCurrentPart.category === 'Hardware(Antenna)-Serials'){
  892. printAntennaLabel([params],icons,item.printerName,this.$store.state.user.autoSerialNumber,this.printTest)
  893. }else {
  894. printAntennaLabel([params],icons,item.printerName,'N',this.printTest)
  895. }
  896. }else if (item.printType === 'RF' || this.currentPart.category === 'RFID'){
  897. printRF_RFIDLabel([params],icons,item.printerName,this.printTest)
  898. }
  899. this.printTest = false
  900. }
  901. // let notFound = [];
  902. // // 打印机集合
  903. // let labelList = this.labelFormatList.filter((item)=> item.labelType === 'Shipment Carton')
  904. // for (let label of labelList) {
  905. // let prints = data.rows.map((item) => {
  906. // let params = {
  907. // qrCode: `(00)${item.partNo}(01)${item.qtyPerCarton}(02)${item.umName}(03)${item.manufacturerDate}(04)${item.serialNumber? item.serialNumber : ''}(05)${item.manufacturerNo? item.manufacturerNo : ''}(06)${item.moldCode? item.moldCode : ''}(07)${item.boxNo? item.boxNo : ''}(08)(09)(10)`,
  908. // ref: item.partNo,
  909. // productRev: item.rev,
  910. // qty: item.qtyPerCarton,
  911. // uom: item.umName,
  912. // desc: item.partDesc,
  913. // rollCount: item.qtyPerRoll,
  914. // date: item.manufacturerDate,
  915. // manufacturer: item.manufacturerNo,
  916. // moldCode: item.moldCode,
  917. // sn: item.serialNumber,
  918. // freeInfo2: item.freeInfo2,
  919. // tradingMark: item.tradingMark,
  920. // weightUmName: item.weightUmName,
  921. // pictureMap:item.pictureMap,
  922. // printLabelType:item.printLabelType,
  923. // templateNo:item.templateNo,
  924. // dateStr:item.dateStr,
  925. // printStr1:item.printStr1,
  926. // printStr2:item.printStr2,
  927. // printStr3:item.printStr3,
  928. // }
  929. // if (item.packingWeight){
  930. // params.weight = new Decimal(item.packingWeight).mul(item.qtyPerCarton).toNumber();
  931. // }
  932. // return params
  933. // });
  934. // let qrCodeList = this.$refs.qrCode.init(prints.map((item)=>{
  935. // return item.qrCode
  936. // }))
  937. // for (let i = 0; i < qrCodeList.length; i++) {
  938. // prints[i].qrCode = qrCodeList[i]
  939. // }
  940. // let icons = this.base64List.map((item)=>{return{icon: item,}})
  941. // if (!this.printerSetupList.includes(label.defaultPrinterName)) {
  942. // notFound.push(label.defaultPrinterName)
  943. // continue
  944. // }
  945. // if (label.printType === 'Alpha/Hard Tag'){
  946. // printAlphaHardTagLabel(prints,icons,label.defaultPrinterName)
  947. // }else if (label.printType === 'Hardware(Antenna)'){
  948. // if (this.printCurrentPart.category === 'Hardware(Antenna)-Serials'){
  949. // printAntennaLabel(prints,icons,label.defaultPrinterName,this.$store.state.user.autoSerialNumber)
  950. // }else {
  951. // printAntennaLabel(prints,icons,label.defaultPrinterName)
  952. // }
  953. // }else if (label.printType === 'RF' || this.currentPart.category === 'RFID'){
  954. // printRF_RFIDLabel(prints,icons,label.defaultPrinterName)
  955. // }
  956. // }
  957. // if (notFound.length > 0){
  958. // this.$message.warning(`The printer ${notFound.join(',')} is not found`)
  959. // }else {
  960. // this.$message.success("Print label success")
  961. // }
  962. }else {
  963. this.$message.warning(data.msg)
  964. }
  965. this.printLoading = false;
  966. }).catch((error)=>{
  967. this.$message.error(error)
  968. this.printLoading = false;
  969. })
  970. },
  971. handlePartRowClick(row){
  972. this.searchPrinter.partNo = row.partNo;
  973. this.partVisible = false;
  974. },
  975. handleCustomerRowClick(row){
  976. this.searchPrinter.customerNo = row.customerNo;
  977. this.customerVisible = false;
  978. },
  979. closePrintDialog(){
  980. this.manufacturerList = [];
  981. this.printCurrentPart = {
  982. ...printer
  983. }
  984. this.$refs.printForm.resetFields();
  985. },
  986. selectLabelFormatUserDefaultListByUserId(){
  987. let params = {
  988. site:this.currentPart.site,
  989. partNo:this.currentPart.partNo,
  990. username:this.$store.state.user.name,
  991. category:this.currentPart.category,
  992. }
  993. getLabelFormatUserDefaultList(params).then(({data})=>{
  994. if (data && data.code === 0){
  995. this.labelFormatList = data.rows;
  996. }else {
  997. this.$message.warning(data.msg)
  998. }
  999. }).catch((error)=>{
  1000. this.$message.error(error)
  1001. })
  1002. },
  1003. handleCartonCount(){
  1004. if (this.printCurrentPart.totalShipQty && this.printCurrentPart.qtyPerCarton && this.printCurrentPart.totalShipQty !== 0 && this.printCurrentPart.qtyPerCarton !== 0){
  1005. this.printCurrentPart.cartonCount = new Decimal(new Decimal(this.printCurrentPart.totalShipQty).div(this.printCurrentPart.qtyPerCarton).toFixed(2)).toSignificantDigits().toNumber();
  1006. }else {
  1007. this.printCurrentPart.cartonCount = 0
  1008. }
  1009. },
  1010. async convertToBase64(fileUrls) {
  1011. this.base64List = []
  1012. for (const fileUrl of fileUrls) {
  1013. const base64Url = await this.getFileAsBase64(fileUrl);
  1014. this.base64List.push(base64Url);
  1015. }
  1016. },
  1017. getFileAsBase64(fileUrl) {
  1018. return new Promise((resolve, reject) => {
  1019. const img = new Image();
  1020. img.crossOrigin = 'Anonymous';
  1021. img.src = fileUrl;
  1022. img.onload = () => {
  1023. const canvas = document.createElement('canvas');
  1024. const ctx = canvas.getContext('2d');
  1025. canvas.width = img.width;
  1026. canvas.height = img.height;
  1027. ctx.drawImage(img, 0, 0);
  1028. const base64data = canvas.toDataURL('image/jpeg');
  1029. resolve(base64data);
  1030. };
  1031. img.onerror = (error) => {
  1032. reject(error);
  1033. };
  1034. });
  1035. },
  1036. async getTableUserColumn (tableId, columnId) {
  1037. let queryTableUser = {
  1038. userId: this.$store.state.user.name,
  1039. functionId: this.$route.meta.menuId,
  1040. tableId: tableId,
  1041. status: true,
  1042. languageCode: this.$i18n.locale
  1043. }
  1044. await getTableUserListLanguage(queryTableUser).then(({data}) => {
  1045. if (data.rows.length > 0) {
  1046. this.caseTable(data.rows,columnId)
  1047. } else {
  1048. this.getColumnList(tableId, columnId)
  1049. }
  1050. })
  1051. },
  1052. // 获取 tableDefault 列
  1053. async getColumnList (tableId, columnId) {
  1054. let queryTable = {
  1055. functionId: this.$route.meta.menuId,
  1056. tableId: tableId,
  1057. languageCode: this.$i18n.locale
  1058. }
  1059. await getTableDefaultListLanguage(queryTable).then(({data}) => {
  1060. if (data.rows.length > 0) {
  1061. this.caseTable(data.rows,columnId)
  1062. } else {
  1063. }
  1064. })
  1065. },
  1066. caseTable(list,columnId){
  1067. if (list.length > 0){
  1068. switch (columnId) {
  1069. case 1:
  1070. this.columnList = list
  1071. break;
  1072. case 2:
  1073. this.pictureColumnList = list
  1074. break;
  1075. case 3:
  1076. this.formatColumnList = list
  1077. break;
  1078. }
  1079. }
  1080. },
  1081. qtyPerCarton(){
  1082. return new Decimal(this.printCurrentPart.qtyPerRoll).mul(this.printCurrentPart.rollsPerCarton).toNumber()
  1083. },
  1084. totalShipQty(){
  1085. return new Decimal(this.printCurrentPart.qtyPerCarton).mul(this.printCurrentPart.cartonCount).toNumber()
  1086. },
  1087. getCategoryList(){
  1088. let params = {};
  1089. getCategoryList(params).then(({data})=>{
  1090. if (data && data.code === 0){
  1091. this.partCategoryList = data.rows;
  1092. }else {
  1093. this.$message.warning(data.msg)
  1094. }
  1095. }).catch((error)=>{
  1096. this.$message.error(error)
  1097. })
  1098. },
  1099. savePrintRollLabelRecord(){
  1100. // 新增 打印记录
  1101. let params = {
  1102. ...this.printCurrentPart,
  1103. serialNumberList: this.serialNumberList.map((item)=>{
  1104. return item.serialNumber
  1105. }),
  1106. }
  1107. this.printLoading = true;
  1108. // 请求接口
  1109. savePrintRollLabelRecord(params).then(({data})=>{
  1110. if (data && data.code === 0) {
  1111. let labelList = this.labelFormatList.filter((item)=> item.labelType === 'Roll Label')
  1112. let prints = data.rows.map((item) => {
  1113. return {
  1114. qrCode: `(00)${item.partNo}(01)${item.qtyPerRoll}(02)${item.umName}(03)${item.manufacturerDate}(04)${item.serialNumber? item.serialNumber : ''}(05)${item.manufacturerNo? item.manufacturerNo : ''}(06)${item.moldCode? item.moldCode : ''}(07)(08)${item.rollNo}(09)(10)`,
  1115. ref: item.partNo,
  1116. rev: item.rev,
  1117. qty: item.qtyPerRoll,
  1118. uom: item.umName,
  1119. desc: item.partDesc,
  1120. date: item.manufacturerDate,
  1121. manufacturer: item.manufacturerNo,
  1122. moldCode: item.moldCode,
  1123. rollNo: item.rollNo,
  1124. sn: item.serialNumber,
  1125. rollLabelRequired: item.rollLabelRequired,
  1126. serialNumberRequired: item.serialNumberRequired,
  1127. serialNumber: item.serialNumber,
  1128. rollLabelFlag: item.rollLabelFlag,// 判断标签类型
  1129. offsetX:item.offsetX,
  1130. offsetY:item.offsetY,
  1131. direction:item.direction,
  1132. }
  1133. });
  1134. let qrCodeList = this.$refs.qrCode.init(prints.map((item)=>{
  1135. return item.qrCode
  1136. }))
  1137. for (let i = 0; i < qrCodeList.length; i++) {
  1138. prints[i].qrCode = qrCodeList[i]
  1139. }
  1140. let notFound = [];
  1141. for (let label of labelList) {
  1142. if (!this.printerSetupList.includes(label.defaultPrinterName)) {
  1143. notFound.push(label.defaultPrinterName)
  1144. continue
  1145. }
  1146. print_roll_label(prints,label.defaultPrinterName,this.printTest)
  1147. }
  1148. this.printTest = false
  1149. if (notFound.length > 0){
  1150. this.$message.warning(`The printer ${notFound.join(',')} is not found`)
  1151. return
  1152. }
  1153. this.$message.success(data.msg)
  1154. }else {
  1155. this.$message.warning(data.msg)
  1156. }
  1157. this.printLoading = false;
  1158. }).catch((error)=>{
  1159. this.$message.error(error)
  1160. this.printLoading = false;
  1161. })
  1162. },
  1163. loadQrCode(){
  1164. let arr = ['2','4','6','8']
  1165. console.log(this.$refs.qrCode.init(arr))
  1166. },
  1167. getLodopPrinterName(){
  1168. const lodop = getLodop()
  1169. for (let i = 0; i < lodop.GET_PRINTER_COUNT(); i++) {
  1170. this.printerSetupList.push(lodop.GET_PRINTER_NAME(i))
  1171. }
  1172. },
  1173. handleGetExternalPartCustomerPage(){
  1174. let params = {
  1175. ...this.searchPrinter,
  1176. site:this.$store.state.user.site,
  1177. no:this.no,
  1178. size:this.size,
  1179. }
  1180. getExternalPartCustomerPage(params).then(({data})=>{
  1181. if (data && data.code === 0){
  1182. this.printerList = data.rows;
  1183. if (this.printerList.length > 0){
  1184. this.currentPart = {...this.printerList[0]}
  1185. }
  1186. this.total = data.total;
  1187. }else {
  1188. this.$message.warning(data.msg)
  1189. }
  1190. }).catch((error)=>{
  1191. this.$message.error(error)
  1192. })
  1193. },
  1194. handleSizeChange(val){
  1195. this.size = val;
  1196. this.handleGetExternalPartCustomerPage();
  1197. },
  1198. handleCurrentChange(val){
  1199. this.no = val;
  1200. this.handleGetExternalPartCustomerPage();
  1201. },
  1202. handlePrintLogistic(){
  1203. this.$refs.logisticForm.validate((valid,obj) => {
  1204. if (valid){
  1205. this.savePrintLogisticLabel()
  1206. }else {
  1207. let i = 0
  1208. Object.keys(obj).forEach(key=>{
  1209. if (i++ === 0){
  1210. this.$message.warning(obj[key][0].message)
  1211. }
  1212. })
  1213. }
  1214. })
  1215. this.printLoading = false;
  1216. },
  1217. savePrintLogisticLabel() {
  1218. let params = {
  1219. ...this.currentPartLogistic,
  1220. createBy: this.$store.state.user.name,
  1221. }
  1222. this.printLoading = true;
  1223. saveLogisticLabelRecord(params).then(({data})=>{
  1224. if (data && data.code === 0){
  1225. let labelList = this.labelFormatList.filter((item)=> item.labelType === 'Logistic Label')
  1226. for (let i = 0; i < this.currentPartLogistic.countOfPallets; i++) {
  1227. let row = {
  1228. qrCode: `(00)${this.currentPartLogistic.partNo? this.currentPartLogistic.partNo : ''}(01)${this.currentPartLogistic.unitQtyPerPallet? this.currentPartLogistic.unitQtyPerPallet : ''}(02)${this.currentPartLogistic.umName? this.currentPartLogistic.umName : ''}(03)(04)(05)(06)(07)(08)(09)(10)${this.currentPartLogistic.poNo? this.currentPartLogistic.poNo : ''}`,
  1229. partNo:this.currentPartLogistic.partNo,
  1230. partDesc:this.currentPartLogistic.partDesc,
  1231. poNo:this.currentPartLogistic.poNo,
  1232. qty:this.currentPartLogistic.unitQtyPerPallet,
  1233. umName:this.currentPartLogistic.umName,
  1234. invoiceNo:this.currentPartLogistic.invoiceNo,
  1235. offsetX:data.row.offsetX,
  1236. offsetY:data.row.offsetY,
  1237. direction:data.row.direction,
  1238. }
  1239. let qrCodeList = this.$refs.qrCode.init([row.qrCode])
  1240. row.qrCode = qrCodeList[0]
  1241. let notFound = [];
  1242. for (let label of labelList) {
  1243. if (!this.printerSetupList.includes(label.defaultPrinterName)) {
  1244. notFound.push(label.defaultPrinterName)
  1245. continue
  1246. }
  1247. printLogisticLabel([row],label.defaultPrinterName,this.printTest)
  1248. }
  1249. this.printTest = false
  1250. if (notFound.length > 0){
  1251. this.$message.warning(`The printer ${notFound.join(',')} is not found`)
  1252. return
  1253. }
  1254. }
  1255. this.$message.success(data.msg)
  1256. }else {
  1257. this.$message.warning(data.msg)
  1258. }
  1259. this.printLoading = false;
  1260. }).catch((error)=>{
  1261. this.$message.error(error)
  1262. this.printLoading = false;
  1263. })
  1264. },
  1265. handlePrintTest(val){
  1266. this.printTest = true
  1267. if (val === 0){
  1268. this.handlePrintOrSave();
  1269. }else {
  1270. this.handlePrintLogistic();
  1271. }
  1272. },
  1273. handleScan(){
  1274. // 判断是否为空
  1275. if (!this.scanObj.serialNumber){
  1276. this.$message.warning("Please input Serial Number")
  1277. return
  1278. }
  1279. // 判断是否重复
  1280. let map = this.scanSerialNumberList.map((item)=>item.serialNumber)
  1281. if(map.includes(this.scanObj.serialNumber)){
  1282. this.$message.warning("Serial Number already exists")
  1283. return
  1284. }
  1285. this.scanSerialNumberList.push(this.scanObj)
  1286. this.scanObj = {
  1287. serialNumber:''
  1288. }
  1289. },
  1290. deleteSerialNumber(index,type){
  1291. this.$confirm('Are you sure you want to delete Serial Number?', 'Warning', {
  1292. confirmButtonText: 'OK',
  1293. cancelButtonText: 'Cancel',
  1294. type: 'warning',
  1295. zIndex:3000
  1296. }).then(() => {
  1297. if (type === 'scan'){
  1298. this.scanSerialNumberList.splice(index,1)
  1299. }else if (type === 'end'){
  1300. this.serialNumberList.splice(index,1)
  1301. }
  1302. this.$message.success('success')
  1303. })
  1304. },
  1305. onChange(file, fileList){
  1306. const fileSuffix = file.name.substring(file.name.lastIndexOf(".") + 1);
  1307. const whiteList = ["xls", "xlsx"];
  1308. if (whiteList.indexOf(fileSuffix) === -1) {
  1309. this.$message.error("Only Excel files (.xls, .xlsx) are allowed!");
  1310. this.fileList.splice(this.fileList.length - 1, 1);
  1311. return
  1312. }
  1313. this.fileList = fileList;
  1314. },
  1315. downloadTemplate(){
  1316. let params = {
  1317. orderRef1:'println',
  1318. orderRef2:'printlnExcel',
  1319. }
  1320. download(params).then(({data})=>{
  1321. // 不限制文件下载类型
  1322. const blob = new Blob([data], {type: "application/octet-stream"})
  1323. // 下载文件名称
  1324. const fileName = 'SN Template.xlsx'
  1325. // a标签下载
  1326. const linkNode = document.createElement('a')
  1327. // a标签的download属性规定下载文件的名称
  1328. linkNode.download = fileName
  1329. linkNode.style.display = 'none'
  1330. // 生成一个Blob URL
  1331. linkNode.href = URL.createObjectURL(blob)
  1332. document.body.appendChild(linkNode)
  1333. // 模拟在按钮上的一次鼠标单击
  1334. linkNode.click()
  1335. // 释放URL 对象
  1336. URL.revokeObjectURL(linkNode.href)
  1337. document.body.removeChild(linkNode)
  1338. })
  1339. },
  1340. handleImportExcel(){
  1341. if (null == this.fileList || 0 === this.fileList.length) {
  1342. this.$message.error("Please upload the file first!")
  1343. return false
  1344. }
  1345. // 提示将删除之前的数据
  1346. this.$confirm('Do you confirm the upload? If the Serial Number already exists, we will delete it!', 'Warning', {
  1347. confirmButtonText: 'OK',
  1348. cancelButtonText: 'Cancel',
  1349. type: 'warning',
  1350. zIndex:3000
  1351. }).then(() => {
  1352. // 判断文件是否上传
  1353. if (null == this.fileList || 0 === this.fileList.length) {
  1354. this.$message.error("please select the file you want to upload!")
  1355. return
  1356. }
  1357. const formData = new FormData()
  1358. formData.append("file", this.fileList[0].raw)
  1359. this.importExcelLoading = true;
  1360. importSerialNumber(formData).then(({data}) => {
  1361. if (data && data.code === 0){
  1362. this.serialNumberList = data.rows.map((item)=>{
  1363. return {
  1364. serialNumber:item,
  1365. }
  1366. })
  1367. this.importExcelVisible = false;
  1368. }else {
  1369. this.$message.warning(data.msg)
  1370. }
  1371. this.importExcelLoading = false;
  1372. })
  1373. }).catch(() => {
  1374. this.importExcelLoading = false;
  1375. });
  1376. },
  1377. handleSaveSerialNumber(){
  1378. if (this.scanSerialNumberList.length === 0){
  1379. this.$message.warning("Please input Serial Number")
  1380. return
  1381. }
  1382. this.serialNumberList = [...this.scanSerialNumberList]
  1383. this.$message.success("success")
  1384. this.serialNumberVisible = false
  1385. },
  1386. handleScanSerialNumber(){
  1387. this.scanSerialNumberList = [...this.serialNumberList]
  1388. this.serialNumberVisible = true
  1389. }
  1390. },
  1391. mounted () {
  1392. this.getLodopPrinterName();
  1393. },
  1394. created () {
  1395. // this.getExternalPartCustomerList();
  1396. this.handleGetExternalPartCustomerPage();
  1397. this.getCategoryList();
  1398. this.getTableUserColumn("30004Table",1)
  1399. this.getTableUserColumn("30004Table2",2)
  1400. this.getTableUserColumn("30004Table3",3)
  1401. }
  1402. }
  1403. </script>
  1404. <template>
  1405. <div>
  1406. <div style="min-width: 800px;max-width: 1300px">
  1407. <el-form :model="searchPrinter" label-position="top">
  1408. <el-row :gutter="10">
  1409. <el-col :span="3">
  1410. <el-form-item label="Customer No">
  1411. <span slot="label" style="cursor:pointer;" @click="customerVisible=true"><a herf="#">Customer No</a></span>
  1412. <el-input v-model="searchPrinter.customerNo" clearable></el-input>
  1413. </el-form-item>
  1414. </el-col>
  1415. <el-col :span="6">
  1416. <el-form-item label="Customer Name">
  1417. <el-input v-model="searchPrinter.customerName" clearable></el-input>
  1418. </el-form-item>
  1419. </el-col>
  1420. <el-col :span="3">
  1421. <el-form-item label="Part Active">
  1422. <el-select v-model="searchPrinter.active" style="width: 100%;" placeholder="">
  1423. <el-option label="All" value=""></el-option>
  1424. <el-option label="Active" value="Y"></el-option>
  1425. <el-option label="Not Active" value="N"></el-option>
  1426. </el-select>
  1427. </el-form-item>
  1428. </el-col>
  1429. <el-col :span="3">
  1430. <el-form-item label=" ">
  1431. <el-button type="primary" style="width: 60px" @click="handleGetExternalPartCustomerPage">Query</el-button>
  1432. </el-form-item>
  1433. </el-col>
  1434. </el-row>
  1435. <el-row :gutter="10">
  1436. <el-col :span="3">
  1437. <el-form-item label="Part No">
  1438. <span slot="label" style="cursor:pointer;" @click="partVisible=true"><a herf="#">Part No</a></span>
  1439. <el-input v-model="searchPrinter.partNo" clearable></el-input>
  1440. </el-form-item>
  1441. </el-col>
  1442. <el-col :span="6">
  1443. <el-form-item label="Part Description">
  1444. <el-input v-model="searchPrinter.partDesc" clearable></el-input>
  1445. </el-form-item>
  1446. </el-col>
  1447. <el-col :span="3">
  1448. <el-form-item label="Part Category">
  1449. <el-select v-model="searchPrinter.category" style="width: 100%;" placeholder="">
  1450. <el-option label="All" value=""></el-option>
  1451. <el-option :label="item.categoryName" :value="item.categoryValue" :key="item.id" v-for="item in partCategoryList"></el-option>
  1452. </el-select>
  1453. </el-form-item>
  1454. </el-col>
  1455. <el-col :span="12" >
  1456. <el-form-item label=" ">
  1457. <el-button type="primary" @click="handlePrint(0)">Print-Carton Label</el-button>
  1458. <el-button type="primary" v-if="$store.state.user.autoSerialNumber !== 'Y'" @click="handlePrint(1)" >Print-Roll Label</el-button>
  1459. <el-button type="primary" @click="handlePrintLogisticLabel">Print Logistic Label</el-button>
  1460. </el-form-item>
  1461. </el-col>
  1462. </el-row>
  1463. </el-form>
  1464. </div>
  1465. <qr-code ref="qrCode"></qr-code>
  1466. <el-table :data="printerList" @row-click="handleClick" style="width: 100%;margin-top: 10px" border :height="height" :row-style="rowStyle">
  1467. <el-table-column
  1468. v-for="(item,index) in columnList" :key="index"
  1469. :sortable="item.columnSortable"
  1470. :prop="item.columnProp"
  1471. :header-align="item.headerAlign"
  1472. :show-overflow-tooltip="item.showOverflowTooltip"
  1473. :align="item.align"
  1474. :fixed="item.fixed===''?false:item.fixed"
  1475. :min-width="item.columnWidth"
  1476. :label="item.columnLabel">
  1477. <template slot-scope="scope">
  1478. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  1479. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  1480. style="width: 100px; height: 80px"/></span>
  1481. </template>
  1482. </el-table-column>
  1483. </el-table>
  1484. <el-pagination
  1485. @size-change="handleSizeChange"
  1486. @current-change="handleCurrentChange"
  1487. :current-page.sync="no"
  1488. :page-sizes="[50,100, 200, 300, 400]"
  1489. :page-size="size"
  1490. layout="sizes, prev, pager, next,total"
  1491. :total="total">
  1492. </el-pagination>
  1493. <el-tabs v-model="activeName">
  1494. <el-tab-pane label="Part Certification" name="picture">
  1495. <picture-module :column-list="pictureColumnList" :height="330" :part="currentPart" @refresh="getExternalPartPictureList" :of-components="true" :data-list="pictureList"></picture-module>
  1496. </el-tab-pane>
  1497. <el-tab-pane label="Linked Format" name="format">
  1498. <linked-format :column-list="formatColumnList" :height="330" :data-list="labelFormatList"></linked-format>
  1499. </el-tab-pane>
  1500. </el-tabs>
  1501. <el-dialog v-drag title="Print Label" :close-on-click-modal="false" @close="closePrintDialog" :visible.sync="printVisible" width="600px" modal-append-to-body>
  1502. <el-form :model="printCurrentPart" ref="printForm" :rules="printRules" label-position="top" >
  1503. <el-row :gutter="10">
  1504. <el-col :span="status === 0? 24:8">
  1505. <el-form-item label="Part No">
  1506. <el-input v-model="printCurrentPart.partNo" disabled></el-input>
  1507. </el-form-item>
  1508. </el-col>
  1509. <el-col :span="16" v-if="status !== 0">
  1510. <el-form-item label="PO" prop="orderNo" v-if="false" :show-message="false">
  1511. <el-input v-model="printCurrentPart.orderNo"></el-input>
  1512. </el-form-item>
  1513. </el-col>
  1514. <el-col :span="24">
  1515. <el-form-item label="Part Description">
  1516. <el-input v-model="printCurrentPart.partDesc" disabled></el-input>
  1517. </el-form-item>
  1518. </el-col>
  1519. <el-col :span="rowSpan" v-if="(status === 0 && printCurrentPart.showCartonQtyPerRoll === 'Y') || (status === 1 && printCurrentPart.showRollQtyPerRoll === 'Y')">
  1520. <el-form-item v-if="printCurrentPart.serialNumberRequired === 'Y'" :label="printCurrentPart.qtyPerRollLabel" :show-message="false">
  1521. <el-input-number :step="0" :min="1" :controls="false" v-model="printCurrentPart.qtyPerRoll" disabled></el-input-number>
  1522. </el-form-item>
  1523. <el-form-item v-else key="qtyPerRoll" :label="printCurrentPart.qtyPerRollLabel" prop="qtyPerRoll" :show-message="false">
  1524. <el-input-number :step="0" :min="1" :controls="false" v-model="printCurrentPart.qtyPerRoll"></el-input-number>
  1525. </el-form-item>
  1526. </el-col>
  1527. <el-col :span="rowSpan" v-if="status === 0 && printCurrentPart.showCartonRollsPerCarton === 'Y'">
  1528. <el-form-item v-if="printCurrentPart.serialNumberRequired === 'Y'" label="Rolls Per Carton" :show-message="false">
  1529. <el-input-number :step="0" :min="1" :controls="false" v-model="printCurrentPart.rollsPerCarton" disabled></el-input-number>
  1530. </el-form-item>
  1531. <el-form-item v-else key="rollsPerCarton" label="Rolls Per Carton" prop="rollsPerCarton" :show-message="false">
  1532. <el-input-number :step="0" :min="1" :controls="false" v-model="printCurrentPart.rollsPerCarton"></el-input-number>
  1533. </el-form-item>
  1534. </el-col>
  1535. <el-col :span="rowSpan" v-if="status === 0">
  1536. <el-form-item v-if="printCurrentPart.serialNumberRequired === 'Y'" label="Qty Per Carton" :show-message="false">
  1537. <el-input-number :step="0" :controls="false" v-model="printCurrentPart.qtyPerCarton" :disabled="printCurrentPart.editQtyPerCarton === 'N'"></el-input-number>
  1538. </el-form-item>
  1539. <el-form-item v-else label="Qty Per Carton" prop="qtyPerCarton" key="qtyPerCarton" :show-message="false">
  1540. <el-input-number :step="0" :controls="false" v-model="printCurrentPart.qtyPerCarton" :disabled="printCurrentPart.editQtyPerCarton === 'N'"></el-input-number>
  1541. </el-form-item>
  1542. </el-col>
  1543. <el-col :span="(status === 0 && rowSpan === 5)? rowSpan-1:rowSpan">
  1544. <el-form-item v-if="printCurrentPart.serialNumberRequired === 'Y' && $store.state.user.autoSerialNumber !== 'Y'" :label="status === 0 ? printCurrentPart.cartonCountLabel:printCurrentPart.rollCountLabel" :show-message="false">
  1545. <el-input-number :step="0" :min="1" :controls="false" v-model="printCurrentPart.cartonCount" disabled></el-input-number>
  1546. </el-form-item>
  1547. <el-form-item v-else key="cartonCount" :label="status === 0 ? printCurrentPart.cartonCountLabel:printCurrentPart.rollCountLabel" prop="cartonCount" :show-message="false">
  1548. <el-input-number :step="0" :min="1" :precision="0" :controls="false" v-model="printCurrentPart.cartonCount"></el-input-number>
  1549. </el-form-item>
  1550. </el-col>
  1551. <el-col :span="rowSpan">
  1552. <el-form-item v-if="printCurrentPart.serialNumberRequired === 'Y'" label="Total Ship Qty" :show-message="false">
  1553. <el-input-number :step="0" :min="0" :controls="false" v-model="printCurrentPart.totalShipQty" disabled></el-input-number>
  1554. </el-form-item>
  1555. <el-form-item v-else label="Total Ship Qty" prop="totalShipQty" key="totalShipQty" :show-message="false">
  1556. <el-input-number :step="0" :min="0" :controls="false" v-model="printCurrentPart.totalShipQty" disabled></el-input-number>
  1557. </el-form-item>
  1558. </el-col>
  1559. <el-col :span="24" v-if="printCurrentPart.category !== 'Hardware(Antenna)-Serials' || $store.state.user.autoSerialNumber !== 'Y'">
  1560. <!-- <el-form-item v-if="printCurrentPart.serialNumberRequired === 'Y'" key="serialNumber" label="Serial Number" prop="serialNumber" :show-message="false">-->
  1561. <!-- <el-input v-model="printCurrentPart.serialNumber"></el-input>-->
  1562. <!-- </el-form-item>-->
  1563. <el-form-item v-if="printCurrentPart.serialNumberRequired !== 'Y'" label="Serial Number" :show-message="false">
  1564. <el-input v-model="printCurrentPart.serialNumber" disabled></el-input>
  1565. </el-form-item>
  1566. </el-col>
  1567. <el-col :span="8">
  1568. <el-form-item label="Manufacturer Date" prop="manufacturerTime" :show-message="false">
  1569. <el-date-picker type="date"
  1570. placeholder=" " value-format="yyyy-MM-dd HH:mm:ss" v-model="printCurrentPart.manufacturerTime" style="width: 100%">
  1571. </el-date-picker>
  1572. </el-form-item>
  1573. </el-col>
  1574. <el-col :span="8">
  1575. <el-form-item v-if="printCurrentPart.manufacturerRequired === 'Y'" key="manufacturerNo" label="Manufacturer" prop="manufacturerNo" :show-message="false">
  1576. <el-select v-model="printCurrentPart.manufacturerNo" style="width: 100%" placeholder="">
  1577. <el-option v-for="item in manufacturerList" :key="item.manufacturerNo" :label="item.manufacturerNo" :value="item.manufacturerNo">
  1578. <span style="float: left">{{ item.manufacturerNo }}</span>
  1579. </el-option>
  1580. </el-select>
  1581. </el-form-item>
  1582. <el-form-item v-else label="Manufacturer" :show-message="false">
  1583. <el-select v-model="printCurrentPart.manufacturerNo" style="width: 100%" disabled placeholder="">
  1584. <el-option v-for="item in manufacturerList" :key="item.manufacturerNo" :label="item.manufacturerNo" :value="item.manufacturerNo">
  1585. <span style="float: left">{{ item.manufacturerNo }}</span>
  1586. </el-option>
  1587. </el-select>
  1588. </el-form-item>
  1589. </el-col>
  1590. <el-col :span="8">
  1591. <el-form-item v-if="printCurrentPart.moldCodeRequired === 'Y'" key="moldCode" label="Mold Code" prop="moldCode" :show-message="false">
  1592. <el-input v-model="printCurrentPart.moldCode" ></el-input>
  1593. </el-form-item>
  1594. <el-form-item v-else label="Mold Code" :show-message="false">
  1595. <el-input v-model="printCurrentPart.moldCode" disabled></el-input>
  1596. </el-form-item>
  1597. </el-col>
  1598. </el-row>
  1599. <el-row :gutter="10" v-if="$store.state.user.autoSerialNumber === 'Y' && printCurrentPart.category === 'Hardware(Antenna)-Serials'">
  1600. <el-col :span="8">
  1601. <el-form-item label="Template">
  1602. <el-select v-model="printCurrentPart.templateNo" style="width: 100%">
  1603. <el-option v-for="item in templateList" :key="item.templateNo" :label="item.templateName" :value="item.templateNo"/>
  1604. </el-select>
  1605. </el-form-item>
  1606. </el-col>
  1607. <el-col :span="8">
  1608. <el-form-item label="Label Type">
  1609. <el-select v-model="printCurrentPart.printLabelType" style="width: 100%">
  1610. <el-option label="Carton Label & Product Label" :value="0"></el-option>
  1611. <el-option label="Carton Label" :value="1"></el-option>
  1612. <el-option label="Product Label" :value="2"></el-option>
  1613. </el-select>
  1614. </el-form-item>
  1615. </el-col>
  1616. </el-row>
  1617. <el-row :gutter="10" v-if="printCurrentPart.serialNumberRequired === 'Y' && (printCurrentPart.category !== 'Hardware(Antenna)-Serials' || $store.state.user.autoSerialNumber !== 'Y')">
  1618. <el-col :span="6">
  1619. Serial Number List
  1620. </el-col>
  1621. <el-col :span="14">
  1622. <el-button type="primary" @click="importExcelVisible = true">Import from Excel</el-button>
  1623. <el-button type="primary" @click="handleScanSerialNumber">Individual Serial Number</el-button>
  1624. </el-col>
  1625. <el-col :span="2">
  1626. <div style="text-align: right;color: #00a0e9">Total:</div>
  1627. </el-col>
  1628. <el-col :span="2">
  1629. <div style="color: #00a0e9">{{serialNumberList.length}}</div>
  1630. </el-col>
  1631. <el-col :span="24">
  1632. <el-table :data="serialNumberList" height="200px" border>
  1633. <el-table-column label="Serial Number" prop="serialNumber" min-width="300"></el-table-column>
  1634. <el-table-column min-width="100" label="Action">
  1635. <template slot-scope="{row,$index}">
  1636. <a @click="deleteSerialNumber($index,'end')">Delete</a>
  1637. </template>
  1638. </el-table-column>
  1639. </el-table>
  1640. </el-col>
  1641. </el-row>
  1642. </el-form>
  1643. <div slot="footer" style="text-align: center; margin-top: 10px">
  1644. <el-row :gutter="10">
  1645. <el-col :span="8">
  1646. <el-button type="primary" icon="el-icon-printer" :loading="printLoading" style="width: 40px;float:left;" @click="handlePrintTest(0)"></el-button>
  1647. </el-col>
  1648. <el-col :span="8">
  1649. <el-button type="primary" :loading="printLoading" style="width: 60px" @click="handlePrintOrSave">Print</el-button>
  1650. <el-button style="width: 60px" @click="printVisible = false">Cancel</el-button>
  1651. </el-col>
  1652. </el-row>
  1653. </div>
  1654. </el-dialog>
  1655. <el-dialog v-drag title="Print Label" :close-on-click-modal="false" :visible.sync="logisticVisible" width="400px">
  1656. <el-form :model="currentPartLogistic" label-position="top" :rules="printRules" ref="logisticForm">
  1657. <el-row :gutter="10">
  1658. <el-col :span="12">
  1659. <el-form-item label="Part No" :show-message="false">
  1660. <el-input v-model="currentPartLogistic.partNo" disabled></el-input>
  1661. </el-form-item>
  1662. </el-col>
  1663. <el-col :span="24">
  1664. <el-form-item label="Part Description" :show-message="false">
  1665. <el-input v-model="currentPartLogistic.partDesc" disabled></el-input>
  1666. </el-form-item>
  1667. </el-col>
  1668. <el-col :span="12">
  1669. <el-form-item label="PO No" prop="poNo" :show-message="false">
  1670. <el-input v-model="currentPartLogistic.poNo"></el-input>
  1671. </el-form-item>
  1672. </el-col>
  1673. <el-col :span="12">
  1674. <el-form-item label="Invoice No" :show-message="false">
  1675. <el-input v-model="currentPartLogistic.invoiceNo"></el-input>
  1676. </el-form-item>
  1677. </el-col>
  1678. <el-col :span="12">
  1679. <el-form-item label="Unit Qty per Pallet" prop="unitQtyPerPallet" :show-message="false">
  1680. <el-input-number :controls="false" :step="0" :min="0" v-model="currentPartLogistic.unitQtyPerPallet"></el-input-number>
  1681. </el-form-item>
  1682. </el-col>
  1683. <el-col :span="12">
  1684. <el-form-item label="Count of Pallets" prop="countOfPallets" :show-message="false">
  1685. <el-input-number :controls="false" :step="0" :min="1" v-model="currentPartLogistic.countOfPallets"></el-input-number>
  1686. </el-form-item>
  1687. </el-col>
  1688. </el-row>
  1689. </el-form>
  1690. <div slot="footer" style="text-align: center; margin-top: 10px">
  1691. <el-row :gutter="10">
  1692. <el-col :span="7">
  1693. <el-button type="primary" icon="el-icon-printer" :loading="printLoading" style="width: 40px;float:left;" @click="handlePrintTest(1)"></el-button>
  1694. </el-col>
  1695. <el-col :span="10">
  1696. <el-button type="primary" :loading="printLoading" style="width: 60px" @click="handlePrintLogistic">Print</el-button>
  1697. <el-button style="width: 60px" @click="logisticVisible = false">Cancel</el-button>
  1698. </el-col>
  1699. </el-row>
  1700. </div>
  1701. </el-dialog>
  1702. <el-dialog v-drag title="Individual Serial Number" top="20vh" :visible.sync="serialNumberVisible" append-to-body :close-on-click-modal="false" width="600px">
  1703. <el-form :model="scanObj" label-position="top" @submit.native.prevent>
  1704. <el-form-item label="Serial Number(Press Enter after scanning/input)" :show-message="false">
  1705. <el-input v-model="scanObj.serialNumber" @keyup.enter.native="handleScan"></el-input>
  1706. </el-form-item>
  1707. </el-form>
  1708. <el-table :data="scanSerialNumberList" height="200px" border>
  1709. <el-table-column label="Serial Number" prop="serialNumber" min-width="300"></el-table-column>
  1710. <el-table-column min-width="100" label="Action">
  1711. <template slot-scope="{row,$index}">
  1712. <a @click="deleteSerialNumber($index,'scan')">Delete</a>
  1713. </template>
  1714. </el-table-column>
  1715. </el-table>
  1716. <div style="color: #00a0e9">Total: {{scanSerialNumberList.length}}</div>
  1717. <div slot="footer" style="text-align: center; margin-top: 10px">
  1718. <el-button type="primary" style="width: 60px" @click="handleSaveSerialNumber">Save</el-button>
  1719. <el-button style="width: 60px" @click="serialNumberVisible = false">Cancel</el-button>
  1720. </div>
  1721. </el-dialog>
  1722. <el-dialog v-drag title="Import from Excel" top="20vh" :visible.sync="importExcelVisible" modal-append-to-body :close-on-click-modal="false" width="390px">
  1723. <div style="margin-top: 5px; margin-bottom: 10px">
  1724. <el-button type="primary" @click="downloadTemplate">Download file template</el-button>
  1725. </div>
  1726. <el-upload class="customer-upload" :file-list="fileList" drag action="javascript:void(0);" ref="uploadFile" :limit="1" accept=".xlsx,.xls"
  1727. :on-remove="onChange" :on-change="onChange" :auto-upload="false">
  1728. <i class="el-icon-upload"></i>
  1729. <div class="el-upload__text">Drag the file hereor<em> click to upload</em></div>
  1730. </el-upload>
  1731. <div slot="footer" style="text-align: center; margin-top: 10px">
  1732. <el-button type="primary" :loading="importExcelLoading" @click="handleImportExcel">{{importExcelLoading?'Saving...':'Save'}}</el-button>
  1733. <el-button style="width: 60px" @click="importExcelVisible = false">Cancel</el-button>
  1734. </div>
  1735. </el-dialog>
  1736. <el-dialog v-drag title="Select Part" :close-on-click-modal="false" :visible.sync="partVisible">
  1737. <external-part :height="450" :of-components="true" @rowClick="handlePartRowClick"></external-part>
  1738. <div slot="footer" style="text-align: center; margin-top: 10px"></div>
  1739. </el-dialog>
  1740. <el-dialog v-drag title="Select Customer" :close-on-click-modal="false" :visible.sync="customerVisible">
  1741. <customer-info :height="450" :of-components="true" @rowClick="handleCustomerRowClick"></customer-info>
  1742. <div slot="footer" style="text-align: center; margin-top: 10px"></div>
  1743. </el-dialog>
  1744. <div v-show="false">
  1745. <img :src="item" v-for="(item,index) in base64List" :key="index" style="display: none">
  1746. </div>
  1747. </div>
  1748. </template>
  1749. <style scoped>
  1750. </style>