sparkles: 要加物料类型筛选
All checks were successful
Release / lint (push) Successful in 50s
Release / Release (push) Successful in 2m0s

This commit is contained in:
my_ong 2025-03-23 10:10:29 +08:00
parent fab443b8a0
commit 04afb056c3
9 changed files with 304 additions and 32 deletions

BIN
dist.zip

Binary file not shown.

View File

@ -3534,6 +3534,170 @@
}
]
},
{
"description": "导出盘点申请单列表",
"name": "downloadAuditExcel",
"method": "get",
"path": "/apply/audit/download-excel",
"response": {
"typeArgs": [],
"typeName": "",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": [
{
"description": "盘点类型",
"required": false,
"in": "query",
"name": "auditType",
"dataType": {
"typeArgs": [],
"typeName": "",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": ["'SCAN'", "'MANUAL'"],
"typeProperties": []
}
},
{
"description": "盘点人",
"required": false,
"in": "query",
"name": "taker",
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"description": "创建日期",
"required": false,
"in": "query",
"name": "createDate",
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"description": "审核状态",
"required": false,
"in": "query",
"name": "reviewResults",
"dataType": {
"typeArgs": [
{
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": ["'WAIT_SCAN'", "'WAIT_SUBMIT'", "'WAIT_REVIEW'", "'PASS'", "'REJECT'"],
"typeProperties": []
}
],
"typeName": "Array",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
}
]
},
{
"description": "导出申请单列表",
"name": "downloadExcel_1",
"method": "get",
"path": "/apply/download-excel",
"response": {
"typeArgs": [],
"typeName": "",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": [
{
"description": "申请类型(1入库 3出库 4盘点)",
"required": true,
"in": "query",
"name": "applyType",
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"description": "物料类型",
"required": false,
"in": "query",
"name": "type",
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"description": "物料编码",
"required": false,
"in": "query",
"name": "code",
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"description": "物料名称",
"required": false,
"in": "query",
"name": "name",
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
}
]
},
{
"description": "查询申请单详情",
"name": "detail_1",
@ -4146,7 +4310,7 @@
"name": "type",
"dataType": {
"typeArgs": [],
"typeName": "number",
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
@ -4401,7 +4565,7 @@
"name": "type",
"dataType": {
"typeArgs": [],
"typeName": "number",
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",

View File

@ -0,0 +1,32 @@
/**
* @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))
}

View File

@ -0,0 +1,32 @@
/**
* @desc
*/
import { defaultSuccess, defaultError, http } from '@/plugins/axios'
import type { AxiosResponse } from 'axios'
export interface Params {
/** 申请类型(1入库 3出库 4盘点) */
applyType: number
/** 物料类型 */
type?: string
/** 物料编码 */
code?: string
/** 物料名称 */
name?: 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))
}

View File

@ -4,6 +4,8 @@
*/
import searchPage from './searchPage'
import saveApply from './saveApply'
import downloadAuditExcel from './downloadAuditExcel'
import downloadExcel from './downloadExcel'
import detail from './detail'
import searchAuditPage from './searchAuditPage'
import auditApply from './auditApply'
@ -20,6 +22,8 @@ import getWaitScanData from './getWaitScanData'
export default {
searchPage,
saveApply,
downloadAuditExcel,
downloadExcel,
detail,
searchAuditPage,
auditApply,

View File

@ -5,7 +5,7 @@ import { defaultSuccess, defaultError, http } from '@/plugins/axios'
import type { AxiosResponse } from 'axios'
export interface Params {
/** 类型 */
type?: number
type?: string
/** 搜索关键词 */
key?: string
}

View File

@ -1,33 +1,33 @@
/**
* @desc
*/
import { defaultSuccess, defaultError, http } from '@/plugins/axios';
import type { AxiosResponse } from 'axios';
import type { IPage } from '@/api/api';
import { defaultSuccess, defaultError, http } from '@/plugins/axios'
import type { AxiosResponse } from 'axios'
import type { IPage } from '@/api/api'
export interface Params {
/** 页码 */
page?: number;
/** 页面大小 */
size?: number;
/** 类型 */
type?: number;
/** 搜索关键词 */
key?: string;
/** 页码 */
page?: number
/** 页面大小 */
size?: number
/** 类型 */
type?: string
/** 搜索关键词 */
key?: string
}
export default async function (
params: Params,
success: (data: IPage<material.Material>) => void = defaultSuccess,
fail: (error: { code: string; error?: string }) => void = defaultError,
params: Params,
success: (data: IPage<material.Material>) => void = defaultSuccess,
fail: (error: { code: string; error?: string }) => void = defaultError,
): Promise<void> {
return http({
method: 'get',
url: `/materials`,
return http({
method: 'get',
url: `/materials`,
params,
})
.then((data: AxiosResponse<IPage<material.Material>, unknown>) => {
success(data.data);
})
.catch((error: { code: string; error?: string }) => fail(error));
params,
})
.then((data: AxiosResponse<IPage<material.Material>, unknown>) => {
success(data.data)
})
.catch((error: { code: string; error?: string }) => fail(error))
}

View File

@ -186,7 +186,7 @@
const tableData = ref<Array<RowVO>>([])
//
const typeVal = ref('')
const typeVal = ref<string>()
const options = ref<{ label: string; value: number }[]>([])
const materialList = ref<material.Material[]>([])
const getMaterialList = async () => {

View File

@ -2,15 +2,30 @@
<page-container>
<!-- 页面操作栏 -->
<template #ops>
<a-row>
<a-col :span="18">
<a-row style="width: 600px">
<a-col :span="8">
<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
v-model:value="searchKey"
placeholder="名称/编码/类型"
placeholder="名称/编码"
allow-clear
enter-button
width="100%"
@search="loadData()"
></a-input-search>
</a-col>
<a-col :span="8">
<a-button type="primary" @click="downloadData()">导出</a-button>
</a-col>
</a-row>
@ -42,17 +57,24 @@
import api from '@/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 materialPage = ref<IPage<material.Material>>()
const loading = ref(false)
const typeVal = ref<string>() //
//
const loadData = async (page = 1, size = 10) => {
loading.value = true
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) => {
loading.value = false
materialPage.value = data
@ -65,7 +87,7 @@
//
const downloadData = () => {
// excel
const url = `${http.prefix}/material/download-excel?key=${searchKey.value}`
const url = `${http.prefix}/material/download-excel?key=${searchKey.value}&type=${typeVal.value}`
window.open(url)
}
@ -97,6 +119,10 @@
title: '是否赋码',
dataIndex: 'assignRule',
},
{
title: '价格',
dataIndex: 'price',
},
{
title: '库存数量',
dataIndex: 'stock',
@ -119,4 +145,18 @@
},
}
})
//
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>