| | |
| | | <template> |
| | | <view> |
| | | <view class="content"> |
| | | <!-- <text>扫描结果:{{ scanResult }}</text> --> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | var main, receiver, filter; |
| | | var action, extraKey; |
| | | var _codeQueryTag = false; |
| | | export default { |
| | | data() { |
| | | return { |
| | | scanCode: '' |
| | | } |
| | | }, |
| | | created: function(option) { |
| | | uni.getSystemInfo({ |
| | | success: (res) => { |
| | | var brand = res.brand.toUpperCase(); |
| | | var model = res.model.toUpperCase(); |
| | | if (brand.indexOf("ZEBRA")!=-1 && model.indexOf("TC2")!=-1) { |
| | | action = "com.zebra.scan"; |
| | | extraKey = "com.motorolasolutions.emdk.datawedge.data_string"; |
| | | } else if (brand.indexOf("SEUIC")!=-1||brand.indexOf("AUTOID")!=-1) { |
| | | action = "com.android.server.scannerservice.broadcast"; |
| | | extraKey = "scannerdata"; |
| | | }else{ |
| | | return; |
| | | } |
| | | console.log(action); |
| | | console.log(extraKey); |
| | | this.initScan() |
| | | this.startScan(); |
| | | var main, receiver, filter; |
| | | var action, extraKey; |
| | | var _codeQueryTag = false; |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | scanCode: '', |
| | | scanResult: '' |
| | | } |
| | | }, |
| | | created() { |
| | | uni.getSystemInfo({ |
| | | success: (res) => { |
| | | var brand = res.brand.toUpperCase(); |
| | | var model = res.model.toUpperCase(); |
| | | |
| | | console.log('设备品牌:', brand); |
| | | console.log('设备型号:', model); |
| | | |
| | | // Zebra设备配置 |
| | | if (brand.indexOf("ZEBRA") != -1 && model.indexOf("TC2") != -1) { |
| | | action = "com.zebra.scan"; |
| | | extraKey = "com.motorolasolutions.emdk.datawedge.data_string"; |
| | | } |
| | | }) |
| | | // AUTOID9N设备配置 |
| | | else if (brand.indexOf("SEUIC") != -1 || brand.indexOf("AUTOID") != -1) { |
| | | // AUTOID9N专用配置 |
| | | if (model.indexOf("AUTOID9N") != -1) { |
| | | action = "com.android.server.scannerservice.broadcast"; |
| | | extraKey = "scannerdata"; // 或 "BARCODE_STRING",根据实际情况调整 |
| | | } |
| | | // 其他SEUIC设备 |
| | | else { |
| | | action = "com.android.server.scannerservice.broadcast"; |
| | | extraKey = "scannerdata"; |
| | | } |
| | | } |
| | | else { |
| | | console.log('未知设备品牌,无法初始化扫码'); |
| | | return; |
| | | } |
| | | |
| | | console.log('扫码广播配置:', { action, extraKey }); |
| | | this.initScan(); |
| | | this.startScan(); |
| | | }, |
| | | fail: (err) => { |
| | | console.error('获取系统信息失败:', err); |
| | | } |
| | | }); |
| | | }, |
| | | onLoad() { |
| | | // 监听全局扫码事件 |
| | | uni.$on('scan', (event) => { |
| | | this.scanResult = event.code; |
| | | console.log('扫码结果:', this.scanResult); |
| | | }); |
| | | }, |
| | | onUnload() { |
| | | this.stopScan(); |
| | | uni.$off('scan'); // 移除事件监听 |
| | | }, |
| | | methods: { |
| | | initScan() { |
| | | console.log('初始化扫码接收器'); |
| | | |
| | | |
| | | }, |
| | | onHide: function() { |
| | | this.stopScan(); |
| | | }, |
| | | destroyed: function() { |
| | | this.stopScan(); |
| | | }, |
| | | methods: { |
| | | initScan() { |
| | | console.log('initScan'); |
| | | let _this = this; |
| | | main = plus.android.runtimeMainActivity(); //获取activity |
| | | try { |
| | | main = plus.android.runtimeMainActivity(); // 获取activity |
| | | var IntentFilter = plus.android.importClass('android.content.IntentFilter'); |
| | | filter = new IntentFilter(); |
| | | //下面的addAction内改为自己的广播动作 |
| | | filter.addAction(action); |
| | | |
| | | console.log('注册广播过滤器:', action); |
| | | |
| | | receiver = plus.android.implements('io.dcloud.feature.internal.reflect.BroadcastReceiver', { |
| | | onReceive: function(context, intent) { |
| | | console.log('onReceive'); |
| | | plus.android.importClass(intent); |
| | | //下面的getStringExtra内改为自己的广播标签--有误 |
| | | let code = intent.getStringExtra(extraKey); |
| | | _this.queryCode(code); |
| | | } |
| | | onReceive: function (context, intent) { |
| | | console.log('接收到扫码广播'); |
| | | |
| | | try { |
| | | plus.android.importClass(intent); |
| | | let code = intent.getStringExtra(extraKey); |
| | | |
| | | if (code) { |
| | | console.log('扫码内容:', code); |
| | | this.queryCode(code); |
| | | } else { |
| | | console.warn('扫码内容为空,可能ExtraKey不正确:', extraKey); |
| | | |
| | | // 尝试备选ExtraKey |
| | | const altExtraKey = extraKey === "BARCODE_STRING" ? "scannerdata" : "BARCODE_STRING"; |
| | | code = intent.getStringExtra(altExtraKey); |
| | | |
| | | if (code) { |
| | | console.log('使用备选ExtraKey获取到内容:', altExtraKey); |
| | | this.queryCode(code); |
| | | } |
| | | } |
| | | } catch (e) { |
| | | console.error('处理扫码广播时出错:', e); |
| | | } |
| | | }.bind(this) // 确保this指向组件实例 |
| | | }); |
| | | }, |
| | | startScan() { |
| | | console.log('startScan'); |
| | | main.registerReceiver(receiver, filter); |
| | | }, |
| | | stopScan() { |
| | | console.log('stopScan'); |
| | | main.unregisterReceiver(receiver); |
| | | }, |
| | | queryCode: function(code) { |
| | | console.log('queryCode'); |
| | | if (_codeQueryTag) return false; |
| | | _codeQueryTag = true; |
| | | setTimeout(function() { |
| | | _codeQueryTag = false; |
| | | }, 150); |
| | | var id = code |
| | | uni.$emit('scan', { |
| | | code: id |
| | | }) |
| | | |
| | | console.log('扫码接收器初始化成功'); |
| | | } catch (e) { |
| | | console.error('初始化扫码接收器失败:', e); |
| | | } |
| | | }, |
| | | startScan() { |
| | | console.log('开始监听扫码广播'); |
| | | |
| | | try { |
| | | if (main && receiver && filter) { |
| | | main.registerReceiver(receiver, filter); |
| | | console.log('广播接收器已注册'); |
| | | } else { |
| | | console.error('无法注册广播接收器: 组件未初始化'); |
| | | } |
| | | } catch (e) { |
| | | console.error('注册广播接收器失败:', e); |
| | | } |
| | | }, |
| | | stopScan() { |
| | | console.log('停止监听扫码广播'); |
| | | |
| | | try { |
| | | if (main && receiver) { |
| | | main.unregisterReceiver(receiver); |
| | | console.log('广播接收器已注销'); |
| | | } |
| | | } catch (e) { |
| | | console.error('注销广播接收器失败:', e); |
| | | } |
| | | }, |
| | | queryCode(code) { |
| | | console.log('处理扫码结果:', code); |
| | | |
| | | if (_codeQueryTag) { |
| | | console.log('忽略重复扫码'); |
| | | return false; |
| | | } |
| | | |
| | | _codeQueryTag = true; |
| | | |
| | | // 防抖处理 |
| | | setTimeout(() => { |
| | | _codeQueryTag = false; |
| | | }, 150); |
| | | |
| | | // 触发全局事件 |
| | | uni.$emit('scan', { code }); |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style> |
| | | |
| | | </style> |
| | | <style></style> |
| | |
| | | { |
| | | "name" : "江东合金MES", |
| | | "appid" : "__UNI__2E031D3", |
| | | "description" : "pigcloud", |
| | | "versionName" : "4.0.2", |
| | | "versionCode" : 2, |
| | | "transformPx" : false, |
| | | "app-plus" : { |
| | | "compilerVersion" : 3, |
| | | "optimization" : { |
| | | "subPackages" : true |
| | | "name": "江东合金MES", |
| | | "appid": "__UNI__2E031D3", |
| | | "description": "pigcloud", |
| | | "versionName": "4.0.2", |
| | | "versionCode": 2, |
| | | "transformPx": false, |
| | | "app-plus": { |
| | | "compilerVersion": 3, |
| | | "optimization": { |
| | | "subPackages": true |
| | | }, |
| | | "safearea": { |
| | | "bottom": { |
| | | "offset": "none" |
| | | } |
| | | }, |
| | | "splashscreen": { |
| | | "alwaysShowBeforeRender": true, |
| | | "waiting": true, |
| | | "autoclose": true, |
| | | "delay": 0 |
| | | }, |
| | | "compatible": { |
| | | "ignoreVersion": true |
| | | }, |
| | | "usingComponents": true, |
| | | "nvueCompiler": "uni-app", |
| | | "modules": { |
| | | "Bluetooth": {} |
| | | }, |
| | | "distribute": { |
| | | "android": { |
| | | "permissions": [ |
| | | "<uses-feature android:name=\"android.hardware.camera\"/>", |
| | | "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>", |
| | | "<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>", |
| | | "<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>", |
| | | "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>", |
| | | "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>", |
| | | "<uses-permission android:name=\"android.permission.CALL_PHONE\"/>", |
| | | "<uses-permission android:name=\"android.permission.CAMERA\"/>", |
| | | "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>", |
| | | "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>", |
| | | "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>", |
| | | "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>", |
| | | "<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>", |
| | | "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>", |
| | | "<uses-permission android:name=\"android.permission.READ_LOGS\"/>", |
| | | "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>", |
| | | "<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>", |
| | | "<uses-permission android:name=\"android.permission.VIBRATE\"/>", |
| | | "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>", |
| | | "<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>", |
| | | "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>", |
| | | "<uses-permission android:name=\"android.permission.BLUETOOTH\"/>", |
| | | "<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\"/>", |
| | | "<uses-permission android:name=\"android.permission.BLUETOOTH_CONNECT\"/> ", |
| | | "<uses-permission android:name=\"android.permission.BLUETOOTH_SCAN\"/>", |
| | | "<uses-permission android:name=\"android.permission.RECEIVE_SMS\"/>", |
| | | "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>", |
| | | "<uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\"/>" |
| | | ], |
| | | "abiFilters": ["armeabi-v7a", "arm64-v8a"] |
| | | }, |
| | | "ios": { |
| | | "dSYMs": false |
| | | }, |
| | | "sdkConfigs": { |
| | | "ad": {}, |
| | | "oauth": {} |
| | | }, |
| | | "icons": { |
| | | "android": { |
| | | "hdpi": "C:/Users/MLL/Desktop/03ae6e42ca681ffd98737b6a20f94d0.png", |
| | | "xhdpi": "C:/Users/MLL/Desktop/03ae6e42ca681ffd98737b6a20f94d0.png", |
| | | "xxhdpi": "C:/Users/MLL/Desktop/03ae6e42ca681ffd98737b6a20f94d0.png", |
| | | "xxxhdpi": "C:/Users/MLL/Desktop/03ae6e42ca681ffd98737b6a20f94d0.png" |
| | | }, |
| | | "safearea" : { |
| | | "bottom" : { |
| | | "offset" : "none" |
| | | } |
| | | }, |
| | | "splashscreen" : { |
| | | "alwaysShowBeforeRender" : true, |
| | | "waiting" : true, |
| | | "autoclose" : true, |
| | | "delay" : 0 |
| | | }, |
| | | "compatible" : { |
| | | "ignoreVersion" : true |
| | | }, |
| | | "usingComponents" : true, |
| | | "nvueCompiler" : "uni-app", |
| | | "modules" : { |
| | | "Bluetooth" : {} |
| | | }, |
| | | "distribute" : { |
| | | "android" : { |
| | | "permissions" : [ |
| | | "<uses-feature android:name=\"android.hardware.camera\"/>", |
| | | "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>", |
| | | "<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>", |
| | | "<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>", |
| | | "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>", |
| | | "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>", |
| | | "<uses-permission android:name=\"android.permission.CALL_PHONE\"/>", |
| | | "<uses-permission android:name=\"android.permission.CAMERA\"/>", |
| | | "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>", |
| | | "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>", |
| | | "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>", |
| | | "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>", |
| | | "<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>", |
| | | "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>", |
| | | "<uses-permission android:name=\"android.permission.READ_LOGS\"/>", |
| | | "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>", |
| | | "<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>", |
| | | "<uses-permission android:name=\"android.permission.VIBRATE\"/>", |
| | | "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>", |
| | | "<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>", |
| | | "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>", |
| | | "<uses-permission android:name=\"android.permission.BLUETOOTH\"/>", |
| | | "<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\"/>", |
| | | "<uses-permission android:name=\"android.permission.BLUETOOTH_CONNECT\"/> ", |
| | | "<uses-permission android:name=\"android.permission.BLUETOOTH_SCAN\"/>" |
| | | ], |
| | | "abiFilters" : [ "armeabi-v7a", "arm64-v8a" ] |
| | | }, |
| | | "ios" : { |
| | | "dSYMs" : false |
| | | }, |
| | | "sdkConfigs" : { |
| | | "ad" : {}, |
| | | "oauth" : {} |
| | | }, |
| | | "icons" : { |
| | | "android" : { |
| | | "hdpi" : "C:/Users/MLL/Desktop/03ae6e42ca681ffd98737b6a20f94d0.png", |
| | | "xhdpi" : "C:/Users/MLL/Desktop/03ae6e42ca681ffd98737b6a20f94d0.png", |
| | | "xxhdpi" : "C:/Users/MLL/Desktop/03ae6e42ca681ffd98737b6a20f94d0.png", |
| | | "xxxhdpi" : "C:/Users/MLL/Desktop/03ae6e42ca681ffd98737b6a20f94d0.png" |
| | | }, |
| | | "ios" : { |
| | | "appstore" : "", |
| | | "ipad" : { |
| | | "app" : "", |
| | | "app@2x" : "", |
| | | "notification" : "", |
| | | "notification@2x" : "", |
| | | "proapp@2x" : "", |
| | | "settings" : "", |
| | | "settings@2x" : "", |
| | | "spotlight" : "", |
| | | "spotlight@2x" : "" |
| | | }, |
| | | "iphone" : { |
| | | "app@2x" : "", |
| | | "app@3x" : "", |
| | | "notification@2x" : "", |
| | | "notification@3x" : "", |
| | | "settings@2x" : "", |
| | | "settings@3x" : "", |
| | | "spotlight@2x" : "", |
| | | "spotlight@3x" : "" |
| | | } |
| | | } |
| | | }, |
| | | "splashscreen" : { |
| | | "androidStyle" : "common" |
| | | } |
| | | }, |
| | | "nativePlugins" : { |
| | | "JCSDK-JCApiModule" : { |
| | | "__plugin_info__" : { |
| | | "name" : "精臣打印机接入插件", |
| | | "description" : "精臣系列打印机打印插件", |
| | | "platforms" : "Android,iOS", |
| | | "url" : "https://ext.dcloud.net.cn/plugin?id=10011", |
| | | "android_package_name" : "uni.UNI2E031D3", |
| | | "ios_bundle_id" : "", |
| | | "isCloud" : true, |
| | | "bought" : 1, |
| | | "pid" : "10011", |
| | | "parameters" : {} |
| | | } |
| | | } |
| | | "ios": { |
| | | "appstore": "", |
| | | "ipad": { |
| | | "app": "", |
| | | "app@2x": "", |
| | | "notification": "", |
| | | "notification@2x": "", |
| | | "proapp@2x": "", |
| | | "settings": "", |
| | | "settings@2x": "", |
| | | "spotlight": "", |
| | | "spotlight@2x": "" |
| | | }, |
| | | "iphone": { |
| | | "app@2x": "", |
| | | "app@3x": "", |
| | | "notification@2x": "", |
| | | "notification@3x": "", |
| | | "settings@2x": "", |
| | | "settings@3x": "", |
| | | "spotlight@2x": "", |
| | | "spotlight@3x": "" |
| | | } |
| | | } |
| | | }, |
| | | "splashscreen": { |
| | | "androidStyle": "common" |
| | | } |
| | | }, |
| | | "quickapp" : {}, |
| | | "mp-weixin" : { |
| | | "appid" : "wxf3e5cc7116d23b18", |
| | | "setting" : { |
| | | "urlCheck" : false, |
| | | "es6" : false, |
| | | "minified" : true, |
| | | "postcss" : true |
| | | "nativePlugins": { |
| | | "JCSDK-JCApiModule": { |
| | | "__plugin_info__": { |
| | | "name": "精臣打印机接入插件", |
| | | "description": "精臣系列打印机打印插件", |
| | | "platforms": "Android,iOS", |
| | | "url": "https://ext.dcloud.net.cn/plugin?id=10011", |
| | | "android_package_name": "uni.UNI2E031D3", |
| | | "ios_bundle_id": "", |
| | | "isCloud": true, |
| | | "bought": 1, |
| | | "pid": "10011", |
| | | "parameters": {} |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "quickapp": {}, |
| | | "mp-weixin": { |
| | | "appid": "wxf3e5cc7116d23b18", |
| | | "setting": { |
| | | "urlCheck": false, |
| | | "es6": false, |
| | | "minified": true, |
| | | "postcss": true |
| | | }, |
| | | "optimization": { |
| | | "subPackages": true |
| | | }, |
| | | "usingComponents": true |
| | | }, |
| | | "mp-alipay": { |
| | | "usingComponents": true, |
| | | "component2": true |
| | | }, |
| | | "mp-qq": { |
| | | "optimization": { |
| | | "subPackages": true |
| | | }, |
| | | "appid": "" |
| | | }, |
| | | "mp-baidu": { |
| | | "usingComponents": true, |
| | | "appid": "" |
| | | }, |
| | | "mp-toutiao": { |
| | | "usingComponents": true, |
| | | "appid": "" |
| | | }, |
| | | "h5": { |
| | | "template": "h5.html", |
| | | "router": { |
| | | "mode": "hash", |
| | | "base": "./" |
| | | }, |
| | | "optimization": { |
| | | "treeShaking": { |
| | | "enable": false |
| | | } |
| | | }, |
| | | "devServer": { |
| | | "port": 8080, //浏览器运行端口 |
| | | "disableHostCheck": true, |
| | | "proxy": { |
| | | "/auth": { |
| | | "target": "http://192.168.32.65:9999", |
| | | "changeOrigin": true, |
| | | "secure": false |
| | | }, |
| | | "optimization" : { |
| | | "subPackages" : true |
| | | "/mes": { |
| | | "target": "http://192.168.32.65:9999", |
| | | "changeOrigin": true, |
| | | "secure": false |
| | | }, |
| | | "usingComponents" : true |
| | | "/admin": { |
| | | "target": "http://192.168.32.65:9999", |
| | | "changeOrigin": true, |
| | | "secure": false |
| | | } |
| | | } |
| | | }, |
| | | "mp-alipay" : { |
| | | "usingComponents" : true, |
| | | "component2" : true |
| | | }, |
| | | "mp-qq" : { |
| | | "optimization" : { |
| | | "subPackages" : true |
| | | }, |
| | | "appid" : "" |
| | | }, |
| | | "mp-baidu" : { |
| | | "usingComponents" : true, |
| | | "appid" : "" |
| | | }, |
| | | "mp-toutiao" : { |
| | | "usingComponents" : true, |
| | | "appid" : "" |
| | | }, |
| | | "h5" : { |
| | | "template" : "h5.html", |
| | | "router" : { |
| | | "mode" : "hash", |
| | | "base" : "./" |
| | | }, |
| | | "optimization" : { |
| | | "treeShaking" : { |
| | | "enable" : false |
| | | } |
| | | }, |
| | | "devServer" : { |
| | | "port" : 8080, //浏览器运行端口 |
| | | "disableHostCheck" : true, |
| | | "proxy" : { |
| | | "/auth" : { |
| | | "target" : "http://192.168.32.65:9999", |
| | | "changeOrigin" : true, |
| | | "secure" : false |
| | | }, |
| | | "/mes" : { |
| | | "target" : "http://192.168.32.65:9999", |
| | | "changeOrigin" : true, |
| | | "secure" : false |
| | | }, |
| | | "/admin" : { |
| | | "target" : "http://192.168.32.65:9999", |
| | | "changeOrigin" : true, |
| | | "secure" : false |
| | | } |
| | | } |
| | | }, |
| | | "title" : "Asun-Mes", |
| | | "domain" : "/app" |
| | | }, |
| | | "locale" : "zh-Hans", |
| | | "fallbackLocale" : "zh-Hans" |
| | | "title": "Asun-Mes", |
| | | "domain": "/app" |
| | | }, |
| | | "locale": "zh-Hans", |
| | | "fallbackLocale": "zh-Hans" |
| | | } |
| | |
| | | <u-search v-model="keywords" placeholder="请输入库位名称" @clear="search" @custom="search" @search="search"> |
| | | </u-search> |
| | | </view> |
| | | <scroll-view class="scroll-list" scroll-y="true" > |
| | | <scroll-view class="scroll-list" scroll-y="true"> |
| | | <u-cell-group class="list" :border="false"> |
| | | <view v-if="locationList==0" class="nodata"> |
| | | <view v-if="locationList == 0" class="nodata"> |
| | | <view>未查到数据</view> |
| | | </view> |
| | | <view v-else class="content" v-for="(item, index) in locationList" :key="item.locNo" :index="index" |
| | |
| | | 库位类型: |
| | | </view> |
| | | <view class="_content"> |
| | | {{ getLocTypeName(item.locType)}} |
| | | {{ getLocTypeName(item.locType) }} |
| | | </view> |
| | | </view> |
| | | <view class="row-list"> |
| | | <view class="_label"> |
| | | 库位状态: |
| | | </view> |
| | | <view class="_content"> |
| | | {{getLocStatus(item.locStatus)}} |
| | | <view class="_content"> |
| | | {{ getLocStatus(item.locStatus) }} |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | </view> |
| | | </template> |
| | | <script> |
| | | import scan from "@/components/scan/scan.vue"; |
| | | export default { |
| | | components: { |
| | | scan |
| | | import scan from "@/components/scan/scan.vue"; |
| | | export default { |
| | | components: { |
| | | scan |
| | | }, |
| | | data() { |
| | | return { |
| | | originList: [], |
| | | locationList: [], |
| | | keywords: "", |
| | | dictType: "warehouse_type", |
| | | listLocType: [] |
| | | }; |
| | | }, |
| | | onLoad(params) { |
| | | |
| | | //获取数 库位状态 |
| | | this.$u.api.dictData({ |
| | | dictType: this.dictType |
| | | }).then(res => { |
| | | this.listLocType = res.data; |
| | | |
| | | }); |
| | | |
| | | if (params && params.workstationNo !== "undefined") { |
| | | this.loadList(params.workstationNo); |
| | | } |
| | | |
| | | }, |
| | | onShow() { |
| | | let that = this |
| | | uni.$off('scan') // 每次进来先 移除全局自定义事件监听器 |
| | | uni.$on('scan', function (data) { |
| | | console.log('onscan'); |
| | | //扫码成功后的回调,你可以写自己的逻辑代码在这里 |
| | | console.log('扫码结果:', data.code); |
| | | that.search(data.code); |
| | | }) |
| | | }, |
| | | onNavigationBarButtonTap(e) { |
| | | uni.scanCode({ |
| | | success: res => { |
| | | try { |
| | | const result = JSON.parse(res.result) |
| | | |
| | | } catch (e) { } |
| | | } |
| | | }); |
| | | }, |
| | | methods: { |
| | | getLocTypeName(locType) { |
| | | let reDate = "" |
| | | let that = this |
| | | //判断数组中是否存在 |
| | | let list = that.listLocType.filter(item => item.value == locType) |
| | | if (list.length > 0) { |
| | | reDate = list[0].label |
| | | } |
| | | return reDate |
| | | }, |
| | | data() { |
| | | return { |
| | | originList: [], |
| | | locationList: [], |
| | | keywords: "", |
| | | dictType: "warehouse_type", |
| | | listLocType: [] |
| | | }; |
| | | }, |
| | | onLoad(params) { |
| | | |
| | | //获取数 库位状态 |
| | | this.$u.api.dictData({ |
| | | dictType: this.dictType |
| | | }).then(res => { |
| | | this.listLocType = res.data; |
| | | |
| | | }); |
| | | |
| | | if (params && params.workstationNo !== "undefined") { |
| | | this.loadList(params.workstationNo); |
| | | getLocStatus(locStatus) { |
| | | let reDate = "" |
| | | switch (locStatus) { |
| | | case 1: |
| | | reDate = "使用"; |
| | | break; |
| | | case 0: |
| | | reDate = "停用"; |
| | | break; |
| | | } |
| | | |
| | | return reDate; |
| | | }, |
| | | onShow() { |
| | | selectLocation(location) { |
| | | this.refreshLastPage(location) |
| | | }, |
| | | //刷新上一个页面 |
| | | refreshLastPage(location) { |
| | | // 告知 A.vue 更新数据 |
| | | // 获取页面栈 |
| | | let pages = getCurrentPages() |
| | | |
| | | let that = this |
| | | // 获取上一页栈 |
| | | let prevPage = pages[pages.length - 2] |
| | | |
| | | uni.$off('scan') // 每次进来先 移除全局自定义事件监听器 |
| | | uni.$on('scan', function(data) { |
| | | console.log('onscan'); |
| | | //扫码成功后的回调,你可以写自己的逻辑代码在这里 |
| | | console.log('扫码结果:', data.code); |
| | | that.search(data.code); |
| | | // 触发上一页 upData 函数(并携带参数) |
| | | prevPage.$vm.setLocation(location) |
| | | |
| | | // 返回上一页 |
| | | uni.navigateBack({ |
| | | delta: 1 |
| | | }) |
| | | }, |
| | | onNavigationBarButtonTap(e) { |
| | | uni.scanCode({ |
| | | success: res => { |
| | | try { |
| | | const result = JSON.parse(res.result) |
| | | |
| | | } catch (e) {} |
| | | } |
| | | search(value) { |
| | | let that = this |
| | | if (value) { |
| | | that.locationList = that.originList.filter(item => item.locName.includes(value)) |
| | | } else { |
| | | that.locationList = that.originList |
| | | } |
| | | }, |
| | | loadList(workstationNo) { |
| | | let params = { |
| | | workstationNo: workstationNo |
| | | } |
| | | //根据工作站编号获取进行中的工单&&对应的线边仓 |
| | | this.$u.api.pigxFeed.getBasicInfoForPdaFeedByWorkstationNo(params).then(res => { |
| | | this.originList = res.data.locationList |
| | | this.locationList = this.originList |
| | | }); |
| | | }, |
| | | methods: { |
| | | getLocTypeName(locType) { |
| | | let reDate = "" |
| | | let that = this |
| | | //判断数组中是否存在 |
| | | let list = that.listLocType.filter(item => item.value == locType) |
| | | if (list.length > 0) { |
| | | reDate = list[0].label |
| | | } |
| | | return reDate |
| | | }, |
| | | getLocStatus(locStatus) { |
| | | let reDate = "" |
| | | switch (locStatus) { |
| | | case 1: |
| | | reDate = "使用"; |
| | | break; |
| | | case 0: |
| | | reDate = "停用"; |
| | | break; |
| | | } |
| | | |
| | | return reDate; |
| | | }, |
| | | selectLocation(location) { |
| | | this.refreshLastPage(location) |
| | | }, |
| | | //刷新上一个页面 |
| | | refreshLastPage(location) { |
| | | // 告知 A.vue 更新数据 |
| | | // 获取页面栈 |
| | | let pages = getCurrentPages() |
| | | |
| | | // 获取上一页栈 |
| | | let prevPage = pages[pages.length - 2] |
| | | |
| | | // 触发上一页 upData 函数(并携带参数) |
| | | prevPage.$vm.setLocation(location) |
| | | |
| | | // 返回上一页 |
| | | uni.navigateBack({ |
| | | delta: 1 |
| | | }) |
| | | }, |
| | | search(value) { |
| | | let that = this |
| | | if (value) { |
| | | that.locationList = that.originList.filter(item => item.locName.includes(value)) |
| | | } else { |
| | | that.locationList = that.originList |
| | | } |
| | | }, |
| | | loadList(workstationNo) { |
| | | let params = { |
| | | workstationNo: workstationNo |
| | | } |
| | | //根据工作站编号获取进行中的工单&&对应的线边仓 |
| | | this.$u.api.pigxFeed.getBasicInfoForPdaFeedByWorkstationNo(params).then(res => { |
| | | this.originList = res.data.locationList |
| | | this.locationList = this.originList |
| | | }); |
| | | }, |
| | | } |
| | | }; |
| | | } |
| | | }; |
| | | </script> |
| | | <style lang="scss"> |
| | | .list .content { |
| | | font-size: 12px; |
| | | background-color: #efefef; |
| | | box-sizing: border-box; |
| | | border-radius: 14rpx; |
| | | margin: 8px; |
| | | padding: 5px 10px; |
| | | box-shadow: none; |
| | | } |
| | | .list .content { |
| | | font-size: 12px; |
| | | background-color: #efefef; |
| | | box-sizing: border-box; |
| | | border-radius: 14rpx; |
| | | margin: 8px; |
| | | padding: 5px 10px; |
| | | box-shadow: none; |
| | | } |
| | | |
| | | .row-list { |
| | | display: flex; |
| | | flex-direction: row; |
| | | } |
| | | .row-list { |
| | | display: flex; |
| | | flex-direction: row; |
| | | } |
| | | |
| | | .row-list ._label { |
| | | flex: 0.8; |
| | | color: #909399; |
| | | } |
| | | .row-list ._label { |
| | | flex: 0.8; |
| | | color: #909399; |
| | | } |
| | | |
| | | .row-list ._content { |
| | | flex: 1.5; |
| | | text-align: right; |
| | | } |
| | | |
| | | .nodata{width: 20%;margin: auto;} |
| | | .row-list ._content { |
| | | flex: 1.5; |
| | | text-align: right; |
| | | } |
| | | |
| | | .nodata { |
| | | width: 20%; |
| | | margin: auto; |
| | | } |
| | | </style> |
| | |
| | | </u-field> |
| | | </modalBg> |
| | | <saveForm ref="saveForm" /> |
| | | <scan></scan> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import modalBg from '@/components/modal/modal-bg.vue' |
| | | import saveForm from './components/saveForm.vue' |
| | | import scan from "@/components/scan/scan.vue"; |
| | | export default { |
| | | components: { modalBg, saveForm }, |
| | | components: { modalBg, saveForm, scan }, |
| | | data() { |
| | | return { |
| | | checkboxList: [ |
| | |
| | | onReady() { |
| | | this.$refs.uForm.setRules(this.rules); |
| | | }, |
| | | onShow() { |
| | | let that = this |
| | | uni.$off('scan') // 每次进来先 移除全局自定义事件监听器 |
| | | uni.$on('scan', function (data) { |
| | | console.log('onscan'); |
| | | //扫码成功后的回调,你可以写自己的逻辑代码在这里 |
| | | console.log('页面扫码结果:', data.code); |
| | | if (data.code) { |
| | | let codeInfo = JSON.parse(data.code) |
| | | if (codeInfo.WorkNo) { |
| | | // 扫描报工单二维码 |
| | | that.saveForm(codeInfo); |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | methods: { |
| | | // 多选处理 |
| | | changeCheckbox(val) { |
| | |
| | | url: '/pages/product/report/orderList' |
| | | }) |
| | | }, |
| | | // 存订单号 |
| | | setNo(val) { |
| | | this.form.value3 = val |
| | | }, |
| | | // 回显扫码的信息-报工单 |
| | | saveForm(val) { |
| | | let { WorkNo, ProcessName, ORDER_NO } = val |
| | | this.form.value1 = WorkNo |
| | | this.form.value2 = ProcessName |
| | | this.form.value3 = ORDER_NO |
| | | } |
| | | } |
| | | } |
| | |
| | | <u-grid :border="false"> |
| | | <u-grid-item v-for="(baseListItem, baseListIndex) in item.list" :key="baseListIndex" |
| | | @click="navTo(baseListItem.url)"> |
| | | <img :src="require(`@/static/custom/home/${baseListItem.icon}.png`)" alt=""> |
| | | <view class="img" :style="`background: url(../../../static/custom/home/${baseListItem.icon}.png) no-repeat;`"> |
| | | </view> |
| | | <text class="grid-text">{{ baseListItem.name }}</text> |
| | | </u-grid-item> |
| | | </u-grid> |
| | |
| | | { |
| | | name: '报工', |
| | | url: '/pages/product/report/index', |
| | | icon: '报工' |
| | | icon: 'one' |
| | | }, |
| | | { |
| | | name: '取消报工', |
| | | url: '/pages/product/cancelReport/index', |
| | | icon: '取消报工' |
| | | icon: 'two' |
| | | }, |
| | | { |
| | | name: '接收(铜杆)', |
| | | url: '/', |
| | | icon: '接收(铜杆)' |
| | | icon: 'three' |
| | | }, |
| | | { |
| | | name: '车间订单下发', |
| | | url: '/', |
| | | icon: '车间订单下发' |
| | | icon: 'four' |
| | | }, |
| | | { |
| | | name: '车间取消下发', |
| | | url: '/', |
| | | icon: '车间取消下发' |
| | | icon: 'five' |
| | | }, |
| | | ] |
| | | }, |
| | |
| | | { |
| | | name: '移库', |
| | | url: '/pages/wareHouse/moveWareHouse/index', |
| | | icon: '移库' |
| | | icon: 'six' |
| | | }, |
| | | { |
| | | name: '盘点报告盘点', |
| | | url: '/pages/wareHouse/inventory/index', |
| | | icon: '盘点报告盘点' |
| | | icon: 'seven' |
| | | }, |
| | | { |
| | | name: '核磅录入', |
| | | url: '/pages/wareHouse/packing/registration', |
| | | icon: '核磅录入' |
| | | icon: 'eight' |
| | | }, |
| | | { |
| | | name: '库存件盘点', |
| | | url: '/pages/wareHouse/inventory/index', |
| | | icon: '库存件盘点' |
| | | icon: 'nine' |
| | | }, |
| | | { |
| | | name: '导体备货盘点', |
| | | url: '/pages/wareHouse/inventory/index', |
| | | icon: '导体备货盘点' |
| | | icon: 'ten' |
| | | }, |
| | | ] |
| | | }, |
| | |
| | | { |
| | | name: '领料', |
| | | url: '/pages/wareHouse/moveWareHouse/index', |
| | | icon: '领料' |
| | | icon: 'eleven' |
| | | }, |
| | | { |
| | | name: '取消领料', |
| | | url: '/pages/wareHouse/inventory/index', |
| | | icon: '取消领料' |
| | | icon: 'twelve' |
| | | }, |
| | | ] |
| | | } |
| | |
| | | </script> |
| | | <style lang="scss"> |
| | | .wrap { |
| | | height: calc(100vh - 200rpx); |
| | | height: 100%; |
| | | background: linear-gradient(to bottom, #e5f0ff, #f6f9ff); |
| | | overflow-y: auto; |
| | | } |
| | |
| | | .u-grid-item { |
| | | background: transparent !important; |
| | | } |
| | | |
| | | .img { |
| | | width: 96rpx; |
| | | height: 96rpx; |
| | | background-size: contain !important; |
| | | background-position: center !important; |
| | | } |
| | | </style> |
| | |
| | | |
| | | <style lang="scss" scoped> |
| | | .my { |
| | | height: calc(100vh - 100rpx); |
| | | height: 100%; |
| | | background: linear-gradient(to bottom, #E5F0FF, #F6F9FF); |
| | | |
| | | .my-head { |