feat: 优化盘点表

This commit is contained in:
louis 2024-03-08 17:23:06 +08:00
parent 3c3c21733c
commit 568d77d178
4 changed files with 8 additions and 236 deletions

View File

@ -224,7 +224,7 @@ export const formSchemas = (isEdit?: boolean): FormSchema<API.MaterialsInOutEnti
label: '领料单号',
field: 'issuanceNumber',
component: 'Input',
vIf:isEdit,
colProps: {
span: 12,
},

View File

@ -9,11 +9,6 @@ export type TableListItem = API.MaterialsInventoryEntity;
export type TableColumnItem = TableColumn<TableListItem>;
const dictStore = useDictStore();
export const baseColumns: TableColumnItem[] = [
{
title: '公司名称',
width: 120,
dataIndex: 'companyName',
},
{
title: '产品名称',
width: 180,
@ -26,7 +21,7 @@ export const baseColumns: TableColumnItem[] = [
dataIndex: 'unit',
formItemProps: {
component: 'Select',
componentProps: {
componentProps: {
options: dictStore
.getDictItemsByCode(DictEnum.Unit)
.map(({ label, id }) => ({ value: id, label })),
@ -39,122 +34,17 @@ export const baseColumns: TableColumnItem[] = [
: '';
},
},
{
title: '库存数量',
hideInSearch: true,
width: 80,
dataIndex: 'previousInventoryQuantity',
dataIndex: 'quantity',
},
{
title: '单价',
title: '库存单价',
hideInSearch: true,
width: 80,
dataIndex: 'previousUnitPrice',
},
{
title: '金额',
hideInSearch: true,
width: 80,
dataIndex: 'previousAmount',
},
{
title: '入库',
children: [
{
title: '入库时间',
width: 120,
align: 'center',
dataIndex: 'inventoryTime',
customRender: ({ record }) => {
return formatToDate(record.inventoryTime);
},
},
{
title: '数量',
width: 80,
align: 'center',
dataIndex: 'inventoryQuantity',
},
{
title: '单价',
width: 80,
align: 'center',
dataIndex: 'inventoryUnitPrice',
},
{
title: '金额',
width: 80,
align: 'center',
dataIndex: 'inventoryAmount',
},
],
},
{
title: '出库',
children: [
{
title: '出库时间',
width: 120,
dataIndex: 'outime',
align: 'center',
customRender: ({ record }) => {
return formatToDate(record.outime);
},
},
{
title: '出库数量',
width: 80,
dataIndex: 'outQuantity',
align: 'center',
},
{
title: '出库单价',
width: 80,
align: 'center',
dataIndex: 'outUnitPrice',
},
{
title: '出库金额',
width: 80,
align: 'center',
dataIndex: 'outAmount',
},
],
},
{
title: '结存数量',
hideInSearch: true,
width: 80,
dataIndex: 'currentInventoryQuantity',
},
{
title: '单价',
hideInSearch: true,
width: 80,
dataIndex: 'currentUnitPrice',
},
{
title: '金额',
hideInSearch: true,
width: 80,
dataIndex: 'currentAmount',
},
{
title: '经办人',
width: 80,
dataIndex: 'agent',
},
{
title: '领料单号',
width: 80,
dataIndex: 'issuanceNumber',
},
{
title: '项目',
width: 80,
dataIndex: 'project',
dataIndex: 'unitPrice',
},
{
title: '备注',

View File

@ -1,115 +0,0 @@
import type { FormSchema } from '@/components/core/schema-form/';
import { ContractStatusEnum } from '@/enums/contractEnum';
import { formatStatus } from './columns';
export const contractSchemas = (
contractTypes: API.DictItemEntity[],
): FormSchema<API.ContractEntity>[] => [
{
field: 'contractNumber',
component: 'Input',
label: '合同编号',
rules: [{ required: true, type: 'string' }],
colProps: {
span: 12,
},
},
{
field: 'title',
component: 'Input',
label: '合同标题',
rules: [{ required: true, type: 'string' }],
colProps: {
span: 12,
},
},
{
field: 'partyA',
component: 'Input',
label: '甲方',
rules: [{ required: true, type: 'string' }],
colProps: {
span: 12,
},
},
{
field: 'partyB',
component: 'Input',
label: '乙方',
rules: [{ required: true, type: 'string' }],
colProps: {
span: 12,
},
},
{
field: 'signingDate',
label: '签订时间',
component: 'DatePicker',
// defaultValue: new Date(),
colProps: { span: 12 },
componentProps: {},
},
{
field: 'deliveryDeadline',
label: '交付期限',
component: 'DatePicker',
// defaultValue: new Date(),
colProps: { span: 12 },
},
{
field: 'type',
label: '合同类型',
component: 'Select',
required: true,
colProps: {
span: 12,
},
componentProps: {
options: contractTypes.map(({ label, id }) => ({ value: id, label })),
},
},
{
field: 'status',
label: '审核结果',
component: 'Select',
required:true,
defaultValue: 0,
colProps: {
span: 12,
},
componentProps: {
allowClear: false,
options: Object.values(ContractStatusEnum)
.filter((value) => typeof value === 'number')
.map((item) => formatStatus(item as ContractStatusEnum)),
},
},
// {
// field: 'remark',
// component: 'InputTextArea',
// label: '备注',
// },
// {
// field: 'menuIds',
// component: 'Tree',
// label: '菜单权限',
// componentProps: {
// checkable: true,
// vModelKey: 'checkedKeys',
// fieldNames: {
// title: 'name',
// key: 'id',
// },
// style: {
// height: '350px',
// paddingTop: '5px',
// overflow: 'auto',
// borderRadius: '6px',
// border: '1px solid #dcdfe6',
// resize: 'vertical',
// },
// },
// },
];

View File

@ -7,7 +7,6 @@
:data-request="Api.materialsInventory.materialsInventoryList"
:columns="columns"
bordered
:scroll="{ x: 1920 }"
size="small"
>
<template #toolbar>
@ -49,18 +48,16 @@
width: 50,
maxWidth: 50,
hideInSearch: true,
fixed: 'right',
dataIndex: 'files',
customRender: ({ record }) => <FilesRender {...record} />,
},
{
title: '操作',
maxWidth: 150,
width: 150,
minWidth: 150,
maxWidth: 80,
width: 80,
minWidth: 80,
dataIndex: 'ACTION',
hideInSearch: true,
fixed: 'right',
actions: ({ record }) => [
{
icon: 'ant-design:edit-outlined',