钱包类型选择权限

This commit is contained in:
weiwei committed 2025-04-03 19:18:10 +08:00
1 parent a7a910b2f3
commit 520e07aaff
2 files changed
+32 -17

No files matched your search

+15 -16
View File
@@ -1,6 +1,6 @@
<template>
<el-dialog :title="form.id ? '编辑' : '新增'" v-model="visible" :close-on-click-modal="false" draggable>
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" v-loading="loading">
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="140px" v-loading="loading">
<el-row :gutter="24">
<!-- <el-col :span="14" class="mb20">-->
<!-- <el-form-item label="商户" prop="merchantId">-->
@@ -48,19 +48,18 @@
<el-input-number v-model="form.marketPrice" :min="0" :precision="2" placeholder="请输入市场价" />
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item label="是否显示" prop="status">
<el-radio-group v-model="form.isShow">
<el-radio :label="item.value" v-for="(item, index) in is_show" border :key="index">{{ item.label }}
</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<!-- <el-col :span="14" class="mb20">-->
<!-- <el-form-item label="库存" prop="stock">-->
<!-- <el-input-number v-model="form.stock" :min="0" :precision="0" />-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col :span="12" class="mb20">
<el-form-item label="是否在移动端显示" prop="status">
<el-radio-group v-model="form.isShow">
<el-radio :label="item.value" v-for="(item, index) in is_show" border :key="index">{{ item.label }} </el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<!-- <el-col :span="14" class="mb20">-->
<!-- <el-form-item label="库存" prop="stock">-->
<!-- <el-input-number v-model="form.stock" :min="0" :precision="0" />-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="8" class="mb20">-->
<!-- <el-form-item label="赠送积分" prop="giveIntegral">-->
@@ -104,7 +103,7 @@ const dataFormRef = ref()
const visible = ref(false)
const loading = ref(false)
// 定义字典
const { spu_status,is_show } = useDict("spu_status","is_show")
const { spu_status, is_show } = useDict("spu_status", "is_show")
// 提交表单数据
const form = reactive({
@@ -127,7 +126,7 @@ const form = reactive({
virtualSalesCount: "",
browseCount: "",
deptId: "",
isShow: "0",
isShow: "0",
})
// 定义校验规则
@@ -16,7 +16,10 @@
<el-col :span="24" class="mb20">
<el-form-item label="钱包" prop="walletTypeId">
<select-wallet-type v-model="form.walletTypeId" placeholder="请选择钱包" :disabled="false" />
<!-- <select-wallet-type v-model="form.walletTypeId" placeholder="请选择钱包" :disabled="false" /> -->
<el-select v-model="form.walletTypeId" :disabled="true">
<el-option v-for="item in walletTypeOptions" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
</el-col>
@@ -41,7 +44,11 @@ import { useMessage } from "/@/hooks/message"
import { getObj, addObj, putObj } from "/@/api/wallet/wallet-recharge-apply"
const emit = defineEmits(["refresh"])
import { getWalletTypeSimple } from "/@/api/wallet/wallet-type"
import { useUserInfo } from "/@/stores/userInfo"
const {
userInfos: { roleCodes },
} = useUserInfo()
// 定义变量内容
const dataFormRef = ref()
const visible = ref(false)
@@ -58,6 +65,7 @@ const form = reactive({
importTime: "",
remark: "",
})
const walletTypeOptions = ref()
// 定义校验规则
const dataRules = ref({
@@ -79,6 +87,14 @@ const openDialog = async (id: string) => {
form.id = id
getwalletRechargeApplyData(id)
}
const res = await getWalletTypeSimple()
walletTypeOptions.value = res.data.records
if (roleCodes.includes("CAN_RECH_CONS_WALLET")) {
form.walletTypeId = res.data.records.find((item: any) => item.uniqueCode == "2").id
} else {
form.walletTypeId = res.data.records.find((item: any) => item.uniqueCode == "1").id
}
}
// 提交