This commit is contained in:
dzc committed 2025-03-29 18:27:30 +08:00
1 parent d8cf18efb7
commit 4db372e852
1 file changed
+21 -5
+21 -5
View File
@@ -23,17 +23,22 @@
<dict-tag :options="wallet_rule_price_type" :value="row.rulePriceType" />
</template>
</el-table-column>
<el-table-column prop="rulePriceConfigId" label="基础金额">
<el-table-column prop="rulePriceConfigId" min-width="60" label="基础金额">
<template #default="{ row }">
<span class="color-success">{{ displayPrice(row.basePrice) }}</span>
</template>
</el-table-column>
<el-table-column prop="rulePriceConfigId" label="额外百分比">
<el-table-column prop="rulePriceConfigId" min-width="60" label="额外百分比">
<template #default="{ row }">
<span class="color-primary">{{ row.multiple }}%</span>
</template>
</el-table-column>
<el-table-column min-width="300" label="描述">
<el-table-column prop="status" min-width="60" label="是否启用">
<template #default="{ row }">
<el-switch active-value="1" inactive-value="0" v-model="row.status" @change="statusChange(row)" />
</template>
</el-table-column>
<el-table-column min-width="200" label="描述">
<template #default="{ row }">
<span class="color-primary">{{ row.sourceMchName ? row.sourceMchName : "???" }}</span>
<span>到</span>
@@ -44,7 +49,7 @@
<span class="color-danger">{{ row.multiple ? row.multiple : "???" }}%</span>
</template>
</el-table-column>
<el-table-column label="操作" width="150">
<el-table-column label="操作" width="150" fixed="right">
<template #default="{ row }">
<el-button
icon="edit-pen"
@@ -66,7 +71,7 @@
</template>
<script setup lang="ts" name="mchRuleConfigDialog">
import * as walletRuleMchConfigApi from "../../../api/wallet/mch-rule-join"
import * as walletRuleMchConfigApi from "/@/api/wallet/mch-rule-join"
import { BasicTableProps, useTable } from "/@/hooks/table"
import { useMessage, useMessageBox } from "/@/hooks/message"
import { useDict } from "/@/hooks/dict"
@@ -111,6 +116,17 @@ const doAdd = () => {
WalletRuleMchConfigFormDialogRef.value.openDialog(null, props.sourceMchId)
}
// 是否启用
const statusChange = async (row: any) => {
try {
await walletRuleMchConfigApi.putObj(row)
getDataList()
useMessage().success("操作成功")
} catch (e) {
useMessage().error("操作错误")
}
}
// 删除操作
const handleDelete = async (ids: string[]) => {
try {