Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 

1 рядок
41 KiB

  1. {"ast":null,"code":"import _regeneratorRuntime from \"/Users/michielcarman/Server Code/Repository/clients-rpm-kit-manager/code/RPM.KitManager/RPM.KitManager.Web/ClientApp/node_modules/babel-preset-react-app/node_modules/@babel/runtime/regenerator\";\nimport _objectDestructuringEmpty from \"/Users/michielcarman/Server Code/Repository/clients-rpm-kit-manager/code/RPM.KitManager/RPM.KitManager.Web/ClientApp/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/objectDestructuringEmpty\";\nimport _asyncToGenerator from \"/Users/michielcarman/Server Code/Repository/clients-rpm-kit-manager/code/RPM.KitManager/RPM.KitManager.Web/ClientApp/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/asyncToGenerator\";\nimport _classCallCheck from \"/Users/michielcarman/Server Code/Repository/clients-rpm-kit-manager/code/RPM.KitManager/RPM.KitManager.Web/ClientApp/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"/Users/michielcarman/Server Code/Repository/clients-rpm-kit-manager/code/RPM.KitManager/RPM.KitManager.Web/ClientApp/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/createClass\";\nimport _possibleConstructorReturn from \"/Users/michielcarman/Server Code/Repository/clients-rpm-kit-manager/code/RPM.KitManager/RPM.KitManager.Web/ClientApp/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"/Users/michielcarman/Server Code/Repository/clients-rpm-kit-manager/code/RPM.KitManager/RPM.KitManager.Web/ClientApp/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _inherits from \"/Users/michielcarman/Server Code/Repository/clients-rpm-kit-manager/code/RPM.KitManager/RPM.KitManager.Web/ClientApp/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/inherits\";\nvar _jsxFileName = \"/Users/michielcarman/Server Code/Repository/clients-rpm-kit-manager/code/RPM.KitManager/RPM.KitManager.Web/ClientApp/src/shared/components/PDFGeneratorButtons/PDFButtonPickingList.tsx\";\n//http://raw.githack.com/MrRio/jsPDF/master/ to check out the documentation.\nimport React from 'react';\nimport jsPDF from 'jspdf';\nimport axios from 'axios';\n\nvar PDFButtonPickingList = /*#__PURE__*/function (_React$Component) {\n _inherits(PDFButtonPickingList, _React$Component);\n\n function PDFButtonPickingList(props) {\n var _this;\n\n _classCallCheck(this, PDFButtonPickingList);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(PDFButtonPickingList).call(this, props));\n _this.createPDF = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {\n var setOfPickListInfo, doc, margins, page, superHeader, title, monthConversion, approveDate, year, month, date, mon, formattedApprovedDate, currentPage, totalPages, tableHeaderStart, tableHeader, tableStart, i, tableLineHeight, summaryStats, daysOfWeek, monthsOfYear, printDate, footer, rawDate, formattedDate;\n return _regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n monthConversion = function _monthConversion(_ref2) {\n _objectDestructuringEmpty(_ref2);\n\n switch (month) {\n case '01':\n return mon = 'JAN';\n\n case '02':\n return mon = 'FEB';\n\n case '03':\n return mon = 'MAR';\n\n case '04':\n return mon = 'APR';\n\n case '05':\n return mon = 'MAY';\n\n case '06':\n return mon = 'JUN';\n\n case '07':\n return mon = 'JUL';\n\n case '08':\n return mon = 'AUG';\n\n case '09':\n return mon = 'SEP';\n\n case '10':\n return mon = 'OCT';\n\n case '11':\n return mon = 'NOV';\n\n case '12':\n return mon = 'DEC';\n\n default:\n return null;\n }\n };\n\n //console.log(this.props)\n //const { dsId, pn, rev } = this.props;\n //const partNumEntered: any = prompt('What is the Part Number?', `${this.props.pn}`);\n //console.log('New Part Number Entered from Prompt: ', partNumEntered);\n //this.setState({ PartNumberEntered: partNumEntered })\n // if (partNumEntered === null) {\n // return null;\n // }\n //console.log('Part Number Entered after setting state', this.state.PartNumberEntered);\n setOfPickListInfo = _this.state.PickLists;\n console.log('PickLists: ', _this.state.PickLists);\n console.log('PickListInfo: ', setOfPickListInfo);\n\n if (!(setOfPickListInfo == null || setOfPickListInfo == undefined || setOfPickListInfo.length == 0)) {\n _context.next = 7;\n break;\n }\n\n alert('No Data Found');\n return _context.abrupt(\"return\");\n\n case 7:\n // const { Header } = this.props;\n // const {\n // headerPartNumber,\n // headerDescription,\n // headerRevisionLevel,\n // headerCustomerPartNumber,\n // headerWeight,\n // headerApproveDate,\n // headerStatusID,\n // headerFACRequired,\n // headerFACCompleted,\n // bodyPickingLocation,\n // bodyPartNumber,\n // bodyQty,\n // bodyPartCode,\n // bodyDescription\n // } = Header;\n // if (Header === undefined) {\n // return;\n // }\n // Document Defaults/Constants\n doc = new jsPDF({\n unit: 'in',\n orientation: 'portrait',\n format: 'letter'\n });\n margins = {\n left: 1,\n right: 1.25,\n top: 1,\n bottom: 1.25\n };\n page = {\n height: 11,\n width: 8.5\n }; // Setup SuperHeader Info\n\n superHeader = {\n items: ['Sales Order #_______', 'OR POP#_________'],\n xCoords: [1, 3.25]\n }; // Print SuperHeader Info\n\n doc.setFontSize(10);\n doc.text(superHeader.items[0], superHeader.xCoords[0], 1 + 1 / 8);\n doc.text(superHeader.items[1], superHeader.xCoords[1], 1 + 1 / 8); //SETUP OF TITLE INFO\n\n title = {\n value: \"Picking List\",\n xPos: 1,\n yPos: 1.5\n }; //PRINTING TITLE INFO\n\n doc.setFontSize(14);\n doc.setFontType(\"bold\");\n doc.setFont(\"times\");\n doc.setTextColor(255, 128, 0); //Set font color to orange\n\n doc.text(title.value, title.xPos, title.yPos);\n doc.setTextColor(0, 0, 0); //Set font color to black\n\n if (setOfPickListInfo[0].headerApproveDate != null) {\n approveDate = setOfPickListInfo[0].headerApproveDate;\n year = approveDate.substr(0, 4);\n month = approveDate.substr(5, 2);\n date = approveDate.substr(8, 2);\n mon = '';\n }\n\n formattedApprovedDate = date + \"-\" + monthConversion(month) + \"-\" + year; // Print SubHeaders\n\n doc.setFontSize(14);\n doc.setFontType('bold');\n\n if (setOfPickListInfo[0].headerPartNumber != null) {\n doc.text(\"Part Number: \".concat(setOfPickListInfo[0].headerPartNumber), 1, 1 + 7 / 8);\n }\n\n doc.setFontSize(10);\n doc.setFontType('normal');\n doc.setFont(\"times\");\n\n if (setOfPickListInfo[0].headerRevisionLevel != null) {\n doc.text(\"REV: \".concat(setOfPickListInfo[0].headerRevisionLevel), 1, 1 + 7 / 8 + 1 / 4);\n }\n\n if (setOfPickListInfo[0].headerDescription != null) {\n doc.text(\"Description: \".concat(setOfPickListInfo[0].headerDescription), 3, 1 + 7 / 8 + 1 / 4);\n }\n\n if (setOfPickListInfo[0].headerCustomerPartNumber != null) {\n doc.text(\"Customer Part Number: \".concat(setOfPickListInfo[0].headerCustomerPartNumber), 1, 1 + 7 / 8 + 2 / 4);\n }\n\n if (setOfPickListInfo[0].headerWeight != null) {\n doc.text(\"Weight: \".concat(setOfPickListInfo[0].headerWeight), 3.75, 1 + 7 / 8 + 2 / 4);\n }\n\n if (formattedApprovedDate != null) {\n doc.text(\"Date Approved: \".concat(formattedApprovedDate), 5.5, 1 + 7 / 8 + 2 / 4);\n }\n\n currentPage = 1;\n totalPages = 1; //Setup Table Column Headings\n\n tableHeaderStart = {\n xPos: 1,\n yPos: 2.8\n }; // Print Table Column Headings \n\n doc.setFontSize(10);\n doc.setFontType(\"bold\");\n tableHeader = ['Picking Location', 'Part Number', 'Qty', 'Picked', 'Description'];\n doc.text(tableHeader[0], tableHeaderStart.xPos, tableHeaderStart.yPos);\n doc.text(tableHeader[1], tableHeaderStart.xPos + 1.25, tableHeaderStart.yPos);\n doc.text(tableHeader[2], tableHeaderStart.xPos + 2.25, tableHeaderStart.yPos);\n doc.text(tableHeader[3], tableHeaderStart.xPos + 2.5, tableHeaderStart.yPos);\n doc.text(tableHeader[4], tableHeaderStart.xPos + 3, tableHeaderStart.yPos);\n doc.setFontType('normal');\n doc.setFont(\"times\");\n tableStart = {\n xPos: 1,\n yPos: 2.5 + 5 / 8\n };\n\n for (i = 0; i < setOfPickListInfo.length; i++) {\n if (parseInt(\"\".concat(setOfPickListInfo[i].bodyQty))) {\n if (\"\".concat(setOfPickListInfo[i].bodyPickingLocation) == 'null' || \"\".concat(setOfPickListInfo[i].bodyPickingLocation) == undefined || \"\".concat(setOfPickListInfo[i].bodyPickingLocation) == null) {\n doc.text(\" \", tableStart.xPos, tableStart.yPos);\n } else {\n doc.text(\"\".concat(setOfPickListInfo[i].bodyPickingLocation), tableStart.xPos, tableStart.yPos);\n } //doc.text(`${setOfPickListInfo[i].bodyPickingLocation}`, tableStart.xPos, tableStart.yPos)\n\n\n if (setOfPickListInfo[i].bodyPartNumber != null) {\n doc.text(\"\".concat(setOfPickListInfo[i].bodyPartNumber), tableStart.xPos + 1.25, tableStart.yPos);\n }\n\n if (setOfPickListInfo[i].bodyQty != null) {\n doc.text(\"\".concat(setOfPickListInfo[i].bodyQty), tableStart.xPos + 2.25, tableStart.yPos);\n }\n\n doc.text(\"_______\", tableHeaderStart.xPos + 2.5, tableStart.yPos);\n\n if (setOfPickListInfo[i].bodyDescription != null) {\n doc.text(\"\".concat(setOfPickListInfo[i].bodyDescription), tableStart.xPos + 3, tableStart.yPos);\n }\n\n tableStart.yPos = tableStart.yPos + 0.2;\n\n if (tableStart.yPos >= page.height) {\n doc.addPage();\n } // doc.setPage(2);\n // tableStart.yPos = 3.25;\n //} //Also moves the focus to the next page \n\n }\n }\n\n tableLineHeight = 0.25; // Print Table Rows\n\n doc.setFontSize(8);\n doc.setFontType(\"normal\"); //Setup Picking Summary Stats\n\n summaryStats = {\n xCoords: [1, 3.5, 5.75],\n rows: [[\"Total Qty Picked:____\", \"Picked By: ___\", \"Date:\"], [\"\", \"Inspected By: ___\", \"Date:\"], [\"Switch Serial #s: ___\", \"Motor Serial #s______\", \"MVAC Serial #s (Matche NO/NC):\"]]\n }; //Print Picking Summary Stats\n\n summaryStats.rows.forEach(function (statRow, rowNum) {\n for (var _i = 0; _i <= 2; _i++) {\n doc.text(statRow[_i], summaryStats.xCoords[_i], 6 + 1 / 4 + rowNum * .25);\n }\n }); //Setup Footer\n\n daysOfWeek = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];\n monthsOfYear = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];\n printDate = new Date(); //This should always be today's date.\n\n footer = {\n date: \"\".concat(daysOfWeek[printDate.getDay()], \", \").concat(monthsOfYear[printDate.getMonth()], \" \").concat(printDate.getDate(), \", \").concat(printDate.getFullYear()),\n pageCt: \"Page \".concat(currentPage, \" of \").concat(totalPages)\n }; //Print Footers: Left (date) + right(pagect)\n\n doc.text(footer.date, 1, page.height - margins.bottom);\n doc.text(footer.pageCt, page.width - margins.right - 1, page.height - margins.bottom); // Create the Name of the File and Save\n\n rawDate = new Date();\n formattedDate = \"\".concat(rawDate.getMonth()).concat(rawDate.getDate()).concat(rawDate.getFullYear());\n doc.save(\"\".concat(setOfPickListInfo[0].headerPartNumber, \"R\").concat(setOfPickListInfo[0].headerRevisionLevel, \"_PickingList.pdf\"));\n\n case 63:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n\n _this.PartNumberEntered = function () {\n return _this.props.partNumEntered;\n };\n\n _this.state = {\n PickLists: null,\n partNumberEntered: null,\n pickListReportFlag: null\n };\n return _this;\n }\n\n _createClass(PDFButtonPickingList, [{\n key: \"componentDidMount\",\n value: function () {\n var _componentDidMount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {\n var _this2 = this;\n\n var _this$props, dsId, pn, rev, PickLists;\n\n return _regeneratorRuntime.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n if (!(this.props.dsId === 'new')) {\n _context2.next = 2;\n break;\n }\n\n return _context2.abrupt(\"return\");\n\n case 2:\n // skip xhr's if we're working on a new spec (they won't exist anyway) \n _this$props = this.props, dsId = _this$props.dsId, pn = _this$props.pn, rev = _this$props.rev; // console.log('Prompt Entered:', this.state.PartNumberEntered);\n // console.log('Part Num Entered!', this.props.partNumEntered);\n // console.log(dsId)\n // console.log(pn)\n // console.log(rev)\n\n _context2.next = 5;\n return axios.get(\"/api/designspec/pickinglist/\".concat(dsId, \"/\").concat(pn, \"/\").concat(rev)).then(function (res) {\n //console.log(res.data.items.records)\n PickLists = res.data.items.records ? res.data.items.records : \"\";\n\n _this2.setState({\n //PickLists: res.data.items.records || ''\n PickLists: res.data.items.records ? res.data.items.records : \"\"\n });\n }).catch(function (err) {\n return console.error(err);\n });\n\n case 5:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this);\n }));\n\n function componentDidMount() {\n return _componentDidMount.apply(this, arguments);\n }\n\n return componentDidMount;\n }() // getPartNumberEntry = () => {\n // const partNumEntered: any = prompt('What is the Part Number?', `${this.props.pn}`);\n // this.setState({ newPartNum: partNumEntered })\n // console.log('New Part Num in Print Button Component', this.state.newPartNum);\n // }\n\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/React.createElement(\"div\", {\n onClick: this.createPDF,\n __self: this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 314,\n columnNumber: 13\n }\n }, this.props.text);\n }\n }]);\n\n return PDFButtonPickingList;\n}(React.Component);\n\nexport default PDFButtonPickingList;","map":{"version":3,"sources":["/Users/michielcarman/Server Code/Repository/clients-rpm-kit-manager/code/RPM.KitManager/RPM.KitManager.Web/ClientApp/src/shared/components/PDFGeneratorButtons/PDFButtonPickingList.tsx"],"names":["React","jsPDF","axios","PDFButtonPickingList","props","createPDF","monthConversion","month","mon","setOfPickListInfo","state","PickLists","console","log","undefined","length","alert","doc","unit","orientation","format","margins","left","right","top","bottom","page","height","width","superHeader","items","xCoords","setFontSize","text","title","value","xPos","yPos","setFontType","setFont","setTextColor","headerApproveDate","approveDate","year","substr","date","formattedApprovedDate","headerPartNumber","headerRevisionLevel","headerDescription","headerCustomerPartNumber","headerWeight","currentPage","totalPages","tableHeaderStart","tableHeader","tableStart","i","parseInt","bodyQty","bodyPickingLocation","bodyPartNumber","bodyDescription","addPage","tableLineHeight","summaryStats","rows","forEach","statRow","rowNum","daysOfWeek","monthsOfYear","printDate","Date","footer","getDay","getMonth","getDate","getFullYear","pageCt","rawDate","formattedDate","save","PartNumberEntered","partNumEntered","partNumberEntered","pickListReportFlag","dsId","pn","rev","get","then","res","data","records","setState","catch","err","error","Component"],"mappings":";;;;;;;;;AAAA;AACA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,KAAP,MAAkB,OAAlB;AACA,OAAOC,KAAP,MAAkB,OAAlB;;IA+BMC,oB;;;AACF,gCAAYC,KAAZ,EAAwB;AAAA;;AAAA;;AACpB,8FAAMA,KAAN;AADoB,UAqCxBC,SArCwB,yEAqCZ;AAAA,qEAwFCC,eAxFD;AAAA;AAAA;AAAA;AAAA;AAwFCA,cAAAA,eAxFD,oCAwFsB;AAAA;;AAC1B,wBAAQC,KAAR;AACI,uBAAK,IAAL;AAAW,2BAAOC,GAAG,GAAG,KAAb;;AACX,uBAAK,IAAL;AAAW,2BAAOA,GAAG,GAAG,KAAb;;AACX,uBAAK,IAAL;AAAW,2BAAOA,GAAG,GAAG,KAAb;;AACX,uBAAK,IAAL;AAAW,2BAAOA,GAAG,GAAG,KAAb;;AACX,uBAAK,IAAL;AAAW,2BAAOA,GAAG,GAAG,KAAb;;AACX,uBAAK,IAAL;AAAW,2BAAOA,GAAG,GAAG,KAAb;;AACX,uBAAK,IAAL;AAAW,2BAAOA,GAAG,GAAG,KAAb;;AACX,uBAAK,IAAL;AAAW,2BAAOA,GAAG,GAAG,KAAb;;AACX,uBAAK,IAAL;AAAW,2BAAOA,GAAG,GAAG,KAAb;;AACX,uBAAK,IAAL;AA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a;AACTC,MAAAA,SAAS,EAAE,IADF;AAET0E,MAAAA,iBAAiB,EAAE,IAFV;AAGTC,MAAAA,kBAAkB,EAAE;AAHX,KAAb;AAFoB;AAOvB;;;;;;;;;;;;;;sBAGO,KAAKlF,KAAL,CAAWmF,IAAX,KAAoB,K;;;;;;;;AAAe;8BACb,KAAKnF,K,EAAvBmF,I,eAAAA,I,EAAMC,E,eAAAA,E,EAAIC,G,eAAAA,G,EAClB;AACA;AACA;AACA;AACA;;;uBAGMvF,KAAK,CAACwF,GAAN,uCAAyCH,IAAzC,cAAiDC,EAAjD,cAAuDC,GAAvD,GACDE,IADC,CACI,UAACC,GAAD,EAAc;AAChB;AACAjF,kBAAAA,SAAS,GAAGiF,GAAG,CAACC,IAAJ,CAAS/D,KAAT,CAAegE,OAAf,GAAyBF,GAAG,CAACC,IAAJ,CAAS/D,KAAT,CAAegE,OAAxC,GAAkD,EAA9D;;AACA,kBAAA,MAAI,CAACC,QAAL,CAAc;AACV;AACApF,oBAAAA,SAAS,EAAEiF,GAAG,CAACC,IAAJ,CAAS/D,KAAT,CAAegE,OAAf,GAAyBF,GAAG,CAACC,IAAJ,CAAS/D,KAAT,CAAegE,OAAxC,GAAkD;AAFnD,mBAAd;AAIH,iBARC,EASDE,KATC,CASK,UAACC,GAAD;AAAA,yBAAcrF,OAAO,CAACsF,KAAR,CAAcD,GAAd,CAAd;AAAA,iBATL,C;;;;;;;;;;;;;;;QAYV;AACA;AACA;AACA;AACA;;;;6BAiPS;AACL,0BACI;AAAK,QAAA,OAAO,EAAE,KAAK5F,SAAnB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SACK,KAAKD,KAAL,CAAW6B,IADhB,CADJ;AAIH;;;;EA1R8BjC,KAAK,CAACmG,S;;AA8RzC,eAAehG,oBAAf","sourcesContent":["//http://raw.githack.com/MrRio/jsPDF/master/ to check out the documentation.\nimport React from 'react';\nimport jsPDF from 'jspdf';\nimport axios from 'axios';\nimport { Console } from 'console';\ninterface PDFBtnProps {\n text: any,\n //Header: any\n PickLists: [],\n partNumberEntered: any,\n pickListReportFlag: any,\n}\n\nexport interface PickList {\n headerPartNumber: number,\n headerDescription: string,\n headerRevisionLevel: number,\n headerCustomerPartNumber: string,\n headerWeight: number,\n headerApproveDate: Date,\n headerStatusID: number,\n headerFACRequired: Boolean,\n headerFACCompleted: Boolean,\n bodyPickingLocation: string,\n bodyPartNumber: number,\n bodyQty: string,\n bodyPartCode: string,\n pbodyDescription: string\n}\n\nexport interface PickListReportFormState extends PickList {\n PickLists: PickList[],\n}\n\nclass PDFButtonPickingList extends React.Component<any, any> {\n constructor(props: any) {\n super(props)\n this.state = {\n PickLists: null,\n partNumberEntered: null,\n pickListReportFlag: null,\n }\n }\n\n async componentDidMount() {\n if (this.props.dsId === 'new') return; // skip xhr's if we're working on a new spec (they won't exist anyway) \n const { dsId, pn, rev } = this.props;\n // console.log('Prompt Entered:', this.state.PartNumberEntered);\n // console.log('Part Num Entered!', this.props.partNumEntered);\n // console.log(dsId)\n // console.log(pn)\n // console.log(rev)\n let PickLists: PickList[];\n\n await axios.get(`/api/designspec/pickinglist/${dsId}/${pn}/${rev}`)\n .then((res: any) => {\n //console.log(res.data.items.records)\n PickLists = res.data.items.records ? res.data.items.records : \"\"\n this.setState({\n //PickLists: res.data.items.records || ''\n PickLists: res.data.items.records ? res.data.items.records : \"\"\n })\n })\n .catch((err: any) => console.error(err)) \n }\n\n // getPartNumberEntry = () => {\n // const partNumEntered: any = prompt('What is the Part Number?', `${this.props.pn}`);\n // this.setState({ newPartNum: partNumEntered })\n // console.log('New Part Num in Print Button Component', this.state.newPartNum);\n // }\n\n createPDF = async () => {\n //console.log(this.props)\n //const { dsId, pn, rev } = this.props;\n\n //const partNumEntered: any = prompt('What is the Part Number?', `${this.props.pn}`);\n //console.log('New Part Number Entered from Prompt: ', partNumEntered);\n //this.setState({ PartNumberEntered: partNumEntered })\n\n\n // if (partNumEntered === null) {\n // return null;\n // }\n //console.log('Part Number Entered after setting state', this.state.PartNumberEntered);\n\n const setOfPickListInfo = this.state.PickLists;\n console.log('PickLists: ', this.state.PickLists);\n console.log('PickListInfo: ', setOfPickListInfo);\n if ((setOfPickListInfo == null) || (setOfPickListInfo == undefined) || (setOfPickListInfo.length == 0)) {\n alert('No Data Found');\n return;\n }\n\n // const { Header } = this.props;\n // const {\n // headerPartNumber,\n // headerDescription,\n // headerRevisionLevel,\n // headerCustomerPartNumber,\n // headerWeight,\n // headerApproveDate,\n // headerStatusID,\n // headerFACRequired,\n // headerFACCompleted,\n // bodyPickingLocation,\n // bodyPartNumber,\n // bodyQty,\n // bodyPartCode,\n // bodyDescription\n // } = Header;\n\n // if (Header === undefined) {\n // return;\n // }\n\n\n // Document Defaults/Constants\n var doc = new jsPDF({\n unit: 'in',\n orientation: 'portrait',\n format: 'letter'\n })\n const margins = {\n left: 1,\n right: 1.25,\n top: 1,\n bottom: 1.25\n }\n const page = {\n height: 11,\n width: 8.5\n }\n\n\n // Setup SuperHeader Info\n const superHeader = {\n items: ['Sales Order #_______', 'OR POP#_________'],\n xCoords: [1, 3.25]\n }\n // Print SuperHeader Info\n doc.setFontSize(10)\n doc.text(superHeader.items[0], superHeader.xCoords[0], 1 + (1 / 8))\n doc.text(superHeader.items[1], superHeader.xCoords[1], 1 + (1 / 8))\n\n //SETUP OF TITLE INFO\n const title = {\n value: \"Picking List\",\n xPos: 1,\n yPos: 1.5\n }\n\n //PRINTING TITLE INFO\n doc.setFontSize(14)\n doc.setFontType(\"bold\")\n doc.setFont(\"times\")\n doc.setTextColor(255, 128, 0) //Set font color to orange\n doc.text(title.value, title.xPos, title.yPos)\n doc.setTextColor(0, 0, 0); //Set font color to black\n\n function monthConversion({ }) {\n switch (month) {\n case '01': return mon = 'JAN';\n case '02': return mon = 'FEB';\n case '03': return mon = 'MAR';\n case '04': return mon = 'APR';\n case '05': return mon = 'MAY';\n case '06': return mon = 'JUN';\n case '07': return mon = 'JUL';\n case '08': return mon = 'AUG';\n case '09': return mon = 'SEP';\n case '10': return mon = 'OCT';\n case '11': return mon = 'NOV';\n case '12': return mon = 'DEC';\n default: return null;\n }\n }\n\n if (setOfPickListInfo[0].headerApproveDate != null) {\n const approveDate = setOfPickListInfo[0].headerApproveDate\n var year = approveDate.substr(0, 4);\n var month = approveDate.substr(5, 2);\n var date = approveDate.substr(8, 2);\n var mon = '';\n }\n\n const formattedApprovedDate = date + `-` + monthConversion(month) + `-` + year;\n\n // Print SubHeaders\n doc.setFontSize(14)\n doc.setFontType('bold');\n if (setOfPickListInfo[0].headerPartNumber != null) {\n doc.text(`Part Number: ${setOfPickListInfo[0].headerPartNumber}`, 1, 1 + (7 / 8))\n }\n doc.setFontSize(10)\n doc.setFontType('normal');\n doc.setFont(\"times\")\n if (setOfPickListInfo[0].headerRevisionLevel != null) {\n doc.text(`REV: ${setOfPickListInfo[0].headerRevisionLevel}`, 1, 1 + (7 / 8) + (1 / 4))\n }\n if (setOfPickListInfo[0].headerDescription != null) {\n doc.text(`Description: ${setOfPickListInfo[0].headerDescription}`, 3, 1 + (7 / 8) + (1 / 4))\n }\n if (setOfPickListInfo[0].headerCustomerPartNumber != null) {\n doc.text(`Customer Part Number: ${setOfPickListInfo[0].headerCustomerPartNumber}`, 1, 1 + (7 / 8) + (2 / 4))\n }\n if (setOfPickListInfo[0].headerWeight != null) {\n doc.text(`Weight: ${setOfPickListInfo[0].headerWeight}`, 3.75, 1 + (7 / 8) + (2 / 4))\n }\n if (formattedApprovedDate != null) {\n doc.text(`Date Approved: ${formattedApprovedDate}`, 5.5, 1 + (7 / 8) + (2 / 4))\n }\n\n\n let currentPage = 1;\n let totalPages = 1;\n\n //Setup Table Column Headings\n const tableHeaderStart = {\n xPos: 1,\n yPos: 2.8\n }\n\n // Print Table Column Headings \n doc.setFontSize(10)\n doc.setFontType(\"bold\")\n const tableHeader = ['Picking Location', 'Part Number', 'Qty', 'Picked', 'Description']\n doc.text(tableHeader[0], tableHeaderStart.xPos, tableHeaderStart.yPos)\n doc.text(tableHeader[1], tableHeaderStart.xPos + 1.25, tableHeaderStart.yPos)\n doc.text(tableHeader[2], tableHeaderStart.xPos + 2.25, tableHeaderStart.yPos)\n doc.text(tableHeader[3], tableHeaderStart.xPos + 2.5, tableHeaderStart.yPos)\n doc.text(tableHeader[4], tableHeaderStart.xPos + 3, tableHeaderStart.yPos)\n doc.setFontType('normal');\n doc.setFont(\"times\")\n\n var tableStart = {\n xPos: 1,\n yPos: 2.5 + (5 / 8)\n }\n\n for (var i = 0; i < setOfPickListInfo.length; i++) {\n if (parseInt(`${setOfPickListInfo[i].bodyQty}`)) {\n if ((`${setOfPickListInfo[i].bodyPickingLocation}` == 'null') || (`${setOfPickListInfo[i].bodyPickingLocation}` == undefined) || (`${setOfPickListInfo[i].bodyPickingLocation}` == null)) {\n doc.text(` `, tableStart.xPos, tableStart.yPos)\n }\n else {\n doc.text(`${setOfPickListInfo[i].bodyPickingLocation}`, tableStart.xPos, tableStart.yPos)\n }\n //doc.text(`${setOfPickListInfo[i].bodyPickingLocation}`, tableStart.xPos, tableStart.yPos)\n if (setOfPickListInfo[i].bodyPartNumber != null) {\n doc.text(`${setOfPickListInfo[i].bodyPartNumber}`, tableStart.xPos + 1.25, tableStart.yPos)\n }\n if (setOfPickListInfo[i].bodyQty != null) {\n doc.text(`${setOfPickListInfo[i].bodyQty}`, tableStart.xPos + 2.25, tableStart.yPos)\n }\n doc.text(`_______`, tableHeaderStart.xPos + 2.5, tableStart.yPos)\n if (setOfPickListInfo[i].bodyDescription != null) {\n doc.text(`${setOfPickListInfo[i].bodyDescription}`, tableStart.xPos + 3, tableStart.yPos)\n }\n tableStart.yPos = tableStart.yPos + 0.2;\n if (tableStart.yPos >= page.height) { doc.addPage(); }\n // doc.setPage(2);\n // tableStart.yPos = 3.25;\n //} //Also moves the focus to the next page \n }\n }\n\n const tableLineHeight = 0.25\n // Print Table Rows\n doc.setFontSize(8)\n doc.setFontType(\"normal\")\n\n\n //Setup Picking Summary Stats\n const summaryStats = {\n xCoords: [1, 3.5, 5.75],\n rows: [\n [`Total Qty Picked:____`, `Picked By: ___`, `Date:`],\n [``, `Inspected By: ___`, `Date:`],\n [`Switch Serial #s: ___`, `Motor Serial #s______`, `MVAC Serial #s (Matche NO/NC):`],\n ]\n }\n //Print Picking Summary Stats\n summaryStats.rows.forEach((statRow, rowNum) => {\n for (let i = 0; i <= 2; i++) {\n doc.text(statRow[i], summaryStats.xCoords[i], 6 + (1 / 4) + (rowNum * .25))\n }\n })\n\n //Setup Footer\n const daysOfWeek = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']\n const monthsOfYear = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']\n const printDate = new Date() //This should always be today's date.\n let footer = {\n date: `${daysOfWeek[printDate.getDay()]}, ${monthsOfYear[printDate.getMonth()]} ${printDate.getDate()}, ${printDate.getFullYear()}`,\n pageCt: `Page ${currentPage} of ${totalPages}`\n }\n //Print Footers: Left (date) + right(pagect)\n doc.text(footer.date, 1, page.height - margins.bottom)\n doc.text(footer.pageCt, page.width - margins.right - 1, page.height - margins.bottom)\n\n // Create the Name of the File and Save\n const rawDate = new Date();\n const formattedDate = `${rawDate.getMonth()}${rawDate.getDate()}${rawDate.getFullYear()}`\n doc.save(`${setOfPickListInfo[0].headerPartNumber}R${setOfPickListInfo[0].headerRevisionLevel}_PickingList.pdf`)\n }\n\n PartNumberEntered = () => {\n return this.props.partNumEntered;\n };\n\n render() {\n return (\n <div onClick={this.createPDF}>\n {this.props.text}\n </div>);\n }\n\n}\n\nexport default PDFButtonPickingList "]},"metadata":{},"sourceType":"module"}