feat:支付配置

This commit is contained in:
dzc committed 2025-01-06 11:35:02 +08:00
1 parent f618439e06
commit 3f3020bc13
14 files changed
+833 -11

No files matched your search

@@ -0,0 +1,91 @@
<template>
<div class="w100">
<div class="layout-padding-auto layout-padding-view">
<div class="flex justify-center flex-col">
<div>
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="180px"
v-loading="loading">
<el-row :gutter="24">
<el-col :span="24" class="mb20">
<el-form-item label="钱包二维码自动刷新" prop="refreshQrCodeEnable">
<el-switch v-model="form.refreshQrCodeEnable" active-text="开启" inactive-text="关闭"
inline-prompt />
</el-form-item>
</el-col>
<el-col :span="24" class="mb20">
<el-form-item label="钱包二维码自动刷新间隔" prop="refreshQrCodeFre">
<el-input style="width: 300px;" type="number" v-model="form.refreshQrCodeFre"
placeholder="请输入钱包二维码自动刷新间隔">
<template #append>秒</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</div>
<div class="flex items-center">
<el-button type="primary" @click="onSubmit" :disabled="loading">确认</el-button>
</div>
</div>
</div>
</template>
<script setup lang="ts" name="code">
import { useDict } from '/@/hooks/dict'
import { storePrice } from "/@/utils/formatMoney"
import { useMessage } from "/@/hooks/message"
import { getObj, putObj } from "/@/api/wallet/wallet-setting"
// 定义变量内容
const dataFormRef = ref();
const loading = ref(false)
// 提交表单数据
const form = reactive({
id: undefined,
refreshQrCodeEnable: undefined,
refreshQrCodeFre: undefined,
});
// 定义校验规则
const dataRules = ref({
refreshQrCodeEnable: [{ required: true, message: '是否开启钱包二维码自动刷新', trigger: 'change' }],
refreshQrCodeFre: [{ required: true, message: '钱包二维码自动刷新间隔', trigger: 'blur' }],
})
onMounted(() => {
getwalletRechargePackageData('1')
})
// 提交
const onSubmit = async () => {
const valid = await dataFormRef.value.validate().catch(() => { });
if (!valid) return false;
try {
loading.value = true;
const pa = {
...form,
payPrice: storePrice(form.payPrice),
bonusPrice: storePrice(form.bonusPrice),
}
await putObj(pa)
useMessage().success('修改成功');
} catch (err: any) {
useMessage().error(err.msg);
} finally {
loading.value = false;
}
};
// 初始化表单数据
const getwalletRechargePackageData = (id: string) => {
// 获取数据
loading.value = true
getObj(id).then((res: any) => {
Object.assign(form, res.data)
}).finally(() => {
loading.value = false
})
};
</script>
@@ -0,0 +1,100 @@
<template>
<div class="w100">
<div class="layout-padding-auto layout-padding-view">
<div class="flex justify-center flex-col">
<div>
<el-form ref="dataFormRef" label-width="120px" :model="form" :rules="dataRules" formDialogRef
v-loading="loading">
<el-row :gutter="24">
<el-col :span="24" class="mb20">
<el-form-item label="每一餐的上限" prop="payAmountEnable">
<el-switch v-model="form.payAmountEnable" active-text="开启" inactive-text="关闭"
inline-prompt />
</el-form-item>
</el-col>
<el-col :span="24" class="mb20">
<el-form-item label="每一餐的上限" prop="payAmountMealLimit">
<el-input style="width: 300px;" type="number" v-model="form.payAmountMealLimit"
placeholder="请输入上限金额">
<template #append>元</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24" class="mb20">
<el-form-item label="倍数" prop="payAmountMealTimes">
<el-input style="width: 300px;" type="number" v-model="form.payAmountMealTimes"
placeholder="请输入倍数">
<template #append>倍</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="flex items-center">
<el-button type="primary" @click="onSubmit" :disabled="loading">确认</el-button>
</div>
</div>
</div>
</div>
</div>
</template>
<script setup lang="ts" name="extra-price">
import { storePrice } from "/@/utils/formatMoney"
import { useMessage } from "/@/hooks/message"
import { getObj, putObj } from "/@/api/wallet/wallet-setting"
// 定义变量内容
const dataFormRef = ref();
const loading = ref(false)
// 提交表单数据
const form = reactive({
id: undefined,
payAmountEnable: undefined,
payAmountMealLimit: undefined,
payAmountMealTimes: undefined,
});
// 定义校验规则
const dataRules = ref({
payAmountEnable: [{ required: true, message: '请选择是否开启每一餐的上限', trigger: 'change' }],
payAmountMealLimit: [{ required: true, message: '请输入上限金额', trigger: 'blur' }],
payAmountMealTimes: [{ required: true, message: '请输入倍数', trigger: 'blur' }],
})
onMounted(() => {
getwalletRechargePackageData('1')
})
// 提交
const onSubmit = async () => {
const valid = await dataFormRef.value.validate().catch(() => { });
if (!valid) return false;
try {
loading.value = true;
const pa = {
...form,
payPrice: storePrice(form.payPrice),
bonusPrice: storePrice(form.bonusPrice),
}
await putObj(pa)
useMessage().success('修改成功');
} catch (err: any) {
useMessage().error(err.msg);
} finally {
loading.value = false;
}
};
// 初始化表单数据
const getwalletRechargePackageData = (id: string) => {
// 获取数据
loading.value = true
getObj(id).then((res: any) => {
Object.assign(form, res.data)
}).finally(() => {
loading.value = false
})
};
</script>
@@ -0,0 +1,79 @@
<template>
<div class="w100">
<div class="layout-padding-auto layout-padding-view">
<div class="flex justify-center flex-col">
<div>
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="180px"
v-loading="loading">
<el-row :gutter="24">
<el-col :span="24" class="mb20">
<el-form-item label="离线订单是否需要审批" prop="offLineOrderApplyEnable">
<el-switch v-model="form.offLineOrderApplyEnable" active-text="开启"
inactive-text="关闭" inline-prompt />
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<div class="flex items-center">
<el-button type="primary" @click="onSubmit" :disabled="loading">确认</el-button>
</div>
</div>
</div>
</div>
</template>
<script setup lang="ts" name="code">
import { useDict } from '/@/hooks/dict'
import { storePrice } from "/@/utils/formatMoney"
import { useMessage } from "/@/hooks/message"
import { getObj, putObj } from "/@/api/wallet/wallet-setting"
// 定义变量内容
const dataFormRef = ref();
const loading = ref(false)
// 提交表单数据
const form = reactive({
id: '',
offLineOrderApplyEnable: '',
});
// 定义校验规则
const dataRules = ref({
offLineOrderApplyEnable: [{ required: true, message: '离线订单是否需要审批', trigger: 'change' }],
})
onMounted(() => {
getwalletRechargePackageData('1')
})
// 提交
const onSubmit = async () => {
const valid = await dataFormRef.value.validate().catch(() => { });
if (!valid) return false;
try {
loading.value = true;
const pa = {
...form,
}
await putObj(pa)
useMessage().success('修改成功');
} catch (err: any) {
useMessage().error(err.msg);
} finally {
loading.value = false;
}
};
// 初始化表单数据
const getwalletRechargePackageData = (id: string) => {
// 获取数据
loading.value = true
getObj(id).then((res: any) => {
Object.assign(form, res.data)
}).finally(() => {
loading.value = false
})
};
</script>
@@ -53,7 +53,6 @@ const emit = defineEmits(['refresh']);
const dataFormRef = ref();
const visible = ref(false)
const loading = ref(false)
const yes_no_type_options = ref<any>([])
// 定义查询字典
const { yes_no_type } = useDict('yes_no_type');
// 提交表单数据
@@ -0,0 +1,94 @@
<template>
<div class="w100">
<div class="layout-padding-auto layout-padding-view">
<div class="flex justify-center flex-col">
<div>
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px"
v-loading="loading">
<el-row :gutter="24">
<el-col :span="24" class="mb20">
<el-form-item label="退款理由" prop="afterSaleRefundReasons">
<el-select style="width: 500px;" v-model="form.afterSaleRefundReasons" allow-create
filterable multiple placeholder="请输入退款理由">
<el-option v-for="reason in form.afterSaleRefundReasons" :key="reason"
:label="reason" :value="reason" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="24" class="mb20">
<el-form-item label="退货理由" prop="afterSaleReturnReasons">
<el-select style="width: 500px;" v-model="form.afterSaleReturnReasons" allow-create
filterable multiple placeholder="请输入退货理由">
<el-option v-for="reason in form.afterSaleReturnReasons" :key="reason"
:label="reason" :value="reason" />
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="flex items-center">
<el-button type="primary" @click="onSubmit" :disabled="loading">确认</el-button>
</div>
</div>
</div>
</div>
</div>
</template>
<script setup lang="ts" name="refund">
import { storePrice } from "/@/utils/formatMoney"
import { useMessage } from "/@/hooks/message"
import { getObj, putObj } from "/@/api/wallet/wallet-setting"
// 定义变量内容
const dataFormRef = ref();
const loading = ref(false)
// 提交表单数据
const form = reactive({
id: undefined,
afterSaleRefundReasons: undefined,
afterSaleReturnReasons: undefined,
});
// 定义校验规则
const dataRules = ref({
afterSaleRefundReasons: [{ required: true, message: '请输入退款理由', trigger: 'blur' }],
afterSaleReturnReasons: [{ required: true, message: '请输入退货理由', trigger: 'blur' }],
})
onMounted(() => {
getwalletRechargePackageData('1')
})
// 提交
const onSubmit = async () => {
const valid = await dataFormRef.value.validate().catch(() => { });
if (!valid) return false;
try {
loading.value = true;
const pa = {
...form,
payPrice: storePrice(form.payPrice),
bonusPrice: storePrice(form.bonusPrice),
}
await putObj(pa)
useMessage().success('修改成功');
} catch (err: any) {
useMessage().error(err.msg);
} finally {
loading.value = false;
}
};
// 初始化表单数据
const getwalletRechargePackageData = (id: string) => {
// 获取数据
loading.value = true
getObj(id).then((res: any) => {
Object.assign(form, res.data)
}).finally(() => {
loading.value = false
})
};
</script>
+8 -4
View File
@@ -10,18 +10,22 @@
</el-tabs>
<div class="flex justify-center">
<recharge-package v-if="activeName == 10" />
<extra-price v-if="activeName == 20" />
<refund v-if="activeName == 30" />
<Code v-if="activeName == 40" />
<off-line v-if="activeName == 50" />
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { BasicTableProps, useTable } from "/@/hooks/table";
import { fetchList, delObjs } from "/@/api/wallet/wallet-recharge-package";
import { useMessage, useMessageBox } from "/@/hooks/message";
import { useDict } from '/@/hooks/dict';
const RechargePackage = defineAsyncComponent(() => import('./components/recharge-package/index.vue'));
const Code = defineAsyncComponent(() => import('./components/code/index.vue'));
const Refund = defineAsyncComponent(() => import('./components/refund/index.vue'));
const OffLine = defineAsyncComponent(() => import('./components/off-line/index.vue'));
const ExtraPrice = defineAsyncComponent(() => import('./components/extra-price/index.vue'));
const data = {
tabList: [