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,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>