Compare commits
No commits in common. "develop" and "master" have entirely different histories.
@ -419,12 +419,7 @@ module.exports = {
|
|||||||
breaklineNumber: 100,
|
breaklineNumber: 100,
|
||||||
breaklineChar: '|',
|
breaklineChar: '|',
|
||||||
skipQuestions: [],
|
skipQuestions: [],
|
||||||
issuePrefixes: [
|
issuePrefixes: [{ value: 'closed', name: 'closed: ISSUES has been processed' }],
|
||||||
{
|
|
||||||
value: 'closed',
|
|
||||||
name: 'closed: ISSUES has been processed',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
customIssuePrefixAlign: 'top',
|
customIssuePrefixAlign: 'top',
|
||||||
emptyIssuePrefixAlias: 'skip',
|
emptyIssuePrefixAlias: 'skip',
|
||||||
customIssuePrefixAlias: 'custom',
|
customIssuePrefixAlias: 'custom',
|
||||||
|
1
.env
1
.env
@ -1,2 +1 @@
|
|||||||
VITE_HTTP_PREFIX='/api'
|
VITE_HTTP_PREFIX='/api'
|
||||||
VITE_UPLOAD_PREFIX='http://localhost:5173/api'
|
|
@ -1,2 +0,0 @@
|
|||||||
VITE_HTTP_PREFIX='/api'
|
|
||||||
VITE_UPLOAD_PREFIX= 'https://ims.riemann.tech/api'
|
|
@ -34,7 +34,7 @@ jobs:
|
|||||||
SOURCE: dist/
|
SOURCE: dist/
|
||||||
REMOTE_HOST: ${{ vars.NGINX_SERVER }}
|
REMOTE_HOST: ${{ vars.NGINX_SERVER }}
|
||||||
REMOTE_USER: ${{ vars.NGINX_SERVER_USER }}
|
REMOTE_USER: ${{ vars.NGINX_SERVER_USER }}
|
||||||
TARGET: ${{ vars.WWW_ROOT }}${{ vars.IMS_DOMAIN }}
|
TARGET: ${{ vars.WWW_ROOT }}${{ vars.DOMAIN }}
|
||||||
EXCLUDE: ""
|
EXCLUDE: ""
|
||||||
SCRIPT_BEFORE: ${{ vars.BAKUP_SCRIPT }} ${{ vars.IMS_DOMAIN }}
|
SCRIPT_BEFORE: ${{ vars.BAKUP_SCRIPT }} ${{ vars.IMS_DOMAIN }}
|
||||||
SCRIPT_AFTER: echo $RSYNC_STDOUT
|
SCRIPT_AFTER: echo $RSYNC_STDOUT
|
||||||
|
@ -29,7 +29,6 @@ export default [
|
|||||||
dictionary: true,
|
dictionary: true,
|
||||||
sensor: true,
|
sensor: true,
|
||||||
station: true,
|
station: true,
|
||||||
material: true,
|
|
||||||
},
|
},
|
||||||
ecmaVersion: 2020,
|
ecmaVersion: 2020,
|
||||||
parser: parserVue,
|
parser: parserVue,
|
||||||
|
@ -35,10 +35,8 @@
|
|||||||
"dayjs": "^1.11.13",
|
"dayjs": "^1.11.13",
|
||||||
"echarts": "^5.5.1",
|
"echarts": "^5.5.1",
|
||||||
"exceljs": "^4.4.0",
|
"exceljs": "^4.4.0",
|
||||||
"jsbarcode": "^3.11.6",
|
|
||||||
"pinia": "^2.2.4",
|
"pinia": "^2.2.4",
|
||||||
"pinia-plugin-persistedstate": "^4.1.1",
|
"pinia-plugin-persistedstate": "^4.1.1",
|
||||||
"print-js": "^1.6.0",
|
|
||||||
"sortablejs": "^1.15.3",
|
"sortablejs": "^1.15.3",
|
||||||
"vue": "^3.5.11",
|
"vue": "^3.5.11",
|
||||||
"vue-codemirror": "^6.1.1",
|
"vue-codemirror": "^6.1.1",
|
||||||
@ -54,7 +52,6 @@
|
|||||||
"@commitlint/cli": "^19.5.0",
|
"@commitlint/cli": "^19.5.0",
|
||||||
"@commitlint/config-conventional": "^19.5.0",
|
"@commitlint/config-conventional": "^19.5.0",
|
||||||
"@eslint/js": "^9.12.0",
|
"@eslint/js": "^9.12.0",
|
||||||
"@types/jsbarcode": "^3.11.4",
|
|
||||||
"@types/sortablejs": "^1.15.8",
|
"@types/sortablejs": "^1.15.8",
|
||||||
"@vitejs/plugin-vue": "^5.1.4",
|
"@vitejs/plugin-vue": "^5.1.4",
|
||||||
"@vitejs/plugin-vue-jsx": "^4.0.1",
|
"@vitejs/plugin-vue-jsx": "^4.0.1",
|
||||||
|
26
pnpm-lock.yaml
generated
26
pnpm-lock.yaml
generated
@ -65,18 +65,12 @@ importers:
|
|||||||
exceljs:
|
exceljs:
|
||||||
specifier: ^4.4.0
|
specifier: ^4.4.0
|
||||||
version: 4.4.0
|
version: 4.4.0
|
||||||
jsbarcode:
|
|
||||||
specifier: ^3.11.6
|
|
||||||
version: 3.11.6
|
|
||||||
pinia:
|
pinia:
|
||||||
specifier: ^2.2.4
|
specifier: ^2.2.4
|
||||||
version: 2.2.4(typescript@5.6.3)(vue@3.5.11(typescript@5.6.3))
|
version: 2.2.4(typescript@5.6.3)(vue@3.5.11(typescript@5.6.3))
|
||||||
pinia-plugin-persistedstate:
|
pinia-plugin-persistedstate:
|
||||||
specifier: ^4.1.1
|
specifier: ^4.1.1
|
||||||
version: 4.1.1(pinia@2.2.4(typescript@5.6.3)(vue@3.5.11(typescript@5.6.3)))(rollup@4.21.2)(webpack-sources@3.2.3)
|
version: 4.1.1(pinia@2.2.4(typescript@5.6.3)(vue@3.5.11(typescript@5.6.3)))(rollup@4.21.2)(webpack-sources@3.2.3)
|
||||||
print-js:
|
|
||||||
specifier: ^1.6.0
|
|
||||||
version: 1.6.0
|
|
||||||
sortablejs:
|
sortablejs:
|
||||||
specifier: ^1.15.3
|
specifier: ^1.15.3
|
||||||
version: 1.15.3
|
version: 1.15.3
|
||||||
@ -117,9 +111,6 @@ importers:
|
|||||||
'@eslint/js':
|
'@eslint/js':
|
||||||
specifier: ^9.12.0
|
specifier: ^9.12.0
|
||||||
version: 9.12.0
|
version: 9.12.0
|
||||||
'@types/jsbarcode':
|
|
||||||
specifier: ^3.11.4
|
|
||||||
version: 3.11.4
|
|
||||||
'@types/sortablejs':
|
'@types/sortablejs':
|
||||||
specifier: ^1.15.8
|
specifier: ^1.15.8
|
||||||
version: 1.15.8
|
version: 1.15.8
|
||||||
@ -976,9 +967,6 @@ packages:
|
|||||||
'@types/http-errors@1.8.2':
|
'@types/http-errors@1.8.2':
|
||||||
resolution: {integrity: sha512-EqX+YQxINb+MeXaIqYDASb6U6FCHbWjkj4a1CKDBks3d/QiB2+PqBLyO72vLDgAO1wUI4O+9gweRcQK11bTL/w==}
|
resolution: {integrity: sha512-EqX+YQxINb+MeXaIqYDASb6U6FCHbWjkj4a1CKDBks3d/QiB2+PqBLyO72vLDgAO1wUI4O+9gweRcQK11bTL/w==}
|
||||||
|
|
||||||
'@types/jsbarcode@3.11.4':
|
|
||||||
resolution: {integrity: sha512-VBcpTAnEMH0Gbh8JpV14CgOtJjCYjsvR2FoDRyoYPE0gUxtApf8N4c+HKEOyz/iiIZkMzqrzBA3XX7+KgKxxsA==}
|
|
||||||
|
|
||||||
'@types/json-schema@7.0.15':
|
'@types/json-schema@7.0.15':
|
||||||
resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==}
|
resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==}
|
||||||
|
|
||||||
@ -2395,9 +2383,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==}
|
resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
jsbarcode@3.11.6:
|
|
||||||
resolution: {integrity: sha512-G5TKGyKY1zJo0ZQKFM1IIMfy0nF2rs92BLlCz+cU4/TazIc4ZH+X1GYeDRt7TKjrYqmPfTjwTBkU/QnQlsYiuA==}
|
|
||||||
|
|
||||||
jsbn@0.1.1:
|
jsbn@0.1.1:
|
||||||
resolution: {integrity: sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==}
|
resolution: {integrity: sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==}
|
||||||
|
|
||||||
@ -3003,9 +2988,6 @@ packages:
|
|||||||
engines: {node: '>=14'}
|
engines: {node: '>=14'}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
print-js@1.6.0:
|
|
||||||
resolution: {integrity: sha512-BfnOIzSKbqGRtO4o0rnj/K3681BSd2QUrsIZy/+WdCIugjIswjmx3lDEZpXB2ruGf9d4b3YNINri81+J0FsBWg==}
|
|
||||||
|
|
||||||
process-nextick-args@2.0.1:
|
process-nextick-args@2.0.1:
|
||||||
resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==}
|
resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==}
|
||||||
|
|
||||||
@ -4776,10 +4758,6 @@ snapshots:
|
|||||||
|
|
||||||
'@types/http-errors@1.8.2': {}
|
'@types/http-errors@1.8.2': {}
|
||||||
|
|
||||||
'@types/jsbarcode@3.11.4':
|
|
||||||
dependencies:
|
|
||||||
'@types/node': 22.5.3
|
|
||||||
|
|
||||||
'@types/json-schema@7.0.15': {}
|
'@types/json-schema@7.0.15': {}
|
||||||
|
|
||||||
'@types/node@12.20.55': {}
|
'@types/node@12.20.55': {}
|
||||||
@ -6406,8 +6384,6 @@ snapshots:
|
|||||||
dependencies:
|
dependencies:
|
||||||
argparse: 2.0.1
|
argparse: 2.0.1
|
||||||
|
|
||||||
jsbarcode@3.11.6: {}
|
|
||||||
|
|
||||||
jsbn@0.1.1: {}
|
jsbn@0.1.1: {}
|
||||||
|
|
||||||
jsesc@2.5.2: {}
|
jsesc@2.5.2: {}
|
||||||
@ -6966,8 +6942,6 @@ snapshots:
|
|||||||
|
|
||||||
prettier@3.3.3: {}
|
prettier@3.3.3: {}
|
||||||
|
|
||||||
print-js@1.6.0: {}
|
|
||||||
|
|
||||||
process-nextick-args@2.0.1: {}
|
process-nextick-args@2.0.1: {}
|
||||||
|
|
||||||
proxy-from-env@1.1.0: {}
|
proxy-from-env@1.1.0: {}
|
||||||
|
@ -5,27 +5,30 @@
|
|||||||
"origins": [
|
"origins": [
|
||||||
{
|
{
|
||||||
"name": "auth",
|
"name": "auth",
|
||||||
"originUrl": "http://127.0.0.1:8888/v3/api-docs/auth",
|
"originUrl": "http://127.0.0.1:7777/v3/api-docs/auth",
|
||||||
"originType": "SwaggerV3",
|
"originType": "SwaggerV3",
|
||||||
"usingOperationId": true
|
"usingOperationId": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "acl",
|
"name": "acl",
|
||||||
"originUrl": "http://127.0.0.1:8888/v3/api-docs/acl",
|
"originUrl": "http://127.0.0.1:7777/v3/api-docs/acl",
|
||||||
"originType": "SwaggerV3",
|
"originType": "SwaggerV3",
|
||||||
"usingOperationId": true
|
"usingOperationId": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "dictionary",
|
"name": "dictionary",
|
||||||
"originUrl": "http://127.0.0.1:8888/v3/api-docs/dictionary",
|
"originUrl": "http://127.0.0.1:7777/v3/api-docs/dictionary",
|
||||||
"originType": "SwaggerV3",
|
"originType": "SwaggerV3",
|
||||||
"usingOperationId": true
|
"usingOperationId": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "material",
|
"name": "material",
|
||||||
"originUrl": "http://127.0.0.1:8888/v3/api-docs/material",
|
"originUrl": "http://127.0.0.1:7777/v3/api-docs/material",
|
||||||
"originType": "SwaggerV3",
|
"originType": "SwaggerV3",
|
||||||
"usingOperationId": true
|
"usingOperationId": true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -447,6 +447,7 @@ export default class MyGenerator extends CodeGenerator {
|
|||||||
const hasPagination = inter.response.typeName.indexOf('Pagination') >= 0
|
const hasPagination = inter.response.typeName.indexOf('Pagination') >= 0
|
||||||
const hasCodebook = inter.response.typeArgs[0] && inter.response.typeArgs[0].typeName.indexOf('Codebook') >= 0
|
const hasCodebook = inter.response.typeArgs[0] && inter.response.typeArgs[0].typeName.indexOf('Codebook') >= 0
|
||||||
const hasVxe = !!inter.parameters.find((p) => p.dataType.typeName.indexOf('VXETableSaveDTO') >= 0)
|
const hasVxe = !!inter.parameters.find((p) => p.dataType.typeName.indexOf('VXETableSaveDTO') >= 0)
|
||||||
|
// const defTypes = this.getAllRefTypeNames(inter);
|
||||||
const imports = [
|
const imports = [
|
||||||
hasResult ? 'Result' : null,
|
hasResult ? 'Result' : null,
|
||||||
hasIPage ? 'IPage' : null,
|
hasIPage ? 'IPage' : null,
|
||||||
|
108
src/api/acl/api.d.ts
vendored
108
src/api/acl/api.d.ts
vendored
@ -4,34 +4,34 @@ declare namespace acl {
|
|||||||
*/
|
*/
|
||||||
export interface Permission {
|
export interface Permission {
|
||||||
/** createdTime */
|
/** createdTime */
|
||||||
createdTime?: string
|
createdTime?: string;
|
||||||
|
|
||||||
/** 权限描述 */
|
/** 权限描述 */
|
||||||
description?: string
|
description?: string;
|
||||||
|
|
||||||
/** id */
|
/** id */
|
||||||
id?: number
|
id?: number;
|
||||||
|
|
||||||
/** 权限key,英文 */
|
/** 权限key,英文 */
|
||||||
key?: string
|
key?: string;
|
||||||
|
|
||||||
/** 权限keyPath,用来做业务,(父级keyPath.key) */
|
/** 权限keyPath,用来做业务,(父级keyPath.key) */
|
||||||
keyPath?: string
|
keyPath?: string;
|
||||||
|
|
||||||
/** 权限名称,中文用来做标识 */
|
/** 权限名称,中文用来做标识 */
|
||||||
name?: string
|
name?: string;
|
||||||
|
|
||||||
/** 父权限key */
|
/** 父权限key */
|
||||||
parentKey?: string
|
parentKey?: string;
|
||||||
|
|
||||||
/** 权限类型 */
|
/** 权限类型 */
|
||||||
type?: 'MENU' | 'BUTTON' | 'OTHER'
|
type?: 'MENU' | 'BUTTON' | 'OTHER';
|
||||||
|
|
||||||
/** typeInfo */
|
/** typeInfo */
|
||||||
typeInfo?: acl.Codebook
|
typeInfo?: acl.Codebook;
|
||||||
|
|
||||||
/** updatedTime */
|
/** updatedTime */
|
||||||
updatedTime?: string
|
updatedTime?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -39,37 +39,37 @@ declare namespace acl {
|
|||||||
*/
|
*/
|
||||||
export interface PermissionInfo {
|
export interface PermissionInfo {
|
||||||
/** createdTime */
|
/** createdTime */
|
||||||
createdTime?: string
|
createdTime?: string;
|
||||||
|
|
||||||
/** 权限描述 */
|
/** 权限描述 */
|
||||||
description?: string
|
description?: string;
|
||||||
|
|
||||||
/** id */
|
/** id */
|
||||||
id?: number
|
id?: number;
|
||||||
|
|
||||||
/** 权限key,英文 */
|
/** 权限key,英文 */
|
||||||
key?: string
|
key?: string;
|
||||||
|
|
||||||
/** 权限keyPath,用来做业务,(父级keyPath.key) */
|
/** 权限keyPath,用来做业务,(父级keyPath.key) */
|
||||||
keyPath?: string
|
keyPath?: string;
|
||||||
|
|
||||||
/** 权限名称,中文用来做标识 */
|
/** 权限名称,中文用来做标识 */
|
||||||
name?: string
|
name?: string;
|
||||||
|
|
||||||
/** 父权限key */
|
/** 父权限key */
|
||||||
parentKey?: string
|
parentKey?: string;
|
||||||
|
|
||||||
/** 权限是否选中标识 */
|
/** 权限是否选中标识 */
|
||||||
selected: boolean
|
selected: boolean;
|
||||||
|
|
||||||
/** 权限类型 */
|
/** 权限类型 */
|
||||||
type?: 'MENU' | 'BUTTON' | 'OTHER'
|
type?: 'MENU' | 'BUTTON' | 'OTHER';
|
||||||
|
|
||||||
/** typeInfo */
|
/** typeInfo */
|
||||||
typeInfo?: acl.Codebook
|
typeInfo?: acl.Codebook;
|
||||||
|
|
||||||
/** updatedTime */
|
/** updatedTime */
|
||||||
updatedTime?: string
|
updatedTime?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -77,22 +77,22 @@ declare namespace acl {
|
|||||||
*/
|
*/
|
||||||
export interface Role {
|
export interface Role {
|
||||||
/** createdTime */
|
/** createdTime */
|
||||||
createdTime?: string
|
createdTime?: string;
|
||||||
|
|
||||||
/** 角色描述 */
|
/** 角色描述 */
|
||||||
description?: string
|
description?: string;
|
||||||
|
|
||||||
/** id */
|
/** id */
|
||||||
id?: number
|
id?: number;
|
||||||
|
|
||||||
/** 角色key,英文,用来做业务 */
|
/** 角色key,英文,用来做业务 */
|
||||||
key?: string
|
key: string;
|
||||||
|
|
||||||
/** 角色名称,中文用来做标识 */
|
/** 角色名称,中文用来做标识 */
|
||||||
name?: string
|
name?: string;
|
||||||
|
|
||||||
/** updatedTime */
|
/** updatedTime */
|
||||||
updatedTime?: string
|
updatedTime?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -100,25 +100,25 @@ declare namespace acl {
|
|||||||
*/
|
*/
|
||||||
export interface RoleInfo {
|
export interface RoleInfo {
|
||||||
/** createdTime */
|
/** createdTime */
|
||||||
createdTime?: string
|
createdTime?: string;
|
||||||
|
|
||||||
/** 角色描述 */
|
/** 角色描述 */
|
||||||
description?: string
|
description?: string;
|
||||||
|
|
||||||
/** id */
|
/** id */
|
||||||
id?: number
|
id?: number;
|
||||||
|
|
||||||
/** 角色key,英文,用来做业务 */
|
/** 角色key,英文,用来做业务 */
|
||||||
key?: string
|
key: string;
|
||||||
|
|
||||||
/** 角色名称,中文用来做标识 */
|
/** 角色名称,中文用来做标识 */
|
||||||
name?: string
|
name?: string;
|
||||||
|
|
||||||
/** 角色是否选中标识 */
|
/** 角色是否选中标识 */
|
||||||
selected: boolean
|
selected: boolean;
|
||||||
|
|
||||||
/** updatedTime */
|
/** updatedTime */
|
||||||
updatedTime?: string
|
updatedTime?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -126,22 +126,22 @@ declare namespace acl {
|
|||||||
*/
|
*/
|
||||||
export interface TreeString {
|
export interface TreeString {
|
||||||
/** 下级列表 */
|
/** 下级列表 */
|
||||||
children?: Array<acl.TreeString>
|
children?: Array<acl.TreeString>;
|
||||||
|
|
||||||
/** 描述 */
|
/** 描述 */
|
||||||
description?: string
|
description?: string;
|
||||||
|
|
||||||
/** ID */
|
/** ID */
|
||||||
key: string
|
key: string;
|
||||||
|
|
||||||
/** 名称 */
|
/** 名称 */
|
||||||
name: string
|
name: string;
|
||||||
|
|
||||||
/** originData */
|
/** originData */
|
||||||
originData: acl.TreeableString
|
originData: acl.TreeableString;
|
||||||
|
|
||||||
/** 父级 ID */
|
/** 父级 ID */
|
||||||
parentKey?: string
|
parentKey?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -149,16 +149,16 @@ declare namespace acl {
|
|||||||
*/
|
*/
|
||||||
export interface TreeableString {
|
export interface TreeableString {
|
||||||
/** description */
|
/** description */
|
||||||
description?: string
|
description?: string;
|
||||||
|
|
||||||
/** key */
|
/** key */
|
||||||
key?: string
|
key?: string;
|
||||||
|
|
||||||
/** name */
|
/** name */
|
||||||
name?: string
|
name?: string;
|
||||||
|
|
||||||
/** parentKey */
|
/** parentKey */
|
||||||
parentKey?: string
|
parentKey?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -166,33 +166,33 @@ declare namespace acl {
|
|||||||
*/
|
*/
|
||||||
export interface User {
|
export interface User {
|
||||||
/** createdTime */
|
/** createdTime */
|
||||||
createdTime?: string
|
createdTime?: string;
|
||||||
|
|
||||||
/** 邮箱 */
|
/** 邮箱 */
|
||||||
email?: string
|
email?: string;
|
||||||
|
|
||||||
/** 真实姓名 */
|
/** 真实姓名 */
|
||||||
fullName?: string
|
fullName?: string;
|
||||||
|
|
||||||
/** id */
|
/** id */
|
||||||
id?: number
|
id?: number;
|
||||||
|
|
||||||
/** 手机号 */
|
/** 手机号 */
|
||||||
mobile?: string
|
mobile?: string;
|
||||||
|
|
||||||
/** 用户名 */
|
/** 用户名 */
|
||||||
name: string
|
name: string;
|
||||||
|
|
||||||
/** 密码 */
|
/** 密码 */
|
||||||
password?: string
|
password?: string;
|
||||||
|
|
||||||
/** 性别 */
|
/** 性别 */
|
||||||
sex?: 'MALE' | 'FEMALE'
|
sex?: 'MALE' | 'FEMALE';
|
||||||
|
|
||||||
/** sexInfo */
|
/** sexInfo */
|
||||||
sexInfo?: acl.Codebook
|
sexInfo?: acl.Codebook;
|
||||||
|
|
||||||
/** updatedTime */
|
/** updatedTime */
|
||||||
updatedTime?: string
|
updatedTime?: string;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,26 +0,0 @@
|
|||||||
/**
|
|
||||||
* @desc 检查用户名是否存在,true存在,false不存在
|
|
||||||
*/
|
|
||||||
import { defaultSuccess, defaultError, http } from '@/plugins/axios'
|
|
||||||
import type { AxiosResponse } from 'axios'
|
|
||||||
export interface Params {
|
|
||||||
/** name */
|
|
||||||
name: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export default async function (
|
|
||||||
params: Params,
|
|
||||||
success: (data: boolean) => void = defaultSuccess,
|
|
||||||
fail: (error: { code: string; error?: string }) => void = defaultError,
|
|
||||||
): Promise<void> {
|
|
||||||
return http({
|
|
||||||
method: 'get',
|
|
||||||
url: `/user/exist-name`,
|
|
||||||
|
|
||||||
params,
|
|
||||||
})
|
|
||||||
.then((data: AxiosResponse<boolean, unknown>) => {
|
|
||||||
success(data.data)
|
|
||||||
})
|
|
||||||
.catch((error: { code: string; error?: string }) => fail(error))
|
|
||||||
}
|
|
@ -2,24 +2,22 @@
|
|||||||
* @description 用户
|
* @description 用户
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import saveOrUpdateUser from './saveOrUpdateUser'
|
import saveOrUpdateUser from './saveOrUpdateUser';
|
||||||
import all from './all'
|
import all from './all';
|
||||||
import existName from './existName'
|
import sexes from './sexes';
|
||||||
import sexes from './sexes'
|
import detail from './detail';
|
||||||
import detail from './detail'
|
import deleteUser from './deleteUser';
|
||||||
import deleteUser from './deleteUser'
|
import resetPassword from './resetPassword';
|
||||||
import resetPassword from './resetPassword'
|
import permissionInfos from './permissionInfos';
|
||||||
import permissionInfos from './permissionInfos'
|
import permissions from './permissions';
|
||||||
import permissions from './permissions'
|
import grant from './grant';
|
||||||
import grant from './grant'
|
import roleInfos from './roleInfos';
|
||||||
import roleInfos from './roleInfos'
|
import grantRole from './grantRole';
|
||||||
import grantRole from './grantRole'
|
import users from './users';
|
||||||
import users from './users'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
saveOrUpdateUser,
|
saveOrUpdateUser,
|
||||||
all,
|
all,
|
||||||
existName,
|
|
||||||
sexes,
|
sexes,
|
||||||
detail,
|
detail,
|
||||||
deleteUser,
|
deleteUser,
|
||||||
@ -30,4 +28,4 @@ export default {
|
|||||||
roleInfos,
|
roleInfos,
|
||||||
grantRole,
|
grantRole,
|
||||||
users,
|
users,
|
||||||
}
|
};
|
||||||
|
File diff suppressed because it is too large
Load Diff
40
src/api/auth/api.d.ts
vendored
40
src/api/auth/api.d.ts
vendored
@ -4,46 +4,46 @@ declare namespace auth {
|
|||||||
*/
|
*/
|
||||||
export interface AuthUser {
|
export interface AuthUser {
|
||||||
/** anonymous */
|
/** anonymous */
|
||||||
anonymous?: boolean
|
anonymous?: boolean;
|
||||||
|
|
||||||
/** 用户头像 */
|
/** 用户头像 */
|
||||||
avatar?: string
|
avatar?: string;
|
||||||
|
|
||||||
/** 邮箱 */
|
/** 邮箱 */
|
||||||
email?: string
|
email?: string;
|
||||||
|
|
||||||
/** extInfo */
|
/** extInfo */
|
||||||
extInfo?: auth.NutMap
|
extInfo?: auth.NutMap;
|
||||||
|
|
||||||
/** 姓名 */
|
/** 姓名 */
|
||||||
fullName: string
|
fullName: string;
|
||||||
|
|
||||||
/** 电话 */
|
/** 电话 */
|
||||||
mobile?: string
|
mobile?: string;
|
||||||
|
|
||||||
/** 密码 */
|
/** 密码 */
|
||||||
password: string
|
password: string;
|
||||||
|
|
||||||
/** 权限列表 */
|
/** 权限列表 */
|
||||||
permissions: Array<string>
|
permissions: Array<string>;
|
||||||
|
|
||||||
/** jwt refreshToken */
|
/** jwt refreshToken */
|
||||||
refreshToken: string
|
refreshToken: string;
|
||||||
|
|
||||||
/** 角色列表 */
|
/** 角色列表 */
|
||||||
roles: Array<string>
|
roles: Array<string>;
|
||||||
|
|
||||||
/** 性别 */
|
/** 性别 */
|
||||||
sex?: 'MALE' | 'FEMALE'
|
sex?: 'MALE' | 'FEMALE';
|
||||||
|
|
||||||
/** sexInfo */
|
/** sexInfo */
|
||||||
sexInfo?: auth.Codebook
|
sexInfo?: auth.Codebook;
|
||||||
|
|
||||||
/** jwt Token */
|
/** jwt Token */
|
||||||
token: string
|
token: string;
|
||||||
|
|
||||||
/** 用户名 */
|
/** 用户名 */
|
||||||
userName: string
|
userName: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -51,21 +51,21 @@ declare namespace auth {
|
|||||||
*/
|
*/
|
||||||
export interface LoginDTO {
|
export interface LoginDTO {
|
||||||
/** 验证码 */
|
/** 验证码 */
|
||||||
captcha?: string
|
captcha?: string;
|
||||||
|
|
||||||
/** 手机号 */
|
/** 手机号 */
|
||||||
mobile?: string
|
mobile?: string;
|
||||||
|
|
||||||
/** 密码 */
|
/** 密码 */
|
||||||
password?: string
|
password?: string;
|
||||||
|
|
||||||
/** 登录类型 */
|
/** 登录类型 */
|
||||||
type: 'ACCOUNT' | 'WECHAT'
|
type: 'ACCOUNT' | 'WECHAT';
|
||||||
|
|
||||||
/** 用户名 */
|
/** 用户名 */
|
||||||
userName?: string
|
userName?: string;
|
||||||
|
|
||||||
/** uuid */
|
/** uuid */
|
||||||
uuid?: string
|
uuid?: string;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* @desc 当前用户
|
* @desc 当前用户
|
||||||
*/
|
*/
|
||||||
import { defaultSuccess, defaultError, http } from '@/plugins/axios'
|
import { defaultSuccess, defaultError, http } from '@/plugins/axios';
|
||||||
import type { AxiosResponse } from 'axios'
|
import type { AxiosResponse } from 'axios';
|
||||||
export default async function (
|
export default async function (
|
||||||
success: (data: auth.AuthUser) => void = defaultSuccess,
|
success: (data: auth.AuthUser) => void = defaultSuccess,
|
||||||
fail: (error: { code: string; error?: string }) => void = defaultError,
|
fail: (error: { code: string; error?: string }) => void = defaultError,
|
||||||
@ -12,7 +12,7 @@ export default async function (
|
|||||||
url: `/auth/current-user`,
|
url: `/auth/current-user`,
|
||||||
})
|
})
|
||||||
.then((data: AxiosResponse<auth.AuthUser, unknown>) => {
|
.then((data: AxiosResponse<auth.AuthUser, unknown>) => {
|
||||||
success(data.data)
|
success(data.data);
|
||||||
})
|
})
|
||||||
.catch((error: { code: string; error?: string }) => fail(error))
|
.catch((error: { code: string; error?: string }) => fail(error));
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* @desc 登录
|
* @desc 登录
|
||||||
*/
|
*/
|
||||||
import { defaultSuccess, defaultError, http } from '@/plugins/axios'
|
import { defaultSuccess, defaultError, http } from '@/plugins/axios';
|
||||||
import type { AxiosResponse } from 'axios'
|
import type { AxiosResponse } from 'axios';
|
||||||
export default async function (
|
export default async function (
|
||||||
/** 请求体 */
|
/** 请求体 */
|
||||||
requestBody: auth.LoginDTO,
|
requestBody: auth.LoginDTO,
|
||||||
@ -16,7 +16,7 @@ export default async function (
|
|||||||
data: requestBody,
|
data: requestBody,
|
||||||
})
|
})
|
||||||
.then((data: AxiosResponse<auth.AuthUser, unknown>) => {
|
.then((data: AxiosResponse<auth.AuthUser, unknown>) => {
|
||||||
success(data.data)
|
success(data.data);
|
||||||
})
|
})
|
||||||
.catch((error: { code: string; error?: string }) => fail(error))
|
.catch((error: { code: string; error?: string }) => fail(error));
|
||||||
}
|
}
|
||||||
|
418
src/api/material/api.d.ts
vendored
418
src/api/material/api.d.ts
vendored
@ -4,52 +4,34 @@ declare namespace material {
|
|||||||
*/
|
*/
|
||||||
export interface ApplyDTO {
|
export interface ApplyDTO {
|
||||||
/** 申请人 */
|
/** 申请人 */
|
||||||
applicant?: string
|
applicant?: string;
|
||||||
|
|
||||||
/** 申请日期 */
|
/** 申请日期 */
|
||||||
applyDate?: string
|
applyDate?: string;
|
||||||
|
|
||||||
/** 申请id */
|
|
||||||
applyId?: number
|
|
||||||
|
|
||||||
/** 申请数量 */
|
/** 申请数量 */
|
||||||
applyNum?: string
|
applyNum?: string;
|
||||||
|
|
||||||
/** 申请类型 */
|
/** 申请类型 */
|
||||||
applyType?: 'PURCHASE_RECEIPT' | 'RETURN_RECEIPT' | 'LOAN_OUT' | 'AUDIT' | 'SCRAP_OUT'
|
applyType?: 'PURCHASE_RECEIPT' | 'RETURN_RECEIPT' | 'LOAN_OUT' | 'AUDIT';
|
||||||
|
|
||||||
/** applyTypeInfo */
|
|
||||||
applyTypeInfo?: material.Codebook
|
|
||||||
|
|
||||||
/** 物料编码 */
|
/** 物料编码 */
|
||||||
code?: string
|
code?: string;
|
||||||
|
|
||||||
/** 是否确认 */
|
|
||||||
confirm?: boolean
|
|
||||||
|
|
||||||
/** 确认数量 */
|
/** 确认数量 */
|
||||||
confirmNum?: string
|
confirmNum?: string;
|
||||||
|
|
||||||
/** 物料名称 */
|
/** 物料名称 */
|
||||||
name?: string
|
name?: string;
|
||||||
|
|
||||||
/** 备注 */
|
/** 备注 */
|
||||||
remark?: string
|
remark?: string;
|
||||||
|
|
||||||
/** 审核状态 */
|
|
||||||
reviewResult?: 'WAIT_SCAN' | 'WAIT_SUBMIT' | 'WAIT_REVIEW' | 'PASS' | 'REJECT'
|
|
||||||
|
|
||||||
/** 审核人 */
|
|
||||||
reviewer?: string
|
|
||||||
|
|
||||||
/** 物料规格 */
|
/** 物料规格 */
|
||||||
spec?: string
|
spec?: string;
|
||||||
|
|
||||||
/** 物料类型 */
|
/** 物料类型 */
|
||||||
type?: string
|
type?: string;
|
||||||
|
|
||||||
/** 类型名称 */
|
|
||||||
typeName?: string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -57,31 +39,31 @@ declare namespace material {
|
|||||||
*/
|
*/
|
||||||
export interface ApplyDetail {
|
export interface ApplyDetail {
|
||||||
/** 申请单ID */
|
/** 申请单ID */
|
||||||
applyId?: number
|
applyId?: number;
|
||||||
|
|
||||||
/** 是否需要赋码 */
|
/** assignRule */
|
||||||
assignRule?: boolean
|
assignRule?: 'LOW_VALUE' | 'HIGH_VALUE';
|
||||||
|
|
||||||
/** 确认数量 */
|
/** 确认数量 */
|
||||||
confirmQuantity?: number
|
confirmQuantity?: number;
|
||||||
|
|
||||||
/** createdTime */
|
/** createdTime */
|
||||||
createdTime?: string
|
createdTime?: string;
|
||||||
|
|
||||||
/** 异常情况说明 */
|
/** 异常情况说明 */
|
||||||
exceptionRemark?: string
|
exceptionRemark?: string;
|
||||||
|
|
||||||
/** id */
|
/** id */
|
||||||
id?: number
|
id?: number;
|
||||||
|
|
||||||
/** 物料Id */
|
/** 物料Id */
|
||||||
materialId?: number
|
materialId?: number;
|
||||||
|
|
||||||
/** 申请数量 */
|
/** 申请数量 */
|
||||||
quantity?: number
|
quantity?: number;
|
||||||
|
|
||||||
/** updatedTime */
|
/** updatedTime */
|
||||||
updatedTime?: string
|
updatedTime?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -89,40 +71,51 @@ declare namespace material {
|
|||||||
*/
|
*/
|
||||||
export interface ApplyForm {
|
export interface ApplyForm {
|
||||||
/** 申请人 */
|
/** 申请人 */
|
||||||
applicant?: string
|
applicant?: string;
|
||||||
|
|
||||||
/** 申请日期 */
|
/** 申请日期 */
|
||||||
applyDate?: string
|
applyDate?: string;
|
||||||
|
|
||||||
/** 盘点类型(1: 扫码 2: 人工) */
|
/** 盘点类型(1: 全盘 2: 部分盘点) */
|
||||||
auditType?: 'SCAN' | 'MANUAL'
|
auditType?: 'ALL' | 'PARTIAL';
|
||||||
|
|
||||||
/** 是否确认(0: 未确认 1: 已确认) */
|
|
||||||
confirm?: boolean
|
|
||||||
|
|
||||||
/** createdTime */
|
/** createdTime */
|
||||||
createdTime?: string
|
createdTime?: string;
|
||||||
|
|
||||||
|
/** 异常原因 */
|
||||||
|
exception?: string;
|
||||||
|
|
||||||
|
/** 处理摘要 */
|
||||||
|
handle?: string;
|
||||||
|
|
||||||
/** id */
|
/** id */
|
||||||
id?: number
|
id?: number;
|
||||||
|
|
||||||
/** 审核意见 */
|
/** 是否确认(0: 未确认 1: 已确认) */
|
||||||
reviewRemark?: string
|
isConfirm?: boolean;
|
||||||
|
|
||||||
|
/** 结果(系统自动生成) */
|
||||||
|
result?: string;
|
||||||
|
|
||||||
/** 审核结果(1-待扫码 2-待提交 3-待审核 4-审核通过 5退回) */
|
/** 审核结果(1-待扫码 2-待提交 3-待审核 4-审核通过 5退回) */
|
||||||
reviewResult?: 'WAIT_SCAN' | 'WAIT_SUBMIT' | 'WAIT_REVIEW' | 'PASS' | 'REJECT'
|
reviewResult?:
|
||||||
|
| 'WAIT_SCAN'
|
||||||
|
| 'WAIT_SUBMIT'
|
||||||
|
| 'WAIT_REVIEW'
|
||||||
|
| 'PASS'
|
||||||
|
| 'REJECT';
|
||||||
|
|
||||||
/** 盘点审核人 */
|
/** 盘点审核人 */
|
||||||
reviewer?: string
|
reviewer?: string;
|
||||||
|
|
||||||
/** 盘点人 */
|
/** 盘点人 */
|
||||||
taker?: string
|
taker?: string;
|
||||||
|
|
||||||
/** 类型(1: 采购入库申请 2: 归还入库申请 3: 出库外借申请 4: 盘点申请) */
|
/** 类型(1: 采购入库申请 2: 归还入库申请 3: 出库外借申请 4: 盘点申请) */
|
||||||
type?: 'PURCHASE_RECEIPT' | 'RETURN_RECEIPT' | 'LOAN_OUT' | 'AUDIT' | 'SCRAP_OUT'
|
type?: 'PURCHASE_RECEIPT' | 'RETURN_RECEIPT' | 'LOAN_OUT' | 'AUDIT';
|
||||||
|
|
||||||
/** updatedTime */
|
/** updatedTime */
|
||||||
updatedTime?: string
|
updatedTime?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -130,13 +123,13 @@ declare namespace material {
|
|||||||
*/
|
*/
|
||||||
export interface ApplyInfo {
|
export interface ApplyInfo {
|
||||||
/** 申请单明细 */
|
/** 申请单明细 */
|
||||||
applyDetails?: Array<material.ApplyDetail>
|
applyDetails?: Array<material.ApplyDetail>;
|
||||||
|
|
||||||
/** applyForm */
|
/** applyForm */
|
||||||
applyForm?: material.ApplyForm
|
applyForm?: material.ApplyForm;
|
||||||
|
|
||||||
/** 扫码的条码集合 */
|
/** 扫码的条码集合 */
|
||||||
detailList?: Array<material.MaterialStockDetail>
|
detailList?: Array<material.MaterialStockDetail>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -144,46 +137,54 @@ declare namespace material {
|
|||||||
*/
|
*/
|
||||||
export interface AuditApplyInfo {
|
export interface AuditApplyInfo {
|
||||||
/** 申请人 */
|
/** 申请人 */
|
||||||
applicant?: string
|
applicant?: string;
|
||||||
|
|
||||||
/** 申请日期 */
|
/** 申请日期 */
|
||||||
applyDate?: string
|
applyDate?: string;
|
||||||
|
|
||||||
/** 盘点类型(1: 扫码 2: 人工) */
|
/** 盘点类型(1: 全盘 2: 部分盘点) */
|
||||||
auditType?: 'SCAN' | 'MANUAL'
|
auditType?: 'ALL' | 'PARTIAL';
|
||||||
|
|
||||||
/** 是否确认(0: 未确认 1: 已确认) */
|
|
||||||
confirm?: boolean
|
|
||||||
|
|
||||||
/** createdTime */
|
/** createdTime */
|
||||||
createdTime?: string
|
createdTime?: string;
|
||||||
|
|
||||||
|
/** 异常原因 */
|
||||||
|
exception?: string;
|
||||||
|
|
||||||
|
/** 处理摘要 */
|
||||||
|
handle?: string;
|
||||||
|
|
||||||
/** id */
|
/** id */
|
||||||
id?: number
|
id?: number;
|
||||||
|
|
||||||
/** 物料ids */
|
/** 物料ids */
|
||||||
ids?: Array<string>
|
ids?: Array<string>;
|
||||||
|
|
||||||
/** 审核意见 */
|
/** 是否确认(0: 未确认 1: 已确认) */
|
||||||
reviewRemark?: string
|
isConfirm?: boolean;
|
||||||
|
|
||||||
|
/** 结果(系统自动生成) */
|
||||||
|
result?: string;
|
||||||
|
|
||||||
/** 审核结果(1-待扫码 2-待提交 3-待审核 4-审核通过 5退回) */
|
/** 审核结果(1-待扫码 2-待提交 3-待审核 4-审核通过 5退回) */
|
||||||
reviewResult?: 'WAIT_SCAN' | 'WAIT_SUBMIT' | 'WAIT_REVIEW' | 'PASS' | 'REJECT'
|
reviewResult?:
|
||||||
|
| 'WAIT_SCAN'
|
||||||
|
| 'WAIT_SUBMIT'
|
||||||
|
| 'WAIT_REVIEW'
|
||||||
|
| 'PASS'
|
||||||
|
| 'REJECT';
|
||||||
|
|
||||||
/** 盘点审核人 */
|
/** 盘点审核人 */
|
||||||
reviewer?: string
|
reviewer?: string;
|
||||||
|
|
||||||
/** 盘点人 */
|
/** 盘点人 */
|
||||||
taker?: string
|
taker?: string;
|
||||||
|
|
||||||
/** 类型(1: 采购入库申请 2: 归还入库申请 3: 出库外借申请 4: 盘点申请) */
|
/** 类型(1: 采购入库申请 2: 归还入库申请 3: 出库外借申请 4: 盘点申请) */
|
||||||
type?: 'PURCHASE_RECEIPT' | 'RETURN_RECEIPT' | 'LOAN_OUT' | 'AUDIT' | 'SCRAP_OUT'
|
type?: 'PURCHASE_RECEIPT' | 'RETURN_RECEIPT' | 'LOAN_OUT' | 'AUDIT';
|
||||||
|
|
||||||
/** 物料类型 */
|
|
||||||
types?: Array<string>
|
|
||||||
|
|
||||||
/** updatedTime */
|
/** updatedTime */
|
||||||
updatedTime?: string
|
updatedTime?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -191,118 +192,45 @@ declare namespace material {
|
|||||||
*/
|
*/
|
||||||
export interface ComparisonResDTO {
|
export interface ComparisonResDTO {
|
||||||
/** 库存明细 */
|
/** 库存明细 */
|
||||||
details?: Array<material.StockDetailInfo>
|
details?: Array<material.StockDetailInfo>;
|
||||||
|
|
||||||
/** 差异数据 */
|
/** 差异数据 */
|
||||||
exceptionalData?: Array<material.StocktakingScanExceptionalData>
|
exceptionalData?: Array<material.StocktakingScanExceptionalData>;
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ManualStockDTO
|
|
||||||
*/
|
|
||||||
export interface ManualStockDTO {
|
|
||||||
/** 申请id */
|
|
||||||
applyId?: number
|
|
||||||
|
|
||||||
/** 编码 */
|
|
||||||
code?: string
|
|
||||||
|
|
||||||
/** 手动核实库存数量 */
|
|
||||||
manualStock?: number
|
|
||||||
|
|
||||||
/** 物料id */
|
|
||||||
materialId?: number
|
|
||||||
|
|
||||||
/** 异常原因 */
|
|
||||||
msg?: string
|
|
||||||
|
|
||||||
/** 名称 */
|
|
||||||
name?: string
|
|
||||||
|
|
||||||
/** 价格 */
|
|
||||||
price?: number
|
|
||||||
|
|
||||||
/** 规格 */
|
|
||||||
spec?: string
|
|
||||||
|
|
||||||
/** 库存数量 */
|
|
||||||
stock?: number
|
|
||||||
|
|
||||||
/** 类型 */
|
|
||||||
type?: string
|
|
||||||
|
|
||||||
/** typeName */
|
|
||||||
typeName?: string
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 人工手动核实物料库存明细
|
|
||||||
*/
|
|
||||||
export interface ManualStockDetail {
|
|
||||||
/** 申请id */
|
|
||||||
applyId?: number
|
|
||||||
|
|
||||||
/** createdTime */
|
|
||||||
createdTime?: string
|
|
||||||
|
|
||||||
/** id */
|
|
||||||
id?: number
|
|
||||||
|
|
||||||
/** 手动核实库存数量 */
|
|
||||||
manualStock?: number
|
|
||||||
|
|
||||||
/** 物料id */
|
|
||||||
materialId?: number
|
|
||||||
|
|
||||||
/** 异常原因 */
|
|
||||||
msg?: string
|
|
||||||
|
|
||||||
/** 库存数量 */
|
|
||||||
stock?: number
|
|
||||||
|
|
||||||
/** updatedTime */
|
|
||||||
updatedTime?: string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 物料信息
|
* 物料信息
|
||||||
*/
|
*/
|
||||||
export interface Material {
|
export interface Material {
|
||||||
/** 是否赋码 */
|
/** 赋码规则(2-低值易耗品(不参与赋码) 1-高价值工具类(参与唯一赋码) */
|
||||||
assignRule?: boolean
|
assignRule?: 'LOW_VALUE' | 'HIGH_VALUE';
|
||||||
|
|
||||||
/** 编码 */
|
/** 编码 */
|
||||||
code?: string
|
code?: string;
|
||||||
|
|
||||||
/** createdTime */
|
/** createdTime */
|
||||||
createdTime?: string
|
createdTime?: string;
|
||||||
|
|
||||||
/** 备注 */
|
/** 备注 */
|
||||||
description?: string
|
description?: string;
|
||||||
|
|
||||||
/** id */
|
/** id */
|
||||||
id?: number
|
id?: number;
|
||||||
|
|
||||||
/** 名称 */
|
/** 名称 */
|
||||||
name?: string
|
name?: string;
|
||||||
|
|
||||||
/** 价格 */
|
|
||||||
price?: number
|
|
||||||
|
|
||||||
/** 规格 */
|
/** 规格 */
|
||||||
spec?: string
|
spec?: string;
|
||||||
|
|
||||||
/** 库存数量 */
|
/** 库存数量 */
|
||||||
stock?: number
|
stock?: number;
|
||||||
|
|
||||||
/** 类型 */
|
/** 类型 */
|
||||||
type?: string
|
type?: string;
|
||||||
|
|
||||||
/** typeName */
|
|
||||||
typeName?: string
|
|
||||||
|
|
||||||
/** updatedTime */
|
/** updatedTime */
|
||||||
updatedTime?: string
|
updatedTime?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -310,71 +238,25 @@ declare namespace material {
|
|||||||
*/
|
*/
|
||||||
export interface MaterialStockDetail {
|
export interface MaterialStockDetail {
|
||||||
/** 入库申请单 */
|
/** 入库申请单 */
|
||||||
applyId?: number
|
applyId?: number;
|
||||||
|
|
||||||
/** 条码 */
|
/** 条码 */
|
||||||
barcode?: string
|
barcode?: string;
|
||||||
|
|
||||||
/** createdTime */
|
/** createdTime */
|
||||||
createdTime?: string
|
createdTime?: string;
|
||||||
|
|
||||||
/** id */
|
/** id */
|
||||||
id?: number
|
id?: number;
|
||||||
|
|
||||||
/** 物料ID */
|
/** 物料ID */
|
||||||
materialId?: number
|
materialId?: number;
|
||||||
|
|
||||||
/** 状态 */
|
/** 状态 */
|
||||||
status?: 'IN' | 'OUT' | 'OFF' | 'LOST' | 'SCRAP_OUT'
|
status?: 'IN' | 'OUT' | 'OFF' | 'LOST';
|
||||||
|
|
||||||
/** updatedTime */
|
/** updatedTime */
|
||||||
updatedTime?: string
|
updatedTime?: string;
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 异常数据列表
|
|
||||||
*/
|
|
||||||
export interface ReviewDTO {
|
|
||||||
/** 申请单 */
|
|
||||||
applyId?: string
|
|
||||||
|
|
||||||
/** 审核意见 */
|
|
||||||
remark?: string
|
|
||||||
|
|
||||||
/** 审核结果 */
|
|
||||||
reviewResult?: 'WAIT_SCAN' | 'WAIT_SUBMIT' | 'WAIT_REVIEW' | 'PASS' | 'REJECT'
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ScrapOutApplyDTO
|
|
||||||
*/
|
|
||||||
export interface ScrapOutApplyDTO {
|
|
||||||
/** 申请人 */
|
|
||||||
applicant?: string
|
|
||||||
|
|
||||||
/** 条码集合 */
|
|
||||||
barcodeList?: string
|
|
||||||
|
|
||||||
/** 确认数量 */
|
|
||||||
confirmQuantity?: number
|
|
||||||
|
|
||||||
/** 物料名称 */
|
|
||||||
name?: string
|
|
||||||
|
|
||||||
/** 单价 */
|
|
||||||
price?: string
|
|
||||||
|
|
||||||
/** 报废原因 */
|
|
||||||
remark?: string
|
|
||||||
|
|
||||||
/** 物料规格 */
|
|
||||||
spec?: string
|
|
||||||
|
|
||||||
/** 类型 */
|
|
||||||
type?: string
|
|
||||||
|
|
||||||
/** 类型名称 */
|
|
||||||
typeName?: string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -382,22 +264,22 @@ declare namespace material {
|
|||||||
*/
|
*/
|
||||||
export interface StockDetailInfo {
|
export interface StockDetailInfo {
|
||||||
/** 物料编码 */
|
/** 物料编码 */
|
||||||
materialCode?: string
|
materialCode?: string;
|
||||||
|
|
||||||
/** 物料名称 */
|
/** 物料名称 */
|
||||||
materialId?: number
|
materialId?: number;
|
||||||
|
|
||||||
/** 物料名称 */
|
/** 物料名称 */
|
||||||
materialName?: string
|
materialName?: string;
|
||||||
|
|
||||||
/** 实际库存(明细数据中统计来的) */
|
/** 实际库存(明细数据中统计来的) */
|
||||||
stockReal?: number
|
stockReal?: number;
|
||||||
|
|
||||||
/** 在存总数(物料表) */
|
/** 在存总数(物料表) */
|
||||||
stockTotal?: number
|
stockTotal?: number;
|
||||||
|
|
||||||
/** 扫码数量 */
|
/** 扫码数量 */
|
||||||
stockTotalScan?: number
|
stockTotalScan?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -405,22 +287,22 @@ declare namespace material {
|
|||||||
*/
|
*/
|
||||||
export interface StocktakingScanDetail {
|
export interface StocktakingScanDetail {
|
||||||
/** 申请单id */
|
/** 申请单id */
|
||||||
applyId?: number
|
applyId?: number;
|
||||||
|
|
||||||
/** 条码 */
|
/** 条码 */
|
||||||
barcode?: string
|
barcode?: string;
|
||||||
|
|
||||||
/** createdTime */
|
/** createdTime */
|
||||||
createdTime?: string
|
createdTime?: string;
|
||||||
|
|
||||||
/** id */
|
/** id */
|
||||||
id?: number
|
id?: number;
|
||||||
|
|
||||||
/** 物料ID */
|
/** 物料ID */
|
||||||
materialId?: number
|
materialId?: number;
|
||||||
|
|
||||||
/** updatedTime */
|
/** updatedTime */
|
||||||
updatedTime?: string
|
updatedTime?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -428,90 +310,36 @@ declare namespace material {
|
|||||||
*/
|
*/
|
||||||
export interface StocktakingScanExceptionalData {
|
export interface StocktakingScanExceptionalData {
|
||||||
/** 申请单id */
|
/** 申请单id */
|
||||||
applyId?: number
|
applyId?: number;
|
||||||
|
|
||||||
/** 条码 */
|
/** 条码 */
|
||||||
barcode?: string
|
barcode?: string;
|
||||||
|
|
||||||
/** createdTime */
|
/** createdTime */
|
||||||
createdTime?: string
|
createdTime?: string;
|
||||||
|
|
||||||
/** 异常处理 */
|
/** 异常处理 */
|
||||||
exceptionHandle?: 'MARK_LOST' | 'MARK_KEEP' | 'MARK_RETURN' | 'MARK_DISCARD' | 'MARK_NEW'
|
exceptionHandle?: 'INBOUND' | 'OUTBOUND' | 'DISCARD';
|
||||||
|
|
||||||
/** 异常类型 */
|
/** 异常类型 */
|
||||||
exceptionReason?: 'SOCK_IN_BUT_SCAN_NOT_EXIST' | 'SOCK_OUT_BUT_SCAN_EXIST' | 'SOCK_NOT_EXIST_BUT_SCAN_EXIST'
|
exceptionReason?:
|
||||||
|
| 'SOCK_IN_BUT_SCAN_NOT_EXIST'
|
||||||
|
| 'SOCK_OUT_BUT_SCAN_EXIST'
|
||||||
|
| 'SOCK_NOT_EXIST_BUT_SCAN_EXIST';
|
||||||
|
|
||||||
/** id */
|
/** id */
|
||||||
id?: number
|
id?: number;
|
||||||
|
|
||||||
/** 物料ID */
|
/** 物料ID */
|
||||||
materialId?: number
|
materialId?: number;
|
||||||
|
|
||||||
/** materialName */
|
/** materialName */
|
||||||
materialName?: string
|
materialName?: string;
|
||||||
|
|
||||||
/** 备注 */
|
/** 备注 */
|
||||||
remark?: string
|
remark?: string;
|
||||||
|
|
||||||
/** updatedTime */
|
/** updatedTime */
|
||||||
updatedTime?: string
|
updatedTime?: string;
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 类型
|
|
||||||
*/
|
|
||||||
export interface Type {
|
|
||||||
/** createdTime */
|
|
||||||
createdTime?: string
|
|
||||||
|
|
||||||
/** id */
|
|
||||||
id?: number
|
|
||||||
|
|
||||||
/** 类型级别 */
|
|
||||||
level: 'ONE' | 'TWO'
|
|
||||||
|
|
||||||
/** levelInfo */
|
|
||||||
levelInfo?: material.Codebook
|
|
||||||
|
|
||||||
/** 类型名称 */
|
|
||||||
name: string
|
|
||||||
|
|
||||||
/** 类型编码 */
|
|
||||||
no: string
|
|
||||||
|
|
||||||
/** 上级类型编码 */
|
|
||||||
parentNo?: string
|
|
||||||
|
|
||||||
/** updatedTime */
|
|
||||||
updatedTime?: string
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* TypeTree
|
|
||||||
*/
|
|
||||||
export interface TypeTree {
|
|
||||||
/** children */
|
|
||||||
children?: Array<material.TypeTree>
|
|
||||||
|
|
||||||
/** 类型名称 */
|
|
||||||
label: string
|
|
||||||
|
|
||||||
/** parentNo */
|
|
||||||
parentNo?: string
|
|
||||||
|
|
||||||
/** 类型编码 */
|
|
||||||
value: string
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* WaitScanInfo
|
|
||||||
*/
|
|
||||||
export interface WaitScanInfo {
|
|
||||||
/** 物料数量 */
|
|
||||||
count?: number
|
|
||||||
|
|
||||||
/** 物料名称 */
|
|
||||||
materialName?: string
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,32 +0,0 @@
|
|||||||
/**
|
|
||||||
* @desc 导出盘点申请单列表
|
|
||||||
*/
|
|
||||||
import { defaultSuccess, defaultError, http } from '@/plugins/axios'
|
|
||||||
import type { AxiosResponse } from 'axios'
|
|
||||||
export interface Params {
|
|
||||||
/** 盘点类型 */
|
|
||||||
auditType?: 'SCAN' | 'MANUAL'
|
|
||||||
/** 盘点人 */
|
|
||||||
taker?: string
|
|
||||||
/** 创建日期 */
|
|
||||||
createDate?: string
|
|
||||||
/** 审核状态 */
|
|
||||||
reviewResults?: Array<'WAIT_SCAN' | 'WAIT_SUBMIT' | 'WAIT_REVIEW' | 'PASS' | 'REJECT'>
|
|
||||||
}
|
|
||||||
|
|
||||||
export default async function (
|
|
||||||
params: Params,
|
|
||||||
success: (data: void) => void = defaultSuccess,
|
|
||||||
fail: (error: { code: string; error?: string }) => void = defaultError,
|
|
||||||
): Promise<void> {
|
|
||||||
return http({
|
|
||||||
method: 'get',
|
|
||||||
url: `/apply/audit/download-excel`,
|
|
||||||
|
|
||||||
params,
|
|
||||||
})
|
|
||||||
.then((data: AxiosResponse<void, unknown>) => {
|
|
||||||
success(data.data)
|
|
||||||
})
|
|
||||||
.catch((error: { code: string; error?: string }) => fail(error))
|
|
||||||
}
|
|
@ -1,30 +0,0 @@
|
|||||||
/**
|
|
||||||
* @desc 导出申请单列表
|
|
||||||
*/
|
|
||||||
import { defaultSuccess, defaultError, http } from '@/plugins/axios'
|
|
||||||
import type { AxiosResponse } from 'axios'
|
|
||||||
export interface Params {
|
|
||||||
/** 申请类型(1入库 3出库 4盘点) */
|
|
||||||
applyType: number
|
|
||||||
/** 物料类型 */
|
|
||||||
type?: string
|
|
||||||
/** 编码/名称 */
|
|
||||||
key?: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export default async function (
|
|
||||||
params: Params,
|
|
||||||
success: (data: void) => void = defaultSuccess,
|
|
||||||
fail: (error: { code: string; error?: string }) => void = defaultError,
|
|
||||||
): Promise<void> {
|
|
||||||
return http({
|
|
||||||
method: 'get',
|
|
||||||
url: `/apply/download-excel`,
|
|
||||||
|
|
||||||
params,
|
|
||||||
})
|
|
||||||
.then((data: AxiosResponse<void, unknown>) => {
|
|
||||||
success(data.data)
|
|
||||||
})
|
|
||||||
.catch((error: { code: string; error?: string }) => fail(error))
|
|
||||||
}
|
|
@ -1,21 +0,0 @@
|
|||||||
/**
|
|
||||||
* @desc 查询人工盘点选中物料的待核查数据
|
|
||||||
*/
|
|
||||||
import { defaultSuccess, defaultError, http } from '@/plugins/axios'
|
|
||||||
import type { AxiosResponse } from 'axios'
|
|
||||||
export default async function (
|
|
||||||
/** 申请单ID */
|
|
||||||
applyId: number,
|
|
||||||
|
|
||||||
success: (data: Array<material.Material>) => void = defaultSuccess,
|
|
||||||
fail: (error: { code: string; error?: string }) => void = defaultError,
|
|
||||||
): Promise<void> {
|
|
||||||
return http({
|
|
||||||
method: 'get',
|
|
||||||
url: `/manual/check-data/${applyId}`,
|
|
||||||
})
|
|
||||||
.then((data: AxiosResponse<Array<material.Material>, unknown>) => {
|
|
||||||
success(data.data)
|
|
||||||
})
|
|
||||||
.catch((error: { code: string; error?: string }) => fail(error))
|
|
||||||
}
|
|
@ -1,21 +0,0 @@
|
|||||||
/**
|
|
||||||
* @desc 获取人工盘点数据
|
|
||||||
*/
|
|
||||||
import { defaultSuccess, defaultError, http } from '@/plugins/axios'
|
|
||||||
import type { AxiosResponse } from 'axios'
|
|
||||||
export default async function (
|
|
||||||
/** 申请单ID */
|
|
||||||
applyId: number,
|
|
||||||
|
|
||||||
success: (data: Array<material.ManualStockDTO>) => void = defaultSuccess,
|
|
||||||
fail: (error: { code: string; error?: string }) => void = defaultError,
|
|
||||||
): Promise<void> {
|
|
||||||
return http({
|
|
||||||
method: 'get',
|
|
||||||
url: `/manual/data/${applyId}`,
|
|
||||||
})
|
|
||||||
.then((data: AxiosResponse<Array<material.ManualStockDTO>, unknown>) => {
|
|
||||||
success(data.data)
|
|
||||||
})
|
|
||||||
.catch((error: { code: string; error?: string }) => fail(error))
|
|
||||||
}
|
|
@ -1,21 +0,0 @@
|
|||||||
/**
|
|
||||||
* @desc 获取报废出库申请单
|
|
||||||
*/
|
|
||||||
import { defaultSuccess, defaultError, http } from '@/plugins/axios'
|
|
||||||
import type { AxiosResponse } from 'axios'
|
|
||||||
export default async function (
|
|
||||||
/** 申请单ID */
|
|
||||||
applyId: number,
|
|
||||||
|
|
||||||
success: (data: Array<material.ScrapOutApplyDTO>) => void = defaultSuccess,
|
|
||||||
fail: (error: { code: string; error?: string }) => void = defaultError,
|
|
||||||
): Promise<void> {
|
|
||||||
return http({
|
|
||||||
method: 'get',
|
|
||||||
url: `/scrap-out/${applyId}`,
|
|
||||||
})
|
|
||||||
.then((data: AxiosResponse<Array<material.ScrapOutApplyDTO>, unknown>) => {
|
|
||||||
success(data.data)
|
|
||||||
})
|
|
||||||
.catch((error: { code: string; error?: string }) => fail(error))
|
|
||||||
}
|
|
@ -1,21 +0,0 @@
|
|||||||
/**
|
|
||||||
* @desc 获取盘点的待扫码信息
|
|
||||||
*/
|
|
||||||
import { defaultSuccess, defaultError, http } from '@/plugins/axios'
|
|
||||||
import type { AxiosResponse } from 'axios'
|
|
||||||
export default async function (
|
|
||||||
/** 申请单ID */
|
|
||||||
applyId: number,
|
|
||||||
|
|
||||||
success: (data: Array<material.WaitScanInfo>) => void = defaultSuccess,
|
|
||||||
fail: (error: { code: string; error?: string }) => void = defaultError,
|
|
||||||
): Promise<void> {
|
|
||||||
return http({
|
|
||||||
method: 'get',
|
|
||||||
url: `/wait-scan-data/${applyId}`,
|
|
||||||
})
|
|
||||||
.then((data: AxiosResponse<Array<material.WaitScanInfo>, unknown>) => {
|
|
||||||
success(data.data)
|
|
||||||
})
|
|
||||||
.catch((error: { code: string; error?: string }) => fail(error))
|
|
||||||
}
|
|
@ -2,40 +2,22 @@
|
|||||||
* @description 入库/出库 申请单管理
|
* @description 入库/出库 申请单管理
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import searchPage from './searchPage'
|
import searchPage from './searchPage';
|
||||||
import saveApply from './saveApply'
|
import saveApply from './saveApply';
|
||||||
import downloadAuditExcel from './downloadAuditExcel'
|
import detail from './detail';
|
||||||
import downloadExcel from './downloadExcel'
|
import searchAuditPage from './searchAuditPage';
|
||||||
import detail from './detail'
|
import auditApply from './auditApply';
|
||||||
import searchAuditPage from './searchAuditPage'
|
import getComparisonRes from './getComparisonRes';
|
||||||
import auditApply from './auditApply'
|
import updateReviewResult from './updateReviewResult';
|
||||||
import getComparisonRes from './getComparisonRes'
|
import saveScanData from './saveScanData';
|
||||||
import updateReviewResult from './updateReviewResult'
|
|
||||||
import submitManualStock from './submitManualStock'
|
|
||||||
import getManualCheckData from './getManualCheckData'
|
|
||||||
import getManualStock from './getManualStock'
|
|
||||||
import saveScanData from './saveScanData'
|
|
||||||
import submitScrapOutReview from './submitScrapOutReview'
|
|
||||||
import getScrapOutById from './getScrapOutById'
|
|
||||||
import submitReview from './submitReview'
|
|
||||||
import getWaitScanData from './getWaitScanData'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
searchPage,
|
searchPage,
|
||||||
saveApply,
|
saveApply,
|
||||||
downloadAuditExcel,
|
|
||||||
downloadExcel,
|
|
||||||
detail,
|
detail,
|
||||||
searchAuditPage,
|
searchAuditPage,
|
||||||
auditApply,
|
auditApply,
|
||||||
getComparisonRes,
|
getComparisonRes,
|
||||||
updateReviewResult,
|
updateReviewResult,
|
||||||
submitManualStock,
|
|
||||||
getManualCheckData,
|
|
||||||
getManualStock,
|
|
||||||
saveScanData,
|
saveScanData,
|
||||||
submitScrapOutReview,
|
};
|
||||||
getScrapOutById,
|
|
||||||
submitReview,
|
|
||||||
getWaitScanData,
|
|
||||||
}
|
|
||||||
|
@ -1,22 +1,24 @@
|
|||||||
/**
|
/**
|
||||||
* @desc 分页查询盘点列表
|
* @desc 分页查询盘点列表
|
||||||
*/
|
*/
|
||||||
import { defaultSuccess, defaultError, http } from '@/plugins/axios'
|
import { defaultSuccess, defaultError, http } from '@/plugins/axios';
|
||||||
import type { AxiosResponse } from 'axios'
|
import type { AxiosResponse } from 'axios';
|
||||||
import type { IPage } from '@/api/api'
|
import type { IPage } from '@/api/api';
|
||||||
export interface Params {
|
export interface Params {
|
||||||
/** 页码 */
|
/** 页码 */
|
||||||
page?: number
|
page?: number;
|
||||||
/** 页面大小 */
|
/** 页面大小 */
|
||||||
size?: number
|
size?: number;
|
||||||
/** 盘点类型 */
|
/** 盘点类型 */
|
||||||
auditType?: 'SCAN' | 'MANUAL'
|
auditType?: 'ALL' | 'PARTIAL';
|
||||||
/** 盘点人 */
|
/** 盘点人 */
|
||||||
taker?: string
|
taker?: string;
|
||||||
/** 创建日期 */
|
/** 创建日期 */
|
||||||
createDate?: string
|
createDate?: string;
|
||||||
/** 审核状态 */
|
/** 审核状态 */
|
||||||
reviewResults?: Array<'WAIT_SCAN' | 'WAIT_SUBMIT' | 'WAIT_REVIEW' | 'PASS' | 'REJECT'>
|
reviewResults?: Array<
|
||||||
|
'WAIT_SCAN' | 'WAIT_SUBMIT' | 'WAIT_REVIEW' | 'PASS' | 'REJECT'
|
||||||
|
>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default async function (
|
export default async function (
|
||||||
@ -31,7 +33,7 @@ export default async function (
|
|||||||
params,
|
params,
|
||||||
})
|
})
|
||||||
.then((data: AxiosResponse<IPage<material.ApplyForm>, unknown>) => {
|
.then((data: AxiosResponse<IPage<material.ApplyForm>, unknown>) => {
|
||||||
success(data.data)
|
success(data.data);
|
||||||
})
|
})
|
||||||
.catch((error: { code: string; error?: string }) => fail(error))
|
.catch((error: { code: string; error?: string }) => fail(error));
|
||||||
}
|
}
|
||||||
|
@ -1,20 +1,22 @@
|
|||||||
/**
|
/**
|
||||||
* @desc 分页查询申请列表
|
* @desc 分页查询申请列表
|
||||||
*/
|
*/
|
||||||
import { defaultSuccess, defaultError, http } from '@/plugins/axios'
|
import { defaultSuccess, defaultError, http } from '@/plugins/axios';
|
||||||
import type { AxiosResponse } from 'axios'
|
import type { AxiosResponse } from 'axios';
|
||||||
import type { IPage } from '@/api/api'
|
import type { IPage } from '@/api/api';
|
||||||
export interface Params {
|
export interface Params {
|
||||||
/** 申请类型(1入库 3出库 4盘点) */
|
/** 申请类型(1入库 3出库 4盘点) */
|
||||||
applyType: number
|
applyType: number;
|
||||||
/** 页码 */
|
/** 页码 */
|
||||||
page?: number
|
page?: number;
|
||||||
/** 页面大小 */
|
/** 页面大小 */
|
||||||
size?: number
|
size?: number;
|
||||||
/** 物料类型 */
|
/** 物料类型 */
|
||||||
type?: string
|
type?: string;
|
||||||
/** 编码/名称 */
|
/** 物料编码 */
|
||||||
key?: string
|
code?: string;
|
||||||
|
/** 物料名称 */
|
||||||
|
name?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default async function (
|
export default async function (
|
||||||
@ -29,7 +31,7 @@ export default async function (
|
|||||||
params,
|
params,
|
||||||
})
|
})
|
||||||
.then((data: AxiosResponse<IPage<material.ApplyDTO>, unknown>) => {
|
.then((data: AxiosResponse<IPage<material.ApplyDTO>, unknown>) => {
|
||||||
success(data.data)
|
success(data.data);
|
||||||
})
|
})
|
||||||
.catch((error: { code: string; error?: string }) => fail(error))
|
.catch((error: { code: string; error?: string }) => fail(error));
|
||||||
}
|
}
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
/**
|
|
||||||
* @desc 提交人工盘点数据
|
|
||||||
*/
|
|
||||||
import { defaultSuccess, defaultError, http } from '@/plugins/axios'
|
|
||||||
import type { AxiosResponse } from 'axios'
|
|
||||||
export default async function (
|
|
||||||
/** 请求体 */
|
|
||||||
requestBody: Array<material.ManualStockDetail>,
|
|
||||||
|
|
||||||
success: (data: void) => void = defaultSuccess,
|
|
||||||
fail: (error: { code: string; error?: string }) => void = defaultError,
|
|
||||||
): Promise<void> {
|
|
||||||
return http({
|
|
||||||
method: 'post',
|
|
||||||
url: `/manual/audit-apply`,
|
|
||||||
data: requestBody,
|
|
||||||
})
|
|
||||||
.then((data: AxiosResponse<void, unknown>) => {
|
|
||||||
success(data.data)
|
|
||||||
})
|
|
||||||
.catch((error: { code: string; error?: string }) => fail(error))
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
/**
|
|
||||||
* @desc 提交审核
|
|
||||||
*/
|
|
||||||
import { defaultSuccess, defaultError, http } from '@/plugins/axios'
|
|
||||||
import type { AxiosResponse } from 'axios'
|
|
||||||
export default async function (
|
|
||||||
/** 请求体 */
|
|
||||||
requestBody: material.ReviewDTO,
|
|
||||||
|
|
||||||
success: (data: void) => void = defaultSuccess,
|
|
||||||
fail: (error: { code: string; error?: string }) => void = defaultError,
|
|
||||||
): Promise<void> {
|
|
||||||
return http({
|
|
||||||
method: 'post',
|
|
||||||
url: `/submit-review`,
|
|
||||||
data: requestBody,
|
|
||||||
})
|
|
||||||
.then((data: AxiosResponse<void, unknown>) => {
|
|
||||||
success(data.data)
|
|
||||||
})
|
|
||||||
.catch((error: { code: string; error?: string }) => fail(error))
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
/**
|
|
||||||
* @desc 提交报废出库审核
|
|
||||||
*/
|
|
||||||
import { defaultSuccess, defaultError, http } from '@/plugins/axios'
|
|
||||||
import type { AxiosResponse } from 'axios'
|
|
||||||
export default async function (
|
|
||||||
/** 请求体 */
|
|
||||||
requestBody: material.ReviewDTO,
|
|
||||||
|
|
||||||
success: (data: void) => void = defaultSuccess,
|
|
||||||
fail: (error: { code: string; error?: string }) => void = defaultError,
|
|
||||||
): Promise<void> {
|
|
||||||
return http({
|
|
||||||
method: 'post',
|
|
||||||
url: `/scrap-out-review`,
|
|
||||||
data: requestBody,
|
|
||||||
})
|
|
||||||
.then((data: AxiosResponse<void, unknown>) => {
|
|
||||||
success(data.data)
|
|
||||||
})
|
|
||||||
.catch((error: { code: string; error?: string }) => fail(error))
|
|
||||||
}
|
|
@ -1,11 +1,8 @@
|
|||||||
import apply from './apply'
|
import apply from './apply';
|
||||||
|
|
||||||
import material from './material'
|
import material from './material';
|
||||||
|
|
||||||
import type from './type'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
apply,
|
apply,
|
||||||
material,
|
material,
|
||||||
type,
|
};
|
||||||
}
|
|
||||||
|
@ -1,28 +1,18 @@
|
|||||||
/**
|
/**
|
||||||
* @desc 查询所有物料列表
|
* @desc 查询所有物料列表
|
||||||
*/
|
*/
|
||||||
import { defaultSuccess, defaultError, http } from '@/plugins/axios'
|
import { defaultSuccess, defaultError, http } from '@/plugins/axios';
|
||||||
import type { AxiosResponse } from 'axios'
|
import type { AxiosResponse } from 'axios';
|
||||||
export interface Params {
|
|
||||||
/** 类型 */
|
|
||||||
type?: string
|
|
||||||
/** 是否赋码 */
|
|
||||||
assignRule?: boolean
|
|
||||||
}
|
|
||||||
|
|
||||||
export default async function (
|
export default async function (
|
||||||
params: Params,
|
|
||||||
success: (data: Array<material.Material>) => void = defaultSuccess,
|
success: (data: Array<material.Material>) => void = defaultSuccess,
|
||||||
fail: (error: { code: string; error?: string }) => void = defaultError,
|
fail: (error: { code: string; error?: string }) => void = defaultError,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
return http({
|
return http({
|
||||||
method: 'post',
|
method: 'get',
|
||||||
url: `/material/list`,
|
url: `/material/list`,
|
||||||
|
|
||||||
params,
|
|
||||||
})
|
})
|
||||||
.then((data: AxiosResponse<Array<material.Material>, unknown>) => {
|
.then((data: AxiosResponse<Array<material.Material>, unknown>) => {
|
||||||
success(data.data)
|
success(data.data);
|
||||||
})
|
})
|
||||||
.catch((error: { code: string; error?: string }) => fail(error))
|
.catch((error: { code: string; error?: string }) => fail(error));
|
||||||
}
|
}
|
||||||
|
@ -1,28 +0,0 @@
|
|||||||
/**
|
|
||||||
* @desc 导出物料列表
|
|
||||||
*/
|
|
||||||
import { defaultSuccess, defaultError, http } from '@/plugins/axios'
|
|
||||||
import type { AxiosResponse } from 'axios'
|
|
||||||
export interface Params {
|
|
||||||
/** 类型 */
|
|
||||||
type?: string
|
|
||||||
/** 搜索关键词 */
|
|
||||||
key?: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export default async function (
|
|
||||||
params: Params,
|
|
||||||
success: (data: void) => void = defaultSuccess,
|
|
||||||
fail: (error: { code: string; error?: string }) => void = defaultError,
|
|
||||||
): Promise<void> {
|
|
||||||
return http({
|
|
||||||
method: 'get',
|
|
||||||
url: `/material/download-excel`,
|
|
||||||
|
|
||||||
params,
|
|
||||||
})
|
|
||||||
.then((data: AxiosResponse<void, unknown>) => {
|
|
||||||
success(data.data)
|
|
||||||
})
|
|
||||||
.catch((error: { code: string; error?: string }) => fail(error))
|
|
||||||
}
|
|
@ -1,29 +0,0 @@
|
|||||||
/**
|
|
||||||
* @desc 批量生成条形码
|
|
||||||
*/
|
|
||||||
import { defaultSuccess, defaultError, http } from '@/plugins/axios'
|
|
||||||
import type { AxiosResponse } from 'axios'
|
|
||||||
export interface Params {
|
|
||||||
/** 条形码数量 */
|
|
||||||
count: number
|
|
||||||
}
|
|
||||||
|
|
||||||
export default async function (
|
|
||||||
/** 物料id */
|
|
||||||
id: number,
|
|
||||||
|
|
||||||
params: Params,
|
|
||||||
success: (data: Array<string>) => void = defaultSuccess,
|
|
||||||
fail: (error: { code: string; error?: string }) => void = defaultError,
|
|
||||||
): Promise<void> {
|
|
||||||
return http({
|
|
||||||
method: 'post',
|
|
||||||
url: `/material/${id}/generate-barcodes`,
|
|
||||||
|
|
||||||
params,
|
|
||||||
})
|
|
||||||
.then((data: AxiosResponse<Array<string>, unknown>) => {
|
|
||||||
success(data.data)
|
|
||||||
})
|
|
||||||
.catch((error: { code: string; error?: string }) => fail(error))
|
|
||||||
}
|
|
@ -2,20 +2,16 @@
|
|||||||
* @description 物料管理
|
* @description 物料管理
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import saveOrUpdateMaterial from './saveOrUpdateMaterial'
|
import saveOrUpdateMaterial from './saveOrUpdateMaterial';
|
||||||
import downloadExcel from './downloadExcel'
|
import all from './all';
|
||||||
import all from './all'
|
import detail from './detail';
|
||||||
import detail from './detail'
|
import deleteMaterial from './deleteMaterial';
|
||||||
import deleteMaterial from './deleteMaterial'
|
import materials from './materials';
|
||||||
import generateBarcodes from './generateBarcodes'
|
|
||||||
import materials from './materials'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
saveOrUpdateMaterial,
|
saveOrUpdateMaterial,
|
||||||
downloadExcel,
|
|
||||||
all,
|
all,
|
||||||
detail,
|
detail,
|
||||||
deleteMaterial,
|
deleteMaterial,
|
||||||
generateBarcodes,
|
|
||||||
materials,
|
materials,
|
||||||
}
|
};
|
||||||
|
@ -1,18 +1,18 @@
|
|||||||
/**
|
/**
|
||||||
* @desc 分页查询物料列表
|
* @desc 分页查询物料列表
|
||||||
*/
|
*/
|
||||||
import { defaultSuccess, defaultError, http } from '@/plugins/axios'
|
import { defaultSuccess, defaultError, http } from '@/plugins/axios';
|
||||||
import type { AxiosResponse } from 'axios'
|
import type { AxiosResponse } from 'axios';
|
||||||
import type { IPage } from '@/api/api'
|
import type { IPage } from '@/api/api';
|
||||||
export interface Params {
|
export interface Params {
|
||||||
/** 页码 */
|
/** 页码 */
|
||||||
page?: number
|
page?: number;
|
||||||
/** 页面大小 */
|
/** 页面大小 */
|
||||||
size?: number
|
size?: number;
|
||||||
/** 类型 */
|
/** 类型 */
|
||||||
type?: string
|
type?: number;
|
||||||
/** 搜索关键词 */
|
/** 搜索关键词 */
|
||||||
key?: string
|
key?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default async function (
|
export default async function (
|
||||||
@ -27,7 +27,7 @@ export default async function (
|
|||||||
params,
|
params,
|
||||||
})
|
})
|
||||||
.then((data: AxiosResponse<IPage<material.Material>, unknown>) => {
|
.then((data: AxiosResponse<IPage<material.Material>, unknown>) => {
|
||||||
success(data.data)
|
success(data.data);
|
||||||
})
|
})
|
||||||
.catch((error: { code: string; error?: string }) => fail(error))
|
.catch((error: { code: string; error?: string }) => fail(error));
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* @desc 增加/编辑物料
|
* @desc 增加/编辑物料
|
||||||
*/
|
*/
|
||||||
import { defaultSuccess, defaultError, http } from '@/plugins/axios'
|
import { defaultSuccess, defaultError, http } from '@/plugins/axios';
|
||||||
import type { AxiosResponse } from 'axios'
|
import type { AxiosResponse } from 'axios';
|
||||||
export default async function (
|
export default async function (
|
||||||
/** 请求体 */
|
/** 请求体 */
|
||||||
requestBody: material.Material,
|
requestBody: material.Material,
|
||||||
@ -16,7 +16,7 @@ export default async function (
|
|||||||
data: requestBody,
|
data: requestBody,
|
||||||
})
|
})
|
||||||
.then((data: AxiosResponse<material.Material, unknown>) => {
|
.then((data: AxiosResponse<material.Material, unknown>) => {
|
||||||
success(data.data)
|
success(data.data);
|
||||||
})
|
})
|
||||||
.catch((error: { code: string; error?: string }) => fail(error))
|
.catch((error: { code: string; error?: string }) => fail(error));
|
||||||
}
|
}
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
/**
|
|
||||||
* @desc 增加/更新地区
|
|
||||||
*/
|
|
||||||
import { defaultSuccess, defaultError, http } from '@/plugins/axios'
|
|
||||||
import type { AxiosResponse } from 'axios'
|
|
||||||
export default async function (
|
|
||||||
/** 请求体 */
|
|
||||||
requestBody: material.Type,
|
|
||||||
|
|
||||||
success: (data: material.Type) => void = defaultSuccess,
|
|
||||||
fail: (error: { code: string; error?: string }) => void = defaultError,
|
|
||||||
): Promise<void> {
|
|
||||||
return http({
|
|
||||||
method: 'post',
|
|
||||||
url: `/area`,
|
|
||||||
data: requestBody,
|
|
||||||
})
|
|
||||||
.then((data: AxiosResponse<material.Type, unknown>) => {
|
|
||||||
success(data.data)
|
|
||||||
})
|
|
||||||
.catch((error: { code: string; error?: string }) => fail(error))
|
|
||||||
}
|
|
@ -1,26 +0,0 @@
|
|||||||
/**
|
|
||||||
* @desc 查询类型
|
|
||||||
*/
|
|
||||||
import { defaultSuccess, defaultError, http } from '@/plugins/axios'
|
|
||||||
import type { AxiosResponse } from 'axios'
|
|
||||||
export interface Params {
|
|
||||||
/** 搜索关键词 */
|
|
||||||
key?: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export default async function (
|
|
||||||
params: Params,
|
|
||||||
success: (data: Array<material.Type>) => void = defaultSuccess,
|
|
||||||
fail: (error: { code: string; error?: string }) => void = defaultError,
|
|
||||||
): Promise<void> {
|
|
||||||
return http({
|
|
||||||
method: 'get',
|
|
||||||
url: `/areas`,
|
|
||||||
|
|
||||||
params,
|
|
||||||
})
|
|
||||||
.then((data: AxiosResponse<Array<material.Type>, unknown>) => {
|
|
||||||
success(data.data)
|
|
||||||
})
|
|
||||||
.catch((error: { code: string; error?: string }) => fail(error))
|
|
||||||
}
|
|
@ -1,21 +0,0 @@
|
|||||||
/**
|
|
||||||
* @desc 删除类型
|
|
||||||
*/
|
|
||||||
import { defaultSuccess, defaultError, http } from '@/plugins/axios'
|
|
||||||
import type { AxiosResponse } from 'axios'
|
|
||||||
export default async function (
|
|
||||||
/** id */
|
|
||||||
id: number,
|
|
||||||
|
|
||||||
success: (data: void) => void = defaultSuccess,
|
|
||||||
fail: (error: { code: string; error?: string }) => void = defaultError,
|
|
||||||
): Promise<void> {
|
|
||||||
return http({
|
|
||||||
method: 'delete',
|
|
||||||
url: `/area/${id}`,
|
|
||||||
})
|
|
||||||
.then((data: AxiosResponse<void, unknown>) => {
|
|
||||||
success(data.data)
|
|
||||||
})
|
|
||||||
.catch((error: { code: string; error?: string }) => fail(error))
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
/**
|
|
||||||
* @description 物料类型管理
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
import addAndModify from './addAndModify'
|
|
||||||
import levels from './levels'
|
|
||||||
import trees from './trees'
|
|
||||||
import deleteArea from './deleteArea'
|
|
||||||
import areas from './areas'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
addAndModify,
|
|
||||||
levels,
|
|
||||||
trees,
|
|
||||||
deleteArea,
|
|
||||||
areas,
|
|
||||||
}
|
|
@ -1,20 +0,0 @@
|
|||||||
/**
|
|
||||||
* @desc 级别
|
|
||||||
*/
|
|
||||||
import { defaultSuccess, defaultError, http } from '@/plugins/axios'
|
|
||||||
import type { AxiosResponse } from 'axios'
|
|
||||||
import type { Codebook } from '@/api/api'
|
|
||||||
|
|
||||||
export default async function (
|
|
||||||
success: (data: Array<Codebook>) => void = defaultSuccess,
|
|
||||||
fail: (error: { code: string; error?: string }) => void = defaultError,
|
|
||||||
): Promise<void> {
|
|
||||||
return http({
|
|
||||||
method: 'get',
|
|
||||||
url: `/area/levels`,
|
|
||||||
})
|
|
||||||
.then((data: AxiosResponse<Array<Codebook>, unknown>) => {
|
|
||||||
success(data.data)
|
|
||||||
})
|
|
||||||
.catch((error: { code: string; error?: string }) => fail(error))
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
/**
|
|
||||||
* @desc 类型树
|
|
||||||
*/
|
|
||||||
import { defaultSuccess, defaultError, http } from '@/plugins/axios'
|
|
||||||
import type { AxiosResponse } from 'axios'
|
|
||||||
export default async function (
|
|
||||||
success: (data: Array<material.TypeTree>) => void = defaultSuccess,
|
|
||||||
fail: (error: { code: string; error?: string }) => void = defaultError,
|
|
||||||
): Promise<void> {
|
|
||||||
return http({
|
|
||||||
method: 'get',
|
|
||||||
url: `/area/trees`,
|
|
||||||
})
|
|
||||||
.then((data: AxiosResponse<Array<material.TypeTree>, unknown>) => {
|
|
||||||
success(data.data)
|
|
||||||
})
|
|
||||||
.catch((error: { code: string; error?: string }) => fail(error))
|
|
||||||
}
|
|
73
src/api/pontCore.ts
Normal file
73
src/api/pontCore.ts
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
/**
|
||||||
|
* @description pont内置请求单例
|
||||||
|
*/
|
||||||
|
|
||||||
|
class PontCoreManager {
|
||||||
|
// static singleInstance = undefined as PontCoreManager;
|
||||||
|
private static singleInstance: PontCoreManager | null = null;
|
||||||
|
|
||||||
|
static getSignleInstance() {
|
||||||
|
if (!PontCoreManager.singleInstance) {
|
||||||
|
PontCoreManager.singleInstance = new PontCoreManager();
|
||||||
|
return PontCoreManager.singleInstance;
|
||||||
|
}
|
||||||
|
return PontCoreManager.singleInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* fetch请求
|
||||||
|
* @param url 请求url
|
||||||
|
* @param options fetch 请求配置
|
||||||
|
*/
|
||||||
|
fetch(url: string, options = {}) {
|
||||||
|
return fetch(url, options).then((res) => {
|
||||||
|
return res.json();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 使用外部传入的请求方法替换默认的fetch请求
|
||||||
|
*/
|
||||||
|
useFetch(fetch: (url: string, options?: any) => Promise<any>) {
|
||||||
|
if (typeof fetch !== 'function') {
|
||||||
|
console.error('fetch should be a function ');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.fetch = fetch;
|
||||||
|
}
|
||||||
|
|
||||||
|
getUrl(path: string, queryParams: any) {
|
||||||
|
const params = {
|
||||||
|
...(queryParams || ({} as any)),
|
||||||
|
};
|
||||||
|
|
||||||
|
const url = path.replace(/\{([^\\}]*(?:\\.[^\\}]*)*)\}/gm, ( key) => {
|
||||||
|
// eslint-disable-next-line no-param-reassign
|
||||||
|
key = key.trim();
|
||||||
|
|
||||||
|
if (params[key] !== undefined) {
|
||||||
|
const value = params[key];
|
||||||
|
delete params[key];
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
console.warn('Please set value for template key: ', key);
|
||||||
|
return '';
|
||||||
|
});
|
||||||
|
|
||||||
|
const paramStr = Object.keys(params)
|
||||||
|
.map((key) => {
|
||||||
|
return params[key] === undefined ? '' : `${key}=${params[key]}`;
|
||||||
|
})
|
||||||
|
.filter((id) => id)
|
||||||
|
.join('&');
|
||||||
|
|
||||||
|
if (paramStr) {
|
||||||
|
return `${url}?${paramStr}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const PontCore = PontCoreManager.getSignleInstance();
|
578
src/auto-imports.d.ts
vendored
578
src/auto-imports.d.ts
vendored
@ -6,304 +6,292 @@
|
|||||||
// biome-ignore lint: disable
|
// biome-ignore lint: disable
|
||||||
export {}
|
export {}
|
||||||
declare global {
|
declare global {
|
||||||
const EffectScope: (typeof import('vue'))['EffectScope']
|
const EffectScope: typeof import('vue')['EffectScope']
|
||||||
const asyncComputed: (typeof import('@vueuse/core'))['asyncComputed']
|
const asyncComputed: typeof import('@vueuse/core')['asyncComputed']
|
||||||
const autoResetRef: (typeof import('@vueuse/core'))['autoResetRef']
|
const autoResetRef: typeof import('@vueuse/core')['autoResetRef']
|
||||||
const computed: (typeof import('vue'))['computed']
|
const computed: typeof import('vue')['computed']
|
||||||
const computedAsync: (typeof import('@vueuse/core'))['computedAsync']
|
const computedAsync: typeof import('@vueuse/core')['computedAsync']
|
||||||
const computedEager: (typeof import('@vueuse/core'))['computedEager']
|
const computedEager: typeof import('@vueuse/core')['computedEager']
|
||||||
const computedInject: (typeof import('@vueuse/core'))['computedInject']
|
const computedInject: typeof import('@vueuse/core')['computedInject']
|
||||||
const computedWithControl: (typeof import('@vueuse/core'))['computedWithControl']
|
const computedWithControl: typeof import('@vueuse/core')['computedWithControl']
|
||||||
const controlledComputed: (typeof import('@vueuse/core'))['controlledComputed']
|
const controlledComputed: typeof import('@vueuse/core')['controlledComputed']
|
||||||
const controlledRef: (typeof import('@vueuse/core'))['controlledRef']
|
const controlledRef: typeof import('@vueuse/core')['controlledRef']
|
||||||
const createApp: (typeof import('vue'))['createApp']
|
const createApp: typeof import('vue')['createApp']
|
||||||
const createEventHook: (typeof import('@vueuse/core'))['createEventHook']
|
const createEventHook: typeof import('@vueuse/core')['createEventHook']
|
||||||
const createGlobalState: (typeof import('@vueuse/core'))['createGlobalState']
|
const createGlobalState: typeof import('@vueuse/core')['createGlobalState']
|
||||||
const createInjectionState: (typeof import('@vueuse/core'))['createInjectionState']
|
const createInjectionState: typeof import('@vueuse/core')['createInjectionState']
|
||||||
const createReactiveFn: (typeof import('@vueuse/core'))['createReactiveFn']
|
const createReactiveFn: typeof import('@vueuse/core')['createReactiveFn']
|
||||||
const createReusableTemplate: (typeof import('@vueuse/core'))['createReusableTemplate']
|
const createReusableTemplate: typeof import('@vueuse/core')['createReusableTemplate']
|
||||||
const createSharedComposable: (typeof import('@vueuse/core'))['createSharedComposable']
|
const createSharedComposable: typeof import('@vueuse/core')['createSharedComposable']
|
||||||
const createTemplatePromise: (typeof import('@vueuse/core'))['createTemplatePromise']
|
const createTemplatePromise: typeof import('@vueuse/core')['createTemplatePromise']
|
||||||
const createUnrefFn: (typeof import('@vueuse/core'))['createUnrefFn']
|
const createUnrefFn: typeof import('@vueuse/core')['createUnrefFn']
|
||||||
const customRef: (typeof import('vue'))['customRef']
|
const customRef: typeof import('vue')['customRef']
|
||||||
const debouncedRef: (typeof import('@vueuse/core'))['debouncedRef']
|
const debouncedRef: typeof import('@vueuse/core')['debouncedRef']
|
||||||
const debouncedWatch: (typeof import('@vueuse/core'))['debouncedWatch']
|
const debouncedWatch: typeof import('@vueuse/core')['debouncedWatch']
|
||||||
const defineAsyncComponent: (typeof import('vue'))['defineAsyncComponent']
|
const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
|
||||||
const defineComponent: (typeof import('vue'))['defineComponent']
|
const defineComponent: typeof import('vue')['defineComponent']
|
||||||
const eagerComputed: (typeof import('@vueuse/core'))['eagerComputed']
|
const eagerComputed: typeof import('@vueuse/core')['eagerComputed']
|
||||||
const effectScope: (typeof import('vue'))['effectScope']
|
const effectScope: typeof import('vue')['effectScope']
|
||||||
const extendRef: (typeof import('@vueuse/core'))['extendRef']
|
const extendRef: typeof import('@vueuse/core')['extendRef']
|
||||||
const getCurrentInstance: (typeof import('vue'))['getCurrentInstance']
|
const getCurrentInstance: typeof import('vue')['getCurrentInstance']
|
||||||
const getCurrentScope: (typeof import('vue'))['getCurrentScope']
|
const getCurrentScope: typeof import('vue')['getCurrentScope']
|
||||||
const h: (typeof import('vue'))['h']
|
const h: typeof import('vue')['h']
|
||||||
const ignorableWatch: (typeof import('@vueuse/core'))['ignorableWatch']
|
const ignorableWatch: typeof import('@vueuse/core')['ignorableWatch']
|
||||||
const inject: (typeof import('vue'))['inject']
|
const inject: typeof import('vue')['inject']
|
||||||
const injectLocal: (typeof import('@vueuse/core'))['injectLocal']
|
const injectLocal: typeof import('@vueuse/core')['injectLocal']
|
||||||
const isDefined: (typeof import('@vueuse/core'))['isDefined']
|
const isDefined: typeof import('@vueuse/core')['isDefined']
|
||||||
const isProxy: (typeof import('vue'))['isProxy']
|
const isProxy: typeof import('vue')['isProxy']
|
||||||
const isReactive: (typeof import('vue'))['isReactive']
|
const isReactive: typeof import('vue')['isReactive']
|
||||||
const isReadonly: (typeof import('vue'))['isReadonly']
|
const isReadonly: typeof import('vue')['isReadonly']
|
||||||
const isRef: (typeof import('vue'))['isRef']
|
const isRef: typeof import('vue')['isRef']
|
||||||
const makeDestructurable: (typeof import('@vueuse/core'))['makeDestructurable']
|
const makeDestructurable: typeof import('@vueuse/core')['makeDestructurable']
|
||||||
const markRaw: (typeof import('vue'))['markRaw']
|
const markRaw: typeof import('vue')['markRaw']
|
||||||
const nextTick: (typeof import('vue'))['nextTick']
|
const nextTick: typeof import('vue')['nextTick']
|
||||||
const onActivated: (typeof import('vue'))['onActivated']
|
const onActivated: typeof import('vue')['onActivated']
|
||||||
const onBeforeMount: (typeof import('vue'))['onBeforeMount']
|
const onBeforeMount: typeof import('vue')['onBeforeMount']
|
||||||
const onBeforeRouteLeave: (typeof import('vue-router'))['onBeforeRouteLeave']
|
const onBeforeRouteLeave: typeof import('vue-router')['onBeforeRouteLeave']
|
||||||
const onBeforeRouteUpdate: (typeof import('vue-router'))['onBeforeRouteUpdate']
|
const onBeforeRouteUpdate: typeof import('vue-router')['onBeforeRouteUpdate']
|
||||||
const onBeforeUnmount: (typeof import('vue'))['onBeforeUnmount']
|
const onBeforeUnmount: typeof import('vue')['onBeforeUnmount']
|
||||||
const onBeforeUpdate: (typeof import('vue'))['onBeforeUpdate']
|
const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
|
||||||
const onClickOutside: (typeof import('@vueuse/core'))['onClickOutside']
|
const onClickOutside: typeof import('@vueuse/core')['onClickOutside']
|
||||||
const onDeactivated: (typeof import('vue'))['onDeactivated']
|
const onDeactivated: typeof import('vue')['onDeactivated']
|
||||||
const onErrorCaptured: (typeof import('vue'))['onErrorCaptured']
|
const onErrorCaptured: typeof import('vue')['onErrorCaptured']
|
||||||
const onKeyStroke: (typeof import('@vueuse/core'))['onKeyStroke']
|
const onKeyStroke: typeof import('@vueuse/core')['onKeyStroke']
|
||||||
const onLongPress: (typeof import('@vueuse/core'))['onLongPress']
|
const onLongPress: typeof import('@vueuse/core')['onLongPress']
|
||||||
const onMounted: (typeof import('vue'))['onMounted']
|
const onMounted: typeof import('vue')['onMounted']
|
||||||
const onRenderTracked: (typeof import('vue'))['onRenderTracked']
|
const onRenderTracked: typeof import('vue')['onRenderTracked']
|
||||||
const onRenderTriggered: (typeof import('vue'))['onRenderTriggered']
|
const onRenderTriggered: typeof import('vue')['onRenderTriggered']
|
||||||
const onScopeDispose: (typeof import('vue'))['onScopeDispose']
|
const onScopeDispose: typeof import('vue')['onScopeDispose']
|
||||||
const onServerPrefetch: (typeof import('vue'))['onServerPrefetch']
|
const onServerPrefetch: typeof import('vue')['onServerPrefetch']
|
||||||
const onStartTyping: (typeof import('@vueuse/core'))['onStartTyping']
|
const onStartTyping: typeof import('@vueuse/core')['onStartTyping']
|
||||||
const onUnmounted: (typeof import('vue'))['onUnmounted']
|
const onUnmounted: typeof import('vue')['onUnmounted']
|
||||||
const onUpdated: (typeof import('vue'))['onUpdated']
|
const onUpdated: typeof import('vue')['onUpdated']
|
||||||
const onWatcherCleanup: (typeof import('vue'))['onWatcherCleanup']
|
const onWatcherCleanup: typeof import('vue')['onWatcherCleanup']
|
||||||
const pausableWatch: (typeof import('@vueuse/core'))['pausableWatch']
|
const pausableWatch: typeof import('@vueuse/core')['pausableWatch']
|
||||||
const provide: (typeof import('vue'))['provide']
|
const provide: typeof import('vue')['provide']
|
||||||
const provideLocal: (typeof import('@vueuse/core'))['provideLocal']
|
const provideLocal: typeof import('@vueuse/core')['provideLocal']
|
||||||
const reactify: (typeof import('@vueuse/core'))['reactify']
|
const reactify: typeof import('@vueuse/core')['reactify']
|
||||||
const reactifyObject: (typeof import('@vueuse/core'))['reactifyObject']
|
const reactifyObject: typeof import('@vueuse/core')['reactifyObject']
|
||||||
const reactive: (typeof import('vue'))['reactive']
|
const reactive: typeof import('vue')['reactive']
|
||||||
const reactiveComputed: (typeof import('@vueuse/core'))['reactiveComputed']
|
const reactiveComputed: typeof import('@vueuse/core')['reactiveComputed']
|
||||||
const reactiveOmit: (typeof import('@vueuse/core'))['reactiveOmit']
|
const reactiveOmit: typeof import('@vueuse/core')['reactiveOmit']
|
||||||
const reactivePick: (typeof import('@vueuse/core'))['reactivePick']
|
const reactivePick: typeof import('@vueuse/core')['reactivePick']
|
||||||
const readonly: (typeof import('vue'))['readonly']
|
const readonly: typeof import('vue')['readonly']
|
||||||
const ref: (typeof import('vue'))['ref']
|
const ref: typeof import('vue')['ref']
|
||||||
const refAutoReset: (typeof import('@vueuse/core'))['refAutoReset']
|
const refAutoReset: typeof import('@vueuse/core')['refAutoReset']
|
||||||
const refDebounced: (typeof import('@vueuse/core'))['refDebounced']
|
const refDebounced: typeof import('@vueuse/core')['refDebounced']
|
||||||
const refDefault: (typeof import('@vueuse/core'))['refDefault']
|
const refDefault: typeof import('@vueuse/core')['refDefault']
|
||||||
const refThrottled: (typeof import('@vueuse/core'))['refThrottled']
|
const refThrottled: typeof import('@vueuse/core')['refThrottled']
|
||||||
const refWithControl: (typeof import('@vueuse/core'))['refWithControl']
|
const refWithControl: typeof import('@vueuse/core')['refWithControl']
|
||||||
const resolveComponent: (typeof import('vue'))['resolveComponent']
|
const resolveComponent: typeof import('vue')['resolveComponent']
|
||||||
const resolveRef: (typeof import('@vueuse/core'))['resolveRef']
|
const resolveRef: typeof import('@vueuse/core')['resolveRef']
|
||||||
const resolveUnref: (typeof import('@vueuse/core'))['resolveUnref']
|
const resolveUnref: typeof import('@vueuse/core')['resolveUnref']
|
||||||
const shallowReactive: (typeof import('vue'))['shallowReactive']
|
const shallowReactive: typeof import('vue')['shallowReactive']
|
||||||
const shallowReadonly: (typeof import('vue'))['shallowReadonly']
|
const shallowReadonly: typeof import('vue')['shallowReadonly']
|
||||||
const shallowRef: (typeof import('vue'))['shallowRef']
|
const shallowRef: typeof import('vue')['shallowRef']
|
||||||
const syncRef: (typeof import('@vueuse/core'))['syncRef']
|
const syncRef: typeof import('@vueuse/core')['syncRef']
|
||||||
const syncRefs: (typeof import('@vueuse/core'))['syncRefs']
|
const syncRefs: typeof import('@vueuse/core')['syncRefs']
|
||||||
const templateRef: (typeof import('@vueuse/core'))['templateRef']
|
const templateRef: typeof import('@vueuse/core')['templateRef']
|
||||||
const throttledRef: (typeof import('@vueuse/core'))['throttledRef']
|
const throttledRef: typeof import('@vueuse/core')['throttledRef']
|
||||||
const throttledWatch: (typeof import('@vueuse/core'))['throttledWatch']
|
const throttledWatch: typeof import('@vueuse/core')['throttledWatch']
|
||||||
const toRaw: (typeof import('vue'))['toRaw']
|
const toRaw: typeof import('vue')['toRaw']
|
||||||
const toReactive: (typeof import('@vueuse/core'))['toReactive']
|
const toReactive: typeof import('@vueuse/core')['toReactive']
|
||||||
const toRef: (typeof import('vue'))['toRef']
|
const toRef: typeof import('vue')['toRef']
|
||||||
const toRefs: (typeof import('vue'))['toRefs']
|
const toRefs: typeof import('vue')['toRefs']
|
||||||
const toValue: (typeof import('vue'))['toValue']
|
const toValue: typeof import('vue')['toValue']
|
||||||
const triggerRef: (typeof import('vue'))['triggerRef']
|
const triggerRef: typeof import('vue')['triggerRef']
|
||||||
const tryOnBeforeMount: (typeof import('@vueuse/core'))['tryOnBeforeMount']
|
const tryOnBeforeMount: typeof import('@vueuse/core')['tryOnBeforeMount']
|
||||||
const tryOnBeforeUnmount: (typeof import('@vueuse/core'))['tryOnBeforeUnmount']
|
const tryOnBeforeUnmount: typeof import('@vueuse/core')['tryOnBeforeUnmount']
|
||||||
const tryOnMounted: (typeof import('@vueuse/core'))['tryOnMounted']
|
const tryOnMounted: typeof import('@vueuse/core')['tryOnMounted']
|
||||||
const tryOnScopeDispose: (typeof import('@vueuse/core'))['tryOnScopeDispose']
|
const tryOnScopeDispose: typeof import('@vueuse/core')['tryOnScopeDispose']
|
||||||
const tryOnUnmounted: (typeof import('@vueuse/core'))['tryOnUnmounted']
|
const tryOnUnmounted: typeof import('@vueuse/core')['tryOnUnmounted']
|
||||||
const unref: (typeof import('vue'))['unref']
|
const unref: typeof import('vue')['unref']
|
||||||
const unrefElement: (typeof import('@vueuse/core'))['unrefElement']
|
const unrefElement: typeof import('@vueuse/core')['unrefElement']
|
||||||
const until: (typeof import('@vueuse/core'))['until']
|
const until: typeof import('@vueuse/core')['until']
|
||||||
const useActiveElement: (typeof import('@vueuse/core'))['useActiveElement']
|
const useActiveElement: typeof import('@vueuse/core')['useActiveElement']
|
||||||
const useAnimate: (typeof import('@vueuse/core'))['useAnimate']
|
const useAnimate: typeof import('@vueuse/core')['useAnimate']
|
||||||
const useArrayDifference: (typeof import('@vueuse/core'))['useArrayDifference']
|
const useArrayDifference: typeof import('@vueuse/core')['useArrayDifference']
|
||||||
const useArrayEvery: (typeof import('@vueuse/core'))['useArrayEvery']
|
const useArrayEvery: typeof import('@vueuse/core')['useArrayEvery']
|
||||||
const useArrayFilter: (typeof import('@vueuse/core'))['useArrayFilter']
|
const useArrayFilter: typeof import('@vueuse/core')['useArrayFilter']
|
||||||
const useArrayFind: (typeof import('@vueuse/core'))['useArrayFind']
|
const useArrayFind: typeof import('@vueuse/core')['useArrayFind']
|
||||||
const useArrayFindIndex: (typeof import('@vueuse/core'))['useArrayFindIndex']
|
const useArrayFindIndex: typeof import('@vueuse/core')['useArrayFindIndex']
|
||||||
const useArrayFindLast: (typeof import('@vueuse/core'))['useArrayFindLast']
|
const useArrayFindLast: typeof import('@vueuse/core')['useArrayFindLast']
|
||||||
const useArrayIncludes: (typeof import('@vueuse/core'))['useArrayIncludes']
|
const useArrayIncludes: typeof import('@vueuse/core')['useArrayIncludes']
|
||||||
const useArrayJoin: (typeof import('@vueuse/core'))['useArrayJoin']
|
const useArrayJoin: typeof import('@vueuse/core')['useArrayJoin']
|
||||||
const useArrayMap: (typeof import('@vueuse/core'))['useArrayMap']
|
const useArrayMap: typeof import('@vueuse/core')['useArrayMap']
|
||||||
const useArrayReduce: (typeof import('@vueuse/core'))['useArrayReduce']
|
const useArrayReduce: typeof import('@vueuse/core')['useArrayReduce']
|
||||||
const useArraySome: (typeof import('@vueuse/core'))['useArraySome']
|
const useArraySome: typeof import('@vueuse/core')['useArraySome']
|
||||||
const useArrayUnique: (typeof import('@vueuse/core'))['useArrayUnique']
|
const useArrayUnique: typeof import('@vueuse/core')['useArrayUnique']
|
||||||
const useAsyncQueue: (typeof import('@vueuse/core'))['useAsyncQueue']
|
const useAsyncQueue: typeof import('@vueuse/core')['useAsyncQueue']
|
||||||
const useAsyncState: (typeof import('@vueuse/core'))['useAsyncState']
|
const useAsyncState: typeof import('@vueuse/core')['useAsyncState']
|
||||||
const useAttrs: (typeof import('vue'))['useAttrs']
|
const useAttrs: typeof import('vue')['useAttrs']
|
||||||
const useBase64: (typeof import('@vueuse/core'))['useBase64']
|
const useBase64: typeof import('@vueuse/core')['useBase64']
|
||||||
const useBattery: (typeof import('@vueuse/core'))['useBattery']
|
const useBattery: typeof import('@vueuse/core')['useBattery']
|
||||||
const useBluetooth: (typeof import('@vueuse/core'))['useBluetooth']
|
const useBluetooth: typeof import('@vueuse/core')['useBluetooth']
|
||||||
const useBreakpoints: (typeof import('@vueuse/core'))['useBreakpoints']
|
const useBreakpoints: typeof import('@vueuse/core')['useBreakpoints']
|
||||||
const useBroadcastChannel: (typeof import('@vueuse/core'))['useBroadcastChannel']
|
const useBroadcastChannel: typeof import('@vueuse/core')['useBroadcastChannel']
|
||||||
const useBrowserLocation: (typeof import('@vueuse/core'))['useBrowserLocation']
|
const useBrowserLocation: typeof import('@vueuse/core')['useBrowserLocation']
|
||||||
const useCached: (typeof import('@vueuse/core'))['useCached']
|
const useCached: typeof import('@vueuse/core')['useCached']
|
||||||
const useClipboard: (typeof import('@vueuse/core'))['useClipboard']
|
const useClipboard: typeof import('@vueuse/core')['useClipboard']
|
||||||
const useClipboardItems: (typeof import('@vueuse/core'))['useClipboardItems']
|
const useClipboardItems: typeof import('@vueuse/core')['useClipboardItems']
|
||||||
const useCloned: (typeof import('@vueuse/core'))['useCloned']
|
const useCloned: typeof import('@vueuse/core')['useCloned']
|
||||||
const useColorMode: (typeof import('@vueuse/core'))['useColorMode']
|
const useColorMode: typeof import('@vueuse/core')['useColorMode']
|
||||||
const useConfirmDialog: (typeof import('@vueuse/core'))['useConfirmDialog']
|
const useConfirmDialog: typeof import('@vueuse/core')['useConfirmDialog']
|
||||||
const useCounter: (typeof import('@vueuse/core'))['useCounter']
|
const useCounter: typeof import('@vueuse/core')['useCounter']
|
||||||
const useCssModule: (typeof import('vue'))['useCssModule']
|
const useCssModule: typeof import('vue')['useCssModule']
|
||||||
const useCssVar: (typeof import('@vueuse/core'))['useCssVar']
|
const useCssVar: typeof import('@vueuse/core')['useCssVar']
|
||||||
const useCssVars: (typeof import('vue'))['useCssVars']
|
const useCssVars: typeof import('vue')['useCssVars']
|
||||||
const useCurrentElement: (typeof import('@vueuse/core'))['useCurrentElement']
|
const useCurrentElement: typeof import('@vueuse/core')['useCurrentElement']
|
||||||
const useCycleList: (typeof import('@vueuse/core'))['useCycleList']
|
const useCycleList: typeof import('@vueuse/core')['useCycleList']
|
||||||
const useDark: (typeof import('@vueuse/core'))['useDark']
|
const useDark: typeof import('@vueuse/core')['useDark']
|
||||||
const useDateFormat: (typeof import('@vueuse/core'))['useDateFormat']
|
const useDateFormat: typeof import('@vueuse/core')['useDateFormat']
|
||||||
const useDebounce: (typeof import('@vueuse/core'))['useDebounce']
|
const useDebounce: typeof import('@vueuse/core')['useDebounce']
|
||||||
const useDebounceFn: (typeof import('@vueuse/core'))['useDebounceFn']
|
const useDebounceFn: typeof import('@vueuse/core')['useDebounceFn']
|
||||||
const useDebouncedRefHistory: (typeof import('@vueuse/core'))['useDebouncedRefHistory']
|
const useDebouncedRefHistory: typeof import('@vueuse/core')['useDebouncedRefHistory']
|
||||||
const useDeviceMotion: (typeof import('@vueuse/core'))['useDeviceMotion']
|
const useDeviceMotion: typeof import('@vueuse/core')['useDeviceMotion']
|
||||||
const useDeviceOrientation: (typeof import('@vueuse/core'))['useDeviceOrientation']
|
const useDeviceOrientation: typeof import('@vueuse/core')['useDeviceOrientation']
|
||||||
const useDevicePixelRatio: (typeof import('@vueuse/core'))['useDevicePixelRatio']
|
const useDevicePixelRatio: typeof import('@vueuse/core')['useDevicePixelRatio']
|
||||||
const useDevicesList: (typeof import('@vueuse/core'))['useDevicesList']
|
const useDevicesList: typeof import('@vueuse/core')['useDevicesList']
|
||||||
const useDisplayMedia: (typeof import('@vueuse/core'))['useDisplayMedia']
|
const useDisplayMedia: typeof import('@vueuse/core')['useDisplayMedia']
|
||||||
const useDocumentVisibility: (typeof import('@vueuse/core'))['useDocumentVisibility']
|
const useDocumentVisibility: typeof import('@vueuse/core')['useDocumentVisibility']
|
||||||
const useDraggable: (typeof import('@vueuse/core'))['useDraggable']
|
const useDraggable: typeof import('@vueuse/core')['useDraggable']
|
||||||
const useDropZone: (typeof import('@vueuse/core'))['useDropZone']
|
const useDropZone: typeof import('@vueuse/core')['useDropZone']
|
||||||
const useElementBounding: (typeof import('@vueuse/core'))['useElementBounding']
|
const useElementBounding: typeof import('@vueuse/core')['useElementBounding']
|
||||||
const useElementByPoint: (typeof import('@vueuse/core'))['useElementByPoint']
|
const useElementByPoint: typeof import('@vueuse/core')['useElementByPoint']
|
||||||
const useElementHover: (typeof import('@vueuse/core'))['useElementHover']
|
const useElementHover: typeof import('@vueuse/core')['useElementHover']
|
||||||
const useElementSize: (typeof import('@vueuse/core'))['useElementSize']
|
const useElementSize: typeof import('@vueuse/core')['useElementSize']
|
||||||
const useElementVisibility: (typeof import('@vueuse/core'))['useElementVisibility']
|
const useElementVisibility: typeof import('@vueuse/core')['useElementVisibility']
|
||||||
const useEventBus: (typeof import('@vueuse/core'))['useEventBus']
|
const useEventBus: typeof import('@vueuse/core')['useEventBus']
|
||||||
const useEventListener: (typeof import('@vueuse/core'))['useEventListener']
|
const useEventListener: typeof import('@vueuse/core')['useEventListener']
|
||||||
const useEventSource: (typeof import('@vueuse/core'))['useEventSource']
|
const useEventSource: typeof import('@vueuse/core')['useEventSource']
|
||||||
const useEyeDropper: (typeof import('@vueuse/core'))['useEyeDropper']
|
const useEyeDropper: typeof import('@vueuse/core')['useEyeDropper']
|
||||||
const useFavicon: (typeof import('@vueuse/core'))['useFavicon']
|
const useFavicon: typeof import('@vueuse/core')['useFavicon']
|
||||||
const useFetch: (typeof import('@vueuse/core'))['useFetch']
|
const useFetch: typeof import('@vueuse/core')['useFetch']
|
||||||
const useFileDialog: (typeof import('@vueuse/core'))['useFileDialog']
|
const useFileDialog: typeof import('@vueuse/core')['useFileDialog']
|
||||||
const useFileSystemAccess: (typeof import('@vueuse/core'))['useFileSystemAccess']
|
const useFileSystemAccess: typeof import('@vueuse/core')['useFileSystemAccess']
|
||||||
const useFocus: (typeof import('@vueuse/core'))['useFocus']
|
const useFocus: typeof import('@vueuse/core')['useFocus']
|
||||||
const useFocusWithin: (typeof import('@vueuse/core'))['useFocusWithin']
|
const useFocusWithin: typeof import('@vueuse/core')['useFocusWithin']
|
||||||
const useFps: (typeof import('@vueuse/core'))['useFps']
|
const useFps: typeof import('@vueuse/core')['useFps']
|
||||||
const useFullscreen: (typeof import('@vueuse/core'))['useFullscreen']
|
const useFullscreen: typeof import('@vueuse/core')['useFullscreen']
|
||||||
const useGamepad: (typeof import('@vueuse/core'))['useGamepad']
|
const useGamepad: typeof import('@vueuse/core')['useGamepad']
|
||||||
const useGeolocation: (typeof import('@vueuse/core'))['useGeolocation']
|
const useGeolocation: typeof import('@vueuse/core')['useGeolocation']
|
||||||
const useId: (typeof import('vue'))['useId']
|
const useId: typeof import('vue')['useId']
|
||||||
const useIdle: (typeof import('@vueuse/core'))['useIdle']
|
const useIdle: typeof import('@vueuse/core')['useIdle']
|
||||||
const useImage: (typeof import('@vueuse/core'))['useImage']
|
const useImage: typeof import('@vueuse/core')['useImage']
|
||||||
const useInfiniteScroll: (typeof import('@vueuse/core'))['useInfiniteScroll']
|
const useInfiniteScroll: typeof import('@vueuse/core')['useInfiniteScroll']
|
||||||
const useIntersectionObserver: (typeof import('@vueuse/core'))['useIntersectionObserver']
|
const useIntersectionObserver: typeof import('@vueuse/core')['useIntersectionObserver']
|
||||||
const useInterval: (typeof import('@vueuse/core'))['useInterval']
|
const useInterval: typeof import('@vueuse/core')['useInterval']
|
||||||
const useIntervalFn: (typeof import('@vueuse/core'))['useIntervalFn']
|
const useIntervalFn: typeof import('@vueuse/core')['useIntervalFn']
|
||||||
const useKeyModifier: (typeof import('@vueuse/core'))['useKeyModifier']
|
const useKeyModifier: typeof import('@vueuse/core')['useKeyModifier']
|
||||||
const useLastChanged: (typeof import('@vueuse/core'))['useLastChanged']
|
const useLastChanged: typeof import('@vueuse/core')['useLastChanged']
|
||||||
const useLink: (typeof import('vue-router'))['useLink']
|
const useLink: typeof import('vue-router')['useLink']
|
||||||
const useLocalStorage: (typeof import('@vueuse/core'))['useLocalStorage']
|
const useLocalStorage: typeof import('@vueuse/core')['useLocalStorage']
|
||||||
const useMagicKeys: (typeof import('@vueuse/core'))['useMagicKeys']
|
const useMagicKeys: typeof import('@vueuse/core')['useMagicKeys']
|
||||||
const useManualRefHistory: (typeof import('@vueuse/core'))['useManualRefHistory']
|
const useManualRefHistory: typeof import('@vueuse/core')['useManualRefHistory']
|
||||||
const useMediaControls: (typeof import('@vueuse/core'))['useMediaControls']
|
const useMediaControls: typeof import('@vueuse/core')['useMediaControls']
|
||||||
const useMediaQuery: (typeof import('@vueuse/core'))['useMediaQuery']
|
const useMediaQuery: typeof import('@vueuse/core')['useMediaQuery']
|
||||||
const useMemoize: (typeof import('@vueuse/core'))['useMemoize']
|
const useMemoize: typeof import('@vueuse/core')['useMemoize']
|
||||||
const useMemory: (typeof import('@vueuse/core'))['useMemory']
|
const useMemory: typeof import('@vueuse/core')['useMemory']
|
||||||
const useModel: (typeof import('vue'))['useModel']
|
const useModel: typeof import('vue')['useModel']
|
||||||
const useMounted: (typeof import('@vueuse/core'))['useMounted']
|
const useMounted: typeof import('@vueuse/core')['useMounted']
|
||||||
const useMouse: (typeof import('@vueuse/core'))['useMouse']
|
const useMouse: typeof import('@vueuse/core')['useMouse']
|
||||||
const useMouseInElement: (typeof import('@vueuse/core'))['useMouseInElement']
|
const useMouseInElement: typeof import('@vueuse/core')['useMouseInElement']
|
||||||
const useMousePressed: (typeof import('@vueuse/core'))['useMousePressed']
|
const useMousePressed: typeof import('@vueuse/core')['useMousePressed']
|
||||||
const useMutationObserver: (typeof import('@vueuse/core'))['useMutationObserver']
|
const useMutationObserver: typeof import('@vueuse/core')['useMutationObserver']
|
||||||
const useNavigatorLanguage: (typeof import('@vueuse/core'))['useNavigatorLanguage']
|
const useNavigatorLanguage: typeof import('@vueuse/core')['useNavigatorLanguage']
|
||||||
const useNetwork: (typeof import('@vueuse/core'))['useNetwork']
|
const useNetwork: typeof import('@vueuse/core')['useNetwork']
|
||||||
const useNow: (typeof import('@vueuse/core'))['useNow']
|
const useNow: typeof import('@vueuse/core')['useNow']
|
||||||
const useObjectUrl: (typeof import('@vueuse/core'))['useObjectUrl']
|
const useObjectUrl: typeof import('@vueuse/core')['useObjectUrl']
|
||||||
const useOffsetPagination: (typeof import('@vueuse/core'))['useOffsetPagination']
|
const useOffsetPagination: typeof import('@vueuse/core')['useOffsetPagination']
|
||||||
const useOnline: (typeof import('@vueuse/core'))['useOnline']
|
const useOnline: typeof import('@vueuse/core')['useOnline']
|
||||||
const usePageLeave: (typeof import('@vueuse/core'))['usePageLeave']
|
const usePageLeave: typeof import('@vueuse/core')['usePageLeave']
|
||||||
const useParallax: (typeof import('@vueuse/core'))['useParallax']
|
const useParallax: typeof import('@vueuse/core')['useParallax']
|
||||||
const useParentElement: (typeof import('@vueuse/core'))['useParentElement']
|
const useParentElement: typeof import('@vueuse/core')['useParentElement']
|
||||||
const usePerformanceObserver: (typeof import('@vueuse/core'))['usePerformanceObserver']
|
const usePerformanceObserver: typeof import('@vueuse/core')['usePerformanceObserver']
|
||||||
const usePermission: (typeof import('@vueuse/core'))['usePermission']
|
const usePermission: typeof import('@vueuse/core')['usePermission']
|
||||||
const usePointer: (typeof import('@vueuse/core'))['usePointer']
|
const usePointer: typeof import('@vueuse/core')['usePointer']
|
||||||
const usePointerLock: (typeof import('@vueuse/core'))['usePointerLock']
|
const usePointerLock: typeof import('@vueuse/core')['usePointerLock']
|
||||||
const usePointerSwipe: (typeof import('@vueuse/core'))['usePointerSwipe']
|
const usePointerSwipe: typeof import('@vueuse/core')['usePointerSwipe']
|
||||||
const usePreferredColorScheme: (typeof import('@vueuse/core'))['usePreferredColorScheme']
|
const usePreferredColorScheme: typeof import('@vueuse/core')['usePreferredColorScheme']
|
||||||
const usePreferredContrast: (typeof import('@vueuse/core'))['usePreferredContrast']
|
const usePreferredContrast: typeof import('@vueuse/core')['usePreferredContrast']
|
||||||
const usePreferredDark: (typeof import('@vueuse/core'))['usePreferredDark']
|
const usePreferredDark: typeof import('@vueuse/core')['usePreferredDark']
|
||||||
const usePreferredLanguages: (typeof import('@vueuse/core'))['usePreferredLanguages']
|
const usePreferredLanguages: typeof import('@vueuse/core')['usePreferredLanguages']
|
||||||
const usePreferredReducedMotion: (typeof import('@vueuse/core'))['usePreferredReducedMotion']
|
const usePreferredReducedMotion: typeof import('@vueuse/core')['usePreferredReducedMotion']
|
||||||
const usePrevious: (typeof import('@vueuse/core'))['usePrevious']
|
const usePrevious: typeof import('@vueuse/core')['usePrevious']
|
||||||
const useRafFn: (typeof import('@vueuse/core'))['useRafFn']
|
const useRafFn: typeof import('@vueuse/core')['useRafFn']
|
||||||
const useRefHistory: (typeof import('@vueuse/core'))['useRefHistory']
|
const useRefHistory: typeof import('@vueuse/core')['useRefHistory']
|
||||||
const useResizeObserver: (typeof import('@vueuse/core'))['useResizeObserver']
|
const useResizeObserver: typeof import('@vueuse/core')['useResizeObserver']
|
||||||
const useRoute: (typeof import('vue-router'))['useRoute']
|
const useRoute: typeof import('vue-router')['useRoute']
|
||||||
const useRouter: (typeof import('vue-router'))['useRouter']
|
const useRouter: typeof import('vue-router')['useRouter']
|
||||||
const useScreenOrientation: (typeof import('@vueuse/core'))['useScreenOrientation']
|
const useScreenOrientation: typeof import('@vueuse/core')['useScreenOrientation']
|
||||||
const useScreenSafeArea: (typeof import('@vueuse/core'))['useScreenSafeArea']
|
const useScreenSafeArea: typeof import('@vueuse/core')['useScreenSafeArea']
|
||||||
const useScriptTag: (typeof import('@vueuse/core'))['useScriptTag']
|
const useScriptTag: typeof import('@vueuse/core')['useScriptTag']
|
||||||
const useScroll: (typeof import('@vueuse/core'))['useScroll']
|
const useScroll: typeof import('@vueuse/core')['useScroll']
|
||||||
const useScrollLock: (typeof import('@vueuse/core'))['useScrollLock']
|
const useScrollLock: typeof import('@vueuse/core')['useScrollLock']
|
||||||
const useSessionStorage: (typeof import('@vueuse/core'))['useSessionStorage']
|
const useSessionStorage: typeof import('@vueuse/core')['useSessionStorage']
|
||||||
const useShare: (typeof import('@vueuse/core'))['useShare']
|
const useShare: typeof import('@vueuse/core')['useShare']
|
||||||
const useSlots: (typeof import('vue'))['useSlots']
|
const useSlots: typeof import('vue')['useSlots']
|
||||||
const useSorted: (typeof import('@vueuse/core'))['useSorted']
|
const useSorted: typeof import('@vueuse/core')['useSorted']
|
||||||
const useSpeechRecognition: (typeof import('@vueuse/core'))['useSpeechRecognition']
|
const useSpeechRecognition: typeof import('@vueuse/core')['useSpeechRecognition']
|
||||||
const useSpeechSynthesis: (typeof import('@vueuse/core'))['useSpeechSynthesis']
|
const useSpeechSynthesis: typeof import('@vueuse/core')['useSpeechSynthesis']
|
||||||
const useStepper: (typeof import('@vueuse/core'))['useStepper']
|
const useStepper: typeof import('@vueuse/core')['useStepper']
|
||||||
const useStorage: (typeof import('@vueuse/core'))['useStorage']
|
const useStorage: typeof import('@vueuse/core')['useStorage']
|
||||||
const useStorageAsync: (typeof import('@vueuse/core'))['useStorageAsync']
|
const useStorageAsync: typeof import('@vueuse/core')['useStorageAsync']
|
||||||
const useStyleTag: (typeof import('@vueuse/core'))['useStyleTag']
|
const useStyleTag: typeof import('@vueuse/core')['useStyleTag']
|
||||||
const useSupported: (typeof import('@vueuse/core'))['useSupported']
|
const useSupported: typeof import('@vueuse/core')['useSupported']
|
||||||
const useSwipe: (typeof import('@vueuse/core'))['useSwipe']
|
const useSwipe: typeof import('@vueuse/core')['useSwipe']
|
||||||
const useTemplateRef: (typeof import('vue'))['useTemplateRef']
|
const useTemplateRef: typeof import('vue')['useTemplateRef']
|
||||||
const useTemplateRefsList: (typeof import('@vueuse/core'))['useTemplateRefsList']
|
const useTemplateRefsList: typeof import('@vueuse/core')['useTemplateRefsList']
|
||||||
const useTextDirection: (typeof import('@vueuse/core'))['useTextDirection']
|
const useTextDirection: typeof import('@vueuse/core')['useTextDirection']
|
||||||
const useTextSelection: (typeof import('@vueuse/core'))['useTextSelection']
|
const useTextSelection: typeof import('@vueuse/core')['useTextSelection']
|
||||||
const useTextareaAutosize: (typeof import('@vueuse/core'))['useTextareaAutosize']
|
const useTextareaAutosize: typeof import('@vueuse/core')['useTextareaAutosize']
|
||||||
const useThrottle: (typeof import('@vueuse/core'))['useThrottle']
|
const useThrottle: typeof import('@vueuse/core')['useThrottle']
|
||||||
const useThrottleFn: (typeof import('@vueuse/core'))['useThrottleFn']
|
const useThrottleFn: typeof import('@vueuse/core')['useThrottleFn']
|
||||||
const useThrottledRefHistory: (typeof import('@vueuse/core'))['useThrottledRefHistory']
|
const useThrottledRefHistory: typeof import('@vueuse/core')['useThrottledRefHistory']
|
||||||
const useTimeAgo: (typeof import('@vueuse/core'))['useTimeAgo']
|
const useTimeAgo: typeof import('@vueuse/core')['useTimeAgo']
|
||||||
const useTimeout: (typeof import('@vueuse/core'))['useTimeout']
|
const useTimeout: typeof import('@vueuse/core')['useTimeout']
|
||||||
const useTimeoutFn: (typeof import('@vueuse/core'))['useTimeoutFn']
|
const useTimeoutFn: typeof import('@vueuse/core')['useTimeoutFn']
|
||||||
const useTimeoutPoll: (typeof import('@vueuse/core'))['useTimeoutPoll']
|
const useTimeoutPoll: typeof import('@vueuse/core')['useTimeoutPoll']
|
||||||
const useTimestamp: (typeof import('@vueuse/core'))['useTimestamp']
|
const useTimestamp: typeof import('@vueuse/core')['useTimestamp']
|
||||||
const useTitle: (typeof import('@vueuse/core'))['useTitle']
|
const useTitle: typeof import('@vueuse/core')['useTitle']
|
||||||
const useToNumber: (typeof import('@vueuse/core'))['useToNumber']
|
const useToNumber: typeof import('@vueuse/core')['useToNumber']
|
||||||
const useToString: (typeof import('@vueuse/core'))['useToString']
|
const useToString: typeof import('@vueuse/core')['useToString']
|
||||||
const useToggle: (typeof import('@vueuse/core'))['useToggle']
|
const useToggle: typeof import('@vueuse/core')['useToggle']
|
||||||
const useTransition: (typeof import('@vueuse/core'))['useTransition']
|
const useTransition: typeof import('@vueuse/core')['useTransition']
|
||||||
const useUrlSearchParams: (typeof import('@vueuse/core'))['useUrlSearchParams']
|
const useUrlSearchParams: typeof import('@vueuse/core')['useUrlSearchParams']
|
||||||
const useUserMedia: (typeof import('@vueuse/core'))['useUserMedia']
|
const useUserMedia: typeof import('@vueuse/core')['useUserMedia']
|
||||||
const useVModel: (typeof import('@vueuse/core'))['useVModel']
|
const useVModel: typeof import('@vueuse/core')['useVModel']
|
||||||
const useVModels: (typeof import('@vueuse/core'))['useVModels']
|
const useVModels: typeof import('@vueuse/core')['useVModels']
|
||||||
const useVibrate: (typeof import('@vueuse/core'))['useVibrate']
|
const useVibrate: typeof import('@vueuse/core')['useVibrate']
|
||||||
const useVirtualList: (typeof import('@vueuse/core'))['useVirtualList']
|
const useVirtualList: typeof import('@vueuse/core')['useVirtualList']
|
||||||
const useWakeLock: (typeof import('@vueuse/core'))['useWakeLock']
|
const useWakeLock: typeof import('@vueuse/core')['useWakeLock']
|
||||||
const useWebNotification: (typeof import('@vueuse/core'))['useWebNotification']
|
const useWebNotification: typeof import('@vueuse/core')['useWebNotification']
|
||||||
const useWebSocket: (typeof import('@vueuse/core'))['useWebSocket']
|
const useWebSocket: typeof import('@vueuse/core')['useWebSocket']
|
||||||
const useWebWorker: (typeof import('@vueuse/core'))['useWebWorker']
|
const useWebWorker: typeof import('@vueuse/core')['useWebWorker']
|
||||||
const useWebWorkerFn: (typeof import('@vueuse/core'))['useWebWorkerFn']
|
const useWebWorkerFn: typeof import('@vueuse/core')['useWebWorkerFn']
|
||||||
const useWindowFocus: (typeof import('@vueuse/core'))['useWindowFocus']
|
const useWindowFocus: typeof import('@vueuse/core')['useWindowFocus']
|
||||||
const useWindowScroll: (typeof import('@vueuse/core'))['useWindowScroll']
|
const useWindowScroll: typeof import('@vueuse/core')['useWindowScroll']
|
||||||
const useWindowSize: (typeof import('@vueuse/core'))['useWindowSize']
|
const useWindowSize: typeof import('@vueuse/core')['useWindowSize']
|
||||||
const watch: (typeof import('vue'))['watch']
|
const watch: typeof import('vue')['watch']
|
||||||
const watchArray: (typeof import('@vueuse/core'))['watchArray']
|
const watchArray: typeof import('@vueuse/core')['watchArray']
|
||||||
const watchAtMost: (typeof import('@vueuse/core'))['watchAtMost']
|
const watchAtMost: typeof import('@vueuse/core')['watchAtMost']
|
||||||
const watchDebounced: (typeof import('@vueuse/core'))['watchDebounced']
|
const watchDebounced: typeof import('@vueuse/core')['watchDebounced']
|
||||||
const watchDeep: (typeof import('@vueuse/core'))['watchDeep']
|
const watchDeep: typeof import('@vueuse/core')['watchDeep']
|
||||||
const watchEffect: (typeof import('vue'))['watchEffect']
|
const watchEffect: typeof import('vue')['watchEffect']
|
||||||
const watchIgnorable: (typeof import('@vueuse/core'))['watchIgnorable']
|
const watchIgnorable: typeof import('@vueuse/core')['watchIgnorable']
|
||||||
const watchImmediate: (typeof import('@vueuse/core'))['watchImmediate']
|
const watchImmediate: typeof import('@vueuse/core')['watchImmediate']
|
||||||
const watchOnce: (typeof import('@vueuse/core'))['watchOnce']
|
const watchOnce: typeof import('@vueuse/core')['watchOnce']
|
||||||
const watchPausable: (typeof import('@vueuse/core'))['watchPausable']
|
const watchPausable: typeof import('@vueuse/core')['watchPausable']
|
||||||
const watchPostEffect: (typeof import('vue'))['watchPostEffect']
|
const watchPostEffect: typeof import('vue')['watchPostEffect']
|
||||||
const watchSyncEffect: (typeof import('vue'))['watchSyncEffect']
|
const watchSyncEffect: typeof import('vue')['watchSyncEffect']
|
||||||
const watchThrottled: (typeof import('@vueuse/core'))['watchThrottled']
|
const watchThrottled: typeof import('@vueuse/core')['watchThrottled']
|
||||||
const watchTriggerable: (typeof import('@vueuse/core'))['watchTriggerable']
|
const watchTriggerable: typeof import('@vueuse/core')['watchTriggerable']
|
||||||
const watchWithFilter: (typeof import('@vueuse/core'))['watchWithFilter']
|
const watchWithFilter: typeof import('@vueuse/core')['watchWithFilter']
|
||||||
const whenever: (typeof import('@vueuse/core'))['whenever']
|
const whenever: typeof import('@vueuse/core')['whenever']
|
||||||
}
|
}
|
||||||
// for type re-export
|
// for type re-export
|
||||||
declare global {
|
declare global {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
export type {
|
export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue'
|
||||||
Component,
|
|
||||||
ComponentPublicInstance,
|
|
||||||
ComputedRef,
|
|
||||||
ExtractDefaultPropTypes,
|
|
||||||
ExtractPropTypes,
|
|
||||||
ExtractPublicPropTypes,
|
|
||||||
InjectionKey,
|
|
||||||
PropType,
|
|
||||||
Ref,
|
|
||||||
VNode,
|
|
||||||
WritableComputedRef,
|
|
||||||
} from 'vue'
|
|
||||||
import('vue')
|
import('vue')
|
||||||
}
|
}
|
||||||
|
4
src/components.d.ts
vendored
4
src/components.d.ts
vendored
@ -17,13 +17,11 @@ declare module 'vue' {
|
|||||||
ADivider: typeof import('ant-design-vue/es')['Divider']
|
ADivider: typeof import('ant-design-vue/es')['Divider']
|
||||||
ADrawer: typeof import('ant-design-vue/es')['Drawer']
|
ADrawer: typeof import('ant-design-vue/es')['Drawer']
|
||||||
ADropdown: typeof import('ant-design-vue/es')['Dropdown']
|
ADropdown: typeof import('ant-design-vue/es')['Dropdown']
|
||||||
AFlex: typeof import('ant-design-vue/es')['Flex']
|
|
||||||
AFloatButton: typeof import('ant-design-vue/es')['FloatButton']
|
AFloatButton: typeof import('ant-design-vue/es')['FloatButton']
|
||||||
AForm: typeof import('ant-design-vue/es')['Form']
|
AForm: typeof import('ant-design-vue/es')['Form']
|
||||||
AFormItem: typeof import('ant-design-vue/es')['FormItem']
|
AFormItem: typeof import('ant-design-vue/es')['FormItem']
|
||||||
AImage: typeof import('ant-design-vue/es')['Image']
|
AImage: typeof import('ant-design-vue/es')['Image']
|
||||||
AInput: typeof import('ant-design-vue/es')['Input']
|
AInput: typeof import('ant-design-vue/es')['Input']
|
||||||
AInputNumber: typeof import('ant-design-vue/es')['InputNumber']
|
|
||||||
AInputPassword: typeof import('ant-design-vue/es')['InputPassword']
|
AInputPassword: typeof import('ant-design-vue/es')['InputPassword']
|
||||||
AInputSearch: typeof import('ant-design-vue/es')['InputSearch']
|
AInputSearch: typeof import('ant-design-vue/es')['InputSearch']
|
||||||
ALayout: typeof import('ant-design-vue/es')['Layout']
|
ALayout: typeof import('ant-design-vue/es')['Layout']
|
||||||
@ -52,11 +50,9 @@ declare module 'vue' {
|
|||||||
ATabPane: typeof import('ant-design-vue/es')['TabPane']
|
ATabPane: typeof import('ant-design-vue/es')['TabPane']
|
||||||
ATabs: typeof import('ant-design-vue/es')['Tabs']
|
ATabs: typeof import('ant-design-vue/es')['Tabs']
|
||||||
ATag: typeof import('ant-design-vue/es')['Tag']
|
ATag: typeof import('ant-design-vue/es')['Tag']
|
||||||
ATextarea: typeof import('ant-design-vue/es')['Textarea']
|
|
||||||
ATooltip: typeof import('ant-design-vue/es')['Tooltip']
|
ATooltip: typeof import('ant-design-vue/es')['Tooltip']
|
||||||
ATransfer: typeof import('ant-design-vue/es')['Transfer']
|
ATransfer: typeof import('ant-design-vue/es')['Transfer']
|
||||||
ATree: typeof import('ant-design-vue/es')['Tree']
|
ATree: typeof import('ant-design-vue/es')['Tree']
|
||||||
ATreeSelect: typeof import('ant-design-vue/es')['TreeSelect']
|
|
||||||
ATypographyLink: typeof import('ant-design-vue/es')['TypographyLink']
|
ATypographyLink: typeof import('ant-design-vue/es')['TypographyLink']
|
||||||
ATypographyParagraph: typeof import('ant-design-vue/es')['TypographyParagraph']
|
ATypographyParagraph: typeof import('ant-design-vue/es')['TypographyParagraph']
|
||||||
ATypographyTitle: typeof import('ant-design-vue/es')['TypographyTitle']
|
ATypographyTitle: typeof import('ant-design-vue/es')['TypographyTitle']
|
||||||
|
@ -2,7 +2,6 @@ import { RouteRecordRaw } from 'vue-router'
|
|||||||
import XEUtils from 'xe-utils'
|
import XEUtils from 'xe-utils'
|
||||||
import i18n from '@/locales'
|
import i18n from '@/locales'
|
||||||
import { routes } from '@/router'
|
import { routes } from '@/router'
|
||||||
import { useUserStore } from '@/stores/user'
|
|
||||||
const { t } = i18n.global
|
const { t } = i18n.global
|
||||||
export interface MenuNode {
|
export interface MenuNode {
|
||||||
key: string
|
key: string
|
||||||
@ -74,8 +73,8 @@ export function menuTree() {
|
|||||||
|
|
||||||
export function hasPermission(key?: string) {
|
export function hasPermission(key?: string) {
|
||||||
console.log(key)
|
console.log(key)
|
||||||
return useUserStore().hasPermission(key) // 过滤菜单是否显示
|
// return useUserStore().hasPermission(key);
|
||||||
// return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
export function permissions() {
|
export function permissions() {
|
||||||
@ -92,7 +91,6 @@ export function fliteredMenus() {
|
|||||||
return !item.hidden
|
return !item.hidden
|
||||||
})
|
})
|
||||||
.filter((item) => {
|
.filter((item) => {
|
||||||
if (item.key === 'Dashboard') return true // 首页显示
|
|
||||||
return hasPermission(item.keyPath)
|
return hasPermission(item.keyPath)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,6 @@
|
|||||||
import { config } from '@/settings/application'
|
import { config } from '@/settings/application'
|
||||||
import { MenuInfo } from 'ant-design-vue/es/menu/src/interface'
|
import { MenuInfo } from 'ant-design-vue/es/menu/src/interface'
|
||||||
import { useUserStore } from '@/stores/user'
|
import { useUserStore } from '@/stores/user'
|
||||||
import api from '@/api'
|
|
||||||
const t = useI18n()
|
const t = useI18n()
|
||||||
const user = useUserStore()
|
const user = useUserStore()
|
||||||
|
|
||||||
@ -82,13 +81,11 @@
|
|||||||
}
|
}
|
||||||
const logout = () => {
|
const logout = () => {
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: '退出登录',
|
title: t.t('layout.user.modal.logout.title'),
|
||||||
icon: createVNode(ExclamationCircleOutlined),
|
icon: createVNode(ExclamationCircleOutlined),
|
||||||
content: createVNode('div', { style: 'color:red;' }, '确定退出系统吗?'),
|
content: createVNode('div', { style: 'color:red;' }, t.t('layout.user.modal.logout.content')),
|
||||||
onOk() {
|
onOk() {
|
||||||
api.authApi.auth.logout(() => {
|
console.log(1)
|
||||||
user.logout()
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -29,18 +29,13 @@
|
|||||||
import SubMenu from './sub-menu.vue'
|
import SubMenu from './sub-menu.vue'
|
||||||
import XEUtils from 'xe-utils'
|
import XEUtils from 'xe-utils'
|
||||||
import { fliteredMenuTree } from './menu'
|
import { fliteredMenuTree } from './menu'
|
||||||
import { useRoute } from 'vue-router'
|
|
||||||
|
|
||||||
const app = useAppStore()
|
const app = useAppStore()
|
||||||
|
|
||||||
// const router = useRouter()
|
|
||||||
|
|
||||||
const theme = computed(() => {
|
const theme = computed(() => {
|
||||||
return app.layout.navTheme === 'light' ? 'light' : 'dark'
|
return app.layout.navTheme === 'light' ? 'light' : 'dark'
|
||||||
})
|
})
|
||||||
const menuTree = computed(() => {
|
const menuTree = computed(() => {
|
||||||
// 重新去计算路由的菜单
|
|
||||||
// router.currentRoute();
|
|
||||||
return fliteredMenuTree()
|
return fliteredMenuTree()
|
||||||
})
|
})
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
{
|
{
|
||||||
"index": "首页",
|
"index": "首页",
|
||||||
"dashboard": "首页",
|
|
||||||
"acl": {
|
"acl": {
|
||||||
"name": "系统管理",
|
"name": "系统管理",
|
||||||
"users": "用户管理",
|
"users": "用户管理",
|
||||||
|
@ -2,7 +2,7 @@ import { http } from '@/settings/http'
|
|||||||
import { useUserStore } from '@/stores/user'
|
import { useUserStore } from '@/stores/user'
|
||||||
import axios, { InternalAxiosRequestConfig, type AxiosError, type AxiosResponse } from 'axios'
|
import axios, { InternalAxiosRequestConfig, type AxiosError, type AxiosResponse } from 'axios'
|
||||||
import type { App } from 'vue'
|
import type { App } from 'vue'
|
||||||
import { notification } from 'ant-design-vue'
|
import router from '@/router'
|
||||||
|
|
||||||
export interface GlobalError {
|
export interface GlobalError {
|
||||||
/** 错误码 */
|
/** 错误码 */
|
||||||
@ -24,13 +24,9 @@ export function defaultSuccess(data: unknown): void {
|
|||||||
console.log(data)
|
console.log(data)
|
||||||
}
|
}
|
||||||
export function defaultError(error: { code: string; error?: string }): void {
|
export function defaultError(error: { code: string; error?: string }): void {
|
||||||
window.console.log(error)
|
if (error) {
|
||||||
notification.error({
|
router.push({ path: '/message', query: { status: error.code, message: error.error } })
|
||||||
message: '操作异常: ',
|
}
|
||||||
placement: 'top',
|
|
||||||
description: error.error + '(' + error.code + ')',
|
|
||||||
duration: 6,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
const config = {
|
const config = {
|
||||||
baseURL: http.prefix,
|
baseURL: http.prefix,
|
||||||
|
@ -1,16 +1,9 @@
|
|||||||
import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
|
import { createRouter, createWebHashHistory } from 'vue-router'
|
||||||
import UserLayout from '@/layout/user-layout.vue'
|
import UserLayout from '@/layout/user-layout.vue'
|
||||||
import AdminLayout from '@/layout/admin-layout.vue'
|
import AdminLayout from '@/layout/admin-layout.vue'
|
||||||
import BlankLayout from '@/layout/blank-layout.vue'
|
import BlankLayout from '@/layout/blank-layout.vue'
|
||||||
import router from '@/router'
|
|
||||||
|
|
||||||
export const routes: Array<RouteRecordRaw> = [
|
export const routes = [
|
||||||
{
|
|
||||||
path: '/admin/dashboard',
|
|
||||||
meta: { title: 'menus.dashboard', icon: 'icon-dashboard', flat: true },
|
|
||||||
name: 'Dashboard',
|
|
||||||
component: () => import('../views/admin/dashboard-page.vue'),
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
path: '/admin/acl', // 系统管理
|
path: '/admin/acl', // 系统管理
|
||||||
name: 'ACL',
|
name: 'ACL',
|
||||||
@ -41,18 +34,12 @@ export const routes: Array<RouteRecordRaw> = [
|
|||||||
name: 'Material',
|
name: 'Material',
|
||||||
meta: {title: 'menus.acl.material',icon: 'icon-permission'},
|
meta: {title: 'menus.acl.material',icon: 'icon-permission'},
|
||||||
component: ()=> import('../views/stock/material/material-page.vue'),
|
component: ()=> import('../views/stock/material/material-page.vue'),
|
||||||
},
|
}
|
||||||
{
|
|
||||||
path: '/admin/acl/type', //物料类型
|
|
||||||
name: 'Type',
|
|
||||||
meta: { title: '物料类型', icon: 'icon-permission' },
|
|
||||||
component: () => import('../views/stock/type/type-page.vue'),
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/stock/name', // 库存管理
|
path: '/stock/name', // 库存管理
|
||||||
name: 'Stock',
|
name: 'STOCK',
|
||||||
meta: { title: 'menus.stock.name', icon: 'icon-acl', flat: true },
|
meta: { title: 'menus.stock.name', icon: 'icon-acl', flat: true },
|
||||||
component: BlankLayout,
|
component: BlankLayout,
|
||||||
redirect: () => ({ name: 'Inbound' }),
|
redirect: () => ({ name: 'Inbound' }),
|
||||||
@ -73,43 +60,43 @@ export const routes: Array<RouteRecordRaw> = [
|
|||||||
path: '/stock/stocktaking', //盘点
|
path: '/stock/stocktaking', //盘点
|
||||||
name: 'Stocktaking',
|
name: 'Stocktaking',
|
||||||
meta: {title: 'menus.stock.stocktaking',icon: 'icon-permission'},
|
meta: {title: 'menus.stock.stocktaking',icon: 'icon-permission'},
|
||||||
component: () => import('../views/stock/stocktaking/stocktaking-page.vue'),
|
component: ()=> import('../views/stock/stocktaking/stocktaking-page.vue')
|
||||||
},
|
},
|
||||||
],
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/statistic/name', // 统计报表
|
path: '/statistic/name', // 统计报表
|
||||||
name: 'Statistic',
|
name: 'STATISTIC',
|
||||||
meta: { title: 'menus.statistic.name', icon: 'icon-acl', flat: true },
|
meta: { title: 'menus.statistic.name', icon: 'icon-acl', flat: true },
|
||||||
component: BlankLayout,
|
component: BlankLayout,
|
||||||
redirect: () => ({ name: 'Query-Stock' }),
|
redirect: () => ({ name: 'S-Inbound' }),
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '/statistic/stock', //库存
|
path: '/statistic/stock', //库存
|
||||||
name: 'Query-Stock',
|
name: 'S-stock',
|
||||||
meta: {title: 'menus.statistic.stock',icon: 'icon-permission'},
|
meta: {title: 'menus.statistic.stock',icon: 'icon-permission'},
|
||||||
component: ()=> import('../views/stock/report/materialReport-page.vue'),
|
component: ()=> import('../views/stock/report/materialReport-page.vue'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/statistic/inbound', //入库
|
path: '/statistic/inbound', //入库
|
||||||
name: 'Query-Inbound',
|
name: 'S-Inbound',
|
||||||
meta: {title: 'menus.statistic.inbound',icon: 'icon-permission'},
|
meta: {title: 'menus.statistic.inbound',icon: 'icon-permission'},
|
||||||
component: ()=> import('../views/stock/report/inboundReport-page.vue'),
|
component: ()=> import('../views/stock/report/inboundReport-page.vue'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/statistic/outbound', //出库
|
path: '/statistic/outbound', //出库
|
||||||
name: 'Query-Outbound',
|
name: 'S-Outbound',
|
||||||
meta: {title: 'menus.statistic.outbound',icon: 'icon-permission'},
|
meta: {title: 'menus.statistic.outbound',icon: 'icon-permission'},
|
||||||
component: ()=> import('../views/stock/report/outboundReport-page.vue'),
|
component: ()=> import('../views/stock/report/outboundReport-page.vue'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/statistic/stocktaking', //盘点
|
path: '/statistic/stocktaking', //盘点
|
||||||
name: 'Query-Stocktaking',
|
name: 'S-stocktaking',
|
||||||
meta: {title: 'menus.statistic.stocktaking',icon: 'icon-permission'},
|
meta: {title: 'menus.statistic.stocktaking',icon: 'icon-permission'},
|
||||||
component: ()=> import('../views/stock/report/stocktakingReport-page.vue'),
|
component: ()=> import('../views/stock/report/stocktakingReport-page.vue'),
|
||||||
},
|
},
|
||||||
],
|
]
|
||||||
},
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
export default createRouter({
|
export default createRouter({
|
||||||
@ -152,77 +139,3 @@ export default createRouter({
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
|
||||||
export const getP = (permissions: Array<string>): RouteRecordRaw => {
|
|
||||||
const newRoutes: RouteRecordRaw[] = filterRoutesByPermission(routes, permissions)
|
|
||||||
return {
|
|
||||||
path: '/admin',
|
|
||||||
name: 'Admin',
|
|
||||||
redirect: '/admin/dashboard',
|
|
||||||
component: AdminLayout,
|
|
||||||
meta: { title: 'menus.index', icon: 'icon-home' },
|
|
||||||
children: newRoutes,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 过滤路由,最多两层
|
|
||||||
const filterRoutesByPermission = (routes: RouteRecordRaw[], permissions: string[]): RouteRecordRaw[] => {
|
|
||||||
return routes
|
|
||||||
.map((route) => {
|
|
||||||
// 确保 route.name 是字符串
|
|
||||||
const parentName = typeof route.name === 'string' ? route.name : undefined
|
|
||||||
if ('Dashboard' === parentName) return route // 首页不做权限过滤
|
|
||||||
|
|
||||||
const hasParentPermission = parentName && permissions.includes(parentName)
|
|
||||||
|
|
||||||
// 如果有子路由,过滤子路由
|
|
||||||
if (Array.isArray(route.children) && route.children.length > 0) {
|
|
||||||
route.children = route.children.filter((child) => {
|
|
||||||
// 确保 child.name 是字符串
|
|
||||||
const childName = typeof child.name === 'string' ? child.name : undefined
|
|
||||||
|
|
||||||
// 拼接父级和子级的权限字符串
|
|
||||||
const fullName = parentName && childName ? `${parentName}.${childName}` : childName
|
|
||||||
|
|
||||||
// 确保 fullName 是字符串并且存在于 permissions 中
|
|
||||||
return typeof fullName === 'string' && permissions.includes(fullName)
|
|
||||||
})
|
|
||||||
|
|
||||||
// 如果子路由中有任何一个有权限,或者父级路由本身有权限,则保留该父级路由
|
|
||||||
if (route.children.length > 0 || hasParentPermission) {
|
|
||||||
return route
|
|
||||||
}
|
|
||||||
} else if (hasParentPermission) {
|
|
||||||
// 如果没有子路由,直接检查父级路由的权限
|
|
||||||
return route
|
|
||||||
}
|
|
||||||
|
|
||||||
// 如果不符合任何条件,返回 undefined,表示该路由将被过滤掉
|
|
||||||
return undefined
|
|
||||||
})
|
|
||||||
.filter((route): route is RouteRecordRaw => route !== undefined) // 过滤掉 undefined 的项并确保类型正确
|
|
||||||
}
|
|
||||||
|
|
||||||
// 白名单
|
|
||||||
const whiteList = ['Index', 'Admin', 'Message', 'LoginPage', 'Login']
|
|
||||||
|
|
||||||
// 路由守卫
|
|
||||||
router.beforeEach(async (to, _, next) => {
|
|
||||||
// 使用 _ 来忽略 from 参数
|
|
||||||
if (to.name && whiteList.includes(to.name as string)) {
|
|
||||||
next()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// 其他页面需要登录 用pinia会报错
|
|
||||||
const user = localStorage.getItem('user')
|
|
||||||
if (user) {
|
|
||||||
// 将json字符串转换为对象auth.AuthUser
|
|
||||||
const obj: auth.AuthUser = JSON.parse(user)
|
|
||||||
if (obj.token && obj.token.length > 0) {
|
|
||||||
next()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
window.console.log('没有登录')
|
|
||||||
next({ name: 'LoginPage' })
|
|
||||||
})
|
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
export interface Http {
|
export interface Http {
|
||||||
prefix: string // 前缀
|
prefix: string // 前缀
|
||||||
timeout: number
|
timeout: number
|
||||||
downloadUrl: string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const http: Http = {
|
export const http: Http = {
|
||||||
prefix: import.meta.env.VITE_HTTP_PREFIX,
|
prefix: import.meta.env.VITE_HTTP_PREFIX,
|
||||||
timeout: 10 * 1000,
|
timeout: 10 * 1000,
|
||||||
downloadUrl: import.meta.env.VITE_UPLOAD_PREFIX,
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
import router, { getP } from '@/router'
|
import router from '@/router'
|
||||||
|
|
||||||
export const useUserStore = defineStore('user', {
|
export const useUserStore = defineStore('user', {
|
||||||
state: (): auth.AuthUser => ({
|
state: (): auth.AuthUser => ({
|
||||||
@ -18,12 +18,6 @@ export const useUserStore = defineStore('user', {
|
|||||||
isAdmin(state) {
|
isAdmin(state) {
|
||||||
return state.roles.includes('admin')
|
return state.roles.includes('admin')
|
||||||
},
|
},
|
||||||
isLogin(state) {
|
|
||||||
return state.token && state.refreshToken
|
|
||||||
},
|
|
||||||
getPermission(state) {
|
|
||||||
return state.permissions
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
refreshUserInfo(user: auth.AuthUser) {
|
refreshUserInfo(user: auth.AuthUser) {
|
||||||
@ -31,13 +25,7 @@ export const useUserStore = defineStore('user', {
|
|||||||
},
|
},
|
||||||
userLogin(user: auth.AuthUser) {
|
userLogin(user: auth.AuthUser) {
|
||||||
Object.assign(this, user)
|
Object.assign(this, user)
|
||||||
// 根据权限动态添加地址
|
router.push({ path: '/admin/acl/users' }) // 登录后跳转到用户列表页面
|
||||||
if (!this.isAdmin) {
|
|
||||||
const path = getP(this.permissions)
|
|
||||||
router.addRoute(path)
|
|
||||||
// router.replace(router.currentRoute.value.fullPath)
|
|
||||||
}
|
|
||||||
router.push({ path: '/admin/dashboard' })
|
|
||||||
},
|
},
|
||||||
logout() {
|
logout() {
|
||||||
this.mobile = ''
|
this.mobile = ''
|
||||||
@ -50,11 +38,6 @@ export const useUserStore = defineStore('user', {
|
|||||||
this.sex = 'FEMALE'
|
this.sex = 'FEMALE'
|
||||||
this.token = ''
|
this.token = ''
|
||||||
this.refreshToken = ''
|
this.refreshToken = ''
|
||||||
router.push({ path: '/login/user' })
|
|
||||||
},
|
|
||||||
hasPermission(permission?: string) {
|
|
||||||
if (this.isAdmin) return true
|
|
||||||
return permission !== undefined && this.permissions.includes(permission)
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
persist: {
|
persist: {
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
watch(
|
watch(
|
||||||
roles,
|
roles,
|
||||||
(newVal: acl.RoleInfo[]) => {
|
(newVal: acl.RoleInfo[]) => {
|
||||||
targetKeys.value = newVal.filter((item) => item.selected).map((item) => item.key as string)
|
targetKeys.value = newVal.filter((item) => item.selected).map((item) => item.key)
|
||||||
},
|
},
|
||||||
{ immediate: true, deep: true },
|
{ immediate: true, deep: true },
|
||||||
)
|
)
|
||||||
|
@ -100,6 +100,10 @@
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
const columns = [
|
const columns = [
|
||||||
|
{
|
||||||
|
title: t('pages.acl.role.table.columns.key'),
|
||||||
|
dataIndex: 'key',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: t('pages.acl.role.table.columns.name'),
|
title: t('pages.acl.role.table.columns.name'),
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
@ -111,6 +115,7 @@
|
|||||||
{
|
{
|
||||||
title: t('pages.acl.role.table.columns.operation'),
|
title: t('pages.acl.role.table.columns.operation'),
|
||||||
dataIndex: 'operation',
|
dataIndex: 'operation',
|
||||||
|
width: 300,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
const pagination = computed(() => {
|
const pagination = computed(() => {
|
||||||
@ -173,7 +178,7 @@
|
|||||||
|
|
||||||
const tryLoadPermissions = (expanded: boolean, record: acl.Role & { permissions?: acl.Permission[] }) => {
|
const tryLoadPermissions = (expanded: boolean, record: acl.Role & { permissions?: acl.Permission[] }) => {
|
||||||
if (expanded && !record.permissions) {
|
if (expanded && !record.permissions) {
|
||||||
api.aclApi.role.permissions(record.key as unknown as string, (data) => {
|
api.aclApi.role.permissions(record.key, (data) => {
|
||||||
record.permissions = data
|
record.permissions = data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,26 @@ export const config: FormConfig = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const formItems: FormItem[] = [
|
export const formItems: FormItem[] = [
|
||||||
|
{
|
||||||
|
group: 'form',
|
||||||
|
type: 'input',
|
||||||
|
config: {
|
||||||
|
autoLink: true,
|
||||||
|
hasFeedback: false,
|
||||||
|
label: t('pages.acl.role.form.add.filed.key'),
|
||||||
|
name: 'key',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
properties: {
|
||||||
|
size: 'default',
|
||||||
|
type: 'text',
|
||||||
|
allowClear: true,
|
||||||
|
bordered: true,
|
||||||
|
showCount: true,
|
||||||
|
placeholder: t('pages.acl.role.form.add.placeholder.key'),
|
||||||
|
},
|
||||||
|
rules: [],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
group: 'form',
|
group: 'form',
|
||||||
type: 'input',
|
type: 'input',
|
||||||
|
@ -177,10 +177,12 @@
|
|||||||
{
|
{
|
||||||
title: t('pages.acl.user.table.columns.sex'),
|
title: t('pages.acl.user.table.columns.sex'),
|
||||||
dataIndex: 'sex',
|
dataIndex: 'sex',
|
||||||
|
width: 75,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('pages.acl.user.table.columns.operation'),
|
title: t('pages.acl.user.table.columns.operation'),
|
||||||
dataIndex: 'operation',
|
dataIndex: 'operation',
|
||||||
|
width: 400,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -5,8 +5,6 @@ const { t } = i18n.global
|
|||||||
import { useAppStore } from '@/stores/app'
|
import { useAppStore } from '@/stores/app'
|
||||||
|
|
||||||
import { FormItem, FormConfig } from '@/components/form-render/form-render-types'
|
import { FormItem, FormConfig } from '@/components/form-render/form-render-types'
|
||||||
import { Rule } from 'ant-design-vue/es/form'
|
|
||||||
import api from '@/api'
|
|
||||||
|
|
||||||
export const config: FormConfig = {
|
export const config: FormConfig = {
|
||||||
layout: 'horizontal',
|
layout: 'horizontal',
|
||||||
@ -42,12 +40,7 @@ export const formItems = (sexes: Codebook[]): FormItem[] => {
|
|||||||
placeholder: t('pages.acl.user.form.add.placeholder.name'),
|
placeholder: t('pages.acl.user.form.add.placeholder.name'),
|
||||||
maxlength: 20,
|
maxlength: 20,
|
||||||
},
|
},
|
||||||
rules: [
|
rules: [],
|
||||||
{
|
|
||||||
validator: validate,
|
|
||||||
trigger: ['blur', 'change'],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'radio',
|
type: 'radio',
|
||||||
@ -87,16 +80,7 @@ export const formItems = (sexes: Codebook[]): FormItem[] => {
|
|||||||
showCount: true,
|
showCount: true,
|
||||||
placeholder: t('pages.acl.user.form.add.placeholder.password'),
|
placeholder: t('pages.acl.user.form.add.placeholder.password'),
|
||||||
},
|
},
|
||||||
rules: [
|
rules: [],
|
||||||
{
|
|
||||||
type: 'string',
|
|
||||||
required: true,
|
|
||||||
whitespace: true,
|
|
||||||
trigger: ['blur', 'change'],
|
|
||||||
pattern: new RegExp('^(?=.*[A-Za-z])(?=.*\\d)[A-Za-z\\d]{8,}$'),
|
|
||||||
message: '8位数字字母组合',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
group: 'form',
|
group: 'form',
|
||||||
@ -159,19 +143,3 @@ export const formItems = (sexes: Codebook[]): FormItem[] => {
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
const validate = async (_rule: Rule, value: string): Promise<void> => {
|
|
||||||
const regex = /^[a-zA-Z0-9]{4,8}$/
|
|
||||||
if (!regex.test(value)) {
|
|
||||||
return Promise.reject('用户名只能是4-8位字母或数字')
|
|
||||||
}
|
|
||||||
return new Promise<void>((resolve, reject) => {
|
|
||||||
api.aclApi.user.existName({ name: value }, (data) => {
|
|
||||||
if (data) {
|
|
||||||
reject('用户名已经存在')
|
|
||||||
} else {
|
|
||||||
resolve()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
<template>
|
|
||||||
<p>这是首页,欢迎使用库管系统!!</p>
|
|
||||||
</template>
|
|
||||||
<script setup lang="ts"></script>
|
|
27
src/views/stock/component/Stocktaking.vue
Normal file
27
src/views/stock/component/Stocktaking.vue
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<template>
|
||||||
|
<a-row bordered>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-button type="primary" width="90%">开始扫码</a-button>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-input bordered size="large" ref="snInput" placeholder="输入条形码" style="width: 90%" />
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
|
||||||
|
|
||||||
|
<vxe-table border stripe show-overflow ref="applyDetailTableRef" max-height="500" :column-config="{ resizable: true }"
|
||||||
|
:keyboard-config="{ isEsc: true }" size="medium">
|
||||||
|
<vxe-column type="seq" title="序号" width="60"></vxe-column>
|
||||||
|
<vxe-column field="id" title="物料id" :visible="false"></vxe-column>
|
||||||
|
<vxe-column field="name" title="物料名称" />
|
||||||
|
<vxe-column field="code" title="编码" />
|
||||||
|
<vxe-column field="spec" title="规格" />
|
||||||
|
<vxe-column field="type" title="类型" />
|
||||||
|
<vxe-column field="times" title="库存数量" />
|
||||||
|
<vxe-column field="oprator" title="盘点数量" />
|
||||||
|
</vxe-table>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
</script>
|
@ -1,269 +0,0 @@
|
|||||||
<template>
|
|
||||||
<!-- 基本信息的表单 -->
|
|
||||||
<div>
|
|
||||||
<a-form :model="formData" name="basic" layout="horizontal" label-wrap>
|
|
||||||
<a-form-item label="申请人" name="applicant">
|
|
||||||
<a-input v-model:value="formData.applicant" style="width: 40%" />
|
|
||||||
</a-form-item>
|
|
||||||
|
|
||||||
<a-form-item label="申请类型" name="applyType">
|
|
||||||
<a-radio-group v-model:value="formData.applyType" button-style="solid" style="width: 40%">
|
|
||||||
<a-radio-button v-if="applyType === 'PURCHASE_RECEIPT'" value="PURCHASE_RECEIPT">采购入库</a-radio-button>
|
|
||||||
<a-radio-button v-if="applyType === 'PURCHASE_RECEIPT'" value="RETURN_RECEIPT">归还入库</a-radio-button>
|
|
||||||
<a-radio-button v-if="applyType === 'LOAN_OUT'" value="LOAN_OUT">出库外借</a-radio-button>
|
|
||||||
<a-radio-button v-if="applyType === 'LOAN_OUT'" value="SCRAP_OUT">报废出库</a-radio-button>
|
|
||||||
</a-radio-group>
|
|
||||||
</a-form-item>
|
|
||||||
<a-form-item v-if="formData.applyType === 'SCRAP_OUT'" label="审核人" name="reviewer">
|
|
||||||
<a-select v-model:value="formData.reviewer" style="width: 40%" :options="personList"></a-select>
|
|
||||||
</a-form-item>
|
|
||||||
<a-form-item label="申请日期" name="applyDate" style="width: 40%">
|
|
||||||
<a-date-picker v-model:value="formData.applyDate" />
|
|
||||||
</a-form-item>
|
|
||||||
<a-form-item label="选择物料" name="selected">
|
|
||||||
<div style="display: flex; justify-content: space-between">
|
|
||||||
<a-tree-select
|
|
||||||
v-model:value="typeVal"
|
|
||||||
show-search
|
|
||||||
style="width: 49%"
|
|
||||||
:dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
|
|
||||||
placeholder="请选择物料类型"
|
|
||||||
allow-clear
|
|
||||||
:tree-data="types"
|
|
||||||
tree-node-filter-prop="label"
|
|
||||||
/>
|
|
||||||
<a-select
|
|
||||||
v-model:value="formData.slectedList"
|
|
||||||
mode="multiple"
|
|
||||||
bordered
|
|
||||||
placeholder="请选择物料"
|
|
||||||
style="width: 49%"
|
|
||||||
show-search
|
|
||||||
:options="options"
|
|
||||||
:filter-option="filterOption"
|
|
||||||
@deselect="removeEvent($event)"
|
|
||||||
@select="insertEvent($event)"
|
|
||||||
></a-select>
|
|
||||||
</div>
|
|
||||||
</a-form-item>
|
|
||||||
</a-form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- vxe-table -->
|
|
||||||
<div>
|
|
||||||
<vxe-table
|
|
||||||
ref="tableRef"
|
|
||||||
v-model:data="tableData"
|
|
||||||
border
|
|
||||||
show-overflow
|
|
||||||
max-height="500"
|
|
||||||
size="medium"
|
|
||||||
empty-text="请先选择物料"
|
|
||||||
:edit-config="{ trigger: 'click', mode: 'cell', autoFocus: true }"
|
|
||||||
>
|
|
||||||
<vxe-column type="seq" title="序号" width="60" />
|
|
||||||
<vxe-column field="id" title="物料id" :visible="false" />
|
|
||||||
<vxe-column field="name" title="物料名称" />
|
|
||||||
<vxe-column field="code" title="编码" />
|
|
||||||
<vxe-column field="spec" title="规格" />
|
|
||||||
<vxe-column field="price" title="价格" />
|
|
||||||
<vxe-column field="typeName" title="类型" />
|
|
||||||
<vxe-column field="assignRule" title="是否赋码">
|
|
||||||
<template #default="{ row }">
|
|
||||||
{{ row.assignRule ? '是' : '否' }}
|
|
||||||
</template>
|
|
||||||
</vxe-column>
|
|
||||||
<vxe-column
|
|
||||||
field="quantity"
|
|
||||||
title="申请数量(点击修改)"
|
|
||||||
:edit-render="{ name: 'input', autoSelect: true }"
|
|
||||||
keyboard-config="{edit: true, del: true}"
|
|
||||||
cell-type="number"
|
|
||||||
>
|
|
||||||
<template #edit="{ row }">
|
|
||||||
<vxe-number-input v-model="row.quantity" type="integer"></vxe-number-input>
|
|
||||||
</template>
|
|
||||||
</vxe-column>
|
|
||||||
|
|
||||||
<vxe-column field="oprator" title="操作">
|
|
||||||
<template #default="{ row }">
|
|
||||||
<vxe-button mode="text" status="error" @click="removeRow(row)">删除</vxe-button>
|
|
||||||
</template>
|
|
||||||
</vxe-column>
|
|
||||||
</vxe-table>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup lang="ts">
|
|
||||||
import { VxeTableInstance } from 'vxe-table'
|
|
||||||
import api from '@/api'
|
|
||||||
import dayjs, { Dayjs } from 'dayjs'
|
|
||||||
import { LabeledValue, DefaultOptionType } from 'ant-design-vue/es/select'
|
|
||||||
import { SelectHandler } from 'ant-design-vue/es/vc-select/Select'
|
|
||||||
import { TreeDataNode } from 'ant-design-vue/es/vc-tree-select/interface'
|
|
||||||
|
|
||||||
// 和外层界面的数据交互
|
|
||||||
const props = defineProps(
|
|
||||||
{
|
|
||||||
applyType: {
|
|
||||||
type: String,
|
|
||||||
default: '',
|
|
||||||
},
|
|
||||||
}, // 申请类型 applyType页面传值的使用1和2,1: 采购入库 和 归还入库 2: 出库外借
|
|
||||||
)
|
|
||||||
const getTableData = () => {
|
|
||||||
const $table = tableRef.value
|
|
||||||
return $table?.getTableData().fullData
|
|
||||||
}
|
|
||||||
const getApplyForm = () => {
|
|
||||||
return {
|
|
||||||
type: formData.value.applyType,
|
|
||||||
applicant: formData.value.applicant,
|
|
||||||
applyDate: formData.value.applyDate.format('YYYY-MM-DD HH:mm:ss'),
|
|
||||||
isConfirm: true,
|
|
||||||
result: '',
|
|
||||||
reviewer: formData.value.reviewer,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
defineExpose({ getTableData, getApplyForm })
|
|
||||||
|
|
||||||
interface FormData {
|
|
||||||
applicant: string // 申请人
|
|
||||||
applyDate: Dayjs // 申请日期
|
|
||||||
applyType: string // 申请类型
|
|
||||||
slectedList: number[] // 入库物料
|
|
||||||
reviewer: string // 审核人
|
|
||||||
}
|
|
||||||
const formData = ref<FormData>({
|
|
||||||
applicant: '',
|
|
||||||
applyDate: dayjs(),
|
|
||||||
applyType: props.applyType,
|
|
||||||
slectedList: [],
|
|
||||||
reviewer: '',
|
|
||||||
})
|
|
||||||
|
|
||||||
// 审核人
|
|
||||||
const personList = ref<Array<{ value: string | undefined; label: string | undefined }>>([])
|
|
||||||
api.aclApi.user.all((data) => {
|
|
||||||
personList.value = data.map((item) => {
|
|
||||||
return {
|
|
||||||
value: item?.name,
|
|
||||||
label: item?.fullName,
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
// 物料类型树
|
|
||||||
const types = ref<Array<TreeDataNode>>([])
|
|
||||||
api.materialApi.type.trees((data) => {
|
|
||||||
types.value = children(data)
|
|
||||||
})
|
|
||||||
const children = (res: Array<material.TypeTree>): Array<TreeDataNode> => {
|
|
||||||
return res.map((areaTree) => ({
|
|
||||||
label: areaTree.label,
|
|
||||||
value: areaTree.value,
|
|
||||||
children: areaTree.children ? children(areaTree.children) : [],
|
|
||||||
key: areaTree.value,
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
|
|
||||||
// vxe-table相关的设置
|
|
||||||
export interface RowVO {
|
|
||||||
id: number
|
|
||||||
name: string
|
|
||||||
code: string
|
|
||||||
spec: string
|
|
||||||
type: string
|
|
||||||
typeName: string
|
|
||||||
quantity: number
|
|
||||||
disabled: boolean
|
|
||||||
checked: boolean
|
|
||||||
price: number
|
|
||||||
assignRule: boolean
|
|
||||||
}
|
|
||||||
const tableRef = ref<VxeTableInstance<RowVO>>()
|
|
||||||
// vxe-table 数据结果
|
|
||||||
const tableData = ref<Array<RowVO>>([])
|
|
||||||
|
|
||||||
// 物料选择器
|
|
||||||
const typeVal = ref<string>()
|
|
||||||
const options = ref<{ label: string; value: number }[]>([])
|
|
||||||
const materialList = ref<material.Material[]>([])
|
|
||||||
const getMaterialList = async () => {
|
|
||||||
await api.materialApi.material.all({ type: typeVal.value }, (data) => {
|
|
||||||
materialList.value = data
|
|
||||||
})
|
|
||||||
options.value = materialList.value.map((item) => {
|
|
||||||
return { label: item.name ? item.name + '(' + item.spec + ')' : '未知', value: item.id ? item.id : -1 }
|
|
||||||
})
|
|
||||||
}
|
|
||||||
watch(
|
|
||||||
typeVal,
|
|
||||||
(newVal) => {
|
|
||||||
if (newVal !== '') {
|
|
||||||
getMaterialList()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{ immediate: true, deep: true },
|
|
||||||
)
|
|
||||||
|
|
||||||
// 选中时在末尾新增一行
|
|
||||||
// value: number, option: { label: string, value: number }
|
|
||||||
type Insert = SelectHandler<LabeledValue, DefaultOptionType> | undefined
|
|
||||||
const insertEvent = (value: Insert) => {
|
|
||||||
// 根据value找到对应的物料信息
|
|
||||||
const m = materialList.value.find((item) => item.id === value)
|
|
||||||
if (m) {
|
|
||||||
const row: RowVO = {
|
|
||||||
id: m.id ? m.id : -1,
|
|
||||||
name: m.name ? m.name : '',
|
|
||||||
code: m.code ? m.code : '',
|
|
||||||
spec: m.spec ? m.spec : '',
|
|
||||||
typeName: m.typeName ? m.typeName : '',
|
|
||||||
type: m.type ? m.type : '',
|
|
||||||
price: m.price ? m.price : 0,
|
|
||||||
quantity: 1,
|
|
||||||
assignRule: m.assignRule ? m.assignRule : false,
|
|
||||||
disabled: false,
|
|
||||||
checked: false,
|
|
||||||
}
|
|
||||||
const $table = tableRef.value
|
|
||||||
if ($table) {
|
|
||||||
$table.insertAt(row, -1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 过滤选项
|
|
||||||
const filterOption = (input: string, option: { label: string; value: number }) => {
|
|
||||||
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
||||||
}
|
|
||||||
|
|
||||||
// 取消选中时,删除table中的行
|
|
||||||
const removeEvent = (value: Insert) => {
|
|
||||||
const $table = tableRef.value
|
|
||||||
// 根据value找到对应的行
|
|
||||||
if ($table) {
|
|
||||||
$table.getTableData().fullData.forEach((item) => {
|
|
||||||
if (item.id === value) {
|
|
||||||
$table.remove(item)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 手动删除table中的行
|
|
||||||
const removeRow = async (row: RowVO) => {
|
|
||||||
//打印tableData数组
|
|
||||||
const $table = tableRef.value
|
|
||||||
if ($table) {
|
|
||||||
// 根据row.id找到对应选中列表中的数据
|
|
||||||
formData.value.slectedList.forEach((item, index) => {
|
|
||||||
if (item.toString() === row.id.toString()) {
|
|
||||||
formData.value.slectedList.splice(index, 1)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
$table.remove(row)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
153
src/views/stock/component/apply-page.vue
Normal file
153
src/views/stock/component/apply-page.vue
Normal file
@ -0,0 +1,153 @@
|
|||||||
|
<template>
|
||||||
|
<page-container>
|
||||||
|
<!-- 页面操作栏 -->
|
||||||
|
<template #ops>
|
||||||
|
<a-row>
|
||||||
|
<a-col :span="18">
|
||||||
|
<a-input-search v-model:value="searchKey" :placeholder="`请输入`" allow-clear enter-button
|
||||||
|
@search="loadData()"></a-input-search>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="6">
|
||||||
|
<a-button type="primary" style="margin-left: 10px" @click="showModal">
|
||||||
|
<template #icon>
|
||||||
|
<icon-font type="icon-plus" />
|
||||||
|
</template>
|
||||||
|
{{ pageType === '1' ? '申请入库' : '申请出库' }}
|
||||||
|
</a-button>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</template>
|
||||||
|
<!-- 页面表格内容 -->
|
||||||
|
<div style="min-height: calc(100vh - 305px)">
|
||||||
|
<!-- 表格行 -->
|
||||||
|
<a-table :columns="columns" :data-source="pagedata?.records" bordered :pagination="pagination" :loading="loading"
|
||||||
|
row-key="key">
|
||||||
|
|
||||||
|
</a-table>
|
||||||
|
</div>
|
||||||
|
</page-container>
|
||||||
|
|
||||||
|
<!-- 弹窗 -->
|
||||||
|
<a-modal v-model:open="open" title="Basic Modal" width="100%" wrap-class-name="full-modal" @ok="handleOk">
|
||||||
|
<apply></apply>
|
||||||
|
</a-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
|
||||||
|
import api from '@/api'
|
||||||
|
import { IPage } from '@/api/api'
|
||||||
|
import apply from './applyModal.vue';
|
||||||
|
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
pageType: {
|
||||||
|
type: String as PropType<'1' | '2'>, // 1 入库 2 出库
|
||||||
|
required: false,
|
||||||
|
default: '1'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const { pageType } = toRefs(props)
|
||||||
|
|
||||||
|
const searchKey = ref('')
|
||||||
|
const pagedata = ref<IPage<material.ApplyDTO>>()
|
||||||
|
const loading = ref(false)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 加载数据的方法
|
||||||
|
const loadData = async (page = 1, size = 10) => {
|
||||||
|
loading.value = true
|
||||||
|
api.materialApi.apply.searchPage(
|
||||||
|
//1: 采购入库 2: 归还入库 3: 出库外借
|
||||||
|
{
|
||||||
|
applyType: 1,
|
||||||
|
page: page || pagedata.value?.current,
|
||||||
|
size: size || pagedata.value?.size,
|
||||||
|
type: searchKey.value,
|
||||||
|
code: searchKey.value,
|
||||||
|
name: searchKey.value
|
||||||
|
},
|
||||||
|
(data) => {
|
||||||
|
loading.value = false
|
||||||
|
pagedata.value = data
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
|
//初始加载
|
||||||
|
loadData()
|
||||||
|
|
||||||
|
//表格列
|
||||||
|
const columns = [
|
||||||
|
{
|
||||||
|
title: '类型',
|
||||||
|
dataIndex: 'type',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '申请人',
|
||||||
|
dataIndex: 'applicant',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '申请日期',
|
||||||
|
dataIndex: 'applyDate',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '是否确认',
|
||||||
|
dataIndex: 'isConfirm',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '创建人',
|
||||||
|
dataIndex: 'createdBy',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '创建时间',
|
||||||
|
dataIndex: 'createdTime',
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
//分页信息
|
||||||
|
const pagination = computed(() => {
|
||||||
|
return {
|
||||||
|
current: pagedata.value?.current,
|
||||||
|
pageSize: pagedata.value?.size,
|
||||||
|
total: pagedata.value?.total,
|
||||||
|
onChange: (page: number, pageSize: number) => {
|
||||||
|
loadData(page, pageSize)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const open = ref<boolean>(false);
|
||||||
|
|
||||||
|
const showModal = () => {
|
||||||
|
open.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleOk = (e: MouseEvent) => {
|
||||||
|
console.log(e);
|
||||||
|
open.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less">
|
||||||
|
.full-modal {
|
||||||
|
.ant-modal {
|
||||||
|
max-width: 100%;
|
||||||
|
top: 0;
|
||||||
|
padding-bottom: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-modal-content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: calc(100vh);
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-modal-body {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -14,13 +14,13 @@
|
|||||||
<vxe-column field="name" title="物料名称" />
|
<vxe-column field="name" title="物料名称" />
|
||||||
<vxe-column field="assignRule" title="是否扫码">
|
<vxe-column field="assignRule" title="是否扫码">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
{{ row.assignRule ? '是' : '否' }}
|
{{ row.assignRule === 'HIGH_VALUE' ? '是' : '否' }}
|
||||||
</template>
|
</template>
|
||||||
</vxe-column>
|
</vxe-column>
|
||||||
<vxe-column field="applyNum" title="申请数量" :edit-render="{ name: 'VxeInput', props: { type: 'integer' } }" />
|
<vxe-column field="applyNum" title="申请数量" :edit-render="{ name: 'VxeInput', props: { type: 'integer' } }" />
|
||||||
<vxe-column field="scanNum" title="扫码数量">
|
<vxe-column field="scanNum" title="扫码数量" :edit-render="{ name: 'VxeInput', props: { type: 'integer' } }" >
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
{{ row.assignRule ? row.scanNum : '~' }}
|
{{ row.assignRule === 'LOW_VALUE' ? '~' : row.scanNum }}
|
||||||
</template>
|
</template>
|
||||||
</vxe-column>
|
</vxe-column>
|
||||||
<vxe-column field="remark" title="备注" :edit-render="{ name: 'VxeInput' }" />
|
<vxe-column field="remark" title="备注" :edit-render="{ name: 'VxeInput' }" />
|
189
src/views/stock/component/applyForm.vue
Normal file
189
src/views/stock/component/applyForm.vue
Normal file
@ -0,0 +1,189 @@
|
|||||||
|
<template>
|
||||||
|
<!-- 基本信息的表单 -->
|
||||||
|
<div>
|
||||||
|
<a-form :model="formData" name="basic" layout="horizontal" labelWrap>
|
||||||
|
<a-form-item label="申请人" name="applicant">
|
||||||
|
<a-input :value="formData.applicant" style="width: 40%;" />
|
||||||
|
</a-form-item>
|
||||||
|
|
||||||
|
<a-form-item label="申请类型" name="applyType">
|
||||||
|
<a-radio-group v-model:value="formData.applyType" button-style="solid" style="width: 40%;">
|
||||||
|
<a-radio-button value='PURCHASE_RECEIPT' v-if="applyType === 'PURCHASE_RECEIPT'">采购入库</a-radio-button>
|
||||||
|
<a-radio-button value='RETURN_RECEIPT' v-if="applyType === 'PURCHASE_RECEIPT'">归还入库</a-radio-button>
|
||||||
|
<a-radio-button value='LOAN_OUT' v-if="applyType === 'LOAN_OUT'">出库外借</a-radio-button>
|
||||||
|
</a-radio-group>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="申请日期" name="applyDate" style="width: 40%;">
|
||||||
|
<a-date-picker v-model:value="formData.applyDate" />
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="选择物料" name="selected">
|
||||||
|
<a-select v-model:value="formData.slectedList" mode="multiple" bordered placeholder="请选择物料" style="width: 40%;"
|
||||||
|
show-search :options="options" @deselect="removeEvent" @select="insertEvent"></a-select>
|
||||||
|
</a-form-item>
|
||||||
|
</a-form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- vxe-table -->
|
||||||
|
<div>
|
||||||
|
<vxe-table border show-overflow ref="tableRef" max-height="500" size="medium" v-model:data="tableData"
|
||||||
|
empty-text="请先选择物料" :edit-config="{ trigger: 'click', mode: 'cell', autoFocus: true }">
|
||||||
|
<vxe-column type="seq" title="序号" width="60" />
|
||||||
|
<vxe-column field="id" title="物料id" :visible="false" />
|
||||||
|
<vxe-column field="name" title="物料名称" />
|
||||||
|
<vxe-column field="code" title="编码" />
|
||||||
|
<vxe-column field="spec" title="规格" />
|
||||||
|
<vxe-column field="type" title="类型" />
|
||||||
|
<vxe-column field="assignRule" title="是否赋码">
|
||||||
|
<template #default="{ row }">
|
||||||
|
{{ row.assignRule === 'HIGH_VALUE' ? '是' : '否' }}
|
||||||
|
</template>
|
||||||
|
</vxe-column>
|
||||||
|
<vxe-column field="quantity" title="申请数量(点击修改)" :edit-render="{ name: 'input', autoSelect: true }"
|
||||||
|
keyboard-config="{edit: true, del: true}" cell-type="number">
|
||||||
|
<template #edit="{ row }">
|
||||||
|
<vxe-number-input v-model="row.quantity" type="integer"></vxe-number-input>
|
||||||
|
</template>
|
||||||
|
</vxe-column>
|
||||||
|
|
||||||
|
<vxe-column field="oprator" title="操作">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<vxe-button mode="text" status="error" @click="removeRow(row)">删除</vxe-button>
|
||||||
|
</template>
|
||||||
|
</vxe-column>
|
||||||
|
|
||||||
|
</vxe-table>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { VxeTableInstance } from 'vxe-table'
|
||||||
|
import api from '@/api'
|
||||||
|
import { useUserStore } from '@/stores/user'
|
||||||
|
import dayjs, { Dayjs } from 'dayjs';
|
||||||
|
|
||||||
|
// 和外层界面的数据交互
|
||||||
|
const props = defineProps(
|
||||||
|
{
|
||||||
|
applyType: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
}
|
||||||
|
} // 申请类型 applyType页面传值的使用1和2,1: 采购入库 和 归还入库 2: 出库外借
|
||||||
|
)
|
||||||
|
const getTableData = ()=> {
|
||||||
|
const $table = tableRef.value
|
||||||
|
return $table?.getTableData().fullData;
|
||||||
|
}
|
||||||
|
const getApplyForm = () => {
|
||||||
|
return {
|
||||||
|
type: formData.value.applyType,
|
||||||
|
applicant: formData.value.applicant,
|
||||||
|
applyDate: formData.value.applyDate.format('YYYY-MM-DD HH:mm:ss'),
|
||||||
|
isConfirm: true,
|
||||||
|
result: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
defineExpose({ getTableData, getApplyForm })
|
||||||
|
|
||||||
|
interface FormData {
|
||||||
|
applicant: string; // 申请人
|
||||||
|
applyDate: Dayjs; // 申请日期
|
||||||
|
applyType: string; // 申请类型
|
||||||
|
slectedList: number[]; // 入库物料
|
||||||
|
}
|
||||||
|
|
||||||
|
const userStore = useUserStore()
|
||||||
|
const formData = ref<FormData>({
|
||||||
|
applicant: userStore.userName,
|
||||||
|
applyDate: dayjs(),
|
||||||
|
applyType: props.applyType,
|
||||||
|
slectedList: []
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// vxe-table相关的设置
|
||||||
|
export interface RowVO {
|
||||||
|
id: number
|
||||||
|
name: string
|
||||||
|
code: string
|
||||||
|
spec: string
|
||||||
|
type: string
|
||||||
|
quantity: number
|
||||||
|
disabled: boolean
|
||||||
|
checked: boolean
|
||||||
|
assignRule: string
|
||||||
|
}
|
||||||
|
const tableRef = ref<VxeTableInstance<RowVO>>()
|
||||||
|
// vxe-table 数据结果
|
||||||
|
const tableData = ref<Array<RowVO>>([])
|
||||||
|
// 物料选择器
|
||||||
|
const options = ref<{ label: string, value: number }[]>([])
|
||||||
|
const materialList = ref<material.Material[]>([])
|
||||||
|
const getMaterialList = async () => {
|
||||||
|
await api.materialApi.material.all((data) => {
|
||||||
|
materialList.value = data
|
||||||
|
})
|
||||||
|
options.value = materialList.value.map((item) => {
|
||||||
|
return { label: item.name ? item.name : '未知', value: item.id ? item.id : -1 }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
getMaterialList()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 选中时在末尾新增一行
|
||||||
|
// value: number, option: { label: string, value: number }
|
||||||
|
const insertEvent = (value: any) => {
|
||||||
|
// 根据value找到对应的物料信息
|
||||||
|
const m = materialList.value.find((item) => item.id === (value ? parseInt(value) : -1))
|
||||||
|
if (m) {
|
||||||
|
const row: RowVO = {
|
||||||
|
id: m.id ? m.id : -1,
|
||||||
|
name: m.name ? m.name : '未知',
|
||||||
|
code: m.code ? m.code : '未知',
|
||||||
|
spec: m.spec ? m.spec : '未知',
|
||||||
|
type: m.type ? m.type : '未知',
|
||||||
|
quantity: 1,
|
||||||
|
assignRule: m.assignRule ? m.assignRule : 'HIGH_VALUE',
|
||||||
|
disabled: false,
|
||||||
|
checked: false
|
||||||
|
}
|
||||||
|
const $table = tableRef.value
|
||||||
|
if ($table) {
|
||||||
|
$table.insertAt(row, -1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 取消选中时,删除table中的行
|
||||||
|
const removeEvent = (value: any) => {
|
||||||
|
const $table = tableRef.value
|
||||||
|
// 根据value找到对应的行
|
||||||
|
if ($table) {
|
||||||
|
$table.getTableData().fullData.forEach((item) => {
|
||||||
|
if (item.id === (value ? parseInt(value) : -1)) {
|
||||||
|
$table.remove(item)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 手动删除table中的行
|
||||||
|
const removeRow = async (row: RowVO) => {
|
||||||
|
//打印tableData数组
|
||||||
|
const $table = tableRef.value
|
||||||
|
if ($table) {
|
||||||
|
// 根据row.id找到对应选中列表中的数据
|
||||||
|
formData.value.slectedList.forEach((item, index) => {
|
||||||
|
if (item.toString() === row.id.toString()) {
|
||||||
|
formData.value.slectedList.splice(index, 1)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
$table.remove(row)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
@ -18,7 +18,7 @@
|
|||||||
<apply-confirm ref="applyConfirmRef" :table-data="conformData"></apply-confirm>
|
<apply-confirm ref="applyConfirmRef" :table-data="conformData"></apply-confirm>
|
||||||
</div>
|
</div>
|
||||||
<div v-show="current === 3" class="step-4">
|
<div v-show="current === 3" class="step-4">
|
||||||
<successResult :apply-type="applyType"></successResult>
|
<successResul></successResul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 按钮 -->
|
<!-- 按钮 -->
|
||||||
@ -30,10 +30,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import applyForm, { RowVO } from './apply-form.vue'
|
import applyForm,{RowVO} from '../component/applyForm.vue'
|
||||||
import scanForm from './scan-form.vue'
|
import scanForm from '../component/scanForm.vue'
|
||||||
import applyConfirm from './apply-confirm.vue'
|
import applyConfirm from '../component/applyConfirm.vue'
|
||||||
import successResult from './success-result.vue'
|
import successResul from '../component/successResul.vue'
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
// 和外层界面的数据交互
|
// 和外层界面的数据交互
|
||||||
defineProps(
|
defineProps(
|
||||||
@ -56,17 +56,17 @@
|
|||||||
const loading = ref(false) // 提交按钮的loading状态
|
const loading = ref(false) // 提交按钮的loading状态
|
||||||
|
|
||||||
const items = [{ title: '录入申请' }, { title: '扫码点货' }, { title: '人工确认' }]
|
const items = [{ title: '录入申请' }, { title: '扫码点货' }, { title: '人工确认' }]
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 点击下一步
|
* 点击下一步
|
||||||
*/
|
*/
|
||||||
type GroupedSums = Record<string, number>
|
|
||||||
const nextStep = () => {
|
const nextStep = () => {
|
||||||
if (applyFormRef.value && current.value === 0) {
|
if (applyFormRef.value && current.value === 0) {
|
||||||
totalValue.value = 0
|
totalValue.value = 0
|
||||||
// 再step1中点击下一步的时候,就去获取step1中的表单数据
|
// 再step1中点击下一步的时候,就去获取step1中的表单数据
|
||||||
selectData.value = applyFormRef.value.getTableData()
|
selectData.value = applyFormRef.value.getTableData()
|
||||||
selectData.value.forEach((item:RowVO) => {
|
selectData.value.forEach((item:RowVO) => {
|
||||||
if (item.assignRule) {
|
if (item.assignRule === 'HIGH_VALUE') {
|
||||||
totalValue.value += item.quantity
|
totalValue.value += item.quantity
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -74,7 +74,7 @@
|
|||||||
if (scanFormRef.value && current.value === 1) {
|
if (scanFormRef.value && current.value === 1) {
|
||||||
// 再step2中点击下一步的时候,就去获取step2中的表单数据
|
// 再step2中点击下一步的时候,就去获取step2中的表单数据
|
||||||
const items = scanFormRef.value.getTableData()
|
const items = scanFormRef.value.getTableData()
|
||||||
const groupedSums = items.reduce((acc: GroupedSums, item: RowVO) => {
|
const groupedSums = items.reduce((acc:any, item:RowVO) => {
|
||||||
if (!acc[item.code]) {
|
if (!acc[item.code]) {
|
||||||
acc[item.code] = 0
|
acc[item.code] = 0
|
||||||
}
|
}
|
||||||
@ -90,7 +90,7 @@
|
|||||||
applyNum: item.quantity,
|
applyNum: item.quantity,
|
||||||
assignRule: item.assignRule,
|
assignRule: item.assignRule,
|
||||||
scanNum: groupedSums[item.code] || 0,
|
scanNum: groupedSums[item.code] || 0,
|
||||||
remark: item.quantity != groupedSums[item.code] && item.assignRule ? `数量不一致` : '',
|
remark: (item.quantity != groupedSums[item.code] && item.assignRule === 'HIGH_VALUE') ? `数量不一致` : '',
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -111,15 +111,12 @@
|
|||||||
const applyForm = applyFormRef.value.getApplyForm() // 申请表单数据
|
const applyForm = applyFormRef.value.getApplyForm() // 申请表单数据
|
||||||
const detailList = scanFormRef.value.getTableData() // 扫码明细数据
|
const detailList = scanFormRef.value.getTableData() // 扫码明细数据
|
||||||
|
|
||||||
api.materialApi.apply.saveApply(
|
api.materialApi.apply.saveApply({ applyForm: applyForm, applyDetails: applyDetails, detailList: detailList }, () => {
|
||||||
{ applyForm: applyForm, applyDetails: applyDetails, detailList: detailList },
|
|
||||||
() => {
|
|
||||||
console.log('申请成功')
|
console.log('申请成功')
|
||||||
// 清理缓存数据
|
// 清理缓存数据
|
||||||
loading.value = false
|
loading.value = false
|
||||||
current.value = 3
|
current.value = 3
|
||||||
},
|
})
|
||||||
)
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -1,170 +0,0 @@
|
|||||||
<template>
|
|
||||||
<!-- vxe-table -->
|
|
||||||
<div>
|
|
||||||
<vxe-table
|
|
||||||
ref="tableRef"
|
|
||||||
v-model:data="tableData"
|
|
||||||
border
|
|
||||||
show-overflow
|
|
||||||
max-height="500"
|
|
||||||
size="medium"
|
|
||||||
empty-text="请先选择物料"
|
|
||||||
:edit-config="{ trigger: 'click', mode: 'cell', autoFocus: true }"
|
|
||||||
>
|
|
||||||
<vxe-column type="seq" title="序号" width="60" />
|
|
||||||
<vxe-column field="id" title="物料id" :visible="false" />
|
|
||||||
<vxe-column field="name" title="物料名称" />
|
|
||||||
<vxe-column field="code" title="编码" />
|
|
||||||
<vxe-column field="spec" title="规格" />
|
|
||||||
<vxe-column field="price" title="价格" />
|
|
||||||
<vxe-column field="typeName" title="类型" />
|
|
||||||
<vxe-column field="stock" title="库存数量" />
|
|
||||||
|
|
||||||
<vxe-column
|
|
||||||
field="manualStock"
|
|
||||||
title="手动核实数量"
|
|
||||||
:edit-render="{ name: 'input', autoSelect: true }"
|
|
||||||
keyboard-config="{edit: true, del: true}"
|
|
||||||
cell-type="number"
|
|
||||||
>
|
|
||||||
<template #edit="{ row }">
|
|
||||||
<vxe-number-input v-model="row.manualStock" type="integer"></vxe-number-input>
|
|
||||||
</template>
|
|
||||||
</vxe-column>
|
|
||||||
<vxe-column
|
|
||||||
field="msg"
|
|
||||||
title="异常原因"
|
|
||||||
:edit-render="{ name: 'input', autoSelect: true }"
|
|
||||||
keyboard-config="{edit: true, del: true}"
|
|
||||||
cell-type="string"
|
|
||||||
>
|
|
||||||
<template #edit="{ row }">
|
|
||||||
<vxe-input v-model="row.msg" placeholder="请输入异常原因" type="text"></vxe-input>
|
|
||||||
</template>
|
|
||||||
</vxe-column>
|
|
||||||
|
|
||||||
<vxe-column field="oprator" title="操作">
|
|
||||||
<template #default="{ row }">
|
|
||||||
<vxe-button mode="text" status="error" @click="removeRow(row)">删除</vxe-button>
|
|
||||||
</template>
|
|
||||||
</vxe-column>
|
|
||||||
</vxe-table>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" setup>
|
|
||||||
import api from '@/api'
|
|
||||||
import dayjs, { Dayjs } from 'dayjs'
|
|
||||||
import { VxeTableInstance } from 'vxe-table'
|
|
||||||
|
|
||||||
//组件交互
|
|
||||||
|
|
||||||
const props = defineProps({
|
|
||||||
applyId: {
|
|
||||||
type: Number,
|
|
||||||
required: false,
|
|
||||||
default: 0,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
const getTableData = (): Array<material.ManualStockDetail> => {
|
|
||||||
const $table = tableRef.value
|
|
||||||
if (!$table) {
|
|
||||||
return []
|
|
||||||
}
|
|
||||||
return $table?.getTableData().fullData.map((item) => {
|
|
||||||
// 只需要保存哪一个物料id,库存数量,手动核实数量
|
|
||||||
return {
|
|
||||||
materialId: item.id,
|
|
||||||
stock: item.stock,
|
|
||||||
manualStock: item.manualStock,
|
|
||||||
msg: item.msg,
|
|
||||||
applyId: props.applyId,
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
defineExpose({ getTableData })
|
|
||||||
|
|
||||||
// vxe-table相关的设置
|
|
||||||
export interface RowVO {
|
|
||||||
id: number
|
|
||||||
name: string
|
|
||||||
code: string
|
|
||||||
spec: string
|
|
||||||
type: string
|
|
||||||
typeName: string
|
|
||||||
stock: number
|
|
||||||
manualStock: number
|
|
||||||
disabled: boolean
|
|
||||||
checked: boolean
|
|
||||||
price: number
|
|
||||||
assignRule: boolean
|
|
||||||
msg: string
|
|
||||||
}
|
|
||||||
// vxe引用
|
|
||||||
const tableRef = ref<VxeTableInstance<RowVO>>()
|
|
||||||
|
|
||||||
// vxe-table 数据结果
|
|
||||||
const tableData = ref<Array<RowVO>>([])
|
|
||||||
// 获取接口数据
|
|
||||||
const fetchData = () => {
|
|
||||||
api.materialApi.apply.getManualCheckData(props.applyId, (data) => {
|
|
||||||
tableData.value = data.map((item) => {
|
|
||||||
return {
|
|
||||||
id: item.id ? item.id : 0,
|
|
||||||
name: item.name ? item.name : '',
|
|
||||||
code: item.code ? item.code : '',
|
|
||||||
spec: item.spec ? item.spec : '',
|
|
||||||
type: item.type ? item.type : '',
|
|
||||||
typeName: item.typeName ? item.typeName : '',
|
|
||||||
stock: item.stock ? item.stock : 0,
|
|
||||||
manualStock: 0,
|
|
||||||
disabled: false,
|
|
||||||
checked: false,
|
|
||||||
price: item.price ? item.price : 0,
|
|
||||||
assignRule: false,
|
|
||||||
msg: '',
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 监测applyId变化,重新获取数据
|
|
||||||
fetchData()
|
|
||||||
watch(
|
|
||||||
() => props.applyId,
|
|
||||||
(newVal, oldVal) => {
|
|
||||||
if (newVal !== oldVal) {
|
|
||||||
fetchData()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
)
|
|
||||||
|
|
||||||
interface FormData {
|
|
||||||
applicant: string // 申请人
|
|
||||||
applyDate: Dayjs // 申请日期
|
|
||||||
slectedList: number[] // 入库物料
|
|
||||||
reviewer: string // 审核人
|
|
||||||
}
|
|
||||||
const formData = ref<FormData>({
|
|
||||||
applicant: '',
|
|
||||||
applyDate: dayjs(),
|
|
||||||
slectedList: [],
|
|
||||||
reviewer: '',
|
|
||||||
})
|
|
||||||
|
|
||||||
// 手动删除table中的行
|
|
||||||
const removeRow = async (row: RowVO) => {
|
|
||||||
//打印tableData数组
|
|
||||||
const $table = tableRef.value
|
|
||||||
if ($table) {
|
|
||||||
// 根据row.id找到对应选中列表中的数据
|
|
||||||
formData.value.slectedList.forEach((item, index) => {
|
|
||||||
if (item.toString() === row.id.toString()) {
|
|
||||||
formData.value.slectedList.splice(index, 1)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
$table.remove(row)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
@ -1,220 +0,0 @@
|
|||||||
<template>
|
|
||||||
<a-button type="primary" @click="beiginScan">开始扫码</a-button>
|
|
||||||
<a-button type="primary" danger style="left: 20px" @click="clearScanData">全部重扫</a-button>
|
|
||||||
<a-input
|
|
||||||
ref="snInput"
|
|
||||||
v-model:value="value"
|
|
||||||
bordered
|
|
||||||
size="large"
|
|
||||||
placeholder="输入条形码"
|
|
||||||
style="margin-top: 20px; margin-bottom: 20px"
|
|
||||||
@press-enter="autoInsertOneRow"
|
|
||||||
/>
|
|
||||||
<slot></slot>
|
|
||||||
<a-row style="margin-bottom: 20px">
|
|
||||||
<a-col :span="12">
|
|
||||||
<a-statistic title="扫码合计" :value="totalValue" style="margin-right: 50px" />
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="12">
|
|
||||||
<a-statistic title="已扫码" :value="remainderValue" />
|
|
||||||
</a-col>
|
|
||||||
</a-row>
|
|
||||||
<!-- Esc键退出编辑功能 -->
|
|
||||||
<vxe-table
|
|
||||||
ref="applyDetailTableRef"
|
|
||||||
border
|
|
||||||
stripe
|
|
||||||
show-overflow
|
|
||||||
max-height="500"
|
|
||||||
:column-config="{ resizable: true }"
|
|
||||||
:keyboard-config="{ isEsc: true }"
|
|
||||||
size="medium"
|
|
||||||
empty-text="请先扫码物料体条码"
|
|
||||||
:edit-config="{ trigger: 'click', mode: 'cell' }"
|
|
||||||
>
|
|
||||||
<vxe-column type="seq" title="序号" width="60"></vxe-column>
|
|
||||||
<vxe-column field="id" title="物料id" :visible="false"></vxe-column>
|
|
||||||
<vxe-column field="barcode" title="物料条码" />
|
|
||||||
<vxe-column field="name" title="物料名称" />
|
|
||||||
<vxe-column field="code" title="编码" />
|
|
||||||
<vxe-column field="spec" title="规格" />
|
|
||||||
<vxe-column field="typeName" title="类型" />
|
|
||||||
<vxe-column field="times" title="扫码时间" />
|
|
||||||
<vxe-column field="oprator" title="操作">
|
|
||||||
<template #default="{ row }">
|
|
||||||
<vxe-button mode="text" status="error" @click="removeStep2Row(row)">删除</vxe-button>
|
|
||||||
</template>
|
|
||||||
</vxe-column>
|
|
||||||
</vxe-table>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" setup>
|
|
||||||
import { VxeTableInstance } from 'vxe-table'
|
|
||||||
import { useTemplateRef } from 'vue'
|
|
||||||
import { api } from '@/api'
|
|
||||||
import { message } from 'ant-design-vue'
|
|
||||||
|
|
||||||
// 父组件数据交互
|
|
||||||
const props = defineProps({
|
|
||||||
totalValue: {
|
|
||||||
type: Number,
|
|
||||||
default: 0,
|
|
||||||
},
|
|
||||||
applyId: {
|
|
||||||
type: Number,
|
|
||||||
required: false,
|
|
||||||
default: 0,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
//获取扫码的集合
|
|
||||||
const getTableData = () => {
|
|
||||||
const $table = applyDetailTableRef.value
|
|
||||||
if ($table) {
|
|
||||||
return $table.getTableData().fullData.map((item) => ({
|
|
||||||
assignRule: item.assignRule,
|
|
||||||
materialId: item.id,
|
|
||||||
barcode: item.barcode,
|
|
||||||
code: item.code,
|
|
||||||
date: item.times,
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取盘点审核的数据
|
|
||||||
const getApplyData = () => {
|
|
||||||
const $table = applyDetailTableRef.value
|
|
||||||
if ($table) {
|
|
||||||
return $table.getTableData().fullData.map((item) => ({
|
|
||||||
applyId: props.applyId,
|
|
||||||
materialId: item.id,
|
|
||||||
barcode: item.barcode,
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
defineExpose({ getTableData, getApplyData })
|
|
||||||
|
|
||||||
const remainderValue = ref(0)
|
|
||||||
|
|
||||||
//扫码的条形码字符串
|
|
||||||
const value = ref('')
|
|
||||||
const input = useTemplateRef('snInput')
|
|
||||||
|
|
||||||
const snListCache = ref<string[]>([]) // 缓存扫码的条形码列表
|
|
||||||
// 定义一个map缓存物料信息
|
|
||||||
const materialMapCache = ref<Map<string, material.Material>>(new Map<string, material.Material>()) // 缓存物料信息,key是code
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 请求接口获取缓存数据
|
|
||||||
*/
|
|
||||||
const getCache = () => {
|
|
||||||
api.materialApi.material.all({}, (data) => {
|
|
||||||
data.forEach((item) => {
|
|
||||||
if (item.code) {
|
|
||||||
materialMapCache.value.set(item.code, item) // 物料编码定义为6位
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
getCache()
|
|
||||||
|
|
||||||
interface TableRowVO {
|
|
||||||
id: number
|
|
||||||
barcode: string
|
|
||||||
assignRule: boolean
|
|
||||||
name: string
|
|
||||||
code: string
|
|
||||||
spec: string
|
|
||||||
type: string
|
|
||||||
typeName: string
|
|
||||||
times: string
|
|
||||||
}
|
|
||||||
|
|
||||||
// 扫码点货的table对象
|
|
||||||
const applyDetailTableRef = ref<VxeTableInstance<TableRowVO>>()
|
|
||||||
|
|
||||||
// 移除table中的行
|
|
||||||
const removeStep2Row = async (row: TableRowVO) => {
|
|
||||||
const $table = applyDetailTableRef.value
|
|
||||||
if ($table) {
|
|
||||||
$table.remove(row)
|
|
||||||
//删除缓存的sn
|
|
||||||
snListCache.value = snListCache.value.filter((item) => item !== row.barcode)
|
|
||||||
|
|
||||||
// 已扫码数量-1
|
|
||||||
remainderValue.value = remainderValue.value - 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function beiginScan() {
|
|
||||||
// input.value?.focus()
|
|
||||||
const el = input.value as HTMLInputElement | null
|
|
||||||
if (el) {
|
|
||||||
el.focus()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 点击开始扫码按钮,自动新增一行 或者 扫码结束后也自动新增一行
|
|
||||||
const autoInsertOneRow = async () => {
|
|
||||||
const $table = applyDetailTableRef.value
|
|
||||||
const sn = value.value.trim()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 1. 判断sn是否合法
|
|
||||||
* 2. 判断sn是否已经存在于表格中,需要缓存sn列表
|
|
||||||
* 3. 根据sn获取物料信息,并新增一行到表格中,需要缓存物料信息
|
|
||||||
* 4. 插入成功后缓存sn
|
|
||||||
*/
|
|
||||||
if (sn.length === 0) {
|
|
||||||
value.value = ''
|
|
||||||
message.warning('【' + sn + '】条形码为空,请重新扫码', 5)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (snListCache.value.includes(sn)) {
|
|
||||||
value.value = ''
|
|
||||||
message.warning('【' + sn + '】条形码重复,请重新扫码', 5)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// 找到条形码对应的物料编码
|
|
||||||
const code = sn.slice(0, 5)
|
|
||||||
const materialInfo = materialMapCache.value.get(code)
|
|
||||||
if (!materialInfo) {
|
|
||||||
value.value = ''
|
|
||||||
message.warning('【' + sn + '】条形码不合法,请重新扫码', 5)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($table) {
|
|
||||||
const row: TableRowVO = {
|
|
||||||
id: materialInfo?.id ?? 0,
|
|
||||||
barcode: sn,
|
|
||||||
assignRule: materialInfo?.assignRule ?? false,
|
|
||||||
name: materialInfo?.name ?? '',
|
|
||||||
code: materialInfo?.code ?? '',
|
|
||||||
spec: materialInfo?.spec ?? '',
|
|
||||||
type: materialInfo?.type ?? '',
|
|
||||||
typeName: materialInfo?.typeName ?? '',
|
|
||||||
times: new Date().toLocaleString(),
|
|
||||||
}
|
|
||||||
$table.insert(row)
|
|
||||||
// 缓存sn
|
|
||||||
snListCache.value.push(sn)
|
|
||||||
//已扫码数量+1
|
|
||||||
|
|
||||||
remainderValue.value = remainderValue.value + 1
|
|
||||||
// 添加后就清空输入框
|
|
||||||
value.value = ''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 清空扫码数据
|
|
||||||
const clearScanData = () => {
|
|
||||||
const $table = applyDetailTableRef.value
|
|
||||||
if ($table) {
|
|
||||||
$table.remove()
|
|
||||||
snListCache.value = []
|
|
||||||
remainderValue.value = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
202
src/views/stock/component/scanForm.vue
Normal file
202
src/views/stock/component/scanForm.vue
Normal file
@ -0,0 +1,202 @@
|
|||||||
|
<template>
|
||||||
|
<a-button type="primary" @click="beiginScan">开始扫码</a-button>
|
||||||
|
<a-button type="primary" danger style="left: 20px;">重新扫码</a-button>
|
||||||
|
<a-input bordered size="large" ref="snInput" v-model:value="value" placeholder="输入条形码" @pressEnter="autoInsertOneRow"
|
||||||
|
style="margin-top: 20px; margin-bottom: 20px;" />
|
||||||
|
<a-row style="margin-bottom: 20px;">
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-statistic title="扫码合计" :value="totalValue" style="margin-right: 50px" />
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-statistic title="已扫码" :value="remainderValue" />
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<!-- Esc键退出编辑功能 -->
|
||||||
|
<vxe-table border stripe show-overflow ref="applyDetailTableRef" max-height="500" :column-config="{ resizable: true }"
|
||||||
|
:keyboard-config="{ isEsc: true }" size="medium" empty-text="请先扫码物料体条码"
|
||||||
|
:edit-config="{ trigger: 'click', mode: 'cell' }">
|
||||||
|
|
||||||
|
<vxe-column type="seq" title="序号" width="60"></vxe-column>
|
||||||
|
<vxe-column field="id" title="物料id" :visible="false"></vxe-column>
|
||||||
|
<vxe-column field="barcode" title="物料条码" />
|
||||||
|
<vxe-column field="name" title="物料名称" />
|
||||||
|
<vxe-column field="code" title="编码" />
|
||||||
|
<vxe-column field="spec" title="规格" />
|
||||||
|
<vxe-column field="type" title="类型" />
|
||||||
|
<vxe-column field="times" title="扫码时间" />
|
||||||
|
<vxe-column field="oprator" title="操作">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<vxe-button mode="text" status="error" @click="removeStep2Row(row)">删除</vxe-button>
|
||||||
|
</template>
|
||||||
|
</vxe-column>
|
||||||
|
|
||||||
|
</vxe-table>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { VxeTableInstance } from 'vxe-table'
|
||||||
|
import { useTemplateRef } from 'vue'
|
||||||
|
import { api } from '@/api'
|
||||||
|
import { message } from 'ant-design-vue';
|
||||||
|
|
||||||
|
// 父组件数据交互
|
||||||
|
const props = defineProps(
|
||||||
|
{
|
||||||
|
totalValue: {
|
||||||
|
type: Number,
|
||||||
|
default: 0
|
||||||
|
},
|
||||||
|
applyId: {
|
||||||
|
type: Number,
|
||||||
|
required: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
//获取扫码的集合
|
||||||
|
const getTableData = () => {
|
||||||
|
const $table = applyDetailTableRef.value
|
||||||
|
if ($table) {
|
||||||
|
return $table.getTableData().fullData.map(item => ({
|
||||||
|
assignRule: item.assignRule,
|
||||||
|
materialId: item.id,
|
||||||
|
barcode: item.barcode,
|
||||||
|
code: item.code,
|
||||||
|
date: item.times
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取盘点审核的数据
|
||||||
|
const getApplyData = () => {
|
||||||
|
const $table = applyDetailTableRef.value
|
||||||
|
if ($table) {
|
||||||
|
return $table.getTableData().fullData.map(item => ({
|
||||||
|
applyId: props.applyId,
|
||||||
|
materialId: item.id,
|
||||||
|
barcode: item.barcode
|
||||||
|
}))
|
||||||
|
|
||||||
|
}}
|
||||||
|
|
||||||
|
|
||||||
|
defineExpose({ getTableData,getApplyData })
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const remainderValue = ref(0)
|
||||||
|
|
||||||
|
//扫码的条形码字符串
|
||||||
|
const value = ref('')
|
||||||
|
const input = useTemplateRef('snInput');
|
||||||
|
|
||||||
|
const snListCache = ref<string[]>([]) // 缓存扫码的条形码列表
|
||||||
|
// 定义一个map缓存物料信息
|
||||||
|
const materialMapCache = ref<Map<string, material.Material>>(new Map<string, material.Material>()) // 缓存物料信息,key是code
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求接口获取缓存数据
|
||||||
|
*/
|
||||||
|
const getCache = () => {
|
||||||
|
|
||||||
|
api.materialApi.material.all((data) => {
|
||||||
|
data.forEach(item => {
|
||||||
|
if (item.code) {
|
||||||
|
materialMapCache.value.set(item.code, item) // 物料编码定义为6位
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
getCache();
|
||||||
|
|
||||||
|
interface TableRowVO {
|
||||||
|
id: number
|
||||||
|
barcode: string
|
||||||
|
assignRule: string
|
||||||
|
name: string
|
||||||
|
code: string
|
||||||
|
spec: string
|
||||||
|
type: string
|
||||||
|
times: string
|
||||||
|
}
|
||||||
|
|
||||||
|
// 扫码点货的table对象
|
||||||
|
const applyDetailTableRef = ref<VxeTableInstance<TableRowVO>>()
|
||||||
|
|
||||||
|
// 移除table中的行
|
||||||
|
const removeStep2Row = async (row: TableRowVO) => {
|
||||||
|
const $table = applyDetailTableRef.value
|
||||||
|
if ($table) {
|
||||||
|
$table.remove(row)
|
||||||
|
//删除缓存的sn
|
||||||
|
snListCache.value = snListCache.value.filter(item => item!== row.barcode)
|
||||||
|
|
||||||
|
// 已扫码数量-1
|
||||||
|
remainderValue.value = remainderValue.value - 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function beiginScan() {
|
||||||
|
// input.value?.focus()
|
||||||
|
const el = input.value as HTMLInputElement | null;
|
||||||
|
if (el) {
|
||||||
|
el.focus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 点击开始扫码按钮,自动新增一行 或者 扫码结束后也自动新增一行
|
||||||
|
const autoInsertOneRow = async () => {
|
||||||
|
const $table = applyDetailTableRef.value
|
||||||
|
const sn = value.value.trim();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1. 判断sn是否合法
|
||||||
|
* 2. 判断sn是否已经存在于表格中,需要缓存sn列表
|
||||||
|
* 3. 根据sn获取物料信息,并新增一行到表格中,需要缓存物料信息
|
||||||
|
* 4. 插入成功后缓存sn
|
||||||
|
*/
|
||||||
|
if (sn.length === 0) {
|
||||||
|
value.value = ''
|
||||||
|
message.warning('【' + sn + '】条形码为空,请重新扫码', 5)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (snListCache.value.includes(sn)) {
|
||||||
|
value.value = ''
|
||||||
|
message.warning('【' + sn + '】条形码重复,请重新扫码', 5)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 找到条形码对应的物料编码
|
||||||
|
const code = sn.slice(0, 6)
|
||||||
|
const materialInfo = materialMapCache.value.get(code)
|
||||||
|
if (!materialInfo) {
|
||||||
|
value.value = ''
|
||||||
|
message.warning('【' + sn + '】条形码不合法,请重新扫码', 5)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if ($table) {
|
||||||
|
const row: TableRowVO = {
|
||||||
|
id: materialInfo?.id ?? 0,
|
||||||
|
barcode: sn,
|
||||||
|
assignRule: materialInfo?.assignRule ?? '',
|
||||||
|
name: materialInfo?.name ?? '',
|
||||||
|
code: materialInfo?.code ?? '',
|
||||||
|
spec: materialInfo?.spec ?? '',
|
||||||
|
type: materialInfo?.type ?? '',
|
||||||
|
times: new Date().toLocaleString()
|
||||||
|
}
|
||||||
|
$table.insert(row)
|
||||||
|
// 缓存sn
|
||||||
|
snListCache.value.push(sn)
|
||||||
|
//已扫码数量+1
|
||||||
|
|
||||||
|
remainderValue.value = remainderValue.value + 1
|
||||||
|
// 添加后就清空输入框
|
||||||
|
value.value = ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
@ -1,34 +0,0 @@
|
|||||||
<template>
|
|
||||||
<a-result status="success" title="操作成功!" sub-title="操作已完成,请仔细核对实物与清单,确保无误。">
|
|
||||||
<template #extra>
|
|
||||||
<a-button type="primary" @click="select">查询申请</a-button>
|
|
||||||
<a-button @click="again">继续提交申请</a-button>
|
|
||||||
</template>
|
|
||||||
</a-result>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" setup>
|
|
||||||
import router from '@/router'
|
|
||||||
|
|
||||||
// 和外层界面的数据交互
|
|
||||||
const props = defineProps(
|
|
||||||
{
|
|
||||||
applyType: {
|
|
||||||
type: String,
|
|
||||||
default: '',
|
|
||||||
},
|
|
||||||
}, // 申请类型 applyType页面传值的使用PURCHASE_RECEIPT和LOAN_OUT,PURCHASE_RECEIPT: 采购入库 和 归还入库 LOAN_OUT: 出库外借
|
|
||||||
)
|
|
||||||
|
|
||||||
const select = () => {
|
|
||||||
if (props.applyType === 'PURCHASE_RECEIPT') {
|
|
||||||
router.push({ path: '/statistic/inbound' })
|
|
||||||
} else {
|
|
||||||
router.push({ path: '/statistic/outbound' })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const again = () => {
|
|
||||||
router.go(0)
|
|
||||||
}
|
|
||||||
</script>
|
|
24
src/views/stock/component/successResul.vue
Normal file
24
src/views/stock/component/successResul.vue
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<template>
|
||||||
|
<a-result
|
||||||
|
status="success"
|
||||||
|
title="Successfully Purchased Cloud Server ECS!"
|
||||||
|
sub-title="Order number: 2017182818828182881 Cloud server configuration takes 1-5 minutes, please wait."
|
||||||
|
>
|
||||||
|
<template #extra>
|
||||||
|
<a-button type="primary" @click="select">查询申请</a-button>
|
||||||
|
<a-button @click="again">继续提交申请</a-button>
|
||||||
|
</template>
|
||||||
|
</a-result>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import router from '@/router'
|
||||||
|
|
||||||
|
const select = () => {
|
||||||
|
router.push({ path: '/statistic/inbound' }) // 未生效
|
||||||
|
}
|
||||||
|
|
||||||
|
const again = () => {
|
||||||
|
router.push({ path: '/stock/inbound' })
|
||||||
|
}
|
||||||
|
</script>
|
@ -1,7 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<apply-modal apply-type="PURCHASE_RECEIPT"></apply-modal>
|
<apply-modal apply-type='PURCHASE_RECEIPT'></apply-modal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import applyModal from '@/views/stock/component/apply-modal.vue'
|
import applyModal from "@/views/stock/component/applyModal.vue";
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { FormItem, FormConfig } from '@/components/form-render/form-render-types'
|
import { FormItem, FormConfig } from '@/components/form-render/form-render-types'
|
||||||
import { TreeDataNode } from 'ant-design-vue/es/vc-tree-select/interface'
|
|
||||||
|
|
||||||
export const config: FormConfig = {
|
export const config: FormConfig = {
|
||||||
layout: 'horizontal',
|
layout: 'horizontal',
|
||||||
@ -14,7 +13,7 @@ export const config: FormConfig = {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export const formItems = (types: TreeDataNode[]): FormItem[] => [
|
export const formItems: FormItem[] = [
|
||||||
{
|
{
|
||||||
group: 'form',
|
group: 'form',
|
||||||
type: 'input',
|
type: 'input',
|
||||||
@ -35,24 +34,22 @@ export const formItems = (types: TreeDataNode[]): FormItem[] => [
|
|||||||
},
|
},
|
||||||
rules: [],
|
rules: [],
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
type: 'tree-select',
|
|
||||||
group: 'form',
|
group: 'form',
|
||||||
|
type: 'input',
|
||||||
config: {
|
config: {
|
||||||
autoLink: true,
|
autoLink: true,
|
||||||
hasFeedback: false,
|
hasFeedback: false,
|
||||||
label: '物料类型',
|
label: '物料类型',
|
||||||
name: 'type',
|
name: 'type',
|
||||||
required: true,
|
|
||||||
extra: '',
|
|
||||||
help: '',
|
|
||||||
htmlFor: 'sgsg',
|
|
||||||
},
|
},
|
||||||
properties: {
|
properties: {
|
||||||
size: 'default',
|
size: 'default',
|
||||||
treeData: types,
|
type: 'text',
|
||||||
placeholder: '请选择物料类型',
|
allowClear: false,
|
||||||
|
bordered: true,
|
||||||
|
showCount: false,
|
||||||
|
placeholder: '请输入物料类型',
|
||||||
},
|
},
|
||||||
rules: [],
|
rules: [],
|
||||||
},
|
},
|
||||||
@ -74,37 +71,24 @@ export const formItems = (types: TreeDataNode[]): FormItem[] => [
|
|||||||
rules: [],
|
rules: [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'input-number',
|
type: 'select',
|
||||||
group: 'form',
|
group: 'form',
|
||||||
config: {
|
config: {
|
||||||
autoLink: true,
|
autoLink: true,
|
||||||
hasFeedback: false,
|
hasFeedback: false,
|
||||||
label: '价格',
|
label: '赋码规则',
|
||||||
name: 'price',
|
name: 'assignRule',
|
||||||
required: true,
|
required: true,
|
||||||
|
|
||||||
},
|
},
|
||||||
properties: {
|
properties: {
|
||||||
size: 'default',
|
size: 'default',
|
||||||
controls: true,
|
controls: true,
|
||||||
placeholder: '请填写价格',
|
placeholder: '请填写赋码规则',
|
||||||
|
options: [{ label: '低值易耗品', value: 'LOW_VALUE' }, { label: '高价值工具类', value: 'HIGH_VALUE' }]
|
||||||
},
|
},
|
||||||
rules: [],
|
rules: [],
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
type: 'switch',
|
|
||||||
group: 'form',
|
|
||||||
config: {
|
|
||||||
autoLink: true,
|
|
||||||
hasFeedback: false,
|
|
||||||
label: '是否赋码',
|
|
||||||
name: 'assignRule',
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
properties: {
|
|
||||||
size: 'default',
|
|
||||||
},
|
|
||||||
rules: [],
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'input',
|
type: 'input',
|
||||||
@ -122,5 +106,5 @@ export const formItems = (types: TreeDataNode[]): FormItem[] => [
|
|||||||
placeholder: '',
|
placeholder: '',
|
||||||
},
|
},
|
||||||
rules: [],
|
rules: [],
|
||||||
},
|
}
|
||||||
]
|
]
|
||||||
|
@ -2,29 +2,17 @@
|
|||||||
<page-container>
|
<page-container>
|
||||||
<!-- 页面操作栏 -->
|
<!-- 页面操作栏 -->
|
||||||
<template #ops>
|
<template #ops>
|
||||||
<a-row style="width: 600px">
|
<a-row>
|
||||||
<a-col :span="8">
|
<a-col :span="18">
|
||||||
<a-tree-select
|
|
||||||
v-model:value="typeVal"
|
|
||||||
show-search
|
|
||||||
style="width: 100%"
|
|
||||||
:dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
|
|
||||||
placeholder="请选择物料类型"
|
|
||||||
allow-clear
|
|
||||||
:tree-data="types"
|
|
||||||
tree-node-filter-prop="label"
|
|
||||||
/>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="8">
|
|
||||||
<a-input-search
|
<a-input-search
|
||||||
v-model:value="searchKey"
|
v-model:value="searchKey"
|
||||||
:placeholder="`名称/编码`"
|
:placeholder="`请输入物料名称`"
|
||||||
allow-clear
|
allow-clear
|
||||||
enter-button
|
enter-button
|
||||||
@search="loadData()"
|
@search="loadData()"
|
||||||
></a-input-search>
|
></a-input-search>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="8">
|
<a-col :span="6">
|
||||||
<a-button type="primary" style="margin-left: 10px" @click="addOrEdit()">
|
<a-button type="primary" style="margin-left: 10px" @click="addOrEdit()">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<icon-font type="icon-plus" />
|
<icon-font type="icon-plus" />
|
||||||
@ -48,7 +36,7 @@
|
|||||||
<!-- 操作按钮列 -->
|
<!-- 操作按钮列 -->
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
<template v-if="column.dataIndex === 'assignRule'">
|
<template v-if="column.dataIndex === 'assignRule'">
|
||||||
{{ record.assignRule ? '是' : '否' }}
|
{{ record.assignRule === 'HIGH_VALUE' ? '高价值工具类' : '低值易耗品' }}
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'operation'">
|
<template v-if="column.dataIndex === 'operation'">
|
||||||
<a-button type="link" :style="{ color: token.colorPrimary }" @click="addOrEdit(record)">
|
<a-button type="link" :style="{ color: token.colorPrimary }" @click="addOrEdit(record)">
|
||||||
@ -58,12 +46,7 @@
|
|||||||
编辑
|
编辑
|
||||||
</a-button>
|
</a-button>
|
||||||
|
|
||||||
<a-button
|
<a-button type="link" :style="{ color: token.colorPrimary }">
|
||||||
v-if="record.assignRule"
|
|
||||||
type="link"
|
|
||||||
:style="{ color: token.colorPrimary }"
|
|
||||||
@click="showPrintModal(record.id)"
|
|
||||||
>
|
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<icon-font type="icon-print" />
|
<icon-font type="icon-print" />
|
||||||
</template>
|
</template>
|
||||||
@ -91,17 +74,6 @@
|
|||||||
:title="modalTitle"
|
:title="modalTitle"
|
||||||
@ok="doSave"
|
@ok="doSave"
|
||||||
/>
|
/>
|
||||||
<!-- 打印条码弹窗 -->
|
|
||||||
<a-modal
|
|
||||||
v-model:open="openPrint"
|
|
||||||
title="条形码打印"
|
|
||||||
width="100%"
|
|
||||||
wrap-class-name="full-modal"
|
|
||||||
@ok="closePrint"
|
|
||||||
@cancel="closePrint"
|
|
||||||
>
|
|
||||||
<printCode ref="printcodeRef" :material-id="materialIdRef"></printCode>
|
|
||||||
</a-modal>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
@ -111,44 +83,18 @@
|
|||||||
import { notification, theme } from 'ant-design-vue'
|
import { notification, theme } from 'ant-design-vue'
|
||||||
import {config, formItems} from './form'
|
import {config, formItems} from './form'
|
||||||
import { FormDataType } from '@/components/form-render/form-render-types'
|
import { FormDataType } from '@/components/form-render/form-render-types'
|
||||||
import printCode from './print-code.vue'
|
|
||||||
import { TreeDataNode } from 'ant-design-vue/es/vc-tree-select/interface'
|
|
||||||
|
|
||||||
const { useToken } = theme
|
const { useToken } = theme
|
||||||
const { token } = useToken()
|
const { token } = useToken()
|
||||||
const searchKey = ref('')
|
const searchKey = ref('')
|
||||||
const openPrint = ref(false)
|
|
||||||
const materialPage = ref<IPage<material.Material>>()
|
const materialPage = ref<IPage<material.Material>>()
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const materialIdRef = ref<number>()
|
|
||||||
const printcodeRef = ref()
|
|
||||||
const typeVal = ref<string>() // 物料类型选择值
|
|
||||||
|
|
||||||
//类型树
|
|
||||||
|
|
||||||
const types = ref<Array<TreeDataNode>>([])
|
|
||||||
api.materialApi.type.trees((data) => {
|
|
||||||
types.value = children(data)
|
|
||||||
})
|
|
||||||
const children = (res: Array<material.TypeTree>): Array<TreeDataNode> => {
|
|
||||||
return res.map((areaTree) => ({
|
|
||||||
label: areaTree.label,
|
|
||||||
value: areaTree.value,
|
|
||||||
children: areaTree.children ? children(areaTree.children) : [],
|
|
||||||
key: areaTree.value,
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
|
|
||||||
// 加载数据的方法
|
// 加载数据的方法
|
||||||
const loadData = async (page = 1, size = 10) => {
|
const loadData = async (page = 1, size = 10) => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
api.materialApi.material.materials(
|
api.materialApi.material.materials(
|
||||||
{
|
{ page: page || materialPage.value?.current, size: size || materialPage.value?.size, key: searchKey.value },
|
||||||
page: page || materialPage.value?.current,
|
|
||||||
size: size || materialPage.value?.size,
|
|
||||||
key: searchKey.value,
|
|
||||||
type: typeVal.value,
|
|
||||||
},
|
|
||||||
(data) => {
|
(data) => {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
materialPage.value = data
|
materialPage.value = data
|
||||||
@ -160,11 +106,6 @@
|
|||||||
|
|
||||||
//表格列
|
//表格列
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
|
||||||
title: '序号',
|
|
||||||
dataIndex: 'key',
|
|
||||||
customRender: ({ index }: { index: number }) => `${index + 1}`,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: '物料编码',
|
title: '物料编码',
|
||||||
dataIndex: 'code',
|
dataIndex: 'code',
|
||||||
@ -173,20 +114,16 @@
|
|||||||
title: '物料名称',
|
title: '物料名称',
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: '价格',
|
|
||||||
dataIndex: 'price',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: '物料类型',
|
title: '物料类型',
|
||||||
dataIndex: 'typeName',
|
dataIndex: 'type',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '物料型号',
|
title: '物料型号',
|
||||||
dataIndex: 'spec',
|
dataIndex: 'spec',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '是否赋码',
|
title: '赋码规则',
|
||||||
dataIndex: 'assignRule',
|
dataIndex: 'assignRule',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -196,6 +133,7 @@
|
|||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
dataIndex: 'operation',
|
dataIndex: 'operation',
|
||||||
|
width: 400,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -221,7 +159,7 @@
|
|||||||
})
|
})
|
||||||
//表单配置
|
//表单配置
|
||||||
const items = computed(() => {
|
const items = computed(() => {
|
||||||
return formItems(types.value)
|
return formItems
|
||||||
})
|
})
|
||||||
|
|
||||||
//弹窗标题
|
//弹窗标题
|
||||||
@ -229,6 +167,7 @@
|
|||||||
return material.value.id ? '编辑物料' : '添加物料'
|
return material.value.id ? '编辑物料' : '添加物料'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
//新增或编辑,只是打开弹窗
|
//新增或编辑,只是打开弹窗
|
||||||
const addOrEdit = (u?: Record<string, unknown>) => {
|
const addOrEdit = (u?: Record<string, unknown>) => {
|
||||||
/*
|
/*
|
||||||
@ -245,7 +184,7 @@
|
|||||||
这是为了避免因访问不存在的对象属性而引发错误。
|
这是为了避免因访问不存在的对象属性而引发错误。
|
||||||
*/
|
*/
|
||||||
// material.value = { ...(u ?? { channels: 3 }) }
|
// material.value = { ...(u ?? { channels: 3 }) }
|
||||||
material.value = { ...u } // 如果 u 存在,则使用 u 的值;否则使用空对象 {}
|
material.value = { ...u}; // 如果 u 存在,则使用 u 的值;否则使用空对象 {}
|
||||||
formDrawer.value?.show()
|
formDrawer.value?.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -260,7 +199,8 @@
|
|||||||
loadData(1)
|
loadData(1)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
})
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//删除
|
//删除
|
||||||
@ -275,22 +215,4 @@
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 打开打印弹窗
|
|
||||||
const showPrintModal = (applyId: number) => {
|
|
||||||
openPrint.value = true
|
|
||||||
materialIdRef.value = applyId
|
|
||||||
}
|
|
||||||
|
|
||||||
// 关闭打印弹窗
|
|
||||||
const closePrint = () => {
|
|
||||||
openPrint.value = false
|
|
||||||
printcodeRef.value.clearContent()
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
|
||||||
.notshow {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
@ -1,132 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<a-flex gap="middle" horizontal>
|
|
||||||
<span class="ant-form-text">请输入打印的条码数量:</span>
|
|
||||||
<a-form-item name="input-number" no-style>
|
|
||||||
<a-input-number v-model:value="inputRef" :min="1" :max="30" />
|
|
||||||
</a-form-item>
|
|
||||||
|
|
||||||
<button @click="printCode">打印条形码</button>
|
|
||||||
</a-flex>
|
|
||||||
<div id="barcodes-container">
|
|
||||||
<!-- 条形码将被动态插入到这里 -->
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup lang="ts">
|
|
||||||
import { ref } from 'vue'
|
|
||||||
import JsBarcode from 'jsbarcode'
|
|
||||||
import printJS from 'print-js'
|
|
||||||
import api from '@/api'
|
|
||||||
|
|
||||||
const props = defineProps({
|
|
||||||
// 接收父组件传递的条形码数量
|
|
||||||
materialId: {
|
|
||||||
type: Number,
|
|
||||||
default: 0,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
const clearContent = () => {
|
|
||||||
inputRef.value = 0
|
|
||||||
const container = document.getElementById('barcodes-container')
|
|
||||||
if (container) container.innerHTML = ''
|
|
||||||
}
|
|
||||||
// 向父组件暴露清空条形码容器的函数
|
|
||||||
defineExpose({ clearContent })
|
|
||||||
|
|
||||||
const inputRef = ref(0)
|
|
||||||
|
|
||||||
watch(inputRef, (newVal) => {
|
|
||||||
fetchAndPrintBarcodes(newVal)
|
|
||||||
})
|
|
||||||
|
|
||||||
const printCode = () => {
|
|
||||||
const container = document.getElementById('barcodes-container')
|
|
||||||
if (!container) {
|
|
||||||
window.console.log('条形码容器未找到')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// 设置页面大小以适应小纸张(40mm x 30mm)
|
|
||||||
const widthInches = (40 * 0.0393701).toFixed(3) // 约1.575英寸
|
|
||||||
const heightInches = (30 * 0.0393701).toFixed(3) // 约1.181英寸
|
|
||||||
|
|
||||||
// 打印配置
|
|
||||||
const printOptions: printJS.Configuration = {
|
|
||||||
printable: 'barcodes-container',
|
|
||||||
type: 'html',
|
|
||||||
scanStyles: false,
|
|
||||||
honorMarginPadding: false,
|
|
||||||
targetStyles: ['*'],
|
|
||||||
style: `
|
|
||||||
@page {
|
|
||||||
size: ${widthInches}in ${heightInches}in;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
body {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
font-size: 6px;
|
|
||||||
}
|
|
||||||
#barcodes-container canvas {
|
|
||||||
display: block;
|
|
||||||
margin-bottom: 2mm; /* 调整条形码之间的间距 */
|
|
||||||
}
|
|
||||||
`,
|
|
||||||
onLoadingStart: () => console.log('开始加载'),
|
|
||||||
onLoadingEnd: () => console.log('加载完成'),
|
|
||||||
onError: (err: unknown) => console.error('打印出错:', err),
|
|
||||||
}
|
|
||||||
|
|
||||||
// 显示条形码容器以便打印
|
|
||||||
container.style.display = 'block'
|
|
||||||
|
|
||||||
// 调用 printJS 进行打印
|
|
||||||
printJS(printOptions)
|
|
||||||
}
|
|
||||||
// 定义一个函数来从后端获取条形码字符串并打印
|
|
||||||
const fetchAndPrintBarcodes = (count: number) => {
|
|
||||||
if (count <= 0) return
|
|
||||||
// 清空之前的条形码容器
|
|
||||||
const container = document.getElementById('barcodes-container')
|
|
||||||
if (!container) throw new Error('条形码容器未找到')
|
|
||||||
container.innerHTML = ''
|
|
||||||
|
|
||||||
// 从后端获取条形码字符串数组
|
|
||||||
api.materialApi.material.generateBarcodes(props.materialId, { count: count }, (res: Array<string>) => {
|
|
||||||
res.forEach((barcodeString: string, index: number) => {
|
|
||||||
const canvasId = `barcode-${index}`
|
|
||||||
const canvasElement = document.createElement('canvas')
|
|
||||||
// 设置画布大小
|
|
||||||
canvasElement.width = 472 // 宽度接近 40mm
|
|
||||||
canvasElement.height = 354 // 高度接近 30mm
|
|
||||||
|
|
||||||
canvasElement.id = canvasId
|
|
||||||
container.appendChild(canvasElement)
|
|
||||||
// 使用JsBarcode生成条形码
|
|
||||||
JsBarcode(`#${canvasId}`, barcodeString, {
|
|
||||||
// format: "EAN13", // 或者根据需要选择其他格式
|
|
||||||
width: 1, // 条形码线条宽度
|
|
||||||
height: 70, // 条形码高度
|
|
||||||
displayValue: true, // 显示条形码下方的文本
|
|
||||||
fontOptions: 'bold', // 文本样式
|
|
||||||
fontSize: 12, // 文本大小
|
|
||||||
textMargin: 5, // 文本与条形码之间的间距
|
|
||||||
margin: 10, // 条形码周围的空白边距
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 如果需要在组件挂载时自动执行打印,请取消注释以下代码
|
|
||||||
// onMounted(fetchAndPrintBarcodes);
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
/* 针对打印样式的样式 */
|
|
||||||
@media print {
|
|
||||||
#barcodes-container {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,7 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<apply-modal apply-type="LOAN_OUT"></apply-modal>
|
<apply-modal apply-type='LOAN_OUT'></apply-modal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import applyModal from '@/views/stock/component/apply-modal.vue'
|
import applyModal from "@/views/stock/component/applyModal.vue";
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -2,64 +2,32 @@
|
|||||||
<page-container>
|
<page-container>
|
||||||
<!-- 页面操作栏 -->
|
<!-- 页面操作栏 -->
|
||||||
<template #ops>
|
<template #ops>
|
||||||
<a-row style="width: 600px">
|
<a-row>
|
||||||
<a-col :span="8">
|
<a-col :span="18">
|
||||||
<a-tree-select
|
<a-input-search v-model:value="searchKey" :placeholder="`请输入`" allow-clear enter-button
|
||||||
v-model:value="typeVal"
|
@search="loadData()"></a-input-search>
|
||||||
show-search
|
|
||||||
style="width: 100%"
|
|
||||||
:dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
|
|
||||||
placeholder="请选择物料类型"
|
|
||||||
allow-clear
|
|
||||||
:tree-data="types"
|
|
||||||
tree-node-filter-prop="label"
|
|
||||||
/>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="8">
|
|
||||||
<a-input-search
|
|
||||||
v-model:value="searchKey"
|
|
||||||
:placeholder="`名称/编码/型号`"
|
|
||||||
allow-clear
|
|
||||||
enter-button
|
|
||||||
@search="loadData()"
|
|
||||||
></a-input-search>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="8">
|
|
||||||
<a-button type="primary" @click="downloadData()">导出</a-button>
|
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
</template>
|
</template>
|
||||||
<!-- 页面表格内容 -->
|
<!-- 页面表格内容 -->
|
||||||
<div style="min-height: calc(100vh - 305px)">
|
<div style="min-height: calc(100vh - 305px)">
|
||||||
<!-- 表格行 -->
|
<!-- 表格行 -->
|
||||||
<a-table
|
<a-table :columns="columns" :data-source="pagedata?.records" bordered :pagination="pagination"
|
||||||
:columns="columns"
|
:loading="loading" row-key="key">
|
||||||
:data-source="pagedata?.records"
|
|
||||||
bordered
|
|
||||||
:pagination="pagination"
|
|
||||||
:loading="loading"
|
|
||||||
row-key="key"
|
|
||||||
>
|
|
||||||
<template #bodyCell="{ column, record }">
|
|
||||||
<template v-if="column.dataIndex === 'applyTypeInfo'">
|
|
||||||
{{ record.applyTypeInfo.description }}
|
|
||||||
</template>
|
|
||||||
</template>
|
|
||||||
</a-table>
|
</a-table>
|
||||||
</div>
|
</div>
|
||||||
</page-container>
|
</page-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import { IPage } from '@/api/api'
|
import { IPage } from '@/api/api'
|
||||||
import { http } from '@/settings/http'
|
|
||||||
import { TreeDataNode } from 'ant-design-vue/es/vc-tree-select/interface'
|
|
||||||
|
|
||||||
const searchKey = ref('')
|
const searchKey = ref('')
|
||||||
const pagedata = ref<IPage<material.ApplyDTO>>()
|
const pagedata = ref<IPage<material.ApplyDTO>>()
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const typeVal = ref<string>() // 物料类型选择值
|
|
||||||
|
|
||||||
// 加载数据的方法
|
// 加载数据的方法
|
||||||
const loadData = async (page = 1, size = 10) => {
|
const loadData = async (page = 1, size = 10) => {
|
||||||
@ -69,68 +37,27 @@
|
|||||||
page: page,
|
page: page,
|
||||||
size: size,
|
size: size,
|
||||||
applyType: 1,
|
applyType: 1,
|
||||||
type: typeVal.value,
|
type:searchKey.value,
|
||||||
key: searchKey.value,
|
code: searchKey.value,
|
||||||
},
|
name: searchKey.value
|
||||||
(data) => {
|
},(data)=>{
|
||||||
pagedata.value = data
|
pagedata.value = data
|
||||||
loading.value = false
|
loading.value = false
|
||||||
},
|
})
|
||||||
)
|
|
||||||
}
|
}
|
||||||
//初始加载
|
//初始加载
|
||||||
loadData()
|
loadData()
|
||||||
|
|
||||||
//导出数据
|
|
||||||
const downloadData = () => {
|
|
||||||
// 创建 URLSearchParams 对象
|
|
||||||
const params = new URLSearchParams()
|
|
||||||
if (typeVal.value) {
|
|
||||||
params.append('type', typeVal.value)
|
|
||||||
}
|
|
||||||
if (searchKey.value) {
|
|
||||||
params.append('key', searchKey.value)
|
|
||||||
}
|
|
||||||
params.append('applyType', '1')
|
|
||||||
const url = `${http.prefix}/apply/download-excel?${params.toString()}`
|
|
||||||
window.open(url)
|
|
||||||
}
|
|
||||||
//表格列
|
//表格列
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
|
||||||
title: '序号',
|
|
||||||
dataIndex: 'key',
|
|
||||||
customRender: ({ index }: { index: number }) => `${index + 1}`,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: '物料名称',
|
title: '物料名称',
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: '物料类型',
|
|
||||||
dataIndex: 'typeName',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: '物料编码',
|
title: '物料编码',
|
||||||
dataIndex: 'code',
|
dataIndex: 'code',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: '物料型号',
|
|
||||||
dataIndex: 'spec',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '入库类型',
|
|
||||||
dataIndex: 'applyTypeInfo',
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
title: '申请数量',
|
|
||||||
dataIndex: 'applyNum',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '确认数量',
|
|
||||||
dataIndex: 'confirmNum',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: '申请人',
|
title: '申请人',
|
||||||
dataIndex: 'applicant',
|
dataIndex: 'applicant',
|
||||||
@ -139,10 +66,18 @@
|
|||||||
title: '申请日期',
|
title: '申请日期',
|
||||||
dataIndex: 'applyDate',
|
dataIndex: 'applyDate',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '申请数量',
|
||||||
|
dataIndex: 'applyNum',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '确认数量',
|
||||||
|
dataIndex: 'confirmNum',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '备注',
|
title: '备注',
|
||||||
dataIndex: 'remark',
|
dataIndex: 'remark',
|
||||||
},
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
//分页信息
|
//分页信息
|
||||||
@ -157,17 +92,6 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// 物料类型树
|
|
||||||
const types = ref<Array<TreeDataNode>>([])
|
|
||||||
api.materialApi.type.trees((data) => {
|
|
||||||
types.value = children(data)
|
|
||||||
})
|
|
||||||
const children = (res: Array<material.TypeTree>): Array<TreeDataNode> => {
|
|
||||||
return res.map((areaTree) => ({
|
|
||||||
label: areaTree.label,
|
|
||||||
value: areaTree.value,
|
|
||||||
children: areaTree.children ? children(areaTree.children) : [],
|
|
||||||
key: areaTree.value,
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -2,32 +2,17 @@
|
|||||||
<page-container>
|
<page-container>
|
||||||
<!-- 页面操作栏 -->
|
<!-- 页面操作栏 -->
|
||||||
<template #ops>
|
<template #ops>
|
||||||
<a-row style="width: 600px">
|
<a-row>
|
||||||
<a-col :span="8">
|
<a-col :span="18">
|
||||||
<a-tree-select
|
|
||||||
v-model:value="typeVal"
|
|
||||||
show-search
|
|
||||||
style="width: 100%"
|
|
||||||
:dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
|
|
||||||
placeholder="请选择物料类型"
|
|
||||||
allow-clear
|
|
||||||
:tree-data="types"
|
|
||||||
tree-node-filter-prop="label"
|
|
||||||
/>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="8">
|
|
||||||
<a-input-search
|
<a-input-search
|
||||||
v-model:value="searchKey"
|
v-model:value="searchKey"
|
||||||
placeholder="名称/编码/型号"
|
:placeholder="`请输入物料名称`"
|
||||||
allow-clear
|
allow-clear
|
||||||
enter-button
|
enter-button
|
||||||
width="100%"
|
|
||||||
@search="loadData()"
|
@search="loadData()"
|
||||||
></a-input-search>
|
></a-input-search>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="8">
|
|
||||||
<a-button type="primary" @click="downloadData()">导出</a-button>
|
|
||||||
</a-col>
|
|
||||||
</a-row>
|
</a-row>
|
||||||
</template>
|
</template>
|
||||||
<!-- 页面表格内容 -->
|
<!-- 页面表格内容 -->
|
||||||
@ -44,37 +29,29 @@
|
|||||||
<!-- 操作按钮列 -->
|
<!-- 操作按钮列 -->
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
<template v-if="column.dataIndex === 'assignRule'">
|
<template v-if="column.dataIndex === 'assignRule'">
|
||||||
{{ record.assignRule ? '是' : '否' }}
|
{{ record.assignRule === 1 ? '高价值工具类' : '低值易耗品' }} <!-- 这里定义为0和1,0再回显的时候不展示?-->
|
||||||
<!-- 这里定义为0和1,0再回显的时候不展示?-->
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</a-table>
|
</a-table>
|
||||||
</div>
|
</div>
|
||||||
</page-container>
|
</page-container>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import { IPage } from '@/api/api'
|
import { IPage } from '@/api/api'
|
||||||
import { http } from '@/settings/http'
|
|
||||||
import { TreeDataNode } from 'ant-design-vue/es/vc-tree-select/interface'
|
|
||||||
|
|
||||||
const searchKey = ref('')
|
const searchKey = ref('')
|
||||||
|
|
||||||
const materialPage = ref<IPage<material.Material>>()
|
const materialPage = ref<IPage<material.Material>>()
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const typeVal = ref<string>() // 物料类型选择值
|
|
||||||
|
|
||||||
// 加载数据的方法
|
// 加载数据的方法
|
||||||
const loadData = async (page = 1, size = 10) => {
|
const loadData = async (page = 1, size = 10) => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
api.materialApi.material.materials(
|
api.materialApi.material.materials(
|
||||||
{
|
{ page: page || materialPage.value?.current, size: size || materialPage.value?.size, key: searchKey.value },
|
||||||
page: page || materialPage.value?.current,
|
|
||||||
size: size || materialPage.value?.size,
|
|
||||||
key: searchKey.value,
|
|
||||||
type: typeVal.value,
|
|
||||||
},
|
|
||||||
(data) => {
|
(data) => {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
materialPage.value = data
|
materialPage.value = data
|
||||||
@ -84,53 +61,28 @@
|
|||||||
//初始加载
|
//初始加载
|
||||||
loadData()
|
loadData()
|
||||||
|
|
||||||
//导出数据
|
|
||||||
const downloadData = () => {
|
|
||||||
// 创建 URLSearchParams 对象
|
|
||||||
const params = new URLSearchParams()
|
|
||||||
if (typeVal.value) {
|
|
||||||
params.append('type', typeVal.value)
|
|
||||||
}
|
|
||||||
if (searchKey.value) {
|
|
||||||
params.append('key', searchKey.value)
|
|
||||||
}
|
|
||||||
|
|
||||||
const url = `${http.prefix}/material/download-excel?${params.toString()}`
|
|
||||||
window.open(url)
|
|
||||||
}
|
|
||||||
|
|
||||||
//表格列
|
//表格列
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
title: '序号',
|
title: '物料编码',
|
||||||
dataIndex: 'key',
|
dataIndex: 'code',
|
||||||
customRender: ({ index }: { index: number }) => `${index + 1}`,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '物料名称',
|
title: '物料名称',
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: '物料编码',
|
|
||||||
dataIndex: 'code',
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
{
|
||||||
title: '物料类型',
|
title: '物料类型',
|
||||||
dataIndex: 'typeName',
|
dataIndex: 'type',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '物料型号',
|
title: '物料型号',
|
||||||
dataIndex: 'spec',
|
dataIndex: 'spec',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '是否赋码',
|
title: '赋码规则',
|
||||||
dataIndex: 'assignRule',
|
dataIndex: 'assignRule',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: '价格',
|
|
||||||
dataIndex: 'price',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: '库存数量',
|
title: '库存数量',
|
||||||
dataIndex: 'stock',
|
dataIndex: 'stock',
|
||||||
@ -139,7 +91,7 @@
|
|||||||
{
|
{
|
||||||
title: '备注',
|
title: '备注',
|
||||||
dataIndex: 'description',
|
dataIndex: 'description',
|
||||||
},
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
//分页信息
|
//分页信息
|
||||||
@ -154,17 +106,5 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// 物料类型树
|
|
||||||
const types = ref<Array<TreeDataNode>>([])
|
|
||||||
api.materialApi.type.trees((data) => {
|
|
||||||
types.value = children(data)
|
|
||||||
})
|
|
||||||
const children = (res: Array<material.TypeTree>): Array<TreeDataNode> => {
|
|
||||||
return res.map((areaTree) => ({
|
|
||||||
label: areaTree.label,
|
|
||||||
value: areaTree.value,
|
|
||||||
children: areaTree.children ? children(areaTree.children) : [],
|
|
||||||
key: areaTree.value,
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -2,106 +2,33 @@
|
|||||||
<page-container>
|
<page-container>
|
||||||
<!-- 页面操作栏 -->
|
<!-- 页面操作栏 -->
|
||||||
<template #ops>
|
<template #ops>
|
||||||
<a-row style="width: 600px">
|
<a-row>
|
||||||
<a-col :span="8">
|
<a-col :span="18">
|
||||||
<a-tree-select
|
<a-input-search v-model:value="searchKey" :placeholder="`请输入`" allow-clear enter-button
|
||||||
v-model:value="typeVal"
|
@search="loadData()"></a-input-search>
|
||||||
show-search
|
|
||||||
style="width: 100%"
|
|
||||||
:dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
|
|
||||||
placeholder="请选择物料类型"
|
|
||||||
allow-clear
|
|
||||||
:tree-data="types"
|
|
||||||
tree-node-filter-prop="label"
|
|
||||||
/>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="8">
|
|
||||||
<a-input-search
|
|
||||||
v-model:value="searchKey"
|
|
||||||
:placeholder="`名称/编码/型号`"
|
|
||||||
allow-clear
|
|
||||||
enter-button
|
|
||||||
@search="loadData()"
|
|
||||||
></a-input-search>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="8">
|
|
||||||
<a-button type="primary" @click="downloadData()">导出</a-button>
|
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
</template>
|
</template>
|
||||||
<!-- 页面表格内容 -->
|
<!-- 页面表格内容 -->
|
||||||
<div style="min-height: calc(100vh - 305px)">
|
<div style="min-height: calc(100vh - 305px)">
|
||||||
<!-- 表格行 -->
|
<!-- 表格行 -->
|
||||||
<a-table
|
<a-table :columns="columns" :data-source="pagedata?.records" bordered :pagination="pagination"
|
||||||
:columns="columns"
|
:loading="loading" row-key="key">
|
||||||
:data-source="pagedata?.records"
|
|
||||||
bordered
|
|
||||||
:pagination="pagination"
|
|
||||||
:loading="loading"
|
|
||||||
row-key="key"
|
|
||||||
>
|
|
||||||
<template #bodyCell="{ column, record }">
|
|
||||||
<template v-if="column.dataIndex === 'applyTypeInfo'">
|
|
||||||
{{ record.applyTypeInfo.description }}
|
|
||||||
</template>
|
|
||||||
<template v-if="column.dataIndex === 'reviewResult'">
|
|
||||||
<template v-if="record.reviewResult === 'PASS'"><span style="color: #52c41a">审核通过</span></template>
|
|
||||||
<template v-if="record.reviewResult === 'REJECT'"><span style="color: #f5222d">审核不通过</span></template>
|
|
||||||
</template>
|
|
||||||
<template v-if="column.dataIndex === 'operation'">
|
|
||||||
<a-button
|
|
||||||
v-if="record.applyType === 'SCRAP_OUT' && !record.confirm && record.reviewer === userStore.userName"
|
|
||||||
type="link"
|
|
||||||
style="margin-left: 10px"
|
|
||||||
@click="showResultModal(record.applyId)"
|
|
||||||
>
|
|
||||||
审核
|
|
||||||
</a-button>
|
|
||||||
</template>
|
|
||||||
</template>
|
|
||||||
</a-table>
|
</a-table>
|
||||||
</div>
|
</div>
|
||||||
</page-container>
|
</page-container>
|
||||||
<!-- 审核弹窗 -->
|
|
||||||
<a-modal v-model:open="openResult" title="报废出库数据:" width="80%" :confirm-loading="confirmLoading" @ok="submit">
|
|
||||||
<vxe-table border show-overflow max-height="500" size="medium" :data="reviewData">
|
|
||||||
<vxe-column type="seq" width="70" />
|
|
||||||
<vxe-column field="name" title="物料名称" />
|
|
||||||
<vxe-column field="typeName" title="类型" />
|
|
||||||
<vxe-column field="spec" title="规格" />
|
|
||||||
<vxe-column field="price" title="价格" />
|
|
||||||
<vxe-column field="applicant" title="申请人" />
|
|
||||||
<vxe-column field="confirmQuantity" title="报废数量" />
|
|
||||||
<vxe-column field="remark" title="报废原因" />
|
|
||||||
</vxe-table>
|
|
||||||
<a-form layout="vertical" style="margin-top: 20px">
|
|
||||||
<a-form-item label="审核意见">
|
|
||||||
<a-textarea v-model:value="remark" placeholder="请输入审核意见" :row="3" :maxlength="1000" />
|
|
||||||
</a-form-item>
|
|
||||||
|
|
||||||
<a-form-item label="审核结果">
|
|
||||||
<a-radio-group v-model:value="reviewResult" button-style="solid">
|
|
||||||
<a-radio-button value="PASS">审核通过</a-radio-button>
|
|
||||||
<a-radio-button value="REJECT" style="margin-left: 20px">审核不通过</a-radio-button>
|
|
||||||
</a-radio-group>
|
|
||||||
</a-form-item>
|
|
||||||
</a-form>
|
|
||||||
</a-modal>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import { IPage } from '@/api/api'
|
import { IPage } from '@/api/api'
|
||||||
import { useUserStore } from '@/stores/user'
|
|
||||||
import { http } from '@/settings/http'
|
|
||||||
import { TreeDataNode } from 'ant-design-vue/es/vc-tree-select/interface'
|
|
||||||
|
|
||||||
const searchKey = ref()
|
const searchKey = ref('')
|
||||||
const pagedata = ref<IPage<material.ApplyDTO>>()
|
const pagedata = ref<IPage<material.ApplyDTO>>()
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const typeVal = ref<string>() // 物料类型选择值
|
|
||||||
|
|
||||||
const userStore = useUserStore()
|
|
||||||
// 加载数据的方法
|
// 加载数据的方法
|
||||||
const loadData = async (page = 1, size = 10) => {
|
const loadData = async (page = 1, size = 10) => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
@ -110,61 +37,35 @@
|
|||||||
page: page,
|
page: page,
|
||||||
size: size,
|
size: size,
|
||||||
applyType: 3,
|
applyType: 3,
|
||||||
type: typeVal.value,
|
type:searchKey.value,
|
||||||
key: searchKey.value,
|
code: searchKey.value,
|
||||||
},
|
name: searchKey.value
|
||||||
(data) => {
|
},(data)=>{
|
||||||
pagedata.value = data
|
pagedata.value = data
|
||||||
loading.value = false
|
loading.value = false
|
||||||
},
|
})
|
||||||
)
|
|
||||||
}
|
}
|
||||||
//初始加载
|
//初始加载
|
||||||
loadData()
|
loadData()
|
||||||
|
|
||||||
//导出数据
|
|
||||||
const downloadData = () => {
|
|
||||||
// 创建 URLSearchParams 对象
|
|
||||||
const params = new URLSearchParams()
|
|
||||||
if (typeVal.value) {
|
|
||||||
params.append('type', typeVal.value)
|
|
||||||
}
|
|
||||||
if (searchKey.value) {
|
|
||||||
params.append('key', searchKey.value)
|
|
||||||
}
|
|
||||||
params.append('applyType', '3')
|
|
||||||
const url = `${http.prefix}/apply/download-excel?${params.toString()}`
|
|
||||||
window.open(url)
|
|
||||||
}
|
|
||||||
|
|
||||||
//表格列
|
//表格列
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
|
||||||
title: '序号',
|
|
||||||
dataIndex: 'key',
|
|
||||||
customRender: ({ index }: { index: number }) => `${index + 1}`,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: '物料名称',
|
title: '物料名称',
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: '物料类型',
|
|
||||||
dataIndex: 'typeName',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: '物料编码',
|
title: '物料编码',
|
||||||
dataIndex: 'code',
|
dataIndex: 'code',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '物料型号',
|
title: '申请人',
|
||||||
dataIndex: 'spec',
|
dataIndex: 'applicant',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '出库类型',
|
title: '申请日期',
|
||||||
dataIndex: 'applyTypeInfo',
|
dataIndex: 'applyDate',
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
title: '申请数量',
|
title: '申请数量',
|
||||||
dataIndex: 'applyNum',
|
dataIndex: 'applyNum',
|
||||||
@ -173,30 +74,10 @@
|
|||||||
title: '确认数量',
|
title: '确认数量',
|
||||||
dataIndex: 'confirmNum',
|
dataIndex: 'confirmNum',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: '申请人',
|
|
||||||
dataIndex: 'applicant',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '审核人',
|
|
||||||
dataIndex: 'reviewer',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '审核状态',
|
|
||||||
dataIndex: 'reviewResult',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '申请日期',
|
|
||||||
dataIndex: 'applyDate',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: '备注',
|
title: '备注',
|
||||||
dataIndex: 'remark',
|
dataIndex: 'remark',
|
||||||
},
|
}
|
||||||
{
|
|
||||||
title: '操作',
|
|
||||||
dataIndex: 'operation',
|
|
||||||
},
|
|
||||||
]
|
]
|
||||||
|
|
||||||
//分页信息
|
//分页信息
|
||||||
@ -211,49 +92,6 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// 审核
|
|
||||||
const openResult = ref<boolean>(false)
|
|
||||||
const confirmLoading = ref(false)
|
|
||||||
const reviewResult = ref<'PASS' | 'REJECT'>('PASS')
|
|
||||||
const remark = ref('')
|
|
||||||
const reviewData = ref<Array<material.ScrapOutApplyDTO>>([])
|
|
||||||
const applyIdRef = ref(0)
|
|
||||||
//点击审核
|
|
||||||
const showResultModal = (applyId: number) => {
|
|
||||||
openResult.value = true
|
|
||||||
applyIdRef.value = applyId
|
|
||||||
api.materialApi.apply.getScrapOutById(applyId, (data) => {
|
|
||||||
reviewData.value = data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 审核提交
|
|
||||||
const submit = () => {
|
|
||||||
confirmLoading.value = true
|
|
||||||
api.materialApi.apply.submitScrapOutReview(
|
|
||||||
{
|
|
||||||
applyId: applyIdRef.value.toString(),
|
|
||||||
reviewResult: reviewResult.value,
|
|
||||||
remark: remark.value,
|
|
||||||
},
|
|
||||||
() => {
|
|
||||||
confirmLoading.value = false
|
|
||||||
openResult.value = false
|
|
||||||
loadData()
|
|
||||||
},
|
|
||||||
)
|
|
||||||
}
|
|
||||||
// 物料类型树
|
|
||||||
const types = ref<Array<TreeDataNode>>([])
|
|
||||||
api.materialApi.type.trees((data) => {
|
|
||||||
types.value = children(data)
|
|
||||||
})
|
|
||||||
const children = (res: Array<material.TypeTree>): Array<TreeDataNode> => {
|
|
||||||
return res.map((areaTree) => ({
|
|
||||||
label: areaTree.label,
|
|
||||||
value: areaTree.value,
|
|
||||||
children: areaTree.children ? children(areaTree.children) : [],
|
|
||||||
key: areaTree.value,
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -3,143 +3,49 @@
|
|||||||
<!-- 页面操作栏 -->
|
<!-- 页面操作栏 -->
|
||||||
<template #ops>
|
<template #ops>
|
||||||
<a-row>
|
<a-row>
|
||||||
<a-col :span="6" style="width: 280px">
|
<a-col :span="18">
|
||||||
<a-date-picker
|
<a-input-search v-model:value="searchKey" :placeholder="`请输入`" allow-clear enter-button
|
||||||
v-model:value="startDate"
|
@search="loadData()"></a-input-search>
|
||||||
:format="'YYYY-MM-DD HH:mm:ss'"
|
|
||||||
placeholder="开始日期大于"
|
|
||||||
style="width: 100%"
|
|
||||||
/>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="6" style="width: 180px">
|
|
||||||
<a-select
|
|
||||||
v-model:value="status"
|
|
||||||
placeholder="盘点状态"
|
|
||||||
:max-tag-count="1"
|
|
||||||
mode="multiple"
|
|
||||||
style="width: 100%"
|
|
||||||
>
|
|
||||||
<a-select-option value="WAIT_SCAN">待扫码</a-select-option>
|
|
||||||
<a-select-option value="WAIT_SUBMIT">待提交</a-select-option>
|
|
||||||
<a-select-option value="WAIT_REVIEW">待审核</a-select-option>
|
|
||||||
<a-select-option value="PASS">审核通过</a-select-option>
|
|
||||||
<a-select-option value="REJECT">退回</a-select-option>
|
|
||||||
</a-select>
|
|
||||||
</a-col>
|
|
||||||
|
|
||||||
<a-col :span="6" style="width: 180px">
|
|
||||||
<a-select v-model:value="auditType" :allow-clear="true" placeholder="盘点类型" style="width: 100%">
|
|
||||||
<a-select-option value="SCAN">扫码盘点</a-select-option>
|
|
||||||
<a-select-option value="MANUAL">人工盘点</a-select-option>
|
|
||||||
</a-select>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="6" style="width: 180px">
|
|
||||||
<a-input-search v-model:value="taker" :placeholder="`盘点人`" allow-clear enter-button @search="loadData()" />
|
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
<a-button type="primary" @click="downloadData()">导出</a-button>
|
|
||||||
</template>
|
</template>
|
||||||
<!-- 页面表格内容 -->
|
<!-- 页面表格内容 -->
|
||||||
<div style="min-height: calc(100vh - 305px)">
|
<div style="min-height: calc(100vh - 305px)">
|
||||||
<!-- 表格行 -->
|
<!-- 表格行 -->
|
||||||
<a-table
|
<a-table :columns="columns" :data-source="auditPage?.records" bordered :pagination="pagination" :loading="loading"
|
||||||
:columns="columns"
|
row-key="key">
|
||||||
:data-source="auditPage?.records"
|
|
||||||
bordered
|
|
||||||
:pagination="pagination"
|
|
||||||
:loading="loading"
|
|
||||||
row-key="key"
|
|
||||||
>
|
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
<template v-if="column.dataIndex === 'auditType'">
|
<template v-if="column.dataIndex === 'auditType'">
|
||||||
{{ record.auditType === 'SCAN' ? '扫码盘点' : '人工盘点' }}
|
{{ record.auditType === 'ALL' ? '全部盘点' : '部分盘点' }}
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'reviewResult'">
|
<template v-if="column.dataIndex === 'reviewResult'">
|
||||||
<!-- 不同状态不同颜色 -->
|
<template v-if="record.reviewResult === 'WAIT_CHECK'"> 待盘点</template>
|
||||||
<template v-if="record.reviewResult === 'WAIT_SCAN'"><span style="color: #faad14">待扫码</span></template>
|
<template v-if="record.reviewResult === 'PASS'"> 通过</template>
|
||||||
<template v-if="record.reviewResult === 'WAIT_SUBMIT'"><span style="color: #1890ff">待提交</span></template>
|
<template v-if="record.reviewResult === 'REJECT'"> 拒绝 </template>
|
||||||
<template v-if="record.reviewResult === 'WAIT_REVIEW'"><span style="color: #722ed1">待审核</span></template>
|
<template v-if="record.reviewResult === 'UN_PASS'"> 未通过</template>
|
||||||
<template v-if="record.reviewResult === 'PASS'"><span style="color: #52c41a">审核通过</span></template>
|
<template v-if="record.reviewResult === 'WAIT_AUDIT'"> 待审核</template>
|
||||||
<template v-if="record.reviewResult === 'REJECT'"><span style="color: #f5222d">退回</span></template>
|
|
||||||
</template>
|
|
||||||
<template v-if="column.dataIndex === 'operation'">
|
|
||||||
<a-button
|
|
||||||
v-if="record.reviewResult === 'WAIT_REVIEW'"
|
|
||||||
type="link"
|
|
||||||
style="margin-left: 10px"
|
|
||||||
@click="showResultModal(record.id, record.auditType, true)"
|
|
||||||
>
|
|
||||||
审核
|
|
||||||
</a-button>
|
|
||||||
<a-button
|
|
||||||
type="link"
|
|
||||||
style="margin-left: 10px"
|
|
||||||
@click="showResultModal(record.id, record.auditType, false)"
|
|
||||||
>
|
|
||||||
查看
|
|
||||||
</a-button>
|
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</a-table>
|
</a-table>
|
||||||
</div>
|
</div>
|
||||||
</page-container>
|
</page-container>
|
||||||
|
|
||||||
<!-- 审核弹窗 -->
|
|
||||||
<a-modal v-model:open="openResult" title="盘点异常数据:" width="80%" :confirm-loading="confirmLoading" @ok="submit">
|
|
||||||
<result-form v-if="auditTypeRef === 'SCAN'" :apply-id="applyIdRef" />
|
|
||||||
<vxe-table
|
|
||||||
v-if="auditTypeRef === 'MANUAL'"
|
|
||||||
v-model:data="manualData"
|
|
||||||
border
|
|
||||||
show-overflow
|
|
||||||
max-height="500"
|
|
||||||
size="medium"
|
|
||||||
>
|
|
||||||
<vxe-column type="seq" title="序号" width="60" />
|
|
||||||
<vxe-column field="id" title="物料id" :visible="false" />
|
|
||||||
<vxe-column field="name" title="物料名称" />
|
|
||||||
<vxe-column field="code" title="编码" />
|
|
||||||
<vxe-column field="spec" title="规格" />
|
|
||||||
<vxe-column field="price" title="价格" />
|
|
||||||
<vxe-column field="typeName" title="类型" />
|
|
||||||
<vxe-column field="stock" title="库存数量" />
|
|
||||||
<vxe-column field="manualStock" title="手动核实数量" />
|
|
||||||
<vxe-column field="msg" title="异常原因" />
|
|
||||||
</vxe-table>
|
|
||||||
<a-form v-if="flag" layout="vertical" style="margin-top: 20px">
|
|
||||||
<a-form-item label="审核意见">
|
|
||||||
<a-textarea v-model:value="remark" placeholder="请输入审核意见" :row="3" :maxlength="1000" />
|
|
||||||
</a-form-item>
|
|
||||||
|
|
||||||
<a-form-item label="审核结果">
|
|
||||||
<a-radio-group v-model:value="reviewResult" button-style="solid">
|
|
||||||
<a-radio-button value="PASS">审核通过</a-radio-button>
|
|
||||||
<a-radio-button value="REJECT" style="margin-left: 20px">退回重盘</a-radio-button>
|
|
||||||
</a-radio-group>
|
|
||||||
</a-form-item>
|
|
||||||
</a-form>
|
|
||||||
</a-modal>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import api from '@/api'
|
import api from '@/api';
|
||||||
import { IPage } from '@/api/api'
|
import { IPage } from '@/api/api'
|
||||||
import resultForm from '../stocktaking/result-form.vue'
|
import { useUserStore } from '@/stores/user'
|
||||||
import { Dayjs } from 'dayjs'
|
|
||||||
import { http } from '@/settings/http'
|
|
||||||
|
|
||||||
const applyIdRef = ref()
|
|
||||||
|
const searchKey = ref('')
|
||||||
const auditPage = ref<IPage<material.ApplyForm>>()
|
const auditPage = ref<IPage<material.ApplyForm>>()
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const confirmLoading = ref(false)
|
|
||||||
const reviewResult = ref<'PASS' | 'REJECT'>('PASS')
|
|
||||||
const remark = ref('')
|
|
||||||
// 搜索条件
|
|
||||||
const startDate = ref<Dayjs>()
|
|
||||||
const taker = ref('')
|
|
||||||
const status = ref<Array<'PASS' | 'REJECT' | 'WAIT_SCAN' | 'WAIT_SUBMIT' | 'WAIT_REVIEW'>>()
|
|
||||||
const auditType = ref<'SCAN' | 'MANUAL'>()
|
|
||||||
|
|
||||||
|
|
||||||
|
const userStore = useUserStore()
|
||||||
// 加载数据的方法
|
// 加载数据的方法
|
||||||
const loadData = async (page = 1, size = 10) => {
|
const loadData = async (page = 1, size = 10) => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
@ -147,60 +53,17 @@
|
|||||||
{
|
{
|
||||||
page: page,
|
page: page,
|
||||||
size: size,
|
size: size,
|
||||||
auditType: auditType.value,
|
taker: userStore.userName
|
||||||
//ISO 8601 的完整日期时间格式为:YYYY-MM-DDTHH:mm:ss,其中 T 是日期和时间之间的分隔符。
|
}, (data) => {
|
||||||
// 对于 LocalDateTime,不需要时区信息(即不包含 Z 或者 +/-HH:mm),因为 LocalDateTime 本身没有时区概念。
|
|
||||||
// 获取 ISO 8601 格式的字符串,但需要去掉 'Z' 和时区部分
|
|
||||||
createDate: startDate.value?.toISOString().replace('Z', '').slice(0, -1),
|
|
||||||
taker: taker.value,
|
|
||||||
reviewResults: status.value,
|
|
||||||
},
|
|
||||||
(data) => {
|
|
||||||
auditPage.value = data
|
auditPage.value = data
|
||||||
loading.value = false
|
loading.value = false
|
||||||
},
|
});
|
||||||
)
|
|
||||||
}
|
}
|
||||||
//初始加载
|
//初始加载
|
||||||
loadData()
|
loadData()
|
||||||
|
|
||||||
//导出数据
|
|
||||||
const downloadData = () => {
|
|
||||||
// 创建 URLSearchParams 对象
|
|
||||||
const params = new URLSearchParams()
|
|
||||||
|
|
||||||
// 动态添加参数
|
|
||||||
if (auditType.value) {
|
|
||||||
params.append('auditType', auditType.value)
|
|
||||||
}
|
|
||||||
if (startDate.value) {
|
|
||||||
// 格式化日期并移除 'Z' 和毫秒部分
|
|
||||||
const formattedDate = startDate.value.toISOString().replace('Z', '').slice(0, -4)
|
|
||||||
params.append('createDate', formattedDate)
|
|
||||||
}
|
|
||||||
if (taker.value) {
|
|
||||||
params.append('taker', taker.value)
|
|
||||||
}
|
|
||||||
if (status.value && status.value.length > 0) {
|
|
||||||
// 为数组中的每个值单独添加参数
|
|
||||||
status.value.forEach((value) => {
|
|
||||||
params.append('reviewResults', value)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 构建完整的 URL
|
|
||||||
const url = `${http.prefix}/apply/audit/download-excel?${params.toString()}`
|
|
||||||
|
|
||||||
// 打开下载链接
|
|
||||||
window.open(url)
|
|
||||||
}
|
|
||||||
//表格列
|
//表格列
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
|
||||||
title: '序号',
|
|
||||||
dataIndex: 'key',
|
|
||||||
customRender: ({ index }: { index: number }) => `${index + 1}`,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: '盘点类型',
|
title: '盘点类型',
|
||||||
dataIndex: 'auditType',
|
dataIndex: 'auditType',
|
||||||
@ -213,26 +76,32 @@
|
|||||||
title: '盘点人',
|
title: '盘点人',
|
||||||
dataIndex: 'taker',
|
dataIndex: 'taker',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '任务状态',
|
||||||
|
dataIndex: 'reviewResult',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '盘点审核人',
|
title: '盘点审核人',
|
||||||
dataIndex: 'reviewer',
|
dataIndex: 'reviewer',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '申请日期',
|
title: '创建时间',
|
||||||
dataIndex: 'applyDate',
|
dataIndex: 'createdTime',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '审核意见',
|
title: '盘点结果(系统生成)',
|
||||||
dataIndex: 'reviewRemark',
|
dataIndex: 'result',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '审核结果',
|
title: '异常原因',
|
||||||
dataIndex: 'reviewResult',
|
dataIndex: 'exception',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '处理方式',
|
||||||
dataIndex: 'operation',
|
dataIndex: 'handle',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
//分页信息
|
//分页信息
|
||||||
@ -247,49 +116,5 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// 定义一个标记,用于控制是查看还是审核 flag=true审核,flag=false查看
|
|
||||||
const flag = ref(false)
|
|
||||||
const openResult = ref<boolean>(false)
|
|
||||||
const auditTypeRef = ref<'SCAN' | 'MANUAL'>()
|
|
||||||
|
|
||||||
// 点击 审核或者查看 按钮
|
|
||||||
const showResultModal = (applyId: number, auditType: 'SCAN' | 'MANUAL', select: boolean) => {
|
|
||||||
flag.value = select
|
|
||||||
auditTypeRef.value = auditType
|
|
||||||
applyIdRef.value = applyId
|
|
||||||
openResult.value = true
|
|
||||||
if (auditType === 'MANUAL') {
|
|
||||||
getManualData(applyId)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询人工盘点数据
|
|
||||||
const manualData = ref<Array<material.ManualStockDTO>>()
|
|
||||||
const getManualData = (applyId: number) => {
|
|
||||||
api.materialApi.apply.getManualStock(applyId, (data) => {
|
|
||||||
manualData.value = data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
//提交审核结果
|
|
||||||
const submit = () => {
|
|
||||||
confirmLoading.value = true
|
|
||||||
if (!flag.value) {
|
|
||||||
confirmLoading.value = false
|
|
||||||
openResult.value = false
|
|
||||||
return
|
|
||||||
}
|
|
||||||
api.materialApi.apply.submitReview(
|
|
||||||
{
|
|
||||||
applyId: applyIdRef.value,
|
|
||||||
reviewResult: reviewResult.value,
|
|
||||||
remark: remark.value,
|
|
||||||
},
|
|
||||||
() => {
|
|
||||||
confirmLoading.value = false
|
|
||||||
openResult.value = false
|
|
||||||
loadData()
|
|
||||||
},
|
|
||||||
)
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { FormItem, FormConfig } from '@/components/form-render/form-render-types'
|
import { FormItem, FormConfig } from '@/components/form-render/form-render-types'
|
||||||
import { TreeDataNode } from 'ant-design-vue/es/vc-tree-select/interface'
|
|
||||||
|
|
||||||
export const config: FormConfig = {
|
export const config: FormConfig = {
|
||||||
layout: 'horizontal',
|
layout: 'horizontal',
|
||||||
@ -14,12 +14,9 @@ export const config: FormConfig = {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export const formItems = (
|
export const formItems = (materialOptions: Array<{ value: string | undefined, label: string | undefined }>,
|
||||||
materialOptions: Array<{ value: string | undefined; label: string | undefined }>,
|
required : Ref<boolean>,
|
||||||
required: boolean,
|
persons: Array<{ value: string | undefined, label: string | undefined }>): FormItem[] => [
|
||||||
persons: Array<{ value: string | undefined; label: string | undefined }>,
|
|
||||||
types: Array<TreeDataNode>,
|
|
||||||
): FormItem[] => [
|
|
||||||
{
|
{
|
||||||
group: 'form',
|
group: 'form',
|
||||||
type: 'radio',
|
type: 'radio',
|
||||||
@ -34,27 +31,8 @@ export const formItems = (
|
|||||||
size: 'default',
|
size: 'default',
|
||||||
optionType: 'button',
|
optionType: 'button',
|
||||||
buttonStyle: 'solid',
|
buttonStyle: 'solid',
|
||||||
defaultValue: 'SCAN',
|
defaultValue: "ALL",
|
||||||
options: [
|
options: [{ value: "ALL", label: "全部盘点" }, { value: "PARTIAL", label: "部分盘点" }]
|
||||||
{ value: 'SCAN', label: '扫码盘点' },
|
|
||||||
{ value: 'MANUAL', label: '人工盘点' },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
rules: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'tree-select',
|
|
||||||
group: 'form',
|
|
||||||
config: {
|
|
||||||
label: '物料类型选择',
|
|
||||||
name: 'types',
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
properties: {
|
|
||||||
size: 'default',
|
|
||||||
placeholder: '请选择物料类型',
|
|
||||||
multiple: true,
|
|
||||||
treeData: types,
|
|
||||||
},
|
},
|
||||||
rules: [],
|
rules: [],
|
||||||
},
|
},
|
||||||
@ -67,12 +45,11 @@ export const formItems = (
|
|||||||
hasFeedback: false,
|
hasFeedback: false,
|
||||||
label: '物料选择',
|
label: '物料选择',
|
||||||
name: 'ids',
|
name: 'ids',
|
||||||
required: true,
|
|
||||||
},
|
},
|
||||||
properties: {
|
properties: {
|
||||||
size: 'default',
|
size: 'default',
|
||||||
mode: 'multiple',
|
mode: 'multiple',
|
||||||
required: required,
|
required: required.value,
|
||||||
placeholder: '请选择物料',
|
placeholder: '请选择物料',
|
||||||
options: materialOptions,
|
options: materialOptions,
|
||||||
},
|
},
|
||||||
@ -116,5 +93,5 @@ export const formItems = (
|
|||||||
options: persons,
|
options: persons,
|
||||||
},
|
},
|
||||||
rules: [],
|
rules: [],
|
||||||
},
|
}
|
||||||
]
|
]
|
||||||
|
@ -1,84 +0,0 @@
|
|||||||
<template>
|
|
||||||
<vxe-table
|
|
||||||
ref="resulRef"
|
|
||||||
border
|
|
||||||
stripe
|
|
||||||
show-overflow
|
|
||||||
max-height="500"
|
|
||||||
:column-config="{ resizable: true }"
|
|
||||||
:data="tableData"
|
|
||||||
:keyboard-config="{ isEsc: true }"
|
|
||||||
size="medium"
|
|
||||||
empty-text="盘点数据和库存数据一致,可以直接提交审核"
|
|
||||||
:edit-config="{ trigger: 'click', mode: 'cell' }"
|
|
||||||
>
|
|
||||||
<vxe-column type="seq" title="序号" width="60"></vxe-column>
|
|
||||||
<vxe-column field="id" title="ID" :visible="false" />
|
|
||||||
<vxe-column field="materialName" title="物料名称" />
|
|
||||||
<vxe-column field="barcode" title="物料条码" />
|
|
||||||
<vxe-column field="exceptionReason" title="异常原因">
|
|
||||||
<template #default="{ row }">
|
|
||||||
<template v-if="row.exceptionReason === 'SOCK_IN_BUT_SCAN_NOT_EXIST'">库房在库状态但是扫码不存在</template>
|
|
||||||
<template v-if="row.exceptionReason === 'SOCK_OUT_BUT_SCAN_EXIST'">库房不是在库状态但是扫码存在</template>
|
|
||||||
<template v-if="row.exceptionReason === 'SOCK_NOT_EXIST_BUT_SCAN_EXIST'">库房不存在该条码但是扫码存在</template>
|
|
||||||
</template>
|
|
||||||
</vxe-column>
|
|
||||||
<vxe-column field="exceptionHandle" title="异常处理(手动选择)" :edit-render="handelEditRender"></vxe-column>
|
|
||||||
<vxe-column field="remark" title="备注说明" width="25%" :edit-render="{ name: 'textarea' }"></vxe-column>
|
|
||||||
</vxe-table>
|
|
||||||
<slot></slot>
|
|
||||||
</template>
|
|
||||||
<script setup lang="ts">
|
|
||||||
import api from '@/api'
|
|
||||||
import { toRefs } from 'vue'
|
|
||||||
import type { VxeColumnPropTypes, VxeTableInstance } from 'vxe-table'
|
|
||||||
import type { VxeSelectProps } from 'vxe-pc-ui'
|
|
||||||
|
|
||||||
// 父组件数据交互
|
|
||||||
const props = defineProps({
|
|
||||||
applyId: {
|
|
||||||
type: Number,
|
|
||||||
required: false,
|
|
||||||
default: 0,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
const resulRef = ref<VxeTableInstance<material.StocktakingScanExceptionalData>>()
|
|
||||||
const getTableData = () => {
|
|
||||||
const $table = resulRef.value
|
|
||||||
if ($table) {
|
|
||||||
return $table.getTableData().fullData.map((item) => ({
|
|
||||||
id: item.id,
|
|
||||||
exceptionHandle: item.exceptionHandle,
|
|
||||||
remark: item.remark,
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
defineExpose({ getTableData })
|
|
||||||
|
|
||||||
const { applyId } = toRefs(props)
|
|
||||||
const tableData = ref<Array<material.StocktakingScanExceptionalData>>()
|
|
||||||
const result = ref()
|
|
||||||
|
|
||||||
api.materialApi.apply.getComparisonRes(props.applyId + '', (data) => {
|
|
||||||
result.value = data
|
|
||||||
tableData.value = data.exceptionalData
|
|
||||||
})
|
|
||||||
//监听id的变化
|
|
||||||
watch(applyId, () => {
|
|
||||||
api.materialApi.apply.getComparisonRes(props.applyId + '', (data) => {
|
|
||||||
result.value = data
|
|
||||||
tableData.value = data.exceptionalData
|
|
||||||
})
|
|
||||||
})
|
|
||||||
//下拉框
|
|
||||||
const handelEditRender = ref<VxeColumnPropTypes.EditRender<undefined, VxeSelectProps>>({
|
|
||||||
name: 'VxeSelect',
|
|
||||||
options: [
|
|
||||||
{ label: '标记为丢失', value: 'MARK_LOST' },
|
|
||||||
{ label: '保持不变', value: 'MARK_KEEP' },
|
|
||||||
{ label: '标记为归还', value: 'MARK_RETURN' },
|
|
||||||
{ label: '标记为舍弃', value: 'MARK_DISCARD' },
|
|
||||||
{ label: '标记为新入库', value: 'MARK_NEW' },
|
|
||||||
],
|
|
||||||
})
|
|
||||||
</script>
|
|
79
src/views/stock/stocktaking/resultForm.vue
Normal file
79
src/views/stock/stocktaking/resultForm.vue
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
<template>
|
||||||
|
<vxe-table border stripe show-overflow ref="resulRef" max-height="500" :column-config="{ resizable: true }"
|
||||||
|
:data="tableData" :keyboard-config="{ isEsc: true }" size="medium" empty-text="盘点数据和库存数据一致,可以直接提交审核"
|
||||||
|
:edit-config="{ trigger: 'click', mode: 'cell' }">
|
||||||
|
|
||||||
|
<vxe-column type="seq" title="序号" width="60"></vxe-column>
|
||||||
|
<vxe-column field="id" title="ID" :visible="false" />
|
||||||
|
<vxe-column field="materialName" title="物料名称" />
|
||||||
|
<vxe-column field="barcode" title="物料条码" />
|
||||||
|
<vxe-column field="exceptionReason" title="异常原因">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<template v-if="row.exceptionReason === 'SOCK_IN_BUT_SCAN_NOT_EXIST'"> 库房在库状态但是扫码不存在</template>
|
||||||
|
<template v-if="row.exceptionReason === 'SOCK_OUT_BUT_SCAN_EXIST'"> 库房不是在库状态但是扫码存在</template>
|
||||||
|
<template v-if="row.exceptionReason === 'SOCK_NOT_EXIST_BUT_SCAN_EXIST'"> 库房不存在该条码但是扫码存在</template>
|
||||||
|
</template>
|
||||||
|
</vxe-column>
|
||||||
|
<vxe-column field="exceptionHandle" title="异常处理(手动选择)" :edit-render="handelEditRender"></vxe-column>
|
||||||
|
<vxe-column field="remark" title="备注说明" width="25%" :edit-render="{ name: 'textarea' }"></vxe-column>
|
||||||
|
</vxe-table>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
|
||||||
|
import api from '@/api'
|
||||||
|
import { toRefs } from 'vue';
|
||||||
|
import type { VxeColumnPropTypes,VxeTableInstance } from 'vxe-table'
|
||||||
|
import type { VxeSelectProps } from 'vxe-pc-ui'
|
||||||
|
|
||||||
|
// 父组件数据交互
|
||||||
|
const props = defineProps(
|
||||||
|
{
|
||||||
|
applyId: {
|
||||||
|
type: Number,
|
||||||
|
required: false,
|
||||||
|
default: 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
const resulRef = ref<VxeTableInstance<material.StocktakingScanExceptionalData>>()
|
||||||
|
const getTableData = () => {
|
||||||
|
const $table = resulRef.value
|
||||||
|
if ($table) {
|
||||||
|
return $table.getTableData().fullData.map(item => ({
|
||||||
|
id: item.id,
|
||||||
|
exceptionHandle: item.exceptionHandle,
|
||||||
|
remark: item.remark
|
||||||
|
}))
|
||||||
|
}}
|
||||||
|
defineExpose({getTableData});
|
||||||
|
|
||||||
|
const { applyId } = toRefs(props)
|
||||||
|
const tableData = ref<Array<material.StocktakingScanExceptionalData>>()
|
||||||
|
const result = ref()
|
||||||
|
|
||||||
|
api.materialApi.apply.getComparisonRes(props.applyId + '', (data) => {
|
||||||
|
result.value = data
|
||||||
|
tableData.value = data.exceptionalData
|
||||||
|
})
|
||||||
|
//监听id的变化
|
||||||
|
watch(applyId, () => {
|
||||||
|
api.materialApi.apply.getComparisonRes(props.applyId + '', (data) => {
|
||||||
|
result.value = data
|
||||||
|
tableData.value = data.exceptionalData
|
||||||
|
})
|
||||||
|
})
|
||||||
|
//下拉框
|
||||||
|
const handelEditRender = ref<VxeColumnPropTypes.EditRender<undefined, VxeSelectProps>>({
|
||||||
|
name: 'VxeSelect',
|
||||||
|
options: [
|
||||||
|
{ label: '入库+1', value: 'INBOUND' },
|
||||||
|
{ label: '不入库-1', value: 'OUTBOUND' },
|
||||||
|
{ label: '丢弃-1', value: 'DISCARD' },
|
||||||
|
]
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
@ -4,204 +4,140 @@
|
|||||||
<template #ops>
|
<template #ops>
|
||||||
<a-row>
|
<a-row>
|
||||||
<a-col :span="18">
|
<a-col :span="18">
|
||||||
<a-input-search
|
<a-input-search v-model:value="searchKey" :placeholder="`请输入`" allow-clear enter-button
|
||||||
v-model:value="searchKey"
|
@search="loadData()"></a-input-search>
|
||||||
:placeholder="`请输入`"
|
|
||||||
allow-clear
|
|
||||||
enter-button
|
|
||||||
@search="loadData()"
|
|
||||||
></a-input-search>
|
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="6">
|
<a-col :span="6">
|
||||||
<a-button type="primary" style="margin-left: 10px" @click="formDrawer?.show()">
|
<a-button type="primary" style="margin-left: 10px" @click="formDrawer?.show()">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<icon-font type="icon-plus" />
|
<icon-font type="icon-plus" />
|
||||||
</template>
|
</template>
|
||||||
新增盘点
|
申请扫码
|
||||||
</a-button>
|
</a-button>
|
||||||
|
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
</template>
|
</template>
|
||||||
<!-- 页面表格内容 -->
|
<!-- 页面表格内容 -->
|
||||||
<div style="min-height: calc(100vh - 305px)">
|
<div style="min-height: calc(100vh - 305px)">
|
||||||
<!-- 表格行 -->
|
<!-- 表格行 -->
|
||||||
<a-table
|
<a-table :columns="columns" :data-source="auditPage?.records" bordered :pagination="pagination" :loading="loading"
|
||||||
:columns="columns"
|
row-key="key">
|
||||||
:data-source="auditPage?.records"
|
|
||||||
bordered
|
|
||||||
:pagination="pagination"
|
|
||||||
:loading="loading"
|
|
||||||
row-key="key"
|
|
||||||
>
|
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
<template v-if="column.dataIndex === 'auditType'">
|
<template v-if="column.dataIndex === 'auditType'">
|
||||||
{{ record.auditType === 'SCAN' ? '扫码盘点' : '人工盘点' }}
|
{{ record.auditType === 'ALL' ? '全部盘点' : '部分盘点' }}
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'reviewResult'">
|
<template v-if="column.dataIndex === 'reviewResult'">
|
||||||
<template v-if="record.reviewResult === 'WAIT_SCAN'"><span style="color: #faad14">待盘点</span></template>
|
<template v-if="record.reviewResult === 'WAIT_SCAN'"> 待扫码</template>
|
||||||
<template v-if="record.reviewResult === 'WAIT_SUBMIT'"><span style="color: #1890ff">待提交</span></template>
|
<template v-if="record.reviewResult === 'WAIT_SUBMIT'"> 待提交</template>
|
||||||
<template v-if="record.reviewResult === 'WAIT_REVIEW'"><span style="color: #722ed1">待审核</span></template>
|
<template v-if="record.reviewResult === 'WAIT_REVIEW'"> 待审核 </template>
|
||||||
<template v-if="record.reviewResult === 'PASS'"><span style="color: #52c41a">审核通过</span></template>
|
<template v-if="record.reviewResult === 'PASS'"> 审核通过</template>
|
||||||
<template v-if="record.reviewResult === 'REJECT'"><span style="color: #f5222d">退回</span></template>
|
<template v-if="record.reviewResult === 'REJECT'"> 退回</template>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'operation'">
|
<template v-if="column.dataIndex === 'operation'">
|
||||||
<a-button
|
<a-button type="link" @click="showModal(record.id)" v-if="record.reviewResult === 'WAIT_SCAN'
|
||||||
v-if="record.reviewResult === 'WAIT_SCAN' || record.reviewResult === 'REJECT'"
|
|| record.reviewResult === 'REJECT'">
|
||||||
type="link"
|
|
||||||
@click="showModal(record.id, record.auditType)"
|
|
||||||
>
|
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<icon-font type="icon-edit" />
|
<icon-font type="icon-edit" />
|
||||||
</template>
|
</template>
|
||||||
开始盘点
|
开始扫码
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-button
|
<a-button type="link" style="margin-left: 10px" @click="showResultModal(record.id)"
|
||||||
v-if="record.reviewResult === 'WAIT_SUBMIT'"
|
v-if="record.reviewResult === 'WAIT_SUBMIT' || record.reviewResult === 'WAIT_SCAN'">
|
||||||
type="link"
|
|
||||||
style="margin-left: 10px"
|
|
||||||
@click="showResultModal(record.id)"
|
|
||||||
>
|
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<icon-font type="icon-plus" />
|
<icon-font type="icon-plus" />
|
||||||
</template>
|
</template>
|
||||||
生成结果
|
生成结果
|
||||||
</a-button>
|
</a-button>
|
||||||
|
<a-button type="link" style="margin-left: 10px" v-if="record.reviewResult === 'WAIT_REVIEW'">
|
||||||
|
<template #icon>
|
||||||
|
<icon-font type="icon-plus" />
|
||||||
|
</template>
|
||||||
|
审核
|
||||||
|
</a-button>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</a-table>
|
</a-table>
|
||||||
</div>
|
</div>
|
||||||
</page-container>
|
</page-container>
|
||||||
|
|
||||||
<!-- 新增申请抽屉 -->
|
<!-- 新增申请抽屉 -->
|
||||||
<form-drawer
|
<form-drawer ref="formDrawer" v-model="applyForm" :form-items="items" :config="formConfig"
|
||||||
ref="formDrawer"
|
:disabled-fields=disabledFields @ok="doSave" title="扫码盘点" />
|
||||||
v-model="applyForm"
|
|
||||||
:form-items="items"
|
|
||||||
:config="formConfig"
|
|
||||||
title="扫码盘点"
|
|
||||||
@ok="doSave"
|
|
||||||
/>
|
|
||||||
<!-- 盘点作业弹窗 -->
|
<!-- 盘点作业弹窗 -->
|
||||||
<a-modal
|
<a-modal v-model:open="open" title="盘点作业" width="100%" wrap-class-name="full-modal" @ok="handleOk"
|
||||||
v-model:open="open"
|
:confirm-loading="confirmLoading">
|
||||||
title="盘点作业"
|
<scan-form ref="scanFormRef" :apply-id="applyIdRef" :total-value="88"></scan-form>
|
||||||
width="100%"
|
|
||||||
wrap-class-name="full-modal"
|
|
||||||
:confirm-loading="confirmLoading"
|
|
||||||
@ok="handleOk"
|
|
||||||
@cancel="cancel"
|
|
||||||
>
|
|
||||||
<scan-form ref="scanFormRef" :apply-id="applyIdRef" :total-value="totalValue">
|
|
||||||
<p>
|
|
||||||
{{ msg }}
|
|
||||||
</p>
|
|
||||||
</scan-form>
|
|
||||||
</a-modal>
|
</a-modal>
|
||||||
<!-- 盘点结果弹窗 -->
|
<!-- 盘点结果弹窗 -->
|
||||||
<a-modal
|
<a-modal v-model:open="openResult" title="盘点异常数据:" okText= "提交审核" @ok="submitHandle" width="80%" :confirm-loading="confirmLoading">
|
||||||
v-model:open="openResult"
|
|
||||||
title="盘点异常数据:"
|
|
||||||
ok-text="提交审核"
|
|
||||||
width="80%"
|
|
||||||
:confirm-loading="confirmLoading"
|
|
||||||
@ok="submitHandle"
|
|
||||||
>
|
|
||||||
<result-form ref="handleResultRef" :apply-id="applyIdRef"></result-form>
|
<result-form ref="handleResultRef" :apply-id="applyIdRef"></result-form>
|
||||||
</a-modal>
|
</a-modal>
|
||||||
<!-- 手动盘点弹窗 -->
|
|
||||||
<a-modal v-model:open="openManual" title="手动盘点" width="80%" :confirm-loading="confirmLoading" @ok="manualHandle">
|
|
||||||
<manual-form ref="manualFormRef" :apply-id="applyIdRef"></manual-form>
|
|
||||||
</a-modal>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import api from '@/api'
|
import api from '@/api';
|
||||||
import { IPage } from '@/api/api'
|
import { IPage } from '@/api/api'
|
||||||
import FormDrawer from '@/components/form-render/form-drawer.vue'
|
import FormDrawer from '@/components/form-render/form-drawer.vue'
|
||||||
import { config, formItems } from './form'
|
import { config, formItems } from './form'
|
||||||
import { notification } from 'ant-design-vue'
|
import { notification } from 'ant-design-vue'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs';
|
||||||
import { useUserStore } from '@/stores/user'
|
import { useUserStore } from '@/stores/user'
|
||||||
import scanForm from '../component/scan-form.vue'
|
import scanForm from '../component/scanForm.vue'
|
||||||
import resultForm from './result-form.vue'
|
import resultForm from '../stocktaking/resultForm.vue'
|
||||||
import { TreeDataNode } from 'ant-design-vue/es/vc-tree-select/interface'
|
|
||||||
import manualForm from '../component/manual-form.vue'
|
|
||||||
|
|
||||||
const searchKey = ref('')
|
const searchKey = ref('')
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
const scanFormRef = ref() // 盘点作业弹窗组件
|
const scanFormRef = ref(); // 盘点作业弹窗组件
|
||||||
const handleResultRef = ref() // 盘点结果弹窗组件
|
const handleResultRef = ref(); // 盘点结果弹窗组件
|
||||||
const confirmLoading = ref(false) // 盘点作业弹窗提交按钮loading
|
const confirmLoading = ref(false) // 盘点作业弹窗提交按钮loading
|
||||||
const manualFormRef = ref() // 手动盘点弹窗组件
|
|
||||||
// 新增申请表单对象
|
// 新增申请表单对象
|
||||||
const applyForm = ref<Partial<material.AuditApplyInfo>>({
|
const applyForm = ref<Partial<material.AuditApplyInfo>>({
|
||||||
auditType: 'SCAN',
|
auditType: 'ALL',
|
||||||
applicant: userStore.fullName,
|
applicant: userStore.userName,
|
||||||
type: 'AUDIT',
|
type: 'AUDIT',
|
||||||
applyDate: dayjs() + '',
|
applyDate: dayjs() + '',
|
||||||
confirm: false,
|
isConfirm: false,
|
||||||
reviewResult: 'WAIT_SCAN',
|
reviewResult: 'WAIT_SCAN'
|
||||||
types: [],
|
|
||||||
})
|
})
|
||||||
const msg = ref()
|
|
||||||
const totalValue = ref(0) // 盘点总值
|
|
||||||
|
|
||||||
//列表数据
|
//列表数据
|
||||||
const auditPage = ref<IPage<material.ApplyForm>>()
|
const auditPage = ref<IPage<material.ApplyForm>>()
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
|
|
||||||
//新增申请的下拉框选择对象
|
//新增申请的下拉框选择对象
|
||||||
const materialList = ref<Array<{ value: string | undefined; label: string | undefined }>>([])
|
const materialList = ref<Array<{ value: string | undefined, label: string | undefined }>>([])
|
||||||
const personList = ref<Array<{ value: string | undefined; label: string | undefined }>>([])
|
const personList = ref<Array<{ value: string | undefined, label: string | undefined }>>([])
|
||||||
const required = ref(true)
|
const required = ref(false)
|
||||||
api.aclApi.user.all((data) => {
|
api.materialApi.material.all((data) => {
|
||||||
personList.value = data.map((item) => {
|
materialList.value = data.map(item => {
|
||||||
return {
|
|
||||||
value: item?.fullName,
|
|
||||||
label: item?.fullName,
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
// //是否必填
|
|
||||||
// const disabledFields = computed(() => {
|
|
||||||
// return applyForm.value?.auditType === 'ALL' ? ['ids'] : []
|
|
||||||
// })
|
|
||||||
|
|
||||||
// 监听选择类型后查询物料
|
|
||||||
watch(
|
|
||||||
applyForm,
|
|
||||||
() => {
|
|
||||||
if (applyForm.value && applyForm.value.types && applyForm.value.types.length > 0) {
|
|
||||||
api.materialApi.material.all({ type: applyForm.value.types.join(',') }, (data) => {
|
|
||||||
materialList.value = data.map((item) => {
|
|
||||||
return {
|
return {
|
||||||
value: item?.id + '',
|
value: item?.id + '',
|
||||||
label: item?.name + '(' + item.spec + ')',
|
label: item?.name
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
api.aclApi.user.all((data) => {
|
||||||
|
personList.value = data.map(item => {
|
||||||
|
return {
|
||||||
|
value: item?.name,
|
||||||
|
label: item?.fullName
|
||||||
}
|
}
|
||||||
},
|
})
|
||||||
{
|
})
|
||||||
immediate: true,
|
|
||||||
deep: true,
|
|
||||||
},
|
|
||||||
)
|
|
||||||
|
|
||||||
// 物料类型树
|
//是否必填
|
||||||
const types = ref<Array<TreeDataNode>>([])
|
const disabledFields = computed(() => {
|
||||||
api.materialApi.type.trees((data) => {
|
if (applyForm.value?.auditType !== 'ALL') {
|
||||||
types.value = children(data)
|
required.value = true
|
||||||
})
|
|
||||||
const children = (res: Array<material.TypeTree>): Array<TreeDataNode> => {
|
|
||||||
return res.map((areaTree) => ({
|
|
||||||
label: areaTree.label,
|
|
||||||
value: areaTree.value,
|
|
||||||
children: areaTree.children ? children(areaTree.children) : [],
|
|
||||||
key: areaTree.value,
|
|
||||||
}))
|
|
||||||
}
|
}
|
||||||
|
return applyForm.value?.auditType === 'ALL' ? ['materials'] : []
|
||||||
|
})
|
||||||
|
|
||||||
//抽屉组件
|
//抽屉组件
|
||||||
const formDrawer = ref<typeof FormDrawer>()
|
const formDrawer = ref<typeof FormDrawer>()
|
||||||
@ -210,8 +146,7 @@
|
|||||||
})
|
})
|
||||||
//表单配置
|
//表单配置
|
||||||
const items = computed(() => {
|
const items = computed(() => {
|
||||||
//required 参数未生效
|
return formItems(materialList.value, required, personList.value)
|
||||||
return formItems(materialList.value, required.value, personList.value, types.value)
|
|
||||||
})
|
})
|
||||||
// 加载数据的方法
|
// 加载数据的方法
|
||||||
const loadData = async (page = 1, size = 10) => {
|
const loadData = async (page = 1, size = 10) => {
|
||||||
@ -220,13 +155,11 @@
|
|||||||
{
|
{
|
||||||
page: page,
|
page: page,
|
||||||
size: size,
|
size: size,
|
||||||
reviewResults: ['WAIT_SUBMIT', 'WAIT_SCAN', 'WAIT_REVIEW', 'REJECT'],
|
reviewResults: ['WAIT_SUBMIT', 'WAIT_SCAN', 'WAIT_REVIEW', 'PASS'],
|
||||||
},
|
}, (data) => {
|
||||||
(data) => {
|
|
||||||
auditPage.value = data
|
auditPage.value = data
|
||||||
loading.value = false
|
loading.value = false
|
||||||
},
|
});
|
||||||
)
|
|
||||||
}
|
}
|
||||||
//初始加载
|
//初始加载
|
||||||
loadData()
|
loadData()
|
||||||
@ -234,9 +167,8 @@
|
|||||||
//表格列
|
//表格列
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
title: '序号',
|
title: '申请ID',
|
||||||
dataIndex: 'key',
|
dataIndex: 'id',
|
||||||
customRender: ({ index }: { index: number }) => `${index + 1}`,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '盘点类型',
|
title: '盘点类型',
|
||||||
@ -254,10 +186,6 @@
|
|||||||
title: '任务状态',
|
title: '任务状态',
|
||||||
dataIndex: 'reviewResult',
|
dataIndex: 'reviewResult',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: '审核意见',
|
|
||||||
dataIndex: 'reviewRemark',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: '盘点审核人',
|
title: '盘点审核人',
|
||||||
dataIndex: 'reviewer',
|
dataIndex: 'reviewer',
|
||||||
@ -270,7 +198,8 @@
|
|||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
dataIndex: 'operation',
|
dataIndex: 'operation',
|
||||||
},
|
width: 400,
|
||||||
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
//分页信息
|
//分页信息
|
||||||
@ -297,88 +226,59 @@
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 盘点作业弹窗相关
|
// 盘点作业弹窗相关
|
||||||
const open = ref<boolean>(false)
|
const open = ref<boolean>(false);
|
||||||
const applyIdRef = ref()
|
const applyIdRef = ref();
|
||||||
const showModal = (applyId: number, auditType: string) => {
|
const showModal = (applyId: number) => {
|
||||||
if (auditType === 'SCAN') {
|
open.value = true;
|
||||||
showScanModal(applyId)
|
applyIdRef.value = applyId;
|
||||||
} else {
|
|
||||||
showManualModal(applyId)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 人工盘点
|
|
||||||
const openManual = ref<boolean>(false)
|
|
||||||
const showManualModal = (applyId: number) => {
|
|
||||||
applyIdRef.value = applyId
|
|
||||||
openManual.value = true
|
|
||||||
}
|
|
||||||
const manualHandle = () => {
|
|
||||||
//提交数据
|
|
||||||
if (manualFormRef.value) {
|
|
||||||
const res: Array<material.ManualStockDetail> = manualFormRef.value.getTableData()
|
|
||||||
api.materialApi.apply.submitManualStock(res, () => {
|
|
||||||
openManual.value = false
|
|
||||||
loadData(1)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 扫码弹窗
|
|
||||||
const showScanModal = (applyId: number) => {
|
|
||||||
open.value = true
|
|
||||||
applyIdRef.value = applyId
|
|
||||||
let m = '需要扫码的物料: '
|
|
||||||
//请求获取数据
|
|
||||||
api.materialApi.apply.getWaitScanData(applyId, (data) => {
|
|
||||||
const m = `需要扫码的物料: ${data.map((item) => item.materialName).join(', ') || '无'}`
|
|
||||||
data.forEach((item) => (totalValue.value += item.count || 0))
|
|
||||||
msg.value = m
|
|
||||||
})
|
|
||||||
msg.value = m
|
|
||||||
}
|
|
||||||
|
|
||||||
|
};
|
||||||
// 盘点作业提交数据
|
// 盘点作业提交数据
|
||||||
|
|
||||||
|
|
||||||
//关闭弹窗 提交数据
|
//关闭弹窗 提交数据
|
||||||
const handleOk = () => {
|
const handleOk = () => {
|
||||||
confirmLoading.value = true
|
confirmLoading.value = true;
|
||||||
if (scanFormRef.value) {
|
if (scanFormRef.value) {
|
||||||
const data = scanFormRef.value.getApplyData()
|
const data = scanFormRef.value.getApplyData();
|
||||||
api.materialApi.apply.saveScanData(applyIdRef.value, data, () => {
|
api.materialApi.apply.saveScanData(applyIdRef.value, data, () => {
|
||||||
open.value = false
|
open.value = false;
|
||||||
confirmLoading.value = false
|
confirmLoading.value = false;
|
||||||
loadData(1)
|
loadData(1)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// 关闭弹窗事件
|
};
|
||||||
const cancel = () => {
|
|
||||||
totalValue.value = 0
|
|
||||||
msg.value = ''
|
|
||||||
}
|
|
||||||
|
|
||||||
// 盘点结果弹窗相关
|
// 盘点结果弹窗相关
|
||||||
const openResult = ref<boolean>(false)
|
const openResult = ref<boolean>(false);
|
||||||
const showResultModal = (applyId: number) => {
|
const showResultModal = (applyId: number) => {
|
||||||
window.console.log('点击传参' + applyId)
|
window.console.log("点击传参" + applyId);
|
||||||
openResult.value = true
|
openResult.value = true;
|
||||||
applyIdRef.value = applyId
|
applyIdRef.value = applyId;
|
||||||
}
|
};
|
||||||
|
|
||||||
// 盘点结果提交数据
|
// 盘点结果提交数据
|
||||||
const submitHandle = () => {
|
const submitHandle = () => {
|
||||||
confirmLoading.value = true
|
confirmLoading.value = true;
|
||||||
const handleData = handleResultRef.value.getTableData()
|
const handleData =handleResultRef.value.getTableData();
|
||||||
api.materialApi.apply.updateReviewResult(applyIdRef.value, handleData, () => {
|
api.materialApi.apply.updateReviewResult(applyIdRef.value, handleData, () => {
|
||||||
openResult.value = false
|
openResult.value = false;
|
||||||
loadData(1)
|
loadData(1)
|
||||||
})
|
});
|
||||||
confirmLoading.value = false
|
confirmLoading.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
|
@ -1,101 +0,0 @@
|
|||||||
import { Codebook } from '@/api/api'
|
|
||||||
import { FormItem, FormConfig } from '@/components/form-render/form-render-types'
|
|
||||||
|
|
||||||
export const config: FormConfig = {
|
|
||||||
layout: 'horizontal',
|
|
||||||
colon: true,
|
|
||||||
hideRequiredMark: false,
|
|
||||||
labelAlign: 'right',
|
|
||||||
scrollToFirstError: false,
|
|
||||||
validateOnRuleChange: true,
|
|
||||||
labelCol: {
|
|
||||||
span: 4,
|
|
||||||
offset: 0,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
export const formItems = (levels: Codebook[]): FormItem[] => [
|
|
||||||
{
|
|
||||||
group: 'form',
|
|
||||||
type: 'input',
|
|
||||||
config: {
|
|
||||||
autoLink: true,
|
|
||||||
hasFeedback: false,
|
|
||||||
label: '类型编码',
|
|
||||||
name: 'no',
|
|
||||||
required: true,
|
|
||||||
help: '格式:一级编码两位组成,00-99取值,只要保证唯一即可;二级编码,四位组成,父级的两位+00-99取值,只要保证唯一即可;',
|
|
||||||
},
|
|
||||||
properties: {
|
|
||||||
size: 'default',
|
|
||||||
type: 'text',
|
|
||||||
allowClear: true,
|
|
||||||
bordered: true,
|
|
||||||
showCount: true,
|
|
||||||
},
|
|
||||||
rules: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
group: 'form',
|
|
||||||
type: 'input',
|
|
||||||
config: {
|
|
||||||
autoLink: true,
|
|
||||||
hasFeedback: false,
|
|
||||||
label: '上级编码',
|
|
||||||
name: 'parentNo',
|
|
||||||
},
|
|
||||||
properties: {
|
|
||||||
size: 'default',
|
|
||||||
type: 'text',
|
|
||||||
allowClear: true,
|
|
||||||
bordered: true,
|
|
||||||
showCount: true,
|
|
||||||
},
|
|
||||||
rules: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'select',
|
|
||||||
group: 'form',
|
|
||||||
config: {
|
|
||||||
autoLink: true,
|
|
||||||
hasFeedback: false,
|
|
||||||
label: '类型级别',
|
|
||||||
name: 'level',
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
properties: {
|
|
||||||
size: 'default',
|
|
||||||
allowClear: false,
|
|
||||||
autoClearSearchValue: true,
|
|
||||||
autofocus: false,
|
|
||||||
bordered: true,
|
|
||||||
defaultActiveFirstOption: true,
|
|
||||||
dropdownMatchSelectWidth: true,
|
|
||||||
labelInValue: false,
|
|
||||||
showSearch: false,
|
|
||||||
options: levels.map((item) => {
|
|
||||||
return { value: item.name, label: item.description }
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
rules: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
group: 'form',
|
|
||||||
type: 'input',
|
|
||||||
config: {
|
|
||||||
autoLink: true,
|
|
||||||
hasFeedback: false,
|
|
||||||
label: '类型名称',
|
|
||||||
name: 'name',
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
properties: {
|
|
||||||
size: 'default',
|
|
||||||
type: 'text',
|
|
||||||
allowClear: true,
|
|
||||||
bordered: true,
|
|
||||||
showCount: true,
|
|
||||||
},
|
|
||||||
rules: [],
|
|
||||||
},
|
|
||||||
]
|
|
@ -1,179 +0,0 @@
|
|||||||
<template>
|
|
||||||
<page-container sub-title="物料类型管理">
|
|
||||||
<template #ops>
|
|
||||||
<a-row>
|
|
||||||
<a-col :span="16">
|
|
||||||
<a-input-search
|
|
||||||
v-model:value="searchKey"
|
|
||||||
placeholder="搜索物料"
|
|
||||||
enter-button
|
|
||||||
@search="loadData()"
|
|
||||||
></a-input-search>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="8">
|
|
||||||
<a-button type="primary" @click="addOrEdit()">
|
|
||||||
<template #icon>
|
|
||||||
<icon-font type="icon-plus"></icon-font>
|
|
||||||
</template>
|
|
||||||
添加
|
|
||||||
</a-button>
|
|
||||||
</a-col>
|
|
||||||
</a-row>
|
|
||||||
</template>
|
|
||||||
<div style="min-height: calc(100vh - 218px)">
|
|
||||||
<vxe-table
|
|
||||||
ref="xTree"
|
|
||||||
border
|
|
||||||
show-overflow
|
|
||||||
size="medium"
|
|
||||||
:loading="loading"
|
|
||||||
height="600"
|
|
||||||
:column-config="{ resizable: true }"
|
|
||||||
:scroll-y="{ enabled: true, gt: 0 }"
|
|
||||||
:expand-config="{
|
|
||||||
expandAll: true,
|
|
||||||
}"
|
|
||||||
:tree-config="{
|
|
||||||
iconOpen: 'vxe-icon-square-minus',
|
|
||||||
iconClose: 'vxe-icon-square-plus',
|
|
||||||
transform: true,
|
|
||||||
rowField: 'no',
|
|
||||||
parentField: 'parentNo',
|
|
||||||
expandAll: true,
|
|
||||||
line: true,
|
|
||||||
}"
|
|
||||||
:data="areas"
|
|
||||||
>
|
|
||||||
<vxe-column field="name" title="类型" tree-node></vxe-column>
|
|
||||||
<vxe-column field="no" title="类型编码"></vxe-column>
|
|
||||||
<vxe-column field="levelInfo.description" title="类型级别"></vxe-column>
|
|
||||||
<vxe-column field="parentNo" title="上级类型编码"></vxe-column>
|
|
||||||
<vxe-column field="ops" title="操作" width="350">
|
|
||||||
<template #default="{ row }">
|
|
||||||
<a-button type="link" @click="addOrEdit({ parentNo: row.no })">
|
|
||||||
<template #icon>
|
|
||||||
<icon-font type="icon-children" />
|
|
||||||
</template>
|
|
||||||
添加子级
|
|
||||||
</a-button>
|
|
||||||
<a-button type="link" style="margin-left: 10px" @click="addOrEdit(row)">
|
|
||||||
<template #icon>
|
|
||||||
<icon-font type="icon-edit" />
|
|
||||||
</template>
|
|
||||||
编辑
|
|
||||||
</a-button>
|
|
||||||
<a-popconfirm :title="$t('确定要删除地区', { name: row.name })" @confirm="deleteArea(row.id)">
|
|
||||||
<a-button type="link" danger style="margin-left: 10px">
|
|
||||||
<template #icon>
|
|
||||||
<icon-font type="icon-delete" />
|
|
||||||
</template>
|
|
||||||
删除
|
|
||||||
</a-button>
|
|
||||||
</a-popconfirm>
|
|
||||||
</template>
|
|
||||||
</vxe-column>
|
|
||||||
</vxe-table>
|
|
||||||
</div>
|
|
||||||
</page-container>
|
|
||||||
|
|
||||||
<form-drawer
|
|
||||||
ref="formDrawer"
|
|
||||||
v-model="area"
|
|
||||||
:form-items="items"
|
|
||||||
:config="formConfig"
|
|
||||||
:title="modalTitle"
|
|
||||||
:disabled-fields="disabledFields"
|
|
||||||
:hidden-fields="hiddenFields"
|
|
||||||
@ok="doSave"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" setup>
|
|
||||||
import api from '@/api'
|
|
||||||
import { config, formItems } from './form'
|
|
||||||
import FormDrawer from '@/components/form-render/form-drawer.vue'
|
|
||||||
import { notification } from 'ant-design-vue'
|
|
||||||
import { Codebook } from '@/api/api'
|
|
||||||
import { FormDataType } from '@/components/form-render/form-render-types'
|
|
||||||
|
|
||||||
const areas = ref<Array<material.Type>>([])
|
|
||||||
const loading = ref(false)
|
|
||||||
const searchKey = ref('')
|
|
||||||
const area = ref<Partial<material.Type>>({})
|
|
||||||
const levels = ref<Codebook[]>([])
|
|
||||||
api.materialApi.type.levels((data) => {
|
|
||||||
levels.value = data
|
|
||||||
})
|
|
||||||
//表单
|
|
||||||
const formDrawer = ref<typeof FormDrawer>()
|
|
||||||
|
|
||||||
const formConfig = computed(() => {
|
|
||||||
return config
|
|
||||||
})
|
|
||||||
//表单配置
|
|
||||||
const items = computed(() => {
|
|
||||||
return formItems(levels.value)
|
|
||||||
})
|
|
||||||
//表单不可用字段
|
|
||||||
const disabledFields = computed(() => {
|
|
||||||
const no = area.value && area.value.id ? 'no' : ''
|
|
||||||
const parentNo = area.value && area.value.parentNo ? 'parentNo' : ''
|
|
||||||
return [no, parentNo]
|
|
||||||
})
|
|
||||||
//表单隐藏字段
|
|
||||||
const hiddenFields = computed(() => {
|
|
||||||
return area.value && area.value.parentNo ? [] : ['parentNo']
|
|
||||||
})
|
|
||||||
|
|
||||||
//弹窗标题
|
|
||||||
const modalTitle = computed(() => {
|
|
||||||
return area.value.id ? '编辑物料类型' : '添加物料类型'
|
|
||||||
})
|
|
||||||
|
|
||||||
// 加载数据
|
|
||||||
const loadData = () => {
|
|
||||||
loading.value = true
|
|
||||||
api.materialApi.type.areas(
|
|
||||||
{
|
|
||||||
key: searchKey.value,
|
|
||||||
},
|
|
||||||
(data) => {
|
|
||||||
areas.value = data
|
|
||||||
loading.value = false
|
|
||||||
},
|
|
||||||
)
|
|
||||||
}
|
|
||||||
loadData()
|
|
||||||
|
|
||||||
// 新增或编辑
|
|
||||||
const addOrEdit = (u?: Record<string, unknown>) => {
|
|
||||||
area.value = { ...u }
|
|
||||||
formDrawer.value?.show()
|
|
||||||
}
|
|
||||||
|
|
||||||
// 抽屉保存
|
|
||||||
const doSave = (_data: FormDataType) => {
|
|
||||||
api.materialApi.type.addAndModify(_data as unknown as material.Type, () => {
|
|
||||||
formDrawer.value?.close()
|
|
||||||
notification.success({
|
|
||||||
message: '操作成功',
|
|
||||||
description: '新增保存成功,页面将自动刷新!',
|
|
||||||
onClose: () => {
|
|
||||||
loadData()
|
|
||||||
},
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// 删除
|
|
||||||
const deleteArea = (id: number) => {
|
|
||||||
api.materialApi.type.deleteArea(id, () => {
|
|
||||||
notification.success({
|
|
||||||
message: '操作成功',
|
|
||||||
description: '删除成功,页面将自动刷新!',
|
|
||||||
onClose: () => {
|
|
||||||
loadData()
|
|
||||||
},
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
</script>
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -59,8 +59,8 @@ export default defineConfig(({ mode }) => {
|
|||||||
open: true,
|
open: true,
|
||||||
proxy: {
|
proxy: {
|
||||||
'/api': {
|
'/api': {
|
||||||
// target: 'https://ims.riemann.tech/api/',
|
// target: 'https://iot.riemann.tech/api/',
|
||||||
target: 'http://127.0.0.1:8888',
|
target: 'http://127.0.0.1:7777',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
rewrite: (path) => path.replace(/^\/api/, ''),
|
rewrite: (path) => path.replace(/^\/api/, ''),
|
||||||
},
|
},
|
||||||
|
93
vite.config.ts.timestamp-1733280057567-72270187d6e8b.mjs
Normal file
93
vite.config.ts.timestamp-1733280057567-72270187d6e8b.mjs
Normal file
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user