- 新增经销商申请页面,支持申请列表展示和分页查询 - 添加搜索组件,支持按客户名称、联系电话、审核状态等条件筛选 - 实现申请状态管理,包括跟进中、已签约、已取消三种状态 - 开发编辑弹窗功能,支持新增和修改申请信息 - 添加审核功能,支持批量通过和单个驳回操作 - 集成跟进记录管理,可查看历史记录并添加新的跟进内容 - 完善表单验证,包含必填字段校验和格式验证 - 优化模型定义,在相关实体中增加头像、昵称、真实姓名等字段 - 调整商品模型,将isShow字段从数字类型改为布尔类型 - 新增分销佣金相关字段,支持固定金额和百分比两种分佣类型
222 lines
5.3 KiB
Vue
222 lines
5.3 KiB
Vue
<!-- 搜索表单 -->
|
|
<template>
|
|
<div class="search-container">
|
|
<!-- 搜索表单 -->
|
|
<a-form
|
|
:model="searchForm"
|
|
layout="inline"
|
|
class="search-form"
|
|
@finish="handleSearch"
|
|
>
|
|
<a-form-item label="申请人姓名">
|
|
<a-input
|
|
v-model:value="searchForm.realName"
|
|
placeholder="请输入申请人姓名"
|
|
allow-clear
|
|
style="width: 160px"
|
|
/>
|
|
</a-form-item>
|
|
|
|
<a-form-item label="手机号码">
|
|
<a-input
|
|
v-model:value="searchForm.mobile"
|
|
placeholder="请输入手机号码"
|
|
allow-clear
|
|
style="width: 160px"
|
|
/>
|
|
</a-form-item>
|
|
|
|
<a-form-item label="申请方式">
|
|
<a-select
|
|
v-model:value="searchForm.applyType"
|
|
placeholder="全部方式"
|
|
allow-clear
|
|
style="width: 120px"
|
|
>
|
|
<a-select-option :value="10">需要审核</a-select-option>
|
|
<a-select-option :value="20">免审核</a-select-option>
|
|
</a-select>
|
|
</a-form-item>
|
|
|
|
<a-form-item label="审核状态">
|
|
<a-select
|
|
v-model:value="searchForm.applyStatus"
|
|
placeholder="全部状态"
|
|
allow-clear
|
|
style="width: 120px"
|
|
>
|
|
<a-select-option :value="10">待审核</a-select-option>
|
|
<a-select-option :value="20">审核通过</a-select-option>
|
|
<a-select-option :value="30">审核驳回</a-select-option>
|
|
</a-select>
|
|
</a-form-item>
|
|
|
|
<a-form-item label="申请时间">
|
|
<a-range-picker
|
|
v-model:value="searchForm.dateRange"
|
|
style="width: 240px"
|
|
/>
|
|
</a-form-item>
|
|
|
|
<a-form-item>
|
|
<a-space>
|
|
<a-button type="primary" html-type="submit" class="ele-btn-icon">
|
|
<template #icon>
|
|
<SearchOutlined />
|
|
</template>
|
|
搜索
|
|
</a-button>
|
|
<a-button @click="resetSearch"> 重置 </a-button>
|
|
</a-space>
|
|
</a-form-item>
|
|
</a-form>
|
|
|
|
<!-- 操作按钮 -->
|
|
<div class="action-buttons">
|
|
<a-space>
|
|
<!-- <a-button type="primary" @click="add" class="ele-btn-icon">-->
|
|
<!-- <template #icon>-->
|
|
<!-- <PlusOutlined />-->
|
|
<!-- </template>-->
|
|
<!-- 新增申请-->
|
|
<!-- </a-button>-->
|
|
<a-button
|
|
type="primary"
|
|
ghost
|
|
:disabled="!selection?.length"
|
|
@click="batchApprove"
|
|
class="ele-btn-icon"
|
|
>
|
|
<template #icon>
|
|
<CheckOutlined />
|
|
</template>
|
|
批量通过
|
|
</a-button>
|
|
<a-button
|
|
:disabled="!selection?.length"
|
|
@click="exportData"
|
|
class="ele-btn-icon"
|
|
>
|
|
<template #icon>
|
|
<ExportOutlined />
|
|
</template>
|
|
导出数据
|
|
</a-button>
|
|
</a-space>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import { reactive } from 'vue';
|
|
import {
|
|
PlusOutlined,
|
|
SearchOutlined,
|
|
CheckOutlined,
|
|
ExportOutlined
|
|
} from '@ant-design/icons-vue';
|
|
import type { ShopDealerApplyParam } from '@/api/shop/shopDealerApply/model';
|
|
import dayjs from 'dayjs';
|
|
|
|
const props = withDefaults(
|
|
defineProps<{
|
|
// 选中的数据
|
|
selection?: any[];
|
|
}>(),
|
|
{
|
|
selection: () => []
|
|
}
|
|
);
|
|
|
|
const emit = defineEmits<{
|
|
(e: 'search', where?: ShopDealerApplyParam): void;
|
|
(e: 'add'): void;
|
|
(e: 'batchApprove'): void;
|
|
(e: 'export'): void;
|
|
}>();
|
|
|
|
// 搜索表单
|
|
const searchForm = reactive<any>({
|
|
realName: '',
|
|
mobile: '',
|
|
applyType: undefined,
|
|
applyStatus: undefined,
|
|
dateRange: undefined
|
|
});
|
|
|
|
// 搜索
|
|
const handleSearch = () => {
|
|
const searchParams: ShopDealerApplyParam = {};
|
|
|
|
if (searchForm.realName) {
|
|
searchParams.realName = searchForm.realName;
|
|
}
|
|
if (searchForm.mobile) {
|
|
searchParams.mobile = searchForm.mobile;
|
|
}
|
|
if (searchForm.applyType) {
|
|
searchParams.applyType = searchForm.applyType;
|
|
}
|
|
if (searchForm.applyStatus) {
|
|
searchParams.applyStatus = searchForm.applyStatus;
|
|
}
|
|
if (searchForm.dateRange && searchForm.dateRange.length === 2) {
|
|
searchParams.startTime = dayjs(searchForm.dateRange[0]).format(
|
|
'YYYY-MM-DD'
|
|
);
|
|
searchParams.endTime = dayjs(searchForm.dateRange[1]).format(
|
|
'YYYY-MM-DD'
|
|
);
|
|
}
|
|
|
|
emit('search', searchParams);
|
|
};
|
|
|
|
// 重置搜索
|
|
const resetSearch = () => {
|
|
searchForm.realName = '';
|
|
searchForm.mobile = '';
|
|
searchForm.applyType = undefined;
|
|
searchForm.applyStatus = undefined;
|
|
searchForm.dateRange = undefined;
|
|
emit('search', {});
|
|
};
|
|
|
|
// 新增
|
|
const add = () => {
|
|
emit('add');
|
|
};
|
|
|
|
// 批量通过
|
|
const batchApprove = () => {
|
|
emit('batchApprove');
|
|
};
|
|
|
|
// 导出数据
|
|
const exportData = () => {
|
|
emit('export');
|
|
};
|
|
</script>
|
|
|
|
<style lang="less" scoped>
|
|
.search-container {
|
|
background: #fff;
|
|
padding: 16px;
|
|
border-radius: 6px;
|
|
margin-bottom: 16px;
|
|
|
|
.search-form {
|
|
margin-bottom: 16px;
|
|
|
|
:deep(.ant-form-item) {
|
|
margin-bottom: 8px;
|
|
}
|
|
}
|
|
|
|
.action-buttons {
|
|
border-top: 1px solid #f0f0f0;
|
|
padding-top: 16px;
|
|
}
|
|
}
|
|
</style>
|