@logwire/logwire-wms-pda-ui 1.1.15 → 1.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +134 -134
- package/dist/logwire-wms-pda-ui.js +2 -2
- package/package.json +69 -69
- package/src/api/common/Device.js +43 -43
- package/src/api/common/Dict.js +19 -19
- package/src/api/common/GetImgSrc.js +20 -20
- package/src/api/common/Language.js +31 -31
- package/src/api/common/Lot.js +20 -20
- package/src/api/common/Msg.js +26 -26
- package/src/api/common/Permissions.js +22 -22
- package/src/api/common/Print.js +65 -65
- package/src/api/common/Task.js +61 -61
- package/src/api/common/UUID.js +28 -28
- package/src/api/common/User.js +53 -53
- package/src/api/common/Waerhouse.js +28 -28
- package/src/api/common/barcode.js +165 -165
- package/src/api/common/common.js +33 -25
- package/src/api/common/index.js +37 -37
- package/src/api/inbound/index.js +6 -6
- package/src/api/inbound/quality.js +99 -99
- package/src/api/inbound/receive.js +119 -109
- package/src/api/inner/count/index.js +97 -97
- package/src/api/inner/disposeAbnormal/action.js +69 -69
- package/src/api/inner/disposeAbnormal/index.js +33 -33
- package/src/api/inner/materialApply/index.js +51 -51
- package/src/api/inner/move/abnormalMove.js +25 -25
- package/src/api/inner/move/lpnMove.js +25 -25
- package/src/api/inner/move/taskMove.js +57 -57
- package/src/api/inner/newProject/action.js +88 -0
- package/src/api/inner/newProject/index.js +18 -0
- package/src/api/inner/reportAbnormal/index.js +34 -34
- package/src/api/outbound/bale/checkBale/action.js +123 -0
- package/src/api/outbound/bale/checkBale/allCheck.js +25 -0
- package/src/api/outbound/bale/checkBale/index.js +52 -0
- package/src/api/outbound/delivery/action.js +148 -148
- package/src/api/outbound/delivery/addOrder.js +32 -32
- package/src/api/outbound/delivery/index.js +25 -25
- package/src/api/outbound/pick/alone.js +60 -60
- package/src/api/outbound/pick/box.js +42 -42
- package/src/api/outbound/pick/index.js +60 -60
- package/src/api/outbound/pick/lpn.js +42 -42
- package/src/api/outbound/pick/notAlone.js +33 -33
- package/src/api/outbound/pickMerge/index.js +69 -69
- package/src/api/outbound/sow/action.js +123 -123
- package/src/api/outbound/sow/index.js +24 -24
- package/src/api/outbound/summary/box.js +33 -33
- package/src/api/outbound/summary/lpn.js +23 -23
- package/src/api/receive/abnormal.js +34 -34
- package/src/api/receive/putaway.js +82 -82
- package/src/api/receive/randomMove.js +43 -43
- package/src/api/receive/receipt.js +25 -25
- package/src/assets/css/changeVant.less +22 -22
- package/src/assets/css/global.less +411 -411
- package/src/assets/css/index.less +4 -4
- package/src/assets/css/var.less +117 -117
- package/src/assets/css//345/205/250/345/261/200/346/240/267/345/274/217.md +31 -31
- package/src/components/module/InnerAbnormal/index.js +11 -11
- package/src/components/module/InnerAbnormal/index.vue +367 -343
- package/src/components/module/Login/index.js +11 -11
- package/src/components/module/Login/index.vue +324 -328
- package/src/components/module/Login//347/231/273/345/275/225/346/250/241/345/235/227.md +1 -1
- package/src/components/module/Lot/index.js +11 -11
- package/src/components/module/Lot/index.vue +181 -181
- package/src/components/module/Lot//346/211/271/346/254/241/345/261/236/346/200/247.md +2 -2
- package/src/components/module/LotLook/index.js +11 -11
- package/src/components/module/LotLook/index.vue +80 -80
- package/src/components/module/Menu/index.js +12 -12
- package/src/components/module/Menu/index.vue +118 -118
- package/src/components/module/Menu//350/217/234/345/215/225/346/240/217.md +1 -1
- package/src/components/module/MsgItem/index.js +11 -11
- package/src/components/module/MsgItem/index.vue +109 -109
- package/src/components/module/MsgItem//346/266/210/346/201/257/345/210/227/350/241/250/345/217/212/345/210/206/351/241/265/346/250/241/345/235/227.md +1 -1
- package/src/components/module/OnLine/index.js +11 -11
- package/src/components/module/OnLine/index.vue +195 -195
- package/src/components/module/OnLine//344/270/212/344/270/213/347/272/277/347/256/241/347/220/206/346/250/241/345/235/227.md +1 -1
- package/src/components/module/ReceiveAbnormal/index.js +11 -11
- package/src/components/module/ReceiveAbnormal/index.vue +865 -847
- package/src/components/module/ScanDataList/index.js +11 -11
- package/src/components/module/ScanDataList/index.vue +326 -326
- package/src/components/module/SkuInfo/index.js +11 -11
- package/src/components/module/SkuInfo/index.vue +65 -65
- package/src/components/module/SystemInfo/index.js +11 -11
- package/src/components/module/SystemInfo/index.vue +217 -217
- package/src/components/module/SystemInfo//347/263/273/347/273/237/344/277/241/346/201/257/344/270/216/344/270/212/347/272/277/347/212/266/346/200/201/346/250/241/345/235/227.md +1 -1
- package/src/components/module/index.js +42 -42
- package/src/components/page/common/Device/index.js +11 -11
- package/src/components/page/common/Device/index.vue +186 -186
- package/src/components/page/common/Device//350/256/276/345/244/207/347/256/241/347/220/206/351/241/265.md +1 -1
- package/src/components/page/common/Home/index.js +11 -11
- package/src/components/page/common/Home/index.vue +113 -113
- package/src/components/page/common/Home//344/270/273/351/241/265.md +1 -1
- package/src/components/page/common/Language/index.js +11 -11
- package/src/components/page/common/Language/index.vue +142 -142
- package/src/components/page/common/Language//350/257/255/350/250/200.md +1 -1
- package/src/components/page/common/Login/index.js +11 -11
- package/src/components/page/common/Login/index.vue +157 -157
- package/src/components/page/common/Login//347/231/273/345/275/225/351/241/265.md +1 -1
- package/src/components/page/common/Menu/index.js +11 -11
- package/src/components/page/common/Menu/index.vue +71 -71
- package/src/components/page/common/Menu//350/217/234/345/215/225/351/241/265.md +1 -1
- package/src/components/page/common/Msg/index.js +11 -11
- package/src/components/page/common/Msg/index.vue +152 -152
- package/src/components/page/common/Msg//346/266/210/346/201/257/351/241/265.md +1 -1
- package/src/components/page/common/My/index.js +11 -11
- package/src/components/page/common/My/index.vue +477 -477
- package/src/components/page/common/My//346/210/221/347/232/204/347/256/241/347/220/206/351/241/265.md +1 -1
- package/src/components/page/common/Print/index.js +11 -11
- package/src/components/page/common/Print/index.vue +314 -314
- package/src/components/page/common/Print//346/211/223/345/215/260/346/234/272/350/256/276/347/275/256/351/241/265.md +1 -1
- package/src/components/page/common/Task/index.js +11 -11
- package/src/components/page/common/Task/index.vue +699 -699
- package/src/components/page/common/Task//344/273/273/345/212/241/351/241/265.md +1 -1
- package/src/components/page/common/Warehouse/index.js +11 -11
- package/src/components/page/common/Warehouse/index.vue +216 -213
- package/src/components/page/common/Warehouse//344/273/223/345/272/223/351/200/211/346/213/251/351/241/265.md +1 -1
- package/src/components/page/common/index.js +39 -39
- package/src/components/page/count/components/{CountBoard/index.vue → CountBoard.vue} +115 -115
- package/src/components/page/count/components/RandomCount.vue +154 -0
- package/src/components/page/count/index.js +21 -21
- package/src/components/page/count/inv/action/index.js +5 -5
- package/src/components/page/count/inv/action/index.vue +271 -12
- package/src/components/page/count/inv/index/index.js +5 -5
- package/src/components/page/count/inv/index/index.vue +190 -13
- package/src/components/page/count/loc/action/index.js +5 -5
- package/src/components/page/count/loc/action/index.vue +545 -514
- package/src/components/page/count/loc/index/index.js +5 -5
- package/src/components/page/count/loc/index/index.vue +184 -184
- package/src/components/page/inbound/components/AsnInfo.vue +180 -177
- package/src/components/page/inbound/components/AsnSkuInfo.vue +45 -45
- package/src/components/page/inbound/components/QualityCard.vue +230 -230
- package/src/components/page/inbound/components/QualityTaskInfo.vue +88 -88
- package/src/components/page/inbound/components/SnsList.vue +98 -98
- package/src/components/page/inbound/index.js +16 -10
- package/src/components/page/inbound/newProject/action/index.js +13 -0
- package/src/components/page/{inner/movePutAway/index → inbound/newProject/action}/index.less +0 -0
- package/src/components/page/inbound/newProject/action/index.vue +1469 -0
- package/src/components/page/inbound/newProject/index/index.js +13 -0
- package/src/components/page/inbound/newProject/index/index.less +0 -0
- package/src/components/page/inbound/newProject/index/index.vue +122 -0
- package/src/components/page/inbound/newProject//346/226/260/345/223/201/351/205/215/347/275/256.md +0 -0
- package/src/components/page/inbound/receive/home/index.js +5 -5
- package/src/components/page/inbound/receive/home/index.vue +73 -73
- package/src/components/page/inbound/receive/index/index.js +5 -5
- package/src/components/page/inbound/receive/index/index.vue +89 -89
- package/src/components/page/inbound/receive/quality/LwInboundQualityExecutePage.vue +405 -337
- package/src/components/page/inbound/receive/quality/LwInboundQualityTaskListPage.vue +163 -157
- package/src/components/page/inbound/receive/quality/index.js +16 -16
- package/src/components/page/inbound/receive/receive-sku/LwInboundReceiveSkuAdvancePage.vue +320 -267
- package/src/components/page/inbound/receive/receive-sku/LwInboundReceiveSkuDirectPage.vue +407 -351
- package/src/components/page/inbound/receive/receive-sku/LwInboundReceiveSkuScanPage.vue +149 -149
- package/src/components/page/inbound/receive/receive-sku/index.js +19 -19
- package/src/components/page/index.js +33 -33
- package/src/components/page/inner/abnormalMove/index/index.js +11 -11
- package/src/components/page/inner/abnormalMove/index/index.vue +468 -463
- package/src/components/page/inner/disposeAbnormal/action/index.js +11 -11
- package/src/components/page/inner/disposeAbnormal/action/index.vue +524 -524
- package/src/components/page/inner/disposeAbnormal/components/abnInfo/index.vue +655 -655
- package/src/components/page/inner/disposeAbnormal/components/disposePopup/index.vue +229 -229
- package/src/components/page/inner/disposeAbnormal/components/listItem/index.vue +213 -213
- package/src/components/page/inner/disposeAbnormal/components/searchBar/index.vue +264 -260
- package/src/components/page/inner/disposeAbnormal/index/index.js +11 -11
- package/src/components/page/inner/disposeAbnormal/index/index.vue +237 -247
- package/src/components/page/inner/index.js +62 -58
- package/src/components/page/inner/lpnMove/action/index.js +11 -11
- package/src/components/page/inner/lpnMove/action/index.vue +222 -221
- package/src/components/page/inner/lpnMove/index/index.js +11 -11
- package/src/components/page/inner/lpnMove/index/index.vue +155 -153
- package/src/components/page/inner/materialApply/action/index.js +10 -10
- package/src/components/page/inner/materialApply/action/index.vue +563 -554
- package/src/components/page/inner/materialApply/generate/index.js +10 -10
- package/src/components/page/inner/materialApply/generate/index.vue +376 -376
- package/src/components/page/inner/movePutAway/index/index.js +11 -11
- package/src/components/page/inner/movePutAway/index/index.vue +363 -363
- package/src/components/page/inner/randomMove/components/Down/index.vue +470 -465
- package/src/components/page/inner/randomMove/components/Up/index.vue +523 -519
- package/src/components/page/inner/randomMove/index/index.js +11 -11
- package/src/components/page/inner/randomMove/index/index.vue +152 -152
- package/src/components/page/inner/reportAbnormal/action/index.js +11 -11
- package/src/components/page/inner/reportAbnormal/action/index.vue +246 -246
- package/src/components/page/inner/reportAbnormal/index/index.js +11 -11
- package/src/components/page/inner/reportAbnormal/index/index.vue +251 -240
- package/src/components/page/inner/taskMove/index/index.js +11 -11
- package/src/components/page/inner/taskMove/index/index.vue +1374 -1363
- package/src/components/page/outbound/bale/aloneBale/action/index.js +11 -11
- package/src/components/page/outbound/bale/aloneBale/action/index.vue +192 -192
- package/src/components/page/outbound/bale/aloneBale/index/index.js +11 -11
- package/src/components/page/outbound/bale/aloneBale/index/index.vue +86 -86
- package/src/components/page/outbound/bale/aloneBale/newBale/index.js +11 -11
- package/src/components/page/outbound/bale/aloneBale/newBale/index.vue +53 -53
- package/src/components/page/outbound/bale/checkBale/action/index.js +11 -11
- package/src/components/page/outbound/bale/checkBale/action/index.vue +1330 -58
- package/src/components/page/outbound/bale/checkBale/allCheck/index.js +11 -11
- package/src/components/page/outbound/bale/checkBale/allCheck/index.vue +119 -88
- package/src/components/page/outbound/bale/checkBale/index/index.js +11 -11
- package/src/components/page/outbound/bale/checkBale/index/index.vue +259 -176
- package/src/components/page/outbound/bale/checkBale/newBale/index.js +11 -11
- package/src/components/page/outbound/bale/checkBale/newBale/index.vue +62 -60
- package/src/components/page/outbound/bale/components/allBlock/index.vue +97 -0
- package/src/components/page/outbound/bale/components/allBlock//345/205/250/351/203/250/346/213/246/346/210/252.md +0 -0
- package/src/components/page/outbound/bale/components/containerInfo/index.vue +237 -229
- package/src/components/page/outbound/bale/components/containerInfo//346/215/206/345/214/205/345/256/271/345/231/250/344/277/241/346/201/257.md +2 -2
- package/src/components/page/outbound/bale/components/containerSkuQty/index.vue +58 -50
- package/src/components/page/outbound/bale/components/mainPage/index.vue +620 -553
- package/src/components/page/outbound/bale/components/partBlock/index.vue +197 -0
- package/src/components/page/outbound/bale/components/partBlock//351/203/250/345/210/206/346/213/246/346/210/252.md +0 -0
- package/src/components/page/outbound/bale/components/planCollapse/index.vue +396 -352
- package/src/components/page/outbound/bale/components/storeInfo/index.vue +135 -126
- package/src/components/page/outbound/bale/components/storeInfo//345/256/242/346/210/267/346/215/206/345/214/205/344/277/241/346/201/257.md +1 -1
- package/src/components/page/outbound/bale/components/storeInfoSkuList/index.vue +121 -123
- package/src/components/page/outbound/delivery/action/index.js +11 -11
- package/src/components/page/outbound/delivery/action/index.vue +646 -642
- package/src/components/page/outbound/delivery/addOrder/index.js +11 -11
- package/src/components/page/outbound/delivery/addOrder/index.vue +281 -274
- package/src/components/page/outbound/delivery/components/boxItem/index.vue +118 -118
- package/src/components/page/outbound/delivery/components/orderContent/index.vue +143 -143
- package/src/components/page/outbound/delivery/components/orderContentTitle/index.vue +239 -239
- package/src/components/page/outbound/delivery/components/soAndLpnItem/index.vue +152 -152
- package/src/components/page/outbound/delivery/index/index.js +11 -11
- package/src/components/page/outbound/delivery/index/index.vue +154 -153
- package/src/components/page/outbound/index.js +94 -94
- package/src/components/page/outbound/pick/alone/index.js +11 -11
- package/src/components/page/outbound/pick/alone/index.vue +497 -493
- package/src/components/page/outbound/pick/box/index.js +11 -11
- package/src/components/page/outbound/pick/box/index.vue +363 -360
- package/src/components/page/outbound/pick/components/dataLookAndChange/index.vue +748 -748
- package/src/components/page/outbound/pick/components/skuLocationInfo/index.vue +208 -208
- package/src/components/page/outbound/pick/components/splitPutDown/index.vue +208 -206
- package/src/components/page/outbound/pick/components/splitPutDown//346/213/206/346/235/277/344/270/213/346/236/266.md +0 -0
- package/src/components/page/outbound/pick/index/index.js +11 -11
- package/src/components/page/outbound/pick/index/index.vue +624 -624
- package/src/components/page/outbound/pick/lpn/index.js +11 -11
- package/src/components/page/outbound/pick/lpn/index.vue +305 -303
- package/src/components/page/outbound/pick/mixin/all.js +100 -100
- package/src/components/page/outbound/pick/mixin/aloneAndNotAlone.js +132 -132
- package/src/components/page/outbound/pick/notAlone/index.js +11 -11
- package/src/components/page/outbound/pick/notAlone/index.vue +524 -519
- package/src/components/page/outbound/pickMerge/action/index.js +11 -11
- package/src/components/page/outbound/pickMerge/action/index.vue +543 -541
- package/src/components/page/outbound/pickMerge/components/containerInfo/index.vue +89 -89
- package/src/components/page/outbound/pickMerge/components/finishPopup/index.vue +88 -88
- package/src/components/page/outbound/pickMerge/components/skuInfo/index.vue +132 -132
- package/src/components/page/outbound/pickMerge/content/index.js +11 -11
- package/src/components/page/outbound/pickMerge/content/index.vue +170 -169
- package/src/components/page/outbound/pickMerge/index/index.js +11 -11
- package/src/components/page/outbound/pickMerge/index/index.vue +77 -76
- package/src/components/page/outbound/sow/action/index.js +11 -11
- package/src/components/page/outbound/sow/action/index.vue +1420 -1408
- package/src/components/page/outbound/sow/components/sowLocationList/index.vue +80 -80
- package/src/components/page/outbound/sow/components/waitSowCollapse/index.vue +105 -105
- package/src/components/page/outbound/sow/index/index.js +11 -11
- package/src/components/page/outbound/sow/index/index.vue +374 -374
- package/src/components/page/outbound/summary/box/index/index.js +11 -11
- package/src/components/page/outbound/summary/box/index/index.vue +645 -643
- package/src/components/page/outbound/summary/lpn/action/index.js +12 -12
- package/src/components/page/outbound/summary/lpn/action/index.vue +253 -251
- package/src/components/page/outbound/summary/lpn/index/index.js +12 -12
- package/src/components/page/outbound/summary/lpn/index/index.vue +70 -69
- package/src/components/page/receive/abnormal/action/index.js +11 -11
- package/src/components/page/receive/abnormal/action/index.vue +45 -45
- package/src/components/page/receive/abnormal/index/index.js +11 -11
- package/src/components/page/receive/abnormal/index/index.vue +73 -72
- package/src/components/page/receive/index.js +36 -36
- package/src/components/page/receive/putaway/components/SkuInfo/index.vue +247 -247
- package/src/components/page/receive/putaway/components/SkuPutAwayInfo/index.vue +203 -203
- package/src/components/page/receive/putaway/components/TaskInfo/index.vue +216 -216
- package/src/components/page/receive/putaway/index/index.js +11 -11
- package/src/components/page/receive/putaway/index/index.vue +288 -286
- package/src/components/page/receive/putaway/lpnAction/index.js +11 -11
- package/src/components/page/receive/putaway/lpnAction/index.vue +332 -330
- package/src/components/page/receive/putaway/skuAction/index.js +11 -11
- package/src/components/page/receive/putaway/skuAction/index.vue +742 -735
- package/src/components/page/receive/receipt/action/index.js +11 -11
- package/src/components/page/receive/receipt/action/index.vue +260 -260
- package/src/components/page/receive/receipt/index/index.js +11 -11
- package/src/components/page/receive/receipt/index/index.vue +124 -123
- package/src/components/ui/BottomBar/index.js +5 -5
- package/src/components/ui/BottomBar/index.vue +72 -72
- package/src/components/ui/BottomBarBtnHidden/index.js +11 -11
- package/src/components/ui/BottomBarBtnHidden/index.vue +91 -91
- package/src/components/ui/Button/index.js +5 -5
- package/src/components/ui/Button/index.vue +183 -183
- package/src/components/ui/CarPlate/index.js +11 -11
- package/src/components/ui/CarPlate/index.vue +378 -378
- package/src/components/ui/CarPlate//350/275/246/347/211/214/345/217/267.md +1 -1
- package/src/components/ui/Cell/index.js +5 -5
- package/src/components/ui/Cell/index.vue +259 -259
- package/src/components/ui/CellPopupDate/index.js +11 -11
- package/src/components/ui/CellPopupDate/index.vue +167 -167
- package/src/components/ui/CellPopupDate//345/215/225/345/205/203/350/241/214/345/212/240/346/227/266/351/227/264/351/200/211/346/213/251/345/231/250.md +1 -1
- package/src/components/ui/CellPopupRadio/index.js +11 -11
- package/src/components/ui/CellPopupRadio/index.vue +136 -136
- package/src/components/ui/CellPopupRadio//350/241/214/345/212/240/345/215/225/351/200/211/345/274/271/345/207/272/346/241/206.md +1 -1
- package/src/components/ui/CutCard/index.js +11 -11
- package/src/components/ui/CutCard/index.vue +132 -132
- package/src/components/ui/CutCard//345/215/241/347/211/207/351/241/265/351/235/242/345/210/207/346/215/242.md +1 -1
- package/src/components/ui/DataLookBg/index.js +11 -11
- package/src/components/ui/DataLookBg/index.vue +104 -104
- package/src/components/ui/DataLookBg//346/225/260/346/215/256/347/234/213/346/235/277/350/203/214/346/231/257/345/233/276.md +1 -1
- package/src/components/ui/ErrorMsg/index.js +59 -59
- package/src/components/ui/ErrorMsg/index.vue +141 -141
- package/src/components/ui/Form/index.js +5 -5
- package/src/components/ui/Form/index.vue +36 -36
- package/src/components/ui/ImgLook/index.js +5 -5
- package/src/components/ui/ImgLook/index.vue +96 -96
- package/src/components/ui/ImgUpload/index.js +12 -12
- package/src/components/ui/ImgUpload/index.vue +120 -120
- package/src/components/ui/Input/index.js +5 -5
- package/src/components/ui/Input/index.vue +554 -544
- package/src/components/ui/Input//350/276/223/345/205/245/346/241/206.md +1 -1
- package/src/components/ui/Loading/index.js +49 -49
- package/src/components/ui/Loading/index.vue +61 -61
- package/src/components/ui/MenuItem/index.js +5 -5
- package/src/components/ui/MenuItem/index.vue +170 -170
- package/src/components/ui/NavBar/index.js +5 -5
- package/src/components/ui/NavBar/index.vue +143 -143
- package/src/components/ui/NavBar//351/241/266/351/203/250/345/257/274/350/210/252/346/240/217.md +1 -1
- package/src/components/ui/NotData/index.js +5 -5
- package/src/components/ui/NotData/index.vue +75 -75
- package/src/components/ui/Pages/index.js +5 -5
- package/src/components/ui/Pages/index.vue +186 -186
- package/src/components/ui/Popup/index.js +5 -5
- package/src/components/ui/Popup/index.vue +245 -245
- package/src/components/ui/PopupCheckbox/index.js +5 -5
- package/src/components/ui/PopupCheckbox/index.vue +207 -207
- package/src/components/ui/PopupRadio/index.js +5 -5
- package/src/components/ui/PopupRadio/index.vue +124 -124
- package/src/components/ui/TabBar/index.js +11 -11
- package/src/components/ui/TabBar/index.vue +132 -132
- package/src/components/ui/TabBar//345/272/225/351/203/250/345/257/274/350/210/252/346/240/217.md +1 -1
- package/src/components/ui/Table/index.js +5 -5
- package/src/components/ui/Table/index.vue +213 -213
- package/src/components/ui/Tag/index.js +5 -5
- package/src/components/ui/Tag/index.vue +142 -142
- package/src/components/ui/TitleValueCell/index.js +11 -11
- package/src/components/ui/TitleValueCell/index.vue +61 -61
- package/src/components/ui/index.js +84 -84
- package/src/directive/Permissions.js +35 -37
- package/src/directive/index.js +12 -12
- package/src/index.js +67 -67
- package/src/mixins/loginAndInit/index.js +27 -0
- package/src/mixins/loginAndInit//346/234/211token/346/227/266/345/200/231/345/222/214/346/234/211/344/273/223/345/272/223id/346/227/266/351/234/200/350/246/201/345/210/235/345/247/213/345/214/226/347/232/204/346/225/260/346/215/256.md +0 -0
- package/src/mixins//346/267/267/345/205/245.md +0 -0
- package/src/router/index.js +405 -393
- package/src/router/menu.js +367 -354
- package/src/test/file/index.js +11 -11
- package/src/test/file/index.vue +25 -25
- package/src/utils/ApiUtils.js +48 -48
- package/src/utils/AppBack.js +44 -44
- package/src/utils/Axios.js +160 -160
- package/src/utils/BarcodeResolve.js +281 -0
- package/src/utils/DateTime.js +219 -219
- package/src/utils/DeepCopy.js +61 -61
- package/src/utils/Dict.js +73 -73
- package/src/utils/GetImgSrc.js +53 -53
- package/src/utils/Init.js +12 -12
- package/src/utils/Language.js +59 -59
- package/src/utils/LocalStorage.js +30 -30
- package/src/utils/Permissions.js +51 -51
- package/src/utils/Print.js +179 -179
- package/src/utils/README.md +2 -2
- package/src/utils/RouteInit.js +14 -14
- package/src/utils/ScanRule.js +150 -150
- package/src/utils/SetColor.js +22 -22
- package/src/utils/TabBar.js +30 -30
- package/src/utils/Tip.js +26 -26
- package/src/utils/Toast.js +41 -41
- package/src/utils/UUID.js +33 -33
- package/src/utils/Warehouse.js +26 -26
- package/src/utils/index.js +63 -61
- package/src/utils/windowGlobalData.js +88 -88
- package/src/views/common/home/index.vue +67 -67
- package/src/views/common/init/index.vue +128 -122
- package/src/views/common/login/index.vue +23 -23
- package/src/views/common/menu/menuOne.vue +36 -36
- package/src/views/common/menu/menuTwo.vue +33 -33
- package/src/views/common/my/device.vue +23 -23
- package/src/views/common/my/index.vue +23 -23
- package/src/views/common/my/language.vue +23 -23
- package/src/views/common/my/msg.vue +23 -23
- package/src/views/common/my/print.vue +23 -23
- package/src/views/common/my/warehouse.vue +25 -25
- package/src/views/common/task/index.vue +23 -23
- package/src/views/count/index.vue +87 -87
- package/src/views/count/inv/action.vue +12 -12
- package/src/views/count/inv/index.vue +12 -12
- package/src/views/count/loc/action.vue +12 -12
- package/src/views/count/loc/index.vue +12 -12
- package/src/views/inbound/newProject/action.vue +23 -0
- package/src/views/inbound/newProject/index.vue +23 -0
- package/src/views/inbound/quality/InboundQualityExecuteView.vue +11 -11
- package/src/views/inbound/quality/InboundQualityTaskListView.vue +11 -11
- package/src/views/inbound/receive/home.vue +14 -14
- package/src/views/inbound/receive/index.vue +13 -13
- package/src/views/inbound/receive/sku/InboundReceiveSkuAdvanceView.vue +13 -13
- package/src/views/inbound/receive/sku/InboundReceiveSkuDirectView.vue +13 -13
- package/src/views/inbound/receive/sku/InboundReceiveSkuScanView.vue +13 -13
- package/src/views/inner/abnormalMove/index.vue +23 -23
- package/src/views/inner/disposeAbnormal/action.vue +23 -23
- package/src/views/inner/disposeAbnormal/index.vue +23 -23
- package/src/views/inner/lpnMove/action.vue +23 -23
- package/src/views/inner/lpnMove/index.vue +23 -23
- package/src/views/inner/materialApply/action.vue +22 -22
- package/src/views/inner/materialApply/generate.vue +22 -22
- package/src/views/inner/movePutAway/index.vue +22 -22
- package/src/views/inner/randomMove/index.vue +23 -23
- package/src/views/inner/reportAbnormal/action.vue +23 -23
- package/src/views/inner/reportAbnormal/index.vue +23 -23
- package/src/views/inner/taskMove/index.vue +23 -23
- package/src/views/outbound/aloneBale/action.vue +23 -23
- package/src/views/outbound/aloneBale/index.vue +23 -23
- package/src/views/outbound/aloneBale/newBale.vue +23 -23
- package/src/views/outbound/bale/action.vue +23 -23
- package/src/views/outbound/bale/allCheck.vue +23 -23
- package/src/views/outbound/bale/index.vue +23 -23
- package/src/views/outbound/bale/newBale.vue +23 -23
- package/src/views/outbound/delivery/action.vue +23 -23
- package/src/views/outbound/delivery/addOrder.vue +23 -23
- package/src/views/outbound/delivery/index.vue +23 -23
- package/src/views/outbound/pick/aloneAction.vue +23 -23
- package/src/views/outbound/pick/boxAction.vue +23 -23
- package/src/views/outbound/pick/index.vue +23 -23
- package/src/views/outbound/pick/lpnAction.vue +23 -23
- package/src/views/outbound/pick/notAloneAction.vue +23 -23
- package/src/views/outbound/pickMerge/action.vue +23 -23
- package/src/views/outbound/pickMerge/content.vue +23 -23
- package/src/views/outbound/pickMerge/index.vue +23 -23
- package/src/views/outbound/sow/action.vue +23 -23
- package/src/views/outbound/sow/index.vue +23 -23
- package/src/views/outbound/summary/box/index.vue +23 -23
- package/src/views/outbound/summary/lpn/action.vue +23 -23
- package/src/views/outbound/summary/lpn/index.vue +23 -23
- package/src/views/receive/abnormal/action.vue +23 -23
- package/src/views/receive/abnormal/index.vue +24 -24
- package/src/views/receive/putaway/index.vue +23 -23
- package/src/views/receive/putaway/lpnAction.vue +23 -23
- package/src/views/receive/putaway/skuAction.vue +23 -23
- package/src/views/receive/receipt/action.vue +25 -25
- package/src/views/receive/receipt/index.vue +25 -25
package/src/test/file/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/*
|
|
2
|
-
*
|
|
3
|
-
* @author: 张文
|
|
4
|
-
* @date 2022-02-25
|
|
5
|
-
* */
|
|
6
|
-
|
|
7
|
-
import lw from "./index.vue";
|
|
8
|
-
|
|
9
|
-
lw.install = Vue => Vue.component(lw.name, lw)
|
|
10
|
-
|
|
11
|
-
export default lw
|
|
1
|
+
/*
|
|
2
|
+
*
|
|
3
|
+
* @author: 张文
|
|
4
|
+
* @date 2022-02-25
|
|
5
|
+
* */
|
|
6
|
+
|
|
7
|
+
import lw from "./index.vue";
|
|
8
|
+
|
|
9
|
+
lw.install = Vue => Vue.component(lw.name, lw)
|
|
10
|
+
|
|
11
|
+
export default lw
|
package/src/test/file/index.vue
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
|
|
3
|
-
@author: 张文
|
|
4
|
-
@date: 2022-02-25
|
|
5
|
-
-->
|
|
6
|
-
<template>
|
|
7
|
-
<div>
|
|
8
|
-
|
|
9
|
-
</div>
|
|
10
|
-
</template>
|
|
11
|
-
|
|
12
|
-
<script>
|
|
13
|
-
|
|
14
|
-
export default {
|
|
15
|
-
name: "index",
|
|
16
|
-
data() {
|
|
17
|
-
return {}
|
|
18
|
-
},
|
|
19
|
-
methods: {}
|
|
20
|
-
}
|
|
21
|
-
</script>
|
|
22
|
-
|
|
23
|
-
<style scoped lang="less">
|
|
24
|
-
|
|
25
|
-
</style>
|
|
1
|
+
<!--
|
|
2
|
+
|
|
3
|
+
@author: 张文
|
|
4
|
+
@date: 2022-02-25
|
|
5
|
+
-->
|
|
6
|
+
<template>
|
|
7
|
+
<div>
|
|
8
|
+
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script>
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
name: "index",
|
|
16
|
+
data() {
|
|
17
|
+
return {}
|
|
18
|
+
},
|
|
19
|
+
methods: {}
|
|
20
|
+
}
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<style scoped lang="less">
|
|
24
|
+
|
|
25
|
+
</style>
|
package/src/utils/ApiUtils.js
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* token数据
|
|
3
|
-
* @author 张文
|
|
4
|
-
* @date 2022-02-10
|
|
5
|
-
* */
|
|
6
|
-
|
|
7
|
-
import lwAxios from "./Axios";
|
|
8
|
-
|
|
9
|
-
export const ApiUtils = {
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* 设置token
|
|
13
|
-
* @author 张文
|
|
14
|
-
* @param {String} data 需要设置的token
|
|
15
|
-
* */
|
|
16
|
-
setToken(data){
|
|
17
|
-
window.sessionStorage.setItem('lwToken', data)
|
|
18
|
-
lwAxios.updateToken(data)
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
// 获取token
|
|
23
|
-
getToken() {
|
|
24
|
-
return window.sessionStorage.getItem('lwToken')
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
// 删除token
|
|
29
|
-
delToken() {
|
|
30
|
-
return window.sessionStorage.removeItem('lwToken')
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* 设置平台接口路径
|
|
36
|
-
* @author 张文
|
|
37
|
-
* @param {String} url 平台接口路径
|
|
38
|
-
* */
|
|
39
|
-
setApiUrl(url){
|
|
40
|
-
window.lwWindowGlobalData.set('apiUrl', url)
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
// 获取平台路径
|
|
45
|
-
getApiUrl(){
|
|
46
|
-
return window.lwWindowGlobalData.get('apiUrl')
|
|
47
|
-
},
|
|
48
|
-
}
|
|
1
|
+
/*
|
|
2
|
+
* token数据
|
|
3
|
+
* @author 张文
|
|
4
|
+
* @date 2022-02-10
|
|
5
|
+
* */
|
|
6
|
+
|
|
7
|
+
import lwAxios from "./Axios";
|
|
8
|
+
|
|
9
|
+
export const ApiUtils = {
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* 设置token
|
|
13
|
+
* @author 张文
|
|
14
|
+
* @param {String} data 需要设置的token
|
|
15
|
+
* */
|
|
16
|
+
setToken(data){
|
|
17
|
+
window.sessionStorage.setItem('lwToken', data)
|
|
18
|
+
lwAxios.updateToken(data)
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
// 获取token
|
|
23
|
+
getToken() {
|
|
24
|
+
return window.sessionStorage.getItem('lwToken')
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
// 删除token
|
|
29
|
+
delToken() {
|
|
30
|
+
return window.sessionStorage.removeItem('lwToken')
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* 设置平台接口路径
|
|
36
|
+
* @author 张文
|
|
37
|
+
* @param {String} url 平台接口路径
|
|
38
|
+
* */
|
|
39
|
+
setApiUrl(url){
|
|
40
|
+
window.lwWindowGlobalData.set('apiUrl', url)
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
// 获取平台路径
|
|
45
|
+
getApiUrl(){
|
|
46
|
+
return window.lwWindowGlobalData.get('apiUrl')
|
|
47
|
+
},
|
|
48
|
+
}
|
package/src/utils/AppBack.js
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* 提供给app返回按钮使用
|
|
3
|
-
* @author: 张文
|
|
4
|
-
* @date 2022-06-15
|
|
5
|
-
* */
|
|
6
|
-
|
|
7
|
-
export const AppBack = {
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* 产品预设的返回路由
|
|
11
|
-
* @author 张文
|
|
12
|
-
* */
|
|
13
|
-
projectRoute(){
|
|
14
|
-
return ['/', '/lwHome', '/lwLogin', '/lwMy', '/lwInit']
|
|
15
|
-
},
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* 设置需要退出app的路由
|
|
19
|
-
* @author 张文
|
|
20
|
-
* @param {Array} arr 需要设置的数据
|
|
21
|
-
* @return -
|
|
22
|
-
* */
|
|
23
|
-
setExitRoute(arr=[]){
|
|
24
|
-
|
|
25
|
-
if (!Array.isArray(arr)){
|
|
26
|
-
console.warn('app返回路由设置:设置数据为非数组!设置将不生效', arr)
|
|
27
|
-
return
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
window.lwWindowGlobalData.set('appBackRoute', arr)
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* 获取退出app的路由
|
|
35
|
-
* @author 张文
|
|
36
|
-
* @return {Array} 当前设置的路由
|
|
37
|
-
* */
|
|
38
|
-
getExitRoute(){
|
|
39
|
-
let list = window.lwWindowGlobalData.get('appBackRoute') || []
|
|
40
|
-
|
|
41
|
-
return this.projectRoute().concat(list)
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
}
|
|
1
|
+
/*
|
|
2
|
+
* 提供给app返回按钮使用
|
|
3
|
+
* @author: 张文
|
|
4
|
+
* @date 2022-06-15
|
|
5
|
+
* */
|
|
6
|
+
|
|
7
|
+
export const AppBack = {
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 产品预设的返回路由
|
|
11
|
+
* @author 张文
|
|
12
|
+
* */
|
|
13
|
+
projectRoute(){
|
|
14
|
+
return ['/', '/lwHome', '/lwLogin', '/lwMy', '/lwInit']
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* 设置需要退出app的路由
|
|
19
|
+
* @author 张文
|
|
20
|
+
* @param {Array} arr 需要设置的数据
|
|
21
|
+
* @return -
|
|
22
|
+
* */
|
|
23
|
+
setExitRoute(arr=[]){
|
|
24
|
+
|
|
25
|
+
if (!Array.isArray(arr)){
|
|
26
|
+
console.warn('app返回路由设置:设置数据为非数组!设置将不生效', arr)
|
|
27
|
+
return
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
window.lwWindowGlobalData.set('appBackRoute', arr)
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* 获取退出app的路由
|
|
35
|
+
* @author 张文
|
|
36
|
+
* @return {Array} 当前设置的路由
|
|
37
|
+
* */
|
|
38
|
+
getExitRoute(){
|
|
39
|
+
let list = window.lwWindowGlobalData.get('appBackRoute') || []
|
|
40
|
+
|
|
41
|
+
return this.projectRoute().concat(list)
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
}
|
package/src/utils/Axios.js
CHANGED
|
@@ -1,160 +1,160 @@
|
|
|
1
|
-
|
|
2
|
-
/*
|
|
3
|
-
* 数据请求
|
|
4
|
-
* @author 张文
|
|
5
|
-
* @date 2022-02-10
|
|
6
|
-
* */
|
|
7
|
-
|
|
8
|
-
import Axios from 'axios'
|
|
9
|
-
import {ApiUtils} from "./ApiUtils";
|
|
10
|
-
import {Warehouse} from "./Warehouse";
|
|
11
|
-
import {lwShowErrorMsg} from "../components/ui/ErrorMsg";
|
|
12
|
-
import {lwShowLoading, lwCloseLoading} from "../components/ui/Loading";
|
|
13
|
-
import {Language} from "./Language";
|
|
14
|
-
|
|
15
|
-
// 用于自定义处理http报错的问题,为false时候不显示报错信息,直接返回错误信息,通过catch接收
|
|
16
|
-
let errGetMe = false
|
|
17
|
-
|
|
18
|
-
const lwAxios = Axios.create({
|
|
19
|
-
baseURL: process.env.VUE_APP_BASE_URL,
|
|
20
|
-
timeout: 1000 * 60 * 30,
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* 设置基础 Url 的方法
|
|
26
|
-
* @author 张文
|
|
27
|
-
* @param url 需要设置的url,修改后将影响所有请求的代理路径
|
|
28
|
-
* */
|
|
29
|
-
lwAxios.setBaseUrl = url => lwAxios.defaults.baseURL = url
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* 更新请求的 Token,正常情况下无需手动更新token,因为当token发生变化时应当主动触发 lwApiUtils.setToken 方法。从而会自动更新当前token
|
|
34
|
-
* @author 张文
|
|
35
|
-
* @param token 需要更新的token,设置token请使用 lwApiUtils.setToken 方法
|
|
36
|
-
* */
|
|
37
|
-
lwAxios.updateToken = token => {
|
|
38
|
-
lwAxios.defaults.headers.common['Authorization'] = token
|
|
39
|
-
lwAxios.defaults.headers.common['token'] = token
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
// 是否有用户Token
|
|
44
|
-
lwAxios.hasToken = () => !!lwAxios.defaults.headers.common['token']
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* 调用平台接口的方法
|
|
49
|
-
* @author 张文
|
|
50
|
-
* @param {Object} obj
|
|
51
|
-
* url-接口,
|
|
52
|
-
* data-数据,
|
|
53
|
-
* config-基础配置{loading-是否需要显示加载框(默认开启),errGetMe-是否由请求接口处理错误信息(默认开启)},
|
|
54
|
-
* method-请求的方法默认post
|
|
55
|
-
* @returns Function 异步函数
|
|
56
|
-
*/
|
|
57
|
-
lwAxios.action = ({url, data, config, method = 'post'}) => {
|
|
58
|
-
const aux = data || {}
|
|
59
|
-
if (!aux.warehouseId) {
|
|
60
|
-
aux.warehouseId = Warehouse.get().id
|
|
61
|
-
}
|
|
62
|
-
return lwAxios({
|
|
63
|
-
method,
|
|
64
|
-
url: ApiUtils.getApiUrl() + url,
|
|
65
|
-
data: {aux},
|
|
66
|
-
...config
|
|
67
|
-
})
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
// 请求拦截
|
|
72
|
-
lwAxios.interceptors.request.use(
|
|
73
|
-
config => {
|
|
74
|
-
let csrf = /XSRF-TOKEN=([\w-]+)/.test(document.cookie) && RegExp.$1
|
|
75
|
-
if (csrf) {
|
|
76
|
-
config.headers['X-XSRF-TOKEN'] = csrf
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// 判断是否显示加载框
|
|
80
|
-
if (config.loading || config.loading === undefined){
|
|
81
|
-
lwShowLoading()
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// 记录当前请求是否需要手动处理报错
|
|
85
|
-
errGetMe=config.errGetMe
|
|
86
|
-
|
|
87
|
-
return config
|
|
88
|
-
},
|
|
89
|
-
error => {
|
|
90
|
-
lwCloseLoading()
|
|
91
|
-
console.warn('请求异常: ', error)
|
|
92
|
-
return Promise.reject(error)
|
|
93
|
-
}
|
|
94
|
-
)
|
|
95
|
-
|
|
96
|
-
// 响应拦截
|
|
97
|
-
lwAxios.interceptors.response.use(
|
|
98
|
-
response => {
|
|
99
|
-
|
|
100
|
-
lwCloseLoading()
|
|
101
|
-
|
|
102
|
-
let result = response.data
|
|
103
|
-
if (!result || !['none', 'success'].includes(result.code)) {
|
|
104
|
-
throw Error({ response })
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// 更新 token
|
|
108
|
-
if (result && result.renewedToken) {
|
|
109
|
-
ApiUtils.setToken(result.renewedToken)
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
if (typeof response.config['map'] === 'function') {
|
|
113
|
-
return response.config['map'](result.data)
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
return result.data
|
|
117
|
-
},
|
|
118
|
-
error => {
|
|
119
|
-
|
|
120
|
-
lwCloseLoading()
|
|
121
|
-
console.warn('接口返回异常: ', error)
|
|
122
|
-
|
|
123
|
-
let resp = error.response
|
|
124
|
-
|
|
125
|
-
if (errGetMe){
|
|
126
|
-
errGetMe = false
|
|
127
|
-
return Promise.reject(resp)
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
if (resp){
|
|
131
|
-
if (resp.status === 401) {
|
|
132
|
-
ApiUtils.setToken(undefined)
|
|
133
|
-
lwShowErrorMsg({ message: Language.get('wms_project.pda.utils.axios.loginOvertime', '登录超时,请重新登录') })
|
|
134
|
-
ApiUtils.delToken()
|
|
135
|
-
history.go(0)
|
|
136
|
-
return Promise.reject(resp)
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
if (resp.status === 404){
|
|
140
|
-
lwShowErrorMsg({ message: Language.get('wms_project.pda.utils.axios.serveError', '请求失败,接口路径错误(404)') })
|
|
141
|
-
return Promise.reject(resp)
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
if (resp.data) {
|
|
145
|
-
lwShowErrorMsg({
|
|
146
|
-
message: resp.data && resp.data.message ?
|
|
147
|
-
resp.data.message :
|
|
148
|
-
Language.get('wms_project.pda.utils.axios.unknownError', '未知错误(可能是系统正在升级或异常)请稍后再试')
|
|
149
|
-
})
|
|
150
|
-
return Promise.reject(resp)
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
lwShowErrorMsg({message: Language.get('wms_project.pda.utils.axios.network', '请求失败,请检查网络连接')})
|
|
156
|
-
return Promise.reject(resp)
|
|
157
|
-
}
|
|
158
|
-
)
|
|
159
|
-
|
|
160
|
-
export default lwAxios
|
|
1
|
+
|
|
2
|
+
/*
|
|
3
|
+
* 数据请求
|
|
4
|
+
* @author 张文
|
|
5
|
+
* @date 2022-02-10
|
|
6
|
+
* */
|
|
7
|
+
|
|
8
|
+
import Axios from 'axios'
|
|
9
|
+
import {ApiUtils} from "./ApiUtils";
|
|
10
|
+
import {Warehouse} from "./Warehouse";
|
|
11
|
+
import {lwShowErrorMsg} from "../components/ui/ErrorMsg";
|
|
12
|
+
import {lwShowLoading, lwCloseLoading} from "../components/ui/Loading";
|
|
13
|
+
import {Language} from "./Language";
|
|
14
|
+
|
|
15
|
+
// 用于自定义处理http报错的问题,为false时候不显示报错信息,直接返回错误信息,通过catch接收
|
|
16
|
+
let errGetMe = false
|
|
17
|
+
|
|
18
|
+
const lwAxios = Axios.create({
|
|
19
|
+
baseURL: process.env.VUE_APP_BASE_URL,
|
|
20
|
+
timeout: 1000 * 60 * 30,
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* 设置基础 Url 的方法
|
|
26
|
+
* @author 张文
|
|
27
|
+
* @param url 需要设置的url,修改后将影响所有请求的代理路径
|
|
28
|
+
* */
|
|
29
|
+
lwAxios.setBaseUrl = url => lwAxios.defaults.baseURL = url
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* 更新请求的 Token,正常情况下无需手动更新token,因为当token发生变化时应当主动触发 lwApiUtils.setToken 方法。从而会自动更新当前token
|
|
34
|
+
* @author 张文
|
|
35
|
+
* @param token 需要更新的token,设置token请使用 lwApiUtils.setToken 方法
|
|
36
|
+
* */
|
|
37
|
+
lwAxios.updateToken = token => {
|
|
38
|
+
lwAxios.defaults.headers.common['Authorization'] = token
|
|
39
|
+
lwAxios.defaults.headers.common['token'] = token
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
// 是否有用户Token
|
|
44
|
+
lwAxios.hasToken = () => !!lwAxios.defaults.headers.common['token']
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* 调用平台接口的方法
|
|
49
|
+
* @author 张文
|
|
50
|
+
* @param {Object} obj
|
|
51
|
+
* url-接口,
|
|
52
|
+
* data-数据,
|
|
53
|
+
* config-基础配置{loading-是否需要显示加载框(默认开启),errGetMe-是否由请求接口处理错误信息(默认开启)},
|
|
54
|
+
* method-请求的方法默认post
|
|
55
|
+
* @returns Function 异步函数
|
|
56
|
+
*/
|
|
57
|
+
lwAxios.action = ({url, data, config, method = 'post'}) => {
|
|
58
|
+
const aux = data || {}
|
|
59
|
+
if (!aux.warehouseId) {
|
|
60
|
+
aux.warehouseId = Warehouse.get().id
|
|
61
|
+
}
|
|
62
|
+
return lwAxios({
|
|
63
|
+
method,
|
|
64
|
+
url: ApiUtils.getApiUrl() + url,
|
|
65
|
+
data: {aux},
|
|
66
|
+
...config
|
|
67
|
+
})
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
// 请求拦截
|
|
72
|
+
lwAxios.interceptors.request.use(
|
|
73
|
+
config => {
|
|
74
|
+
let csrf = /XSRF-TOKEN=([\w-]+)/.test(document.cookie) && RegExp.$1
|
|
75
|
+
if (csrf) {
|
|
76
|
+
config.headers['X-XSRF-TOKEN'] = csrf
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// 判断是否显示加载框
|
|
80
|
+
if (config.loading || config.loading === undefined){
|
|
81
|
+
lwShowLoading()
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// 记录当前请求是否需要手动处理报错
|
|
85
|
+
errGetMe=config.errGetMe
|
|
86
|
+
|
|
87
|
+
return config
|
|
88
|
+
},
|
|
89
|
+
error => {
|
|
90
|
+
lwCloseLoading()
|
|
91
|
+
console.warn('请求异常: ', error)
|
|
92
|
+
return Promise.reject(error)
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
// 响应拦截
|
|
97
|
+
lwAxios.interceptors.response.use(
|
|
98
|
+
response => {
|
|
99
|
+
|
|
100
|
+
lwCloseLoading()
|
|
101
|
+
|
|
102
|
+
let result = response.data
|
|
103
|
+
if (!result || !['none', 'success'].includes(result.code)) {
|
|
104
|
+
throw Error({ response })
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// 更新 token
|
|
108
|
+
if (result && result.renewedToken) {
|
|
109
|
+
ApiUtils.setToken(result.renewedToken)
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (typeof response.config['map'] === 'function') {
|
|
113
|
+
return response.config['map'](result.data)
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return result.data
|
|
117
|
+
},
|
|
118
|
+
error => {
|
|
119
|
+
|
|
120
|
+
lwCloseLoading()
|
|
121
|
+
console.warn('接口返回异常: ', error)
|
|
122
|
+
|
|
123
|
+
let resp = error.response
|
|
124
|
+
|
|
125
|
+
if (errGetMe){
|
|
126
|
+
errGetMe = false
|
|
127
|
+
return Promise.reject(resp)
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (resp){
|
|
131
|
+
if (resp.status === 401) {
|
|
132
|
+
ApiUtils.setToken(undefined)
|
|
133
|
+
lwShowErrorMsg({ message: Language.get('wms_project.pda.utils.axios.loginOvertime', '登录超时,请重新登录') })
|
|
134
|
+
ApiUtils.delToken()
|
|
135
|
+
history.go(0)
|
|
136
|
+
return Promise.reject(resp)
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
if (resp.status === 404){
|
|
140
|
+
lwShowErrorMsg({ message: Language.get('wms_project.pda.utils.axios.serveError', '请求失败,接口路径错误(404)') })
|
|
141
|
+
return Promise.reject(resp)
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
if (resp.data) {
|
|
145
|
+
lwShowErrorMsg({
|
|
146
|
+
message: resp.data && resp.data.message ?
|
|
147
|
+
resp.data.message :
|
|
148
|
+
Language.get('wms_project.pda.utils.axios.unknownError', '未知错误(可能是系统正在升级或异常)请稍后再试')
|
|
149
|
+
})
|
|
150
|
+
return Promise.reject(resp)
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
lwShowErrorMsg({message: Language.get('wms_project.pda.utils.axios.network', '请求失败,请检查网络连接')})
|
|
156
|
+
return Promise.reject(resp)
|
|
157
|
+
}
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
export default lwAxios
|