feat(shop): 添加订单月份字段并优化搜索功能
- 在订单模型中新增 month 字段用于记录订单月份- 搜索组件中引入批量删除功能并优化按钮交互逻辑 - 替换搜索输入框为带搜索功能的 InputSearch 组件 - 更新结算金额和实发金额计算方式,使用 settledPrice 和 payPrice 字段 - 表格列中增加月份显示列并调整部分列宽度- 修改收益比率相关标签文案,如“税率”、“占比”等 - 调整编辑页数据绑定逻辑以支持新增字段展示 - 开发环境 API 地址默认启用本地地址配置
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
VITE_APP_NAME=后台管理(开发环境)
|
VITE_APP_NAME=后台管理(开发环境)
|
||||||
#VITE_API_URL=http://127.0.0.1:9200/api
|
VITE_API_URL=http://127.0.0.1:9200/api
|
||||||
#VITE_SERVER_API_URL=http://127.0.0.1:8000/api
|
#VITE_SERVER_API_URL=http://127.0.0.1:8000/api
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ export interface ShopDealerOrder {
|
|||||||
rate?: number;
|
rate?: number;
|
||||||
// 商品单价
|
// 商品单价
|
||||||
price?: string;
|
price?: string;
|
||||||
|
// 订单月份
|
||||||
|
month?: string;
|
||||||
// 订单是否失效(0未失效 1已失效)
|
// 订单是否失效(0未失效 1已失效)
|
||||||
isInvalid?: number;
|
isInvalid?: number;
|
||||||
// 佣金结算(0未结算 1已结算)
|
// 佣金结算(0未结算 1已结算)
|
||||||
|
|||||||
@@ -2,15 +2,31 @@
|
|||||||
<div class="flex items-center gap-20">
|
<div class="flex items-center gap-20">
|
||||||
<!-- 搜索表单 -->
|
<!-- 搜索表单 -->
|
||||||
<a-form
|
<a-form
|
||||||
:model="searchForm"
|
:model="where"
|
||||||
layout="inline"
|
layout="inline"
|
||||||
class="search-form"
|
class="search-form"
|
||||||
@finish="handleSearch"
|
@finish="handleSearch"
|
||||||
>
|
>
|
||||||
|
<a-form-item>
|
||||||
|
<a-space>
|
||||||
|
<a-button
|
||||||
|
danger
|
||||||
|
class="ele-btn-icon"
|
||||||
|
v-if="selection.length > 0"
|
||||||
|
:disabled="selection?.length === 0"
|
||||||
|
@click="removeBatch"
|
||||||
|
>
|
||||||
|
<template #icon>
|
||||||
|
<DeleteOutlined/>
|
||||||
|
</template>
|
||||||
|
<span>批量删除</span>
|
||||||
|
</a-button>
|
||||||
|
</a-space>
|
||||||
|
</a-form-item>
|
||||||
|
|
||||||
<a-form-item label="订单状态">
|
<a-form-item label="订单状态">
|
||||||
<a-select
|
<a-select
|
||||||
v-model:value="searchForm.isInvalid"
|
v-model:value="where.isInvalid"
|
||||||
placeholder="全部"
|
placeholder="全部"
|
||||||
allow-clear
|
allow-clear
|
||||||
style="width: 120px"
|
style="width: 120px"
|
||||||
@@ -22,7 +38,7 @@
|
|||||||
|
|
||||||
<a-form-item label="结算状态">
|
<a-form-item label="结算状态">
|
||||||
<a-select
|
<a-select
|
||||||
v-model:value="searchForm.isSettled"
|
v-model:value="where.isSettled"
|
||||||
placeholder="全部"
|
placeholder="全部"
|
||||||
allow-clear
|
allow-clear
|
||||||
style="width: 120px"
|
style="width: 120px"
|
||||||
@@ -34,12 +50,19 @@
|
|||||||
|
|
||||||
<a-form-item>
|
<a-form-item>
|
||||||
<a-space>
|
<a-space>
|
||||||
<a-button type="primary" html-type="submit" class="ele-btn-icon">
|
<a-input-search
|
||||||
<template #icon>
|
allow-clear
|
||||||
<SearchOutlined/>
|
placeholder="请输入关键词"
|
||||||
</template>
|
style="width: 240px"
|
||||||
搜索
|
v-model:value="where.keywords"
|
||||||
</a-button>
|
@search="handleSearch"
|
||||||
|
/>
|
||||||
|
<!-- <a-button type="primary" html-type="submit" class="ele-btn-icon">-->
|
||||||
|
<!-- <template #icon>-->
|
||||||
|
<!-- <SearchOutlined/>-->
|
||||||
|
<!-- </template>-->
|
||||||
|
<!-- 搜索-->
|
||||||
|
<!-- </a-button>-->
|
||||||
<a-button @click="resetSearch">
|
<a-button @click="resetSearch">
|
||||||
重置
|
重置
|
||||||
</a-button>
|
</a-button>
|
||||||
@@ -64,7 +87,7 @@
|
|||||||
type="primary"
|
type="primary"
|
||||||
danger
|
danger
|
||||||
@click="batchSettle"
|
@click="batchSettle"
|
||||||
class="ele-btn-icon"
|
:disabled="selection?.length === 0"
|
||||||
>
|
>
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<DollarOutlined/>
|
<DollarOutlined/>
|
||||||
@@ -83,10 +106,12 @@ import {reactive, ref} from 'vue';
|
|||||||
import {
|
import {
|
||||||
SearchOutlined,
|
SearchOutlined,
|
||||||
DollarOutlined,
|
DollarOutlined,
|
||||||
UploadOutlined
|
UploadOutlined,
|
||||||
|
DeleteOutlined
|
||||||
} from '@ant-design/icons-vue';
|
} from '@ant-design/icons-vue';
|
||||||
import type {ShopDealerOrderParam} from '@/api/shop/shopDealerOrder/model';
|
import type {ShopDealerOrderParam} from '@/api/shop/shopDealerOrder/model';
|
||||||
import Import from './Import.vue';
|
import Import from './Import.vue';
|
||||||
|
import useSearch from "@/utils/use-search";
|
||||||
|
|
||||||
const props = withDefaults(
|
const props = withDefaults(
|
||||||
defineProps<{
|
defineProps<{
|
||||||
@@ -109,7 +134,7 @@ const emit = defineEmits<{
|
|||||||
const showImport = ref(false);
|
const showImport = ref(false);
|
||||||
|
|
||||||
// 搜索表单
|
// 搜索表单
|
||||||
const searchForm = reactive<ShopDealerOrderParam>({
|
const {where, resetFields} = useSearch<ShopDealerOrderParam>({
|
||||||
orderId: undefined,
|
orderId: undefined,
|
||||||
orderNo: '',
|
orderNo: '',
|
||||||
productName: '',
|
productName: '',
|
||||||
@@ -119,7 +144,7 @@ const searchForm = reactive<ShopDealerOrderParam>({
|
|||||||
|
|
||||||
// 搜索
|
// 搜索
|
||||||
const handleSearch = () => {
|
const handleSearch = () => {
|
||||||
const searchParams = {...searchForm};
|
const searchParams = {...where};
|
||||||
// 清除空值
|
// 清除空值
|
||||||
Object.keys(searchParams).forEach(key => {
|
Object.keys(searchParams).forEach(key => {
|
||||||
if (searchParams[key] === '' || searchParams[key] === undefined) {
|
if (searchParams[key] === '' || searchParams[key] === undefined) {
|
||||||
@@ -131,12 +156,18 @@ const handleSearch = () => {
|
|||||||
|
|
||||||
// 重置搜索
|
// 重置搜索
|
||||||
const resetSearch = () => {
|
const resetSearch = () => {
|
||||||
Object.keys(searchForm).forEach(key => {
|
// Object.keys(searchForm).forEach(key => {
|
||||||
searchForm[key] = key === 'orderId' ? undefined : '';
|
// searchForm[key] = key === 'orderId' ? undefined : '';
|
||||||
});
|
// });
|
||||||
|
resetFields();
|
||||||
emit('search', {});
|
emit('search', {});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 批量删除
|
||||||
|
const removeBatch = () => {
|
||||||
|
emit('remove');
|
||||||
|
};
|
||||||
|
|
||||||
// 批量结算
|
// 批量结算
|
||||||
const batchSettle = () => {
|
const batchSettle = () => {
|
||||||
emit('batchSettle');
|
emit('batchSettle');
|
||||||
|
|||||||
@@ -43,20 +43,20 @@
|
|||||||
</a-col>
|
</a-col>
|
||||||
|
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="收益比率" name="rate">
|
<a-form-item label="税率" name="rate">
|
||||||
{{ form.rate }}
|
{{ form.rate }}
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="结算金额" name="payPrice">
|
<a-form-item label="结算金额" name="payPrice">
|
||||||
{{ (form.orderPrice * form.rate * 1000).toFixed(2) }}
|
{{ parseFloat(form.settledPrice || 0).toFixed(2) }}
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="实发金额" name="payPrice">
|
<a-form-item label="实发金额" name="payPrice">
|
||||||
{{ (form.orderPrice * form.rate * 1000).toFixed(2) }}
|
{{ parseFloat(form.payPrice || 0).toFixed(2) }}
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
@@ -83,7 +83,7 @@
|
|||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="收益比率" name="rate">
|
<a-form-item label="占比" name="rate">
|
||||||
{{ '70%' }}
|
{{ '70%' }}
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="获取收益" name="firstMoney">
|
<a-form-item label="获取收益" name="firstMoney">
|
||||||
@@ -116,7 +116,7 @@
|
|||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="收益比率" name="rate">
|
<a-form-item label="占比" name="rate">
|
||||||
{{ '30%' }}
|
{{ '30%' }}
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="获取收益" name="secondMoney">
|
<a-form-item label="获取收益" name="secondMoney">
|
||||||
@@ -179,6 +179,10 @@
|
|||||||
nickname: undefined,
|
nickname: undefined,
|
||||||
orderId: undefined,
|
orderId: undefined,
|
||||||
orderPrice: undefined,
|
orderPrice: undefined,
|
||||||
|
settledPrice: undefined,
|
||||||
|
price: undefined,
|
||||||
|
month: undefined,
|
||||||
|
payPrice: undefined,
|
||||||
firstUserId: undefined,
|
firstUserId: undefined,
|
||||||
secondUserId: undefined,
|
secondUserId: undefined,
|
||||||
thirdUserId: undefined,
|
thirdUserId: undefined,
|
||||||
@@ -261,7 +265,7 @@
|
|||||||
if (props.data) {
|
if (props.data) {
|
||||||
assignObject(form, props.data);
|
assignObject(form, props.data);
|
||||||
if(props.data.orderPrice && props.data.rate){
|
if(props.data.orderPrice && props.data.rate){
|
||||||
form.firstMoney = (Number(props.data.orderPrice) * props.data.rate * 1000 * 0.5).toFixed(2)
|
form.firstMoney = (Number(props.data.payPrice) * 0.7).toFixed(2)
|
||||||
}
|
}
|
||||||
isUpdate.value = true;
|
isUpdate.value = true;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
:columns="columns"
|
:columns="columns"
|
||||||
:datasource="datasource"
|
:datasource="datasource"
|
||||||
:customRow="customRow"
|
:customRow="customRow"
|
||||||
|
v-model:selection="selection"
|
||||||
tool-class="ele-toolbar-form"
|
tool-class="ele-toolbar-form"
|
||||||
class="sys-org-table"
|
class="sys-org-table"
|
||||||
>
|
>
|
||||||
@@ -16,6 +17,7 @@
|
|||||||
:selection="selection"
|
:selection="selection"
|
||||||
@batchSettle="batchSettle"
|
@batchSettle="batchSettle"
|
||||||
@export="handleExport"
|
@export="handleExport"
|
||||||
|
@remove="removeBatch"
|
||||||
@importDone="reload"
|
@importDone="reload"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
@@ -40,11 +42,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="column.key === 'settledPrice'">
|
<template v-if="column.key === 'settledPrice'">
|
||||||
{{ (record.orderPrice * record.rate * 1000).toFixed(2) }}
|
{{ record.settledPrice.toFixed(2) }}
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="column.key === 'payPrice'">
|
<template v-if="column.key === 'payPrice'">
|
||||||
{{ (record.orderPrice * record.rate).toFixed(2) }}
|
{{ record.payPrice.toFixed(2) }}
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="column.key === 'dealerInfo'">
|
<template v-if="column.key === 'dealerInfo'">
|
||||||
@@ -189,7 +191,8 @@ const columns = ref<ColumnItem[]>([
|
|||||||
{
|
{
|
||||||
title: '客户名称',
|
title: '客户名称',
|
||||||
dataIndex: 'comments',
|
dataIndex: 'comments',
|
||||||
key: 'comments'
|
key: 'comments',
|
||||||
|
width: 120
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '结算电量',
|
title: '结算电量',
|
||||||
@@ -234,6 +237,13 @@ const columns = ref<ColumnItem[]>([
|
|||||||
align: 'center',
|
align: 'center',
|
||||||
width: 100
|
width: 100
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '月份',
|
||||||
|
dataIndex: 'month',
|
||||||
|
key: 'month',
|
||||||
|
align: 'center',
|
||||||
|
width: 100
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '结算状态',
|
title: '结算状态',
|
||||||
dataIndex: 'isSettled',
|
dataIndex: 'isSettled',
|
||||||
|
|||||||
Reference in New Issue
Block a user