Class

BarcodeList

BarcodeList()

After successfully scanning an item on the barcode scanner page and manual entry, the item(s) will appear on the this page with delete option. This module submit list of barcode and min to API. This module support offline scanning too.

Constructor

# new BarcodeList()

View Source honeywellScanner/BarcodeList.tsx, line 20

Members

# deleteBarcode

This function is used to delete selected barcode or min and after deleting push data to indexeddb. updateScannedData callback function checks deleted min/barcode has another entry in list, if entry is present then need to update valid flag as well as deleted return id. If localstorage is empty then it removes whole item.

View Source honeywellScanner/BarcodeList.tsx, line 223

# submitBarcodes

This function check value stored is min or barcode from indexeddb. if its barcode and has validFlag=true then it sends data with returnId as {barcode:12344535,returnId:6576} and That barcode's validFlag is false then send data as {barcode:5645646454} Same applies in case of minId too. JSON object looks like [{min:909845, returnId:6768},{barcode:464757757578,returnId:6767},{min:909844},{barcode:464757757577}] and then call post API. It also checks App has internet connection or not, If internet connection is not there then It sends API call when internet is back

View Source honeywellScanner/BarcodeList.tsx, line 216

Methods

# barcodeSendSuccess()

This function checks if any error while sending barcode to API then it redirects to error page. If barcodes successfully submitted then redirects it to success page.

View Source honeywellScanner/BarcodeList.tsx, line 139

# componentDidUpdate()

ComponentDidUpdate gets data from indexeddb and sets to State, If data's validFlag is true means its valid product(From returns table) , If validFlag is false then that data is not from products returned from list.

View Source honeywellScanner/BarcodeList.tsx, line 125

# deleteBarcode()

This function is used to delete selected barcode or min and after deleting push data to indexeddb. updateScannedData callback function checks deleted min/barcode has another entry in list, if entry is present then need to update valid flag as well as deleted return id. If localstorage is empty then it removes whole item.

View Source honeywellScanner/BarcodeList.tsx, line 81

# submitBarcodes()

This function check value stored is min or barcode from indexeddb. if its barcode and has validFlag=true then it sends data with returnId as {barcode:12344535,returnId:6576} and That barcode's validFlag is false then send data as {barcode:5645646454} Same applies in case of minId too. JSON object looks like [{min:909845, returnId:6768},{barcode:464757757578,returnId:6767},{min:909844},{barcode:464757757577}] and then call post API. It also checks App has internet connection or not, If internet connection is not there then It sends API call when internet is back

View Source honeywellScanner/BarcodeList.tsx, line 36