From a1a0b360b03613d6a87ac79fa47a99025c23e65f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Mon, 9 Sep 2024 01:14:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=E5=95=86=E6=88=B7?= =?UTF-8?q?=E5=85=A5=E9=A9=BB=E7=94=B3=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/shop/merchantApply/model/index.ts | 3 + .../components/merchantApplyEdit.vue | 154 +++++++++--------- .../shop/merchantApply/components/search.vue | 12 +- src/views/shop/merchantApply/index.vue | 26 +-- 4 files changed, 101 insertions(+), 94 deletions(-) diff --git a/src/api/shop/merchantApply/model/index.ts b/src/api/shop/merchantApply/model/index.ts index d02cc2c..1101d3c 100644 --- a/src/api/shop/merchantApply/model/index.ts +++ b/src/api/shop/merchantApply/model/index.ts @@ -14,6 +14,8 @@ export interface MerchantApply { phone?: string; // 商户姓名 realName?: string; + // 工作人员名称 + name2?: string; // 店铺类型 shopType?: string; // 商户分类 @@ -32,6 +34,7 @@ export interface MerchantApply { goodsReview?: number; // 备注 comments?: string; + reason?: string; // 状态 status?: number; // 排序号 diff --git a/src/views/shop/merchantApply/components/merchantApplyEdit.vue b/src/views/shop/merchantApply/components/merchantApplyEdit.vue index 93d5ec9..e367147 100644 --- a/src/views/shop/merchantApply/components/merchantApplyEdit.vue +++ b/src/views/shop/merchantApply/components/merchantApplyEdit.vue @@ -26,17 +26,15 @@ v-model:value="form.merchantName" /> - - - + + + - + + + + - - - - - - - - - - - - - - - - - - + - + - 显示 - 隐藏 + 审核通过 + 驳回 - - + @@ -138,13 +111,17 @@ import { ref, reactive, watch } from 'vue'; import { Form, message } from 'ant-design-vue'; 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 { useThemeStore } from '@/store/modules/theme'; import { storeToRefs } from 'pinia'; import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types'; import { FormInstance } from 'ant-design-vue/es/form'; import { FileRecord } from '@/api/system/file/model'; + import { MerchantType } from '@/api/shop/merchantType/model'; // 是否是修改 const isUpdate = ref(false); @@ -172,6 +149,7 @@ // 表格选中数据 const formRef = ref(null); const images = ref([]); + const files = ref([]); // 用户信息 const form = reactive({ @@ -180,6 +158,7 @@ image: undefined, phone: undefined, realName: undefined, + name2: '', shopType: undefined, category: undefined, commission: undefined, @@ -189,15 +168,11 @@ recommend: undefined, goodsReview: undefined, comments: undefined, + reason: undefined, status: undefined, sortNumber: undefined, tenantId: undefined, - createTime: undefined, - merchantApplyId: undefined, - merchantApplyName: '', - status: 0, - comments: '', - sortNumber: 100 + createTime: undefined }); /* 更新visible */ @@ -207,11 +182,11 @@ // 表单验证规则 const rules = reactive({ - merchantApplyName: [ + merchantName: [ { required: true, type: 'string', - message: '请填写商户入驻申请名称', + message: '请填写商户名称', trigger: 'blur' } ] @@ -231,6 +206,26 @@ 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); /* 保存编辑 */ @@ -245,7 +240,9 @@ const formData = { ...form }; - const saveOrUpdate = isUpdate.value ? updateMerchantApply : addMerchantApply; + const saveOrUpdate = isUpdate.value + ? updateMerchantApply + : addMerchantApply; saveOrUpdate(formData) .then((msg) => { loading.value = false; @@ -268,12 +265,13 @@ images.value = []; if (props.data) { assignObject(form, props.data); - if(props.data.image){ + form.status = 1; + if (props.data.image) { images.value.push({ uid: uuid(), url: props.data.image, status: 'done' - }) + }); } isUpdate.value = true; } else { diff --git a/src/views/shop/merchantApply/components/search.vue b/src/views/shop/merchantApply/components/search.vue index 82fea9d..7e6bb6a 100644 --- a/src/views/shop/merchantApply/components/search.vue +++ b/src/views/shop/merchantApply/components/search.vue @@ -1,12 +1,12 @@ diff --git a/src/views/shop/merchantApply/index.vue b/src/views/shop/merchantApply/index.vue index c10751c..3735e6b 100644 --- a/src/views/shop/merchantApply/index.vue +++ b/src/views/shop/merchantApply/index.vue @@ -1,13 +1,18 @@