feat:平台流水抽成
This commit is contained in:
1 parent
87cc87c850
commit
9dfb9511cf
4 files changed
+63
-50
No files matched your search
@@ -48,6 +48,14 @@
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="平台抽成" min-width="120" align="center" prop="mchPlatformRankePrice"
|
||||
min-min-width="120">
|
||||
<template #default="{ row }">
|
||||
<span class="color-success">
|
||||
{{ displayPrice(row.mchPlatformRankePrice) }}({{ row?.mchPlatformRanke ?? 0 }}%)
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="220">
|
||||
<template #default="{ row }">
|
||||
<el-tooltip class="box-item" effect="dark" content="只有合作商家能结账" placement="top">
|
||||
@@ -103,7 +111,7 @@ const selectionChangHandle = (objs: { id: string }[]) => {
|
||||
|
||||
const getSummaries = (param: any) => {
|
||||
const { columns, data } = param
|
||||
const totalColumns = ["totalPayPrice", "totalPayCount", "totalRefundPrice", "totalRefundCount", "totalProfitPrice", "totalProfitCount"]
|
||||
const totalColumns = ["totalPayPrice", "totalPayCount", "totalRefundPrice", "totalRefundCount", "totalProfitPrice", "totalProfitCount", "mchPlatformRankePrice"]
|
||||
const totalRow = Array.from({ length: columns.length })
|
||||
totalRow[0] = "合计"
|
||||
columns.forEach((i: any, index: number) => {
|
||||
|
||||
@@ -53,6 +53,14 @@
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="平台抽成" min-width="120" align="center" prop="mchPlatformRankePrice"
|
||||
min-min-width="120">
|
||||
<template #default="{ row }">
|
||||
<span class="color-success">
|
||||
{{ displayPrice(row.mchPlatformRankePrice) }}({{ row?.mchPlatformRanke ?? 0 }}%)
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||
</div>
|
||||
@@ -85,7 +93,7 @@ const selectionChangHandle = (objs: { id: string }[]) => {
|
||||
|
||||
const getSummaries = (param: any) => {
|
||||
const { columns, data } = param
|
||||
const totalColumns = ["totalPayPrice", "totalPayCount", "totalRefundPrice", "totalRefundCount", "totalProfitPrice", "totalProfitCount"]
|
||||
const totalColumns = ["totalPayPrice", "totalPayCount", "totalRefundPrice", "totalRefundCount", "totalProfitPrice", "totalProfitCount", "mchPlatformRankePrice"]
|
||||
const totalRow = Array.from({ length: columns.length })
|
||||
totalRow[0] = "合计"
|
||||
columns.forEach((i: any, index: number) => {
|
||||
|
||||
@@ -15,14 +15,9 @@
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="商户类型:" prop="types">
|
||||
<el-radio-group v-model="form.types">
|
||||
<el-radio
|
||||
:label="item.value"
|
||||
:disabled="merchantTypeRadioDisabled"
|
||||
v-for="(item, index) in merchant_type"
|
||||
border
|
||||
:key="index"
|
||||
@click="handleClickRadio(item.value)"
|
||||
>
|
||||
<el-radio :label="item.value" :disabled="merchantTypeRadioDisabled"
|
||||
v-for="(item, index) in merchant_type" border :key="index"
|
||||
@click="handleClickRadio(item.value)">
|
||||
{{ item.label }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
@@ -30,15 +25,17 @@
|
||||
</el-col>
|
||||
<el-col v-if="form.types == '2'" :span="24" class="mb20">
|
||||
<el-form-item label="合作商家类型:" prop="supType">
|
||||
<el-radio-group v-model="form.supType" @change="(value:string) => form.supType = value">
|
||||
<el-radio border :label="item.value" v-for="(item, index) in wallet_mch_sup_type" :key="index">{{ item.label }}</el-radio>
|
||||
<el-radio-group v-model="form.supType" @change="(value: string) => form.supType = value">
|
||||
<el-radio border :label="item.value" v-for="(item, index) in wallet_mch_sup_type"
|
||||
:key="index">{{ item.label }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-if="form.types == '2' && form.supType == '20'" :span="24" class="mb20">
|
||||
<el-form-item label="合作状态:" prop="cooperationStatus">
|
||||
<el-radio-group v-model="form.cooperationStatus">
|
||||
<el-radio border :label="item.value" v-for="(item, index) in yes_no_type" :key="index">{{ item.label }}</el-radio>
|
||||
<el-radio border :label="item.value" v-for="(item, index) in yes_no_type" :key="index">{{
|
||||
item.label }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -98,43 +95,35 @@
|
||||
<el-input v-model.trim="form.phone" placeholder="请输入联系电话" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item prop="platformRanke">
|
||||
<template #label>
|
||||
<span>平台抽成:</span>
|
||||
<tip content="多个联系电话用/分隔" />
|
||||
</template>
|
||||
<el-input v-model.trim="form.platformRanke" placeholder="请输入平台抽成">
|
||||
<template #append>
|
||||
<span>%</span>
|
||||
</template>
|
||||
</el-input>
|
||||
<el-alert style="margin-top: 10px;"
|
||||
:title="`该商户的平台抽成是${form.platformRanke}%,即每一笔订单的抽成金额为${form.platformRanke}%的订单金额`"
|
||||
type="success" :closable="false" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-if="form.types == '1'" :span="24" class="mb20">
|
||||
<el-form-item label="营业时间:" class="my-0" />
|
||||
<el-form-item class="ml-2" label="早上" prop="jobTime">
|
||||
<el-time-picker
|
||||
v-model="jobTime.morning"
|
||||
placeholder="请选择营业时间"
|
||||
is-range
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
value-format="HH:mm"
|
||||
format="HH:mm"
|
||||
/>
|
||||
<el-time-picker v-model="jobTime.morning" placeholder="请选择营业时间" is-range range-separator="至"
|
||||
start-placeholder="开始日期" end-placeholder="结束日期" value-format="HH:mm" format="HH:mm" />
|
||||
</el-form-item>
|
||||
<el-form-item class="ml-2" label="中午" prop="jobTime">
|
||||
<el-time-picker
|
||||
v-model="jobTime.noon"
|
||||
placeholder="请选择营业时间"
|
||||
is-range
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
value-format="HH:mm"
|
||||
format="HH:mm"
|
||||
/>
|
||||
<el-time-picker v-model="jobTime.noon" placeholder="请选择营业时间" is-range range-separator="至"
|
||||
start-placeholder="开始日期" end-placeholder="结束日期" value-format="HH:mm" format="HH:mm" />
|
||||
</el-form-item>
|
||||
<el-form-item class="ml-2" label="晚上" prop="jobTime">
|
||||
<el-time-picker
|
||||
v-model="jobTime.evening"
|
||||
placeholder="请选择营业时间"
|
||||
is-range
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
value-format="HH:mm"
|
||||
format="HH:mm"
|
||||
/>
|
||||
<el-time-picker v-model="jobTime.evening" placeholder="请选择营业时间" is-range range-separator="至"
|
||||
start-placeholder="开始日期" end-placeholder="结束日期" value-format="HH:mm" format="HH:mm" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mb20">
|
||||
@@ -165,8 +154,7 @@ const loading = ref(false)
|
||||
// 定义字典
|
||||
const { merchant_type, wallet_mch_sup_type, yes_no_type } = useDict("merchant_type", "wallet_mch_sup_type", "yes_no_type")
|
||||
|
||||
// 提交表单数据
|
||||
const form = reactive({
|
||||
const defaultForm = {
|
||||
id: "",
|
||||
deptId: "",
|
||||
name: "",
|
||||
@@ -186,7 +174,11 @@ const form = reactive({
|
||||
parentId: "",
|
||||
catgoryId: "",
|
||||
discountsPrice: "",
|
||||
})
|
||||
platformRanke: '0',
|
||||
}
|
||||
|
||||
// 提交表单数据
|
||||
const form = reactive({ ...defaultForm })
|
||||
const jobTime = reactive<{
|
||||
[key: string]: string[]
|
||||
}>({
|
||||
@@ -239,9 +231,8 @@ watch(
|
||||
|
||||
// 提交
|
||||
const onSubmit = async () => {
|
||||
const valid = await dataFormRef.value.validate().catch(() => {})
|
||||
const valid = await dataFormRef.value.validate().catch(() => { })
|
||||
if (!valid) return false
|
||||
|
||||
const _pa = {
|
||||
...form,
|
||||
isSyncZy: form.isSyncZy ? "1" : "0",
|
||||
@@ -249,11 +240,9 @@ const onSubmit = async () => {
|
||||
cooperationStatus: form.types == "2" && form.supType == "10" ? null : form.cooperationStatus,
|
||||
parentId: form.types == "2" && form.supType == "10" ? -1 : form.parentId,
|
||||
}
|
||||
|
||||
if (_pa.parentId == "") {
|
||||
_pa.parentId = -1
|
||||
}
|
||||
|
||||
try {
|
||||
loading.value = true
|
||||
form.id ? await putObj(_pa) : await addObj(_pa)
|
||||
@@ -281,6 +270,9 @@ const getmerchantInfoData = async (id: string) => {
|
||||
if (form.canteenIsOpen == undefined) {
|
||||
form.canteenIsOpen = "0"
|
||||
}
|
||||
if (form.platformRanke == undefined) {
|
||||
form.platformRanke = defaultForm.platformRanke
|
||||
}
|
||||
jobTime.morning = resJobTime[0]?.split("-") ?? []
|
||||
jobTime.noon = resJobTime[1]?.split("-") ?? []
|
||||
jobTime.evening = resJobTime[2]?.split("-") ?? []
|
||||
|
||||
@@ -93,6 +93,11 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="isSyncZy" label="平台抽成" min-width="120" align="center">
|
||||
<template #default="{ row }">
|
||||
<span>{{ row?.platformRanke ?? 0 }}%</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="isSyncZy" label="是否同步正元" min-width="120" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-switch :disabled="!useUserInfo().userInfos.roleCodes.includes('ROLE_ADMIN')"
|
||||
|
||||
Reference in new issue
Block a user