Compare commits

..

No commits in common. "master" and "v2.6.1" have entirely different histories.

551 changed files with 4780 additions and 41494 deletions

1
.gitignore vendored
View File

@ -49,4 +49,3 @@ vite.config.ts.*
*.sln
*.sw?
.history
.cursor

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 31 KiB

View File

@ -21,8 +21,7 @@
// CSS
"vunguyentuan.vscode-css-variables",
// package.json PNPM catalog
"antfu.pnpm-catalog-lens",
"augment.vscode-augment"
"antfu.pnpm-catalog-lens"
],
"unwantedRecommendations": [
// volar

View File

@ -41,24 +41,24 @@
| 框架 | 说明 | 版本 |
| --- | --- | --- |
| [Vue](https://staging-cn.vuejs.org/) | vue框架 | 3.5.17 |
| [Vite](https://cn.vitejs.dev//) | 开发与构建工具 | 7.1.2 |
| [Vue](https://staging-cn.vuejs.org/) | vue框架 | 3.5.13 |
| [Vite](https://cn.vitejs.dev//) | 开发与构建工具 | 6.2.5 |
| [Ant Design Vue](https://www.antdv.com/) | Ant Design Vue | 4.2.6 |
| [Element Plus](https://element-plus.org/zh-CN/) | Element Plus | 2.10.2 |
| [Naive UI](https://www.naiveui.com/) | Naive UI | 2.42.0 |
| [Element Plus](https://element-plus.org/zh-CN/) | Element Plus | 2.9.7 |
| [Naive UI](https://www.naiveui.com/) | Naive UI | 2.41.0 |
| [TypeScript](https://www.typescriptlang.org/docs/) | JavaScript 超集 | 5.8.3 |
| [pinia](https://pinia.vuejs.org/) | Vue 存储库替代 vuex5 | 3.0.3 |
| [vueuse](https://vueuse.org/) | 常用工具集 | 13.4.0 |
| [vue-i18n](https://kazupon.github.io/vue-i18n/zh/introduction.html/) | 国际化 | 11.1.7 |
| [vue-router](https://router.vuejs.org/) | Vue 路由 | 4.5.1 |
| [pinia](https://pinia.vuejs.org/) | Vue 存储库替代 vuex5 | 2.3.1 |
| [vueuse](https://vueuse.org/) | 常用工具集 | 12.8.2 |
| [vue-i18n](https://kazupon.github.io/vue-i18n/zh/introduction.html/) | 国际化 | 11.1.3 |
| [vue-router](https://router.vuejs.org/) | Vue 路由 | 4.5.0 |
| [Tailwind CSS](https://tailwindcss.com/) | 原子 CSS | 3.4.17 |
| [Iconify](https://icon-sets.iconify.design/) | 在线图标库 | 2.2.354 |
| [Iconify](https://icon-sets.iconify.design/) | 在线图标库 | 2.2.324 |
| [TinyMCE](https://www.tiny.cloud/) | 富文本编辑器 | 6.1.0 |
| [Echarts](https://echarts.apache.org/) | 图表库 | 5.6.0 |
| [axios](https://axios-http.com/) | http客户端 | 1.10.0 |
| [axios](https://axios-http.com/) | http客户端 | 1.8.4 |
| [dayjs](https://day.js.org/) | 日期处理库 | 1.11.13 |
| [vee-validate](https://vee-validate.logaretm.com/) | 表单验证 | 4.15.1 |
| [zod](https://zod.dev/) | 数据验证 | 3.25.67 |
| [vee-validate](https://vee-validate.logaretm.com/) | 表单验证 | 4.15.0 |
| [zod](https://zod.dev/) | 数据验证 | 3.24.2 |
## 🔥 后端架构

View File

@ -1,7 +1,5 @@
import { eventHandler } from 'h3';
import { verifyAccessToken } from '~/utils/jwt-utils';
import { MOCK_CODES } from '~/utils/mock-data';
import { unAuthorizedResponse, useResponseSuccess } from '~/utils/response';
import { unAuthorizedResponse } from '~/utils/response';
export default eventHandler((event) => {
const userinfo = verifyAccessToken(event);

View File

@ -1,15 +1,9 @@
import { defineEventHandler, readBody, setResponseStatus } from 'h3';
import {
clearRefreshTokenCookie,
setRefreshTokenCookie,
} from '~/utils/cookie-utils';
import { generateAccessToken, generateRefreshToken } from '~/utils/jwt-utils';
import { MOCK_USERS } from '~/utils/mock-data';
import {
forbiddenResponse,
useResponseError,
useResponseSuccess,
} from '~/utils/response';
import { forbiddenResponse } from '~/utils/response';
export default defineEventHandler(async (event) => {
const { password, username } = await readBody(event);

View File

@ -1,9 +1,7 @@
import { defineEventHandler } from 'h3';
import {
clearRefreshTokenCookie,
getRefreshTokenFromCookie,
} from '~/utils/cookie-utils';
import { useResponseSuccess } from '~/utils/response';
export default defineEventHandler(async (event) => {
const refreshToken = getRefreshTokenFromCookie(event);

View File

@ -1,11 +1,9 @@
import { defineEventHandler } from 'h3';
import {
clearRefreshTokenCookie,
getRefreshTokenFromCookie,
setRefreshTokenCookie,
} from '~/utils/cookie-utils';
import { generateAccessToken, verifyRefreshToken } from '~/utils/jwt-utils';
import { MOCK_USERS } from '~/utils/mock-data';
import { verifyRefreshToken } from '~/utils/jwt-utils';
import { forbiddenResponse } from '~/utils/response';
export default defineEventHandler(async (event) => {

View File

@ -1,7 +1,3 @@
import { eventHandler, setHeader } from 'h3';
import { verifyAccessToken } from '~/utils/jwt-utils';
import { unAuthorizedResponse } from '~/utils/response';
export default eventHandler(async (event) => {
const userinfo = verifyAccessToken(event);
if (!userinfo) {

View File

@ -1,7 +1,5 @@
import { eventHandler } from 'h3';
import { verifyAccessToken } from '~/utils/jwt-utils';
import { MOCK_MENUS } from '~/utils/mock-data';
import { unAuthorizedResponse, useResponseSuccess } from '~/utils/response';
import { unAuthorizedResponse } from '~/utils/response';
export default eventHandler(async (event) => {
const userinfo = verifyAccessToken(event);

View File

@ -1,6 +1,3 @@
import { eventHandler, getQuery, setResponseStatus } from 'h3';
import { useResponseError } from '~/utils/response';
export default eventHandler((event) => {
const { status } = getQuery(event);
setResponseStatus(event, Number(status));

View File

@ -1,4 +1,3 @@
import { eventHandler } from 'h3';
import { verifyAccessToken } from '~/utils/jwt-utils';
import {
sleep,

View File

@ -1,4 +1,3 @@
import { eventHandler } from 'h3';
import { verifyAccessToken } from '~/utils/jwt-utils';
import {
sleep,

View File

@ -1,4 +1,3 @@
import { eventHandler } from 'h3';
import { verifyAccessToken } from '~/utils/jwt-utils';
import {
sleep,

View File

@ -1,5 +1,4 @@
import { faker } from '@faker-js/faker';
import { eventHandler } from 'h3';
import { verifyAccessToken } from '~/utils/jwt-utils';
import { unAuthorizedResponse, useResponseSuccess } from '~/utils/response';

View File

@ -1,4 +1,3 @@
import { eventHandler } from 'h3';
import { verifyAccessToken } from '~/utils/jwt-utils';
import { MOCK_MENU_LIST } from '~/utils/mock-data';
import { unAuthorizedResponse, useResponseSuccess } from '~/utils/response';

View File

@ -1,7 +1,6 @@
import { eventHandler, getQuery } from 'h3';
import { verifyAccessToken } from '~/utils/jwt-utils';
import { MOCK_MENU_LIST } from '~/utils/mock-data';
import { unAuthorizedResponse, useResponseSuccess } from '~/utils/response';
import { unAuthorizedResponse } from '~/utils/response';
const namesMap: Record<string, any> = {};

View File

@ -1,7 +1,6 @@
import { eventHandler, getQuery } from 'h3';
import { verifyAccessToken } from '~/utils/jwt-utils';
import { MOCK_MENU_LIST } from '~/utils/mock-data';
import { unAuthorizedResponse, useResponseSuccess } from '~/utils/response';
import { unAuthorizedResponse } from '~/utils/response';
const pathMap: Record<string, any> = { '/': 0 };

View File

@ -1,5 +1,4 @@
import { faker } from '@faker-js/faker';
import { eventHandler, getQuery } from 'h3';
import { verifyAccessToken } from '~/utils/jwt-utils';
import { getMenuIds, MOCK_MENU_LIST } from '~/utils/mock-data';
import { unAuthorizedResponse, usePageResponseSuccess } from '~/utils/response';

View File

@ -1,11 +1,6 @@
import { faker } from '@faker-js/faker';
import { eventHandler, getQuery } from 'h3';
import { verifyAccessToken } from '~/utils/jwt-utils';
import {
sleep,
unAuthorizedResponse,
usePageResponseSuccess,
} from '~/utils/response';
import { unAuthorizedResponse, usePageResponseSuccess } from '~/utils/response';
function generateMockDataList(count: number) {
const dataList = [];
@ -49,69 +44,30 @@ export default eventHandler(async (event) => {
await sleep(600);
const { page, pageSize, sortBy, sortOrder } = getQuery(event);
// 规范化分页参数,处理 string[]
const pageRaw = Array.isArray(page) ? page[0] : page;
const pageSizeRaw = Array.isArray(pageSize) ? pageSize[0] : pageSize;
const pageNumber = Math.max(
1,
Number.parseInt(String(pageRaw ?? '1'), 10) || 1,
);
const pageSizeNumber = Math.min(
100,
Math.max(1, Number.parseInt(String(pageSizeRaw ?? '10'), 10) || 10),
);
const listData = structuredClone(mockData);
// 规范化 query 入参,兼容 string[]
const sortKeyRaw = Array.isArray(sortBy) ? sortBy[0] : sortBy;
const sortOrderRaw = Array.isArray(sortOrder) ? sortOrder[0] : sortOrder;
// 检查 sortBy 是否是 listData 元素的合法属性键
if (
typeof sortKeyRaw === 'string' &&
listData[0] &&
Object.prototype.hasOwnProperty.call(listData[0], sortKeyRaw)
) {
// 定义数组元素的类型
type ItemType = (typeof listData)[0];
const sortKey = sortKeyRaw as keyof ItemType; // 将 sortBy 断言为合法键
const isDesc = sortOrderRaw === 'desc';
if (sortBy && Reflect.has(listData[0], sortBy as string)) {
listData.sort((a, b) => {
const aValue = a[sortKey] as unknown;
const bValue = b[sortKey] as unknown;
let result = 0;
if (typeof aValue === 'number' && typeof bValue === 'number') {
result = aValue - bValue;
} else if (aValue instanceof Date && bValue instanceof Date) {
result = aValue.getTime() - bValue.getTime();
} else if (typeof aValue === 'boolean' && typeof bValue === 'boolean') {
if (aValue === bValue) {
result = 0;
if (sortOrder === 'asc') {
if (sortBy === 'price') {
return (
Number.parseFloat(a[sortBy as string]) -
Number.parseFloat(b[sortBy as string])
);
} else {
result = aValue ? 1 : -1;
return a[sortBy as string] > b[sortBy as string] ? 1 : -1;
}
} else {
const aStr = String(aValue);
const bStr = String(bValue);
const aNum = Number(aStr);
const bNum = Number(bStr);
result =
Number.isFinite(aNum) && Number.isFinite(bNum)
? aNum - bNum
: aStr.localeCompare(bStr, undefined, {
numeric: true,
sensitivity: 'base',
});
if (sortBy === 'price') {
return (
Number.parseFloat(b[sortBy as string]) -
Number.parseFloat(a[sortBy as string])
);
} else {
return a[sortBy as string] < b[sortBy as string] ? 1 : -1;
}
}
return isDesc ? -result : result;
});
}
return usePageResponseSuccess(
String(pageNumber),
String(pageSizeNumber),
listData,
);
return usePageResponseSuccess(page as string, pageSize as string, listData);
});

View File

@ -1,3 +1 @@
import { defineEventHandler } from 'h3';
export default defineEventHandler(() => 'Test get handler');

View File

@ -1,3 +1 @@
import { defineEventHandler } from 'h3';
export default defineEventHandler(() => 'Test post handler');

View File

@ -1,6 +1,5 @@
import { eventHandler } from 'h3';
import { verifyAccessToken } from '~/utils/jwt-utils';
import { unAuthorizedResponse, useResponseSuccess } from '~/utils/response';
import { unAuthorizedResponse } from '~/utils/response';
export default eventHandler((event) => {
const userinfo = verifyAccessToken(event);

View File

@ -1,6 +1,5 @@
import { eventHandler } from 'h3';
import { verifyAccessToken } from '~/utils/jwt-utils';
import { unAuthorizedResponse, useResponseSuccess } from '~/utils/response';
import { unAuthorizedResponse } from '~/utils/response';
export default eventHandler((event) => {
const userinfo = verifyAccessToken(event);

View File

@ -1,4 +1,3 @@
import { defineEventHandler } from 'h3';
import { forbiddenResponse, sleep } from '~/utils/response';
export default defineEventHandler(async (event) => {

View File

@ -1,5 +1,3 @@
import { defineEventHandler } from 'h3';
export default defineEventHandler(() => {
return `
<h1>Hello Vben Admin</h1>

View File

@ -1,7 +1,5 @@
import type { EventHandlerRequest, H3Event } from 'h3';
import { deleteCookie, getCookie, setCookie } from 'h3';
export function clearRefreshTokenCookie(event: H3Event<EventHandlerRequest>) {
deleteCookie(event, 'jwt', {
httpOnly: true,

View File

@ -1,11 +1,8 @@
import type { EventHandlerRequest, H3Event } from 'h3';
import type { UserInfo } from './mock-data';
import { getHeader } from 'h3';
import jwt from 'jsonwebtoken';
import { MOCK_USERS } from './mock-data';
import { UserInfo } from './mock-data';
// TODO: Replace with your own secret key
const ACCESS_TOKEN_SECRET = 'access_token_secret';
@ -34,22 +31,12 @@ export function verifyAccessToken(
return null;
}
const tokenParts = authHeader.split(' ');
if (tokenParts.length !== 2) {
return null;
}
const token = tokenParts[1] as string;
const token = authHeader.split(' ')[1];
try {
const decoded = jwt.verify(
token,
ACCESS_TOKEN_SECRET,
) as unknown as UserPayload;
const decoded = jwt.verify(token, ACCESS_TOKEN_SECRET) as UserPayload;
const username = decoded.username;
const user = MOCK_USERS.find((item) => item.username === username);
if (!user) {
return null;
}
const { password: _pwd, ...userinfo } = user;
return userinfo;
} catch {
@ -63,12 +50,7 @@ export function verifyRefreshToken(
try {
const decoded = jwt.verify(token, REFRESH_TOKEN_SECRET) as UserPayload;
const username = decoded.username;
const user = MOCK_USERS.find(
(item) => item.username === username,
) as UserInfo;
if (!user) {
return null;
}
const user = MOCK_USERS.find((item) => item.username === username);
const { password: _pwd, ...userinfo } = user;
return userinfo;
} catch {

View File

@ -1,7 +1,5 @@
import type { EventHandlerRequest, H3Event } from 'h3';
import { setResponseStatus } from 'h3';
export function useResponseSuccess<T = any>(data: T) {
return {
code: 0,

View File

@ -24,12 +24,3 @@ VITE_APP_BAIDU_CODE = e98f2eab6ceb8688bc6d8fc5332ff093
# GoView域名
VITE_GOVIEW_URL='http://127.0.0.1:3000'
# API 加解密
VITE_APP_API_ENCRYPT_ENABLE = true
VITE_APP_API_ENCRYPT_HEADER = X-Api-Encrypt
VITE_APP_API_ENCRYPT_ALGORITHM = AES
VITE_APP_API_ENCRYPT_REQUEST_KEY = 52549111389893486934626385991395
VITE_APP_API_ENCRYPT_RESPONSE_KEY = 96103715984234343991809655248883
# VITE_APP_API_ENCRYPT_REQUEST_KEY = MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCls2rIpnGdYnLFgz1XU13GbNQ5DloyPpvW00FPGjqn5Z6JpK+kDtVlnkhwR87iRrE5Vf2WNqRX6vzbLSgveIQY8e8oqGCb829myjf1MuI+ZzN4ghf/7tEYhZJGPI9AbfxFqBUzm+kR3/HByAI22GLT96WM26QiMK8n3tIP/yiLswIDAQAB
# VITE_APP_API_ENCRYPT_RESPONSE_KEY = MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAOH8IfIFxL/MR9XIg1UDv5z1fGXQI93E8wrU4iPFovL/sEt9uSgSkjyidC2O7N+m7EKtoN6b1u7cEwXSkwf3kfK0jdWLSQaNpX5YshqXCBzbDfugDaxuyYrNA4/tIMs7mzZAk0APuRXB35Dmupou7Yw7TFW/7QhQmGfzeEKULQvnAgMBAAECgYAw8LqlQGyQoPv5p3gRxEMOCfgL0JzD3XBJKztiRd35RDh40Nx1ejgjW4dPioFwGiVWd2W8cAGHLzALdcQT2KDJh+T/tsd4SPmI6uSBBK6Ff2DkO+kFFcuYvfclQQKqxma5CaZOSqhgenacmgTMFeg2eKlY3symV6JlFNu/IKU42QJBAOhxAK/Eq3e61aYQV2JSguhMR3b8NXJJRroRs/QHEanksJtl+M+2qhkC9nQVXBmBkndnkU/l2tYcHfSBlAyFySMCQQD445tgm/J2b6qMQmuUGQAYDN8FIkHjeKmha+l/fv0igWm8NDlBAem91lNDIPBUzHL1X1+pcts5bjmq99YdOnhtAkAg2J8dN3B3idpZDiQbC8fd5bGPmdI/pSUudAP27uzLEjr2qrE/QPPGdwm2m7IZFJtK7kK1hKio6u48t/bg0iL7AkEAuUUs94h+v702Fnym+jJ2CHEkXvz2US8UDs52nWrZYiM1o1y4tfSHm8H8bv8JCAa9GHyriEawfBraILOmllFdLQJAQSRZy4wmlaG48MhVXodB85X+VZ9krGXZ2TLhz7kz9iuToy53l9jTkESt6L5BfBDCVdIwcXLYgK+8KFdHN5W7HQ==

View File

@ -1,6 +1,6 @@
{
"name": "@vben/web-antd",
"version": "5.5.9",
"version": "5.5.7",
"homepage": "https://vben.pro",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {
@ -47,6 +47,7 @@
"@vueuse/integrations": "catalog:",
"ant-design-vue": "catalog:",
"cropperjs": "catalog:",
"crypto-js": "catalog:",
"dayjs": "catalog:",
"highlight.js": "catalog:",
"pinia": "catalog:",

View File

@ -7,7 +7,6 @@ import { IconifyIcon } from '@vben/icons';
import { $te } from '@vben/locales';
import {
AsyncComponents,
createRequiredValidation,
setupVbenVxeTable,
useVbenVxeGrid,
} from '@vben/plugins/vxe-table';
@ -355,7 +354,7 @@ setupVbenVxeTable({
useVbenForm,
});
export { createRequiredValidation, useVbenVxeGrid };
export { useVbenVxeGrid };
const [VxeTable, VxeColumn, VxeToolbar] = AsyncComponents;
export { VxeColumn, VxeTable, VxeToolbar };

View File

@ -40,7 +40,6 @@ export namespace BpmProcessInstanceApi {
nodeType: BpmNodeTypeEnum;
startTime?: Date;
status: number;
processInstanceId?: string;
tasks: ApprovalTaskInfo[];
}

View File

@ -130,8 +130,3 @@ export const getChildrenTaskList = async (id: string) => {
`/bpm/task/list-by-parent-task-id?parentTaskId=${id}`,
);
};
// 撤回任务
export const withdrawTask = async (taskId: string) => {
return await requestClient.put('/bpm/task/withdraw', null, { params: { taskId } });
};

View File

@ -64,11 +64,7 @@ export namespace AuthApi {
/** 登录 */
export async function loginApi(data: AuthApi.LoginParams) {
return requestClient.post<AuthApi.LoginResult>('/system/auth/login', data, {
headers: {
isEncrypt: false,
},
});
return requestClient.post<AuthApi.LoginResult>('/system/auth/login', data);
}
/** 刷新 accessToken */

View File

@ -1,68 +0,0 @@
import type { PageParam, PageResult } from '@vben/request';
import { requestClient } from '#/api/request';
export namespace ErpAccountApi {
/** ERP 结算账户信息 */
export interface Account {
id?: number; // 结算账户编号
no: string; // 账户编码
remark: string; // 备注
status: number; // 开启状态
sort: number; // 排序
defaultStatus: boolean; // 是否默认
name: string; // 账户名称
}
/** 结算账户分页查询参数 */
export interface AccountPageParam extends PageParam {
name?: string;
no?: string;
status?: number;
}
}
/** 查询结算账户分页 */
export function getAccountPage(params: ErpAccountApi.AccountPageParam) {
return requestClient.get<PageResult<ErpAccountApi.Account>>(
'/erp/account/page',
{ params },
);
}
/** 查询结算账户精简列表 */
export function getAccountSimpleList() {
return requestClient.get<ErpAccountApi.Account[]>('/erp/account/simple-list');
}
/** 查询结算账户详情 */
export function getAccount(id: number) {
return requestClient.get<ErpAccountApi.Account>(`/erp/account/get?id=${id}`);
}
/** 新增结算账户 */
export function createAccount(data: ErpAccountApi.Account) {
return requestClient.post('/erp/account/create', data);
}
/** 修改结算账户 */
export function updateAccount(data: ErpAccountApi.Account) {
return requestClient.put('/erp/account/update', data);
}
/** 修改结算账户默认状态 */
export function updateAccountDefaultStatus(id: number, defaultStatus: boolean) {
return requestClient.put('/erp/account/update-default-status', null, {
params: { id, defaultStatus },
});
}
/** 删除结算账户 */
export function deleteAccount(id: number) {
return requestClient.delete(`/erp/account/delete?id=${id}`);
}
/** 导出结算账户 Excel */
export function exportAccount(params: any) {
return requestClient.download('/erp/account/export-excel', { params });
}

View File

@ -1,103 +0,0 @@
import type { PageParam, PageResult } from '@vben/request';
import { requestClient } from '#/api/request';
namespace ErpFinancePaymentApi {
/** 付款单信息 */
export interface FinancePayment {
id?: number; // 付款单编号
no: string; // 付款单号
supplierId: number; // 供应商编号
paymentTime: Date; // 付款时间
totalPrice: number; // 合计金额,单位:元
status: number; // 状态
remark: string; // 备注
}
/** 付款单分页查询参数 */
export interface FinancePaymentPageParams extends PageParam {
no?: string;
supplierId?: number;
status?: number;
}
/** 付款单状态更新参数 */
export interface FinancePaymentStatusParams {
id: number;
status: number;
}
}
/**
*
*/
export function getFinancePaymentPage(
params: ErpFinancePaymentApi.FinancePaymentPageParams,
) {
return requestClient.get<PageResult<ErpFinancePaymentApi.FinancePayment>>(
'/erp/finance-payment/page',
{
params,
},
);
}
/**
*
*/
export function getFinancePayment(id: number) {
return requestClient.get<ErpFinancePaymentApi.FinancePayment>(
`/erp/finance-payment/get?id=${id}`,
);
}
/**
*
*/
export function createFinancePayment(
data: ErpFinancePaymentApi.FinancePayment,
) {
return requestClient.post('/erp/finance-payment/create', data);
}
/**
*
*/
export function updateFinancePayment(
data: ErpFinancePaymentApi.FinancePayment,
) {
return requestClient.put('/erp/finance-payment/update', data);
}
/**
*
*/
export function updateFinancePaymentStatus(
params: ErpFinancePaymentApi.FinancePaymentStatusParams,
) {
return requestClient.put('/erp/finance-payment/update-status', null, {
params,
});
}
/**
*
*/
export function deleteFinancePayment(ids: number[]) {
return requestClient.delete('/erp/finance-payment/delete', {
params: {
ids: ids.join(','),
},
});
}
/**
* Excel
*/
export function exportFinancePayment(
params: ErpFinancePaymentApi.FinancePaymentPageParams,
) {
return requestClient.download('/erp/finance-payment/export-excel', {
params,
});
}

View File

@ -1,103 +0,0 @@
import type { PageParam, PageResult } from '@vben/request';
import { requestClient } from '#/api/request';
namespace ErpFinanceReceiptApi {
/** 收款单信息 */
export interface FinanceReceipt {
id?: number; // 收款单编号
no: string; // 收款单号
customerId: number; // 客户编号
receiptTime: Date; // 收款时间
totalPrice: number; // 合计金额,单位:元
status: number; // 状态
remark: string; // 备注
}
/** 收款单分页查询参数 */
export interface FinanceReceiptPageParams extends PageParam {
no?: string;
customerId?: number;
status?: number;
}
/** 收款单状态更新参数 */
export interface FinanceReceiptStatusParams {
id: number;
status: number;
}
}
/**
*
*/
export function getFinanceReceiptPage(
params: ErpFinanceReceiptApi.FinanceReceiptPageParams,
) {
return requestClient.get<PageResult<ErpFinanceReceiptApi.FinanceReceipt>>(
'/erp/finance-receipt/page',
{
params,
},
);
}
/**
*
*/
export function getFinanceReceipt(id: number) {
return requestClient.get<ErpFinanceReceiptApi.FinanceReceipt>(
`/erp/finance-receipt/get?id=${id}`,
);
}
/**
*
*/
export function createFinanceReceipt(
data: ErpFinanceReceiptApi.FinanceReceipt,
) {
return requestClient.post('/erp/finance-receipt/create', data);
}
/**
*
*/
export function updateFinanceReceipt(
data: ErpFinanceReceiptApi.FinanceReceipt,
) {
return requestClient.put('/erp/finance-receipt/update', data);
}
/**
*
*/
export function updateFinanceReceiptStatus(
params: ErpFinanceReceiptApi.FinanceReceiptStatusParams,
) {
return requestClient.put('/erp/finance-receipt/update-status', null, {
params,
});
}
/**
*
*/
export function deleteFinanceReceipt(ids: number[]) {
return requestClient.delete('/erp/finance-receipt/delete', {
params: {
ids: ids.join(','),
},
});
}
/**
* Excel
*/
export function exportFinanceReceipt(
params: ErpFinanceReceiptApi.FinanceReceiptPageParams,
) {
return requestClient.download('/erp/finance-receipt/export-excel', {
params,
});
}

View File

@ -1,61 +0,0 @@
import { requestClient } from '#/api/request';
export namespace ErpProductCategoryApi {
/** ERP 产品分类信息 */
export interface ProductCategory {
id?: number; // 分类编号
parentId?: number; // 父分类编号
name: string; // 分类名称
code?: string; // 分类编码
sort?: number; // 分类排序
status?: number; // 开启状态
children?: ProductCategory[]; // 子分类
}
}
/** 查询产品分类列表 */
export function getProductCategoryList() {
return requestClient.get<ErpProductCategoryApi.ProductCategory[]>(
'/erp/product-category/list',
);
}
/** 查询产品分类精简列表 */
export function getProductCategorySimpleList() {
return requestClient.get<ErpProductCategoryApi.ProductCategory[]>(
'/erp/product-category/simple-list',
);
}
/** 查询产品分类详情 */
export function getProductCategory(id: number) {
return requestClient.get<ErpProductCategoryApi.ProductCategory>(
`/erp/product-category/get?id=${id}`,
);
}
/** 新增产品分类 */
export function createProductCategory(
data: ErpProductCategoryApi.ProductCategory,
) {
return requestClient.post('/erp/product-category/create', data);
}
/** 修改产品分类 */
export function updateProductCategory(
data: ErpProductCategoryApi.ProductCategory,
) {
return requestClient.put('/erp/product-category/update', data);
}
/** 删除产品分类 */
export function deleteProductCategory(id: number) {
return requestClient.delete(`/erp/product-category/delete?id=${id}`);
}
/** 导出产品分类 Excel */
export function exportProductCategory(params: any) {
return requestClient.download('/erp/product-category/export-excel', {
params,
});
}

View File

@ -1,61 +0,0 @@
import type { PageParam, PageResult } from '@vben/request';
import { requestClient } from '#/api/request';
export namespace ErpProductApi {
/** ERP 产品信息 */
export interface Product {
id?: number; // 产品编号
name: string; // 产品名称
barCode: string; // 产品条码
categoryId: number; // 产品类型编号
unitId: number; // 单位编号
unitName?: string; // 单位名字
status: number; // 产品状态
standard: string; // 产品规格
remark: string; // 产品备注
expiryDay: number; // 保质期天数
weight: number; // 重量kg
purchasePrice: number; // 采购价格,单位:元
salePrice: number; // 销售价格,单位:元
minPrice: number; // 最低价格,单位:元
}
}
/** 查询产品分页 */
export function getProductPage(params: PageParam) {
return requestClient.get<PageResult<ErpProductApi.Product>>(
'/erp/product/page',
{ params },
);
}
/** 查询产品精简列表 */
export function getProductSimpleList() {
return requestClient.get<ErpProductApi.Product[]>('/erp/product/simple-list');
}
/** 查询产品详情 */
export function getProduct(id: number) {
return requestClient.get<ErpProductApi.Product>(`/erp/product/get?id=${id}`);
}
/** 新增产品 */
export function createProduct(data: ErpProductApi.Product) {
return requestClient.post('/erp/product/create', data);
}
/** 修改产品 */
export function updateProduct(data: ErpProductApi.Product) {
return requestClient.put('/erp/product/update', data);
}
/** 删除产品 */
export function deleteProduct(id: number) {
return requestClient.delete(`/erp/product/delete?id=${id}`);
}
/** 导出产品 Excel */
export function exportProduct(params: any) {
return requestClient.download('/erp/product/export-excel', { params });
}

View File

@ -1,62 +0,0 @@
import type { PageParam, PageResult } from '@vben/request';
import { requestClient } from '#/api/request';
export namespace ErpProductUnitApi {
/** ERP 产品单位信息 */
export interface ProductUnit {
id?: number; // 单位编号
name: string; // 单位名字
status: number; // 单位状态
}
/** 产品单位分页查询参数 */
export interface ProductUnitPageParam extends PageParam {
name?: string;
status?: number;
}
}
/** 查询产品单位分页 */
export function getProductUnitPage(
params: ErpProductUnitApi.ProductUnitPageParam,
) {
return requestClient.get<PageResult<ErpProductUnitApi.ProductUnit>>(
'/erp/product-unit/page',
{ params },
);
}
/** 查询产品单位精简列表 */
export function getProductUnitSimpleList() {
return requestClient.get<ErpProductUnitApi.ProductUnit[]>(
'/erp/product-unit/simple-list',
);
}
/** 查询产品单位详情 */
export function getProductUnit(id: number) {
return requestClient.get<ErpProductUnitApi.ProductUnit>(
`/erp/product-unit/get?id=${id}`,
);
}
/** 新增产品单位 */
export function createProductUnit(data: ErpProductUnitApi.ProductUnit) {
return requestClient.post('/erp/product-unit/create', data);
}
/** 修改产品单位 */
export function updateProductUnit(data: ErpProductUnitApi.ProductUnit) {
return requestClient.put('/erp/product-unit/update', data);
}
/** 删除产品单位 */
export function deleteProductUnit(id: number) {
return requestClient.delete(`/erp/product-unit/delete?id=${id}`);
}
/** 导出产品单位 Excel */
export function exportProductUnit(params: any) {
return requestClient.download('/erp/product-unit/export-excel', { params });
}

View File

@ -1,129 +0,0 @@
import type { PageParam, PageResult } from '@vben/request';
import { requestClient } from '#/api/request';
export namespace ErpPurchaseInApi {
/** 采购入库信息 */
export interface PurchaseIn {
id?: number; // 入库工单编号
no?: string; // 采购入库号
supplierId?: number; // 供应商编号
inTime?: Date; // 入库时间
totalCount?: number; // 合计数量
totalPrice?: number; // 合计金额,单位:元
status?: number; // 状态
remark?: string; // 备注
outCount?: number; // 采购出库数量
returnCount?: number; // 采购退货数量
discountPercent?: number; // 折扣百分比
discountPrice?: number; // 折扣金额
paymentPrice?: number; // 实际支付金额
otherPrice?: number; // 其他费用
totalProductPrice?: number; // 合计商品金额
taxPrice?: number; // 合计税额
items?: PurchaseInItem[]; // 采购入库明细
}
export interface PurchaseInItem {
count?: number;
id?: number;
orderItemId?: number;
productBarCode?: string;
productId?: number;
productName: string;
productPrice: number;
productUnitId?: number;
productUnitName?: string;
totalProductPrice?: number;
remark: string;
stockCount?: number;
taxPercent?: number;
taxPrice?: number;
totalPrice?: number;
warehouseId?: number;
inCount?: number;
}
/** 采购入库分页查询参数 */
export interface PurchaseInPageParams extends PageParam {
no?: string;
supplierId?: number;
status?: number;
}
/** 采购入库状态更新参数 */
export interface PurchaseInStatusParams {
id: number;
status: number;
}
}
/**
*
*/
export function getPurchaseInPage(
params: ErpPurchaseInApi.PurchaseInPageParams,
) {
return requestClient.get<PageResult<ErpPurchaseInApi.PurchaseIn>>(
'/erp/purchase-in/page',
{
params,
},
);
}
/**
*
*/
export function getPurchaseIn(id: number) {
return requestClient.get<ErpPurchaseInApi.PurchaseIn>(
`/erp/purchase-in/get?id=${id}`,
);
}
/**
*
*/
export function createPurchaseIn(data: ErpPurchaseInApi.PurchaseIn) {
return requestClient.post('/erp/purchase-in/create', data);
}
/**
*
*/
export function updatePurchaseIn(data: ErpPurchaseInApi.PurchaseIn) {
return requestClient.put('/erp/purchase-in/update', data);
}
/**
*
*/
export function updatePurchaseInStatus(id: number, status: number) {
return requestClient.put('/erp/purchase-in/update-status', null, {
params: {
id,
status,
},
});
}
/**
*
*/
export function deletePurchaseIn(ids: number[]) {
return requestClient.delete('/erp/purchase-in/delete', {
params: {
ids: ids.join(','),
},
});
}
/**
* Excel
*/
export function exportPurchaseIn(
params: ErpPurchaseInApi.PurchaseInPageParams,
) {
return requestClient.download('/erp/purchase-in/export-excel', {
params,
});
}

View File

@ -1,117 +0,0 @@
import type { PageParam, PageResult } from '@vben/request';
import { requestClient } from '#/api/request';
export namespace ErpPurchaseOrderApi {
/** ERP 采购订单项信息 */
export interface PurchaseOrderItem {
id?: number; // 订单项编号
orderId?: number; // 采购订单编号
productId?: number; // 产品编号
productName?: string; // 产品名称
productBarCode?: string; // 产品条码
productUnitId?: number; // 产品单位编号
productUnitName?: string; // 产品单位名称
productPrice?: number; // 产品单价,单位:元
totalProductPrice?: number; // 产品总价,单位:元
count?: number; // 数量
totalPrice?: number; // 总价,单位:元
taxPercent?: number; // 税率,百分比
taxPrice?: number; // 税额,单位:元
totalTaxPrice?: number; // 含税总价,单位:元
remark?: string; // 备注
stockCount?: number; // 库存数量(显示字段)
}
/** ERP 采购订单信息 */
export interface PurchaseOrder {
id?: number; // 订单工单编号
no?: string; // 采购订单号
supplierId?: number; // 供应商编号
supplierName?: string; // 供应商名称
orderTime?: Date | string; // 订单时间
totalCount?: number; // 合计数量
totalPrice?: number; // 合计金额,单位:元
totalProductPrice?: number; // 产品金额,单位:元
discountPercent?: number; // 优惠率,百分比
discountPrice?: number; // 优惠金额,单位:元
depositPrice?: number; // 定金金额,单位:元
accountId?: number; // 结算账户编号
status?: number; // 状态
remark?: string; // 备注
fileUrl?: string; // 附件地址
inCount?: number; // 采购入库数量
count?: number; // 数量
returnCount?: number; // 采购退货数量
inStatus?: number; // 入库状态
returnStatus?: number; // 退货状态
productNames?: string; // 产品名称列表
creatorName?: string; // 创建人名称
createTime?: Date; // 创建时间
items?: PurchaseOrderItem[]; // 订单项列表
}
/** 采购订单分页查询参数 */
export interface PurchaseOrderPageParam extends PageParam {
no?: string;
supplierId?: number;
productId?: number;
orderTime?: string[];
status?: number;
remark?: string;
creator?: string;
inStatus?: number;
returnStatus?: number;
}
}
/** 查询采购订单分页 */
export function getPurchaseOrderPage(
params: ErpPurchaseOrderApi.PurchaseOrderPageParam,
) {
return requestClient.get<PageResult<ErpPurchaseOrderApi.PurchaseOrder>>(
'/erp/purchase-order/page',
{ params },
);
}
/** 查询采购订单详情 */
export function getPurchaseOrder(id: number) {
return requestClient.get<ErpPurchaseOrderApi.PurchaseOrder>(
`/erp/purchase-order/get?id=${id}`,
);
}
/** 新增采购订单 */
export function createPurchaseOrder(data: ErpPurchaseOrderApi.PurchaseOrder) {
return requestClient.post('/erp/purchase-order/create', data);
}
/** 修改采购订单 */
export function updatePurchaseOrder(data: ErpPurchaseOrderApi.PurchaseOrder) {
return requestClient.put('/erp/purchase-order/update', data);
}
/** 更新采购订单的状态 */
export function updatePurchaseOrderStatus(id: number, status: number) {
return requestClient.put('/erp/purchase-order/update-status', null, {
params: { id, status },
});
}
/** 删除采购订单 */
export function deletePurchaseOrder(id: number) {
return requestClient.delete(`/erp/purchase-order/delete?id=${id}`);
}
/** 批量删除采购订单 */
export function deletePurchaseOrderList(ids: number[]) {
return requestClient.delete('/erp/purchase-order/delete', {
params: { ids: ids.join(',') },
});
}
/** 导出采购订单 Excel */
export function exportPurchaseOrder(params: any) {
return requestClient.download('/erp/purchase-order/export-excel', { params });
}

View File

@ -1,127 +0,0 @@
import type { PageParam, PageResult } from '@vben/request';
import { requestClient } from '#/api/request';
export namespace ErpPurchaseReturnApi {
/** 采购退货信息 */
export interface PurchaseReturn {
id?: number; // 采购退货编号
no?: string; // 采购退货号
supplierId?: number; // 供应商编号
returnTime?: Date; // 退货时间
totalCount?: number; // 合计数量
totalPrice: number; // 合计金额,单位:元
discountPercent?: number; // 折扣百分比
discountPrice?: number; // 折扣金额
status?: number; // 状态
remark?: string; // 备注
totalTaxPrice?: number; // 合计税额
otherPrice?: number; // 其他费用
items?: PurchaseReturnItem[];
}
export interface PurchaseReturnItem {
count?: number;
id?: number;
orderItemId?: number;
productBarCode?: string;
productId?: number;
productName: string;
productPrice: number;
productUnitId?: number;
productUnitName?: string;
totalProductPrice?: number;
remark: string;
stockCount?: number;
taxPercent?: number;
taxPrice?: number;
totalPrice?: number;
warehouseId?: number;
}
/** 采购退货分页查询参数 */
export interface PurchaseReturnPageParams extends PageParam {
no?: string;
supplierId?: number;
status?: number;
}
/** 采购退货状态更新参数 */
export interface PurchaseReturnStatusParams {
id: number;
status: number;
}
}
/**
* 退
*/
export function getPurchaseReturnPage(
params: ErpPurchaseReturnApi.PurchaseReturnPageParams,
) {
return requestClient.get<PageResult<ErpPurchaseReturnApi.PurchaseReturn>>(
'/erp/purchase-return/page',
{
params,
},
);
}
/**
* 退
*/
export function getPurchaseReturn(id: number) {
return requestClient.get<ErpPurchaseReturnApi.PurchaseReturn>(
`/erp/purchase-return/get?id=${id}`,
);
}
/**
* 退
*/
export function createPurchaseReturn(
data: ErpPurchaseReturnApi.PurchaseReturn,
) {
return requestClient.post('/erp/purchase-return/create', data);
}
/**
* 退
*/
export function updatePurchaseReturn(
data: ErpPurchaseReturnApi.PurchaseReturn,
) {
return requestClient.put('/erp/purchase-return/update', data);
}
/**
* 退
*/
export function updatePurchaseReturnStatus(
params: ErpPurchaseReturnApi.PurchaseReturnStatusParams,
) {
return requestClient.put('/erp/purchase-return/update-status', null, {
params,
});
}
/**
* 退
*/
export function deletePurchaseReturn(ids: number[]) {
return requestClient.delete('/erp/purchase-return/delete', {
params: {
ids: ids.join(','),
},
});
}
/**
* 退 Excel
*/
export function exportPurchaseReturn(
params: ErpPurchaseReturnApi.PurchaseReturnPageParams,
) {
return requestClient.download('/erp/purchase-return/export-excel', {
params,
});
}

View File

@ -1,73 +0,0 @@
import type { PageParam, PageResult } from '@vben/request';
import { requestClient } from '#/api/request';
export namespace ErpSupplierApi {
/** ERP 供应商信息 */
export interface Supplier {
id?: number; // 供应商编号
name: string; // 供应商名称
contact: string; // 联系人
mobile: string; // 手机号码
telephone: string; // 联系电话
email: string; // 电子邮箱
fax: string; // 传真
remark: string; // 备注
status: number; // 开启状态
sort: number; // 排序
taxNo: string; // 纳税人识别号
taxPercent: number; // 税率
bankName: string; // 开户行
bankAccount: string; // 开户账号
bankAddress: string; // 开户地址
}
/** 供应商分页查询参数 */
export interface SupplierPageParam extends PageParam {
name?: string;
mobile?: string;
status?: number;
}
}
/** 查询供应商分页 */
export function getSupplierPage(params: ErpSupplierApi.SupplierPageParam) {
return requestClient.get<PageResult<ErpSupplierApi.Supplier>>(
'/erp/supplier/page',
{ params },
);
}
/** 获得供应商精简列表 */
export function getSupplierSimpleList() {
return requestClient.get<ErpSupplierApi.Supplier[]>(
'/erp/supplier/simple-list',
);
}
/** 查询供应商详情 */
export function getSupplier(id: number) {
return requestClient.get<ErpSupplierApi.Supplier>(
`/erp/supplier/get?id=${id}`,
);
}
/** 新增供应商 */
export function createSupplier(data: ErpSupplierApi.Supplier) {
return requestClient.post('/erp/supplier/create', data);
}
/** 修改供应商 */
export function updateSupplier(data: ErpSupplierApi.Supplier) {
return requestClient.put('/erp/supplier/update', data);
}
/** 删除供应商 */
export function deleteSupplier(id: number) {
return requestClient.delete(`/erp/supplier/delete?id=${id}`);
}
/** 导出供应商 Excel */
export function exportSupplier(params: any) {
return requestClient.download('/erp/supplier/export-excel', { params });
}

View File

@ -1,73 +0,0 @@
import type { PageParam, PageResult } from '@vben/request';
import { requestClient } from '#/api/request';
export namespace ErpCustomerApi {
/** ERP 客户信息 */
export interface Customer {
id?: number; // 客户编号
name: string; // 客户名称
contact: string; // 联系人
mobile: string; // 手机号码
telephone: string; // 联系电话
email: string; // 电子邮箱
fax: string; // 传真
remark: string; // 备注
status: number; // 开启状态
sort: number; // 排序
taxNo: string; // 纳税人识别号
taxPercent: number; // 税率
bankName: string; // 开户行
bankAccount: string; // 开户账号
bankAddress: string; // 开户地址
}
/** 客户分页查询参数 */
export interface CustomerPageParam extends PageParam {
name?: string;
mobile?: string;
status?: number;
}
}
/** 查询客户分页 */
export function getCustomerPage(params: ErpCustomerApi.CustomerPageParam) {
return requestClient.get<PageResult<ErpCustomerApi.Customer>>(
'/erp/customer/page',
{ params },
);
}
/** 查询客户精简列表 */
export function getCustomerSimpleList() {
return requestClient.get<ErpCustomerApi.Customer[]>(
'/erp/customer/simple-list',
);
}
/** 查询客户详情 */
export function getCustomer(id: number) {
return requestClient.get<ErpCustomerApi.Customer>(
`/erp/customer/get?id=${id}`,
);
}
/** 新增客户 */
export function createCustomer(data: ErpCustomerApi.Customer) {
return requestClient.post('/erp/customer/create', data);
}
/** 修改客户 */
export function updateCustomer(data: ErpCustomerApi.Customer) {
return requestClient.put('/erp/customer/update', data);
}
/** 删除客户 */
export function deleteCustomer(id: number) {
return requestClient.delete(`/erp/customer/delete?id=${id}`);
}
/** 导出客户 Excel */
export function exportCustomer(params: any) {
return requestClient.download('/erp/customer/export-excel', { params });
}

View File

@ -1,97 +0,0 @@
import type { PageParam, PageResult } from '@vben/request';
import { requestClient } from '#/api/request';
export namespace ErpSaleOrderApi {
/** ERP 销售订单信息 */
export interface SaleOrder {
id?: number; // 订单工单编号
no: string; // 销售订单号
customerId: number; // 客户编号
accountId?: number; // 收款账户编号
orderTime: Date; // 订单时间
totalCount: number; // 合计数量
totalPrice: number; // 合计金额,单位:元
status: number; // 状态
remark: string; // 备注
outCount: number; // 销售出库数量
fileUrl?: string; // 附件地址
inCount?: number; // 采购入库数量
returnCount: number; // 销售退货数量
totalProductPrice?: number; // 产品金额,单位:元
discountPercent?: number; // 优惠率,百分比
discountPrice?: number; // 优惠金额,单位:元
depositPrice?: number; // 定金金额,单位:元
items?: SaleOrderItem[]; // 销售订单产品明细列表
}
/** ERP 销售订单产品明细 */
export interface SaleOrderItem {
id?: number; // 订单项编号
orderId?: number; // 采购订单编号
productId?: number; // 产品编号
productName?: string; // 产品名称
productBarCode?: string; // 产品条码
productUnitId?: number; // 产品单位编号
productUnitName?: string; // 产品单位名称
productPrice?: number; // 产品单价,单位:元
totalProductPrice?: number; // 产品总价,单位:元
count?: number; // 数量
totalPrice?: number; // 总价,单位:元
taxPercent?: number; // 税率,百分比
taxPrice?: number; // 税额,单位:元
totalTaxPrice?: number; // 含税总价,单位:元
remark?: string; // 备注
stockCount?: number; // 库存数量(显示字段)
}
/** 销售订单分页查询参数 */
export interface SaleOrderPageParam extends PageParam {
no?: string;
customerId?: number;
status?: number;
}
}
/** 查询销售订单分页 */
export function getSaleOrderPage(params: ErpSaleOrderApi.SaleOrderPageParam) {
return requestClient.get<PageResult<ErpSaleOrderApi.SaleOrder>>(
'/erp/sale-order/page',
{ params },
);
}
/** 查询销售订单详情 */
export function getSaleOrder(id: number) {
return requestClient.get<ErpSaleOrderApi.SaleOrder>(
`/erp/sale-order/get?id=${id}`,
);
}
/** 新增销售订单 */
export function createSaleOrder(data: ErpSaleOrderApi.SaleOrder) {
return requestClient.post('/erp/sale-order/create', data);
}
/** 修改销售订单 */
export function updateSaleOrder(data: ErpSaleOrderApi.SaleOrder) {
return requestClient.put('/erp/sale-order/update', data);
}
/** 更新销售订单的状态 */
export function updateSaleOrderStatus(id: number, status: number) {
return requestClient.put('/erp/sale-order/update-status', null, {
params: { id, status },
});
}
/** 删除销售订单 */
export function deleteSaleOrder(ids: number[]) {
return requestClient.delete('/erp/sale-order/delete', {
params: { ids: ids.join(',') },
});
}
/** 导出销售订单 Excel */
export function exportSaleOrder(params: any) {
return requestClient.download('/erp/sale-order/export-excel', { params });
}

View File

@ -1,120 +0,0 @@
import type { PageParam, PageResult } from '@vben/request';
import { requestClient } from '#/api/request';
export namespace ErpSaleOutApi {
/** 销售出库信息 */
export interface SaleOut {
id?: number; // 销售出库编号
no?: string; // 销售出库号
customerId?: number; // 客户编号
saleUserId?: number; // 客户编号
outTime?: Date; // 出库时间
totalCount?: number; // 合计数量
totalPrice?: number; // 合计金额,单位:元
status?: number; // 状态
remark?: string; // 备注
discountPercent?: number; // 折扣百分比
discountPrice?: number; // 折扣金额
otherPrice?: number; // 其他费用
totalProductPrice?: number; // 合计商品金额
taxPrice?: number; // 合计税额
totalTaxPrice?: number; // 合计税额
fileUrl?: string; // 附件地址
items?: SaleOutItem[];
}
export interface SaleOutItem {
count?: number;
id?: number;
orderItemId?: number;
productBarCode?: string;
productId?: number;
productName: string;
productPrice: number;
productUnitId?: number;
productUnitName?: string;
totalProductPrice?: number;
remark: string;
stockCount?: number;
taxPercent?: number;
taxPrice?: number;
totalPrice?: number;
warehouseId?: number;
outCount?: number;
}
/** 销售出库分页查询参数 */
export interface SaleOutPageParams extends PageParam {
no?: string;
customerId?: number;
status?: number;
}
/** 销售出库状态更新参数 */
export interface SaleOutStatusParams {
id: number;
status: number;
}
}
/**
*
*/
export function getSaleOutPage(params: ErpSaleOutApi.SaleOutPageParams) {
return requestClient.get<PageResult<ErpSaleOutApi.SaleOut>>(
'/erp/sale-out/page',
{
params,
},
);
}
/**
*
*/
export function getSaleOut(id: number) {
return requestClient.get<ErpSaleOutApi.SaleOut>(`/erp/sale-out/get?id=${id}`);
}
/**
*
*/
export function createSaleOut(data: ErpSaleOutApi.SaleOut) {
return requestClient.post('/erp/sale-out/create', data);
}
/**
*
*/
export function updateSaleOut(data: ErpSaleOutApi.SaleOut) {
return requestClient.put('/erp/sale-out/update', data);
}
/**
*
*/
export function updateSaleOutStatus(params: ErpSaleOutApi.SaleOutStatusParams) {
return requestClient.put('/erp/sale-out/update-status', null, {
params,
});
}
/**
*
*/
export function deleteSaleOut(ids: number[]) {
return requestClient.delete('/erp/sale-out/delete', {
params: {
ids: ids.join(','),
},
});
}
/**
* Excel
*/
export function exportSaleOut(params: ErpSaleOutApi.SaleOutPageParams) {
return requestClient.download('/erp/sale-out/export-excel', {
params,
});
}

View File

@ -1,127 +0,0 @@
import type { PageParam, PageResult } from '@vben/request';
import { requestClient } from '#/api/request';
export namespace ErpSaleReturnApi {
/** 销售退货信息 */
export interface SaleReturn {
id?: number; // 销售退货编号
no?: string; // 销售退货号
customerId?: number; // 客户编号
returnTime?: Date; // 退货时间
totalCount?: number; // 合计数量
totalPrice?: number; // 合计金额,单位:元
status?: number; // 状态
remark?: string; // 备注
discountPercent?: number; // 折扣百分比
discountPrice?: number; // 折扣金额
otherPrice?: number; // 其他费用
totalProductPrice?: number; // 合计商品金额
taxPrice?: number; // 合计税额
totalTaxPrice?: number; // 合计税额
fileUrl?: string; // 附件地址
items?: SaleReturnItem[];
}
export interface SaleReturnItem {
count?: number;
id?: number;
orderItemId?: number;
productBarCode?: string;
productId?: number;
productName: string;
productPrice: number;
productUnitId?: number;
productUnitName?: string;
totalProductPrice?: number;
remark: string;
stockCount?: number;
taxPercent?: number;
taxPrice?: number;
totalPrice?: number;
warehouseId?: number;
returnCount?: number;
}
/** 销售退货分页查询参数 */
export interface SaleReturnPageParams extends PageParam {
no?: string;
customerId?: number;
status?: number;
}
/** 销售退货状态更新参数 */
export interface SaleReturnStatusParams {
id: number;
status: number;
}
}
/**
* 退
*/
export function getSaleReturnPage(
params: ErpSaleReturnApi.SaleReturnPageParams,
) {
return requestClient.get<PageResult<ErpSaleReturnApi.SaleReturn>>(
'/erp/sale-return/page',
{
params,
},
);
}
/**
* 退
*/
export function getSaleReturn(id: number) {
return requestClient.get<ErpSaleReturnApi.SaleReturn>(
`/erp/sale-return/get?id=${id}`,
);
}
/**
* 退
*/
export function createSaleReturn(data: ErpSaleReturnApi.SaleReturn) {
return requestClient.post('/erp/sale-return/create', data);
}
/**
* 退
*/
export function updateSaleReturn(data: ErpSaleReturnApi.SaleReturn) {
return requestClient.put('/erp/sale-return/update', data);
}
/**
* 退
*/
export function updateSaleReturnStatus(
params: ErpSaleReturnApi.SaleReturnStatusParams,
) {
return requestClient.put('/erp/sale-return/update-status', null, {
params,
});
}
/**
* 退
*/
export function deleteSaleReturn(ids: number[]) {
return requestClient.delete('/erp/sale-return/delete', {
params: {
ids: ids.join(','),
},
});
}
/**
* 退 Excel
*/
export function exportSaleReturn(
params: ErpSaleReturnApi.SaleReturnPageParams,
) {
return requestClient.download('/erp/sale-return/export-excel', {
params,
});
}

View File

@ -1,31 +0,0 @@
import { requestClient } from '#/api/request';
export namespace ErpPurchaseStatisticsApi {
/** ERP 采购全局统计 */
export interface PurchaseSummary {
todayPrice: number; // 今日采购金额
yesterdayPrice: number; // 昨日采购金额
monthPrice: number; // 本月采购金额
yearPrice: number; // 今年采购金额
}
/** ERP 采购时间段统计 */
export interface PurchaseTimeSummary {
time: string; // 时间
price: number; // 采购金额
}
}
/** 获得采购统计 */
export function getPurchaseSummary() {
return requestClient.get<ErpPurchaseStatisticsApi.PurchaseSummary>(
'/erp/purchase-statistics/summary',
);
}
/** 获得采购时间段统计 */
export function getPurchaseTimeSummary() {
return requestClient.get<ErpPurchaseStatisticsApi.PurchaseTimeSummary[]>(
'/erp/purchase-statistics/time-summary',
);
}

View File

@ -1,31 +0,0 @@
import { requestClient } from '#/api/request';
export namespace ErpSaleStatisticsApi {
/** ERP 销售全局统计 */
export interface SaleSummary {
todayPrice: number; // 今日销售金额
yesterdayPrice: number; // 昨日销售金额
monthPrice: number; // 本月销售金额
yearPrice: number; // 今年销售金额
}
/** ERP 销售时间段统计 */
export interface SaleTimeSummary {
time: string; // 时间
price: number; // 销售金额
}
}
/** 获得销售统计 */
export function getSaleSummary() {
return requestClient.get<ErpSaleStatisticsApi.SaleSummary>(
'/erp/sale-statistics/summary',
);
}
/** 获得销售时间段统计 */
export function getSaleTimeSummary() {
return requestClient.get<ErpSaleStatisticsApi.SaleTimeSummary[]>(
'/erp/sale-statistics/time-summary',
);
}

View File

@ -1,117 +0,0 @@
import type { PageParam, PageResult } from '@vben/request';
import { requestClient } from '#/api/request';
export namespace ErpStockCheckApi {
/** 库存盘点单信息 */
export interface StockCheck {
id?: number; // 盘点编号
no: string; // 盘点单号
checkTime: Date; // 盘点时间
totalCount: number; // 合计数量
totalPrice: number; // 合计金额,单位:元
status: number; // 状态
remark: string; // 备注
fileUrl?: string; // 附件
productNames?: string; // 产品信息
creatorName?: string; // 创建人
items?: StockCheckItem[]; // 盘点产品清单
}
// 库存盘点单产品信息
export interface StockCheckItem {
id?: number; // 编号
warehouseId?: number; // 仓库编号
productId?: number; // 产品编号
productName?: string; // 产品名称
productUnitId?: number; // 产品单位编号
productUnitName?: string; // 产品单位名称
productBarCode?: string; // 产品条码
count?: number; // 盈亏数量
actualCount?: number; // 实际库存
productPrice?: number; // 产品单价
totalPrice?: number; // 总价
stockCount?: number; // 账面库存
remark?: string; // 备注
}
/** 库存盘点单分页查询参数 */
export interface StockCheckPageParams extends PageParam {
no?: string;
status?: number;
}
/** 库存盘点单状态更新参数 */
export interface StockCheckStatusParams {
id: number;
status: number;
}
}
/**
*
*/
export function getStockCheckPage(
params: ErpStockCheckApi.StockCheckPageParams,
) {
return requestClient.get<PageResult<ErpStockCheckApi.StockCheck>>(
'/erp/stock-check/page',
{
params,
},
);
}
/**
*
*/
export function getStockCheck(id: number) {
return requestClient.get<ErpStockCheckApi.StockCheck>(
`/erp/stock-check/get?id=${id}`,
);
}
/**
*
*/
export function createStockCheck(data: ErpStockCheckApi.StockCheck) {
return requestClient.post('/erp/stock-check/create', data);
}
/**
*
*/
export function updateStockCheck(data: ErpStockCheckApi.StockCheck) {
return requestClient.put('/erp/stock-check/update', data);
}
/**
*
*/
export function updateStockCheckStatus(
params: ErpStockCheckApi.StockCheckStatusParams,
) {
return requestClient.put('/erp/stock-check/update-status', null, {
params,
});
}
/**
*
*/
export function deleteStockCheck(ids: number[]) {
return requestClient.delete('/erp/stock-check/delete', {
params: {
ids: ids.join(','),
},
});
}
/**
* Excel
*/
export function exportStockCheck(
params: ErpStockCheckApi.StockCheckPageParams,
) {
return requestClient.download('/erp/stock-check/export-excel', {
params,
});
}

View File

@ -1,113 +0,0 @@
import type { PageParam, PageResult } from '@vben/request';
import { requestClient } from '#/api/request';
export namespace ErpStockInApi {
/** 其它入库单信息 */
export interface StockIn {
id?: number; // 入库编号
no: string; // 入库单号
supplierId: number; // 供应商编号
supplierName?: string; // 供应商名称
inTime: Date; // 入库时间
totalCount: number; // 合计数量
totalPrice: number; // 合计金额,单位:元
status: number; // 状态
remark: string; // 备注
fileUrl?: string; // 附件
productNames?: string; // 产品信息
creatorName?: string; // 创建人
items?: StockInItem[]; // 入库产品清单
}
/** 其它入库单产品信息 */
export interface StockInItem {
id?: number; // 编号
warehouseId: number; // 仓库编号
productId: number; // 产品编号
productName?: string; // 产品名称
productUnitId?: number; // 产品单位编号
productUnitName?: string; // 产品单位名称
productBarCode?: string; // 产品条码
count: number; // 数量
productPrice: number; // 产品单价
totalPrice: number; // 总价
stockCount?: number; // 库存数量
remark?: string; // 备注
}
/** 其它入库单分页查询参数 */
export interface StockInPageParams extends PageParam {
no?: string;
supplierId?: number;
status?: number;
}
/** 其它入库单状态更新参数 */
export interface StockInStatusParams {
id: number;
status: number;
}
}
/**
*
*/
export function getStockInPage(params: ErpStockInApi.StockInPageParams) {
return requestClient.get<PageResult<ErpStockInApi.StockIn>>(
'/erp/stock-in/page',
{
params,
},
);
}
/**
*
*/
export function getStockIn(id: number) {
return requestClient.get<ErpStockInApi.StockIn>(`/erp/stock-in/get?id=${id}`);
}
/**
*
*/
export function createStockIn(data: ErpStockInApi.StockIn) {
return requestClient.post('/erp/stock-in/create', data);
}
/**
*
*/
export function updateStockIn(data: ErpStockInApi.StockIn) {
return requestClient.put('/erp/stock-in/update', data);
}
/**
*
*/
export function updateStockInStatus(params: ErpStockInApi.StockInStatusParams) {
return requestClient.put('/erp/stock-in/update-status', null, {
params,
});
}
/**
*
*/
export function deleteStockIn(ids: number[]) {
return requestClient.delete('/erp/stock-in/delete', {
params: {
ids: ids.join(','),
},
});
}
/**
* Excel
*/
export function exportStockIn(params: ErpStockInApi.StockInPageParams) {
return requestClient.download('/erp/stock-in/export-excel', {
params,
});
}

View File

@ -1,117 +0,0 @@
import type { PageParam, PageResult } from '@vben/request';
import { requestClient } from '#/api/request';
export namespace ErpStockMoveApi {
/** 库存调拨单信息 */
export interface StockMove {
id?: number; // 调拨编号
no: string; // 调拨单号
outTime: Date; // 调拨时间
totalCount: number; // 合计数量
totalPrice: number; // 合计金额,单位:元
status: number; // 状态
remark: string; // 备注
fileUrl?: string; // 附件
fromWarehouseId?: number; // 来源仓库编号
createTime: Date; // 创建时间
creator: string; // 创建人
creatorName: string; // 创建人名称
productNames: string; // 产品名称
items?: StockMoveItem[]; // 子表信息
}
/** 库存调拨单子表信息 */
export interface StockMoveItem {
count: number; // 数量
fromWarehouseId?: number; // 来源仓库ID
id?: number; // ID
productBarCode: string; // 产品条形码
productId?: number; // 产品ID
productName?: string; // 产品名称
productPrice: number; // 产品单价
productUnitName?: string; // 产品单位
remark?: string; // 备注
stockCount: number; // 库存数量
toWarehouseId?: number; // 目标仓库ID
totalPrice?: number; // 总价
}
/** 库存调拨单分页查询参数 */
export interface StockMovePageParams extends PageParam {
no?: string;
status?: number;
}
/** 库存调拨单状态更新参数 */
export interface StockMoveStatusParams {
id: number;
status: number;
}
}
/**
*
*/
export function getStockMovePage(params: ErpStockMoveApi.StockMovePageParams) {
return requestClient.get<PageResult<ErpStockMoveApi.StockMove>>(
'/erp/stock-move/page',
{
params,
},
);
}
/**
*
*/
export function getStockMove(id: number) {
return requestClient.get<ErpStockMoveApi.StockMove>(
`/erp/stock-move/get?id=${id}`,
);
}
/**
*
*/
export function createStockMove(data: ErpStockMoveApi.StockMove) {
return requestClient.post('/erp/stock-move/create', data);
}
/**
*
*/
export function updateStockMove(data: ErpStockMoveApi.StockMove) {
return requestClient.put('/erp/stock-move/update', data);
}
/**
*
*/
export function updateStockMoveStatus(
params: ErpStockMoveApi.StockMoveStatusParams,
) {
return requestClient.put('/erp/stock-move/update-status', null, {
params,
});
}
/**
*
*/
export function deleteStockMove(ids: number[]) {
return requestClient.delete('/erp/stock-move/delete', {
params: {
ids: ids.join(','),
},
});
}
/**
* Excel
*/
export function exportStockMove(params: ErpStockMoveApi.StockMovePageParams) {
return requestClient.download('/erp/stock-move/export-excel', {
params,
});
}

View File

@ -1,114 +0,0 @@
import type { PageParam, PageResult } from '@vben/request';
import { requestClient } from '#/api/request';
export namespace ErpStockOutApi {
/** 其它出库单信息 */
export interface StockOut {
id?: number; // 出库编号
no: string; // 出库单号
customerId: number; // 客户编号
outTime: Date; // 出库时间
totalCount: number; // 合计数量
totalPrice: number; // 合计金额,单位:元
status: number; // 状态
remark: string; // 备注
fileUrl?: string; // 附件
items?: StockOutItem[]; // 出库产品清单
}
/** 其它出库单产品信息 */
export interface StockOutItem {
id?: number; // 编号
warehouseId?: number; // 仓库编号
productId?: number; // 产品编号
productName?: string; // 产品名称
productUnitId?: number; // 产品单位编号
productUnitName?: string; // 产品单位名称
productBarCode?: string; // 产品条码
count: number; // 数量
productPrice: number; // 产品单价
totalPrice: number; // 总价
stockCount?: number; // 库存数量
remark?: string; // 备注
}
/** 其它出库单分页查询参数 */
export interface StockOutPageParams extends PageParam {
no?: string;
customerId?: number;
status?: number;
}
/** 其它出库单状态更新参数 */
export interface StockOutStatusParams {
id: number;
status: number;
}
}
/**
*
*/
export function getStockOutPage(params: ErpStockOutApi.StockOutPageParams) {
return requestClient.get<PageResult<ErpStockOutApi.StockOut>>(
'/erp/stock-out/page',
{
params,
},
);
}
/**
*
*/
export function getStockOut(id: number) {
return requestClient.get<ErpStockOutApi.StockOut>(
`/erp/stock-out/get?id=${id}`,
);
}
/**
*
*/
export function createStockOut(data: ErpStockOutApi.StockOut) {
return requestClient.post('/erp/stock-out/create', data);
}
/**
*
*/
export function updateStockOut(data: ErpStockOutApi.StockOut) {
return requestClient.put('/erp/stock-out/update', data);
}
/**
*
*/
export function updateStockOutStatus(
params: ErpStockOutApi.StockOutStatusParams,
) {
return requestClient.put('/erp/stock-out/update-status', null, {
params,
});
}
/**
*
*/
export function deleteStockOut(ids: number[]) {
return requestClient.delete('/erp/stock-out/delete', {
params: {
ids: ids.join(','),
},
});
}
/**
* Excel
*/
export function exportStockOut(params: ErpStockOutApi.StockOutPageParams) {
return requestClient.download('/erp/stock-out/export-excel', {
params,
});
}

View File

@ -1,47 +0,0 @@
import type { PageParam, PageResult } from '@vben/request';
import { requestClient } from '#/api/request';
export namespace ErpStockRecordApi {
/** ERP 产品库存明细 */
export interface StockRecord {
id?: number; // 编号
productId: number; // 产品编号
warehouseId: number; // 仓库编号
count: number; // 出入库数量
totalCount: number; // 总库存量
bizType: number; // 业务类型
bizId: number; // 业务编号
bizItemId: number; // 业务项编号
bizNo: string; // 业务单号
}
/** 库存记录分页查询参数 */
export interface StockRecordPageParam extends PageParam {
productId?: number;
warehouseId?: number;
bizType?: number;
}
}
/** 查询产品库存明细分页 */
export function getStockRecordPage(
params: ErpStockRecordApi.StockRecordPageParam,
) {
return requestClient.get<PageResult<ErpStockRecordApi.StockRecord>>(
'/erp/stock-record/page',
{ params },
);
}
/** 查询产品库存明细详情 */
export function getStockRecord(id: number) {
return requestClient.get<ErpStockRecordApi.StockRecord>(
`/erp/stock-record/get?id=${id}`,
);
}
/** 导出产品库存明细 Excel */
export function exportStockRecord(params: any) {
return requestClient.download('/erp/stock-record/export-excel', { params });
}

View File

@ -1,83 +0,0 @@
import type { PageParam, PageResult } from '@vben/request';
import { requestClient } from '#/api/request';
export namespace ErpStockApi {
/** 产品库存信息 */
export interface Stock {
id?: number; // 编号
productId: number; // 产品编号
warehouseId: number; // 仓库编号
count: number; // 库存数量
}
/** 产品库存分页查询参数 */
export interface StockPageParams extends PageParam {
productId?: number;
warehouseId?: number;
}
/** 产品库存查询参数 */
export interface StockQueryParams {
productId: number;
warehouseId: number;
}
}
/**
*
*/
export function getStockPage(params: ErpStockApi.StockPageParams) {
return requestClient.get<PageResult<ErpStockApi.Stock>>('/erp/stock/page', {
params,
});
}
/**
*
*/
export function getStock(id: number) {
return requestClient.get<ErpStockApi.Stock>(`/erp/stock/get?id=${id}`);
}
/**
*
*/
export function getStockByProductAndWarehouse(
params: ErpStockApi.StockQueryParams,
) {
return requestClient.get<ErpStockApi.Stock>('/erp/stock/get', {
params,
});
}
/**
*
*/
export function getStockCount(productId: number, warehouseId?: number) {
const params: any = { productId };
if (warehouseId !== undefined) {
params.warehouseId = warehouseId;
}
return requestClient.get<number>('/erp/stock/get-count', {
params,
});
}
/**
* Excel
*/
export function exportStock(params: ErpStockApi.StockPageParams) {
return requestClient.download('/erp/stock/export-excel', {
params,
});
}
/**
*
*/
export function getWarehouseStockCount(params: ErpStockApi.StockQueryParams) {
return requestClient.get<number>('/erp/stock/get-count', {
params,
});
}

View File

@ -1,77 +0,0 @@
import type { PageParam, PageResult } from '@vben/request';
import { requestClient } from '#/api/request';
export namespace ErpWarehouseApi {
/** ERP 仓库信息 */
export interface Warehouse {
id?: number; // 仓库编号
name: string; // 仓库名称
address: string; // 仓库地址
sort: number; // 排序
remark: string; // 备注
principal: string; // 负责人
warehousePrice: number; // 仓储费,单位:元
truckagePrice: number; // 搬运费,单位:元
status: number; // 开启状态
defaultStatus: boolean; // 是否默认
}
/** 仓库分页查询参数 */
export interface WarehousePageParam extends PageParam {
name?: string;
status?: number;
}
}
/** 查询仓库分页 */
export function getWarehousePage(params: ErpWarehouseApi.WarehousePageParam) {
return requestClient.get<PageResult<ErpWarehouseApi.Warehouse>>(
'/erp/warehouse/page',
{ params },
);
}
/** 查询仓库精简列表 */
export function getWarehouseSimpleList() {
return requestClient.get<ErpWarehouseApi.Warehouse[]>(
'/erp/warehouse/simple-list',
);
}
/** 查询仓库详情 */
export function getWarehouse(id: number) {
return requestClient.get<ErpWarehouseApi.Warehouse>(
`/erp/warehouse/get?id=${id}`,
);
}
/** 新增仓库 */
export function createWarehouse(data: ErpWarehouseApi.Warehouse) {
return requestClient.post('/erp/warehouse/create', data);
}
/** 修改仓库 */
export function updateWarehouse(data: ErpWarehouseApi.Warehouse) {
return requestClient.put('/erp/warehouse/update', data);
}
/** 修改仓库默认状态 */
export function updateWarehouseDefaultStatus(
id: number,
defaultStatus: boolean,
) {
return requestClient.put('/erp/warehouse/update-default-status', null, {
params: { id, defaultStatus },
});
}
/** 删除仓库 */
export function deleteWarehouse(id: number) {
return requestClient.delete(`/erp/warehouse/delete?id=${id}`);
}
/** 导出仓库 Excel */
export function exportWarehouse(params: any) {
return requestClient.download('/erp/warehouse/export-excel', { params });
}

View File

@ -16,7 +16,6 @@ export namespace InfraFileConfigApi {
accessKey?: string;
accessSecret?: string;
pathStyle?: boolean;
enablePublicAccess?: boolean;
domain: string;
}

View File

@ -12,7 +12,6 @@ import {
RequestClient,
} from '@vben/request';
import { useAccessStore } from '@vben/stores';
import { createApiEncrypt } from '@vben/utils';
import { message } from 'ant-design-vue';
@ -22,7 +21,6 @@ import { refreshTokenApi } from './core';
const { apiURL } = useAppConfig(import.meta.env, import.meta.env.PROD);
const tenantEnable = isTenantEnable();
const apiEncrypt = createApiEncrypt(import.meta.env);
function createRequestClient(baseURL: string, options?: RequestClientOptions) {
const client = new RequestClient({
@ -86,46 +84,10 @@ function createRequestClient(baseURL: string, options?: RequestClientOptions) {
config.headers['visit-tenant-id'] = tenantEnable
? accessStore.visitTenantId
: undefined;
// 是否 API 加密
if ((config.headers || {}).isEncrypt) {
try {
// 加密请求数据
if (config.data) {
config.data = apiEncrypt.encryptRequest(config.data);
// 设置加密标识头
config.headers[apiEncrypt.getEncryptHeader()] = 'true';
}
} catch (error) {
console.error('请求数据加密失败:', error);
throw error;
}
}
return config;
},
});
// API 解密响应拦截器
client.addResponseInterceptor({
fulfilled: (response) => {
// 检查是否需要解密响应数据
const encryptHeader = apiEncrypt.getEncryptHeader();
const isEncryptResponse =
response.headers[encryptHeader] === 'true' ||
response.headers[encryptHeader.toLowerCase()] === 'true';
if (isEncryptResponse && typeof response.data === 'string') {
try {
// 解密响应数据
response.data = apiEncrypt.decryptResponse(response.data);
} catch (error) {
console.error('响应数据解密失败:', error);
throw new Error(`响应数据解密失败: ${(error as Error).message}`);
}
}
return response;
},
});
// 处理返回的响应数据格式
client.addResponseInterceptor(
defaultResponseInterceptor({

View File

@ -8,9 +8,7 @@ export namespace SystemMailLogApi {
id: number;
userId: number;
userType: number;
toMails: string[];
ccMails?: string[];
bccMails?: string[];
toMail: string;
accountId: number;
fromMail: string;
templateId: number;
@ -34,3 +32,15 @@ export function getMailLogPage(params: PageParam) {
{ params },
);
}
/** 查询邮件日志详情 */
export function getMailLog(id: number) {
return requestClient.get<SystemMailLogApi.MailLog>(
`/system/mail-log/get?id=${id}`,
);
}
/** 重新发送邮件 */
export function resendMail(id: number) {
return requestClient.put(`/system/mail-log/resend?id=${id}`);
}

View File

@ -20,9 +20,7 @@ export namespace SystemMailTemplateApi {
/** 邮件发送信息 */
export interface MailSendReq {
toMails: string[];
ccMails?: string[];
bccMails?: string[];
mail: string;
templateCode: string;
templateParams: Record<string, any>;
}

View File

@ -12,7 +12,7 @@ export namespace SystemTenantApi {
contactMobile: string;
accountCount: number;
expireTime: Date;
websites: string[];
website: string;
status: number;
}
}

View File

@ -1,3 +1,2 @@
export { default as Tinyflow } from './tinyflow.vue';
export * from './ui/typing';

View File

@ -359,8 +359,7 @@ async function saveConfig() {
currentNode.value.signEnable = configForm.value.signEnable;
//
currentNode.value.reasonRequire = configForm.value.reasonRequire;
//
currentNode.value.skipExpression = configForm.value.skipExpression;
currentNode.value.showText = getShowText();
drawerApi.close();
return true;
@ -444,8 +443,7 @@ function showUserTaskNodeConfig(node: SimpleFlowNode) {
configForm.value.signEnable = node?.signEnable ?? false;
// 7.
configForm.value.reasonRequire = node?.reasonRequire ?? false;
// 8.
configForm.value.skipExpression = node?.skipExpression ?? '';
drawerApi.open();
}
@ -852,7 +850,7 @@ onMounted(() => {
label="流程表达式"
name="expression"
>
<Textarea v-model:value="configForm.expression" allow-clear />
<Textarea v-model:value="configForm.expression" clearable />
</FormItem>
<!-- 多人审批/办理 方式 -->
<FormItem :label="`多人${nodeTypeName}方式`" name="approveMethod">
@ -1119,16 +1117,6 @@ onMounted(() => {
/>
</FormItem>
</div>
<div>
<Divider content-position="left">跳过表达式</Divider>
<FormItem prop="skipExpression">
<Textarea
v-model:value="configForm.skipExpression"
allow-clear
:rows="2"
/>
</FormItem>
</div>
</Form>
</div>
</TabPane>

View File

@ -602,8 +602,6 @@ export interface SimpleFlowNode {
signEnable?: boolean;
// 审批意见
reasonRequire?: boolean;
// 跳过表达式
skipExpression?: string;
// 触发器设置
triggerSetting?: TriggerSetting;
// 子流程

View File

@ -214,7 +214,6 @@ export type UserTaskFormType = {
returnNodeId?: string;
roleIds?: number[]; // 角色
signEnable: boolean;
skipExpression?: string; // 跳过表达式
taskAssignListener?: {
body: HttpRequestParam[];
header: HttpRequestParam[];

View File

@ -137,7 +137,7 @@ function handleButtonClick(action: ActionItem) {
}
}
/** 监听props变化强制重新计算 */
// props
watch(
() => [props.actions, props.dropDownActions],
() => {

View File

@ -979,11 +979,11 @@ export enum BpmTaskStatusEnum {
*
*/
APPROVE = 2,
/**
*
*/
APPROVING = 7,
/**
*
*/
@ -992,6 +992,7 @@ export enum BpmTaskStatusEnum {
*
*/
NOT_START = -1,
/**
*
*/
@ -1001,15 +1002,10 @@ export enum BpmTaskStatusEnum {
* 退
*/
RETURN = 5,
/**
*
*/
RUNNING = 1,
/**
*
*/
SKIP = -2,
/**
*
*/

View File

@ -4,7 +4,6 @@
// TODO @芋艿:后续这些 form-create 的优化;另外需要使用 form-create-helper 会好点
import { isRef } from 'vue';
import formCreate from '@form-create/ant-design-vue';
// 编码表单 Conf
export const encodeConf = (designerRef: any) => {
return JSON.stringify(designerRef.value.getOption());
@ -24,7 +23,7 @@ export const encodeFields = (designerRef: any) => {
export const decodeFields = (fields: string[]) => {
const rule: object[] = [];
fields.forEach((item) => {
rule.push(formCreate.parseJson(item));
rule.push(JSON.parse(item));
});
return rule;
};
@ -35,7 +34,7 @@ export const setConfAndFields = (
conf: string,
fields: string | string[],
) => {
designerRef.value.setOption(formCreate.parseJson(conf));
designerRef.value.setOption(JSON.parse(conf));
// 处理 fields 参数类型,确保传入 decodeFields 的是 string[] 类型
const fieldsArray = Array.isArray(fields) ? fields : [fields];
designerRef.value.setRule(decodeFields(fieldsArray));
@ -51,7 +50,7 @@ export const setConfAndFields2 = (
if (isRef(detailPreview)) {
detailPreview = detailPreview.value;
}
detailPreview.option = formCreate.parseJson(conf);
detailPreview.option = JSON.parse(conf);
detailPreview.rule = decodeFields(fields);
if (value) {
detailPreview.value = value;

View File

@ -1,5 +1,4 @@
<script lang="ts" setup>
// TODO @gjdhttps://t.zsxq.com/pmNb1 AI
import type { AiChatConversationApi } from '#/api/ai/chat/conversation';
import type { AiChatMessageApi } from '#/api/ai/chat/message';
@ -24,7 +23,6 @@ import MessageList from './components/message/MessageList.vue';
import MessageListEmpty from './components/message/MessageListEmpty.vue';
import MessageLoading from './components/message/MessageLoading.vue';
import MessageNewConversation from './components/message/MessageNewConversation.vue';
/** AI 聊天对话 列表 */
defineOptions({ name: 'AiChat' });

View File

@ -104,10 +104,7 @@ onMounted(async () => {
</template>
<template #userId="{ row }">
<span>
{{
userList.find((item: SystemUserApi.User) => item.id === row.userId)
?.nickname
}}
{{ userList.find((item) => item.id === row.userId)?.nickname }}
</span>
</template>
<template #publicStatus="{ row }">

View File

@ -108,10 +108,7 @@ onMounted(async () => {
</template>
<template #userId="{ row }">
<span>
{{
userList.find((item: SystemUserApi.User) => item.id === row.userId)
?.nickname
}}
{{ userList.find((item) => item.id === row.userId)?.nickname }}
</span>
</template>
<template #actions="{ row }">

View File

@ -112,11 +112,7 @@ onMounted(async () => {
</template>
<template #keyId="{ row }">
<span>
{{
apiKeyList.find(
(item: AiModelApiKeyApi.ApiKey) => item.id === row.keyId,
)?.name
}}
{{ apiKeyList.find((item) => item.id === row.keyId)?.name }}
</span>
</template>
<template #actions="{ row }">

View File

@ -123,7 +123,6 @@ const formData: any = ref({
enable: false,
summary: [],
},
allowWithdrawTask: false,
});
//
@ -179,16 +178,6 @@ async function initData() {
//
if (route.params.type === 'copy') {
delete formData.value.id;
if (formData.value.bpmnXml) {
formData.value.bpmnXml = formData.value.bpmnXml.replaceAll(
formData.value.name,
`${formData.value.name}副本`,
);
formData.value.bpmnXml = formData.value.bpmnXml.replaceAll(
formData.value.key,
`${formData.value.key}_copy`,
);
}
formData.value.name += '副本';
formData.value.key += '_copy';
}

View File

@ -69,27 +69,7 @@ const selectedUsers = ref<number[]>();
const rules: Record<string, Rule[]> = {
name: [{ required: true, message: '流程名称不能为空', trigger: 'blur' }],
key: [
{ required: true, message: '流程标识不能为空', trigger: 'blur' },
{
validator: (_rule: any, value: string, callback: any) => {
if (!value) {
callback();
return;
}
if (!/^[a-z_][\-\w.$]*$/i.test(value)) {
callback(
new Error(
'只能包含字母、数字、下划线、连字符和点号,且必须以字母或下划线开头',
),
);
return;
}
callback();
},
trigger: 'blur',
},
],
key: [{ required: true, message: '流程标识不能为空', trigger: 'blur' }],
category: [{ required: true, message: '流程分类不能为空', trigger: 'blur' }],
type: [{ required: true, message: '流程类型不能为空', trigger: 'blur' }],
visible: [{ required: true, message: '是否可见不能为空', trigger: 'blur' }],

View File

@ -1,5 +1,5 @@
<script setup lang="ts">
import { computed, provide, ref, watch } from 'vue';
import { computed, ref, watch } from 'vue';
import { CircleHelp } from '@vben/icons';
@ -146,7 +146,7 @@ function handleTaskAfterTriggerEnableChange(val: boolean | number | string) {
: null;
}
/** 表单字段 */
/** 表单选项 */
const formField = ref<Array<{ field: string; title: string }>>([]);
const formFieldOptions4Title = computed(() => {
const cloneFormField = formField.value.map((item) => {
@ -178,9 +178,6 @@ const formFieldOptions4Summary = computed(() => {
};
});
});
const unParsedFormFields = ref<string[]>([]); //
// HttpRequestSetting 使
provide('formFields', unParsedFormFields);
/** 兼容以前未配置更多设置的流程 */
function initData() {
@ -220,9 +217,6 @@ function initData() {
if (modelData.value.taskAfterTriggerSetting) {
taskAfterTriggerEnable.value = true;
}
if (modelData.value.allowWithdrawTask === undefined) {
modelData.value.allowWithdrawTask = false;
}
}
/** 监听表单 ID 变化,加载表单数据 */
@ -233,7 +227,6 @@ watch(
const data = await FormApi.getFormDetail(newFormId);
const result: Array<{ field: string; title: string }> = [];
if (data.fields) {
unParsedFormFields.value = data.fields;
data.fields.forEach((fieldStr: string) => {
parseFormFields(JSON.parse(fieldStr), result);
});
@ -241,7 +234,6 @@ watch(
formField.value = result;
} else {
formField.value = [];
unParsedFormFields.value = [];
}
},
{ immediate: true },
@ -275,18 +267,6 @@ defineExpose({ initData, validate });
</div>
</div>
</FormItem>
<FormItem class="mb-5" label="审批人权限">
<div class="mt-1 flex flex-col">
<Checkbox v-model:checked="modelData.allowWithdrawTask">
允许审批人撤回任务
</Checkbox>
<div class="ml-6">
<TypographyText type="secondary">
审批人可撤回正在审批节点的前一节点
</TypographyText>
</div>
</div>
</FormItem>
<FormItem v-if="modelData.processIdRule" class="mb-5" label="流程编码">
<Row :gutter="8" align="middle">
<Col :span="1">

View File

@ -415,7 +415,6 @@ const handleRenameSuccess = () => {
>
<div class="flex h-12 items-center">
<!-- 头部分类名 -->
<!-- TODO @jason1无法拖动排序2拖动后直接请求排序不用有个保存排序模型分类和排序分类里的模型交互有点不同哈 -->
<div class="flex items-center">
<Tooltip v-if="isCategorySorting" title="拖动排序">
<span

View File

@ -7,7 +7,6 @@ import { computed, nextTick, ref, watch } from 'vue';
import { useTabs } from '@vben/hooks';
import { IconifyIcon } from '@vben/icons';
import formCreate from '@form-create/ant-design-vue';
import { Button, Card, Col, message, Row, Space, Tabs } from 'ant-design-vue';
import { getProcessDefinition } from '#/api/bpm/definition';
@ -51,9 +50,6 @@ const props = defineProps({
const emit = defineEmits(['cancel']);
// form-create
const isFormReady = ref(false);
const { closeCurrentTab } = useTabs();
const getTitle = computed(() => {
@ -130,18 +126,16 @@ async function initProcessInfo(row: any, formVariables?: any) {
// formVariables row.formFields
// formVariables
//
const formApi = formCreate.create(decodeFields(row.formFields));
const allowedFields = formApi.fields();
const allowedFields = new Set(
decodeFields(row.formFields).map((fieldObj: any) => fieldObj.field),
);
for (const key in formVariables) {
if (!allowedFields.includes(key)) {
if (!allowedFields.has(key)) {
delete formVariables[key];
}
}
setConfAndFields2(detailForm, row.formConf, row.formFields, formVariables);
//
isFormReady.value = true;
await nextTick();
fApi.value?.btn.show(false); //
@ -298,7 +292,6 @@ defineExpose({ initProcessInfo });
class="flex-1 overflow-auto"
>
<form-create
v-if="isFormReady"
:rule="detailForm.rule"
v-model:api="fApi"
v-model="detailForm.value"

View File

@ -2,8 +2,6 @@
import type { BpmProcessInstanceApi } from '#/api/bpm/processInstance';
import type { SystemUserApi } from '#/api/system/user';
// TODO @jason https://t.zsxq.com/eif2e
import { nextTick, onMounted, ref, shallowRef, watch } from 'vue';
import { Page } from '@vben/common-ui';

View File

@ -4,7 +4,7 @@ import type { Rule } from 'ant-design-vue/es/form';
import type { BpmProcessInstanceApi } from '#/api/bpm/processInstance';
import { computed, nextTick, reactive, ref, watch } from 'vue';
import { computed, reactive, ref, watch } from 'vue';
import { useRouter } from 'vue-router';
import { useVbenModal } from '@vben/common-ui';
@ -102,7 +102,6 @@ const approveSignFormRef = ref();
const nextAssigneesActivityNode = ref<BpmProcessInstanceApi.ApprovalNodeInfo[]>(
[],
); //
const nextAssigneesTimelineRef = ref(); // 线
const approveReasonForm: any = reactive({
reason: '',
signPicUrl: '',
@ -279,10 +278,6 @@ function closePopover(type: string, formRef: any | FormInstance) {
}
if (popOverVisible.value[type]) popOverVisible.value[type] = false;
nextAssigneesActivityNode.value = [];
// Timeline
if (nextAssigneesTimelineRef.value) {
nextAssigneesTimelineRef.value.batchSetCustomApproveUsers({});
}
}
/** 流程通过时,根据表单变量查询新的流程节点,判断下一个节点类型是否为自选审批人 */
@ -295,7 +290,6 @@ async function initNextAssigneesFormField() {
processVariablesStr: JSON.stringify(variables),
});
if (data && data.length > 0) {
const customApproveUsersData: Record<string, any[]> = {}; // Timeline
data.forEach((node: BpmProcessInstanceApi.ApprovalNodeInfo) => {
if (
//
@ -308,23 +302,7 @@ async function initNextAssigneesFormField() {
) {
nextAssigneesActivityNode.value.push(node);
}
// candidateUsers customApproveUsers
if (node.candidateUsers && node.candidateUsers.length > 0) {
customApproveUsersData[node.id] = node.candidateUsers;
}
});
// candidateUsers Timeline
await nextTick(); // tick Timeline
if (
nextAssigneesTimelineRef.value &&
Object.keys(customApproveUsersData).length > 0
) {
nextAssigneesTimelineRef.value.batchSetCustomApproveUsers(
customApproveUsersData,
);
}
}
}
@ -386,10 +364,6 @@ async function handleAudit(pass: boolean, formRef: FormInstance | undefined) {
await TaskApi.approveTask(data);
popOverVisible.value.approve = false;
nextAssigneesActivityNode.value = [];
// Timeline
if (nextAssigneesTimelineRef.value) {
nextAssigneesTimelineRef.value.batchSetCustomApproveUsers({});
}
message.success('审批通过成功');
} else {
//
@ -759,10 +733,9 @@ defineExpose({ loadTodoTask });
>
<div class="-mb-8 -mt-3.5 ml-2.5">
<ProcessInstanceTimeline
ref="nextAssigneesTimelineRef"
:activity-nodes="nextAssigneesActivityNode"
:show-status-icon="false"
:enable-approve-user-select="true"
:use-next-assignees="true"
@select-user-confirm="selectNextAssigneesConfirm"
/>
</div>

View File

@ -23,12 +23,12 @@ defineOptions({ name: 'BpmProcessInstanceTimeline' });
const props = withDefaults(
defineProps<{
activityNodes: BpmProcessInstanceApi.ApprovalNodeInfo[]; //
enableApproveUserSelect?: boolean; //
showStatusIcon?: boolean; //
useNextAssignees?: boolean; //
}>(),
{
showStatusIcon: true, // true
enableApproveUserSelect: false, // false
useNextAssignees: false, // false
},
);
@ -43,8 +43,6 @@ const statusIconMap: Record<
string,
{ animation?: string; color: string; icon: string }
> = {
//
'-2': { color: '#909398', icon: 'mdi:skip-forward-outline' },
//
'-1': { color: '#909398', icon: 'mdi:clock-outline' },
//
@ -183,9 +181,6 @@ function handleUserSelectConfirm(userList: any[]) {
/** 跳转子流程 */
function handleChildProcess(activity: any) {
if (!activity.processInstanceId) {
return;
}
push({
name: 'BpmProcessInstanceDetail',
query: {
@ -200,12 +195,12 @@ function shouldShowCustomUserSelect(
) {
return (
isEmpty(activity.tasks) &&
((BpmCandidateStrategyEnum.START_USER_SELECT ===
activity.candidateStrategy &&
isEmpty(activity.candidateUsers)) ||
(props.enableApproveUserSelect &&
BpmCandidateStrategyEnum.APPROVE_USER_SELECT ===
activity.candidateStrategy))
isEmpty(activity.candidateUsers) &&
(BpmCandidateStrategyEnum.START_USER_SELECT ===
activity.candidateStrategy ||
(BpmCandidateStrategyEnum.APPROVE_USER_SELECT ===
activity.candidateStrategy &&
props.useNextAssignees))
);
}
@ -228,21 +223,6 @@ function handleUserSelectClosed() {
function handleUserSelectCancel() {
selectedUsers.value = [];
}
/** 设置自定义审批人 */
const setCustomApproveUsers = (activityId: string, users: any[]) => {
customApproveUsers.value[activityId] = users || [];
};
/** 批量设置多个节点的自定义审批人 */
const batchSetCustomApproveUsers = (data: Record<string, any[]>) => {
Object.keys(data).forEach((activityId) => {
customApproveUsers.value[activityId] = data[activityId] || [];
});
};
//
defineExpose({ setCustomApproveUsers, batchSetCustomApproveUsers });
</script>
<template>
@ -287,12 +267,7 @@ defineExpose({ setCustomApproveUsers, batchSetCustomApproveUsers });
>
<!-- 第一行节点名称时间 -->
<div class="flex w-full">
<div class="font-bold">
{{ activity.name }}
<span v-if="activity.status === BpmTaskStatusEnum.SKIP">
跳过
</span>
</div>
<div class="font-bold">{{ activity.name }}</div>
<!-- 信息时间 -->
<div
v-if="activity.status !== BpmTaskStatusEnum.NOT_START"
@ -309,7 +284,6 @@ defineExpose({ setCustomApproveUsers, batchSetCustomApproveUsers });
ghost
size="small"
@click="handleChildProcess(activity)"
:disabled="!activity.processInstanceId"
>
查看子流程
</Button>

View File

@ -4,10 +4,8 @@ import type { BpmTaskApi } from '#/api/bpm/task';
import { DocAlert, Page } from '@vben/common-ui';
import { message } from 'ant-design-vue';
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import { getTaskDonePage, withdrawTask } from '#/api/bpm/task';
import { getTaskDonePage } from '#/api/bpm/task';
import { router } from '#/router';
import { useGridColumns, useGridFormSchema } from './data';
@ -25,15 +23,7 @@ function handleHistory(row: BpmTaskApi.TaskManager) {
});
}
/** 撤回任务 */
async function handleWithdraw(row: BpmTaskApi.TaskManager) {
await withdrawTask(row.id);
message.success('撤回成功');
//
await gridApi.query();
}
const [Grid, gridApi] = useVbenVxeGrid({
const [Grid] = useVbenVxeGrid({
formOptions: {
schema: useGridFormSchema(),
},
@ -62,7 +52,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
cellConfig: {
height: 64,
},
} as VxeTableGridOptions<BpmTaskApi.TaskManager>,
} as VxeTableGridOptions<BpmTaskApi.Task>,
});
</script>
@ -85,13 +75,6 @@ const [Grid, gridApi] = useVbenVxeGrid({
<template #actions="{ row }">
<TableAction
:actions="[
{
label: '撤回',
type: 'link',
icon: ACTION_ICON.EDIT,
color: 'warning',
onClick: handleWithdraw.bind(null, row),
},
{
label: '历史',
type: 'link',

View File

@ -66,7 +66,7 @@ function handleUpdateValue(row: any) {
} else {
tableData.value[index] = row;
}
emit('update:products', [...tableData.value]);
emit('update:products', tableData.value);
}
/** 表格配置 */

View File

@ -1,167 +0,0 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import { h } from 'vue';
import { Tag } from 'ant-design-vue';
import { z } from '#/adapter/form';
import { CommonStatusEnum, DICT_TYPE, getDictOptions } from '#/utils';
/** 新增/修改的表单 */
export function useFormSchema(): VbenFormSchema[] {
return [
{
component: 'Input',
fieldName: 'id',
dependencies: {
triggerFields: [''],
show: () => false,
},
},
{
component: 'Input',
fieldName: 'name',
label: '名称',
rules: 'required',
componentProps: {
placeholder: '请输入名称',
},
},
{
fieldName: 'status',
label: '状态',
component: 'RadioGroup',
componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
},
rules: z.number().default(CommonStatusEnum.ENABLE),
},
{
fieldName: 'sort',
label: '排序',
component: 'InputNumber',
componentProps: {
placeholder: '请输入排序',
precision: 0,
class: 'w-full',
},
rules: 'required',
defaultValue: 0,
},
{
fieldName: 'defaultStatus',
label: '是否默认',
component: 'RadioGroup',
componentProps: {
options: [
{
label: '是',
value: true,
},
{
label: '否',
value: false,
},
],
buttonStyle: 'solid',
optionType: 'button',
},
rules: z.boolean().default(false).optional(),
},
{
fieldName: 'no',
label: '编码',
component: 'Input',
componentProps: {
placeholder: '请输入编码',
},
},
{
fieldName: 'remark',
label: '备注',
component: 'Textarea',
},
];
}
/** 列表的搜索表单 */
export function useGridFormSchema(): VbenFormSchema[] {
return [
{
fieldName: 'name',
label: '名称',
component: 'Input',
},
{
fieldName: 'no',
label: '编码',
component: 'Input',
},
{
fieldName: 'remark',
label: '备注',
component: 'Input',
},
];
}
/** 列表的字段 */
export function useGridColumns(): VxeTableGridOptions['columns'] {
return [
{
field: 'name',
title: '名称',
},
{
field: 'no',
title: '编码',
},
{
field: 'remark',
title: '备注',
},
{
field: 'sort',
title: '排序',
},
{
field: 'status',
title: '状态',
cellRender: {
name: 'CellDict',
props: { type: DICT_TYPE.COMMON_STATUS },
},
},
{
field: 'defaultStatus',
title: '是否默认',
slots: {
default: ({ row }) => {
return h(
Tag,
{
class: 'mr-1',
color: row.defaultStatus ? 'blue' : 'red',
},
() => (row.defaultStatus ? '是' : '否'),
);
},
},
},
{
field: 'createTime',
title: '创建时间',
formatter: 'formatDateTime',
},
{
title: '操作',
width: 130,
fixed: 'right',
slots: { default: 'actions' },
},
];
}

View File

@ -1,152 +1,34 @@
<script lang="ts" setup>
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { ErpAccountApi } from '#/api/erp/finance/account';
import { DocAlert, Page } from '@vben/common-ui';
import { DocAlert, Page, useVbenModal } from '@vben/common-ui';
import { downloadFileFromBlobPart } from '@vben/utils';
import { message } from 'ant-design-vue';
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import {
deleteAccount,
exportAccount,
getAccountPage,
} from '#/api/erp/finance/account';
import { $t } from '#/locales';
import { useGridColumns, useGridFormSchema } from './data';
import Form from './modules/form.vue';
const [FormModal, formModalApi] = useVbenModal({
connectedComponent: Form,
destroyOnClose: true,
});
/** 刷新表格 */
function onRefresh() {
gridApi.query();
}
/** 导出表格 */
async function handleExport() {
const data = await exportAccount(await gridApi.formApi.getValues());
downloadFileFromBlobPart({ fileName: '结算账户信息.xls', source: data });
}
/** 创建结算账户 */
function handleCreate() {
formModalApi.setData(null).open();
}
/** 编辑结算账户 */
function handleEdit(row: ErpAccountApi.Account) {
formModalApi.setData(row).open();
}
/** 删除结算账户 */
async function handleDelete(row: ErpAccountApi.Account) {
const hideLoading = message.loading({
content: $t('ui.actionMessage.deleting', [row.name]),
key: 'action_key_msg',
});
try {
await deleteAccount(row.id as number);
message.success({
content: $t('ui.actionMessage.deleteSuccess', [row.name]),
key: 'action_key_msg',
});
onRefresh();
} finally {
hideLoading();
}
}
const [Grid, gridApi] = useVbenVxeGrid({
formOptions: {
schema: useGridFormSchema(),
},
gridOptions: {
columns: useGridColumns(),
height: 'auto',
keepSource: true,
proxyConfig: {
ajax: {
query: async ({ page }, formValues) => {
return await getAccountPage({
pageNo: page.currentPage,
pageSize: page.pageSize,
...formValues,
});
},
},
},
rowConfig: {
keyField: 'id',
isHover: true,
},
toolbarConfig: {
refresh: true,
search: true,
},
} as VxeTableGridOptions<ErpAccountApi.Account>,
});
import { Button } from 'ant-design-vue';
</script>
<template>
<Page auto-content-height>
<Page>
<template #doc>
<DocAlert
title="【财务】采购付款、销售收款"
url="https://doc.iocoder.cn/sale/finance-payment-receipt/"
/>
</template>
<FormModal @success="onRefresh" />
<Grid table-title="">
<template #toolbar-tools>
<TableAction
:actions="[
{
label: $t('ui.actionTitle.create', ['结算账户']),
type: 'primary',
icon: ACTION_ICON.ADD,
auth: ['erp:account:create'],
onClick: handleCreate,
},
{
label: $t('ui.actionTitle.export'),
type: 'primary',
icon: ACTION_ICON.DOWNLOAD,
auth: ['erp:account:export'],
onClick: handleExport,
},
]"
/>
</template>
<template #actions="{ row }">
<TableAction
:actions="[
{
label: $t('common.edit'),
type: 'link',
icon: ACTION_ICON.EDIT,
auth: ['erp:account:update'],
onClick: handleEdit.bind(null, row),
},
{
label: $t('common.delete'),
type: 'link',
danger: true,
icon: ACTION_ICON.DELETE,
auth: ['erp:account:delete'],
popConfirm: {
title: $t('ui.actionMessage.deleteConfirm', [row.name]),
confirm: handleDelete.bind(null, row),
},
},
]"
/>
</template>
</Grid>
<Button
danger
type="link"
target="_blank"
href="https://github.com/yudaocode/yudao-ui-admin-vue3"
>
该功能支持 Vue3 + element-plus 版本
</Button>
<br />
<Button
type="link"
target="_blank"
href="https://github.com/yudaocode/yudao-ui-admin-vue3/blob/master/src/views/erp/finance/account/index"
>
可参考
https://github.com/yudaocode/yudao-ui-admin-vue3/blob/master/src/views/erp/finance/account/index
代码pull request 贡献给我们
</Button>
</Page>
</template>

View File

@ -1,86 +0,0 @@
<script lang="ts" setup>
import type { ErpAccountApi } from '#/api/erp/finance/account';
import { computed, ref } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { message } from 'ant-design-vue';
import { useVbenForm } from '#/adapter/form';
import {
createAccount,
getAccount,
updateAccount,
} from '#/api/erp/finance/account';
import { $t } from '#/locales';
import { useFormSchema } from '../data';
const emit = defineEmits(['success']);
const formData = ref<ErpAccountApi.Account>();
const getTitle = computed(() => {
return formData.value?.id
? $t('ui.actionTitle.edit', ['结算产品'])
: $t('ui.actionTitle.create', ['结算产品']);
});
const [Form, formApi] = useVbenForm({
commonConfig: {
componentProps: {
class: 'w-full',
},
},
// 2
wrapperClass: 'grid-cols-1',
layout: 'horizontal',
schema: useFormSchema(),
showDefaultActions: false,
});
const [Modal, modalApi] = useVbenModal({
async onConfirm() {
const { valid } = await formApi.validate();
if (!valid) {
return;
}
modalApi.lock();
//
const data = (await formApi.getValues()) as ErpAccountApi.Account;
try {
await (formData.value?.id ? updateAccount(data) : createAccount(data));
//
await modalApi.close();
emit('success');
message.success($t('ui.actionMessage.operationSuccess'));
} finally {
modalApi.unlock();
}
},
async onOpenChange(isOpen: boolean) {
if (!isOpen) {
formData.value = undefined;
return;
}
//
const data = modalApi.getData<ErpAccountApi.Account>();
if (!data || !data.id) {
return;
}
modalApi.lock();
try {
formData.value = await getAccount(data.id as number);
// values
await formApi.setValues(formData.value);
} finally {
modalApi.unlock();
}
},
});
</script>
<template>
<Modal class="w-2/5" :title="getTitle">
<Form class="mx-4" />
</Modal>
</template>

View File

@ -1,70 +0,0 @@
<script lang="ts" setup>
import type { AnalysisOverviewItem } from '@vben/common-ui';
import { computed } from 'vue';
import { AnalysisOverview } from '@vben/common-ui';
import {
SvgBellIcon,
SvgCakeIcon,
SvgCardIcon,
SvgDownloadIcon,
} from '@vben/icons';
interface Props {
saleSummary?: {
monthPrice?: number;
todayPrice?: number;
yearPrice?: number;
yesterdayPrice?: number;
};
purchaseSummary?: {
monthPrice?: number;
todayPrice?: number;
yearPrice?: number;
yesterdayPrice?: number;
};
}
const props = withDefaults(defineProps<Props>(), {
saleSummary: () => ({}),
purchaseSummary: () => ({}),
});
/** 概览数据 */
// TODO @nehc 8 4
const overviewItems = computed<AnalysisOverviewItem[]>(() => [
{
icon: SvgCardIcon,
title: '今日销售',
totalTitle: '今日采购',
totalValue: props.purchaseSummary?.todayPrice || 0,
value: props.saleSummary?.todayPrice || 0,
},
{
icon: SvgCakeIcon,
title: '昨日销售',
totalTitle: '昨日采购',
totalValue: props.purchaseSummary?.yesterdayPrice || 0,
value: props.saleSummary?.yesterdayPrice || 0,
},
{
icon: SvgDownloadIcon,
title: '本月销售',
totalTitle: '本月采购',
totalValue: props.purchaseSummary?.monthPrice || 0,
value: props.saleSummary?.monthPrice || 0,
},
{
icon: SvgBellIcon,
title: '今年销售',
totalTitle: '今年采购',
totalValue: props.purchaseSummary?.yearPrice || 0,
value: props.saleSummary?.yearPrice || 0,
},
]);
</script>
<template>
<AnalysisOverview :items="overviewItems" />
</template>

View File

@ -1,174 +0,0 @@
<script lang="ts" setup>
import type { EChartsOption } from 'echarts';
import type { EchartsUIType } from '@vben/plugins/echarts';
import type { ErpPurchaseStatisticsApi } from '#/api/erp/statistics/purchase';
import type { ErpSaleStatisticsApi } from '#/api/erp/statistics/sale';
import { onMounted, ref, watch } from 'vue';
import { EchartsUI, useEcharts } from '@vben/plugins/echarts';
import { Card } from 'ant-design-vue';
import {
getPurchaseSummary,
getPurchaseTimeSummary,
} from '#/api/erp/statistics/purchase';
import { getSaleSummary, getSaleTimeSummary } from '#/api/erp/statistics/sale';
interface Props {
title: string;
type?: 'purchase' | 'sale';
}
const props = withDefaults(defineProps<Props>(), {
type: 'sale',
});
/** 销售统计数据 */
const saleSummary = ref<ErpSaleStatisticsApi.SaleSummary>(); //
const saleTimeSummaryList = ref<ErpSaleStatisticsApi.SaleTimeSummary[]>(); //
const getSaleStatistics = async () => {
saleSummary.value = await getSaleSummary();
saleTimeSummaryList.value = await getSaleTimeSummary();
};
/** 采购统计数据 */
const purchaseSummary = ref<ErpPurchaseStatisticsApi.PurchaseSummary>(); //
const purchaseTimeSummaryList =
ref<ErpPurchaseStatisticsApi.PurchaseTimeSummary[]>(); //
const getPurchaseStatistics = async () => {
purchaseSummary.value = await getPurchaseSummary();
purchaseTimeSummaryList.value = await getPurchaseTimeSummary();
};
/** 获取当前类型的时段数据 */
const currentTimeSummaryList = ref<Array<{ price: number; time: string }>>();
const chartRef = ref<EchartsUIType>();
const { renderEcharts } = useEcharts(chartRef);
/** 折线图配置 */
const lineChartOptions: EChartsOption = {
grid: {
left: 20,
right: 20,
bottom: 20,
top: 80,
containLabel: true,
},
legend: {
top: 50,
},
series: [
{
name: '金额',
type: 'line',
smooth: true,
areaStyle: {},
data: [],
},
],
toolbox: {
feature: {
dataZoom: {
yAxisIndex: false,
},
brush: {
type: ['lineX', 'clear'],
},
saveAsImage: {
show: true,
name: props.title,
},
},
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
},
padding: [5, 10],
},
xAxis: {
type: 'category',
boundaryGap: false,
axisTick: {
show: false,
},
data: [],
},
yAxis: {
axisTick: {
show: false,
},
},
};
/** 初始化数据 */
const initData = async () => {
if (props.type === 'sale') {
await getSaleStatistics();
currentTimeSummaryList.value = saleTimeSummaryList.value;
} else {
await getPurchaseStatistics();
currentTimeSummaryList.value = purchaseTimeSummaryList.value;
}
};
/** 监听数据变化并更新图表 */
watch(
() => currentTimeSummaryList.value,
(val) => {
if (!val || val.length === 0) {
return;
}
//
const xAxisData = val.map((item) => item.time);
const seriesData = val.map((item) => item.price);
const options = {
...lineChartOptions,
xAxis: {
...lineChartOptions.xAxis,
data: xAxisData,
},
series: [
{
...lineChartOptions.series![0],
data: seriesData,
},
],
};
renderEcharts(options);
},
{ immediate: true },
);
/** 组件挂载时初始化数据 */
onMounted(() => {
initData();
});
/** 暴露数据给父组件使用 */
defineExpose({
saleSummary,
purchaseSummary,
saleTimeSummaryList,
purchaseTimeSummaryList,
});
</script>
<template>
<Card>
<template #title>
<span>{{ title }}</span>
</template>
<!-- 折线图 -->
<EchartsUI ref="chartRef" />
</Card>
</template>

View File

@ -1,21 +1,7 @@
<script lang="ts" setup>
import { ref } from 'vue';
import { DocAlert, Page } from '@vben/common-ui';
import { Col, Row, Spin } from 'ant-design-vue';
import SummaryCard from './components/SummaryCard.vue';
import TimeSummaryChart from './components/TimeSummaryChart.vue';
/** ERP首页 */
defineOptions({ name: 'ErpHome' });
const loading = ref(false); //
/** 图表组件引用 */
const saleChartRef = ref();
const purchaseChartRef = ref();
import { Button } from 'ant-design-vue';
</script>
<template>
@ -26,28 +12,23 @@ const purchaseChartRef = ref();
url="https://doc.iocoder.cn/erp/build/"
/>
</template>
<Spin :spinning="loading">
<div class="flex flex-col gap-4">
<!-- 销售/采购的全局统计 -->
<SummaryCard />
<!-- 销售/采购的时段统计 -->
<Row :gutter="16">
<!-- 销售统计 -->
<Col :md="12" :sm="12" :xs="24">
<TimeSummaryChart ref="saleChartRef" title="销售统计" type="sale" />
</Col>
<!-- 采购统计 -->
<Col :md="12" :sm="12" :xs="24">
<TimeSummaryChart
ref="purchaseChartRef"
title="采购统计"
type="purchase"
/>
</Col>
</Row>
</div>
</Spin>
<Button
danger
type="link"
target="_blank"
href="https://github.com/yudaocode/yudao-ui-admin-vue3"
>
该功能支持 Vue3 + element-plus 版本
</Button>
<br />
<Button
type="link"
target="_blank"
href="https://github.com/yudaocode/yudao-ui-admin-vue3/blob/master/src/views/erp/home/index.vue"
>
可参考
https://github.com/yudaocode/yudao-ui-admin-vue3/blob/master/src/views/erp/home/index.vue
代码pull request 贡献给我们
</Button>
</Page>
</template>

View File

@ -1,125 +0,0 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { ErpProductCategoryApi } from '#/api/erp/product/category';
import { handleTree } from '@vben/utils';
import { z } from '#/adapter/form';
import { getProductCategoryList } from '#/api/erp/product/category';
import { CommonStatusEnum, DICT_TYPE, getDictOptions } from '#/utils';
/** 新增/修改的表单 */
export function useFormSchema(): VbenFormSchema[] {
return [
{
fieldName: 'id',
component: 'Input',
dependencies: {
triggerFields: [''],
show: () => false,
},
},
{
fieldName: 'parentId',
label: '上级分类',
component: 'ApiTreeSelect',
componentProps: {
allowClear: true,
api: async () => {
const data = await getProductCategoryList();
data.unshift({
id: 0,
name: '顶级分类',
});
return handleTree(data);
},
labelField: 'name',
valueField: 'id',
childrenField: 'children',
placeholder: '请选择上级分类',
treeDefaultExpandAll: true,
},
rules: 'selectRequired',
},
{
fieldName: 'name',
label: '分类名称',
component: 'Input',
componentProps: {
placeholder: '请输入分类名称',
},
rules: 'required',
},
{
fieldName: 'code',
label: '分类编码',
component: 'Input',
componentProps: {
placeholder: '请输入分类编码',
},
rules: z.string().regex(/^[A-Z]+$/, '分类编码必须为大写字母'),
},
{
fieldName: 'sort',
label: '显示顺序',
component: 'InputNumber',
componentProps: {
min: 0,
controlsPosition: 'right',
placeholder: '请输入显示顺序',
},
rules: 'required',
},
{
fieldName: 'status',
label: '状态',
component: 'RadioGroup',
componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
},
rules: z.number().default(CommonStatusEnum.ENABLE),
},
];
}
/** 列表的字段 */
export function useGridColumns(): VxeTableGridOptions<ErpProductCategoryApi.ProductCategory>['columns'] {
return [
{
field: 'name',
title: '分类名称',
align: 'left',
treeNode: true,
},
{
field: 'code',
title: '分类编码',
},
{
field: 'sort',
title: '显示顺序',
},
{
field: 'status',
title: '分类状态',
cellRender: {
name: 'CellDict',
props: { type: DICT_TYPE.COMMON_STATUS },
},
},
{
field: 'createTime',
title: '创建时间',
formatter: 'formatDateTime',
},
{
title: '操作',
width: 220,
fixed: 'right',
slots: { default: 'actions' },
},
];
}

View File

@ -1,166 +1,34 @@
<script lang="ts" setup>
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { ErpProductCategoryApi } from '#/api/erp/product/category';
import { DocAlert, Page } from '@vben/common-ui';
import { ref } from 'vue';
import { DocAlert, Page, useVbenModal } from '@vben/common-ui';
import { message } from 'ant-design-vue';
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import {
deleteProductCategory,
getProductCategoryList,
} from '#/api/erp/product/category';
import { $t } from '#/locales';
import { useGridColumns } from './data';
import Form from './modules/form.vue';
const [FormModal, formModalApi] = useVbenModal({
connectedComponent: Form,
destroyOnClose: true,
});
/** 刷新表格 */
function onRefresh() {
gridApi.query();
}
/** 切换树形展开/收缩状态 */
const isExpanded = ref(true);
function toggleExpand() {
isExpanded.value = !isExpanded.value;
gridApi.grid.setAllTreeExpand(isExpanded.value);
}
/** 创建分类 */
function handleCreate() {
formModalApi.setData(null).open();
}
/** 添加下级分类 */
function handleAppend(row: ErpProductCategoryApi.ProductCategory) {
formModalApi.setData({ parentId: row.id }).open();
}
/** 编辑分类 */
function handleEdit(row: ErpProductCategoryApi.ProductCategory) {
formModalApi.setData(row).open();
}
/** 删除分类 */
async function handleDelete(row: ErpProductCategoryApi.ProductCategory) {
const hideLoading = message.loading({
content: $t('ui.actionMessage.deleting', [row.name]),
key: 'action_key_msg',
});
try {
await deleteProductCategory(row.id as number);
message.success({
content: $t('ui.actionMessage.deleteSuccess', [row.name]),
key: 'action_key_msg',
});
onRefresh();
} finally {
hideLoading();
}
}
const [Grid, gridApi] = useVbenVxeGrid({
gridOptions: {
columns: useGridColumns(),
height: 'auto',
proxyConfig: {
ajax: {
query: async () => {
return await getProductCategoryList();
},
},
},
pagerConfig: {
enabled: false,
},
rowConfig: {
keyField: 'id',
isHover: true,
},
toolbarConfig: {
refresh: true,
search: true,
},
treeConfig: {
transform: true,
rowField: 'id',
parentField: 'parentId',
expandAll: true,
accordion: false,
},
} as VxeTableGridOptions<ErpProductCategoryApi.ProductCategory>,
});
import { Button } from 'ant-design-vue';
</script>
<template>
<Page auto-content-height>
<Page>
<template #doc>
<DocAlert
title="【产品】产品信息、分类、单位"
url="https://doc.iocoder.cn/erp/product/"
/>
</template>
<FormModal @success="onRefresh" />
<Grid table-title="">
<template #toolbar-tools>
<TableAction
:actions="[
{
label: $t('ui.actionTitle.create', ['产品分类']),
type: 'primary',
icon: ACTION_ICON.ADD,
auth: ['erp:product-category:create'],
onClick: handleCreate,
},
{
label: isExpanded ? '收缩' : '展开',
type: 'primary',
onClick: toggleExpand,
},
]"
/>
</template>
<template #actions="{ row }">
<TableAction
:actions="[
{
label: '新增下级',
type: 'link',
icon: ACTION_ICON.ADD,
auth: ['erp:product-category:create'],
onClick: handleAppend.bind(null, row),
},
{
label: $t('common.edit'),
type: 'link',
icon: ACTION_ICON.EDIT,
auth: ['erp:product-category:update'],
onClick: handleEdit.bind(null, row),
},
{
label: $t('common.delete'),
type: 'link',
danger: true,
icon: ACTION_ICON.DELETE,
auth: ['erp:product-category:delete'],
ifShow: !(row.children && row.children.length > 0),
popConfirm: {
title: $t('ui.actionMessage.deleteConfirm', [row.name]),
confirm: handleDelete.bind(null, row),
},
},
]"
/>
</template>
</Grid>
<Button
danger
type="link"
target="_blank"
href="https://github.com/yudaocode/yudao-ui-admin-vue3"
>
该功能支持 Vue3 + element-plus 版本
</Button>
<br />
<Button
type="link"
target="_blank"
href="https://github.com/yudaocode/yudao-ui-admin-vue3/blob/master/src/views/erp/product/category/index"
>
可参考
https://github.com/yudaocode/yudao-ui-admin-vue3/blob/master/src/views/erp/product/category/index
代码pull request 贡献给我们
</Button>
</Page>
</template>

View File

@ -1,92 +0,0 @@
<script lang="ts" setup>
import type { ErpProductCategoryApi } from '#/api/erp/product/category';
import { computed, ref } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { message } from 'ant-design-vue';
import { useVbenForm } from '#/adapter/form';
import {
createProductCategory,
getProductCategory,
updateProductCategory,
} from '#/api/erp/product/category';
import { $t } from '#/locales';
import { useFormSchema } from '../data';
const emit = defineEmits(['success']);
const formData = ref<ErpProductCategoryApi.ProductCategory>();
const getTitle = computed(() => {
return formData.value?.id
? $t('ui.actionTitle.edit', ['分类'])
: $t('ui.actionTitle.create', ['分类']);
});
const [Form, formApi] = useVbenForm({
commonConfig: {
componentProps: {
class: 'w-full',
},
formItemClass: 'col-span-2',
labelWidth: 80,
},
layout: 'horizontal',
schema: useFormSchema(),
showDefaultActions: false,
});
const [Modal, modalApi] = useVbenModal({
async onConfirm() {
const { valid } = await formApi.validate();
if (!valid) {
return;
}
modalApi.lock();
//
const data =
(await formApi.getValues()) as ErpProductCategoryApi.ProductCategory;
try {
await (formData.value?.id
? updateProductCategory(data)
: createProductCategory(data));
//
await modalApi.close();
emit('success');
message.success($t('ui.actionMessage.operationSuccess'));
} finally {
modalApi.unlock();
}
},
async onOpenChange(isOpen: boolean) {
if (!isOpen) {
formData.value = undefined;
return;
}
//
let data = modalApi.getData<ErpProductCategoryApi.ProductCategory>();
if (!data) {
return;
}
if (data.id) {
modalApi.lock();
try {
data = await getProductCategory(data.id);
} finally {
modalApi.unlock();
}
}
// values
formData.value = data;
await formApi.setValues(formData.value);
},
});
</script>
<template>
<Modal :title="getTitle">
<Form class="mx-4" />
</Modal>
</template>

View File

@ -1,220 +0,0 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import { handleTree } from '@vben/utils';
import { z } from '#/adapter/form';
import { getProductCategorySimpleList } from '#/api/erp/product/category';
import { getProductUnitSimpleList } from '#/api/erp/product/unit';
import { CommonStatusEnum, DICT_TYPE, getDictOptions } from '#/utils';
/** 新增/修改的表单 */
export function useFormSchema(): VbenFormSchema[] {
return [
{
component: 'Input',
fieldName: 'id',
dependencies: {
triggerFields: [''],
show: () => false,
},
},
{
component: 'Input',
fieldName: 'name',
label: '名称',
rules: 'required',
componentProps: {
placeholder: '请输入名称',
},
},
{
fieldName: 'barCode',
label: '条码',
component: 'Input',
rules: 'required',
componentProps: {
placeholder: '请输入条码',
},
},
{
fieldName: 'categoryId',
label: '分类',
component: 'ApiTreeSelect',
componentProps: {
api: async () => {
const data = await getProductCategorySimpleList();
return handleTree(data);
},
labelField: 'name',
valueField: 'id',
childrenField: 'children',
placeholder: '请选择分类',
treeDefaultExpandAll: true,
},
rules: 'required',
},
{
fieldName: 'unitId',
label: '单位',
component: 'ApiSelect',
componentProps: {
api: getProductUnitSimpleList,
labelField: 'name',
valueField: 'id',
placeholder: '请选择单位',
},
rules: 'required',
},
{
fieldName: 'status',
label: '状态',
component: 'RadioGroup',
componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
},
rules: z.number().default(CommonStatusEnum.ENABLE),
},
{
fieldName: 'standard',
label: '规格',
component: 'Input',
componentProps: {
placeholder: '请输入规格',
},
},
{
fieldName: 'expiryDay',
label: '保质期天数',
component: 'InputNumber',
componentProps: {
placeholder: '请输入保质期天数',
},
},
{
fieldName: 'weight',
label: '重量kg',
component: 'InputNumber',
componentProps: {
placeholder: '请输入重量kg',
},
},
{
fieldName: 'purchasePrice',
label: '采购价格',
component: 'InputNumber',
componentProps: {
placeholder: '请输入采购价格,单位:元',
},
},
{
fieldName: 'salePrice',
label: '销售价格',
component: 'InputNumber',
componentProps: {
placeholder: '请输入销售价格,单位:元',
},
},
{
fieldName: 'minPrice',
label: '最低价格',
component: 'InputNumber',
componentProps: {
placeholder: '请输入最低价格,单位:元',
},
},
{
fieldName: 'remark',
label: '备注',
component: 'Textarea',
},
];
}
/** 列表的搜索表单 */
export function useGridFormSchema(): VbenFormSchema[] {
return [
{
fieldName: 'name',
label: '名称',
component: 'Input',
},
{
fieldName: 'categoryId',
label: '分类',
component: 'ApiTreeSelect',
componentProps: {
api: async () => {
const data = await getProductCategorySimpleList();
return handleTree(data);
},
labelField: 'name',
valueField: 'id',
childrenField: 'children',
placeholder: '请选择分类',
treeDefaultExpandAll: true,
},
},
];
}
/** 列表的字段 */
export function useGridColumns(): VxeTableGridOptions['columns'] {
return [
{
field: 'barCode',
title: '条码',
},
{
field: 'name',
title: '名称',
},
{
field: 'standard',
title: '规格',
},
{
field: 'categoryName',
title: '分类',
},
{
field: 'unitName',
title: '单位',
},
{
field: 'purchasePrice',
title: '采购价格',
},
{
field: 'salePrice',
title: '销售价格',
},
{
field: 'minPrice',
title: '最低价格',
},
{
field: 'status',
title: '状态',
cellRender: {
name: 'CellDict',
props: { type: DICT_TYPE.COMMON_STATUS },
},
},
{
field: 'createTime',
title: '创建时间',
formatter: 'formatDateTime',
},
{
title: '操作',
width: 130,
fixed: 'right',
slots: { default: 'actions' },
},
];
}

View File

@ -1,152 +1,34 @@
<script lang="ts" setup>
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { ErpProductApi } from '#/api/erp/product/product';
import { DocAlert, Page } from '@vben/common-ui';
import { DocAlert, Page, useVbenModal } from '@vben/common-ui';
import { downloadFileFromBlobPart } from '@vben/utils';
import { message } from 'ant-design-vue';
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import {
deleteProduct,
exportProduct,
getProductPage,
} from '#/api/erp/product/product';
import { $t } from '#/locales';
import { useGridColumns, useGridFormSchema } from './data';
import Form from './modules/form.vue';
const [FormModal, formModalApi] = useVbenModal({
connectedComponent: Form,
destroyOnClose: true,
});
/** 刷新表格 */
function onRefresh() {
gridApi.query();
}
/** 导出表格 */
async function handleExport() {
const data = await exportProduct(await gridApi.formApi.getValues());
downloadFileFromBlobPart({ fileName: '产品信息.xls', source: data });
}
/** 创建产品 */
function handleCreate() {
formModalApi.setData(null).open();
}
/** 编辑产品 */
function handleEdit(row: ErpProductApi.Product) {
formModalApi.setData(row).open();
}
/** 删除产品 */
async function handleDelete(row: ErpProductApi.Product) {
const hideLoading = message.loading({
content: $t('ui.actionMessage.deleting', [row.name]),
key: 'action_key_msg',
});
try {
await deleteProduct(row.id as number);
message.success({
content: $t('ui.actionMessage.deleteSuccess', [row.name]),
key: 'action_key_msg',
});
onRefresh();
} finally {
hideLoading();
}
}
const [Grid, gridApi] = useVbenVxeGrid({
formOptions: {
schema: useGridFormSchema(),
},
gridOptions: {
columns: useGridColumns(),
height: 'auto',
keepSource: true,
proxyConfig: {
ajax: {
query: async ({ page }, formValues) => {
return await getProductPage({
pageNo: page.currentPage,
pageSize: page.pageSize,
...formValues,
});
},
},
},
rowConfig: {
keyField: 'id',
isHover: true,
},
toolbarConfig: {
refresh: true,
search: true,
},
} as VxeTableGridOptions<ErpProductApi.Product>,
});
import { Button } from 'ant-design-vue';
</script>
<template>
<Page auto-content-height>
<Page>
<template #doc>
<DocAlert
title="【产品】产品信息、分类、单位"
url="https://doc.iocoder.cn/erp/product/"
/>
</template>
<FormModal @success="onRefresh" />
<Grid table-title="">
<template #toolbar-tools>
<TableAction
:actions="[
{
label: $t('ui.actionTitle.create', ['产品']),
type: 'primary',
icon: ACTION_ICON.ADD,
auth: ['erp:product:create'],
onClick: handleCreate,
},
{
label: $t('ui.actionTitle.export'),
type: 'primary',
icon: ACTION_ICON.DOWNLOAD,
auth: ['erp:product:export'],
onClick: handleExport,
},
]"
/>
</template>
<template #actions="{ row }">
<TableAction
:actions="[
{
label: $t('common.edit'),
type: 'link',
icon: ACTION_ICON.EDIT,
auth: ['erp:product:update'],
onClick: handleEdit.bind(null, row),
},
{
label: $t('common.delete'),
type: 'link',
danger: true,
icon: ACTION_ICON.DELETE,
auth: ['erp:product:delete'],
popConfirm: {
title: $t('ui.actionMessage.deleteConfirm', [row.name]),
confirm: handleDelete.bind(null, row),
},
},
]"
/>
</template>
</Grid>
<Button
danger
type="link"
target="_blank"
href="https://github.com/yudaocode/yudao-ui-admin-vue3"
>
该功能支持 Vue3 + element-plus 版本
</Button>
<br />
<Button
type="link"
target="_blank"
href="https://github.com/yudaocode/yudao-ui-admin-vue3/blob/master/src/views/erp/product/product/index"
>
可参考
https://github.com/yudaocode/yudao-ui-admin-vue3/blob/master/src/views/erp/product/product/index
代码pull request 贡献给我们
</Button>
</Page>
</template>

View File

@ -1,86 +0,0 @@
<script lang="ts" setup>
import type { ErpProductApi } from '#/api/erp/product/product';
import { computed, ref } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { message } from 'ant-design-vue';
import { useVbenForm } from '#/adapter/form';
import {
createProduct,
getProduct,
updateProduct,
} from '#/api/erp/product/product';
import { $t } from '#/locales';
import { useFormSchema } from '../data';
const emit = defineEmits(['success']);
const formData = ref<ErpProductApi.Product>();
const getTitle = computed(() => {
return formData.value?.id
? $t('ui.actionTitle.edit', ['产品'])
: $t('ui.actionTitle.create', ['产品']);
});
const [Form, formApi] = useVbenForm({
commonConfig: {
componentProps: {
class: 'w-full',
},
},
// 2
wrapperClass: 'grid-cols-2',
layout: 'horizontal',
schema: useFormSchema(),
showDefaultActions: false,
});
const [Modal, modalApi] = useVbenModal({
async onConfirm() {
const { valid } = await formApi.validate();
if (!valid) {
return;
}
modalApi.lock();
//
const data = (await formApi.getValues()) as ErpProductApi.Product;
try {
await (formData.value?.id ? updateProduct(data) : createProduct(data));
//
await modalApi.close();
emit('success');
message.success($t('ui.actionMessage.operationSuccess'));
} finally {
modalApi.unlock();
}
},
async onOpenChange(isOpen: boolean) {
if (!isOpen) {
formData.value = undefined;
return;
}
//
const data = modalApi.getData<ErpProductApi.Product>();
if (!data || !data.id) {
return;
}
modalApi.lock();
try {
formData.value = await getProduct(data.id as number);
// values
await formApi.setValues(formData.value);
} finally {
modalApi.unlock();
}
},
});
</script>
<template>
<Modal class="w-2/5" :title="getTitle">
<Form class="mx-4" />
</Modal>
</template>

View File

@ -1,89 +0,0 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import { z } from '#/adapter/form';
import { CommonStatusEnum, DICT_TYPE, getDictOptions } from '#/utils';
/** 新增/修改的表单 */
export function useFormSchema(): VbenFormSchema[] {
return [
{
component: 'Input',
fieldName: 'id',
dependencies: {
triggerFields: [''],
show: () => false,
},
},
{
component: 'Input',
fieldName: 'name',
label: '单位名称',
rules: 'required',
},
{
fieldName: 'status',
label: '单位状态',
component: 'RadioGroup',
componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
buttonStyle: 'solid',
optionType: 'button',
},
rules: z.number().default(CommonStatusEnum.ENABLE),
},
];
}
/** 列表的搜索表单 */
export function useGridFormSchema(): VbenFormSchema[] {
return [
{
fieldName: 'name',
label: '单位名称',
component: 'Input',
},
{
fieldName: 'status',
label: '单位状态',
component: 'Select',
componentProps: {
allowClear: true,
options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'),
},
},
];
}
/** 列表的字段 */
export function useGridColumns(): VxeTableGridOptions['columns'] {
return [
{
field: 'id',
title: '单位编号',
},
{
field: 'name',
title: '单位名称',
},
{
field: 'status',
title: '单位状态',
cellRender: {
name: 'CellDict',
props: { type: DICT_TYPE.COMMON_STATUS },
},
},
{
field: 'createTime',
title: '创建时间',
formatter: 'formatDateTime',
},
{
title: '操作',
width: 130,
fixed: 'right',
slots: { default: 'actions' },
},
];
}

View File

@ -1,152 +1,34 @@
<script lang="ts" setup>
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { ErpProductUnitApi } from '#/api/erp/product/unit';
import { DocAlert, Page } from '@vben/common-ui';
import { DocAlert, Page, useVbenModal } from '@vben/common-ui';
import { downloadFileFromBlobPart } from '@vben/utils';
import { message } from 'ant-design-vue';
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import {
deleteProductUnit,
exportProductUnit,
getProductUnitPage,
} from '#/api/erp/product/unit';
import { $t } from '#/locales';
import { useGridColumns, useGridFormSchema } from './data';
import Form from './modules/form.vue';
const [FormModal, formModalApi] = useVbenModal({
connectedComponent: Form,
destroyOnClose: true,
});
/** 刷新表格 */
function onRefresh() {
gridApi.query();
}
/** 导出表格 */
async function handleExport() {
const data = await exportProductUnit(await gridApi.formApi.getValues());
downloadFileFromBlobPart({ fileName: '产品单位.xls', source: data });
}
/** 创建产品单位 */
function handleCreate() {
formModalApi.setData(null).open();
}
/** 编辑产品单位 */
function handleEdit(row: ErpProductUnitApi.ProductUnit) {
formModalApi.setData(row).open();
}
/** 删除产品单位 */
async function handleDelete(row: ErpProductUnitApi.ProductUnit) {
const hideLoading = message.loading({
content: $t('ui.actionMessage.deleting', [row.name]),
key: 'action_key_msg',
});
try {
await deleteProductUnit(row.id as number);
message.success({
content: $t('ui.actionMessage.deleteSuccess', [row.name]),
key: 'action_key_msg',
});
onRefresh();
} finally {
hideLoading();
}
}
const [Grid, gridApi] = useVbenVxeGrid({
formOptions: {
schema: useGridFormSchema(),
},
gridOptions: {
columns: useGridColumns(),
height: 'auto',
keepSource: true,
proxyConfig: {
ajax: {
query: async ({ page }, formValues) => {
return await getProductUnitPage({
pageNo: page.currentPage,
pageSize: page.pageSize,
...formValues,
});
},
},
},
rowConfig: {
keyField: 'id',
isHover: true,
},
toolbarConfig: {
refresh: true,
search: true,
},
} as VxeTableGridOptions<ErpProductUnitApi.ProductUnit>,
});
import { Button } from 'ant-design-vue';
</script>
<template>
<Page auto-content-height>
<Page>
<template #doc>
<DocAlert
title="【产品】产品信息、分类、单位"
url="https://doc.iocoder.cn/erp/product/"
/>
</template>
<FormModal @success="onRefresh" />
<Grid table-title="">
<template #toolbar-tools>
<TableAction
:actions="[
{
label: $t('ui.actionTitle.create', ['产品单位']),
type: 'primary',
icon: ACTION_ICON.ADD,
auth: ['erp:product-unit:create'],
onClick: handleCreate,
},
{
label: $t('ui.actionTitle.export'),
type: 'primary',
icon: ACTION_ICON.DOWNLOAD,
auth: ['erp:product-unit:export'],
onClick: handleExport,
},
]"
/>
</template>
<template #actions="{ row }">
<TableAction
:actions="[
{
label: $t('common.edit'),
type: 'link',
icon: ACTION_ICON.EDIT,
auth: ['erp:product-unit:update'],
onClick: handleEdit.bind(null, row),
},
{
label: $t('common.delete'),
type: 'link',
danger: true,
icon: ACTION_ICON.DELETE,
auth: ['erp:product-unit:delete'],
popConfirm: {
title: $t('ui.actionMessage.deleteConfirm', [row.name]),
confirm: handleDelete.bind(null, row),
},
},
]"
/>
</template>
</Grid>
<Button
danger
type="link"
target="_blank"
href="https://github.com/yudaocode/yudao-ui-admin-vue3"
>
该功能支持 Vue3 + element-plus 版本
</Button>
<br />
<Button
type="link"
target="_blank"
href="https://github.com/yudaocode/yudao-ui-admin-vue3/blob/master/src/views/erp/product/unit/index"
>
可参考
https://github.com/yudaocode/yudao-ui-admin-vue3/blob/master/src/views/erp/product/unit/index
代码pull request 贡献给我们
</Button>
</Page>
</template>

View File

@ -1,88 +0,0 @@
<script lang="ts" setup>
import type { ErpProductUnitApi } from '#/api/erp/product/unit';
import { computed, ref } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { message } from 'ant-design-vue';
import { useVbenForm } from '#/adapter/form';
import {
createProductUnit,
getProductUnit,
updateProductUnit,
} from '#/api/erp/product/unit';
import { $t } from '#/locales';
import { useFormSchema } from '../data';
const emit = defineEmits(['success']);
const formData = ref<ErpProductUnitApi.ProductUnit>();
const getTitle = computed(() => {
return formData.value?.id
? $t('ui.actionTitle.edit', ['产品单位'])
: $t('ui.actionTitle.create', ['产品单位']);
});
const [Form, formApi] = useVbenForm({
commonConfig: {
componentProps: {
class: 'w-full',
},
formItemClass: 'col-span-2',
labelWidth: 80,
},
layout: 'horizontal',
schema: useFormSchema(),
showDefaultActions: false,
});
const [Modal, modalApi] = useVbenModal({
async onConfirm() {
const { valid } = await formApi.validate();
if (!valid) {
return;
}
modalApi.lock();
//
const data = (await formApi.getValues()) as ErpProductUnitApi.ProductUnit;
try {
await (formData.value?.id
? updateProductUnit(data)
: createProductUnit(data));
//
await modalApi.close();
emit('success');
message.success($t('ui.actionMessage.operationSuccess'));
} finally {
modalApi.unlock();
}
},
async onOpenChange(isOpen: boolean) {
if (!isOpen) {
formData.value = undefined;
return;
}
//
const data = modalApi.getData<ErpProductUnitApi.ProductUnit>();
if (!data || !data.id) {
return;
}
modalApi.lock();
try {
formData.value = await getProductUnit(data.id as number);
// values
await formApi.setValues(formData.value);
} finally {
modalApi.unlock();
}
},
});
</script>
<template>
<Modal class="w-2/5" :title="getTitle">
<Form class="mx-4" />
</Modal>
</template>

View File

@ -1,586 +0,0 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import { erpPriceInputFormatter } from '@vben/utils';
import { z } from '#/adapter/form';
import { getAccountSimpleList } from '#/api/erp/finance/account';
import { getProductSimpleList } from '#/api/erp/product/product';
import { getSupplierSimpleList } from '#/api/erp/purchase/supplier';
import { getWarehouseSimpleList } from '#/api/erp/stock/warehouse';
import { getSimpleUserList } from '#/api/system/user';
import { DICT_TYPE, getDictOptions } from '#/utils';
/** 表单的配置项 */
export function useFormSchema(formType: string): VbenFormSchema[] {
return [
{
component: 'Input',
componentProps: {
style: { display: 'none' },
},
fieldName: 'id',
label: 'ID',
hideLabel: true,
formItemClass: 'hidden',
},
{
component: 'Input',
componentProps: {
placeholder: '系统自动生成',
disabled: true,
},
fieldName: 'no',
label: '入库单号',
},
{
component: 'ApiSelect',
componentProps: {
disabled: true,
placeholder: '请选择供应商',
allowClear: true,
showSearch: true,
api: getSupplierSimpleList,
fieldNames: {
label: 'name',
value: 'id',
},
},
fieldName: 'supplierId',
label: '供应商',
rules: 'required',
},
{
fieldName: 'orderNo',
label: '关联订单',
component: 'Input',
formItemClass: 'col-span-1',
componentProps: {
disabled: formType === 'detail',
placeholder: '请选择关联订单',
},
rules: 'required',
},
{
component: 'DatePicker',
componentProps: {
disabled: formType === 'detail',
placeholder: '选择订单时间',
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
style: { width: '100%' },
},
fieldName: 'inTime',
label: '入库时间',
rules: 'required',
},
{
component: 'Textarea',
componentProps: {
placeholder: '请输入备注',
disabled: formType === 'detail',
autoSize: { minRows: 1, maxRows: 1 },
class: 'w-full',
},
fieldName: 'remark',
label: '备注',
formItemClass: 'col-span-2',
},
{
component: 'FileUpload',
componentProps: {
disabled: formType === 'detail',
maxNumber: 1,
maxSize: 10,
accept: [
'pdf',
'doc',
'docx',
'xls',
'xlsx',
'txt',
'jpg',
'jpeg',
'png',
],
showDescription: true,
},
fieldName: 'fileUrl',
label: '附件',
formItemClass: 'col-span-3',
},
{
fieldName: 'product',
label: '产品清单',
component: 'Input',
formItemClass: 'col-span-3',
},
{
component: 'InputNumber',
fieldName: 'discountPercent',
componentProps: {
placeholder: '优惠率',
min: 0,
max: 100,
disabled: true,
precision: 2,
style: { width: '100%' },
},
label: '优惠率(%)',
},
{
component: 'InputNumber',
componentProps: {
placeholder: '付款优惠',
precision: 2,
formatter: erpPriceInputFormatter,
disabled: true,
style: { width: '100%' },
},
fieldName: 'discountPrice',
label: '付款优惠',
},
{
component: 'InputNumber',
componentProps: {
placeholder: '优惠后金额',
precision: 2,
formatter: erpPriceInputFormatter,
disabled: true,
style: { width: '100%' },
},
fieldName: 'discountedPrice',
label: '优惠后金额',
},
{
component: 'InputNumber',
componentProps: {
disabled: formType === 'detail',
placeholder: '请输入其他费用',
precision: 2,
formatter: erpPriceInputFormatter,
style: { width: '100%' },
},
fieldName: 'otherPrice',
label: '其他费用',
},
{
component: 'ApiSelect',
componentProps: {
placeholder: '请选择结算账户',
disabled: true,
allowClear: true,
showSearch: true,
api: getAccountSimpleList,
fieldNames: {
label: 'name',
value: 'id',
},
},
fieldName: 'accountId',
label: '结算账户',
},
{
component: 'InputNumber',
componentProps: {
precision: 2,
style: { width: '100%' },
disabled: true,
min: 0,
},
fieldName: 'totalPrice',
label: '应付金额',
rules: z.number().min(0).optional(),
},
];
}
/** 采购订单项表格列定义 */
export function usePurchaseOrderItemTableColumns(): VxeTableGridOptions['columns'] {
return [
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
{
field: 'warehouseId',
title: '仓库名称',
minWidth: 200,
slots: { default: 'warehouseId' },
},
{
field: 'productId',
title: '产品名称',
minWidth: 200,
slots: { default: 'productId' },
},
{
field: 'stockCount',
title: '仓库库存',
minWidth: 80,
},
{
field: 'productBarCode',
title: '条码',
minWidth: 120,
},
{
field: 'productUnitName',
title: '单位',
minWidth: 80,
},
{
field: 'totalCount',
title: '原数量',
minWidth: 120,
},
{
field: 'inCount',
title: '已入库数量',
minWidth: 120,
},
{
field: 'count',
title: '数量',
minWidth: 120,
fixed: 'right',
slots: { default: 'count' },
},
{
field: 'productPrice',
title: '产品单价',
fixed: 'right',
minWidth: 120,
slots: { default: 'productPrice' },
},
{
field: 'totalProductPrice',
fixed: 'right',
title: '产品金额',
minWidth: 120,
formatter: 'formatAmount2',
},
{
fixed: 'right',
field: 'taxPercent',
title: '税率(%)',
minWidth: 100,
},
{
fixed: 'right',
field: 'taxPrice',
title: '税额',
minWidth: 120,
formatter: 'formatAmount2',
},
{
field: 'totalPrice',
fixed: 'right',
title: '合计金额',
minWidth: 120,
formatter: 'formatAmount2',
},
];
}
/** 列表的搜索表单 */
export function useGridFormSchema(): VbenFormSchema[] {
return [
{
fieldName: 'no',
label: '入库单号',
component: 'Input',
componentProps: {
placeholder: '请输入入库单号',
allowClear: true,
},
},
{
fieldName: 'productId',
label: '产品',
component: 'ApiSelect',
componentProps: {
placeholder: '请选择产品',
allowClear: true,
showSearch: true,
api: getProductSimpleList,
fieldNames: {
label: 'name',
value: 'id',
},
},
},
{
fieldName: 'inTime',
label: '入库时间',
component: 'RangePicker',
componentProps: {
placeholder: ['开始时间', '结束时间'],
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
},
{
fieldName: 'supplierId',
label: '供应商',
component: 'ApiSelect',
componentProps: {
placeholder: '请选择供应商',
allowClear: true,
showSearch: true,
api: getSupplierSimpleList,
fieldNames: {
label: 'name',
value: 'id',
},
},
},
{
fieldName: 'warehouseId',
label: '仓库',
component: 'ApiSelect',
componentProps: {
placeholder: '请选择仓库',
allowClear: true,
showSearch: true,
api: getWarehouseSimpleList,
labelField: 'name',
valueField: 'id',
filterOption: false,
},
},
{
fieldName: 'creator',
label: '创建人',
component: 'ApiSelect',
componentProps: {
placeholder: '请选择创建人',
allowClear: true,
showSearch: true,
api: getSimpleUserList,
fieldNames: {
label: 'nickname',
value: 'id',
},
},
},
{
fieldName: 'orderNo',
label: '关联订单',
component: 'Input',
componentProps: {
placeholder: '请输入关联订单号',
allowClear: true,
},
},
{
fieldName: 'paymentStatus',
label: '付款状态',
component: 'Select',
componentProps: {
options: [
{ label: '未付款', value: 0 },
{ label: '部分付款', value: 1 },
{ label: '全部付款', value: 2 },
],
placeholder: '请选择退货状态',
allowClear: true,
},
},
{
fieldName: 'status',
label: '状态',
component: 'Select',
componentProps: {
placeholder: '请选择状态',
allowClear: true,
options: getDictOptions(DICT_TYPE.ERP_AUDIT_STATUS, 'number'),
},
},
{
fieldName: 'remark',
label: '备注',
component: 'Input',
componentProps: {
placeholder: '请输入备注',
allowClear: true,
},
},
];
}
/** 列表的字段 */
export function useGridColumns(): VxeTableGridOptions['columns'] {
return [
{
type: 'checkbox',
width: 50,
fixed: 'left',
},
{
field: 'no',
title: '入库单号',
width: 200,
fixed: 'left',
},
{
field: 'productNames',
title: '产品信息',
showOverflow: 'tooltip',
minWidth: 120,
},
{
field: 'supplierName',
title: '供应商',
minWidth: 120,
},
{
field: 'inTime',
title: '入库时间',
width: 160,
formatter: 'formatDateTime',
},
{
field: 'creatorName',
title: '创建人',
minWidth: 120,
},
{
field: 'totalCount',
title: '总数量',
minWidth: 120,
},
{
field: 'totalPrice',
title: '应付金额',
formatter: 'formatNumber',
minWidth: 120,
},
{
field: 'paymentPrice',
title: '已付金额',
formatter: 'formatNumber',
minWidth: 120,
},
{
field: 'status',
title: '状态',
minWidth: 120,
cellRender: {
name: 'CellDict',
props: { type: DICT_TYPE.ERP_AUDIT_STATUS },
},
},
{
title: '操作',
minWidth: 250,
fixed: 'right',
slots: { default: 'actions' },
},
];
}
/** 列表的搜索表单 */
export function useOrderGridFormSchema(): VbenFormSchema[] {
return [
{
fieldName: 'no',
label: '订单单号',
component: 'Input',
componentProps: {
placeholder: '请输入订单单号',
allowClear: true,
disabled: true,
},
},
{
fieldName: 'productId',
label: '产品',
component: 'ApiSelect',
componentProps: {
placeholder: '请选择产品',
allowClear: true,
showSearch: true,
api: getProductSimpleList,
fieldNames: {
label: 'name',
value: 'id',
},
},
},
{
fieldName: 'orderTime',
label: '订单时间',
component: 'RangePicker',
componentProps: {
placeholder: ['开始时间', '结束时间'],
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
},
];
}
/** 列表的字段 */
export function useOrderGridColumns(): VxeTableGridOptions['columns'] {
return [
{
type: 'radio',
width: 50,
fixed: 'left',
},
{
field: 'no',
title: '订单单号',
width: 200,
fixed: 'left',
},
{
field: 'productNames',
title: '产品信息',
showOverflow: 'tooltip',
minWidth: 120,
},
{
field: 'supplierName',
title: '供应商',
minWidth: 120,
},
{
field: 'orderTime',
title: '订单时间',
width: 160,
formatter: 'formatDate',
},
{
field: 'creatorName',
title: '创建人',
minWidth: 120,
},
{
field: 'totalCount',
title: '总数量',
minWidth: 120,
},
{
field: 'inCount',
title: '入库数量',
minWidth: 120,
},
{
field: 'totalProductPrice',
title: '金额合计',
formatter: 'formatNumber',
minWidth: 120,
},
{
field: 'totalPrice',
title: '含税金额',
formatter: 'formatNumber',
minWidth: 120,
},
];
}

Some files were not shown because too many files have changed in this diff Show More