Compare commits
26
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
232a3e179a | ||
|
|
1c434a608a | ||
|
|
f8ec49c79d | ||
|
|
7b10d36361 | ||
|
|
e8ae05b87b | ||
|
|
c4d5db056b | ||
|
|
7b199ba559 | ||
|
|
322ada8428 | ||
|
|
3e9b0fd1a8 | ||
|
|
b734f50f0a | ||
|
|
b04f890664 | ||
|
|
304d7ccde0 | ||
|
|
45a8928564 | ||
|
|
f6f85ed8ce | ||
|
|
3e936b064d | ||
|
|
7c6c7a1b32 | ||
|
|
c8ce45ae38 | ||
|
|
bff563b444 | ||
|
|
63755eab5c | ||
|
|
26c7085ab2 | ||
|
|
53a059f16b | ||
|
|
e0ee8d8c8d | ||
|
|
fa0ff1614b | ||
|
|
3f2481d1eb | ||
|
|
162e10a6fc | ||
|
|
26ff443107 |
@@ -0,0 +1,37 @@
|
|||||||
|
---
|
||||||
|
description: PDA 小屏界面字号与排版标准(以手动进仓页为准)
|
||||||
|
alwaysApply: true
|
||||||
|
---
|
||||||
|
|
||||||
|
# PDA 字号标准
|
||||||
|
|
||||||
|
本项目面向工业 PDA 小屏。新增/改版业务页时,**以后台手动进仓页**(`storeFabricManualIn.vue`)的字号为准,不要用偏小的默认字号。
|
||||||
|
|
||||||
|
共用变量:`@import '@/common/pda-typography.scss';`(或等价路径)。
|
||||||
|
|
||||||
|
## 字号(rpx)
|
||||||
|
|
||||||
|
| 用途 | 字号 | 变量 |
|
||||||
|
|------|------|------|
|
||||||
|
| 表单标签 / 正文 / 输入值 | **36** | `$pda-font-body` |
|
||||||
|
| 扫码输入框 | **36** | `$pda-font-body` |
|
||||||
|
| 占位提示 | **34** | `$pda-font-placeholder` |
|
||||||
|
| 行内操作(取消/修改) | **34** | `$pda-font-action` |
|
||||||
|
| 单位角标(如 KG) | **32** | `$pda-font-unit` |
|
||||||
|
| 顶栏次要文字(设置等) | **32** | `$pda-font-nav-sub` |
|
||||||
|
| 主按钮文字 | **36** | `$pda-font-button` |
|
||||||
|
| 弹层标题 / 选项 | **36** | `$pda-font-popup-title` / `$pda-font-popup-item` |
|
||||||
|
| 弹层取消 / 空态 | **34** | `$pda-font-popup-sub` |
|
||||||
|
|
||||||
|
## 行高与触控
|
||||||
|
|
||||||
|
- 列表行最小高度约 **100rpx**,可略加上下 padding
|
||||||
|
- 扫码输入框高度约 **100rpx**
|
||||||
|
- 主按钮高度约 **92rpx**
|
||||||
|
- 标签列宽约 **200rpx**(中文四字标签)
|
||||||
|
|
||||||
|
## 注意
|
||||||
|
|
||||||
|
- 登录环境选择、出仓明细等已放大过的页面,新改动保持不低于上表
|
||||||
|
- 不要为了“好看”再缩小字号;宁可少露内容、可滚动,也要可读
|
||||||
|
- 选择类弹层(如 `SearchSelectPopup`)与表单页使用同一套字号
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
NODE_ENV = development
|
NODE_ENV = production
|
||||||
VUE_APP_ENV_NAME = 默认环境
|
VUE_APP_ENV_NAME = zhoushang环境
|
||||||
VUE_APP_UPGRADE_NAME = erp_pda
|
VUE_APP_UPGRADE_NAME = erp_pda_zhoushang_zhichang
|
||||||
VUE_APP_PRODUCTION_API_URL = https://www.haotopai.com/hcscm_weave/mes/server/pda/v1
|
VUE_APP_PRODUCTION_API_URL = https://www.haotopai.com/hcscm_weave/mes/server/pda/v1
|
||||||
VUE_APP_DEV_API_URL = https://www.haotopai.com/hcscm_weave/mes/server/pda/v1
|
VUE_APP_DEV_API_URL = https://www.haotopai.com/hcscm_weave/mes/server/pda/v1
|
||||||
|
|||||||
+3
-3
@@ -1,5 +1,5 @@
|
|||||||
NODE_ENV = production
|
NODE_ENV = production
|
||||||
VUE_APP_ENV_NAME = zhoushang环境
|
VUE_APP_ENV_NAME = zhoushang环境
|
||||||
VUE_APP_UPGRADE_NAME = erp_pda_zhoushang
|
VUE_APP_UPGRADE_NAME = erp_pda_zhoushang_zhichang
|
||||||
VUE_APP_PRODUCTION_API_URL = https://hcscmtest.zzfzyc.com/hcscm_weave/pda/v1
|
VUE_APP_PRODUCTION_API_URL = https://www.haotopai.com/hcscm_weave/mes/server/pda/v1
|
||||||
VUE_APP_DEV_API_URL = https://hcscmtest.zzfzyc.com/hcscm_weave/pda/v1
|
VUE_APP_DEV_API_URL = https://www.haotopai.com/hcscm_weave/mes/server/pda/v1
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ pnpm-lock.yaml
|
|||||||
# Environment variables
|
# Environment variables
|
||||||
.env.local
|
.env.local
|
||||||
.env.*.local
|
.env.*.local
|
||||||
|
scripts/upload-apk.local.json
|
||||||
|
|
||||||
# Build output and cache
|
# Build output and cache
|
||||||
/.hbuilderx/
|
/.hbuilderx/
|
||||||
|
|||||||
@@ -48,6 +48,7 @@
|
|||||||
"dev:quickapp-webview-huawei": "cross-env NODE_ENV=development UNI_PLATFORM=quickapp-webview-huawei vue-cli-service uni-build --watch",
|
"dev:quickapp-webview-huawei": "cross-env NODE_ENV=development UNI_PLATFORM=quickapp-webview-huawei vue-cli-service uni-build --watch",
|
||||||
"dev:quickapp-webview-union": "cross-env NODE_ENV=development UNI_PLATFORM=quickapp-webview-union vue-cli-service uni-build --watch",
|
"dev:quickapp-webview-union": "cross-env NODE_ENV=development UNI_PLATFORM=quickapp-webview-union vue-cli-service uni-build --watch",
|
||||||
"info": "node node_modules/@dcloudio/vue-cli-plugin-uni/commands/info.js",
|
"info": "node node_modules/@dcloudio/vue-cli-plugin-uni/commands/info.js",
|
||||||
|
"upload:apk": "node scripts/upload-apk.js",
|
||||||
"serve:quickapp-native": "node node_modules/@dcloudio/uni-quickapp-native/bin/serve.js",
|
"serve:quickapp-native": "node node_modules/@dcloudio/uni-quickapp-native/bin/serve.js",
|
||||||
"test:android": "cross-env UNI_PLATFORM=app-plus UNI_OS_NAME=android jest -i",
|
"test:android": "cross-env UNI_PLATFORM=app-plus UNI_OS_NAME=android jest -i",
|
||||||
"test:h5": "cross-env UNI_PLATFORM=h5 jest -i",
|
"test:h5": "cross-env UNI_PLATFORM=h5 jest -i",
|
||||||
|
|||||||
@@ -0,0 +1,293 @@
|
|||||||
|
/**
|
||||||
|
* 上传已打包的 PDA APK,等价于 ERP「开发者资源上传」里的安装包上传。
|
||||||
|
*
|
||||||
|
* 用法:
|
||||||
|
* npm run upload:apk -- --file D:\path\app.apk --target test
|
||||||
|
* npm run upload:apk -- --file D:\path\app.apk --target prod
|
||||||
|
* npm run upload:apk -- --file D:\path\app.apk --target test --mode zhisheng
|
||||||
|
*
|
||||||
|
* --target 只决定 APK 放到哪套 CDN:
|
||||||
|
* test 测试 CDN
|
||||||
|
* prod 正式 CDN
|
||||||
|
* 两者没有别的差别。生产环境的 PDA 也可以从测试 CDN 下载并安装。
|
||||||
|
*
|
||||||
|
* 版本号取 src/manifest.json 的 versionName。
|
||||||
|
* 场景值取对应 .env 的 VUE_APP_UPGRADE_NAME,拼成 /version/{upgradeName}/{version}.apk。
|
||||||
|
* 运行时输入 ERP 手机号和密码获取 token。多个账套时再选择一次。
|
||||||
|
*/
|
||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
|
const readline = require('readline');
|
||||||
|
|
||||||
|
const ROOT = path.resolve(__dirname, '..');
|
||||||
|
const LOCAL_CONFIG = path.join(__dirname, 'upload-apk.local.json');
|
||||||
|
const API_BASE_DEFAULT = 'https://hcscmtest.zzfzyc.com/hcscm_weave';
|
||||||
|
const UPYUN_API = 'https://v0.api.upyun.com';
|
||||||
|
const CDN_HOST = {
|
||||||
|
test: 'https://testhcscm.cdn.zzfzyc.com',
|
||||||
|
prod: 'https://hcscm.cdn.zzfzyc.com',
|
||||||
|
};
|
||||||
|
|
||||||
|
const MODE_ENV = {
|
||||||
|
zhoushang: '.env.zhoushang',
|
||||||
|
zhisheng: '.env.zhisheng',
|
||||||
|
mes: '.env.mes',
|
||||||
|
cjt: '.env.cjt',
|
||||||
|
};
|
||||||
|
|
||||||
|
function parseArgs(argv) {
|
||||||
|
const args = { mode: 'zhoushang' };
|
||||||
|
for (let i = 0; i < argv.length; i += 1) {
|
||||||
|
const key = argv[i];
|
||||||
|
const value = argv[i + 1];
|
||||||
|
if (key === '--file' || key === '--target' || key === '--mode' || key === '--version') {
|
||||||
|
args[key.slice(2)] = value;
|
||||||
|
i += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return args;
|
||||||
|
}
|
||||||
|
|
||||||
|
function readEnvValue(filePath, name) {
|
||||||
|
const text = fs.readFileSync(filePath, 'utf8');
|
||||||
|
const line = text.split(/\r?\n/).find((item) => item.trim().startsWith(`${name}`));
|
||||||
|
if (!line) return '';
|
||||||
|
const raw = line.slice(line.indexOf('=') + 1).trim();
|
||||||
|
return raw.replace(/^['"]|['"]$/g, '');
|
||||||
|
}
|
||||||
|
|
||||||
|
function readManifestVersion() {
|
||||||
|
const manifest = JSON.parse(fs.readFileSync(path.join(ROOT, 'src/manifest.json'), 'utf8'));
|
||||||
|
return String(manifest.versionName || '').trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
function loadApiBase() {
|
||||||
|
if (!fs.existsSync(LOCAL_CONFIG)) return API_BASE_DEFAULT;
|
||||||
|
const config = JSON.parse(fs.readFileSync(LOCAL_CONFIG, 'utf8'));
|
||||||
|
return String(config.apiBase || API_BASE_DEFAULT).replace(/\/+$/, '');
|
||||||
|
}
|
||||||
|
|
||||||
|
function ask(question) {
|
||||||
|
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
rl.question(question, (answer) => {
|
||||||
|
rl.close();
|
||||||
|
resolve(String(answer || '').trim());
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function askPassword(question) {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
const stdin = process.stdin;
|
||||||
|
const stdout = process.stdout;
|
||||||
|
if (!stdin.isTTY || typeof stdin.setRawMode !== 'function') {
|
||||||
|
ask(question).then(resolve);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
stdout.write(question);
|
||||||
|
stdin.setRawMode(true);
|
||||||
|
stdin.resume();
|
||||||
|
stdin.setEncoding('utf8');
|
||||||
|
let value = '';
|
||||||
|
const onData = (char) => {
|
||||||
|
switch (char) {
|
||||||
|
case '\n':
|
||||||
|
case '\r':
|
||||||
|
case '\u0004':
|
||||||
|
stdin.setRawMode(false);
|
||||||
|
stdin.pause();
|
||||||
|
stdin.removeListener('data', onData);
|
||||||
|
stdout.write('\n');
|
||||||
|
resolve(value);
|
||||||
|
break;
|
||||||
|
case '\u0003':
|
||||||
|
process.exit();
|
||||||
|
break;
|
||||||
|
case '\u007f':
|
||||||
|
case '\b':
|
||||||
|
value = value.slice(0, -1);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
value += char;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
stdin.on('data', onData);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function apiJson(apiBase, urlPath, { method = 'GET', token, body } = {}) {
|
||||||
|
const headers = { Platform: '1' };
|
||||||
|
if (token) headers.Authorization = token;
|
||||||
|
if (body) headers['Content-Type'] = 'application/json';
|
||||||
|
const res = await fetch(`${apiBase}${urlPath}`, {
|
||||||
|
method,
|
||||||
|
headers,
|
||||||
|
body: body ? JSON.stringify(body) : undefined,
|
||||||
|
});
|
||||||
|
const data = await res.json().catch(() => ({}));
|
||||||
|
if (!res.ok || data.code !== 0) {
|
||||||
|
throw new Error(data.msg || `请求失败(HTTP ${res.status})`);
|
||||||
|
}
|
||||||
|
return data.data || {};
|
||||||
|
}
|
||||||
|
|
||||||
|
async function login(apiBase) {
|
||||||
|
const phone = await ask('手机号: ');
|
||||||
|
const password = await askPassword('密码: ');
|
||||||
|
if (!phone || !password) {
|
||||||
|
throw new Error('请输入手机号和密码');
|
||||||
|
}
|
||||||
|
console.log('正在登录...');
|
||||||
|
const first = await apiJson(apiBase, '/admin/v1/login', {
|
||||||
|
method: 'POST',
|
||||||
|
body: { phone, password },
|
||||||
|
});
|
||||||
|
const tempToken = first.token;
|
||||||
|
if (!tempToken) throw new Error('登录未返回 token');
|
||||||
|
|
||||||
|
const dropdown = await apiJson(apiBase, '/admin/v1/tenantManagement/dropdownList', {
|
||||||
|
token: tempToken,
|
||||||
|
});
|
||||||
|
const tenants = dropdown.list || [];
|
||||||
|
if (!tenants.length) return tempToken;
|
||||||
|
|
||||||
|
let tenant = tenants[0];
|
||||||
|
if (tenants.length > 1) {
|
||||||
|
console.log('请选择账套:');
|
||||||
|
tenants.forEach((item, index) => {
|
||||||
|
const name = item.company_name || item.database_name || item.tenant_contacts || item.tenant_management_id;
|
||||||
|
console.log(` ${index + 1}. ${name}`);
|
||||||
|
});
|
||||||
|
const picked = Number(await ask('序号: '));
|
||||||
|
tenant = tenants[picked - 1];
|
||||||
|
if (!tenant) throw new Error('账套序号无效');
|
||||||
|
}
|
||||||
|
|
||||||
|
const second = await apiJson(apiBase, '/admin/v1/login', {
|
||||||
|
method: 'POST',
|
||||||
|
token: tempToken,
|
||||||
|
body: {
|
||||||
|
token: tempToken,
|
||||||
|
tenant_management_id: tenant.tenant_management_id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
if (!second.token) throw new Error('选择账套后未返回 token');
|
||||||
|
return second.token;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getCdnSign({ apiBase, token, saveKey, status }) {
|
||||||
|
const url = new URL(`${apiBase}/admin/v1/cdn/token`);
|
||||||
|
url.searchParams.set('method', 'post');
|
||||||
|
url.searchParams.set('save_key', saveKey);
|
||||||
|
url.searchParams.set('status', String(status));
|
||||||
|
const res = await fetch(url, {
|
||||||
|
headers: {
|
||||||
|
Authorization: token,
|
||||||
|
Platform: '1',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const body = await res.json();
|
||||||
|
if (!res.ok || body.code !== 0) {
|
||||||
|
throw new Error(body.msg || `获取签名失败(HTTP ${res.status})`);
|
||||||
|
}
|
||||||
|
return body.data || {};
|
||||||
|
}
|
||||||
|
|
||||||
|
async function uploadToUpyun({ bucket, authorization, policy, filePath, fileName }) {
|
||||||
|
const buf = fs.readFileSync(filePath);
|
||||||
|
const form = new FormData();
|
||||||
|
form.append('authorization', authorization);
|
||||||
|
form.append('policy', policy);
|
||||||
|
form.append('file', new Blob([buf], { type: 'application/vnd.android.package-archive' }), fileName);
|
||||||
|
const res = await fetch(`${UPYUN_API}/${bucket}`, {
|
||||||
|
method: 'POST',
|
||||||
|
body: form,
|
||||||
|
});
|
||||||
|
const text = await res.text();
|
||||||
|
let body = {};
|
||||||
|
try {
|
||||||
|
body = JSON.parse(text);
|
||||||
|
} catch (e) {
|
||||||
|
body = { raw: text };
|
||||||
|
}
|
||||||
|
if (!res.ok || (body.code != null && Number(body.code) !== 200)) {
|
||||||
|
throw new Error(body.message || body.msg || body.raw || `上传失败(HTTP ${res.status})`);
|
||||||
|
}
|
||||||
|
return body;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function main() {
|
||||||
|
const args = parseArgs(process.argv.slice(2));
|
||||||
|
if (!args.file || !args.target) {
|
||||||
|
console.error('用法: npm run upload:apk -- --file <apk路径> --target test|prod [--mode zhoushang]');
|
||||||
|
console.error('--target 只切换 APK 的 CDN:test 测试 CDN,prod 正式 CDN。生产环境也可以从测试 CDN 下载安装。');
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
if (args.target !== 'test' && args.target !== 'prod') {
|
||||||
|
console.error('--target 只能是 test 或 prod。两者只是 APK 的 CDN 环境不同,生产环境也可以从测试 CDN 下载安装。');
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
const envFile = MODE_ENV[args.mode];
|
||||||
|
if (!envFile) {
|
||||||
|
console.error(`不支持的 --mode:${args.mode},可选 zhoushang、zhisheng、mes、cjt`);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
const apkPath = path.resolve(args.file);
|
||||||
|
if (!fs.existsSync(apkPath)) {
|
||||||
|
console.error(`找不到 APK:${apkPath}`);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
const version = args.version || readManifestVersion();
|
||||||
|
if (!version) {
|
||||||
|
console.error('manifest.json 里没有 versionName');
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
const upgradeName = readEnvValue(path.join(ROOT, envFile), 'VUE_APP_UPGRADE_NAME');
|
||||||
|
if (!upgradeName) {
|
||||||
|
console.error(`${envFile} 里没有 VUE_APP_UPGRADE_NAME`);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
const status = args.target === 'prod' ? 2 : 1;
|
||||||
|
const fileName = `${version}.apk`;
|
||||||
|
const saveKey = `/version/${upgradeName}/${fileName}`;
|
||||||
|
const apiBase = loadApiBase();
|
||||||
|
const token = await login(apiBase);
|
||||||
|
|
||||||
|
console.log(`版本号: ${version}`);
|
||||||
|
console.log(`场景路径: ${saveKey}`);
|
||||||
|
const cdnLabel = args.target === 'prod' ? '正式 CDN' : '测试 CDN';
|
||||||
|
console.log(`CDN: ${cdnLabel}(只影响下载地址,生产环境也可以从测试 CDN 安装)`);
|
||||||
|
console.log('正在获取签名...');
|
||||||
|
const sign = await getCdnSign({
|
||||||
|
apiBase,
|
||||||
|
token,
|
||||||
|
saveKey,
|
||||||
|
status,
|
||||||
|
});
|
||||||
|
if (!sign.bucket || !sign.authorization || !sign.policy) {
|
||||||
|
throw new Error('签名返回缺少 bucket、authorization 或 policy');
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('正在上传 APK...');
|
||||||
|
const uploaded = await uploadToUpyun({
|
||||||
|
bucket: sign.bucket,
|
||||||
|
authorization: sign.authorization,
|
||||||
|
policy: sign.policy,
|
||||||
|
filePath: apkPath,
|
||||||
|
fileName,
|
||||||
|
});
|
||||||
|
console.log('上传成功');
|
||||||
|
const pathUrl = uploaded.url && String(uploaded.url).startsWith('http')
|
||||||
|
? uploaded.url
|
||||||
|
: `${CDN_HOST[args.target]}${saveKey}`;
|
||||||
|
console.log(pathUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
main().catch((error) => {
|
||||||
|
console.error(error.message || error);
|
||||||
|
process.exit(1);
|
||||||
|
});
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"apiBase": "https://hcscmtest.zzfzyc.com/hcscm_weave"
|
||||||
|
}
|
||||||
@@ -26,14 +26,16 @@ const config = {
|
|||||||
// 开发环境API URL选项(仅替换 //域名/ 后第一个路径段 hcscm → hcscm_weave,不改域名)
|
// 开发环境API URL选项(仅替换 //域名/ 后第一个路径段 hcscm → hcscm_weave,不改域名)
|
||||||
devApiUrlOptions: [
|
devApiUrlOptions: [
|
||||||
{ label: '测试环境', value: 'https://hcscmtest.zzfzyc.com/hcscm_weave/pda/v1' },
|
{ label: '测试环境', value: 'https://hcscmtest.zzfzyc.com/hcscm_weave/pda/v1' },
|
||||||
|
{ label: '正式环境', value: process.env.VUE_APP_DEV_API_URL || process.env.VUE_APP_PRODUCTION_API_URL || 'https://www.haotopai.com/hcscm_weave/mes/server/pda/v1' },
|
||||||
{ label: '本地环境', value: 'http://192.168.1.66:7010/hcscm_weave/pda/v1' },
|
{ label: '本地环境', value: 'http://192.168.1.66:7010/hcscm_weave/pda/v1' },
|
||||||
{ label: '正式环境', value: process.env.VUE_APP_DEV_API_URL || 'https://www.haotopai.com/hcscm_weave/mes/server/pda/v1' },
|
|
||||||
{ label: '自定义', value: 'custom' }
|
{ label: '自定义', value: 'custom' }
|
||||||
]
|
]
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 设置后台接口服务的基础地址 - 使用动态API URL
|
export function getTestApiUrl() {
|
||||||
// config.baseUrl = 'https://aidex.vip/api'; // 注释掉固定的baseUrl
|
const test = config.devApiUrlOptions.find(item => item.label === '测试环境');
|
||||||
|
return (test && test.value) || 'https://hcscmtest.zzfzyc.com/hcscm_weave/pda/v1';
|
||||||
|
}
|
||||||
|
|
||||||
export default config;
|
export default config;
|
||||||
|
|||||||
@@ -46,6 +46,12 @@ const install = (Vue, vm) => {
|
|||||||
detailList: (params = {}) => vm.$u.get(gfmWarehouseUrl('getGfmWarehouseList'), params),
|
detailList: (params = {}) => vm.$u.get(gfmWarehouseUrl('getGfmWarehouseList'), params),
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// PDA 生产进仓(排产单细码扫码进仓)
|
||||||
|
productionScheduleOrder: {
|
||||||
|
getScanFineCodeDetail: (params = {}) => vm.$u.get('/produce/productionScheduleOrder/getScanFineCodeDetail', params),
|
||||||
|
scanInWarehouseFineCode: (params = {}) => vm.$u.putJson('/produce/productionScheduleOrder/scanInWarehouseFineCode', params),
|
||||||
|
},
|
||||||
|
|
||||||
// 营销体系下拉(路径相对 apiurl:.../pda/v1/saleSystem/getSaleSystemDropdownList)
|
// 营销体系下拉(路径相对 apiurl:.../pda/v1/saleSystem/getSaleSystemDropdownList)
|
||||||
saleSystem: {
|
saleSystem: {
|
||||||
getDropdownList: (params = {}) => vm.$u.get('/saleSystem/getSaleSystemDropdownList', params),
|
getDropdownList: (params = {}) => vm.$u.get('/saleSystem/getSaleSystemDropdownList', params),
|
||||||
@@ -56,6 +62,11 @@ const install = (Vue, vm) => {
|
|||||||
list: (params = {}) => vm.$u.get('/business_unit/list', params),
|
list: (params = {}) => vm.$u.get('/business_unit/list', params),
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 员工枚举(路径相对 apiurl:.../pda/v1/employee/list_enum)
|
||||||
|
employee: {
|
||||||
|
listEnum: (params = {}) => vm.$u.get('/employee/list_enum', params),
|
||||||
|
},
|
||||||
|
|
||||||
// 字典明细枚举(路径相对 apiurl:.../pda/v1/dictionaryDetail/getDictionaryDetailEnumList)
|
// 字典明细枚举(路径相对 apiurl:.../pda/v1/dictionaryDetail/getDictionaryDetailEnumList)
|
||||||
dictionary: {
|
dictionary: {
|
||||||
getDetailEnumList: (params = {}) => vm.$u.get('/dictionaryDetail/getDictionaryDetailEnumList', params),
|
getDetailEnumList: (params = {}) => vm.$u.get('/dictionaryDetail/getDictionaryDetailEnumList', params),
|
||||||
|
|||||||
@@ -25,6 +25,10 @@ const install = (Vue, vm) => {
|
|||||||
console.log('request', req);
|
console.log('request', req);
|
||||||
console.log('baseUrl', vm.$store.state.apiurl);
|
console.log('baseUrl', vm.$store.state.apiurl);
|
||||||
console.log('完整URL', vm.$store.state.apiurl + req.url);
|
console.log('完整URL', vm.$store.state.apiurl + req.url);
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
// Android 5.x 等老 PDA 不信任 Let's Encrypt 新证书链,关闭校验证书
|
||||||
|
req.sslVerify = false;
|
||||||
|
// #endif
|
||||||
if (!req.header){
|
if (!req.header){
|
||||||
req.header = [];
|
req.header = [];
|
||||||
}
|
}
|
||||||
@@ -70,8 +74,12 @@ const install = (Vue, vm) => {
|
|||||||
}
|
}
|
||||||
console.log('res',res)
|
console.log('res',res)
|
||||||
if (!(res.data)){
|
if (!(res.data)){
|
||||||
vm.$u.toast('未连接到服务器')
|
const errMsg = String((res && res.errMsg) || '');
|
||||||
return Promise.reject(new Error('未连接到服务器'));
|
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));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(res.data.code !== 0) {
|
if(res.data.code !== 0) {
|
||||||
@@ -159,6 +167,9 @@ const install = (Vue, vm) => {
|
|||||||
uni.request({
|
uni.request({
|
||||||
url,
|
url,
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
sslVerify: false,
|
||||||
|
// #endif
|
||||||
header: {
|
header: {
|
||||||
...header,
|
...header,
|
||||||
'Platform': 2,
|
'Platform': 2,
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
/**
|
||||||
|
* PDA 小屏字号标准(以手动进仓页为准)
|
||||||
|
* 业务页请优先引用这些变量,避免字号再次变小。
|
||||||
|
*/
|
||||||
|
|
||||||
|
$pda-font-body: 36rpx;
|
||||||
|
$pda-font-placeholder: 34rpx;
|
||||||
|
$pda-font-action: 34rpx;
|
||||||
|
$pda-font-unit: 32rpx;
|
||||||
|
$pda-font-nav-sub: 32rpx;
|
||||||
|
$pda-font-button: 36rpx;
|
||||||
|
$pda-font-popup-title: 36rpx;
|
||||||
|
$pda-font-popup-item: 36rpx;
|
||||||
|
$pda-font-popup-sub: 34rpx;
|
||||||
|
|
||||||
|
$pda-row-min-height: 100rpx;
|
||||||
|
$pda-scan-input-height: 100rpx;
|
||||||
|
$pda-button-height: 92rpx;
|
||||||
|
$pda-label-width: 200rpx;
|
||||||
@@ -4,6 +4,9 @@ export const DICTIONARY_TYPE_SCANNER = 10046;
|
|||||||
|
|
||||||
export const PHONE_SCAN_BRAND = 'phone';
|
export const PHONE_SCAN_BRAND = 'phone';
|
||||||
|
|
||||||
|
// 历史误用 brand=newland 表示东集;真正的新大陆是 nlscan
|
||||||
|
const LEGACY_SEUIC_BRANDS = ['newland', '东集', 'idata'];
|
||||||
|
|
||||||
export const PHONE_SCAN_CONFIG = {
|
export const PHONE_SCAN_CONFIG = {
|
||||||
brand: PHONE_SCAN_BRAND,
|
brand: PHONE_SCAN_BRAND,
|
||||||
name: '手机扫码',
|
name: '手机扫码',
|
||||||
@@ -16,6 +19,28 @@ export function isPhoneScanConfig(config) {
|
|||||||
return !!(config && (config.isPhoneScan || config.brand === PHONE_SCAN_BRAND));
|
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 = []) {
|
function enrichFromBuiltinConfig(config, builtinConfigs = []) {
|
||||||
if (!config || !builtinConfigs.length) {
|
if (!config || !builtinConfigs.length) {
|
||||||
return config;
|
return config;
|
||||||
@@ -24,7 +49,13 @@ function enrichFromBuiltinConfig(config, builtinConfigs = []) {
|
|||||||
const builtin = builtinConfigs.find((item) => {
|
const builtin = builtinConfigs.find((item) => {
|
||||||
return item.action === config.action
|
return item.action === config.action
|
||||||
|| item.name === config.name
|
|| 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) {
|
if (!builtin) {
|
||||||
@@ -49,7 +80,7 @@ export function normalizeConfig(raw, builtinConfigs = []) {
|
|||||||
return { ...PHONE_SCAN_CONFIG };
|
return { ...PHONE_SCAN_CONFIG };
|
||||||
}
|
}
|
||||||
|
|
||||||
const config = enrichFromBuiltinConfig({
|
let config = {
|
||||||
brand,
|
brand,
|
||||||
name: raw.name || '',
|
name: raw.name || '',
|
||||||
action: raw.action || raw.code || '',
|
action: raw.action || raw.code || '',
|
||||||
@@ -57,7 +88,10 @@ export function normalizeConfig(raw, builtinConfigs = []) {
|
|||||||
needSetup: raw.needSetup != null ? raw.needSetup : !!raw.need_setup,
|
needSetup: raw.needSetup != null ? raw.needSetup : !!raw.need_setup,
|
||||||
setupAction: raw.setupAction || raw.setup_action || '',
|
setupAction: raw.setupAction || raw.setup_action || '',
|
||||||
setupParams: raw.setupParams || raw.setup_params || null,
|
setupParams: raw.setupParams || raw.setup_params || null,
|
||||||
}, builtinConfigs);
|
};
|
||||||
|
|
||||||
|
config = migrateLegacySeuicBrand(config);
|
||||||
|
config = enrichFromBuiltinConfig(config, builtinConfigs);
|
||||||
|
|
||||||
if (!config.brand || !config.action || !config.dataKey) {
|
if (!config.brand || !config.action || !config.dataKey) {
|
||||||
return null;
|
return null;
|
||||||
@@ -73,7 +107,16 @@ export function mapDictionaryToScannerConfig(raw, builtinConfigs = []) {
|
|||||||
export function getScanConfig(builtinConfigs = []) {
|
export function getScanConfig(builtinConfigs = []) {
|
||||||
try {
|
try {
|
||||||
const data = uni.getStorageSync(STORAGE_KEY);
|
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) {
|
} catch (e) {
|
||||||
console.log('读取扫码枪配置失败', e);
|
console.log('读取扫码枪配置失败', e);
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
+24
-5
@@ -10,7 +10,8 @@ import {
|
|||||||
} from '@/common/scanConfig.js';
|
} from '@/common/scanConfig.js';
|
||||||
|
|
||||||
const PDA_DEVICE_KEYWORDS = [
|
const PDA_DEVICE_KEYWORDS = [
|
||||||
'newland', 'nls', 'sunmi', 'urovo', 'zebra', 'honeywell', 'idata', 'seuic',
|
'newland', 'nls', 'nlscan', 'sunmi', 'urovo', 'zebra', 'honeywell',
|
||||||
|
'idata', 'seuic', 'autoid', '东集', '东大',
|
||||||
];
|
];
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -29,16 +30,18 @@ export default {
|
|||||||
getScannerConfigs() {
|
getScannerConfigs() {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
brand: 'newland',
|
// 东大集成 SEUIC / AUTOID 系列(如 AUTOID9),勿与新大陆 nlscan 混淆
|
||||||
name: '东集',
|
brand: 'seuic',
|
||||||
|
name: '东大集成(AUTOID)',
|
||||||
action: 'com.android.server.scannerservice.broadcast',
|
action: 'com.android.server.scannerservice.broadcast',
|
||||||
dataKey: 'scannerdata',
|
dataKey: 'scannerdata',
|
||||||
needSetup: true,
|
needSetup: true,
|
||||||
setupAction: 'com.android.scanner.service_settings',
|
setupAction: 'com.android.scanner.service_settings',
|
||||||
setupParams: {
|
setupParams: {
|
||||||
|
barcode_send_mode: 'BROADCAST',
|
||||||
action_barcode_broadcast: 'com.android.server.scannerservice.broadcast',
|
action_barcode_broadcast: 'com.android.server.scannerservice.broadcast',
|
||||||
key_barcode_broadcast: 'scannerdata',
|
key_barcode_broadcast: 'scannerdata',
|
||||||
endchar: 'ENTER'
|
endchar: 'NONE'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -48,6 +51,21 @@ export default {
|
|||||||
dataKey: 'data',
|
dataKey: 'data',
|
||||||
needSetup: false
|
needSetup: false
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
brand: 'urovo',
|
||||||
|
name: '优博讯',
|
||||||
|
action: 'android.intent.ACTION_DECODE_DATA',
|
||||||
|
dataKey: 'barcode_string',
|
||||||
|
needSetup: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// 新大陆 Newland,广播为 nlscan.action.SCANNER_RESULT
|
||||||
|
brand: 'nlscan',
|
||||||
|
name: '新大陆',
|
||||||
|
action: 'nlscan.action.SCANNER_RESULT',
|
||||||
|
dataKey: 'SCAN_BARCODE1',
|
||||||
|
needSetup: false
|
||||||
|
},
|
||||||
{ ...PHONE_SCAN_CONFIG },
|
{ ...PHONE_SCAN_CONFIG },
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
@@ -267,7 +285,8 @@ export default {
|
|||||||
if (!self.isPageActive) return;
|
if (!self.isPageActive) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
plus.android.importClass('android.content.Intent');
|
// 广播回调里的 intent 需要按实例导入,否则 getStringExtra 不可用
|
||||||
|
plus.android.importClass(intent);
|
||||||
const scanResult = intent.getStringExtra(config.dataKey);
|
const scanResult = intent.getStringExtra(config.dataKey);
|
||||||
|
|
||||||
console.log(`${config.name}扫码结果:`, scanResult);
|
console.log(`${config.name}扫码结果:`, scanResult);
|
||||||
|
|||||||
@@ -61,6 +61,12 @@ export const STATUS_ACTION_CONFIG = {
|
|||||||
unapprove: { status: AUDIT_STATUS.PENDING, msg: '确认消审该单据?', apiKey: 'statusWait' },
|
unapprove: { status: AUDIT_STATUS.PENDING, msg: '确认消审该单据?', apiKey: 'statusWait' },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** 审核 / 作废成功后播放的语音文案 */
|
||||||
|
export const STATUS_ACTION_VOICE = {
|
||||||
|
approve: '审核成功',
|
||||||
|
void: '作废成功',
|
||||||
|
};
|
||||||
|
|
||||||
// 出仓类型:当前后端仅提供「坯布其他出货单」一种类型的接口
|
// 出仓类型:当前后端仅提供「坯布其他出货单」一种类型的接口
|
||||||
export const BILL_TYPES = [
|
export const BILL_TYPES = [
|
||||||
{ value: 'other', label: '坯布其他出货单' },
|
{ value: 'other', label: '坯布其他出货单' },
|
||||||
@@ -69,8 +75,8 @@ export const BILL_TYPES = [
|
|||||||
/** 列表分页拉取每页条数 */
|
/** 列表分页拉取每页条数 */
|
||||||
export const LIST_PAGE_SIZE = 100;
|
export const LIST_PAGE_SIZE = 100;
|
||||||
|
|
||||||
/** 往来单位类型:织厂(接收单位下拉筛选) */
|
/** 往来单位类型:染厂(接收单位下拉筛选) */
|
||||||
export const BUSINESS_UNIT_TYPE_KNITTING_FACTORY = 11;
|
export const BUSINESS_UNIT_TYPE_DYEING_FACTORY = 12;
|
||||||
|
|
||||||
export function getStatusOptions() {
|
export function getStatusOptions() {
|
||||||
return Object.keys(AUDIT_STATUS_MAP).map((value) => ({
|
return Object.keys(AUDIT_STATUS_MAP).map((value) => ({
|
||||||
@@ -147,17 +153,7 @@ export function normalizeOrder(order) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 扫码详情区表格列 */
|
/** 扫码详情区汇总维度(勾选后随扫码请求把对应 lock 字段传给后端) */
|
||||||
export const SCAN_DETAIL_TABLE_COLUMNS = [
|
|
||||||
{ label: '坯布编号', key: 'grey_fabric_code', width: 140 },
|
|
||||||
{ label: '坯布名称', key: 'grey_fabric_name', width: 140 },
|
|
||||||
{ label: '纱批', key: 'yarn_batch', width: 120 },
|
|
||||||
{ label: '机号', key: 'machine_number', width: 100 },
|
|
||||||
{ label: '条数', key: 'roll', width: 80 },
|
|
||||||
{ label: '重量', key: 'weight', width: 100 },
|
|
||||||
];
|
|
||||||
|
|
||||||
/** 扫码详情区汇总维度(勾选后参与表格分组;带 lock 的维度会随扫码请求传给后端) */
|
|
||||||
export const SCAN_GROUP_OPTIONS = [
|
export const SCAN_GROUP_OPTIONS = [
|
||||||
{ key: 'produce_order_no', label: '合同' },
|
{ key: 'produce_order_no', label: '合同' },
|
||||||
{ key: 'grey_fabric_code', label: '布编' },
|
{ key: 'grey_fabric_code', label: '布编' },
|
||||||
@@ -300,56 +296,6 @@ export function buildScanDetailFromContext(context, order) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function aggregateScanTableRows(rows, keys) {
|
|
||||||
const map = new Map();
|
|
||||||
rows.forEach((row) => {
|
|
||||||
const groupId = keys.map((k) => row[k] || '').join('|');
|
|
||||||
const existing = map.get(groupId);
|
|
||||||
if (!existing) {
|
|
||||||
map.set(groupId, { ...row, roll: 0, raw_weight: 0 });
|
|
||||||
}
|
|
||||||
const agg = map.get(groupId);
|
|
||||||
agg.roll = Number((agg.roll + Number(row.roll || 0)).toFixed(2));
|
|
||||||
agg.raw_weight = Number(agg.raw_weight || 0) + Number(row.raw_weight || 0);
|
|
||||||
});
|
|
||||||
return Array.from(map.values()).map((row) => ({
|
|
||||||
...row,
|
|
||||||
weight: formatWeightKg(row.raw_weight),
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 构建扫码详情区汇总表格数据 */
|
|
||||||
export function buildScanDetailTableRows(itemData, groupKeys = []) {
|
|
||||||
const rows = [];
|
|
||||||
(itemData || []).forEach((item) => {
|
|
||||||
(item.fine_codes || []).forEach((fc) => {
|
|
||||||
rows.push({
|
|
||||||
customer_name: item.customer_name || '',
|
|
||||||
produce_order_no: item.produce_order_no || item.contract_no || '',
|
|
||||||
grey_fabric_code: item.grey_fabric_code || '',
|
|
||||||
grey_fabric_name: item.grey_fabric_name || '',
|
|
||||||
yarn_batch: item.yarn_batch || '',
|
|
||||||
machine_number: item.machine_number || '',
|
|
||||||
volume_number: fc.roll_no || fc.fabric_piece_code || '',
|
|
||||||
grey_fabric_level_name: item.grey_fabric_level_name || '',
|
|
||||||
roll: fc.roll || 0,
|
|
||||||
raw_weight: fc.raw_weight != null ? fc.raw_weight : 0,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
if (!rows.length) return [];
|
|
||||||
const keys = (groupKeys || []).filter(Boolean);
|
|
||||||
if (!keys.length) {
|
|
||||||
return aggregateScanTableRows(rows, ['grey_fabric_code', 'grey_fabric_name', 'yarn_batch', 'machine_number']);
|
|
||||||
}
|
|
||||||
return aggregateScanTableRows(rows, keys);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getScanDetailTableWidth(columns) {
|
|
||||||
const total = (columns || []).reduce((sum, col) => sum + (col.width || 120), 0);
|
|
||||||
return `${total}rpx`;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function normalizeItem(item) {
|
export function normalizeItem(item) {
|
||||||
const machineStockRaw = item.machine_stock_roll ?? item.machine_stock ?? item.machine_inventory_roll;
|
const machineStockRaw = item.machine_stock_roll ?? item.machine_stock ?? item.machine_inventory_roll;
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -23,6 +23,9 @@ export function request(options) {
|
|||||||
url: apiurl + options.url,
|
url: apiurl + options.url,
|
||||||
method: options.method || 'GET',
|
method: options.method || 'GET',
|
||||||
data: options.data,
|
data: options.data,
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
sslVerify: false,
|
||||||
|
// #endif
|
||||||
header: {
|
header: {
|
||||||
'Platform': 2,
|
'Platform': 2,
|
||||||
'Authorization': token,
|
'Authorization': token,
|
||||||
@@ -363,6 +366,58 @@ function playErrorAudio() {
|
|||||||
errorAudio.play();
|
errorAudio.play();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 固定中文提示语音
|
||||||
|
const SPEAK_AUDIO = {
|
||||||
|
'扫码出仓成功': '/static/audio/scan_out_ok.mp3',
|
||||||
|
'删除成功': '/static/audio/delete_ok.mp3',
|
||||||
|
'提交成功': '/static/audio/submit_ok.mp3',
|
||||||
|
'审核成功': '/static/audio/audit_ok.mp3',
|
||||||
|
'作废成功': '/static/audio/void_ok.mp3',
|
||||||
|
'扫码成功': '/static/audio/scan_ok.wav',
|
||||||
|
'进仓成功': '/static/audio/in_ok.wav',
|
||||||
|
};
|
||||||
|
|
||||||
|
const speakAudioMap = {};
|
||||||
|
|
||||||
|
function stopOtherSpeak(exceptText) {
|
||||||
|
Object.keys(speakAudioMap).forEach((key) => {
|
||||||
|
if (key === exceptText || !speakAudioMap[key]) return;
|
||||||
|
try {
|
||||||
|
speakAudioMap[key].stop();
|
||||||
|
} catch (e) {}
|
||||||
|
});
|
||||||
|
if (successAudio) {
|
||||||
|
try {
|
||||||
|
successAudio.stop();
|
||||||
|
} catch (e) {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function playSpeak(text) {
|
||||||
|
const src = SPEAK_AUDIO[text];
|
||||||
|
if (!src) return;
|
||||||
|
stopOtherSpeak(text);
|
||||||
|
const prev = speakAudioMap[text];
|
||||||
|
if (prev) {
|
||||||
|
try {
|
||||||
|
prev.stop();
|
||||||
|
prev.destroy();
|
||||||
|
} catch (e) {}
|
||||||
|
speakAudioMap[text] = undefined;
|
||||||
|
}
|
||||||
|
const audio = uni.createInnerAudioContext();
|
||||||
|
audio.autoplay = true;
|
||||||
|
audio.src = src;
|
||||||
|
audio.onError((res) => {
|
||||||
|
console.log('语音播放失败', text, res && res.errMsg);
|
||||||
|
try {
|
||||||
|
audio.destroy();
|
||||||
|
} catch (e) {}
|
||||||
|
if (speakAudioMap[text] === audio) speakAudioMap[text] = undefined;
|
||||||
|
});
|
||||||
|
speakAudioMap[text] = audio;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
get apiurl() {
|
get apiurl() {
|
||||||
@@ -375,4 +430,5 @@ export default {
|
|||||||
parGetData,
|
parGetData,
|
||||||
playSuccessAudio,
|
playSuccessAudio,
|
||||||
playErrorAudio,
|
playErrorAudio,
|
||||||
|
playSpeak,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<view class="fabric-out-sectionTitle">{{ title }}</view>
|
<view v-if="title" class="fabric-out-sectionTitle">{{ title }}</view>
|
||||||
<slot name="before-list" />
|
<slot name="before-list" />
|
||||||
<view class="fabric-out-detailList">
|
<view class="fabric-out-detailList">
|
||||||
<view
|
<view
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
list: { type: Array, default: () => [] },
|
list: { type: Array, default: () => [] },
|
||||||
title: { type: String, default: '出仓细码' },
|
title: { type: String, default: '' },
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
v-if="showPhoneScan"
|
v-if="showPhoneScan"
|
||||||
class="fabric-out-phoneScanIcon"
|
class="fabric-out-phoneScanIcon"
|
||||||
name="scan"
|
name="scan"
|
||||||
size="44"
|
size="80"
|
||||||
color="#2979ff"
|
color="#2979ff"
|
||||||
@click="$emit('phone-scan')"
|
@click="$emit('phone-scan')"
|
||||||
/>
|
/>
|
||||||
@@ -46,7 +46,8 @@ export default {
|
|||||||
@import '@/pages/storefabric/storeFabricBusinessOutPage.scss';
|
@import '@/pages/storefabric/storeFabricBusinessOutPage.scss';
|
||||||
|
|
||||||
.fabric-out-phoneScanIcon {
|
.fabric-out-phoneScanIcon {
|
||||||
margin-left: 16rpx;
|
margin-left: 8rpx;
|
||||||
|
padding: 10rpx 16rpx;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -12,12 +12,14 @@
|
|||||||
<text class="fabric-out-scanDetailLabel">客户:</text>
|
<text class="fabric-out-scanDetailLabel">客户:</text>
|
||||||
<text class="fabric-out-scanDetailValue">{{ detail.customer_name || '' }}</text>
|
<text class="fabric-out-scanDetailValue">{{ detail.customer_name || '' }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="fabric-out-scanDetailRow fabric-out-scanDetailRow--2col">
|
<view class="fabric-out-scanDetailRow">
|
||||||
<view class="fabric-out-scanDetailCheck" @click="toggleGroup('produce_order_no')">
|
<view class="fabric-out-scanDetailCheck" @click="toggleGroup('produce_order_no')">
|
||||||
<checkbox :checked="isGroupChecked('produce_order_no')" />
|
<checkbox :checked="isGroupChecked('produce_order_no')" />
|
||||||
<text class="fabric-out-scanDetailLabel">生产通知单:</text>
|
<text class="fabric-out-scanDetailLabel">生产通知单:</text>
|
||||||
<text class="fabric-out-scanDetailValue">{{ detail.produce_order_no || '' }}</text>
|
<text class="fabric-out-scanDetailValue">{{ detail.produce_order_no || '' }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="fabric-out-scanDetailRow">
|
||||||
<view class="fabric-out-scanDetailCheck" @click="toggleGroup('grey_fabric_code')">
|
<view class="fabric-out-scanDetailCheck" @click="toggleGroup('grey_fabric_code')">
|
||||||
<checkbox :checked="isGroupChecked('grey_fabric_code')" />
|
<checkbox :checked="isGroupChecked('grey_fabric_code')" />
|
||||||
<text class="fabric-out-scanDetailLabel">布编:</text>
|
<text class="fabric-out-scanDetailLabel">布编:</text>
|
||||||
@@ -58,67 +60,16 @@
|
|||||||
<text class="fabric-out-scanDetailValue">{{ formatWeight(detail.weight) }}Kg</text>
|
<text class="fabric-out-scanDetailValue">{{ formatWeight(detail.weight) }}Kg</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<scroll-view scroll-x class="fabric-out-scanDetailTableScroll">
|
|
||||||
<view class="fabric-out-scanDetailTable" :style="{ width: tableWidth }">
|
|
||||||
<view class="fabric-out-scanDetailTableRow fabric-out-scanDetailTableHead">
|
|
||||||
<view
|
|
||||||
v-for="col in columns"
|
|
||||||
:key="col.key"
|
|
||||||
class="fabric-out-scanDetailTableCell"
|
|
||||||
:style="cellStyle(col)"
|
|
||||||
>{{ col.label }}</view>
|
|
||||||
</view>
|
|
||||||
<view v-if="!tableRows.length" class="fabric-out-scanDetailEmpty">暂无数据~~</view>
|
|
||||||
<view
|
|
||||||
v-for="(row, rowIndex) in tableRows"
|
|
||||||
:key="rowIndex"
|
|
||||||
class="fabric-out-scanDetailTableRow"
|
|
||||||
>
|
|
||||||
<view
|
|
||||||
v-for="col in columns"
|
|
||||||
:key="col.key"
|
|
||||||
class="fabric-out-scanDetailTableCell"
|
|
||||||
:style="cellStyle(col)"
|
|
||||||
>{{ formatCell(row, col.key) }}</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</scroll-view>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
|
||||||
SCAN_DETAIL_TABLE_COLUMNS,
|
|
||||||
getScanDetailTableWidth,
|
|
||||||
buildScanDetailTableRows,
|
|
||||||
} from '@/common/storeFabricBusinessOut';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
detail: { type: Object, default: () => ({}) },
|
detail: { type: Object, default: () => ({}) },
|
||||||
itemData: { type: Array, default: () => [] },
|
|
||||||
groupKeys: { type: Array, default: () => [] },
|
groupKeys: { type: Array, default: () => [] },
|
||||||
},
|
},
|
||||||
computed: {
|
|
||||||
columns() {
|
|
||||||
return SCAN_DETAIL_TABLE_COLUMNS;
|
|
||||||
},
|
|
||||||
tableWidth() {
|
|
||||||
return getScanDetailTableWidth(this.columns);
|
|
||||||
},
|
|
||||||
tableRows() {
|
|
||||||
return buildScanDetailTableRows(this.itemData, this.groupKeys);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
cellStyle(col) {
|
|
||||||
return {
|
|
||||||
width: `${col.width}rpx`,
|
|
||||||
minWidth: `${col.width}rpx`,
|
|
||||||
maxWidth: `${col.width}rpx`,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
isGroupChecked(key) {
|
isGroupChecked(key) {
|
||||||
return (this.groupKeys || []).includes(key);
|
return (this.groupKeys || []).includes(key);
|
||||||
},
|
},
|
||||||
@@ -140,11 +91,6 @@ export default {
|
|||||||
const n = Number(value || 0);
|
const n = Number(value || 0);
|
||||||
return Number(n.toFixed(2));
|
return Number(n.toFixed(2));
|
||||||
},
|
},
|
||||||
formatCell(row, key) {
|
|
||||||
if (key === 'roll') return this.formatRoll(row.roll);
|
|
||||||
if (key === 'weight') return this.formatWeight(row.weight);
|
|
||||||
return row[key] || '';
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -32,11 +32,11 @@ export default {
|
|||||||
border-bottom: 1rpx solid #f5f5f5;
|
border-bottom: 1rpx solid #f5f5f5;
|
||||||
}
|
}
|
||||||
.statusLabel {
|
.statusLabel {
|
||||||
font-size: 28rpx;
|
font-size: 40rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
.statusTag {
|
.statusTag {
|
||||||
font-size: 24rpx;
|
font-size: 34rpx;
|
||||||
padding: 4rpx 12rpx;
|
padding: 4rpx 12rpx;
|
||||||
border-radius: 6rpx;
|
border-radius: 6rpx;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
|
|||||||
@@ -0,0 +1,134 @@
|
|||||||
|
<template>
|
||||||
|
<u-popup v-model="visible" mode="bottom" :safe-area-inset-bottom="true" border-radius="16">
|
||||||
|
<view class="search-select" :style="{ maxHeight: panelMaxHeight + 'px' }">
|
||||||
|
<view class="search-select__bar">
|
||||||
|
<text class="search-select__title">{{ title }}</text>
|
||||||
|
<text class="search-select__cancel" @click="visible = false">取消</text>
|
||||||
|
</view>
|
||||||
|
<view class="search-select__search">
|
||||||
|
<u-search v-model="keyword" :placeholder="placeholder" :show-action="false" />
|
||||||
|
</view>
|
||||||
|
<scroll-view
|
||||||
|
scroll-y
|
||||||
|
class="search-select__list"
|
||||||
|
:style="{ height: listHeight + 'px' }"
|
||||||
|
:enable-back-to-top="false"
|
||||||
|
>
|
||||||
|
<view v-if="!filteredList.length" class="search-select__empty">暂无匹配数据</view>
|
||||||
|
<view
|
||||||
|
v-for="item in filteredList"
|
||||||
|
:key="String(item.value)"
|
||||||
|
class="search-select__item"
|
||||||
|
@click="confirm(item)"
|
||||||
|
>{{ item.label }}</view>
|
||||||
|
</scroll-view>
|
||||||
|
</view>
|
||||||
|
</u-popup>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
show: { type: Boolean, default: false },
|
||||||
|
title: { type: String, default: '请选择' },
|
||||||
|
placeholder: { type: String, default: '请输入名称搜索' },
|
||||||
|
list: { type: Array, default: () => [] },
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
keyword: '',
|
||||||
|
panelMaxHeight: 520,
|
||||||
|
listHeight: 360,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
visible: {
|
||||||
|
get() { return this.show; },
|
||||||
|
set(val) { this.$emit('update:show', val); },
|
||||||
|
},
|
||||||
|
filteredList() {
|
||||||
|
const keyword = (this.keyword || '').trim().toLowerCase();
|
||||||
|
if (!keyword) return this.list;
|
||||||
|
return this.list.filter((item) => String(item.label || '').toLowerCase().includes(keyword));
|
||||||
|
},
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
show(val) {
|
||||||
|
if (val) {
|
||||||
|
this.keyword = '';
|
||||||
|
this.calcHeight();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.calcHeight();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
calcHeight() {
|
||||||
|
try {
|
||||||
|
const sys = uni.getSystemInfoSync();
|
||||||
|
const winH = sys.windowHeight || 600;
|
||||||
|
// 弹层约占屏高 65%,列表为弹层去掉标题+搜索后的剩余高度
|
||||||
|
this.panelMaxHeight = Math.floor(winH * 0.65);
|
||||||
|
this.listHeight = Math.max(220, this.panelMaxHeight - 140);
|
||||||
|
} catch (e) {
|
||||||
|
this.panelMaxHeight = 520;
|
||||||
|
this.listHeight = 360;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
confirm(item) {
|
||||||
|
this.visible = false;
|
||||||
|
this.$emit('confirm', item);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
@import '@/common/pda-typography.scss';
|
||||||
|
|
||||||
|
.search-select {
|
||||||
|
background: #fff;
|
||||||
|
padding-bottom: 20rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.search-select__bar {
|
||||||
|
flex-shrink: 0;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 24rpx 30rpx 12rpx;
|
||||||
|
}
|
||||||
|
.search-select__title {
|
||||||
|
font-size: $pda-font-popup-title;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #202328;
|
||||||
|
}
|
||||||
|
.search-select__cancel {
|
||||||
|
font-size: $pda-font-popup-sub;
|
||||||
|
color: #888;
|
||||||
|
}
|
||||||
|
.search-select__search {
|
||||||
|
flex-shrink: 0;
|
||||||
|
padding: 0 24rpx 12rpx;
|
||||||
|
}
|
||||||
|
.search-select__list {
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.search-select__empty {
|
||||||
|
padding: 80rpx 0;
|
||||||
|
text-align: center;
|
||||||
|
color: #999;
|
||||||
|
font-size: $pda-font-popup-sub;
|
||||||
|
}
|
||||||
|
.search-select__item {
|
||||||
|
padding: 32rpx 30rpx;
|
||||||
|
font-size: $pda-font-popup-item;
|
||||||
|
color: #202328;
|
||||||
|
border-bottom: 1px solid #f2f2f2;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="warehouse-table-wrap">
|
<view class="warehouse-table-wrap" :class="{ 'is-auto-height': isAutoHeight }">
|
||||||
<scroll-view scroll-x class="tableScrollX">
|
<scroll-view scroll-x class="tableScrollX">
|
||||||
<wyb-table
|
<wyb-table
|
||||||
ref="table"
|
ref="table"
|
||||||
@@ -22,10 +22,14 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
headers: { type: Array, default: () => [] },
|
headers: { type: Array, default: () => [] },
|
||||||
contents: { type: Array, default: () => [] },
|
contents: { type: Array, default: () => [] },
|
||||||
|
// auto:高度随内容撑开,纵向滚动交给外层 scroll-view,避免与下拉刷新抢手势
|
||||||
height: { type: String, default: 'auto' },
|
height: { type: String, default: 'auto' },
|
||||||
firstLineFixed: { type: Boolean, default: true },
|
firstLineFixed: { type: Boolean, default: true },
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
isAutoHeight() {
|
||||||
|
return !this.height || this.height === 'auto';
|
||||||
|
},
|
||||||
tableWidth() {
|
tableWidth() {
|
||||||
const total = (this.headers || []).reduce((sum, col) => sum + (col.width || 160), 0);
|
const total = (this.headers || []).reduce((sum, col) => sum + (col.width || 160), 0);
|
||||||
return `${total}rpx`;
|
return `${total}rpx`;
|
||||||
@@ -49,4 +53,10 @@ export default {
|
|||||||
.tableScrollX {
|
.tableScrollX {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
/* 取消表格内部纵向滚动,只保留横向;纵向由页面 scroll-view 处理 */
|
||||||
|
.is-auto-height ::v-deep .wyb-table-scroll-view {
|
||||||
|
height: auto !important;
|
||||||
|
overflow-x: auto;
|
||||||
|
overflow-y: visible;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
+19
@@ -17,6 +17,25 @@ import VueI18n from '@/common/vue-i18n.min.js';
|
|||||||
import lang_zh_CN from '@/common/locales/zh_CN.js';
|
import lang_zh_CN from '@/common/locales/zh_CN.js';
|
||||||
import lang_en from '@/common/locales/en.js';
|
import lang_en from '@/common/locales/en.js';
|
||||||
|
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
// Android 5.x 等老 PDA 不信任 Let's Encrypt 新证书链,全局关闭 HTTPS 证书校验
|
||||||
|
(() => {
|
||||||
|
const patchSslVerify = (methodName) => {
|
||||||
|
const original = uni[methodName];
|
||||||
|
if (typeof original !== 'function') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
uni[methodName] = (options = {}) => original({
|
||||||
|
...options,
|
||||||
|
sslVerify: false
|
||||||
|
});
|
||||||
|
};
|
||||||
|
patchSslVerify('request');
|
||||||
|
patchSslVerify('downloadFile');
|
||||||
|
patchSslVerify('uploadFile');
|
||||||
|
})();
|
||||||
|
// #endif
|
||||||
|
|
||||||
Vue.config.productionTip = false;
|
Vue.config.productionTip = false;
|
||||||
|
|
||||||
App.mpType = 'app';
|
App.mpType = 'app';
|
||||||
|
|||||||
+4
-4
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name" : "浩拓技术",
|
"name" : "浩拓织厂",
|
||||||
"appid" : "__UNI__F79F300",
|
"appid" : "__UNI__F79F300",
|
||||||
"description" : "浩拓纺织平台",
|
"description" : "周尚-浩拓织厂",
|
||||||
"versionName" : "1.1.5",
|
"versionName" : "1.1.11",
|
||||||
"versionCode" : 105,
|
"versionCode" : 111,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
"optimization" : {
|
"optimization" : {
|
||||||
|
|||||||
+8
-19
@@ -569,7 +569,7 @@
|
|||||||
"navigationBarTitleText": "",
|
"navigationBarTitleText": "",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
},{
|
},{
|
||||||
"path" : "pages/storefabric/storeFabricBusinessOutList",
|
"path" : "pages/storefabric/storeFabricBusinessOutList",
|
||||||
"style" :
|
"style" :
|
||||||
{
|
{
|
||||||
@@ -577,6 +577,13 @@
|
|||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
},{
|
},{
|
||||||
|
"path": "pages/storefabric/storeFabricManualIn",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "手动进仓",
|
||||||
|
"navigationStyle": "custom",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
|
},{
|
||||||
"path" : "pages/storefabric/storeFabricBusinessOutAdd",
|
"path" : "pages/storefabric/storeFabricBusinessOutAdd",
|
||||||
"style" :
|
"style" :
|
||||||
{
|
{
|
||||||
@@ -800,30 +807,12 @@
|
|||||||
"backgroundColor": "#ffffff",
|
"backgroundColor": "#ffffff",
|
||||||
"borderStyle": "white",
|
"borderStyle": "white",
|
||||||
"list": [
|
"list": [
|
||||||
{
|
|
||||||
"pagePath": "pages/sys/msg/index",
|
|
||||||
"iconPath": "static/aidex/tabbar/msg_1.png",
|
|
||||||
"selectedIconPath": "static/aidex/tabbar/msg_2.png",
|
|
||||||
"text": "消息"
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// "pagePath": "pages/sys/home/index",
|
|
||||||
// "iconPath": "static/aidex/tabbar/home_1.png",
|
|
||||||
// "selectedIconPath": "static/aidex/tabbar/home_2.png",
|
|
||||||
// "text": "首页"
|
|
||||||
// },
|
|
||||||
{
|
{
|
||||||
"pagePath": "pages/sys/workbench/index",
|
"pagePath": "pages/sys/workbench/index",
|
||||||
"iconPath": "static/aidex/tabbar/apply_1.png",
|
"iconPath": "static/aidex/tabbar/apply_1.png",
|
||||||
"selectedIconPath": "static/aidex/tabbar/apply_2.png",
|
"selectedIconPath": "static/aidex/tabbar/apply_2.png",
|
||||||
"text": "工作台"
|
"text": "工作台"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"pagePath": "pages/sys/book/index",
|
|
||||||
"iconPath": "static/aidex/tabbar/book_1.png",
|
|
||||||
"selectedIconPath": "static/aidex/tabbar/book_2.png",
|
|
||||||
"text": "通讯录"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"pagePath": "pages/sys/user/index",
|
"pagePath": "pages/sys/user/index",
|
||||||
"iconPath": "static/aidex/tabbar/my_1.png",
|
"iconPath": "static/aidex/tabbar/my_1.png",
|
||||||
|
|||||||
@@ -89,7 +89,6 @@
|
|||||||
<FabricOutScanDetail
|
<FabricOutScanDetail
|
||||||
slot="before-list"
|
slot="before-list"
|
||||||
:detail="scanDetail"
|
:detail="scanDetail"
|
||||||
:item-data="form.item_data"
|
|
||||||
:group-keys="scanGroupKeys"
|
:group-keys="scanGroupKeys"
|
||||||
@group-change="scanGroupKeys = $event"
|
@group-change="scanGroupKeys = $event"
|
||||||
/>
|
/>
|
||||||
@@ -122,7 +121,13 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<u-select v-model="selectShow" :list="selectList" @confirm="selectConfirmFun"></u-select>
|
<search-select-popup
|
||||||
|
:show.sync="selectShow"
|
||||||
|
title="选择接收单位"
|
||||||
|
placeholder="请输入染厂名称"
|
||||||
|
:list="selectList"
|
||||||
|
@confirm="selectConfirmFun"
|
||||||
|
/>
|
||||||
|
|
||||||
<FabricInfoPopup :show.sync="fabricInfoShow" :data="currentFabricInfo" />
|
<FabricInfoPopup :show.sync="fabricInfoShow" :data="currentFabricInfo" />
|
||||||
|
|
||||||
@@ -152,6 +157,8 @@ import FabricOutScanDetail from '@/components/storefabric/FabricOutScanDetail.vu
|
|||||||
|
|
||||||
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
||||||
|
|
||||||
|
import SearchSelectPopup from '@/components/storefabric/SearchSelectPopup.vue';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -172,6 +179,8 @@ export default {
|
|||||||
|
|
||||||
FabricOutFooter,
|
FabricOutFooter,
|
||||||
|
|
||||||
|
SearchSelectPopup,
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
mixins: [formMixin],
|
mixins: [formMixin],
|
||||||
|
|||||||
@@ -43,7 +43,6 @@
|
|||||||
<FabricOutScanDetail
|
<FabricOutScanDetail
|
||||||
slot="before-list"
|
slot="before-list"
|
||||||
:detail="scanDetail"
|
:detail="scanDetail"
|
||||||
:item-data="form.item_data"
|
|
||||||
:group-keys="scanGroupKeys"
|
:group-keys="scanGroupKeys"
|
||||||
@group-change="scanGroupKeys = $event"
|
@group-change="scanGroupKeys = $event"
|
||||||
/>
|
/>
|
||||||
@@ -51,7 +50,13 @@
|
|||||||
|
|
||||||
<FabricOutFooter :buttons="statusActionButtons" @action="handleStatusAction" />
|
<FabricOutFooter :buttons="statusActionButtons" @action="handleStatusAction" />
|
||||||
|
|
||||||
<u-select v-model="selectShow" :list="selectList" @confirm="selectConfirmFun"></u-select>
|
<search-select-popup
|
||||||
|
:show.sync="selectShow"
|
||||||
|
title="选择接收单位"
|
||||||
|
placeholder="请输入染厂名称"
|
||||||
|
:list="selectList"
|
||||||
|
@confirm="selectConfirmFun"
|
||||||
|
/>
|
||||||
<FabricInfoPopup :show.sync="fabricInfoShow" :data="currentFabricInfo" />
|
<FabricInfoPopup :show.sync="fabricInfoShow" :data="currentFabricInfo" />
|
||||||
<FineCodePopup :show.sync="fineCodeShow" :list="currentFineCodes" :readonly="false" @delete="onDeleteFineCode" />
|
<FineCodePopup :show.sync="fineCodeShow" :list="currentFineCodes" :readonly="false" @delete="onDeleteFineCode" />
|
||||||
</view>
|
</view>
|
||||||
@@ -66,6 +71,7 @@ import FabricOutDetailList from '@/components/storefabric/FabricOutDetailList.vu
|
|||||||
import FabricOutScanBar from '@/components/storefabric/FabricOutScanBar.vue';
|
import FabricOutScanBar from '@/components/storefabric/FabricOutScanBar.vue';
|
||||||
import FabricOutScanDetail from '@/components/storefabric/FabricOutScanDetail.vue';
|
import FabricOutScanDetail from '@/components/storefabric/FabricOutScanDetail.vue';
|
||||||
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
||||||
|
import SearchSelectPopup from '@/components/storefabric/SearchSelectPopup.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@@ -76,6 +82,7 @@ export default {
|
|||||||
FabricOutScanBar,
|
FabricOutScanBar,
|
||||||
FabricOutScanDetail,
|
FabricOutScanDetail,
|
||||||
FabricOutFooter,
|
FabricOutFooter,
|
||||||
|
SearchSelectPopup,
|
||||||
},
|
},
|
||||||
mixins: [formMixin],
|
mixins: [formMixin],
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
|
|||||||
@@ -1,9 +1,19 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<view class="filterBar">
|
<view class="filterBar">
|
||||||
<u-search v-model="filters.order_no" placeholder="出仓单号" :show-action="false" @search="loadList" @custom="loadList" />
|
<u-search
|
||||||
<view class="filterBtn" @click="filterShow = true">
|
v-model="filters.order_no"
|
||||||
<u-icon name="list" size="40" color="#666"></u-icon>
|
placeholder="出仓单号"
|
||||||
|
:show-action="false"
|
||||||
|
@search="applySearch"
|
||||||
|
@custom="applySearch"
|
||||||
|
@clear="applySearch"
|
||||||
|
/>
|
||||||
|
<view class="filterBtn" :class="{ 'filterBtn--active': hasActiveFilter }" @click="filterShow = true">
|
||||||
|
<view class="filterBtn__icon">
|
||||||
|
<u-icon name="list" size="44" :color="hasActiveFilter ? '#2979ff' : '#666'"></u-icon>
|
||||||
|
<view v-if="hasActiveFilter" class="filterBtn__badge"></view>
|
||||||
|
</view>
|
||||||
<text>筛选</text>
|
<text>筛选</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -20,36 +30,48 @@
|
|||||||
|
|
||||||
<addBtn url="./storeFabricBusinessOutAdd"></addBtn>
|
<addBtn url="./storeFabricBusinessOutAdd"></addBtn>
|
||||||
|
|
||||||
<u-popup v-model="filterShow" mode="right" width="580rpx" :safe-area-inset-bottom="true">
|
<u-popup v-model="filterShow" mode="right" width="580rpx" :safe-area-inset-bottom="true" @close="cancelFilterEdit">
|
||||||
<view class="filterPanel">
|
<view class="filterPanel">
|
||||||
<view class="filterTitle">筛选条件</view>
|
<view class="filterTitle">筛选条件</view>
|
||||||
<view class="filterItem">
|
<view class="filterItem">
|
||||||
<text class="filterLabel">出仓单号</text>
|
<text class="filterLabel">出仓单号</text>
|
||||||
<u-input v-model="filters.order_no" placeholder="请输入出仓单号" />
|
<view class="filterInput">
|
||||||
|
<u-input
|
||||||
|
v-model="filters.order_no"
|
||||||
|
placeholder="请输入出仓单号"
|
||||||
|
:height="100"
|
||||||
|
:custom-style="{ fontSize: '36rpx', color: '#202328' }"
|
||||||
|
placeholder-style="color: #aeb4bf; font-size: 34rpx;"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="filterItem">
|
<view class="filterItem">
|
||||||
<text class="filterLabel">出仓日期</text>
|
<text class="filterLabel">出仓日期</text>
|
||||||
<view class="dateRow">
|
<view class="dateRow">
|
||||||
<picker mode="date" :value="filters.start_date" @change="e => filters.start_date = e.detail.value">
|
<picker class="datePicker" mode="date" :value="filters.start_date" @change="e => filters.start_date = e.detail.value">
|
||||||
<view class="dateInput">{{ filters.start_date || '开始日期' }}</view>
|
<view class="dateInput" :class="{ 'dateInput--placeholder': !filters.start_date }">
|
||||||
|
{{ filters.start_date || '开始日期' }}
|
||||||
|
</view>
|
||||||
</picker>
|
</picker>
|
||||||
<text>~</text>
|
<text class="dateSeparator">~</text>
|
||||||
<picker mode="date" :value="filters.end_date" @change="e => filters.end_date = e.detail.value">
|
<picker class="datePicker" mode="date" :value="filters.end_date" @change="e => filters.end_date = e.detail.value">
|
||||||
<view class="dateInput">{{ filters.end_date || '结束日期' }}</view>
|
<view class="dateInput" :class="{ 'dateInput--placeholder': !filters.end_date }">
|
||||||
|
{{ filters.end_date || '结束日期' }}
|
||||||
|
</view>
|
||||||
</picker>
|
</picker>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="filterItem" @click="openDeliveryUnitSelect">
|
<view class="filterItem" @click="openDeliveryUnitSelect">
|
||||||
<text class="filterLabel">出仓单位</text>
|
<text class="filterLabel">出仓单位</text>
|
||||||
<view class="filterValue">{{ deliveryUnitLabel || '全部' }} <u-icon name="arrow-right" size="28"></u-icon></view>
|
<view class="filterValue">{{ deliveryUnitLabel || '全部' }} <u-icon name="arrow-right" size="36"></u-icon></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="filterItem" @click="openBusinessUnitSelect">
|
<view class="filterItem" @click="openBusinessUnitSelect">
|
||||||
<text class="filterLabel">接收单位</text>
|
<text class="filterLabel">接收单位</text>
|
||||||
<view class="filterValue">{{ businessUnitLabel || '全部' }} <u-icon name="arrow-right" size="28"></u-icon></view>
|
<view class="filterValue">{{ businessUnitLabel || '全部' }} <u-icon name="arrow-right" size="36"></u-icon></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="filterItem" @click="openStatusSelect">
|
<view class="filterItem" @click="openStatusSelect">
|
||||||
<text class="filterLabel">订单状态</text>
|
<text class="filterLabel">订单状态</text>
|
||||||
<view class="filterValue">{{ statusLabel || '全部' }} <u-icon name="arrow-right" size="28"></u-icon></view>
|
<view class="filterValue">{{ statusLabel || '全部' }} <u-icon name="arrow-right" size="36"></u-icon></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="filterActions">
|
<view class="filterActions">
|
||||||
<u-button type="warning" size="medium" @click="resetFilter">重置</u-button>
|
<u-button type="warning" size="medium" @click="resetFilter">重置</u-button>
|
||||||
@@ -58,26 +80,76 @@
|
|||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
|
|
||||||
<u-select v-model="statusSelectShow" :list="statusSelectList" @confirm="onStatusConfirm"></u-select>
|
<u-select
|
||||||
<u-select v-model="unitSelectShow" :list="unitSelectList" @confirm="onUnitConfirm"></u-select>
|
class="pdaSelect"
|
||||||
|
v-model="statusSelectShow"
|
||||||
|
title="选择订单状态"
|
||||||
|
:list="statusSelectList"
|
||||||
|
:default-value="statusSelectDefault"
|
||||||
|
@confirm="onStatusConfirm"
|
||||||
|
></u-select>
|
||||||
|
<u-select
|
||||||
|
class="pdaSelect"
|
||||||
|
v-model="unitSelectShow"
|
||||||
|
title="选择出仓单位"
|
||||||
|
:list="unitSelectList"
|
||||||
|
:default-value="unitSelectDefault"
|
||||||
|
@confirm="onUnitConfirm"
|
||||||
|
></u-select>
|
||||||
|
<search-select-popup
|
||||||
|
:show.sync="businessUnitSelectShow"
|
||||||
|
title="选择接收单位"
|
||||||
|
placeholder="请输入染厂名称"
|
||||||
|
:list="businessUnitSelectList"
|
||||||
|
@confirm="onBusinessUnitConfirm"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import addBtn from '@/components/addBtn/addBtn.vue';
|
import addBtn from '@/components/addBtn/addBtn.vue';
|
||||||
import FabricOutItem from '@/components/card/storeFabricBusinessOutItem.vue';
|
import FabricOutItem from '@/components/card/storeFabricBusinessOutItem.vue';
|
||||||
|
import SearchSelectPopup from '@/components/storefabric/SearchSelectPopup.vue';
|
||||||
import {
|
import {
|
||||||
getStatusOptions,
|
getStatusOptions,
|
||||||
|
AUDIT_STATUS,
|
||||||
AUDIT_STATUS_MAP,
|
AUDIT_STATUS_MAP,
|
||||||
BILL_TYPES,
|
BILL_TYPES,
|
||||||
BUSINESS_UNIT_TYPE_KNITTING_FACTORY,
|
BUSINESS_UNIT_TYPE_DYEING_FACTORY,
|
||||||
formatRoll,
|
formatRoll,
|
||||||
mapToSelectOptions,
|
mapToSelectOptions,
|
||||||
fetchAllOrderList,
|
fetchAllOrderList,
|
||||||
} from '@/common/storeFabricBusinessOut';
|
} from '@/common/storeFabricBusinessOut';
|
||||||
|
|
||||||
|
const FILTER_STORAGE_KEY = 'storeFabricBusinessOutListFilters';
|
||||||
|
|
||||||
|
const createDefaultFilters = () => ({
|
||||||
|
order_no: '',
|
||||||
|
start_date: '',
|
||||||
|
end_date: '',
|
||||||
|
delivery_unit_id: '',
|
||||||
|
delivery_unit_name: '',
|
||||||
|
business_unit_id: '',
|
||||||
|
business_unit_name: '',
|
||||||
|
audit_status: AUDIT_STATUS.PENDING,
|
||||||
|
});
|
||||||
|
|
||||||
|
const normalizeFilters = (value) => {
|
||||||
|
const filters = createDefaultFilters();
|
||||||
|
if (!value || typeof value !== 'object' || Array.isArray(value)) return filters;
|
||||||
|
|
||||||
|
Object.keys(filters).forEach((key) => {
|
||||||
|
if (typeof value[key] === 'string' || typeof value[key] === 'number') {
|
||||||
|
filters[key] = value[key];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (!filters.delivery_unit_id) filters.delivery_unit_name = '';
|
||||||
|
if (!filters.business_unit_id) filters.business_unit_name = '';
|
||||||
|
return filters;
|
||||||
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { addBtn, FabricOutItem },
|
components: { addBtn, FabricOutItem, SearchSelectPopup },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
list: [],
|
list: [],
|
||||||
@@ -86,21 +158,14 @@ export default {
|
|||||||
filterShow: false,
|
filterShow: false,
|
||||||
statusSelectShow: false,
|
statusSelectShow: false,
|
||||||
unitSelectShow: false,
|
unitSelectShow: false,
|
||||||
|
businessUnitSelectShow: false,
|
||||||
unitSelectType: '',
|
unitSelectType: '',
|
||||||
deliveryUnitOptions: [],
|
deliveryUnitOptions: [],
|
||||||
businessUnitOptions: [],
|
businessUnitOptions: [],
|
||||||
unitOptionsLoading: false,
|
unitOptionsLoading: false,
|
||||||
billTypeName: (BILL_TYPES[0] || {}).label || '坯布其他出货单',
|
billTypeName: (BILL_TYPES[0] || {}).label || '坯布其他出货单',
|
||||||
filters: {
|
filters: createDefaultFilters(),
|
||||||
order_no: '',
|
appliedFilters: createDefaultFilters(),
|
||||||
start_date: '',
|
|
||||||
end_date: '',
|
|
||||||
delivery_unit_id: '',
|
|
||||||
delivery_unit_name: '',
|
|
||||||
business_unit_id: '',
|
|
||||||
business_unit_name: '',
|
|
||||||
audit_status: '',
|
|
||||||
},
|
|
||||||
statusSelectList: [
|
statusSelectList: [
|
||||||
{ value: '', label: '全部' },
|
{ value: '', label: '全部' },
|
||||||
...getStatusOptions(),
|
...getStatusOptions(),
|
||||||
@@ -119,23 +184,78 @@ export default {
|
|||||||
return this.filters.business_unit_name || '';
|
return this.filters.business_unit_name || '';
|
||||||
},
|
},
|
||||||
unitSelectList() {
|
unitSelectList() {
|
||||||
const options = this.unitSelectType === 'delivery' ? this.deliveryUnitOptions : this.businessUnitOptions;
|
return [{ value: '', label: '全部' }, ...this.deliveryUnitOptions];
|
||||||
return [{ value: '', label: '全部' }, ...options];
|
},
|
||||||
|
businessUnitSelectList() {
|
||||||
|
return [{ value: '', label: '全部' }, ...this.businessUnitOptions];
|
||||||
|
},
|
||||||
|
statusSelectDefault() {
|
||||||
|
const index = this.statusSelectList.findIndex(
|
||||||
|
(item) => String(item.value) === String(this.filters.audit_status)
|
||||||
|
);
|
||||||
|
return [index >= 0 ? index : 0];
|
||||||
|
},
|
||||||
|
unitSelectDefault() {
|
||||||
|
const index = this.unitSelectList.findIndex(
|
||||||
|
(item) => String(item.value) === String(this.filters.delivery_unit_id)
|
||||||
|
);
|
||||||
|
return [index >= 0 ? index : 0];
|
||||||
|
},
|
||||||
|
hasActiveFilter() {
|
||||||
|
const filters = this.appliedFilters;
|
||||||
|
return Boolean(
|
||||||
|
String(filters.order_no || '').trim()
|
||||||
|
|| filters.start_date
|
||||||
|
|| filters.end_date
|
||||||
|
|| filters.delivery_unit_id
|
||||||
|
|| filters.business_unit_id
|
||||||
|
|| (filters.audit_status !== '' && filters.audit_status !== null)
|
||||||
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
uni.setNavigationBarTitle({ title: '坯布出库列表' });
|
uni.setNavigationBarTitle({ title: '坯布出库列表' });
|
||||||
|
this.restoreFilterCache();
|
||||||
uni.getSystemInfo({
|
uni.getSystemInfo({
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
this.scrollHeight = `${res.windowHeight - 50}px`;
|
this.scrollHeight = `${res.windowHeight - 50}px`;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
this.loadList();
|
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.loadList();
|
this.loadList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
restoreFilterCache() {
|
||||||
|
try {
|
||||||
|
const filters = normalizeFilters(uni.getStorageSync(FILTER_STORAGE_KEY));
|
||||||
|
this.filters = { ...filters };
|
||||||
|
this.appliedFilters = { ...filters };
|
||||||
|
} catch (e) {
|
||||||
|
this.filters = createDefaultFilters();
|
||||||
|
this.appliedFilters = createDefaultFilters();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
saveFilterCache() {
|
||||||
|
try {
|
||||||
|
uni.setStorageSync(FILTER_STORAGE_KEY, { ...this.appliedFilters });
|
||||||
|
} catch (e) {
|
||||||
|
// 缓存失败不影响列表筛选
|
||||||
|
}
|
||||||
|
},
|
||||||
|
commitFilters() {
|
||||||
|
const filters = normalizeFilters(this.filters);
|
||||||
|
this.filters = { ...filters };
|
||||||
|
this.appliedFilters = { ...filters };
|
||||||
|
this.saveFilterCache();
|
||||||
|
this.loadList();
|
||||||
|
},
|
||||||
|
applySearch() {
|
||||||
|
this.commitFilters();
|
||||||
|
},
|
||||||
|
cancelFilterEdit() {
|
||||||
|
this.filters = { ...this.appliedFilters };
|
||||||
|
},
|
||||||
loadDeliveryUnitOptions() {
|
loadDeliveryUnitOptions() {
|
||||||
if (this.deliveryUnitOptions.length) return Promise.resolve(this.deliveryUnitOptions);
|
if (this.deliveryUnitOptions.length) return Promise.resolve(this.deliveryUnitOptions);
|
||||||
return this.$u.api.businessUnit.list({})
|
return this.$u.api.businessUnit.list({})
|
||||||
@@ -150,7 +270,7 @@ export default {
|
|||||||
},
|
},
|
||||||
loadBusinessUnitOptions() {
|
loadBusinessUnitOptions() {
|
||||||
if (this.businessUnitOptions.length) return Promise.resolve(this.businessUnitOptions);
|
if (this.businessUnitOptions.length) return Promise.resolve(this.businessUnitOptions);
|
||||||
return this.$u.api.businessUnit.list({ unit_type_id: BUSINESS_UNIT_TYPE_KNITTING_FACTORY })
|
return this.$u.api.businessUnit.list({ unit_type_id: BUSINESS_UNIT_TYPE_DYEING_FACTORY })
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
this.businessUnitOptions = mapToSelectOptions(res);
|
this.businessUnitOptions = mapToSelectOptions(res);
|
||||||
return this.businessUnitOptions;
|
return this.businessUnitOptions;
|
||||||
@@ -181,7 +301,23 @@ export default {
|
|||||||
this.openUnitSelect('delivery');
|
this.openUnitSelect('delivery');
|
||||||
},
|
},
|
||||||
openBusinessUnitSelect() {
|
openBusinessUnitSelect() {
|
||||||
this.openUnitSelect('business');
|
if (this.unitOptionsLoading) return;
|
||||||
|
this.unitOptionsLoading = true;
|
||||||
|
this.loadBusinessUnitOptions()
|
||||||
|
.then((list) => {
|
||||||
|
if (!list.length) {
|
||||||
|
uni.showToast({ title: '暂无可选单位', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.businessUnitSelectShow = true;
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.unitOptionsLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onBusinessUnitConfirm(item) {
|
||||||
|
this.filters.business_unit_id = item.value;
|
||||||
|
this.filters.business_unit_name = item.value ? item.label : '';
|
||||||
},
|
},
|
||||||
onUnitConfirm(e) {
|
onUnitConfirm(e) {
|
||||||
const item = e[0] || {};
|
const item = e[0] || {};
|
||||||
@@ -194,10 +330,11 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
loadList() {
|
loadList() {
|
||||||
|
const filters = this.appliedFilters;
|
||||||
const params = {};
|
const params = {};
|
||||||
if (this.filters.order_no) params.order_no = this.filters.order_no;
|
if (filters.order_no) params.order_no = filters.order_no;
|
||||||
if (this.filters.audit_status !== '' && this.filters.audit_status !== null) {
|
if (filters.audit_status !== '' && filters.audit_status !== null) {
|
||||||
params.audit_status = this.filters.audit_status;
|
params.audit_status = filters.audit_status;
|
||||||
}
|
}
|
||||||
fetchAllOrderList((p) => this.$u.api.gfmOtherDeliveryOrder.list(p), params)
|
fetchAllOrderList((p) => this.$u.api.gfmOtherDeliveryOrder.list(p), params)
|
||||||
.then((rows) => {
|
.then((rows) => {
|
||||||
@@ -231,12 +368,13 @@ export default {
|
|||||||
},
|
},
|
||||||
// 后端列表仅支持 单号/状态 过滤,出仓日期与单位在前端做本地过滤
|
// 后端列表仅支持 单号/状态 过滤,出仓日期与单位在前端做本地过滤
|
||||||
matchClientFilter(item) {
|
matchClientFilter(item) {
|
||||||
if (this.filters.start_date && item.out_date < this.filters.start_date) return false;
|
const filters = this.appliedFilters;
|
||||||
if (this.filters.end_date && item.out_date > this.filters.end_date) return false;
|
if (filters.start_date && item.out_date < filters.start_date) return false;
|
||||||
if (this.filters.delivery_unit_id && String(item.delivery_unit_id) !== String(this.filters.delivery_unit_id)) {
|
if (filters.end_date && item.out_date > filters.end_date) return false;
|
||||||
|
if (filters.delivery_unit_id && String(item.delivery_unit_id) !== String(filters.delivery_unit_id)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (this.filters.business_unit_id && String(item.business_unit_id) !== String(this.filters.business_unit_id)) {
|
if (filters.business_unit_id && String(item.business_unit_id) !== String(filters.business_unit_id)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -246,40 +384,165 @@ export default {
|
|||||||
this.loadList();
|
this.loadList();
|
||||||
},
|
},
|
||||||
goView(item) {
|
goView(item) {
|
||||||
uni.navigateTo({ url: `./storeFabricBusinessOutView?id=${item.id}` });
|
const page = Number(item.audit_status) === AUDIT_STATUS.PENDING
|
||||||
|
? 'storeFabricBusinessOutEdit'
|
||||||
|
: 'storeFabricBusinessOutView';
|
||||||
|
uni.navigateTo({ url: `./${page}?id=${item.id}` });
|
||||||
},
|
},
|
||||||
openStatusSelect() { this.statusSelectShow = true; },
|
openStatusSelect() { this.statusSelectShow = true; },
|
||||||
onStatusConfirm(e) { this.filters.audit_status = e[0].value; },
|
onStatusConfirm(e) { this.filters.audit_status = e[0].value; },
|
||||||
resetFilter() {
|
resetFilter() {
|
||||||
this.filters = {
|
this.filters = createDefaultFilters();
|
||||||
order_no: '',
|
|
||||||
start_date: '',
|
|
||||||
end_date: '',
|
|
||||||
delivery_unit_id: '',
|
|
||||||
delivery_unit_name: '',
|
|
||||||
business_unit_id: '',
|
|
||||||
business_unit_name: '',
|
|
||||||
audit_status: '',
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
applyFilter() {
|
applyFilter() {
|
||||||
|
this.commitFilters();
|
||||||
this.filterShow = false;
|
this.filterShow = false;
|
||||||
this.loadList();
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style lang="scss">
|
||||||
|
@import '@/common/pda-typography.scss';
|
||||||
|
|
||||||
page { background-color: #F8F8F8; }
|
page { background-color: #F8F8F8; }
|
||||||
.filterBar { display: flex; align-items: center; padding: 16rpx 20rpx; background: #fff; gap: 16rpx; }
|
.filterBar { display: flex; align-items: center; padding: 16rpx 20rpx; background: #fff; gap: 16rpx; }
|
||||||
.filterBtn { display: flex; flex-direction: column; align-items: center; font-size: 22rpx; color: #666; min-width: 80rpx; }
|
.filterBtn {
|
||||||
.filterPanel { padding: 30rpx; }
|
display: flex;
|
||||||
.filterTitle { font-size: 32rpx; font-weight: bold; margin-bottom: 30rpx; }
|
flex-direction: column;
|
||||||
.filterItem { margin-bottom: 24rpx; }
|
align-items: center;
|
||||||
.filterLabel { display: block; font-size: 28rpx; color: #666; margin-bottom: 12rpx; }
|
justify-content: center;
|
||||||
.filterValue { display: flex; align-items: center; justify-content: space-between; padding: 16rpx; background: #f5f5f5; border-radius: 8rpx; font-size: 28rpx; }
|
min-width: 88rpx;
|
||||||
.dateRow { display: flex; align-items: center; gap: 12rpx; }
|
min-height: 76rpx;
|
||||||
.dateInput { padding: 16rpx; background: #f5f5f5; border-radius: 8rpx; font-size: 26rpx; min-width: 200rpx; text-align: center; }
|
padding: 6rpx 8rpx;
|
||||||
.filterActions { display: flex; gap: 20rpx; margin-top: 40rpx; }
|
border: 2rpx solid transparent;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-size: $pda-font-nav-sub;
|
||||||
|
line-height: 1.2;
|
||||||
|
color: #666;
|
||||||
|
transition: color 0.2s, background-color 0.2s, border-color 0.2s;
|
||||||
|
}
|
||||||
|
.filterBtn--active {
|
||||||
|
color: #2979ff;
|
||||||
|
background: #eef5ff;
|
||||||
|
border-color: #9fc5ff;
|
||||||
|
}
|
||||||
|
.filterBtn__icon {
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.filterBtn__badge {
|
||||||
|
position: absolute;
|
||||||
|
top: -3rpx;
|
||||||
|
right: -7rpx;
|
||||||
|
width: 13rpx;
|
||||||
|
height: 13rpx;
|
||||||
|
border: 3rpx solid #fff;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: #ff4d4f;
|
||||||
|
box-sizing: content-box;
|
||||||
|
}
|
||||||
|
.filterPanel {
|
||||||
|
min-height: 100%;
|
||||||
|
padding: 32rpx 28rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.filterTitle {
|
||||||
|
margin-bottom: 30rpx;
|
||||||
|
font-size: $pda-font-popup-title;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #202328;
|
||||||
|
}
|
||||||
|
.filterItem { margin-bottom: 28rpx; }
|
||||||
|
.filterLabel {
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 14rpx;
|
||||||
|
font-size: $pda-font-body;
|
||||||
|
line-height: 1.35;
|
||||||
|
color: #555b66;
|
||||||
|
}
|
||||||
|
.filterInput {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
min-height: $pda-row-min-height;
|
||||||
|
padding: 0 18rpx;
|
||||||
|
background: #f5f6f8;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
::v-deep .filterInput .u-input__input {
|
||||||
|
font-size: $pda-font-body !important;
|
||||||
|
color: #202328;
|
||||||
|
}
|
||||||
|
::v-deep .filterInput .u-input__input::placeholder {
|
||||||
|
font-size: $pda-font-placeholder;
|
||||||
|
color: #aeb4bf;
|
||||||
|
}
|
||||||
|
.filterValue {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
min-height: $pda-row-min-height;
|
||||||
|
padding: 0 18rpx;
|
||||||
|
background: #f5f6f8;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-size: $pda-font-body;
|
||||||
|
color: #202328;
|
||||||
|
}
|
||||||
|
.dateRow {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10rpx;
|
||||||
|
}
|
||||||
|
.datePicker {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
.dateInput {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
min-height: $pda-row-min-height;
|
||||||
|
padding: 0 8rpx;
|
||||||
|
background: #f5f6f8;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-size: $pda-font-body;
|
||||||
|
color: #202328;
|
||||||
|
text-align: center;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
.dateInput--placeholder {
|
||||||
|
font-size: $pda-font-placeholder;
|
||||||
|
color: #7d8490;
|
||||||
|
}
|
||||||
|
.dateSeparator {
|
||||||
|
flex-shrink: 0;
|
||||||
|
font-size: $pda-font-body;
|
||||||
|
color: #555b66;
|
||||||
|
}
|
||||||
|
.filterActions {
|
||||||
|
display: flex;
|
||||||
|
gap: 20rpx;
|
||||||
|
margin-top: 40rpx;
|
||||||
|
}
|
||||||
|
.filterActions .u-btn {
|
||||||
|
flex: 1;
|
||||||
|
height: $pda-button-height !important;
|
||||||
|
line-height: $pda-button-height !important;
|
||||||
|
padding: 0 !important;
|
||||||
|
font-size: $pda-font-button !important;
|
||||||
|
}
|
||||||
|
::v-deep .pdaSelect .u-select__header {
|
||||||
|
height: $pda-row-min-height;
|
||||||
|
}
|
||||||
|
::v-deep .pdaSelect .u-select__header__btn,
|
||||||
|
::v-deep .pdaSelect .u-select__header__title,
|
||||||
|
::v-deep .pdaSelect .u-select__body__picker-view__item {
|
||||||
|
font-size: $pda-font-popup-item !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import scanMixin from '@/common/scanMixin.js';
|
|||||||
import {
|
import {
|
||||||
AUDIT_STATUS_MAP,
|
AUDIT_STATUS_MAP,
|
||||||
BILL_TYPES,
|
BILL_TYPES,
|
||||||
BUSINESS_UNIT_TYPE_KNITTING_FACTORY,
|
BUSINESS_UNIT_TYPE_DYEING_FACTORY,
|
||||||
normalizeOrder,
|
normalizeOrder,
|
||||||
mapToSelectOptions,
|
mapToSelectOptions,
|
||||||
getFineCodeScanCode,
|
getFineCodeScanCode,
|
||||||
@@ -22,6 +22,7 @@ import {
|
|||||||
getFormStatusActionButtons,
|
getFormStatusActionButtons,
|
||||||
orderToFormFields,
|
orderToFormFields,
|
||||||
confirmOrderStatusAction,
|
confirmOrderStatusAction,
|
||||||
|
STATUS_ACTION_VOICE,
|
||||||
DRAFT_AUDIT_STATUS,
|
DRAFT_AUDIT_STATUS,
|
||||||
DRAFT_AUDIT_STATUS_NAME,
|
DRAFT_AUDIT_STATUS_NAME,
|
||||||
getEmptyScanDetail,
|
getEmptyScanDetail,
|
||||||
@@ -136,7 +137,7 @@ export default {
|
|||||||
},
|
},
|
||||||
ensureBusinessUnitOptions() {
|
ensureBusinessUnitOptions() {
|
||||||
if (this.businessUnitOptions.length) return Promise.resolve(this.businessUnitOptions);
|
if (this.businessUnitOptions.length) return Promise.resolve(this.businessUnitOptions);
|
||||||
return this.$u.api.businessUnit.list({ unit_type_id: BUSINESS_UNIT_TYPE_KNITTING_FACTORY })
|
return this.$u.api.businessUnit.list({ unit_type_id: BUSINESS_UNIT_TYPE_DYEING_FACTORY })
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
this.businessUnitOptions = mapToSelectOptions(res);
|
this.businessUnitOptions = mapToSelectOptions(res);
|
||||||
return this.businessUnitOptions;
|
return this.businessUnitOptions;
|
||||||
@@ -197,12 +198,10 @@ export default {
|
|||||||
.catch((e) => this.showError(e.message || '加载单位列表失败'));
|
.catch((e) => this.showError(e.message || '加载单位列表失败'));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
selectConfirmFun(e) {
|
selectConfirmFun(item) {
|
||||||
const item = e[0];
|
if (!item || this.selectType !== '接收单位') return;
|
||||||
if (this.selectType === '接收单位') {
|
this.form.business_unit_id = item.value;
|
||||||
this.form.business_unit_id = item.value;
|
this.form.business_unit_name = item.label;
|
||||||
this.form.business_unit_name = item.label;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
bindDateChange(e) {
|
bindDateChange(e) {
|
||||||
this.form.delivery_time = e.detail.value;
|
this.form.delivery_time = e.detail.value;
|
||||||
@@ -244,7 +243,7 @@ export default {
|
|||||||
this.applyOrder(order);
|
this.applyOrder(order);
|
||||||
this.headerSaved = true;
|
this.headerSaved = true;
|
||||||
this.syncCanScanFromStatus(order.audit_status);
|
this.syncCanScanFromStatus(order.audit_status);
|
||||||
this.showSuccess('保存成功,可以扫码');
|
this.showSuccess('保存成功,可以扫码', '提交成功');
|
||||||
this.registerOrderScanBroadcast();
|
this.registerOrderScanBroadcast();
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
@@ -332,10 +331,10 @@ export default {
|
|||||||
const row = order.item_data.find((i) => (i.group_key || String(i.id)) === this.currentGroupKey);
|
const row = order.item_data.find((i) => (i.group_key || String(i.id)) === this.currentGroupKey);
|
||||||
this.currentFineCodes = row ? [...row.fine_codes] : [];
|
this.currentFineCodes = row ? [...row.fine_codes] : [];
|
||||||
}
|
}
|
||||||
this.BillDataMessage = scanType === 2 ? '删除成功' : '扫描成功';
|
this.BillDataMessage = scanType === 2 ? '删除成功' : '扫码出仓成功';
|
||||||
this.QRBarCode = '';
|
this.QRBarCode = '';
|
||||||
if (scanType === 2) this.showSuccess('删除成功');
|
if (scanType === 2) this.showSuccess('删除成功', '删除成功');
|
||||||
else util.playSuccessAudio();
|
else util.playSpeak('扫码出仓成功');
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
@@ -379,7 +378,8 @@ export default {
|
|||||||
if (!order) return;
|
if (!order) return;
|
||||||
this.applyOrder(order);
|
this.applyOrder(order);
|
||||||
this.syncCanScanFromStatus(order.audit_status);
|
this.syncCanScanFromStatus(order.audit_status);
|
||||||
this.showSuccess('操作成功');
|
const voice = STATUS_ACTION_VOICE[action] || '';
|
||||||
|
this.showSuccess(voice || '操作成功', voice);
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -387,8 +387,9 @@ export default {
|
|||||||
util.playErrorAudio();
|
util.playErrorAudio();
|
||||||
uni.showModal({ title: '提示', content: message, showCancel: false });
|
uni.showModal({ title: '提示', content: message, showCancel: false });
|
||||||
},
|
},
|
||||||
showSuccess(message) {
|
showSuccess(message, speakText) {
|
||||||
util.playSuccessAudio();
|
if (speakText) util.playSpeak(speakText);
|
||||||
|
else util.playSuccessAudio();
|
||||||
uni.showToast({ title: message, icon: 'success' });
|
uni.showToast({ title: message, icon: 'success' });
|
||||||
},
|
},
|
||||||
getBillTypeName() {
|
getBillTypeName() {
|
||||||
|
|||||||
@@ -6,8 +6,25 @@
|
|||||||
.fabric-out-mt32 {
|
.fabric-out-mt32 {
|
||||||
margin-top: 32rpx;
|
margin-top: 32rpx;
|
||||||
}
|
}
|
||||||
|
.fabric-out-page .flex-white-plr26,
|
||||||
|
.fabric-out-page .flex-white-plr26-column,
|
||||||
|
.fabric-out-page .flex-white-plr26 text,
|
||||||
|
.fabric-out-page .flex-white-plr26 view,
|
||||||
|
.fabric-out-page .u-input__input,
|
||||||
|
.fabric-out-page .uni-input-input,
|
||||||
|
.fabric-out-page .uni-textarea-textarea {
|
||||||
|
font-size: 40rpx;
|
||||||
|
}
|
||||||
|
.fabric-out-page .redXingh {
|
||||||
|
font-size: 40rpx;
|
||||||
|
}
|
||||||
|
.fabric-out-page .u-btn {
|
||||||
|
font-size: 36rpx !important;
|
||||||
|
height: 88rpx;
|
||||||
|
line-height: 88rpx;
|
||||||
|
}
|
||||||
.fabric-out-sectionTitle {
|
.fabric-out-sectionTitle {
|
||||||
font-size: 30rpx;
|
font-size: 42rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
padding: 24rpx 26rpx 12rpx;
|
padding: 24rpx 26rpx 12rpx;
|
||||||
border-left: 6rpx solid #007AFF;
|
border-left: 6rpx solid #007AFF;
|
||||||
@@ -16,7 +33,7 @@
|
|||||||
.fabric-out-scanTip {
|
.fabric-out-scanTip {
|
||||||
padding: 20rpx 26rpx;
|
padding: 20rpx 26rpx;
|
||||||
color: #fa8c16;
|
color: #fa8c16;
|
||||||
font-size: 26rpx;
|
font-size: 36rpx;
|
||||||
background: #fff7e6;
|
background: #fff7e6;
|
||||||
margin: 16rpx 26rpx;
|
margin: 16rpx 26rpx;
|
||||||
border-radius: 8rpx;
|
border-radius: 8rpx;
|
||||||
@@ -24,7 +41,7 @@
|
|||||||
.fabric-out-msgTip {
|
.fabric-out-msgTip {
|
||||||
padding: 12rpx 26rpx;
|
padding: 12rpx 26rpx;
|
||||||
color: #52c41a;
|
color: #52c41a;
|
||||||
font-size: 26rpx;
|
font-size: 36rpx;
|
||||||
}
|
}
|
||||||
.fabric-out-detailList {
|
.fabric-out-detailList {
|
||||||
padding: 0 26rpx;
|
padding: 0 26rpx;
|
||||||
@@ -39,7 +56,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
font-size: 28rpx;
|
font-size: 38rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
padding-bottom: 12rpx;
|
padding-bottom: 12rpx;
|
||||||
border-bottom: 1rpx solid #f0f0f0;
|
border-bottom: 1rpx solid #f0f0f0;
|
||||||
@@ -49,7 +66,7 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 20rpx;
|
gap: 20rpx;
|
||||||
padding-top: 12rpx;
|
padding-top: 12rpx;
|
||||||
font-size: 26rpx;
|
font-size: 36rpx;
|
||||||
color: #666;
|
color: #666;
|
||||||
}
|
}
|
||||||
.fabric-out-scanRow {
|
.fabric-out-scanRow {
|
||||||
@@ -66,7 +83,7 @@
|
|||||||
.fabric-out-delCheck {
|
.fabric-out-delCheck {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
font-size: 26rpx;
|
font-size: 36rpx;
|
||||||
color: #666;
|
color: #666;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
@@ -82,7 +99,7 @@
|
|||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
padding: 16rpx 20rpx;
|
padding: 16rpx 20rpx;
|
||||||
border-bottom: 1rpx solid #f0f0f0;
|
border-bottom: 1rpx solid #f0f0f0;
|
||||||
font-size: 26rpx;
|
font-size: 36rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
.fabric-out-scanDetailRow--2col {
|
.fabric-out-scanDetailRow--2col {
|
||||||
@@ -108,34 +125,6 @@
|
|||||||
color: #333;
|
color: #333;
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
.fabric-out-scanDetailTableScroll {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.fabric-out-scanDetailTable {
|
|
||||||
min-width: 100%;
|
|
||||||
}
|
|
||||||
.fabric-out-scanDetailTableRow {
|
|
||||||
display: flex;
|
|
||||||
border-bottom: 1rpx solid #f0f0f0;
|
|
||||||
}
|
|
||||||
.fabric-out-scanDetailTableHead {
|
|
||||||
background: #f5f5f5;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
.fabric-out-scanDetailTableCell {
|
|
||||||
padding: 14rpx 8rpx;
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #333;
|
|
||||||
text-align: center;
|
|
||||||
box-sizing: border-box;
|
|
||||||
word-break: break-all;
|
|
||||||
}
|
|
||||||
.fabric-out-scanDetailEmpty {
|
|
||||||
padding: 24rpx;
|
|
||||||
text-align: center;
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
.fabric-out-submitView {
|
.fabric-out-submitView {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 16rpx 26rpx 26rpx;
|
padding: 16rpx 26rpx 26rpx;
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ import {
|
|||||||
getViewStatusActionButtons,
|
getViewStatusActionButtons,
|
||||||
confirmOrderStatusAction,
|
confirmOrderStatusAction,
|
||||||
formatDisplayTime,
|
formatDisplayTime,
|
||||||
|
STATUS_ACTION_VOICE,
|
||||||
} from '@/common/storeFabricBusinessOut';
|
} from '@/common/storeFabricBusinessOut';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -123,8 +124,10 @@ export default {
|
|||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
const order = normalizeOrder(res);
|
const order = normalizeOrder(res);
|
||||||
if (order) this.order = order;
|
if (order) this.order = order;
|
||||||
util.playSuccessAudio();
|
const voice = STATUS_ACTION_VOICE[action] || '';
|
||||||
uni.showToast({ title: '操作成功', icon: 'success' });
|
if (voice) util.playSpeak(voice);
|
||||||
|
else util.playSuccessAudio();
|
||||||
|
uni.showToast({ title: voice || '操作成功', icon: 'success' });
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -0,0 +1,561 @@
|
|||||||
|
<template>
|
||||||
|
<view class="manual-in">
|
||||||
|
<common-navbar title="手动进仓">
|
||||||
|
<template #right>
|
||||||
|
<view class="manual-in__setting" @click="navToSetting">
|
||||||
|
<u-icon name="setting" color="#333333" size="34"></u-icon>
|
||||||
|
<text>设置</text>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
</common-navbar>
|
||||||
|
|
||||||
|
<view class="manual-in__scan">
|
||||||
|
<input
|
||||||
|
class="manual-in__scan-input"
|
||||||
|
type="text"
|
||||||
|
confirm-type="done"
|
||||||
|
:focus="scanFocus"
|
||||||
|
v-model="scanCode"
|
||||||
|
placeholder="请点击扫描/输入布票编码"
|
||||||
|
placeholder-class="manual-in__placeholder"
|
||||||
|
@confirm="onScanConfirm"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="manual-in__panel">
|
||||||
|
<view class="manual-in__row">
|
||||||
|
<text class="manual-in__label">布票编码</text>
|
||||||
|
<text class="manual-in__value">{{ detail.fabric_piece_code || '-' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="manual-in__row">
|
||||||
|
<text class="manual-in__label">生产单号</text>
|
||||||
|
<text class="manual-in__value">{{ detail.production_order_no || '-' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="manual-in__row">
|
||||||
|
<text class="manual-in__label">机台</text>
|
||||||
|
<text class="manual-in__value">{{ detail.machine_number || '-' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="manual-in__row">
|
||||||
|
<text class="manual-in__label">布种名称</text>
|
||||||
|
<text class="manual-in__value">{{ detail.grey_fabric_name || '-' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="manual-in__row">
|
||||||
|
<text class="manual-in__label">坯布编号</text>
|
||||||
|
<text class="manual-in__value">{{ detail.grey_fabric_code || '-' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="manual-in__row manual-in__row--input">
|
||||||
|
<text class="manual-in__label">重量</text>
|
||||||
|
<view class="manual-in__right">
|
||||||
|
<input
|
||||||
|
class="manual-in__field"
|
||||||
|
type="digit"
|
||||||
|
v-model="weightKg"
|
||||||
|
placeholder="请输入"
|
||||||
|
placeholder-class="manual-in__placeholder"
|
||||||
|
/>
|
||||||
|
<text class="manual-in__unit">KG</text>
|
||||||
|
<text class="manual-in__action" @click="clearWeight">取消</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="manual-in__row manual-in__row--input" @click="openLevelPicker">
|
||||||
|
<text class="manual-in__label">等级</text>
|
||||||
|
<view class="manual-in__right">
|
||||||
|
<text :class="levelDisplayName ? 'manual-in__field-text' : 'manual-in__placeholder'">
|
||||||
|
{{ levelDisplayName || '请选择等级' }}
|
||||||
|
</text>
|
||||||
|
<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">
|
||||||
|
<input
|
||||||
|
class="manual-in__field"
|
||||||
|
type="text"
|
||||||
|
v-model="warehouseBinName"
|
||||||
|
placeholder="/"
|
||||||
|
placeholder-class="manual-in__placeholder"
|
||||||
|
/>
|
||||||
|
<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>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<SearchSelectPopup
|
||||||
|
:show.sync="levelPickerShow"
|
||||||
|
title="选择等级"
|
||||||
|
placeholder="请输入等级名称"
|
||||||
|
:list="levelOptions"
|
||||||
|
@confirm="onLevelConfirm"
|
||||||
|
/>
|
||||||
|
<SearchSelectPopup
|
||||||
|
:show.sync="inspectorPickerShow"
|
||||||
|
title="选择查布工"
|
||||||
|
placeholder="请输入查布工姓名"
|
||||||
|
:list="inspectorOptions"
|
||||||
|
@confirm="onInspectorConfirm"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import CommonNavbar from '@/components/common-navbar/index';
|
||||||
|
import SearchSelectPopup from '@/components/storefabric/SearchSelectPopup.vue';
|
||||||
|
import scanMixin from '@/common/scanMixin.js';
|
||||||
|
import util from '@/common/util.js';
|
||||||
|
import { formatWeightKg } from '@/common/storeFabricBusinessOut.js';
|
||||||
|
|
||||||
|
// 坯布等级字典 id(与后台字典配置一致)
|
||||||
|
const DICTIONARY_TYPE_GREY_FABRIC_LEVEL = 10025;
|
||||||
|
// 查布工岗位 duty(验布/查布相关)
|
||||||
|
const INSPECTOR_DUTY = '20004,20011';
|
||||||
|
const WEIGHT_SCALE = 10000;
|
||||||
|
|
||||||
|
function emptyDetail() {
|
||||||
|
return {
|
||||||
|
fabric_piece_code: '',
|
||||||
|
production_order_no: '',
|
||||||
|
machine_number: '',
|
||||||
|
grey_fabric_name: '',
|
||||||
|
grey_fabric_code: '',
|
||||||
|
inspection_weight: null,
|
||||||
|
grey_fabric_level_id: [],
|
||||||
|
grey_fabric_level_name: '',
|
||||||
|
inspector_id: null,
|
||||||
|
inspector_name: '',
|
||||||
|
volume_number: '',
|
||||||
|
grey_fabric_id: '',
|
||||||
|
id: '',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function toWeightInt(kg) {
|
||||||
|
const raw = String(kg == null ? '' : kg).trim();
|
||||||
|
if (!raw) return null;
|
||||||
|
const n = Number(raw);
|
||||||
|
if (!Number.isFinite(n) || n <= 0) return null;
|
||||||
|
return Math.round(n * WEIGHT_SCALE);
|
||||||
|
}
|
||||||
|
|
||||||
|
function formatDisplayWeightKg(value) {
|
||||||
|
if (value == null || value === '') return '';
|
||||||
|
const n = Number(value);
|
||||||
|
if (!Number.isFinite(n) || n <= 0) return '';
|
||||||
|
return String(formatWeightKg(n));
|
||||||
|
}
|
||||||
|
|
||||||
|
function normalizeLevelIds(value) {
|
||||||
|
if (Array.isArray(value)) {
|
||||||
|
return value.map((item) => Number(item)).filter((item) => Number.isFinite(item));
|
||||||
|
}
|
||||||
|
if (value == null || value === '') return [];
|
||||||
|
const n = Number(value);
|
||||||
|
return Number.isFinite(n) ? [n] : [];
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: { CommonNavbar, SearchSelectPopup },
|
||||||
|
mixins: [scanMixin],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
scanCode: '',
|
||||||
|
scanFocus: true,
|
||||||
|
submitting: false,
|
||||||
|
loadingDetail: false,
|
||||||
|
warehouseBinId: null,
|
||||||
|
warehouseBinName: '',
|
||||||
|
weightKg: '',
|
||||||
|
detail: emptyDetail(),
|
||||||
|
levelPickerShow: false,
|
||||||
|
levelOptions: [],
|
||||||
|
levelOptionsLoaded: false,
|
||||||
|
inspectorPickerShow: false,
|
||||||
|
inspectorOptions: [],
|
||||||
|
inspectorOptionsLoaded: false,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
levelDisplayName() {
|
||||||
|
return this.detail.grey_fabric_level_name || '';
|
||||||
|
},
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.registerScanBroadcast(this.handleScanCode);
|
||||||
|
this.loadLevelOptions();
|
||||||
|
this.loadInspectorOptions();
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
this.scanFocus = false;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.scanFocus = true;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
navToSetting() {
|
||||||
|
uni.navigateTo({ url: '/pages/sys/user/scan-settings' });
|
||||||
|
},
|
||||||
|
clearWeight() {
|
||||||
|
this.weightKg = '';
|
||||||
|
this.detail.inspection_weight = null;
|
||||||
|
},
|
||||||
|
clearLevel() {
|
||||||
|
this.detail.grey_fabric_level_id = [];
|
||||||
|
this.detail.grey_fabric_level_name = '';
|
||||||
|
},
|
||||||
|
clearInspector() {
|
||||||
|
this.detail.inspector_id = null;
|
||||||
|
this.detail.inspector_name = '';
|
||||||
|
},
|
||||||
|
editWarehouseBin() {
|
||||||
|
uni.showModal({
|
||||||
|
title: '存放仓位',
|
||||||
|
editable: true,
|
||||||
|
placeholderText: '请输入仓位名称',
|
||||||
|
content: this.warehouseBinName || '',
|
||||||
|
success: (res) => {
|
||||||
|
if (!res.confirm) return;
|
||||||
|
this.warehouseBinName = (res.content || '').trim();
|
||||||
|
this.warehouseBinId = null;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
async loadLevelOptions() {
|
||||||
|
try {
|
||||||
|
const res = await this.$u.api.dictionary.getDetailEnumList({
|
||||||
|
dictionary_id: DICTIONARY_TYPE_GREY_FABRIC_LEVEL,
|
||||||
|
status: 1,
|
||||||
|
size: 200,
|
||||||
|
});
|
||||||
|
const list = Array.isArray(res) ? res : (Array.isArray(res && res.list) ? res.list : []);
|
||||||
|
this.levelOptions = list
|
||||||
|
.map((item) => ({
|
||||||
|
value: item.id,
|
||||||
|
label: item.name || item.code || String(item.id),
|
||||||
|
}))
|
||||||
|
.filter((item) => item.value != null);
|
||||||
|
this.levelOptionsLoaded = true;
|
||||||
|
} catch (error) {
|
||||||
|
console.log('加载坯布等级枚举失败', error);
|
||||||
|
this.levelOptions = [];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async openLevelPicker() {
|
||||||
|
if (!this.levelOptionsLoaded || !this.levelOptions.length) {
|
||||||
|
await this.loadLevelOptions();
|
||||||
|
}
|
||||||
|
if (!this.levelOptions.length) {
|
||||||
|
this.$u.toast('暂无等级可选,请检查等级字典配置');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.levelPickerShow = true;
|
||||||
|
},
|
||||||
|
onLevelConfirm(item) {
|
||||||
|
if (!item) return;
|
||||||
|
this.detail.grey_fabric_level_id = [Number(item.value)];
|
||||||
|
this.detail.grey_fabric_level_name = item.label || '';
|
||||||
|
},
|
||||||
|
async loadInspectorOptions() {
|
||||||
|
try {
|
||||||
|
const res = await this.$u.api.employee.listEnum({
|
||||||
|
size: 50,
|
||||||
|
duty: INSPECTOR_DUTY,
|
||||||
|
});
|
||||||
|
const list = Array.isArray(res) ? res : (Array.isArray(res && res.list) ? res.list : []);
|
||||||
|
this.inspectorOptions = list
|
||||||
|
.map((item) => ({
|
||||||
|
value: item.id,
|
||||||
|
label: item.name || item.employee_name || item.real_name || item.code || String(item.id),
|
||||||
|
}))
|
||||||
|
.filter((item) => item.value != null);
|
||||||
|
this.inspectorOptionsLoaded = true;
|
||||||
|
} catch (error) {
|
||||||
|
console.log('加载查布工枚举失败', error);
|
||||||
|
this.inspectorOptions = [];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async openInspectorPicker() {
|
||||||
|
if (!this.inspectorOptionsLoaded || !this.inspectorOptions.length) {
|
||||||
|
await this.loadInspectorOptions();
|
||||||
|
}
|
||||||
|
if (!this.inspectorOptions.length) {
|
||||||
|
this.$u.toast('暂无查布工可选');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.inspectorPickerShow = true;
|
||||||
|
},
|
||||||
|
onInspectorConfirm(item) {
|
||||||
|
if (!item) return;
|
||||||
|
this.detail.inspector_id = Number(item.value);
|
||||||
|
this.detail.inspector_name = item.label || '';
|
||||||
|
},
|
||||||
|
handleScanCode(scanResult) {
|
||||||
|
const code = String(scanResult || '').trim().replace(/[\r\n]/g, '');
|
||||||
|
if (!code) return;
|
||||||
|
this.fetchScanDetail(code);
|
||||||
|
},
|
||||||
|
onScanConfirm() {
|
||||||
|
const code = String(this.scanCode || '').trim();
|
||||||
|
if (!code) {
|
||||||
|
this.$u.toast('请扫描或输入布票编码');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.fetchScanDetail(code);
|
||||||
|
},
|
||||||
|
async fetchScanDetail(code) {
|
||||||
|
if (this.loadingDetail) return;
|
||||||
|
this.loadingDetail = true;
|
||||||
|
this.scanCode = code;
|
||||||
|
try {
|
||||||
|
const res = await this.$u.api.productionScheduleOrder.getScanFineCodeDetail({
|
||||||
|
fabric_piece_code: code,
|
||||||
|
});
|
||||||
|
this.applyScanDetail(res, code);
|
||||||
|
} catch (error) {
|
||||||
|
console.log('扫码获取细码失败', error);
|
||||||
|
this.detail = {
|
||||||
|
...emptyDetail(),
|
||||||
|
fabric_piece_code: code,
|
||||||
|
};
|
||||||
|
this.weightKg = '';
|
||||||
|
} finally {
|
||||||
|
this.loadingDetail = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
applyScanDetail(res, fallbackCode) {
|
||||||
|
const data = res || {};
|
||||||
|
const levelIds = normalizeLevelIds(data.grey_fabric_level_id);
|
||||||
|
this.detail = {
|
||||||
|
...emptyDetail(),
|
||||||
|
fabric_piece_code: data.fabric_piece_code || fallbackCode || '',
|
||||||
|
production_order_no: data.production_order_no || '',
|
||||||
|
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: data.grey_fabric_level_name || '',
|
||||||
|
inspector_id: data.inspector_id != null ? data.inspector_id : null,
|
||||||
|
inspector_name: data.inspector_name || '',
|
||||||
|
};
|
||||||
|
this.weightKg = formatDisplayWeightKg(data.inspection_weight);
|
||||||
|
this.scanCode = this.detail.fabric_piece_code;
|
||||||
|
util.playSpeak('扫码成功');
|
||||||
|
},
|
||||||
|
async submitInWarehouse() {
|
||||||
|
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 (!levelIds.length) {
|
||||||
|
this.$u.toast('请选择等级');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.submitting) return;
|
||||||
|
this.submitting = true;
|
||||||
|
try {
|
||||||
|
const payload = {
|
||||||
|
fabric_piece_code: fabricPieceCode,
|
||||||
|
actual_weight: actualWeight,
|
||||||
|
electronic_scale_weight: actualWeight,
|
||||||
|
grey_fabric_level_id: levelIds,
|
||||||
|
};
|
||||||
|
const inspectorName = String(this.detail.inspector_name || '').trim();
|
||||||
|
if (inspectorName) {
|
||||||
|
payload.inspector_name = inspectorName;
|
||||||
|
}
|
||||||
|
if (this.detail.inspector_id != null && this.detail.inspector_id !== '') {
|
||||||
|
payload.inspector_id = Number(this.detail.inspector_id);
|
||||||
|
}
|
||||||
|
const binName = String(this.warehouseBinName || '').trim();
|
||||||
|
if (binName && binName !== '/') {
|
||||||
|
payload.warehouse_bin_name = binName;
|
||||||
|
}
|
||||||
|
if (this.warehouseBinId != null && this.warehouseBinId !== '') {
|
||||||
|
payload.warehouse_bin_id = Number(this.warehouseBinId);
|
||||||
|
}
|
||||||
|
const res = await this.$u.api.productionScheduleOrder.scanInWarehouseFineCode(payload);
|
||||||
|
if (res) {
|
||||||
|
this.detail.volume_number = res.volume_number != null ? res.volume_number : this.detail.volume_number;
|
||||||
|
this.detail.grey_fabric_id = res.grey_fabric_id != null ? res.grey_fabric_id : this.detail.grey_fabric_id;
|
||||||
|
this.detail.id = res.id != null ? res.id : this.detail.id;
|
||||||
|
if (res.fabric_piece_code) {
|
||||||
|
this.detail.fabric_piece_code = res.fabric_piece_code;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const volumeText = res && res.volume_number != null ? `,卷号 ${res.volume_number}` : '';
|
||||||
|
util.playSpeak('进仓成功');
|
||||||
|
this.$u.toast(`进仓成功${volumeText}`);
|
||||||
|
this.resetForNextScan();
|
||||||
|
} catch (error) {
|
||||||
|
console.log('手动进仓失败', error);
|
||||||
|
} finally {
|
||||||
|
this.submitting = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
resetForNextScan() {
|
||||||
|
this.scanCode = '';
|
||||||
|
this.detail = emptyDetail();
|
||||||
|
this.weightKg = '';
|
||||||
|
this.warehouseBinId = null;
|
||||||
|
this.warehouseBinName = '';
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.scanFocus = false;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.scanFocus = true;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import '@/common/pda-typography.scss';
|
||||||
|
|
||||||
|
.manual-in {
|
||||||
|
min-height: 100vh;
|
||||||
|
background: #f5f6f8;
|
||||||
|
padding-bottom: 180rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.manual-in__setting {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8rpx;
|
||||||
|
font-size: $pda-font-nav-sub;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.manual-in__scan {
|
||||||
|
margin: 16rpx 0;
|
||||||
|
padding: 0 28rpx;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.manual-in__scan-input {
|
||||||
|
height: $pda-scan-input-height;
|
||||||
|
font-size: $pda-font-body;
|
||||||
|
color: #202328;
|
||||||
|
}
|
||||||
|
|
||||||
|
.manual-in__placeholder {
|
||||||
|
color: #b0b4bb;
|
||||||
|
font-size: $pda-font-placeholder;
|
||||||
|
}
|
||||||
|
|
||||||
|
.manual-in__panel {
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.manual-in__row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
min-height: $pda-row-min-height;
|
||||||
|
padding: 12rpx 28rpx;
|
||||||
|
border-bottom: 1rpx solid #eceff3;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.manual-in__row--input {
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.manual-in__label {
|
||||||
|
width: $pda-label-width;
|
||||||
|
flex-shrink: 0;
|
||||||
|
font-size: $pda-font-body;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.manual-in__value {
|
||||||
|
flex: 1;
|
||||||
|
font-size: $pda-font-body;
|
||||||
|
color: #202328;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.manual-in__right {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-end;
|
||||||
|
gap: 18rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.manual-in__field {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
text-align: right;
|
||||||
|
font-size: $pda-font-body;
|
||||||
|
color: #202328;
|
||||||
|
}
|
||||||
|
|
||||||
|
.manual-in__field-text {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
text-align: right;
|
||||||
|
font-size: $pda-font-body;
|
||||||
|
color: #202328;
|
||||||
|
}
|
||||||
|
|
||||||
|
.manual-in__unit {
|
||||||
|
font-size: $pda-font-unit;
|
||||||
|
color: #666;
|
||||||
|
padding: 6rpx 14rpx;
|
||||||
|
border: 1rpx solid #d7dbe3;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.manual-in__action {
|
||||||
|
font-size: $pda-font-action;
|
||||||
|
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>
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
<WarehouseDataTable
|
<WarehouseDataTable
|
||||||
:headers="tableHeaders"
|
:headers="tableHeaders"
|
||||||
:contents="tableContents"
|
:contents="tableContents"
|
||||||
:height="tableHeight"
|
height="auto"
|
||||||
@row-click="goStockList"
|
@row-click="goStockList"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
@@ -56,7 +56,6 @@ import {
|
|||||||
GROUP_TABLE_COLUMNS,
|
GROUP_TABLE_COLUMNS,
|
||||||
buildGroupListQuery,
|
buildGroupListQuery,
|
||||||
buildStockListNavigateQuery,
|
buildStockListNavigateQuery,
|
||||||
calcTableHeight,
|
|
||||||
fetchAllWarehouseList,
|
fetchAllWarehouseList,
|
||||||
mapGroupTableRow,
|
mapGroupTableRow,
|
||||||
sumStockTotals,
|
sumStockTotals,
|
||||||
@@ -85,9 +84,6 @@ export default {
|
|||||||
totals() {
|
totals() {
|
||||||
return sumStockTotals(this.list);
|
return sumStockTotals(this.list);
|
||||||
},
|
},
|
||||||
tableHeight() {
|
|
||||||
return calcTableHeight(this.tableContents.length);
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
uni.setNavigationBarTitle({ title: '坯布库存' });
|
uni.setNavigationBarTitle({ title: '坯布库存' });
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
<WarehouseDataTable
|
<WarehouseDataTable
|
||||||
:headers="tableHeaders"
|
:headers="tableHeaders"
|
||||||
:contents="tableContents"
|
:contents="tableContents"
|
||||||
:height="tableHeight"
|
height="auto"
|
||||||
@row-click="goDetail"
|
@row-click="goDetail"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
@@ -50,7 +50,6 @@ import {
|
|||||||
STOCK_TABLE_COLUMNS,
|
STOCK_TABLE_COLUMNS,
|
||||||
buildDetailNavigateQuery,
|
buildDetailNavigateQuery,
|
||||||
buildStockListQuery,
|
buildStockListQuery,
|
||||||
calcTableHeight,
|
|
||||||
fetchAllWarehouseList,
|
fetchAllWarehouseList,
|
||||||
mapStockTableRow,
|
mapStockTableRow,
|
||||||
parsePageQuery,
|
parsePageQuery,
|
||||||
@@ -84,9 +83,6 @@ export default {
|
|||||||
totals() {
|
totals() {
|
||||||
return sumStockTotals(this.list);
|
return sumStockTotals(this.list);
|
||||||
},
|
},
|
||||||
tableHeight() {
|
|
||||||
return calcTableHeight(this.tableContents.length, { maxPx: 9999 });
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
const parsed = parsePageQuery(options || {});
|
const parsed = parsePageQuery(options || {});
|
||||||
|
|||||||
@@ -4,26 +4,25 @@
|
|||||||
<view class="haotoplogo">
|
<view class="haotoplogo">
|
||||||
<image src="/static/haotop/image/logo/Start.jpg" mode="aspectFit" class="logoimg"></image>
|
<image src="/static/haotop/image/logo/Start.jpg" mode="aspectFit" class="logoimg"></image>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="app-name">{{ appName }}</view>
|
||||||
<!-- <div v-if="loginType === 'currentPhone'">-->
|
<!-- <div v-if="loginType === 'currentPhone'">-->
|
||||||
<!-- <u-tabs :list="list" :is-scroll="false" :current="current" @change="onClickItem"></u-tabs> -->
|
<!-- <u-tabs :list="list" :is-scroll="false" :current="current" @change="onClickItem"></u-tabs> -->
|
||||||
<!-- <view v-if="current === 0"> -->
|
<!-- <view v-if="current === 0"> -->
|
||||||
<view class="list">
|
<view class="list">
|
||||||
<template v-if="isDevelopment">
|
<view class="list-call env-call">
|
||||||
<view class="list-call">
|
<view class="iconfont icon-link" style="font-size: 28px;color:#5473e8;"></view>
|
||||||
<view class="iconfont icon-link" style="font-size: 22px;color:#5473e8;"></view>
|
<view style="width: 100%;">
|
||||||
<view style="width: 100%;">
|
<view class="server-selector" @click="showServerPicker">
|
||||||
<view class="server-selector" @click="showServerPicker">
|
<text>{{ getApiUrlLabel() }}</text>
|
||||||
<text>{{ getApiUrlLabel() }}</text>
|
<view class="iconfont icon-arrow-down"></view>
|
||||||
<view class="iconfont icon-arrow-down" style="font-size: 16px;"></view>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="list-call" v-if="selectedApiUrl === 'custom'">
|
</view>
|
||||||
<!-- 当选择自定义时显示输入框 -->
|
<view class="list-call" v-if="selectedApiUrl === 'custom'">
|
||||||
<input class="u-input" type="text" v-model="customApiUrl" maxlength="100" placeholder="请输入服务器地址"
|
<!-- 当选择自定义时显示输入框 -->
|
||||||
@blur="handleBlurInputUrl" />
|
<input class="u-input" type="text" v-model="customApiUrl" maxlength="100" placeholder="请输入服务器地址"
|
||||||
</view>
|
@blur="handleBlurInputUrl" />
|
||||||
</template>
|
</view>
|
||||||
<view class="list-call">
|
<view class="list-call">
|
||||||
<view class="iconfont icon-avatar" style="font-size: 22px;color:#5473e8;"></view>
|
<view class="iconfont icon-avatar" style="font-size: 22px;color:#5473e8;"></view>
|
||||||
<input class="u-input" type="text" v-model="login.username" maxlength="32"
|
<input class="u-input" type="text" v-model="login.username" maxlength="32"
|
||||||
@@ -105,7 +104,7 @@
|
|||||||
<!-- </view>-->
|
<!-- </view>-->
|
||||||
<!-- </view>-->
|
<!-- </view>-->
|
||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
<u-picker v-model="showApiUrlPicker" mode="selector" :range="apiUrlList" range-key="label"
|
<u-picker class="login-env-picker" v-model="showApiUrlPicker" mode="selector" :range="apiUrlList" range-key="label"
|
||||||
@confirm="onApiUrlConfirm" @cancel="showApiUrlPicker = false"></u-picker>
|
@confirm="onApiUrlConfirm" @cancel="showApiUrlPicker = false"></u-picker>
|
||||||
<!-- 版本信息显示 -->
|
<!-- 版本信息显示 -->
|
||||||
<view class="version-info">
|
<view class="version-info">
|
||||||
@@ -118,7 +117,7 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2013-Now http://aidex.vip All rights reserved.
|
* Copyright (c) 2013-Now http://aidex.vip All rights reserved.
|
||||||
*/
|
*/
|
||||||
import config from '@/common/config.js';
|
import config, { getTestApiUrl } from '@/common/config.js';
|
||||||
import base64 from '@/common/base64.js';
|
import base64 from '@/common/base64.js';
|
||||||
import util from '@/common/util.js';
|
import util from '@/common/util.js';
|
||||||
import md5 from '@/common/md5.js';
|
import md5 from '@/common/md5.js';
|
||||||
@@ -136,10 +135,9 @@ export default {
|
|||||||
password: ""
|
password: ""
|
||||||
},
|
},
|
||||||
showApiUrlPicker: false,
|
showApiUrlPicker: false,
|
||||||
// 根据环境设置默认URL和选项
|
selectedApiUrl: getTestApiUrl(),
|
||||||
selectedApiUrl: config.isDevelopment ? config.devApiUrlOptions[0].value : config.productionApiUrl,
|
|
||||||
customApiUrl: 'http://192.168.1.66:50002/hcscm_weave/pda/v1',
|
customApiUrl: 'http://192.168.1.66:50002/hcscm_weave/pda/v1',
|
||||||
apiUrlList: config.isDevelopment ? config.devApiUrlOptions : [],
|
apiUrlList: config.devApiUrlOptions,
|
||||||
phoneNo: '',
|
phoneNo: '',
|
||||||
//username: '',
|
//username: '',
|
||||||
//password: '',
|
//password: '',
|
||||||
@@ -159,6 +157,9 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
appName() {
|
||||||
|
return manifest.name || '';
|
||||||
|
},
|
||||||
appVersion() {
|
appVersion() {
|
||||||
return manifest.versionName;
|
return manifest.versionName;
|
||||||
},
|
},
|
||||||
@@ -168,16 +169,9 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
onShow() {
|
onShow() {
|
||||||
// 只在开发环境读取存储的URL
|
const testUrl = getTestApiUrl();
|
||||||
if (config.isDevelopment) {
|
util.updateApiUrl(testUrl);
|
||||||
uni.getStorage({
|
this.selectedApiUrl = testUrl;
|
||||||
key: 'ApiUrl',
|
|
||||||
success: (e) => {
|
|
||||||
util.updateApiUrl(e.data);
|
|
||||||
this.selectedApiUrl = e.data;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
uni.getStorage({
|
uni.getStorage({
|
||||||
key: 'UserInfo',
|
key: 'UserInfo',
|
||||||
@@ -300,21 +294,12 @@ export default {
|
|||||||
title: '登录中...'
|
title: '登录中...'
|
||||||
});
|
});
|
||||||
|
|
||||||
let currentApiUrl;
|
const currentApiUrl = this.selectedApiUrl === 'custom' ? this.customApiUrl : this.selectedApiUrl;
|
||||||
|
if (!currentApiUrl || currentApiUrl.length === 0) {
|
||||||
if (config.isDevelopment) {
|
this.$u.toast('请输入服务器地址');
|
||||||
// 开发环境:使用选择的URL
|
return;
|
||||||
currentApiUrl = this.selectedApiUrl === 'custom' ? this.customApiUrl : this.selectedApiUrl;
|
|
||||||
if (!currentApiUrl || currentApiUrl.length === 0) {
|
|
||||||
this.$u.toast('请输入服务器地址');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 更新store中的URL
|
|
||||||
this.$store.dispatch('updateApiUrl', currentApiUrl);
|
|
||||||
} else {
|
|
||||||
// 生产环境:使用固定的生产URL
|
|
||||||
currentApiUrl = config.productionApiUrl;
|
|
||||||
}
|
}
|
||||||
|
this.$store.dispatch('updateApiUrl', currentApiUrl);
|
||||||
|
|
||||||
if (this.login.username.length == 0) {
|
if (this.login.username.length == 0) {
|
||||||
this.$u.toast('请输入账号');
|
this.$u.toast('请输入账号');
|
||||||
@@ -339,14 +324,11 @@ export default {
|
|||||||
var aLoginUserData = res;
|
var aLoginUserData = res;
|
||||||
|
|
||||||
//console.log('--aLoginUserData->>' + JSON.stringify(aLoginUserData));
|
//console.log('--aLoginUserData->>' + JSON.stringify(aLoginUserData));
|
||||||
// 只在开发环境保存 apiurl 到本地存储
|
uni.setStorage({
|
||||||
if (config.isDevelopment) {
|
key: 'ApiUrl',
|
||||||
uni.setStorage({
|
data: currentApiUrl
|
||||||
key: 'ApiUrl',
|
});
|
||||||
data: currentApiUrl
|
util.updateApiUrl(currentApiUrl);
|
||||||
});
|
|
||||||
util.updateApiUrl(currentApiUrl);
|
|
||||||
}
|
|
||||||
// 保存 token 到本地存储
|
// 保存 token 到本地存储
|
||||||
uni.setStorageSync('RemoteTokenData', aLoginUserData);
|
uni.setStorageSync('RemoteTokenData', aLoginUserData);
|
||||||
|
|
||||||
@@ -456,18 +438,14 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
handleBlurInputUrl(e) {
|
handleBlurInputUrl(e) {
|
||||||
// 只在开发环境处理自定义URL
|
const url = e.detail.value.trim();
|
||||||
if (config.isDevelopment) {
|
if (url) {
|
||||||
const url = e.detail.value.trim();
|
this.customApiUrl = url;
|
||||||
if (url) {
|
uni.setStorage({
|
||||||
this.customApiUrl = url;
|
key: 'ApiUrl',
|
||||||
// 保存到本地存储
|
data: url
|
||||||
uni.setStorage({
|
});
|
||||||
key: 'ApiUrl',
|
util.updateApiUrl(url);
|
||||||
data: url
|
|
||||||
});
|
|
||||||
util.updateApiUrl(url);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -476,14 +454,25 @@ export default {
|
|||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import 'index.scss';
|
@import 'index.scss';
|
||||||
|
|
||||||
|
.env-call {
|
||||||
|
height: auto;
|
||||||
|
min-height: 140rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.server-selector {
|
.server-selector {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 10rpx 0;
|
min-height: 80rpx;
|
||||||
|
padding: 16rpx 0;
|
||||||
|
font-size: 40rpx;
|
||||||
border-bottom: 1px solid #eee;
|
border-bottom: 1px solid #eee;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.server-selector .icon-arrow-down {
|
||||||
|
font-size: 28px;
|
||||||
|
}
|
||||||
|
|
||||||
.list-call {
|
.list-call {
|
||||||
.u-select {
|
.u-select {
|
||||||
margin-bottom: 10rpx;
|
margin-bottom: 10rpx;
|
||||||
@@ -499,7 +488,16 @@ export default {
|
|||||||
height: 150rpx;
|
height: 150rpx;
|
||||||
// max-width: 5%;
|
// max-width: 5%;
|
||||||
// max-height: 5%;
|
// max-height: 5%;
|
||||||
margin: 10rpx auto 10rpx auto;
|
margin: 10rpx auto 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.app-name {
|
||||||
|
margin: 8rpx 0 24rpx;
|
||||||
|
color: #242820;
|
||||||
|
font-size: 40rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
line-height: 1.3;
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logoimg {
|
.logoimg {
|
||||||
@@ -598,3 +596,23 @@ export default {
|
|||||||
margin-left: 10rpx;
|
margin-left: 10rpx;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.login-env-picker {
|
||||||
|
::v-deep .u-picker-header,
|
||||||
|
::v-deep .u-btn-picker {
|
||||||
|
height: 100rpx;
|
||||||
|
font-size: 36rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .u-picker-body {
|
||||||
|
height: 560rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .u-column-item,
|
||||||
|
::v-deep .u-line-1 {
|
||||||
|
height: 88rpx;
|
||||||
|
font-size: 40rpx;
|
||||||
|
line-height: 88rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -47,14 +47,22 @@
|
|||||||
<!--<u-cell-item icon="account" :iconStyle="{ color: '#27c0dc' }" title="关于我们" @click="navTo('about')"></u-cell-item>
|
<!--<u-cell-item icon="account" :iconStyle="{ color: '#27c0dc' }" title="关于我们" @click="navTo('about')"></u-cell-item>
|
||||||
<u-cell-item icon="kefu-ermai" :iconStyle="{ color: '#ff8a00' }" title="联系客服" @click="navTo('service')"></u-cell-item>!-->
|
<u-cell-item icon="kefu-ermai" :iconStyle="{ color: '#ff8a00' }" title="联系客服" @click="navTo('service')"></u-cell-item>!-->
|
||||||
<u-gap height="20" bg-color="#f5f5f5"></u-gap>
|
<u-gap height="20" bg-color="#f5f5f5"></u-gap>
|
||||||
|
<u-cell-item icon="reload" :iconStyle="{ color: '#19be6b' }" title="版本更新" @click="upgrade"></u-cell-item>
|
||||||
<u-cell-item icon="setting" :iconStyle="{ color: '#2767dc' }" title="系统设置" @click="navTo('setting')"></u-cell-item>
|
<u-cell-item icon="setting" :iconStyle="{ color: '#2767dc' }" title="系统设置" @click="navTo('setting')"></u-cell-item>
|
||||||
</u-cell-group>
|
</u-cell-group>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="app-meta">
|
||||||
|
<text class="app-name">{{ appName }}</text>
|
||||||
|
<text class="app-version">版本 {{ appVersion }}</text>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import CommonNavbar from "@/components/common-navbar/index";
|
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 manifest from '@/manifest.json';
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2013-Now http://aidex.vip All rights reserved.
|
* Copyright (c) 2013-Now http://aidex.vip All rights reserved.
|
||||||
*/
|
*/
|
||||||
@@ -73,6 +81,12 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
|
appName() {
|
||||||
|
return manifest.name || '';
|
||||||
|
},
|
||||||
|
appVersion() {
|
||||||
|
return manifest.versionName || '';
|
||||||
|
},
|
||||||
avatarUrl() {
|
avatarUrl() {
|
||||||
// let url = this.vuex_user.avatarUrl || '/ctxPath/static/images/user1.jpg';
|
// let url = this.vuex_user.avatarUrl || '/ctxPath/static/images/user1.jpg';
|
||||||
// url = url.replace('/ctxPath/', this.vuex_config.baseUrl + '/');
|
// url = url.replace('/ctxPath/', this.vuex_config.baseUrl + '/');
|
||||||
@@ -102,25 +116,29 @@ export default {
|
|||||||
},
|
},
|
||||||
upgrade(){
|
upgrade(){
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
this.$u.api.upgradeCheck().then(res => {
|
app_upgrade(async () => {
|
||||||
if (res.result == 'true'){
|
const appInfo = await new Promise((resolve) => {
|
||||||
uni.showModal({
|
plus.runtime.getProperty(plus.runtime.appid, (inf) => {
|
||||||
title: '提示',
|
resolve(inf);
|
||||||
content: res.message + '是否下载更新?',
|
|
||||||
showCancel: true,
|
|
||||||
success: function (res2) {
|
|
||||||
if (res2.confirm) {
|
|
||||||
plus.runtime.openURL(res.data.apkUrl);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}else{
|
});
|
||||||
this.$u.toast(res.message);
|
const res = await this.$u.api.upgradeCheck({
|
||||||
|
app_name: config.upgradeName,
|
||||||
|
current_version: appInfo.version
|
||||||
|
});
|
||||||
|
if (!res.download_url) {
|
||||||
|
this.$u.toast('当前版本已是最新版');
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
});
|
return {
|
||||||
|
changelog: res.message + ',最新版本:' + res.latest_version,
|
||||||
|
status: res.need_update ? 1 : 0,
|
||||||
|
path: res.download_url
|
||||||
|
};
|
||||||
|
}, 1);
|
||||||
// #endif
|
// #endif
|
||||||
// #ifndef APP-PLUS
|
// #ifndef APP-PLUS
|
||||||
this.$u.toast('小程序端或H5端无需检查更新')
|
this.$u.toast('小程序端或H5端已是最新版,无需检查更新!');
|
||||||
// #endif
|
// #endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -145,4 +163,22 @@ page {
|
|||||||
height:50rpx;
|
height:50rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.app-meta {
|
||||||
|
padding: 48rpx 30rpx 40rpx;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.app-name {
|
||||||
|
display: block;
|
||||||
|
color: #242820;
|
||||||
|
font-size: 36rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
line-height: 1.4;
|
||||||
|
}
|
||||||
|
.app-version {
|
||||||
|
display: block;
|
||||||
|
margin-top: 8rpx;
|
||||||
|
color: #8a8f86;
|
||||||
|
font-size: 32rpx;
|
||||||
|
line-height: 1.3;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ export default {
|
|||||||
const res = await this.$u.api.dictionary.getDetailEnumList({
|
const res = await this.$u.api.dictionary.getDetailEnumList({
|
||||||
dictionary_id: DICTIONARY_TYPE_SCANNER,
|
dictionary_id: DICTIONARY_TYPE_SCANNER,
|
||||||
});
|
});
|
||||||
const list = Array.isArray(res) ? res : [];
|
const list = Array.isArray(res) ? res : (Array.isArray(res && res.list) ? res.list : []);
|
||||||
const builtinConfigs = this.getScannerConfigs();
|
const builtinConfigs = this.getScannerConfigs();
|
||||||
if (list.length) {
|
if (list.length) {
|
||||||
this.configList = list
|
this.configList = list
|
||||||
@@ -98,6 +98,8 @@ export default {
|
|||||||
this.useFallbackConfigList();
|
this.useFallbackConfigList();
|
||||||
}
|
}
|
||||||
this.ensurePhoneScanOption();
|
this.ensurePhoneScanOption();
|
||||||
|
this.ensureSeuicOption();
|
||||||
|
this.ensureNlscanOption();
|
||||||
this.initFormFromSaved();
|
this.initFormFromSaved();
|
||||||
},
|
},
|
||||||
useFallbackConfigList() {
|
useFallbackConfigList() {
|
||||||
@@ -110,6 +112,30 @@ export default {
|
|||||||
this.configList.push(phoneConfig);
|
this.configList.push(phoneConfig);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
ensureBuiltinScannerOption(brand) {
|
||||||
|
const builtinConfig = this.getScannerConfigs().find((item) => item.brand === brand);
|
||||||
|
if (!builtinConfig) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const exists = this.configList.some((item) => {
|
||||||
|
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, builtinConfig);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.configList.push(builtinConfig);
|
||||||
|
},
|
||||||
|
ensureSeuicOption() {
|
||||||
|
this.ensureBuiltinScannerOption('seuic');
|
||||||
|
},
|
||||||
|
ensureNlscanOption() {
|
||||||
|
this.ensureBuiltinScannerOption('nlscan');
|
||||||
|
},
|
||||||
initFormFromSaved() {
|
initFormFromSaved() {
|
||||||
const savedConfig = getScanConfig(this.getScannerConfigs());
|
const savedConfig = getScanConfig(this.getScannerConfigs());
|
||||||
if (savedConfig) {
|
if (savedConfig) {
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
<u-cell-group :border="false">
|
<u-cell-group :border="false">
|
||||||
<u-cell-item title="通用" @click="navTo('/pages/sys/user/currency')" :arrow="true"></u-cell-item>
|
<u-cell-item title="通用" @click="navTo('/pages/sys/user/currency')" :arrow="true"></u-cell-item>
|
||||||
<u-gap height="20" bg-color="#f5f5f5"></u-gap>
|
<u-gap height="20" bg-color="#f5f5f5"></u-gap>
|
||||||
<u-cell-item title="版本更新" @click="upgrade()" :arrow="true"></u-cell-item>
|
|
||||||
<u-cell-item title="隐私政策" @click="navTo('')" :arrow="true"></u-cell-item>
|
<u-cell-item title="隐私政策" @click="navTo('')" :arrow="true"></u-cell-item>
|
||||||
<u-cell-item title="用户协议" @click="navTo('')" :arrow="true"></u-cell-item>
|
<u-cell-item title="用户协议" @click="navTo('')" :arrow="true"></u-cell-item>
|
||||||
</u-cell-group>
|
</u-cell-group>
|
||||||
@@ -18,10 +17,6 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2013-Now http://aidex.vip All rights reserved.
|
* Copyright (c) 2013-Now http://aidex.vip All rights reserved.
|
||||||
*/
|
*/
|
||||||
import app_upgrade from '@/uni_modules/app-upgrade/js_sdk/index.js'
|
|
||||||
import util from '@/common/util.js';
|
|
||||||
import config from '../../../common/config';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -34,36 +29,6 @@ export default {
|
|||||||
url: url
|
url: url
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
upgrade(){
|
|
||||||
// #ifdef APP-PLUS
|
|
||||||
app_upgrade(async ()=>{
|
|
||||||
// 获取应用信息
|
|
||||||
const appInfo = await new Promise((resolve) => {
|
|
||||||
plus.runtime.getProperty(plus.runtime.appid, (inf) => {
|
|
||||||
resolve(inf);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
const res = await this.$u.api.upgradeCheck({
|
|
||||||
app_name: config.upgradeName,
|
|
||||||
current_version: appInfo.version
|
|
||||||
})
|
|
||||||
console.log('res',res)
|
|
||||||
if(!res.download_url){
|
|
||||||
this.$u.toast('当前版本已是最新版');
|
|
||||||
return
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
changelog: res.message + ',最新版本:' + res.latest_version,
|
|
||||||
|
|
||||||
status: res.need_update ? 1 : 0, // 0 无新版本 | 1 有新版本
|
|
||||||
path: res.download_url // 新apk地址
|
|
||||||
}
|
|
||||||
}, 1)
|
|
||||||
// #endif
|
|
||||||
// #ifndef APP-PLUS
|
|
||||||
this.$u.toast('小程序端或H5端已是最新版,无需检查更新!');
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
openSettings() {
|
openSettings() {
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
uni.getSystemInfo({
|
uni.getSystemInfo({
|
||||||
|
|||||||
+257
-251
@@ -1,298 +1,304 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="wrap">
|
<view class="app-center">
|
||||||
<common-navbar title="工作台" :showBack="false">
|
<view class="app-center__status" :style="{ height: statusBarHeight + 'px' }"></view>
|
||||||
<template #right>
|
<view class="app-center__header">
|
||||||
<view class="scan_box">
|
<text class="app-center__version">v{{ appVersion }}</text>
|
||||||
<u-icon name="scan" color="#333333" size="46" @click="handleScan"></u-icon>
|
<text class="app-center__title">工作台</text>
|
||||||
|
<view class="app-center__setting" @click="navTo('/pages/sys/user/setting')">
|
||||||
|
<u-icon name="setting" color="#333333" size="34"></u-icon>
|
||||||
|
<text>设置</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="app-center__grid">
|
||||||
|
<view
|
||||||
|
v-for="item in menuList"
|
||||||
|
:key="item.path"
|
||||||
|
class="menu-card"
|
||||||
|
:class="item.tone"
|
||||||
|
hover-class="menu-card--pressed"
|
||||||
|
@click="navTo(item.path)"
|
||||||
|
>
|
||||||
|
<image class="menu-card__bg" :src="item.bg" mode="aspectFill"></image>
|
||||||
|
<view class="menu-card__mask"></view>
|
||||||
|
<text class="menu-card__quote">“</text>
|
||||||
|
<view v-if="item.tag" class="menu-card__tag">
|
||||||
|
<text>{{ item.tag }}</text>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
<view class="menu-card__body">
|
||||||
</common-navbar>
|
<text class="menu-card__name">{{ item.name }}</text>
|
||||||
<!-- <view class="workbench-title">销售管理</view>-->
|
<text class="menu-card__en">{{ item.en }}</text>
|
||||||
<!-- <view class="toolbar">-->
|
</view>
|
||||||
<!-- <u-grid class="grid" :col="4" :border="false">-->
|
<view class="menu-card__arrow">
|
||||||
<!-- <u-grid-item :index="0" @click="navTo('/pages/saleship/salepickscan')">-->
|
<text>›</text>
|
||||||
<!-- <view class="home-icon icon-color05">-->
|
</view>
|
||||||
<!-- <i class="iconfont icon-hetongguanli"></i>-->
|
</view>
|
||||||
<!-- </view>-->
|
|
||||||
<!-- <view class="grid-text">成品配布</view>-->
|
|
||||||
<!-- </u-grid-item>-->
|
|
||||||
<!-- <u-grid-item :index="1" @click="navTo('/pages/storegoods/QRBarCodeReview')">-->
|
|
||||||
<!-- <view class="home-icon icon-color02">-->
|
|
||||||
<!-- <i class="iconfont icon-mall-bag"></i>-->
|
|
||||||
<!-- </view>-->
|
|
||||||
<!-- <view class="grid-text">标签检测</view>-->
|
|
||||||
<!-- </u-grid-item>-->
|
|
||||||
<!-- </u-grid>-->
|
|
||||||
<!-- </view>-->
|
|
||||||
<!-- <view class="workbench-title">成品管理</view>-->
|
|
||||||
<!-- <view class="toolbar">-->
|
|
||||||
<!-- <u-grid class="grid" :col="4" :border="false">-->
|
|
||||||
<!-- <u-grid-item :index="0" @click="navTo('/pages/storegoods/dyeworksDyeback')">-->
|
|
||||||
<!-- <view class="home-icon icon-color04">-->
|
|
||||||
<!-- <i class="iconfont icon-finance"></i>-->
|
|
||||||
<!-- </view>-->
|
|
||||||
<!-- <view class="grid-text">染整进仓</view>-->
|
|
||||||
<!-- </u-grid-item>-->
|
|
||||||
<!-- <u-grid-item :index="1" @click="navTo('/pages/storegoods/storeGoodsBusinessIn')">-->
|
|
||||||
<!-- <view class="home-icon icon-color03">-->
|
|
||||||
<!-- <i class="iconfont icon-mall-bag"></i>-->
|
|
||||||
<!-- </view>-->
|
|
||||||
<!-- <view class="grid-text">成品进仓</view>-->
|
|
||||||
<!-- </u-grid-item>-->
|
|
||||||
<!-- <u-grid-item :index="2" @click="navTo('/pages/storegoods/storeGoodsBusinessOut')">-->
|
|
||||||
<!-- <view class="home-icon icon-color12">-->
|
|
||||||
<!-- <i class="iconfont icon-baoxiaodan"></i>-->
|
|
||||||
<!-- </view>-->
|
|
||||||
<!-- <view class="grid-text">成品出仓</view>-->
|
|
||||||
<!-- </u-grid-item>-->
|
|
||||||
<!-- <u-grid-item @click="navTo('/pages/storegoods/storeGoodsBusinessCheck')">-->
|
|
||||||
<!-- <view class="home-icon icon-color04">-->
|
|
||||||
<!-- <i class="iconfont icon-shenpi"></i>-->
|
|
||||||
<!-- </view>-->
|
|
||||||
<!-- <view class="grid-text">成品盘点</view>-->
|
|
||||||
<!-- </u-grid-item>-->
|
|
||||||
<!-- <u-grid-item @click="navTo('/pages/storegoods/storeGoodsBusinessStationMoveOnly')">-->
|
|
||||||
<!-- <view class="home-icon icon-color04">-->
|
|
||||||
<!-- <i class="iconfont icon-shenpi"></i>-->
|
|
||||||
<!-- </view>-->
|
|
||||||
<!-- <view class="grid-text">成品移架</view>-->
|
|
||||||
<!-- </u-grid-item>-->
|
|
||||||
<!-- <u-grid-item @click="navTo('/pages/storegoods/storegoodsstoresearch')">-->
|
|
||||||
<!-- <view class="home-icon icon-color04">-->
|
|
||||||
<!-- <i class="iconfont icon-shenpi"></i>-->
|
|
||||||
<!-- </view>-->
|
|
||||||
<!-- <view class="grid-text">成品库存</view>-->
|
|
||||||
<!-- </u-grid-item>-->
|
|
||||||
<!-- <u-grid-item @click="navTo('/pages/storegoods/storegoodsstoreallin')">-->
|
|
||||||
<!-- <view class="home-icon icon-color04">-->
|
|
||||||
<!-- <i class="iconfont icon-shenpi"></i>-->
|
|
||||||
<!-- </view>-->
|
|
||||||
<!-- <view class="grid-text">进仓查询</view>-->
|
|
||||||
<!-- </u-grid-item>-->
|
|
||||||
<!-- <u-grid-item @click="navTo('/pages/storegoods/storegoodsstoreallout')">-->
|
|
||||||
<!-- <view class="home-icon icon-color04">-->
|
|
||||||
<!-- <i class="iconfont icon-shenpi"></i>-->
|
|
||||||
<!-- </view>-->
|
|
||||||
<!-- <view class="grid-text">出仓查询</view>-->
|
|
||||||
<!-- </u-grid-item>-->
|
|
||||||
<!-- </u-grid>-->
|
|
||||||
<!-- </view>-->
|
|
||||||
<view class="workbench-title">坯布管理</view>
|
|
||||||
<view class="toolbar">
|
|
||||||
<u-grid class="grid" :col="4" :border="false">
|
|
||||||
<!-- <u-grid-item @click="navTo('/pages/storefabric/storefabricInStore')">-->
|
|
||||||
<!-- <view class="home-icon icon-color04">-->
|
|
||||||
<!-- <i class="iconfont icon-hetongguanli"></i>-->
|
|
||||||
<!-- </view>-->
|
|
||||||
<!-- <view class="grid-text">坯布进仓</view>-->
|
|
||||||
<!-- </u-grid-item>-->
|
|
||||||
<u-grid-item @click="navTo('/pages/storefabric/storeFabricBusinessOutList')">
|
|
||||||
<view class="home-icon icon-color03">
|
|
||||||
<i class="iconfont icon-chucha"></i>
|
|
||||||
</view>
|
|
||||||
<view class="grid-text">坯布出库</view>
|
|
||||||
</u-grid-item>
|
|
||||||
<u-grid-item @click="navTo('/pages/storefabric/storeFabricWarehouseGroupList')">
|
|
||||||
<view class="home-icon icon-color05">
|
|
||||||
<i class="iconfont icon-huiyishi"></i>
|
|
||||||
</view>
|
|
||||||
<view class="grid-text">坯布库存</view>
|
|
||||||
</u-grid-item>
|
|
||||||
<!-- <u-grid-item @click="navTo('/pages/storefabric/storefabricstoreallin')">-->
|
|
||||||
<!-- <view class="home-icon icon-color05">-->
|
|
||||||
<!-- <i class="iconfont icon-huiyishi"></i>-->
|
|
||||||
<!-- </view>-->
|
|
||||||
<!-- <view class="grid-text">进仓查询</view>-->
|
|
||||||
<!-- </u-grid-item>-->
|
|
||||||
<!-- <u-grid-item @click="navTo('/pages/storefabric/storefabricstoreallout')">-->
|
|
||||||
<!-- <view class="home-icon icon-color05">-->
|
|
||||||
<!-- <i class="iconfont icon-huiyishi"></i>-->
|
|
||||||
<!-- </view>-->
|
|
||||||
<!-- <view class="grid-text">出仓查询</view>-->
|
|
||||||
<!-- </u-grid-item>-->
|
|
||||||
</u-grid>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import CommonNavbar from "@/components/common-navbar/index";
|
|
||||||
import scanMixin from '@/common/scanMixin.js';
|
import scanMixin from '@/common/scanMixin.js';
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2013-Now http://aidex.vip All rights reserved.
|
* Copyright (c) 2013-Now http://aidex.vip All rights reserved.
|
||||||
*/
|
*/
|
||||||
export default {
|
export default {
|
||||||
components: {
|
|
||||||
CommonNavbar,
|
|
||||||
},
|
|
||||||
mixins: [scanMixin],
|
mixins: [scanMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
show: false,
|
statusBarHeight: 20,
|
||||||
head: "/static/aidex/images/head.png",
|
appVersion: '1.1.10',
|
||||||
imgList: [
|
menuList: [
|
||||||
{ image: "/static/aidex/banner/banner01.png" },
|
{
|
||||||
//{image: '/static/aidex/banner/banner02.png'},
|
name: '坯布出库',
|
||||||
//{image: '/static/aidex/banner/banner03.png'}
|
en: 'FABRIC OUT',
|
||||||
],
|
tag: '出库',
|
||||||
todoCount: 3,
|
path: '/pages/storefabric/storeFabricBusinessOutList',
|
||||||
// scanReceiver 和 isPageActive 已由 scanMixin 提供
|
tone: 'tone-out',
|
||||||
|
bg: '/static/img/workbench/fabric-out.jpg'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '坯布库存',
|
||||||
|
en: 'FABRIC STOCK',
|
||||||
|
tag: '库存',
|
||||||
|
path: '/pages/storefabric/storeFabricWarehouseGroupList',
|
||||||
|
tone: 'tone-stock',
|
||||||
|
bg: '/static/img/workbench/fabric-stock.jpg'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '手动进仓',
|
||||||
|
en: 'MANUAL ENTRY',
|
||||||
|
tag: '进仓',
|
||||||
|
path: '/pages/storefabric/storeFabricManualIn',
|
||||||
|
tone: 'tone-in',
|
||||||
|
bg: '/static/img/workbench/fabric-stock.jpg'
|
||||||
|
}
|
||||||
|
]
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
onLoad() {
|
onLoad() {
|
||||||
|
const sys = uni.getSystemInfoSync();
|
||||||
|
this.statusBarHeight = sys.statusBarHeight || 20;
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
plus.runtime.getProperty(plus.runtime.appid, (inf) => {
|
||||||
|
if (inf && inf.version) {
|
||||||
|
this.appVersion = inf.version;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// #endif
|
||||||
this.registerScanBroadcast(this.handleScanCode);
|
this.registerScanBroadcast(this.handleScanCode);
|
||||||
},
|
},
|
||||||
// onUnload, onHide, onShow 已由 scanMixin 自动处理
|
|
||||||
|
|
||||||
computed: {
|
|
||||||
contentStyle() {
|
|
||||||
const navHeight = getStatusBarHeight() + 44;
|
|
||||||
return {
|
|
||||||
height: `${navHeight}px`,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
// 自定义扫码处理回调 - 处理本页面特有的扫码逻辑
|
|
||||||
handleScanCode(scanResult) {
|
handleScanCode(scanResult) {
|
||||||
console.log('工作台-扫码结果:', scanResult);
|
|
||||||
const cleanResult = scanResult.trim().replace(/[\r\n]/g, '');
|
const cleanResult = scanResult.trim().replace(/[\r\n]/g, '');
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/saleship/salepickscandetail?order_no=' + cleanResult
|
url: '/pages/saleship/salepickscandetail?order_no=' + cleanResult
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
navTo(url) {
|
navTo(url) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({ url });
|
||||||
url: url,
|
}
|
||||||
});
|
}
|
||||||
},
|
|
||||||
imgListClick(index) {
|
|
||||||
console.log(`点击了第${index + 1}页图片`);
|
|
||||||
},
|
|
||||||
itemClick(index) {
|
|
||||||
console.log(index);
|
|
||||||
},
|
|
||||||
// 处理扫码(手动点击扫码按钮)
|
|
||||||
handleScan() {
|
|
||||||
if (this.usePhoneScanFallback) {
|
|
||||||
this.openPhoneScan();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// #ifdef APP-PLUS || MP-WEIXIN
|
|
||||||
uni.scanCode({
|
|
||||||
scanType: ['qrCode', 'barCode'], // 同时支持二维码和条形码
|
|
||||||
success: (res) => {
|
|
||||||
console.log('扫码成功:', res);
|
|
||||||
const cleanResult = res.result.trim().replace(/[\r\n]/g, '');
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/saleship/salepickscandetail?order_no=' + cleanResult
|
|
||||||
})
|
|
||||||
},
|
|
||||||
fail: (err) => {
|
|
||||||
console.error('扫码失败:', err);
|
|
||||||
uni.showToast({
|
|
||||||
title: '扫码失败',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
// #ifdef H5
|
|
||||||
uni.showToast({
|
|
||||||
title: "H5环境不支持扫码功能",
|
|
||||||
icon: "error",
|
|
||||||
});
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
// 处理扫码成功
|
|
||||||
handleScanSuccess(result) {
|
|
||||||
try {
|
|
||||||
// 这里可以根据实际需求处理扫码结果
|
|
||||||
// 例如:验证扫码结果的格式或内容
|
|
||||||
if (this.validateScanResult(result)) {
|
|
||||||
// 扫码验证通过,执行其他逻辑
|
|
||||||
uni.showToast({
|
|
||||||
title: "执行成功",
|
|
||||||
icon: "success",
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: "无效的二维码",
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error("处理扫码结果失败:", error);
|
|
||||||
uni.showToast({
|
|
||||||
title: "处理失败",
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// registerScanBroadcast 和 unregisterScanBroadcast 已由 scanMixin 提供
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import "index.scss";
|
page {
|
||||||
|
background: #eef1f4;
|
||||||
|
}
|
||||||
|
|
||||||
.scan_box {
|
.app-center {
|
||||||
|
min-height: 100vh;
|
||||||
|
background: #eef1f4;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.app-center__header {
|
||||||
|
position: relative;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
height: 88rpx;
|
||||||
.scan_text {
|
padding: 0 24rpx;
|
||||||
font-size: 12px;
|
background: #ffffff;
|
||||||
color: #2979ff;
|
border-bottom: 1rpx solid #e5e8ec;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.banner-box {
|
.app-center__version {
|
||||||
padding: 0 2%;
|
position: absolute;
|
||||||
width: 96%;
|
left: 24rpx;
|
||||||
height: 170rpx;
|
font-size: 24rpx;
|
||||||
margin: 30rpx 0 30rpx;
|
color: #9aa3ad;
|
||||||
|
line-height: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.u-swiper-wrap {
|
.app-center__title {
|
||||||
padding: 0 10px;
|
font-size: 36rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #1f2430;
|
||||||
|
letter-spacing: 2rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.banner-pic {
|
.app-center__setting {
|
||||||
width: 47%;
|
position: absolute;
|
||||||
float: left;
|
right: 24rpx;
|
||||||
display: inline-block;
|
display: flex;
|
||||||
margin: 0 1.5%;
|
align-items: center;
|
||||||
}
|
gap: 6rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
.banner-pic image {
|
|
||||||
width: 100%;
|
|
||||||
height: 170rpx;
|
|
||||||
border-radius: 12rpx;
|
|
||||||
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.u-mode-light-info {
|
|
||||||
background-color: #ffffff;
|
|
||||||
color: #666666;
|
|
||||||
border: 1px solid #e9ecf6;
|
|
||||||
font-size: 12px;
|
|
||||||
padding: 2px 8px;
|
|
||||||
position: relative;
|
|
||||||
top: -3px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.workbench-title {
|
|
||||||
font-size: 32rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #333333;
|
color: #333333;
|
||||||
padding: 15px 30rpx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.home-icon i.icon-tongzhi {
|
.app-center__grid {
|
||||||
font-size: 22px;
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 28rpx 48rpx 40rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-card {
|
||||||
|
position: relative;
|
||||||
|
width: 310rpx;
|
||||||
|
height: 200rpx;
|
||||||
|
margin-bottom: 22rpx;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
box-sizing: border-box;
|
||||||
|
box-shadow: 0 6rpx 14rpx rgba(20, 40, 70, 0.12);
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-card--pressed {
|
||||||
|
opacity: 0.88;
|
||||||
|
transform: scale(0.985);
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-card__bg {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
z-index: 0;
|
||||||
|
opacity: 0.38;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-card__mask {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-card__quote {
|
||||||
|
position: absolute;
|
||||||
|
left: 14rpx;
|
||||||
|
top: 2rpx;
|
||||||
|
font-size: 48rpx;
|
||||||
|
line-height: 1;
|
||||||
|
color: rgba(255, 255, 255, 0.55);
|
||||||
|
font-weight: 700;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-card__tag {
|
||||||
|
position: absolute;
|
||||||
|
top: 14rpx;
|
||||||
|
right: 48rpx;
|
||||||
|
padding: 2rpx 12rpx;
|
||||||
|
border-radius: 6rpx;
|
||||||
|
background: #ffffff;
|
||||||
|
z-index: 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-card__tag text {
|
||||||
|
font-size: 20rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
line-height: 1.2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-card__body {
|
||||||
|
position: absolute;
|
||||||
|
left: 22rpx;
|
||||||
|
right: 22rpx;
|
||||||
|
top: 50%;
|
||||||
|
transform: translateY(-42%);
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-card__name {
|
||||||
|
display: block;
|
||||||
|
font-size: 34rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #ffffff;
|
||||||
|
line-height: 1.2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-card__en {
|
||||||
|
display: block;
|
||||||
|
margin-top: 8rpx;
|
||||||
|
font-size: 18rpx;
|
||||||
|
letter-spacing: 1rpx;
|
||||||
|
color: rgba(255, 255, 255, 0.88);
|
||||||
|
line-height: 1.2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-card__arrow {
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
width: 48rpx;
|
||||||
|
height: 42rpx;
|
||||||
|
background: #eef1f4;
|
||||||
|
border-top-left-radius: 16rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
z-index: 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-card__arrow text {
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: #8a93a0;
|
||||||
|
line-height: 1;
|
||||||
|
margin-top: -4rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tone-out {
|
||||||
|
background: #e14b3b;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tone-out .menu-card__mask {
|
||||||
|
background: rgba(225, 75, 59, 0.72);
|
||||||
|
}
|
||||||
|
|
||||||
|
.tone-out .menu-card__tag text {
|
||||||
|
color: #e14b3b;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tone-stock {
|
||||||
|
background: #2f78e6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tone-stock .menu-card__mask {
|
||||||
|
background: rgba(47, 120, 230, 0.72);
|
||||||
|
}
|
||||||
|
|
||||||
|
.tone-stock .menu-card__tag text {
|
||||||
|
color: #2f78e6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tone-in {
|
||||||
|
background: #3f51b5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tone-in .menu-card__mask {
|
||||||
|
background: rgba(63, 81, 181, 0.72);
|
||||||
|
}
|
||||||
|
|
||||||
|
.tone-in .menu-card__tag text {
|
||||||
|
color: #3f51b5;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 204 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 137 KiB |
+10
-23
@@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2013-Now http://aidex.vip All rights reserved.
|
* Copyright (c) 2013-Now http://aidex.vip All rights reserved.
|
||||||
*/
|
*/
|
||||||
import config from '@/common/config.js';
|
import config, { getTestApiUrl } from '@/common/config.js';
|
||||||
import util from '@/common/util.js';
|
import util from '@/common/util.js';
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import Vuex from 'vuex'
|
import Vuex from 'vuex'
|
||||||
@@ -21,19 +21,13 @@ try{
|
|||||||
|
|
||||||
// 初始化API URL
|
// 初始化API URL
|
||||||
function initApiUrl() {
|
function initApiUrl() {
|
||||||
if (config.isDevelopment) {
|
const testUrl = getTestApiUrl();
|
||||||
// 开发环境:从存储读取,如果没有则使用测试环境
|
try {
|
||||||
try {
|
uni.setStorageSync('ApiUrl', testUrl);
|
||||||
const savedApiUrl = uni.getStorageSync('ApiUrl');
|
} catch (e) {
|
||||||
return savedApiUrl || config.devApiUrlOptions[0].value;
|
console.log('写入测试环境地址失败', e);
|
||||||
} catch (e) {
|
|
||||||
console.log('读取存储的 apiurl 失败', e);
|
|
||||||
return config.devApiUrlOptions[0].value;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// 生产环境:使用固定的生产URL
|
|
||||||
return config.productionApiUrl;
|
|
||||||
}
|
}
|
||||||
|
return testUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 需要永久存储,且下次APP启动需要取出的,在state中的变量名
|
// 需要永久存储,且下次APP启动需要取出的,在state中的变量名
|
||||||
@@ -105,13 +99,7 @@ const store = new Vuex.Store({
|
|||||||
state.vuex_notificationAudio = audio;
|
state.vuex_notificationAudio = audio;
|
||||||
},
|
},
|
||||||
SET_API_URL(state, url) {
|
SET_API_URL(state, url) {
|
||||||
// 生产环境不允许修改URL
|
|
||||||
if (!config.isDevelopment) {
|
|
||||||
console.warn('生产环境不允许修改API URL');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
state.apiurl = url
|
state.apiurl = url
|
||||||
// 同时保存到本地存储
|
|
||||||
uni.setStorageSync('ApiUrl', url)
|
uni.setStorageSync('ApiUrl', url)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -173,6 +161,9 @@ const store = new Vuex.Store({
|
|||||||
uni.request({
|
uni.request({
|
||||||
url: util.apiurl + "/product/fpmArrangeOrder/getFpmArrangeOrderList",
|
url: util.apiurl + "/product/fpmArrangeOrder/getFpmArrangeOrderList",
|
||||||
method: "GET",
|
method: "GET",
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
sslVerify: false,
|
||||||
|
// #endif
|
||||||
header: {
|
header: {
|
||||||
platform: "2",
|
platform: "2",
|
||||||
Authorization: uni.getStorageSync("RemoteTokenData").token,
|
Authorization: uni.getStorageSync("RemoteTokenData").token,
|
||||||
@@ -221,10 +212,6 @@ const store = new Vuex.Store({
|
|||||||
name: 'vuex_messageList',
|
name: 'vuex_messageList',
|
||||||
value: newList
|
value: newList
|
||||||
});
|
});
|
||||||
uni.setTabBarBadge({
|
|
||||||
index: 0,
|
|
||||||
text: `${newList.length}`
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
// 使用 $uStore 方式更新状态
|
// 使用 $uStore 方式更新状态
|
||||||
commit('$uStore', {
|
commit('$uStore', {
|
||||||
|
|||||||
Reference in New Issue
Block a user