diff --git a/src/common/scanConfig.js b/src/common/scanConfig.js
index 1a3d4da..fb3eae8 100644
--- a/src/common/scanConfig.js
+++ b/src/common/scanConfig.js
@@ -4,6 +4,9 @@ export const DICTIONARY_TYPE_SCANNER = 10046;
export const PHONE_SCAN_BRAND = 'phone';
+// 历史误用 brand=newland 表示东集;真正的新大陆是 nlscan
+const LEGACY_SEUIC_BRANDS = ['newland', '东集', 'idata'];
+
export const PHONE_SCAN_CONFIG = {
brand: PHONE_SCAN_BRAND,
name: '手机扫码',
@@ -16,6 +19,28 @@ export function isPhoneScanConfig(config) {
return !!(config && (config.isPhoneScan || config.brand === PHONE_SCAN_BRAND));
}
+function migrateLegacySeuicBrand(config) {
+ if (!config || isPhoneScanConfig(config)) {
+ return config;
+ }
+ const brand = String(config.brand || '');
+ const name = String(config.name || '');
+ const action = String(config.action || '');
+ // 历史内置配置把东集误标成 brand=newland;真正的新大陆是 nlscan
+ const isLegacySeuicLabel = LEGACY_SEUIC_BRANDS.includes(brand) || name === '东集';
+ if (!isLegacySeuicLabel) {
+ return config;
+ }
+ if (action.includes('nlscan')) {
+ return config;
+ }
+ return {
+ ...config,
+ brand: 'seuic',
+ name: (!name || name === '东集') ? '东大集成(AUTOID)' : name,
+ };
+}
+
function enrichFromBuiltinConfig(config, builtinConfigs = []) {
if (!config || !builtinConfigs.length) {
return config;
@@ -24,7 +49,13 @@ function enrichFromBuiltinConfig(config, builtinConfigs = []) {
const builtin = builtinConfigs.find((item) => {
return item.action === config.action
|| item.name === config.name
- || item.brand === config.brand;
+ || item.brand === config.brand
+ || (item.brand === 'seuic' && (
+ String(config.name || '').includes('东大')
+ || String(config.name || '').includes('东集')
+ || String(config.name || '').includes('AUTOID')
+ || String(config.action || '').includes('scannerservice.broadcast')
+ ));
});
if (!builtin) {
@@ -49,7 +80,7 @@ export function normalizeConfig(raw, builtinConfigs = []) {
return { ...PHONE_SCAN_CONFIG };
}
- const config = enrichFromBuiltinConfig({
+ let config = {
brand,
name: raw.name || '',
action: raw.action || raw.code || '',
@@ -57,7 +88,10 @@ export function normalizeConfig(raw, builtinConfigs = []) {
needSetup: raw.needSetup != null ? raw.needSetup : !!raw.need_setup,
setupAction: raw.setupAction || raw.setup_action || '',
setupParams: raw.setupParams || raw.setup_params || null,
- }, builtinConfigs);
+ };
+
+ config = migrateLegacySeuicBrand(config);
+ config = enrichFromBuiltinConfig(config, builtinConfigs);
if (!config.brand || !config.action || !config.dataKey) {
return null;
@@ -73,7 +107,16 @@ export function mapDictionaryToScannerConfig(raw, builtinConfigs = []) {
export function getScanConfig(builtinConfigs = []) {
try {
const data = uni.getStorageSync(STORAGE_KEY);
- return normalizeConfig(data, builtinConfigs);
+ const normalized = normalizeConfig(data, builtinConfigs);
+ // 旧 brand=newland(东集) 迁移后写回,避免下次仍读到错误 brand
+ if (normalized && data && String(data.brand || '') !== String(normalized.brand || '')) {
+ try {
+ uni.setStorageSync(STORAGE_KEY, normalized);
+ } catch (e) {
+ console.log('迁移扫码枪配置写回失败', e);
+ }
+ }
+ return normalized;
} catch (e) {
console.log('读取扫码枪配置失败', e);
return null;
diff --git a/src/common/scanMixin.js b/src/common/scanMixin.js
index 4406ac2..8e42082 100644
--- a/src/common/scanMixin.js
+++ b/src/common/scanMixin.js
@@ -10,7 +10,8 @@ import {
} from '@/common/scanConfig.js';
const PDA_DEVICE_KEYWORDS = [
- 'newland', 'nls', 'sunmi', 'urovo', 'zebra', 'honeywell', 'idata', 'seuic',
+ 'newland', 'nls', 'nlscan', 'sunmi', 'urovo', 'zebra', 'honeywell',
+ 'idata', 'seuic', 'autoid', '东集', '东大',
];
export default {
@@ -29,16 +30,18 @@ export default {
getScannerConfigs() {
return [
{
- brand: 'newland',
- name: '东集',
+ // 东大集成 SEUIC / AUTOID 系列(如 AUTOID9),勿与新大陆 nlscan 混淆
+ brand: 'seuic',
+ name: '东大集成(AUTOID)',
action: 'com.android.server.scannerservice.broadcast',
dataKey: 'scannerdata',
needSetup: true,
setupAction: 'com.android.scanner.service_settings',
setupParams: {
+ barcode_send_mode: 'BROADCAST',
action_barcode_broadcast: 'com.android.server.scannerservice.broadcast',
key_barcode_broadcast: 'scannerdata',
- endchar: 'ENTER'
+ endchar: 'NONE'
}
},
{
@@ -56,6 +59,7 @@ export default {
needSetup: false
},
{
+ // 新大陆 Newland,广播为 nlscan.action.SCANNER_RESULT
brand: 'nlscan',
name: '新大陆',
action: 'nlscan.action.SCANNER_RESULT',
diff --git a/src/components/storefabric/SearchSelectPopup.vue b/src/components/storefabric/SearchSelectPopup.vue
index d774d2c..cf7624d 100644
--- a/src/components/storefabric/SearchSelectPopup.vue
+++ b/src/components/storefabric/SearchSelectPopup.vue
@@ -1,6 +1,6 @@
-
+
{{ title }}
取消
@@ -8,7 +8,12 @@
-
+
暂无匹配数据
item.brand === 'nlscan');
- if (!nlscanConfig) {
+ ensureBuiltinScannerOption(brand) {
+ const builtinConfig = this.getScannerConfigs().find((item) => item.brand === brand);
+ if (!builtinConfig) {
return;
}
const exists = this.configList.some((item) => {
- return item.brand === nlscanConfig.brand || item.action === nlscanConfig.action;
+ return item.brand === builtinConfig.brand || item.action === builtinConfig.action;
});
if (exists) {
return;
}
const phoneIndex = this.configList.findIndex((item) => item.brand === PHONE_SCAN_BRAND);
if (phoneIndex >= 0) {
- this.configList.splice(phoneIndex, 0, nlscanConfig);
+ this.configList.splice(phoneIndex, 0, builtinConfig);
return;
}
- this.configList.push(nlscanConfig);
+ this.configList.push(builtinConfig);
+ },
+ ensureSeuicOption() {
+ this.ensureBuiltinScannerOption('seuic');
+ },
+ ensureNlscanOption() {
+ this.ensureBuiltinScannerOption('nlscan');
},
initFormFromSaved() {
const savedConfig = getScanConfig(this.getScannerConfigs());
diff --git a/src/pages/sys/workbench/index.vue b/src/pages/sys/workbench/index.vue
index b1c171b..005095d 100644
--- a/src/pages/sys/workbench/index.vue
+++ b/src/pages/sys/workbench/index.vue
@@ -1,340 +1,284 @@
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 坯布管理
-
-
-
-
-
-
-
-
-
-
-
- 坯布出库
-
-
-
-
-
- 坯布库存
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/src/static/img/workbench/fabric-out.jpg b/src/static/img/workbench/fabric-out.jpg
new file mode 100644
index 0000000..33eb769
Binary files /dev/null and b/src/static/img/workbench/fabric-out.jpg differ
diff --git a/src/static/img/workbench/fabric-stock.jpg b/src/static/img/workbench/fabric-stock.jpg
new file mode 100644
index 0000000..d93a5d9
Binary files /dev/null and b/src/static/img/workbench/fabric-stock.jpg differ