Compare commits
11
Commits
c390b9f72b
...
zhoushang
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b1648bcb30 | ||
|
|
c0067e3b89 | ||
|
|
706fcda5b9 | ||
|
|
fdbd06f5f5 | ||
|
|
0e630d0fb0 | ||
|
|
4d3f767e16 | ||
|
|
5b6690b4d8 | ||
|
|
db12e1a249 | ||
|
|
870f857be8 | ||
|
|
59e699b4f6 | ||
|
|
fdacdfbda0 |
@@ -1,5 +1,6 @@
|
||||
NODE_ENV = production
|
||||
VUE_APP_ENV_NAME = zhoushang环境
|
||||
VUE_APP_UPGRADE_NAME = erp_pda_zhoushang_zhichang
|
||||
VUE_APP_UPGRADE_CDN_PREFIX = https://zsfzcdn.yushangfangzhi.com/version/erp_pda_zhoushang_zhichang
|
||||
VUE_APP_PRODUCTION_API_URL = https://zszc.yushangfangzhi.com/hcscm_weave/pda/v1
|
||||
VUE_APP_DEV_API_URL = https://zszc.yushangfangzhi.com/hcscm_weave/pda/v1
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
NODE_ENV = production
|
||||
VUE_APP_ENV_NAME = zhoushang环境
|
||||
VUE_APP_UPGRADE_NAME = erp_pda_zhoushang_zhichang
|
||||
VUE_APP_UPGRADE_CDN_PREFIX = https://zsfzcdn.yushangfangzhi.com/version/erp_pda_zhoushang_zhichang
|
||||
VUE_APP_PRODUCTION_API_URL = https://zszc.yushangfangzhi.com/hcscm_weave/pda/v1
|
||||
VUE_APP_DEV_API_URL = https://zszc.yushangfangzhi.com/hcscm_weave/pda/v1
|
||||
|
||||
+21
-10
@@ -21,12 +21,20 @@ const path = require('path');
|
||||
const readline = require('readline');
|
||||
|
||||
const ROOT = path.resolve(__dirname, '..');
|
||||
const API_BASE = 'https://hcscmtest.zzfzyc.com/hcscm_weave';
|
||||
const UPYUN_API = 'https://v0.api.upyun.com';
|
||||
const CDN_HOST = {
|
||||
const DEFAULT_API_BASE = 'https://hcscmtest.zzfzyc.com/hcscm_weave';
|
||||
const DEFAULT_CDN_HOST = {
|
||||
test: 'https://testhcscm.cdn.zzfzyc.com',
|
||||
prod: 'https://hcscm.cdn.zzfzyc.com',
|
||||
};
|
||||
/** 织厂环境签到 zhoushang 空间,下载域名与 ERP 相同 */
|
||||
const MODE_UPLOAD = {
|
||||
zhoushang: {
|
||||
apiBase: 'https://zszc.yushangfangzhi.com/hcscm_weave',
|
||||
cdnHost: 'https://zsfzcdn.yushangfangzhi.com',
|
||||
status: 1,
|
||||
},
|
||||
};
|
||||
|
||||
const MODE_ENV = {
|
||||
zhoushang: '.env.zhoushang',
|
||||
@@ -218,9 +226,9 @@ async function uploadToUpyun({ bucket, authorization, policy, filePath, fileName
|
||||
return body;
|
||||
}
|
||||
|
||||
function toPublicUrl(target, saveKey, uploaded) {
|
||||
function toPublicUrl(cdnHost, saveKey, uploaded) {
|
||||
if (uploaded.url && String(uploaded.url).startsWith('http')) return uploaded.url;
|
||||
return `${CDN_HOST[target]}${saveKey}`;
|
||||
return `${cdnHost}${saveKey}`;
|
||||
}
|
||||
|
||||
async function uploadApkFile({ apiBase, token, apkPath, saveKey, fileName, status }) {
|
||||
@@ -235,6 +243,7 @@ async function uploadApkFile({ apiBase, token, apkPath, saveKey, fileName, statu
|
||||
if (!sign.bucket || !sign.authorization || !sign.policy) {
|
||||
throw new Error('签名返回缺少 bucket、authorization 或 policy');
|
||||
}
|
||||
console.log(`空间: ${sign.bucket}`);
|
||||
console.log(`正在上传 ${fileName}...`);
|
||||
const uploaded = await uploadToUpyun({
|
||||
bucket: sign.bucket,
|
||||
@@ -280,12 +289,14 @@ async function main() {
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const status = args.target === 'prod' ? 2 : 1;
|
||||
const modeUpload = MODE_UPLOAD[args.mode];
|
||||
const status = modeUpload ? modeUpload.status : (args.target === 'prod' ? 2 : 1);
|
||||
const fileName = `${version}.apk`;
|
||||
const saveKey = `/version/${upgradeName}/${fileName}`;
|
||||
const latestFileName = 'latest.apk';
|
||||
const latestSaveKey = `/version/${upgradeName}/${latestFileName}`;
|
||||
const apiBase = API_BASE;
|
||||
const apiBase = modeUpload ? modeUpload.apiBase : DEFAULT_API_BASE;
|
||||
const cdnHost = modeUpload ? modeUpload.cdnHost : DEFAULT_CDN_HOST[args.target];
|
||||
const token = await login(apiBase, {
|
||||
phone: args.phone,
|
||||
password: args.password,
|
||||
@@ -293,8 +304,8 @@ async function main() {
|
||||
});
|
||||
|
||||
console.log(`版本号: ${version}`);
|
||||
const cdnLabel = args.target === 'prod' ? '正式 CDN' : '测试 CDN';
|
||||
console.log(`CDN: ${cdnLabel}(只影响下载地址,生产环境也可以从测试 CDN 安装)`);
|
||||
console.log(`签名接口: ${apiBase}`);
|
||||
console.log(`CDN: ${cdnHost}`);
|
||||
const uploaded = await uploadApkFile({
|
||||
apiBase,
|
||||
token,
|
||||
@@ -303,7 +314,7 @@ async function main() {
|
||||
fileName,
|
||||
status,
|
||||
});
|
||||
console.log(toPublicUrl(args.target, saveKey, uploaded));
|
||||
console.log(toPublicUrl(cdnHost, saveKey, uploaded));
|
||||
|
||||
const latestUploaded = await uploadApkFile({
|
||||
apiBase,
|
||||
@@ -313,7 +324,7 @@ async function main() {
|
||||
fileName: latestFileName,
|
||||
status,
|
||||
});
|
||||
console.log(toPublicUrl(args.target, latestSaveKey, latestUploaded));
|
||||
console.log(toPublicUrl(cdnHost, latestSaveKey, latestUploaded));
|
||||
}
|
||||
|
||||
main().catch((error) => {
|
||||
|
||||
@@ -7,6 +7,7 @@ export const isDevelopment = process.env.NODE_ENV === 'development'
|
||||
|
||||
const config = {
|
||||
upgradeName: process.env.VUE_APP_UPGRADE_NAME || 'erp_pda',
|
||||
upgradeCdnPrefix: process.env.VUE_APP_UPGRADE_CDN_PREFIX || '',
|
||||
|
||||
// 产品名称
|
||||
productName: '浩拓技术',
|
||||
@@ -33,6 +34,20 @@ const config = {
|
||||
|
||||
}
|
||||
|
||||
export function resolveUpgradeDownloadUrl(downloadUrl) {
|
||||
const raw = String(downloadUrl || '').trim();
|
||||
const prefix = String(config.upgradeCdnPrefix || '').trim().replace(/\/+$/, '');
|
||||
if (!raw || !prefix) {
|
||||
return raw;
|
||||
}
|
||||
const path = raw.split('?')[0].split('#')[0];
|
||||
const fileName = path.split('/').filter(Boolean).pop() || '';
|
||||
if (!fileName || !/\.apk$/i.test(fileName)) {
|
||||
return raw;
|
||||
}
|
||||
return `${prefix}/${fileName}`;
|
||||
}
|
||||
|
||||
export function getDefaultApiUrl() {
|
||||
const prod = config.devApiUrlOptions.find(item => item.label === '正式环境');
|
||||
return (prod && prod.value) || config.productionApiUrl || 'https://zszc.yushangfangzhi.com/server/hcscm_weave/pda/v1';
|
||||
|
||||
@@ -114,7 +114,7 @@ const install = (Vue, vm) => {
|
||||
// 个人信息修改
|
||||
user: {
|
||||
saveUserInfo: (params = {}) => vm.$u.post(config.productionApiUrl+'/mobile/user/saveUserInfo', params),
|
||||
infoSavePwd: (params = {}) => vm.$u.put(config.productionApiUrl+'/system/user/profile/updatePwd', params),
|
||||
infoSavePwd: (params = {}) => vm.$u.put('/system/user/profile/updatePwd', params),
|
||||
infoSavePqa: (params = {}) => vm.$u.post(config.productionApiUrl+'/sys/user/infoSavePqa', params),
|
||||
},
|
||||
|
||||
|
||||
@@ -73,18 +73,33 @@ const install = (Vue, vm) => {
|
||||
return false;
|
||||
}
|
||||
console.log('res',res)
|
||||
if (!(res.data)){
|
||||
const rejectWithMessage = (message) => {
|
||||
const text = String(message || '请求失败').trim() || '请求失败';
|
||||
vm.$u.toast(text);
|
||||
return Promise.reject(new Error(text));
|
||||
};
|
||||
// HTTP 非 200(如 404)时直接报错,避免把字符串/HTML 当业务 data 解析
|
||||
if (res.statusCode && res.statusCode !== 200) {
|
||||
let message = `请求失败(${res.statusCode})`;
|
||||
if (typeof res.data === 'string' && res.data.trim()) {
|
||||
message = res.data.trim().slice(0, 120);
|
||||
} else if (res.data && typeof res.data === 'object') {
|
||||
message = res.data.msg || res.data.message || message;
|
||||
}
|
||||
return rejectWithMessage(message);
|
||||
}
|
||||
if (res.data === undefined || res.data === null || res.data === '') {
|
||||
const errMsg = String((res && res.errMsg) || '');
|
||||
const isNetworkError = res.statusCode === -1
|
||||
|| /Unable to resolve host|Failed to connect|request:fail|timeout|网络/i.test(errMsg);
|
||||
const message = isNetworkError ? '当前没有网络,请检查网络后重试' : '未连接到服务器';
|
||||
vm.$u.toast(message)
|
||||
return Promise.reject(new Error(message));
|
||||
return rejectWithMessage(message);
|
||||
}
|
||||
if (typeof res.data !== 'object') {
|
||||
return rejectWithMessage(String(res.data).slice(0, 120));
|
||||
}
|
||||
|
||||
if (res.data.code !== 0) {
|
||||
vm.$u.toast(res.data.msg)
|
||||
return Promise.reject(new Error(res.data.msg))
|
||||
return rejectWithMessage(res.data.msg || res.data.message || '请求失败');
|
||||
}
|
||||
let data = res.data.data;
|
||||
console.log('data',data)
|
||||
|
||||
@@ -35,7 +35,11 @@ export async function ensureScanConfigAfterLogin(api) {
|
||||
if (result.skipped) {
|
||||
console.log('本地已有扫码设置,跳过自动匹配', result.config && result.config.name);
|
||||
} else if (result.saved) {
|
||||
if (result.reason === 'rematch_n5s_from_seuic') {
|
||||
console.log('N5S 误识别为东集,已纠正为', result.config && result.config.name);
|
||||
} else {
|
||||
console.log('已自动写入扫码设置', result.config && result.config.name);
|
||||
}
|
||||
} else {
|
||||
console.log('自动匹配扫码设置未写入', result.reason);
|
||||
}
|
||||
|
||||
+105
-9
@@ -50,6 +50,14 @@ export const BUILTIN_SCANNER_CONFIGS = [
|
||||
dataKey: 'SCAN_BARCODE1',
|
||||
needSetup: false,
|
||||
},
|
||||
{
|
||||
// N5S 部分固件走智联天地兼容广播,而不是 nlscan.action
|
||||
brand: 'nlscan_compat',
|
||||
name: '新大陆(兼容广播)',
|
||||
action: 'android.intent.action.RECEIVE_SCANDATA_BROADCAST',
|
||||
dataKey: 'android.intent.extra.SCAN_BROADCAST_DATA',
|
||||
needSetup: false,
|
||||
},
|
||||
{ ...PHONE_SCAN_CONFIG },
|
||||
];
|
||||
|
||||
@@ -62,10 +70,19 @@ const DETECT_RULES = [
|
||||
packages: ['com.sunmi.scanner', 'woyou.aidlservice.jiuiv5'],
|
||||
},
|
||||
{
|
||||
matchNames: ['新大陆'],
|
||||
matchActions: ['nlscan.action.SCANNER_RESULT'],
|
||||
keywords: ['newland', 'nls', 'nlscan'],
|
||||
packages: ['com.nlscan.barcodescanner', 'com.newland'],
|
||||
matchNames: ['新大陆', '新大陆(兼容广播)'],
|
||||
matchActions: [
|
||||
'nlscan.action.SCANNER_RESULT',
|
||||
'android.intent.action.RECEIVE_SCANDATA_BROADCAST',
|
||||
],
|
||||
// N5S 机型常标成 alps/zltd,不能只靠 newland 关键字
|
||||
keywords: ['newland', 'nls', 'nlscan', 'n5s', 'zltd'],
|
||||
models: ['n5s', 'n5'],
|
||||
packages: [
|
||||
'com.nlscan.barcodescanner',
|
||||
'com.newland',
|
||||
'com.nlscan.android.scan.service',
|
||||
],
|
||||
},
|
||||
{
|
||||
matchNames: ['优博讯'],
|
||||
@@ -94,10 +111,19 @@ const DETECT_RULES = [
|
||||
];
|
||||
|
||||
const PDA_DEVICE_KEYWORDS = [
|
||||
'newland', 'nls', 'nlscan', 'sunmi', 'urovo', 'ubx', 'zebra', 'honeywell',
|
||||
'newland', 'nls', 'nlscan', 'n5s', 'zltd', 'sunmi', 'urovo', 'ubx', 'zebra', 'honeywell',
|
||||
'idata', 'seuic', 'autoid', '东集', '东大',
|
||||
];
|
||||
|
||||
/** 明确机型 → 优先品牌,避免通用东集广播抢分 */
|
||||
const MODEL_PREFERRED_BRANDS = [
|
||||
{
|
||||
models: ['n5s'],
|
||||
brands: ['nlscan', 'nlscan_compat'],
|
||||
score: 220,
|
||||
},
|
||||
];
|
||||
|
||||
const NO_SETUP_HINT_KEY = 'pda_scan_config_hint_shown';
|
||||
|
||||
export function isPhoneScanConfig(config) {
|
||||
@@ -319,6 +345,57 @@ function canResolveBroadcast(action) {
|
||||
return false;
|
||||
}
|
||||
|
||||
function isModelMatch(identity, models = []) {
|
||||
const model = String((identity && identity.model) || '').toLowerCase();
|
||||
if (!model) return false;
|
||||
return (models || []).some((item) => model === item || model.includes(item));
|
||||
}
|
||||
|
||||
function getModelPreferredBoost(config, identity) {
|
||||
if (!config || isPhoneScanConfig(config)) {
|
||||
return 0;
|
||||
}
|
||||
const brand = String(config.brand || '');
|
||||
for (let i = 0; i < MODEL_PREFERRED_BRANDS.length; i += 1) {
|
||||
const rule = MODEL_PREFERRED_BRANDS[i];
|
||||
if (!isModelMatch(identity, rule.models)) continue;
|
||||
if ((rule.brands || []).includes(brand)) {
|
||||
return Number(rule.score) || 0;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** 新大陆 N5S / 智联天地 N5S:机型名常为 n5s,厂商可能是 newland/zltd/alps */
|
||||
export function isNewlandN5sDevice(identity = getDeviceIdentity()) {
|
||||
const model = String((identity && identity.model) || '').toLowerCase();
|
||||
const text = `${identity.manufacturer || ''} ${identity.brand || ''} ${model}`.toLowerCase();
|
||||
if (model === 'n5s' || model.includes('n5s')) {
|
||||
return true;
|
||||
}
|
||||
return text.includes('n5s') && (
|
||||
text.includes('newland')
|
||||
|| text.includes('zltd')
|
||||
|| text.includes('nlscan')
|
||||
|| text.includes('alps')
|
||||
);
|
||||
}
|
||||
|
||||
function isWrongSeuicOnNewlandDevice(config, identity = getDeviceIdentity()) {
|
||||
if (!config || isPhoneScanConfig(config)) {
|
||||
return false;
|
||||
}
|
||||
if (!isNewlandN5sDevice(identity) && !isModelMatch(identity, ['n5s'])) {
|
||||
return false;
|
||||
}
|
||||
const brand = String(config.brand || '');
|
||||
const action = String(config.action || '');
|
||||
return brand === 'seuic'
|
||||
|| action.includes('scannerservice.broadcast')
|
||||
|| String(config.name || '').includes('东集')
|
||||
|| String(config.name || '').includes('东大');
|
||||
}
|
||||
|
||||
function scoreScannerConfig(config, identity) {
|
||||
if (!config || isPhoneScanConfig(config)) {
|
||||
return 0;
|
||||
@@ -339,6 +416,19 @@ function scoreScannerConfig(config, identity) {
|
||||
if ((rule.keywords || []).some((keyword) => deviceText.includes(String(keyword).toLowerCase()))) {
|
||||
score += 40;
|
||||
}
|
||||
if (isModelMatch(identity, rule.models || [])) {
|
||||
score += 80;
|
||||
}
|
||||
}
|
||||
|
||||
score += getModelPreferredBoost(config, identity);
|
||||
|
||||
// 明确是 N5S 时,压低东集通用广播抢分
|
||||
if (isNewlandN5sDevice(identity) && (
|
||||
config.brand === 'seuic'
|
||||
|| String(config.action || '').includes('scannerservice.broadcast')
|
||||
)) {
|
||||
score = Math.min(score, 30);
|
||||
}
|
||||
|
||||
return score;
|
||||
@@ -376,12 +466,16 @@ export function matchBestScanConfig(candidateConfigs = []) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 仅本地没有有效配置时,自动匹配并写入扫描设置
|
||||
* 仅本地没有有效配置时,自动匹配并写入扫描设置。
|
||||
* 若本地误把 N5S 识别成东集,则强制重配。
|
||||
* @returns {{ saved: boolean, config: object|null, skipped: boolean, reason?: string }}
|
||||
*/
|
||||
export function autoConfigureScanSettings({ remoteConfigs = [] } = {}) {
|
||||
const existing = getScanConfig(BUILTIN_SCANNER_CONFIGS);
|
||||
if (existing) {
|
||||
const identity = getDeviceIdentity();
|
||||
const forceRematch = !!(existing && isWrongSeuicOnNewlandDevice(existing, identity));
|
||||
|
||||
if (existing && !forceRematch) {
|
||||
return {
|
||||
saved: false,
|
||||
skipped: true,
|
||||
@@ -396,7 +490,7 @@ export function autoConfigureScanSettings({ remoteConfigs = [] } = {}) {
|
||||
return {
|
||||
saved: false,
|
||||
skipped: false,
|
||||
config: null,
|
||||
config: existing || null,
|
||||
reason: 'no_match',
|
||||
};
|
||||
}
|
||||
@@ -406,6 +500,8 @@ export function autoConfigureScanSettings({ remoteConfigs = [] } = {}) {
|
||||
saved,
|
||||
skipped: false,
|
||||
config: matched,
|
||||
reason: saved ? 'saved' : 'save_failed',
|
||||
reason: saved
|
||||
? (forceRematch ? 'rematch_n5s_from_seuic' : 'saved')
|
||||
: 'save_failed',
|
||||
};
|
||||
}
|
||||
|
||||
+84
-2
@@ -72,20 +72,63 @@ export default {
|
||||
return configs.length ? configs[0] : null;
|
||||
},
|
||||
|
||||
/** 停止手机连续扫码(含 Ba-Scanner) */
|
||||
stopPhoneScanContinuous() {
|
||||
this._phoneScanContinuousActive = false;
|
||||
// #ifdef APP-PLUS
|
||||
try {
|
||||
const scanner = uni.requireNativePlugin('Ba-Scanner');
|
||||
if (scanner && typeof scanner.onClose === 'function') {
|
||||
scanner.onClose();
|
||||
}
|
||||
} catch (e) {
|
||||
// 未购买/未打包原生插件时忽略
|
||||
}
|
||||
// #endif
|
||||
},
|
||||
|
||||
/**
|
||||
* 打开手机扫码
|
||||
* @param {{ continuous?: boolean, callback?: Function, fail?: Function, scanType?: string[], hintText?: string, scanTimeSpace?: number }} options
|
||||
* continuous=true 时优先用 Ba-Scanner 连续扫;无插件则扫完自动再开相机
|
||||
*/
|
||||
openPhoneScan(options = {}) {
|
||||
const callback = options.callback || this._scanCallback;
|
||||
const continuous = !!options.continuous;
|
||||
this._phoneScanContinuousActive = continuous;
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
if (continuous && this.openBaScannerContinuous(options, callback)) {
|
||||
return;
|
||||
}
|
||||
// #endif
|
||||
|
||||
// #ifdef APP-PLUS || MP-WEIXIN
|
||||
uni.scanCode({
|
||||
scanType: options.scanType || ['qrCode', 'barCode'],
|
||||
success: (res) => {
|
||||
this.handleScanResult(res.result, callback);
|
||||
const result = this.handleScanResult(res.result, callback);
|
||||
if (!continuous || !this._phoneScanContinuousActive) return;
|
||||
Promise.resolve(result)
|
||||
.catch(() => null)
|
||||
.then(() => {
|
||||
if (!this._phoneScanContinuousActive || !this.isPageActive) return;
|
||||
setTimeout(() => {
|
||||
if (!this._phoneScanContinuousActive || !this.isPageActive) return;
|
||||
this.openPhoneScan(options);
|
||||
}, Number(options.scanTimeSpace) > 0 ? Number(options.scanTimeSpace) : 400);
|
||||
});
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('手机扫码失败:', err);
|
||||
this._phoneScanContinuousActive = false;
|
||||
if (options.fail) {
|
||||
options.fail(err);
|
||||
return;
|
||||
}
|
||||
// 用户取消不打扰
|
||||
const msg = (err && (err.errMsg || err.message)) || '';
|
||||
if (/cancel|取消/i.test(msg)) return;
|
||||
uni.showToast({
|
||||
title: '扫码失败',
|
||||
icon: 'none',
|
||||
@@ -103,6 +146,41 @@ export default {
|
||||
// #endif
|
||||
},
|
||||
|
||||
/**
|
||||
* Ba-Scanner 连续扫码(插件市场 id=9669)
|
||||
* @returns {boolean} 是否已成功唤起原生连续扫
|
||||
*/
|
||||
openBaScannerContinuous(options = {}, callback) {
|
||||
// #ifdef APP-PLUS
|
||||
try {
|
||||
const scanner = uni.requireNativePlugin('Ba-Scanner');
|
||||
if (!scanner || typeof scanner.onScan !== 'function') return false;
|
||||
scanner.onScan(
|
||||
{
|
||||
isContinuous: true,
|
||||
scanTimeSpace: Number(options.scanTimeSpace) > 0 ? Number(options.scanTimeSpace) : 1500,
|
||||
isShowVibrate: options.isShowVibrate !== false,
|
||||
isShowBeep: !!options.isShowBeep,
|
||||
isShowToast: false,
|
||||
isShowPhotoAlbum: options.isShowPhotoAlbum !== false,
|
||||
hintText: options.hintText || '扫二维码/条形码,可连续扫',
|
||||
barcodeFormats: options.barcodeFormats || ['QR Code', 'Code 128', 'Code 39', 'EAN-13', 'EAN-8'],
|
||||
},
|
||||
(ret) => {
|
||||
if (!ret || !ret.result) return;
|
||||
if (!this._phoneScanContinuousActive) return;
|
||||
this.handleScanResult(ret.result, callback);
|
||||
},
|
||||
);
|
||||
return true;
|
||||
} catch (e) {
|
||||
console.warn('Ba-Scanner 不可用,回退 uni.scanCode', e);
|
||||
return false;
|
||||
}
|
||||
// #endif
|
||||
return false;
|
||||
},
|
||||
|
||||
triggerScan() {
|
||||
if (this.usePhoneScanFallback) {
|
||||
this.openPhoneScan();
|
||||
@@ -261,11 +339,12 @@ export default {
|
||||
console.log("扫码结果:", cleanCode);
|
||||
|
||||
if (scanCallback) {
|
||||
scanCallback(cleanCode);
|
||||
return scanCallback(cleanCode);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("处理扫码结果时出错:", error);
|
||||
}
|
||||
return undefined;
|
||||
},
|
||||
|
||||
unregisterScanBroadcast() {
|
||||
@@ -317,10 +396,13 @@ export default {
|
||||
|
||||
onHide() {
|
||||
this.isPageActive = false;
|
||||
// 不在 onHide 里关 Ba-Scanner:打开原生扫码页也会触发 hide,误关会打断连续扫
|
||||
// 无插件回退模式靠 isPageActive 控制是否自动再开相机
|
||||
},
|
||||
|
||||
onUnload() {
|
||||
this.isPageActive = false;
|
||||
this.stopPhoneScanContinuous();
|
||||
this.unregisterScanBroadcast();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,12 +46,12 @@ export const FABRIC_INFO_FIELDS = [
|
||||
|
||||
/** 细码表格列(不含操作列) */
|
||||
export const FINE_CODE_TABLE_COLUMNS = [
|
||||
{ label: '序号', key: 'seq', width: 70 },
|
||||
{ label: '卷号', key: 'roll_no', width: 90 },
|
||||
{ label: '匹数', key: 'roll', width: 90 },
|
||||
{ label: '数量(重量)', key: 'weight', width: 120 },
|
||||
{ label: '条码', key: 'bar_code', width: 260 },
|
||||
{ label: '仓位', key: 'position', width: 110 },
|
||||
{ label: '序号', key: 'seq', width: 90 },
|
||||
{ label: '卷号', key: 'roll_no', width: 110 },
|
||||
{ label: '匹数', key: 'roll', width: 100 },
|
||||
{ label: '数量(重量)', key: 'weight', width: 160 },
|
||||
{ label: '条码', key: 'bar_code', width: 280 },
|
||||
{ label: '仓位', key: 'position', width: 140 },
|
||||
];
|
||||
|
||||
/** 审核状态变更操作配置(apiKey 对应 gfmOtherDeliveryOrder 下的方法名) */
|
||||
@@ -61,12 +61,19 @@ export const STATUS_ACTION_CONFIG = {
|
||||
unapprove: { status: AUDIT_STATUS.PENDING, msg: '确认消审该单据?', apiKey: 'statusWait' },
|
||||
};
|
||||
|
||||
/** 审核 / 作废成功后播放的语音文案 */
|
||||
/** 审核 / 消审 / 作废成功后播放的语音文案 */
|
||||
export const STATUS_ACTION_VOICE = {
|
||||
approve: '审核成功',
|
||||
unapprove: '消审成功',
|
||||
void: '作废成功',
|
||||
};
|
||||
|
||||
/** 将接口状态统一为数字,避免字符串导致按钮判断失效 */
|
||||
export function toAuditStatus(status) {
|
||||
const n = Number(status);
|
||||
return Number.isFinite(n) ? n : DRAFT_AUDIT_STATUS;
|
||||
}
|
||||
|
||||
// 出仓类型:当前后端仅提供「坯布其他出货单」一种类型的接口
|
||||
export const BILL_TYPES = [
|
||||
{ value: 'other', label: '坯布其他出货单' },
|
||||
@@ -127,11 +134,12 @@ export function normalizeOrder(order) {
|
||||
if (!order) return null;
|
||||
const normalizedItems = (order.item_data || []).map((item) => normalizeItem(item));
|
||||
const itemData = groupItemData(normalizedItems);
|
||||
const auditStatus = toAuditStatus(order.audit_status);
|
||||
return {
|
||||
id: order.id,
|
||||
order_no: order.order_no || '',
|
||||
audit_status: order.audit_status,
|
||||
audit_status_name: order.audit_status_name || AUDIT_STATUS_MAP[order.audit_status] || '',
|
||||
audit_status: auditStatus,
|
||||
audit_status_name: order.audit_status_name || AUDIT_STATUS_MAP[auditStatus] || '',
|
||||
// 表头
|
||||
sale_system_id: order.sale_system_id || '',
|
||||
sale_system_name: order.sale_system_name || '',
|
||||
@@ -432,11 +440,13 @@ export function formatDisplayTime(value, format = 'YYYY-MM-DD') {
|
||||
}
|
||||
|
||||
export function canScanAtStatus(status) {
|
||||
return [AUDIT_STATUS.PENDING, AUDIT_STATUS.REJECTED].includes(status);
|
||||
const s = toAuditStatus(status);
|
||||
return s === AUDIT_STATUS.PENDING || s === AUDIT_STATUS.REJECTED;
|
||||
}
|
||||
|
||||
export function isLockedOrderStatus(status) {
|
||||
return [AUDIT_STATUS.APPROVED, AUDIT_STATUS.VOIDED].includes(status);
|
||||
const s = toAuditStatus(status);
|
||||
return s === AUDIT_STATUS.APPROVED || s === AUDIT_STATUS.VOIDED;
|
||||
}
|
||||
|
||||
/** 分页拉取全部列表(直至末页) */
|
||||
@@ -451,9 +461,14 @@ export function fetchAllOrderList(listFn, params = {}, pageSize = LIST_PAGE_SIZE
|
||||
return loadPage(1, []);
|
||||
}
|
||||
|
||||
/** 新增/编辑页底部:审核、作废 */
|
||||
/** 新增/编辑页底部:审核、作废 / 已审核时消审 */
|
||||
export function getFormStatusActionButtons(headerSaved, orderId, status) {
|
||||
if (!headerSaved || !orderId || !canScanAtStatus(status)) return [];
|
||||
if (!headerSaved || !orderId) return [];
|
||||
const s = toAuditStatus(status);
|
||||
if (s === AUDIT_STATUS.APPROVED) {
|
||||
return [{ label: '消审', action: 'unapprove' }];
|
||||
}
|
||||
if (!canScanAtStatus(s)) return [];
|
||||
return [
|
||||
{ label: '审核', action: 'approve' },
|
||||
{ label: '作废', action: 'void' },
|
||||
@@ -462,14 +477,15 @@ export function getFormStatusActionButtons(headerSaved, orderId, status) {
|
||||
|
||||
/** 查看页底部:编辑、审核、作废 / 消审 */
|
||||
export function getViewStatusActionButtons(status) {
|
||||
if (status === AUDIT_STATUS.PENDING || status === AUDIT_STATUS.REJECTED) {
|
||||
const s = toAuditStatus(status);
|
||||
if (s === AUDIT_STATUS.PENDING || s === AUDIT_STATUS.REJECTED) {
|
||||
return [
|
||||
{ label: '编辑', action: 'edit' },
|
||||
{ label: '审核', action: 'approve' },
|
||||
{ label: '作废', action: 'void' },
|
||||
];
|
||||
}
|
||||
if (status === AUDIT_STATUS.APPROVED) {
|
||||
if (s === AUDIT_STATUS.APPROVED) {
|
||||
return [{ label: '消审', action: 'unapprove' }];
|
||||
}
|
||||
return [];
|
||||
@@ -490,7 +506,8 @@ export function orderToFormFields(order) {
|
||||
|
||||
export function getFineCodeTableColumns(readonly) {
|
||||
const cols = [...FINE_CODE_TABLE_COLUMNS];
|
||||
if (!readonly) cols.push({ label: '操作', key: 'action', width: 90 });
|
||||
// 操作列放前面,避免 PDA 小屏横向滚动后才看到删除
|
||||
if (!readonly) cols.splice(1, 0, { label: '操作', key: 'action', width: 160 });
|
||||
return cols;
|
||||
}
|
||||
|
||||
@@ -516,7 +533,7 @@ export function getFineCodeTableWidth(columns) {
|
||||
* @param {Vue} vm 页面实例,需有 $u.api 与 showError
|
||||
* @param {{ orderId: number, action: string, onSuccess?: Function }} options
|
||||
*/
|
||||
export function confirmOrderStatusAction(vm, { orderId, action, onSuccess }) {
|
||||
export function confirmOrderStatusAction(vm, { orderId, action, onSuccess, onCancel }) {
|
||||
const cfg = STATUS_ACTION_CONFIG[action];
|
||||
if (!cfg || !orderId) return;
|
||||
const api = vm.$u.api.gfmOtherDeliveryOrder;
|
||||
@@ -526,7 +543,10 @@ export function confirmOrderStatusAction(vm, { orderId, action, onSuccess }) {
|
||||
title: '提示',
|
||||
content: cfg.msg,
|
||||
success: (res) => {
|
||||
if (!res.confirm) return;
|
||||
if (!res.confirm) {
|
||||
if (typeof onCancel === 'function') onCancel();
|
||||
return;
|
||||
}
|
||||
uni.showLoading({ title: '处理中...' });
|
||||
requestFn(buildStatusParam(orderId, cfg.status))
|
||||
.then(() => {
|
||||
|
||||
@@ -0,0 +1,259 @@
|
||||
<template>
|
||||
<view v-show="visible" class="plus-barcode-panel">
|
||||
<view class="plus-barcode-panel__toolbar">
|
||||
<text class="plus-barcode-panel__tip">{{ tipText }}</text>
|
||||
<text class="plus-barcode-panel__close" @click.stop="close">收起</text>
|
||||
</view>
|
||||
<!-- #ifdef APP-PLUS -->
|
||||
<view :id="holderId" class="plus-barcode-panel__holder" />
|
||||
<!-- #endif -->
|
||||
<!-- #ifndef APP-PLUS -->
|
||||
<view class="plus-barcode-panel__fallback">
|
||||
<text>当前环境不支持半屏扫码,请使用输入框或系统扫码</text>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
const DEFAULT_FILTERS = [0, 1, 2, 8, 10]; // QR EAN13 EAN8 CODE39 CODE128
|
||||
let barcodeSeq = 0;
|
||||
|
||||
export default {
|
||||
name: 'PlusBarcodePanel',
|
||||
props: {
|
||||
visible: { type: Boolean, default: false },
|
||||
hintText: { type: String, default: '将条码放入框内,可连续扫' },
|
||||
scanTimeSpace: { type: Number, default: 1200 },
|
||||
filters: { type: Array, default: () => DEFAULT_FILTERS.slice() },
|
||||
},
|
||||
data() {
|
||||
barcodeSeq += 1;
|
||||
return {
|
||||
holderId: `plusBarcodeHolder_${barcodeSeq}`,
|
||||
barcodeViewId: `plusBarcodeView_${barcodeSeq}`,
|
||||
_barcode: null,
|
||||
_restartTimer: null,
|
||||
_active: false,
|
||||
_creating: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
tipText() {
|
||||
return this.hintText || '将条码放入框内,可连续扫';
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
visible(val) {
|
||||
if (val) {
|
||||
this.$nextTick(() => {
|
||||
this.openNative();
|
||||
});
|
||||
} else {
|
||||
this.destroyNative();
|
||||
}
|
||||
},
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.destroyNative();
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
if (this.visible) {
|
||||
this.$nextTick(() => this.openNative());
|
||||
return;
|
||||
}
|
||||
this.$emit('update:visible', true);
|
||||
},
|
||||
close() {
|
||||
this.destroyNative();
|
||||
if (this.visible) {
|
||||
this.$emit('update:visible', false);
|
||||
}
|
||||
this.$emit('close');
|
||||
},
|
||||
getCurrentWebview() {
|
||||
// #ifdef APP-PLUS
|
||||
try {
|
||||
const pages = getCurrentPages();
|
||||
const page = pages[pages.length - 1];
|
||||
if (page && typeof page.$getAppWebview === 'function') {
|
||||
return page.$getAppWebview();
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('PlusBarcodePanel getCurrentWebview failed', e);
|
||||
}
|
||||
// #endif
|
||||
return null;
|
||||
},
|
||||
openNative() {
|
||||
// #ifdef APP-PLUS
|
||||
if (!this.visible || this._creating) return;
|
||||
if (this._barcode) {
|
||||
this.resumeScan();
|
||||
return;
|
||||
}
|
||||
this._creating = true;
|
||||
this._active = true;
|
||||
// 等占位区域完成布局后再量位置,避免 Android 上 rect 为 0
|
||||
setTimeout(() => {
|
||||
if (!this.visible || !this._active) {
|
||||
this._creating = false;
|
||||
return;
|
||||
}
|
||||
uni.createSelectorQuery()
|
||||
.in(this)
|
||||
.select('.plus-barcode-panel__holder')
|
||||
.boundingClientRect((rect) => {
|
||||
this._creating = false;
|
||||
if (!this.visible || !this._active) return;
|
||||
if (!rect || !rect.width || !rect.height) {
|
||||
uni.showToast({ title: '扫码区域未就绪', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
this.createBarcode(rect);
|
||||
})
|
||||
.exec();
|
||||
}, 80);
|
||||
// #endif
|
||||
},
|
||||
createBarcode(rect) {
|
||||
// #ifdef APP-PLUS
|
||||
const webview = this.getCurrentWebview();
|
||||
if (!webview || typeof plus === 'undefined' || !plus.barcode) {
|
||||
uni.showToast({ title: '当前环境不支持扫码', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
this.destroyNative(false);
|
||||
try {
|
||||
const barcode = plus.barcode.create(
|
||||
this.barcodeViewId,
|
||||
this.filters && this.filters.length ? this.filters : DEFAULT_FILTERS,
|
||||
{
|
||||
top: `${Math.round(rect.top)}px`,
|
||||
left: `${Math.round(rect.left)}px`,
|
||||
width: `${Math.round(rect.width)}px`,
|
||||
height: `${Math.round(rect.height)}px`,
|
||||
position: 'absolute',
|
||||
background: '#000000',
|
||||
frameColor: '#2979ff',
|
||||
scanbarColor: '#2979ff',
|
||||
},
|
||||
);
|
||||
barcode.onmarked = (type, code) => {
|
||||
this.onMarked(type, code);
|
||||
};
|
||||
barcode.onerror = (err) => {
|
||||
console.error('PlusBarcodePanel onerror', err);
|
||||
};
|
||||
webview.append(barcode);
|
||||
this._barcode = barcode;
|
||||
this._active = true;
|
||||
barcode.start({
|
||||
vibrate: true,
|
||||
sound: 'default',
|
||||
});
|
||||
} catch (e) {
|
||||
console.error('PlusBarcodePanel create failed', e);
|
||||
uni.showToast({ title: '打开扫码失败', icon: 'none' });
|
||||
this._barcode = null;
|
||||
}
|
||||
// #endif
|
||||
},
|
||||
onMarked(type, code) {
|
||||
const result = String(code || '').trim();
|
||||
if (!result || !this._active) return;
|
||||
try {
|
||||
if (this._barcode) this._barcode.cancel();
|
||||
} catch (e) {
|
||||
// ignore
|
||||
}
|
||||
this.$emit('success', result, type);
|
||||
clearTimeout(this._restartTimer);
|
||||
const gap = Number(this.scanTimeSpace) > 0 ? Number(this.scanTimeSpace) : 1200;
|
||||
this._restartTimer = setTimeout(() => {
|
||||
this.resumeScan();
|
||||
}, gap);
|
||||
},
|
||||
resumeScan() {
|
||||
// #ifdef APP-PLUS
|
||||
if (!this.visible || !this._active || !this._barcode) return;
|
||||
try {
|
||||
this._barcode.start({
|
||||
vibrate: true,
|
||||
sound: 'default',
|
||||
});
|
||||
} catch (e) {
|
||||
console.warn('PlusBarcodePanel resume failed', e);
|
||||
}
|
||||
// #endif
|
||||
},
|
||||
destroyNative(clearActive = true) {
|
||||
clearTimeout(this._restartTimer);
|
||||
this._restartTimer = null;
|
||||
if (clearActive) this._active = false;
|
||||
// #ifdef APP-PLUS
|
||||
const barcode = this._barcode;
|
||||
this._barcode = null;
|
||||
if (!barcode) return;
|
||||
try {
|
||||
barcode.cancel();
|
||||
} catch (e) {
|
||||
// ignore
|
||||
}
|
||||
try {
|
||||
barcode.close();
|
||||
} catch (e) {
|
||||
// ignore
|
||||
}
|
||||
// #endif
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import '@/common/pda-typography.scss';
|
||||
|
||||
.plus-barcode-panel {
|
||||
background: #000;
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
.plus-barcode-panel__toolbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
min-height: 72rpx;
|
||||
padding: 12rpx 26rpx;
|
||||
background: #1f1f1f;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.plus-barcode-panel__tip {
|
||||
flex: 1;
|
||||
color: #ffffff;
|
||||
font-size: $pda-font-action;
|
||||
padding-right: 16rpx;
|
||||
}
|
||||
.plus-barcode-panel__close {
|
||||
color: #2979ff;
|
||||
font-size: $pda-font-action;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.plus-barcode-panel__holder {
|
||||
width: 100%;
|
||||
height: 420rpx;
|
||||
background: #000;
|
||||
}
|
||||
.plus-barcode-panel__fallback {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 420rpx;
|
||||
padding: 24rpx;
|
||||
box-sizing: border-box;
|
||||
background: #333;
|
||||
color: #fff;
|
||||
font-size: $pda-font-body;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
@@ -10,14 +10,20 @@
|
||||
@input="$emit('input', $event.detail.value)"
|
||||
@confirm="$emit('scan')"
|
||||
/>
|
||||
<u-icon
|
||||
v-if="showPhoneScan"
|
||||
class="fabric-out-phoneScanIcon"
|
||||
name="scan"
|
||||
size="80"
|
||||
color="#2979ff"
|
||||
@click="$emit('phone-scan')"
|
||||
/>
|
||||
<view
|
||||
v-if="scanning"
|
||||
class="fabric-out-scanClose"
|
||||
@click.stop="$emit('phone-scan')"
|
||||
>
|
||||
关闭扫码
|
||||
</view>
|
||||
<view
|
||||
v-else
|
||||
class="fabric-out-toolbarIcon"
|
||||
@click.stop="$emit('phone-scan')"
|
||||
>
|
||||
<u-icon name="scan" size="44" color="#595959" />
|
||||
</view>
|
||||
<checkbox-group @change="$emit('delete-mode-change', $event)">
|
||||
<label class="fabric-out-delCheck">
|
||||
<checkbox :checked="deleteMode" />删除
|
||||
@@ -37,17 +43,40 @@ export default {
|
||||
deleteMode: { type: Boolean, default: false },
|
||||
message: { type: String, default: '' },
|
||||
disabledTip: { type: String, default: '当前状态不可扫码' },
|
||||
showPhoneScan: { type: Boolean, default: false },
|
||||
scanning: { type: Boolean, default: false },
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import '@/pages/storefabric/storeFabricBusinessOutPage.scss';
|
||||
@import '@/common/pda-typography.scss';
|
||||
|
||||
.fabric-out-phoneScanIcon {
|
||||
.fabric-out-toolbarIcon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 72rpx;
|
||||
height: 72rpx;
|
||||
margin-left: 8rpx;
|
||||
padding: 10rpx 16rpx;
|
||||
border-radius: 8rpx;
|
||||
border: 1rpx solid #d9d9d9;
|
||||
background: #f7f7f7;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.fabric-out-scanClose {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-left: 8rpx;
|
||||
padding: 0 16rpx;
|
||||
height: 72rpx;
|
||||
border-radius: 8rpx;
|
||||
border: 1rpx solid #2979ff;
|
||||
background: #eaf2ff;
|
||||
color: #2979ff;
|
||||
font-size: $pda-font-action;
|
||||
flex-shrink: 0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,29 +1,52 @@
|
||||
<template>
|
||||
<view class="fabric-out-summary">
|
||||
<scroll-view scroll-x class="fabric-out-summaryScroll">
|
||||
<wyb-table
|
||||
:headers="headers"
|
||||
:contents="contents"
|
||||
:width="tableWidth"
|
||||
height="auto"
|
||||
:font-size="[36, 36]"
|
||||
:min-height="[100, 100]"
|
||||
:padding="[16, 12]"
|
||||
:first-line-fixed="false"
|
||||
empty-string=""
|
||||
@onCellClick="$emit('cell-click', $event)"
|
||||
/>
|
||||
<view class="fabric-out-summaryInner" :style="{ width: tableWidth }">
|
||||
<t-table border="1" border-color="#e1e1e1">
|
||||
<t-tr font-size="18" color="#3e3e3e" align="center">
|
||||
<t-th
|
||||
v-for="col in headers"
|
||||
:key="col.key"
|
||||
align="center"
|
||||
>
|
||||
<view class="fabric-out-th" :style="cellStyle(col)">{{ col.label }}</view>
|
||||
</t-th>
|
||||
</t-tr>
|
||||
<t-tr
|
||||
v-for="(row, rowIndex) in contents"
|
||||
:key="row.group_key || rowIndex"
|
||||
font-size="18"
|
||||
color="#333"
|
||||
align="center"
|
||||
>
|
||||
<t-td
|
||||
v-for="col in headers"
|
||||
:key="col.key"
|
||||
align="center"
|
||||
>
|
||||
<view
|
||||
class="fabric-out-td"
|
||||
:style="cellStyle(col)"
|
||||
@click="onCellClick(col.key, row)"
|
||||
>{{ formatCell(row, col.key) }}</view>
|
||||
</t-td>
|
||||
</t-tr>
|
||||
</t-table>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view v-if="!contents.length" class="fabric-out-summaryEmpty">暂无数据~~</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import wybTable from '@/components/wyb-table/wyb-table.vue';
|
||||
import tTable from '@/components/t-table/t-table.vue';
|
||||
import tTr from '@/components/t-table/t-tr.vue';
|
||||
import tTh from '@/components/t-table/t-th.vue';
|
||||
import tTd from '@/components/t-table/t-td.vue';
|
||||
import { SUMMARY_TABLE_COLUMNS } from '@/common/storeFabricBusinessOut';
|
||||
|
||||
export default {
|
||||
components: { wybTable },
|
||||
components: { tTable, tTr, tTh, tTd },
|
||||
props: {
|
||||
rows: { type: Array, default: () => [] },
|
||||
},
|
||||
@@ -47,10 +70,30 @@ export default {
|
||||
}));
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
cellStyle(col) {
|
||||
const width = `${col.width || 160}rpx`;
|
||||
return {
|
||||
width,
|
||||
minWidth: width,
|
||||
maxWidth: width,
|
||||
};
|
||||
},
|
||||
formatCell(row, key) {
|
||||
const val = row[key];
|
||||
if (val === 0) return '0';
|
||||
return val != null && val !== '' ? val : '-';
|
||||
},
|
||||
onCellClick(key, row) {
|
||||
this.$emit('cell-click', { key, lineData: row });
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import '@/common/pda-typography.scss';
|
||||
|
||||
.fabric-out-summary {
|
||||
background: #fff;
|
||||
margin-top: 16rpx;
|
||||
@@ -58,16 +101,40 @@ export default {
|
||||
.fabric-out-summaryScroll {
|
||||
width: 100%;
|
||||
}
|
||||
.fabric-out-summary ::v-deep .wyb-table-scroll-view {
|
||||
height: auto !important;
|
||||
overflow-x: auto;
|
||||
overflow-y: visible;
|
||||
.fabric-out-summaryInner {
|
||||
min-width: 100%;
|
||||
}
|
||||
.fabric-out-summary ::v-deep .t-table {
|
||||
width: 100%;
|
||||
}
|
||||
.fabric-out-summary ::v-deep .t-th,
|
||||
.fabric-out-summary ::v-deep .t-td {
|
||||
flex: 0 0 auto;
|
||||
width: auto;
|
||||
padding: 0;
|
||||
min-height: $pda-row-min-height;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.fabric-out-th,
|
||||
.fabric-out-td {
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: $pda-row-min-height;
|
||||
padding: 16rpx 12rpx;
|
||||
font-size: $pda-font-body;
|
||||
word-break: break-all;
|
||||
text-align: center;
|
||||
}
|
||||
.fabric-out-th {
|
||||
font-weight: bold;
|
||||
}
|
||||
.fabric-out-summaryEmpty {
|
||||
text-align: center;
|
||||
color: #999;
|
||||
font-size: 36rpx;
|
||||
line-height: 100rpx;
|
||||
font-size: $pda-font-body;
|
||||
line-height: $pda-row-min-height;
|
||||
background: #fff;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -21,11 +21,17 @@
|
||||
:class="{ actionCell: col.key === 'action' && !readonly }"
|
||||
:style="cellStyle(col)"
|
||||
@click="onCellTap(col.key, rowIndex)"
|
||||
>{{ row[col.key] }}</view>
|
||||
>
|
||||
<text
|
||||
v-if="col.key === 'action' && !readonly"
|
||||
class="deleteBtn"
|
||||
>{{ row[col.key] }}</text>
|
||||
<template v-else>{{ row[col.key] }}</template>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view v-if="!readonly && list.length" class="tableTip">点击「操作」列删除,将调用扫码删除接口</view>
|
||||
<view v-if="!readonly && list.length" class="tableTip">点击「删除」将调用扫码删除接口</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</template>
|
||||
@@ -81,9 +87,11 @@ export default {
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
<style scoped lang="scss">
|
||||
@import '@/common/pda-typography.scss';
|
||||
|
||||
.popupWrap {
|
||||
padding: 24rpx 16rpx 30rpx;
|
||||
padding: 28rpx 16rpx 32rpx;
|
||||
max-height: 80vh;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
@@ -91,18 +99,18 @@ export default {
|
||||
overflow: hidden;
|
||||
}
|
||||
.popupTitle {
|
||||
font-size: 32rpx;
|
||||
font-size: $pda-font-popup-title;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
margin-bottom: 20rpx;
|
||||
margin-bottom: 24rpx;
|
||||
color: #333;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.emptyTip {
|
||||
text-align: center;
|
||||
color: #999;
|
||||
padding: 40rpx 0;
|
||||
font-size: 28rpx;
|
||||
padding: 48rpx 0;
|
||||
font-size: $pda-font-popup-sub;
|
||||
}
|
||||
.tableScroll {
|
||||
width: 100%;
|
||||
@@ -118,6 +126,7 @@ export default {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
align-items: stretch;
|
||||
border-bottom: 1rpx solid #e1e1e1;
|
||||
}
|
||||
.tableRow:last-child {
|
||||
@@ -131,8 +140,12 @@ export default {
|
||||
}
|
||||
.tableCell {
|
||||
flex-shrink: 0;
|
||||
padding: 12rpx 8rpx;
|
||||
font-size: 22rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: $pda-row-min-height;
|
||||
padding: 16rpx 10rpx;
|
||||
font-size: $pda-font-popup-item;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
border-right: 1rpx solid #e1e1e1;
|
||||
@@ -146,13 +159,28 @@ export default {
|
||||
.headCell {
|
||||
font-weight: bold;
|
||||
color: #3e3e3e;
|
||||
min-height: 80rpx;
|
||||
}
|
||||
.actionCell {
|
||||
padding: 12rpx 8rpx;
|
||||
}
|
||||
.deleteBtn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-width: 120rpx;
|
||||
min-height: 72rpx;
|
||||
padding: 0 20rpx;
|
||||
border-radius: 8rpx;
|
||||
background: #fff1f0;
|
||||
border: 1rpx solid #ffa39e;
|
||||
color: #f5222d;
|
||||
font-size: $pda-font-action;
|
||||
line-height: 1.2;
|
||||
}
|
||||
.tableTip {
|
||||
margin-top: 16rpx;
|
||||
font-size: 22rpx;
|
||||
margin-top: 20rpx;
|
||||
font-size: $pda-font-popup-sub;
|
||||
color: #999;
|
||||
text-align: center;
|
||||
flex-shrink: 0;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<view class="warehouse-table-wrap" :class="{ 'is-auto-height': isAutoHeight }">
|
||||
<scroll-view scroll-x class="tableScrollX">
|
||||
<wyb-table
|
||||
ref="table"
|
||||
:headers="headers"
|
||||
@@ -10,7 +9,6 @@
|
||||
:first-line-fixed="firstLineFixed"
|
||||
@onCellClick="onCellClick"
|
||||
/>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -24,7 +22,7 @@ export default {
|
||||
contents: { type: Array, default: () => [] },
|
||||
// auto:高度随内容撑开,纵向滚动交给外层 scroll-view,避免与下拉刷新抢手势
|
||||
height: { type: String, default: 'auto' },
|
||||
firstLineFixed: { type: Boolean, default: true },
|
||||
firstLineFixed: { type: Boolean, default: false },
|
||||
},
|
||||
computed: {
|
||||
isAutoHeight() {
|
||||
@@ -50,9 +48,6 @@ export default {
|
||||
width: 100%;
|
||||
background: #fff;
|
||||
}
|
||||
.tableScrollX {
|
||||
width: 100%;
|
||||
}
|
||||
/* 取消表格内部纵向滚动,只保留横向;纵向由页面 scroll-view 处理 */
|
||||
.is-auto-height ::v-deep .wyb-table-scroll-view {
|
||||
height: auto !important;
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
<template>
|
||||
<view class="t-table" :style="{ 'border-width': border + 'px', 'border-color': borderColor }">
|
||||
<slot />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
border: {
|
||||
type: String,
|
||||
default: '1'
|
||||
},
|
||||
borderColor: {
|
||||
type: String,
|
||||
default: '#d0dee5'
|
||||
},
|
||||
isCheck: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
provide() {
|
||||
return {
|
||||
table: this
|
||||
};
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
created() {
|
||||
this.childrens = [];
|
||||
this.index = 0;
|
||||
},
|
||||
methods: {
|
||||
fire(e, index, len) {
|
||||
let childrens = this.childrens;
|
||||
console.log(childrens);
|
||||
// 全选
|
||||
if (index === 0) {
|
||||
childrens.map((vm, index) => {
|
||||
vm.checkboxData.checked = e;
|
||||
return vm;
|
||||
});
|
||||
} else {
|
||||
let isAll = childrens.find((n, ids) => ids !== 0 && !n.checkboxData.checked);
|
||||
childrens[0].checkboxData.checked = isAll ? false : true;
|
||||
}
|
||||
|
||||
let fireArr = [];
|
||||
for (let i = 0; i < childrens.length; i++) {
|
||||
if (childrens[i].checkboxData.checked && i !== 0) {
|
||||
fireArr.push(childrens[i].checkboxData.value - 1);
|
||||
}
|
||||
}
|
||||
this.$emit('change', {
|
||||
detail: fireArr
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.t-table {
|
||||
width: 100%;
|
||||
border: 1px #d0dee5 solid;
|
||||
border-left: none;
|
||||
border-top: none;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.t-table>>>t-tr {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.t-table>>>t-tr:nth-child(2n) {
|
||||
background: #f5f5f5;
|
||||
}
|
||||
|
||||
/* #ifdef H5 */
|
||||
.t-table>>>.t-tr:nth-child(2n) {
|
||||
background: #f5f5f5;
|
||||
}
|
||||
/* #endif */
|
||||
</style>
|
||||
@@ -0,0 +1,71 @@
|
||||
<template>
|
||||
<view class="t-td" :style="{ 'border-width': thBorder + 'px','border-color':borderColor ,'font-size':fontSize+'px' ,'color':color,'justify-content':tdAlignCpd}">
|
||||
<slot></slot>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
align: String
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
thBorder: '1',
|
||||
borderColor: '#d0dee5',
|
||||
fontSize: '14',
|
||||
color: '#555c60',
|
||||
tdAlign: 'center'
|
||||
};
|
||||
},
|
||||
inject: ['table', 'tr'],
|
||||
|
||||
created() {
|
||||
this.thBorder = this.table.border;
|
||||
this.borderColor = this.table.borderColor;
|
||||
this.fontSize = this.tr.fontSize;
|
||||
this.color = this.tr.color;
|
||||
if (this.align) {
|
||||
this.tdAlign = this.align;
|
||||
} else {
|
||||
this.tdAlign = this.tr.align
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
tdAlignCpd() {
|
||||
let nameAlign = '';
|
||||
switch (this.tdAlign) {
|
||||
case 'left':
|
||||
nameAlign = 'flex-start'
|
||||
break;
|
||||
case 'center':
|
||||
nameAlign = 'center'
|
||||
break;
|
||||
case 'right':
|
||||
nameAlign = 'flex-end'
|
||||
break;
|
||||
default:
|
||||
nameAlign = 'center'
|
||||
break;
|
||||
}
|
||||
return nameAlign
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.t-td {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
padding: 14upx;
|
||||
border-top: 1px #d0dee5 solid;
|
||||
border-left: 1px #d0dee5 solid;
|
||||
text-align: center;
|
||||
color: #555c60;
|
||||
font-size: 28upx;
|
||||
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,71 @@
|
||||
<template>
|
||||
<view class="t-th" :style="{ 'border-width': thBorder + 'px' ,'border-color':borderColor,'font-size':fontSize+'px' ,'color':color,'justify-content':thAlignCpd}">
|
||||
<slot></slot>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
align: String,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
thBorder: '1',
|
||||
borderColor: '#d0dee5',
|
||||
fontSize: '15',
|
||||
color: '#3b4246',
|
||||
thAlign: 'center'
|
||||
};
|
||||
},
|
||||
inject: ['table', 'tr'],
|
||||
|
||||
created() {
|
||||
this.thBorder = this.table.border;
|
||||
this.borderColor = this.table.borderColor;
|
||||
this.fontSize = this.tr.fontSize;
|
||||
this.color = this.tr.color;
|
||||
if (this.align) {
|
||||
this.thAlign = this.align;
|
||||
} else {
|
||||
this.thAlign = this.tr.align
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
thAlignCpd() {
|
||||
let nameAlign = '';
|
||||
switch (this.thAlign) {
|
||||
case 'left':
|
||||
nameAlign = 'flex-start'
|
||||
break;
|
||||
case 'center':
|
||||
nameAlign = 'center'
|
||||
break;
|
||||
case 'right':
|
||||
nameAlign = 'flex-end'
|
||||
break;
|
||||
default:
|
||||
nameAlign = 'center'
|
||||
break;
|
||||
}
|
||||
return nameAlign
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.t-th {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 30upx;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
color: #3b4246;
|
||||
border-left: 1px #d0dee5 solid;
|
||||
border-top: 1px #d0dee5 solid;
|
||||
padding: 15upx;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,81 @@
|
||||
<template>
|
||||
<view class="t-tr">
|
||||
<view v-if="isCheck" class="t-check-box" :style="{ 'border-width': thBorder + 'px' ,'border-color':borderColor}">
|
||||
<checkbox-group @change="checkboxChange">
|
||||
<checkbox :value="checkboxData.value + ''" :checked="checkboxData.checked" />
|
||||
</checkbox-group>
|
||||
</view>
|
||||
<slot></slot>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
fontSize: String,
|
||||
color: String,
|
||||
align: String
|
||||
},
|
||||
inject: ['table'],
|
||||
provide() {
|
||||
return {
|
||||
tr: this
|
||||
};
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isCheck: false,
|
||||
checkboxData: {
|
||||
value: 0,
|
||||
checked: false
|
||||
},
|
||||
checked: false,
|
||||
thBorder: '1',
|
||||
borderColor: '#d0dee5'
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.thBorder = this.table.border;
|
||||
this.borderColor = this.table.borderColor;
|
||||
this.table.childrens.push(this);
|
||||
this.checkboxData.value = this.table.index++;
|
||||
this.isCheck = this.table.isCheck;
|
||||
|
||||
},
|
||||
methods: {
|
||||
checkboxChange(e) {
|
||||
this.checkboxData.checked = !this.checkboxData.checked;
|
||||
this.table.childrens[this.checkboxData.value] = this;
|
||||
this.table.fire(e.detail.value[0] ? true : false, this.checkboxData.value, this.table.index);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.t-tr {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.t-tr t-th,
|
||||
.t-tr t-td {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.t-tr .t-check-box {
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 80upx;
|
||||
color: #3b4246;
|
||||
border-left: 1px #d0dee5 solid;
|
||||
border-top: 1px #d0dee5 solid;
|
||||
}
|
||||
|
||||
.t-tr .t-check-box checkbox {
|
||||
transform: scale(0.8);
|
||||
}
|
||||
</style>
|
||||
@@ -73,7 +73,7 @@
|
||||
borderRight: index === headers.length - 1 || (!showVertBorder && index !== 0) ? 'none' : '1px solid' + borderColor,
|
||||
zIndex: index === 0 ? 20 : 0,
|
||||
left: index === 0 && firstLineFixed ? (enableCheck ? checkColWidth + 'rpx' : 0) : 'auto',
|
||||
position: index === 0 ? 'sticky' : 'static'}">
|
||||
position: index === 0 && firstLineFixed ? 'sticky' : 'static'}">
|
||||
<text :style="{marginLeft: autoSortShow(index) && textAlign !== 'left' ? fontSize[0] * 0.65 + 'rpx' : 0}">
|
||||
{{item.label || emptyString}}
|
||||
</text>
|
||||
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
"name" : "浩拓织厂",
|
||||
"appid" : "__UNI__F79F300",
|
||||
"description" : "周尚-浩拓织厂",
|
||||
"versionName" : "1.1.20",
|
||||
"versionCode" : 120,
|
||||
"versionName" : "1.1.26",
|
||||
"versionCode" : 126,
|
||||
"transformPx" : false,
|
||||
"app-plus" : {
|
||||
"optimization" : {
|
||||
|
||||
@@ -42,13 +42,20 @@
|
||||
</view>
|
||||
|
||||
<view v-if="showScanSection">
|
||||
<PlusBarcodePanel
|
||||
ref="plusBarcodePanel"
|
||||
:visible.sync="phoneScanPanelOpen"
|
||||
hint-text="连续扫码出仓,扫完可继续下一条"
|
||||
:scan-time-space="1200"
|
||||
@success="onPlusBarcodeSuccess"
|
||||
/>
|
||||
<FabricOutScanBar
|
||||
:can-scan="canScan"
|
||||
:value="QRBarCode"
|
||||
:delete-mode="BarCodeDelStatus"
|
||||
:message="BillDataMessage"
|
||||
disabled-tip="请先提交保存后再扫码"
|
||||
:show-phone-scan="usePhoneScanFallback"
|
||||
:scanning="phoneScanPanelOpen"
|
||||
@input="QRBarCode = $event"
|
||||
@scan="handleScan"
|
||||
@phone-scan="handlePhoneScan"
|
||||
@@ -99,6 +106,7 @@ import FabricOutScanDetail from '@/components/storefabric/FabricOutScanDetail.vu
|
||||
import FabricOutSummaryTable from '@/components/storefabric/FabricOutSummaryTable.vue';
|
||||
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
||||
import SearchSelectPopup from '@/components/storefabric/SearchSelectPopup.vue';
|
||||
import PlusBarcodePanel from '@/components/common/PlusBarcodePanel.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -110,6 +118,7 @@ export default {
|
||||
FabricOutSummaryTable,
|
||||
FabricOutFooter,
|
||||
SearchSelectPopup,
|
||||
PlusBarcodePanel,
|
||||
},
|
||||
mixins: [formMixin],
|
||||
onLoad() {
|
||||
|
||||
@@ -36,12 +36,19 @@
|
||||
</view>
|
||||
|
||||
<view v-if="showScanSection">
|
||||
<PlusBarcodePanel
|
||||
ref="plusBarcodePanel"
|
||||
:visible.sync="phoneScanPanelOpen"
|
||||
hint-text="连续扫码出仓,扫完可继续下一条"
|
||||
:scan-time-space="1200"
|
||||
@success="onPlusBarcodeSuccess"
|
||||
/>
|
||||
<FabricOutScanBar
|
||||
:can-scan="canScan"
|
||||
:value="QRBarCode"
|
||||
:delete-mode="BarCodeDelStatus"
|
||||
:message="BillDataMessage"
|
||||
:show-phone-scan="usePhoneScanFallback"
|
||||
:scanning="phoneScanPanelOpen"
|
||||
@input="QRBarCode = $event"
|
||||
@scan="handleScan"
|
||||
@phone-scan="handlePhoneScan"
|
||||
@@ -82,6 +89,7 @@ import FabricOutScanDetail from '@/components/storefabric/FabricOutScanDetail.vu
|
||||
import FabricOutSummaryTable from '@/components/storefabric/FabricOutSummaryTable.vue';
|
||||
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
||||
import SearchSelectPopup from '@/components/storefabric/SearchSelectPopup.vue';
|
||||
import PlusBarcodePanel from '@/components/common/PlusBarcodePanel.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -93,6 +101,7 @@ export default {
|
||||
FabricOutSummaryTable,
|
||||
FabricOutFooter,
|
||||
SearchSelectPopup,
|
||||
PlusBarcodePanel,
|
||||
},
|
||||
mixins: [formMixin],
|
||||
data() {
|
||||
|
||||
@@ -64,6 +64,7 @@ export default {
|
||||
auditStatus: 0,
|
||||
businessUnitOptions: [],
|
||||
dropdownLoading: false,
|
||||
phoneScanPanelOpen: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -112,15 +113,28 @@ export default {
|
||||
},
|
||||
onHide() {
|
||||
this.isPageActive = false;
|
||||
this.closePhoneScanPanel();
|
||||
this.unregisterScanBroadcast();
|
||||
},
|
||||
onUnload() {
|
||||
this.isPageActive = false;
|
||||
this.closePhoneScanPanel();
|
||||
this.unregisterScanBroadcast();
|
||||
},
|
||||
methods: {
|
||||
handlePhoneScan() {
|
||||
this.openPhoneScan();
|
||||
if (!this.canScan) {
|
||||
this.showError('请先提交保存后再扫码');
|
||||
return;
|
||||
}
|
||||
this.phoneScanPanelOpen = !this.phoneScanPanelOpen;
|
||||
},
|
||||
closePhoneScanPanel() {
|
||||
this.phoneScanPanelOpen = false;
|
||||
},
|
||||
onPlusBarcodeSuccess(scanResult) {
|
||||
this.QRBarCode = String(scanResult || '').trim().replace(/[\r\n]/g, '');
|
||||
return this.handleScan();
|
||||
},
|
||||
registerOrderScanBroadcast() {
|
||||
this.registerScanBroadcast((scanResult) => {
|
||||
@@ -132,6 +146,7 @@ export default {
|
||||
const nextCanScan = this.isEditable && canScanAtStatus(status);
|
||||
if (this.canScan && !nextCanScan) {
|
||||
this.unregisterScanBroadcast();
|
||||
this.closePhoneScanPanel();
|
||||
}
|
||||
this.canScan = nextCanScan;
|
||||
},
|
||||
@@ -314,14 +329,14 @@ export default {
|
||||
if (!this.canScan || !this.orderId) {
|
||||
this.showError('请先提交保存后再扫码');
|
||||
this.QRBarCode = '';
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
if (!code) {
|
||||
this.QRBarCode = '';
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
const scanType = this.BarCodeDelStatus ? 2 : 1;
|
||||
this.doScanUpdate(code, scanType);
|
||||
return this.doScanUpdate(code, scanType);
|
||||
},
|
||||
BarCodeDelChange(e) {
|
||||
this.BarCodeDelStatus = (e.detail.value || []).length > 0;
|
||||
|
||||
@@ -9,17 +9,47 @@
|
||||
</template>
|
||||
</common-navbar>
|
||||
|
||||
<PlusBarcodePanel
|
||||
ref="plusBarcodePanel"
|
||||
:visible.sync="phoneScanPanelOpen"
|
||||
hint-text="先扫描布票,再填写信息后确认进仓"
|
||||
:scan-time-space="1200"
|
||||
@success="onPlusBarcodeSuccess"
|
||||
/>
|
||||
|
||||
<view class="manual-in__scan">
|
||||
<input
|
||||
class="manual-in__scan-input"
|
||||
type="text"
|
||||
confirm-type="done"
|
||||
:confirm-hold="true"
|
||||
:focus="scanFocus"
|
||||
v-model="scanCode"
|
||||
placeholder="请点击扫描/输入布票编码"
|
||||
placeholder="请先扫描布票编码"
|
||||
placeholder-class="manual-in__placeholder"
|
||||
@confirm="onScanConfirm"
|
||||
/>
|
||||
<view
|
||||
v-if="scanCode"
|
||||
class="manual-in__scan-icon"
|
||||
@click.stop="clearScanCode"
|
||||
>
|
||||
<u-icon name="close-circle-fill" size="44" color="#bfbfbf" />
|
||||
</view>
|
||||
<view
|
||||
v-if="phoneScanPanelOpen"
|
||||
class="manual-in__scan-close"
|
||||
@click.stop="handlePhoneScan"
|
||||
>
|
||||
关闭扫码
|
||||
</view>
|
||||
<view
|
||||
v-else
|
||||
class="manual-in__scan-icon"
|
||||
@click.stop="handlePhoneScan"
|
||||
>
|
||||
<u-icon name="scan" size="44" color="#595959" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="manual-in__panel">
|
||||
@@ -43,6 +73,22 @@
|
||||
<text class="manual-in__label">坯布编号</text>
|
||||
<text class="manual-in__value">{{ detail.grey_fabric_code || '-' }}</text>
|
||||
</view>
|
||||
<view class="manual-in__row">
|
||||
<text class="manual-in__label">卷号</text>
|
||||
<text class="manual-in__value">{{ detail.volume_number != null && detail.volume_number !== '' ? detail.volume_number : '-' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="manual-in__panel manual-in__panel--form">
|
||||
<view class="manual-in__row manual-in__row--input" @click="openInspectorPicker">
|
||||
<text class="manual-in__label">查布工</text>
|
||||
<view class="manual-in__right">
|
||||
<text :class="detail.inspector_name ? 'manual-in__field-text' : 'manual-in__placeholder'">
|
||||
{{ detail.inspector_name || '请选择查布工' }}
|
||||
</text>
|
||||
<text class="manual-in__action" @click.stop="clearInspector">取消</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="manual-in__row manual-in__row--input">
|
||||
<text class="manual-in__label">重量</text>
|
||||
<view class="manual-in__right">
|
||||
@@ -66,15 +112,6 @@
|
||||
<text class="manual-in__action" @click.stop="clearLevel">取消</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="manual-in__row manual-in__row--input" @click="openInspectorPicker">
|
||||
<text class="manual-in__label">查布工</text>
|
||||
<view class="manual-in__right">
|
||||
<text :class="detail.inspector_name ? 'manual-in__field-text' : 'manual-in__placeholder'">
|
||||
{{ detail.inspector_name || '请选择查布工' }}
|
||||
</text>
|
||||
<text class="manual-in__action" @click.stop="clearInspector">取消</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="manual-in__row manual-in__row--input">
|
||||
<text class="manual-in__label">存放仓位</text>
|
||||
<view class="manual-in__right">
|
||||
@@ -88,20 +125,17 @@
|
||||
<text class="manual-in__action" @click="editWarehouseBin">修改</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="manual-in__row" v-if="detail.volume_number != null && detail.volume_number !== ''">
|
||||
<text class="manual-in__label">卷号</text>
|
||||
<text class="manual-in__value">{{ detail.volume_number }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="manual-in__footer">
|
||||
<u-button
|
||||
type="primary"
|
||||
shape="circle"
|
||||
:loading="submitting"
|
||||
:disabled="submitting || loadingDetail"
|
||||
@click="submitInWarehouse"
|
||||
>确定进仓</u-button>
|
||||
>
|
||||
确认进仓
|
||||
</u-button>
|
||||
</view>
|
||||
|
||||
<SearchSelectPopup
|
||||
@@ -126,6 +160,7 @@
|
||||
<script>
|
||||
import CommonNavbar from '@/components/common-navbar/index';
|
||||
import SearchSelectPopup from '@/components/storefabric/SearchSelectPopup.vue';
|
||||
import PlusBarcodePanel from '@/components/common/PlusBarcodePanel.vue';
|
||||
import scanMixin from '@/common/scanMixin.js';
|
||||
import util from '@/common/util.js';
|
||||
import { formatWeightKg } from '@/common/storeFabricBusinessOut.js';
|
||||
@@ -179,7 +214,7 @@ function normalizeLevelIds(value) {
|
||||
}
|
||||
|
||||
export default {
|
||||
components: { CommonNavbar, SearchSelectPopup },
|
||||
components: { CommonNavbar, SearchSelectPopup, PlusBarcodePanel },
|
||||
mixins: [scanMixin],
|
||||
data() {
|
||||
return {
|
||||
@@ -197,6 +232,7 @@ export default {
|
||||
inspectorPickerShow: false,
|
||||
inspectorOptions: [],
|
||||
inspectorOptionsLoaded: false,
|
||||
phoneScanPanelOpen: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -217,12 +253,32 @@ export default {
|
||||
this.loadInspectorOptions();
|
||||
},
|
||||
onShow() {
|
||||
this.scanFocus = false;
|
||||
this.$nextTick(() => {
|
||||
this.scanFocus = true;
|
||||
});
|
||||
this.isPageActive = true;
|
||||
this.refocusScanInput(50);
|
||||
},
|
||||
onHide() {
|
||||
this.isPageActive = false;
|
||||
this.closePhoneScanPanel();
|
||||
},
|
||||
onUnload() {
|
||||
this.isPageActive = false;
|
||||
this.closePhoneScanPanel();
|
||||
clearTimeout(this._scanFocusTimer);
|
||||
},
|
||||
methods: {
|
||||
refocusScanInput(delay = 120) {
|
||||
clearTimeout(this._scanFocusTimer);
|
||||
this.scanFocus = false;
|
||||
this._scanFocusTimer = setTimeout(() => {
|
||||
this.scanFocus = true;
|
||||
}, delay);
|
||||
},
|
||||
closePhoneScanPanel() {
|
||||
this.phoneScanPanelOpen = false;
|
||||
},
|
||||
onPlusBarcodeSuccess(scanResult) {
|
||||
return this.handleScanCode(scanResult);
|
||||
},
|
||||
navToSetting() {
|
||||
uni.navigateTo({ url: '/pages/sys/user/scan-settings' });
|
||||
},
|
||||
@@ -330,6 +386,13 @@ export default {
|
||||
if (!code) return;
|
||||
this.fetchScanDetail(code);
|
||||
},
|
||||
clearScanCode() {
|
||||
this.scanCode = '';
|
||||
this.refocusScanInput();
|
||||
},
|
||||
handlePhoneScan() {
|
||||
this.phoneScanPanelOpen = !this.phoneScanPanelOpen;
|
||||
},
|
||||
onScanConfirm() {
|
||||
const code = String(this.scanCode || '').trim();
|
||||
if (!code) {
|
||||
@@ -338,8 +401,22 @@ export default {
|
||||
}
|
||||
this.fetchScanDetail(code);
|
||||
},
|
||||
validateBeforeSubmit() {
|
||||
const fabricPieceCode = String(this.detail.fabric_piece_code || this.scanCode || '').trim();
|
||||
if (!fabricPieceCode) {
|
||||
return '请先扫描或输入布票编码';
|
||||
}
|
||||
const inspectorName = String(this.detail.inspector_name || '').trim();
|
||||
if (!inspectorName && (this.detail.inspector_id == null || this.detail.inspector_id === '')) {
|
||||
return '请选择查布工';
|
||||
}
|
||||
if (toWeightInt(this.weightKg) == null) {
|
||||
return '请输入有效重量';
|
||||
}
|
||||
return '';
|
||||
},
|
||||
async fetchScanDetail(code) {
|
||||
if (this.loadingDetail) return;
|
||||
if (this.loadingDetail || this.submitting) return;
|
||||
this.loadingDetail = true;
|
||||
this.scanCode = code;
|
||||
try {
|
||||
@@ -349,22 +426,29 @@ export default {
|
||||
this.applyScanDetail(res, code);
|
||||
} catch (error) {
|
||||
console.log('扫码获取细码失败', error);
|
||||
const kept = this.keepFormFields();
|
||||
this.detail = {
|
||||
...emptyDetail(),
|
||||
fabric_piece_code: code,
|
||||
inspector_id: this.detail.inspector_id,
|
||||
inspector_name: this.detail.inspector_name,
|
||||
...kept,
|
||||
};
|
||||
this.weightKg = '';
|
||||
this.scanCode = '';
|
||||
this.refocusScanInput(200);
|
||||
} finally {
|
||||
this.loadingDetail = false;
|
||||
}
|
||||
},
|
||||
keepFormFields() {
|
||||
return {
|
||||
grey_fabric_level_id: normalizeLevelIds(this.detail.grey_fabric_level_id),
|
||||
grey_fabric_level_name: this.detail.grey_fabric_level_name || '',
|
||||
inspector_id: this.detail.inspector_id,
|
||||
inspector_name: this.detail.inspector_name || '',
|
||||
};
|
||||
},
|
||||
applyScanDetail(res, fallbackCode) {
|
||||
const data = res || {};
|
||||
const levelIds = normalizeLevelIds(data.grey_fabric_level_id);
|
||||
const hasIncomingInspector = data.inspector_id != null && data.inspector_id !== ''
|
||||
|| String(data.inspector_name || '').trim();
|
||||
const kept = this.keepFormFields();
|
||||
this.detail = {
|
||||
...emptyDetail(),
|
||||
fabric_piece_code: data.fabric_piece_code || fallbackCode || '',
|
||||
@@ -372,33 +456,20 @@ export default {
|
||||
machine_number: data.machine_number || '',
|
||||
grey_fabric_name: data.grey_fabric_name || '',
|
||||
grey_fabric_code: data.grey_fabric_code || '',
|
||||
inspection_weight: formatDisplayWeightKg(data.inspection_weight) ? data.inspection_weight : null,
|
||||
grey_fabric_level_id: levelIds,
|
||||
grey_fabric_level_name: Array.isArray(data.grey_fabric_level_name)
|
||||
? data.grey_fabric_level_name.filter(Boolean).join('、')
|
||||
: (data.grey_fabric_level_name || ''),
|
||||
inspector_id: hasIncomingInspector && data.inspector_id != null && data.inspector_id !== ''
|
||||
? data.inspector_id
|
||||
: this.detail.inspector_id,
|
||||
inspector_name: hasIncomingInspector
|
||||
? (data.inspector_name || this.detail.inspector_name || '')
|
||||
: (this.detail.inspector_name || ''),
|
||||
inspection_weight: toWeightInt(this.weightKg),
|
||||
volume_number: data.volume_number != null && data.volume_number !== '' ? data.volume_number : null,
|
||||
...kept,
|
||||
};
|
||||
this.weightKg = formatDisplayWeightKg(data.inspection_weight);
|
||||
this.scanCode = this.detail.fabric_piece_code;
|
||||
util.playSpeak('扫码成功');
|
||||
},
|
||||
async submitInWarehouse() {
|
||||
const err = this.validateBeforeSubmit();
|
||||
if (err) {
|
||||
this.$u.toast(err);
|
||||
return;
|
||||
}
|
||||
const fabricPieceCode = String(this.detail.fabric_piece_code || this.scanCode || '').trim();
|
||||
if (!fabricPieceCode) {
|
||||
this.$u.toast('请先扫描或输入布票编码');
|
||||
return;
|
||||
}
|
||||
const actualWeight = toWeightInt(this.weightKg);
|
||||
if (actualWeight == null) {
|
||||
this.$u.toast('请输入有效重量');
|
||||
return;
|
||||
}
|
||||
const levelIds = normalizeLevelIds(this.detail.grey_fabric_level_id);
|
||||
if (this.submitting) return;
|
||||
this.submitting = true;
|
||||
@@ -440,26 +511,21 @@ export default {
|
||||
this.resetForNextScan();
|
||||
} catch (error) {
|
||||
console.log('手动进仓失败', error);
|
||||
this.scanCode = '';
|
||||
this.refocusScanInput(200);
|
||||
} finally {
|
||||
this.submitting = false;
|
||||
}
|
||||
},
|
||||
resetForNextScan() {
|
||||
const inspectorId = this.detail.inspector_id;
|
||||
const inspectorName = this.detail.inspector_name;
|
||||
const kept = this.keepFormFields();
|
||||
this.scanCode = '';
|
||||
this.detail = {
|
||||
...emptyDetail(),
|
||||
inspector_id: inspectorId,
|
||||
inspector_name: inspectorName,
|
||||
...kept,
|
||||
};
|
||||
this.weightKg = '';
|
||||
this.$nextTick(() => {
|
||||
this.scanFocus = false;
|
||||
this.$nextTick(() => {
|
||||
this.scanFocus = true;
|
||||
});
|
||||
});
|
||||
// toast 会抢焦点,稍后再聚焦,方便连续扫码
|
||||
this.refocusScanInput(600);
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -471,7 +537,7 @@ export default {
|
||||
.manual-in {
|
||||
min-height: 100vh;
|
||||
background: #f5f6f8;
|
||||
padding-bottom: 180rpx;
|
||||
padding-bottom: calc(160rpx + env(safe-area-inset-bottom));
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
@@ -487,14 +553,46 @@ export default {
|
||||
margin: 16rpx 0;
|
||||
padding: 0 28rpx;
|
||||
background: #fff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12rpx;
|
||||
}
|
||||
|
||||
.manual-in__scan-input {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
height: $pda-scan-input-height;
|
||||
font-size: $pda-font-body;
|
||||
color: #202328;
|
||||
}
|
||||
|
||||
.manual-in__scan-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 72rpx;
|
||||
height: 72rpx;
|
||||
flex-shrink: 0;
|
||||
border-radius: 8rpx;
|
||||
border: 1rpx solid #d9d9d9;
|
||||
background: #f7f7f7;
|
||||
}
|
||||
|
||||
.manual-in__scan-close {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 72rpx;
|
||||
padding: 0 16rpx;
|
||||
flex-shrink: 0;
|
||||
border-radius: 8rpx;
|
||||
border: 1rpx solid #2979ff;
|
||||
background: #eaf2ff;
|
||||
color: #2979ff;
|
||||
font-size: $pda-font-action;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.manual-in__placeholder {
|
||||
color: #b0b4bb;
|
||||
font-size: $pda-font-placeholder;
|
||||
@@ -504,6 +602,27 @@ export default {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.manual-in__panel--form {
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
|
||||
.manual-in__footer {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
padding: 20rpx 28rpx calc(20rpx + env(safe-area-inset-bottom));
|
||||
background: #fff;
|
||||
box-shadow: 0 -4rpx 16rpx rgba(0, 0, 0, 0.06);
|
||||
box-sizing: border-box;
|
||||
z-index: 20;
|
||||
|
||||
::v-deep .u-btn {
|
||||
height: $pda-button-height !important;
|
||||
font-size: $pda-font-button !important;
|
||||
}
|
||||
}
|
||||
|
||||
.manual-in__row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -569,20 +688,4 @@ export default {
|
||||
color: #2f78e6;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.manual-in__footer {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
padding: 24rpx 40rpx calc(24rpx + env(safe-area-inset-bottom));
|
||||
background: #fff;
|
||||
box-shadow: 0 -4rpx 16rpx rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
::v-deep .manual-in__footer .u-btn {
|
||||
height: $pda-button-height !important;
|
||||
line-height: $pda-button-height !important;
|
||||
font-size: $pda-font-button !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://aidex.vip All rights reserved.
|
||||
*/
|
||||
import config, { getDefaultApiUrl } from '@/common/config.js';
|
||||
import config, { getDefaultApiUrl, resolveUpgradeDownloadUrl } from '@/common/config.js';
|
||||
import base64 from '@/common/base64.js';
|
||||
import util from '@/common/util.js';
|
||||
import md5 from '@/common/md5.js';
|
||||
@@ -459,7 +459,7 @@ export default {
|
||||
return {
|
||||
changelog: res.message + ',最新版本:' + res.latest_version,
|
||||
status: res.need_update ? 1 : 0, // 0 无新版本 | 1 有新版本
|
||||
path: res.download_url, // 新apk地址
|
||||
path: resolveUpgradeDownloadUrl(res.download_url), // 新apk地址
|
||||
latest_version: res.latest_version
|
||||
};
|
||||
} catch (error) {
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<u-gap height="20" bg-color="#f5f5f5"></u-gap>
|
||||
<u-cell-item icon="question-circle" :iconStyle="{ color: '#ff8d06' }" title="常见问题" @click="navTo('problem')"></u-cell-item>
|
||||
<u-cell-item icon="kefu-ermai" :iconStyle="{ color: '#5f8dff' }" title="意见反馈" @click="navTo('comment')"></u-cell-item>
|
||||
<u-cell-item icon="map" :iconStyle="{ color: '#316ede' }" title="账号安全" @click="navTo('pwd')"></u-cell-item>
|
||||
<u-cell-item icon="map" :iconStyle="{ color: '#316ede' }" title="修改密码" @click="navTo('pwd')"></u-cell-item>
|
||||
<u-cell-item icon="scan" :iconStyle="{ color: '#36cfc9' }" title="扫描设置" @click="navTo('scan-settings')"></u-cell-item>
|
||||
<u-cell-item icon="order" :iconStyle="{ color: '#59bdf9' }" title="清除缓存" @click="navTo('clear-cache')"></u-cell-item>
|
||||
<!--<u-cell-item icon="account" :iconStyle="{ color: '#27c0dc' }" title="关于我们" @click="navTo('about')"></u-cell-item>
|
||||
@@ -61,7 +61,7 @@
|
||||
<script>
|
||||
import CommonNavbar from "@/components/common-navbar/index";
|
||||
import app_upgrade from '@/uni_modules/app-upgrade/js_sdk/index.js';
|
||||
import config from '@/common/config.js';
|
||||
import config, { resolveUpgradeDownloadUrl } from '@/common/config.js';
|
||||
import manifest from '@/manifest.json';
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://aidex.vip All rights reserved.
|
||||
@@ -133,7 +133,7 @@ export default {
|
||||
return {
|
||||
changelog: res.message + ',最新版本:' + res.latest_version,
|
||||
status: res.need_update ? 1 : 0,
|
||||
path: res.download_url,
|
||||
path: resolveUpgradeDownloadUrl(res.download_url),
|
||||
latest_version: res.latest_version
|
||||
};
|
||||
}, 1);
|
||||
|
||||
@@ -68,31 +68,30 @@ export default {
|
||||
methods: {
|
||||
submit() {
|
||||
this.$refs.uForm.validate(valid => {
|
||||
if (valid) {
|
||||
if (!valid) {
|
||||
this.$u.toast('您填写的信息有误,请根据提示修正。');
|
||||
return;
|
||||
}
|
||||
this.$u.api.user.infoSavePwd({
|
||||
oldPassword: this.model.oldPassword,
|
||||
newPassword: this.model.newPassword
|
||||
}).then(res => {
|
||||
if(res.code == '200'){
|
||||
}).then(() => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: res.msg,
|
||||
content: '密码修改成功',
|
||||
showCancel: false,
|
||||
success: function () {
|
||||
success: () => {
|
||||
uni.navigateBack();
|
||||
}
|
||||
});
|
||||
}else{
|
||||
}).catch((err) => {
|
||||
const message = (err && (err.message || err.msg)) || '修改密码失败';
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: res.msg,
|
||||
content: message,
|
||||
showCancel: false
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$u.toast('您填写的信息有误,请根据提示修正。');
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
|
||||
+11
-12
@@ -33,7 +33,7 @@ export default {
|
||||
model: {
|
||||
oldPassword: '',
|
||||
newPassword: '',
|
||||
confirmNewPassword: ''
|
||||
confirmPassword: ''
|
||||
},
|
||||
rules: {
|
||||
oldPassword: [
|
||||
@@ -78,31 +78,30 @@ export default {
|
||||
methods: {
|
||||
submit() {
|
||||
this.$refs.uForm.validate(valid => {
|
||||
if (valid) {
|
||||
if (!valid) {
|
||||
this.$u.toast('您填写的信息有误,请根据提示修正。');
|
||||
return;
|
||||
}
|
||||
this.$u.api.user.infoSavePwd({
|
||||
oldPassword: this.model.oldPassword,
|
||||
newPassword: this.model.newPassword
|
||||
}).then(res => {
|
||||
if(res.code == '200'){
|
||||
}).then(() => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: res.msg,
|
||||
content: '密码修改成功',
|
||||
showCancel: false,
|
||||
success: function () {
|
||||
success: () => {
|
||||
uni.navigateBack();
|
||||
}
|
||||
});
|
||||
}else{
|
||||
}).catch((err) => {
|
||||
const message = (err && (err.message || err.msg)) || '修改密码失败';
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: res.msg,
|
||||
content: message,
|
||||
showCancel: false
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$u.toast('您填写的信息有误,请根据提示修正。');
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
|
||||
@@ -42,6 +42,7 @@ import {
|
||||
mapDictionaryToScannerConfig,
|
||||
PHONE_SCAN_BRAND,
|
||||
saveScanConfig,
|
||||
autoConfigureScanSettings,
|
||||
} from '@/common/scanConfig.js';
|
||||
|
||||
export default {
|
||||
@@ -100,6 +101,7 @@ export default {
|
||||
this.ensurePhoneScanOption();
|
||||
this.ensureSeuicOption();
|
||||
this.ensureNlscanOption();
|
||||
this.ensureNlscanCompatOption();
|
||||
this.initFormFromSaved();
|
||||
},
|
||||
useFallbackConfigList() {
|
||||
@@ -136,8 +138,15 @@ export default {
|
||||
ensureNlscanOption() {
|
||||
this.ensureBuiltinScannerOption('nlscan');
|
||||
},
|
||||
ensureNlscanCompatOption() {
|
||||
this.ensureBuiltinScannerOption('nlscan_compat');
|
||||
},
|
||||
initFormFromSaved() {
|
||||
const savedConfig = getScanConfig(this.getScannerConfigs());
|
||||
// N5S 曾被误识别为东集时,进入设置页会纠正并写回
|
||||
const rematch = autoConfigureScanSettings({
|
||||
remoteConfigs: this.remoteScannerConfigs || [],
|
||||
});
|
||||
const savedConfig = (rematch && rematch.config) || getScanConfig(this.getScannerConfigs());
|
||||
if (savedConfig) {
|
||||
this.applyConfig(savedConfig);
|
||||
return;
|
||||
|
||||
@@ -14,6 +14,7 @@ module.exports = {
|
||||
'process.env': {
|
||||
...definitions[0]['process.env'],
|
||||
VUE_APP_UPGRADE_NAME: JSON.stringify(process.env.VUE_APP_UPGRADE_NAME),
|
||||
VUE_APP_UPGRADE_CDN_PREFIX: JSON.stringify(process.env.VUE_APP_UPGRADE_CDN_PREFIX),
|
||||
VUE_APP_PRODUCTION_API_URL: JSON.stringify(process.env.VUE_APP_PRODUCTION_API_URL),
|
||||
VUE_APP_DEV_API_URL: JSON.stringify(process.env.VUE_APP_DEV_API_URL),
|
||||
VUE_APP_ENV_NAME: JSON.stringify(process.env.VUE_APP_ENV_NAME),
|
||||
|
||||
Reference in New Issue
Block a user