feat:生成批量充值/扣款发票信息配置

This commit is contained in:
dzc committed 2025-06-24 11:47:20 +08:00
1 parent 807b67711e
commit 8520bdb639
3 files changed
+99 -27

No files matched your search

@@ -3,43 +3,28 @@
<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-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
:disabled="!auth('wallet_setting_edit')"
active-value="1"
inactive-value="0"
v-model="form.payAmountEnable"
active-text="开启"
inactive-text="关闭"
inline-prompt
/>
<el-switch :disabled="!auth('wallet_setting_edit')" active-value="1"
inactive-value="0" 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
:disabled="!auth('wallet_setting_edit')"
style="width: 300px"
type="number"
v-model="form.payAmountMealLimit"
placeholder="请输入上限金额"
>
<el-input :disabled="!auth('wallet_setting_edit')" 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
:disabled="!auth('wallet_setting_edit')"
style="width: 300px"
type="number"
v-model="form.payAmountMealTimes"
placeholder="请输入倍数"
>
<el-input :disabled="!auth('wallet_setting_edit')" style="width: 300px"
type="number" v-model="form.payAmountMealTimes" placeholder="请输入倍数">
<template #append>倍</template>
</el-input>
</el-form-item>
@@ -79,12 +64,12 @@ const dataRules = ref({
})
onMounted(() => {
getwalletRechargePackageData("1")
getwalletRechargePackageData()
})
// 提交
const onSubmit = async () => {
const valid = await dataFormRef.value.validate().catch(() => {})
const valid = await dataFormRef.value.validate().catch(() => { })
if (!valid) return false
try {
@@ -103,7 +88,7 @@ const onSubmit = async () => {
}
// 初始化表单数据
const getwalletRechargePackageData = (id: string) => {
const getwalletRechargePackageData = () => {
// 获取数据
loading.value = true
getObj()
@@ -0,0 +1,84 @@
<template>
<div class="w-full">
<div class="layout-padding-auto layout-padding-view">
<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="topupDeptStr">
<el-input :disabled="!auth('wallet_setting_edit')" style="width: 300px"
v-model="form.topupDeptStr" placeholder="请输入充值收款单位">
</el-input>
</el-form-item>
<el-form-item label="充值收款人" prop="topupUserId">
<select-user :disabled="!auth('wallet_setting_edit')" style="width: 300px"
v-model="form.topupUserId" placeholder="请选择充值收款人">
</select-user>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<div class="flex items-center" v-auth="'wallet_setting_edit'">
<el-button type="primary" @click="onSubmit" :disabled="loading">确认</el-button>
</div>
</div>
</div>
</template>
<script setup lang="ts" name="WalletRecharge">
import { useMessage } from "/@/hooks/message"
import { auth } from "/@/utils/authFunction"
import { getObj, putObj } from "/@/api/wallet/wallet-setting"
onMounted(() => {
getwalletRechargeData()
})
// 定义变量内容
const dataFormRef = ref()
const loading = ref(false)
// 提交表单数据
const form = reactive({
id: undefined,
topupDeptStr: undefined,
topupUserId: undefined,
})
// 定义校验规则
const dataRules = ref({
topupDeptStr: [{ required: true, message: "请输入充值收款单位", trigger: "blur" }],
topupUserId: [{ required: true, message: "请选择充值收款人", trigger: "change" }],
})
// 提交
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 getwalletRechargeData = () => {
// 获取数据
loading.value = true
getObj()
.then((res: any) => {
Object.assign(form, res.data)
})
.finally(() => {
loading.value = false
})
}
</script>
@@ -16,6 +16,7 @@
<off-line v-if="activeName == 50" />
<third-zy v-if="activeName == 60" />
<user-setting v-if="activeName == 70" />
<wallet-recharge v-if="activeName == 80" />
</div>
</div>
</div>
@@ -29,6 +30,7 @@ const OffLine = defineAsyncComponent(() => import("./components/off-line/index.v
const ExtraPrice = defineAsyncComponent(() => import("./components/extra-price/index.vue"))
const ThirdZy = defineAsyncComponent(() => import("./components/third-zy/index.vue"))
const UserSetting = defineAsyncComponent(() => import("./components/user/index.vue"))
const WalletRecharge = defineAsyncComponent(() => import("./components/wallet-recharge/index.vue"))
const data = {
tabList: [
@@ -39,6 +41,7 @@ const data = {
{ id: 50, label: "离线配置" },
{ id: 60, label: "正元同步配置" },
{ id: 70, label: "用户同步配置" },
{ id: 80, label: "批量申请/扣款发票配置" },
],
}