feat: 完成采购,视频分析模块

This commit is contained in:
fyy
2025-07-27 17:42:43 +08:00
parent 08b738f0f4
commit 3d7ddf3ed8
45 changed files with 5349 additions and 166 deletions

View File

@@ -3,48 +3,46 @@ import type { VxeGridProps } from '#/adapter/vxe-table';
import { getDictOptions } from '#/utils/dict';
import { renderDict } from '#/utils/render';
import { suppliersList } from '#/api/property/assetManage/suppliers';
import { depotList } from '#/api/property/assetManage/depot';
import { useUserStore } from '@vben/stores';
const userStore = useUserStore();
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'title',
label: '标题',
},
// {
// component: 'Input',
// fieldName: 'title',
// label: '标题',
// },
{
component: 'Input',
fieldName: 'applicat',
label: '申请人id',
},
{
component: 'Input',
fieldName: 'phone',
label: '申请人手机号',
},
{
component: 'Input',
fieldName: 'supplier',
label: '供应商id',
},
{
component: 'Input',
fieldName: 'capitalId',
label: '资产id',
label: '申请人',
},
// {
// component: 'Input',
// fieldName: 'phone',
// label: '申请人手机号',
// },
// {
// component: 'ApiSelect',
// fieldName: 'supplier',
// label: '供应商',
// componentProps: {
// api: suppliersList({ pageNum: 1, pageSize: 1000 }),
// resultField: 'rows',
// labelField: 'assetTypeName',
// valueField: 'id',
// },
// },
{
component: 'Select',
componentProps: {},
fieldName: 'buyType',
label: '采购方式',
},
{
component: 'Input',
fieldName: 'buyUnitPrice',
label: '采购单价',
},
{
component: 'Input',
fieldName: 'buyAmount',
label: '采购金额',
options: getDictOptions('wy_zccgfs'),
},
{
component: 'Select',
@@ -55,21 +53,6 @@ export const querySchema: FormSchemaGetter = () => [
fieldName: 'state',
label: '状态',
},
{
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
fieldName: 'applicationTime',
label: '申请时间',
},
{
component: 'Input',
fieldName: 'searchValue',
label: '搜索值',
},
];
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
@@ -77,12 +60,18 @@ export const querySchema: FormSchemaGetter = () => [
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '',
title: '序号',
field: 'id',
slots: {
default: ({ rowIndex }) => {
return (rowIndex + 1).toString();
},
},
},
{
title: '标题',
field: 'title',
width: 'auto',
},
{
title: '申请人id',
@@ -96,21 +85,15 @@ export const columns: VxeGridProps['columns'] = [
title: '供应商id',
field: 'supplier',
},
{
title: '资产id',
field: 'capitalId',
},
{
title: '采购方式',
field: 'buyType',
},
{
title: '采购单价',
field: 'buyUnitPrice',
},
{
title: '采购金额',
field: 'buyAmount',
slots: {
default: ({ row }) => {
// 可选从DictEnum中获取 DictEnum.WY_ZCSQSHZT 便于维护
return renderDict(row.buyType, 'wy_zccgfs');
},
},
},
{
title: '状态',
@@ -126,20 +109,12 @@ export const columns: VxeGridProps['columns'] = [
title: '备注',
field: 'remark',
},
{
title: '申请时间',
field: 'applicationTime',
},
{
title: '搜索值',
field: 'searchValue',
},
{
field: 'action',
fixed: 'right',
slots: { default: 'action' },
title: '操作',
width: 180,
width: 280,
},
];
@@ -160,73 +135,131 @@ export const modalSchema: FormSchemaGetter = () => [
rules: 'required',
},
{
label: '申请人id',
fieldName: 'applicat',
component: 'Input',
label: '存放仓库',
fieldName: 'depotId',
component: 'ApiSelect',
rules: 'required',
},
{
label: '申请人手机号',
fieldName: 'phone',
component: 'Input',
rules: 'required',
},
{
label: '供应商id',
fieldName: 'supplier',
component: 'Input',
rules: 'required',
},
{
label: '资产id',
fieldName: 'capitalId',
component: 'Input',
rules: 'required',
},
{
label: '采购方式',
fieldName: 'buyType',
component: 'Select',
componentProps: {},
rules: 'selectRequired',
},
{
label: '采购单价',
fieldName: 'buyUnitPrice',
component: 'Input',
},
{
label: '采购金额',
fieldName: 'buyAmount',
component: 'Input',
},
{
label: '状态',
fieldName: 'state',
component: 'Select',
componentProps: {
// 可选从DictEnum中获取 DictEnum.WY_ZCSQSHZT 便于维护
options: getDictOptions('wy_zcsqshzt'),
api: async () => {
const res = await depotList({ pageNum: 1, pageSize: 1000 });
return res;
},
resultField: 'rows',
labelField: 'depotName',
valueField: 'id',
},
},
{
component: 'Input',
fieldName: 'applicatDisplay', // 显示用
label: '申请人',
rules: 'required',
disabled: true,
},
{
component: 'Input',
rules: 'required',
fieldName: 'applicat', // 实际存储ID
dependencies: {
show: () => false,
triggerFields: [''],
},
},
{
component: 'Input',
fieldName: 'phone',
rules: 'required',
label: '申请人手机号',
},
{
component: 'ApiSelect',
rules: 'required',
fieldName: 'supplier',
label: '供应商',
componentProps: {
api: async () => {
const res = await suppliersList({ pageNum: 1, pageSize: 1000 });
return res;
},
resultField: 'rows',
labelField: 'suppliersName',
valueField: 'id',
},
},
{
rules: 'required',
component: 'Select',
componentProps: {
options: getDictOptions('wy_zccgfs'),
},
fieldName: 'buyType',
label: '采购方式',
},
// {
// label: '采购单价',
// fieldName: 'buyUnitPrice',
// component: 'Input',
// },
// {
// label: '采购金额',
// fieldName: 'buyAmount',
// component: 'Input',
// },
// {
// label: '状态',
// fieldName: 'state',
// component: 'Select',
// componentProps: {
// // 可选从DictEnum中获取 DictEnum.WY_ZCSQSHZT 便于维护
// options: getDictOptions('wy_zcsqshzt'),
// },
// },
{
label: '备注',
fieldName: 'remark',
component: 'Input',
},
];
export const detailColumns: VxeGridProps['columns'] = [
{
label: '申请时间',
fieldName: 'applicationTime',
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
title: '序号',
field: 'id',
width: 80,
slots: {
default: ({ rowIndex }) => {
return (rowIndex + 1).toString();
},
},
},
{
label: '搜索值',
fieldName: 'searchValue',
component: 'Input',
title: '资产名称',
field: 'capitalName',
width: 150,
},
{
title: '规格',
field: 'spec',
width: 120,
},
{
title: '购买数量',
field: 'buyQuantity',
width: 120,
},
{
title: '采购单价',
field: 'buyUnitPrice',
width: 120,
},
{
title: '金额小计',
field: 'buyAmount',
width: 120,
},
{
title: '备注',
field: 'remark',
width: 150,
},
];