feat:是否保留100元用于跨单位
This commit is contained in:
1 parent
6de0f583b8
commit
e6acab2fea
3 files changed
+86
-79
No files matched your search
@@ -1,6 +1,8 @@
|
||||
<template>
|
||||
<el-dialog :title="form.id ? '编辑' : '新增'" width="30%" v-model="visible" append-to-body :close-on-click-modal="false" draggable>
|
||||
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="120px" v-loading="loading">
|
||||
<el-dialog :title="form.id ? '编辑' : '新增'" width="30%" v-model="visible" append-to-body :close-on-click-modal="false"
|
||||
draggable>
|
||||
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="120px"
|
||||
v-loading="loading">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="源钱包类型" prop="sourceWalletTypeId">
|
||||
@@ -9,11 +11,8 @@
|
||||
</el-col>
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="目标钱包类型" prop="targetWalletTypeId">
|
||||
<select-wallet-type
|
||||
v-model="form.targetWalletTypeId"
|
||||
:autoFirst="true"
|
||||
:apiParams="{ notWalletTypeIds: form.sourceWalletTypeId }"
|
||||
/>
|
||||
<select-wallet-type v-model="form.targetWalletTypeId" :autoFirst="true"
|
||||
:apiParams="{ notWalletTypeIds: form.sourceWalletTypeId }" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mb20" v-if="!form.id">
|
||||
@@ -88,7 +87,7 @@ const openDialog = (id: string, sourceWalletTypeId: string) => {
|
||||
|
||||
// 提交
|
||||
const onSubmit = async () => {
|
||||
const valid = await dataFormRef.value.validate().catch(() => {})
|
||||
const valid = await dataFormRef.value.validate().catch(() => { })
|
||||
if (!valid) return false
|
||||
try {
|
||||
loading.value = true
|
||||
|
||||
@@ -1,24 +1,37 @@
|
||||
<template>
|
||||
<el-dialog title="钱包规则" width="75%" v-model="visible" append-to-body :close-on-click-modal="false" draggable>
|
||||
<el-dialog title="钱包规则" width="85%" v-model="visible" append-to-body :close-on-click-modal="false" draggable>
|
||||
<el-form ref="queryRef" :inline="true" :model="state.queryForm" @keyup.enter="getDataList">
|
||||
<el-row>
|
||||
<el-form-item style="width: 300px" label="部门" prop="targetDeptId">
|
||||
<select-dept v-model="state.queryForm.targetDeptId" />
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 200px" label="是否启用" prop="status">
|
||||
<dict-select v-model="state.queryForm.status" dict-code="yes_no_type" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<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-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="doAdd" v-auth="'dzc_walletRuleMchConfig_add'"> 新 增 </el-button>
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="doAdd"
|
||||
v-auth="'dzc_walletRuleMchConfig_add'"> 新 增 </el-button>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-table
|
||||
:data="state.dataList"
|
||||
v-loading="state.loading"
|
||||
border
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
@selection-change="selectionChangHandle"
|
||||
@sort-change="sortChangeHandle"
|
||||
>
|
||||
<el-table :data="state.dataList" v-loading="state.loading" border :cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle" @selection-change="selectionChangHandle"
|
||||
@sort-change="sortChangeHandle">
|
||||
<el-table-column type="selection" width="40" align="center" />
|
||||
<el-table-column type="index" label="#" width="80" />
|
||||
<el-table-column min-width="120" label="源钱包类型">
|
||||
<template #default="{ row }">
|
||||
<div class="flex items-center justify-center">
|
||||
<div class="flex flex-col items-center justify-center">
|
||||
<div class="color-primary">{{ row.sourceName }}</div>
|
||||
<div class="flex items-center just ml5">
|
||||
<dict-tag :options="wallet_type" :value="row.sourceUniqueCode" />
|
||||
@@ -28,7 +41,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column min-width="120" label="目标钱包类型">
|
||||
<template #default="{ row }">
|
||||
<div class="flex items-center justify-center">
|
||||
<div class="flex flex-col items-center justify-center">
|
||||
<div class="color-primary">{{ row.targetName }}</div>
|
||||
<div class="flex items-center just ml5">
|
||||
<dict-tag :options="wallet_type" :value="row.targetUniqueCode" />
|
||||
@@ -37,16 +50,22 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column min-width="120" prop="deptName" label="目标部门" show-overflow-tooltip />
|
||||
<el-table-column prop="rulePriceConfigId" min-width="80" label="转换百分比">
|
||||
<el-table-column prop="rulePriceConfigId" min-width="100" label="转换百分比">
|
||||
<template #default="{ row }">
|
||||
<span class="color-success">{{ row.balanceMultiple }}%</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" min-width="80" label="是否启用">
|
||||
<el-table-column prop="status" min-width="100" label="是否启用">
|
||||
<template #default="{ row }">
|
||||
<el-switch active-value="1" inactive-value="0" v-model="row.status" @change="statusChange(row)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="isReservePrice" min-width="100" label="是否保留100元用于跨单位">
|
||||
<template #default="{ row }">
|
||||
<el-switch active-value="1" inactive-value="0" v-model="row.isReservePrice"
|
||||
@change="isReservePriceChange(row)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column min-width="300" label="描述">
|
||||
<template #default="{ row }">
|
||||
<wallet-rule-desc :detail="row" />
|
||||
@@ -54,17 +73,10 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="150" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
icon="edit-pen"
|
||||
text
|
||||
type="primary"
|
||||
v-auth="'dzc_walletRuleMchConfig_edit'"
|
||||
@click="WalletRuleFormDialogRef.openDialog(row.id, row.sourceWalletTypeId)"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-button icon="delete" text type="primary" v-auth="'dzc_walletRuleMchConfig_del'" @click="handleDelete([row.id])"
|
||||
>删除</el-button
|
||||
>
|
||||
<el-button icon="edit-pen" text type="primary" v-auth="'dzc_walletRuleMchConfig_edit'"
|
||||
@click="WalletRuleFormDialogRef.openDialog(row.id, row.sourceWalletTypeId)">编辑</el-button>
|
||||
<el-button icon="delete" text type="primary" v-auth="'dzc_walletRuleMchConfig_del'"
|
||||
@click="handleDelete([row.id])">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -83,11 +95,12 @@ const WalletRuleFormDialog = defineAsyncComponent(() => import("./wallet-rule-fo
|
||||
const WalletRuleDesc = defineAsyncComponent(() => import("../../components/wallet-rule-desc.vue"))
|
||||
|
||||
// 定义查询字典
|
||||
const { wallet_type } = useDict("wallet_type")
|
||||
const { wallet_type, yes_no_type } = useDict("wallet_type", "yes_no_type")
|
||||
|
||||
// 定义变量内容
|
||||
const WalletRuleFormDialogRef = ref()
|
||||
const visible = ref(false)
|
||||
const queryRef = ref()
|
||||
|
||||
// 多选变量
|
||||
const selectObjs = ref([]) as any
|
||||
@@ -108,6 +121,15 @@ const selectionChangHandle = (objs: { id: string }[]) => {
|
||||
multiple.value = !objs.length
|
||||
}
|
||||
|
||||
// 清空搜索条件
|
||||
const resetQuery = () => {
|
||||
// 清空搜索条件
|
||||
queryRef.value?.resetFields()
|
||||
// 清空多选
|
||||
selectObjs.value = []
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 新增
|
||||
const doAdd = () => {
|
||||
WalletRuleFormDialogRef.value.openDialog(null, state.queryForm.sourceWalletTypeId)
|
||||
@@ -124,6 +146,16 @@ const statusChange = async (row: any) => {
|
||||
}
|
||||
}
|
||||
|
||||
const isReservePriceChange = async (row: any) => {
|
||||
try {
|
||||
await walletRuleJoinApi.putObj(row)
|
||||
getDataList()
|
||||
useMessage().success("操作成功")
|
||||
} catch (e) {
|
||||
useMessage().error("操作错误")
|
||||
}
|
||||
}
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = async (ids: string[]) => {
|
||||
try {
|
||||
|
||||
@@ -3,39 +3,22 @@
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()" v-auth="'wallet_walletType_add'">
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()"
|
||||
v-auth="'wallet_walletType_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button
|
||||
plain
|
||||
:disabled="multiple"
|
||||
icon="Delete"
|
||||
type="primary"
|
||||
v-auth="'wallet_walletType_del'"
|
||||
@click="handleDelete(selectObjs)"
|
||||
>
|
||||
<el-button plain :disabled="multiple" icon="Delete" type="primary" v-auth="'wallet_walletType_del'"
|
||||
@click="handleDelete(selectObjs)">
|
||||
删除
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
:search="false"
|
||||
v-model:showSearch="showSearch"
|
||||
:export="'wallet_walletType_export'"
|
||||
@exportExcel="exportExcel"
|
||||
class="ml10 mr20"
|
||||
style="float: right"
|
||||
@queryTable="getDataList"
|
||||
></right-toolbar>
|
||||
<right-toolbar :search="false" v-model:showSearch="showSearch" :export="'wallet_walletType_export'"
|
||||
@exportExcel="exportExcel" class="ml10 mr20" style="float: right"
|
||||
@queryTable="getDataList"></right-toolbar>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-table
|
||||
:data="state.dataList"
|
||||
v-loading="state.loading"
|
||||
border
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
@selection-change="selectionChangHandle"
|
||||
@sort-change="sortChangeHandle"
|
||||
>
|
||||
<el-table :data="state.dataList" v-loading="state.loading" border :cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle" @selection-change="selectionChangHandle"
|
||||
@sort-change="sortChangeHandle">
|
||||
<el-table-column type="selection" width="40" align="center" />
|
||||
<el-table-column type="index" label="#" width="40" />
|
||||
<el-table-column prop="icon" label="钱包图标" show-overflow-tooltip>
|
||||
@@ -51,39 +34,32 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="isRule" label="是否启用钱包规则" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<el-switch
|
||||
:disabled="!useUserInfo().userInfos.roleCodes.includes('ROLE_ADMIN')"
|
||||
active-value="1"
|
||||
inactive-value="0"
|
||||
v-model="row.isRule"
|
||||
@change="isRuleChange(row)"
|
||||
/>
|
||||
<el-switch :disabled="!useUserInfo().userInfos.roleCodes.includes('ROLE_ADMIN')"
|
||||
active-value="1" inactive-value="0" v-model="row.isRule" @change="isRuleChange(row)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-auths="['wallet_walletType_edit', 'wallet_walletType_del']" label="操作" width="250">
|
||||
<template #default="{ row }">
|
||||
<div class="flex items-start">
|
||||
<el-button
|
||||
v-if="row.isRule == 1"
|
||||
icon="InfoFilled"
|
||||
text
|
||||
type="primary"
|
||||
<el-button v-if="row.isRule == 1" icon="InfoFilled" text type="primary"
|
||||
v-auth="'wallet_walletManage_edit'"
|
||||
@click="WalletRuleTableDialogRef.openDialog(row.id)"
|
||||
>
|
||||
@click="WalletRuleTableDialogRef.openDialog(row.id)">
|
||||
钱包规则
|
||||
</el-button>
|
||||
<el-button icon="edit-pen" text type="primary" v-auth="'wallet_walletType_edit'" @click="formDialogRef.openDialog(row.id)">
|
||||
<el-button icon="edit-pen" text type="primary" v-auth="'wallet_walletType_edit'"
|
||||
@click="formDialogRef.openDialog(row.id)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button icon="delete" text type="primary" v-auth="'wallet_walletType_del'" @click="handleDelete([row.id])">
|
||||
<el-button icon="delete" text type="primary" v-auth="'wallet_walletType_del'"
|
||||
@click="handleDelete([row.id])">
|
||||
删除
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle"
|
||||
v-bind="state.pagination" />
|
||||
</div>
|
||||
|
||||
<!-- 编辑、新增 -->
|
||||
|
||||
Reference in new issue
Block a user