Compare commits
37
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7382154a8d | ||
|
|
b861487d9d | ||
|
|
6273ec0f19 | ||
|
|
4825cd13f2 | ||
|
|
036b331e9a | ||
|
|
5557819e64 | ||
|
|
69608b92d7 | ||
|
|
c6084e8b2c | ||
|
|
cc2d0218b5 | ||
|
|
ec57e43b25 | ||
|
|
f084afafcc | ||
|
|
a1caee64f7 | ||
|
|
0710e7cccf | ||
|
|
81618150ab | ||
|
|
7b11fc60c8 | ||
|
|
2764b27118 | ||
|
|
3ea99ce92f | ||
|
|
f56c40bb6d | ||
|
|
2903972e55 | ||
|
|
917d028ca0 | ||
|
|
7cf50486ef | ||
|
|
51222f608a | ||
|
|
fc6a514076 | ||
|
|
92b89f145c | ||
|
|
9e70b4a1f3 | ||
|
|
8243a82aa7 | ||
|
|
8f42cea11b | ||
|
|
b259e0c2e7 | ||
|
|
30e20853df | ||
|
|
6688fb3867 | ||
|
|
d9d1458b58 | ||
|
|
4faf1bf41a | ||
|
|
2347b84a8a | ||
|
|
8ec38126e6 | ||
|
|
55f13bb47b | ||
|
|
e785a99b7d | ||
|
|
470a474d70 |
@@ -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
|
||||||
VUE_APP_PRODUCTION_API_URL = https://www.haotopai.com/hcscm_weave/mes/server/pda/v1
|
VUE_APP_PRODUCTION_API_URL = https://zsfz.yushangfangzhi.com/hcscm/pda/v1
|
||||||
VUE_APP_DEV_API_URL = https://www.haotopai.com/hcscm_weave/mes/server/pda/v1
|
VUE_APP_DEV_API_URL = https://zsfz.yushangfangzhi.com/hcscm/pda/v1
|
||||||
|
|||||||
+2
-2
@@ -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
|
||||||
VUE_APP_PRODUCTION_API_URL = https://hcscmtest.zzfzyc.com/hcscm_weave/pda/v1
|
VUE_APP_PRODUCTION_API_URL = https://zsfz.yushangfangzhi.com/hcscm/pda/v1
|
||||||
VUE_APP_DEV_API_URL = https://hcscmtest.zzfzyc.com/hcscm_weave/pda/v1
|
VUE_APP_DEV_API_URL = https://zsfz.yushangfangzhi.com/hcscm/pda/v1
|
||||||
|
|||||||
@@ -101,3 +101,38 @@ pack.json内容如下:详情可访问 [CLI uni-app发行 - Android/iOS云打
|
|||||||
```
|
```
|
||||||
### 云服务器走CICD 打包:
|
### 云服务器走CICD 打包:
|
||||||
需要下载 [Linux HBuilderX Cli](https://ask.dcloud.net.cn/article/41469)
|
需要下载 [Linux HBuilderX Cli](https://ask.dcloud.net.cn/article/41469)
|
||||||
|
|
||||||
|
### 上传 PDA 安装包
|
||||||
|
|
||||||
|
云打包得到 APK 后,用命令行上传,等价于 ERP「开发者资源上传」里的安装包上传。周尚环境的登录和签名走 `https://zsfz.yushangfangzhi.com/hcscm`,安装包进入 `zhoushang` 空间。
|
||||||
|
|
||||||
|
先把 `src/manifest.json` 的 `versionName`、`versionCode` 改成新版本,再打包。安装包里的版本号必须和上传文件名一致,否则 PDA 会反复提示升级。
|
||||||
|
|
||||||
|
```
|
||||||
|
npm run upload:apk -- --file D:\path\你的.apk --target test
|
||||||
|
npm run upload:apk -- --file D:\path\你的.apk --target prod
|
||||||
|
```
|
||||||
|
|
||||||
|
`npm` 后面的 `--` 只是分隔符,用来把 `--file`、`--target` 传给脚本。也可以不经过 npm:
|
||||||
|
|
||||||
|
```
|
||||||
|
node scripts/upload-apk.js --file D:\path\你的.apk --target test
|
||||||
|
```
|
||||||
|
|
||||||
|
运行后输入 ERP 手机号和密码获取 token。账号下有多个账套时,再按序号选一次。
|
||||||
|
|
||||||
|
`--target` 只决定 APK 放到哪套 CDN,没有别的差别。生产环境的 PDA 也可以从测试 CDN 下载并安装。
|
||||||
|
|
||||||
|
| 参数 | 说明 |
|
||||||
|
|---|---|
|
||||||
|
| `--target test` | 周尚环境固定上传到 `https://zsfzcdn.yushangfangzhi.com` |
|
||||||
|
| `--target prod` | 其他环境的正式 CDN:`https://hcscm.cdn.zzfzyc.com` |
|
||||||
|
| `--mode` | 默认 `zhoushang`。可选 `zhoushang`、`zhisheng`、`mes`、`cjt` |
|
||||||
|
| `--version` | 可选。不传则用 `src/manifest.json` 的 `versionName` |
|
||||||
|
|
||||||
|
场景值取对应 `.env.{mode}` 里的 `VUE_APP_UPGRADE_NAME`。保存路径为 `/version/{场景值}/{版本号}.apk`。版本包上传成功后,同一份安装包会再传到 `/version/{场景值}/latest.apk`。本分支默认场景是 `.env.zhoushang` 的 `erp_pda_zhoushang`,上传成功后会打印完整下载地址,例如:
|
||||||
|
|
||||||
|
```
|
||||||
|
https://zsfzcdn.yushangfangzhi.com/version/erp_pda_zhoushang/1.1.9.apk
|
||||||
|
https://zsfzcdn.yushangfangzhi.com/version/erp_pda_zhoushang/latest.apk
|
||||||
|
```
|
||||||
|
|||||||
@@ -50,6 +50,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,334 @@
|
|||||||
|
/**
|
||||||
|
* 上传已打包的 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。
|
||||||
|
* 版本包上传成功后,再把同一份安装包上传为 /version/{upgradeName}/latest.apk。
|
||||||
|
* 运行时输入 ERP 手机号和密码获取 token。多个账套时再选择一次。
|
||||||
|
*/
|
||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
|
const readline = require('readline');
|
||||||
|
|
||||||
|
const ROOT = path.resolve(__dirname, '..');
|
||||||
|
const UPYUN_API = 'https://v0.api.upyun.com';
|
||||||
|
const DEFAULT_API_BASE = 'https://hcscmtest.zzfzyc.com/hcscm';
|
||||||
|
const DEFAULT_CDN_HOST = {
|
||||||
|
test: 'https://testhcscm.cdn.zzfzyc.com',
|
||||||
|
prod: 'https://hcscm.cdn.zzfzyc.com',
|
||||||
|
};
|
||||||
|
/** 周尚环境的安装包签到 zhoushang 空间,下载域名是 zsfzcdn */
|
||||||
|
const MODE_UPLOAD = {
|
||||||
|
zhoushang: {
|
||||||
|
apiBase: 'https://zsfz.yushangfangzhi.com/hcscm',
|
||||||
|
cdnHost: 'https://zsfzcdn.yushangfangzhi.com',
|
||||||
|
/** 该环境只有 status=1 返回了 zhoushang 空间,正式状态没有可用 bucket */
|
||||||
|
status: 1,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
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' || key === '--phone' || key === '--password' || key === '--tenant') {
|
||||||
|
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 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, { phone: phoneArg, password: passwordArg, tenant: tenantArg } = {}) {
|
||||||
|
const phone = phoneArg || await ask('手机号: ');
|
||||||
|
const password = passwordArg || 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) {
|
||||||
|
if (tenantArg) {
|
||||||
|
const picked = Number(tenantArg);
|
||||||
|
tenant = tenants[picked - 1];
|
||||||
|
if (!tenant) throw new Error('账套序号无效');
|
||||||
|
} else {
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
function toPublicUrl(cdnHost, saveKey, uploaded) {
|
||||||
|
if (uploaded.url && String(uploaded.url).startsWith('http')) return uploaded.url;
|
||||||
|
return `${cdnHost}${saveKey}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function uploadApkFile({ apiBase, token, apkPath, saveKey, fileName, status }) {
|
||||||
|
console.log(`场景路径: ${saveKey}`);
|
||||||
|
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(`空间: ${sign.bucket}`);
|
||||||
|
console.log(`正在上传 ${fileName}...`);
|
||||||
|
const uploaded = await uploadToUpyun({
|
||||||
|
bucket: sign.bucket,
|
||||||
|
authorization: sign.authorization,
|
||||||
|
policy: sign.policy,
|
||||||
|
filePath: apkPath,
|
||||||
|
fileName,
|
||||||
|
});
|
||||||
|
console.log('上传成功');
|
||||||
|
return uploaded;
|
||||||
|
}
|
||||||
|
|
||||||
|
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 modeUpload = MODE_UPLOAD[args.mode];
|
||||||
|
const status = modeUpload ? modeUpload.status : (args.target === 'prod' ? 2 : 1);
|
||||||
|
const fileName = `${version}.apk`;
|
||||||
|
const saveKey = `/version/${upgradeName}/${fileName}`;
|
||||||
|
const latestFileName = 'latest.apk';
|
||||||
|
const latestSaveKey = `/version/${upgradeName}/${latestFileName}`;
|
||||||
|
const apiBase = modeUpload ? modeUpload.apiBase : DEFAULT_API_BASE;
|
||||||
|
const cdnHost = modeUpload ? modeUpload.cdnHost : DEFAULT_CDN_HOST[args.target];
|
||||||
|
const token = await login(apiBase, {
|
||||||
|
phone: args.phone,
|
||||||
|
password: args.password,
|
||||||
|
tenant: args.tenant,
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(`版本号: ${version}`);
|
||||||
|
console.log(`签名接口: ${apiBase}`);
|
||||||
|
console.log(`CDN: ${cdnHost}`);
|
||||||
|
const uploaded = await uploadApkFile({
|
||||||
|
apiBase,
|
||||||
|
token,
|
||||||
|
apkPath,
|
||||||
|
saveKey,
|
||||||
|
fileName,
|
||||||
|
status,
|
||||||
|
});
|
||||||
|
console.log(toPublicUrl(cdnHost, saveKey, uploaded));
|
||||||
|
|
||||||
|
const latestUploaded = await uploadApkFile({
|
||||||
|
apiBase,
|
||||||
|
token,
|
||||||
|
apkPath,
|
||||||
|
saveKey: latestSaveKey,
|
||||||
|
fileName: latestFileName,
|
||||||
|
status,
|
||||||
|
});
|
||||||
|
console.log(toPublicUrl(cdnHost, latestSaveKey, latestUploaded));
|
||||||
|
}
|
||||||
|
|
||||||
|
main().catch((error) => {
|
||||||
|
console.error(error.message || error);
|
||||||
|
process.exit(1);
|
||||||
|
});
|
||||||
+24
@@ -6,6 +6,8 @@ import { audioManager } from '@/utils/audioManager'
|
|||||||
|
|
||||||
import util from '@/common/util.js';
|
import util from '@/common/util.js';
|
||||||
import md5 from '@/common/md5.js';
|
import md5 from '@/common/md5.js';
|
||||||
|
import { getLoginData, restoreUserSession } from '@/common/userSession.js';
|
||||||
|
import { ensureScanConfigAfterLogin } from '@/common/scanAutoConfig.js';
|
||||||
export default {
|
export default {
|
||||||
globalData: {
|
globalData: {
|
||||||
AppName: '',
|
AppName: '',
|
||||||
@@ -25,11 +27,20 @@ import { audioManager } from '@/utils/audioManager'
|
|||||||
|
|
||||||
onLaunch() {
|
onLaunch() {
|
||||||
console.log('App Launch');
|
console.log('App Launch');
|
||||||
|
restoreUserSession();
|
||||||
|
|
||||||
// 初始化音频管理器
|
// 初始化音频管理器
|
||||||
audioManager.init();
|
audioManager.init();
|
||||||
// 初始化通知系统
|
// 初始化通知系统
|
||||||
this.$store.dispatch('initNotification');
|
this.$store.dispatch('initNotification');
|
||||||
|
|
||||||
|
// 已登录且本地无扫码配置时,自动匹配一次
|
||||||
|
const loginData = getLoginData();
|
||||||
|
if (loginData && loginData.token && this.$u && this.$u.api) {
|
||||||
|
ensureScanConfigAfterLogin(this.$u.api).catch((error) => {
|
||||||
|
console.log('启动时自动匹配扫码设置失败', error);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -374,4 +385,17 @@ import { audioManager } from '@/utils/audioManager'
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.u-select__search,
|
||||||
|
.u-action-sheet-search,
|
||||||
|
.u-dropdown-item__search {
|
||||||
|
height: 88rpx !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.u-select__search__input,
|
||||||
|
.u-action-sheet-search__input,
|
||||||
|
.u-dropdown-item__search__input {
|
||||||
|
font-size: 32rpx !important;
|
||||||
|
height: 88rpx !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -21,14 +21,14 @@ const config = {
|
|||||||
isDevelopment: isDevelopment,
|
isDevelopment: isDevelopment,
|
||||||
|
|
||||||
// 生产环境API URL(服务名段 hcscm)
|
// 生产环境API URL(服务名段 hcscm)
|
||||||
productionApiUrl: process.env.VUE_APP_PRODUCTION_API_URL || 'https://www.haotopai.com/hcscm/pda/v1',
|
productionApiUrl: process.env.VUE_APP_PRODUCTION_API_URL,
|
||||||
|
|
||||||
// 开发环境API URL选项(服务名段 hcscm)
|
// 开发环境API URL选项(服务名段 hcscm)
|
||||||
devApiUrlOptions: [
|
devApiUrlOptions: [
|
||||||
{ label: '测试环境', value: 'https://hcscmtest.zzfzyc.com/hcscm/pda/v1' },
|
{ label: '测试环境', value: 'https://hcscmtest.zzfzyc.com/hcscm/pda/v1' },
|
||||||
{ label: '本地环境', value: 'http://192.168.1.66:7010/hcscm/pda/v1' },
|
{ label: '本地环境', value: 'http://192.168.1.66:7010/hcscm/pda/v1' },
|
||||||
{ label: '本地穿透', value: 'https://2yd52gx88533.vicp.fun/hcscm/pda/v1' },
|
{ label: '本地穿透', value: 'https://2yd52gx88533.vicp.fun/hcscm/pda/v1' },
|
||||||
{ label: '正式环境', value: process.env.VUE_APP_DEV_API_URL || 'https://www.haotopai.com/hcscm/pda/v1' },
|
{ label: '正式环境', value: process.env.VUE_APP_PRODUCTION_API_URL },
|
||||||
{ label: '自定义', value: 'custom' }
|
{ label: '自定义', value: 'custom' }
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -142,6 +142,10 @@ const install = (Vue, vm) => {
|
|||||||
// PDA登录接口
|
// PDA登录接口
|
||||||
pdaLogin: (params = {}) => vm.$u.postJson('/login', params),
|
pdaLogin: (params = {}) => vm.$u.postJson('/login', params),
|
||||||
pdaLogout: (params = {}) => vm.$u.postJson('/logout', params),
|
pdaLogout: (params = {}) => vm.$u.postJson('/logout', params),
|
||||||
|
// 修改密码:PUT pda/v1/user/updatePassword
|
||||||
|
updatePassword: (params = {}) => vm.$u.putJson('/user/updatePassword', params),
|
||||||
|
// 登录后获取当前用户信息、菜单与按钮权限
|
||||||
|
pdaGetInformation: (params = {}) => vm.$u.get('/information', params),
|
||||||
// 获取配布单列表
|
// 获取配布单列表
|
||||||
getFpmArrangeOrderList: (params = {}) => vm.$u.get('/product/fpmArrangeOrder/getFpmArrangeOrderList', params),
|
getFpmArrangeOrderList: (params = {}) => vm.$u.get('/product/fpmArrangeOrder/getFpmArrangeOrderList', params),
|
||||||
// 获取成品配布单详情
|
// 获取成品配布单详情
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
* Copyright (c) 2013-Now http://aidex.vip All rights reserved.
|
* Copyright (c) 2013-Now http://aidex.vip All rights reserved.
|
||||||
*/
|
*/
|
||||||
// 此处第二个参数vm,就是我们在页面使用的this,你可以通过vm获取vuex等操作
|
// 此处第二个参数vm,就是我们在页面使用的this,你可以通过vm获取vuex等操作
|
||||||
|
import { clearUserSession } from '@/common/userSession.js';
|
||||||
|
|
||||||
const install = (Vue, vm) => {
|
const install = (Vue, vm) => {
|
||||||
// 通用请求头设定
|
// 通用请求头设定
|
||||||
const ajaxHeader = 'x-ajax';
|
const ajaxHeader = 'x-ajax';
|
||||||
@@ -32,6 +34,10 @@ const install = (Vue, vm) => {
|
|||||||
data: req.data,
|
data: req.data,
|
||||||
header: req.header
|
header: req.header
|
||||||
}, null, 2));
|
}, null, 2));
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
// Android 5.x 等老 PDA 不信任 Let's Encrypt 新证书链,关闭校验证书
|
||||||
|
req.sslVerify = false;
|
||||||
|
// #endif
|
||||||
if (!req.header){
|
if (!req.header){
|
||||||
req.header = [];
|
req.header = [];
|
||||||
}
|
}
|
||||||
@@ -43,8 +49,9 @@ const install = (Vue, vm) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 设定传递 Token 认证参数 aidex
|
// 设定传递 Token 认证参数 aidex
|
||||||
if (!req.header[sessionIdHeader] && vm.vuex_token){
|
if (!req.header[sessionIdHeader]){
|
||||||
req.header[sessionIdHeader] = vm.vuex_token;
|
const loginData = uni.getStorageSync('RemoteTokenData');
|
||||||
|
req.header[sessionIdHeader] = vm.vuex_token || (loginData && loginData.token) || '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// 为节省流量,记住我数据不是每次都发送的,当会话失效后,尝试重试登录 aidex
|
// 为节省流量,记住我数据不是每次都发送的,当会话失效后,尝试重试登录 aidex
|
||||||
@@ -65,11 +72,7 @@ const install = (Vue, vm) => {
|
|||||||
// 处理401未授权状态码
|
// 处理401未授权状态码
|
||||||
if (res.statusCode === 401) {
|
if (res.statusCode === 401) {
|
||||||
vm.$u.toast('登录已过期,请重新登录');
|
vm.$u.toast('登录已过期,请重新登录');
|
||||||
// 清除token和用户信息
|
clearUserSession();
|
||||||
uni.removeStorageSync('token');
|
|
||||||
vm.$u.vuex('vuex_token', '');
|
|
||||||
vm.$u.vuex('vuex_user', {});
|
|
||||||
// 跳转到登录页面
|
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/sys/login/index'
|
url: '/pages/sys/login/index'
|
||||||
});
|
});
|
||||||
@@ -177,6 +180,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,149 @@
|
|||||||
|
@import '@/common/pda-typography.scss';
|
||||||
|
|
||||||
|
page { background-color: #F8F8F8; }
|
||||||
|
.filterBar { display: flex; align-items: center; padding: 16rpx 20rpx; background: #fff; gap: 16rpx; }
|
||||||
|
.filterBtn {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
min-width: 88rpx;
|
||||||
|
min-height: 76rpx;
|
||||||
|
padding: 8rpx 10rpx;
|
||||||
|
border: 2rpx solid transparent;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-size: $pda-font-nav-sub;
|
||||||
|
line-height: 1.2;
|
||||||
|
color: #666;
|
||||||
|
background: #f5f6f8;
|
||||||
|
}
|
||||||
|
.filter-active {
|
||||||
|
color: #2979ff !important;
|
||||||
|
background: #d6e8ff !important;
|
||||||
|
border-color: #2979ff !important;
|
||||||
|
}
|
||||||
|
.filterBtn__icon {
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.filterBtn__badge {
|
||||||
|
position: absolute;
|
||||||
|
top: -8rpx;
|
||||||
|
right: -10rpx;
|
||||||
|
width: 18rpx;
|
||||||
|
height: 18rpx;
|
||||||
|
border: 4rpx 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;
|
||||||
|
}
|
||||||
|
::v-deep .pdaSelect .u-select__search__input {
|
||||||
|
font-size: $pda-font-body !important;
|
||||||
|
}
|
||||||
|
::v-deep .pdaSelect .u-select__loading,
|
||||||
|
::v-deep .pdaSelect .u-select__empty {
|
||||||
|
font-size: $pda-font-popup-sub !important;
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
export function hasFilterValue(value) {
|
||||||
|
if (value === '' || value === null || value === undefined) return false;
|
||||||
|
if (typeof value === 'string') return value.trim() !== '';
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function normalizeAuditStatus(value) {
|
||||||
|
if (!hasFilterValue(value) && value !== 0) return '';
|
||||||
|
const status = Number(value);
|
||||||
|
return Number.isNaN(status) ? '' : status;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isActiveFilterState(filters) {
|
||||||
|
if (!filters) return false;
|
||||||
|
return Object.keys(filters).some((key) => {
|
||||||
|
if (/_name$/.test(key)) return false;
|
||||||
|
return hasFilterValue(filters[key]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function normalizeFilterState(value, defaults) {
|
||||||
|
const filters = { ...defaults };
|
||||||
|
if (!value || typeof value !== 'object' || Array.isArray(value)) return filters;
|
||||||
|
|
||||||
|
Object.keys(filters).forEach((key) => {
|
||||||
|
if (key === 'audit_status') return;
|
||||||
|
if (typeof value[key] === 'string' || typeof value[key] === 'number') {
|
||||||
|
filters[key] = value[key];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Object.keys(filters).forEach((key) => {
|
||||||
|
if (!key.endsWith('_id') || hasFilterValue(filters[key])) return;
|
||||||
|
const nameKey = `${key.slice(0, -3)}_name`;
|
||||||
|
if (nameKey in filters) filters[nameKey] = '';
|
||||||
|
});
|
||||||
|
if (Object.prototype.hasOwnProperty.call(value, 'audit_status')) {
|
||||||
|
filters.audit_status = normalizeAuditStatus(value.audit_status);
|
||||||
|
}
|
||||||
|
return filters;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function withSelectedOption(list, selectedValue, selectedLabel) {
|
||||||
|
const rows = Array.isArray(list) ? list.slice() : [];
|
||||||
|
const exists = rows.some((item) => String(item.value) === String(selectedValue));
|
||||||
|
if (hasFilterValue(selectedValue) && !exists) {
|
||||||
|
rows.unshift({ value: selectedValue, label: selectedLabel || String(selectedValue) });
|
||||||
|
}
|
||||||
|
return [{ value: '', label: '全部' }].concat(rows);
|
||||||
|
}
|
||||||
@@ -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;
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
/**
|
||||||
|
* 从往来单位等列表接口中取出数组。
|
||||||
|
* 兼容拦截器解包后的 { list, total },以及完整响应
|
||||||
|
* { data: { code, data: { list, total } } }。
|
||||||
|
*/
|
||||||
|
export function extractList(data, depth = 0) {
|
||||||
|
if (!data || depth > 6) return [];
|
||||||
|
if (Array.isArray(data)) return data;
|
||||||
|
if (Array.isArray(data.list)) return data.list;
|
||||||
|
if (Array.isArray(data.items)) return data.items;
|
||||||
|
if (Array.isArray(data.records)) return data.records;
|
||||||
|
if (data.data && typeof data.data === 'object') return extractList(data.data, depth + 1);
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 将下拉/列表接口响应转为 u-select 所需的 { value, label } */
|
||||||
|
export function mapToSelectOptions(data) {
|
||||||
|
return extractList(data).filter((item) => item && typeof item === 'object').map((item) => ({
|
||||||
|
value: item.id != null ? item.id : item.value,
|
||||||
|
label: item.name || item.label || item.code || (item.id != null ? String(item.id) : ''),
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下拉远程搜索:把关键字写入接口常用的 name 参数。
|
||||||
|
* 空关键字时不带 name,让后端返回默认列表。
|
||||||
|
*/
|
||||||
|
export function withNameParam(params, keyword) {
|
||||||
|
const next = Object.assign({}, params || {});
|
||||||
|
const name = String(keyword || '').trim();
|
||||||
|
if (name) next.name = name;
|
||||||
|
else delete next.name;
|
||||||
|
return next;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const REMOTE_SELECT_TYPES = [
|
||||||
|
'染厂',
|
||||||
|
'加工单位',
|
||||||
|
'供应商',
|
||||||
|
'仓库名称',
|
||||||
|
'营销体系',
|
||||||
|
];
|
||||||
|
|
||||||
|
export function isRemoteSelectType(type) {
|
||||||
|
return REMOTE_SELECT_TYPES.indexOf(type) !== -1;
|
||||||
|
}
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
import { isRemoteSelectType } from '@/common/remoteSelect';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单页远程下拉搜索。
|
||||||
|
* 使用方需实现 fetchRemoteSelectOptions(type, keyword),返回 { value, label }[]。
|
||||||
|
*
|
||||||
|
* 注意:不要用 `_` / `$` 前缀的 data 字段名——Vue2 不会代理到 this,
|
||||||
|
* `++this._xxx` 会得到 NaN,导致列表不更新、loading 不关。
|
||||||
|
*/
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
selectSearching: false,
|
||||||
|
selectSearchSeq: 0,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
isRemoteSelect() {
|
||||||
|
return isRemoteSelectType(this.selectType);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
isRemoteSelectType,
|
||||||
|
openSelectPicker(type, cachedList) {
|
||||||
|
this.selectType = type;
|
||||||
|
this.selectList = Array.isArray(cachedList) ? cachedList.slice() : [];
|
||||||
|
this.selectShow = true;
|
||||||
|
},
|
||||||
|
onSelectSearch(keyword) {
|
||||||
|
if (!isRemoteSelectType(this.selectType)) return;
|
||||||
|
if (typeof this.fetchRemoteSelectOptions !== 'function') return;
|
||||||
|
const seq = ++this.selectSearchSeq;
|
||||||
|
this.selectSearching = true;
|
||||||
|
const finish = () => {
|
||||||
|
if (seq === this.selectSearchSeq) this.selectSearching = false;
|
||||||
|
};
|
||||||
|
Promise.resolve()
|
||||||
|
.then(() => this.fetchRemoteSelectOptions(this.selectType, keyword))
|
||||||
|
.then((list) => {
|
||||||
|
if (seq !== this.selectSearchSeq) return;
|
||||||
|
this.selectList = Array.isArray(list) ? list.slice() : [];
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
if (seq !== this.selectSearchSeq) return;
|
||||||
|
if (typeof this.showError === 'function') {
|
||||||
|
this.showError((e && e.message) || '搜索失败');
|
||||||
|
} else {
|
||||||
|
uni.showToast({ title: (e && e.message) || '搜索失败', icon: 'none' });
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(finish, finish);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
/**
|
||||||
|
* 登录后 / 冷启动:拉取扫码字典并在本地无配置时自动匹配写入
|
||||||
|
*/
|
||||||
|
import {
|
||||||
|
DICTIONARY_TYPE_SCANNER,
|
||||||
|
autoConfigureScanSettings,
|
||||||
|
} from '@/common/scanConfig.js';
|
||||||
|
|
||||||
|
function extractDictionaryList(res) {
|
||||||
|
if (Array.isArray(res)) return res;
|
||||||
|
if (res && Array.isArray(res.list)) return res.list;
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {object} api - this.$u.api
|
||||||
|
* @returns {Promise<{saved:boolean,skipped:boolean,config:object|null,reason?:string}>}
|
||||||
|
*/
|
||||||
|
export async function ensureScanConfigAfterLogin(api) {
|
||||||
|
if (!api || !api.dictionary || !api.dictionary.getDetailEnumList) {
|
||||||
|
return autoConfigureScanSettings({ remoteConfigs: [] });
|
||||||
|
}
|
||||||
|
|
||||||
|
let remoteConfigs = [];
|
||||||
|
try {
|
||||||
|
const res = await api.dictionary.getDetailEnumList({
|
||||||
|
dictionary_id: DICTIONARY_TYPE_SCANNER,
|
||||||
|
});
|
||||||
|
remoteConfigs = extractDictionaryList(res);
|
||||||
|
} catch (error) {
|
||||||
|
console.log('拉取扫码字典失败,改用内置配置自动匹配', error);
|
||||||
|
}
|
||||||
|
|
||||||
|
const result = autoConfigureScanSettings({ remoteConfigs });
|
||||||
|
if (result.skipped) {
|
||||||
|
console.log('本地已有扫码设置,跳过自动匹配', result.config && result.config.name);
|
||||||
|
} else if (result.saved) {
|
||||||
|
console.log('已自动写入扫码设置', result.config && result.config.name);
|
||||||
|
} else {
|
||||||
|
console.log('自动匹配扫码设置未写入', result.reason);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
+279
-6
@@ -10,6 +10,103 @@ export const PHONE_SCAN_CONFIG = {
|
|||||||
isPhoneScan: true,
|
isPhoneScan: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** 内置扫码配置:补 needSetup,并在字典拉不到时兜底 */
|
||||||
|
export const BUILTIN_SCANNER_CONFIGS = [
|
||||||
|
{
|
||||||
|
brand: 'newland',
|
||||||
|
name: '东大集成',
|
||||||
|
action: 'com.android.server.scannerservice.broadcast',
|
||||||
|
dataKey: 'scannerdata',
|
||||||
|
needSetup: true,
|
||||||
|
setupAction: 'com.android.scanner.service_settings',
|
||||||
|
setupParams: {
|
||||||
|
action_barcode_broadcast: 'com.android.server.scannerservice.broadcast',
|
||||||
|
key_barcode_broadcast: 'scannerdata',
|
||||||
|
endchar: 'ENTER',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
brand: 'sunmi',
|
||||||
|
name: '商米',
|
||||||
|
action: 'com.sunmi.scanner.ACTION_DATA_CODE_RECEIVED',
|
||||||
|
dataKey: 'data',
|
||||||
|
needSetup: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
brand: 'nlscan',
|
||||||
|
name: '新大陆',
|
||||||
|
action: 'nlscan.action.SCANNER_RESULT',
|
||||||
|
dataKey: 'SCAN_BARCODE1',
|
||||||
|
needSetup: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
brand: 'urovo',
|
||||||
|
name: '优博讯',
|
||||||
|
action: 'android.intent.ACTION_DECODE_DATA',
|
||||||
|
dataKey: 'barcode_string',
|
||||||
|
needSetup: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
brand: 'idata',
|
||||||
|
name: '盈达',
|
||||||
|
action: 'android.intent.action.SCANRESULT',
|
||||||
|
dataKey: 'value',
|
||||||
|
needSetup: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
brand: 'iData',
|
||||||
|
name: '海雅达',
|
||||||
|
action: 'com.android.scanner.broadcast',
|
||||||
|
dataKey: 'scandata',
|
||||||
|
needSetup: false,
|
||||||
|
},
|
||||||
|
{ ...PHONE_SCAN_CONFIG },
|
||||||
|
];
|
||||||
|
|
||||||
|
/** 设备关键词 / 常见扫码相关包名,用于自动识别 */
|
||||||
|
const DETECT_RULES = [
|
||||||
|
{
|
||||||
|
matchNames: ['商米'],
|
||||||
|
matchActions: ['com.sunmi.scanner.ACTION_DATA_CODE_RECEIVED'],
|
||||||
|
keywords: ['sunmi'],
|
||||||
|
packages: ['com.sunmi.scanner', 'woyou.aidlservice.jiuiv5'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
matchNames: ['新大陆'],
|
||||||
|
matchActions: ['nlscan.action.SCANNER_RESULT'],
|
||||||
|
keywords: ['newland', 'nls', 'nlscan'],
|
||||||
|
packages: ['com.nlscan.barcodescanner', 'com.newland'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
matchNames: ['优博讯'],
|
||||||
|
matchActions: ['android.intent.ACTION_DECODE_DATA'],
|
||||||
|
keywords: ['urovo'],
|
||||||
|
packages: ['com.urovo', 'com.ubx'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
matchNames: ['盈达'],
|
||||||
|
matchActions: ['android.intent.action.SCANRESULT'],
|
||||||
|
keywords: ['idata', 'yingda'],
|
||||||
|
packages: ['com.idata', 'com.android.scanner'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
matchNames: ['海雅达'],
|
||||||
|
matchActions: ['com.android.scanner.broadcast'],
|
||||||
|
keywords: ['iData', 'seui', 'haiyada'],
|
||||||
|
packages: ['com.android.scanner'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
matchNames: ['东大集成', '东集'],
|
||||||
|
matchActions: ['com.android.server.scannerservice.broadcast'],
|
||||||
|
keywords: ['seuic', 'eastcom', 'newland', 'nls'],
|
||||||
|
packages: ['com.android.scanner', 'com.seuic.scanner'],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const PDA_DEVICE_KEYWORDS = [
|
||||||
|
'newland', 'nls', 'sunmi', 'urovo', 'honeywell', 'idata', 'seuic', 'zebra', 'ubx',
|
||||||
|
];
|
||||||
|
|
||||||
const NO_SETUP_HINT_KEY = 'pda_scan_config_hint_shown';
|
const NO_SETUP_HINT_KEY = 'pda_scan_config_hint_shown';
|
||||||
|
|
||||||
export function isPhoneScanConfig(config) {
|
export function isPhoneScanConfig(config) {
|
||||||
@@ -33,13 +130,13 @@ function enrichFromBuiltinConfig(config, builtinConfigs = []) {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
...config,
|
...config,
|
||||||
needSetup: builtin.needSetup,
|
needSetup: config.needSetup != null ? config.needSetup : builtin.needSetup,
|
||||||
setupAction: builtin.setupAction || '',
|
setupAction: config.setupAction || builtin.setupAction || '',
|
||||||
setupParams: builtin.setupParams || null,
|
setupParams: config.setupParams || builtin.setupParams || null,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function normalizeConfig(raw, builtinConfigs = []) {
|
export function normalizeConfig(raw, builtinConfigs = BUILTIN_SCANNER_CONFIGS) {
|
||||||
if (!raw || typeof raw !== 'object') return null;
|
if (!raw || typeof raw !== 'object') return null;
|
||||||
|
|
||||||
const brand = String(raw.brand || raw.id || raw.dictionary_detail_id || raw.name || '');
|
const brand = String(raw.brand || raw.id || raw.dictionary_detail_id || raw.name || '');
|
||||||
@@ -66,11 +163,11 @@ export function normalizeConfig(raw, builtinConfigs = []) {
|
|||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function mapDictionaryToScannerConfig(raw, builtinConfigs = []) {
|
export function mapDictionaryToScannerConfig(raw, builtinConfigs = BUILTIN_SCANNER_CONFIGS) {
|
||||||
return normalizeConfig(raw, builtinConfigs);
|
return normalizeConfig(raw, builtinConfigs);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getScanConfig(builtinConfigs = []) {
|
export function getScanConfig(builtinConfigs = BUILTIN_SCANNER_CONFIGS) {
|
||||||
try {
|
try {
|
||||||
const data = uni.getStorageSync(STORAGE_KEY);
|
const data = uni.getStorageSync(STORAGE_KEY);
|
||||||
return normalizeConfig(data, builtinConfigs);
|
return normalizeConfig(data, builtinConfigs);
|
||||||
@@ -80,6 +177,10 @@ export function getScanConfig(builtinConfigs = []) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function hasLocalScanConfig(builtinConfigs = BUILTIN_SCANNER_CONFIGS) {
|
||||||
|
return !!getScanConfig(builtinConfigs);
|
||||||
|
}
|
||||||
|
|
||||||
export function saveScanConfig(config) {
|
export function saveScanConfig(config) {
|
||||||
const normalized = normalizeConfig(config);
|
const normalized = normalizeConfig(config);
|
||||||
if (!normalized) {
|
if (!normalized) {
|
||||||
@@ -109,3 +210,175 @@ export function markNoConfigHintShown() {
|
|||||||
console.log('记录扫码枪提示状态失败', e);
|
console.log('记录扫码枪提示状态失败', e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function mergeScannerConfigs(remoteConfigs = []) {
|
||||||
|
const configMap = new Map();
|
||||||
|
BUILTIN_SCANNER_CONFIGS.forEach((item) => {
|
||||||
|
if (!isPhoneScanConfig(item)) {
|
||||||
|
configMap.set(item.action || item.brand, item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
(remoteConfigs || []).forEach((raw) => {
|
||||||
|
const normalized = mapDictionaryToScannerConfig(raw);
|
||||||
|
if (!normalized || isPhoneScanConfig(normalized)) return;
|
||||||
|
configMap.set(normalized.action || normalized.brand, normalized);
|
||||||
|
});
|
||||||
|
const list = Array.from(configMap.values());
|
||||||
|
list.push({ ...PHONE_SCAN_CONFIG });
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getDeviceIdentity() {
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
try {
|
||||||
|
const Build = plus.android.importClass('android.os.Build');
|
||||||
|
return {
|
||||||
|
manufacturer: String(Build.MANUFACTURER || '').toLowerCase(),
|
||||||
|
model: String(Build.MODEL || '').toLowerCase(),
|
||||||
|
brand: String(Build.BRAND || '').toLowerCase(),
|
||||||
|
};
|
||||||
|
} catch (e) {
|
||||||
|
console.log('读取设备信息失败', e);
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
return { manufacturer: '', model: '', brand: '' };
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isPdaDevice() {
|
||||||
|
const identity = getDeviceIdentity();
|
||||||
|
const text = `${identity.manufacturer} ${identity.model} ${identity.brand}`;
|
||||||
|
return PDA_DEVICE_KEYWORDS.some((keyword) => text.includes(keyword.toLowerCase()));
|
||||||
|
}
|
||||||
|
|
||||||
|
function findDetectRule(config) {
|
||||||
|
return DETECT_RULES.find((rule) => {
|
||||||
|
if (rule.matchNames.includes(config.name)) return true;
|
||||||
|
if (rule.matchActions.includes(config.action)) return true;
|
||||||
|
return false;
|
||||||
|
}) || null;
|
||||||
|
}
|
||||||
|
|
||||||
|
function isPackageInstalled(packageName) {
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
try {
|
||||||
|
const main = plus.android.runtimeMainActivity();
|
||||||
|
const pm = main.getPackageManager();
|
||||||
|
plus.android.importClass(pm);
|
||||||
|
pm.getPackageInfo(packageName, 0);
|
||||||
|
return true;
|
||||||
|
} catch (e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function canResolveBroadcast(action) {
|
||||||
|
if (!action) return false;
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
try {
|
||||||
|
const main = plus.android.runtimeMainActivity();
|
||||||
|
const Intent = plus.android.importClass('android.content.Intent');
|
||||||
|
const pm = main.getPackageManager();
|
||||||
|
plus.android.importClass(pm);
|
||||||
|
const intent = new Intent(action);
|
||||||
|
const list = pm.queryBroadcastReceivers(intent, 0);
|
||||||
|
return !!(list && list.size && list.size() > 0);
|
||||||
|
} catch (e) {
|
||||||
|
console.log('探测广播接收方失败', action, e);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function scoreScannerConfig(config, identity) {
|
||||||
|
if (!config || isPhoneScanConfig(config)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
let score = 0;
|
||||||
|
const rule = findDetectRule(config);
|
||||||
|
const deviceText = `${identity.manufacturer} ${identity.model} ${identity.brand}`;
|
||||||
|
|
||||||
|
if (canResolveBroadcast(config.action)) {
|
||||||
|
score += 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rule) {
|
||||||
|
if ((rule.packages || []).some((pkg) => isPackageInstalled(pkg))) {
|
||||||
|
score += 60;
|
||||||
|
}
|
||||||
|
if ((rule.keywords || []).some((keyword) => deviceText.includes(String(keyword).toLowerCase()))) {
|
||||||
|
score += 40;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return score;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在候选配置中选出最匹配当前设备的一项;非 PDA 且无命中则回落手机扫码
|
||||||
|
*/
|
||||||
|
export function matchBestScanConfig(candidateConfigs = []) {
|
||||||
|
const configs = (candidateConfigs || [])
|
||||||
|
.map((item) => normalizeConfig(item))
|
||||||
|
.filter(Boolean);
|
||||||
|
const pdaConfigs = configs.filter((item) => !isPhoneScanConfig(item));
|
||||||
|
const identity = getDeviceIdentity();
|
||||||
|
|
||||||
|
let best = null;
|
||||||
|
let bestScore = 0;
|
||||||
|
pdaConfigs.forEach((config) => {
|
||||||
|
const score = scoreScannerConfig(config, identity);
|
||||||
|
if (score > bestScore) {
|
||||||
|
bestScore = score;
|
||||||
|
best = config;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (best && bestScore > 0) {
|
||||||
|
return best;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isPdaDevice()) {
|
||||||
|
return { ...PHONE_SCAN_CONFIG };
|
||||||
|
}
|
||||||
|
|
||||||
|
return pdaConfigs[0] || { ...PHONE_SCAN_CONFIG };
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 仅本地没有有效配置时,自动匹配并写入扫描设置
|
||||||
|
* @returns {{ saved: boolean, config: object|null, skipped: boolean, reason?: string }}
|
||||||
|
*/
|
||||||
|
export function autoConfigureScanSettings({ remoteConfigs = [] } = {}) {
|
||||||
|
const existing = getScanConfig();
|
||||||
|
if (existing) {
|
||||||
|
return {
|
||||||
|
saved: false,
|
||||||
|
skipped: true,
|
||||||
|
config: existing,
|
||||||
|
reason: 'local_exists',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const candidates = mergeScannerConfigs(remoteConfigs);
|
||||||
|
const matched = matchBestScanConfig(candidates);
|
||||||
|
if (!matched) {
|
||||||
|
return {
|
||||||
|
saved: false,
|
||||||
|
skipped: false,
|
||||||
|
config: null,
|
||||||
|
reason: 'no_match',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const saved = saveScanConfig(matched);
|
||||||
|
return {
|
||||||
|
saved,
|
||||||
|
skipped: false,
|
||||||
|
config: matched,
|
||||||
|
reason: saved ? 'saved' : 'save_failed',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|||||||
+18
-42
@@ -1,18 +1,16 @@
|
|||||||
// common/scanMixin.js
|
// common/scanMixin.js
|
||||||
// 多厂商PDA扫码器兼容方案 - 策略模式 + 配置表驱动
|
// 多厂商PDA扫码器兼容方案 - 策略模式 + 配置表驱动
|
||||||
import {
|
import {
|
||||||
|
BUILTIN_SCANNER_CONFIGS,
|
||||||
getScanConfig,
|
getScanConfig,
|
||||||
hasShownNoConfigHint,
|
hasShownNoConfigHint,
|
||||||
|
isPdaDevice as detectPdaDevice,
|
||||||
isPhoneScanConfig,
|
isPhoneScanConfig,
|
||||||
markNoConfigHintShown,
|
markNoConfigHintShown,
|
||||||
normalizeConfig,
|
normalizeConfig,
|
||||||
PHONE_SCAN_CONFIG,
|
PHONE_SCAN_CONFIG,
|
||||||
} from '@/common/scanConfig.js';
|
} from '@/common/scanConfig.js';
|
||||||
|
|
||||||
const PDA_DEVICE_KEYWORDS = [
|
|
||||||
'newland', 'nls', 'sunmi', 'urovo', 'zebra', 'honeywell', 'idata', 'seuic',
|
|
||||||
];
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -21,35 +19,14 @@ export default {
|
|||||||
registeredBrands: [],
|
registeredBrands: [],
|
||||||
remoteScannerConfigs: [],
|
remoteScannerConfigs: [],
|
||||||
usePhoneScanFallback: false,
|
usePhoneScanFallback: false,
|
||||||
|
phoneScanPanelOpen: false,
|
||||||
_scanCallback: null,
|
_scanCallback: null,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
getScannerConfigs() {
|
getScannerConfigs() {
|
||||||
return [
|
return BUILTIN_SCANNER_CONFIGS.map((item) => ({ ...item }));
|
||||||
{
|
|
||||||
brand: 'newland',
|
|
||||||
name: '东集',
|
|
||||||
action: 'com.android.server.scannerservice.broadcast',
|
|
||||||
dataKey: 'scannerdata',
|
|
||||||
needSetup: true,
|
|
||||||
setupAction: 'com.android.scanner.service_settings',
|
|
||||||
setupParams: {
|
|
||||||
action_barcode_broadcast: 'com.android.server.scannerservice.broadcast',
|
|
||||||
key_barcode_broadcast: 'scannerdata',
|
|
||||||
endchar: 'ENTER'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
brand: 'sunmi',
|
|
||||||
name: '商米',
|
|
||||||
action: 'com.sunmi.scanner.ACTION_DATA_CODE_RECEIVED',
|
|
||||||
dataKey: 'data',
|
|
||||||
needSetup: false
|
|
||||||
},
|
|
||||||
{ ...PHONE_SCAN_CONFIG },
|
|
||||||
];
|
|
||||||
},
|
},
|
||||||
|
|
||||||
getPhoneScanConfig() {
|
getPhoneScanConfig() {
|
||||||
@@ -57,20 +34,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
isPdaDevice() {
|
isPdaDevice() {
|
||||||
// #ifdef APP-PLUS
|
return detectPdaDevice();
|
||||||
try {
|
|
||||||
const Build = plus.android.importClass('android.os.Build');
|
|
||||||
const manufacturer = String(Build.MANUFACTURER || '').toLowerCase();
|
|
||||||
const model = String(Build.MODEL || '').toLowerCase();
|
|
||||||
return PDA_DEVICE_KEYWORDS.some((keyword) => {
|
|
||||||
return manufacturer.includes(keyword) || model.includes(keyword);
|
|
||||||
});
|
|
||||||
} catch (error) {
|
|
||||||
console.log('检测设备类型失败', error);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// #endif
|
|
||||||
return false;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
shouldUsePhoneScan() {
|
shouldUsePhoneScan() {
|
||||||
@@ -109,6 +73,15 @@ export default {
|
|||||||
return configs.length ? configs[0] : null;
|
return configs.length ? configs[0] : null;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
closePhoneScanPanel() {
|
||||||
|
this.phoneScanPanelOpen = false;
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 半屏连续扫:再次点击同一入口则收起 */
|
||||||
|
togglePhoneScanPanel() {
|
||||||
|
this.phoneScanPanelOpen = !this.phoneScanPanelOpen;
|
||||||
|
},
|
||||||
|
|
||||||
openPhoneScan(options = {}) {
|
openPhoneScan(options = {}) {
|
||||||
const callback = options.callback || this._scanCallback;
|
const callback = options.callback || this._scanCallback;
|
||||||
// #ifdef APP-PLUS || MP-WEIXIN
|
// #ifdef APP-PLUS || MP-WEIXIN
|
||||||
@@ -267,7 +240,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);
|
||||||
@@ -353,10 +327,12 @@ export default {
|
|||||||
|
|
||||||
onHide() {
|
onHide() {
|
||||||
this.isPageActive = false;
|
this.isPageActive = false;
|
||||||
|
this.closePhoneScanPanel();
|
||||||
},
|
},
|
||||||
|
|
||||||
onUnload() {
|
onUnload() {
|
||||||
this.isPageActive = false;
|
this.isPageActive = false;
|
||||||
|
this.closePhoneScanPanel();
|
||||||
this.unregisterScanBroadcast();
|
this.unregisterScanBroadcast();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
@import '@/common/pda-typography.scss';
|
||||||
|
|
||||||
|
.statusTag {
|
||||||
|
flex-shrink: 0;
|
||||||
|
font-size: $pda-font-body;
|
||||||
|
line-height: 1.25;
|
||||||
|
padding: 10rpx 22rpx;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.status-0 { background: #d9d9d9; color: #434343; }
|
||||||
|
.status-1 { background: #fa8c16; color: #fff; }
|
||||||
|
.status-2 { background: #52c41a; color: #fff; }
|
||||||
|
.status-3 { background: #f5222d; color: #fff; }
|
||||||
|
.status-4 { background: #8c8c8c; color: #fff; }
|
||||||
@@ -18,6 +18,13 @@ export const AUDIT_STATUS = {
|
|||||||
export const DRAFT_AUDIT_STATUS = 0;
|
export const DRAFT_AUDIT_STATUS = 0;
|
||||||
export const DRAFT_AUDIT_STATUS_NAME = '待保存';
|
export const DRAFT_AUDIT_STATUS_NAME = '待保存';
|
||||||
|
|
||||||
|
/** 将接口状态统一为数字,避免字符串导致按钮判断失效 */
|
||||||
|
export function toAuditStatus(status) {
|
||||||
|
const n = Number(status);
|
||||||
|
return Number.isFinite(n) ? n : DRAFT_AUDIT_STATUS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
export const AUDIT_STATUS_MAP = {
|
export const AUDIT_STATUS_MAP = {
|
||||||
1: '待审核',
|
1: '待审核',
|
||||||
2: '已审核',
|
2: '已审核',
|
||||||
@@ -80,14 +87,7 @@ export function getStatusOptions() {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 将下拉/列表接口响应转为 u-select 所需的 { value, label } */
|
export { mapToSelectOptions } from '@/common/remoteSelect';
|
||||||
export function mapToSelectOptions(data) {
|
|
||||||
const list = Array.isArray(data) ? data : (data && (data.list || data.items || data.records)) || [];
|
|
||||||
return list.map((item) => ({
|
|
||||||
value: item.id,
|
|
||||||
label: item.name || item.label || item.code || String(item.id),
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
// 匹数:后端以 0.01 匹存储(乘以100的整数),展示需除以100
|
// 匹数:后端以 0.01 匹存储(乘以100的整数),展示需除以100
|
||||||
export function formatRoll(value) {
|
export function formatRoll(value) {
|
||||||
@@ -124,8 +124,8 @@ export function normalizeOrder(order) {
|
|||||||
return {
|
return {
|
||||||
id: order.id,
|
id: order.id,
|
||||||
order_no: order.order_no || '',
|
order_no: order.order_no || '',
|
||||||
audit_status: order.audit_status,
|
audit_status: toAuditStatus(order.audit_status),
|
||||||
audit_status_name: order.audit_status_name || AUDIT_STATUS_MAP[order.audit_status] || '',
|
audit_status_name: order.audit_status_name || AUDIT_STATUS_MAP[toAuditStatus(order.audit_status)] || '',
|
||||||
// 表头
|
// 表头
|
||||||
sale_system_id: order.sale_system_id || '',
|
sale_system_id: order.sale_system_id || '',
|
||||||
sale_system_name: order.sale_system_name || '',
|
sale_system_name: order.sale_system_name || '',
|
||||||
@@ -477,11 +477,13 @@ export function formatDisplayTime(value, format = 'YYYY-MM-DD') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function canScanAtStatus(status) {
|
export function canScanAtStatus(status) {
|
||||||
return [AUDIT_STATUS.PENDING, AUDIT_STATUS.REJECTED].includes(status);
|
const s = toAuditStatus(status);
|
||||||
|
return s === AUDIT_STATUS.PENDING || s === AUDIT_STATUS.REJECTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isLockedOrderStatus(status) {
|
export function isLockedOrderStatus(status) {
|
||||||
return [AUDIT_STATUS.APPROVED, AUDIT_STATUS.VOIDED].includes(status);
|
const s = toAuditStatus(status);
|
||||||
|
return s === AUDIT_STATUS.APPROVED || s === AUDIT_STATUS.VOIDED;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 分页拉取全部列表(直至末页) */
|
/** 分页拉取全部列表(直至末页) */
|
||||||
@@ -498,7 +500,12 @@ export function fetchAllOrderList(listFn, params = {}, pageSize = LIST_PAGE_SIZE
|
|||||||
|
|
||||||
/** 新增/编辑页底部:审核、作废 */
|
/** 新增/编辑页底部:审核、作废 */
|
||||||
export function getFormStatusActionButtons(headerSaved, orderId, status) {
|
export function getFormStatusActionButtons(headerSaved, orderId, status) {
|
||||||
if (!headerSaved || !orderId || !canScanAtStatus(status)) return [];
|
if (!headerSaved || !orderId) return [];
|
||||||
|
const s = toAuditStatus(status);
|
||||||
|
if (s === AUDIT_STATUS.APPROVED) {
|
||||||
|
return [{ label: '消审', action: 'unapprove' }];
|
||||||
|
}
|
||||||
|
if (!canScanAtStatus(s)) return [];
|
||||||
return [
|
return [
|
||||||
{ label: '审核', action: 'approve' },
|
{ label: '审核', action: 'approve' },
|
||||||
{ label: '作废', action: 'void' },
|
{ label: '作废', action: 'void' },
|
||||||
@@ -507,14 +514,15 @@ export function getFormStatusActionButtons(headerSaved, orderId, status) {
|
|||||||
|
|
||||||
/** 查看页底部:编辑、审核、作废 / 消审 */
|
/** 查看页底部:编辑、审核、作废 / 消审 */
|
||||||
export function getViewStatusActionButtons(status) {
|
export function getViewStatusActionButtons(status) {
|
||||||
if (status === AUDIT_STATUS.PENDING || status === AUDIT_STATUS.REJECTED) {
|
const s = toAuditStatus(status);
|
||||||
|
if (s === AUDIT_STATUS.PENDING || s === AUDIT_STATUS.REJECTED) {
|
||||||
return [
|
return [
|
||||||
{ label: '编辑', action: 'edit' },
|
{ label: '编辑', action: 'edit' },
|
||||||
{ label: '审核', action: 'approve' },
|
{ label: '审核', action: 'approve' },
|
||||||
{ label: '作废', action: 'void' },
|
{ label: '作废', action: 'void' },
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
if (status === AUDIT_STATUS.APPROVED) {
|
if (s === AUDIT_STATUS.APPROVED) {
|
||||||
return [{ label: '消审', action: 'unapprove' }];
|
return [{ label: '消审', action: 'unapprove' }];
|
||||||
}
|
}
|
||||||
return [];
|
return [];
|
||||||
|
|||||||
@@ -15,6 +15,13 @@ export const AUDIT_STATUS = {
|
|||||||
export const DRAFT_AUDIT_STATUS = 0;
|
export const DRAFT_AUDIT_STATUS = 0;
|
||||||
export const DRAFT_AUDIT_STATUS_NAME = '待保存';
|
export const DRAFT_AUDIT_STATUS_NAME = '待保存';
|
||||||
|
|
||||||
|
/** 将接口状态统一为数字,避免字符串导致按钮判断失效 */
|
||||||
|
export function toAuditStatus(status) {
|
||||||
|
const n = Number(status);
|
||||||
|
return Number.isFinite(n) ? n : DRAFT_AUDIT_STATUS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
export const AUDIT_STATUS_MAP = {
|
export const AUDIT_STATUS_MAP = {
|
||||||
1: '待审核',
|
1: '待审核',
|
||||||
2: '已审核',
|
2: '已审核',
|
||||||
@@ -74,13 +81,7 @@ export function getStatusOptions() {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
export function mapToSelectOptions(data) {
|
export { mapToSelectOptions } from '@/common/remoteSelect';
|
||||||
const list = Array.isArray(data) ? data : (data && (data.list || data.items || data.records)) || [];
|
|
||||||
return list.map((item) => ({
|
|
||||||
value: item.id,
|
|
||||||
label: item.name || item.label || item.code || String(item.id),
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 匹数:后端 ×100 存储 */
|
/** 匹数:后端 ×100 存储 */
|
||||||
export function formatRoll(value) {
|
export function formatRoll(value) {
|
||||||
@@ -104,8 +105,8 @@ export function normalizeOrder(order) {
|
|||||||
return {
|
return {
|
||||||
id: order.id,
|
id: order.id,
|
||||||
order_no: order.order_no || '',
|
order_no: order.order_no || '',
|
||||||
audit_status: order.audit_status,
|
audit_status: toAuditStatus(order.audit_status),
|
||||||
audit_status_name: order.audit_status_name || AUDIT_STATUS_MAP[order.audit_status] || '',
|
audit_status_name: order.audit_status_name || AUDIT_STATUS_MAP[toAuditStatus(order.audit_status)] || '',
|
||||||
process_unit_id: order.process_unit_id || '',
|
process_unit_id: order.process_unit_id || '',
|
||||||
process_name: order.process_name || '',
|
process_name: order.process_name || '',
|
||||||
warehouse_id: order.warehouse_id || '',
|
warehouse_id: order.warehouse_id || '',
|
||||||
@@ -278,6 +279,7 @@ export function buildScanDetailFromScanResponse(res) {
|
|||||||
: '',
|
: '',
|
||||||
product_code: res.product_code || '',
|
product_code: res.product_code || '',
|
||||||
product_color_code: res.product_color_code || '',
|
product_color_code: res.product_color_code || '',
|
||||||
|
// 本单匹数/数量:整单合计(扫码后会再以详情 total_* 覆盖)
|
||||||
order_roll: formatRoll(res.order_roll != null ? res.order_roll : res.total_roll),
|
order_roll: formatRoll(res.order_roll != null ? res.order_roll : res.total_roll),
|
||||||
item_roll: formatRoll(res.item_roll != null ? res.item_roll : res.roll),
|
item_roll: formatRoll(res.item_roll != null ? res.item_roll : res.roll),
|
||||||
order_weight: formatWeightKg(res.order_weight != null ? res.order_weight : res.total_weight),
|
order_weight: formatWeightKg(res.order_weight != null ? res.order_weight : res.total_weight),
|
||||||
@@ -338,11 +340,13 @@ export function formatDisplayTime(value, format = 'YYYY-MM-DD') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function canScanAtStatus(status) {
|
export function canScanAtStatus(status) {
|
||||||
return [AUDIT_STATUS.PENDING, AUDIT_STATUS.REJECTED].includes(status);
|
const s = toAuditStatus(status);
|
||||||
|
return s === AUDIT_STATUS.PENDING || s === AUDIT_STATUS.REJECTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isLockedOrderStatus(status) {
|
export function isLockedOrderStatus(status) {
|
||||||
return [AUDIT_STATUS.APPROVED, AUDIT_STATUS.VOIDED].includes(status);
|
const s = toAuditStatus(status);
|
||||||
|
return s === AUDIT_STATUS.APPROVED || s === AUDIT_STATUS.VOIDED;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function fetchAllOrderList(listFn, params = {}, pageSize = LIST_PAGE_SIZE) {
|
export function fetchAllOrderList(listFn, params = {}, pageSize = LIST_PAGE_SIZE) {
|
||||||
@@ -377,7 +381,12 @@ export function fetchAllOrderList(listFn, params = {}, pageSize = LIST_PAGE_SIZE
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getFormStatusActionButtons(headerSaved, orderId, status) {
|
export function getFormStatusActionButtons(headerSaved, orderId, status) {
|
||||||
if (!headerSaved || !orderId || !canScanAtStatus(status)) return [];
|
if (!headerSaved || !orderId) return [];
|
||||||
|
const s = toAuditStatus(status);
|
||||||
|
if (s === AUDIT_STATUS.APPROVED) {
|
||||||
|
return [{ label: '消审', action: 'unapprove' }];
|
||||||
|
}
|
||||||
|
if (!canScanAtStatus(s)) return [];
|
||||||
return [
|
return [
|
||||||
{ label: '审核', action: 'approve' },
|
{ label: '审核', action: 'approve' },
|
||||||
{ label: '作废', action: 'void' },
|
{ label: '作废', action: 'void' },
|
||||||
@@ -385,14 +394,15 @@ export function getFormStatusActionButtons(headerSaved, orderId, status) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getViewStatusActionButtons(status) {
|
export function getViewStatusActionButtons(status) {
|
||||||
if (status === AUDIT_STATUS.PENDING || status === AUDIT_STATUS.REJECTED) {
|
const s = toAuditStatus(status);
|
||||||
|
if (s === AUDIT_STATUS.PENDING || s === AUDIT_STATUS.REJECTED) {
|
||||||
return [
|
return [
|
||||||
{ label: '编辑', action: 'edit' },
|
{ label: '编辑', action: 'edit' },
|
||||||
{ label: '审核', action: 'approve' },
|
{ label: '审核', action: 'approve' },
|
||||||
{ label: '作废', action: 'void' },
|
{ label: '作废', action: 'void' },
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
if (status === AUDIT_STATUS.APPROVED) {
|
if (s === AUDIT_STATUS.APPROVED) {
|
||||||
return [{ label: '消审', action: 'unapprove' }];
|
return [{ label: '消审', action: 'unapprove' }];
|
||||||
}
|
}
|
||||||
return [];
|
return [];
|
||||||
|
|||||||
@@ -15,6 +15,13 @@ export const AUDIT_STATUS = {
|
|||||||
export const DRAFT_AUDIT_STATUS = 0;
|
export const DRAFT_AUDIT_STATUS = 0;
|
||||||
export const DRAFT_AUDIT_STATUS_NAME = '待保存';
|
export const DRAFT_AUDIT_STATUS_NAME = '待保存';
|
||||||
|
|
||||||
|
/** 将接口状态统一为数字,避免字符串导致按钮判断失效 */
|
||||||
|
export function toAuditStatus(status) {
|
||||||
|
const n = Number(status);
|
||||||
|
return Number.isFinite(n) ? n : DRAFT_AUDIT_STATUS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
export const AUDIT_STATUS_MAP = {
|
export const AUDIT_STATUS_MAP = {
|
||||||
1: '待审核',
|
1: '待审核',
|
||||||
2: '已审核',
|
2: '已审核',
|
||||||
@@ -59,13 +66,7 @@ export function getStatusOptions() {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
export function mapToSelectOptions(data) {
|
export { mapToSelectOptions } from '@/common/remoteSelect';
|
||||||
const list = Array.isArray(data) ? data : (data && (data.list || data.items || data.records)) || [];
|
|
||||||
return list.map((item) => ({
|
|
||||||
value: item.id,
|
|
||||||
label: item.name || item.label || item.code || String(item.id),
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 匹数:后端 ×100 存储 */
|
/** 匹数:后端 ×100 存储 */
|
||||||
export function formatRoll(value) {
|
export function formatRoll(value) {
|
||||||
@@ -84,8 +85,8 @@ export function normalizeOrder(order) {
|
|||||||
return {
|
return {
|
||||||
id: order.id,
|
id: order.id,
|
||||||
order_no: order.order_no || '',
|
order_no: order.order_no || '',
|
||||||
audit_status: order.audit_status,
|
audit_status: toAuditStatus(order.audit_status),
|
||||||
audit_status_name: order.audit_status_name || AUDIT_STATUS_MAP[order.audit_status] || '',
|
audit_status_name: order.audit_status_name || AUDIT_STATUS_MAP[toAuditStatus(order.audit_status)] || '',
|
||||||
process_unit_id: order.process_unit_id || '',
|
process_unit_id: order.process_unit_id || '',
|
||||||
process_name: order.process_name || '',
|
process_name: order.process_name || '',
|
||||||
warehouse_id: order.warehouse_id || '',
|
warehouse_id: order.warehouse_id || '',
|
||||||
@@ -243,6 +244,7 @@ export function buildScanDetailFromScanResponse(res) {
|
|||||||
: '',
|
: '',
|
||||||
product_code: res.product_code || '',
|
product_code: res.product_code || '',
|
||||||
product_color_code: res.product_color_code || '',
|
product_color_code: res.product_color_code || '',
|
||||||
|
// 本单匹数/数量:整单合计(扫码后会再以详情 total_* 覆盖)
|
||||||
order_roll: formatRoll(res.order_roll != null ? res.order_roll : res.total_roll),
|
order_roll: formatRoll(res.order_roll != null ? res.order_roll : res.total_roll),
|
||||||
item_roll: formatRoll(res.item_roll != null ? res.item_roll : res.roll),
|
item_roll: formatRoll(res.item_roll != null ? res.item_roll : res.roll),
|
||||||
order_weight: formatWeightKg(res.order_weight != null ? res.order_weight : res.total_weight),
|
order_weight: formatWeightKg(res.order_weight != null ? res.order_weight : res.total_weight),
|
||||||
@@ -280,11 +282,13 @@ export function formatDisplayTime(value, format = 'YYYY-MM-DD') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function canScanAtStatus(status) {
|
export function canScanAtStatus(status) {
|
||||||
return [AUDIT_STATUS.PENDING, AUDIT_STATUS.REJECTED].includes(status);
|
const s = toAuditStatus(status);
|
||||||
|
return s === AUDIT_STATUS.PENDING || s === AUDIT_STATUS.REJECTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isLockedOrderStatus(status) {
|
export function isLockedOrderStatus(status) {
|
||||||
return [AUDIT_STATUS.APPROVED, AUDIT_STATUS.VOIDED].includes(status);
|
const s = toAuditStatus(status);
|
||||||
|
return s === AUDIT_STATUS.APPROVED || s === AUDIT_STATUS.VOIDED;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function fetchAllOrderList(listFn, params = {}, pageSize = LIST_PAGE_SIZE) {
|
export function fetchAllOrderList(listFn, params = {}, pageSize = LIST_PAGE_SIZE) {
|
||||||
@@ -319,7 +323,12 @@ export function fetchAllOrderList(listFn, params = {}, pageSize = LIST_PAGE_SIZE
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getFormStatusActionButtons(headerSaved, orderId, status) {
|
export function getFormStatusActionButtons(headerSaved, orderId, status) {
|
||||||
if (!headerSaved || !orderId || !canScanAtStatus(status)) return [];
|
if (!headerSaved || !orderId) return [];
|
||||||
|
const s = toAuditStatus(status);
|
||||||
|
if (s === AUDIT_STATUS.APPROVED) {
|
||||||
|
return [{ label: '消审', action: 'unapprove' }];
|
||||||
|
}
|
||||||
|
if (!canScanAtStatus(s)) return [];
|
||||||
return [
|
return [
|
||||||
{ label: '审核', action: 'approve' },
|
{ label: '审核', action: 'approve' },
|
||||||
{ label: '作废', action: 'void' },
|
{ label: '作废', action: 'void' },
|
||||||
@@ -327,14 +336,15 @@ export function getFormStatusActionButtons(headerSaved, orderId, status) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getViewStatusActionButtons(status) {
|
export function getViewStatusActionButtons(status) {
|
||||||
if (status === AUDIT_STATUS.PENDING || status === AUDIT_STATUS.REJECTED) {
|
const s = toAuditStatus(status);
|
||||||
|
if (s === AUDIT_STATUS.PENDING || s === AUDIT_STATUS.REJECTED) {
|
||||||
return [
|
return [
|
||||||
{ label: '编辑', action: 'edit' },
|
{ label: '编辑', action: 'edit' },
|
||||||
{ label: '审核', action: 'approve' },
|
{ label: '审核', action: 'approve' },
|
||||||
{ label: '作废', action: 'void' },
|
{ label: '作废', action: 'void' },
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
if (status === AUDIT_STATUS.APPROVED) {
|
if (s === AUDIT_STATUS.APPROVED) {
|
||||||
return [{ label: '消审', action: 'unapprove' }];
|
return [{ label: '消审', action: 'unapprove' }];
|
||||||
}
|
}
|
||||||
return [];
|
return [];
|
||||||
|
|||||||
@@ -15,6 +15,13 @@ export const AUDIT_STATUS = {
|
|||||||
export const DRAFT_AUDIT_STATUS = 0;
|
export const DRAFT_AUDIT_STATUS = 0;
|
||||||
export const DRAFT_AUDIT_STATUS_NAME = '待保存';
|
export const DRAFT_AUDIT_STATUS_NAME = '待保存';
|
||||||
|
|
||||||
|
/** 将接口状态统一为数字,避免字符串导致按钮判断失效 */
|
||||||
|
export function toAuditStatus(status) {
|
||||||
|
const n = Number(status);
|
||||||
|
return Number.isFinite(n) ? n : DRAFT_AUDIT_STATUS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
export const AUDIT_STATUS_MAP = {
|
export const AUDIT_STATUS_MAP = {
|
||||||
1: '待审核',
|
1: '待审核',
|
||||||
2: '已审核',
|
2: '已审核',
|
||||||
@@ -55,13 +62,7 @@ export function getStatusOptions() {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
export function mapToSelectOptions(data) {
|
export { mapToSelectOptions } from '@/common/remoteSelect';
|
||||||
const list = Array.isArray(data) ? data : (data && (data.list || data.items || data.records)) || [];
|
|
||||||
return list.map((item) => ({
|
|
||||||
value: item.id,
|
|
||||||
label: item.name || item.label || item.code || String(item.id),
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 匹数:后端 ×100 存储 */
|
/** 匹数:后端 ×100 存储 */
|
||||||
export function formatRoll(value) {
|
export function formatRoll(value) {
|
||||||
@@ -80,8 +81,8 @@ export function normalizeOrder(order) {
|
|||||||
return {
|
return {
|
||||||
id: order.id,
|
id: order.id,
|
||||||
order_no: order.order_no || '',
|
order_no: order.order_no || '',
|
||||||
audit_status: order.audit_status,
|
audit_status: toAuditStatus(order.audit_status),
|
||||||
audit_status_name: order.audit_status_name || AUDIT_STATUS_MAP[order.audit_status] || '',
|
audit_status_name: order.audit_status_name || AUDIT_STATUS_MAP[toAuditStatus(order.audit_status)] || '',
|
||||||
process_unit_id: order.process_unit_id || order.biz_unit_id || '',
|
process_unit_id: order.process_unit_id || order.biz_unit_id || '',
|
||||||
process_name: order.process_name || order.biz_unit_name || '',
|
process_name: order.process_name || order.biz_unit_name || '',
|
||||||
warehouse_id: order.warehouse_id || '',
|
warehouse_id: order.warehouse_id || '',
|
||||||
@@ -239,6 +240,7 @@ export function buildScanDetailFromScanResponse(res) {
|
|||||||
: '',
|
: '',
|
||||||
product_code: res.product_code || '',
|
product_code: res.product_code || '',
|
||||||
product_color_code: res.product_color_code || '',
|
product_color_code: res.product_color_code || '',
|
||||||
|
// 本单匹数/数量:整单合计(扫码后会再以详情 total_* 覆盖)
|
||||||
order_roll: formatRoll(res.order_roll != null ? res.order_roll : res.total_roll),
|
order_roll: formatRoll(res.order_roll != null ? res.order_roll : res.total_roll),
|
||||||
item_roll: formatRoll(res.item_roll != null ? res.item_roll : res.roll),
|
item_roll: formatRoll(res.item_roll != null ? res.item_roll : res.roll),
|
||||||
order_weight: formatWeightKg(res.order_weight != null ? res.order_weight : res.total_weight),
|
order_weight: formatWeightKg(res.order_weight != null ? res.order_weight : res.total_weight),
|
||||||
@@ -276,11 +278,13 @@ export function formatDisplayTime(value, format = 'YYYY-MM-DD') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function canScanAtStatus(status) {
|
export function canScanAtStatus(status) {
|
||||||
return [AUDIT_STATUS.PENDING, AUDIT_STATUS.REJECTED].includes(status);
|
const s = toAuditStatus(status);
|
||||||
|
return s === AUDIT_STATUS.PENDING || s === AUDIT_STATUS.REJECTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isLockedOrderStatus(status) {
|
export function isLockedOrderStatus(status) {
|
||||||
return [AUDIT_STATUS.APPROVED, AUDIT_STATUS.VOIDED].includes(status);
|
const s = toAuditStatus(status);
|
||||||
|
return s === AUDIT_STATUS.APPROVED || s === AUDIT_STATUS.VOIDED;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function fetchAllOrderList(listFn, params = {}, pageSize = LIST_PAGE_SIZE) {
|
export function fetchAllOrderList(listFn, params = {}, pageSize = LIST_PAGE_SIZE) {
|
||||||
@@ -315,7 +319,12 @@ export function fetchAllOrderList(listFn, params = {}, pageSize = LIST_PAGE_SIZE
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getFormStatusActionButtons(headerSaved, orderId, status) {
|
export function getFormStatusActionButtons(headerSaved, orderId, status) {
|
||||||
if (!headerSaved || !orderId || !canScanAtStatus(status)) return [];
|
if (!headerSaved || !orderId) return [];
|
||||||
|
const s = toAuditStatus(status);
|
||||||
|
if (s === AUDIT_STATUS.APPROVED) {
|
||||||
|
return [{ label: '消审', action: 'unapprove' }];
|
||||||
|
}
|
||||||
|
if (!canScanAtStatus(s)) return [];
|
||||||
return [
|
return [
|
||||||
{ label: '审核', action: 'approve' },
|
{ label: '审核', action: 'approve' },
|
||||||
{ label: '作废', action: 'void' },
|
{ label: '作废', action: 'void' },
|
||||||
@@ -323,14 +332,15 @@ export function getFormStatusActionButtons(headerSaved, orderId, status) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getViewStatusActionButtons(status) {
|
export function getViewStatusActionButtons(status) {
|
||||||
if (status === AUDIT_STATUS.PENDING || status === AUDIT_STATUS.REJECTED) {
|
const s = toAuditStatus(status);
|
||||||
|
if (s === AUDIT_STATUS.PENDING || s === AUDIT_STATUS.REJECTED) {
|
||||||
return [
|
return [
|
||||||
{ label: '编辑', action: 'edit' },
|
{ label: '编辑', action: 'edit' },
|
||||||
{ label: '审核', action: 'approve' },
|
{ label: '审核', action: 'approve' },
|
||||||
{ label: '作废', action: 'void' },
|
{ label: '作废', action: 'void' },
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
if (status === AUDIT_STATUS.APPROVED) {
|
if (s === AUDIT_STATUS.APPROVED) {
|
||||||
return [{ label: '消审', action: 'unapprove' }];
|
return [{ label: '消审', action: 'unapprove' }];
|
||||||
}
|
}
|
||||||
return [];
|
return [];
|
||||||
|
|||||||
@@ -15,6 +15,13 @@ export const AUDIT_STATUS = {
|
|||||||
export const DRAFT_AUDIT_STATUS = 0;
|
export const DRAFT_AUDIT_STATUS = 0;
|
||||||
export const DRAFT_AUDIT_STATUS_NAME = '待保存';
|
export const DRAFT_AUDIT_STATUS_NAME = '待保存';
|
||||||
|
|
||||||
|
/** 将接口状态统一为数字,避免字符串导致按钮判断失效 */
|
||||||
|
export function toAuditStatus(status) {
|
||||||
|
const n = Number(status);
|
||||||
|
return Number.isFinite(n) ? n : DRAFT_AUDIT_STATUS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
export const AUDIT_STATUS_MAP = {
|
export const AUDIT_STATUS_MAP = {
|
||||||
1: '待审核',
|
1: '待审核',
|
||||||
2: '已审核',
|
2: '已审核',
|
||||||
@@ -87,13 +94,7 @@ export function getStatusOptions() {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
export function mapToSelectOptions(data) {
|
export { mapToSelectOptions } from '@/common/remoteSelect';
|
||||||
const list = Array.isArray(data) ? data : (data && (data.list || data.items || data.records)) || [];
|
|
||||||
return list.map((item) => ({
|
|
||||||
value: item.id,
|
|
||||||
label: item.name || item.label || item.code || String(item.id),
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 匹数:后端 ×100 存储 */
|
/** 匹数:后端 ×100 存储 */
|
||||||
export function formatRoll(value) {
|
export function formatRoll(value) {
|
||||||
@@ -117,8 +118,8 @@ export function normalizeOrder(order) {
|
|||||||
return {
|
return {
|
||||||
id: order.id,
|
id: order.id,
|
||||||
order_no: order.order_no || '',
|
order_no: order.order_no || '',
|
||||||
audit_status: order.audit_status,
|
audit_status: toAuditStatus(order.audit_status),
|
||||||
audit_status_name: order.audit_status_name || AUDIT_STATUS_MAP[order.audit_status] || '',
|
audit_status_name: order.audit_status_name || AUDIT_STATUS_MAP[toAuditStatus(order.audit_status)] || '',
|
||||||
biz_unit_id: order.biz_unit_id || '',
|
biz_unit_id: order.biz_unit_id || '',
|
||||||
biz_unit_name: order.biz_unit_name || '',
|
biz_unit_name: order.biz_unit_name || '',
|
||||||
warehouse_id: order.warehouse_id || '',
|
warehouse_id: order.warehouse_id || '',
|
||||||
@@ -294,6 +295,7 @@ export function buildScanDetailFromScanResponse(res) {
|
|||||||
: '',
|
: '',
|
||||||
product_code: res.product_code || '',
|
product_code: res.product_code || '',
|
||||||
product_color_code: res.product_color_code || '',
|
product_color_code: res.product_color_code || '',
|
||||||
|
// 本单匹数/数量:整单合计(扫码后会再以详情 total_* 覆盖)
|
||||||
order_roll: formatRoll(res.order_roll != null ? res.order_roll : res.total_roll),
|
order_roll: formatRoll(res.order_roll != null ? res.order_roll : res.total_roll),
|
||||||
item_roll: formatRoll(res.item_roll != null ? res.item_roll : res.roll),
|
item_roll: formatRoll(res.item_roll != null ? res.item_roll : res.roll),
|
||||||
order_weight: formatWeightKg(res.order_weight != null ? res.order_weight : res.total_weight),
|
order_weight: formatWeightKg(res.order_weight != null ? res.order_weight : res.total_weight),
|
||||||
@@ -354,11 +356,13 @@ export function formatDisplayTime(value, format = 'YYYY-MM-DD') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function canScanAtStatus(status) {
|
export function canScanAtStatus(status) {
|
||||||
return [AUDIT_STATUS.PENDING, AUDIT_STATUS.REJECTED].includes(status);
|
const s = toAuditStatus(status);
|
||||||
|
return s === AUDIT_STATUS.PENDING || s === AUDIT_STATUS.REJECTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isLockedOrderStatus(status) {
|
export function isLockedOrderStatus(status) {
|
||||||
return [AUDIT_STATUS.APPROVED, AUDIT_STATUS.VOIDED].includes(status);
|
const s = toAuditStatus(status);
|
||||||
|
return s === AUDIT_STATUS.APPROVED || s === AUDIT_STATUS.VOIDED;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function fetchAllOrderList(listFn, params = {}, pageSize = LIST_PAGE_SIZE) {
|
export function fetchAllOrderList(listFn, params = {}, pageSize = LIST_PAGE_SIZE) {
|
||||||
@@ -393,7 +397,12 @@ export function fetchAllOrderList(listFn, params = {}, pageSize = LIST_PAGE_SIZE
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getFormStatusActionButtons(headerSaved, orderId, status) {
|
export function getFormStatusActionButtons(headerSaved, orderId, status) {
|
||||||
if (!headerSaved || !orderId || !canScanAtStatus(status)) return [];
|
if (!headerSaved || !orderId) return [];
|
||||||
|
const s = toAuditStatus(status);
|
||||||
|
if (s === AUDIT_STATUS.APPROVED) {
|
||||||
|
return [{ label: '消审', action: 'unapprove' }];
|
||||||
|
}
|
||||||
|
if (!canScanAtStatus(s)) return [];
|
||||||
return [
|
return [
|
||||||
{ label: '审核', action: 'approve' },
|
{ label: '审核', action: 'approve' },
|
||||||
{ label: '作废', action: 'void' },
|
{ label: '作废', action: 'void' },
|
||||||
@@ -401,14 +410,15 @@ export function getFormStatusActionButtons(headerSaved, orderId, status) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getViewStatusActionButtons(status) {
|
export function getViewStatusActionButtons(status) {
|
||||||
if (status === AUDIT_STATUS.PENDING || status === AUDIT_STATUS.REJECTED) {
|
const s = toAuditStatus(status);
|
||||||
|
if (s === AUDIT_STATUS.PENDING || s === AUDIT_STATUS.REJECTED) {
|
||||||
return [
|
return [
|
||||||
{ label: '编辑', action: 'edit' },
|
{ label: '编辑', action: 'edit' },
|
||||||
{ label: '审核', action: 'approve' },
|
{ label: '审核', action: 'approve' },
|
||||||
{ label: '作废', action: 'void' },
|
{ label: '作废', action: 'void' },
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
if (status === AUDIT_STATUS.APPROVED) {
|
if (s === AUDIT_STATUS.APPROVED) {
|
||||||
return [{ label: '消审', action: 'unapprove' }];
|
return [{ label: '消审', action: 'unapprove' }];
|
||||||
}
|
}
|
||||||
return [];
|
return [];
|
||||||
|
|||||||
@@ -0,0 +1,155 @@
|
|||||||
|
/**
|
||||||
|
* 登录会话:token、用户信息、菜单/按钮权限
|
||||||
|
*/
|
||||||
|
import store from '@/store/index.js';
|
||||||
|
|
||||||
|
const TOKEN_KEY = 'RemoteTokenData';
|
||||||
|
const USER_TOKEN_KEY = 'userToken';
|
||||||
|
const INFORMATION_KEY = 'PdaUserInformation';
|
||||||
|
|
||||||
|
function commitVuex(name, value) {
|
||||||
|
store.commit('$uStore', { name, value });
|
||||||
|
}
|
||||||
|
|
||||||
|
function applyGlobalData(patch) {
|
||||||
|
try {
|
||||||
|
const app = getApp();
|
||||||
|
if (!app || !app.globalData) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Object.keys(patch).forEach((key) => {
|
||||||
|
app.globalData[key] = patch[key];
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
console.log('applyGlobalData error', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getLoginData() {
|
||||||
|
return uni.getStorageSync(TOKEN_KEY) || null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getUserInformation() {
|
||||||
|
return uni.getStorageSync(INFORMATION_KEY) || null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function applyLoginData(loginData) {
|
||||||
|
if (!loginData) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
uni.setStorageSync(TOKEN_KEY, loginData);
|
||||||
|
uni.setStorageSync(USER_TOKEN_KEY, { Token: loginData.token });
|
||||||
|
if (loginData.token) {
|
||||||
|
commitVuex('vuex_token', loginData.token);
|
||||||
|
}
|
||||||
|
applyGlobalData({
|
||||||
|
Token: loginData.token || '',
|
||||||
|
EmployeeID: loginData.employee_id != null ? loginData.employee_id : (loginData.user_id || 0),
|
||||||
|
LoginID: loginData.user_id || 0,
|
||||||
|
LoginName: loginData.user_name || '',
|
||||||
|
UserName: loginData.user_name || '',
|
||||||
|
PlanDepartmentID: loginData.default_sale_system_id || 0,
|
||||||
|
PlanDepartmentName: loginData.default_sale_system_name || '',
|
||||||
|
StoreNameID: loginData.default_physical_warehouse_id || 0,
|
||||||
|
StoreName: loginData.default_physical_warehouse_name || '',
|
||||||
|
IsSaleUserStatus: 0,
|
||||||
|
UserGroup: '',
|
||||||
|
StoreTypeNo: ''
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function applyUserInformation(info) {
|
||||||
|
if (!info) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
uni.setStorageSync(INFORMATION_KEY, info);
|
||||||
|
const profile = {
|
||||||
|
userName: info.user_name || '',
|
||||||
|
user_id: info.user_id,
|
||||||
|
user_name: info.user_name || '',
|
||||||
|
avatar: info.avatar_url || '',
|
||||||
|
avatar_url: info.avatar_url || '',
|
||||||
|
employee_id: info.employee_id,
|
||||||
|
department_id: info.department_id,
|
||||||
|
department_name: info.department_name || '',
|
||||||
|
phone: info.phone || '',
|
||||||
|
default_sale_system_id: info.default_sale_system_id,
|
||||||
|
default_sale_system_name: info.default_sale_system_name || '',
|
||||||
|
default_customer_id: info.default_customer_id,
|
||||||
|
default_customer_name: info.default_customer_name || '',
|
||||||
|
role_id: info.role_id || []
|
||||||
|
};
|
||||||
|
commitVuex('vuex_user', profile);
|
||||||
|
applyGlobalData({
|
||||||
|
EmployeeID: info.employee_id != null ? info.employee_id : (info.user_id || 0),
|
||||||
|
LoginID: info.user_id || 0,
|
||||||
|
LoginName: info.user_name || '',
|
||||||
|
UserName: info.user_name || '',
|
||||||
|
PlanDepartmentID: info.default_sale_system_id || 0,
|
||||||
|
PlanDepartmentName: info.default_sale_system_name || ''
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function restoreUserSession() {
|
||||||
|
const loginData = getLoginData();
|
||||||
|
if (loginData && loginData.token) {
|
||||||
|
applyLoginData(loginData);
|
||||||
|
}
|
||||||
|
const info = getUserInformation();
|
||||||
|
if (info) {
|
||||||
|
applyUserInformation(info);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function clearUserSession() {
|
||||||
|
uni.removeStorageSync(TOKEN_KEY);
|
||||||
|
uni.removeStorageSync(USER_TOKEN_KEY);
|
||||||
|
uni.removeStorageSync(INFORMATION_KEY);
|
||||||
|
uni.removeStorageSync('token');
|
||||||
|
commitVuex('vuex_token', '');
|
||||||
|
commitVuex('vuex_user', {});
|
||||||
|
applyGlobalData({
|
||||||
|
Token: '',
|
||||||
|
EmployeeID: 0,
|
||||||
|
LoginID: 0,
|
||||||
|
LoginName: '',
|
||||||
|
UserName: '',
|
||||||
|
PlanDepartmentID: 0,
|
||||||
|
PlanDepartmentName: '',
|
||||||
|
StoreNameID: 0,
|
||||||
|
StoreName: '',
|
||||||
|
IsSaleUserStatus: 0,
|
||||||
|
UserGroup: '',
|
||||||
|
StoreTypeNo: ''
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function hasResourceRouter(name) {
|
||||||
|
if (!name) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
const info = getUserInformation();
|
||||||
|
if (!info) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
const names = info.resource_router_names;
|
||||||
|
if (!Array.isArray(names)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return names.indexOf(name) !== -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function hasButtonCode(code) {
|
||||||
|
if (!code) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
const info = getUserInformation();
|
||||||
|
if (!info) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
const codes = info.button_codes;
|
||||||
|
if (!Array.isArray(codes)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return codes.indexOf(code) !== -1;
|
||||||
|
}
|
||||||
+57
-2
@@ -2,6 +2,7 @@
|
|||||||
* 通用公共js库,主要定义api接口,auth apikey 常量值和通用函数
|
* 通用公共js库,主要定义api接口,auth apikey 常量值和通用函数
|
||||||
*/
|
*/
|
||||||
import store from '@/store/index.js';
|
import store from '@/store/index.js';
|
||||||
|
import { speak } from './tts.js';
|
||||||
|
|
||||||
// var apiurl = 'http://192.168.1.66:50002/hcscm/pda/v1/'; //开发环境 添
|
// var apiurl = 'http://192.168.1.66:50002/hcscm/pda/v1/'; //开发环境 添
|
||||||
// var apiurl = 'http://192.168.1.55:50002/hcscm/pda/v1/'; //开发环境 添
|
// var apiurl = 'http://192.168.1.55:50002/hcscm/pda/v1/'; //开发环境 添
|
||||||
@@ -23,6 +24,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,
|
||||||
@@ -329,7 +333,56 @@ function createAudio(src) {
|
|||||||
let successAudio = undefined;
|
let successAudio = undefined;
|
||||||
let errorAudio = undefined;
|
let errorAudio = undefined;
|
||||||
|
|
||||||
function playSuccessAudio() {
|
/** 审核类操作成功时的固定播报 */
|
||||||
|
function statusSuccessVoice(action) {
|
||||||
|
const map = {
|
||||||
|
approve: '审核成功',
|
||||||
|
void: '作废成功',
|
||||||
|
unapprove: '消审成功',
|
||||||
|
};
|
||||||
|
return map[action] || '操作成功';
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 成功/失败提示音约 0.9 秒,播完再朗读,避免提示音抢走语音 */
|
||||||
|
let speakFeedbackTimer = null;
|
||||||
|
|
||||||
|
function voiceContent(text, fallback) {
|
||||||
|
let content = String(text == null ? '' : text)
|
||||||
|
.replace(/[\r\n\t]/g, '')
|
||||||
|
.replace(/[!!。..??;;,,、]/g, '')
|
||||||
|
.trim();
|
||||||
|
if (!content || content.length > 32) content = fallback;
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
|
function clearSpeakFeedbackTimer() {
|
||||||
|
if (!speakFeedbackTimer) return;
|
||||||
|
clearTimeout(speakFeedbackTimer);
|
||||||
|
speakFeedbackTimer = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
function speakFeedback(text, fallback) {
|
||||||
|
const content = voiceContent(text, fallback);
|
||||||
|
clearSpeakFeedbackTimer();
|
||||||
|
speakFeedbackTimer = setTimeout(() => {
|
||||||
|
speakFeedbackTimer = null;
|
||||||
|
speak(content);
|
||||||
|
}, 1100);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 只播人声,不播提示音 */
|
||||||
|
function speakNow(text, fallback) {
|
||||||
|
clearSpeakFeedbackTimer();
|
||||||
|
if (successAudio) successAudio.stop();
|
||||||
|
speak(voiceContent(text, fallback));
|
||||||
|
}
|
||||||
|
|
||||||
|
function playSuccessAudio(text, options) {
|
||||||
|
if (options && options.voiceOnly) {
|
||||||
|
speakNow(text, '成功');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
speakFeedback(text, '成功');
|
||||||
if (!successAudio) {
|
if (!successAudio) {
|
||||||
//console.log("create success");
|
//console.log("create success");
|
||||||
successAudio = createAudio('/static/audio/appright.wav');
|
successAudio = createAudio('/static/audio/appright.wav');
|
||||||
@@ -346,7 +399,8 @@ function playSuccessAudio() {
|
|||||||
successAudio.play();
|
successAudio.play();
|
||||||
}
|
}
|
||||||
|
|
||||||
function playErrorAudio() {
|
function playErrorAudio(text) {
|
||||||
|
speakFeedback(text, '失败');
|
||||||
if (!errorAudio) {
|
if (!errorAudio) {
|
||||||
//console.log("create error");
|
//console.log("create error");
|
||||||
errorAudio = createAudio('/static/audio/apperror.wav');
|
errorAudio = createAudio('/static/audio/apperror.wav');
|
||||||
@@ -375,4 +429,5 @@ export default {
|
|||||||
parGetData,
|
parGetData,
|
||||||
playSuccessAudio,
|
playSuccessAudio,
|
||||||
playErrorAudio,
|
playErrorAudio,
|
||||||
|
statusSuccessVoice,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -46,21 +46,15 @@ export default {
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped lang="scss">
|
||||||
|
@import '@/common/status-tag.scss';
|
||||||
|
|
||||||
.cardTopName {
|
.cardTopName {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
gap: 16rpx;
|
||||||
|
overflow: visible;
|
||||||
|
white-space: normal;
|
||||||
}
|
}
|
||||||
.statusTag {
|
|
||||||
font-size: 24rpx;
|
|
||||||
padding: 4rpx 12rpx;
|
|
||||||
border-radius: 6rpx;
|
|
||||||
font-weight: normal;
|
|
||||||
}
|
|
||||||
.status-0 { background: #f0f0f0; color: #666; }
|
|
||||||
.status-1 { background: #fff7e6; color: #fa8c16; }
|
|
||||||
.status-2 { background: #f6ffed; color: #52c41a; }
|
|
||||||
.status-3 { background: #fff1f0; color: #f5222d; }
|
|
||||||
.status-4 { background: #f5f5f5; color: #999; }
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -47,21 +47,15 @@ export default {
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped lang="scss">
|
||||||
|
@import '@/common/status-tag.scss';
|
||||||
|
|
||||||
.cardTopName {
|
.cardTopName {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
gap: 16rpx;
|
||||||
|
overflow: visible;
|
||||||
|
white-space: normal;
|
||||||
}
|
}
|
||||||
.statusTag {
|
|
||||||
font-size: 24rpx;
|
|
||||||
padding: 4rpx 12rpx;
|
|
||||||
border-radius: 6rpx;
|
|
||||||
font-weight: normal;
|
|
||||||
}
|
|
||||||
.status-0 { background: #f0f0f0; color: #666; }
|
|
||||||
.status-1 { background: #fff7e6; color: #fa8c16; }
|
|
||||||
.status-2 { background: #f6ffed; color: #52c41a; }
|
|
||||||
.status-3 { background: #fff1f0; color: #f5222d; }
|
|
||||||
.status-4 { background: #f5f5f5; color: #999; }
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -51,21 +51,15 @@ export default {
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped lang="scss">
|
||||||
|
@import '@/common/status-tag.scss';
|
||||||
|
|
||||||
.cardTopName {
|
.cardTopName {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
gap: 16rpx;
|
||||||
|
overflow: visible;
|
||||||
|
white-space: normal;
|
||||||
}
|
}
|
||||||
.statusTag {
|
|
||||||
font-size: 24rpx;
|
|
||||||
padding: 4rpx 12rpx;
|
|
||||||
border-radius: 6rpx;
|
|
||||||
font-weight: normal;
|
|
||||||
}
|
|
||||||
.status-0 { background: #f0f0f0; color: #666; }
|
|
||||||
.status-1 { background: #fff7e6; color: #fa8c16; }
|
|
||||||
.status-2 { background: #f6ffed; color: #52c41a; }
|
|
||||||
.status-3 { background: #fff1f0; color: #f5222d; }
|
|
||||||
.status-4 { background: #f5f5f5; color: #999; }
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -47,21 +47,15 @@ export default {
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped lang="scss">
|
||||||
|
@import '@/common/status-tag.scss';
|
||||||
|
|
||||||
.cardTopName {
|
.cardTopName {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
gap: 16rpx;
|
||||||
|
overflow: visible;
|
||||||
|
white-space: normal;
|
||||||
}
|
}
|
||||||
.statusTag {
|
|
||||||
font-size: 24rpx;
|
|
||||||
padding: 4rpx 12rpx;
|
|
||||||
border-radius: 6rpx;
|
|
||||||
font-weight: normal;
|
|
||||||
}
|
|
||||||
.status-0 { background: #f0f0f0; color: #666; }
|
|
||||||
.status-1 { background: #fff7e6; color: #fa8c16; }
|
|
||||||
.status-2 { background: #f6ffed; color: #52c41a; }
|
|
||||||
.status-3 { background: #fff1f0; color: #f5222d; }
|
|
||||||
.status-4 { background: #f5f5f5; color: #999; }
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -47,21 +47,15 @@ export default {
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped lang="scss">
|
||||||
|
@import '@/common/status-tag.scss';
|
||||||
|
|
||||||
.cardTopName {
|
.cardTopName {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
gap: 16rpx;
|
||||||
|
overflow: visible;
|
||||||
|
white-space: normal;
|
||||||
}
|
}
|
||||||
.statusTag {
|
|
||||||
font-size: 24rpx;
|
|
||||||
padding: 4rpx 12rpx;
|
|
||||||
border-radius: 6rpx;
|
|
||||||
font-weight: normal;
|
|
||||||
}
|
|
||||||
.status-0 { background: #f0f0f0; color: #666; }
|
|
||||||
.status-1 { background: #fff7e6; color: #fa8c16; }
|
|
||||||
.status-2 { background: #f6ffed; color: #52c41a; }
|
|
||||||
.status-3 { background: #fff1f0; color: #f5222d; }
|
|
||||||
.status-4 { background: #f5f5f5; color: #999; }
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -0,0 +1,286 @@
|
|||||||
|
<template>
|
||||||
|
<view v-show="visible" class="plus-barcode-panel">
|
||||||
|
<view class="plus-barcode-panel__toolbar">
|
||||||
|
<text class="plus-barcode-panel__tip">{{ tipText }}</text>
|
||||||
|
<text class="plus-barcode-panel__close" @click.stop="close">收起</text>
|
||||||
|
</view>
|
||||||
|
<!-- #ifdef APP-PLUS -->
|
||||||
|
<view :id="barcodeViewId" class="plus-barcode-panel__holder" />
|
||||||
|
<!-- #endif -->
|
||||||
|
<!-- #ifndef APP-PLUS -->
|
||||||
|
<view class="plus-barcode-panel__fallback">
|
||||||
|
<text>当前环境不支持半屏扫码,请使用输入框或系统扫码</text>
|
||||||
|
</view>
|
||||||
|
<!-- #endif -->
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const DEFAULT_FILTERS = [0, 1, 2, 8, 10]; // QR EAN13 EAN8 CODE39 CODE128
|
||||||
|
let barcodeSeq = 0;
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'PlusBarcodePanel',
|
||||||
|
props: {
|
||||||
|
visible: { type: Boolean, default: false },
|
||||||
|
hintText: { type: String, default: '将条码放入框内,可连续扫' },
|
||||||
|
scanTimeSpace: { type: Number, default: 1200 },
|
||||||
|
filters: { type: Array, default: () => DEFAULT_FILTERS.slice() },
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
barcodeSeq += 1;
|
||||||
|
return {
|
||||||
|
barcodeViewId: `plusBarcodeView_${barcodeSeq}`,
|
||||||
|
_barcode: null,
|
||||||
|
_restartTimer: null,
|
||||||
|
_active: false,
|
||||||
|
_creating: false,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
tipText() {
|
||||||
|
return this.hintText || '将条码放入框内,可连续扫';
|
||||||
|
},
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
visible(val) {
|
||||||
|
if (val) {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.openNative();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.destroyNative();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
this.destroyNative();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
open() {
|
||||||
|
if (this.visible) {
|
||||||
|
this.$nextTick(() => this.openNative());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$emit('update:visible', true);
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.destroyNative();
|
||||||
|
if (this.visible) {
|
||||||
|
this.$emit('update:visible', false);
|
||||||
|
}
|
||||||
|
this.$emit('close');
|
||||||
|
},
|
||||||
|
getCurrentWebview() {
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
try {
|
||||||
|
const pages = getCurrentPages();
|
||||||
|
const page = pages[pages.length - 1];
|
||||||
|
const vm = page && (page.$vm || page);
|
||||||
|
const scope = (vm && vm.$scope) || (page && page.$scope);
|
||||||
|
if (scope && typeof scope.$getAppWebview === 'function') {
|
||||||
|
return scope.$getAppWebview();
|
||||||
|
}
|
||||||
|
if (page && typeof page.$getAppWebview === 'function') {
|
||||||
|
return page.$getAppWebview();
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.warn('PlusBarcodePanel getCurrentWebview failed', e);
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
openNative() {
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
if (!this.visible || this._creating) return;
|
||||||
|
if (this._barcode) {
|
||||||
|
this.resumeScan();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this._creating = true;
|
||||||
|
this._active = true;
|
||||||
|
// 等占位节点挂到页面后再创建,避免 view 层报 Not Found: Page[-1]
|
||||||
|
setTimeout(() => {
|
||||||
|
if (!this.visible || !this._active) {
|
||||||
|
this._creating = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.measureHolder(0);
|
||||||
|
}, 200);
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
measureHolder(attempt) {
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
const query = uni.createSelectorQuery().in(this);
|
||||||
|
query.select(`#${this.barcodeViewId}`)
|
||||||
|
.boundingClientRect((rect) => {
|
||||||
|
if (!this.visible || !this._active) {
|
||||||
|
this._creating = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!rect || !rect.width || !rect.height) {
|
||||||
|
if (attempt < 8) {
|
||||||
|
setTimeout(() => this.measureHolder(attempt + 1), 150);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const sys = uni.getSystemInfoSync();
|
||||||
|
this._creating = false;
|
||||||
|
this.createBarcode({
|
||||||
|
top: (sys.statusBarHeight || 0) + 44,
|
||||||
|
left: 0,
|
||||||
|
width: sys.windowWidth || 300,
|
||||||
|
height: 220,
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this._creating = false;
|
||||||
|
this.createBarcode(rect);
|
||||||
|
})
|
||||||
|
.exec();
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
createBarcode(rect) {
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
const webview = this.getCurrentWebview();
|
||||||
|
if (!webview || typeof plus === 'undefined' || !plus.barcode) {
|
||||||
|
uni.showToast({ title: '当前环境不支持扫码', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.destroyNative(false);
|
||||||
|
const width = Math.max(Math.round(rect.width), 1);
|
||||||
|
const height = Math.max(Math.round(rect.height), 1);
|
||||||
|
const top = Math.max(0, Math.round(rect.top || 0));
|
||||||
|
const left = Math.max(0, Math.round(rect.left || 0));
|
||||||
|
try {
|
||||||
|
// 使用独立 id 覆盖在占位区域上,避免和页面节点 id 冲突导致 Not Found
|
||||||
|
const barcode = plus.barcode.create(
|
||||||
|
`plusBarcodeNative_${Date.now()}`,
|
||||||
|
this.filters && this.filters.length ? this.filters : DEFAULT_FILTERS,
|
||||||
|
{
|
||||||
|
top: `${top}px`,
|
||||||
|
left: `${left}px`,
|
||||||
|
width: `${width}px`,
|
||||||
|
height: `${height}px`,
|
||||||
|
position: 'absolute',
|
||||||
|
background: '#000000',
|
||||||
|
frameColor: '#2979ff',
|
||||||
|
scanbarColor: '#2979ff',
|
||||||
|
},
|
||||||
|
);
|
||||||
|
barcode.onmarked = (type, code) => {
|
||||||
|
this.onMarked(type, code);
|
||||||
|
};
|
||||||
|
barcode.onerror = (err) => {
|
||||||
|
console.error('PlusBarcodePanel onerror', err);
|
||||||
|
};
|
||||||
|
webview.append(barcode);
|
||||||
|
this._barcode = barcode;
|
||||||
|
this._active = true;
|
||||||
|
barcode.start({
|
||||||
|
vibrate: true,
|
||||||
|
sound: 'default',
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
console.error('PlusBarcodePanel create failed', e);
|
||||||
|
uni.showToast({ title: '打开扫码失败', icon: 'none' });
|
||||||
|
this._barcode = null;
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
onMarked(type, code) {
|
||||||
|
const result = String(code || '').trim();
|
||||||
|
if (!result || !this._active) return;
|
||||||
|
try {
|
||||||
|
if (this._barcode) this._barcode.cancel();
|
||||||
|
} catch (e) {
|
||||||
|
// ignore
|
||||||
|
}
|
||||||
|
this.$emit('success', result, type);
|
||||||
|
clearTimeout(this._restartTimer);
|
||||||
|
const gap = Number(this.scanTimeSpace) > 0 ? Number(this.scanTimeSpace) : 1200;
|
||||||
|
this._restartTimer = setTimeout(() => {
|
||||||
|
this.resumeScan();
|
||||||
|
}, gap);
|
||||||
|
},
|
||||||
|
resumeScan() {
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
if (!this.visible || !this._active || !this._barcode) return;
|
||||||
|
try {
|
||||||
|
this._barcode.start({
|
||||||
|
vibrate: true,
|
||||||
|
sound: 'default',
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
console.warn('PlusBarcodePanel resume failed', e);
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
destroyNative(clearActive = true) {
|
||||||
|
clearTimeout(this._restartTimer);
|
||||||
|
this._restartTimer = null;
|
||||||
|
if (clearActive) this._active = false;
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
const barcode = this._barcode;
|
||||||
|
this._barcode = null;
|
||||||
|
if (!barcode) return;
|
||||||
|
try {
|
||||||
|
barcode.cancel();
|
||||||
|
} catch (e) {
|
||||||
|
// ignore
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
barcode.close();
|
||||||
|
} catch (e) {
|
||||||
|
// ignore
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
@import '@/common/pda-typography.scss';
|
||||||
|
|
||||||
|
.plus-barcode-panel {
|
||||||
|
background: #000;
|
||||||
|
margin-top: 16rpx;
|
||||||
|
}
|
||||||
|
.plus-barcode-panel__toolbar {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
min-height: 72rpx;
|
||||||
|
padding: 12rpx 26rpx;
|
||||||
|
background: #1f1f1f;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.plus-barcode-panel__tip {
|
||||||
|
flex: 1;
|
||||||
|
color: #ffffff;
|
||||||
|
font-size: $pda-font-action;
|
||||||
|
padding-right: 16rpx;
|
||||||
|
}
|
||||||
|
.plus-barcode-panel__close {
|
||||||
|
color: #2979ff;
|
||||||
|
font-size: $pda-font-action;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
.plus-barcode-panel__holder {
|
||||||
|
width: 100%;
|
||||||
|
height: 420rpx;
|
||||||
|
background: #000;
|
||||||
|
}
|
||||||
|
.plus-barcode-panel__fallback {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: 420rpx;
|
||||||
|
padding: 24rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
background: #333;
|
||||||
|
color: #fff;
|
||||||
|
font-size: $pda-font-body;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,36 +1,135 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<view class="fabric-out-sectionTitle">{{ title }}</view>
|
<view class="summary-title">{{ title }}</view>
|
||||||
<slot name="before-list" />
|
<slot name="before-list" />
|
||||||
<view class="fabric-out-detailList">
|
<view class="summary-wrap">
|
||||||
<view
|
<scroll-view scroll-x class="summary-scroll">
|
||||||
|
<t-table v-if="list.length" border="1" border-color="#e5e5e5" :style="{ width: tableWidth }">
|
||||||
|
<t-tr class="summary-head" font-size="18" color="#666666" align="left">
|
||||||
|
<t-th v-for="col in columns" :key="col.key" :style="cellStyle(col)">{{ col.label }}</t-th>
|
||||||
|
</t-tr>
|
||||||
|
<t-tr
|
||||||
v-for="row in list"
|
v-for="row in list"
|
||||||
:key="row.group_key || row.id"
|
:key="row.group_key || row.id"
|
||||||
class="fabric-out-detailCard"
|
font-size="18"
|
||||||
|
color="#333333"
|
||||||
|
align="left"
|
||||||
|
@click="$emit('fabric-info', row)"
|
||||||
>
|
>
|
||||||
<view class="fabric-out-detailRow" @click="$emit('fabric-info', row)">
|
<t-td :style="cellStyle(columns[0])">{{ row.grey_fabric_code || '-' }}</t-td>
|
||||||
<text>{{ row.grey_fabric_code }}#{{ row.grey_fabric_name }}</text>
|
<t-td :style="cellStyle(columns[1])">{{ row.grey_fabric_name || '-' }}</t-td>
|
||||||
<u-icon name="arrow-right" size="32" color="#888" />
|
<t-td :style="cellStyle(columns[2])">{{ displayNum(row.roll) }}</t-td>
|
||||||
</view>
|
<t-td :style="cellStyle(columns[3])">{{ displayNum(row.weight) }}</t-td>
|
||||||
<view class="fabric-out-detailMeta">
|
<t-td class="summary-action" :style="cellStyle(columns[4])" @click.stop="$emit('fine-code', row)">细码</t-td>
|
||||||
<text>匹数:{{ row.roll }}</text>
|
</t-tr>
|
||||||
<text>重量:{{ row.weight }}KG</text>
|
<t-tr class="summary-total" font-size="18" color="#333333" align="left">
|
||||||
<u-button type="primary" size="mini" @click="$emit('fine-code', row)">细码</u-button>
|
<t-td :style="cellStyle(columns[0])">合计</t-td>
|
||||||
</view>
|
<t-td :style="cellStyle(columns[1])"></t-td>
|
||||||
</view>
|
<t-td :style="cellStyle(columns[2])">{{ totalRoll }}</t-td>
|
||||||
|
<t-td :style="cellStyle(columns[3])">{{ totalWeight }}</t-td>
|
||||||
|
<t-td :style="cellStyle(columns[4])"></t-td>
|
||||||
|
</t-tr>
|
||||||
|
</t-table>
|
||||||
|
<view v-else class="summary-empty">暂无出仓明细</view>
|
||||||
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import tTable from '@/components/t-table/t-table.vue';
|
||||||
|
import tTh from '@/components/t-table/t-th.vue';
|
||||||
|
import tTr from '@/components/t-table/t-tr.vue';
|
||||||
|
import tTd from '@/components/t-table/t-td.vue';
|
||||||
|
|
||||||
|
const COLUMNS = [
|
||||||
|
{ key: 'grey_fabric_code', label: '坯布编号', width: 220 },
|
||||||
|
{ key: 'grey_fabric_name', label: '坯布名称', width: 260 },
|
||||||
|
{ key: 'roll', label: '匹数', width: 140 },
|
||||||
|
{ key: 'weight', label: '重量', width: 160 },
|
||||||
|
{ key: 'action', label: '操作', width: 140 },
|
||||||
|
];
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components: { tTable, tTh, tTr, tTd },
|
||||||
props: {
|
props: {
|
||||||
list: { type: Array, default: () => [] },
|
list: { type: Array, default: () => [] },
|
||||||
title: { type: String, default: '出仓细码' },
|
title: { type: String, default: '出仓细码' },
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
columns() {
|
||||||
|
return COLUMNS;
|
||||||
|
},
|
||||||
|
tableWidth() {
|
||||||
|
const total = COLUMNS.reduce((sum, col) => sum + col.width, 0);
|
||||||
|
return `${total}rpx`;
|
||||||
|
},
|
||||||
|
totalRoll() {
|
||||||
|
return this.sumField('roll');
|
||||||
|
},
|
||||||
|
totalWeight() {
|
||||||
|
return this.sumField('weight');
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
cellStyle(col) {
|
||||||
|
const width = `${col.width}rpx`;
|
||||||
|
return {
|
||||||
|
width,
|
||||||
|
minWidth: width,
|
||||||
|
maxWidth: width,
|
||||||
|
flex: `0 0 ${width}`,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
displayNum(val) {
|
||||||
|
if (val === 0) return '0';
|
||||||
|
return val != null && val !== '' ? val : '-';
|
||||||
|
},
|
||||||
|
sumField(key) {
|
||||||
|
const total = (this.list || []).reduce((sum, row) => sum + Number(row[key] || 0), 0);
|
||||||
|
return Number(total.toFixed(2));
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@import '@/pages/storefabric/storeFabricBusinessOutPage.scss';
|
@import '@/common/pda-typography.scss';
|
||||||
|
|
||||||
|
.summary-title {
|
||||||
|
font-size: $pda-font-body;
|
||||||
|
font-weight: bold;
|
||||||
|
padding: 24rpx 26rpx 12rpx;
|
||||||
|
border-left: 6rpx solid #007AFF;
|
||||||
|
margin: 20rpx 26rpx 0;
|
||||||
|
}
|
||||||
|
.summary-wrap {
|
||||||
|
margin: 0 26rpx 16rpx;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.summary-scroll {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
::v-deep .t-th,
|
||||||
|
::v-deep .t-td {
|
||||||
|
box-sizing: border-box;
|
||||||
|
min-height: $pda-row-min-height;
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
::v-deep .summary-head {
|
||||||
|
background: #f7f8fa;
|
||||||
|
}
|
||||||
|
::v-deep .summary-total {
|
||||||
|
background: #fff7e6;
|
||||||
|
}
|
||||||
|
::v-deep .summary-action {
|
||||||
|
color: #2979ff;
|
||||||
|
}
|
||||||
|
.summary-empty {
|
||||||
|
padding: 28rpx 16rpx;
|
||||||
|
font-size: $pda-font-placeholder;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -10,8 +10,13 @@
|
|||||||
@input="$emit('input', $event.detail.value)"
|
@input="$emit('input', $event.detail.value)"
|
||||||
@confirm="$emit('scan')"
|
@confirm="$emit('scan')"
|
||||||
/>
|
/>
|
||||||
|
<view
|
||||||
|
v-if="showPhoneScan && scanning"
|
||||||
|
class="fabric-out-scanClose"
|
||||||
|
@click.stop="$emit('phone-scan')"
|
||||||
|
>关闭扫码</view>
|
||||||
<u-icon
|
<u-icon
|
||||||
v-if="showPhoneScan"
|
v-else-if="showPhoneScan"
|
||||||
class="fabric-out-phoneScanIcon"
|
class="fabric-out-phoneScanIcon"
|
||||||
name="scan"
|
name="scan"
|
||||||
size="44"
|
size="44"
|
||||||
@@ -38,15 +43,32 @@ export default {
|
|||||||
message: { type: String, default: '' },
|
message: { type: String, default: '' },
|
||||||
disabledTip: { type: String, default: '当前状态不可扫码' },
|
disabledTip: { type: String, default: '当前状态不可扫码' },
|
||||||
showPhoneScan: { type: Boolean, default: false },
|
showPhoneScan: { type: Boolean, default: false },
|
||||||
|
scanning: { type: Boolean, default: false },
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@import '@/pages/storefabric/storeFabricBusinessOutPage.scss';
|
@import '@/pages/storefabric/storeFabricBusinessOutPage.scss';
|
||||||
|
@import '@/common/pda-typography.scss';
|
||||||
|
|
||||||
.fabric-out-phoneScanIcon {
|
.fabric-out-phoneScanIcon {
|
||||||
margin-left: 16rpx;
|
margin-left: 16rpx;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
.fabric-out-scanClose {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin-left: 8rpx;
|
||||||
|
padding: 0 16rpx;
|
||||||
|
height: 72rpx;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
border: 1rpx solid #2979ff;
|
||||||
|
background: #eaf2ff;
|
||||||
|
color: #2979ff;
|
||||||
|
font-size: $pda-font-action;
|
||||||
|
flex-shrink: 0;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -0,0 +1,60 @@
|
|||||||
|
<template>
|
||||||
|
<view class="order-header-fold">
|
||||||
|
<view class="order-header-fold__bar" @click="toggle">
|
||||||
|
<text class="order-header-fold__title">单据信息</text>
|
||||||
|
<text v-if="summary" class="order-header-fold__summary">{{ summary }}</text>
|
||||||
|
<text class="order-header-fold__action">{{ value ? '展开' : '收起' }}</text>
|
||||||
|
</view>
|
||||||
|
<view v-show="!value">
|
||||||
|
<slot />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
value: { type: Boolean, default: false },
|
||||||
|
summary: { type: String, default: '' },
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
toggle() {
|
||||||
|
this.$emit('input', !this.value);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
@import '@/common/pda-typography.scss';
|
||||||
|
|
||||||
|
.order-header-fold__bar {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
min-height: $pda-row-min-height;
|
||||||
|
margin: 16rpx 26rpx 0;
|
||||||
|
padding: 0 24rpx;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
}
|
||||||
|
.order-header-fold__title {
|
||||||
|
font-size: $pda-font-body;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #1a1a1a;
|
||||||
|
}
|
||||||
|
.order-header-fold__summary {
|
||||||
|
flex: 1;
|
||||||
|
margin-left: 16rpx;
|
||||||
|
font-size: $pda-font-action;
|
||||||
|
color: #666;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
.order-header-fold__action {
|
||||||
|
margin-left: auto;
|
||||||
|
padding-left: 16rpx;
|
||||||
|
font-size: $pda-font-action;
|
||||||
|
color: #2979ff;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -22,7 +22,9 @@ export default {
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped lang="scss">
|
||||||
|
@import '@/common/status-tag.scss';
|
||||||
|
|
||||||
.statusRow {
|
.statusRow {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -32,18 +34,7 @@ export default {
|
|||||||
border-bottom: 1rpx solid #f5f5f5;
|
border-bottom: 1rpx solid #f5f5f5;
|
||||||
}
|
}
|
||||||
.statusLabel {
|
.statusLabel {
|
||||||
font-size: 28rpx;
|
font-size: $pda-font-body;
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
.statusTag {
|
|
||||||
font-size: 24rpx;
|
|
||||||
padding: 4rpx 12rpx;
|
|
||||||
border-radius: 6rpx;
|
|
||||||
font-weight: normal;
|
|
||||||
}
|
|
||||||
.status-0 { background: #f0f0f0; color: #666; }
|
|
||||||
.status-1 { background: #fff7e6; color: #fa8c16; }
|
|
||||||
.status-2 { background: #f6ffed; color: #52c41a; }
|
|
||||||
.status-3 { background: #fff1f0; color: #f5222d; }
|
|
||||||
.status-4 { background: #f5f5f5; color: #999; }
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -0,0 +1,294 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view class="summary-title">{{ title }}</view>
|
||||||
|
<slot name="before-list" />
|
||||||
|
<view class="summary-wrap">
|
||||||
|
<scroll-view scroll-x class="summary-scroll">
|
||||||
|
<t-table v-if="rows.length" border="1" border-color="#e5e5e5" :style="{ width: tableWidth }">
|
||||||
|
<t-tr class="summary-head" font-size="18" color="#666666" align="left">
|
||||||
|
<t-th v-for="col in columns" :key="col.key" :style="cellStyle(col)">{{ col.label }}</t-th>
|
||||||
|
</t-tr>
|
||||||
|
<t-tr
|
||||||
|
v-for="row in rows"
|
||||||
|
:key="row.group_key"
|
||||||
|
font-size="18"
|
||||||
|
color="#333333"
|
||||||
|
align="left"
|
||||||
|
:class="{ 'summary-row--open': expandedKey === row.group_key }"
|
||||||
|
@click="toggleRow(row.group_key)"
|
||||||
|
>
|
||||||
|
<t-td v-for="col in columns" :key="col.key" :style="cellStyle(col)">{{ formatCell(row, col.key) }}</t-td>
|
||||||
|
</t-tr>
|
||||||
|
<t-tr class="summary-total" font-size="18" color="#333333" align="left">
|
||||||
|
<t-td v-for="col in columns" :key="col.key" :style="cellStyle(col)">{{ totalCell(col.key) }}</t-td>
|
||||||
|
</t-tr>
|
||||||
|
</t-table>
|
||||||
|
<view v-else class="summary-empty">{{ emptyText }}</view>
|
||||||
|
</scroll-view>
|
||||||
|
|
||||||
|
<view v-if="expandedRow" class="summary-fine">
|
||||||
|
<view class="summary-fineTitle">
|
||||||
|
细码({{ expandedRow.fine_codes.length }})
|
||||||
|
<text class="summary-fineHint">{{ expandedKey ? '点击行收起' : '' }}</text>
|
||||||
|
</view>
|
||||||
|
<view v-if="!expandedRow.fine_codes.length" class="summary-empty">暂无细码</view>
|
||||||
|
<scroll-view v-else scroll-x class="summary-scroll">
|
||||||
|
<t-table border="1" border-color="#e5e5e5" :style="{ width: fineTableWidth }">
|
||||||
|
<t-tr class="summary-head" font-size="18" color="#666666" align="left">
|
||||||
|
<t-th v-for="col in fineCols" :key="col.key" :style="cellStyle(col)">{{ col.label }}</t-th>
|
||||||
|
</t-tr>
|
||||||
|
<t-tr
|
||||||
|
v-for="(fc, fcIndex) in expandedRow.fine_codes"
|
||||||
|
:key="fc.id || fcIndex"
|
||||||
|
font-size="18"
|
||||||
|
color="#333333"
|
||||||
|
align="left"
|
||||||
|
>
|
||||||
|
<t-td
|
||||||
|
v-for="col in fineCols"
|
||||||
|
:key="col.key"
|
||||||
|
:class="{ 'summary-action': col.key === 'action' }"
|
||||||
|
:style="cellStyle(col)"
|
||||||
|
@click="onFineCellTap(col.key, fc)"
|
||||||
|
>{{ formatFineCell(fc, col.key) }}</t-td>
|
||||||
|
</t-tr>
|
||||||
|
</t-table>
|
||||||
|
</scroll-view>
|
||||||
|
<view v-if="deletable && expandedRow.fine_codes.length" class="summary-tip">
|
||||||
|
点击「删除」移除对应细码
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import tTable from '@/components/t-table/t-table.vue';
|
||||||
|
import tTh from '@/components/t-table/t-th.vue';
|
||||||
|
import tTr from '@/components/t-table/t-tr.vue';
|
||||||
|
import tTd from '@/components/t-table/t-td.vue';
|
||||||
|
|
||||||
|
const SUMMARY_COLUMNS = [
|
||||||
|
{ label: '成品编号', key: 'product_code', width: 260 },
|
||||||
|
{ label: '色号', key: 'product_color_code', width: 220 },
|
||||||
|
{ label: '匹数', key: 'roll', width: 140 },
|
||||||
|
{ label: '数量', key: 'weight', width: 160 },
|
||||||
|
{ label: '染整单', key: 'quote_order_no', width: 260 },
|
||||||
|
{ label: '缸号', key: 'dye_factory_dyelot_number', width: 220 },
|
||||||
|
];
|
||||||
|
|
||||||
|
const FINE_COLUMNS = [
|
||||||
|
{ label: '卷号', key: 'volume_number', width: 140 },
|
||||||
|
{ label: '外部卷号', key: 'extern_volume_number', width: 180 },
|
||||||
|
{ label: '匹数', key: 'roll', width: 120 },
|
||||||
|
{ label: '数量', key: 'weight', width: 150 },
|
||||||
|
{ label: '仓位', key: 'warehouse_bin_name', width: 180 },
|
||||||
|
{ label: '缸号', key: 'dye_factory_dyelot_number', width: 200 },
|
||||||
|
];
|
||||||
|
|
||||||
|
const TARE_COLUMNS = [
|
||||||
|
{ label: '纸筒重量', key: 'paper_tube_weight', width: 180 },
|
||||||
|
{ label: '包装重量', key: 'package_weight', width: 180 },
|
||||||
|
];
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: { tTable, tTh, tTr, tTd },
|
||||||
|
props: {
|
||||||
|
groups: { type: Array, default: () => [] },
|
||||||
|
title: { type: String, default: '明细' },
|
||||||
|
emptyText: { type: String, default: '暂无明细' },
|
||||||
|
rollKey: { type: String, default: 'in_roll' },
|
||||||
|
weightKey: { type: String, default: 'in_weight' },
|
||||||
|
deletable: { type: Boolean, default: false },
|
||||||
|
showTareColumns: { type: Boolean, default: false },
|
||||||
|
showBarCode: { type: Boolean, default: false },
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
expandedKey: '',
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
columns() {
|
||||||
|
return SUMMARY_COLUMNS;
|
||||||
|
},
|
||||||
|
rows() {
|
||||||
|
const rows = [];
|
||||||
|
(this.groups || []).forEach((product) => {
|
||||||
|
(product.colors || []).forEach((color) => {
|
||||||
|
rows.push({
|
||||||
|
group_key: color.group_key,
|
||||||
|
product_code: product.product_code || '',
|
||||||
|
product_name: product.product_name || '',
|
||||||
|
product_color_code: color.product_color_code || '',
|
||||||
|
product_color_name: color.product_color_name || '',
|
||||||
|
quote_order_no: color.quote_order_no || '',
|
||||||
|
dye_factory_dyelot_number: color.dye_factory_dyelot_number || '',
|
||||||
|
roll: color[this.rollKey],
|
||||||
|
weight: color[this.weightKey],
|
||||||
|
fine_codes: color.fine_codes || [],
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return rows;
|
||||||
|
},
|
||||||
|
expandedRow() {
|
||||||
|
return this.rows.find((row) => row.group_key === this.expandedKey) || null;
|
||||||
|
},
|
||||||
|
fineCols() {
|
||||||
|
const cols = [...FINE_COLUMNS];
|
||||||
|
if (this.showBarCode) {
|
||||||
|
const idx = cols.findIndex((col) => col.key === 'weight');
|
||||||
|
cols.splice(idx + 1, 0, { label: '条码', key: 'bar_code', width: 280 });
|
||||||
|
}
|
||||||
|
if (this.showTareColumns) {
|
||||||
|
const idx = cols.findIndex((col) => col.key === 'weight');
|
||||||
|
cols.splice(idx + 1, 0, ...TARE_COLUMNS);
|
||||||
|
}
|
||||||
|
if (this.deletable) {
|
||||||
|
cols.push({ label: '操作', key: 'action', width: 120 });
|
||||||
|
}
|
||||||
|
return cols;
|
||||||
|
},
|
||||||
|
tableWidth() {
|
||||||
|
return this.sumWidth(this.columns);
|
||||||
|
},
|
||||||
|
fineTableWidth() {
|
||||||
|
return this.sumWidth(this.fineCols);
|
||||||
|
},
|
||||||
|
totalRoll() {
|
||||||
|
return this.sumField('roll');
|
||||||
|
},
|
||||||
|
totalWeight() {
|
||||||
|
return this.sumField('weight');
|
||||||
|
},
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
rows() {
|
||||||
|
if (this.expandedKey && !this.rows.some((row) => row.group_key === this.expandedKey)) {
|
||||||
|
this.expandedKey = '';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
sumWidth(cols) {
|
||||||
|
const total = cols.reduce((sum, col) => sum + (col.width || 120), 0);
|
||||||
|
return `${total}rpx`;
|
||||||
|
},
|
||||||
|
sumField(key) {
|
||||||
|
const total = this.rows.reduce((sum, row) => sum + Number(row[key] || 0), 0);
|
||||||
|
return Number(total.toFixed(2));
|
||||||
|
},
|
||||||
|
cellStyle(col) {
|
||||||
|
const width = `${col.width}rpx`;
|
||||||
|
return {
|
||||||
|
width,
|
||||||
|
minWidth: width,
|
||||||
|
maxWidth: width,
|
||||||
|
flex: `0 0 ${width}`,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
joinName(code, name) {
|
||||||
|
const main = code || '-';
|
||||||
|
return name ? `${main} ${name}` : main;
|
||||||
|
},
|
||||||
|
formatCell(row, key) {
|
||||||
|
if (key === 'product_code') return this.joinName(row.product_code, row.product_name);
|
||||||
|
if (key === 'product_color_code') return this.joinName(row.product_color_code, row.product_color_name);
|
||||||
|
if (key === 'roll' || key === 'weight') {
|
||||||
|
const val = row[key];
|
||||||
|
if (val === 0) return '0';
|
||||||
|
return val != null && val !== '' ? val : '-';
|
||||||
|
}
|
||||||
|
const val = row[key];
|
||||||
|
if (val === 0) return '0';
|
||||||
|
return val != null && val !== '' ? val : '-';
|
||||||
|
},
|
||||||
|
totalCell(key) {
|
||||||
|
if (key === 'product_code') return '合计';
|
||||||
|
if (key === 'roll') return this.totalRoll;
|
||||||
|
if (key === 'weight') return this.totalWeight;
|
||||||
|
return '';
|
||||||
|
},
|
||||||
|
toggleRow(key) {
|
||||||
|
this.expandedKey = this.expandedKey === key ? '' : key;
|
||||||
|
},
|
||||||
|
formatFineCell(fc, key) {
|
||||||
|
if (key === 'action') return '删除';
|
||||||
|
const val = fc[key];
|
||||||
|
if (val === 0) return '0';
|
||||||
|
return val != null && val !== '' ? val : '-';
|
||||||
|
},
|
||||||
|
onFineCellTap(key, fc) {
|
||||||
|
if (!this.deletable || key !== 'action') return;
|
||||||
|
this.$emit('delete', fc);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
@import '@/common/pda-typography.scss';
|
||||||
|
|
||||||
|
.summary-title {
|
||||||
|
font-size: $pda-font-body;
|
||||||
|
font-weight: bold;
|
||||||
|
padding: 24rpx 26rpx 12rpx;
|
||||||
|
border-left: 6rpx solid #007AFF;
|
||||||
|
margin: 20rpx 26rpx 0;
|
||||||
|
}
|
||||||
|
.summary-wrap {
|
||||||
|
margin: 0 26rpx 16rpx;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.summary-scroll {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
::v-deep .t-th,
|
||||||
|
::v-deep .t-td {
|
||||||
|
box-sizing: border-box;
|
||||||
|
min-height: $pda-row-min-height;
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
::v-deep .summary-head {
|
||||||
|
background: #f7f8fa;
|
||||||
|
}
|
||||||
|
::v-deep .summary-row--open {
|
||||||
|
background: #f0f7ff;
|
||||||
|
}
|
||||||
|
::v-deep .summary-total {
|
||||||
|
background: #fff7e6;
|
||||||
|
}
|
||||||
|
::v-deep .summary-action {
|
||||||
|
color: #f5222d;
|
||||||
|
}
|
||||||
|
.summary-empty {
|
||||||
|
padding: 28rpx 16rpx;
|
||||||
|
font-size: $pda-font-placeholder;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
.summary-fine {
|
||||||
|
padding: 8rpx 0 16rpx;
|
||||||
|
}
|
||||||
|
.summary-fineTitle {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 12rpx 16rpx 8rpx;
|
||||||
|
font-size: $pda-font-action;
|
||||||
|
color: #2979ff;
|
||||||
|
}
|
||||||
|
.summary-fineHint {
|
||||||
|
color: #999;
|
||||||
|
font-size: $pda-font-popup-sub;
|
||||||
|
}
|
||||||
|
.summary-action {
|
||||||
|
color: #f5222d;
|
||||||
|
}
|
||||||
|
.summary-tip {
|
||||||
|
padding: 8rpx 16rpx 0;
|
||||||
|
font-size: $pda-font-popup-sub;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -11,8 +11,13 @@
|
|||||||
@confirm="$emit('confirm')"
|
@confirm="$emit('confirm')"
|
||||||
/>
|
/>
|
||||||
<text v-if="name" class="process-in-binName">{{ name }}</text>
|
<text v-if="name" class="process-in-binName">{{ name }}</text>
|
||||||
|
<view
|
||||||
|
v-if="showPhoneScan && scanning"
|
||||||
|
class="fabric-out-scanClose"
|
||||||
|
@click.stop="$emit('phone-scan')"
|
||||||
|
>关闭扫码</view>
|
||||||
<u-icon
|
<u-icon
|
||||||
v-if="showPhoneScan"
|
v-else-if="showPhoneScan"
|
||||||
class="fabric-out-phoneScanIcon"
|
class="fabric-out-phoneScanIcon"
|
||||||
name="scan"
|
name="scan"
|
||||||
size="44"
|
size="44"
|
||||||
@@ -34,6 +39,7 @@ export default {
|
|||||||
code: { type: String, default: '' },
|
code: { type: String, default: '' },
|
||||||
name: { type: String, default: '' },
|
name: { type: String, default: '' },
|
||||||
showPhoneScan: { type: Boolean, default: false },
|
showPhoneScan: { type: Boolean, default: false },
|
||||||
|
scanning: { type: Boolean, default: false },
|
||||||
showDisabledTip: { type: Boolean, default: true },
|
showDisabledTip: { type: Boolean, default: true },
|
||||||
disabledTip: { type: String, default: '请先提交保存后再扫仓位' },
|
disabledTip: { type: String, default: '请先提交保存后再扫仓位' },
|
||||||
},
|
},
|
||||||
@@ -42,6 +48,7 @@ export default {
|
|||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@import '@/pages/storefabric/storeFabricBusinessOutPage.scss';
|
@import '@/pages/storefabric/storeFabricBusinessOutPage.scss';
|
||||||
|
@import '@/common/pda-typography.scss';
|
||||||
|
|
||||||
.process-in-binRow {
|
.process-in-binRow {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
@@ -53,6 +60,21 @@ export default {
|
|||||||
margin-left: 16rpx;
|
margin-left: 16rpx;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
.fabric-out-scanClose {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin-left: 8rpx;
|
||||||
|
padding: 0 16rpx;
|
||||||
|
height: 72rpx;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
border: 1rpx solid #2979ff;
|
||||||
|
background: #eaf2ff;
|
||||||
|
color: #2979ff;
|
||||||
|
font-size: $pda-font-action;
|
||||||
|
flex-shrink: 0;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
.process-in-binName {
|
.process-in-binName {
|
||||||
margin-left: 12rpx;
|
margin-left: 12rpx;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
|
|||||||
@@ -1,261 +1,35 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<FineCodeSummaryTable
|
||||||
<view class="fabric-out-sectionTitle">{{ title }}</view>
|
:groups="groups"
|
||||||
<slot name="before-list" />
|
:title="title"
|
||||||
<view class="fabric-out-detailList">
|
:empty-text="emptyText"
|
||||||
<dataNull
|
roll-key="in_roll"
|
||||||
v-if="!groups.length"
|
weight-key="in_weight"
|
||||||
src="/src/static/img/chahua/gjNull.png"
|
:deletable="deletable"
|
||||||
title="暂无进仓明细"
|
:show-tare-columns="showTareColumns"
|
||||||
title1="扫码后将在此展示"
|
@delete="$emit('delete', $event)"
|
||||||
/>
|
|
||||||
<view
|
|
||||||
v-for="product in groups"
|
|
||||||
:key="product.group_key"
|
|
||||||
class="fabric-out-detailCard process-in-productCard"
|
|
||||||
>
|
>
|
||||||
<view class="process-in-productHead">
|
<slot name="before-list" slot="before-list" />
|
||||||
<text class="process-in-productTitle">
|
</FineCodeSummaryTable>
|
||||||
{{ product.product_code || '-' }}<text v-if="product.product_name" class="process-in-subText">{{ ' ' + product.product_name }}</text>
|
|
||||||
</text>
|
|
||||||
<text class="process-in-productSum">
|
|
||||||
匹数 {{ product.in_roll }} / 数量 {{ product.in_weight }}
|
|
||||||
</text>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view
|
|
||||||
v-for="color in product.colors"
|
|
||||||
:key="color.group_key"
|
|
||||||
class="process-in-colorBlock"
|
|
||||||
>
|
|
||||||
<view class="process-in-colorHead">
|
|
||||||
<text class="process-in-colorTitle">
|
|
||||||
色号 {{ color.product_color_code || '-' }}<text v-if="color.product_color_name" class="process-in-subText">{{ ' ' + color.product_color_name }}</text>
|
|
||||||
</text>
|
|
||||||
<text class="process-in-colorSum">
|
|
||||||
匹数 {{ color.in_roll }} / 数量 {{ color.in_weight }}
|
|
||||||
</text>
|
|
||||||
</view>
|
|
||||||
<view class="process-in-colorMeta">
|
|
||||||
<text>染整单:{{ color.quote_order_no || '-' }}</text>
|
|
||||||
<text>缸号:{{ color.dye_factory_dyelot_number || '-' }}</text>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="process-in-fcTitle">细码({{ color.fine_codes.length }})</view>
|
|
||||||
<view v-if="!color.fine_codes.length" class="process-in-fcEmpty">暂无细码</view>
|
|
||||||
<scroll-view v-else scroll-x class="process-in-fcScroll">
|
|
||||||
<view class="process-in-fcTable" :style="{ width: fineTableWidth }">
|
|
||||||
<view class="process-in-fcRow process-in-fcHead">
|
|
||||||
<view
|
|
||||||
v-for="col in fineColumns"
|
|
||||||
:key="col.key"
|
|
||||||
class="process-in-fcCell"
|
|
||||||
:style="cellStyle(col)"
|
|
||||||
>{{ col.label }}</view>
|
|
||||||
</view>
|
|
||||||
<view
|
|
||||||
v-for="(fc, fcIndex) in color.fine_codes"
|
|
||||||
:key="fc.id || fcIndex"
|
|
||||||
class="process-in-fcRow"
|
|
||||||
>
|
|
||||||
<view
|
|
||||||
v-for="col in fineColumns"
|
|
||||||
:key="col.key"
|
|
||||||
class="process-in-fcCell"
|
|
||||||
:class="{ 'process-in-fcAction': col.key === 'action' }"
|
|
||||||
:style="cellStyle(col)"
|
|
||||||
@click="onCellTap(col.key, fc)"
|
|
||||||
>{{ formatFineCell(fc, col.key) }}</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</scroll-view>
|
|
||||||
<view v-if="deletable && color.fine_codes.length" class="process-in-fcTip">
|
|
||||||
勾选上方「删除」后扫码,或点击「删除」列移除细码
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import FineCodeSummaryTable from '@/components/storegoods/FineCodeSummaryTable.vue';
|
||||||
import { buildItemGroups } from '@/common/storeGoodsProcessIn';
|
import { buildItemGroups } from '@/common/storeGoodsProcessIn';
|
||||||
|
|
||||||
const FINE_COLUMNS = [
|
|
||||||
{ label: '卷号', key: 'volume_number', width: 110 },
|
|
||||||
{ label: '外部卷号', key: 'extern_volume_number', width: 140 },
|
|
||||||
{ label: '匹数', key: 'roll', width: 100 },
|
|
||||||
{ label: '数量', key: 'weight', width: 130 },
|
|
||||||
{ label: '仓位', key: 'warehouse_bin_name', width: 140 },
|
|
||||||
{ label: '缸号', key: 'dye_factory_dyelot_number', width: 160 },
|
|
||||||
];
|
|
||||||
|
|
||||||
const TARE_COLUMNS = [
|
|
||||||
{ label: '纸筒重量', key: 'paper_tube_weight', width: 140 },
|
|
||||||
{ label: '包装重量', key: 'package_weight', width: 140 },
|
|
||||||
];
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components: { FineCodeSummaryTable },
|
||||||
props: {
|
props: {
|
||||||
list: { type: Array, default: () => [] },
|
list: { type: Array, default: () => [] },
|
||||||
title: { type: String, default: '进仓明细' },
|
title: { type: String, default: '进仓明细' },
|
||||||
|
emptyText: { type: String, default: '暂无进仓明细' },
|
||||||
deletable: { type: Boolean, default: false },
|
deletable: { type: Boolean, default: false },
|
||||||
/** 加工/采购进仓:细码行展示扫码时提交的纸筒、包装重量 */
|
|
||||||
showTareColumns: { type: Boolean, default: false },
|
showTareColumns: { type: Boolean, default: false },
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
groups() {
|
groups() {
|
||||||
return buildItemGroups(this.list);
|
return buildItemGroups(this.list);
|
||||||
},
|
},
|
||||||
fineColumns() {
|
|
||||||
const cols = [...FINE_COLUMNS];
|
|
||||||
if (this.showTareColumns) {
|
|
||||||
const idx = cols.findIndex((col) => col.key === 'weight');
|
|
||||||
cols.splice(idx + 1, 0, ...TARE_COLUMNS);
|
|
||||||
}
|
|
||||||
if (this.deletable) {
|
|
||||||
cols.push({ label: '操作', key: 'action', width: 100 });
|
|
||||||
}
|
|
||||||
return cols;
|
|
||||||
},
|
|
||||||
fineTableWidth() {
|
|
||||||
const total = this.fineColumns.reduce((sum, col) => sum + (col.width || 100), 0);
|
|
||||||
return `${total}rpx`;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
cellStyle(col) {
|
|
||||||
return {
|
|
||||||
width: `${col.width}rpx`,
|
|
||||||
minWidth: `${col.width}rpx`,
|
|
||||||
maxWidth: `${col.width}rpx`,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
formatFineCell(fc, key) {
|
|
||||||
if (key === 'action') return '删除';
|
|
||||||
const val = fc[key];
|
|
||||||
if (val === 0) return '0';
|
|
||||||
return val != null && val !== '' ? val : '-';
|
|
||||||
},
|
|
||||||
onCellTap(key, fc) {
|
|
||||||
if (!this.deletable || key !== 'action') return;
|
|
||||||
this.$emit('delete', fc);
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
@import '@/pages/storefabric/storeFabricBusinessOutPage.scss';
|
|
||||||
|
|
||||||
.process-in-productCard {
|
|
||||||
padding: 0;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
.process-in-productHead {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
padding: 20rpx;
|
|
||||||
background: #f0f7ff;
|
|
||||||
border-bottom: 1rpx solid #e6f0ff;
|
|
||||||
}
|
|
||||||
.process-in-productTitle {
|
|
||||||
font-size: 32rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #1a1a1a;
|
|
||||||
flex: 1;
|
|
||||||
padding-right: 16rpx;
|
|
||||||
}
|
|
||||||
.process-in-productSum,
|
|
||||||
.process-in-colorSum {
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #666;
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
.process-in-subText {
|
|
||||||
font-weight: normal;
|
|
||||||
color: #666;
|
|
||||||
font-size: 28rpx;
|
|
||||||
}
|
|
||||||
.process-in-colorBlock {
|
|
||||||
padding: 16rpx 20rpx 20rpx;
|
|
||||||
border-bottom: 1rpx solid #f0f0f0;
|
|
||||||
}
|
|
||||||
.process-in-colorBlock:last-child {
|
|
||||||
border-bottom: none;
|
|
||||||
}
|
|
||||||
.process-in-colorHead {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
margin-bottom: 8rpx;
|
|
||||||
}
|
|
||||||
.process-in-colorTitle {
|
|
||||||
font-size: 30rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #333;
|
|
||||||
flex: 1;
|
|
||||||
padding-right: 12rpx;
|
|
||||||
}
|
|
||||||
.process-in-colorMeta {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 16rpx 24rpx;
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #888;
|
|
||||||
margin-bottom: 12rpx;
|
|
||||||
}
|
|
||||||
.process-in-fcTitle {
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #2979ff;
|
|
||||||
margin-bottom: 8rpx;
|
|
||||||
}
|
|
||||||
.process-in-fcEmpty {
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #bbb;
|
|
||||||
padding: 8rpx 0;
|
|
||||||
}
|
|
||||||
.process-in-fcScroll {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.process-in-fcTable {
|
|
||||||
border: 1rpx solid #eee;
|
|
||||||
border-radius: 8rpx;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
.process-in-fcRow {
|
|
||||||
display: flex;
|
|
||||||
align-items: stretch;
|
|
||||||
border-bottom: 1rpx solid #f0f0f0;
|
|
||||||
}
|
|
||||||
.process-in-fcRow:last-child {
|
|
||||||
border-bottom: none;
|
|
||||||
}
|
|
||||||
.process-in-fcHead {
|
|
||||||
background: #fafafa;
|
|
||||||
}
|
|
||||||
.process-in-fcCell {
|
|
||||||
box-sizing: border-box;
|
|
||||||
padding: 14rpx 10rpx;
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #333;
|
|
||||||
border-right: 1rpx solid #f0f0f0;
|
|
||||||
word-break: break-all;
|
|
||||||
}
|
|
||||||
.process-in-fcHead .process-in-fcCell {
|
|
||||||
font-weight: bold;
|
|
||||||
color: #666;
|
|
||||||
}
|
|
||||||
.process-in-fcCell:last-child {
|
|
||||||
border-right: none;
|
|
||||||
}
|
|
||||||
.process-in-fcAction {
|
|
||||||
color: #f5222d;
|
|
||||||
}
|
|
||||||
.process-in-fcTip {
|
|
||||||
margin-top: 8rpx;
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|||||||
@@ -1,97 +1,24 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<FineCodeSummaryTable
|
||||||
<view class="fabric-out-sectionTitle">{{ title }}</view>
|
:groups="groups"
|
||||||
<slot name="before-list" />
|
:title="title"
|
||||||
<view class="fabric-out-detailList">
|
empty-text="暂无出仓明细"
|
||||||
<dataNull
|
roll-key="out_roll"
|
||||||
v-if="!groups.length"
|
weight-key="out_weight"
|
||||||
src="/src/static/img/chahua/gjNull.png"
|
:deletable="deletable"
|
||||||
title="暂无出仓明细"
|
show-bar-code
|
||||||
title1="扫码后将在此展示"
|
@delete="$emit('delete', $event)"
|
||||||
/>
|
|
||||||
<view
|
|
||||||
v-for="product in groups"
|
|
||||||
:key="product.group_key"
|
|
||||||
class="fabric-out-detailCard process-in-productCard"
|
|
||||||
>
|
>
|
||||||
<view class="process-in-productHead">
|
<slot name="before-list" slot="before-list" />
|
||||||
<text class="process-in-productTitle">
|
</FineCodeSummaryTable>
|
||||||
{{ product.product_code || '-' }}<text v-if="product.product_name" class="process-in-subText">{{ ' ' + product.product_name }}</text>
|
|
||||||
</text>
|
|
||||||
<text class="process-in-productSum">
|
|
||||||
匹数 {{ product.out_roll }} / 数量 {{ product.out_weight }}
|
|
||||||
</text>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view
|
|
||||||
v-for="color in product.colors"
|
|
||||||
:key="color.group_key"
|
|
||||||
class="process-in-colorBlock"
|
|
||||||
>
|
|
||||||
<view class="process-in-colorHead">
|
|
||||||
<text class="process-in-colorTitle">
|
|
||||||
色号 {{ color.product_color_code || '-' }}<text v-if="color.product_color_name" class="process-in-subText">{{ ' ' + color.product_color_name }}</text>
|
|
||||||
</text>
|
|
||||||
<text class="process-in-colorSum">
|
|
||||||
匹数 {{ color.out_roll }} / 数量 {{ color.out_weight }}
|
|
||||||
</text>
|
|
||||||
</view>
|
|
||||||
<view class="process-in-colorMeta">
|
|
||||||
<text>染整单:{{ color.quote_order_no || '-' }}</text>
|
|
||||||
<text>缸号:{{ color.dye_factory_dyelot_number || '-' }}</text>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="process-in-fcTitle">细码({{ color.fine_codes.length }})</view>
|
|
||||||
<view v-if="!color.fine_codes.length" class="process-in-fcEmpty">暂无细码</view>
|
|
||||||
<scroll-view v-else scroll-x class="process-in-fcScroll">
|
|
||||||
<view class="process-in-fcTable" :style="{ width: fineTableWidth }">
|
|
||||||
<view class="process-in-fcRow process-in-fcHead">
|
|
||||||
<view
|
|
||||||
v-for="col in fineColumns"
|
|
||||||
:key="col.key"
|
|
||||||
class="process-in-fcCell"
|
|
||||||
:style="cellStyle(col)"
|
|
||||||
>{{ col.label }}</view>
|
|
||||||
</view>
|
|
||||||
<view
|
|
||||||
v-for="(fc, fcIndex) in color.fine_codes"
|
|
||||||
:key="fc.id || fcIndex"
|
|
||||||
class="process-in-fcRow"
|
|
||||||
>
|
|
||||||
<view
|
|
||||||
v-for="col in fineColumns"
|
|
||||||
:key="col.key"
|
|
||||||
class="process-in-fcCell"
|
|
||||||
:class="{ 'process-in-fcAction': col.key === 'action' }"
|
|
||||||
:style="cellStyle(col)"
|
|
||||||
@click="onCellTap(col.key, fc)"
|
|
||||||
>{{ formatFineCell(fc, col.key) }}</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</scroll-view>
|
|
||||||
<view v-if="deletable && color.fine_codes.length" class="process-in-fcTip">
|
|
||||||
勾选上方「删除」后扫码,或点击「删除」列移除细码
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import FineCodeSummaryTable from '@/components/storegoods/FineCodeSummaryTable.vue';
|
||||||
import { buildItemGroups } from '@/common/storeGoodsProcessOut';
|
import { buildItemGroups } from '@/common/storeGoodsProcessOut';
|
||||||
|
|
||||||
const FINE_COLUMNS = [
|
|
||||||
{ label: '卷号', key: 'volume_number', width: 110 },
|
|
||||||
{ label: '外部卷号', key: 'extern_volume_number', width: 140 },
|
|
||||||
{ label: '匹数', key: 'roll', width: 100 },
|
|
||||||
{ label: '数量', key: 'weight', width: 130 },
|
|
||||||
{ label: '条码', key: 'bar_code', width: 260 },
|
|
||||||
{ label: '仓位', key: 'warehouse_bin_name', width: 140 },
|
|
||||||
{ label: '缸号', key: 'dye_factory_dyelot_number', width: 160 },
|
|
||||||
];
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components: { FineCodeSummaryTable },
|
||||||
props: {
|
props: {
|
||||||
list: { type: Array, default: () => [] },
|
list: { type: Array, default: () => [] },
|
||||||
title: { type: String, default: '出仓明细' },
|
title: { type: String, default: '出仓明细' },
|
||||||
@@ -101,148 +28,6 @@ export default {
|
|||||||
groups() {
|
groups() {
|
||||||
return buildItemGroups(this.list);
|
return buildItemGroups(this.list);
|
||||||
},
|
},
|
||||||
fineColumns() {
|
|
||||||
if (!this.deletable) return FINE_COLUMNS;
|
|
||||||
return [...FINE_COLUMNS, { label: '操作', key: 'action', width: 100 }];
|
|
||||||
},
|
|
||||||
fineTableWidth() {
|
|
||||||
const total = this.fineColumns.reduce((sum, col) => sum + (col.width || 100), 0);
|
|
||||||
return `${total}rpx`;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
cellStyle(col) {
|
|
||||||
return {
|
|
||||||
width: `${col.width}rpx`,
|
|
||||||
minWidth: `${col.width}rpx`,
|
|
||||||
maxWidth: `${col.width}rpx`,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
formatFineCell(fc, key) {
|
|
||||||
if (key === 'action') return '删除';
|
|
||||||
const val = fc[key];
|
|
||||||
if (val === 0) return '0';
|
|
||||||
return val != null && val !== '' ? val : '-';
|
|
||||||
},
|
|
||||||
onCellTap(key, fc) {
|
|
||||||
if (!this.deletable || key !== 'action') return;
|
|
||||||
this.$emit('delete', fc);
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
@import '@/pages/storefabric/storeFabricBusinessOutPage.scss';
|
|
||||||
|
|
||||||
.process-in-productCard {
|
|
||||||
padding: 0;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
.process-in-productHead {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
padding: 20rpx;
|
|
||||||
background: #f0f7ff;
|
|
||||||
border-bottom: 1rpx solid #e6f0ff;
|
|
||||||
}
|
|
||||||
.process-in-productTitle {
|
|
||||||
font-size: 32rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #1a1a1a;
|
|
||||||
flex: 1;
|
|
||||||
padding-right: 16rpx;
|
|
||||||
}
|
|
||||||
.process-in-productSum,
|
|
||||||
.process-in-colorSum {
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #666;
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
.process-in-subText {
|
|
||||||
font-weight: normal;
|
|
||||||
color: #666;
|
|
||||||
font-size: 28rpx;
|
|
||||||
}
|
|
||||||
.process-in-colorBlock {
|
|
||||||
padding: 16rpx 20rpx 20rpx;
|
|
||||||
border-bottom: 1rpx solid #f0f0f0;
|
|
||||||
}
|
|
||||||
.process-in-colorBlock:last-child {
|
|
||||||
border-bottom: none;
|
|
||||||
}
|
|
||||||
.process-in-colorHead {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
margin-bottom: 8rpx;
|
|
||||||
}
|
|
||||||
.process-in-colorTitle {
|
|
||||||
font-size: 30rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #333;
|
|
||||||
flex: 1;
|
|
||||||
padding-right: 12rpx;
|
|
||||||
}
|
|
||||||
.process-in-colorMeta {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 16rpx 24rpx;
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #888;
|
|
||||||
margin-bottom: 12rpx;
|
|
||||||
}
|
|
||||||
.process-in-fcTitle {
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #2979ff;
|
|
||||||
margin-bottom: 8rpx;
|
|
||||||
}
|
|
||||||
.process-in-fcEmpty {
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #bbb;
|
|
||||||
padding: 8rpx 0;
|
|
||||||
}
|
|
||||||
.process-in-fcScroll {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.process-in-fcTable {
|
|
||||||
border: 1rpx solid #eee;
|
|
||||||
border-radius: 8rpx;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
.process-in-fcRow {
|
|
||||||
display: flex;
|
|
||||||
align-items: stretch;
|
|
||||||
border-bottom: 1rpx solid #f0f0f0;
|
|
||||||
}
|
|
||||||
.process-in-fcRow:last-child {
|
|
||||||
border-bottom: none;
|
|
||||||
}
|
|
||||||
.process-in-fcHead {
|
|
||||||
background: #fafafa;
|
|
||||||
}
|
|
||||||
.process-in-fcCell {
|
|
||||||
box-sizing: border-box;
|
|
||||||
padding: 14rpx 10rpx;
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #333;
|
|
||||||
border-right: 1rpx solid #f0f0f0;
|
|
||||||
word-break: break-all;
|
|
||||||
}
|
|
||||||
.process-in-fcHead .process-in-fcCell {
|
|
||||||
font-weight: bold;
|
|
||||||
color: #666;
|
|
||||||
}
|
|
||||||
.process-in-fcCell:last-child {
|
|
||||||
border-right: none;
|
|
||||||
}
|
|
||||||
.process-in-fcAction {
|
|
||||||
color: #f5222d;
|
|
||||||
}
|
|
||||||
.process-in-fcTip {
|
|
||||||
margin-top: 8rpx;
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|||||||
@@ -0,0 +1,86 @@
|
|||||||
|
<template>
|
||||||
|
<view class="t-table" :style="{ 'border-width': border + 'px', 'border-color': borderColor }">
|
||||||
|
<slot />
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
border: {
|
||||||
|
type: String,
|
||||||
|
default: '1'
|
||||||
|
},
|
||||||
|
borderColor: {
|
||||||
|
type: String,
|
||||||
|
default: '#d0dee5'
|
||||||
|
},
|
||||||
|
isCheck: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
provide() {
|
||||||
|
return {
|
||||||
|
table: this
|
||||||
|
};
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.childrens = [];
|
||||||
|
this.index = 0;
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
fire(e, index, len) {
|
||||||
|
let childrens = this.childrens;
|
||||||
|
console.log(childrens);
|
||||||
|
// 全选
|
||||||
|
if (index === 0) {
|
||||||
|
childrens.map((vm, index) => {
|
||||||
|
vm.checkboxData.checked = e;
|
||||||
|
return vm;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
let isAll = childrens.find((n, ids) => ids !== 0 && !n.checkboxData.checked);
|
||||||
|
childrens[0].checkboxData.checked = isAll ? false : true;
|
||||||
|
}
|
||||||
|
|
||||||
|
let fireArr = [];
|
||||||
|
for (let i = 0; i < childrens.length; i++) {
|
||||||
|
if (childrens[i].checkboxData.checked && i !== 0) {
|
||||||
|
fireArr.push(childrens[i].checkboxData.value - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.$emit('change', {
|
||||||
|
detail: fireArr
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.t-table {
|
||||||
|
width: 100%;
|
||||||
|
border: 1px #d0dee5 solid;
|
||||||
|
border-left: none;
|
||||||
|
border-top: none;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.t-table>>>t-tr {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.t-table>>>t-tr:nth-child(2n) {
|
||||||
|
background: #f5f5f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* #ifdef H5 */
|
||||||
|
.t-table>>>.t-tr:nth-child(2n) {
|
||||||
|
background: #f5f5f5;
|
||||||
|
}
|
||||||
|
/* #endif */
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
<template>
|
||||||
|
<view class="t-td" :style="{ 'border-width': thBorder + 'px','border-color':borderColor ,'font-size':fontSize+'px' ,'color':color,'justify-content':tdAlignCpd}" @click="$emit('click', $event)">
|
||||||
|
<slot></slot>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
align: String
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
thBorder: '1',
|
||||||
|
borderColor: '#d0dee5',
|
||||||
|
fontSize: '14',
|
||||||
|
color: '#555c60',
|
||||||
|
tdAlign: 'center'
|
||||||
|
};
|
||||||
|
},
|
||||||
|
inject: ['table', 'tr'],
|
||||||
|
|
||||||
|
created() {
|
||||||
|
this.thBorder = this.table.border;
|
||||||
|
this.borderColor = this.table.borderColor;
|
||||||
|
this.fontSize = this.tr.fontSize;
|
||||||
|
this.color = this.tr.color;
|
||||||
|
if (this.align) {
|
||||||
|
this.tdAlign = this.align;
|
||||||
|
} else {
|
||||||
|
this.tdAlign = this.tr.align
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
tdAlignCpd() {
|
||||||
|
let nameAlign = '';
|
||||||
|
switch (this.tdAlign) {
|
||||||
|
case 'left':
|
||||||
|
nameAlign = 'flex-start'
|
||||||
|
break;
|
||||||
|
case 'center':
|
||||||
|
nameAlign = 'center'
|
||||||
|
break;
|
||||||
|
case 'right':
|
||||||
|
nameAlign = 'flex-end'
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
nameAlign = 'center'
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return nameAlign
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.t-td {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
padding: 14upx;
|
||||||
|
border-top: 1px #d0dee5 solid;
|
||||||
|
border-left: 1px #d0dee5 solid;
|
||||||
|
text-align: center;
|
||||||
|
color: #555c60;
|
||||||
|
font-size: 28upx;
|
||||||
|
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
<template>
|
||||||
|
<view class="t-th" :style="{ 'border-width': thBorder + 'px' ,'border-color':borderColor,'font-size':fontSize+'px' ,'color':color,'justify-content':thAlignCpd}">
|
||||||
|
<slot></slot>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
align: String,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
thBorder: '1',
|
||||||
|
borderColor: '#d0dee5',
|
||||||
|
fontSize: '15',
|
||||||
|
color: '#3b4246',
|
||||||
|
thAlign: 'center'
|
||||||
|
};
|
||||||
|
},
|
||||||
|
inject: ['table', 'tr'],
|
||||||
|
|
||||||
|
created() {
|
||||||
|
this.thBorder = this.table.border;
|
||||||
|
this.borderColor = this.table.borderColor;
|
||||||
|
this.fontSize = this.tr.fontSize;
|
||||||
|
this.color = this.tr.color;
|
||||||
|
if (this.align) {
|
||||||
|
this.thAlign = this.align;
|
||||||
|
} else {
|
||||||
|
this.thAlign = this.tr.align
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
thAlignCpd() {
|
||||||
|
let nameAlign = '';
|
||||||
|
switch (this.thAlign) {
|
||||||
|
case 'left':
|
||||||
|
nameAlign = 'flex-start'
|
||||||
|
break;
|
||||||
|
case 'center':
|
||||||
|
nameAlign = 'center'
|
||||||
|
break;
|
||||||
|
case 'right':
|
||||||
|
nameAlign = 'flex-end'
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
nameAlign = 'center'
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return nameAlign
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.t-th {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 30upx;
|
||||||
|
font-weight: bold;
|
||||||
|
text-align: center;
|
||||||
|
color: #3b4246;
|
||||||
|
border-left: 1px #d0dee5 solid;
|
||||||
|
border-top: 1px #d0dee5 solid;
|
||||||
|
padding: 15upx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
<template>
|
||||||
|
<view class="t-tr" @click="$emit('click', $event)">
|
||||||
|
<view v-if="isCheck" class="t-check-box" :style="{ 'border-width': thBorder + 'px' ,'border-color':borderColor}">
|
||||||
|
<checkbox-group @change="checkboxChange">
|
||||||
|
<checkbox :value="checkboxData.value + ''" :checked="checkboxData.checked" />
|
||||||
|
</checkbox-group>
|
||||||
|
</view>
|
||||||
|
<slot></slot>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
fontSize: String,
|
||||||
|
color: String,
|
||||||
|
align: String
|
||||||
|
},
|
||||||
|
inject: ['table'],
|
||||||
|
provide() {
|
||||||
|
return {
|
||||||
|
tr: this
|
||||||
|
};
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
isCheck: false,
|
||||||
|
checkboxData: {
|
||||||
|
value: 0,
|
||||||
|
checked: false
|
||||||
|
},
|
||||||
|
checked: false,
|
||||||
|
thBorder: '1',
|
||||||
|
borderColor: '#d0dee5'
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.thBorder = this.table.border;
|
||||||
|
this.borderColor = this.table.borderColor;
|
||||||
|
this.table.childrens.push(this);
|
||||||
|
this.checkboxData.value = this.table.index++;
|
||||||
|
this.isCheck = this.table.isCheck;
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
checkboxChange(e) {
|
||||||
|
this.checkboxData.checked = !this.checkboxData.checked;
|
||||||
|
this.table.childrens[this.checkboxData.value] = this;
|
||||||
|
this.table.fire(e.detail.value[0] ? true : false, this.checkboxData.value, this.table.index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.t-tr {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.t-tr t-th,
|
||||||
|
.t-tr t-td {
|
||||||
|
display: flex;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.t-tr .t-check-box {
|
||||||
|
flex-shrink: 0;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
width: 80upx;
|
||||||
|
color: #3b4246;
|
||||||
|
border-left: 1px #d0dee5 solid;
|
||||||
|
border-top: 1px #d0dee5 solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
.t-tr .t-check-box checkbox {
|
||||||
|
transform: scale(0.8);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,247 @@
|
|||||||
|
<template>
|
||||||
|
<u-popup mode="bottom" :border-radius="borderRadius" :popup="false" v-model="value" :maskCloseAble="maskCloseAble"
|
||||||
|
length="auto" :safeAreaInsetBottom="safeAreaInsetBottom" @close="popupClose" :z-index="uZIndex">
|
||||||
|
<view class="u-tips u-border-bottom" v-if="tips.text" :style="[tipsStyle]">
|
||||||
|
{{tips.text}}
|
||||||
|
</view>
|
||||||
|
<view class="u-action-sheet-search" v-if="showSearch" @tap.stop>
|
||||||
|
<u-icon name="search" size="32" color="#909399"></u-icon>
|
||||||
|
<input
|
||||||
|
class="u-action-sheet-search__input"
|
||||||
|
:value="keyword"
|
||||||
|
:placeholder="searchPlaceholder"
|
||||||
|
confirm-type="search"
|
||||||
|
:adjust-position="true"
|
||||||
|
@input="onSearchInput"
|
||||||
|
/>
|
||||||
|
<u-icon
|
||||||
|
v-if="keyword"
|
||||||
|
name="close-circle-fill"
|
||||||
|
size="28"
|
||||||
|
color="#c0c4cc"
|
||||||
|
@tap.stop="clearSearch"
|
||||||
|
></u-icon>
|
||||||
|
</view>
|
||||||
|
<scroll-view scroll-y class="u-action-sheet-scroll">
|
||||||
|
<view
|
||||||
|
v-for="(item, index) in displayList"
|
||||||
|
:key="item._originIndex"
|
||||||
|
@touchmove.stop.prevent
|
||||||
|
@tap="itemClick(item._originIndex)"
|
||||||
|
:style="[itemStyle(item._originIndex)]"
|
||||||
|
class="u-action-sheet-item u-line-1"
|
||||||
|
:class="[index < displayList.length - 1 ? 'u-border-bottom' : '']"
|
||||||
|
:hover-stay-time="150"
|
||||||
|
>
|
||||||
|
<text>{{item.text}}</text>
|
||||||
|
<text class="u-action-sheet-item__subtext u-line-1" v-if="item.subText">{{item.subText}}</text>
|
||||||
|
</view>
|
||||||
|
<view v-if="!displayList.length" class="u-action-sheet-empty">无匹配选项</view>
|
||||||
|
</scroll-view>
|
||||||
|
<view class="u-gab" v-if="cancelBtn">
|
||||||
|
</view>
|
||||||
|
<view @touchmove.stop.prevent class="u-actionsheet-cancel u-action-sheet-item" hover-class="u-hover-class"
|
||||||
|
:hover-stay-time="150" v-if="cancelBtn" @tap="close">{{cancelText}}</view>
|
||||||
|
</u-popup>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
/**
|
||||||
|
* actionSheet 操作菜单(本地覆盖:选项支持搜索)
|
||||||
|
* @description 本组件用于从底部弹出一个操作菜单,供用户选择并返回结果。
|
||||||
|
* @tutorial https://www.uviewui.com/components/actionSheet.html
|
||||||
|
* @property {Array<Object>} list 按钮的文字数组,见官方文档示例
|
||||||
|
* @property {Boolean} show-search 是否显示搜索框(默认true)
|
||||||
|
* @property {String} search-placeholder 搜索框占位文字
|
||||||
|
* @event {Function} click 点击ActionSheet列表项时触发,返回原始列表下标
|
||||||
|
* @example <u-action-sheet :list="list" @click="click" v-model="show"></u-action-sheet>
|
||||||
|
*/
|
||||||
|
export default {
|
||||||
|
name: "u-action-sheet",
|
||||||
|
props: {
|
||||||
|
maskCloseAble: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
list: {
|
||||||
|
type: Array,
|
||||||
|
default () {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
tips: {
|
||||||
|
type: Object,
|
||||||
|
default () {
|
||||||
|
return {
|
||||||
|
text: '',
|
||||||
|
color: '',
|
||||||
|
fontSize: '26'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
cancelBtn: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
safeAreaInsetBottom: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
value: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
borderRadius: {
|
||||||
|
type: [String, Number],
|
||||||
|
default: 0
|
||||||
|
},
|
||||||
|
zIndex: {
|
||||||
|
type: [String, Number],
|
||||||
|
default: 0
|
||||||
|
},
|
||||||
|
cancelText: {
|
||||||
|
type: String,
|
||||||
|
default: '取消'
|
||||||
|
},
|
||||||
|
showSearch: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
searchPlaceholder: {
|
||||||
|
type: String,
|
||||||
|
default: '搜索'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
keyword: ''
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
value(val) {
|
||||||
|
if (val) this.keyword = '';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
tipsStyle() {
|
||||||
|
let style = {};
|
||||||
|
if (this.tips.color) style.color = this.tips.color;
|
||||||
|
if (this.tips.fontSize) style.fontSize = this.tips.fontSize + 'rpx';
|
||||||
|
return style;
|
||||||
|
},
|
||||||
|
itemStyle() {
|
||||||
|
return (index) => {
|
||||||
|
let style = {};
|
||||||
|
const item = this.list[index];
|
||||||
|
if (!item) return style;
|
||||||
|
if (item.color) style.color = item.color;
|
||||||
|
if (item.fontSize) style.fontSize = item.fontSize + 'rpx';
|
||||||
|
if (item.disabled) style.color = '#c0c4cc';
|
||||||
|
return style;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
uZIndex() {
|
||||||
|
return this.zIndex ? this.zIndex : this.$u.zIndex.popup;
|
||||||
|
},
|
||||||
|
displayList() {
|
||||||
|
const keyword = (this.keyword || '').trim().toLowerCase();
|
||||||
|
return (this.list || []).reduce((arr, item, index) => {
|
||||||
|
const text = String((item && item.text) || '');
|
||||||
|
const subText = String((item && item.subText) || '');
|
||||||
|
if (!keyword || text.toLowerCase().indexOf(keyword) !== -1 || subText.toLowerCase().indexOf(keyword) !== -1) {
|
||||||
|
arr.push(Object.assign({}, item, { _originIndex: index }));
|
||||||
|
}
|
||||||
|
return arr;
|
||||||
|
}, []);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onSearchInput(e) {
|
||||||
|
this.keyword = e && e.detail && e.detail.value != null ? e.detail.value : '';
|
||||||
|
},
|
||||||
|
clearSearch() {
|
||||||
|
this.keyword = '';
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.popupClose();
|
||||||
|
this.$emit('close');
|
||||||
|
},
|
||||||
|
popupClose() {
|
||||||
|
this.keyword = '';
|
||||||
|
this.$emit('input', false);
|
||||||
|
},
|
||||||
|
itemClick(index) {
|
||||||
|
if(this.list[index] && this.list[index].disabled) return;
|
||||||
|
this.$emit('click', index);
|
||||||
|
this.$emit('input', false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import "~uview-ui/libs/css/style.components.scss";
|
||||||
|
|
||||||
|
.u-tips {
|
||||||
|
font-size: 26rpx;
|
||||||
|
text-align: center;
|
||||||
|
padding: 34rpx 0;
|
||||||
|
line-height: 1;
|
||||||
|
color: $u-tips-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
.u-action-sheet-search {
|
||||||
|
@include vue-flex;
|
||||||
|
align-items: center;
|
||||||
|
margin: 16rpx 24rpx;
|
||||||
|
padding: 0 24rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
&__input {
|
||||||
|
flex: 1;
|
||||||
|
height: 80rpx;
|
||||||
|
margin-left: 12rpx;
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: #303133;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.u-action-sheet-scroll {
|
||||||
|
max-height: 600rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.u-action-sheet-empty {
|
||||||
|
text-align: center;
|
||||||
|
padding: 60rpx 0;
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: #909399;
|
||||||
|
}
|
||||||
|
|
||||||
|
.u-action-sheet-item {
|
||||||
|
@include vue-flex;
|
||||||
|
line-height: 1;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 32rpx;
|
||||||
|
padding: 34rpx 0;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.u-action-sheet-item__subtext {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: $u-tips-color;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.u-gab {
|
||||||
|
height: 12rpx;
|
||||||
|
background-color: rgb(234, 234, 236);
|
||||||
|
}
|
||||||
|
|
||||||
|
.u-actionsheet-cancel {
|
||||||
|
color: $u-main-color;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,186 @@
|
|||||||
|
<template>
|
||||||
|
<view class="u-dropdown-item" v-if="active" @touchmove.stop.prevent="() => {}" @tap.stop.prevent="() => {}">
|
||||||
|
<block v-if="!$slots.default && !$slots.$default">
|
||||||
|
<view class="u-dropdown-item__search" v-if="showSearch" @tap.stop>
|
||||||
|
<u-icon name="search" size="28" color="#909399"></u-icon>
|
||||||
|
<input
|
||||||
|
class="u-dropdown-item__search__input"
|
||||||
|
:value="keyword"
|
||||||
|
:placeholder="searchPlaceholder"
|
||||||
|
confirm-type="search"
|
||||||
|
:adjust-position="true"
|
||||||
|
@input="onSearchInput"
|
||||||
|
/>
|
||||||
|
<u-icon
|
||||||
|
v-if="keyword"
|
||||||
|
name="close-circle-fill"
|
||||||
|
size="28"
|
||||||
|
color="#c0c4cc"
|
||||||
|
@tap.stop="clearSearch"
|
||||||
|
></u-icon>
|
||||||
|
</view>
|
||||||
|
<scroll-view scroll-y="true" :style="{
|
||||||
|
height: $u.addUnit(height)
|
||||||
|
}">
|
||||||
|
<view class="u-dropdown-item__options">
|
||||||
|
<u-cell-group>
|
||||||
|
<u-cell-item @click="cellClick(item.value)" :arrow="false" :title="item.label" v-for="(item, index) in filteredOptions"
|
||||||
|
:key="index" :title-style="{
|
||||||
|
color: value == item.value ? activeColor : inactiveColor
|
||||||
|
}">
|
||||||
|
<u-icon v-if="value == item.value" name="checkbox-mark" :color="activeColor" size="32"></u-icon>
|
||||||
|
</u-cell-item>
|
||||||
|
</u-cell-group>
|
||||||
|
<view v-if="!filteredOptions.length" class="u-dropdown-item__empty">无匹配选项</view>
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
</block>
|
||||||
|
<slot v-else />
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
/**
|
||||||
|
* dropdown-item 下拉菜单(本地覆盖:选项支持搜索)
|
||||||
|
* @description 该组件一般用于向下展开菜单,同时可切换多个选项卡的场景
|
||||||
|
* @tutorial http://uviewui.com/components/dropdown.html
|
||||||
|
* @property {String | Number} v-model 双向绑定选项卡选择值
|
||||||
|
* @property {String} title 菜单项标题
|
||||||
|
* @property {Array[Object]} options 选项数据,如果传入了默认slot,此参数无效
|
||||||
|
* @property {Boolean} show-search 是否显示搜索框(默认true)
|
||||||
|
* @property {String} search-placeholder 搜索框占位文字
|
||||||
|
* @example <u-dropdown-item title="标题"></u-dropdown-item>
|
||||||
|
*/
|
||||||
|
export default {
|
||||||
|
name: 'u-dropdown-item',
|
||||||
|
props: {
|
||||||
|
value: {
|
||||||
|
type: [Number, String, Array],
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
type: [String, Number],
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
options: {
|
||||||
|
type: Array,
|
||||||
|
default () {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
disabled: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
height: {
|
||||||
|
type: [Number, String],
|
||||||
|
default: 'auto'
|
||||||
|
},
|
||||||
|
showSearch: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
searchPlaceholder: {
|
||||||
|
type: String,
|
||||||
|
default: '搜索'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
active: false,
|
||||||
|
activeColor: '#2979ff',
|
||||||
|
inactiveColor: '#606266',
|
||||||
|
keyword: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
propsChange() {
|
||||||
|
return `${this.title}-${this.disabled}`;
|
||||||
|
},
|
||||||
|
filteredOptions() {
|
||||||
|
const keyword = (this.keyword || '').trim().toLowerCase();
|
||||||
|
const list = this.options || [];
|
||||||
|
if (!keyword) return list;
|
||||||
|
return list.filter(item => {
|
||||||
|
const label = String(item && item.label != null ? item.label : '');
|
||||||
|
const value = String(item && item.value != null ? item.value : '');
|
||||||
|
return label.toLowerCase().indexOf(keyword) !== -1 || value.toLowerCase().indexOf(keyword) !== -1;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
propsChange() {
|
||||||
|
if (this.parent) this.parent.init();
|
||||||
|
},
|
||||||
|
active(val) {
|
||||||
|
if (!val) this.keyword = '';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.parent = false;
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onSearchInput(e) {
|
||||||
|
this.keyword = e && e.detail && e.detail.value != null ? e.detail.value : '';
|
||||||
|
},
|
||||||
|
clearSearch() {
|
||||||
|
this.keyword = '';
|
||||||
|
},
|
||||||
|
init() {
|
||||||
|
let parent = this.$u.$parent.call(this, 'u-dropdown');
|
||||||
|
if (parent) {
|
||||||
|
this.parent = parent;
|
||||||
|
this.activeColor = parent.activeColor;
|
||||||
|
this.inactiveColor = parent.inactiveColor;
|
||||||
|
let exist = parent.children.find(val => {
|
||||||
|
return this === val;
|
||||||
|
})
|
||||||
|
if (!exist) parent.children.push(this);
|
||||||
|
if (parent.children.length == 1) this.active = true;
|
||||||
|
parent.menuList.push({
|
||||||
|
title: this.title,
|
||||||
|
disabled: this.disabled
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
cellClick(value) {
|
||||||
|
this.$emit('input', value);
|
||||||
|
this.parent.close();
|
||||||
|
this.$emit('change', value);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.init();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
@import "~uview-ui/libs/css/style.components.scss";
|
||||||
|
|
||||||
|
.u-dropdown-item__search {
|
||||||
|
@include vue-flex;
|
||||||
|
align-items: center;
|
||||||
|
margin: 16rpx 24rpx 0;
|
||||||
|
padding: 0 24rpx;
|
||||||
|
height: 72rpx;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
&__input {
|
||||||
|
flex: 1;
|
||||||
|
height: 72rpx;
|
||||||
|
margin-left: 12rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #303133;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.u-dropdown-item__empty {
|
||||||
|
text-align: center;
|
||||||
|
padding: 40rpx 0;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #909399;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,589 @@
|
|||||||
|
<template>
|
||||||
|
<view class="u-select">
|
||||||
|
<u-popup :maskCloseAble="maskCloseAble" mode="bottom" :popup="false" v-model="value" length="auto" :safeAreaInsetBottom="safeAreaInsetBottom" @close="close" :z-index="uZIndex">
|
||||||
|
<view class="u-select">
|
||||||
|
<view class="u-select__header" @touchmove.stop.prevent="">
|
||||||
|
<view
|
||||||
|
class="u-select__header__cancel u-select__header__btn"
|
||||||
|
:style="{ color: cancelColor }"
|
||||||
|
hover-class="u-hover-class"
|
||||||
|
:hover-stay-time="150"
|
||||||
|
@tap="getResult('cancel')"
|
||||||
|
>
|
||||||
|
{{cancelText}}
|
||||||
|
</view>
|
||||||
|
<view class="u-select__header__title">
|
||||||
|
{{title}}
|
||||||
|
</view>
|
||||||
|
<view
|
||||||
|
class="u-select__header__confirm u-select__header__btn"
|
||||||
|
:style="{ color: moving ? cancelColor : confirmColor }"
|
||||||
|
hover-class="u-hover-class"
|
||||||
|
:hover-stay-time="150"
|
||||||
|
@touchmove.stop=""
|
||||||
|
@tap.stop="getResult('confirm')"
|
||||||
|
>
|
||||||
|
{{confirmText}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="u-select__search" v-if="showSearch" @tap.stop>
|
||||||
|
<u-icon name="search" size="32" color="#909399"></u-icon>
|
||||||
|
<input
|
||||||
|
class="u-select__search__input"
|
||||||
|
:value="keyword"
|
||||||
|
:placeholder="searchPlaceholder"
|
||||||
|
confirm-type="search"
|
||||||
|
:adjust-position="true"
|
||||||
|
@input="onSearchInput"
|
||||||
|
@confirm="onSearchConfirm"
|
||||||
|
/>
|
||||||
|
<u-icon
|
||||||
|
v-if="keyword"
|
||||||
|
name="close-circle-fill"
|
||||||
|
size="28"
|
||||||
|
color="#c0c4cc"
|
||||||
|
@tap.stop="clearSearch"
|
||||||
|
></u-icon>
|
||||||
|
</view>
|
||||||
|
<view v-if="loading" class="u-select__loading">搜索中...</view>
|
||||||
|
<view class="u-select__body" :style="hasCustomItemHeight ? bodyStyle : null">
|
||||||
|
<view v-if="isColumnEmpty && !loading" class="u-select__empty">无匹配选项</view>
|
||||||
|
<picker-view
|
||||||
|
v-else-if="value && !isColumnEmpty"
|
||||||
|
:key="pickerKey"
|
||||||
|
@change="columnChange"
|
||||||
|
class="u-select__body__picker-view"
|
||||||
|
:style="pickerViewStyle"
|
||||||
|
:indicator-style="indicatorStyle"
|
||||||
|
:value="defaultSelector"
|
||||||
|
@pickstart="pickstart"
|
||||||
|
@pickend="pickend"
|
||||||
|
>
|
||||||
|
<picker-view-column v-for="(item, index) in columnData" :key="'col-' + pickerKey + '-' + index">
|
||||||
|
<view
|
||||||
|
class="u-select__body__picker-view__item"
|
||||||
|
:style="hasCustomItemHeight ? itemStyle : null"
|
||||||
|
v-for="(item1, index1) in item"
|
||||||
|
:key="item1[valueName] != null ? item1[valueName] : index1"
|
||||||
|
>
|
||||||
|
<view class="u-line-1" :style="hasCustomItemHeight ? itemStyle : null">{{ item1[labelName] }}</view>
|
||||||
|
</view>
|
||||||
|
</picker-view-column>
|
||||||
|
</picker-view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</u-popup>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
/**
|
||||||
|
* select 列选择器(本地覆盖:选项支持搜索)
|
||||||
|
* @description 此选择器用于单列,多列,多列联动的选择场景。
|
||||||
|
* @tutorial http://uviewui.com/components/select.html
|
||||||
|
* @property {String} mode 模式选择,"single-column"-单列模式,"mutil-column"-多列模式,"mutil-column-auto"-多列联动模式
|
||||||
|
* @property {Array} list 列数据,数组形式,见官网说明
|
||||||
|
* @property {Boolean} v-model 布尔值变量,用于控制选择器的弹出与收起
|
||||||
|
* @property {Boolean} show-search 是否显示搜索框(默认true)
|
||||||
|
* @property {String} search-placeholder 搜索框占位文字
|
||||||
|
* @event {Function} confirm 点击确定按钮,返回当前选择的值
|
||||||
|
* @example <u-select v-model="show" :list="list"></u-select>
|
||||||
|
*/
|
||||||
|
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
list: {
|
||||||
|
type: Array,
|
||||||
|
default() {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
border: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
value: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
cancelColor: {
|
||||||
|
type: String,
|
||||||
|
default: '#606266'
|
||||||
|
},
|
||||||
|
confirmColor: {
|
||||||
|
type: String,
|
||||||
|
default: '#2979ff'
|
||||||
|
},
|
||||||
|
zIndex: {
|
||||||
|
type: [String, Number],
|
||||||
|
default: 0
|
||||||
|
},
|
||||||
|
safeAreaInsetBottom: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
maskCloseAble: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
defaultValue: {
|
||||||
|
type: Array,
|
||||||
|
default() {
|
||||||
|
return [0];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mode: {
|
||||||
|
type: String,
|
||||||
|
default: 'single-column'
|
||||||
|
},
|
||||||
|
valueName: {
|
||||||
|
type: String,
|
||||||
|
default: 'value'
|
||||||
|
},
|
||||||
|
labelName: {
|
||||||
|
type: String,
|
||||||
|
default: 'label'
|
||||||
|
},
|
||||||
|
childName: {
|
||||||
|
type: String,
|
||||||
|
default: 'children'
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
cancelText: {
|
||||||
|
type: String,
|
||||||
|
default: '取消'
|
||||||
|
},
|
||||||
|
confirmText: {
|
||||||
|
type: String,
|
||||||
|
default: '确认'
|
||||||
|
},
|
||||||
|
showSearch: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
searchPlaceholder: {
|
||||||
|
type: String,
|
||||||
|
default: '搜索'
|
||||||
|
},
|
||||||
|
remote: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
loading: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
debounce: {
|
||||||
|
type: Number,
|
||||||
|
default: 400
|
||||||
|
},
|
||||||
|
/** 选项行高(rpx)。App 端需与 indicator 同步,避免选中框错位 */
|
||||||
|
itemHeight: {
|
||||||
|
type: [Number, String],
|
||||||
|
default: 0
|
||||||
|
},
|
||||||
|
/** 可见行数,用于计算滚轮高度;需为奇数,选中行才能居中 */
|
||||||
|
visibleItemCount: {
|
||||||
|
type: [Number, String],
|
||||||
|
default: 5
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
defaultSelector: [0],
|
||||||
|
columnData: [],
|
||||||
|
selectValue: [],
|
||||||
|
lastSelectIndex: [],
|
||||||
|
columnNum: 0,
|
||||||
|
moving: false,
|
||||||
|
keyword: '',
|
||||||
|
pickerKey: 0,
|
||||||
|
// 勿用 _ 前缀:Vue2 不会把 data 代理到 this
|
||||||
|
searchTimer: null,
|
||||||
|
lastSearchEmit: '',
|
||||||
|
lastSearchAt: 0
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
value: {
|
||||||
|
immediate: true,
|
||||||
|
handler(val) {
|
||||||
|
if (val) {
|
||||||
|
this.keyword = '';
|
||||||
|
this.applyPickerData();
|
||||||
|
if (this.remote) this.emitRemoteSearch('');
|
||||||
|
} else {
|
||||||
|
this.clearSearchTimer();
|
||||||
|
this.lastSearchEmit = '';
|
||||||
|
this.lastSearchAt = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
list: {
|
||||||
|
handler() {
|
||||||
|
if (!this.value) return;
|
||||||
|
this.applyPickerData();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
loading(val) {
|
||||||
|
// loading 从 true→false 时再刷一次滚轮,避免原生 picker-view 漏更
|
||||||
|
if (!val && this.value && this.remote) this.applyPickerData();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
this.clearSearchTimer();
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
uZIndex() {
|
||||||
|
return this.zIndex ? this.zIndex : this.$u.zIndex.popup;
|
||||||
|
},
|
||||||
|
isColumnEmpty() {
|
||||||
|
return !this.columnData || !this.columnData.length || !this.columnData[0] || !this.columnData[0].length;
|
||||||
|
},
|
||||||
|
hasCustomItemHeight() {
|
||||||
|
return Number(this.itemHeight) > 0;
|
||||||
|
},
|
||||||
|
itemHeightRpx() {
|
||||||
|
return Number(this.itemHeight) || 70;
|
||||||
|
},
|
||||||
|
itemHeightPx() {
|
||||||
|
return uni.upx2px(this.itemHeightRpx);
|
||||||
|
},
|
||||||
|
visibleCount() {
|
||||||
|
const n = Number(this.visibleItemCount) || 5;
|
||||||
|
return n % 2 === 0 ? n + 1 : n;
|
||||||
|
},
|
||||||
|
indicatorStyle() {
|
||||||
|
if (!this.hasCustomItemHeight) return '';
|
||||||
|
return `height: ${this.itemHeightPx}px;`;
|
||||||
|
},
|
||||||
|
itemStyle() {
|
||||||
|
return {
|
||||||
|
height: `${this.itemHeightPx}px`,
|
||||||
|
lineHeight: `${this.itemHeightPx}px`,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
pickerViewStyle() {
|
||||||
|
if (!this.hasCustomItemHeight) return null;
|
||||||
|
return { height: `${this.itemHeightPx * this.visibleCount}px` };
|
||||||
|
},
|
||||||
|
bodyStyle() {
|
||||||
|
return this.pickerViewStyle;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
pickstart() {
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
this.moving = true;
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
pickend() {
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
this.moving = false;
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
readInputValue(e) {
|
||||||
|
if (typeof e === 'string' || typeof e === 'number') return String(e);
|
||||||
|
if (e && e.detail && e.detail.value != null) return String(e.detail.value);
|
||||||
|
if (e && e.target && e.target.value != null) return String(e.target.value);
|
||||||
|
return '';
|
||||||
|
},
|
||||||
|
clearSearchTimer() {
|
||||||
|
if (this.searchTimer) {
|
||||||
|
clearTimeout(this.searchTimer);
|
||||||
|
this.searchTimer = null;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
emitRemoteSearch(keyword) {
|
||||||
|
this.clearSearchTimer();
|
||||||
|
const key = keyword == null ? '' : String(keyword).trim();
|
||||||
|
const now = Date.now();
|
||||||
|
if (key === this.lastSearchEmit && now - this.lastSearchAt < 80) return;
|
||||||
|
this.lastSearchEmit = key;
|
||||||
|
this.lastSearchAt = now;
|
||||||
|
this.$emit('search', key);
|
||||||
|
},
|
||||||
|
scheduleRemoteSearch() {
|
||||||
|
this.clearSearchTimer();
|
||||||
|
this.searchTimer = setTimeout(() => {
|
||||||
|
this.emitRemoteSearch(this.keyword);
|
||||||
|
}, this.debounce);
|
||||||
|
},
|
||||||
|
onSearchInput(e) {
|
||||||
|
this.keyword = this.readInputValue(e);
|
||||||
|
if (this.remote) this.scheduleRemoteSearch();
|
||||||
|
else this.applyFilter();
|
||||||
|
},
|
||||||
|
onSearchConfirm(e) {
|
||||||
|
this.keyword = this.readInputValue(e);
|
||||||
|
if (this.remote) this.emitRemoteSearch(this.keyword);
|
||||||
|
else this.applyFilter();
|
||||||
|
},
|
||||||
|
clearSearch() {
|
||||||
|
this.keyword = '';
|
||||||
|
if (this.remote) this.emitRemoteSearch('');
|
||||||
|
else this.applyFilter();
|
||||||
|
},
|
||||||
|
matchKeyword(text) {
|
||||||
|
const keyword = (this.keyword || '').trim().toLowerCase();
|
||||||
|
if (!keyword) return true;
|
||||||
|
return String(text == null ? '' : text).toLowerCase().indexOf(keyword) !== -1;
|
||||||
|
},
|
||||||
|
filterItems(list) {
|
||||||
|
if (!Array.isArray(list)) return [];
|
||||||
|
if (this.remote) return list.slice();
|
||||||
|
const keyword = (this.keyword || '').trim();
|
||||||
|
if (!keyword) return list.slice();
|
||||||
|
return list.filter(item => {
|
||||||
|
return this.matchKeyword(item && item[this.labelName]) || this.matchKeyword(item && item[this.valueName]);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
applyPickerData() {
|
||||||
|
this.init();
|
||||||
|
this.pickerKey += 1;
|
||||||
|
},
|
||||||
|
applyFilter() {
|
||||||
|
this.applyPickerData();
|
||||||
|
},
|
||||||
|
init() {
|
||||||
|
this.setColumnNum();
|
||||||
|
this.setDefaultSelector();
|
||||||
|
this.setColumnData();
|
||||||
|
this.setSelectValue();
|
||||||
|
},
|
||||||
|
setDefaultSelector() {
|
||||||
|
const columnNum = this.columnNum || 1;
|
||||||
|
const defaultValue = Array.isArray(this.defaultValue) ? this.defaultValue.slice() : [];
|
||||||
|
this.defaultSelector = defaultValue.length === columnNum
|
||||||
|
? defaultValue
|
||||||
|
: Array(columnNum).fill(0);
|
||||||
|
this.lastSelectIndex = this.defaultSelector.slice();
|
||||||
|
},
|
||||||
|
setColumnNum() {
|
||||||
|
if(this.mode == 'single-column') this.columnNum = 1;
|
||||||
|
else if(this.mode == 'mutil-column') this.columnNum = this.list.length;
|
||||||
|
else if(this.mode == 'mutil-column-auto') {
|
||||||
|
let num = 1;
|
||||||
|
let column = this.list;
|
||||||
|
while(column[0] && column[0][this.childName]) {
|
||||||
|
column = column[0] ? column[0][this.childName] : {};
|
||||||
|
num ++;
|
||||||
|
}
|
||||||
|
this.columnNum = num;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
setColumnData() {
|
||||||
|
let data = [];
|
||||||
|
this.selectValue = [];
|
||||||
|
if(this.mode == 'mutil-column-auto') {
|
||||||
|
const sourceList = this.filterItems(this.list);
|
||||||
|
if (!sourceList.length) {
|
||||||
|
this.columnData = [[]];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let selector = this.defaultSelector.length ? this.defaultSelector[0] : 0;
|
||||||
|
if (selector >= sourceList.length) selector = 0;
|
||||||
|
let column = sourceList[selector];
|
||||||
|
for (let i = 0; i < this.columnNum; i++) {
|
||||||
|
if (i == 0) {
|
||||||
|
data[i] = sourceList;
|
||||||
|
column = column ? column[this.childName] : [];
|
||||||
|
} else {
|
||||||
|
data[i] = column || [];
|
||||||
|
const nextIndex = this.defaultSelector[i] || 0;
|
||||||
|
column = (column && column[nextIndex]) ? column[nextIndex][this.childName] : [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if(this.mode == 'single-column') {
|
||||||
|
data[0] = this.filterItems(this.list);
|
||||||
|
} else {
|
||||||
|
data = (this.list || []).map(col => this.filterItems(Array.isArray(col) ? col : []));
|
||||||
|
}
|
||||||
|
this.columnData = data.slice();
|
||||||
|
},
|
||||||
|
setSelectValue() {
|
||||||
|
let tmp = null;
|
||||||
|
for(let i = 0; i < this.columnNum; i++) {
|
||||||
|
const col = this.columnData[i] || [];
|
||||||
|
tmp = col[this.defaultSelector[i]];
|
||||||
|
let data = {
|
||||||
|
value: tmp ? tmp[this.valueName] : null,
|
||||||
|
label: tmp ? tmp[this.labelName] : null
|
||||||
|
};
|
||||||
|
if(tmp && tmp.extra !== undefined) data.extra = tmp.extra;
|
||||||
|
this.selectValue.push(data)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
columnChange(e) {
|
||||||
|
let index = null;
|
||||||
|
let columnIndex = e.detail.value;
|
||||||
|
this.selectValue = [];
|
||||||
|
this.defaultSelector = columnIndex;
|
||||||
|
if(this.mode == 'mutil-column-auto') {
|
||||||
|
this.lastSelectIndex.map((val, idx) => {
|
||||||
|
if (val != columnIndex[idx]) index = idx;
|
||||||
|
});
|
||||||
|
|
||||||
|
for (let i = index + 1; i < this.columnNum; i++) {
|
||||||
|
this.columnData[i] = this.columnData[i - 1][i - 1 == index ? columnIndex[index] : 0][this.childName];
|
||||||
|
this.defaultSelector[i] = 0;
|
||||||
|
}
|
||||||
|
columnIndex.map((item, idx) => {
|
||||||
|
let data = this.columnData[idx][columnIndex[idx]];
|
||||||
|
let tmp = {
|
||||||
|
value: data ? data[this.valueName] : null,
|
||||||
|
label: data ? data[this.labelName] : null,
|
||||||
|
};
|
||||||
|
if(data && data.extra !== undefined) tmp.extra = data.extra;
|
||||||
|
this.selectValue.push(tmp);
|
||||||
|
|
||||||
|
})
|
||||||
|
this.lastSelectIndex = columnIndex;
|
||||||
|
} else if(this.mode == 'single-column') {
|
||||||
|
let data = this.columnData[0][columnIndex[0]];
|
||||||
|
let tmp = {
|
||||||
|
value: data ? data[this.valueName] : null,
|
||||||
|
label: data ? data[this.labelName] : null,
|
||||||
|
};
|
||||||
|
if(data && data.extra !== undefined) tmp.extra = data.extra;
|
||||||
|
this.selectValue.push(tmp);
|
||||||
|
} else if(this.mode == 'mutil-column') {
|
||||||
|
columnIndex.map((item, idx) => {
|
||||||
|
let data = this.columnData[idx][columnIndex[idx]];
|
||||||
|
let tmp = {
|
||||||
|
value: data ? data[this.valueName] : null,
|
||||||
|
label: data ? data[this.labelName] : null,
|
||||||
|
};
|
||||||
|
if(data && data.extra !== undefined) tmp.extra = data.extra;
|
||||||
|
this.selectValue.push(tmp);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.$emit('input', false);
|
||||||
|
this.$set(this, 'defaultSelector', [0]);
|
||||||
|
this.keyword = '';
|
||||||
|
this.lastSearchEmit = '';
|
||||||
|
this.lastSearchAt = 0;
|
||||||
|
},
|
||||||
|
getResult(event = null) {
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
if (this.moving) return;
|
||||||
|
// #endif
|
||||||
|
if (event === 'confirm' && this.isColumnEmpty) {
|
||||||
|
this.$u.toast && this.$u.toast('无匹配选项');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (event) this.$emit(event, this.selectValue);
|
||||||
|
this.close();
|
||||||
|
},
|
||||||
|
selectHandler() {
|
||||||
|
this.$emit('click');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
@import "~uview-ui/libs/css/style.components.scss";
|
||||||
|
|
||||||
|
.u-select {
|
||||||
|
|
||||||
|
&__action {
|
||||||
|
position: relative;
|
||||||
|
line-height: $u-form-item-height;
|
||||||
|
height: $u-form-item-height;
|
||||||
|
|
||||||
|
&__icon {
|
||||||
|
position: absolute;
|
||||||
|
right: 20rpx;
|
||||||
|
top: 50%;
|
||||||
|
transition: transform .4s;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
z-index: 1;
|
||||||
|
|
||||||
|
&--reverse {
|
||||||
|
transform: rotate(-180deg) translateY(50%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__hader {
|
||||||
|
&__title {
|
||||||
|
color: $u-content-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&--border {
|
||||||
|
border-radius: 6rpx;
|
||||||
|
border-radius: 4px;
|
||||||
|
border: 1px solid $u-form-item-border-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__header {
|
||||||
|
@include vue-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
height: 80rpx;
|
||||||
|
padding: 0 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__search {
|
||||||
|
@include vue-flex;
|
||||||
|
align-items: center;
|
||||||
|
margin: 0 24rpx 16rpx;
|
||||||
|
padding: 0 24rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
&__input {
|
||||||
|
flex: 1;
|
||||||
|
height: 80rpx;
|
||||||
|
margin-left: 12rpx;
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: #303133;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__loading {
|
||||||
|
padding: 0 24rpx 8rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #909399;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__empty {
|
||||||
|
@include vue-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: 100%;
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: #909399;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__body {
|
||||||
|
width: 100%;
|
||||||
|
height: 500rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
background-color: #fff;
|
||||||
|
|
||||||
|
&__picker-view {
|
||||||
|
height: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
&__item {
|
||||||
|
@include vue-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: $u-main-color;
|
||||||
|
padding: 0 8rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</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';
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
"name" : "浩拓ERP",
|
"name" : "浩拓ERP",
|
||||||
"appid" : "__UNI__F79F300",
|
"appid" : "__UNI__F79F300",
|
||||||
"description" : "浩拓ERP",
|
"description" : "浩拓ERP",
|
||||||
"versionName" : "1.1.5",
|
"versionName" : "1.1.21",
|
||||||
"versionCode" : 105,
|
"versionCode" : 121,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
"optimization" : {
|
"optimization" : {
|
||||||
|
|||||||
@@ -0,0 +1,119 @@
|
|||||||
|
import {
|
||||||
|
hasFilterValue,
|
||||||
|
normalizeAuditStatus,
|
||||||
|
isActiveFilterState,
|
||||||
|
normalizeFilterState,
|
||||||
|
withSelectedOption,
|
||||||
|
} from '@/common/listFilter';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
appliedFilters: null,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
hasActiveFilter() {
|
||||||
|
return isActiveFilterState(this.appliedFilters || this.filters);
|
||||||
|
},
|
||||||
|
filterIconColor() {
|
||||||
|
return this.hasActiveFilter ? '#2979ff' : '#666666';
|
||||||
|
},
|
||||||
|
statusSelectDefault() {
|
||||||
|
const list = this.statusSelectList || [];
|
||||||
|
const index = list.findIndex(
|
||||||
|
(item) => String(item.value) === String(this.filters && this.filters.audit_status)
|
||||||
|
);
|
||||||
|
return [index >= 0 ? index : 0];
|
||||||
|
},
|
||||||
|
unitSelectDefault() {
|
||||||
|
const selectedValue = this.getUnitSelectValue();
|
||||||
|
const index = (this.unitSelectList || []).findIndex(
|
||||||
|
(item) => String(item.value) === String(selectedValue)
|
||||||
|
);
|
||||||
|
return [index >= 0 ? index : 0];
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
hasFilterValue,
|
||||||
|
getDefaultFilters() {
|
||||||
|
return typeof this.createDefaultFilters === 'function'
|
||||||
|
? this.createDefaultFilters()
|
||||||
|
: {};
|
||||||
|
},
|
||||||
|
getUnitSelectValue() {
|
||||||
|
const type = this.unitSelectType;
|
||||||
|
const filters = this.filters || {};
|
||||||
|
if (type === 'warehouse') return filters.warehouse_id;
|
||||||
|
if (type === 'delivery') return filters.delivery_unit_id;
|
||||||
|
if (type === 'business') return filters.business_unit_id;
|
||||||
|
if (type === 'supplier') return filters.supplier_id;
|
||||||
|
if (type === 'process') return filters.process_unit_id;
|
||||||
|
return filters.process_unit_id || filters.supplier_id || filters.business_unit_id || '';
|
||||||
|
},
|
||||||
|
getUnitSelectLabel() {
|
||||||
|
const type = this.unitSelectType;
|
||||||
|
const filters = this.filters || {};
|
||||||
|
if (type === 'warehouse') return filters.warehouse_name;
|
||||||
|
if (type === 'delivery') return filters.delivery_unit_name;
|
||||||
|
if (type === 'business') return filters.business_unit_name;
|
||||||
|
if (type === 'supplier') return filters.supplier_name;
|
||||||
|
if (type === 'process') return filters.process_name;
|
||||||
|
return filters.process_name || filters.supplier_name || filters.business_unit_name || '';
|
||||||
|
},
|
||||||
|
restoreFilterCache() {
|
||||||
|
const defaults = this.getDefaultFilters();
|
||||||
|
try {
|
||||||
|
const cached = this.filterStorageKey ? uni.getStorageSync(this.filterStorageKey) : null;
|
||||||
|
if (!cached || typeof cached !== 'object' || Array.isArray(cached)) {
|
||||||
|
this.filters = { ...defaults };
|
||||||
|
this.appliedFilters = { ...defaults };
|
||||||
|
this.saveFilterCache();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const filters = normalizeFilterState(cached, defaults);
|
||||||
|
this.filters = { ...filters };
|
||||||
|
this.appliedFilters = { ...filters };
|
||||||
|
} catch (e) {
|
||||||
|
this.filters = { ...defaults };
|
||||||
|
this.appliedFilters = { ...defaults };
|
||||||
|
}
|
||||||
|
},
|
||||||
|
saveFilterCache() {
|
||||||
|
if (!this.filterStorageKey) return;
|
||||||
|
try {
|
||||||
|
uni.setStorageSync(this.filterStorageKey, { ...this.appliedFilters });
|
||||||
|
} catch (e) {
|
||||||
|
// 缓存失败不影响列表筛选
|
||||||
|
}
|
||||||
|
},
|
||||||
|
commitFilters() {
|
||||||
|
const filters = normalizeFilterState(this.filters, this.getDefaultFilters());
|
||||||
|
this.filters = { ...filters };
|
||||||
|
this.appliedFilters = { ...filters };
|
||||||
|
this.saveFilterCache();
|
||||||
|
this.loadList();
|
||||||
|
},
|
||||||
|
applySearch() {
|
||||||
|
this.commitFilters();
|
||||||
|
},
|
||||||
|
cancelFilterEdit() {
|
||||||
|
this.filters = { ...(this.appliedFilters || this.getDefaultFilters()) };
|
||||||
|
},
|
||||||
|
applyFilter() {
|
||||||
|
this.commitFilters();
|
||||||
|
this.filterShow = false;
|
||||||
|
},
|
||||||
|
resetFilter() {
|
||||||
|
this.filters = this.getDefaultFilters();
|
||||||
|
},
|
||||||
|
onStatusConfirm(e) {
|
||||||
|
this.filters.audit_status = normalizeAuditStatus((e[0] || {}).value);
|
||||||
|
},
|
||||||
|
applyUnitSelectList(list, preserveSelected = true) {
|
||||||
|
const selectedValue = preserveSelected ? this.getUnitSelectValue() : '';
|
||||||
|
const selectedLabel = preserveSelected ? this.getUnitSelectLabel() : '';
|
||||||
|
this.unitSelectList = withSelectedOption(list, selectedValue, selectedLabel);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
+3
-12
@@ -1,5 +1,8 @@
|
|||||||
{
|
{
|
||||||
"easycom": {
|
"easycom": {
|
||||||
|
"^u-select$": "@/components/u-select/u-select.vue",
|
||||||
|
"^u-action-sheet$": "@/components/u-action-sheet/u-action-sheet.vue",
|
||||||
|
"^u-dropdown-item$": "@/components/u-dropdown-item/u-dropdown-item.vue",
|
||||||
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
|
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
|
||||||
},
|
},
|
||||||
"pages": [
|
"pages": [
|
||||||
@@ -912,12 +915,6 @@
|
|||||||
"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",
|
// "pagePath": "pages/sys/home/index",
|
||||||
// "iconPath": "static/aidex/tabbar/home_1.png",
|
// "iconPath": "static/aidex/tabbar/home_1.png",
|
||||||
@@ -930,12 +927,6 @@
|
|||||||
"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",
|
||||||
|
|||||||
@@ -58,10 +58,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.u-cell_title {
|
.u-cell_title {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
min-width: 655rpx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.u-border-bottom:last-child:after {
|
.u-border-bottom:last-child:after {
|
||||||
|
|||||||
@@ -15,10 +15,22 @@
|
|||||||
<u-form-item>
|
<u-form-item>
|
||||||
<text class="title" style="width: 200px">备注内容:{{ BillRemark }}</text>
|
<text class="title" style="width: 200px">备注内容:{{ BillRemark }}</text>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
<PlusBarcodePanel
|
||||||
|
v-if="usePhoneScanFallback"
|
||||||
|
:visible.sync="phoneScanPanelOpen"
|
||||||
|
hint-text="连续扫码配布,扫完可继续下一条"
|
||||||
|
:scan-time-space="1200"
|
||||||
|
@success="onPlusBarcodeSuccess"
|
||||||
|
/>
|
||||||
<u-form-item label-width="130" label="条码资料:">
|
<u-form-item label-width="130" label="条码资料:">
|
||||||
<input type="text" v-model="QRBarCode" maxlength="-1" style="width: 170px" @confirm="SalePickBillDetailScan" />
|
<input type="text" v-model="QRBarCode" maxlength="-1" style="width: 170px" @confirm="SalePickBillDetailScan" />
|
||||||
|
<text
|
||||||
|
v-if="usePhoneScanFallback && phoneScanPanelOpen"
|
||||||
|
class="phone-scan-close"
|
||||||
|
@click.stop="handlePhoneScan"
|
||||||
|
>关闭扫码</text>
|
||||||
<u-icon
|
<u-icon
|
||||||
v-if="usePhoneScanFallback"
|
v-else-if="usePhoneScanFallback"
|
||||||
name="scan"
|
name="scan"
|
||||||
size="44"
|
size="44"
|
||||||
color="#2979ff"
|
color="#2979ff"
|
||||||
@@ -83,8 +95,10 @@ import util, {
|
|||||||
} from "../../common/util";
|
} from "../../common/util";
|
||||||
import wybTable from "@/components/wyb-table/wyb-table.vue";
|
import wybTable from "@/components/wyb-table/wyb-table.vue";
|
||||||
import scanMixin from "@/common/scanMixin.js";
|
import scanMixin from "@/common/scanMixin.js";
|
||||||
|
import PlusBarcodePanel from "@/components/common/PlusBarcodePanel.vue";
|
||||||
let that = "";
|
let that = "";
|
||||||
export default {
|
export default {
|
||||||
|
components: { PlusBarcodePanel },
|
||||||
mixins: [scanMixin],
|
mixins: [scanMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -215,14 +229,17 @@ export default {
|
|||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
handlePhoneScan() {
|
handlePhoneScan() {
|
||||||
this.openPhoneScan();
|
this.togglePhoneScanPanel();
|
||||||
|
},
|
||||||
|
onPlusBarcodeSuccess(scanResult) {
|
||||||
|
this.handleScanResult(scanResult, this._scanCallback);
|
||||||
},
|
},
|
||||||
|
|
||||||
playSuccess() {
|
playSuccess(text) {
|
||||||
util.playSuccessAudio();
|
util.playSuccessAudio(text);
|
||||||
},
|
},
|
||||||
playError() {
|
playError(text) {
|
||||||
util.playErrorAudio();
|
util.playErrorAudio(text);
|
||||||
},
|
},
|
||||||
|
|
||||||
handleAllCrockNoChange() {
|
handleAllCrockNoChange() {
|
||||||
@@ -289,7 +306,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 添加通用错误提示方法
|
// 添加通用错误提示方法
|
||||||
showError(message) {
|
showError(message) {
|
||||||
this.playError();
|
this.playError(message);
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
content: message,
|
content: message,
|
||||||
@@ -298,7 +315,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 添加成功提示方法
|
// 添加成功提示方法
|
||||||
showSuccess(message) {
|
showSuccess(message) {
|
||||||
this.playSuccess();
|
this.playSuccess(message);
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: message,
|
title: message,
|
||||||
icon: 'success'
|
icon: 'success'
|
||||||
@@ -364,7 +381,6 @@ export default {
|
|||||||
|
|
||||||
if (res.data.code == 0 && res.data.msg == "success") {
|
if (res.data.code == 0 && res.data.msg == "success") {
|
||||||
var aResultData = res.data.data;
|
var aResultData = res.data.data;
|
||||||
this.playSuccess();
|
|
||||||
this.FabricGoodsNo = aResultData.product_code;
|
this.FabricGoodsNo = aResultData.product_code;
|
||||||
this.FabricGoodsName = aResultData.product_name;
|
this.FabricGoodsName = aResultData.product_name;
|
||||||
this.GoodsCodeNo = aResultData.product_color_code;
|
this.GoodsCodeNo = aResultData.product_color_code;
|
||||||
@@ -401,7 +417,7 @@ export default {
|
|||||||
// 提交按钮方法
|
// 提交按钮方法
|
||||||
submitBtnFun: function () {
|
submitBtnFun: function () {
|
||||||
if (this.BillMasterID == 0) {
|
if (this.BillMasterID == 0) {
|
||||||
this.playError();
|
this.playError("单号为空,不能提交");
|
||||||
this.BillDataMessage = "单号为空,不能提交";
|
this.BillDataMessage = "单号为空,不能提交";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -438,15 +454,15 @@ export default {
|
|||||||
console.log('outFpmArrangeOrder res', res)
|
console.log('outFpmArrangeOrder res', res)
|
||||||
if (res) {
|
if (res) {
|
||||||
this.BillDataMessage = "成功生成出仓单!";
|
this.BillDataMessage = "成功生成出仓单!";
|
||||||
this.playSuccess();
|
this.playSuccess("提交成功");
|
||||||
} else {
|
} else {
|
||||||
this.playError();
|
this.playError("提交生成出仓单出错");
|
||||||
this.BillDataMessage = "提交生成出仓单出错!" + res.msg;
|
this.BillDataMessage = "提交生成出仓单出错!" + res.msg;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
this.submitLoading = false
|
this.submitLoading = false
|
||||||
this.playError();
|
this.playError("连接服务器出错");
|
||||||
this.BillDataMessage = "连接服务器出错,请检查后台服务是否启动!";
|
this.BillDataMessage = "连接服务器出错,请检查后台服务是否启动!";
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -455,6 +471,18 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
.phone-scan-close {
|
||||||
|
margin-left: 8px;
|
||||||
|
padding: 0 12px;
|
||||||
|
height: 36px;
|
||||||
|
line-height: 36px;
|
||||||
|
border: 1px solid #2979ff;
|
||||||
|
border-radius: 4px;
|
||||||
|
color: #2979ff;
|
||||||
|
background: #eaf2ff;
|
||||||
|
font-size: 34rpx;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
page {
|
page {
|
||||||
background-color: #f8f8f8;
|
background-color: #f8f8f8;
|
||||||
padding-bottom: 260rpx;
|
padding-bottom: 260rpx;
|
||||||
|
|||||||
@@ -2,18 +2,12 @@
|
|||||||
|
|
||||||
<view class="fabric-out-page">
|
<view class="fabric-out-page">
|
||||||
|
|
||||||
|
<OrderHeaderFold v-model="headerCollapsed" :summary="form.order_no || '保存后自动生成'">
|
||||||
|
|
||||||
<OrderStatusBar class="fabric-out-mt32" :status="displayAuditStatus" :name="displayAuditStatusName" />
|
<OrderStatusBar class="fabric-out-mt32" :status="displayAuditStatus" :name="displayAuditStatusName" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<view class="flex-white-plr26 ptb10 bdb_f5">
|
|
||||||
|
|
||||||
<text class="mr26">出仓单号</text>
|
|
||||||
|
|
||||||
<u-input disabled placeholder="保存后自动生成" v-model="form.order_no" />
|
|
||||||
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="flex-white-plr26 ptb20 bdb_f5">
|
<view class="flex-white-plr26 ptb20 bdb_f5">
|
||||||
|
|
||||||
<text class="mr26">出仓类型</text>
|
<text class="mr26">出仓类型</text>
|
||||||
@@ -60,6 +54,8 @@
|
|||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
</OrderHeaderFold>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<FabricOutDetailList
|
<FabricOutDetailList
|
||||||
@@ -72,6 +68,13 @@
|
|||||||
|
|
||||||
>
|
>
|
||||||
|
|
||||||
|
<PlusBarcodePanel
|
||||||
|
slot="before-list"
|
||||||
|
:visible.sync="phoneScanPanelOpen"
|
||||||
|
hint-text="连续扫码出仓,扫完可继续下一条"
|
||||||
|
:scan-time-space="1200"
|
||||||
|
@success="onPlusBarcodeSuccess"
|
||||||
|
/>
|
||||||
<FabricOutScanBar
|
<FabricOutScanBar
|
||||||
slot="before-list"
|
slot="before-list"
|
||||||
:can-scan="canScan"
|
:can-scan="canScan"
|
||||||
@@ -80,6 +83,7 @@
|
|||||||
:message="BillDataMessage"
|
:message="BillDataMessage"
|
||||||
disabled-tip="请先提交保存后再扫码"
|
disabled-tip="请先提交保存后再扫码"
|
||||||
:show-phone-scan="usePhoneScanFallback"
|
:show-phone-scan="usePhoneScanFallback"
|
||||||
|
:scanning="phoneScanPanelOpen"
|
||||||
@input="QRBarCode = $event"
|
@input="QRBarCode = $event"
|
||||||
@scan="handleScan"
|
@scan="handleScan"
|
||||||
@phone-scan="handlePhoneScan"
|
@phone-scan="handlePhoneScan"
|
||||||
@@ -122,7 +126,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<u-select v-model="selectShow" :list="selectList" @confirm="selectConfirmFun"></u-select>
|
<u-select v-model="selectShow" :list="selectList" :remote="isRemoteSelect" :loading="selectSearching" @search="onSelectSearch" @confirm="selectConfirmFun"></u-select>
|
||||||
|
|
||||||
<FabricInfoPopup :show.sync="fabricInfoShow" :data="currentFabricInfo" />
|
<FabricInfoPopup :show.sync="fabricInfoShow" :data="currentFabricInfo" />
|
||||||
|
|
||||||
@@ -144,6 +148,8 @@ import FineCodePopup from '@/components/storefabric/FineCodePopup.vue';
|
|||||||
|
|
||||||
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
|
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
|
||||||
|
|
||||||
|
import OrderHeaderFold from '@/components/storefabric/OrderHeaderFold.vue';
|
||||||
|
|
||||||
import FabricOutDetailList from '@/components/storefabric/FabricOutDetailList.vue';
|
import FabricOutDetailList from '@/components/storefabric/FabricOutDetailList.vue';
|
||||||
|
|
||||||
import FabricOutScanBar from '@/components/storefabric/FabricOutScanBar.vue';
|
import FabricOutScanBar from '@/components/storefabric/FabricOutScanBar.vue';
|
||||||
@@ -152,18 +158,24 @@ import FabricOutScanDetail from '@/components/storefabric/FabricOutScanDetail.vu
|
|||||||
|
|
||||||
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
||||||
|
|
||||||
|
import PlusBarcodePanel from '@/components/common/PlusBarcodePanel.vue';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
|
|
||||||
|
PlusBarcodePanel,
|
||||||
|
|
||||||
FabricInfoPopup,
|
FabricInfoPopup,
|
||||||
|
|
||||||
FineCodePopup,
|
FineCodePopup,
|
||||||
|
|
||||||
OrderStatusBar,
|
OrderStatusBar,
|
||||||
|
|
||||||
|
OrderHeaderFold,
|
||||||
|
|
||||||
FabricOutDetailList,
|
FabricOutDetailList,
|
||||||
|
|
||||||
FabricOutScanBar,
|
FabricOutScanBar,
|
||||||
|
|||||||
@@ -1,11 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="fabric-out-page">
|
<view class="fabric-out-page">
|
||||||
|
<OrderHeaderFold v-model="headerCollapsed" :summary="form.order_no">
|
||||||
<OrderStatusBar class="fabric-out-mt32" :status="displayAuditStatus" :name="displayAuditStatusName" />
|
<OrderStatusBar class="fabric-out-mt32" :status="displayAuditStatus" :name="displayAuditStatusName" />
|
||||||
|
|
||||||
<view class="flex-white-plr26 ptb10 bdb_f5">
|
|
||||||
<text class="mr26">出仓单号</text>
|
|
||||||
<text>{{ form.order_no }}</text>
|
|
||||||
</view>
|
|
||||||
<view class="flex-white-plr26 ptb20 bdb_f5">
|
<view class="flex-white-plr26 ptb20 bdb_f5">
|
||||||
<text class="mr26">出仓类型</text>
|
<text class="mr26">出仓类型</text>
|
||||||
<text>{{ getBillTypeName() }}</text>
|
<text>{{ getBillTypeName() }}</text>
|
||||||
@@ -22,12 +18,20 @@
|
|||||||
<text class="mr26">单据备注</text>
|
<text class="mr26">单据备注</text>
|
||||||
<text>{{ form.remark || '-' }}</text>
|
<text>{{ form.remark || '-' }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
</OrderHeaderFold>
|
||||||
|
|
||||||
<FabricOutDetailList
|
<FabricOutDetailList
|
||||||
:list="form.item_data"
|
:list="form.item_data"
|
||||||
@fabric-info="openFabricInfo"
|
@fabric-info="openFabricInfo"
|
||||||
@fine-code="openFineCode"
|
@fine-code="openFineCode"
|
||||||
>
|
>
|
||||||
|
<PlusBarcodePanel
|
||||||
|
slot="before-list"
|
||||||
|
:visible.sync="phoneScanPanelOpen"
|
||||||
|
hint-text="连续扫码出仓,扫完可继续下一条"
|
||||||
|
:scan-time-space="1200"
|
||||||
|
@success="onPlusBarcodeSuccess"
|
||||||
|
/>
|
||||||
<FabricOutScanBar
|
<FabricOutScanBar
|
||||||
slot="before-list"
|
slot="before-list"
|
||||||
:can-scan="canScan"
|
:can-scan="canScan"
|
||||||
@@ -35,6 +39,7 @@
|
|||||||
:delete-mode="BarCodeDelStatus"
|
:delete-mode="BarCodeDelStatus"
|
||||||
:message="BillDataMessage"
|
:message="BillDataMessage"
|
||||||
:show-phone-scan="usePhoneScanFallback"
|
:show-phone-scan="usePhoneScanFallback"
|
||||||
|
:scanning="phoneScanPanelOpen"
|
||||||
@input="QRBarCode = $event"
|
@input="QRBarCode = $event"
|
||||||
@scan="handleScan"
|
@scan="handleScan"
|
||||||
@phone-scan="handlePhoneScan"
|
@phone-scan="handlePhoneScan"
|
||||||
@@ -51,7 +56,7 @@
|
|||||||
|
|
||||||
<FabricOutFooter :buttons="statusActionButtons" @action="handleStatusAction" />
|
<FabricOutFooter :buttons="statusActionButtons" @action="handleStatusAction" />
|
||||||
|
|
||||||
<u-select v-model="selectShow" :list="selectList" @confirm="selectConfirmFun"></u-select>
|
<u-select v-model="selectShow" :list="selectList" :remote="isRemoteSelect" :loading="selectSearching" @search="onSelectSearch" @confirm="selectConfirmFun"></u-select>
|
||||||
<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>
|
||||||
@@ -62,22 +67,31 @@ import formMixin from './storeFabricBusinessOutMixin.js';
|
|||||||
import FabricInfoPopup from '@/components/storefabric/FabricInfoPopup.vue';
|
import FabricInfoPopup from '@/components/storefabric/FabricInfoPopup.vue';
|
||||||
import FineCodePopup from '@/components/storefabric/FineCodePopup.vue';
|
import FineCodePopup from '@/components/storefabric/FineCodePopup.vue';
|
||||||
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
|
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
|
||||||
|
import OrderHeaderFold from '@/components/storefabric/OrderHeaderFold.vue';
|
||||||
import FabricOutDetailList from '@/components/storefabric/FabricOutDetailList.vue';
|
import FabricOutDetailList from '@/components/storefabric/FabricOutDetailList.vue';
|
||||||
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 PlusBarcodePanel from '@/components/common/PlusBarcodePanel.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
PlusBarcodePanel,
|
||||||
FabricInfoPopup,
|
FabricInfoPopup,
|
||||||
FineCodePopup,
|
FineCodePopup,
|
||||||
OrderStatusBar,
|
OrderStatusBar,
|
||||||
|
OrderHeaderFold,
|
||||||
FabricOutDetailList,
|
FabricOutDetailList,
|
||||||
FabricOutScanBar,
|
FabricOutScanBar,
|
||||||
FabricOutScanDetail,
|
FabricOutScanDetail,
|
||||||
FabricOutFooter,
|
FabricOutFooter,
|
||||||
},
|
},
|
||||||
mixins: [formMixin],
|
mixins: [formMixin],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
headerCollapsed: true,
|
||||||
|
};
|
||||||
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
uni.setNavigationBarTitle({ title: '编辑坯布出仓单' });
|
uni.setNavigationBarTitle({ title: '编辑坯布出仓单' });
|
||||||
this.pageMode = 'edit';
|
this.pageMode = 'edit';
|
||||||
|
|||||||
@@ -1,9 +1,28 @@
|
|||||||
<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="{ 'filter-active': hasActiveFilter }"
|
||||||
|
@click="filterShow = true"
|
||||||
|
>
|
||||||
|
<view class="filterBtn__icon">
|
||||||
|
<u-icon
|
||||||
|
:key="hasActiveFilter ? 'on' : 'off'"
|
||||||
|
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,22 +39,34 @@
|
|||||||
|
|
||||||
<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>
|
||||||
@@ -45,11 +76,11 @@
|
|||||||
<!-- </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,8 +89,25 @@
|
|||||||
</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"
|
||||||
|
remote
|
||||||
|
:loading="selectSearching"
|
||||||
|
@search="onUnitSearch"
|
||||||
|
@confirm="onUnitConfirm"
|
||||||
|
></u-select>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -68,6 +116,7 @@ import addBtn from '@/components/addBtn/addBtn.vue';
|
|||||||
import FabricOutItem from '@/components/card/storeFabricBusinessOutItem.vue';
|
import FabricOutItem from '@/components/card/storeFabricBusinessOutItem.vue';
|
||||||
import {
|
import {
|
||||||
getStatusOptions,
|
getStatusOptions,
|
||||||
|
AUDIT_STATUS,
|
||||||
AUDIT_STATUS_MAP,
|
AUDIT_STATUS_MAP,
|
||||||
BILL_TYPES,
|
BILL_TYPES,
|
||||||
BUSINESS_UNIT_TYPE_DYE_FACTORY,
|
BUSINESS_UNIT_TYPE_DYE_FACTORY,
|
||||||
@@ -75,6 +124,46 @@ import {
|
|||||||
mapToSelectOptions,
|
mapToSelectOptions,
|
||||||
fetchAllOrderList,
|
fetchAllOrderList,
|
||||||
} from '@/common/storeFabricBusinessOut';
|
} from '@/common/storeFabricBusinessOut';
|
||||||
|
import { withNameParam } from '@/common/remoteSelect';
|
||||||
|
|
||||||
|
const FILTER_STORAGE_KEY = 'storeFabricBusinessOutListFilters_v2';
|
||||||
|
|
||||||
|
const hasFilterValue = (value) => value !== '' && value !== null && value !== undefined;
|
||||||
|
|
||||||
|
const normalizeAuditStatus = (value) => {
|
||||||
|
if (!hasFilterValue(value)) return '';
|
||||||
|
const status = Number(value);
|
||||||
|
return Number.isNaN(status) ? '' : status;
|
||||||
|
};
|
||||||
|
|
||||||
|
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 (key === 'audit_status') return;
|
||||||
|
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 = '';
|
||||||
|
if (Object.prototype.hasOwnProperty.call(value, 'audit_status')) {
|
||||||
|
filters.audit_status = normalizeAuditStatus(value.audit_status);
|
||||||
|
}
|
||||||
|
return filters;
|
||||||
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { addBtn, FabricOutItem },
|
components: { addBtn, FabricOutItem },
|
||||||
@@ -90,17 +179,12 @@ export default {
|
|||||||
deliveryUnitOptions: [],
|
deliveryUnitOptions: [],
|
||||||
businessUnitOptions: [],
|
businessUnitOptions: [],
|
||||||
unitOptionsLoading: false,
|
unitOptionsLoading: false,
|
||||||
|
selectSearching: false,
|
||||||
|
unitSearchSeq: 0,
|
||||||
|
unitSelectList: [{ value: '', label: '全部' }],
|
||||||
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(),
|
||||||
@@ -118,24 +202,85 @@ export default {
|
|||||||
businessUnitLabel() {
|
businessUnitLabel() {
|
||||||
return this.filters.business_unit_name || '';
|
return this.filters.business_unit_name || '';
|
||||||
},
|
},
|
||||||
unitSelectList() {
|
statusSelectDefault() {
|
||||||
const options = this.unitSelectType === 'delivery' ? this.deliveryUnitOptions : this.businessUnitOptions;
|
const index = this.statusSelectList.findIndex(
|
||||||
return [{ value: '', label: '全部' }, ...options];
|
(item) => String(item.value) === String(this.filters.audit_status)
|
||||||
|
);
|
||||||
|
return [index >= 0 ? index : 0];
|
||||||
|
},
|
||||||
|
unitSelectDefault() {
|
||||||
|
const selectedValue = this.unitSelectType === 'delivery'
|
||||||
|
? this.filters.delivery_unit_id
|
||||||
|
: this.filters.business_unit_id;
|
||||||
|
const index = this.unitSelectList.findIndex(
|
||||||
|
(item) => String(item.value) === String(selectedValue)
|
||||||
|
);
|
||||||
|
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
|
||||||
|
|| hasFilterValue(filters.audit_status)
|
||||||
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
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 cached = uni.getStorageSync(FILTER_STORAGE_KEY);
|
||||||
|
if (!cached || typeof cached !== 'object' || Array.isArray(cached)) {
|
||||||
|
const filters = createDefaultFilters();
|
||||||
|
this.filters = { ...filters };
|
||||||
|
this.appliedFilters = { ...filters };
|
||||||
|
this.saveFilterCache();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const filters = normalizeFilters(cached);
|
||||||
|
this.filters = { ...filters };
|
||||||
|
this.appliedFilters = { ...filters };
|
||||||
|
} catch (e) {
|
||||||
|
const filters = createDefaultFilters();
|
||||||
|
this.filters = { ...filters };
|
||||||
|
this.appliedFilters = { ...filters };
|
||||||
|
}
|
||||||
|
},
|
||||||
|
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({})
|
||||||
@@ -160,21 +305,55 @@ export default {
|
|||||||
return this.businessUnitOptions;
|
return this.businessUnitOptions;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
openUnitSelect(type) {
|
applyUnitSelectList(list, preserveSelected = true) {
|
||||||
if (this.unitOptionsLoading) return;
|
const rows = Array.isArray(list) ? list.slice() : [];
|
||||||
this.unitOptionsLoading = true;
|
if (preserveSelected) {
|
||||||
const loadFn = type === 'delivery' ? this.loadDeliveryUnitOptions : this.loadBusinessUnitOptions;
|
const isDelivery = this.unitSelectType === 'delivery';
|
||||||
loadFn.call(this)
|
const selectedValue = isDelivery
|
||||||
.then((list) => {
|
? this.filters.delivery_unit_id
|
||||||
if (!list.length) {
|
: this.filters.business_unit_id;
|
||||||
uni.showToast({ title: '暂无可选单位', icon: 'none' });
|
const selectedLabel = isDelivery
|
||||||
return;
|
? this.filters.delivery_unit_name
|
||||||
|
: this.filters.business_unit_name;
|
||||||
|
const selectedExists = rows.some(
|
||||||
|
(item) => String(item.value) === String(selectedValue)
|
||||||
|
);
|
||||||
|
if (selectedValue !== '' && selectedValue !== null && selectedValue !== undefined && !selectedExists) {
|
||||||
|
rows.unshift({ value: selectedValue, label: selectedLabel || String(selectedValue) });
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
this.unitSelectList = [{ value: '', label: '全部' }].concat(rows);
|
||||||
|
},
|
||||||
|
openUnitSelect(type) {
|
||||||
this.unitSelectType = type;
|
this.unitSelectType = type;
|
||||||
|
const cache = type === 'delivery' ? this.deliveryUnitOptions : this.businessUnitOptions;
|
||||||
|
this.applyUnitSelectList(cache);
|
||||||
this.unitSelectShow = true;
|
this.unitSelectShow = true;
|
||||||
|
},
|
||||||
|
onUnitSearch(keyword) {
|
||||||
|
const seq = ++this.unitSearchSeq;
|
||||||
|
const isDelivery = this.unitSelectType === 'delivery';
|
||||||
|
const empty = !String(keyword || '').trim();
|
||||||
|
this.selectSearching = true;
|
||||||
|
const params = isDelivery ? {} : { unit_type_id: BUSINESS_UNIT_TYPE_DYE_FACTORY };
|
||||||
|
this.$u.api.businessUnit.list(withNameParam(params, keyword))
|
||||||
|
.then((res) => {
|
||||||
|
if (seq !== this.unitSearchSeq) return;
|
||||||
|
const list = mapToSelectOptions(res);
|
||||||
|
if (empty) {
|
||||||
|
if (isDelivery) this.deliveryUnitOptions = list;
|
||||||
|
else this.businessUnitOptions = list;
|
||||||
|
}
|
||||||
|
this.applyUnitSelectList(list, empty);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.catch((e) => {
|
||||||
this.unitOptionsLoading = false;
|
if (seq !== this.unitSearchSeq) return;
|
||||||
|
uni.showToast({ title: (e && e.message) || '搜索失败', icon: 'none' });
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
if (seq === this.unitSearchSeq) this.selectSearching = false;
|
||||||
|
}, () => {
|
||||||
|
if (seq === this.unitSearchSeq) this.selectSearching = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
openDeliveryUnitSelect() {
|
openDeliveryUnitSelect() {
|
||||||
@@ -194,10 +373,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 (hasFilterValue(filters.audit_status)) {
|
||||||
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 +411,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;
|
||||||
@@ -249,37 +430,20 @@ export default {
|
|||||||
uni.navigateTo({ url: `./storeFabricBusinessOutView?id=${item.id}` });
|
uni.navigateTo({ url: `./storeFabricBusinessOutView?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 = normalizeAuditStatus((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">
|
||||||
page { background-color: #F8F8F8; }
|
@import '@/common/list-filter.scss';
|
||||||
.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; }
|
|
||||||
.filterPanel { padding: 30rpx; }
|
|
||||||
.filterTitle { font-size: 32rpx; font-weight: bold; margin-bottom: 30rpx; }
|
|
||||||
.filterItem { margin-bottom: 24rpx; }
|
|
||||||
.filterLabel { display: block; font-size: 28rpx; color: #666; margin-bottom: 12rpx; }
|
|
||||||
.filterValue { display: flex; align-items: center; justify-content: space-between; padding: 16rpx; background: #f5f5f5; border-radius: 8rpx; font-size: 28rpx; }
|
|
||||||
.dateRow { display: flex; align-items: center; gap: 12rpx; }
|
|
||||||
.dateInput { padding: 16rpx; background: #f5f5f5; border-radius: 8rpx; font-size: 26rpx; min-width: 200rpx; text-align: center; }
|
|
||||||
.filterActions { display: flex; gap: 20rpx; margin-top: 40rpx; }
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -10,6 +10,9 @@
|
|||||||
*/
|
*/
|
||||||
import util from '@/common/util';
|
import util from '@/common/util';
|
||||||
import scanMixin from '@/common/scanMixin.js';
|
import scanMixin from '@/common/scanMixin.js';
|
||||||
|
import PlusBarcodePanel from '@/components/common/PlusBarcodePanel.vue';
|
||||||
|
import remoteSelectMixin from '@/common/remoteSelectMixin.js';
|
||||||
|
import { withNameParam } from '@/common/remoteSelect';
|
||||||
import { initTts, speak } from '@/common/tts.js';
|
import { initTts, speak } from '@/common/tts.js';
|
||||||
import {
|
import {
|
||||||
AUDIT_STATUS_MAP,
|
AUDIT_STATUS_MAP,
|
||||||
@@ -36,13 +39,15 @@ import {
|
|||||||
} from '@/common/storeFabricBusinessOut';
|
} from '@/common/storeFabricBusinessOut';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [scanMixin],
|
components: { PlusBarcodePanel },
|
||||||
|
mixins: [scanMixin, remoteSelectMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
pageMode: 'add',
|
pageMode: 'add',
|
||||||
orderId: 0,
|
orderId: 0,
|
||||||
form: this.getEmptyForm(),
|
form: this.getEmptyForm(),
|
||||||
headerSaved: false,
|
headerSaved: false,
|
||||||
|
headerCollapsed: false,
|
||||||
selectShow: false,
|
selectShow: false,
|
||||||
selectList: [],
|
selectList: [],
|
||||||
selectType: '',
|
selectType: '',
|
||||||
@@ -112,7 +117,15 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handlePhoneScan() {
|
handlePhoneScan() {
|
||||||
this.openPhoneScan();
|
if (!this.canScan) {
|
||||||
|
this.showError('请先提交保存后再扫码');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.togglePhoneScanPanel();
|
||||||
|
},
|
||||||
|
onPlusBarcodeSuccess(scanResult) {
|
||||||
|
this.QRBarCode = String(scanResult || '').trim().replace(/[\r\n]/g, '');
|
||||||
|
return this.handleScan();
|
||||||
},
|
},
|
||||||
registerOrderScanBroadcast() {
|
registerOrderScanBroadcast() {
|
||||||
this.registerScanBroadcast((scanResult) => {
|
this.registerScanBroadcast((scanResult) => {
|
||||||
@@ -124,6 +137,7 @@ export default {
|
|||||||
const nextCanScan = this.isEditable && canScanAtStatus(status);
|
const nextCanScan = this.isEditable && canScanAtStatus(status);
|
||||||
if (this.canScan && !nextCanScan) {
|
if (this.canScan && !nextCanScan) {
|
||||||
this.unregisterScanBroadcast();
|
this.unregisterScanBroadcast();
|
||||||
|
this.closePhoneScanPanel();
|
||||||
}
|
}
|
||||||
this.canScan = nextCanScan;
|
this.canScan = nextCanScan;
|
||||||
},
|
},
|
||||||
@@ -145,6 +159,15 @@ export default {
|
|||||||
return this.businessUnitOptions;
|
return this.businessUnitOptions;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
fetchRemoteSelectOptions(type, keyword) {
|
||||||
|
if (type !== '染厂') return Promise.resolve([]);
|
||||||
|
return this.$u.api.businessUnit.list(withNameParam({ unit_type_id: BUSINESS_UNIT_TYPE_DYE_FACTORY }, keyword))
|
||||||
|
.then((res) => {
|
||||||
|
const list = mapToSelectOptions(res);
|
||||||
|
if (!String(keyword || '').trim()) this.businessUnitOptions = list;
|
||||||
|
return list;
|
||||||
|
});
|
||||||
|
},
|
||||||
getEmptyForm() {
|
getEmptyForm() {
|
||||||
return {
|
return {
|
||||||
order_no: '',
|
order_no: '',
|
||||||
@@ -172,6 +195,7 @@ export default {
|
|||||||
this.orderId = order.id;
|
this.orderId = order.id;
|
||||||
this.auditStatus = order.audit_status;
|
this.auditStatus = order.audit_status;
|
||||||
this.headerSaved = true;
|
this.headerSaved = true;
|
||||||
|
this.headerCollapsed = true;
|
||||||
this.form = orderToFormFields(order);
|
this.form = orderToFormFields(order);
|
||||||
this.refreshScanDetailTotals(order);
|
this.refreshScanDetailTotals(order);
|
||||||
this.syncCanScanFromStatus(order.audit_status);
|
this.syncCanScanFromStatus(order.audit_status);
|
||||||
@@ -185,19 +209,9 @@ export default {
|
|||||||
},
|
},
|
||||||
pickerSelectFun(type) {
|
pickerSelectFun(type) {
|
||||||
if (!this.headerEditable) return;
|
if (!this.headerEditable) return;
|
||||||
this.selectType = type;
|
|
||||||
const openPicker = (list) => {
|
|
||||||
if (!list.length) {
|
|
||||||
this.showError('暂无可选数据');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.selectList = list;
|
|
||||||
this.selectShow = true;
|
|
||||||
};
|
|
||||||
if (type === '染厂') {
|
if (type === '染厂') {
|
||||||
this.ensureBusinessUnitOptions()
|
this.openSelectPicker(type, this.businessUnitOptions);
|
||||||
.then(openPicker)
|
return;
|
||||||
.catch((e) => this.showError(e.message || '加载单位列表失败'));
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
selectConfirmFun(e) {
|
selectConfirmFun(e) {
|
||||||
@@ -246,8 +260,9 @@ export default {
|
|||||||
const order = normalizeOrder(detail);
|
const order = normalizeOrder(detail);
|
||||||
this.applyOrder(order);
|
this.applyOrder(order);
|
||||||
this.headerSaved = true;
|
this.headerSaved = true;
|
||||||
|
this.headerCollapsed = true;
|
||||||
this.syncCanScanFromStatus(order.audit_status);
|
this.syncCanScanFromStatus(order.audit_status);
|
||||||
this.showSuccess('保存成功,可以扫码');
|
this.showSuccess('保存成功,可以扫码', '保存成功', { voiceOnly: true });
|
||||||
this.registerOrderScanBroadcast();
|
this.registerOrderScanBroadcast();
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
@@ -348,8 +363,8 @@ export default {
|
|||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
const message = e.message || (scanType === 2 ? '删除失败' : '扫码失败');
|
const message = e.message || (scanType === 2 ? '删除失败' : '扫码失败');
|
||||||
const mismatchVoice = resolveScanMismatchVoice(message);
|
const mismatchVoice = resolveScanMismatchVoice(message);
|
||||||
if (mismatchVoice) speak(mismatchVoice);
|
speak(mismatchVoice || (scanType === 2 ? '删除失败' : '扫码失败'));
|
||||||
this.showError(message, { skipErrorAudio: !!mismatchVoice });
|
uni.showToast({ title: message, icon: 'none', duration: 2500 });
|
||||||
this.QRBarCode = '';
|
this.QRBarCode = '';
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -389,16 +404,16 @@ 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('操作成功');
|
this.showSuccess(util.statusSuccessVoice(action));
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
showError(message, options = {}) {
|
showError(message, options = {}) {
|
||||||
if (!options.skipErrorAudio) util.playErrorAudio();
|
if (!options.skipErrorAudio) util.playErrorAudio(message);
|
||||||
uni.showModal({ title: '提示', content: message, showCancel: false });
|
uni.showModal({ title: '提示', content: message, showCancel: false });
|
||||||
},
|
},
|
||||||
showSuccess(message) {
|
showSuccess(message, voiceText, options) {
|
||||||
util.playSuccessAudio();
|
util.playSuccessAudio(voiceText || message, options);
|
||||||
uni.showToast({ title: message, icon: 'success' });
|
uni.showToast({ title: message, icon: 'success' });
|
||||||
},
|
},
|
||||||
getBillTypeName() {
|
getBillTypeName() {
|
||||||
|
|||||||
@@ -1,11 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="fabric-out-page">
|
<view class="fabric-out-page">
|
||||||
|
<OrderHeaderFold v-model="headerCollapsed" :summary="order.order_no">
|
||||||
<OrderStatusBar class="fabric-out-mt32" :status="order.audit_status" :name="order.audit_status_name" />
|
<OrderStatusBar class="fabric-out-mt32" :status="order.audit_status" :name="order.audit_status_name" />
|
||||||
|
|
||||||
<view class="flex-white-plr26 ptb10 bdb_f5">
|
|
||||||
<text class="mr26">出仓单号</text>
|
|
||||||
<text>{{ order.order_no }}</text>
|
|
||||||
</view>
|
|
||||||
<view class="flex-white-plr26 ptb20 bdb_f5">
|
<view class="flex-white-plr26 ptb20 bdb_f5">
|
||||||
<text class="mr26">出仓类型</text>
|
<text class="mr26">出仓类型</text>
|
||||||
<text>{{ billTypeName }}</text>
|
<text>{{ billTypeName }}</text>
|
||||||
@@ -25,6 +21,7 @@
|
|||||||
<view v-if="order.auditer_name" class="flex-white-plr26 ptb20 bdb_f5">
|
<view v-if="order.auditer_name" class="flex-white-plr26 ptb20 bdb_f5">
|
||||||
<text class="mr26">审核人</text><text>{{ order.auditer_name }} {{ formatTime(order.audit_time, 'YYYY-MM-DD') }}</text>
|
<text class="mr26">审核人</text><text>{{ order.auditer_name }} {{ formatTime(order.audit_time, 'YYYY-MM-DD') }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
</OrderHeaderFold>
|
||||||
|
|
||||||
<FabricOutDetailList
|
<FabricOutDetailList
|
||||||
:title="detailTitle"
|
:title="detailTitle"
|
||||||
@@ -45,6 +42,7 @@ import util from '@/common/util';
|
|||||||
import FabricInfoPopup from '@/components/storefabric/FabricInfoPopup.vue';
|
import FabricInfoPopup from '@/components/storefabric/FabricInfoPopup.vue';
|
||||||
import FineCodePopup from '@/components/storefabric/FineCodePopup.vue';
|
import FineCodePopup from '@/components/storefabric/FineCodePopup.vue';
|
||||||
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
|
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
|
||||||
|
import OrderHeaderFold from '@/components/storefabric/OrderHeaderFold.vue';
|
||||||
import FabricOutDetailList from '@/components/storefabric/FabricOutDetailList.vue';
|
import FabricOutDetailList from '@/components/storefabric/FabricOutDetailList.vue';
|
||||||
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
||||||
import {
|
import {
|
||||||
@@ -56,9 +54,10 @@ import {
|
|||||||
} from '@/common/storeFabricBusinessOut';
|
} from '@/common/storeFabricBusinessOut';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { FabricInfoPopup, FineCodePopup, OrderStatusBar, FabricOutDetailList, FabricOutFooter },
|
components: { FabricInfoPopup, FineCodePopup, OrderStatusBar, OrderHeaderFold, FabricOutDetailList, FabricOutFooter },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
headerCollapsed: true,
|
||||||
orderId: 0,
|
orderId: 0,
|
||||||
order: {},
|
order: {},
|
||||||
billTypeName: (BILL_TYPES[0] || {}).label || '坯布其他出货单',
|
billTypeName: (BILL_TYPES[0] || {}).label || '坯布其他出货单',
|
||||||
@@ -118,18 +117,25 @@ export default {
|
|||||||
confirmOrderStatusAction(this, {
|
confirmOrderStatusAction(this, {
|
||||||
orderId: this.orderId,
|
orderId: this.orderId,
|
||||||
action,
|
action,
|
||||||
onSuccess: () => this.$u.api.gfmOtherDeliveryOrder.detail({ id: this.orderId })
|
onSuccess: () => {
|
||||||
.then((res) => {
|
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
|
const voice = util.statusSuccessVoice(action);
|
||||||
|
util.playSuccessAudio(voice);
|
||||||
|
uni.showToast({ title: voice, icon: 'success' });
|
||||||
|
if (action === 'unapprove') {
|
||||||
|
uni.redirectTo({ url: `./storeFabricBusinessOutEdit?id=${this.orderId}` });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return this.$u.api.gfmOtherDeliveryOrder.detail({ id: this.orderId })
|
||||||
|
.then((res) => {
|
||||||
const order = normalizeOrder(res);
|
const order = normalizeOrder(res);
|
||||||
if (order) this.order = order;
|
if (order) this.order = order;
|
||||||
util.playSuccessAudio();
|
});
|
||||||
uni.showToast({ title: '操作成功', icon: 'success' });
|
},
|
||||||
}),
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
showError(message) {
|
showError(message) {
|
||||||
util.playErrorAudio();
|
util.playErrorAudio(message);
|
||||||
uni.showModal({ title: '提示', content: message, showCancel: false });
|
uni.showModal({ title: '提示', content: message, showCancel: false });
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -29,10 +29,22 @@
|
|||||||
</view>
|
</view>
|
||||||
<u-input v-model="Remark" maxlength="-1" type="textarea" :border="true" :height="100" :auto-height="true" />
|
<u-input v-model="Remark" maxlength="-1" type="textarea" :border="true" :height="100" :auto-height="true" />
|
||||||
</view>
|
</view>
|
||||||
|
<PlusBarcodePanel
|
||||||
|
v-if="usePhoneScanFallback"
|
||||||
|
:visible.sync="phoneScanPanelOpen"
|
||||||
|
hint-text="连续扫码盘点,扫完可继续下一条"
|
||||||
|
:scan-time-space="1200"
|
||||||
|
@success="onPlusBarcodeSuccess"
|
||||||
|
/>
|
||||||
<u-form-item label-width="150" label="条码资料:">
|
<u-form-item label-width="150" label="条码资料:">
|
||||||
<input type="text" maxlength="-1" v-model="QRBarCode" style="width:200px;" @confirm="GoodsCheckBillDetailScan" />
|
<input type="text" maxlength="-1" v-model="QRBarCode" style="width:200px;" @confirm="GoodsCheckBillDetailScan" />
|
||||||
|
<text
|
||||||
|
v-if="usePhoneScanFallback && phoneScanPanelOpen"
|
||||||
|
class="phone-scan-close"
|
||||||
|
@click.stop="handlePhoneScan"
|
||||||
|
>关闭扫码</text>
|
||||||
<u-icon
|
<u-icon
|
||||||
v-if="usePhoneScanFallback"
|
v-else-if="usePhoneScanFallback"
|
||||||
name="scan"
|
name="scan"
|
||||||
size="44"
|
size="44"
|
||||||
color="#2979ff"
|
color="#2979ff"
|
||||||
@@ -106,8 +118,10 @@
|
|||||||
playErrorAudio
|
playErrorAudio
|
||||||
} from '../../common/util';
|
} from '../../common/util';
|
||||||
import scanMixin from '@/common/scanMixin.js';
|
import scanMixin from '@/common/scanMixin.js';
|
||||||
|
import PlusBarcodePanel from '@/components/common/PlusBarcodePanel.vue';
|
||||||
import wybTable from '@/components/wyb-table/wyb-table.vue';
|
import wybTable from '@/components/wyb-table/wyb-table.vue';
|
||||||
export default {
|
export default {
|
||||||
|
components: { PlusBarcodePanel },
|
||||||
mixins: [scanMixin],
|
mixins: [scanMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -245,12 +259,31 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handlePhoneScan() {
|
handlePhoneScan() {
|
||||||
this.openPhoneScan();
|
this.togglePhoneScanPanel();
|
||||||
|
},
|
||||||
|
onPlusBarcodeSuccess(scanResult) {
|
||||||
|
const code = String(scanResult || '').replace(/\s+/g, '').replace(/[\r\n]/g, '');
|
||||||
|
if (!code) return;
|
||||||
|
if (!this.StoreName) {
|
||||||
|
this.showError('请先选择仓库');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.StoreStationNo) {
|
||||||
|
this.StoreStationNo = code;
|
||||||
|
this.$nextTick(() => this.GetStoreStationName());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.GoodsCheckBillID) {
|
||||||
|
this.showError('请先提交');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.QRBarCode = code;
|
||||||
|
this.$nextTick(() => this.GoodsCheckBillDetailScan());
|
||||||
},
|
},
|
||||||
|
|
||||||
// 添加通用错误提示方法
|
// 添加通用错误提示方法
|
||||||
showError(message) {
|
showError(message) {
|
||||||
this.playError();
|
this.playError(message);
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
content: message,
|
content: message,
|
||||||
@@ -260,7 +293,7 @@
|
|||||||
|
|
||||||
// 添加成功提示方法
|
// 添加成功提示方法
|
||||||
showSuccess(message) {
|
showSuccess(message) {
|
||||||
this.playSuccess();
|
this.playSuccess(message);
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: message,
|
title: message,
|
||||||
icon: 'success'
|
icon: 'success'
|
||||||
@@ -269,11 +302,11 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
playSuccess() {
|
playSuccess(text) {
|
||||||
util.playSuccessAudio();
|
util.playSuccessAudio(text);
|
||||||
},
|
},
|
||||||
playError() {
|
playError(text) {
|
||||||
util.playErrorAudio();
|
util.playErrorAudio(text);
|
||||||
},
|
},
|
||||||
|
|
||||||
BarCodeDelChange: function() {
|
BarCodeDelChange: function() {
|
||||||
@@ -692,6 +725,18 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
.phone-scan-close {
|
||||||
|
margin-left: 8px;
|
||||||
|
padding: 0 12px;
|
||||||
|
height: 36px;
|
||||||
|
line-height: 36px;
|
||||||
|
border: 1px solid #2979ff;
|
||||||
|
border-radius: 4px;
|
||||||
|
color: #2979ff;
|
||||||
|
background: #eaf2ff;
|
||||||
|
font-size: 34rpx;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
page {
|
page {
|
||||||
background-color: #F8F8F8;
|
background-color: #F8F8F8;
|
||||||
padding-bottom: 260rpx;
|
padding-bottom: 260rpx;
|
||||||
|
|||||||
@@ -9,11 +9,23 @@
|
|||||||
<text class="title" style="width:200px;">仓库名称:{{ StoreName }}</text>
|
<text class="title" style="width:200px;">仓库名称:{{ StoreName }}</text>
|
||||||
<text class="title" style="width:200px;">仓位名称:{{ StoreStationName }}</text>
|
<text class="title" style="width:200px;">仓位名称:{{ StoreStationName }}</text>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
<PlusBarcodePanel
|
||||||
|
v-if="usePhoneScanFallback"
|
||||||
|
:visible.sync="phoneScanPanelOpen"
|
||||||
|
hint-text="连续扫码盘点,扫完可继续下一条"
|
||||||
|
:scan-time-space="1200"
|
||||||
|
@success="onPlusBarcodeSuccess"
|
||||||
|
/>
|
||||||
<u-form-item label-width="150" label="条码资料:">
|
<u-form-item label-width="150" label="条码资料:">
|
||||||
<input type="text" v-model="QRBarCode" maxlength="-1" style="width:200px;"
|
<input type="text" v-model="QRBarCode" maxlength="-1" style="width:200px;"
|
||||||
@confirm="GoodsCheckBillDetailScan" />
|
@confirm="GoodsCheckBillDetailScan" />
|
||||||
|
<text
|
||||||
|
v-if="usePhoneScanFallback && phoneScanPanelOpen"
|
||||||
|
class="phone-scan-close"
|
||||||
|
@click.stop="handlePhoneScan"
|
||||||
|
>关闭扫码</text>
|
||||||
<u-icon
|
<u-icon
|
||||||
v-if="usePhoneScanFallback"
|
v-else-if="usePhoneScanFallback"
|
||||||
name="scan"
|
name="scan"
|
||||||
size="44"
|
size="44"
|
||||||
color="#2979ff"
|
color="#2979ff"
|
||||||
@@ -78,9 +90,11 @@ import util, {
|
|||||||
playErrorAudio
|
playErrorAudio
|
||||||
} from '../../common/util';
|
} from '../../common/util';
|
||||||
import scanMixin from '@/common/scanMixin.js';
|
import scanMixin from '@/common/scanMixin.js';
|
||||||
|
import PlusBarcodePanel from '@/components/common/PlusBarcodePanel.vue';
|
||||||
import wybTable from '@/components/wyb-table/wyb-table.vue';
|
import wybTable from '@/components/wyb-table/wyb-table.vue';
|
||||||
//let that = '';
|
//let that = '';
|
||||||
export default {
|
export default {
|
||||||
|
components: { PlusBarcodePanel },
|
||||||
mixins: [scanMixin],
|
mixins: [scanMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -178,12 +192,15 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handlePhoneScan() {
|
handlePhoneScan() {
|
||||||
this.openPhoneScan();
|
this.togglePhoneScanPanel();
|
||||||
|
},
|
||||||
|
onPlusBarcodeSuccess(scanResult) {
|
||||||
|
this.handleScanResult(scanResult, this._scanCallback);
|
||||||
},
|
},
|
||||||
|
|
||||||
// 添加通用错误提示方法
|
// 添加通用错误提示方法
|
||||||
showError(message) {
|
showError(message) {
|
||||||
this.playError();
|
this.playError(message);
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
content: message,
|
content: message,
|
||||||
@@ -191,11 +208,11 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
playSuccess() {
|
playSuccess(text) {
|
||||||
util.playSuccessAudio();
|
util.playSuccessAudio(text);
|
||||||
},
|
},
|
||||||
playError() {
|
playError(text) {
|
||||||
util.playErrorAudio();
|
util.playErrorAudio(text);
|
||||||
},
|
},
|
||||||
|
|
||||||
BarCodeDelChange: function () {
|
BarCodeDelChange: function () {
|
||||||
@@ -375,6 +392,18 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
.phone-scan-close {
|
||||||
|
margin-left: 8px;
|
||||||
|
padding: 0 12px;
|
||||||
|
height: 36px;
|
||||||
|
line-height: 36px;
|
||||||
|
border: 1px solid #2979ff;
|
||||||
|
border-radius: 4px;
|
||||||
|
color: #2979ff;
|
||||||
|
background: #eaf2ff;
|
||||||
|
font-size: 34rpx;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
page {
|
page {
|
||||||
background-color: #F8F8F8;
|
background-color: #F8F8F8;
|
||||||
padding-bottom: 260rpx;
|
padding-bottom: 260rpx;
|
||||||
|
|||||||
@@ -23,11 +23,23 @@
|
|||||||
<checkbox ref="checkBoxRef" :checked="AllStoreStationScanStatus">整架</checkbox>
|
<checkbox ref="checkBoxRef" :checked="AllStoreStationScanStatus">整架</checkbox>
|
||||||
</checkbox-group>
|
</checkbox-group>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
<PlusBarcodePanel
|
||||||
|
v-if="usePhoneScanFallback"
|
||||||
|
:visible.sync="phoneScanPanelOpen"
|
||||||
|
hint-text="连续扫码移仓,扫完可继续下一条"
|
||||||
|
:scan-time-space="1200"
|
||||||
|
@success="onPlusBarcodeSuccess"
|
||||||
|
/>
|
||||||
<u-form-item label-width="150" label="条码资料:" :class="{ 'input-highlight': shouldHighlightQR }">
|
<u-form-item label-width="150" label="条码资料:" :class="{ 'input-highlight': shouldHighlightQR }">
|
||||||
<input type="text" v-model="QRBarCode" maxlength="-1" style="width:150px;"
|
<input type="text" v-model="QRBarCode" maxlength="-1" style="width:150px;"
|
||||||
@confirm="GoodsStoreStationMoveScan" />
|
@confirm="GoodsStoreStationMoveScan" />
|
||||||
|
<text
|
||||||
|
v-if="usePhoneScanFallback && phoneScanPanelOpen"
|
||||||
|
class="phone-scan-close"
|
||||||
|
@click.stop="handlePhoneScan"
|
||||||
|
>关闭扫码</text>
|
||||||
<u-icon
|
<u-icon
|
||||||
v-if="usePhoneScanFallback"
|
v-else-if="usePhoneScanFallback"
|
||||||
name="scan"
|
name="scan"
|
||||||
size="44"
|
size="44"
|
||||||
color="#2979ff"
|
color="#2979ff"
|
||||||
@@ -83,7 +95,9 @@ import util, {
|
|||||||
} from '../../common/util';
|
} from '../../common/util';
|
||||||
import wybTable from '@/components/wyb-table/wyb-table.vue';
|
import wybTable from '@/components/wyb-table/wyb-table.vue';
|
||||||
import scanMixin from '@/common/scanMixin.js';
|
import scanMixin from '@/common/scanMixin.js';
|
||||||
|
import PlusBarcodePanel from '@/components/common/PlusBarcodePanel.vue';
|
||||||
export default {
|
export default {
|
||||||
|
components: { PlusBarcodePanel },
|
||||||
mixins: [scanMixin],
|
mixins: [scanMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -183,14 +197,17 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handlePhoneScan() {
|
handlePhoneScan() {
|
||||||
this.openPhoneScan();
|
this.togglePhoneScanPanel();
|
||||||
|
},
|
||||||
|
onPlusBarcodeSuccess(scanResult) {
|
||||||
|
this.handleScanResult(scanResult, this._scanCallback);
|
||||||
},
|
},
|
||||||
|
|
||||||
playSuccess() {
|
playSuccess() {
|
||||||
util.playSuccessAudio();
|
util.playSuccessAudio();
|
||||||
},
|
},
|
||||||
playError() {
|
playError(text) {
|
||||||
util.playErrorAudio();
|
util.playErrorAudio(text);
|
||||||
},
|
},
|
||||||
|
|
||||||
// 自定义扫码处理回调 - 处理本页面特有的扫码逻辑
|
// 自定义扫码处理回调 - 处理本页面特有的扫码逻辑
|
||||||
@@ -268,7 +285,7 @@ export default {
|
|||||||
|
|
||||||
// 添加一个通用的错误提示方法
|
// 添加一个通用的错误提示方法
|
||||||
showError(message) {
|
showError(message) {
|
||||||
this.playError();
|
this.playError(message);
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
content: message,
|
content: message,
|
||||||
@@ -511,6 +528,18 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
.phone-scan-close {
|
||||||
|
margin-left: 8px;
|
||||||
|
padding: 0 12px;
|
||||||
|
height: 36px;
|
||||||
|
line-height: 36px;
|
||||||
|
border: 1px solid #2979ff;
|
||||||
|
border-radius: 4px;
|
||||||
|
color: #2979ff;
|
||||||
|
background: #eaf2ff;
|
||||||
|
font-size: 34rpx;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
.first {
|
.first {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="fabric-out-page">
|
<view class="fabric-out-page">
|
||||||
|
<OrderHeaderFold v-model="headerCollapsed" :summary="form.order_no || '保存后自动生成'">
|
||||||
<OrderStatusBar class="fabric-out-mt32" :status="displayAuditStatus" :name="displayAuditStatusName" />
|
<OrderStatusBar class="fabric-out-mt32" :status="displayAuditStatus" :name="displayAuditStatusName" />
|
||||||
|
|
||||||
<view class="flex-white-plr26 ptb10 bdb_f5">
|
|
||||||
<text class="mr26">进仓单号</text>
|
|
||||||
<u-input disabled placeholder="保存后自动生成" v-model="form.order_no" />
|
|
||||||
</view>
|
|
||||||
<view @click="pickerSelectFun('进仓类型')" class="flex-white-plr26 ptb20 bdb_f5">
|
<view @click="pickerSelectFun('进仓类型')" class="flex-white-plr26 ptb20 bdb_f5">
|
||||||
<text class="mr26">进仓类型<text class="redXingh">*</text></text>
|
<text class="mr26">进仓类型<text class="redXingh">*</text></text>
|
||||||
<view :class="form.in_order_type_name ? '' : 'cBlack'">
|
<view :class="form.in_order_type_name ? '' : 'cBlack'">
|
||||||
@@ -62,13 +58,21 @@
|
|||||||
<view style="margin-bottom: 8rpx;"><text>单据备注</text></view>
|
<view style="margin-bottom: 8rpx;"><text>单据备注</text></view>
|
||||||
<u-input v-model="form.remark" :disabled="!headerEditable" type="textarea" :border="true" :height="100" :auto-height="true" />
|
<u-input v-model="form.remark" :disabled="!headerEditable" type="textarea" :border="true" :height="100" :auto-height="true" />
|
||||||
</view>
|
</view>
|
||||||
|
</OrderHeaderFold>
|
||||||
|
|
||||||
|
<PlusBarcodePanel
|
||||||
|
:visible.sync="phoneScanPanelOpen"
|
||||||
|
:hint-text="phoneScanHint"
|
||||||
|
:scan-time-space="1200"
|
||||||
|
@success="onPlusBarcodeSuccess"
|
||||||
|
/>
|
||||||
<ProcessInBinBar
|
<ProcessInBinBar
|
||||||
:can-scan="canScan"
|
:can-scan="canScan"
|
||||||
:bin-id="warehouseBinId"
|
:bin-id="warehouseBinId"
|
||||||
:code="warehouseBinCode"
|
:code="warehouseBinCode"
|
||||||
:name="warehouseBinName"
|
:name="warehouseBinName"
|
||||||
:show-phone-scan="canScan"
|
:show-phone-scan="canScan"
|
||||||
|
:scanning="phoneScanPanelOpen && phoneScanTarget === 'bin'"
|
||||||
@code-input="warehouseBinCode = $event"
|
@code-input="warehouseBinCode = $event"
|
||||||
@confirm="resolveWarehouseBin"
|
@confirm="resolveWarehouseBin"
|
||||||
@phone-scan="handleBinPhoneScan"
|
@phone-scan="handleBinPhoneScan"
|
||||||
@@ -81,6 +85,7 @@
|
|||||||
:message="BillDataMessage"
|
:message="BillDataMessage"
|
||||||
:disabled-tip="qrDisabledTip"
|
:disabled-tip="qrDisabledTip"
|
||||||
:show-phone-scan="canScanQr"
|
:show-phone-scan="canScanQr"
|
||||||
|
:scanning="phoneScanPanelOpen && phoneScanTarget === 'qr'"
|
||||||
@input="QRBarCode = $event"
|
@input="QRBarCode = $event"
|
||||||
@scan="handleScan"
|
@scan="handleScan"
|
||||||
@phone-scan="handlePhoneScan"
|
@phone-scan="handlePhoneScan"
|
||||||
@@ -107,22 +112,26 @@
|
|||||||
@action="handleStatusAction"
|
@action="handleStatusAction"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<u-select v-model="selectShow" :list="selectList" @confirm="selectConfirmFun"></u-select>
|
<u-select v-model="selectShow" :list="selectList" :remote="isRemoteSelect" :loading="selectSearching" @search="onSelectSearch" @confirm="selectConfirmFun"></u-select>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import formMixin from './storeGoodsProcessInMixin.js';
|
import formMixin from './storeGoodsProcessInMixin.js';
|
||||||
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
|
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
|
||||||
|
import OrderHeaderFold from '@/components/storefabric/OrderHeaderFold.vue';
|
||||||
import FabricOutScanBar from '@/components/storefabric/FabricOutScanBar.vue';
|
import FabricOutScanBar from '@/components/storefabric/FabricOutScanBar.vue';
|
||||||
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
||||||
import ProcessInScanDetail from '@/components/storegoods/ProcessInScanDetail.vue';
|
import ProcessInScanDetail from '@/components/storegoods/ProcessInScanDetail.vue';
|
||||||
import ProcessInDetailList from '@/components/storegoods/ProcessInDetailList.vue';
|
import ProcessInDetailList from '@/components/storegoods/ProcessInDetailList.vue';
|
||||||
import ProcessInBinBar from '@/components/storegoods/ProcessInBinBar.vue';
|
import ProcessInBinBar from '@/components/storegoods/ProcessInBinBar.vue';
|
||||||
|
import PlusBarcodePanel from '@/components/common/PlusBarcodePanel.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
PlusBarcodePanel,
|
||||||
OrderStatusBar,
|
OrderStatusBar,
|
||||||
|
OrderHeaderFold,
|
||||||
FabricOutScanBar,
|
FabricOutScanBar,
|
||||||
FabricOutFooter,
|
FabricOutFooter,
|
||||||
ProcessInScanDetail,
|
ProcessInScanDetail,
|
||||||
|
|||||||
@@ -1,11 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="fabric-out-page">
|
<view class="fabric-out-page">
|
||||||
|
<OrderHeaderFold v-model="headerCollapsed" :summary="form.order_no">
|
||||||
<OrderStatusBar class="fabric-out-mt32" :status="displayAuditStatus" :name="displayAuditStatusName" />
|
<OrderStatusBar class="fabric-out-mt32" :status="displayAuditStatus" :name="displayAuditStatusName" />
|
||||||
|
|
||||||
<view class="flex-white-plr26 ptb10 bdb_f5">
|
|
||||||
<text class="mr26">进仓单号</text>
|
|
||||||
<text>{{ form.order_no }}</text>
|
|
||||||
</view>
|
|
||||||
<view class="flex-white-plr26 ptb20 bdb_f5">
|
<view class="flex-white-plr26 ptb20 bdb_f5">
|
||||||
<text class="mr26">进仓类型</text>
|
<text class="mr26">进仓类型</text>
|
||||||
<text>{{ form.in_order_type_name || '加工进仓单' }}</text>
|
<text>{{ form.in_order_type_name || '加工进仓单' }}</text>
|
||||||
@@ -50,13 +46,21 @@
|
|||||||
<text class="mr26">单据备注</text>
|
<text class="mr26">单据备注</text>
|
||||||
<text>{{ form.remark || '-' }}</text>
|
<text>{{ form.remark || '-' }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
</OrderHeaderFold>
|
||||||
|
|
||||||
|
<PlusBarcodePanel
|
||||||
|
:visible.sync="phoneScanPanelOpen"
|
||||||
|
:hint-text="phoneScanHint"
|
||||||
|
:scan-time-space="1200"
|
||||||
|
@success="onPlusBarcodeSuccess"
|
||||||
|
/>
|
||||||
<ProcessInBinBar
|
<ProcessInBinBar
|
||||||
:can-scan="canScan"
|
:can-scan="canScan"
|
||||||
:bin-id="warehouseBinId"
|
:bin-id="warehouseBinId"
|
||||||
:code="warehouseBinCode"
|
:code="warehouseBinCode"
|
||||||
:name="warehouseBinName"
|
:name="warehouseBinName"
|
||||||
:show-phone-scan="canScan"
|
:show-phone-scan="canScan"
|
||||||
|
:scanning="phoneScanPanelOpen && phoneScanTarget === 'bin'"
|
||||||
@code-input="warehouseBinCode = $event"
|
@code-input="warehouseBinCode = $event"
|
||||||
@confirm="resolveWarehouseBin"
|
@confirm="resolveWarehouseBin"
|
||||||
@phone-scan="handleBinPhoneScan"
|
@phone-scan="handleBinPhoneScan"
|
||||||
@@ -69,6 +73,7 @@
|
|||||||
:message="BillDataMessage"
|
:message="BillDataMessage"
|
||||||
:disabled-tip="qrDisabledTip"
|
:disabled-tip="qrDisabledTip"
|
||||||
:show-phone-scan="canScanQr"
|
:show-phone-scan="canScanQr"
|
||||||
|
:scanning="phoneScanPanelOpen && phoneScanTarget === 'qr'"
|
||||||
@input="QRBarCode = $event"
|
@input="QRBarCode = $event"
|
||||||
@scan="handleScan"
|
@scan="handleScan"
|
||||||
@phone-scan="handlePhoneScan"
|
@phone-scan="handlePhoneScan"
|
||||||
@@ -85,22 +90,26 @@
|
|||||||
|
|
||||||
<FabricOutFooter :buttons="statusActionButtons" @action="handleStatusAction" />
|
<FabricOutFooter :buttons="statusActionButtons" @action="handleStatusAction" />
|
||||||
|
|
||||||
<u-select v-model="selectShow" :list="selectList" @confirm="selectConfirmFun"></u-select>
|
<u-select v-model="selectShow" :list="selectList" :remote="isRemoteSelect" :loading="selectSearching" @search="onSelectSearch" @confirm="selectConfirmFun"></u-select>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import formMixin from './storeGoodsProcessInMixin.js';
|
import formMixin from './storeGoodsProcessInMixin.js';
|
||||||
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
|
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
|
||||||
|
import OrderHeaderFold from '@/components/storefabric/OrderHeaderFold.vue';
|
||||||
import FabricOutScanBar from '@/components/storefabric/FabricOutScanBar.vue';
|
import FabricOutScanBar from '@/components/storefabric/FabricOutScanBar.vue';
|
||||||
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
||||||
import ProcessInScanDetail from '@/components/storegoods/ProcessInScanDetail.vue';
|
import ProcessInScanDetail from '@/components/storegoods/ProcessInScanDetail.vue';
|
||||||
import ProcessInDetailList from '@/components/storegoods/ProcessInDetailList.vue';
|
import ProcessInDetailList from '@/components/storegoods/ProcessInDetailList.vue';
|
||||||
import ProcessInBinBar from '@/components/storegoods/ProcessInBinBar.vue';
|
import ProcessInBinBar from '@/components/storegoods/ProcessInBinBar.vue';
|
||||||
|
import PlusBarcodePanel from '@/components/common/PlusBarcodePanel.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
PlusBarcodePanel,
|
||||||
OrderStatusBar,
|
OrderStatusBar,
|
||||||
|
OrderHeaderFold,
|
||||||
FabricOutScanBar,
|
FabricOutScanBar,
|
||||||
FabricOutFooter,
|
FabricOutFooter,
|
||||||
ProcessInScanDetail,
|
ProcessInScanDetail,
|
||||||
@@ -110,6 +119,7 @@ export default {
|
|||||||
mixins: [formMixin],
|
mixins: [formMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
headerCollapsed: true,
|
||||||
weightInputStyle: {
|
weightInputStyle: {
|
||||||
fontSize: '36rpx',
|
fontSize: '36rpx',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
<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 v-model="filters.order_no" placeholder="进仓单号" :show-action="false" @search="applySearch" @custom="applySearch" @clear="applySearch" />
|
||||||
<view class="filterBtn" @click="filterShow = true">
|
<view class="filterBtn" :class="{ 'filter-active': hasActiveFilter }" @click="filterShow = true">
|
||||||
<u-icon name="list" size="40" color="#666"></u-icon>
|
<view class="filterBtn__icon">
|
||||||
|
<u-icon :key="filterIconColor" name="list" size="44" :color="filterIconColor"></u-icon>
|
||||||
|
<view v-if="hasActiveFilter" class="filterBtn__badge"></view>
|
||||||
|
</view>
|
||||||
<text>筛选</text>
|
<text>筛选</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -20,24 +23,26 @@
|
|||||||
|
|
||||||
<addBtn url="./storeGoodsProcessInAdd"></addBtn>
|
<addBtn url="./storeGoodsProcessInAdd"></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" @click="openProcessUnitSelect">
|
<view class="filterItem" @click="openProcessUnitSelect">
|
||||||
<text class="filterLabel">加工单位</text>
|
<text class="filterLabel">加工单位</text>
|
||||||
<view class="filterValue">{{ processUnitLabel || '全部' }} <u-icon name="arrow-right" size="28"></u-icon></view>
|
<view class="filterValue">{{ processUnitLabel || '全部' }} <u-icon name="arrow-right" size="36"></u-icon></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="filterItem" @click="openWarehouseSelect">
|
<view class="filterItem" @click="openWarehouseSelect">
|
||||||
<text class="filterLabel">仓库</text>
|
<text class="filterLabel">仓库</text>
|
||||||
<view class="filterValue">{{ warehouseLabel || '全部' }} <u-icon name="arrow-right" size="28"></u-icon></view>
|
<view class="filterValue">{{ warehouseLabel || '全部' }} <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>
|
||||||
@@ -46,8 +51,8 @@
|
|||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
|
|
||||||
<u-select v-model="statusSelectShow" :list="statusSelectList" @confirm="onStatusConfirm"></u-select>
|
<u-select class="pdaSelect" v-model="statusSelectShow" title="选择订单状态" :list="statusSelectList" :default-value="statusSelectDefault" @confirm="onStatusConfirm"></u-select>
|
||||||
<u-select v-model="unitSelectShow" :list="unitSelectList" @confirm="onUnitConfirm"></u-select>
|
<u-select class="pdaSelect" v-model="unitSelectShow" :list="unitSelectList" :default-value="unitSelectDefault" remote :loading="selectSearching" @search="onUnitSearch" @confirm="onUnitConfirm"></u-select>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -56,6 +61,7 @@ import addBtn from '@/components/addBtn/addBtn.vue';
|
|||||||
import ProcessInItem from '@/components/card/storeGoodsProcessInItem.vue';
|
import ProcessInItem from '@/components/card/storeGoodsProcessInItem.vue';
|
||||||
import {
|
import {
|
||||||
getStatusOptions,
|
getStatusOptions,
|
||||||
|
AUDIT_STATUS,
|
||||||
AUDIT_STATUS_MAP,
|
AUDIT_STATUS_MAP,
|
||||||
BUSINESS_UNIT_TYPE_PROCESS,
|
BUSINESS_UNIT_TYPE_PROCESS,
|
||||||
WAREHOUSE_TYPE_FINISHED,
|
WAREHOUSE_TYPE_FINISHED,
|
||||||
@@ -63,9 +69,12 @@ import {
|
|||||||
mapToSelectOptions,
|
mapToSelectOptions,
|
||||||
fetchAllOrderList,
|
fetchAllOrderList,
|
||||||
} from '@/common/storeGoodsProcessIn';
|
} from '@/common/storeGoodsProcessIn';
|
||||||
|
import { withNameParam } from '@/common/remoteSelect';
|
||||||
|
import listFilterMixin from '@/mixins/listFilterMixin';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { addBtn, ProcessInItem },
|
components: { addBtn, ProcessInItem },
|
||||||
|
mixins: [listFilterMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
list: [],
|
list: [],
|
||||||
@@ -79,13 +88,17 @@ export default {
|
|||||||
processUnitOptions: [],
|
processUnitOptions: [],
|
||||||
warehouseOptions: [],
|
warehouseOptions: [],
|
||||||
unitOptionsLoading: false,
|
unitOptionsLoading: false,
|
||||||
|
selectSearching: false,
|
||||||
|
unitSearchSeq: 0,
|
||||||
|
unitSelectList: [{ value: '', label: '全部' }],
|
||||||
|
filterStorageKey: 'storeGoodsProcessInListFilters_v2',
|
||||||
filters: {
|
filters: {
|
||||||
order_no: '',
|
order_no: '',
|
||||||
process_unit_id: '',
|
process_unit_id: '',
|
||||||
process_name: '',
|
process_name: '',
|
||||||
warehouse_id: '',
|
warehouse_id: '',
|
||||||
warehouse_name: '',
|
warehouse_name: '',
|
||||||
audit_status: '',
|
audit_status: AUDIT_STATUS.PENDING,
|
||||||
},
|
},
|
||||||
statusSelectList: [
|
statusSelectList: [
|
||||||
{ value: '', label: '全部' },
|
{ value: '', label: '全部' },
|
||||||
@@ -104,13 +117,10 @@ export default {
|
|||||||
warehouseLabel() {
|
warehouseLabel() {
|
||||||
return this.filters.warehouse_name || '';
|
return this.filters.warehouse_name || '';
|
||||||
},
|
},
|
||||||
unitSelectList() {
|
|
||||||
const options = this.unitSelectType === 'warehouse' ? this.warehouseOptions : this.processUnitOptions;
|
|
||||||
return [{ value: '', label: '全部' }, ...options];
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
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`;
|
||||||
@@ -121,6 +131,16 @@ export default {
|
|||||||
this.loadList();
|
this.loadList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
createDefaultFilters() {
|
||||||
|
return {
|
||||||
|
order_no: '',
|
||||||
|
process_unit_id: '',
|
||||||
|
process_name: '',
|
||||||
|
warehouse_id: '',
|
||||||
|
warehouse_name: '',
|
||||||
|
audit_status: AUDIT_STATUS.PENDING,
|
||||||
|
};
|
||||||
|
},
|
||||||
loadProcessUnitOptions() {
|
loadProcessUnitOptions() {
|
||||||
if (this.processUnitOptions.length) return Promise.resolve(this.processUnitOptions);
|
if (this.processUnitOptions.length) return Promise.resolve(this.processUnitOptions);
|
||||||
return this.$u.api.businessUnit.list({ unit_type_id: BUSINESS_UNIT_TYPE_PROCESS })
|
return this.$u.api.businessUnit.list({ unit_type_id: BUSINESS_UNIT_TYPE_PROCESS })
|
||||||
@@ -146,20 +166,34 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
openUnitSelect(type) {
|
openUnitSelect(type) {
|
||||||
if (this.unitOptionsLoading) return;
|
|
||||||
this.unitOptionsLoading = true;
|
|
||||||
const loadFn = type === 'warehouse' ? this.loadWarehouseOptions : this.loadProcessUnitOptions;
|
|
||||||
loadFn.call(this)
|
|
||||||
.then((list) => {
|
|
||||||
if (!list.length) {
|
|
||||||
uni.showToast({ title: '暂无可选数据', icon: 'none' });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.unitSelectType = type;
|
this.unitSelectType = type;
|
||||||
|
const cache = type === 'warehouse' ? this.warehouseOptions : this.processUnitOptions;
|
||||||
|
this.applyUnitSelectList(cache);
|
||||||
this.unitSelectShow = true;
|
this.unitSelectShow = true;
|
||||||
})
|
},
|
||||||
.finally(() => {
|
onUnitSearch(keyword) {
|
||||||
this.unitOptionsLoading = false;
|
const seq = ++this.unitSearchSeq;
|
||||||
|
const type = this.unitSelectType;
|
||||||
|
const empty = !String(keyword || '').trim();
|
||||||
|
this.selectSearching = true;
|
||||||
|
const req = type === 'warehouse'
|
||||||
|
? this.$u.api.physicalWarehouse.getDropdownList(withNameParam({ warehouse_type_id: WAREHOUSE_TYPE_FINISHED }, keyword))
|
||||||
|
: this.$u.api.businessUnit.list(withNameParam({ unit_type_id: BUSINESS_UNIT_TYPE_PROCESS }, keyword));
|
||||||
|
req.then((res) => {
|
||||||
|
if (seq !== this.unitSearchSeq) return;
|
||||||
|
const list = mapToSelectOptions(res);
|
||||||
|
if (empty) {
|
||||||
|
if (type === 'warehouse') this.warehouseOptions = list;
|
||||||
|
else this.processUnitOptions = list;
|
||||||
|
}
|
||||||
|
this.applyUnitSelectList(list, empty);
|
||||||
|
}).catch((e) => {
|
||||||
|
if (seq !== this.unitSearchSeq) return;
|
||||||
|
uni.showToast({ title: (e && e.message) || '搜索失败', icon: 'none' });
|
||||||
|
}).then(() => {
|
||||||
|
if (seq === this.unitSearchSeq) this.selectSearching = false;
|
||||||
|
}, () => {
|
||||||
|
if (seq === this.unitSearchSeq) this.selectSearching = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
openProcessUnitSelect() {
|
openProcessUnitSelect() {
|
||||||
@@ -181,12 +215,13 @@ export default {
|
|||||||
loadList() {
|
loadList() {
|
||||||
if (this.listLoading) return;
|
if (this.listLoading) return;
|
||||||
this.listLoading = true;
|
this.listLoading = true;
|
||||||
|
const filters = this.appliedFilters || this.filters;
|
||||||
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.process_unit_id) params.process_unit_id = this.filters.process_unit_id;
|
if (filters.process_unit_id) params.process_unit_id = filters.process_unit_id;
|
||||||
if (this.filters.warehouse_id) params.warehouse_id = this.filters.warehouse_id;
|
if (filters.warehouse_id) params.warehouse_id = filters.warehouse_id;
|
||||||
if (this.filters.audit_status !== '' && this.filters.audit_status !== null) {
|
if (this.hasFilterValue(filters.audit_status)) {
|
||||||
params.audit_status = this.filters.audit_status;
|
params.audit_status = filters.audit_status;
|
||||||
}
|
}
|
||||||
fetchAllOrderList((p) => this.$u.api.fpmProcessInOrder.list(p), params)
|
fetchAllOrderList((p) => this.$u.api.fpmProcessInOrder.list(p), params)
|
||||||
.then((rows) => {
|
.then((rows) => {
|
||||||
@@ -231,33 +266,10 @@ export default {
|
|||||||
uni.navigateTo({ url: `./${page}?id=${item.id}` });
|
uni.navigateTo({ url: `./${page}?id=${item.id}` });
|
||||||
},
|
},
|
||||||
openStatusSelect() { this.statusSelectShow = true; },
|
openStatusSelect() { this.statusSelectShow = true; },
|
||||||
onStatusConfirm(e) { this.filters.audit_status = e[0].value; },
|
|
||||||
resetFilter() {
|
|
||||||
this.filters = {
|
|
||||||
order_no: '',
|
|
||||||
process_unit_id: '',
|
|
||||||
process_name: '',
|
|
||||||
warehouse_id: '',
|
|
||||||
warehouse_name: '',
|
|
||||||
audit_status: '',
|
|
||||||
};
|
|
||||||
},
|
|
||||||
applyFilter() {
|
|
||||||
this.filterShow = false;
|
|
||||||
this.loadList();
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style lang="scss">
|
||||||
page { background-color: #F8F8F8; }
|
@import '@/common/list-filter.scss';
|
||||||
.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; }
|
|
||||||
.filterPanel { padding: 30rpx; }
|
|
||||||
.filterTitle { font-size: 32rpx; font-weight: bold; margin-bottom: 30rpx; }
|
|
||||||
.filterItem { margin-bottom: 24rpx; }
|
|
||||||
.filterLabel { display: block; font-size: 28rpx; color: #666; margin-bottom: 12rpx; }
|
|
||||||
.filterValue { display: flex; align-items: center; justify-content: space-between; padding: 16rpx; background: #f5f5f5; border-radius: 8rpx; font-size: 28rpx; }
|
|
||||||
.filterActions { display: flex; gap: 20rpx; margin-top: 40rpx; }
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -8,6 +8,9 @@
|
|||||||
*/
|
*/
|
||||||
import util from '@/common/util';
|
import util from '@/common/util';
|
||||||
import scanMixin from '@/common/scanMixin.js';
|
import scanMixin from '@/common/scanMixin.js';
|
||||||
|
import PlusBarcodePanel from '@/components/common/PlusBarcodePanel.vue';
|
||||||
|
import remoteSelectMixin from '@/common/remoteSelectMixin.js';
|
||||||
|
import { withNameParam } from '@/common/remoteSelect';
|
||||||
import { initTts, speak } from '@/common/tts.js';
|
import { initTts, speak } from '@/common/tts.js';
|
||||||
import {
|
import {
|
||||||
AUDIT_STATUS_MAP,
|
AUDIT_STATUS_MAP,
|
||||||
@@ -36,13 +39,15 @@ import {
|
|||||||
} from '@/common/storeGoodsProcessIn';
|
} from '@/common/storeGoodsProcessIn';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [scanMixin],
|
components: { PlusBarcodePanel },
|
||||||
|
mixins: [scanMixin, remoteSelectMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
pageMode: 'add',
|
pageMode: 'add',
|
||||||
orderId: 0,
|
orderId: 0,
|
||||||
form: this.getEmptyForm(),
|
form: this.getEmptyForm(),
|
||||||
headerSaved: false,
|
headerSaved: false,
|
||||||
|
headerCollapsed: false,
|
||||||
selectShow: false,
|
selectShow: false,
|
||||||
selectList: [],
|
selectList: [],
|
||||||
selectType: '',
|
selectType: '',
|
||||||
@@ -107,6 +112,11 @@ export default {
|
|||||||
if (!this.warehouseBinId && !this.BarCodeDelStatus) return '请先扫描仓位后再扫布匹二维码';
|
if (!this.warehouseBinId && !this.BarCodeDelStatus) return '请先扫描仓位后再扫布匹二维码';
|
||||||
return '当前状态不可扫码';
|
return '当前状态不可扫码';
|
||||||
},
|
},
|
||||||
|
phoneScanHint() {
|
||||||
|
return this.phoneScanTarget === 'bin'
|
||||||
|
? '请扫描仓位,成功后自动扫布飞'
|
||||||
|
: '连续扫描布飞二维码,扫完可继续下一条';
|
||||||
|
},
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.isPageActive = true;
|
this.isPageActive = true;
|
||||||
@@ -131,21 +141,56 @@ export default {
|
|||||||
this.warehouseBinCode = '';
|
this.warehouseBinCode = '';
|
||||||
this.warehouseBinName = '';
|
this.warehouseBinName = '';
|
||||||
this.phoneContinuousScan = false;
|
this.phoneContinuousScan = false;
|
||||||
|
this._phoneBinLocked = false;
|
||||||
|
this._pendingFabricCode = '';
|
||||||
|
if (this.phoneScanTarget === 'bin') this.closePhoneScanPanel();
|
||||||
|
},
|
||||||
|
/** 重扫仓位:先清空输入框再填入,避免残留旧码拼接 */
|
||||||
|
applyWarehouseBinScan(scanResult) {
|
||||||
|
const code = String(scanResult || '').trim().replace(/[\r\n]/g, '');
|
||||||
|
if (!code) return;
|
||||||
|
this.warehouseBinCode = '';
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.warehouseBinCode = code;
|
||||||
|
this.$nextTick(() => this.resolveWarehouseBin());
|
||||||
|
});
|
||||||
|
},
|
||||||
|
openHalfScreenScan(target) {
|
||||||
|
if (this.phoneScanPanelOpen && this.phoneScanTarget === target) {
|
||||||
|
this.closePhoneScanPanel();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.phoneContinuousScan = false;
|
||||||
|
if (target === 'bin') this._phoneBinLocked = false;
|
||||||
|
this.phoneScanTarget = target;
|
||||||
|
this.phoneScanPanelOpen = true;
|
||||||
|
},
|
||||||
|
onPlusBarcodeSuccess(scanResult) {
|
||||||
|
const code = String(scanResult || '').trim().replace(/[\r\n]/g, '');
|
||||||
|
if (!code) return;
|
||||||
|
if (this.phoneScanTarget === 'bin') {
|
||||||
|
if (this._phoneBinLocked) {
|
||||||
|
if (!this.warehouseBinId) {
|
||||||
|
this._pendingFabricCode = code;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.phoneScanTarget = 'qr';
|
||||||
|
} else {
|
||||||
|
this._phoneBinLocked = true;
|
||||||
|
this._pendingFabricCode = '';
|
||||||
|
this.applyWarehouseBinScan(code);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.QRBarCode = code;
|
||||||
|
this.$nextTick(() => this.handleScan());
|
||||||
},
|
},
|
||||||
handleBinPhoneScan() {
|
handleBinPhoneScan() {
|
||||||
if (!this.canScan || !this.orderId) {
|
if (!this.canScan || !this.orderId) {
|
||||||
this.showError('请先提交保存后再扫码');
|
this.showError('请先提交保存后再扫码');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.phoneContinuousScan = false;
|
this.openHalfScreenScan('bin');
|
||||||
this.phoneScanTarget = 'bin';
|
|
||||||
this.openPhoneScan({
|
|
||||||
callback: (scanResult) => {
|
|
||||||
this.warehouseBinCode = String(scanResult || '').trim().replace(/[\r\n]/g, '');
|
|
||||||
this.$nextTick(() => this.resolveWarehouseBin());
|
|
||||||
},
|
|
||||||
fail: () => {},
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
handlePhoneScan() {
|
handlePhoneScan() {
|
||||||
if (!this.canScan || !this.orderId) {
|
if (!this.canScan || !this.orderId) {
|
||||||
@@ -157,11 +202,10 @@ export default {
|
|||||||
this.handleBinPhoneScan();
|
this.handleBinPhoneScan();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.phoneScanTarget = 'qr';
|
this.openHalfScreenScan('qr');
|
||||||
this.phoneContinuousScan = true;
|
|
||||||
this.openContinuousPhoneScan();
|
|
||||||
},
|
},
|
||||||
openContinuousPhoneScan() {
|
openContinuousPhoneScan() {
|
||||||
|
if (this.phoneScanPanelOpen) return;
|
||||||
if (!this.phoneContinuousScan || !this.canScanQr || !this.isPageActive) {
|
if (!this.phoneContinuousScan || !this.canScanQr || !this.isPageActive) {
|
||||||
this.phoneContinuousScan = false;
|
this.phoneContinuousScan = false;
|
||||||
return;
|
return;
|
||||||
@@ -177,6 +221,7 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
scheduleNextPhoneScan() {
|
scheduleNextPhoneScan() {
|
||||||
|
if (this.phoneScanPanelOpen) return;
|
||||||
if (!this.phoneContinuousScan || !this.canScanQr || !this.isPageActive) {
|
if (!this.phoneContinuousScan || !this.canScanQr || !this.isPageActive) {
|
||||||
this.phoneContinuousScan = false;
|
this.phoneContinuousScan = false;
|
||||||
return;
|
return;
|
||||||
@@ -191,8 +236,7 @@ export default {
|
|||||||
if (!code) return;
|
if (!code) return;
|
||||||
// 删除模式:直接按布匹码删除;未扫仓位时枪扫优先解析为仓位
|
// 删除模式:直接按布匹码删除;未扫仓位时枪扫优先解析为仓位
|
||||||
if (!this.BarCodeDelStatus && !this.warehouseBinId) {
|
if (!this.BarCodeDelStatus && !this.warehouseBinId) {
|
||||||
this.warehouseBinCode = code;
|
this.applyWarehouseBinScan(code);
|
||||||
this.$nextTick(() => this.resolveWarehouseBin());
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.QRBarCode = code;
|
this.QRBarCode = code;
|
||||||
@@ -235,10 +279,21 @@ export default {
|
|||||||
this.BillDataMessage = '';
|
this.BillDataMessage = '';
|
||||||
speak('仓位成功');
|
speak('仓位成功');
|
||||||
uni.showToast({ title: '仓位识别成功', icon: 'success' });
|
uni.showToast({ title: '仓位识别成功', icon: 'success' });
|
||||||
|
if (this.phoneScanPanelOpen) this.phoneScanTarget = 'qr';
|
||||||
|
this._phoneBinLocked = false;
|
||||||
|
const pending = this._pendingFabricCode;
|
||||||
|
this._pendingFabricCode = '';
|
||||||
|
if (pending && this.phoneScanPanelOpen) {
|
||||||
|
this.QRBarCode = pending;
|
||||||
|
this.$nextTick(() => this.handleScan());
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
|
this._phoneBinLocked = false;
|
||||||
|
this._pendingFabricCode = '';
|
||||||
this.warehouseBinId = 0;
|
this.warehouseBinId = 0;
|
||||||
|
this.warehouseBinCode = '';
|
||||||
this.warehouseBinName = '';
|
this.warehouseBinName = '';
|
||||||
this.showError(e.message || '仓位识别失败');
|
this.showError(e.message || '仓位识别失败');
|
||||||
});
|
});
|
||||||
@@ -247,6 +302,7 @@ export default {
|
|||||||
const nextCanScan = this.isEditable && canScanAtStatus(status);
|
const nextCanScan = this.isEditable && canScanAtStatus(status);
|
||||||
if (this.canScan && !nextCanScan) {
|
if (this.canScan && !nextCanScan) {
|
||||||
this.phoneContinuousScan = false;
|
this.phoneContinuousScan = false;
|
||||||
|
this.closePhoneScanPanel();
|
||||||
this.unregisterScanBroadcast();
|
this.unregisterScanBroadcast();
|
||||||
}
|
}
|
||||||
this.canScan = nextCanScan;
|
this.canScan = nextCanScan;
|
||||||
@@ -300,6 +356,34 @@ export default {
|
|||||||
return this.saleSystemOptions;
|
return this.saleSystemOptions;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
fetchRemoteSelectOptions(type, keyword) {
|
||||||
|
const empty = !String(keyword || '').trim();
|
||||||
|
if (type === '加工单位') {
|
||||||
|
return this.$u.api.businessUnit.list(withNameParam({ unit_type_id: BUSINESS_UNIT_TYPE_PROCESS }, keyword))
|
||||||
|
.then((res) => {
|
||||||
|
const list = mapToSelectOptions(res);
|
||||||
|
if (empty) this.processUnitOptions = list;
|
||||||
|
return list;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (type === '仓库名称') {
|
||||||
|
return this.$u.api.physicalWarehouse.getDropdownList(withNameParam({ warehouse_type_id: WAREHOUSE_TYPE_FINISHED }, keyword))
|
||||||
|
.then((res) => {
|
||||||
|
const list = mapToSelectOptions(res);
|
||||||
|
if (empty) this.warehouseOptions = list;
|
||||||
|
return list;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (type === '营销体系') {
|
||||||
|
return this.$u.api.saleSystem.getDropdownList(withNameParam({}, keyword))
|
||||||
|
.then((res) => {
|
||||||
|
const list = mapToSelectOptions(res);
|
||||||
|
if (empty) this.saleSystemOptions = list;
|
||||||
|
return list;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return Promise.resolve([]);
|
||||||
|
},
|
||||||
applyDefaultWarehouse() {
|
applyDefaultWarehouse() {
|
||||||
const app = getApp();
|
const app = getApp();
|
||||||
const picked = pickDefaultWarehouse(
|
const picked = pickDefaultWarehouse(
|
||||||
@@ -368,6 +452,7 @@ export default {
|
|||||||
this.orderId = order.id;
|
this.orderId = order.id;
|
||||||
this.auditStatus = order.audit_status;
|
this.auditStatus = order.audit_status;
|
||||||
this.headerSaved = true;
|
this.headerSaved = true;
|
||||||
|
this.headerCollapsed = true;
|
||||||
this.form = orderToFormFields(order);
|
this.form = orderToFormFields(order);
|
||||||
this.clearWarehouseBin();
|
this.clearWarehouseBin();
|
||||||
this.syncCanScanFromStatus(order.audit_status);
|
this.syncCanScanFromStatus(order.audit_status);
|
||||||
@@ -381,30 +466,22 @@ export default {
|
|||||||
},
|
},
|
||||||
pickerSelectFun(type) {
|
pickerSelectFun(type) {
|
||||||
if (!this.headerEditable) return;
|
if (!this.headerEditable) return;
|
||||||
|
if (type === '进仓类型') {
|
||||||
this.selectType = type;
|
this.selectType = type;
|
||||||
const openPicker = (list) => {
|
if (!this.inOrderTypeOptions.length) {
|
||||||
if (!list.length) {
|
|
||||||
this.showError('暂无可选数据');
|
this.showError('暂无可选数据');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.selectList = list;
|
this.selectList = this.inOrderTypeOptions;
|
||||||
this.selectShow = true;
|
this.selectShow = true;
|
||||||
};
|
return;
|
||||||
if (type === '进仓类型') {
|
|
||||||
openPicker(this.inOrderTypeOptions);
|
|
||||||
} else if (type === '加工单位') {
|
|
||||||
this.ensureProcessUnitOptions()
|
|
||||||
.then(openPicker)
|
|
||||||
.catch((e) => this.showError(e.message || '加载加工单位失败'));
|
|
||||||
} else if (type === '仓库名称') {
|
|
||||||
this.ensureWarehouseOptions()
|
|
||||||
.then(openPicker)
|
|
||||||
.catch((e) => this.showError(e.message || '加载仓库失败'));
|
|
||||||
} else if (type === '营销体系') {
|
|
||||||
this.ensureSaleSystemOptions()
|
|
||||||
.then(openPicker)
|
|
||||||
.catch((e) => this.showError(e.message || '加载营销体系失败'));
|
|
||||||
}
|
}
|
||||||
|
const cache = {
|
||||||
|
'加工单位': this.processUnitOptions,
|
||||||
|
'仓库名称': this.warehouseOptions,
|
||||||
|
'营销体系': this.saleSystemOptions,
|
||||||
|
};
|
||||||
|
if (cache[type]) this.openSelectPicker(type, cache[type]);
|
||||||
},
|
},
|
||||||
selectConfirmFun(e) {
|
selectConfirmFun(e) {
|
||||||
const item = e[0];
|
const item = e[0];
|
||||||
@@ -463,9 +540,10 @@ export default {
|
|||||||
const order = normalizeOrder(detail);
|
const order = normalizeOrder(detail);
|
||||||
this.applyOrder(order, { keepWeights: true });
|
this.applyOrder(order, { keepWeights: true });
|
||||||
this.headerSaved = true;
|
this.headerSaved = true;
|
||||||
|
this.headerCollapsed = true;
|
||||||
this.clearWarehouseBin();
|
this.clearWarehouseBin();
|
||||||
this.syncCanScanFromStatus(order.audit_status);
|
this.syncCanScanFromStatus(order.audit_status);
|
||||||
this.showSuccess('保存成功,请先扫描仓位');
|
this.showSuccess('保存成功,请先扫描仓位', '保存成功', { voiceOnly: true });
|
||||||
this.registerOrderScanBroadcast();
|
this.registerOrderScanBroadcast();
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
@@ -579,6 +657,12 @@ export default {
|
|||||||
if (order) {
|
if (order) {
|
||||||
this.form.item_data = order.item_data;
|
this.form.item_data = order.item_data;
|
||||||
this.auditStatus = order.audit_status;
|
this.auditStatus = order.audit_status;
|
||||||
|
// 本单匹数/本单数量:取这张单的总匹数、总数量
|
||||||
|
this.scanDetail = {
|
||||||
|
...this.scanDetail,
|
||||||
|
order_roll: order.total_roll,
|
||||||
|
order_weight: order.total_weight,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(() => null);
|
.catch(() => null);
|
||||||
@@ -591,7 +675,8 @@ export default {
|
|||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
this.phoneContinuousScan = false;
|
this.phoneContinuousScan = false;
|
||||||
const message = e.message || (isDelete ? '删除失败' : '扫码失败');
|
const message = e.message || (isDelete ? '删除失败' : '扫码失败');
|
||||||
this.showError(message);
|
speak(isDelete ? '删除失败' : '扫码失败');
|
||||||
|
uni.showToast({ title: message, icon: 'none', duration: 2500 });
|
||||||
this.QRBarCode = '';
|
this.QRBarCode = '';
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -606,16 +691,16 @@ 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('操作成功');
|
this.showSuccess(util.statusSuccessVoice(action));
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
showError(message) {
|
showError(message) {
|
||||||
util.playErrorAudio();
|
util.playErrorAudio(message);
|
||||||
uni.showModal({ title: '提示', content: message, showCancel: false });
|
uni.showModal({ title: '提示', content: message, showCancel: false });
|
||||||
},
|
},
|
||||||
showSuccess(message) {
|
showSuccess(message, voiceText, options) {
|
||||||
util.playSuccessAudio();
|
util.playSuccessAudio(voiceText || message, options);
|
||||||
uni.showToast({ title: message, icon: 'success' });
|
uni.showToast({ title: message, icon: 'success' });
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,11 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="fabric-out-page">
|
<view class="fabric-out-page">
|
||||||
|
<OrderHeaderFold v-model="headerCollapsed" :summary="order.order_no">
|
||||||
<OrderStatusBar class="fabric-out-mt32" :status="order.audit_status" :name="order.audit_status_name" />
|
<OrderStatusBar class="fabric-out-mt32" :status="order.audit_status" :name="order.audit_status_name" />
|
||||||
|
|
||||||
<view class="flex-white-plr26 ptb10 bdb_f5">
|
|
||||||
<text class="mr26">进仓单号</text>
|
|
||||||
<text>{{ order.order_no }}</text>
|
|
||||||
</view>
|
|
||||||
<view class="flex-white-plr26 ptb20 bdb_f5">
|
<view class="flex-white-plr26 ptb20 bdb_f5">
|
||||||
<text class="mr26">进仓类型</text>
|
<text class="mr26">进仓类型</text>
|
||||||
<text>{{ order.in_order_type_name || '加工进仓单' }}</text>
|
<text>{{ order.in_order_type_name || '加工进仓单' }}</text>
|
||||||
@@ -44,6 +40,7 @@
|
|||||||
<text class="mr26">审核人</text>
|
<text class="mr26">审核人</text>
|
||||||
<text>{{ order.auditor_name }} {{ formatTime(order.audit_time, 'YYYY-MM-DD') }}</text>
|
<text>{{ order.auditor_name }} {{ formatTime(order.audit_time, 'YYYY-MM-DD') }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
</OrderHeaderFold>
|
||||||
|
|
||||||
<ProcessInDetailList
|
<ProcessInDetailList
|
||||||
:title="detailTitle"
|
:title="detailTitle"
|
||||||
@@ -58,6 +55,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import util from '@/common/util';
|
import util from '@/common/util';
|
||||||
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
|
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
|
||||||
|
import OrderHeaderFold from '@/components/storefabric/OrderHeaderFold.vue';
|
||||||
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
||||||
import ProcessInDetailList from '@/components/storegoods/ProcessInDetailList.vue';
|
import ProcessInDetailList from '@/components/storegoods/ProcessInDetailList.vue';
|
||||||
import {
|
import {
|
||||||
@@ -68,10 +66,11 @@ import {
|
|||||||
} from '@/common/storeGoodsProcessIn';
|
} from '@/common/storeGoodsProcessIn';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { OrderStatusBar, FabricOutFooter, ProcessInDetailList },
|
components: { OrderStatusBar, OrderHeaderFold, FabricOutFooter, ProcessInDetailList },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
orderId: 0,
|
orderId: 0,
|
||||||
|
headerCollapsed: true,
|
||||||
order: { item_data: [] },
|
order: { item_data: [] },
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -117,18 +116,25 @@ export default {
|
|||||||
confirmOrderStatusAction(this, {
|
confirmOrderStatusAction(this, {
|
||||||
orderId: this.orderId,
|
orderId: this.orderId,
|
||||||
action,
|
action,
|
||||||
onSuccess: () => this.$u.api.fpmProcessInOrder.detail({ id: this.orderId })
|
onSuccess: () => {
|
||||||
.then((res) => {
|
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
|
const voice = util.statusSuccessVoice(action);
|
||||||
|
util.playSuccessAudio(voice);
|
||||||
|
uni.showToast({ title: voice, icon: 'success' });
|
||||||
|
if (action === 'unapprove') {
|
||||||
|
uni.redirectTo({ url: `./storeGoodsProcessInEdit?id=${this.orderId}` });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return this.$u.api.fpmProcessInOrder.detail({ id: this.orderId })
|
||||||
|
.then((res) => {
|
||||||
const order = normalizeOrder(res);
|
const order = normalizeOrder(res);
|
||||||
if (order) this.order = order;
|
if (order) this.order = order;
|
||||||
util.playSuccessAudio();
|
});
|
||||||
uni.showToast({ title: '操作成功', icon: 'success' });
|
},
|
||||||
}),
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
showError(message) {
|
showError(message) {
|
||||||
util.playErrorAudio();
|
util.playErrorAudio(message);
|
||||||
uni.showModal({ title: '提示', content: message, showCancel: false });
|
uni.showModal({ title: '提示', content: message, showCancel: false });
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,11 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="fabric-out-page">
|
<view class="fabric-out-page">
|
||||||
|
<OrderHeaderFold v-model="headerCollapsed" :summary="form.order_no || '保存后自动生成'">
|
||||||
<OrderStatusBar class="fabric-out-mt32" :status="displayAuditStatus" :name="displayAuditStatusName" />
|
<OrderStatusBar class="fabric-out-mt32" :status="displayAuditStatus" :name="displayAuditStatusName" />
|
||||||
|
|
||||||
<view class="flex-white-plr26 ptb10 bdb_f5">
|
|
||||||
<text class="mr26">出仓单号</text>
|
|
||||||
<u-input disabled placeholder="保存后自动生成" v-model="form.order_no" />
|
|
||||||
</view>
|
|
||||||
<view @click="pickerSelectFun('出仓类型')" class="flex-white-plr26 ptb20 bdb_f5">
|
<view @click="pickerSelectFun('出仓类型')" class="flex-white-plr26 ptb20 bdb_f5">
|
||||||
<text class="mr26">出仓类型<text class="redXingh">*</text></text>
|
<text class="mr26">出仓类型<text class="redXingh">*</text></text>
|
||||||
<view :class="form.out_order_type_name ? '' : 'cBlack'">
|
<view :class="form.out_order_type_name ? '' : 'cBlack'">
|
||||||
@@ -31,7 +27,14 @@
|
|||||||
<view style="margin-bottom: 8rpx;"><text>单据备注</text></view>
|
<view style="margin-bottom: 8rpx;"><text>单据备注</text></view>
|
||||||
<u-input v-model="form.remark" :disabled="!headerEditable" type="textarea" :border="true" :height="100" :auto-height="true" />
|
<u-input v-model="form.remark" :disabled="!headerEditable" type="textarea" :border="true" :height="100" :auto-height="true" />
|
||||||
</view>
|
</view>
|
||||||
|
</OrderHeaderFold>
|
||||||
|
|
||||||
|
<PlusBarcodePanel
|
||||||
|
:visible.sync="phoneScanPanelOpen"
|
||||||
|
hint-text="连续扫码出仓,扫完可继续下一条"
|
||||||
|
:scan-time-space="1200"
|
||||||
|
@success="onPlusBarcodeSuccess"
|
||||||
|
/>
|
||||||
<FabricOutScanBar
|
<FabricOutScanBar
|
||||||
:can-scan="showQrScanBar"
|
:can-scan="showQrScanBar"
|
||||||
:value="QRBarCode"
|
:value="QRBarCode"
|
||||||
@@ -39,6 +42,7 @@
|
|||||||
:message="BillDataMessage"
|
:message="BillDataMessage"
|
||||||
:disabled-tip="qrDisabledTip"
|
:disabled-tip="qrDisabledTip"
|
||||||
:show-phone-scan="canScanQr"
|
:show-phone-scan="canScanQr"
|
||||||
|
:scanning="phoneScanPanelOpen"
|
||||||
@input="QRBarCode = $event"
|
@input="QRBarCode = $event"
|
||||||
@scan="handleScan"
|
@scan="handleScan"
|
||||||
@phone-scan="handlePhoneScan"
|
@phone-scan="handlePhoneScan"
|
||||||
@@ -64,21 +68,25 @@
|
|||||||
@action="handleStatusAction"
|
@action="handleStatusAction"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<u-select v-model="selectShow" :list="selectList" @confirm="selectConfirmFun"></u-select>
|
<u-select v-model="selectShow" :list="selectList" :remote="isRemoteSelect" :loading="selectSearching" @search="onSelectSearch" @confirm="selectConfirmFun"></u-select>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import formMixin from './storeGoodsProcessOutMixin.js';
|
import formMixin from './storeGoodsProcessOutMixin.js';
|
||||||
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
|
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
|
||||||
|
import OrderHeaderFold from '@/components/storefabric/OrderHeaderFold.vue';
|
||||||
import FabricOutScanBar from '@/components/storefabric/FabricOutScanBar.vue';
|
import FabricOutScanBar from '@/components/storefabric/FabricOutScanBar.vue';
|
||||||
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
||||||
import ProcessOutScanDetail from '@/components/storegoods/ProcessOutScanDetail.vue';
|
import ProcessOutScanDetail from '@/components/storegoods/ProcessOutScanDetail.vue';
|
||||||
import ProcessOutDetailList from '@/components/storegoods/ProcessOutDetailList.vue';
|
import ProcessOutDetailList from '@/components/storegoods/ProcessOutDetailList.vue';
|
||||||
|
import PlusBarcodePanel from '@/components/common/PlusBarcodePanel.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
PlusBarcodePanel,
|
||||||
OrderStatusBar,
|
OrderStatusBar,
|
||||||
|
OrderHeaderFold,
|
||||||
FabricOutScanBar,
|
FabricOutScanBar,
|
||||||
FabricOutFooter,
|
FabricOutFooter,
|
||||||
ProcessOutScanDetail,
|
ProcessOutScanDetail,
|
||||||
|
|||||||
@@ -1,11 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="fabric-out-page">
|
<view class="fabric-out-page">
|
||||||
|
<OrderHeaderFold v-model="headerCollapsed" :summary="form.order_no">
|
||||||
<OrderStatusBar class="fabric-out-mt32" :status="displayAuditStatus" :name="displayAuditStatusName" />
|
<OrderStatusBar class="fabric-out-mt32" :status="displayAuditStatus" :name="displayAuditStatusName" />
|
||||||
|
|
||||||
<view class="flex-white-plr26 ptb10 bdb_f5">
|
|
||||||
<text class="mr26">出仓单号</text>
|
|
||||||
<text>{{ form.order_no }}</text>
|
|
||||||
</view>
|
|
||||||
<view class="flex-white-plr26 ptb20 bdb_f5">
|
<view class="flex-white-plr26 ptb20 bdb_f5">
|
||||||
<text class="mr26">出仓类型</text>
|
<text class="mr26">出仓类型</text>
|
||||||
<text>{{ form.out_order_type_name || '正常加工出仓' }}</text>
|
<text>{{ form.out_order_type_name || '正常加工出仓' }}</text>
|
||||||
@@ -22,7 +18,14 @@
|
|||||||
<text class="mr26">单据备注</text>
|
<text class="mr26">单据备注</text>
|
||||||
<text>{{ form.remark || '-' }}</text>
|
<text>{{ form.remark || '-' }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
</OrderHeaderFold>
|
||||||
|
|
||||||
|
<PlusBarcodePanel
|
||||||
|
:visible.sync="phoneScanPanelOpen"
|
||||||
|
hint-text="连续扫码出仓,扫完可继续下一条"
|
||||||
|
:scan-time-space="1200"
|
||||||
|
@success="onPlusBarcodeSuccess"
|
||||||
|
/>
|
||||||
<FabricOutScanBar
|
<FabricOutScanBar
|
||||||
:can-scan="showQrScanBar"
|
:can-scan="showQrScanBar"
|
||||||
:value="QRBarCode"
|
:value="QRBarCode"
|
||||||
@@ -30,6 +33,7 @@
|
|||||||
:message="BillDataMessage"
|
:message="BillDataMessage"
|
||||||
:disabled-tip="qrDisabledTip"
|
:disabled-tip="qrDisabledTip"
|
||||||
:show-phone-scan="canScanQr"
|
:show-phone-scan="canScanQr"
|
||||||
|
:scanning="phoneScanPanelOpen"
|
||||||
@input="QRBarCode = $event"
|
@input="QRBarCode = $event"
|
||||||
@scan="handleScan"
|
@scan="handleScan"
|
||||||
@phone-scan="handlePhoneScan"
|
@phone-scan="handlePhoneScan"
|
||||||
@@ -45,27 +49,36 @@
|
|||||||
|
|
||||||
<FabricOutFooter :buttons="statusActionButtons" @action="handleStatusAction" />
|
<FabricOutFooter :buttons="statusActionButtons" @action="handleStatusAction" />
|
||||||
|
|
||||||
<u-select v-model="selectShow" :list="selectList" @confirm="selectConfirmFun"></u-select>
|
<u-select v-model="selectShow" :list="selectList" :remote="isRemoteSelect" :loading="selectSearching" @search="onSelectSearch" @confirm="selectConfirmFun"></u-select>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import formMixin from './storeGoodsProcessOutMixin.js';
|
import formMixin from './storeGoodsProcessOutMixin.js';
|
||||||
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
|
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
|
||||||
|
import OrderHeaderFold from '@/components/storefabric/OrderHeaderFold.vue';
|
||||||
import FabricOutScanBar from '@/components/storefabric/FabricOutScanBar.vue';
|
import FabricOutScanBar from '@/components/storefabric/FabricOutScanBar.vue';
|
||||||
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
||||||
import ProcessOutScanDetail from '@/components/storegoods/ProcessOutScanDetail.vue';
|
import ProcessOutScanDetail from '@/components/storegoods/ProcessOutScanDetail.vue';
|
||||||
import ProcessOutDetailList from '@/components/storegoods/ProcessOutDetailList.vue';
|
import ProcessOutDetailList from '@/components/storegoods/ProcessOutDetailList.vue';
|
||||||
|
import PlusBarcodePanel from '@/components/common/PlusBarcodePanel.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
PlusBarcodePanel,
|
||||||
OrderStatusBar,
|
OrderStatusBar,
|
||||||
|
OrderHeaderFold,
|
||||||
FabricOutScanBar,
|
FabricOutScanBar,
|
||||||
FabricOutFooter,
|
FabricOutFooter,
|
||||||
ProcessOutScanDetail,
|
ProcessOutScanDetail,
|
||||||
ProcessOutDetailList,
|
ProcessOutDetailList,
|
||||||
},
|
},
|
||||||
mixins: [formMixin],
|
mixins: [formMixin],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
headerCollapsed: true,
|
||||||
|
};
|
||||||
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
uni.setNavigationBarTitle({ title: '编辑加工出仓单' });
|
uni.setNavigationBarTitle({ title: '编辑加工出仓单' });
|
||||||
this.pageMode = 'edit';
|
this.pageMode = 'edit';
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
<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 v-model="filters.order_no" placeholder="出仓单号" :show-action="false" @search="applySearch" @custom="applySearch" @clear="applySearch" />
|
||||||
<view class="filterBtn" @click="filterShow = true">
|
<view class="filterBtn" :class="{ 'filter-active': hasActiveFilter }" @click="filterShow = true">
|
||||||
<u-icon name="list" size="40" color="#666"></u-icon>
|
<view class="filterBtn__icon">
|
||||||
|
<u-icon :key="filterIconColor" name="list" size="44" :color="filterIconColor"></u-icon>
|
||||||
|
<view v-if="hasActiveFilter" class="filterBtn__badge"></view>
|
||||||
|
</view>
|
||||||
<text>筛选</text>
|
<text>筛选</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -20,24 +23,26 @@
|
|||||||
|
|
||||||
<addBtn url="./storeGoodsProcessOutAdd"></addBtn>
|
<addBtn url="./storeGoodsProcessOutAdd"></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" @click="openProcessUnitSelect">
|
<view class="filterItem" @click="openProcessUnitSelect">
|
||||||
<text class="filterLabel">加工单位</text>
|
<text class="filterLabel">加工单位</text>
|
||||||
<view class="filterValue">{{ processUnitLabel || '全部' }} <u-icon name="arrow-right" size="28"></u-icon></view>
|
<view class="filterValue">{{ processUnitLabel || '全部' }} <u-icon name="arrow-right" size="36"></u-icon></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="filterItem" @click="openWarehouseSelect">
|
<view class="filterItem" @click="openWarehouseSelect">
|
||||||
<text class="filterLabel">仓库</text>
|
<text class="filterLabel">仓库</text>
|
||||||
<view class="filterValue">{{ warehouseLabel || '全部' }} <u-icon name="arrow-right" size="28"></u-icon></view>
|
<view class="filterValue">{{ warehouseLabel || '全部' }} <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>
|
||||||
@@ -46,8 +51,8 @@
|
|||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
|
|
||||||
<u-select v-model="statusSelectShow" :list="statusSelectList" @confirm="onStatusConfirm"></u-select>
|
<u-select class="pdaSelect" v-model="statusSelectShow" title="选择订单状态" :list="statusSelectList" :default-value="statusSelectDefault" @confirm="onStatusConfirm"></u-select>
|
||||||
<u-select v-model="unitSelectShow" :list="unitSelectList" @confirm="onUnitConfirm"></u-select>
|
<u-select class="pdaSelect" v-model="unitSelectShow" :list="unitSelectList" :default-value="unitSelectDefault" remote :loading="selectSearching" @search="onUnitSearch" @confirm="onUnitConfirm"></u-select>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -56,6 +61,7 @@ import addBtn from '@/components/addBtn/addBtn.vue';
|
|||||||
import ProcessOutItem from '@/components/card/storeGoodsProcessOutItem.vue';
|
import ProcessOutItem from '@/components/card/storeGoodsProcessOutItem.vue';
|
||||||
import {
|
import {
|
||||||
getStatusOptions,
|
getStatusOptions,
|
||||||
|
AUDIT_STATUS,
|
||||||
AUDIT_STATUS_MAP,
|
AUDIT_STATUS_MAP,
|
||||||
BUSINESS_UNIT_TYPE_PROCESS,
|
BUSINESS_UNIT_TYPE_PROCESS,
|
||||||
WAREHOUSE_TYPE_FINISHED,
|
WAREHOUSE_TYPE_FINISHED,
|
||||||
@@ -63,9 +69,12 @@ import {
|
|||||||
mapToSelectOptions,
|
mapToSelectOptions,
|
||||||
fetchAllOrderList,
|
fetchAllOrderList,
|
||||||
} from '@/common/storeGoodsProcessOut';
|
} from '@/common/storeGoodsProcessOut';
|
||||||
|
import { withNameParam } from '@/common/remoteSelect';
|
||||||
|
import listFilterMixin from '@/mixins/listFilterMixin';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { addBtn, ProcessOutItem },
|
components: { addBtn, ProcessOutItem },
|
||||||
|
mixins: [listFilterMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
list: [],
|
list: [],
|
||||||
@@ -79,13 +88,17 @@ export default {
|
|||||||
processUnitOptions: [],
|
processUnitOptions: [],
|
||||||
warehouseOptions: [],
|
warehouseOptions: [],
|
||||||
unitOptionsLoading: false,
|
unitOptionsLoading: false,
|
||||||
|
selectSearching: false,
|
||||||
|
unitSearchSeq: 0,
|
||||||
|
unitSelectList: [{ value: '', label: '全部' }],
|
||||||
|
filterStorageKey: 'storeGoodsProcessOutListFilters_v2',
|
||||||
filters: {
|
filters: {
|
||||||
order_no: '',
|
order_no: '',
|
||||||
process_unit_id: '',
|
process_unit_id: '',
|
||||||
process_name: '',
|
process_name: '',
|
||||||
warehouse_id: '',
|
warehouse_id: '',
|
||||||
warehouse_name: '',
|
warehouse_name: '',
|
||||||
audit_status: '',
|
audit_status: AUDIT_STATUS.PENDING,
|
||||||
},
|
},
|
||||||
statusSelectList: [
|
statusSelectList: [
|
||||||
{ value: '', label: '全部' },
|
{ value: '', label: '全部' },
|
||||||
@@ -104,13 +117,10 @@ export default {
|
|||||||
warehouseLabel() {
|
warehouseLabel() {
|
||||||
return this.filters.warehouse_name || '';
|
return this.filters.warehouse_name || '';
|
||||||
},
|
},
|
||||||
unitSelectList() {
|
|
||||||
const options = this.unitSelectType === 'warehouse' ? this.warehouseOptions : this.processUnitOptions;
|
|
||||||
return [{ value: '', label: '全部' }, ...options];
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
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`;
|
||||||
@@ -121,6 +131,16 @@ export default {
|
|||||||
this.loadList();
|
this.loadList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
createDefaultFilters() {
|
||||||
|
return {
|
||||||
|
order_no: '',
|
||||||
|
process_unit_id: '',
|
||||||
|
process_name: '',
|
||||||
|
warehouse_id: '',
|
||||||
|
warehouse_name: '',
|
||||||
|
audit_status: AUDIT_STATUS.PENDING,
|
||||||
|
};
|
||||||
|
},
|
||||||
loadProcessUnitOptions() {
|
loadProcessUnitOptions() {
|
||||||
if (this.processUnitOptions.length) return Promise.resolve(this.processUnitOptions);
|
if (this.processUnitOptions.length) return Promise.resolve(this.processUnitOptions);
|
||||||
return this.$u.api.businessUnit.list({ unit_type_id: BUSINESS_UNIT_TYPE_PROCESS })
|
return this.$u.api.businessUnit.list({ unit_type_id: BUSINESS_UNIT_TYPE_PROCESS })
|
||||||
@@ -146,20 +166,34 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
openUnitSelect(type) {
|
openUnitSelect(type) {
|
||||||
if (this.unitOptionsLoading) return;
|
|
||||||
this.unitOptionsLoading = true;
|
|
||||||
const loadFn = type === 'warehouse' ? this.loadWarehouseOptions : this.loadProcessUnitOptions;
|
|
||||||
loadFn.call(this)
|
|
||||||
.then((list) => {
|
|
||||||
if (!list.length) {
|
|
||||||
uni.showToast({ title: '暂无可选数据', icon: 'none' });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.unitSelectType = type;
|
this.unitSelectType = type;
|
||||||
|
const cache = type === 'warehouse' ? this.warehouseOptions : this.processUnitOptions;
|
||||||
|
this.applyUnitSelectList(cache);
|
||||||
this.unitSelectShow = true;
|
this.unitSelectShow = true;
|
||||||
})
|
},
|
||||||
.finally(() => {
|
onUnitSearch(keyword) {
|
||||||
this.unitOptionsLoading = false;
|
const seq = ++this.unitSearchSeq;
|
||||||
|
const type = this.unitSelectType;
|
||||||
|
const empty = !String(keyword || '').trim();
|
||||||
|
this.selectSearching = true;
|
||||||
|
const req = type === 'warehouse'
|
||||||
|
? this.$u.api.physicalWarehouse.getDropdownList(withNameParam({ warehouse_type_id: WAREHOUSE_TYPE_FINISHED }, keyword))
|
||||||
|
: this.$u.api.businessUnit.list(withNameParam({ unit_type_id: BUSINESS_UNIT_TYPE_PROCESS }, keyword));
|
||||||
|
req.then((res) => {
|
||||||
|
if (seq !== this.unitSearchSeq) return;
|
||||||
|
const list = mapToSelectOptions(res);
|
||||||
|
if (empty) {
|
||||||
|
if (type === 'warehouse') this.warehouseOptions = list;
|
||||||
|
else this.processUnitOptions = list;
|
||||||
|
}
|
||||||
|
this.applyUnitSelectList(list, empty);
|
||||||
|
}).catch((e) => {
|
||||||
|
if (seq !== this.unitSearchSeq) return;
|
||||||
|
uni.showToast({ title: (e && e.message) || '搜索失败', icon: 'none' });
|
||||||
|
}).then(() => {
|
||||||
|
if (seq === this.unitSearchSeq) this.selectSearching = false;
|
||||||
|
}, () => {
|
||||||
|
if (seq === this.unitSearchSeq) this.selectSearching = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
openProcessUnitSelect() {
|
openProcessUnitSelect() {
|
||||||
@@ -181,12 +215,13 @@ export default {
|
|||||||
loadList() {
|
loadList() {
|
||||||
if (this.listLoading) return;
|
if (this.listLoading) return;
|
||||||
this.listLoading = true;
|
this.listLoading = true;
|
||||||
|
const filters = this.appliedFilters || this.filters;
|
||||||
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.process_unit_id) params.process_unit_id = this.filters.process_unit_id;
|
if (filters.process_unit_id) params.process_unit_id = filters.process_unit_id;
|
||||||
if (this.filters.warehouse_id) params.warehouse_id = this.filters.warehouse_id;
|
if (filters.warehouse_id) params.warehouse_id = filters.warehouse_id;
|
||||||
if (this.filters.audit_status !== '' && this.filters.audit_status !== null) {
|
if (this.hasFilterValue(filters.audit_status)) {
|
||||||
params.audit_status = this.filters.audit_status;
|
params.audit_status = filters.audit_status;
|
||||||
}
|
}
|
||||||
fetchAllOrderList((p) => this.$u.api.fpmProcessOutOrder.list(p), params)
|
fetchAllOrderList((p) => this.$u.api.fpmProcessOutOrder.list(p), params)
|
||||||
.then((rows) => {
|
.then((rows) => {
|
||||||
@@ -233,33 +268,10 @@ export default {
|
|||||||
uni.navigateTo({ url: `./${page}?id=${item.id}` });
|
uni.navigateTo({ url: `./${page}?id=${item.id}` });
|
||||||
},
|
},
|
||||||
openStatusSelect() { this.statusSelectShow = true; },
|
openStatusSelect() { this.statusSelectShow = true; },
|
||||||
onStatusConfirm(e) { this.filters.audit_status = e[0].value; },
|
|
||||||
resetFilter() {
|
|
||||||
this.filters = {
|
|
||||||
order_no: '',
|
|
||||||
process_unit_id: '',
|
|
||||||
process_name: '',
|
|
||||||
warehouse_id: '',
|
|
||||||
warehouse_name: '',
|
|
||||||
audit_status: '',
|
|
||||||
};
|
|
||||||
},
|
|
||||||
applyFilter() {
|
|
||||||
this.filterShow = false;
|
|
||||||
this.loadList();
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style lang="scss">
|
||||||
page { background-color: #F8F8F8; }
|
@import '@/common/list-filter.scss';
|
||||||
.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; }
|
|
||||||
.filterPanel { padding: 30rpx; }
|
|
||||||
.filterTitle { font-size: 32rpx; font-weight: bold; margin-bottom: 30rpx; }
|
|
||||||
.filterItem { margin-bottom: 24rpx; }
|
|
||||||
.filterLabel { display: block; font-size: 28rpx; color: #666; margin-bottom: 12rpx; }
|
|
||||||
.filterValue { display: flex; align-items: center; justify-content: space-between; padding: 16rpx; background: #f5f5f5; border-radius: 8rpx; font-size: 28rpx; }
|
|
||||||
.filterActions { display: flex; gap: 20rpx; margin-top: 40rpx; }
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -7,6 +7,9 @@
|
|||||||
*/
|
*/
|
||||||
import util from '@/common/util';
|
import util from '@/common/util';
|
||||||
import scanMixin from '@/common/scanMixin.js';
|
import scanMixin from '@/common/scanMixin.js';
|
||||||
|
import PlusBarcodePanel from '@/components/common/PlusBarcodePanel.vue';
|
||||||
|
import remoteSelectMixin from '@/common/remoteSelectMixin.js';
|
||||||
|
import { withNameParam } from '@/common/remoteSelect';
|
||||||
import { initTts, speak } from '@/common/tts.js';
|
import { initTts, speak } from '@/common/tts.js';
|
||||||
import {
|
import {
|
||||||
AUDIT_STATUS_MAP,
|
AUDIT_STATUS_MAP,
|
||||||
@@ -32,13 +35,15 @@ import {
|
|||||||
} from '@/common/storeGoodsProcessOut';
|
} from '@/common/storeGoodsProcessOut';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [scanMixin],
|
components: { PlusBarcodePanel },
|
||||||
|
mixins: [scanMixin, remoteSelectMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
pageMode: 'add',
|
pageMode: 'add',
|
||||||
orderId: 0,
|
orderId: 0,
|
||||||
form: this.getEmptyForm(),
|
form: this.getEmptyForm(),
|
||||||
headerSaved: false,
|
headerSaved: false,
|
||||||
|
headerCollapsed: false,
|
||||||
selectShow: false,
|
selectShow: false,
|
||||||
selectList: [],
|
selectList: [],
|
||||||
selectType: '',
|
selectType: '',
|
||||||
@@ -111,10 +116,15 @@ export default {
|
|||||||
this.showError('请先提交保存后再扫码');
|
this.showError('请先提交保存后再扫码');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.phoneContinuousScan = true;
|
this.phoneContinuousScan = false;
|
||||||
this.openContinuousPhoneScan();
|
this.togglePhoneScanPanel();
|
||||||
|
},
|
||||||
|
onPlusBarcodeSuccess(scanResult) {
|
||||||
|
this.QRBarCode = String(scanResult || '').trim().replace(/[\r\n]/g, '');
|
||||||
|
this.$nextTick(() => this.handleScan());
|
||||||
},
|
},
|
||||||
openContinuousPhoneScan() {
|
openContinuousPhoneScan() {
|
||||||
|
if (this.phoneScanPanelOpen) return;
|
||||||
if (!this.phoneContinuousScan || !this.canScanQr || !this.isPageActive) {
|
if (!this.phoneContinuousScan || !this.canScanQr || !this.isPageActive) {
|
||||||
this.phoneContinuousScan = false;
|
this.phoneContinuousScan = false;
|
||||||
return;
|
return;
|
||||||
@@ -130,6 +140,7 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
scheduleNextPhoneScan() {
|
scheduleNextPhoneScan() {
|
||||||
|
if (this.phoneScanPanelOpen) return;
|
||||||
if (!this.phoneContinuousScan || !this.canScanQr || !this.isPageActive) {
|
if (!this.phoneContinuousScan || !this.canScanQr || !this.isPageActive) {
|
||||||
this.phoneContinuousScan = false;
|
this.phoneContinuousScan = false;
|
||||||
return;
|
return;
|
||||||
@@ -150,6 +161,7 @@ export default {
|
|||||||
const nextCanScan = this.isEditable && canScanAtStatus(status);
|
const nextCanScan = this.isEditable && canScanAtStatus(status);
|
||||||
if (this.canScan && !nextCanScan) {
|
if (this.canScan && !nextCanScan) {
|
||||||
this.phoneContinuousScan = false;
|
this.phoneContinuousScan = false;
|
||||||
|
this.closePhoneScanPanel();
|
||||||
this.unregisterScanBroadcast();
|
this.unregisterScanBroadcast();
|
||||||
}
|
}
|
||||||
this.canScan = nextCanScan;
|
this.canScan = nextCanScan;
|
||||||
@@ -211,6 +223,26 @@ export default {
|
|||||||
return this.warehouseOptions;
|
return this.warehouseOptions;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
fetchRemoteSelectOptions(type, keyword) {
|
||||||
|
const empty = !String(keyword || '').trim();
|
||||||
|
if (type === '加工单位') {
|
||||||
|
return this.$u.api.businessUnit.list(withNameParam({ unit_type_id: BUSINESS_UNIT_TYPE_PROCESS }, keyword))
|
||||||
|
.then((res) => {
|
||||||
|
const list = mapToSelectOptions(res);
|
||||||
|
if (empty) this.processUnitOptions = list;
|
||||||
|
return list;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (type === '仓库名称') {
|
||||||
|
return this.$u.api.physicalWarehouse.getDropdownList(withNameParam({ warehouse_type_id: WAREHOUSE_TYPE_FINISHED }, keyword))
|
||||||
|
.then((res) => {
|
||||||
|
const list = mapToSelectOptions(res);
|
||||||
|
if (empty) this.warehouseOptions = list;
|
||||||
|
return list;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return Promise.resolve([]);
|
||||||
|
},
|
||||||
applyDefaultWarehouse() {
|
applyDefaultWarehouse() {
|
||||||
const app = getApp();
|
const app = getApp();
|
||||||
const picked = pickDefaultWarehouse(
|
const picked = pickDefaultWarehouse(
|
||||||
@@ -252,6 +284,7 @@ export default {
|
|||||||
this.orderId = order.id;
|
this.orderId = order.id;
|
||||||
this.auditStatus = order.audit_status;
|
this.auditStatus = order.audit_status;
|
||||||
this.headerSaved = true;
|
this.headerSaved = true;
|
||||||
|
this.headerCollapsed = true;
|
||||||
this.form = orderToFormFields(order);
|
this.form = orderToFormFields(order);
|
||||||
this.syncCanScanFromStatus(order.audit_status);
|
this.syncCanScanFromStatus(order.audit_status);
|
||||||
if (this.canScan) this.registerOrderScanBroadcast();
|
if (this.canScan) this.registerOrderScanBroadcast();
|
||||||
@@ -264,6 +297,7 @@ export default {
|
|||||||
},
|
},
|
||||||
pickerSelectFun(type) {
|
pickerSelectFun(type) {
|
||||||
if (!this.headerEditable) return;
|
if (!this.headerEditable) return;
|
||||||
|
if (type === '出仓类型') {
|
||||||
this.selectType = type;
|
this.selectType = type;
|
||||||
const openPicker = (list) => {
|
const openPicker = (list) => {
|
||||||
if (!list.length) {
|
if (!list.length) {
|
||||||
@@ -273,19 +307,16 @@ export default {
|
|||||||
this.selectList = list;
|
this.selectList = list;
|
||||||
this.selectShow = true;
|
this.selectShow = true;
|
||||||
};
|
};
|
||||||
if (type === '出仓类型') {
|
|
||||||
this.ensureOutOrderTypeOptions()
|
this.ensureOutOrderTypeOptions()
|
||||||
.then(openPicker)
|
.then(openPicker)
|
||||||
.catch((e) => this.showError(e.message || '加载出仓类型失败'));
|
.catch((e) => this.showError(e.message || '加载出仓类型失败'));
|
||||||
} else if (type === '加工单位') {
|
return;
|
||||||
this.ensureProcessUnitOptions()
|
|
||||||
.then(openPicker)
|
|
||||||
.catch((e) => this.showError(e.message || '加载加工单位失败'));
|
|
||||||
} else if (type === '仓库名称') {
|
|
||||||
this.ensureWarehouseOptions()
|
|
||||||
.then(openPicker)
|
|
||||||
.catch((e) => this.showError(e.message || '加载仓库失败'));
|
|
||||||
}
|
}
|
||||||
|
const cache = {
|
||||||
|
'加工单位': this.processUnitOptions,
|
||||||
|
'仓库名称': this.warehouseOptions,
|
||||||
|
};
|
||||||
|
if (cache[type]) this.openSelectPicker(type, cache[type]);
|
||||||
},
|
},
|
||||||
selectConfirmFun(e) {
|
selectConfirmFun(e) {
|
||||||
const item = e[0];
|
const item = e[0];
|
||||||
@@ -346,8 +377,9 @@ export default {
|
|||||||
const order = normalizeOrder(detail);
|
const order = normalizeOrder(detail);
|
||||||
this.applyOrder(order);
|
this.applyOrder(order);
|
||||||
this.headerSaved = true;
|
this.headerSaved = true;
|
||||||
|
this.headerCollapsed = true;
|
||||||
this.syncCanScanFromStatus(order.audit_status);
|
this.syncCanScanFromStatus(order.audit_status);
|
||||||
this.showSuccess('保存成功,请开始扫码');
|
this.showSuccess('保存成功,请开始扫码', '保存成功', { voiceOnly: true });
|
||||||
this.registerOrderScanBroadcast();
|
this.registerOrderScanBroadcast();
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
@@ -433,6 +465,12 @@ export default {
|
|||||||
if (order) {
|
if (order) {
|
||||||
this.form.item_data = order.item_data;
|
this.form.item_data = order.item_data;
|
||||||
this.auditStatus = order.audit_status;
|
this.auditStatus = order.audit_status;
|
||||||
|
// 本单匹数/本单数量:取这张单的总匹数、总数量
|
||||||
|
this.scanDetail = {
|
||||||
|
...this.scanDetail,
|
||||||
|
order_roll: order.total_roll,
|
||||||
|
order_weight: order.total_weight,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(() => null);
|
.catch(() => null);
|
||||||
@@ -445,7 +483,8 @@ export default {
|
|||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
this.phoneContinuousScan = false;
|
this.phoneContinuousScan = false;
|
||||||
const message = e.message || (isDelete ? '删除失败' : '扫码失败');
|
const message = e.message || (isDelete ? '删除失败' : '扫码失败');
|
||||||
this.showError(message);
|
speak(isDelete ? '删除失败' : '扫码失败');
|
||||||
|
uni.showToast({ title: message, icon: 'none', duration: 2500 });
|
||||||
this.QRBarCode = '';
|
this.QRBarCode = '';
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -460,16 +499,16 @@ 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('操作成功');
|
this.showSuccess(util.statusSuccessVoice(action));
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
showError(message) {
|
showError(message) {
|
||||||
util.playErrorAudio();
|
util.playErrorAudio(message);
|
||||||
uni.showModal({ title: '提示', content: message, showCancel: false });
|
uni.showModal({ title: '提示', content: message, showCancel: false });
|
||||||
},
|
},
|
||||||
showSuccess(message) {
|
showSuccess(message, voiceText, options) {
|
||||||
util.playSuccessAudio();
|
util.playSuccessAudio(voiceText || message, options);
|
||||||
uni.showToast({ title: message, icon: 'success' });
|
uni.showToast({ title: message, icon: 'success' });
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,11 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="fabric-out-page">
|
<view class="fabric-out-page">
|
||||||
|
<OrderHeaderFold v-model="headerCollapsed" :summary="order.order_no">
|
||||||
<OrderStatusBar class="fabric-out-mt32" :status="order.audit_status" :name="order.audit_status_name" />
|
<OrderStatusBar class="fabric-out-mt32" :status="order.audit_status" :name="order.audit_status_name" />
|
||||||
|
|
||||||
<view class="flex-white-plr26 ptb10 bdb_f5">
|
|
||||||
<text class="mr26">出仓单号</text>
|
|
||||||
<text>{{ order.order_no }}</text>
|
|
||||||
</view>
|
|
||||||
<view class="flex-white-plr26 ptb20 bdb_f5">
|
<view class="flex-white-plr26 ptb20 bdb_f5">
|
||||||
<text class="mr26">出仓类型</text>
|
<text class="mr26">出仓类型</text>
|
||||||
<text>{{ order.out_order_type_name || '正常加工出仓' }}</text>
|
<text>{{ order.out_order_type_name || '正常加工出仓' }}</text>
|
||||||
@@ -30,6 +26,7 @@
|
|||||||
<text class="mr26">审核人</text>
|
<text class="mr26">审核人</text>
|
||||||
<text>{{ order.auditor_name }} {{ formatTime(order.audit_time, 'YYYY-MM-DD') }}</text>
|
<text>{{ order.auditor_name }} {{ formatTime(order.audit_time, 'YYYY-MM-DD') }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
</OrderHeaderFold>
|
||||||
|
|
||||||
<ProcessOutDetailList
|
<ProcessOutDetailList
|
||||||
:title="detailTitle"
|
:title="detailTitle"
|
||||||
@@ -43,6 +40,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import util from '@/common/util';
|
import util from '@/common/util';
|
||||||
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
|
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
|
||||||
|
import OrderHeaderFold from '@/components/storefabric/OrderHeaderFold.vue';
|
||||||
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
||||||
import ProcessOutDetailList from '@/components/storegoods/ProcessOutDetailList.vue';
|
import ProcessOutDetailList from '@/components/storegoods/ProcessOutDetailList.vue';
|
||||||
import {
|
import {
|
||||||
@@ -53,10 +51,11 @@ import {
|
|||||||
} from '@/common/storeGoodsProcessOut';
|
} from '@/common/storeGoodsProcessOut';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { OrderStatusBar, FabricOutFooter, ProcessOutDetailList },
|
components: { OrderStatusBar, OrderHeaderFold, FabricOutFooter, ProcessOutDetailList },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
orderId: 0,
|
orderId: 0,
|
||||||
|
headerCollapsed: true,
|
||||||
order: { item_data: [] },
|
order: { item_data: [] },
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -102,18 +101,25 @@ export default {
|
|||||||
confirmOrderStatusAction(this, {
|
confirmOrderStatusAction(this, {
|
||||||
orderId: this.orderId,
|
orderId: this.orderId,
|
||||||
action,
|
action,
|
||||||
onSuccess: () => this.$u.api.fpmProcessOutOrder.detail({ id: this.orderId })
|
onSuccess: () => {
|
||||||
.then((res) => {
|
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
|
const voice = util.statusSuccessVoice(action);
|
||||||
|
util.playSuccessAudio(voice);
|
||||||
|
uni.showToast({ title: voice, icon: 'success' });
|
||||||
|
if (action === 'unapprove') {
|
||||||
|
uni.redirectTo({ url: `./storeGoodsProcessOutEdit?id=${this.orderId}` });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return this.$u.api.fpmProcessOutOrder.detail({ id: this.orderId })
|
||||||
|
.then((res) => {
|
||||||
const order = normalizeOrder(res);
|
const order = normalizeOrder(res);
|
||||||
if (order) this.order = order;
|
if (order) this.order = order;
|
||||||
util.playSuccessAudio();
|
});
|
||||||
uni.showToast({ title: '操作成功', icon: 'success' });
|
},
|
||||||
}),
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
showError(message) {
|
showError(message) {
|
||||||
util.playErrorAudio();
|
util.playErrorAudio(message);
|
||||||
uni.showModal({ title: '提示', content: message, showCancel: false });
|
uni.showModal({ title: '提示', content: message, showCancel: false });
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,11 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="fabric-out-page">
|
<view class="fabric-out-page">
|
||||||
|
<OrderHeaderFold v-model="headerCollapsed" :summary="form.order_no || '保存后自动生成'">
|
||||||
<OrderStatusBar class="fabric-out-mt32" :status="displayAuditStatus" :name="displayAuditStatusName" />
|
<OrderStatusBar class="fabric-out-mt32" :status="displayAuditStatus" :name="displayAuditStatusName" />
|
||||||
|
|
||||||
<view class="flex-white-plr26 ptb10 bdb_f5">
|
|
||||||
<text class="mr26">进仓单号</text>
|
|
||||||
<u-input disabled placeholder="保存后自动生成" v-model="form.order_no" />
|
|
||||||
</view>
|
|
||||||
<view class="flex-white-plr26 ptb20 bdb_f5">
|
<view class="flex-white-plr26 ptb20 bdb_f5">
|
||||||
<text class="mr26">进仓类型</text>
|
<text class="mr26">进仓类型</text>
|
||||||
<view>加工退货进仓单</view>
|
<view>加工退货进仓单</view>
|
||||||
@@ -28,13 +24,21 @@
|
|||||||
<view style="margin-bottom: 8rpx;"><text>单据备注</text></view>
|
<view style="margin-bottom: 8rpx;"><text>单据备注</text></view>
|
||||||
<u-input v-model="form.remark" :disabled="!headerEditable" type="textarea" :border="true" :height="100" :auto-height="true" />
|
<u-input v-model="form.remark" :disabled="!headerEditable" type="textarea" :border="true" :height="100" :auto-height="true" />
|
||||||
</view>
|
</view>
|
||||||
|
</OrderHeaderFold>
|
||||||
|
|
||||||
|
<PlusBarcodePanel
|
||||||
|
:visible.sync="phoneScanPanelOpen"
|
||||||
|
:hint-text="phoneScanHint"
|
||||||
|
:scan-time-space="1200"
|
||||||
|
@success="onPlusBarcodeSuccess"
|
||||||
|
/>
|
||||||
<ProcessInBinBar
|
<ProcessInBinBar
|
||||||
:can-scan="canScan"
|
:can-scan="canScan"
|
||||||
:bin-id="warehouseBinId"
|
:bin-id="warehouseBinId"
|
||||||
:code="warehouseBinCode"
|
:code="warehouseBinCode"
|
||||||
:name="warehouseBinName"
|
:name="warehouseBinName"
|
||||||
:show-phone-scan="canScan"
|
:show-phone-scan="canScan"
|
||||||
|
:scanning="phoneScanPanelOpen && phoneScanTarget === 'bin'"
|
||||||
@code-input="warehouseBinCode = $event"
|
@code-input="warehouseBinCode = $event"
|
||||||
@confirm="resolveWarehouseBin"
|
@confirm="resolveWarehouseBin"
|
||||||
@phone-scan="handleBinPhoneScan"
|
@phone-scan="handleBinPhoneScan"
|
||||||
@@ -47,6 +51,7 @@
|
|||||||
:message="BillDataMessage"
|
:message="BillDataMessage"
|
||||||
:disabled-tip="qrDisabledTip"
|
:disabled-tip="qrDisabledTip"
|
||||||
:show-phone-scan="canScanQr"
|
:show-phone-scan="canScanQr"
|
||||||
|
:scanning="phoneScanPanelOpen && phoneScanTarget === 'qr'"
|
||||||
@input="QRBarCode = $event"
|
@input="QRBarCode = $event"
|
||||||
@scan="handleScan"
|
@scan="handleScan"
|
||||||
@phone-scan="handlePhoneScan"
|
@phone-scan="handlePhoneScan"
|
||||||
@@ -72,22 +77,26 @@
|
|||||||
@action="handleStatusAction"
|
@action="handleStatusAction"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<u-select v-model="selectShow" :list="selectList" @confirm="selectConfirmFun"></u-select>
|
<u-select v-model="selectShow" :list="selectList" :remote="isRemoteSelect" :loading="selectSearching" @search="onSelectSearch" @confirm="selectConfirmFun"></u-select>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import formMixin from './storeGoodsProcessReturnInMixin.js';
|
import formMixin from './storeGoodsProcessReturnInMixin.js';
|
||||||
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
|
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
|
||||||
|
import OrderHeaderFold from '@/components/storefabric/OrderHeaderFold.vue';
|
||||||
import FabricOutScanBar from '@/components/storefabric/FabricOutScanBar.vue';
|
import FabricOutScanBar from '@/components/storefabric/FabricOutScanBar.vue';
|
||||||
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
||||||
import ProcessInScanDetail from '@/components/storegoods/ProcessInScanDetail.vue';
|
import ProcessInScanDetail from '@/components/storegoods/ProcessInScanDetail.vue';
|
||||||
import ProcessInDetailList from '@/components/storegoods/ProcessInDetailList.vue';
|
import ProcessInDetailList from '@/components/storegoods/ProcessInDetailList.vue';
|
||||||
import ProcessInBinBar from '@/components/storegoods/ProcessInBinBar.vue';
|
import ProcessInBinBar from '@/components/storegoods/ProcessInBinBar.vue';
|
||||||
|
import PlusBarcodePanel from '@/components/common/PlusBarcodePanel.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
PlusBarcodePanel,
|
||||||
OrderStatusBar,
|
OrderStatusBar,
|
||||||
|
OrderHeaderFold,
|
||||||
FabricOutScanBar,
|
FabricOutScanBar,
|
||||||
FabricOutFooter,
|
FabricOutFooter,
|
||||||
ProcessInScanDetail,
|
ProcessInScanDetail,
|
||||||
|
|||||||
@@ -1,11 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="fabric-out-page">
|
<view class="fabric-out-page">
|
||||||
|
<OrderHeaderFold v-model="headerCollapsed" :summary="form.order_no">
|
||||||
<OrderStatusBar class="fabric-out-mt32" :status="displayAuditStatus" :name="displayAuditStatusName" />
|
<OrderStatusBar class="fabric-out-mt32" :status="displayAuditStatus" :name="displayAuditStatusName" />
|
||||||
|
|
||||||
<view class="flex-white-plr26 ptb10 bdb_f5">
|
|
||||||
<text class="mr26">进仓单号</text>
|
|
||||||
<text>{{ form.order_no }}</text>
|
|
||||||
</view>
|
|
||||||
<view class="flex-white-plr26 ptb20 bdb_f5">
|
<view class="flex-white-plr26 ptb20 bdb_f5">
|
||||||
<text class="mr26">进仓类型</text>
|
<text class="mr26">进仓类型</text>
|
||||||
<text>加工退货进仓单</text>
|
<text>加工退货进仓单</text>
|
||||||
@@ -22,13 +18,21 @@
|
|||||||
<text class="mr26">单据备注</text>
|
<text class="mr26">单据备注</text>
|
||||||
<text>{{ form.remark || '-' }}</text>
|
<text>{{ form.remark || '-' }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
</OrderHeaderFold>
|
||||||
|
|
||||||
|
<PlusBarcodePanel
|
||||||
|
:visible.sync="phoneScanPanelOpen"
|
||||||
|
:hint-text="phoneScanHint"
|
||||||
|
:scan-time-space="1200"
|
||||||
|
@success="onPlusBarcodeSuccess"
|
||||||
|
/>
|
||||||
<ProcessInBinBar
|
<ProcessInBinBar
|
||||||
:can-scan="canScan"
|
:can-scan="canScan"
|
||||||
:bin-id="warehouseBinId"
|
:bin-id="warehouseBinId"
|
||||||
:code="warehouseBinCode"
|
:code="warehouseBinCode"
|
||||||
:name="warehouseBinName"
|
:name="warehouseBinName"
|
||||||
:show-phone-scan="canScan"
|
:show-phone-scan="canScan"
|
||||||
|
:scanning="phoneScanPanelOpen && phoneScanTarget === 'bin'"
|
||||||
@code-input="warehouseBinCode = $event"
|
@code-input="warehouseBinCode = $event"
|
||||||
@confirm="resolveWarehouseBin"
|
@confirm="resolveWarehouseBin"
|
||||||
@phone-scan="handleBinPhoneScan"
|
@phone-scan="handleBinPhoneScan"
|
||||||
@@ -41,6 +45,7 @@
|
|||||||
:message="BillDataMessage"
|
:message="BillDataMessage"
|
||||||
:disabled-tip="qrDisabledTip"
|
:disabled-tip="qrDisabledTip"
|
||||||
:show-phone-scan="canScanQr"
|
:show-phone-scan="canScanQr"
|
||||||
|
:scanning="phoneScanPanelOpen && phoneScanTarget === 'qr'"
|
||||||
@input="QRBarCode = $event"
|
@input="QRBarCode = $event"
|
||||||
@scan="handleScan"
|
@scan="handleScan"
|
||||||
@phone-scan="handlePhoneScan"
|
@phone-scan="handlePhoneScan"
|
||||||
@@ -56,22 +61,26 @@
|
|||||||
|
|
||||||
<FabricOutFooter :buttons="statusActionButtons" @action="handleStatusAction" />
|
<FabricOutFooter :buttons="statusActionButtons" @action="handleStatusAction" />
|
||||||
|
|
||||||
<u-select v-model="selectShow" :list="selectList" @confirm="selectConfirmFun"></u-select>
|
<u-select v-model="selectShow" :list="selectList" :remote="isRemoteSelect" :loading="selectSearching" @search="onSelectSearch" @confirm="selectConfirmFun"></u-select>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import formMixin from './storeGoodsProcessReturnInMixin.js';
|
import formMixin from './storeGoodsProcessReturnInMixin.js';
|
||||||
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
|
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
|
||||||
|
import OrderHeaderFold from '@/components/storefabric/OrderHeaderFold.vue';
|
||||||
import FabricOutScanBar from '@/components/storefabric/FabricOutScanBar.vue';
|
import FabricOutScanBar from '@/components/storefabric/FabricOutScanBar.vue';
|
||||||
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
||||||
import ProcessInScanDetail from '@/components/storegoods/ProcessInScanDetail.vue';
|
import ProcessInScanDetail from '@/components/storegoods/ProcessInScanDetail.vue';
|
||||||
import ProcessInDetailList from '@/components/storegoods/ProcessInDetailList.vue';
|
import ProcessInDetailList from '@/components/storegoods/ProcessInDetailList.vue';
|
||||||
import ProcessInBinBar from '@/components/storegoods/ProcessInBinBar.vue';
|
import ProcessInBinBar from '@/components/storegoods/ProcessInBinBar.vue';
|
||||||
|
import PlusBarcodePanel from '@/components/common/PlusBarcodePanel.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
PlusBarcodePanel,
|
||||||
OrderStatusBar,
|
OrderStatusBar,
|
||||||
|
OrderHeaderFold,
|
||||||
FabricOutScanBar,
|
FabricOutScanBar,
|
||||||
FabricOutFooter,
|
FabricOutFooter,
|
||||||
ProcessInScanDetail,
|
ProcessInScanDetail,
|
||||||
@@ -79,6 +88,11 @@ export default {
|
|||||||
ProcessInBinBar,
|
ProcessInBinBar,
|
||||||
},
|
},
|
||||||
mixins: [formMixin],
|
mixins: [formMixin],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
headerCollapsed: true,
|
||||||
|
};
|
||||||
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
uni.setNavigationBarTitle({ title: '编辑加工退货进仓单' });
|
uni.setNavigationBarTitle({ title: '编辑加工退货进仓单' });
|
||||||
this.pageMode = 'edit';
|
this.pageMode = 'edit';
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
<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 v-model="filters.order_no" placeholder="进仓单号" :show-action="false" @search="applySearch" @custom="applySearch" @clear="applySearch" />
|
||||||
<view class="filterBtn" @click="filterShow = true">
|
<view class="filterBtn" :class="{ 'filter-active': hasActiveFilter }" @click="filterShow = true">
|
||||||
<u-icon name="list" size="40" color="#666"></u-icon>
|
<view class="filterBtn__icon">
|
||||||
|
<u-icon :key="filterIconColor" name="list" size="44" :color="filterIconColor"></u-icon>
|
||||||
|
<view v-if="hasActiveFilter" class="filterBtn__badge"></view>
|
||||||
|
</view>
|
||||||
<text>筛选</text>
|
<text>筛选</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -20,24 +23,26 @@
|
|||||||
|
|
||||||
<addBtn url="./storeGoodsProcessReturnInAdd"></addBtn>
|
<addBtn url="./storeGoodsProcessReturnInAdd"></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" @click="openProcessUnitSelect">
|
<view class="filterItem" @click="openProcessUnitSelect">
|
||||||
<text class="filterLabel">加工单位</text>
|
<text class="filterLabel">加工单位</text>
|
||||||
<view class="filterValue">{{ processUnitLabel || '全部' }} <u-icon name="arrow-right" size="28"></u-icon></view>
|
<view class="filterValue">{{ processUnitLabel || '全部' }} <u-icon name="arrow-right" size="36"></u-icon></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="filterItem" @click="openWarehouseSelect">
|
<view class="filterItem" @click="openWarehouseSelect">
|
||||||
<text class="filterLabel">仓库</text>
|
<text class="filterLabel">仓库</text>
|
||||||
<view class="filterValue">{{ warehouseLabel || '全部' }} <u-icon name="arrow-right" size="28"></u-icon></view>
|
<view class="filterValue">{{ warehouseLabel || '全部' }} <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>
|
||||||
@@ -46,8 +51,8 @@
|
|||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
|
|
||||||
<u-select v-model="statusSelectShow" :list="statusSelectList" @confirm="onStatusConfirm"></u-select>
|
<u-select class="pdaSelect" v-model="statusSelectShow" title="选择订单状态" :list="statusSelectList" :default-value="statusSelectDefault" @confirm="onStatusConfirm"></u-select>
|
||||||
<u-select v-model="unitSelectShow" :list="unitSelectList" @confirm="onUnitConfirm"></u-select>
|
<u-select class="pdaSelect" v-model="unitSelectShow" :list="unitSelectList" :default-value="unitSelectDefault" remote :loading="selectSearching" @search="onUnitSearch" @confirm="onUnitConfirm"></u-select>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -56,6 +61,7 @@ import addBtn from '@/components/addBtn/addBtn.vue';
|
|||||||
import ProcessReturnInItem from '@/components/card/storeGoodsProcessReturnInItem.vue';
|
import ProcessReturnInItem from '@/components/card/storeGoodsProcessReturnInItem.vue';
|
||||||
import {
|
import {
|
||||||
getStatusOptions,
|
getStatusOptions,
|
||||||
|
AUDIT_STATUS,
|
||||||
AUDIT_STATUS_MAP,
|
AUDIT_STATUS_MAP,
|
||||||
BUSINESS_UNIT_TYPE_PROCESS,
|
BUSINESS_UNIT_TYPE_PROCESS,
|
||||||
WAREHOUSE_TYPE_FINISHED,
|
WAREHOUSE_TYPE_FINISHED,
|
||||||
@@ -63,9 +69,12 @@ import {
|
|||||||
mapToSelectOptions,
|
mapToSelectOptions,
|
||||||
fetchAllOrderList,
|
fetchAllOrderList,
|
||||||
} from '@/common/storeGoodsProcessReturnIn';
|
} from '@/common/storeGoodsProcessReturnIn';
|
||||||
|
import { withNameParam } from '@/common/remoteSelect';
|
||||||
|
import listFilterMixin from '@/mixins/listFilterMixin';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { addBtn, ProcessReturnInItem },
|
components: { addBtn, ProcessReturnInItem },
|
||||||
|
mixins: [listFilterMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
list: [],
|
list: [],
|
||||||
@@ -79,13 +88,17 @@ export default {
|
|||||||
processUnitOptions: [],
|
processUnitOptions: [],
|
||||||
warehouseOptions: [],
|
warehouseOptions: [],
|
||||||
unitOptionsLoading: false,
|
unitOptionsLoading: false,
|
||||||
|
selectSearching: false,
|
||||||
|
unitSearchSeq: 0,
|
||||||
|
unitSelectList: [{ value: '', label: '全部' }],
|
||||||
|
filterStorageKey: 'storeGoodsProcessReturnInListFilters_v2',
|
||||||
filters: {
|
filters: {
|
||||||
order_no: '',
|
order_no: '',
|
||||||
process_unit_id: '',
|
process_unit_id: '',
|
||||||
process_name: '',
|
process_name: '',
|
||||||
warehouse_id: '',
|
warehouse_id: '',
|
||||||
warehouse_name: '',
|
warehouse_name: '',
|
||||||
audit_status: '',
|
audit_status: AUDIT_STATUS.PENDING,
|
||||||
},
|
},
|
||||||
statusSelectList: [
|
statusSelectList: [
|
||||||
{ value: '', label: '全部' },
|
{ value: '', label: '全部' },
|
||||||
@@ -104,13 +117,10 @@ export default {
|
|||||||
warehouseLabel() {
|
warehouseLabel() {
|
||||||
return this.filters.warehouse_name || '';
|
return this.filters.warehouse_name || '';
|
||||||
},
|
},
|
||||||
unitSelectList() {
|
|
||||||
const options = this.unitSelectType === 'warehouse' ? this.warehouseOptions : this.processUnitOptions;
|
|
||||||
return [{ value: '', label: '全部' }, ...options];
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
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`;
|
||||||
@@ -121,6 +131,16 @@ export default {
|
|||||||
this.loadList();
|
this.loadList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
createDefaultFilters() {
|
||||||
|
return {
|
||||||
|
order_no: '',
|
||||||
|
process_unit_id: '',
|
||||||
|
process_name: '',
|
||||||
|
warehouse_id: '',
|
||||||
|
warehouse_name: '',
|
||||||
|
audit_status: AUDIT_STATUS.PENDING,
|
||||||
|
};
|
||||||
|
},
|
||||||
loadProcessUnitOptions() {
|
loadProcessUnitOptions() {
|
||||||
if (this.processUnitOptions.length) return Promise.resolve(this.processUnitOptions);
|
if (this.processUnitOptions.length) return Promise.resolve(this.processUnitOptions);
|
||||||
return this.$u.api.businessUnit.list({ unit_type_id: BUSINESS_UNIT_TYPE_PROCESS })
|
return this.$u.api.businessUnit.list({ unit_type_id: BUSINESS_UNIT_TYPE_PROCESS })
|
||||||
@@ -146,20 +166,34 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
openUnitSelect(type) {
|
openUnitSelect(type) {
|
||||||
if (this.unitOptionsLoading) return;
|
|
||||||
this.unitOptionsLoading = true;
|
|
||||||
const loadFn = type === 'warehouse' ? this.loadWarehouseOptions : this.loadProcessUnitOptions;
|
|
||||||
loadFn.call(this)
|
|
||||||
.then((list) => {
|
|
||||||
if (!list.length) {
|
|
||||||
uni.showToast({ title: '暂无可选数据', icon: 'none' });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.unitSelectType = type;
|
this.unitSelectType = type;
|
||||||
|
const cache = type === 'warehouse' ? this.warehouseOptions : this.processUnitOptions;
|
||||||
|
this.applyUnitSelectList(cache);
|
||||||
this.unitSelectShow = true;
|
this.unitSelectShow = true;
|
||||||
})
|
},
|
||||||
.finally(() => {
|
onUnitSearch(keyword) {
|
||||||
this.unitOptionsLoading = false;
|
const seq = ++this.unitSearchSeq;
|
||||||
|
const type = this.unitSelectType;
|
||||||
|
const empty = !String(keyword || '').trim();
|
||||||
|
this.selectSearching = true;
|
||||||
|
const req = type === 'warehouse'
|
||||||
|
? this.$u.api.physicalWarehouse.getDropdownList(withNameParam({ warehouse_type_id: WAREHOUSE_TYPE_FINISHED }, keyword))
|
||||||
|
: this.$u.api.businessUnit.list(withNameParam({ unit_type_id: BUSINESS_UNIT_TYPE_PROCESS }, keyword));
|
||||||
|
req.then((res) => {
|
||||||
|
if (seq !== this.unitSearchSeq) return;
|
||||||
|
const list = mapToSelectOptions(res);
|
||||||
|
if (empty) {
|
||||||
|
if (type === 'warehouse') this.warehouseOptions = list;
|
||||||
|
else this.processUnitOptions = list;
|
||||||
|
}
|
||||||
|
this.applyUnitSelectList(list, empty);
|
||||||
|
}).catch((e) => {
|
||||||
|
if (seq !== this.unitSearchSeq) return;
|
||||||
|
uni.showToast({ title: (e && e.message) || '搜索失败', icon: 'none' });
|
||||||
|
}).then(() => {
|
||||||
|
if (seq === this.unitSearchSeq) this.selectSearching = false;
|
||||||
|
}, () => {
|
||||||
|
if (seq === this.unitSearchSeq) this.selectSearching = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
openProcessUnitSelect() {
|
openProcessUnitSelect() {
|
||||||
@@ -181,12 +215,13 @@ export default {
|
|||||||
loadList() {
|
loadList() {
|
||||||
if (this.listLoading) return;
|
if (this.listLoading) return;
|
||||||
this.listLoading = true;
|
this.listLoading = true;
|
||||||
|
const filters = this.appliedFilters || this.filters;
|
||||||
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.process_unit_id) params.supplier_id = this.filters.process_unit_id;
|
if (filters.process_unit_id) params.supplier_id = filters.process_unit_id;
|
||||||
if (this.filters.warehouse_id) params.warehouse_id = this.filters.warehouse_id;
|
if (filters.warehouse_id) params.warehouse_id = filters.warehouse_id;
|
||||||
if (this.filters.audit_status !== '' && this.filters.audit_status !== null) {
|
if (this.hasFilterValue(filters.audit_status)) {
|
||||||
params.audit_status = this.filters.audit_status;
|
params.audit_status = filters.audit_status;
|
||||||
}
|
}
|
||||||
fetchAllOrderList((p) => this.$u.api.fpmProcessReturnInOrder.list(p), params)
|
fetchAllOrderList((p) => this.$u.api.fpmProcessReturnInOrder.list(p), params)
|
||||||
.then((rows) => {
|
.then((rows) => {
|
||||||
@@ -231,33 +266,10 @@ export default {
|
|||||||
uni.navigateTo({ url: `./${page}?id=${item.id}` });
|
uni.navigateTo({ url: `./${page}?id=${item.id}` });
|
||||||
},
|
},
|
||||||
openStatusSelect() { this.statusSelectShow = true; },
|
openStatusSelect() { this.statusSelectShow = true; },
|
||||||
onStatusConfirm(e) { this.filters.audit_status = e[0].value; },
|
|
||||||
resetFilter() {
|
|
||||||
this.filters = {
|
|
||||||
order_no: '',
|
|
||||||
process_unit_id: '',
|
|
||||||
process_name: '',
|
|
||||||
warehouse_id: '',
|
|
||||||
warehouse_name: '',
|
|
||||||
audit_status: '',
|
|
||||||
};
|
|
||||||
},
|
|
||||||
applyFilter() {
|
|
||||||
this.filterShow = false;
|
|
||||||
this.loadList();
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style lang="scss">
|
||||||
page { background-color: #F8F8F8; }
|
@import '@/common/list-filter.scss';
|
||||||
.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; }
|
|
||||||
.filterPanel { padding: 30rpx; }
|
|
||||||
.filterTitle { font-size: 32rpx; font-weight: bold; margin-bottom: 30rpx; }
|
|
||||||
.filterItem { margin-bottom: 24rpx; }
|
|
||||||
.filterLabel { display: block; font-size: 28rpx; color: #666; margin-bottom: 12rpx; }
|
|
||||||
.filterValue { display: flex; align-items: center; justify-content: space-between; padding: 16rpx; background: #f5f5f5; border-radius: 8rpx; font-size: 28rpx; }
|
|
||||||
.filterActions { display: flex; gap: 20rpx; margin-top: 40rpx; }
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -8,6 +8,9 @@
|
|||||||
*/
|
*/
|
||||||
import util from '@/common/util';
|
import util from '@/common/util';
|
||||||
import scanMixin from '@/common/scanMixin.js';
|
import scanMixin from '@/common/scanMixin.js';
|
||||||
|
import PlusBarcodePanel from '@/components/common/PlusBarcodePanel.vue';
|
||||||
|
import remoteSelectMixin from '@/common/remoteSelectMixin.js';
|
||||||
|
import { withNameParam } from '@/common/remoteSelect';
|
||||||
import { initTts, speak } from '@/common/tts.js';
|
import { initTts, speak } from '@/common/tts.js';
|
||||||
import {
|
import {
|
||||||
AUDIT_STATUS_MAP,
|
AUDIT_STATUS_MAP,
|
||||||
@@ -31,13 +34,15 @@ import {
|
|||||||
} from '@/common/storeGoodsProcessReturnIn';
|
} from '@/common/storeGoodsProcessReturnIn';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [scanMixin],
|
components: { PlusBarcodePanel },
|
||||||
|
mixins: [scanMixin, remoteSelectMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
pageMode: 'add',
|
pageMode: 'add',
|
||||||
orderId: 0,
|
orderId: 0,
|
||||||
form: this.getEmptyForm(),
|
form: this.getEmptyForm(),
|
||||||
headerSaved: false,
|
headerSaved: false,
|
||||||
|
headerCollapsed: false,
|
||||||
selectShow: false,
|
selectShow: false,
|
||||||
selectList: [],
|
selectList: [],
|
||||||
selectType: '',
|
selectType: '',
|
||||||
@@ -96,6 +101,11 @@ export default {
|
|||||||
if (!this.warehouseBinId && !this.BarCodeDelStatus) return '请先扫描仓位后再扫布匹二维码';
|
if (!this.warehouseBinId && !this.BarCodeDelStatus) return '请先扫描仓位后再扫布匹二维码';
|
||||||
return '当前状态不可扫码';
|
return '当前状态不可扫码';
|
||||||
},
|
},
|
||||||
|
phoneScanHint() {
|
||||||
|
return this.phoneScanTarget === 'bin'
|
||||||
|
? '请扫描仓位,成功后自动扫布飞'
|
||||||
|
: '连续扫描布飞二维码,扫完可继续下一条';
|
||||||
|
},
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.isPageActive = true;
|
this.isPageActive = true;
|
||||||
@@ -120,21 +130,56 @@ export default {
|
|||||||
this.warehouseBinCode = '';
|
this.warehouseBinCode = '';
|
||||||
this.warehouseBinName = '';
|
this.warehouseBinName = '';
|
||||||
this.phoneContinuousScan = false;
|
this.phoneContinuousScan = false;
|
||||||
|
this._phoneBinLocked = false;
|
||||||
|
this._pendingFabricCode = '';
|
||||||
|
if (this.phoneScanTarget === 'bin') this.closePhoneScanPanel();
|
||||||
|
},
|
||||||
|
/** 重扫仓位:先清空输入框再填入,避免残留旧码拼接 */
|
||||||
|
applyWarehouseBinScan(scanResult) {
|
||||||
|
const code = String(scanResult || '').trim().replace(/[\r\n]/g, '');
|
||||||
|
if (!code) return;
|
||||||
|
this.warehouseBinCode = '';
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.warehouseBinCode = code;
|
||||||
|
this.$nextTick(() => this.resolveWarehouseBin());
|
||||||
|
});
|
||||||
|
},
|
||||||
|
openHalfScreenScan(target) {
|
||||||
|
if (this.phoneScanPanelOpen && this.phoneScanTarget === target) {
|
||||||
|
this.closePhoneScanPanel();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.phoneContinuousScan = false;
|
||||||
|
if (target === 'bin') this._phoneBinLocked = false;
|
||||||
|
this.phoneScanTarget = target;
|
||||||
|
this.phoneScanPanelOpen = true;
|
||||||
|
},
|
||||||
|
onPlusBarcodeSuccess(scanResult) {
|
||||||
|
const code = String(scanResult || '').trim().replace(/[\r\n]/g, '');
|
||||||
|
if (!code) return;
|
||||||
|
if (this.phoneScanTarget === 'bin') {
|
||||||
|
if (this._phoneBinLocked) {
|
||||||
|
if (!this.warehouseBinId) {
|
||||||
|
this._pendingFabricCode = code;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.phoneScanTarget = 'qr';
|
||||||
|
} else {
|
||||||
|
this._phoneBinLocked = true;
|
||||||
|
this._pendingFabricCode = '';
|
||||||
|
this.applyWarehouseBinScan(code);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.QRBarCode = code;
|
||||||
|
this.$nextTick(() => this.handleScan());
|
||||||
},
|
},
|
||||||
handleBinPhoneScan() {
|
handleBinPhoneScan() {
|
||||||
if (!this.canScan || !this.orderId) {
|
if (!this.canScan || !this.orderId) {
|
||||||
this.showError('请先提交保存后再扫码');
|
this.showError('请先提交保存后再扫码');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.phoneContinuousScan = false;
|
this.openHalfScreenScan('bin');
|
||||||
this.phoneScanTarget = 'bin';
|
|
||||||
this.openPhoneScan({
|
|
||||||
callback: (scanResult) => {
|
|
||||||
this.warehouseBinCode = String(scanResult || '').trim().replace(/[\r\n]/g, '');
|
|
||||||
this.$nextTick(() => this.resolveWarehouseBin());
|
|
||||||
},
|
|
||||||
fail: () => {},
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
handlePhoneScan() {
|
handlePhoneScan() {
|
||||||
if (!this.canScan || !this.orderId) {
|
if (!this.canScan || !this.orderId) {
|
||||||
@@ -146,11 +191,10 @@ export default {
|
|||||||
this.handleBinPhoneScan();
|
this.handleBinPhoneScan();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.phoneScanTarget = 'qr';
|
this.openHalfScreenScan('qr');
|
||||||
this.phoneContinuousScan = true;
|
|
||||||
this.openContinuousPhoneScan();
|
|
||||||
},
|
},
|
||||||
openContinuousPhoneScan() {
|
openContinuousPhoneScan() {
|
||||||
|
if (this.phoneScanPanelOpen) return;
|
||||||
if (!this.phoneContinuousScan || !this.canScanQr || !this.isPageActive) {
|
if (!this.phoneContinuousScan || !this.canScanQr || !this.isPageActive) {
|
||||||
this.phoneContinuousScan = false;
|
this.phoneContinuousScan = false;
|
||||||
return;
|
return;
|
||||||
@@ -166,6 +210,7 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
scheduleNextPhoneScan() {
|
scheduleNextPhoneScan() {
|
||||||
|
if (this.phoneScanPanelOpen) return;
|
||||||
if (!this.phoneContinuousScan || !this.canScanQr || !this.isPageActive) {
|
if (!this.phoneContinuousScan || !this.canScanQr || !this.isPageActive) {
|
||||||
this.phoneContinuousScan = false;
|
this.phoneContinuousScan = false;
|
||||||
return;
|
return;
|
||||||
@@ -180,8 +225,7 @@ export default {
|
|||||||
if (!code) return;
|
if (!code) return;
|
||||||
// 删除模式:直接按布匹码删除;未扫仓位时枪扫优先解析为仓位
|
// 删除模式:直接按布匹码删除;未扫仓位时枪扫优先解析为仓位
|
||||||
if (!this.BarCodeDelStatus && !this.warehouseBinId) {
|
if (!this.BarCodeDelStatus && !this.warehouseBinId) {
|
||||||
this.warehouseBinCode = code;
|
this.applyWarehouseBinScan(code);
|
||||||
this.$nextTick(() => this.resolveWarehouseBin());
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.QRBarCode = code;
|
this.QRBarCode = code;
|
||||||
@@ -224,10 +268,21 @@ export default {
|
|||||||
this.BillDataMessage = '';
|
this.BillDataMessage = '';
|
||||||
speak('仓位成功');
|
speak('仓位成功');
|
||||||
uni.showToast({ title: '仓位识别成功', icon: 'success' });
|
uni.showToast({ title: '仓位识别成功', icon: 'success' });
|
||||||
|
if (this.phoneScanPanelOpen) this.phoneScanTarget = 'qr';
|
||||||
|
this._phoneBinLocked = false;
|
||||||
|
const pending = this._pendingFabricCode;
|
||||||
|
this._pendingFabricCode = '';
|
||||||
|
if (pending && this.phoneScanPanelOpen) {
|
||||||
|
this.QRBarCode = pending;
|
||||||
|
this.$nextTick(() => this.handleScan());
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
|
this._phoneBinLocked = false;
|
||||||
|
this._pendingFabricCode = '';
|
||||||
this.warehouseBinId = 0;
|
this.warehouseBinId = 0;
|
||||||
|
this.warehouseBinCode = '';
|
||||||
this.warehouseBinName = '';
|
this.warehouseBinName = '';
|
||||||
this.showError(e.message || '仓位识别失败');
|
this.showError(e.message || '仓位识别失败');
|
||||||
});
|
});
|
||||||
@@ -236,6 +291,7 @@ export default {
|
|||||||
const nextCanScan = this.isEditable && canScanAtStatus(status);
|
const nextCanScan = this.isEditable && canScanAtStatus(status);
|
||||||
if (this.canScan && !nextCanScan) {
|
if (this.canScan && !nextCanScan) {
|
||||||
this.phoneContinuousScan = false;
|
this.phoneContinuousScan = false;
|
||||||
|
this.closePhoneScanPanel();
|
||||||
this.unregisterScanBroadcast();
|
this.unregisterScanBroadcast();
|
||||||
}
|
}
|
||||||
this.canScan = nextCanScan;
|
this.canScan = nextCanScan;
|
||||||
@@ -275,6 +331,26 @@ export default {
|
|||||||
return this.warehouseOptions;
|
return this.warehouseOptions;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
fetchRemoteSelectOptions(type, keyword) {
|
||||||
|
const empty = !String(keyword || '').trim();
|
||||||
|
if (type === '加工单位') {
|
||||||
|
return this.$u.api.businessUnit.list(withNameParam({ unit_type_id: BUSINESS_UNIT_TYPE_PROCESS }, keyword))
|
||||||
|
.then((res) => {
|
||||||
|
const list = mapToSelectOptions(res);
|
||||||
|
if (empty) this.processUnitOptions = list;
|
||||||
|
return list;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (type === '仓库名称') {
|
||||||
|
return this.$u.api.physicalWarehouse.getDropdownList(withNameParam({ warehouse_type_id: WAREHOUSE_TYPE_FINISHED }, keyword))
|
||||||
|
.then((res) => {
|
||||||
|
const list = mapToSelectOptions(res);
|
||||||
|
if (empty) this.warehouseOptions = list;
|
||||||
|
return list;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return Promise.resolve([]);
|
||||||
|
},
|
||||||
applyDefaultWarehouse() {
|
applyDefaultWarehouse() {
|
||||||
const app = getApp();
|
const app = getApp();
|
||||||
const picked = pickDefaultWarehouse(
|
const picked = pickDefaultWarehouse(
|
||||||
@@ -314,6 +390,7 @@ export default {
|
|||||||
this.orderId = order.id;
|
this.orderId = order.id;
|
||||||
this.auditStatus = order.audit_status;
|
this.auditStatus = order.audit_status;
|
||||||
this.headerSaved = true;
|
this.headerSaved = true;
|
||||||
|
this.headerCollapsed = true;
|
||||||
this.form = orderToFormFields(order);
|
this.form = orderToFormFields(order);
|
||||||
this.clearWarehouseBin();
|
this.clearWarehouseBin();
|
||||||
this.syncCanScanFromStatus(order.audit_status);
|
this.syncCanScanFromStatus(order.audit_status);
|
||||||
@@ -327,24 +404,11 @@ export default {
|
|||||||
},
|
},
|
||||||
pickerSelectFun(type) {
|
pickerSelectFun(type) {
|
||||||
if (!this.headerEditable) return;
|
if (!this.headerEditable) return;
|
||||||
this.selectType = type;
|
const cache = {
|
||||||
const openPicker = (list) => {
|
'加工单位': this.processUnitOptions,
|
||||||
if (!list.length) {
|
'仓库名称': this.warehouseOptions,
|
||||||
this.showError('暂无可选数据');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.selectList = list;
|
|
||||||
this.selectShow = true;
|
|
||||||
};
|
};
|
||||||
if (type === '加工单位') {
|
if (cache[type]) this.openSelectPicker(type, cache[type]);
|
||||||
this.ensureProcessUnitOptions()
|
|
||||||
.then(openPicker)
|
|
||||||
.catch((e) => this.showError(e.message || '加载加工单位失败'));
|
|
||||||
} else if (type === '仓库名称') {
|
|
||||||
this.ensureWarehouseOptions()
|
|
||||||
.then(openPicker)
|
|
||||||
.catch((e) => this.showError(e.message || '加载仓库失败'));
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
selectConfirmFun(e) {
|
selectConfirmFun(e) {
|
||||||
const item = e[0];
|
const item = e[0];
|
||||||
@@ -399,9 +463,10 @@ export default {
|
|||||||
const order = normalizeOrder(detail);
|
const order = normalizeOrder(detail);
|
||||||
this.applyOrder(order);
|
this.applyOrder(order);
|
||||||
this.headerSaved = true;
|
this.headerSaved = true;
|
||||||
|
this.headerCollapsed = true;
|
||||||
this.clearWarehouseBin();
|
this.clearWarehouseBin();
|
||||||
this.syncCanScanFromStatus(order.audit_status);
|
this.syncCanScanFromStatus(order.audit_status);
|
||||||
this.showSuccess('保存成功,请先扫描仓位');
|
this.showSuccess('保存成功,请先扫描仓位', '保存成功', { voiceOnly: true });
|
||||||
this.registerOrderScanBroadcast();
|
this.registerOrderScanBroadcast();
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
@@ -492,6 +557,12 @@ export default {
|
|||||||
if (order) {
|
if (order) {
|
||||||
this.form.item_data = order.item_data;
|
this.form.item_data = order.item_data;
|
||||||
this.auditStatus = order.audit_status;
|
this.auditStatus = order.audit_status;
|
||||||
|
// 本单匹数/本单数量:取这张单的总匹数、总数量
|
||||||
|
this.scanDetail = {
|
||||||
|
...this.scanDetail,
|
||||||
|
order_roll: order.total_roll,
|
||||||
|
order_weight: order.total_weight,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(() => null);
|
.catch(() => null);
|
||||||
@@ -504,7 +575,8 @@ export default {
|
|||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
this.phoneContinuousScan = false;
|
this.phoneContinuousScan = false;
|
||||||
const message = e.message || (isDelete ? '删除失败' : '扫码失败');
|
const message = e.message || (isDelete ? '删除失败' : '扫码失败');
|
||||||
this.showError(message);
|
speak(isDelete ? '删除失败' : '扫码失败');
|
||||||
|
uni.showToast({ title: message, icon: 'none', duration: 2500 });
|
||||||
this.QRBarCode = '';
|
this.QRBarCode = '';
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -519,16 +591,16 @@ 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('操作成功');
|
this.showSuccess(util.statusSuccessVoice(action));
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
showError(message) {
|
showError(message) {
|
||||||
util.playErrorAudio();
|
util.playErrorAudio(message);
|
||||||
uni.showModal({ title: '提示', content: message, showCancel: false });
|
uni.showModal({ title: '提示', content: message, showCancel: false });
|
||||||
},
|
},
|
||||||
showSuccess(message) {
|
showSuccess(message, voiceText, options) {
|
||||||
util.playSuccessAudio();
|
util.playSuccessAudio(voiceText || message, options);
|
||||||
uni.showToast({ title: message, icon: 'success' });
|
uni.showToast({ title: message, icon: 'success' });
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,11 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="fabric-out-page">
|
<view class="fabric-out-page">
|
||||||
|
<OrderHeaderFold v-model="headerCollapsed" :summary="order.order_no">
|
||||||
<OrderStatusBar class="fabric-out-mt32" :status="order.audit_status" :name="order.audit_status_name" />
|
<OrderStatusBar class="fabric-out-mt32" :status="order.audit_status" :name="order.audit_status_name" />
|
||||||
|
|
||||||
<view class="flex-white-plr26 ptb10 bdb_f5">
|
|
||||||
<text class="mr26">进仓单号</text>
|
|
||||||
<text>{{ order.order_no }}</text>
|
|
||||||
</view>
|
|
||||||
<view class="flex-white-plr26 ptb20 bdb_f5">
|
<view class="flex-white-plr26 ptb20 bdb_f5">
|
||||||
<text class="mr26">进仓类型</text>
|
<text class="mr26">进仓类型</text>
|
||||||
<text>{{ order.in_order_type_name || '加工退货进仓单' }}</text>
|
<text>{{ order.in_order_type_name || '加工退货进仓单' }}</text>
|
||||||
@@ -30,6 +26,7 @@
|
|||||||
<text class="mr26">审核人</text>
|
<text class="mr26">审核人</text>
|
||||||
<text>{{ order.auditor_name }} {{ formatTime(order.audit_time, 'YYYY-MM-DD') }}</text>
|
<text>{{ order.auditor_name }} {{ formatTime(order.audit_time, 'YYYY-MM-DD') }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
</OrderHeaderFold>
|
||||||
|
|
||||||
<ProcessInDetailList
|
<ProcessInDetailList
|
||||||
:title="detailTitle"
|
:title="detailTitle"
|
||||||
@@ -43,6 +40,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import util from '@/common/util';
|
import util from '@/common/util';
|
||||||
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
|
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
|
||||||
|
import OrderHeaderFold from '@/components/storefabric/OrderHeaderFold.vue';
|
||||||
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
||||||
import ProcessInDetailList from '@/components/storegoods/ProcessInDetailList.vue';
|
import ProcessInDetailList from '@/components/storegoods/ProcessInDetailList.vue';
|
||||||
import {
|
import {
|
||||||
@@ -53,10 +51,11 @@ import {
|
|||||||
} from '@/common/storeGoodsProcessReturnIn';
|
} from '@/common/storeGoodsProcessReturnIn';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { OrderStatusBar, FabricOutFooter, ProcessInDetailList },
|
components: { OrderStatusBar, OrderHeaderFold, FabricOutFooter, ProcessInDetailList },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
orderId: 0,
|
orderId: 0,
|
||||||
|
headerCollapsed: true,
|
||||||
order: { item_data: [] },
|
order: { item_data: [] },
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -102,18 +101,25 @@ export default {
|
|||||||
confirmOrderStatusAction(this, {
|
confirmOrderStatusAction(this, {
|
||||||
orderId: this.orderId,
|
orderId: this.orderId,
|
||||||
action,
|
action,
|
||||||
onSuccess: () => this.$u.api.fpmProcessReturnInOrder.detail({ id: this.orderId })
|
onSuccess: () => {
|
||||||
.then((res) => {
|
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
|
const voice = util.statusSuccessVoice(action);
|
||||||
|
util.playSuccessAudio(voice);
|
||||||
|
uni.showToast({ title: voice, icon: 'success' });
|
||||||
|
if (action === 'unapprove') {
|
||||||
|
uni.redirectTo({ url: `./storeGoodsProcessReturnInEdit?id=${this.orderId}` });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return this.$u.api.fpmProcessReturnInOrder.detail({ id: this.orderId })
|
||||||
|
.then((res) => {
|
||||||
const order = normalizeOrder(res);
|
const order = normalizeOrder(res);
|
||||||
if (order) this.order = order;
|
if (order) this.order = order;
|
||||||
util.playSuccessAudio();
|
});
|
||||||
uni.showToast({ title: '操作成功', icon: 'success' });
|
},
|
||||||
}),
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
showError(message) {
|
showError(message) {
|
||||||
util.playErrorAudio();
|
util.playErrorAudio(message);
|
||||||
uni.showModal({ title: '提示', content: message, showCancel: false });
|
uni.showModal({ title: '提示', content: message, showCancel: false });
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,11 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="fabric-out-page">
|
<view class="fabric-out-page">
|
||||||
|
<OrderHeaderFold v-model="headerCollapsed" :summary="form.order_no || '保存后自动生成'">
|
||||||
<OrderStatusBar class="fabric-out-mt32" :status="displayAuditStatus" :name="displayAuditStatusName" />
|
<OrderStatusBar class="fabric-out-mt32" :status="displayAuditStatus" :name="displayAuditStatusName" />
|
||||||
|
|
||||||
<view class="flex-white-plr26 ptb10 bdb_f5">
|
|
||||||
<text class="mr26">进仓单号</text>
|
|
||||||
<u-input disabled placeholder="保存后自动生成" v-model="form.order_no" />
|
|
||||||
</view>
|
|
||||||
<view @click="pickerSelectFun('供应商')" class="flex-white-plr26 ptb20 bdb_f5">
|
<view @click="pickerSelectFun('供应商')" class="flex-white-plr26 ptb20 bdb_f5">
|
||||||
<text class="mr26">供应商<text class="redXingh">*</text></text>
|
<text class="mr26">供应商<text class="redXingh">*</text></text>
|
||||||
<view :class="form.biz_unit_name ? '' : 'cBlack'">
|
<view :class="form.biz_unit_name ? '' : 'cBlack'">
|
||||||
@@ -62,13 +58,21 @@
|
|||||||
<view style="margin-bottom: 8rpx;"><text>单据备注</text></view>
|
<view style="margin-bottom: 8rpx;"><text>单据备注</text></view>
|
||||||
<u-input v-model="form.remark" :disabled="!headerEditable" type="textarea" :border="true" :height="100" :auto-height="true" />
|
<u-input v-model="form.remark" :disabled="!headerEditable" type="textarea" :border="true" :height="100" :auto-height="true" />
|
||||||
</view>
|
</view>
|
||||||
|
</OrderHeaderFold>
|
||||||
|
|
||||||
|
<PlusBarcodePanel
|
||||||
|
:visible.sync="phoneScanPanelOpen"
|
||||||
|
:hint-text="phoneScanHint"
|
||||||
|
:scan-time-space="1200"
|
||||||
|
@success="onPlusBarcodeSuccess"
|
||||||
|
/>
|
||||||
<ProcessInBinBar
|
<ProcessInBinBar
|
||||||
:can-scan="canScan"
|
:can-scan="canScan"
|
||||||
:bin-id="warehouseBinId"
|
:bin-id="warehouseBinId"
|
||||||
:code="warehouseBinCode"
|
:code="warehouseBinCode"
|
||||||
:name="warehouseBinName"
|
:name="warehouseBinName"
|
||||||
:show-phone-scan="canScan"
|
:show-phone-scan="canScan"
|
||||||
|
:scanning="phoneScanPanelOpen && phoneScanTarget === 'bin'"
|
||||||
@code-input="warehouseBinCode = $event"
|
@code-input="warehouseBinCode = $event"
|
||||||
@confirm="resolveWarehouseBin"
|
@confirm="resolveWarehouseBin"
|
||||||
@phone-scan="handleBinPhoneScan"
|
@phone-scan="handleBinPhoneScan"
|
||||||
@@ -81,6 +85,7 @@
|
|||||||
:message="BillDataMessage"
|
:message="BillDataMessage"
|
||||||
:disabled-tip="qrDisabledTip"
|
:disabled-tip="qrDisabledTip"
|
||||||
:show-phone-scan="canScanQr"
|
:show-phone-scan="canScanQr"
|
||||||
|
:scanning="phoneScanPanelOpen && phoneScanTarget === 'qr'"
|
||||||
@input="QRBarCode = $event"
|
@input="QRBarCode = $event"
|
||||||
@scan="handleScan"
|
@scan="handleScan"
|
||||||
@phone-scan="handlePhoneScan"
|
@phone-scan="handlePhoneScan"
|
||||||
@@ -107,22 +112,26 @@
|
|||||||
@action="handleStatusAction"
|
@action="handleStatusAction"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<u-select v-model="selectShow" :list="selectList" @confirm="selectConfirmFun"></u-select>
|
<u-select v-model="selectShow" :list="selectList" :remote="isRemoteSelect" :loading="selectSearching" @search="onSelectSearch" @confirm="selectConfirmFun"></u-select>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import formMixin from './storeGoodsPurchaseInMixin.js';
|
import formMixin from './storeGoodsPurchaseInMixin.js';
|
||||||
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
|
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
|
||||||
|
import OrderHeaderFold from '@/components/storefabric/OrderHeaderFold.vue';
|
||||||
import FabricOutScanBar from '@/components/storefabric/FabricOutScanBar.vue';
|
import FabricOutScanBar from '@/components/storefabric/FabricOutScanBar.vue';
|
||||||
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
||||||
import ProcessInScanDetail from '@/components/storegoods/ProcessInScanDetail.vue';
|
import ProcessInScanDetail from '@/components/storegoods/ProcessInScanDetail.vue';
|
||||||
import ProcessInDetailList from '@/components/storegoods/ProcessInDetailList.vue';
|
import ProcessInDetailList from '@/components/storegoods/ProcessInDetailList.vue';
|
||||||
import ProcessInBinBar from '@/components/storegoods/ProcessInBinBar.vue';
|
import ProcessInBinBar from '@/components/storegoods/ProcessInBinBar.vue';
|
||||||
|
import PlusBarcodePanel from '@/components/common/PlusBarcodePanel.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
PlusBarcodePanel,
|
||||||
OrderStatusBar,
|
OrderStatusBar,
|
||||||
|
OrderHeaderFold,
|
||||||
FabricOutScanBar,
|
FabricOutScanBar,
|
||||||
FabricOutFooter,
|
FabricOutFooter,
|
||||||
ProcessInScanDetail,
|
ProcessInScanDetail,
|
||||||
|
|||||||
@@ -1,11 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="fabric-out-page">
|
<view class="fabric-out-page">
|
||||||
|
<OrderHeaderFold v-model="headerCollapsed" :summary="form.order_no">
|
||||||
<OrderStatusBar class="fabric-out-mt32" :status="displayAuditStatus" :name="displayAuditStatusName" />
|
<OrderStatusBar class="fabric-out-mt32" :status="displayAuditStatus" :name="displayAuditStatusName" />
|
||||||
|
|
||||||
<view class="flex-white-plr26 ptb10 bdb_f5">
|
|
||||||
<text class="mr26">进仓单号</text>
|
|
||||||
<text>{{ form.order_no }}</text>
|
|
||||||
</view>
|
|
||||||
<view class="flex-white-plr26 ptb20 bdb_f5">
|
<view class="flex-white-plr26 ptb20 bdb_f5">
|
||||||
<text class="mr26">供应商</text>
|
<text class="mr26">供应商</text>
|
||||||
<text>{{ form.biz_unit_name || '-' }}</text>
|
<text>{{ form.biz_unit_name || '-' }}</text>
|
||||||
@@ -50,13 +46,21 @@
|
|||||||
<text class="mr26">单据备注</text>
|
<text class="mr26">单据备注</text>
|
||||||
<text>{{ form.remark || '-' }}</text>
|
<text>{{ form.remark || '-' }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
</OrderHeaderFold>
|
||||||
|
|
||||||
|
<PlusBarcodePanel
|
||||||
|
:visible.sync="phoneScanPanelOpen"
|
||||||
|
:hint-text="phoneScanHint"
|
||||||
|
:scan-time-space="1200"
|
||||||
|
@success="onPlusBarcodeSuccess"
|
||||||
|
/>
|
||||||
<ProcessInBinBar
|
<ProcessInBinBar
|
||||||
:can-scan="canScan"
|
:can-scan="canScan"
|
||||||
:bin-id="warehouseBinId"
|
:bin-id="warehouseBinId"
|
||||||
:code="warehouseBinCode"
|
:code="warehouseBinCode"
|
||||||
:name="warehouseBinName"
|
:name="warehouseBinName"
|
||||||
:show-phone-scan="canScan"
|
:show-phone-scan="canScan"
|
||||||
|
:scanning="phoneScanPanelOpen && phoneScanTarget === 'bin'"
|
||||||
@code-input="warehouseBinCode = $event"
|
@code-input="warehouseBinCode = $event"
|
||||||
@confirm="resolveWarehouseBin"
|
@confirm="resolveWarehouseBin"
|
||||||
@phone-scan="handleBinPhoneScan"
|
@phone-scan="handleBinPhoneScan"
|
||||||
@@ -69,6 +73,7 @@
|
|||||||
:message="BillDataMessage"
|
:message="BillDataMessage"
|
||||||
:disabled-tip="qrDisabledTip"
|
:disabled-tip="qrDisabledTip"
|
||||||
:show-phone-scan="canScanQr"
|
:show-phone-scan="canScanQr"
|
||||||
|
:scanning="phoneScanPanelOpen && phoneScanTarget === 'qr'"
|
||||||
@input="QRBarCode = $event"
|
@input="QRBarCode = $event"
|
||||||
@scan="handleScan"
|
@scan="handleScan"
|
||||||
@phone-scan="handlePhoneScan"
|
@phone-scan="handlePhoneScan"
|
||||||
@@ -85,22 +90,26 @@
|
|||||||
|
|
||||||
<FabricOutFooter :buttons="statusActionButtons" @action="handleStatusAction" />
|
<FabricOutFooter :buttons="statusActionButtons" @action="handleStatusAction" />
|
||||||
|
|
||||||
<u-select v-model="selectShow" :list="selectList" @confirm="selectConfirmFun"></u-select>
|
<u-select v-model="selectShow" :list="selectList" :remote="isRemoteSelect" :loading="selectSearching" @search="onSelectSearch" @confirm="selectConfirmFun"></u-select>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import formMixin from './storeGoodsPurchaseInMixin.js';
|
import formMixin from './storeGoodsPurchaseInMixin.js';
|
||||||
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
|
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
|
||||||
|
import OrderHeaderFold from '@/components/storefabric/OrderHeaderFold.vue';
|
||||||
import FabricOutScanBar from '@/components/storefabric/FabricOutScanBar.vue';
|
import FabricOutScanBar from '@/components/storefabric/FabricOutScanBar.vue';
|
||||||
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
||||||
import ProcessInScanDetail from '@/components/storegoods/ProcessInScanDetail.vue';
|
import ProcessInScanDetail from '@/components/storegoods/ProcessInScanDetail.vue';
|
||||||
import ProcessInDetailList from '@/components/storegoods/ProcessInDetailList.vue';
|
import ProcessInDetailList from '@/components/storegoods/ProcessInDetailList.vue';
|
||||||
import ProcessInBinBar from '@/components/storegoods/ProcessInBinBar.vue';
|
import ProcessInBinBar from '@/components/storegoods/ProcessInBinBar.vue';
|
||||||
|
import PlusBarcodePanel from '@/components/common/PlusBarcodePanel.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
PlusBarcodePanel,
|
||||||
OrderStatusBar,
|
OrderStatusBar,
|
||||||
|
OrderHeaderFold,
|
||||||
FabricOutScanBar,
|
FabricOutScanBar,
|
||||||
FabricOutFooter,
|
FabricOutFooter,
|
||||||
ProcessInScanDetail,
|
ProcessInScanDetail,
|
||||||
@@ -110,6 +119,7 @@ export default {
|
|||||||
mixins: [formMixin],
|
mixins: [formMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
headerCollapsed: true,
|
||||||
weightInputStyle: {
|
weightInputStyle: {
|
||||||
fontSize: '36rpx',
|
fontSize: '36rpx',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
<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 v-model="filters.order_no" placeholder="进仓单号" :show-action="false" @search="applySearch" @custom="applySearch" @clear="applySearch" />
|
||||||
<view class="filterBtn" @click="filterShow = true">
|
<view class="filterBtn" :class="{ 'filter-active': hasActiveFilter }" @click="filterShow = true">
|
||||||
<u-icon name="list" size="40" color="#666"></u-icon>
|
<view class="filterBtn__icon">
|
||||||
|
<u-icon :key="filterIconColor" name="list" size="44" :color="filterIconColor"></u-icon>
|
||||||
|
<view v-if="hasActiveFilter" class="filterBtn__badge"></view>
|
||||||
|
</view>
|
||||||
<text>筛选</text>
|
<text>筛选</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -20,24 +23,26 @@
|
|||||||
|
|
||||||
<addBtn url="./storeGoodsPurchaseInAdd"></addBtn>
|
<addBtn url="./storeGoodsPurchaseInAdd"></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" @click="openSupplierSelect">
|
<view class="filterItem" @click="openSupplierSelect">
|
||||||
<text class="filterLabel">供应商</text>
|
<text class="filterLabel">供应商</text>
|
||||||
<view class="filterValue">{{ supplierLabel || '全部' }} <u-icon name="arrow-right" size="28"></u-icon></view>
|
<view class="filterValue">{{ supplierLabel || '全部' }} <u-icon name="arrow-right" size="36"></u-icon></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="filterItem" @click="openWarehouseSelect">
|
<view class="filterItem" @click="openWarehouseSelect">
|
||||||
<text class="filterLabel">仓库</text>
|
<text class="filterLabel">仓库</text>
|
||||||
<view class="filterValue">{{ warehouseLabel || '全部' }} <u-icon name="arrow-right" size="28"></u-icon></view>
|
<view class="filterValue">{{ warehouseLabel || '全部' }} <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>
|
||||||
@@ -46,8 +51,8 @@
|
|||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
|
|
||||||
<u-select v-model="statusSelectShow" :list="statusSelectList" @confirm="onStatusConfirm"></u-select>
|
<u-select class="pdaSelect" v-model="statusSelectShow" title="选择订单状态" :list="statusSelectList" :default-value="statusSelectDefault" @confirm="onStatusConfirm"></u-select>
|
||||||
<u-select v-model="unitSelectShow" :list="unitSelectList" @confirm="onUnitConfirm"></u-select>
|
<u-select class="pdaSelect" v-model="unitSelectShow" :list="unitSelectList" :default-value="unitSelectDefault" remote :loading="selectSearching" @search="onUnitSearch" @confirm="onUnitConfirm"></u-select>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -56,6 +61,7 @@ import addBtn from '@/components/addBtn/addBtn.vue';
|
|||||||
import PurchaseInItem from '@/components/card/storeGoodsPurchaseInItem.vue';
|
import PurchaseInItem from '@/components/card/storeGoodsPurchaseInItem.vue';
|
||||||
import {
|
import {
|
||||||
getStatusOptions,
|
getStatusOptions,
|
||||||
|
AUDIT_STATUS,
|
||||||
AUDIT_STATUS_MAP,
|
AUDIT_STATUS_MAP,
|
||||||
BUSINESS_UNIT_TYPE_PRODUCT_SUPPLIER,
|
BUSINESS_UNIT_TYPE_PRODUCT_SUPPLIER,
|
||||||
WAREHOUSE_TYPE_FINISHED,
|
WAREHOUSE_TYPE_FINISHED,
|
||||||
@@ -63,9 +69,12 @@ import {
|
|||||||
mapToSelectOptions,
|
mapToSelectOptions,
|
||||||
fetchAllOrderList,
|
fetchAllOrderList,
|
||||||
} from '@/common/storeGoodsPurchaseIn';
|
} from '@/common/storeGoodsPurchaseIn';
|
||||||
|
import { withNameParam } from '@/common/remoteSelect';
|
||||||
|
import listFilterMixin from '@/mixins/listFilterMixin';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { addBtn, PurchaseInItem },
|
components: { addBtn, PurchaseInItem },
|
||||||
|
mixins: [listFilterMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
list: [],
|
list: [],
|
||||||
@@ -79,13 +88,17 @@ export default {
|
|||||||
supplierOptions: [],
|
supplierOptions: [],
|
||||||
warehouseOptions: [],
|
warehouseOptions: [],
|
||||||
unitOptionsLoading: false,
|
unitOptionsLoading: false,
|
||||||
|
selectSearching: false,
|
||||||
|
unitSearchSeq: 0,
|
||||||
|
unitSelectList: [{ value: '', label: '全部' }],
|
||||||
|
filterStorageKey: 'storeGoodsPurchaseInListFilters_v2',
|
||||||
filters: {
|
filters: {
|
||||||
order_no: '',
|
order_no: '',
|
||||||
supplier_id: '',
|
supplier_id: '',
|
||||||
supplier_name: '',
|
supplier_name: '',
|
||||||
warehouse_id: '',
|
warehouse_id: '',
|
||||||
warehouse_name: '',
|
warehouse_name: '',
|
||||||
audit_status: '',
|
audit_status: AUDIT_STATUS.PENDING,
|
||||||
},
|
},
|
||||||
statusSelectList: [
|
statusSelectList: [
|
||||||
{ value: '', label: '全部' },
|
{ value: '', label: '全部' },
|
||||||
@@ -104,13 +117,10 @@ export default {
|
|||||||
warehouseLabel() {
|
warehouseLabel() {
|
||||||
return this.filters.warehouse_name || '';
|
return this.filters.warehouse_name || '';
|
||||||
},
|
},
|
||||||
unitSelectList() {
|
|
||||||
const options = this.unitSelectType === 'warehouse' ? this.warehouseOptions : this.supplierOptions;
|
|
||||||
return [{ value: '', label: '全部' }, ...options];
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
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`;
|
||||||
@@ -121,6 +131,16 @@ export default {
|
|||||||
this.loadList();
|
this.loadList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
createDefaultFilters() {
|
||||||
|
return {
|
||||||
|
order_no: '',
|
||||||
|
supplier_id: '',
|
||||||
|
supplier_name: '',
|
||||||
|
warehouse_id: '',
|
||||||
|
warehouse_name: '',
|
||||||
|
audit_status: AUDIT_STATUS.PENDING,
|
||||||
|
};
|
||||||
|
},
|
||||||
loadSupplierOptions() {
|
loadSupplierOptions() {
|
||||||
if (this.supplierOptions.length) return Promise.resolve(this.supplierOptions);
|
if (this.supplierOptions.length) return Promise.resolve(this.supplierOptions);
|
||||||
return this.$u.api.businessUnit.list({ unit_type_id: BUSINESS_UNIT_TYPE_PRODUCT_SUPPLIER })
|
return this.$u.api.businessUnit.list({ unit_type_id: BUSINESS_UNIT_TYPE_PRODUCT_SUPPLIER })
|
||||||
@@ -146,20 +166,34 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
openUnitSelect(type) {
|
openUnitSelect(type) {
|
||||||
if (this.unitOptionsLoading) return;
|
|
||||||
this.unitOptionsLoading = true;
|
|
||||||
const loadFn = type === 'warehouse' ? this.loadWarehouseOptions : this.loadSupplierOptions;
|
|
||||||
loadFn.call(this)
|
|
||||||
.then((list) => {
|
|
||||||
if (!list.length) {
|
|
||||||
uni.showToast({ title: '暂无可选数据', icon: 'none' });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.unitSelectType = type;
|
this.unitSelectType = type;
|
||||||
|
const cache = type === 'warehouse' ? this.warehouseOptions : this.supplierOptions;
|
||||||
|
this.applyUnitSelectList(cache);
|
||||||
this.unitSelectShow = true;
|
this.unitSelectShow = true;
|
||||||
})
|
},
|
||||||
.finally(() => {
|
onUnitSearch(keyword) {
|
||||||
this.unitOptionsLoading = false;
|
const seq = ++this.unitSearchSeq;
|
||||||
|
const type = this.unitSelectType;
|
||||||
|
const empty = !String(keyword || '').trim();
|
||||||
|
this.selectSearching = true;
|
||||||
|
const req = type === 'warehouse'
|
||||||
|
? this.$u.api.physicalWarehouse.getDropdownList(withNameParam({ warehouse_type_id: WAREHOUSE_TYPE_FINISHED }, keyword))
|
||||||
|
: this.$u.api.businessUnit.list(withNameParam({ unit_type_id: BUSINESS_UNIT_TYPE_PRODUCT_SUPPLIER }, keyword));
|
||||||
|
req.then((res) => {
|
||||||
|
if (seq !== this.unitSearchSeq) return;
|
||||||
|
const list = mapToSelectOptions(res);
|
||||||
|
if (empty) {
|
||||||
|
if (type === 'warehouse') this.warehouseOptions = list;
|
||||||
|
else this.supplierOptions = list;
|
||||||
|
}
|
||||||
|
this.applyUnitSelectList(list, empty);
|
||||||
|
}).catch((e) => {
|
||||||
|
if (seq !== this.unitSearchSeq) return;
|
||||||
|
uni.showToast({ title: (e && e.message) || '搜索失败', icon: 'none' });
|
||||||
|
}).then(() => {
|
||||||
|
if (seq === this.unitSearchSeq) this.selectSearching = false;
|
||||||
|
}, () => {
|
||||||
|
if (seq === this.unitSearchSeq) this.selectSearching = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
openSupplierSelect() {
|
openSupplierSelect() {
|
||||||
@@ -181,12 +215,13 @@ export default {
|
|||||||
loadList() {
|
loadList() {
|
||||||
if (this.listLoading) return;
|
if (this.listLoading) return;
|
||||||
this.listLoading = true;
|
this.listLoading = true;
|
||||||
|
const filters = this.appliedFilters || this.filters;
|
||||||
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.supplier_id) params.supplier_id = this.filters.supplier_id;
|
if (filters.supplier_id) params.supplier_id = filters.supplier_id;
|
||||||
if (this.filters.warehouse_id) params.warehouse_id = this.filters.warehouse_id;
|
if (filters.warehouse_id) params.warehouse_id = filters.warehouse_id;
|
||||||
if (this.filters.audit_status !== '' && this.filters.audit_status !== null) {
|
if (this.hasFilterValue(filters.audit_status)) {
|
||||||
params.audit_status = this.filters.audit_status;
|
params.audit_status = filters.audit_status;
|
||||||
}
|
}
|
||||||
fetchAllOrderList((p) => this.$u.api.fpmPrcInOrder.list(p), params)
|
fetchAllOrderList((p) => this.$u.api.fpmPrcInOrder.list(p), params)
|
||||||
.then((rows) => {
|
.then((rows) => {
|
||||||
@@ -231,33 +266,10 @@ export default {
|
|||||||
uni.navigateTo({ url: `./${page}?id=${item.id}` });
|
uni.navigateTo({ url: `./${page}?id=${item.id}` });
|
||||||
},
|
},
|
||||||
openStatusSelect() { this.statusSelectShow = true; },
|
openStatusSelect() { this.statusSelectShow = true; },
|
||||||
onStatusConfirm(e) { this.filters.audit_status = e[0].value; },
|
|
||||||
resetFilter() {
|
|
||||||
this.filters = {
|
|
||||||
order_no: '',
|
|
||||||
supplier_id: '',
|
|
||||||
supplier_name: '',
|
|
||||||
warehouse_id: '',
|
|
||||||
warehouse_name: '',
|
|
||||||
audit_status: '',
|
|
||||||
};
|
|
||||||
},
|
|
||||||
applyFilter() {
|
|
||||||
this.filterShow = false;
|
|
||||||
this.loadList();
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style lang="scss">
|
||||||
page { background-color: #F8F8F8; }
|
@import '@/common/list-filter.scss';
|
||||||
.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; }
|
|
||||||
.filterPanel { padding: 30rpx; }
|
|
||||||
.filterTitle { font-size: 32rpx; font-weight: bold; margin-bottom: 30rpx; }
|
|
||||||
.filterItem { margin-bottom: 24rpx; }
|
|
||||||
.filterLabel { display: block; font-size: 28rpx; color: #666; margin-bottom: 12rpx; }
|
|
||||||
.filterValue { display: flex; align-items: center; justify-content: space-between; padding: 16rpx; background: #f5f5f5; border-radius: 8rpx; font-size: 28rpx; }
|
|
||||||
.filterActions { display: flex; gap: 20rpx; margin-top: 40rpx; }
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -8,6 +8,9 @@
|
|||||||
*/
|
*/
|
||||||
import util from '@/common/util';
|
import util from '@/common/util';
|
||||||
import scanMixin from '@/common/scanMixin.js';
|
import scanMixin from '@/common/scanMixin.js';
|
||||||
|
import PlusBarcodePanel from '@/components/common/PlusBarcodePanel.vue';
|
||||||
|
import remoteSelectMixin from '@/common/remoteSelectMixin.js';
|
||||||
|
import { withNameParam } from '@/common/remoteSelect';
|
||||||
import { initTts, speak } from '@/common/tts.js';
|
import { initTts, speak } from '@/common/tts.js';
|
||||||
import {
|
import {
|
||||||
AUDIT_STATUS_MAP,
|
AUDIT_STATUS_MAP,
|
||||||
@@ -38,13 +41,15 @@ import {
|
|||||||
} from '@/common/storeGoodsPurchaseIn';
|
} from '@/common/storeGoodsPurchaseIn';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [scanMixin],
|
components: { PlusBarcodePanel },
|
||||||
|
mixins: [scanMixin, remoteSelectMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
pageMode: 'add',
|
pageMode: 'add',
|
||||||
orderId: 0,
|
orderId: 0,
|
||||||
form: this.getEmptyForm(),
|
form: this.getEmptyForm(),
|
||||||
headerSaved: false,
|
headerSaved: false,
|
||||||
|
headerCollapsed: false,
|
||||||
selectShow: false,
|
selectShow: false,
|
||||||
selectList: [],
|
selectList: [],
|
||||||
selectType: '',
|
selectType: '',
|
||||||
@@ -109,6 +114,11 @@ export default {
|
|||||||
if (!this.warehouseBinId && !this.BarCodeDelStatus) return '请先扫描仓位后再扫布匹二维码';
|
if (!this.warehouseBinId && !this.BarCodeDelStatus) return '请先扫描仓位后再扫布匹二维码';
|
||||||
return '当前状态不可扫码';
|
return '当前状态不可扫码';
|
||||||
},
|
},
|
||||||
|
phoneScanHint() {
|
||||||
|
return this.phoneScanTarget === 'bin'
|
||||||
|
? '请扫描仓位,成功后自动扫布飞'
|
||||||
|
: '连续扫描布飞二维码,扫完可继续下一条';
|
||||||
|
},
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.isPageActive = true;
|
this.isPageActive = true;
|
||||||
@@ -133,21 +143,56 @@ export default {
|
|||||||
this.warehouseBinCode = '';
|
this.warehouseBinCode = '';
|
||||||
this.warehouseBinName = '';
|
this.warehouseBinName = '';
|
||||||
this.phoneContinuousScan = false;
|
this.phoneContinuousScan = false;
|
||||||
|
this._phoneBinLocked = false;
|
||||||
|
this._pendingFabricCode = '';
|
||||||
|
if (this.phoneScanTarget === 'bin') this.closePhoneScanPanel();
|
||||||
|
},
|
||||||
|
/** 重扫仓位:先清空输入框再填入,避免残留旧码拼接 */
|
||||||
|
applyWarehouseBinScan(scanResult) {
|
||||||
|
const code = String(scanResult || '').trim().replace(/[\r\n]/g, '');
|
||||||
|
if (!code) return;
|
||||||
|
this.warehouseBinCode = '';
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.warehouseBinCode = code;
|
||||||
|
this.$nextTick(() => this.resolveWarehouseBin());
|
||||||
|
});
|
||||||
|
},
|
||||||
|
openHalfScreenScan(target) {
|
||||||
|
if (this.phoneScanPanelOpen && this.phoneScanTarget === target) {
|
||||||
|
this.closePhoneScanPanel();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.phoneContinuousScan = false;
|
||||||
|
if (target === 'bin') this._phoneBinLocked = false;
|
||||||
|
this.phoneScanTarget = target;
|
||||||
|
this.phoneScanPanelOpen = true;
|
||||||
|
},
|
||||||
|
onPlusBarcodeSuccess(scanResult) {
|
||||||
|
const code = String(scanResult || '').trim().replace(/[\r\n]/g, '');
|
||||||
|
if (!code) return;
|
||||||
|
if (this.phoneScanTarget === 'bin') {
|
||||||
|
if (this._phoneBinLocked) {
|
||||||
|
if (!this.warehouseBinId) {
|
||||||
|
this._pendingFabricCode = code;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.phoneScanTarget = 'qr';
|
||||||
|
} else {
|
||||||
|
this._phoneBinLocked = true;
|
||||||
|
this._pendingFabricCode = '';
|
||||||
|
this.applyWarehouseBinScan(code);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.QRBarCode = code;
|
||||||
|
this.$nextTick(() => this.handleScan());
|
||||||
},
|
},
|
||||||
handleBinPhoneScan() {
|
handleBinPhoneScan() {
|
||||||
if (!this.canScan || !this.orderId) {
|
if (!this.canScan || !this.orderId) {
|
||||||
this.showError('请先提交保存后再扫码');
|
this.showError('请先提交保存后再扫码');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.phoneContinuousScan = false;
|
this.openHalfScreenScan('bin');
|
||||||
this.phoneScanTarget = 'bin';
|
|
||||||
this.openPhoneScan({
|
|
||||||
callback: (scanResult) => {
|
|
||||||
this.warehouseBinCode = String(scanResult || '').trim().replace(/[\r\n]/g, '');
|
|
||||||
this.$nextTick(() => this.resolveWarehouseBin());
|
|
||||||
},
|
|
||||||
fail: () => {},
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
handlePhoneScan() {
|
handlePhoneScan() {
|
||||||
if (!this.canScan || !this.orderId) {
|
if (!this.canScan || !this.orderId) {
|
||||||
@@ -159,11 +204,10 @@ export default {
|
|||||||
this.handleBinPhoneScan();
|
this.handleBinPhoneScan();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.phoneScanTarget = 'qr';
|
this.openHalfScreenScan('qr');
|
||||||
this.phoneContinuousScan = true;
|
|
||||||
this.openContinuousPhoneScan();
|
|
||||||
},
|
},
|
||||||
openContinuousPhoneScan() {
|
openContinuousPhoneScan() {
|
||||||
|
if (this.phoneScanPanelOpen) return;
|
||||||
if (!this.phoneContinuousScan || !this.canScanQr || !this.isPageActive) {
|
if (!this.phoneContinuousScan || !this.canScanQr || !this.isPageActive) {
|
||||||
this.phoneContinuousScan = false;
|
this.phoneContinuousScan = false;
|
||||||
return;
|
return;
|
||||||
@@ -179,6 +223,7 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
scheduleNextPhoneScan() {
|
scheduleNextPhoneScan() {
|
||||||
|
if (this.phoneScanPanelOpen) return;
|
||||||
if (!this.phoneContinuousScan || !this.canScanQr || !this.isPageActive) {
|
if (!this.phoneContinuousScan || !this.canScanQr || !this.isPageActive) {
|
||||||
this.phoneContinuousScan = false;
|
this.phoneContinuousScan = false;
|
||||||
return;
|
return;
|
||||||
@@ -193,8 +238,7 @@ export default {
|
|||||||
if (!code) return;
|
if (!code) return;
|
||||||
// 删除模式:直接按布匹码删除;未扫仓位时枪扫优先解析为仓位
|
// 删除模式:直接按布匹码删除;未扫仓位时枪扫优先解析为仓位
|
||||||
if (!this.BarCodeDelStatus && !this.warehouseBinId) {
|
if (!this.BarCodeDelStatus && !this.warehouseBinId) {
|
||||||
this.warehouseBinCode = code;
|
this.applyWarehouseBinScan(code);
|
||||||
this.$nextTick(() => this.resolveWarehouseBin());
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.QRBarCode = code;
|
this.QRBarCode = code;
|
||||||
@@ -237,10 +281,21 @@ export default {
|
|||||||
this.BillDataMessage = '';
|
this.BillDataMessage = '';
|
||||||
speak('仓位成功');
|
speak('仓位成功');
|
||||||
uni.showToast({ title: '仓位识别成功', icon: 'success' });
|
uni.showToast({ title: '仓位识别成功', icon: 'success' });
|
||||||
|
if (this.phoneScanPanelOpen) this.phoneScanTarget = 'qr';
|
||||||
|
this._phoneBinLocked = false;
|
||||||
|
const pending = this._pendingFabricCode;
|
||||||
|
this._pendingFabricCode = '';
|
||||||
|
if (pending && this.phoneScanPanelOpen) {
|
||||||
|
this.QRBarCode = pending;
|
||||||
|
this.$nextTick(() => this.handleScan());
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
|
this._phoneBinLocked = false;
|
||||||
|
this._pendingFabricCode = '';
|
||||||
this.warehouseBinId = 0;
|
this.warehouseBinId = 0;
|
||||||
|
this.warehouseBinCode = '';
|
||||||
this.warehouseBinName = '';
|
this.warehouseBinName = '';
|
||||||
this.showError(e.message || '仓位识别失败');
|
this.showError(e.message || '仓位识别失败');
|
||||||
});
|
});
|
||||||
@@ -249,6 +304,7 @@ export default {
|
|||||||
const nextCanScan = this.isEditable && canScanAtStatus(status);
|
const nextCanScan = this.isEditable && canScanAtStatus(status);
|
||||||
if (this.canScan && !nextCanScan) {
|
if (this.canScan && !nextCanScan) {
|
||||||
this.phoneContinuousScan = false;
|
this.phoneContinuousScan = false;
|
||||||
|
this.closePhoneScanPanel();
|
||||||
this.unregisterScanBroadcast();
|
this.unregisterScanBroadcast();
|
||||||
}
|
}
|
||||||
this.canScan = nextCanScan;
|
this.canScan = nextCanScan;
|
||||||
@@ -302,6 +358,34 @@ export default {
|
|||||||
return this.saleSystemOptions;
|
return this.saleSystemOptions;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
fetchRemoteSelectOptions(type, keyword) {
|
||||||
|
const empty = !String(keyword || '').trim();
|
||||||
|
if (type === '供应商') {
|
||||||
|
return this.$u.api.businessUnit.list(withNameParam({ unit_type_id: BUSINESS_UNIT_TYPE_PRODUCT_SUPPLIER }, keyword))
|
||||||
|
.then((res) => {
|
||||||
|
const list = mapToSelectOptions(res);
|
||||||
|
if (empty) this.supplierOptions = list;
|
||||||
|
return list;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (type === '仓库名称') {
|
||||||
|
return this.$u.api.physicalWarehouse.getDropdownList(withNameParam({ warehouse_type_id: WAREHOUSE_TYPE_FINISHED }, keyword))
|
||||||
|
.then((res) => {
|
||||||
|
const list = mapToSelectOptions(res);
|
||||||
|
if (empty) this.warehouseOptions = list;
|
||||||
|
return list;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (type === '营销体系') {
|
||||||
|
return this.$u.api.saleSystem.getDropdownList(withNameParam({}, keyword))
|
||||||
|
.then((res) => {
|
||||||
|
const list = mapToSelectOptions(res);
|
||||||
|
if (empty) this.saleSystemOptions = list;
|
||||||
|
return list;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return Promise.resolve([]);
|
||||||
|
},
|
||||||
applyDefaultWarehouse() {
|
applyDefaultWarehouse() {
|
||||||
const app = getApp();
|
const app = getApp();
|
||||||
const picked = pickDefaultWarehouse(
|
const picked = pickDefaultWarehouse(
|
||||||
@@ -372,6 +456,7 @@ export default {
|
|||||||
this.orderId = order.id;
|
this.orderId = order.id;
|
||||||
this.auditStatus = order.audit_status;
|
this.auditStatus = order.audit_status;
|
||||||
this.headerSaved = true;
|
this.headerSaved = true;
|
||||||
|
this.headerCollapsed = true;
|
||||||
this.form = orderToFormFields(order);
|
this.form = orderToFormFields(order);
|
||||||
this.clearWarehouseBin();
|
this.clearWarehouseBin();
|
||||||
this.syncCanScanFromStatus(order.audit_status);
|
this.syncCanScanFromStatus(order.audit_status);
|
||||||
@@ -385,30 +470,22 @@ export default {
|
|||||||
},
|
},
|
||||||
pickerSelectFun(type) {
|
pickerSelectFun(type) {
|
||||||
if (!this.headerEditable) return;
|
if (!this.headerEditable) return;
|
||||||
|
if (type === '订单类型') {
|
||||||
this.selectType = type;
|
this.selectType = type;
|
||||||
const openPicker = (list) => {
|
if (!this.saleModeOptions.length) {
|
||||||
if (!list.length) {
|
|
||||||
this.showError('暂无可选数据');
|
this.showError('暂无可选数据');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.selectList = list;
|
this.selectList = this.saleModeOptions;
|
||||||
this.selectShow = true;
|
this.selectShow = true;
|
||||||
};
|
return;
|
||||||
if (type === '供应商') {
|
|
||||||
this.ensureSupplierOptions()
|
|
||||||
.then(openPicker)
|
|
||||||
.catch((e) => this.showError(e.message || '加载供应商失败'));
|
|
||||||
} else if (type === '仓库名称') {
|
|
||||||
this.ensureWarehouseOptions()
|
|
||||||
.then(openPicker)
|
|
||||||
.catch((e) => this.showError(e.message || '加载仓库失败'));
|
|
||||||
} else if (type === '营销体系') {
|
|
||||||
this.ensureSaleSystemOptions()
|
|
||||||
.then(openPicker)
|
|
||||||
.catch((e) => this.showError(e.message || '加载营销体系失败'));
|
|
||||||
} else if (type === '订单类型') {
|
|
||||||
openPicker(this.saleModeOptions);
|
|
||||||
}
|
}
|
||||||
|
const cache = {
|
||||||
|
'供应商': this.supplierOptions,
|
||||||
|
'仓库名称': this.warehouseOptions,
|
||||||
|
'营销体系': this.saleSystemOptions,
|
||||||
|
};
|
||||||
|
if (cache[type]) this.openSelectPicker(type, cache[type]);
|
||||||
},
|
},
|
||||||
selectConfirmFun(e) {
|
selectConfirmFun(e) {
|
||||||
const item = e[0];
|
const item = e[0];
|
||||||
@@ -468,9 +545,10 @@ export default {
|
|||||||
const order = normalizeOrder(detail);
|
const order = normalizeOrder(detail);
|
||||||
this.applyOrder(order, { keepWeights: true });
|
this.applyOrder(order, { keepWeights: true });
|
||||||
this.headerSaved = true;
|
this.headerSaved = true;
|
||||||
|
this.headerCollapsed = true;
|
||||||
this.clearWarehouseBin();
|
this.clearWarehouseBin();
|
||||||
this.syncCanScanFromStatus(order.audit_status);
|
this.syncCanScanFromStatus(order.audit_status);
|
||||||
this.showSuccess('保存成功,请先扫描仓位');
|
this.showSuccess('保存成功,请先扫描仓位', '保存成功', { voiceOnly: true });
|
||||||
this.registerOrderScanBroadcast();
|
this.registerOrderScanBroadcast();
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
@@ -584,6 +662,12 @@ export default {
|
|||||||
if (order) {
|
if (order) {
|
||||||
this.form.item_data = order.item_data;
|
this.form.item_data = order.item_data;
|
||||||
this.auditStatus = order.audit_status;
|
this.auditStatus = order.audit_status;
|
||||||
|
// 本单匹数/本单数量:取这张单的总匹数、总数量
|
||||||
|
this.scanDetail = {
|
||||||
|
...this.scanDetail,
|
||||||
|
order_roll: order.total_roll,
|
||||||
|
order_weight: order.total_weight,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(() => null);
|
.catch(() => null);
|
||||||
@@ -596,7 +680,8 @@ export default {
|
|||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
this.phoneContinuousScan = false;
|
this.phoneContinuousScan = false;
|
||||||
const message = e.message || (isDelete ? '删除失败' : '扫码失败');
|
const message = e.message || (isDelete ? '删除失败' : '扫码失败');
|
||||||
this.showError(message);
|
speak(isDelete ? '删除失败' : '扫码失败');
|
||||||
|
uni.showToast({ title: message, icon: 'none', duration: 2500 });
|
||||||
this.QRBarCode = '';
|
this.QRBarCode = '';
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -611,16 +696,16 @@ 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('操作成功');
|
this.showSuccess(util.statusSuccessVoice(action));
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
showError(message) {
|
showError(message) {
|
||||||
util.playErrorAudio();
|
util.playErrorAudio(message);
|
||||||
uni.showModal({ title: '提示', content: message, showCancel: false });
|
uni.showModal({ title: '提示', content: message, showCancel: false });
|
||||||
},
|
},
|
||||||
showSuccess(message) {
|
showSuccess(message, voiceText, options) {
|
||||||
util.playSuccessAudio();
|
util.playSuccessAudio(voiceText || message, options);
|
||||||
uni.showToast({ title: message, icon: 'success' });
|
uni.showToast({ title: message, icon: 'success' });
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,11 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="fabric-out-page">
|
<view class="fabric-out-page">
|
||||||
|
<OrderHeaderFold v-model="headerCollapsed" :summary="order.order_no">
|
||||||
<OrderStatusBar class="fabric-out-mt32" :status="order.audit_status" :name="order.audit_status_name" />
|
<OrderStatusBar class="fabric-out-mt32" :status="order.audit_status" :name="order.audit_status_name" />
|
||||||
|
|
||||||
<view class="flex-white-plr26 ptb10 bdb_f5">
|
|
||||||
<text class="mr26">进仓单号</text>
|
|
||||||
<text>{{ order.order_no }}</text>
|
|
||||||
</view>
|
|
||||||
<view class="flex-white-plr26 ptb20 bdb_f5">
|
<view class="flex-white-plr26 ptb20 bdb_f5">
|
||||||
<text class="mr26">供应商</text>
|
<text class="mr26">供应商</text>
|
||||||
<text>{{ order.biz_unit_name || '-' }}</text>
|
<text>{{ order.biz_unit_name || '-' }}</text>
|
||||||
@@ -44,6 +40,7 @@
|
|||||||
<text class="mr26">审核人</text>
|
<text class="mr26">审核人</text>
|
||||||
<text>{{ order.auditor_name }} {{ formatTime(order.audit_time, 'YYYY-MM-DD') }}</text>
|
<text>{{ order.auditor_name }} {{ formatTime(order.audit_time, 'YYYY-MM-DD') }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
</OrderHeaderFold>
|
||||||
|
|
||||||
<ProcessInDetailList
|
<ProcessInDetailList
|
||||||
:title="detailTitle"
|
:title="detailTitle"
|
||||||
@@ -58,6 +55,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import util from '@/common/util';
|
import util from '@/common/util';
|
||||||
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
|
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
|
||||||
|
import OrderHeaderFold from '@/components/storefabric/OrderHeaderFold.vue';
|
||||||
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
|
||||||
import ProcessInDetailList from '@/components/storegoods/ProcessInDetailList.vue';
|
import ProcessInDetailList from '@/components/storegoods/ProcessInDetailList.vue';
|
||||||
import {
|
import {
|
||||||
@@ -68,10 +66,11 @@ import {
|
|||||||
} from '@/common/storeGoodsPurchaseIn';
|
} from '@/common/storeGoodsPurchaseIn';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { OrderStatusBar, FabricOutFooter, ProcessInDetailList },
|
components: { OrderStatusBar, OrderHeaderFold, FabricOutFooter, ProcessInDetailList },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
orderId: 0,
|
orderId: 0,
|
||||||
|
headerCollapsed: true,
|
||||||
order: { item_data: [] },
|
order: { item_data: [] },
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -117,18 +116,25 @@ export default {
|
|||||||
confirmOrderStatusAction(this, {
|
confirmOrderStatusAction(this, {
|
||||||
orderId: this.orderId,
|
orderId: this.orderId,
|
||||||
action,
|
action,
|
||||||
onSuccess: () => this.$u.api.fpmPrcInOrder.detail({ id: this.orderId })
|
onSuccess: () => {
|
||||||
.then((res) => {
|
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
|
const voice = util.statusSuccessVoice(action);
|
||||||
|
util.playSuccessAudio(voice);
|
||||||
|
uni.showToast({ title: voice, icon: 'success' });
|
||||||
|
if (action === 'unapprove') {
|
||||||
|
uni.redirectTo({ url: `./storeGoodsPurchaseInEdit?id=${this.orderId}` });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return this.$u.api.fpmPrcInOrder.detail({ id: this.orderId })
|
||||||
|
.then((res) => {
|
||||||
const order = normalizeOrder(res);
|
const order = normalizeOrder(res);
|
||||||
if (order) this.order = order;
|
if (order) this.order = order;
|
||||||
util.playSuccessAudio();
|
});
|
||||||
uni.showToast({ title: '操作成功', icon: 'success' });
|
},
|
||||||
}),
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
showError(message) {
|
showError(message) {
|
||||||
util.playErrorAudio();
|
util.playErrorAudio(message);
|
||||||
uni.showModal({ title: '提示', content: message, showCancel: false });
|
uni.showModal({ title: '提示', content: message, showCancel: false });
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
+128
-83
@@ -4,17 +4,17 @@
|
|||||||
<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" style="font-size: 16px;"></view>
|
<view class="iconfont icon-arrow-down"></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -23,7 +23,6 @@
|
|||||||
<input class="u-input" type="text" v-model="customApiUrl" maxlength="100" placeholder="请输入服务器地址"
|
<input class="u-input" type="text" v-model="customApiUrl" maxlength="100" placeholder="请输入服务器地址"
|
||||||
@blur="handleBlurInputUrl" />
|
@blur="handleBlurInputUrl" />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
|
||||||
<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,8 +104,9 @@
|
|||||||
<!-- </view>-->
|
<!-- </view>-->
|
||||||
<!-- </view>-->
|
<!-- </view>-->
|
||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
<u-picker v-model="showApiUrlPicker" mode="selector" :range="apiUrlList" range-key="label"
|
<u-select class="login-env-picker" v-model="showApiUrlPicker" :list="apiUrlList" :default-value="apiUrlDefaultIndex"
|
||||||
@confirm="onApiUrlConfirm" @cancel="showApiUrlPicker = false"></u-picker>
|
title="选择服务器" :show-search="false" :item-height="88" :visible-item-count="5"
|
||||||
|
@confirm="onApiUrlConfirm" @cancel="showApiUrlPicker = false"></u-select>
|
||||||
<!-- 版本信息显示 -->
|
<!-- 版本信息显示 -->
|
||||||
<view class="version-info">
|
<view class="version-info">
|
||||||
<text class="version-text">版本: {{ appVersion }}</text>
|
<text class="version-text">版本: {{ appVersion }}</text>
|
||||||
@@ -125,6 +125,8 @@ import md5 from '@/common/md5.js';
|
|||||||
import manifest from '@/manifest.json';
|
import manifest from '@/manifest.json';
|
||||||
import { mapState } from 'vuex'
|
import { mapState } from 'vuex'
|
||||||
import app_upgrade from '@/uni_modules/app-upgrade/js_sdk/index.js'
|
import app_upgrade from '@/uni_modules/app-upgrade/js_sdk/index.js'
|
||||||
|
import { applyLoginData, applyUserInformation } from '@/common/userSession.js'
|
||||||
|
import { ensureScanConfigAfterLogin } from '@/common/scanAutoConfig.js'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -136,10 +138,10 @@ export default {
|
|||||||
password: ""
|
password: ""
|
||||||
},
|
},
|
||||||
showApiUrlPicker: false,
|
showApiUrlPicker: false,
|
||||||
// 根据环境设置默认URL和选项
|
// 登录默认正式环境,本地已选过的地址仍会在 onShow 里恢复
|
||||||
selectedApiUrl: config.isDevelopment ? config.devApiUrlOptions[0].value : config.productionApiUrl,
|
selectedApiUrl: (config.devApiUrlOptions.find(item => item.label === '正式环境') || {}).value || config.productionApiUrl,
|
||||||
customApiUrl: 'http://192.168.1.66:50002/hcscm/pda/v1',
|
customApiUrl: 'http://192.168.1.66:50002/hcscm/pda/v1',
|
||||||
apiUrlList: config.isDevelopment ? config.devApiUrlOptions : [],
|
apiUrlList: config.devApiUrlOptions,
|
||||||
phoneNo: '',
|
phoneNo: '',
|
||||||
//username: '',
|
//username: '',
|
||||||
//password: '',
|
//password: '',
|
||||||
@@ -159,17 +161,24 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
appName() {
|
||||||
|
return manifest.name || '';
|
||||||
|
},
|
||||||
appVersion() {
|
appVersion() {
|
||||||
return manifest.versionName;
|
return manifest.versionName;
|
||||||
},
|
},
|
||||||
envName() {
|
envName() {
|
||||||
return process.env.VUE_APP_ENV_NAME || '';
|
return process.env.VUE_APP_ENV_NAME || '';
|
||||||
|
},
|
||||||
|
apiUrlDefaultIndex() {
|
||||||
|
const list = this.apiUrlList || [];
|
||||||
|
let index = list.findIndex(item => item.value === this.selectedApiUrl);
|
||||||
|
if (index < 0) index = list.findIndex(item => item.label === '正式环境');
|
||||||
|
return [index >= 0 ? index : 0];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onShow() {
|
onShow() {
|
||||||
// 只在开发环境读取存储的URL
|
|
||||||
if (config.isDevelopment) {
|
|
||||||
uni.getStorage({
|
uni.getStorage({
|
||||||
key: 'ApiUrl',
|
key: 'ApiUrl',
|
||||||
success: (e) => {
|
success: (e) => {
|
||||||
@@ -177,7 +186,6 @@ export default {
|
|||||||
this.selectedApiUrl = e.data;
|
this.selectedApiUrl = e.data;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
uni.getStorage({
|
uni.getStorage({
|
||||||
key: 'UserInfo',
|
key: 'UserInfo',
|
||||||
@@ -218,9 +226,8 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
onApiUrlConfirm(e) {
|
onApiUrlConfirm(e) {
|
||||||
console.log('e', JSON.stringify(e));
|
const selectedValue = e && e[0] && e[0].value;
|
||||||
const selectedValue = this.apiUrlList[e[0]].value;
|
if (selectedValue == null) return;
|
||||||
console.log('selectedValue', selectedValue)
|
|
||||||
this.selectedApiUrl = selectedValue;
|
this.selectedApiUrl = selectedValue;
|
||||||
this.showApiUrlPicker = false;
|
this.showApiUrlPicker = false;
|
||||||
|
|
||||||
@@ -295,26 +302,27 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
isDefaultPassword(loginData) {
|
||||||
|
const value = loginData && loginData.is_default_password;
|
||||||
|
return value === true || value === 1 || value === '1' || value === 'true';
|
||||||
|
},
|
||||||
|
enterWorkbench(openPasswordPage) {
|
||||||
|
const url = openPasswordPage
|
||||||
|
? '/pages/sys/workbench/index?changePassword=1'
|
||||||
|
: '/pages/sys/workbench/index';
|
||||||
|
uni.reLaunch({ url });
|
||||||
|
},
|
||||||
submit(loginType = '1') {
|
submit(loginType = '1') {
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '登录中...'
|
title: '登录中...'
|
||||||
});
|
});
|
||||||
|
|
||||||
let currentApiUrl;
|
const currentApiUrl = this.selectedApiUrl === 'custom' ? this.customApiUrl : this.selectedApiUrl;
|
||||||
|
|
||||||
if (config.isDevelopment) {
|
|
||||||
// 开发环境:使用选择的URL
|
|
||||||
currentApiUrl = this.selectedApiUrl === 'custom' ? this.customApiUrl : this.selectedApiUrl;
|
|
||||||
if (!currentApiUrl || currentApiUrl.length === 0) {
|
if (!currentApiUrl || currentApiUrl.length === 0) {
|
||||||
this.$u.toast('请输入服务器地址');
|
this.$u.toast('请输入服务器地址');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 更新store中的URL
|
|
||||||
this.$store.dispatch('updateApiUrl', currentApiUrl);
|
this.$store.dispatch('updateApiUrl', currentApiUrl);
|
||||||
} else {
|
|
||||||
// 生产环境:使用固定的生产URL
|
|
||||||
currentApiUrl = config.productionApiUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.login.username.length == 0) {
|
if (this.login.username.length == 0) {
|
||||||
this.$u.toast('请输入账号');
|
this.$u.toast('请输入账号');
|
||||||
@@ -334,65 +342,70 @@ export default {
|
|||||||
this.$u.api.pdaLogin({
|
this.$u.api.pdaLogin({
|
||||||
'phone': this.login.username,
|
'phone': this.login.username,
|
||||||
'password': this.login.password,
|
'password': this.login.password,
|
||||||
}).then((res) => {
|
}).then(async (res) => {
|
||||||
console.log('login res', res)
|
console.log('login res', res)
|
||||||
var aLoginUserData = res;
|
var aLoginUserData = res;
|
||||||
|
|
||||||
//console.log('--aLoginUserData->>' + JSON.stringify(aLoginUserData));
|
//console.log('--aLoginUserData->>' + JSON.stringify(aLoginUserData));
|
||||||
// 只在开发环境保存 apiurl 到本地存储
|
|
||||||
if (config.isDevelopment) {
|
|
||||||
uni.setStorage({
|
uni.setStorage({
|
||||||
key: 'ApiUrl',
|
key: 'ApiUrl',
|
||||||
data: currentApiUrl
|
data: currentApiUrl
|
||||||
});
|
});
|
||||||
util.updateApiUrl(currentApiUrl);
|
util.updateApiUrl(currentApiUrl);
|
||||||
}
|
|
||||||
// 保存 token 到本地存储
|
// 保存 token 到本地存储
|
||||||
uni.setStorageSync('RemoteTokenData', aLoginUserData);
|
uni.setStorageSync('RemoteTokenData', aLoginUserData);
|
||||||
|
|
||||||
uni.setStorage({
|
applyLoginData(aLoginUserData);
|
||||||
key: 'userToken',
|
|
||||||
data: {
|
try {
|
||||||
Token: aLoginUserData.token,
|
const userInfo = await this.$u.api.pdaGetInformation();
|
||||||
|
console.log('information res', userInfo);
|
||||||
|
applyUserInformation(userInfo);
|
||||||
|
} catch (infoError) {
|
||||||
|
console.log('information error', infoError);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
getApp().globalData.Token = aLoginUserData.token;
|
try {
|
||||||
getApp().globalData.EmployeeID = aLoginUserData.user_id;
|
await ensureScanConfigAfterLogin(this.$u.api);
|
||||||
getApp().globalData.IsSaleUserStatus = 0;
|
} catch (scanError) {
|
||||||
getApp().globalData.LoginID = aLoginUserData.user_id;
|
console.log('自动匹配扫码设置失败', scanError);
|
||||||
getApp().globalData.LoginName = aLoginUserData.user_name;
|
}
|
||||||
getApp().globalData.PlanDepartmentID = aLoginUserData.default_sale_system_id;
|
|
||||||
getApp().globalData.PlanDepartmentName = aLoginUserData.default_sale_system_name;
|
|
||||||
getApp().globalData.UserGroup = '';
|
|
||||||
getApp().globalData.StoreNameID = aLoginUserData.default_physical_warehouse_id;
|
|
||||||
getApp().globalData.StoreName = aLoginUserData.default_physical_warehouse_name;
|
|
||||||
getApp().globalData.StoreTypeNo = '';
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.reLaunch({
|
|
||||||
url: '/pages/sys/workbench/index'
|
|
||||||
});
|
|
||||||
}, 500);
|
|
||||||
|
|
||||||
var that = this
|
if (this.remember == true) {
|
||||||
if (that.remember == true) {
|
|
||||||
if ((this.login.username.length > 0) && (this.login.password.length > 0)) {
|
if ((this.login.username.length > 0) && (this.login.password.length > 0)) {
|
||||||
uni.setStorage({
|
uni.setStorage({
|
||||||
key: 'UserInfo',
|
key: 'UserInfo',
|
||||||
data: that.login
|
data: this.login
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$store.dispatch('initNotification');
|
||||||
|
uni.hideLoading();
|
||||||
|
|
||||||
|
if (this.isDefaultPassword(aLoginUserData)) {
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '当前使用的是默认密码,请及时修改密码',
|
||||||
|
confirmText: '去修改',
|
||||||
|
cancelText: '稍后',
|
||||||
|
success: (modalRes) => {
|
||||||
|
this.enterWorkbench(!!(modalRes && modalRes.confirm));
|
||||||
|
},
|
||||||
|
fail: () => {
|
||||||
|
this.enterWorkbench(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
title: '登录成功!'
|
title: '登录成功!'
|
||||||
});
|
});
|
||||||
this.$store.dispatch('initNotification');
|
setTimeout(() => {
|
||||||
setTimeout(function () {
|
this.enterWorkbench(false);
|
||||||
uni.hideLoading();
|
}, 500);
|
||||||
}, 1000);
|
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
console.log('login error', error)
|
console.log('login error', error)
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@@ -414,61 +427,54 @@ export default {
|
|||||||
qqLogin() {
|
qqLogin() {
|
||||||
this.$u.toast('QQ 登录');
|
this.$u.toast('QQ 登录');
|
||||||
},
|
},
|
||||||
// 自动检查版本更新
|
// 自动检查版本更新(有新版本才弹窗,已是最新不提示)
|
||||||
autoCheckUpgrade() {
|
autoCheckUpgrade() {
|
||||||
console.log('autoCheckUpgrade 开始执行');
|
this.runUpgradeCheck({ silentWhenLatest: true });
|
||||||
|
},
|
||||||
|
runUpgradeCheck({ silentWhenLatest }) {
|
||||||
const self = this;
|
const self = this;
|
||||||
|
app_upgrade(async () => {
|
||||||
app_upgrade(async (versionCode) => {
|
|
||||||
console.log('app_upgrade 回调被执行, versionCode:', versionCode);
|
|
||||||
try {
|
try {
|
||||||
// 获取应用信息
|
|
||||||
const appInfo = await new Promise((resolve) => {
|
const appInfo = await new Promise((resolve) => {
|
||||||
plus.runtime.getProperty(plus.runtime.appid, (inf) => {
|
plus.runtime.getProperty(plus.runtime.appid, (inf) => {
|
||||||
resolve(inf);
|
resolve(inf);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
console.log('appInfo:', appInfo);
|
|
||||||
|
|
||||||
const res = await self.$u.api.upgradeCheck({
|
const res = await self.$u.api.upgradeCheck({
|
||||||
app_name: config.upgradeName,
|
app_name: config.upgradeName,
|
||||||
current_version: appInfo.version
|
current_version: appInfo.version
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log('自动检查版本更新结果:', res);
|
|
||||||
|
|
||||||
if (!res || !res.download_url) {
|
if (!res || !res.download_url) {
|
||||||
// 当前已是最新版本,不提示
|
if (!silentWhenLatest) {
|
||||||
console.log('当前已是最新版本');
|
self.$u.toast('当前版本已是最新版');
|
||||||
|
}
|
||||||
return { status: 0 };
|
return { status: 0 };
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
changelog: res.message + ',最新版本:' + res.latest_version,
|
changelog: res.message + ',最新版本:' + res.latest_version,
|
||||||
status: res.need_update ? 1 : 0, // 0 无新版本 | 1 有新版本
|
status: res.need_update ? 1 : 0,
|
||||||
path: res.download_url // 新apk地址
|
path: res.download_url
|
||||||
};
|
};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('检查版本更新失败:', error);
|
console.log('检查版本更新失败:', error);
|
||||||
|
if (!silentWhenLatest) {
|
||||||
|
self.$u.toast('检查更新失败,请稍后重试');
|
||||||
|
}
|
||||||
return { status: 0 };
|
return { status: 0 };
|
||||||
}
|
}
|
||||||
}, 1); // 使用 type=1 强制检查,跳过时间戳检查
|
}, 1);
|
||||||
},
|
},
|
||||||
|
|
||||||
handleBlurInputUrl(e) {
|
handleBlurInputUrl(e) {
|
||||||
// 只在开发环境处理自定义URL
|
|
||||||
if (config.isDevelopment) {
|
|
||||||
const url = e.detail.value.trim();
|
const url = e.detail.value.trim();
|
||||||
if (url) {
|
if (url) {
|
||||||
this.customApiUrl = url;
|
this.customApiUrl = url;
|
||||||
// 保存到本地存储
|
|
||||||
uni.setStorage({
|
uni.setStorage({
|
||||||
key: 'ApiUrl',
|
key: 'ApiUrl',
|
||||||
data: url
|
data: url
|
||||||
});
|
});
|
||||||
util.updateApiUrl(url);
|
util.updateApiUrl(url);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -476,14 +482,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 +516,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 {
|
||||||
@@ -585,16 +611,35 @@ export default {
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
padding: 0 24rpx 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.version-text {
|
.version-text {
|
||||||
font-size: 24rpx;
|
font-size: 32rpx;
|
||||||
color: #999999;
|
color: #999999;
|
||||||
}
|
}
|
||||||
|
|
||||||
.env-text {
|
.env-text {
|
||||||
font-size: 24rpx;
|
font-size: 32rpx;
|
||||||
color: #5473e8;
|
color: #5473e8;
|
||||||
margin-left: 10rpx;
|
margin-left: 10rpx;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.login-env-picker {
|
||||||
|
::v-deep .u-select__header,
|
||||||
|
::v-deep .u-select__header__btn {
|
||||||
|
height: 100rpx;
|
||||||
|
font-size: 36rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .u-select__header__title {
|
||||||
|
font-size: 36rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .u-select__body__picker-view__item,
|
||||||
|
::v-deep .u-line-1 {
|
||||||
|
font-size: 40rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
+115
-40
@@ -36,25 +36,34 @@
|
|||||||
!-->
|
!-->
|
||||||
</view>
|
</view>
|
||||||
<view class="list">
|
<view class="list">
|
||||||
<view>
|
|
||||||
<u-cell-group class="personal-list">
|
|
||||||
<u-gap height="20" bg-color="#f5f5f5"></u-gap>
|
<u-gap height="20" bg-color="#f5f5f5"></u-gap>
|
||||||
<u-cell-item icon="question-circle" :iconStyle="{ color: '#ff8d06' }" title="常见问题" @click="navTo('problem')"></u-cell-item>
|
<u-cell-group class="personal-list" :border="false">
|
||||||
<u-cell-item icon="kefu-ermai" :iconStyle="{ color: '#5f8dff' }" title="意见反馈" @click="navTo('comment')"></u-cell-item>
|
<u-cell-item icon="question-circle" :iconStyle="{ color: '#ff8d06' }" title="常见问题" :center="true" @click="navTo('problem')"></u-cell-item>
|
||||||
<u-cell-item icon="map" :iconStyle="{ color: '#316ede' }" title="账号安全" @click="navTo('pwd')"></u-cell-item>
|
<u-cell-item icon="kefu-ermai" :iconStyle="{ color: '#5f8dff' }" title="意见反馈" :center="true" @click="navTo('comment')"></u-cell-item>
|
||||||
<u-cell-item icon="scan" :iconStyle="{ color: '#36cfc9' }" title="扫描设置" @click="navTo('scan-settings')"></u-cell-item>
|
<u-cell-item icon="lock" :iconStyle="{ color: '#316ede' }" title="修改密码" :center="true" @click="navTo('pwd')"></u-cell-item>
|
||||||
<u-cell-item icon="order" :iconStyle="{ color: '#59bdf9' }" title="清除缓存" @click="navTo('clear-cache')"></u-cell-item>
|
<u-cell-item icon="scan" :iconStyle="{ color: '#36cfc9' }" title="扫描设置" :center="true" @click="navTo('scan-settings')"></u-cell-item>
|
||||||
<!--<u-cell-item icon="account" :iconStyle="{ color: '#27c0dc' }" title="关于我们" @click="navTo('about')"></u-cell-item>
|
<u-cell-item icon="order" :iconStyle="{ color: '#59bdf9' }" title="清除缓存" :center="true" @click="navTo('clear-cache')"></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-cell-item icon="setting" :iconStyle="{ color: '#2767dc' }" title="系统设置" @click="navTo('setting')"></u-cell-item>
|
|
||||||
</u-cell-group>
|
</u-cell-group>
|
||||||
|
<u-gap height="20" bg-color="#f5f5f5"></u-gap>
|
||||||
|
<u-cell-group class="personal-list" :border="false">
|
||||||
|
<u-cell-item icon="reload" :iconStyle="{ color: '#19be6b' }" title="版本更新" :center="true" @click="upgrade"></u-cell-item>
|
||||||
|
<u-cell-item icon="setting" :iconStyle="{ color: '#2767dc' }" title="系统设置" :center="true" @click="navTo('setting')"></u-cell-item>
|
||||||
|
</u-cell-group>
|
||||||
|
<u-gap height="20" bg-color="#f5f5f5"></u-gap>
|
||||||
|
<u-button class="sign-out logout-btn" @click="logout" :hair-line="false">退出登录</u-button>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="app-meta">
|
||||||
|
<text class="app-name">{{ appName }}</text>
|
||||||
|
<text class="app-version">版本 {{ appVersion }}</text>
|
||||||
</view>
|
</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 { clearUserSession } from '@/common/userSession.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.
|
||||||
*/
|
*/
|
||||||
@@ -69,10 +78,16 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
this.loginUserName = getApp().globalData.UserName;
|
this.loginUserName = getApp().globalData.UserName || (this.vuex_user && this.vuex_user.user_name) || '';
|
||||||
},
|
},
|
||||||
|
|
||||||
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 + '/');
|
||||||
@@ -88,61 +103,121 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
logout() {
|
logout() {
|
||||||
this.$u.api.logout().then(res => {
|
const goLogin = () => {
|
||||||
this.$u.toast(res.msg);
|
clearUserSession();
|
||||||
if (res.code == '200' || res.code == '401') {
|
|
||||||
let self = this;
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/sys/login/index'
|
url: '/pages/sys/login/index'
|
||||||
});
|
});
|
||||||
}, 500);
|
};
|
||||||
}
|
this.$u.api.pdaLogout().then(() => {
|
||||||
|
goLogin();
|
||||||
|
}).catch((error) => {
|
||||||
|
console.log('logout error', error);
|
||||||
|
goLogin();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
@import '@/common/pda-typography.scss';
|
||||||
@import 'index.scss';
|
@import 'index.scss';
|
||||||
page {
|
page {
|
||||||
background-color: #f5f5f5;
|
background-color: #f5f5f5;
|
||||||
}
|
}
|
||||||
.wrap .u-cell-box .u-cell_title{
|
.header {
|
||||||
color:#202328;
|
.userinfo {
|
||||||
|
position: relative;
|
||||||
|
padding: 20rpx 30rpx 24rpx;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.info {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.username {
|
||||||
|
font-size: $pda-font-body;
|
||||||
|
line-height: 1.3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.list {
|
||||||
|
.personal-list {
|
||||||
|
::v-deep .u-cell {
|
||||||
|
min-height: $pda-row-min-height;
|
||||||
|
padding: 24rpx 30rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
::v-deep .u-cell_title {
|
||||||
|
color: #202328;
|
||||||
|
font-size: $pda-font-body;
|
||||||
|
line-height: 1.3;
|
||||||
|
}
|
||||||
|
::v-deep .u-cell__left-icon-wrap {
|
||||||
|
margin-right: 20rpx;
|
||||||
|
}
|
||||||
|
::v-deep .u-cell__right-icon-wrap {
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.sign-in-images{
|
.sign-in-images{
|
||||||
width: 125rpx;
|
width: 125rpx;
|
||||||
height:50rpx;
|
height:50rpx;
|
||||||
position: absolute;
|
flex-shrink: 0;
|
||||||
right: 0;
|
uni-image, image {
|
||||||
top:5px;
|
|
||||||
uni-image{
|
|
||||||
width: 125rpx;
|
width: 125rpx;
|
||||||
height:50rpx;
|
height:50rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.app-meta {
|
||||||
|
padding: 48rpx 30rpx 40rpx;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.app-name {
|
||||||
|
display: block;
|
||||||
|
color: #242820;
|
||||||
|
font-size: $pda-font-body;
|
||||||
|
font-weight: 700;
|
||||||
|
line-height: 1.4;
|
||||||
|
}
|
||||||
|
.app-version {
|
||||||
|
display: block;
|
||||||
|
margin-top: 8rpx;
|
||||||
|
color: #8a8f86;
|
||||||
|
font-size: $pda-font-nav-sub;
|
||||||
|
line-height: 1.3;
|
||||||
|
}
|
||||||
|
.logout-btn {
|
||||||
|
min-height: $pda-row-min-height;
|
||||||
|
font-size: $pda-font-body;
|
||||||
|
line-height: $pda-row-min-height;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
+32
-15
@@ -33,7 +33,7 @@ export default {
|
|||||||
model: {
|
model: {
|
||||||
oldPassword: '',
|
oldPassword: '',
|
||||||
newPassword: '',
|
newPassword: '',
|
||||||
confirmNewPassword: ''
|
confirmPassword: ''
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
oldPassword: [
|
oldPassword: [
|
||||||
@@ -79,26 +79,27 @@ export default {
|
|||||||
submit() {
|
submit() {
|
||||||
this.$refs.uForm.validate(valid => {
|
this.$refs.uForm.validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$u.api.user.infoSavePwd({
|
this.$u.api.updatePassword({
|
||||||
oldPassword: this.model.oldPassword,
|
old_password: this.model.oldPassword,
|
||||||
newPassword: this.model.newPassword
|
new_password: this.model.newPassword
|
||||||
}).then(res => {
|
}).then(() => {
|
||||||
if(res.code == '200'){
|
const saved = uni.getStorageSync('UserInfo');
|
||||||
|
if (saved && typeof saved === 'object') {
|
||||||
|
uni.setStorageSync('UserInfo', {
|
||||||
|
...saved,
|
||||||
|
password: this.model.newPassword
|
||||||
|
});
|
||||||
|
}
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
content: res.msg,
|
content: '密码修改成功',
|
||||||
showCancel: false,
|
showCancel: false,
|
||||||
success: function () {
|
success: function () {
|
||||||
uni.navigateBack();
|
uni.navigateBack();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}else{
|
}).catch((error) => {
|
||||||
uni.showModal({
|
console.log('updatePassword error', error);
|
||||||
title: '提示',
|
|
||||||
content: res.msg,
|
|
||||||
showCancel: false
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.$u.toast('您填写的信息有误,请根据提示修正。');
|
this.$u.toast('您填写的信息有误,请根据提示修正。');
|
||||||
@@ -112,15 +113,31 @@ export default {
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
@import '@/common/pda-typography.scss';
|
||||||
page{
|
page{
|
||||||
background: #f5f5f5;
|
background: #f5f5f5;
|
||||||
}
|
}
|
||||||
.u-form{
|
.u-form{
|
||||||
background: #fff;
|
background: #fff;
|
||||||
padding: 0px 15px;
|
padding: 0 30rpx;
|
||||||
}
|
}
|
||||||
.remind-text{
|
.remind-text{
|
||||||
padding: 20rpx 30rpx;
|
padding: 20rpx 30rpx;
|
||||||
color: #666666;
|
color: #666666;
|
||||||
|
font-size: $pda-font-popup-sub;
|
||||||
|
line-height: 1.4;
|
||||||
|
}
|
||||||
|
.form-footer {
|
||||||
|
padding: 40rpx 30rpx;
|
||||||
|
}
|
||||||
|
::v-deep .u-form-item--left__content__label {
|
||||||
|
font-size: $pda-font-body;
|
||||||
|
}
|
||||||
|
::v-deep .u-input__input {
|
||||||
|
font-size: $pda-font-body;
|
||||||
|
}
|
||||||
|
::v-deep .u-btn {
|
||||||
|
height: $pda-button-height;
|
||||||
|
font-size: $pda-font-button;
|
||||||
}
|
}
|
||||||
</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,7 @@ export default {
|
|||||||
this.useFallbackConfigList();
|
this.useFallbackConfigList();
|
||||||
}
|
}
|
||||||
this.ensurePhoneScanOption();
|
this.ensurePhoneScanOption();
|
||||||
|
this.ensureNlscanOption();
|
||||||
this.initFormFromSaved();
|
this.initFormFromSaved();
|
||||||
},
|
},
|
||||||
useFallbackConfigList() {
|
useFallbackConfigList() {
|
||||||
@@ -110,6 +111,24 @@ export default {
|
|||||||
this.configList.push(phoneConfig);
|
this.configList.push(phoneConfig);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
ensureNlscanOption() {
|
||||||
|
const nlscanConfig = this.getScannerConfigs().find((item) => item.brand === 'nlscan');
|
||||||
|
if (!nlscanConfig) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const exists = this.configList.some((item) => {
|
||||||
|
return item.brand === nlscanConfig.brand || item.action === nlscanConfig.action;
|
||||||
|
});
|
||||||
|
if (exists) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const phoneIndex = this.configList.findIndex((item) => item.brand === PHONE_SCAN_BRAND);
|
||||||
|
if (phoneIndex >= 0) {
|
||||||
|
this.configList.splice(phoneIndex, 0, nlscanConfig);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.configList.push(nlscanConfig);
|
||||||
|
},
|
||||||
initFormFromSaved() {
|
initFormFromSaved() {
|
||||||
const savedConfig = getScanConfig(this.getScannerConfigs());
|
const savedConfig = getScanConfig(this.getScannerConfigs());
|
||||||
if (savedConfig) {
|
if (savedConfig) {
|
||||||
|
|||||||
@@ -4,23 +4,15 @@
|
|||||||
<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>
|
||||||
<u-gap height="20" bg-color="#f5f5f5"></u-gap>
|
|
||||||
<view>
|
|
||||||
<u-button class="sign-out" @click="logout" :hair-line="false">退出登录</u-button>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
/**
|
/**
|
||||||
* 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() {
|
||||||
@@ -34,36 +26,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({
|
||||||
@@ -82,30 +44,6 @@ export default {
|
|||||||
// #ifndef APP-PLUS
|
// #ifndef APP-PLUS
|
||||||
this.$u.toast('小程序端或H5端已是最新版,无需检查更新!');
|
this.$u.toast('小程序端或H5端已是最新版,无需检查更新!');
|
||||||
// #endif
|
// #endif
|
||||||
},
|
|
||||||
logout() {
|
|
||||||
this.$u.api.pdaLogout().then(res => {
|
|
||||||
console.log('res',res)
|
|
||||||
if (res.code != 0) {
|
|
||||||
// this.$u.toast('退出登录失败');
|
|
||||||
uni.reLaunch({
|
|
||||||
url: '/pages/sys/login/index'
|
|
||||||
});
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// 清除token和用户信息
|
|
||||||
uni.removeStorageSync('token');
|
|
||||||
this.$store.dispatch('updateUserInfo', null);
|
|
||||||
uni.reLaunch({
|
|
||||||
url: '/pages/sys/login/index'
|
|
||||||
});
|
|
||||||
}).catch(error => {
|
|
||||||
console.log('error',error)
|
|
||||||
// 即使退出登录失败,也要清除本地token和用户信息
|
|
||||||
uni.removeStorageSync('token');
|
|
||||||
this.$store.dispatch('updateUserInfo', null);
|
|
||||||
// this.$u.toast('退出登录失败');
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
+312
-103
@@ -1,63 +1,51 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="wrap">
|
<view class="workbench-page">
|
||||||
<common-navbar title="工作台" :showBack="false">
|
<common-navbar
|
||||||
|
title="应用中心"
|
||||||
|
:showBack="false"
|
||||||
|
backgroundColor="#f4f5e8"
|
||||||
|
:showShadow="false"
|
||||||
|
>
|
||||||
|
<template #left>
|
||||||
|
<text class="app-version">v{{ appVersion }}</text>
|
||||||
|
</template>
|
||||||
<template #right>
|
<template #right>
|
||||||
<view class="scan_box">
|
<view class="settings-entry" @click="openSettings">
|
||||||
<u-icon name="scan" color="#333333" size="46" @click="handleScan"></u-icon>
|
<u-icon name="setting-fill" color="#242820" size="32"></u-icon>
|
||||||
|
<text class="settings-text">设置</text>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</common-navbar>
|
</common-navbar>
|
||||||
<view class="workbench-title">销售管理</view>
|
|
||||||
<view class="toolbar">
|
<view class="menu-grid">
|
||||||
<u-grid class="grid" :col="4" :border="false">
|
<view
|
||||||
<u-grid-item :index="0" @click="navTo('/pages/saleship/salepickscan')">
|
v-for="(item, index) in visibleMenuItems"
|
||||||
<view class="home-icon icon-color05">
|
:key="item.router"
|
||||||
<i class="iconfont icon-hetongguanli"></i>
|
class="menu-card"
|
||||||
|
:class="`menu-card--${index % 6}`"
|
||||||
|
hover-class="menu-card--active"
|
||||||
|
@click="navTo(item.url)"
|
||||||
|
>
|
||||||
|
<image class="card-background" :src="staticSrc(item.backgroundImage)" mode="aspectFit"></image>
|
||||||
|
<view class="card-scrim"></view>
|
||||||
|
<text class="card-mark">“</text>
|
||||||
|
<view class="card-content">
|
||||||
|
<view class="card-title">{{ item.name }}</view>
|
||||||
|
<view class="card-subtitle">{{ item.subtitle }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="grid-text">成品配布</view>
|
<view class="card-arrow">
|
||||||
</u-grid-item>
|
<u-icon name="arrow-right" color="#5b6257" size="22"></u-icon>
|
||||||
<!-- <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>
|
||||||
<view class="workbench-title">成品管理</view>
|
|
||||||
<view class="toolbar">
|
|
||||||
<u-grid class="grid" :col="4" :border="false">
|
|
||||||
<u-grid-item :index="2" @click="navTo('/pages/storegoods/storeGoodsProcessInList')">
|
|
||||||
<view class="home-icon icon-color04">
|
|
||||||
<i class="iconfont icon-hetongguanli"></i>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="grid-text">加工进仓</view>
|
<view v-if="!visibleMenuItems.length" class="empty-state">暂无可用功能</view>
|
||||||
</u-grid-item>
|
|
||||||
<u-grid-item :index="3" @click="navTo('/pages/storegoods/storeGoodsProcessOutList')">
|
|
||||||
<view class="home-icon icon-color05">
|
|
||||||
<i class="iconfont icon-hetongguanli"></i>
|
|
||||||
</view>
|
|
||||||
<view class="grid-text">加工出仓</view>
|
|
||||||
</u-grid-item>
|
|
||||||
<u-grid-item :index="4" @click="navTo('/pages/storegoods/storeGoodsProcessReturnInList')">
|
|
||||||
<view class="home-icon icon-color02">
|
|
||||||
<i class="iconfont icon-hetongguanli"></i>
|
|
||||||
</view>
|
|
||||||
<view class="grid-text">加工退货进仓</view>
|
|
||||||
</u-grid-item>
|
|
||||||
<u-grid-item :index="5" @click="navTo('/pages/storegoods/storeGoodsPurchaseInList')">
|
|
||||||
<view class="home-icon icon-color03">
|
|
||||||
<i class="iconfont icon-hetongguanli"></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 CommonNavbar from "@/components/common-navbar/index";
|
||||||
import scanMixin from '@/common/scanMixin.js';
|
import scanMixin from '@/common/scanMixin.js';
|
||||||
|
import { hasResourceRouter } from '@/common/userSession.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.
|
||||||
*/
|
*/
|
||||||
@@ -76,24 +64,104 @@ export default {
|
|||||||
//{image: '/static/aidex/banner/banner03.png'}
|
//{image: '/static/aidex/banner/banner03.png'}
|
||||||
],
|
],
|
||||||
todoCount: 3,
|
todoCount: 3,
|
||||||
// scanReceiver 和 isPageActive 已由 scanMixin 提供
|
menuGroups: [
|
||||||
|
{
|
||||||
|
title: '销售管理',
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
name: '成品配布',
|
||||||
|
subtitle: 'FINISHED GOODS',
|
||||||
|
backgroundImage: '/static/workbench/finished-goods.png',
|
||||||
|
url: '/pages/saleship/salepickscan',
|
||||||
|
router: 'CashCommodityClothOrder',
|
||||||
|
icon: 'icon-hetongguanli',
|
||||||
|
color: 'icon-color05'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '成品管理',
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
name: '加工进仓',
|
||||||
|
subtitle: 'PROCESSING IN',
|
||||||
|
backgroundImage: '/static/workbench/processing-in.png',
|
||||||
|
url: '/pages/storegoods/storeGoodsProcessInList',
|
||||||
|
router: 'FpProcessingEntryOrder',
|
||||||
|
icon: 'icon-hetongguanli',
|
||||||
|
color: 'icon-color04'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '加工出仓',
|
||||||
|
subtitle: 'PROCESSING OUT',
|
||||||
|
backgroundImage: '/static/workbench/processing-out.png',
|
||||||
|
url: '/pages/storegoods/storeGoodsProcessOutList',
|
||||||
|
router: 'FpProcessingDeliverFromGodownOrder',
|
||||||
|
icon: 'icon-hetongguanli',
|
||||||
|
color: 'icon-color05'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '加工退货进仓',
|
||||||
|
subtitle: 'RETURN ENTRY',
|
||||||
|
backgroundImage: '/static/workbench/return-entry.png',
|
||||||
|
url: '/pages/storegoods/storeGoodsProcessReturnInList',
|
||||||
|
router: 'FpProcessingReturnEntryOrder',
|
||||||
|
icon: 'icon-hetongguanli',
|
||||||
|
color: 'icon-color02'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '采购进仓',
|
||||||
|
subtitle: 'PURCHASE ENTRY',
|
||||||
|
backgroundImage: '/static/workbench/purchase-entry.png',
|
||||||
|
url: '/pages/storegoods/storeGoodsPurchaseInList',
|
||||||
|
router: 'FinishPurchaseWarehouseEntry',
|
||||||
|
icon: 'icon-hetongguanli',
|
||||||
|
color: 'icon-color03'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
onLoad() {
|
onLoad(options) {
|
||||||
this.registerScanBroadcast(this.handleScanCode);
|
this.registerScanBroadcast(this.handleScanCode);
|
||||||
|
if (options && String(options.changePassword) === '1') {
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/sys/user/pwd'
|
||||||
|
});
|
||||||
|
}, 300);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// onUnload, onHide, onShow 已由 scanMixin 自动处理
|
// onUnload, onHide, onShow 已由 scanMixin 自动处理
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
contentStyle() {
|
appVersion() {
|
||||||
const navHeight = getStatusBarHeight() + 44;
|
return manifest.versionName;
|
||||||
return {
|
|
||||||
height: `${navHeight}px`,
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
|
visibleMenuGroups() {
|
||||||
|
return this.menuGroups
|
||||||
|
.map((group) => ({
|
||||||
|
...group,
|
||||||
|
items: group.items.filter((item) => hasResourceRouter(item.router))
|
||||||
|
}))
|
||||||
|
.filter((group) => group.items.length > 0);
|
||||||
|
},
|
||||||
|
visibleMenuItems() {
|
||||||
|
return this.visibleMenuGroups.reduce((items, group) => {
|
||||||
|
return items.concat(group.items);
|
||||||
|
}, []);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
staticSrc(path) {
|
||||||
|
let base = '';
|
||||||
|
// #ifdef H5
|
||||||
|
base = (process.env.BASE_URL || '/').replace(/\/$/, '');
|
||||||
|
// #endif
|
||||||
|
return `${base}${path}`;
|
||||||
|
},
|
||||||
// 自定义扫码处理回调 - 处理本页面特有的扫码逻辑
|
// 自定义扫码处理回调 - 处理本页面特有的扫码逻辑
|
||||||
handleScanCode(scanResult) {
|
handleScanCode(scanResult) {
|
||||||
console.log('工作台-扫码结果:', scanResult);
|
console.log('工作台-扫码结果:', scanResult);
|
||||||
@@ -108,6 +176,11 @@ export default {
|
|||||||
url: url,
|
url: url,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
openSettings() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/sys/user/setting'
|
||||||
|
});
|
||||||
|
},
|
||||||
imgListClick(index) {
|
imgListClick(index) {
|
||||||
console.log(`点击了第${index + 1}页图片`);
|
console.log(`点击了第${index + 1}页图片`);
|
||||||
},
|
},
|
||||||
@@ -177,63 +250,199 @@ export default {
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import "index.scss";
|
page {
|
||||||
|
min-height: 100%;
|
||||||
|
background: #f4f5e8;
|
||||||
|
}
|
||||||
|
|
||||||
.scan_box {
|
.workbench-page {
|
||||||
|
min-height: 100vh;
|
||||||
|
padding-bottom: 40rpx;
|
||||||
|
background:
|
||||||
|
linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0) 220rpx),
|
||||||
|
#f4f5e8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workbench-page .navbar_left,
|
||||||
|
.workbench-page .navbar_right {
|
||||||
|
min-width: 68px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workbench-page .navbar_center {
|
||||||
|
padding: 0 8px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.app-version {
|
||||||
|
color: #444a40;
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.settings-entry {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
align-items: center;
|
||||||
|
justify-content: flex-end;
|
||||||
|
color: #242820;
|
||||||
|
font-size: 26rpx;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.settings-text {
|
||||||
|
margin-left: 8rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-grid {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
padding: 14rpx 19rpx 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-card {
|
||||||
|
position: relative;
|
||||||
|
box-sizing: border-box;
|
||||||
|
width: calc(50% - 30rpx);
|
||||||
|
height: 218rpx;
|
||||||
|
margin: 14rpx 15rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
border-radius: 12rpx 28rpx 12rpx 28rpx;
|
||||||
|
color: #ffffff;
|
||||||
|
box-shadow: 0 12rpx 24rpx rgba(49, 58, 45, 0.14);
|
||||||
|
transition: transform 120ms ease, opacity 120ms ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-card--active {
|
||||||
|
opacity: 0.88;
|
||||||
|
transform: scale(0.97);
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-card--0 {
|
||||||
|
background: linear-gradient(145deg, #ed4052, #cf263e);
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-card--1 {
|
||||||
|
background: linear-gradient(145deg, #1787f0, #1768d6);
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-card--2 {
|
||||||
|
background: linear-gradient(145deg, #6558eb, #4639c8);
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-card--3 {
|
||||||
|
background: linear-gradient(145deg, #ff6a2b, #ea3d19);
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-card--4 {
|
||||||
|
background: linear-gradient(145deg, #149de4, #1977d1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-card--5 {
|
||||||
|
background: linear-gradient(145deg, #20bea8, #0c9789);
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-background {
|
||||||
|
position: absolute;
|
||||||
|
z-index: 0;
|
||||||
|
top: 18rpx;
|
||||||
|
right: -4rpx;
|
||||||
|
width: 150rpx;
|
||||||
|
height: 120rpx;
|
||||||
|
opacity: 0.72;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-scrim {
|
||||||
|
position: absolute;
|
||||||
|
z-index: 1;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
background: linear-gradient(105deg, rgba(0, 0, 0, 0.16) 0%, rgba(0, 0, 0, 0.02) 58%);
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-mark {
|
||||||
|
position: absolute;
|
||||||
|
z-index: 2;
|
||||||
|
top: 10rpx;
|
||||||
|
left: 18rpx;
|
||||||
|
color: rgba(255, 255, 255, 0.2);
|
||||||
|
font-family: Georgia, serif;
|
||||||
|
font-size: 74rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-content {
|
||||||
|
position: absolute;
|
||||||
|
z-index: 2;
|
||||||
|
right: 16rpx;
|
||||||
|
bottom: 42rpx;
|
||||||
|
left: 22rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-title {
|
||||||
|
overflow: hidden;
|
||||||
|
font-size: 40rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
line-height: 1.25;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-subtitle {
|
||||||
|
margin-top: 8rpx;
|
||||||
|
color: rgba(255, 255, 255, 0.76);
|
||||||
|
font-size: 22rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
letter-spacing: 1rpx;
|
||||||
|
line-height: 1.2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-arrow {
|
||||||
|
position: absolute;
|
||||||
|
z-index: 3;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
display: flex;
|
||||||
|
width: 48rpx;
|
||||||
|
height: 42rpx;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
border-radius: 8rpx 0 0 0;
|
||||||
|
background: rgba(244, 245, 232, 0.94);
|
||||||
|
}
|
||||||
|
|
||||||
.scan_text {
|
.empty-state {
|
||||||
font-size: 12px;
|
width: 100%;
|
||||||
color: #2979ff;
|
padding: 120rpx 0;
|
||||||
|
color: #7e8578;
|
||||||
|
font-size: 28rpx;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 350px) {
|
||||||
|
.menu-grid {
|
||||||
|
padding-right: 15rpx;
|
||||||
|
padding-left: 15rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-card {
|
||||||
|
width: calc(50% - 22rpx);
|
||||||
|
height: 206rpx;
|
||||||
|
margin-right: 11rpx;
|
||||||
|
margin-left: 11rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-title {
|
||||||
|
font-size: 36rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.banner-box {
|
@media (prefers-reduced-motion: reduce) {
|
||||||
padding: 0 2%;
|
.menu-card {
|
||||||
width: 96%;
|
transition: none;
|
||||||
height: 170rpx;
|
}
|
||||||
margin: 30rpx 0 30rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.u-swiper-wrap {
|
|
||||||
padding: 0 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner-pic {
|
|
||||||
width: 47%;
|
|
||||||
float: left;
|
|
||||||
display: inline-block;
|
|
||||||
margin: 0 1.5%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.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;
|
|
||||||
padding: 15px 30rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.home-icon i.icon-tongzhi {
|
|
||||||
font-size: 22px;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 2.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
+20
-27
@@ -19,29 +19,14 @@ try{
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 本分支统一使用 hcscm 服务前缀
|
|
||||||
function normalizeApiUrl(url) {
|
|
||||||
return String(url || '').replace(/hcscm_weave/g, 'hcscm');
|
|
||||||
}
|
|
||||||
|
|
||||||
// 初始化API URL
|
// 初始化API URL
|
||||||
function initApiUrl() {
|
function initApiUrl() {
|
||||||
if (config.isDevelopment) {
|
const fallbackUrl = (config.devApiUrlOptions.find(item => item.label === '正式环境') || {}).value || config.productionApiUrl;
|
||||||
// 开发环境:从存储读取,如果没有则使用测试环境
|
|
||||||
try {
|
try {
|
||||||
const savedApiUrl = uni.getStorageSync('ApiUrl');
|
return uni.getStorageSync('ApiUrl') || fallbackUrl;
|
||||||
const url = normalizeApiUrl(savedApiUrl || config.devApiUrlOptions[0].value);
|
|
||||||
if (savedApiUrl && url !== savedApiUrl) {
|
|
||||||
uni.setStorageSync('ApiUrl', url);
|
|
||||||
}
|
|
||||||
return url;
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log('读取存储的 apiurl 失败', e);
|
console.log('读取存储的 apiurl 失败', e);
|
||||||
return config.devApiUrlOptions[0].value;
|
return fallbackUrl;
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// 生产环境:使用固定的生产URL
|
|
||||||
return normalizeApiUrl(config.productionApiUrl);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,15 +99,8 @@ const store = new Vuex.Store({
|
|||||||
state.vuex_notificationAudio = audio;
|
state.vuex_notificationAudio = audio;
|
||||||
},
|
},
|
||||||
SET_API_URL(state, url) {
|
SET_API_URL(state, url) {
|
||||||
// 生产环境不允许修改URL
|
state.apiurl = url
|
||||||
if (!config.isDevelopment) {
|
uni.setStorageSync('ApiUrl', url)
|
||||||
console.warn('生产环境不允许修改API URL');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const nextUrl = normalizeApiUrl(url);
|
|
||||||
state.apiurl = nextUrl
|
|
||||||
// 同时保存到本地存储
|
|
||||||
uni.setStorageSync('ApiUrl', nextUrl)
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -183,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,
|
||||||
@@ -255,6 +236,18 @@ const store = new Vuex.Store({
|
|||||||
},
|
},
|
||||||
updateApiUrl({ commit }, url) {
|
updateApiUrl({ commit }, url) {
|
||||||
commit('SET_API_URL', url)
|
commit('SET_API_URL', url)
|
||||||
|
},
|
||||||
|
updateUserInfo({ commit }, info) {
|
||||||
|
commit('$uStore', {
|
||||||
|
name: 'vuex_user',
|
||||||
|
value: info || {}
|
||||||
|
});
|
||||||
|
if (!info) {
|
||||||
|
commit('$uStore', {
|
||||||
|
name: 'vuex_token',
|
||||||
|
value: ''
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getters: {
|
getters: {
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
const path = require('path');
|
||||||
const dotenv = require('dotenv');
|
const dotenv = require('dotenv');
|
||||||
|
|
||||||
// // Load environment variables from .env file
|
// // Load environment variables from .env file
|
||||||
@@ -5,6 +6,10 @@ dotenv.config();
|
|||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
chainWebpack: (config) => {
|
chainWebpack: (config) => {
|
||||||
|
config.resolve.alias
|
||||||
|
.set('uview-ui/components/u-select/u-select.vue', path.resolve(__dirname, 'src/components/u-select/u-select.vue'))
|
||||||
|
.set('uview-ui/components/u-action-sheet/u-action-sheet.vue', path.resolve(__dirname, 'src/components/u-action-sheet/u-action-sheet.vue'))
|
||||||
|
.set('uview-ui/components/u-dropdown-item/u-dropdown-item.vue', path.resolve(__dirname, 'src/components/u-dropdown-item/u-dropdown-item.vue'));
|
||||||
config.plugin('define').tap((definitions) => {
|
config.plugin('define').tap((definitions) => {
|
||||||
console.log('VUE_APP_UPGRADE_NAME',JSON.stringify(process.env.VUE_APP_UPGRADE_NAME))
|
console.log('VUE_APP_UPGRADE_NAME',JSON.stringify(process.env.VUE_APP_UPGRADE_NAME))
|
||||||
console.log('VUE_APP_PRODUCTION_API_URL',JSON.stringify(process.env.VUE_APP_PRODUCTION_API_URL))
|
console.log('VUE_APP_PRODUCTION_API_URL',JSON.stringify(process.env.VUE_APP_PRODUCTION_API_URL))
|
||||||
|
|||||||
Reference in New Issue
Block a user