新增:商户入驻申请

This commit is contained in:
2024-09-09 01:14:20 +08:00
parent a677b9b094
commit a1a0b360b0
4 changed files with 101 additions and 94 deletions

View File

@@ -14,6 +14,8 @@ export interface MerchantApply {
phone?: string; phone?: string;
// 商户姓名 // 商户姓名
realName?: string; realName?: string;
// 工作人员名称
name2?: string;
// 店铺类型 // 店铺类型
shopType?: string; shopType?: string;
// 商户分类 // 商户分类
@@ -32,6 +34,7 @@ export interface MerchantApply {
goodsReview?: number; goodsReview?: number;
// 备注 // 备注
comments?: string; comments?: string;
reason?: string;
// 状态 // 状态
status?: number; status?: number;
// 排序号 // 排序号

View File

@@ -26,9 +26,7 @@
v-model:value="form.merchantName" v-model:value="form.merchantName"
/> />
</a-form-item> </a-form-item>
<a-form-item <a-form-item label="商户图标" name="image">
label="商户图标"
name="image">
<SelectFile <SelectFile
:placeholder="`请选择图片`" :placeholder="`请选择图片`"
:limit="1" :limit="1"
@@ -51,63 +49,39 @@
v-model:value="form.realName" v-model:value="form.realName"
/> />
</a-form-item> </a-form-item>
<a-form-item label="店铺类型" name="shopType"> <a-form-item label="工作负责人" name="name2">
<a-input <a-input
allow-clear allow-clear
placeholder="请输入店铺类型" placeholder="工作负责人名称"
v-model:value="form.name2"
/>
</a-form-item>
<a-form-item label="店铺类型" name="shopType">
<SelectMerchantType
:placeholder="`请选择店铺类型`"
v-model:value="form.shopType" v-model:value="form.shopType"
@done="chooseShopType"
/> />
</a-form-item> </a-form-item>
<a-form-item label="商户分类" name="category"> <a-form-item label="商户分类" name="category">
<a-input <industry-select
allow-clear
placeholder="请输入商户分类"
v-model:value="form.category" v-model:value="form.category"
/> valueField="label"
</a-form-item> placeholder="请选择所属行业"
<a-form-item label="手续费" name="commission"> class="ele-fluid"
<a-input @change="onIndustry"
allow-clear
placeholder="请输入手续费"
v-model:value="form.commission"
/>
</a-form-item>
<a-form-item label="关键字" name="keywords">
<a-input
allow-clear
placeholder="请输入关键字"
v-model:value="form.keywords"
/> />
</a-form-item> </a-form-item>
<a-form-item label="资质图片" name="files"> <a-form-item label="资质图片" name="files">
<a-input <SelectFile
allow-clear :placeholder="`请选择图片`"
placeholder="请输入资质图片" :limit="9"
v-model:value="form.files" :data="files"
@done="chooseFiles"
@del="onDeleteFiles"
/> />
</a-form-item> </a-form-item>
<a-form-item label="是否自营" name="ownStore"> <a-form-item label="产品介绍" name="comments">
<a-input
allow-clear
placeholder="请输入是否自营"
v-model:value="form.ownStore"
/>
</a-form-item>
<a-form-item label="是否推荐" name="recommend">
<a-input
allow-clear
placeholder="请输入是否推荐"
v-model:value="form.recommend"
/>
</a-form-item>
<a-form-item label="是否需要审核" name="goodsReview">
<a-input
allow-clear
placeholder="请输入是否需要审核"
v-model:value="form.goodsReview"
/>
</a-form-item>
<a-form-item label="备注" name="comments">
<a-textarea <a-textarea
:rows="4" :rows="4"
:maxlength="200" :maxlength="200"
@@ -115,19 +89,18 @@
v-model:value="form.comments" v-model:value="form.comments"
/> />
</a-form-item> </a-form-item>
<a-form-item label="状态" name="status"> <a-form-item label="审核状态" name="status">
<a-radio-group v-model:value="form.status"> <a-radio-group v-model:value="form.status">
<a-radio :value="0">显示</a-radio> <a-radio :value="1">审核通过</a-radio>
<a-radio :value="1">隐藏</a-radio> <a-radio :value="2">驳回</a-radio>
</a-radio-group> </a-radio-group>
</a-form-item> </a-form-item>
<a-form-item label="排序号" name="sortNumber"> <a-form-item v-if="form.status == 2" label="驳回原因" name="comments">
<a-input-number <a-textarea
:min="0" :rows="4"
:max="9999" :maxlength="200"
class="ele-fluid" placeholder="请输入驳回原因"
placeholder="请输入排序号" v-model:value="form.reason"
v-model:value="form.sortNumber"
/> />
</a-form-item> </a-form-item>
</a-form> </a-form>
@@ -138,13 +111,17 @@
import { ref, reactive, watch } from 'vue'; import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue'; import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro'; import { assignObject, uuid } from 'ele-admin-pro';
import { addMerchantApply, updateMerchantApply } from '@/api/shop/merchantApply'; import {
addMerchantApply,
updateMerchantApply
} from '@/api/shop/merchantApply';
import { MerchantApply } from '@/api/shop/merchantApply/model'; import { MerchantApply } from '@/api/shop/merchantApply/model';
import { useThemeStore } from '@/store/modules/theme'; import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia'; import { storeToRefs } from 'pinia';
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types'; import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
import { FormInstance } from 'ant-design-vue/es/form'; import { FormInstance } from 'ant-design-vue/es/form';
import { FileRecord } from '@/api/system/file/model'; import { FileRecord } from '@/api/system/file/model';
import { MerchantType } from '@/api/shop/merchantType/model';
// 是否是修改 // 是否是修改
const isUpdate = ref(false); const isUpdate = ref(false);
@@ -172,6 +149,7 @@
// 表格选中数据 // 表格选中数据
const formRef = ref<FormInstance | null>(null); const formRef = ref<FormInstance | null>(null);
const images = ref<ItemType[]>([]); const images = ref<ItemType[]>([]);
const files = ref<ItemType[]>([]);
// 用户信息 // 用户信息
const form = reactive<MerchantApply>({ const form = reactive<MerchantApply>({
@@ -180,6 +158,7 @@
image: undefined, image: undefined,
phone: undefined, phone: undefined,
realName: undefined, realName: undefined,
name2: '',
shopType: undefined, shopType: undefined,
category: undefined, category: undefined,
commission: undefined, commission: undefined,
@@ -189,15 +168,11 @@
recommend: undefined, recommend: undefined,
goodsReview: undefined, goodsReview: undefined,
comments: undefined, comments: undefined,
reason: undefined,
status: undefined, status: undefined,
sortNumber: undefined, sortNumber: undefined,
tenantId: undefined, tenantId: undefined,
createTime: undefined, createTime: undefined
merchantApplyId: undefined,
merchantApplyName: '',
status: 0,
comments: '',
sortNumber: 100
}); });
/* 更新visible */ /* 更新visible */
@@ -207,11 +182,11 @@
// 表单验证规则 // 表单验证规则
const rules = reactive({ const rules = reactive({
merchantApplyName: [ merchantName: [
{ {
required: true, required: true,
type: 'string', type: 'string',
message: '请填写商户入驻申请名称', message: '请填写商户名称',
trigger: 'blur' trigger: 'blur'
} }
] ]
@@ -231,6 +206,26 @@
form.image = ''; form.image = '';
}; };
const chooseShopType = (data: MerchantType) => {
form.shopType = data.name;
};
const onIndustry = (item: any) => {
form.category = item[0] + '/' + item[1];
};
const chooseFiles = (data: FileRecord) => {
files.value.push({
uid: data.id,
url: data.path,
status: 'done'
});
};
const onDeleteFiles = (index: number) => {
files.value.splice(index, 1);
};
const { resetFields } = useForm(form, rules); const { resetFields } = useForm(form, rules);
/* 保存编辑 */ /* 保存编辑 */
@@ -245,7 +240,9 @@
const formData = { const formData = {
...form ...form
}; };
const saveOrUpdate = isUpdate.value ? updateMerchantApply : addMerchantApply; const saveOrUpdate = isUpdate.value
? updateMerchantApply
: addMerchantApply;
saveOrUpdate(formData) saveOrUpdate(formData)
.then((msg) => { .then((msg) => {
loading.value = false; loading.value = false;
@@ -268,12 +265,13 @@
images.value = []; images.value = [];
if (props.data) { if (props.data) {
assignObject(form, props.data); assignObject(form, props.data);
if(props.data.image){ form.status = 1;
if (props.data.image) {
images.value.push({ images.value.push({
uid: uuid(), uid: uuid(),
url: props.data.image, url: props.data.image,
status: 'done' status: 'done'
}) });
} }
isUpdate.value = true; isUpdate.value = true;
} else { } else {

View File

@@ -1,12 +1,12 @@
<!-- 搜索表单 --> <!-- 搜索表单 -->
<template> <template>
<a-space :size="10" style="flex-wrap: wrap"> <a-space :size="10" style="flex-wrap: wrap">
<a-button type="primary" class="ele-btn-icon" @click="add"> <!-- <a-button type="primary" class="ele-btn-icon" @click="add">-->
<template #icon> <!-- <template #icon>-->
<PlusOutlined /> <!-- <PlusOutlined />-->
</template> <!-- </template>-->
<span>添加</span> <!-- <span>添加</span>-->
</a-button> <!-- </a-button>-->
</a-space> </a-space>
</template> </template>

View File

@@ -1,13 +1,18 @@
<template> <template>
<div class="page"> <div class="page">
<div class="ele-body"> <div class="ele-body">
<a-card :bordered="false" :body-style="{ padding: '16px' }"> <a-card
title="商户申请列表"
:bordered="false"
:body-style="{ padding: '16px' }"
>
<ele-pro-table <ele-pro-table
ref="tableRef" ref="tableRef"
row-key="merchantApplyId" row-key="merchantApplyId"
:columns="columns" :columns="columns"
:datasource="datasource" :datasource="datasource"
:customRow="customRow" :customRow="customRow"
:toolbar="false"
tool-class="ele-toolbar-form" tool-class="ele-toolbar-form"
class="sys-org-table" class="sys-org-table"
> >
@@ -25,8 +30,9 @@
<a-image :src="record.image" :width="50" /> <a-image :src="record.image" :width="50" />
</template> </template>
<template v-if="column.key === 'status'"> <template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="orange">处理</a-tag> <a-tag v-if="record.status === 0" color="orange">审核</a-tag>
<a-tag v-if="record.status === 1" color="green">通过</a-tag> <a-tag v-if="record.status === 1" color="green">审核通过</a-tag>
<a-tag v-if="record.status === 2" color="green">驳回</a-tag>
</template> </template>
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
<a-space> <a-space>
@@ -67,7 +73,7 @@
DatasourceFunction, DatasourceFunction,
ColumnItem ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types'; } from 'ele-admin-pro/es/ele-pro-table/types';
import Search from '../merchant/components/search.vue'; import Search from './components/search.vue';
import MerchantApplyEdit from './components/merchantApplyEdit.vue'; import MerchantApplyEdit from './components/merchantApplyEdit.vue';
import { import {
pageMerchantApply, pageMerchantApply,
@@ -138,6 +144,12 @@
key: 'phone', key: 'phone',
align: 'center' align: 'center'
}, },
{
title: '店铺类型',
dataIndex: 'shopType',
key: 'shopType',
align: 'center'
},
{ {
title: '申请时间', title: '申请时间',
dataIndex: 'createTime', dataIndex: 'createTime',
@@ -147,12 +159,6 @@
ellipsis: true, ellipsis: true,
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:MM:ss') customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:MM:ss')
}, },
{
title: '店铺类型',
dataIndex: 'shopType',
key: 'shopType',
align: 'center'
},
{ {
title: '状态', title: '状态',
dataIndex: 'status', dataIndex: 'status',