feat:【antd】【erp 系统】sale/order 重构完成

This commit is contained in:
YunaiV
2025-10-03 20:54:22 +08:00
parent 83cffeafc3
commit d5712f2640
3 changed files with 23 additions and 30 deletions

View File

@@ -10,6 +10,7 @@ import { getAccountSimpleList } from '#/api/erp/finance/account';
import { getProductSimpleList } from '#/api/erp/product/product';
import { getCustomerSimpleList } from '#/api/erp/sale/customer';
import { getSimpleUserList } from '#/api/system/user';
import { getRangePickerDefaultProps } from '#/utils';
/** 表单的配置项 */
export function useFormSchema(): VbenFormSchema[] {
@@ -166,7 +167,6 @@ export function useFormSchema(): VbenFormSchema[] {
componentProps: {
placeholder: '请输入收取订金',
precision: 2,
style: { width: '100%' },
min: 0,
},
fieldName: 'depositPrice',
@@ -284,10 +284,8 @@ export function useGridFormSchema(): VbenFormSchema[] {
label: '订单时间',
component: 'RangePicker',
componentProps: {
placeholder: ['开始时间', '结束时间'],
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
...getRangePickerDefaultProps(),
allowClear: true,
},
},
{

View File

@@ -8,6 +8,7 @@ import { useVbenModal } from '@vben/common-ui';
import { message } from 'ant-design-vue';
import { useVbenForm } from '#/adapter/form';
import { getAccountSimpleList } from '#/api/erp/finance/account';
import {
createSaleOrder,
getSaleOrder,
@@ -17,7 +18,6 @@ import { $t } from '#/locales';
import { useFormSchema } from '../data';
import ItemForm from './item-form.vue';
import {getAccountSimpleList} from '#/api/erp/finance/account';
const emit = defineEmits(['success']);
const formData = ref<ErpSaleOrderApi.SaleOrder>();

View File

@@ -228,7 +228,7 @@ onMounted(async () => {
v-model:value="row.productId"
:options="productOptions"
:field-names="{ label: 'name', value: 'id' }"
style="width: 100%"
class="w-full"
placeholder="请选择产品"
show-search
@change="handleProductChange($event, row)"
@@ -240,12 +240,11 @@ onMounted(async () => {
v-if="!disabled"
v-model:value="row.count"
:min="0"
:precision="2"
:precision="3"
@change="handleRowChange(row)"
/>
<span v-else>{{ row.count || '-' }}</span>
</template>
<template #productPrice="{ row }">
<InputNumber
v-if="!disabled"
@@ -256,7 +255,6 @@ onMounted(async () => {
/>
<span v-else>{{ row.productPrice || '-' }}</span>
</template>
<template #taxPercent="{ row }">
<InputNumber
v-if="!disabled"
@@ -268,11 +266,26 @@ onMounted(async () => {
/>
<span v-else>{{ row.taxPercent || '-' }}</span>
</template>
<template #remark="{ row }">
<Input v-if="!disabled" v-model:value="row.remark" class="w-full" />
<span v-else>{{ row.remark || '-' }}</span>
</template>
<template #actions="{ row }">
<TableAction
v-if="!disabled"
:actions="[
{
label: '删除',
type: 'link',
danger: true,
popConfirm: {
title: '确认删除该产品吗?',
confirm: handleDelete.bind(null, row),
},
},
]"
/>
</template>
<template #bottom>
<div class="border-border bg-muted mt-2 rounded border p-2">
@@ -290,10 +303,9 @@ onMounted(async () => {
</div>
</div>
</div>
<TableAction
v-if="!disabled"
class="mt-4 flex justify-center"
class="mt-2 flex justify-center"
:actions="[
{
label: '添加产品',
@@ -303,22 +315,5 @@ onMounted(async () => {
]"
/>
</template>
<template #actions="{ row }">
<TableAction
v-if="!disabled"
:actions="[
{
label: '删除',
type: 'link',
danger: true,
popConfirm: {
title: '确认删除该产品吗?',
confirm: handleDelete.bind(null, row),
},
},
]"
/>
</template>
</Grid>
</template>