241102
This commit is contained in:
@@ -25,6 +25,7 @@ export interface Goods {
|
||||
video?: string;
|
||||
// 商品详情
|
||||
content?: string;
|
||||
canExpress?: number;
|
||||
// 商品分类
|
||||
category?: string;
|
||||
// 商品分类ID
|
||||
@@ -49,6 +50,9 @@ export interface Goods {
|
||||
chainStoreRate?: string;
|
||||
memberStoreRate?: string;
|
||||
memberMarketRate?: string;
|
||||
memberStoreCommission?: string;
|
||||
supplierCommission?: string;
|
||||
coopCommission?: string;
|
||||
memberStorePrice?: string;
|
||||
memberMarketPrice?: string;
|
||||
// 经销商价格
|
||||
@@ -61,6 +65,7 @@ export interface Goods {
|
||||
dealerGift?: boolean;
|
||||
buyingGiftNum?: number;
|
||||
priceGiftNum?: number;
|
||||
priceGiftName?: string;
|
||||
dealerGiftNum?: number;
|
||||
// 库存计算方式(10下单减库存 20付款减库存)
|
||||
deductStockType?: number;
|
||||
|
||||
@@ -43,6 +43,7 @@ export interface Merchant {
|
||||
keywords?: string;
|
||||
// 资质图片
|
||||
files?: string;
|
||||
swiper?: string;
|
||||
// 营业时间
|
||||
businessTime?: string;
|
||||
timePeriod1?: string;
|
||||
|
||||
@@ -30,16 +30,16 @@
|
||||
<a-space class="login-title">
|
||||
<h4
|
||||
class="title-btn"
|
||||
:class="loginType === 'account' ? 'active' : ''"
|
||||
@click="onLoginType('account')"
|
||||
>密码登录</h4
|
||||
:class="loginType === 'sms' ? 'active' : ''"
|
||||
@click="onLoginType('sms')"
|
||||
>短信登录</h4
|
||||
>
|
||||
<a-divider type="vertical" style="height: 20px" />
|
||||
<h4
|
||||
class="title-btn"
|
||||
:class="loginType === 'sms' ? 'active' : ''"
|
||||
@click="onLoginType('sms')"
|
||||
>短信登录</h4
|
||||
:class="loginType === 'account' ? 'active' : ''"
|
||||
@click="onLoginType('account')"
|
||||
>密码登录</h4
|
||||
>
|
||||
</a-space>
|
||||
<template v-if="loginType === 'account'">
|
||||
@@ -233,7 +233,7 @@
|
||||
const loading = ref(false);
|
||||
// 是否显示tenantId填写输入框
|
||||
const showTenantId = ref(true);
|
||||
const loginType = ref('account');
|
||||
const loginType = ref('sms');
|
||||
const config = ref<Config>();
|
||||
// 配置信息
|
||||
const { form } = useFormData<User>({
|
||||
|
||||
@@ -65,8 +65,7 @@
|
||||
ColumnItem
|
||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||
import Search from './components/search.vue';
|
||||
<<<<<<< HEAD:src/views/shop/bookingCard/index.vue
|
||||
import CardEdit from './components/cardEdit.vue';
|
||||
|
||||
import {
|
||||
pageBookingCard,
|
||||
removeBookingCard,
|
||||
@@ -76,33 +75,17 @@
|
||||
BookingCard,
|
||||
BookingCardParam
|
||||
} from '@/api/booking/bookingCard/model';
|
||||
import { formatNumber } from 'ele-admin-pro/es';
|
||||
=======
|
||||
import DealerApplyEdit from './components/dealerApplyEdit.vue';
|
||||
import {
|
||||
pageDealerApply,
|
||||
removeDealerApply,
|
||||
removeBatchDealerApply
|
||||
} from '@/api/shop/dealerApply';
|
||||
import type {
|
||||
DealerApply,
|
||||
DealerApplyParam
|
||||
} from '@/api/shop/dealerApply/model';
|
||||
>>>>>>> origin/master:src/views/shop/dealerApply/index.vue
|
||||
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
|
||||
// 表格选中数据
|
||||
<<<<<<< HEAD:src/views/shop/bookingCard/index.vue
|
||||
|
||||
const selection = ref<BookingCard[]>([]);
|
||||
// 当前编辑数据
|
||||
const current = ref<BookingCard | null>(null);
|
||||
=======
|
||||
const selection = ref<DealerApply[]>([]);
|
||||
// 当前编辑数据
|
||||
const current = ref<DealerApply | null>(null);
|
||||
>>>>>>> origin/master:src/views/shop/dealerApply/index.vue
|
||||
|
||||
// 是否显示编辑弹窗
|
||||
const showEdit = ref(false);
|
||||
// 是否显示批量移动弹窗
|
||||
@@ -121,11 +104,8 @@
|
||||
if (filters) {
|
||||
where.status = filters.status;
|
||||
}
|
||||
<<<<<<< HEAD:src/views/shop/bookingCard/index.vue
|
||||
|
||||
return pageBookingCard({
|
||||
=======
|
||||
return pageDealerApply({
|
||||
>>>>>>> origin/master:src/views/shop/dealerApply/index.vue
|
||||
...where,
|
||||
...orders,
|
||||
page,
|
||||
@@ -222,21 +202,16 @@
|
||||
]);
|
||||
|
||||
/* 搜索 */
|
||||
<<<<<<< HEAD:src/views/shop/bookingCard/index.vue
|
||||
|
||||
const reload = (where?: BookingCardParam) => {
|
||||
=======
|
||||
const reload = (where?: DealerApplyParam) => {
|
||||
>>>>>>> origin/master:src/views/shop/dealerApply/index.vue
|
||||
|
||||
selection.value = [];
|
||||
tableRef?.value?.reload({ where: where });
|
||||
};
|
||||
|
||||
/* 打开编辑弹窗 */
|
||||
<<<<<<< HEAD:src/views/shop/bookingCard/index.vue
|
||||
|
||||
const openEdit = (row?: BookingCard) => {
|
||||
=======
|
||||
const openEdit = (row?: DealerApply) => {
|
||||
>>>>>>> origin/master:src/views/shop/dealerApply/index.vue
|
||||
current.value = row ?? null;
|
||||
showEdit.value = true;
|
||||
};
|
||||
@@ -247,15 +222,10 @@
|
||||
};
|
||||
|
||||
/* 删除单个 */
|
||||
<<<<<<< HEAD:src/views/shop/bookingCard/index.vue
|
||||
|
||||
const remove = (row: BookingCard) => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeBookingCard(row.cardId)
|
||||
=======
|
||||
const remove = (row: DealerApply) => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeDealerApply(row.applyId)
|
||||
>>>>>>> origin/master:src/views/shop/dealerApply/index.vue
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
@@ -280,11 +250,8 @@
|
||||
maskClosable: true,
|
||||
onOk: () => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
<<<<<<< HEAD:src/views/shop/bookingCard/index.vue
|
||||
|
||||
removeBatchBookingCard(selection.value.map((d) => d.cardId))
|
||||
=======
|
||||
removeBatchDealerApply(selection.value.map((d) => d.applyId))
|
||||
>>>>>>> origin/master:src/views/shop/dealerApply/index.vue
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
@@ -304,11 +271,8 @@
|
||||
};
|
||||
|
||||
/* 自定义行属性 */
|
||||
<<<<<<< HEAD:src/views/shop/bookingCard/index.vue
|
||||
|
||||
const customRow = (record: BookingCard) => {
|
||||
=======
|
||||
const customRow = (record: DealerApply) => {
|
||||
>>>>>>> origin/master:src/views/shop/dealerApply/index.vue
|
||||
return {
|
||||
// 行点击事件
|
||||
onClick: () => {
|
||||
@@ -325,11 +289,7 @@
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
<<<<<<< HEAD:src/views/shop/bookingCard/index.vue
|
||||
name: 'BookingCard'
|
||||
=======
|
||||
name: 'DealerApply'
|
||||
>>>>>>> origin/master:src/views/shop/dealerApply/index.vue
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -21,31 +21,31 @@
|
||||
>
|
||||
<a-tabs type="card" v-model:active-key="active" @change="onChange">
|
||||
<a-tab-pane tab="基本信息" key="base">
|
||||
<!-- <a-form-item label="商品类型" name="type">-->
|
||||
<!-- <a-space>-->
|
||||
<!-- <a-button-->
|
||||
<!-- :type="form.type == 1 ? 'primary' : ''"-->
|
||||
<!-- @click="onType(1)"-->
|
||||
<!-- :ghost="form.type == 1"-->
|
||||
<!-- >实物商品-->
|
||||
<!-- </a-button-->
|
||||
<!-- >-->
|
||||
<!-- <a-button-->
|
||||
<!-- :type="form.type == 2 ? 'primary' : ''"-->
|
||||
<!-- @click="onType(2)"-->
|
||||
<!-- :ghost="form.type == 2"-->
|
||||
<!-- >虚拟商品-->
|
||||
<!-- </a-button-->
|
||||
<!-- >-->
|
||||
<!-- </a-space>-->
|
||||
<!-- <div class="ele-text-placeholder">-->
|
||||
<!-- {{-->
|
||||
<!-- form.type == 1-->
|
||||
<!-- ? `支持快递邮寄、同城配送或到店自提方式发货`-->
|
||||
<!-- : '电子券码等,线下到店核销,无需备货'-->
|
||||
<!-- }}-->
|
||||
<!-- </div>-->
|
||||
<!-- </a-form-item>-->
|
||||
<!-- <a-form-item label="商品类型" name="type">-->
|
||||
<!-- <a-space>-->
|
||||
<!-- <a-button-->
|
||||
<!-- :type="form.type == 1 ? 'primary' : ''"-->
|
||||
<!-- @click="onType(1)"-->
|
||||
<!-- :ghost="form.type == 1"-->
|
||||
<!-- >实物商品-->
|
||||
<!-- </a-button-->
|
||||
<!-- >-->
|
||||
<!-- <a-button-->
|
||||
<!-- :type="form.type == 2 ? 'primary' : ''"-->
|
||||
<!-- @click="onType(2)"-->
|
||||
<!-- :ghost="form.type == 2"-->
|
||||
<!-- >虚拟商品-->
|
||||
<!-- </a-button-->
|
||||
<!-- >-->
|
||||
<!-- </a-space>-->
|
||||
<!-- <div class="ele-text-placeholder">-->
|
||||
<!-- {{-->
|
||||
<!-- form.type == 1-->
|
||||
<!-- ? `支持快递邮寄、同城配送或到店自提方式发货`-->
|
||||
<!-- : '电子券码等,线下到店核销,无需备货'-->
|
||||
<!-- }}-->
|
||||
<!-- </div>-->
|
||||
<!-- </a-form-item>-->
|
||||
<a-form-item
|
||||
v-if="!merchantId"
|
||||
label="选择店铺"
|
||||
@@ -103,6 +103,12 @@
|
||||
v-model:value="form.comments"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="是否可以快递配送">
|
||||
<a-select v-model:value="form.canExpress">
|
||||
<a-select-option :value="1">可以</a-select-option>
|
||||
<a-select-option :value="0">不可以</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item label="单位名称" name="unitName">
|
||||
<a-input
|
||||
allow-clear
|
||||
@@ -129,26 +135,32 @@
|
||||
v-model:value="form.price"
|
||||
/>
|
||||
<a-checkbox v-model:checked="form.priceGift">有赠品</a-checkbox>
|
||||
<a-input v-if="form.priceGift" v-model:value="form.priceGiftName" style="width: 200px"
|
||||
placeholder="请输入赠品名称">
|
||||
<template #prefix>名称</template>
|
||||
</a-input>
|
||||
<a-input-number v-if="form.priceGift" v-model:value="form.priceGiftNum" style="width: 200px"
|
||||
placeholder="请输入赠品数量"/>
|
||||
placeholder="请输入赠品数量">
|
||||
<template #prefix>数量</template>
|
||||
</a-input-number>
|
||||
</a-space>
|
||||
<div class="ele-text-placeholder">商品的实际购买金额,最低0.01</div>
|
||||
</a-form-item>
|
||||
<a-form-item label="经销商价" name="dealerPrice" v-if="!merchantId">
|
||||
<a-space>
|
||||
<a-input-number
|
||||
:placeholder="`经销商价格`"
|
||||
style="width: 240px"
|
||||
:min="0.01"
|
||||
v-model:value="form.dealerPrice"
|
||||
/>
|
||||
<a-checkbox v-model:checked="form.dealerGift">有赠品</a-checkbox>
|
||||
<a-input-number v-if="form.dealerGift" v-model:value="form.dealerGiftNum" style="width: 200px"
|
||||
placeholder="请输入赠品数量"/>
|
||||
</a-space>
|
||||
<div class="ele-text-placeholder">经销商价格</div>
|
||||
</a-form-item>
|
||||
<a-form-item label="供应商价" name="buyingPrice" v-if="!merchantId">
|
||||
<!-- <a-form-item label="经销商价" name="dealerPrice" v-if="!merchantId">-->
|
||||
<!-- <a-space>-->
|
||||
<!-- <a-input-number-->
|
||||
<!-- :placeholder="`经销商价格`"-->
|
||||
<!-- style="width: 240px"-->
|
||||
<!-- :min="0.01"-->
|
||||
<!-- v-model:value="form.dealerPrice"-->
|
||||
<!-- />-->
|
||||
<!-- <a-checkbox v-model:checked="form.dealerGift">有赠品</a-checkbox>-->
|
||||
<!-- <a-input-number v-if="form.dealerGift" v-model:value="form.dealerGiftNum" style="width: 200px"-->
|
||||
<!-- placeholder="请输入赠品数量"/>-->
|
||||
<!-- </a-space>-->
|
||||
<!-- <div class="ele-text-placeholder">经销商价格</div>-->
|
||||
<!-- </a-form-item>-->
|
||||
<a-form-item label="供应商价" name="buyingPrice" v-if="!merchantId">
|
||||
<a-space>
|
||||
<a-input-number
|
||||
:placeholder="`供应商价`"
|
||||
@@ -205,37 +217,65 @@
|
||||
</a-space>
|
||||
<div class="ele-text-placeholder">会员店差价比例(%)</div>
|
||||
</a-form-item>
|
||||
<!-- <a-form-item label="会员超市价格" name="memberMarketPrice" v-if="!merchantId">-->
|
||||
<!-- <a-space>-->
|
||||
<!-- <a-input-number-->
|
||||
<!-- :placeholder="`请输入会员超市价格`"-->
|
||||
<!-- :min="0.01"-->
|
||||
<!-- style="width: 240px"-->
|
||||
<!-- v-model:value="form.memberMarketPrice"-->
|
||||
<!-- />-->
|
||||
<!-- </a-space>-->
|
||||
<!-- <div class="ele-text-placeholder">会员超市价格</div>-->
|
||||
<!-- </a-form-item>-->
|
||||
<!-- <a-form-item label="会员超市差价比例(%)" name="memberMarketRate" v-if="!merchantId">-->
|
||||
<!-- <a-space>-->
|
||||
<!-- <a-input-number-->
|
||||
<!-- :placeholder="`请输入会员超市差价比例(%)`"-->
|
||||
<!-- :min="0.01"-->
|
||||
<!-- :max="100"-->
|
||||
<!-- style="width: 240px"-->
|
||||
<!-- v-model:value="form.memberMarketRate"-->
|
||||
<!-- />-->
|
||||
<!-- </a-space>-->
|
||||
<!-- <div class="ele-text-placeholder">会员超市差价比例(%)</div>-->
|
||||
<!-- </a-form-item>-->
|
||||
<!-- <a-form-item label="当前库存" name="stock">-->
|
||||
<!-- <a-input-number-->
|
||||
<!-- :placeholder="`商品库存`"-->
|
||||
<!-- style="width: 240px"-->
|
||||
<!-- v-model:value="form.stock"-->
|
||||
<!-- />-->
|
||||
<!-- <div class="ele-text-placeholder">划线价仅用于商品页展示</div>-->
|
||||
<!-- </a-form-item>-->
|
||||
<a-form-item label="会员店直推分佣(元)" v-if="!merchantId">
|
||||
<a-space>
|
||||
<a-input-number
|
||||
:placeholder="`请输入会员店直推分佣(元)`"
|
||||
style="width: 240px"
|
||||
v-model:value="form.memberStoreCommission"
|
||||
/>
|
||||
</a-space>
|
||||
</a-form-item>
|
||||
<a-form-item label="供应商直推分佣(元)" v-if="!merchantId">
|
||||
<a-space>
|
||||
<a-input-number
|
||||
:placeholder="`请输入供应商直推分佣(元)`"
|
||||
style="width: 240px"
|
||||
v-model:value="form.supplierCommission"
|
||||
/>
|
||||
</a-space>
|
||||
</a-form-item>
|
||||
<a-form-item label="合作伙伴直推分佣(元)" v-if="!merchantId">
|
||||
<a-space>
|
||||
<a-input-number
|
||||
:placeholder="`请输入合作伙伴直推分佣(元)`"
|
||||
style="width: 240px"
|
||||
v-model:value="form.coopCommission"
|
||||
/>
|
||||
</a-space>
|
||||
</a-form-item>
|
||||
|
||||
<!-- <a-form-item label="会员超市价格" name="memberMarketPrice" v-if="!merchantId">-->
|
||||
<!-- <a-space>-->
|
||||
<!-- <a-input-number-->
|
||||
<!-- :placeholder="`请输入会员超市价格`"-->
|
||||
<!-- :min="0.01"-->
|
||||
<!-- style="width: 240px"-->
|
||||
<!-- v-model:value="form.memberMarketPrice"-->
|
||||
<!-- />-->
|
||||
<!-- </a-space>-->
|
||||
<!-- <div class="ele-text-placeholder">会员超市价格</div>-->
|
||||
<!-- </a-form-item>-->
|
||||
<!-- <a-form-item label="会员超市差价比例(%)" name="memberMarketRate" v-if="!merchantId">-->
|
||||
<!-- <a-space>-->
|
||||
<!-- <a-input-number-->
|
||||
<!-- :placeholder="`请输入会员超市差价比例(%)`"-->
|
||||
<!-- :min="0.01"-->
|
||||
<!-- :max="100"-->
|
||||
<!-- style="width: 240px"-->
|
||||
<!-- v-model:value="form.memberMarketRate"-->
|
||||
<!-- />-->
|
||||
<!-- </a-space>-->
|
||||
<!-- <div class="ele-text-placeholder">会员超市差价比例(%)</div>-->
|
||||
<!-- </a-form-item>-->
|
||||
<!-- <a-form-item label="当前库存" name="stock">-->
|
||||
<!-- <a-input-number-->
|
||||
<!-- :placeholder="`商品库存`"-->
|
||||
<!-- style="width: 240px"-->
|
||||
<!-- v-model:value="form.stock"-->
|
||||
<!-- />-->
|
||||
<!-- <div class="ele-text-placeholder">划线价仅用于商品页展示</div>-->
|
||||
<!-- </a-form-item>-->
|
||||
<a-form-item label="是否新品">
|
||||
<a-switch size="small" v-model:checked="form.isNew" :checked-value="1" :un-checked-value="0"/>
|
||||
</a-form-item>
|
||||
@@ -565,6 +605,7 @@ const form = reactive<Goods>({
|
||||
image: undefined,
|
||||
video: undefined,
|
||||
content: undefined,
|
||||
canExpress: 1,
|
||||
unitName: '',
|
||||
categoryId: undefined,
|
||||
parentName: undefined,
|
||||
@@ -578,6 +619,7 @@ const form = reactive<Goods>({
|
||||
priceGift: undefined,
|
||||
dealerGift: undefined,
|
||||
priceGiftNum: undefined,
|
||||
priceGiftName: undefined,
|
||||
dealerGiftNum: undefined,
|
||||
files: undefined,
|
||||
sales: 0,
|
||||
@@ -595,6 +637,9 @@ const form = reactive<Goods>({
|
||||
chainStoreRate: undefined,
|
||||
memberStoreRate: undefined,
|
||||
memberMarketRate: undefined,
|
||||
memberStoreCommission: undefined,
|
||||
supplierCommission: undefined,
|
||||
coopCommission: undefined,
|
||||
stock: 1000,
|
||||
deductStockType: 20,
|
||||
isShow: 1,
|
||||
@@ -1005,7 +1050,7 @@ const save = () => {
|
||||
.then(() => {
|
||||
loading.value = true;
|
||||
if (form.priceGift && !form.priceGiftNum) return message.error('请输入会员赠品数量');
|
||||
if (form.dealerGift && !form.dealerGiftNum) return message.error('请输入经销商赠品数量');
|
||||
// if (form.dealerGift && !form.dealerGiftNum) return message.error('请输入经销商赠品数量');
|
||||
const formData = {
|
||||
...form,
|
||||
content: content.value,
|
||||
|
||||
@@ -19,27 +19,27 @@
|
||||
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||
"
|
||||
>
|
||||
<a-form-item label="商品" name="goodsId">
|
||||
<a-select v-model:value="form.goodsId" placeholder="请选择商品">
|
||||
<a-select-option v-for="(item, index) in goodsList" :key="index" :value="item.goodsId">
|
||||
{{ item.goodsName }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<!-- <a-form-item label="商品" name="goodsId">-->
|
||||
<!-- <a-select v-model:value="form.goodsId" placeholder="请选择商品">-->
|
||||
<!-- <a-select-option v-for="(item, index) in goodsList" :key="index" :value="item.goodsId">-->
|
||||
<!-- {{ item.goodsName }}-->
|
||||
<!-- </a-select-option>-->
|
||||
<!-- </a-select>-->
|
||||
<!-- </a-form-item>-->
|
||||
<a-form-item label="店铺类型" name="merchantShopType">
|
||||
<SelectMerchantType
|
||||
<SelectMerchantType disabled
|
||||
:placeholder="`请选择店铺类型`"
|
||||
v-model:value="form.merchantShopType"
|
||||
@done="chooseShopType"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="SKU" v-if="form.goodsId && goodsList.find(v => v.goodsId === form.goodsId)?.goodsSkus">
|
||||
<a-select v-model:value="form.skuId" placeholder="请选择SKU">
|
||||
<a-select-option v-for="(item, index) in goodsList.find(v => v.goodsId === form.goodsId)?.goodsSkus" :key="index" :value="item.id">
|
||||
{{ item.sku }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<!-- <a-form-item label="SKU" v-if="form.goodsId && goodsList.find(v => v.goodsId === form.goodsId)?.goodsSkus">-->
|
||||
<!-- <a-select v-model:value="form.skuId" placeholder="请选择SKU">-->
|
||||
<!-- <a-select-option v-for="(item, index) in goodsList.find(v => v.goodsId === form.goodsId)?.goodsSkus" :key="index" :value="item.id">-->
|
||||
<!-- {{ item.sku }}-->
|
||||
<!-- </a-select-option>-->
|
||||
<!-- </a-select>-->
|
||||
<!-- </a-form-item>-->
|
||||
<a-form-item label="比例(%)" name="rate">
|
||||
<a-input-number style="width: 200px"
|
||||
allow-clear
|
||||
@@ -116,14 +116,6 @@ const updateVisible = (value: boolean) => {
|
||||
|
||||
// 表单验证规则
|
||||
const rules = reactive({
|
||||
goodsIncomeConfigName: [
|
||||
{
|
||||
required: true,
|
||||
type: 'string',
|
||||
message: '请填写分润配置名称',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
const chooseShopType = (data: MerchantType) => {
|
||||
@@ -161,17 +153,17 @@ const save = () => {
|
||||
.catch(() => {
|
||||
});
|
||||
};
|
||||
|
||||
const goodsList = ref<Goods[]>([]);
|
||||
const getGoodsList = async () => {
|
||||
goodsList.value = await listGoods()
|
||||
}
|
||||
//
|
||||
// const goodsList = ref<Goods[]>([]);
|
||||
// const getGoodsList = async () => {
|
||||
// goodsList.value = await listGoods()
|
||||
// }
|
||||
|
||||
watch(
|
||||
() => props.visible,
|
||||
async (visible) => {
|
||||
if (visible) {
|
||||
await getGoodsList()
|
||||
// await getGoodsList()
|
||||
if (props.data) {
|
||||
assignObject(form, props.data);
|
||||
isUpdate.value = true;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<!-- 搜索表单 -->
|
||||
<template>
|
||||
<a-space :size="10" style="flex-wrap: wrap">
|
||||
<a-button type="primary" class="ele-btn-icon" @click="add">
|
||||
<template #icon>
|
||||
<PlusOutlined />
|
||||
</template>
|
||||
<span>添加</span>
|
||||
</a-button>
|
||||
<!-- <a-button type="primary" class="ele-btn-icon" @click="add">-->
|
||||
<!-- <template #icon>-->
|
||||
<!-- <PlusOutlined />-->
|
||||
<!-- </template>-->
|
||||
<!-- <span>添加</span>-->
|
||||
<!-- </a-button>-->
|
||||
</a-space>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -31,13 +31,13 @@
|
||||
<template v-if="column.key === 'action'">
|
||||
<a-space>
|
||||
<a @click="openEdit(record)">修改</a>
|
||||
<a-divider type="vertical" />
|
||||
<a-popconfirm
|
||||
title="确定要删除此记录吗?"
|
||||
@confirm="remove(record)"
|
||||
>
|
||||
<a class="ele-text-danger">删除</a>
|
||||
</a-popconfirm>
|
||||
<!-- <a-divider type="vertical" />-->
|
||||
<!-- <a-popconfirm-->
|
||||
<!-- title="确定要删除此记录吗?"-->
|
||||
<!-- @confirm="remove(record)"-->
|
||||
<!-- >-->
|
||||
<!-- <a class="ele-text-danger">删除</a>-->
|
||||
<!-- </a-popconfirm>-->
|
||||
</a-space>
|
||||
</template>
|
||||
</template>
|
||||
@@ -100,39 +100,39 @@
|
||||
|
||||
// 表格列配置
|
||||
const columns = ref<ColumnItem[]>([
|
||||
{
|
||||
title: '商品',
|
||||
dataIndex: ['goods', 'goodsName'],
|
||||
key: 'goodsId',
|
||||
align: 'center',
|
||||
},
|
||||
// {
|
||||
// title: '商品',
|
||||
// dataIndex: ['goods', 'goodsName'],
|
||||
// key: 'goodsId',
|
||||
// align: 'center',
|
||||
// },
|
||||
{
|
||||
title: '店铺类型',
|
||||
dataIndex: 'merchantShopType',
|
||||
key: 'merchantShopType',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: 'SKU',
|
||||
dataIndex: ['goodsSku', 'sku'],
|
||||
key: 'spec',
|
||||
align: 'center',
|
||||
},
|
||||
// {
|
||||
// title: 'SKU',
|
||||
// dataIndex: ['goodsSku', 'sku'],
|
||||
// key: 'spec',
|
||||
// align: 'center',
|
||||
// },
|
||||
{
|
||||
title: '比例(%)',
|
||||
dataIndex: 'rate',
|
||||
key: 'rate',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createTime',
|
||||
key: 'createTime',
|
||||
align: 'center',
|
||||
sorter: true,
|
||||
ellipsis: true,
|
||||
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd')
|
||||
},
|
||||
// {
|
||||
// title: '创建时间',
|
||||
// dataIndex: 'createTime',
|
||||
// key: 'createTime',
|
||||
// align: 'center',
|
||||
// sorter: true,
|
||||
// ellipsis: true,
|
||||
// customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd')
|
||||
// },
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
|
||||
@@ -133,22 +133,31 @@
|
||||
@del="onDeleteFiles"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="是否自营" name="ownStore">
|
||||
<a-switch
|
||||
checked-children="是"
|
||||
un-checked-children="否"
|
||||
:checked="form.ownStore === 1"
|
||||
@update:checked="updateOwnStore"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="是否推荐" name="recommend">
|
||||
<a-switch
|
||||
checked-children="是"
|
||||
un-checked-children="否"
|
||||
:checked="form.recommend === 1"
|
||||
@update:checked="updateRecommend"
|
||||
<a-form-item label="轮播图" name="swiper">
|
||||
<SelectFile
|
||||
:placeholder="`请选择图片`"
|
||||
:limit="9"
|
||||
:data="swiper"
|
||||
@done="chooseSwiper"
|
||||
@del="onDeleteSwiper"
|
||||
/>
|
||||
</a-form-item>
|
||||
<!-- <a-form-item label="是否自营" name="ownStore">-->
|
||||
<!-- <a-switch-->
|
||||
<!-- checked-children="是"-->
|
||||
<!-- un-checked-children="否"-->
|
||||
<!-- :checked="form.ownStore === 1"-->
|
||||
<!-- @update:checked="updateOwnStore"-->
|
||||
<!-- />-->
|
||||
<!-- </a-form-item>-->
|
||||
<!-- <a-form-item label="是否推荐" name="recommend">-->
|
||||
<!-- <a-switch-->
|
||||
<!-- checked-children="是"-->
|
||||
<!-- un-checked-children="否"-->
|
||||
<!-- :checked="form.recommend === 1"-->
|
||||
<!-- @update:checked="updateRecommend"-->
|
||||
<!-- />-->
|
||||
<!-- </a-form-item>-->
|
||||
<a-form-item label="是否在营业" name="recommend">
|
||||
<a-switch
|
||||
checked-children="是"
|
||||
@@ -157,14 +166,14 @@
|
||||
@update:checked="updateIsOn"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="是否需要审核" name="goodsReview">
|
||||
<a-switch
|
||||
checked-children="是"
|
||||
un-checked-children="否"
|
||||
:checked="form.goodsReview === 1"
|
||||
@update:checked="updateGoodsReview"
|
||||
/>
|
||||
</a-form-item>
|
||||
<!-- <a-form-item label="是否需要审核" name="goodsReview">-->
|
||||
<!-- <a-switch-->
|
||||
<!-- checked-children="是"-->
|
||||
<!-- un-checked-children="否"-->
|
||||
<!-- :checked="form.goodsReview === 1"-->
|
||||
<!-- @update:checked="updateGoodsReview"-->
|
||||
<!-- />-->
|
||||
<!-- </a-form-item>-->
|
||||
<a-form-item label="状态" name="status">
|
||||
<a-radio-group v-model:value="form.status">
|
||||
<a-radio :value="0">显示</a-radio>
|
||||
@@ -270,6 +279,7 @@ const form = reactive<Merchant>({
|
||||
commission: 0,
|
||||
keywords: undefined,
|
||||
files: undefined,
|
||||
swiper: undefined,
|
||||
ownStore: undefined,
|
||||
recommend: undefined,
|
||||
isOn: 1,
|
||||
@@ -456,6 +466,10 @@ const save = () => {
|
||||
if (!timeRange.value || !timeRange.value.length) {
|
||||
return message.error('营业时间不能为空')
|
||||
}
|
||||
if (!swiper.value.length) {
|
||||
return message.error('轮播图不能为空')
|
||||
}
|
||||
|
||||
const formData = {
|
||||
...form,
|
||||
keywords: JSON.stringify(form.keywords),
|
||||
@@ -463,6 +477,7 @@ const save = () => {
|
||||
};
|
||||
formData.startTime = timeRange.value[0];
|
||||
formData.endTime = timeRange.value[1];
|
||||
formData.swiper = JSON.stringify(swiper.value);
|
||||
const saveOrUpdate = isUpdate.value ? updateMerchant : addMerchant;
|
||||
saveOrUpdate(formData)
|
||||
.then((msg) => {
|
||||
@@ -487,6 +502,19 @@ const getMerchantCategoryList = async () => {
|
||||
});
|
||||
}
|
||||
|
||||
const swiper = ref<ItemType[]>([]);
|
||||
const chooseSwiper = (data: FileRecord) => {
|
||||
swiper.value.push({
|
||||
uid: data.id,
|
||||
url: data.path,
|
||||
status: 'done'
|
||||
});
|
||||
};
|
||||
|
||||
const onDeleteSwiper = (index: number) => {
|
||||
swiper.value.splice(index, 1);
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.visible,
|
||||
async (visible) => {
|
||||
@@ -494,6 +522,7 @@ watch(
|
||||
await getMerchantCategoryList()
|
||||
images.value = [];
|
||||
files.value = [];
|
||||
swiper.value = [];
|
||||
merchantCategoryId.value = [];
|
||||
if (props.data) {
|
||||
isUpdate.value = true;
|
||||
@@ -510,7 +539,7 @@ watch(
|
||||
arr.map((item) => {
|
||||
files.value.push({
|
||||
uid: uuid(),
|
||||
url: item.url,
|
||||
url: item,
|
||||
status: 'done'
|
||||
});
|
||||
});
|
||||
@@ -518,12 +547,18 @@ watch(
|
||||
if (props.data.keywords) {
|
||||
form.keywords = JSON.parse(props.data.keywords);
|
||||
}
|
||||
if (props.data && props.data.merchantCategoryId) {
|
||||
if (props.data.swiper) {
|
||||
swiper.value = JSON.parse(props.data.swiper);
|
||||
}
|
||||
if (props.data.merchantCategoryId) {
|
||||
merchantCategoryList.value.forEach(item => {
|
||||
const cate = item.children?.find(i => i.categoryId === props?.data?.merchantCategoryId)
|
||||
if (cate) merchantCategoryId.value.push(item?.categoryId, cate.categoryId)
|
||||
});
|
||||
}
|
||||
if (props.data.startTime && props.data.endTime) {
|
||||
timeRange.value = [props.data.startTime, props.data.endTime];
|
||||
}
|
||||
} else {
|
||||
isUpdate.value = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user