feat:钱包、设备权限

This commit is contained in:
dzc committed 2025-01-19 11:54:56 +08:00
1 parent 611f1d634d
commit ef3dea40fa
19 files changed
+484 -361

No files matched your search

+4 -4
View File
@@ -10,15 +10,15 @@ ENV = 'development'
# ADMIN 服务地址 # ADMIN 服务地址
# VITE_ADMIN_PROXY_PATH = http://123.156.230.15:8089/api/ # 线上 # VITE_ADMIN_PROXY_PATH = http://123.156.230.15:8089/api/ # 线上
# VITE_ADMIN_PROXY_PATH = http://pjcloud.center.takin.cc/ # VITE_ADMIN_PROXY_PATH = http://pjcloud.center.takin.cc/
# VITE_ADMIN_PROXY_PATH = http://localhost:9999/ VITE_ADMIN_PROXY_PATH = http://localhost:9999
VITE_ADMIN_PROXY_PATH = http://192.168.101.29:9999/ # 邓-本地 # VITE_ADMIN_PROXY_PATH = http://192.168.101.29:9999/ # 邓-本地
# VITE_ADMIN_PROXY_PATH = http://59.202.170.152:81/api # 正式环境 # VITE_ADMIN_PROXY_PATH = http://59.202.170.152:81/api # 正式环境
# 图片访问基础地址 # 图片访问基础地址
# VITE_IMAGE_BASE_PATH = http://123.156.230.15:8089/api # 线上 # VITE_IMAGE_BASE_PATH = http://123.156.230.15:8089/api # 线上
# VITE_IMAGE_BASE_PATH = http://pjcloud.center.takin.cc # VITE_IMAGE_BASE_PATH = http://pjcloud.center.takin.cc
# VITE_IMAGE_BASE_PATH = http://localhost:9999 VITE_IMAGE_BASE_PATH = http://localhost:9999
VITE_IMAGE_BASE_PATH = http://192.168.101.29:9999 # 邓-本地 # VITE_IMAGE_BASE_PATH = http://192.168.101.29:9999 # 邓-本地
# VITE_IMAGE_BASE_PATH = http://59.202.170.152:81/api/ # 正式环境 # VITE_IMAGE_BASE_PATH = http://59.202.170.152:81/api/ # 正式环境
# 代码生成服务地址 # 代码生成服务地址
+1 -1
View File
@@ -108,4 +108,4 @@
"type": "git", "type": "git",
"url": "https://gitee.com/log4j/pig" "url": "https://gitee.com/log4j/pig"
} }
} }
+1 -1
View File
@@ -30,7 +30,7 @@ export type Props = {
placeholder?: string placeholder?: string
} }
const props = withDefaults(defineProps<Props>(), { const props = withDefaults(defineProps<Props>(), {
placeholder: "请选择", placeholder: "输入姓名、手机号",
}) })
const queryForm = reactive<any>({ const queryForm = reactive<any>({
+6
View File
@@ -34,6 +34,11 @@
<div class="layout-padding-auto layout-padding-view"> <div class="layout-padding-auto layout-padding-view">
<el-row v-show="showSearch"> <el-row v-show="showSearch">
<el-form ref="queryRef" :inline="true" :model="state.queryForm" @keyup.enter="getDataList"> <el-form ref="queryRef" :inline="true" :model="state.queryForm" @keyup.enter="getDataList">
<el-form-item label="用户" prop="userIds">
<div style="width: 180px">
<select-user v-model="state.queryForm.userIds" clearable />
</div>
</el-form-item>
<el-form-item :label="$t('sysuser.username')" prop="username"> <el-form-item :label="$t('sysuser.username')" prop="username">
<el-input v-model="state.queryForm.username" :placeholder="$t('sysuser.inputUsernameTip')" clearable /> <el-input v-model="state.queryForm.username" :placeholder="$t('sysuser.inputUsernameTip')" clearable />
</el-form-item> </el-form-item>
@@ -46,6 +51,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-row> </el-row>
<el-row> <el-row>
<div class="mb8" style="width: 100%"> <div class="mb8" style="width: 100%">
<el-button v-auth="'sys_user_add'" icon="folder-add" type="primary" @click="userDialogRef.openDialog()"> <el-button v-auth="'sys_user_add'" icon="folder-add" type="primary" @click="userDialogRef.openDialog()">
+50 -43
View File
@@ -1,62 +1,69 @@
<template> <template>
<el-dialog title="购物车" v-model="visible" :close-on-click-modal="false" draggable> <el-dialog title="购物车" v-model="visible" :close-on-click-modal="false" draggable>
<el-table :data="state.dataList" v-loading="state.loading" border :cell-style="tableStyle.cellStyle" <el-table
:header-cell-style="tableStyle.headerCellStyle" @sort-change="sortChangeHandle"> :data="state.dataList"
<el-table-column label="商品名" align="center" prop="productName" /> v-loading="state.loading"
<el-table-column label="商品图片" align="center" prop="code"> border
<template #default="{ row }"> :cell-style="tableStyle.cellStyle"
<preview-image v-if="row.productPic" :src="row.productPic" /> :header-cell-style="tableStyle.headerCellStyle"
</template> @sort-change="sortChangeHandle"
</el-table-column> >
<el-table-column label="商品价格" align="center" prop="ticketId"> <el-table-column label="商品名" align="center" prop="productName" />
<template #default="{ row }"> <el-table-column label="商品图片" align="center" prop="code">
<span>{{ displayPrice(row.productPrice) }}</span> <template #default="{ row }">
</template> <preview-image v-if="row.productPic" :src="row.productPic" />
</el-table-column> </template>
<el-table-column label="商品数量" align="center" prop="productCount" /> </el-table-column>
<el-table-column label="商品总额" align="center" prop="totalPrice"> <el-table-column label="商品价格" align="center" prop="ticketId">
<template #default="{ row }"> <template #default="{ row }">
<span>{{ displayPrice(row.totalPrice) }}</span> <span>{{ displayPrice(row.productPrice) }}</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> <el-table-column label="商品数量" align="center" prop="productCount" />
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" /> <el-table-column label="商品总额" align="center" prop="totalPrice">
<template #footer> <template #default="{ row }">
<span class="dialog-footer"> <span>{{ displayPrice(row.totalPrice) }}</span>
<el-button @click="visible = false">取消</el-button> </template>
</span> </el-table-column>
</template> </el-table>
</el-dialog> <pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
<template #footer>
<span class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
</span>
</template>
</el-dialog>
</template> </template>
<script setup lang="ts" name="shop-car"> <script setup lang="ts" name="shop-car">
import { BasicTableProps, useTable } from "/@/hooks/table"; import { BasicTableProps, useTable } from "/@/hooks/table"
import * as hardCar from "/@/api/hard/hard-car"; import * as hardCar from "/@/api/hard/hard-car"
import { displayPrice } from "/@/utils/formatMoney" import { displayPrice } from "/@/utils/formatMoney"
// 定义变量内容 // 定义变量内容
const visible = ref(false) const visible = ref(false)
const state: BasicTableProps = reactive<BasicTableProps>({ const state: BasicTableProps = reactive<BasicTableProps>({
createdIsNeed: false, createdIsNeed: false,
queryForm: {}, queryForm: {},
pageList: hardCar.getCarByOrderId pageList: hardCar.getCarByOrderId,
}) })
// table hook // table hook
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state) const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } =
useTable(state)
// 打开弹窗 // 打开弹窗
const openDialog = (id: string) => { const openDialog = (id: string) => {
visible.value = true visible.value = true
if (id) { if (id) {
state.queryForm.orderId = id state.queryForm.orderId = id
getDataList() getDataList()
} }
}; }
// 暴露变量 // 暴露变量
defineExpose({ defineExpose({
openDialog openDialog,
}); })
</script> </script>
@@ -78,6 +78,7 @@
<el-descriptions-item <el-descriptions-item
:column="1" :column="1"
v-if="globalData.type == 'apply' && globalData.afterSaleData.status == 10" v-if="globalData.type == 'apply' && globalData.afterSaleData.status == 10"
v-auth="'hard_hardAfterSale_change'"
label="操作: " label="操作: "
label-class-name="no-colon" label-class-name="no-colon"
> >
@@ -1,70 +1,70 @@
<template> <template>
<el-dialog title="拒绝售后" v-model="visible" width="45%" :close-on-click-modal="false" draggable> <el-dialog title="拒绝售后" v-model="visible" width="45%" :close-on-click-modal="false" draggable>
<el-form ref="dataFormRef" :model="form" label-width="80px" :rules="dataRules" v-loading="loading"> <el-form ref="dataFormRef" :model="form" label-width="80px" :rules="dataRules" v-loading="loading">
<el-form-item label="审批备注" prop="auditReason"> <el-form-item label="审批备注" prop="auditReason">
<el-input v-model="form.auditReason" :rows="3" placeholder="请输入审批备注" type="textarea" /> <el-input v-model="form.auditReason" :rows="3" placeholder="请输入审批备注" type="textarea" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<template #footer> <template #footer>
<el-button type="primary" @click="onSubmit">确 定</el-button> <el-button type="primary" @click="onSubmit">确 定</el-button>
<el-button @click="visible = false">取 消</el-button> <el-button @click="visible = false">取 消</el-button>
</template> </template>
</el-dialog> </el-dialog>
</template> </template>
<script setup lang="ts" name="refund-reject"> <script setup lang="ts" name="refund-reject">
import { useMessage } from "/@/hooks/message"; import { useMessage } from "/@/hooks/message"
import * as hardAfterSaleApi from '/@/api/hard/hard-after-sale' import * as hardAfterSaleApi from "/@/api/hard/hard-after-sale"
const emit = defineEmits(['refresh']); const emit = defineEmits(["refresh"])
// 定义变量内容 // 定义变量内容
const dataFormRef = ref(); const dataFormRef = ref()
const visible = ref(false) const visible = ref(false)
const loading = ref(false) const loading = ref(false)
const form = reactive<any>({ const form = reactive<any>({
id: undefined, id: undefined,
auditReason: "", auditReason: "",
}) })
// 定义校验规则 // 定义校验规则
const dataRules = ref({ const dataRules = ref({
auditReason: [{ required: true, message: '请输入拒绝原因', trigger: 'blur' }], auditReason: [{ required: true, message: "请输入拒绝原因", trigger: "blur" }],
}) })
// 打开弹窗 // 打开弹窗
const openDialog = async (id: string) => { const openDialog = async (id: string) => {
visible.value = true visible.value = true
form.id = '' form.id = ""
if (!id) return if (!id) return
nextTick(() => { nextTick(() => {
dataFormRef.value?.resetFields(); dataFormRef.value?.resetFields()
}); })
form.id = id form.id = id
const { data } = await hardAfterSaleApi.detailByOrderId({ orderId: id }) const { data } = await hardAfterSaleApi.detailByOrderId({ orderId: id })
Object.assign(form, data) Object.assign(form, data)
}; }
// 提交 // 提交
const onSubmit = async () => { const onSubmit = async () => {
const valid = await dataFormRef.value.validate().catch(() => { }); const valid = await dataFormRef.value.validate().catch(() => {})
if (!valid) return false; if (!valid) return false
try { try {
loading.value = true; loading.value = true
await hardAfterSaleApi.disagree(form); await hardAfterSaleApi.disagree(form)
useMessage().success(form.id ? '修改成功' : '添加成功'); useMessage().success(form.id ? "修改成功" : "添加成功")
visible.value = false; visible.value = false
emit('refresh'); emit("refresh")
} catch (err: any) { } catch (err: any) {
useMessage().error(err.msg); useMessage().error(err.msg)
} finally { } finally {
loading.value = false; loading.value = false
} }
}; }
// 暴露变量 // 暴露变量
defineExpose({ defineExpose({
openDialog openDialog,
}); })
</script> </script>
+1 -1
View File
@@ -57,7 +57,7 @@
<el-table-column type="index" label="#" width="40" /> <el-table-column type="index" label="#" width="40" />
<el-table-column prop="id" label="编号" /> <el-table-column prop="id" label="编号" />
<el-table-column prop="name" label="分组名" /> <el-table-column prop="name" label="分组名" />
<el-table-column v-if="false" prop="deptName" label="部门" /> <el-table-column prop="deptName" label="部门" />
<el-table-column label="操作" width="150"> <el-table-column label="操作" width="150">
<template #default="scope"> <template #default="scope">
<el-button <el-button
+24 -12
View File
@@ -4,13 +4,8 @@
<el-form ref="queryRef" :inline="true" :model="state.queryForm" @keyup.enter="getDataList"> <el-form ref="queryRef" :inline="true" :model="state.queryForm" @keyup.enter="getDataList">
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :span="4"> <el-col :span="4">
<el-form-item class="w100" label="设备名" prop="name"> <el-form-item class="w100" label="用户" prop="userIdChild">
<el-input v-model="state.queryForm.name" placeholder="设备名" /> <select-user v-model="state.queryForm.userIdChild" />
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item class="w100" label="设备类型" prop="type">
<dict-select v-model="state.queryForm.type" dict-code="hard_type" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
@@ -18,6 +13,16 @@
<select-mch v-model="state.queryForm.merchantIds" /> <select-mch v-model="state.queryForm.merchantIds" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4">
<el-form-item class="w100" label="设备类型" prop="hardType">
<dict-select v-model="state.queryForm.hardType" dict-code="hard_type" />
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item class="w100" label="打印时间" prop="createTimeList">
<el-date-picker v-model="state.queryForm.createTimeList" value-format="YYYY-MM-DD" type="daterange" />
</el-form-item>
</el-col>
<el-form-item> <el-form-item>
<el-button icon="Search" type="primary" @click="getDataList">{{ $t("common.queryBtn") }}</el-button> <el-button icon="Search" type="primary" @click="getDataList">{{ $t("common.queryBtn") }}</el-button>
<el-button icon="Refresh" @click="resetQuery">{{ $t("common.resetBtn") }}</el-button> <el-button icon="Refresh" @click="resetQuery">{{ $t("common.resetBtn") }}</el-button>
@@ -34,8 +39,18 @@
@sort-change="sortChangeHandle" @sort-change="sortChangeHandle"
> >
<el-table-column type="selection" width="40" align="center" /> <el-table-column type="selection" width="40" align="center" />
<el-table-column type="index" label="#" width="40" /> <el-table-column type="index" label="#" width="60" />
<el-table-column label="部门" prop="deptName" /> <el-table-column width="200" label="用户">
<template #default="{ row }">
<div class="flex flex-row items-center justify-center">
<preview-image width="50px" height="50px" :src="row.userAvatar" />
<div class="flex flex-col ml-2 items-start cursor-pointer hover:underline hover:text-blue-500">
<span> {{ row.username }}</span>
<span> {{ row.userMobile }}</span>
</div>
</div>
</template>
</el-table-column>
<el-table-column width="250px" label="设备信息"> <el-table-column width="250px" label="设备信息">
<template #default="{ row }"> <template #default="{ row }">
<div class="status"> <div class="status">
@@ -184,17 +199,14 @@ const handleDelete = async (ids: string[]) => {
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 2px; margin-bottom: 2px;
span { span {
display: inline-block; display: inline-block;
} }
span:nth-child(1) { span:nth-child(1) {
min-width: 60px; min-width: 60px;
max-width: 100px; max-width: 100px;
text-align: left; text-align: left;
} }
span:nth-child(2) { span:nth-child(2) {
flex: 1; flex: 1;
min-width: 50px; min-width: 50px;
+22 -4
View File
@@ -103,15 +103,33 @@
@click="formDialogRef.openDialog(row.id)" @click="formDialogRef.openDialog(row.id)"
>编辑</el-button >编辑</el-button
> >
<el-button icon="TrendCharts" link type="primary" @click="mqformDialogRef.openDialog(row.id)"> <el-button
icon="TrendCharts"
link
type="primary"
v-auth="'hard_hardManager_edit'"
@click="mqformDialogRef.openDialog(row.id)"
>
mq设置 mq设置
</el-button> </el-button>
<el-button icon="SetUp" link type="primary" @click="faceFormDialogRef.openDialog(row.id)"> <el-button
icon="SetUp"
link
type="primary"
v-auth="'hard_hardManager_edit'"
@click="faceFormDialogRef.openDialog(row.id)"
>
人脸sdk设置 人脸sdk设置
</el-button> </el-button>
<el-button icon="delete" text type="primary" v-auth="'hard_hardManager_del'" @click="handleDelete([row.id])" <el-button
>删除</el-button icon="delete"
text
type="primary"
v-auth="'hard_hardManager_del'"
@click="handleDelete([row.id])"
> >
删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
+40 -11
View File
@@ -13,7 +13,12 @@
<select-mch v-model="state.queryForm.mchIds" /> <select-mch v-model="state.queryForm.mchIds" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="4">
<el-form-item class="w100" label="用户部门" prop="deptIdIdDeepen">
<select-dept v-model="state.queryForm.deptIdIdDeepen" />
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item class="w100" label="创建时间" prop="payTimeList"> <el-form-item class="w100" label="创建时间" prop="payTimeList">
<el-date-picker v-model="state.queryForm.payTimeList" value-format="YYYY-MM-DD" type="daterange" /> <el-date-picker v-model="state.queryForm.payTimeList" value-format="YYYY-MM-DD" type="daterange" />
</el-form-item> </el-form-item>
@@ -42,13 +47,17 @@
> >
<el-table-column type="selection" width="40" align="center" /> <el-table-column type="selection" width="40" align="center" />
<el-table-column type="index" label="#" width="50" /> <el-table-column type="index" label="#" width="50" />
<el-table-column prop="username" width="100" label="用户" /> <el-table-column width="200" label="用户">
<el-table-column prop="userAvatar" width="100" label="头像">
<template #default="{ row }"> <template #default="{ row }">
<preview-image :src="row.userAvatar" /> <div class="flex flex-row items-center justify-center">
<preview-image width="50px" height="50px" :src="row.userAvatar" />
<div class="flex flex-col ml-2 items-start cursor-pointer hover:underline hover:text-blue-500">
<span> {{ row.username }}</span>
<span> {{ row.userMobile }}</span>
</div>
</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="userMobile" width="120" label="手机号" />
<el-table-column width="200px" label="商品简要信息"> <el-table-column width="200px" label="商品简要信息">
<template #default="{ row }"> <template #default="{ row }">
<div class="desc"> <div class="desc">
@@ -167,13 +176,30 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column fixed="right" label="操作" width="250"> <el-table-column fixed="right" label="操作" width="200">
<template #default="{ row }"> <template #default="{ row }">
<el-button icon="Printer" text type="primary" @click="print(row)"> 打印发票 </el-button> <div class="flex justify-between">
<el-button icon="ShoppingCartFull" text type="primary" @click="shopCarDialogRef.openDialog(row.id)"> <el-button icon="Printer" text type="primary" @click="print(row)" v-auth="'hard_hardInvoice_admin_print'">
购物车 打印发票
</el-button> </el-button>
<el-button icon="InfoFilled" link type="primary" @click="doRefund(row)"> 详情 </el-button> <el-button icon="ShoppingCartFull" text type="primary" @click="shopCarDialogRef.openDialog(row.id)">
购物车
</el-button>
</div>
<div class="flex justify-between">
<el-button icon="Money" link type="primary" @click="transactionListRef.openDialog(row.walletId)">
钱包明细
</el-button>
<el-button
icon="InfoFilled"
link
type="primary"
v-auth="'wallet_walletTransaction_update_balance'"
@click="doRefund(row)"
>
订单详情
</el-button>
</div>
<el-button <el-button
v-if="false" v-if="false"
icon="edit-pen" icon="edit-pen"
@@ -198,6 +224,7 @@
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" /> <pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
</div> </div>
<!-- 编辑、新增 --> <!-- 编辑、新增 -->
<transaction-list ref="transactionListRef" @refresh="getDataList(false)" />
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" /> <form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
<shop-car ref="shopCarDialogRef" /> <shop-car ref="shopCarDialogRef" />
</div> </div>
@@ -218,6 +245,7 @@ const { push } = useRouter()
// 引入组件 // 引入组件
const FormDialog = defineAsyncComponent(() => import("./form.vue")) const FormDialog = defineAsyncComponent(() => import("./form.vue"))
const ShopCar = defineAsyncComponent(() => import("../components/shop-car.vue")) const ShopCar = defineAsyncComponent(() => import("../components/shop-car.vue"))
const TransactionList = defineAsyncComponent(() => import("/@/views/wallet/components/transaction-list.vue"))
// 定义查询字典 // 定义查询字典
const { hard_pay_type, hard_order_type, hard_order_status, hard_type, hard_refund_status, daily_menu } = useDict( const { hard_pay_type, hard_order_type, hard_order_status, hard_type, hard_refund_status, daily_menu } = useDict(
"hard_pay_type", "hard_pay_type",
@@ -230,6 +258,7 @@ const { hard_pay_type, hard_order_type, hard_order_status, hard_type, hard_refun
// 定义变量内容 // 定义变量内容
const formDialogRef = ref() const formDialogRef = ref()
const shopCarDialogRef = ref() const shopCarDialogRef = ref()
const transactionListRef = ref()
const tabList = ref<any>([{}]) const tabList = ref<any>([{}])
const activeName = ref(null) const activeName = ref(null)
// 搜索变量 // 搜索变量
+2 -2
View File
@@ -107,7 +107,7 @@
icon="Money" icon="Money"
text text
type="primary" type="primary"
v-auth="'wallet_walletManage_edit'" v-auth="'wallet_walletTransaction_update_balance'"
@click="changeBalanceRef.openDialog(row.userId, row.id)" @click="changeBalanceRef.openDialog(row.userId, row.id)"
>充值/扣款</el-button >充值/扣款</el-button
> >
@@ -129,7 +129,7 @@ import { useDict } from "/@/hooks/dict"
import { displayPrice } from "/@/utils/formatMoney" import { displayPrice } from "/@/utils/formatMoney"
// 引入组件 // 引入组件
const TransactionList = defineAsyncComponent(() => import("./transaction-list.vue")) const TransactionList = defineAsyncComponent(() => import("../components/transaction-list.vue"))
const ChangeBalance = defineAsyncComponent(() => import("./change-balance.vue")) const ChangeBalance = defineAsyncComponent(() => import("./change-balance.vue"))
// 定义查询字典 // 定义查询字典
const { wallet_type, yes_no_type } = useDict("wallet_type", "yes_no_type") const { wallet_type, yes_no_type } = useDict("wallet_type", "yes_no_type")
@@ -100,7 +100,7 @@
icon="Connection" icon="Connection"
text text
type="primary" type="primary"
v-auth="'wallet_walletRechargeApply_edit'" v-auth="'wallet_walletRechargeApply_apply'"
@click="doApply(row)" @click="doApply(row)"
>申请</el-button >申请</el-button
> >
@@ -1,91 +1,107 @@
<template> <template>
<div class="w100"> <div class="w100">
<div class="layout-padding-auto layout-padding-view"> <div class="layout-padding-auto layout-padding-view">
<div class="flex justify-center flex-col"> <div class="flex justify-center flex-col">
<div> <div>
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="180px" <el-form
v-loading="loading"> ref="dataFormRef"
<el-row :gutter="24"> :model="form"
<el-col :span="24" class="mb20"> :rules="dataRules"
<el-form-item label="钱包二维码自动刷新" prop="refreshQrCodeEnable"> formDialogRef
<el-switch active-value="1" inactive-value="0" v-model="form.refreshQrCodeEnable" label-width="180px"
active-text="开启" inactive-text="关闭" inline-prompt /> v-loading="loading"
</el-form-item> >
</el-col> <el-row :gutter="24">
<el-col :span="24" class="mb20"> <el-col :span="24" class="mb20">
<el-form-item label="钱包二维码自动刷新间隔" prop="refreshQrCodeFre"> <el-form-item label="钱包二维码自动刷新" prop="refreshQrCodeEnable">
<el-input style="width: 300px;" type="number" v-model="form.refreshQrCodeFre" <el-switch
placeholder="请输入钱包二维码自动刷新间隔"> active-value="1"
<template #append>秒</template> inactive-value="0"
</el-input> v-model="form.refreshQrCodeEnable"
</el-form-item> active-text="开启"
</el-col> inactive-text="关闭"
</el-row> inline-prompt
</el-form> />
</div> </el-form-item>
</div> </el-col>
<div class="flex items-center"> <el-col :span="24" class="mb20">
<el-button type="primary" @click="onSubmit" :disabled="loading">确认</el-button> <el-form-item label="钱包二维码自动刷新间隔" prop="refreshQrCodeFre">
</div> <el-input
</div> style="width: 300px"
</div> 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" v-auth="'wallet_setting_edit'">
<el-button type="primary" @click="onSubmit" :disabled="loading">确认</el-button>
</div>
</div>
</div>
</template> </template>
<script setup lang="ts" name="code"> <script setup lang="ts" name="code">
import { useDict } from '/@/hooks/dict' import { useDict } from "/@/hooks/dict"
import { storePrice } from "/@/utils/formatMoney" import { storePrice } from "/@/utils/formatMoney"
import { useMessage } from "/@/hooks/message" import { useMessage } from "/@/hooks/message"
import { getObj, putObj } from "/@/api/wallet/wallet-setting" import { getObj, putObj } from "/@/api/wallet/wallet-setting"
// 定义变量内容 // 定义变量内容
const dataFormRef = ref(); const dataFormRef = ref()
const loading = ref(false) const loading = ref(false)
// 提交表单数据 // 提交表单数据
const form = reactive({ const form = reactive({
id: undefined, id: undefined,
refreshQrCodeEnable: undefined, refreshQrCodeEnable: undefined,
refreshQrCodeFre: undefined, refreshQrCodeFre: undefined,
}); })
// 定义校验规则 // 定义校验规则
const dataRules = ref({ const dataRules = ref({
refreshQrCodeEnable: [{ required: true, message: '是否开启钱包二维码自动刷新', trigger: 'change' }], refreshQrCodeEnable: [{ required: true, message: "是否开启钱包二维码自动刷新", trigger: "change" }],
refreshQrCodeFre: [{ required: true, message: '钱包二维码自动刷新间隔', trigger: 'blur' }], refreshQrCodeFre: [{ required: true, message: "钱包二维码自动刷新间隔", trigger: "blur" }],
}) })
onMounted(() => { onMounted(() => {
getwalletRechargePackageData('1') getwalletRechargePackageData("1")
}) })
// 提交 // 提交
const onSubmit = async () => { const onSubmit = async () => {
const valid = await dataFormRef.value.validate().catch(() => { }); const valid = await dataFormRef.value.validate().catch(() => {})
if (!valid) return false; 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;
}
};
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) => { const getwalletRechargePackageData = (id: string) => {
// 获取数据 // 获取数据
loading.value = true loading.value = true
getObj(id).then((res: any) => { getObj(id)
Object.assign(form, res.data) .then((res: any) => {
}).finally(() => { Object.assign(form, res.data)
loading.value = false })
}) .finally(() => {
}; loading.value = false
})
</script> }
</script>
@@ -50,7 +50,7 @@
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<div class="flex items-center"> <div class="flex items-center" v-auth="'wallet_setting_edit'">
<el-button type="primary" @click="onSubmit" :disabled="loading">确认</el-button> <el-button type="primary" @click="onSubmit" :disabled="loading">确认</el-button>
</div> </div>
</div> </div>
@@ -1,80 +1,91 @@
<template> <template>
<div class="w100"> <div class="w100">
<div class="layout-padding-auto layout-padding-view"> <div class="layout-padding-auto layout-padding-view">
<div class="flex justify-center flex-col"> <div class="flex justify-center flex-col">
<div> <div>
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="180px" <el-form
v-loading="loading"> ref="dataFormRef"
<el-row :gutter="24"> :model="form"
<el-col :span="24" class="mb20"> :rules="dataRules"
<el-form-item label="离线订单是否需要审批" prop="offLineOrderApplyEnable"> formDialogRef
<el-switch active-value="1" inactive-value="0" label-width="180px"
v-model="form.offLineOrderApplyEnable" active-text="开启" inactive-text="关闭" v-loading="loading"
inline-prompt /> >
</el-form-item> <el-row :gutter="24">
</el-col> <el-col :span="24" class="mb20">
</el-row> <el-form-item label="离线订单是否需要审批" prop="offLineOrderApplyEnable">
</el-form> <el-switch
</div> active-value="1"
<div class="flex items-center"> inactive-value="0"
<el-button type="primary" @click="onSubmit" :disabled="loading">确认</el-button> v-model="form.offLineOrderApplyEnable"
</div> active-text="开启"
</div> inactive-text="关闭"
</div> inline-prompt
</div> />
</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>
</div>
</template> </template>
<script setup lang="ts" name="code"> <script setup lang="ts" name="code">
import { useDict } from '/@/hooks/dict' import { useDict } from "/@/hooks/dict"
import { storePrice } from "/@/utils/formatMoney" import { storePrice } from "/@/utils/formatMoney"
import { useMessage } from "/@/hooks/message" import { useMessage } from "/@/hooks/message"
import { getObj, putObj } from "/@/api/wallet/wallet-setting" import { getObj, putObj } from "/@/api/wallet/wallet-setting"
// 定义变量内容 // 定义变量内容
const dataFormRef = ref(); const dataFormRef = ref()
const loading = ref(false) const loading = ref(false)
// 提交表单数据 // 提交表单数据
const form = reactive({ const form = reactive({
id: '', id: "",
offLineOrderApplyEnable: '', offLineOrderApplyEnable: "",
}); })
// 定义校验规则 // 定义校验规则
const dataRules = ref({ const dataRules = ref({
offLineOrderApplyEnable: [{ required: true, message: '离线订单是否需要审批', trigger: 'change' }], offLineOrderApplyEnable: [{ required: true, message: "离线订单是否需要审批", trigger: "change" }],
}) })
onMounted(() => { onMounted(() => {
getwalletRechargePackageData('1') getwalletRechargePackageData("1")
}) })
// 提交 // 提交
const onSubmit = async () => { const onSubmit = async () => {
const valid = await dataFormRef.value.validate().catch(() => { }); const valid = await dataFormRef.value.validate().catch(() => {})
if (!valid) return false; 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;
}
};
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) => { const getwalletRechargePackageData = (id: string) => {
// 获取数据 // 获取数据
loading.value = true loading.value = true
getObj(id).then((res: any) => { getObj(id)
Object.assign(form, res.data) .then((res: any) => {
}).finally(() => { Object.assign(form, res.data)
loading.value = false })
}) .finally(() => {
}; loading.value = false
})
</script> }
</script>
@@ -1,38 +1,64 @@
<template> <template>
<div class="w100"> <div class="w100">
<div class="layout-padding-auto layout-padding-view"> <div class="layout-padding-auto layout-padding-view">
<div class="flex justify-center flex-col"> <div class="flex justify-center flex-col">
<div> <div>
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" <el-form
v-loading="loading"> ref="dataFormRef"
<el-row :gutter="24"> :model="form"
<el-col :span="24" class="mb20"> :rules="dataRules"
<el-form-item label="退款理由" prop="afterSaleRefundReasons"> formDialogRef
<el-select style="width: 500px;" v-model="form.afterSaleRefundReasons" allow-create label-width="90px"
filterable multiple placeholder="请输入退款理由"> v-loading="loading"
<el-option v-for="reason in form.afterSaleRefundReasons" :key="reason" >
:label="reason" :value="reason" /> <el-row :gutter="24">
</el-select> <el-col :span="24" class="mb20">
</el-form-item> <el-form-item label="退款理由" prop="afterSaleRefundReasons">
</el-col> <el-select
<el-col :span="24" class="mb20"> style="width: 500px"
<el-form-item label="退货理由" prop="afterSaleReturnReasons"> v-model="form.afterSaleRefundReasons"
<el-select style="width: 500px;" v-model="form.afterSaleReturnReasons" allow-create allow-create
filterable multiple placeholder="请输入退货理由"> filterable
<el-option v-for="reason in form.afterSaleReturnReasons" :key="reason" multiple
:label="reason" :value="reason" /> placeholder="请输入退款理由"
</el-select> >
</el-form-item> <el-option
</el-col> v-for="reason in form.afterSaleRefundReasons"
</el-row> :key="reason"
</el-form> :label="reason"
<div class="flex items-center"> :value="reason"
<el-button type="primary" @click="onSubmit" :disabled="loading">确认</el-button> />
</div> </el-select>
</div> </el-form-item>
</div> </el-col>
</div> <el-col :span="24" class="mb20">
</div> <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" v-auth="'wallet_setting_edit'">
<el-button type="primary" @click="onSubmit" :disabled="loading">确认</el-button>
</div>
</div>
</div>
</div>
</div>
</template> </template>
<script setup lang="ts" name="refund"> <script setup lang="ts" name="refund">
@@ -40,61 +66,61 @@ import { storePrice } from "/@/utils/formatMoney"
import { useMessage } from "/@/hooks/message" import { useMessage } from "/@/hooks/message"
import { getObj, putObj } from "/@/api/wallet/wallet-setting" import { getObj, putObj } from "/@/api/wallet/wallet-setting"
// 定义变量内容 // 定义变量内容
const dataFormRef = ref(); const dataFormRef = ref()
const loading = ref(false) const loading = ref(false)
// 提交表单数据 // 提交表单数据
const form = reactive<any>({ const form = reactive<any>({
id: undefined, id: undefined,
afterSaleRefundReasons: undefined, afterSaleRefundReasons: undefined,
afterSaleReturnReasons: undefined, afterSaleReturnReasons: undefined,
}); })
// 定义校验规则 // 定义校验规则
const dataRules = ref({ const dataRules = ref({
afterSaleRefundReasons: [{ required: true, message: '请输入退款理由', trigger: 'blur' }], afterSaleRefundReasons: [{ required: true, message: "请输入退款理由", trigger: "blur" }],
afterSaleReturnReasons: [{ required: true, message: '请输入退货理由', trigger: 'blur' }], afterSaleReturnReasons: [{ required: true, message: "请输入退货理由", trigger: "blur" }],
}) })
onMounted(() => { onMounted(() => {
getwalletRechargePackageData('1') getwalletRechargePackageData("1")
}) })
// 提交 // 提交
const onSubmit = async () => { const onSubmit = async () => {
const valid = await dataFormRef.value.validate().catch(() => { }); const valid = await dataFormRef.value.validate().catch(() => {})
if (!valid) return false; if (!valid) return false
try { try {
loading.value = true; loading.value = true
const pa = { const pa = {
...form, ...form,
afterSaleRefundReasons: form.afterSaleRefundReasons?.join(","), afterSaleRefundReasons: form.afterSaleRefundReasons?.join(","),
afterSaleReturnReasons: form.afterSaleReturnReasons?.join(",") afterSaleReturnReasons: form.afterSaleReturnReasons?.join(","),
} }
await putObj(pa) await putObj(pa)
useMessage().success('修改成功'); useMessage().success("修改成功")
} catch (err: any) { } catch (err: any) {
useMessage().error(err.msg); useMessage().error(err.msg)
} finally { } finally {
loading.value = false; loading.value = false
} }
}; }
// 初始化表单数据 // 初始化表单数据
const getwalletRechargePackageData = (id: string) => { const getwalletRechargePackageData = (id: string) => {
// 获取数据 // 获取数据
loading.value = true loading.value = true
getObj(id).then((res: any) => { getObj(id)
const data: any = res.data; .then((res: any) => {
if (data.afterSaleRefundReasons) { const data: any = res.data
data.afterSaleRefundReasons = data.afterSaleRefundReasons?.split(",") if (data.afterSaleRefundReasons) {
} data.afterSaleRefundReasons = data.afterSaleRefundReasons?.split(",")
if (data.afterSaleReturnReasons) { }
data.afterSaleReturnReasons = data.afterSaleReturnReasons?.split(",") if (data.afterSaleReturnReasons) {
} data.afterSaleReturnReasons = data.afterSaleReturnReasons?.split(",")
Object.assign(form, data) }
}).finally(() => { Object.assign(form, data)
loading.value = false })
}) .finally(() => {
}; loading.value = false
})
</script> }
</script>
+32 -35
View File
@@ -1,45 +1,42 @@
<template> <template>
<div class="layout-padding"> <div class="layout-padding">
<div class="layout-padding-auto layout-padding-view"> <div class="layout-padding-auto layout-padding-view">
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick"> <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
<div v-for="(v) in data.tabList" :key="v.id"> <div v-for="v in data.tabList" :key="v.id">
<el-tab-pane :label="v.label" :name="v.id"> <el-tab-pane :label="v.label" :name="v.id">
<div></div> <div></div>
</el-tab-pane> </el-tab-pane>
</div> </div>
</el-tabs> </el-tabs>
<div class="flex justify-center"> <div class="flex justify-center">
<recharge-package v-if="activeName == 10" /> <recharge-package v-if="activeName == 10" />
<extra-price v-if="activeName == 20" /> <extra-price v-if="activeName == 20" />
<refund v-if="activeName == 30" /> <refund v-if="activeName == 30" />
<Code v-if="activeName == 40" /> <Code v-if="activeName == 40" />
<off-line v-if="activeName == 50" /> <off-line v-if="activeName == 50" />
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
const RechargePackage = defineAsyncComponent(() => import("./components/recharge-package/index.vue"))
const RechargePackage = defineAsyncComponent(() => import('./components/recharge-package/index.vue')); const Code = defineAsyncComponent(() => import("./components/code/index.vue"))
const Code = defineAsyncComponent(() => import('./components/code/index.vue')); const Refund = defineAsyncComponent(() => import("./components/refund/index.vue"))
const Refund = defineAsyncComponent(() => import('./components/refund/index.vue')); const OffLine = defineAsyncComponent(() => import("./components/off-line/index.vue"))
const OffLine = defineAsyncComponent(() => import('./components/off-line/index.vue')); const ExtraPrice = defineAsyncComponent(() => import("./components/extra-price/index.vue"))
const ExtraPrice = defineAsyncComponent(() => import('./components/extra-price/index.vue'));
const data = { const data = {
tabList: [ tabList: [
{ id: 10, label: "充值套餐" }, { id: 10, label: "充值套餐" },
{ id: 20, label: "每餐额定金额配置" }, { id: 20, label: "每餐额定金额配置" },
{ id: 30, label: "退款配置" }, { id: 30, label: "退款配置" },
{ id: 40, label: "二维码配置" }, { id: 40, label: "二维码配置" },
{ id: 50, label: "离线配置" }, { id: 50, label: "离线配置" },
] ],
} }
const activeName = ref(data.tabList[0].id) const activeName = ref(data.tabList[0].id)
const handleClick = (e: any) => { const handleClick = (e: any) => {}
} </script>
</script>