feat:【antd】【erp 系统】sale 重构代码风格(处理文案等)
This commit is contained in:
@@ -111,7 +111,7 @@ export function useFormSchema(formType: string): VbenFormSchema[] {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldName: 'items',
|
fieldName: 'items',
|
||||||
label: '产品清单',
|
label: '销售产品清单',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
formItemClass: 'col-span-3',
|
formItemClass: 'col-span-3',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -19,13 +19,13 @@ import {
|
|||||||
import { $t } from '#/locales';
|
import { $t } from '#/locales';
|
||||||
|
|
||||||
import { useGridColumns, useGridFormSchema } from './data';
|
import { useGridColumns, useGridFormSchema } from './data';
|
||||||
import SaleOrderForm from './modules/form.vue';
|
import Form from './modules/form.vue';
|
||||||
|
|
||||||
/** ERP 销售订单列表 */
|
/** ERP 销售订单列表 */
|
||||||
defineOptions({ name: 'ErpSaleOrder' });
|
defineOptions({ name: 'ErpSaleOrder' });
|
||||||
|
|
||||||
const [FormModal, formModalApi] = useVbenModal({
|
const [FormModal, formModalApi] = useVbenModal({
|
||||||
connectedComponent: SaleOrderForm,
|
connectedComponent: Form,
|
||||||
destroyOnClose: true,
|
destroyOnClose: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -308,7 +308,7 @@ onMounted(async () => {
|
|||||||
class="mt-2 flex justify-center"
|
class="mt-2 flex justify-center"
|
||||||
:actions="[
|
:actions="[
|
||||||
{
|
{
|
||||||
label: '添加产品',
|
label: '添加销售产品',
|
||||||
type: 'default',
|
type: 'default',
|
||||||
onClick: handleAdd,
|
onClick: handleAdd,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ export function useFormSchema(formType: string): VbenFormSchema[] {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldName: 'items',
|
fieldName: 'items',
|
||||||
label: '产品清单',
|
label: '出库产品清单',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
formItemClass: 'col-span-3',
|
formItemClass: 'col-span-3',
|
||||||
},
|
},
|
||||||
@@ -495,6 +495,7 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 列表的搜索表单 */
|
/** 列表的搜索表单 */
|
||||||
export function useOrderGridFormSchema(): VbenFormSchema[] {
|
export function useOrderGridFormSchema(): VbenFormSchema[] {
|
||||||
return [
|
return [
|
||||||
|
|||||||
@@ -19,13 +19,13 @@ import {
|
|||||||
import { $t } from '#/locales';
|
import { $t } from '#/locales';
|
||||||
|
|
||||||
import { useGridColumns, useGridFormSchema } from './data';
|
import { useGridColumns, useGridFormSchema } from './data';
|
||||||
import SaleOutForm from './modules/form.vue';
|
import Form from './modules/form.vue';
|
||||||
|
|
||||||
/** ERP 销售出库列表 */
|
/** ERP 销售出库列表 */
|
||||||
defineOptions({ name: 'ErpSaleOut' });
|
defineOptions({ name: 'ErpSaleOut' });
|
||||||
|
|
||||||
const [FormModal, formModalApi] = useVbenModal({
|
const [FormModal, formModalApi] = useVbenModal({
|
||||||
connectedComponent: SaleOutForm,
|
connectedComponent: Form,
|
||||||
destroyOnClose: true,
|
destroyOnClose: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ const emit = defineEmits([
|
|||||||
'update:total-price',
|
'update:total-price',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const tableData = ref<ErpSaleOutApi.SaleOutItem[]>([]);
|
const tableData = ref<ErpSaleOutApi.SaleOutItem[]>([]); // 表格数据
|
||||||
const productOptions = ref<any[]>([]); // 产品下拉选项
|
const productOptions = ref<any[]>([]); // 产品下拉选项
|
||||||
const warehouseOptions = ref<any[]>([]); // 仓库下拉选项
|
const warehouseOptions = ref<any[]>([]); // 仓库下拉选项
|
||||||
|
|
||||||
|
|||||||
@@ -72,15 +72,15 @@ const [Grid] = useVbenVxeGrid({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 选择采购订单 */
|
/** 选择销售订单 */
|
||||||
function handleSelectOrder(selectOrder: ErpSaleOrderApi.SaleOrder) {
|
function handleSelectOrder(selectOrder: ErpSaleOrderApi.SaleOrder) {
|
||||||
order.value = selectOrder;
|
order.value = selectOrder;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 确认选择采购订单 */
|
/** 确认选择销售订单 */
|
||||||
const handleOk = () => {
|
const handleOk = () => {
|
||||||
if (!order.value) {
|
if (!order.value) {
|
||||||
message.warning('请选择一个采购订单');
|
message.warning('请选择一个销售订单');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
emit('update:order', order.value);
|
emit('update:order', order.value);
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ export function useFormSchema(formType: string): VbenFormSchema[] {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldName: 'items',
|
fieldName: 'items',
|
||||||
label: '产品清单',
|
label: '退货产品清单',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
formItemClass: 'col-span-3',
|
formItemClass: 'col-span-3',
|
||||||
},
|
},
|
||||||
@@ -143,10 +143,9 @@ export function useFormSchema(formType: string): VbenFormSchema[] {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldName: 'discountPrice',
|
fieldName: 'discountPrice',
|
||||||
label: '收款优惠',
|
label: '退款优惠',
|
||||||
component: 'InputNumber',
|
component: 'InputNumber',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
placeholder: '付款优惠',
|
|
||||||
precision: 2,
|
precision: 2,
|
||||||
formatter: erpPriceInputFormatter,
|
formatter: erpPriceInputFormatter,
|
||||||
disabled: true,
|
disabled: true,
|
||||||
@@ -241,17 +240,21 @@ export function useFormItemColumns(): VxeTableGridOptions['columns'] {
|
|||||||
minWidth: 150,
|
minWidth: 150,
|
||||||
slots: { default: 'remark' },
|
slots: { default: 'remark' },
|
||||||
},
|
},
|
||||||
|
// TODO @AI:formData[0]?.outCount != null
|
||||||
{
|
{
|
||||||
field: 'totalCount',
|
field: 'totalCount',
|
||||||
title: '原数量',
|
title: '已出库',
|
||||||
formatter: 'formatAmount3',
|
formatter: 'formatAmount3',
|
||||||
minWidth: 120,
|
minWidth: 120,
|
||||||
|
fixed: 'right',
|
||||||
},
|
},
|
||||||
|
// TODO @AI:formData[0]?.returnCount != null
|
||||||
{
|
{
|
||||||
field: 'returnCount',
|
field: 'returnCount',
|
||||||
title: '已退货数量',
|
title: '已退货',
|
||||||
formatter: 'formatAmount3',
|
formatter: 'formatAmount3',
|
||||||
minWidth: 120,
|
minWidth: 120,
|
||||||
|
fixed: 'right',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'count',
|
field: 'count',
|
||||||
@@ -444,7 +447,7 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'productNames',
|
field: 'productNames',
|
||||||
title: '产品信息',
|
title: '退货产品信息',
|
||||||
showOverflow: 'tooltip',
|
showOverflow: 'tooltip',
|
||||||
minWidth: 120,
|
minWidth: 120,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -19,13 +19,13 @@ import {
|
|||||||
import { $t } from '#/locales';
|
import { $t } from '#/locales';
|
||||||
|
|
||||||
import { useGridColumns, useGridFormSchema } from './data';
|
import { useGridColumns, useGridFormSchema } from './data';
|
||||||
import SaleReturnForm from './modules/form.vue';
|
import Form from './modules/form.vue';
|
||||||
|
|
||||||
/** ERP 销售退货列表 */
|
/** ERP 销售退货列表 */
|
||||||
defineOptions({ name: 'ErpSaleReturn' });
|
defineOptions({ name: 'ErpSaleReturn' });
|
||||||
|
|
||||||
const [FormModal, formModalApi] = useVbenModal({
|
const [FormModal, formModalApi] = useVbenModal({
|
||||||
connectedComponent: SaleReturnForm,
|
connectedComponent: Form,
|
||||||
destroyOnClose: true,
|
destroyOnClose: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -197,16 +197,15 @@ onMounted(async () => {
|
|||||||
<Grid class="w-full">
|
<Grid class="w-full">
|
||||||
<template #warehouseId="{ row }">
|
<template #warehouseId="{ row }">
|
||||||
<Select
|
<Select
|
||||||
v-if="!disabled"
|
|
||||||
v-model:value="row.warehouseId"
|
v-model:value="row.warehouseId"
|
||||||
:options="warehouseOptions"
|
:options="warehouseOptions"
|
||||||
:field-names="{ label: 'name', value: 'id' }"
|
:field-names="{ label: 'name', value: 'id' }"
|
||||||
class="w-full"
|
|
||||||
placeholder="请选择仓库"
|
placeholder="请选择仓库"
|
||||||
|
:disabled="disabled"
|
||||||
show-search
|
show-search
|
||||||
|
class="w-full"
|
||||||
@change="handleWarehouseChange(row)"
|
@change="handleWarehouseChange(row)"
|
||||||
/>
|
/>
|
||||||
<span v-else>{{ row.warehouseName || '-' }}</span>
|
|
||||||
</template>
|
</template>
|
||||||
<template #productId="{ row }">
|
<template #productId="{ row }">
|
||||||
<Select
|
<Select
|
||||||
@@ -288,4 +287,4 @@ onMounted(async () => {
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</Grid>
|
</Grid>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user