Merge branch 'master' of http://gitea.zianxin.com/zianxin-tec/biz-pc-cloud
This commit is contained in:
commit
a7a910b2f3
18 files changed
+847
-68
No files matched your search
Vendored
+41
@@ -0,0 +1,41 @@
|
|||||||
|
import request from "/@/utils/request"
|
||||||
|
|
||||||
|
export function fetchList(query?: Object) {
|
||||||
|
return request({
|
||||||
|
url: '/thirdparty/thirdPartyLog/page',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function addObj(obj?: Object) {
|
||||||
|
return request({
|
||||||
|
url: '/thirdparty/thirdPartyLog',
|
||||||
|
method: 'post',
|
||||||
|
data: obj
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getObj(id?: string) {
|
||||||
|
return request({
|
||||||
|
url: '/thirdparty/thirdPartyLog/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function delObjs(ids?: Object) {
|
||||||
|
return request({
|
||||||
|
url: '/thirdparty/thirdPartyLog',
|
||||||
|
method: 'delete',
|
||||||
|
data: ids
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function putObj(obj?: Object) {
|
||||||
|
return request({
|
||||||
|
url: '/thirdparty/thirdPartyLog',
|
||||||
|
method: 'put',
|
||||||
|
data: obj
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
@@ -47,6 +47,13 @@ export function getObj(id?: string) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getObjDetails(id?: string) {
|
||||||
|
return request({
|
||||||
|
url: "/wallet/wallet-manage/join/" + id,
|
||||||
|
method: "get",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export function delObjs(ids?: Object) {
|
export function delObjs(ids?: Object) {
|
||||||
return request({
|
return request({
|
||||||
url: "/wallet/wallet-manage",
|
url: "/wallet/wallet-manage",
|
||||||
|
|||||||
@@ -31,6 +31,14 @@ export function getObj(id?: string) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function userConfig(query?: Object) {
|
||||||
|
return request({
|
||||||
|
url: "/wallet/wallet-rule-join/user-config",
|
||||||
|
method: "get",
|
||||||
|
params: query,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export function getJoinDetail(id?: string) {
|
export function getJoinDetail(id?: string) {
|
||||||
return request({
|
return request({
|
||||||
url: "/wallet/wallet-rule-join/join-detail/" + id,
|
url: "/wallet/wallet-rule-join/join-detail/" + id,
|
||||||
|
|||||||
@@ -35,11 +35,13 @@ const props = withDefaults(
|
|||||||
defineProps<{
|
defineProps<{
|
||||||
placeholder?: string
|
placeholder?: string
|
||||||
apiParams?: any
|
apiParams?: any
|
||||||
|
autoFirst?: boolean
|
||||||
disabled?: boolean
|
disabled?: boolean
|
||||||
}>(),
|
}>(),
|
||||||
{
|
{
|
||||||
placeholder: "请选择",
|
placeholder: "请选择",
|
||||||
apiParams: {},
|
apiParams: {},
|
||||||
|
autoFirst: false,
|
||||||
disabled: false,
|
disabled: false,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
@@ -75,6 +77,9 @@ async function getOptions() {
|
|||||||
}
|
}
|
||||||
const { data } = await mchApi.select(_pa)
|
const { data } = await mchApi.select(_pa)
|
||||||
state.options = data.records ?? []
|
state.options = data.records ?? []
|
||||||
|
if (props.autoFirst && state.options.length != 0) {
|
||||||
|
state.selectId = state.options[0].id
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
setTimeout(() => (state.loading = false), 500)
|
setTimeout(() => (state.loading = false), 500)
|
||||||
}
|
}
|
||||||
@@ -91,4 +96,8 @@ function clear() {
|
|||||||
state.selectId = null
|
state.selectId = null
|
||||||
getOptions()
|
getOptions()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
props.autoFirst && getOptions()
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
v-model="state.selectId"
|
v-model="state.selectId"
|
||||||
:placeholder="props.placeholder"
|
:placeholder="props.placeholder"
|
||||||
clearable
|
:clearable="props.clearable"
|
||||||
remote-show-suffix
|
remote-show-suffix
|
||||||
filterable
|
filterable
|
||||||
remote
|
remote
|
||||||
@@ -11,6 +11,7 @@
|
|||||||
:remote-method="remoteSearch"
|
:remote-method="remoteSearch"
|
||||||
:loading="state.loading"
|
:loading="state.loading"
|
||||||
@visible-change="(e: boolean) => e && getOptions()"
|
@visible-change="(e: boolean) => e && getOptions()"
|
||||||
|
@change="change"
|
||||||
>
|
>
|
||||||
<el-option v-for="v in state.options" :key="v.id" :label="`${v.name}`" :value="v.id">
|
<el-option v-for="v in state.options" :key="v.id" :label="`${v.name}`" :value="v.id">
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
@@ -30,16 +31,24 @@ import { reactive } from "vue"
|
|||||||
import { useDict } from "/@/hooks/dict"
|
import { useDict } from "/@/hooks/dict"
|
||||||
import { getWalletTypeSimple } from "/@/api/wallet/wallet-type"
|
import { getWalletTypeSimple } from "/@/api/wallet/wallet-type"
|
||||||
|
|
||||||
|
const emit = defineEmits(["change"])
|
||||||
|
|
||||||
const selectId = defineModel()
|
const selectId = defineModel()
|
||||||
|
|
||||||
const props = withDefaults(
|
const props = withDefaults(
|
||||||
defineProps<{
|
defineProps<{
|
||||||
placeholder?: string
|
placeholder?: string
|
||||||
disabled?: boolean
|
disabled?: boolean
|
||||||
|
clearable?: boolean
|
||||||
|
autoFirst?: boolean
|
||||||
|
apiParams?: any
|
||||||
}>(),
|
}>(),
|
||||||
{
|
{
|
||||||
placeholder: "请选择",
|
placeholder: "请选择",
|
||||||
disabled: false,
|
disabled: false,
|
||||||
|
clearable: true,
|
||||||
|
autoFirst: false,
|
||||||
|
apiParams: {},
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -59,6 +68,8 @@ const state = reactive<any>({
|
|||||||
watch(
|
watch(
|
||||||
selectId,
|
selectId,
|
||||||
(newVal, oldValue) => {
|
(newVal, oldValue) => {
|
||||||
|
console.log(newVal, "newVal")
|
||||||
|
|
||||||
if (newVal == oldValue) return
|
if (newVal == oldValue) return
|
||||||
state.selectId = newVal
|
state.selectId = newVal
|
||||||
getOptions()
|
getOptions()
|
||||||
@@ -71,10 +82,14 @@ async function getOptions() {
|
|||||||
state.loading = true
|
state.loading = true
|
||||||
const _pa = {
|
const _pa = {
|
||||||
...queryForm,
|
...queryForm,
|
||||||
|
...props.apiParams,
|
||||||
}
|
}
|
||||||
const { data } = await getWalletTypeSimple(_pa)
|
const { data } = await getWalletTypeSimple(_pa)
|
||||||
state.options = data.records ?? []
|
state.options = data.records ?? []
|
||||||
|
if (props.autoFirst && state.options.length != 0) {
|
||||||
|
state.selectId = state.options[0].id
|
||||||
|
emit("change", state.selectId)
|
||||||
|
}
|
||||||
const { wallet_type } = useDict("wallet_type")
|
const { wallet_type } = useDict("wallet_type")
|
||||||
state.walletType = wallet_type
|
state.walletType = wallet_type
|
||||||
} finally {
|
} finally {
|
||||||
@@ -93,4 +108,12 @@ function clear() {
|
|||||||
state.selectId = null
|
state.selectId = null
|
||||||
getOptions()
|
getOptions()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function change() {
|
||||||
|
emit("change", selectId)
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
props.autoFirst && getOptions()
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
@@ -0,0 +1,159 @@
|
|||||||
|
<template>
|
||||||
|
<div class="el-tree-select">
|
||||||
|
<el-tree-select
|
||||||
|
v-model="state.selectIdList"
|
||||||
|
id="tree-option"
|
||||||
|
ref="selectTree"
|
||||||
|
:accordion="true"
|
||||||
|
:data="state.options"
|
||||||
|
:props="state.objMap"
|
||||||
|
:node-key="state.objMap.value"
|
||||||
|
:expand-on-click-node="true"
|
||||||
|
:default-expanded-keys="defaultExpandedKey"
|
||||||
|
:filter-node-method="filterNode"
|
||||||
|
@node-click="handleNodeClick"
|
||||||
|
@check="handleCheck"
|
||||||
|
@visible-change="(e) => e && getOptions()"
|
||||||
|
clearable
|
||||||
|
highlight-current
|
||||||
|
default-expand-all
|
||||||
|
show-checkbox
|
||||||
|
collapse-tags
|
||||||
|
multiple
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup name="TreeMultipleSelect">
|
||||||
|
import { deptTree } from "/@/api/admin/dept"
|
||||||
|
const { proxy } = getCurrentInstance()
|
||||||
|
|
||||||
|
const selectIdList = defineModel()
|
||||||
|
|
||||||
|
const state = reactive({
|
||||||
|
objMap: {
|
||||||
|
value: "id",
|
||||||
|
label: "name",
|
||||||
|
children: "children",
|
||||||
|
},
|
||||||
|
selectIdList: selectIdList,
|
||||||
|
loading: false,
|
||||||
|
options: [],
|
||||||
|
checkedTreeNodes: [],
|
||||||
|
})
|
||||||
|
|
||||||
|
watch(
|
||||||
|
selectIdList,
|
||||||
|
(newVal, oldValue) => {
|
||||||
|
if (newVal == oldValue) return
|
||||||
|
state.selectIdList = newVal
|
||||||
|
getOptions()
|
||||||
|
},
|
||||||
|
{ immediate: true },
|
||||||
|
)
|
||||||
|
|
||||||
|
const emit = defineEmits(["update:value"])
|
||||||
|
|
||||||
|
const valueTitle = ref("")
|
||||||
|
const defaultExpandedKey = ref([])
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化下拉菜单选择器的默认值,并设置默认选中和默认展开。
|
||||||
|
*/
|
||||||
|
function initHandle() {
|
||||||
|
nextTick(() => {
|
||||||
|
const selectedValue = selectIdList.value
|
||||||
|
if (selectedValue !== null && typeof selectedValue !== "undefined") {
|
||||||
|
const node = proxy.$refs.selectTree.getNode(selectedValue)
|
||||||
|
if (node) {
|
||||||
|
valueTitle.value = node.data[state.objMap.label]
|
||||||
|
proxy.$refs.selectTree.setCurrentKey(selectedValue) // 设置默认选中
|
||||||
|
defaultExpandedKey.value = [selectedValue] // 设置默认展开
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
clearHandle()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点击某一节点时触发的事件,更新当前的选中值和展开状态。
|
||||||
|
* @param {Object} node - 被点击的节点对象
|
||||||
|
*/
|
||||||
|
function handleNodeClick(node) {
|
||||||
|
valueTitle.value = node[state.objMap.label]
|
||||||
|
selectIdList.value = node[state.objMap.value]
|
||||||
|
defaultExpandedKey.value = []
|
||||||
|
proxy.$refs.treeSelect.blur()
|
||||||
|
selectFilterData("")
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 勾选树节点时
|
||||||
|
*/
|
||||||
|
const handleCheck = (data, checkStatus) => {
|
||||||
|
const { checkedNodes } = checkStatus
|
||||||
|
state.checkedTreeNodes = checkedNodes
|
||||||
|
if (state.checkedTreeNodes.length > 0) {
|
||||||
|
state.switch = false
|
||||||
|
}
|
||||||
|
let deptIds = []
|
||||||
|
if (state.checkedTreeNodes && state.checkedTreeNodes.length) {
|
||||||
|
deptIds = state.checkedTreeNodes.map((v) => v[state.objMap.value])
|
||||||
|
}
|
||||||
|
state.selectIdList = deptIds
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 搜索过滤函数,根据输入的值来过滤显示的节点。
|
||||||
|
* @param {String} val - 输入框内的搜索关键字
|
||||||
|
*/
|
||||||
|
function selectFilterData(val) {
|
||||||
|
proxy.$refs.selectTree.filter(val)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据输入的值来判断节点是否需要显示。
|
||||||
|
* @param {String} value - 输入框内的搜索关键字
|
||||||
|
* @param {Object} data - 当前处理的节点数据
|
||||||
|
* @returns {Boolean} - 是否需要显示此节点
|
||||||
|
*/
|
||||||
|
function filterNode(value, data) {
|
||||||
|
if (!value) return true
|
||||||
|
return data[state.objMap["label"]].indexOf(value) !== -1
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 清空当前的选中状态,并重置展开状态。
|
||||||
|
*/
|
||||||
|
function clearHandle() {
|
||||||
|
valueTitle.value = ""
|
||||||
|
valueId.value = ""
|
||||||
|
defaultExpandedKey.value = []
|
||||||
|
clearSelected()
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 删除所有选中状态的节点。
|
||||||
|
*/
|
||||||
|
function clearSelected() {
|
||||||
|
const allNode = document.querySelectorAll("#tree-option .el-tree-node")
|
||||||
|
allNode.forEach((element) => element.classList.remove("is-current"))
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取数据
|
||||||
|
*/
|
||||||
|
async function getOptions() {
|
||||||
|
try {
|
||||||
|
state.loading = true
|
||||||
|
const _pa = {}
|
||||||
|
const { data } = await deptTree(_pa)
|
||||||
|
state.options = data
|
||||||
|
} finally {
|
||||||
|
setTimeout(() => (state.loading = false), 500)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import "/@/assets/styles/variables.module.scss";
|
||||||
|
</style>
|
||||||
@@ -25,6 +25,7 @@ import SelectHardGroup from "/@/components/Select/selectHardGroup.vue"
|
|||||||
import SelectHandlerUser from "/@/components/Select/SelectHandlerUser.vue"
|
import SelectHandlerUser from "/@/components/Select/SelectHandlerUser.vue"
|
||||||
import SelectSupplier from "/@/components/Select/SelectSupplier.vue"
|
import SelectSupplier from "/@/components/Select/SelectSupplier.vue"
|
||||||
import SelectMchRule from "/@/components/Select/SelectMchRule.vue"
|
import SelectMchRule from "/@/components/Select/SelectMchRule.vue"
|
||||||
|
import TreeMultipleSelect from "/@/components/TreeMultipleSelect/index.vue"
|
||||||
|
|
||||||
// 第三方组件
|
// 第三方组件
|
||||||
import ElementPlus from "element-plus"
|
import ElementPlus from "element-plus"
|
||||||
@@ -61,6 +62,7 @@ export default {
|
|||||||
app.component("SvgIcon", SvgIcon)
|
app.component("SvgIcon", SvgIcon)
|
||||||
app.component("PreviewImage", PreviewImage)
|
app.component("PreviewImage", PreviewImage)
|
||||||
app.component("DraggableDepTree", DraggableDepTree)
|
app.component("DraggableDepTree", DraggableDepTree)
|
||||||
|
app.component("TreeMultipleSelect", TreeMultipleSelect)
|
||||||
|
|
||||||
app.component("SelectUser", SelectUser)
|
app.component("SelectUser", SelectUser)
|
||||||
app.component("SelectWalletType", SelectWalletType)
|
app.component("SelectWalletType", SelectWalletType)
|
||||||
|
|||||||
@@ -69,7 +69,7 @@
|
|||||||
<dict-tag :options="spu_status" :value="scope.row.status" />
|
<dict-tag :options="spu_status" :value="scope.row.status" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="isShow" label="是否在移动端显示 " show-overflow-tooltip>
|
<el-table-column prop="isShow" label="是否在移动端显示" show-overflow-tooltip>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :options="is_show" :value="scope.row.isShow"></dict-tag>
|
<dict-tag :options="is_show" :value="scope.row.isShow"></dict-tag>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24" class="mb20">
|
<el-col :span="24" class="mb20">
|
||||||
<el-form-item label="目标商户" prop="targetMchId">
|
<el-form-item label="目标商户" prop="targetMchId">
|
||||||
<select-mch v-model="form.targetMchId" :apiParams="{ types: '1' }" />
|
<select-mch v-model="form.targetMchId" autoFirst :apiParams="{ types: '1', notIds: [form.sourceMchId] }" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24" class="mb20">
|
<el-col :span="24" class="mb20">
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog width="50%" v-model="visible" :close-on-click-modal="false" @closed="dialogClosed" draggable>
|
<el-dialog width="70%" v-model="visible" :close-on-click-modal="false" @closed="dialogClosed" draggable>
|
||||||
<div>
|
<div>
|
||||||
<el-tabs v-model="form.activeTab" class="demo-tabs">
|
<el-tabs v-model="form.activeTab" class="demo-tabs">
|
||||||
<div v-for="v in data.tabList" :key="v.id">
|
<div v-for="v in data.tabList" :key="v.id">
|
||||||
|
|||||||
+139
@@ -0,0 +1,139 @@
|
|||||||
|
<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-row :gutter="24">
|
||||||
|
<el-col :span="12" class="mb20">
|
||||||
|
<el-form-item label="接口名称" prop="apiName">
|
||||||
|
<el-input v-model="form.apiName" placeholder="请输入接口名称"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="12" class="mb20">
|
||||||
|
<el-form-item label="是否删除" prop="deleted">
|
||||||
|
<el-input v-model="form.deleted" placeholder="请输入是否删除"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="12" class="mb20">
|
||||||
|
<el-form-item label="请求路径" prop="requestUrl">
|
||||||
|
<el-input v-model="form.requestUrl" placeholder="请输入请求路径"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="12" class="mb20">
|
||||||
|
<el-form-item label="状态码" prop="httpStatus">
|
||||||
|
<el-input v-model="form.httpStatus" placeholder="请输入状态码"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="12" class="mb20">
|
||||||
|
<el-form-item label="原始响应" prop="responseBody">
|
||||||
|
<editor v-if="visible" v-model:get-html="form.responseBody" placeholder="请输入原始响应"></editor>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="12" class="mb20">
|
||||||
|
<el-form-item label="错误码(如-1)" prop="errorCode">
|
||||||
|
<el-input v-model="form.errorCode" placeholder="请输入错误码(如-1)"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="12" class="mb20">
|
||||||
|
<el-form-item label="错误描述" prop="errorMsg">
|
||||||
|
<el-input type="textarea" v-model="form.errorMsg" placeholder="请输入错误描述"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<el-button @click="visible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="onSubmit" :disabled="loading">确认</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts" name="ThirdPartyLogDialog">
|
||||||
|
import { useDict } from '/src/hooks/dict';
|
||||||
|
import { useMessage } from "/src/hooks/message";
|
||||||
|
import { getObj, addObj, putObj } from '/src/api/thirdparty/thirdPartyLog'
|
||||||
|
import { rule } from '/src/utils/validate';
|
||||||
|
const emit = defineEmits(['refresh']);
|
||||||
|
|
||||||
|
// 定义变量内容
|
||||||
|
const dataFormRef = ref();
|
||||||
|
const visible = ref(false)
|
||||||
|
const loading = ref(false)
|
||||||
|
// 定义字典
|
||||||
|
|
||||||
|
// 提交表单数据
|
||||||
|
const form = reactive({
|
||||||
|
id:'',
|
||||||
|
apiName: '',
|
||||||
|
deleted: '',
|
||||||
|
requestUrl: '',
|
||||||
|
httpStatus: '',
|
||||||
|
responseBody: '',
|
||||||
|
errorCode: '',
|
||||||
|
errorMsg: '',
|
||||||
|
});
|
||||||
|
|
||||||
|
// 定义校验规则
|
||||||
|
const dataRules = ref({
|
||||||
|
})
|
||||||
|
|
||||||
|
// 打开弹窗
|
||||||
|
const openDialog = (id: string) => {
|
||||||
|
visible.value = true
|
||||||
|
form.id = ''
|
||||||
|
|
||||||
|
// 重置表单数据
|
||||||
|
nextTick(() => {
|
||||||
|
dataFormRef.value?.resetFields();
|
||||||
|
});
|
||||||
|
|
||||||
|
// 获取thirdPartyLog信息
|
||||||
|
if (id) {
|
||||||
|
form.id = id
|
||||||
|
getthirdPartyLogData(id)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 提交
|
||||||
|
const onSubmit = async () => {
|
||||||
|
const valid = await dataFormRef.value.validate().catch(() => {});
|
||||||
|
if (!valid) return false;
|
||||||
|
|
||||||
|
try {
|
||||||
|
loading.value = true;
|
||||||
|
form.id ? await putObj(form) : await addObj(form);
|
||||||
|
useMessage().success(form.id ? '修改成功' : '添加成功');
|
||||||
|
visible.value = false;
|
||||||
|
emit('refresh');
|
||||||
|
} catch (err: any) {
|
||||||
|
useMessage().error(err.msg);
|
||||||
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// 初始化表单数据
|
||||||
|
const getthirdPartyLogData = (id: string) => {
|
||||||
|
// 获取数据
|
||||||
|
loading.value = true
|
||||||
|
getObj(id).then((res: any) => {
|
||||||
|
Object.assign(form, res.data)
|
||||||
|
}).finally(() => {
|
||||||
|
loading.value = false
|
||||||
|
})
|
||||||
|
};
|
||||||
|
|
||||||
|
// 暴露变量
|
||||||
|
defineExpose({
|
||||||
|
openDialog
|
||||||
|
});
|
||||||
|
</script>
|
||||||
+117
@@ -0,0 +1,117 @@
|
|||||||
|
<template>
|
||||||
|
<div class="layout-padding">
|
||||||
|
<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="'thirdparty_thirdPartyLog_add'">
|
||||||
|
新 增
|
||||||
|
</el-button>
|
||||||
|
<el-button plain :disabled="multiple" icon="Delete" type="primary"
|
||||||
|
v-auth="'thirdparty_thirdPartyLog_del'" @click="handleDelete(selectObjs)">
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
<right-toolbar v-model:showSearch="showSearch" :export="'thirdparty_thirdPartyLog_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-column type="selection" width="40" align="center" />
|
||||||
|
<el-table-column type="index" label="#" width="40" />
|
||||||
|
<el-table-column prop="apiName" label="接口名称" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="deleted" label="是否删除" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="requestUrl" label="请求路径" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="httpStatus" label="状态码" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="errorCode" label="错误码(如-1)" show-overflow-tooltip/>
|
||||||
|
<el-table-column label="操作" width="150">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button icon="edit-pen" text type="primary" v-auth="'thirdparty_thirdPartyLog_edit'"
|
||||||
|
@click="formDialogRef.openDialog(scope.row.id)">编辑</el-button>
|
||||||
|
<el-button icon="delete" text type="primary" v-auth="'thirdparty_thirdPartyLog_del'" @click="handleDelete([scope.row.id])">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 编辑、新增 -->
|
||||||
|
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts" name="systemThirdPartyLog">
|
||||||
|
import { BasicTableProps, useTable } from "/src/hooks/table";
|
||||||
|
import { fetchList, delObjs } from "/src/api/thirdparty/thirdPartyLog";
|
||||||
|
import { useMessage, useMessageBox } from "/src/hooks/message";
|
||||||
|
import { useDict } from '/src/hooks/dict';
|
||||||
|
|
||||||
|
// 引入组件
|
||||||
|
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
||||||
|
// 定义查询字典
|
||||||
|
|
||||||
|
// 定义变量内容
|
||||||
|
const formDialogRef = ref()
|
||||||
|
// 搜索变量
|
||||||
|
const queryRef = ref()
|
||||||
|
const showSearch = ref(true)
|
||||||
|
// 多选变量
|
||||||
|
const selectObjs = ref([]) as any
|
||||||
|
const multiple = ref(true)
|
||||||
|
|
||||||
|
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||||
|
queryForm: {},
|
||||||
|
pageList: fetchList
|
||||||
|
})
|
||||||
|
|
||||||
|
// table hook
|
||||||
|
const {
|
||||||
|
getDataList,
|
||||||
|
currentChangeHandle,
|
||||||
|
sizeChangeHandle,
|
||||||
|
sortChangeHandle,
|
||||||
|
downBlobFile,
|
||||||
|
tableStyle
|
||||||
|
} = useTable(state)
|
||||||
|
|
||||||
|
// 清空搜索条件
|
||||||
|
const resetQuery = () => {
|
||||||
|
// 清空搜索条件
|
||||||
|
queryRef.value?.resetFields()
|
||||||
|
// 清空多选
|
||||||
|
selectObjs.value = []
|
||||||
|
getDataList()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出excel
|
||||||
|
const exportExcel = () => {
|
||||||
|
downBlobFile('/thirdparty/thirdPartyLog/export', Object.assign(state.queryForm, { ids: selectObjs }), 'thirdPartyLog.xlsx')
|
||||||
|
}
|
||||||
|
|
||||||
|
// 多选事件
|
||||||
|
const selectionChangHandle = (objs: { id: string }[]) => {
|
||||||
|
selectObjs.value = objs.map(({ id }) => id);
|
||||||
|
multiple.value = !objs.length;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 删除操作
|
||||||
|
const handleDelete = async (ids: string[]) => {
|
||||||
|
try {
|
||||||
|
await useMessageBox().confirm('此操作将永久删除');
|
||||||
|
} catch {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
await delObjs(ids);
|
||||||
|
getDataList();
|
||||||
|
useMessage().success('删除成功');
|
||||||
|
} catch (err: any) {
|
||||||
|
useMessage().error(err.msg);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@@ -1,16 +1,18 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="size-full flex justify-start">
|
<div class="size-full flex justify-start">
|
||||||
<div class="size-full text-start">
|
<div class="size-full text-start">
|
||||||
|
<span class="color-primary">{{ detail.deptName ? detail.deptName : "???" }}</span>
|
||||||
|
<span>部门的用户将余额从</span>
|
||||||
<span class="color-primary">{{ detail.sourceName ? detail.sourceName : "???" }}</span>
|
<span class="color-primary">{{ detail.sourceName ? detail.sourceName : "???" }}</span>
|
||||||
<span>转到</span>
|
<span>转到</span>
|
||||||
<span class="color-primary">{{ detail.targetName ? detail.targetName : "???" }}</span>
|
<span class="color-primary">{{ detail.targetName ? detail.targetName : "???" }}</span>
|
||||||
<span>百分比为</span>
|
<span>百分比为</span>
|
||||||
<span class="color-danger">{{ detail.balanceMultiple ? detail.balanceMultiple : "???" }}%</span>
|
<span class="color-danger">{{ detail.balanceMultiple ? detail.balanceMultiple : "???" }}%</span>
|
||||||
<span>,如100元从</span>
|
<span>,如</span>
|
||||||
<span class="color-primary">{{ detail.sourceName ? detail.sourceName : "???" }}</span>
|
<span class="color-primary">100元</span>
|
||||||
<span>转到</span>
|
<span>总余额可转到</span>
|
||||||
<span class="color-primary">{{ detail.targetName ? detail.targetName : "???" }}</span>
|
<span class="color-primary">{{ detail.targetName ? detail.targetName : "???" }}</span>
|
||||||
<span>为{{ (100 * detail.balanceMultiple) / 100 }}元</span>
|
<span class="color-success">{{ detail.targetName ? displayPrice(100 * detail.balanceMultiple) : "???元" }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -108,26 +108,38 @@
|
|||||||
<el-table-column
|
<el-table-column
|
||||||
label="操作"
|
label="操作"
|
||||||
fixed="right"
|
fixed="right"
|
||||||
width="200"
|
width="250"
|
||||||
v-auths="['wallet_walletManage_edit', 'wallet_walletTransaction_update_balance']"
|
v-auths="['wallet_walletManage_edit', 'wallet_walletTransaction_update_balance']"
|
||||||
>
|
>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-button
|
<div class="flex items-start">
|
||||||
icon="InfoFilled"
|
<el-button
|
||||||
text
|
icon="InfoFilled"
|
||||||
type="primary"
|
text
|
||||||
v-auth="'wallet_walletManage_edit'"
|
type="primary"
|
||||||
@click="formDialogRef.openDialog(row.id)"
|
v-auth="'wallet_walletManage_edit'"
|
||||||
>详情</el-button
|
@click="formDialogRef.openDialog(row.id)"
|
||||||
>
|
>详情</el-button
|
||||||
<el-button
|
>
|
||||||
icon="Money"
|
<el-button
|
||||||
text
|
icon="Money"
|
||||||
type="primary"
|
text
|
||||||
v-auth="'wallet_walletTransaction_update_balance'"
|
type="primary"
|
||||||
@click="changeBalanceRef.openDialog(row.userId, row.id)"
|
v-auth="'wallet_walletTransaction_update_balance'"
|
||||||
>充值/扣款</el-button
|
@click="changeBalanceRef.openDialog(row.userId, row.id)"
|
||||||
>
|
>充值/扣款</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
v-if="row.isRule == 1"
|
||||||
|
icon="SwitchFilled"
|
||||||
|
text
|
||||||
|
type="primary"
|
||||||
|
v-auth="'wallet_walletTransaction_update_balance'"
|
||||||
|
@click="doTransferAccounts(row)"
|
||||||
|
>
|
||||||
|
转账
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -137,12 +149,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<transaction-list ref="formDialogRef" @refresh="getDataList(false)" />
|
<transaction-list ref="formDialogRef" @refresh="getDataList(false)" />
|
||||||
<change-balance ref="changeBalanceRef" @refresh="getDataList(false)" />
|
<change-balance ref="changeBalanceRef" @refresh="getDataList(false)" />
|
||||||
|
<transfer-accounts ref="transferAccountsRef" @refresh="getDataList(false)" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts" name="systemWalletManage">
|
<script setup lang="ts" name="systemWalletManage">
|
||||||
import { BasicTableProps, useTable } from "/@/hooks/table"
|
import { BasicTableProps, useTable } from "/@/hooks/table"
|
||||||
import { fetchList, fetchListJoin, delObjs } from "/@/api/wallet/wallet-manage"
|
import * as walletManage from "/@/api/wallet/wallet-manage"
|
||||||
import { useMessage, useMessageBox } from "/@/hooks/message"
|
import { useMessage, useMessageBox } from "/@/hooks/message"
|
||||||
import { useDict } from "/@/hooks/dict"
|
import { useDict } from "/@/hooks/dict"
|
||||||
import { displayPrice } from "/@/utils/formatMoney"
|
import { displayPrice } from "/@/utils/formatMoney"
|
||||||
@@ -150,22 +163,23 @@ import { displayPrice } from "/@/utils/formatMoney"
|
|||||||
// 引入组件
|
// 引入组件
|
||||||
const TransactionList = defineAsyncComponent(() => import("../components/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 TransferAccounts = defineAsyncComponent(() => import("./transfer-accounts.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")
|
||||||
// 定义变量内容
|
// 定义变量内容
|
||||||
const formDialogRef = ref()
|
const formDialogRef = ref()
|
||||||
const changeBalanceRef = ref()
|
const changeBalanceRef = ref()
|
||||||
const draggableDepTreeRef = ref()
|
const draggableDepTreeRef = ref()
|
||||||
|
const transferAccountsRef = ref()
|
||||||
// 搜索变量
|
// 搜索变量
|
||||||
const queryRef = ref()
|
const queryRef = ref()
|
||||||
const showSearch = ref(true)
|
const showSearch = ref(true)
|
||||||
// 多选变量
|
// 多选变量
|
||||||
const selectObjs = ref([]) as any
|
const selectObjs = ref([]) as any
|
||||||
const multiple = ref(true)
|
const multiple = ref(true)
|
||||||
|
|
||||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||||
queryForm: {},
|
queryForm: {},
|
||||||
pageList: fetchListJoin,
|
pageList: walletManage.fetchListJoin,
|
||||||
})
|
})
|
||||||
|
|
||||||
// table hook
|
// table hook
|
||||||
@@ -192,6 +206,12 @@ const exportExcel = () => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 转账
|
||||||
|
const doTransferAccounts = (row: any) => {
|
||||||
|
// 检查配置是否正确
|
||||||
|
transferAccountsRef.value.openDialog(row.userId, row.id)
|
||||||
|
}
|
||||||
|
|
||||||
const getSummaries = (param: any) => {
|
const getSummaries = (param: any) => {
|
||||||
const { columns, data } = param
|
const { columns, data } = param
|
||||||
const totalColumns = ["balance", "totalExpense", "totalRecharge"]
|
const totalColumns = ["balance", "totalExpense", "totalRecharge"]
|
||||||
@@ -231,7 +251,7 @@ const handleDelete = async (ids: string[]) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await delObjs(ids)
|
await walletManage.delObjs(ids)
|
||||||
getDataList()
|
getDataList()
|
||||||
useMessage().success("删除成功")
|
useMessage().success("删除成功")
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
|
|||||||
@@ -0,0 +1,223 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog title="转账" v-model="visible" width="60%" :close-on-click-modal="false" draggable>
|
||||||
|
<div>
|
||||||
|
<el-alert title="错误" type="error">
|
||||||
|
<span>{{ errorMsg }}</span>
|
||||||
|
<span>请配置</span>
|
||||||
|
</el-alert>
|
||||||
|
<div v-if="!errorMsg">
|
||||||
|
<el-descriptions :column="2" border title="用户">
|
||||||
|
<el-descriptions-item :rowspan="1" label="用户名: ">
|
||||||
|
<span>{{ userConfigDetail.username }}</span>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item :rowspan="1" label="手机号: ">
|
||||||
|
<span>{{ userConfigDetail.userMobile }}</span>
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
<el-descriptions :column="2" border title="钱包">
|
||||||
|
<el-descriptions-item :rowspan="1" label="源钱包: ">
|
||||||
|
<span class="color-primary">{{ walletDetail.walletTypeName }}</span>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item :rowspan="1" label="源余额: ">
|
||||||
|
<span class="color-success">{{ displayPrice(walletDetail.balance) }}</span>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item :rowspan="1" label="目标钱包: ">
|
||||||
|
<span class="color-primary">{{ walletDetail.username }}</span>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item :rowspan="1" label="目标余额: ">
|
||||||
|
<span class="color-success">{{ walletDetail.username }}</span>
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</div>
|
||||||
|
<div class="flex justify-start items-center mt-5">
|
||||||
|
<span>用户</span>
|
||||||
|
<span class="color-primary">{{ walletDetail.username }}</span>
|
||||||
|
<span>将</span>
|
||||||
|
<el-input-number :disabled="errorMsg" class="mx-1" style="width: 200px" :min="1" :max="200" v-model="form.balance" placeholder="" />
|
||||||
|
<span>元从</span>
|
||||||
|
<span class="color-primary">{{ walletDetail.walletTypeName }}</span>
|
||||||
|
<span>转到</span>
|
||||||
|
<select-wallet-type
|
||||||
|
class="mx-1"
|
||||||
|
:clearable="false"
|
||||||
|
:autoFirst="true"
|
||||||
|
:apiParams="{ notWalletTypeIds: walletDetail.walletTypeId }"
|
||||||
|
style="width: 200px"
|
||||||
|
v-model="form.targetWalletTypeId"
|
||||||
|
@change="selectWalletTypeChange"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<el-button @click="visible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="onSubmit" :disabled="errorMsg || loading">确认</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts" name="transferAccounts">
|
||||||
|
import { useMessage } from "/@/hooks/message"
|
||||||
|
import * as walletApi from "/@/api/wallet/wallet-manage"
|
||||||
|
import * as walletRuleJoin from "/@/api/wallet/wallet-rule-join"
|
||||||
|
import * as walletTransactionApi from "/@/api/wallet/wallet-transaction"
|
||||||
|
import { displayPrice } from "/@/utils/formatMoney"
|
||||||
|
import { convertToInteger } from "/@/utils/convert"
|
||||||
|
const emit = defineEmits(["refresh"])
|
||||||
|
|
||||||
|
// 定义变量内容
|
||||||
|
const dataFormRef = ref()
|
||||||
|
const visible = ref(false)
|
||||||
|
const loading = ref(false)
|
||||||
|
// 定义字典
|
||||||
|
|
||||||
|
// 提交表单数据
|
||||||
|
const form = reactive<any>({
|
||||||
|
id: undefined,
|
||||||
|
balance: 10,
|
||||||
|
changeType: 1,
|
||||||
|
})
|
||||||
|
|
||||||
|
const walletDetail = reactive<any>({})
|
||||||
|
|
||||||
|
const userConfigDetail = reactive<any>({})
|
||||||
|
|
||||||
|
const errorMsg = ref<string>("")
|
||||||
|
|
||||||
|
/** 变动后的余额 */
|
||||||
|
const balanceResult = computed(() => displayPrice(convertToInteger(form.balance) + convertToInteger(form.changeBalance) * form.changeType))
|
||||||
|
|
||||||
|
// 定义校验规则
|
||||||
|
const dataRules = ref({
|
||||||
|
changeBalance: [{ required: true, message: "变动余额不能为空", trigger: "blur" }],
|
||||||
|
})
|
||||||
|
|
||||||
|
// 打开弹窗
|
||||||
|
const openDialog = (userId: string, id: string) => {
|
||||||
|
visible.value = true
|
||||||
|
form.id = ""
|
||||||
|
if (id) {
|
||||||
|
form.id = id
|
||||||
|
getwalletManageData(userId, id)
|
||||||
|
}
|
||||||
|
nextTick(() => {
|
||||||
|
dataFormRef.value?.resetFields()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提交
|
||||||
|
const onSubmit = async () => {
|
||||||
|
const valid = await dataFormRef.value.validate().catch(() => {})
|
||||||
|
if (!valid) return false
|
||||||
|
if (form.changeBalance <= 0) {
|
||||||
|
useMessage().error("变动余额不能为零")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (convertToInteger(balanceResult.value) < 0) {
|
||||||
|
useMessage().error("变动后的余额不能小于 0")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
loading.value = true
|
||||||
|
const pa = {
|
||||||
|
...form,
|
||||||
|
userId: form.id,
|
||||||
|
walletId: form.walletId,
|
||||||
|
balance: form.changeBalance * 100,
|
||||||
|
}
|
||||||
|
if (pa.changeType == -1) {
|
||||||
|
pa.balance = -1 * pa.balance
|
||||||
|
}
|
||||||
|
await walletTransactionApi.updateBalance(pa)
|
||||||
|
useMessage().success("操作成功")
|
||||||
|
visible.value = false
|
||||||
|
emit("refresh")
|
||||||
|
} catch (err: any) {
|
||||||
|
useMessage().error(err.msg)
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 初始化表单数据
|
||||||
|
const getwalletManageData = async (userId: string, id: string) => {
|
||||||
|
// 获取数据
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const { data } = await walletApi.getObjDetails(id)
|
||||||
|
Object.assign(walletDetail, data)
|
||||||
|
getUserConfig(walletDetail.userId, walletDetail.walletTypeId, form.targetWalletTypeId)
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const selectWalletTypeChange = (targetWalletTypeId: any) => {
|
||||||
|
getUserConfig(walletDetail.userId, walletDetail.walletTypeId, targetWalletTypeId)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 用户配置
|
||||||
|
const getUserConfig = async (userId: any, sourceWalletId: any, targetWalletId: any) => {
|
||||||
|
if (!userId || !sourceWalletId || !targetWalletId) return
|
||||||
|
const _pa = {
|
||||||
|
userId: userId,
|
||||||
|
sourceWalletTypeId: sourceWalletId,
|
||||||
|
targetWalletTypeId: targetWalletId,
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
const { data } = await walletRuleJoin.userConfig(_pa)
|
||||||
|
if (!data) return
|
||||||
|
Object.assign(data, userConfigDetail)
|
||||||
|
} catch (e: any) {
|
||||||
|
errorMsg.value = e.msg
|
||||||
|
useMessage().error(e.msg)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
openDialog,
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
:deep(.el-descriptions) {
|
||||||
|
&:not(:nth-child(1)) {
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-descriptions__cell.is-bordered-label {
|
||||||
|
width: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-descriptions__cell.is-bordered-content {
|
||||||
|
width: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-descriptions__title {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
display: inline-block;
|
||||||
|
width: 3px;
|
||||||
|
height: 20px;
|
||||||
|
margin-right: 10px;
|
||||||
|
background-color: #409eff;
|
||||||
|
content: "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-descriptions-item__container {
|
||||||
|
margin: 0 10px;
|
||||||
|
|
||||||
|
.no-colon {
|
||||||
|
margin: 0;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
content: "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -9,7 +9,16 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24" class="mb20">
|
<el-col :span="24" class="mb20">
|
||||||
<el-form-item label="目标钱包类型" prop="targetWalletTypeId">
|
<el-form-item label="目标钱包类型" prop="targetWalletTypeId">
|
||||||
<select-wallet-type v-model="form.targetWalletTypeId" />
|
<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">
|
||||||
|
<el-form-item label="目标部门" prop="targetDeptIdList">
|
||||||
|
<tree-multiple-select style="width: 400px" v-model="form.targetDeptIdList" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24" class="mb20">
|
<el-col :span="24" class="mb20">
|
||||||
@@ -17,11 +26,6 @@
|
|||||||
<el-input-number :min="1" :max="200" v-model="form.balanceMultiple" placeholder="" />
|
<el-input-number :min="1" :max="200" v-model="form.balanceMultiple" placeholder="" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24" class="mb20">
|
|
||||||
<el-alert title="提示" type="info" :closable="false">
|
|
||||||
<wallet-rule-desc :detail="form" />
|
|
||||||
</el-alert>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
@@ -37,8 +41,6 @@
|
|||||||
import { useMessage } from "/@/hooks/message"
|
import { useMessage } from "/@/hooks/message"
|
||||||
import * as walletRuleJoinApi from "/@/api/wallet/wallet-rule-join"
|
import * as walletRuleJoinApi from "/@/api/wallet/wallet-rule-join"
|
||||||
|
|
||||||
const WalletRuleDesc = defineAsyncComponent(() => import("../../components/wallet-rule-desc.vue"))
|
|
||||||
|
|
||||||
const emit = defineEmits(["refresh"])
|
const emit = defineEmits(["refresh"])
|
||||||
|
|
||||||
// 定义变量内容
|
// 定义变量内容
|
||||||
@@ -52,6 +54,8 @@ const defaultForm = {
|
|||||||
id: "",
|
id: "",
|
||||||
sourceWalletTypeId: "",
|
sourceWalletTypeId: "",
|
||||||
targetWalletTypeId: "",
|
targetWalletTypeId: "",
|
||||||
|
targetDeptId: "",
|
||||||
|
targetDeptIdList: [],
|
||||||
balanceMultiple: 100,
|
balanceMultiple: 100,
|
||||||
status: 0,
|
status: 0,
|
||||||
}
|
}
|
||||||
@@ -61,21 +65,21 @@ const form = reactive({
|
|||||||
|
|
||||||
// 定义校验规则
|
// 定义校验规则
|
||||||
const dataRules = ref({
|
const dataRules = ref({
|
||||||
sourceWalletTypeId: [{ required: true, message: "请选择源钱包类型", trigger: "blur" }],
|
sourceWalletTypeId: [{ required: true, message: "请选择源钱包类型", trigger: "change" }],
|
||||||
targetWalletTypeId: [{ required: true, message: "请选择目标钱包类型", trigger: "blur" }],
|
targetWalletTypeId: [{ required: true, message: "请选择目标钱包类型", trigger: "change" }],
|
||||||
balanceMultiple: [{ required: true, message: "请输入钱包转换百分比", trigger: "blur" }],
|
targetDeptId: [{ required: true, message: "请选择目标部门", trigger: "change" }],
|
||||||
|
targetDeptIdList: [{ required: true, message: "请选择目标部门", trigger: "change" }],
|
||||||
|
balanceMultiple: [{ required: true, message: "请输入钱包转换百分比", trigger: "change" }],
|
||||||
})
|
})
|
||||||
|
|
||||||
// 打开弹窗
|
// 打开弹窗
|
||||||
const openDialog = (id: string, sourceWalletTypeId: string) => {
|
const openDialog = (id: string, sourceWalletTypeId: string) => {
|
||||||
visible.value = true
|
visible.value = true
|
||||||
Object.assign(form, defaultForm)
|
|
||||||
form.sourceWalletTypeId = sourceWalletTypeId
|
|
||||||
// 重置表单数据
|
// 重置表单数据
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
dataFormRef.value?.resetFields()
|
dataFormRef.value?.resetFields()
|
||||||
|
Object.assign(form, { ...defaultForm, sourceWalletTypeId: sourceWalletTypeId })
|
||||||
})
|
})
|
||||||
// 获取walletRuleJoin信息
|
|
||||||
if (id) {
|
if (id) {
|
||||||
form.id = id
|
form.id = id
|
||||||
getwalletRuleJoinData(id)
|
getwalletRuleJoinData(id)
|
||||||
@@ -86,14 +90,11 @@ const openDialog = (id: string, sourceWalletTypeId: string) => {
|
|||||||
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 { data } = form.id ? await walletRuleJoinApi.putObj(form) : await walletRuleJoinApi.addObj(form)
|
form.id ? await walletRuleJoinApi.putObj(form) : await walletRuleJoinApi.addObj(form)
|
||||||
useMessage().success(form.id ? "修改成功" : "添加成功")
|
useMessage().success(form.id ? "修改成功" : "添加成功")
|
||||||
// visible.value = false
|
visible.value = false
|
||||||
// 更新
|
|
||||||
await getwalletRuleJoinData(data)
|
|
||||||
emit("refresh")
|
emit("refresh")
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
useMessage().error(err.msg)
|
useMessage().error(err.msg)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog title="钱包规则" width="70%" v-model="visible" append-to-body :close-on-click-modal="false" draggable>
|
<el-dialog title="钱包规则" width="75%" v-model="visible" append-to-body :close-on-click-modal="false" draggable>
|
||||||
<el-row>
|
<el-row>
|
||||||
<div class="mb8" style="width: 100%">
|
<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>
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column min-width="120" label="目前钱包类型">
|
<el-table-column min-width="120" label="目标钱包类型">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<div class="flex items-center justify-center">
|
<div class="flex items-center justify-center">
|
||||||
<div class="color-primary">{{ row.targetName }}</div>
|
<div class="color-primary">{{ row.targetName }}</div>
|
||||||
@@ -36,6 +36,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</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="80" label="转换百分比">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<span class="color-success">{{ row.balanceMultiple }}%</span>
|
<span class="color-success">{{ row.balanceMultiple }}%</span>
|
||||||
@@ -58,7 +59,7 @@
|
|||||||
text
|
text
|
||||||
type="primary"
|
type="primary"
|
||||||
v-auth="'dzc_walletRuleMchConfig_edit'"
|
v-auth="'dzc_walletRuleMchConfig_edit'"
|
||||||
@click="WalletRuleFormDialogRef.openDialog(row.id, state.queryForm.sourceWalletTypeId)"
|
@click="WalletRuleFormDialogRef.openDialog(row.id, row.sourceWalletTypeId)"
|
||||||
>编辑</el-button
|
>编辑</el-button
|
||||||
>
|
>
|
||||||
<el-button icon="delete" text type="primary" v-auth="'dzc_walletRuleMchConfig_del'" @click="handleDelete([row.id])"
|
<el-button icon="delete" text type="primary" v-auth="'dzc_walletRuleMchConfig_del'" @click="handleDelete([row.id])"
|
||||||
|
|||||||
@@ -49,21 +49,37 @@
|
|||||||
<dict-tag :options="wallet_type" :value="row.uniqueCode" />
|
<dict-tag :options="wallet_type" :value="row.uniqueCode" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column prop="isRule" label="是否启用钱包规则" show-overflow-tooltip>
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-switch
|
||||||
|
v-auth="'wallet_walletManage_edit'"
|
||||||
|
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">
|
<el-table-column v-auths="['wallet_walletType_edit', 'wallet_walletType_del']" label="操作" width="250">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-button
|
<div class="flex items-start">
|
||||||
icon="InfoFilled"
|
<el-button
|
||||||
text
|
v-if="row.isRule == 1"
|
||||||
type="primary"
|
icon="InfoFilled"
|
||||||
v-auth="'wallet_walletManage_edit'"
|
text
|
||||||
@click="WalletRuleTableDialogRef.openDialog(row.id)"
|
type="primary"
|
||||||
>
|
v-auth="'wallet_walletManage_edit'"
|
||||||
钱包规则
|
@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>
|
||||||
</el-button>
|
<el-button icon="edit-pen" text type="primary" v-auth="'wallet_walletType_edit'" @click="formDialogRef.openDialog(row.id)">
|
||||||
<el-button icon="delete" text type="primary" v-auth="'wallet_walletType_del'" @click="handleDelete([row.id])"> 删除 </el-button>
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button icon="delete" text type="primary" v-auth="'wallet_walletType_del'" @click="handleDelete([row.id])">
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -78,7 +94,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts" name="systemWalletType">
|
<script setup lang="ts" name="systemWalletType">
|
||||||
import { BasicTableProps, useTable } from "/@/hooks/table"
|
import { BasicTableProps, useTable } from "/@/hooks/table"
|
||||||
import { fetchList, delObjs } from "/@/api/wallet/wallet-type"
|
import * as walletTypeApi from "/@/api/wallet/wallet-type"
|
||||||
import { useMessage, useMessageBox } from "/@/hooks/message"
|
import { useMessage, useMessageBox } from "/@/hooks/message"
|
||||||
import { useDict } from "/@/hooks/dict"
|
import { useDict } from "/@/hooks/dict"
|
||||||
|
|
||||||
@@ -99,7 +115,7 @@ const multiple = ref(true)
|
|||||||
|
|
||||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||||
queryForm: {},
|
queryForm: {},
|
||||||
pageList: fetchList,
|
pageList: walletTypeApi.fetchList,
|
||||||
})
|
})
|
||||||
|
|
||||||
// table hook
|
// table hook
|
||||||
@@ -125,6 +141,17 @@ const selectionChangHandle = (objs: { id: string }[]) => {
|
|||||||
multiple.value = !objs.length
|
multiple.value = !objs.length
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 修改是否启用钱包规则
|
||||||
|
const isRuleChange = async (row: any) => {
|
||||||
|
try {
|
||||||
|
await walletTypeApi.putObj(row)
|
||||||
|
getDataList()
|
||||||
|
useMessage().success("操作成功")
|
||||||
|
} catch (e) {
|
||||||
|
useMessage().error("操作错误")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 删除操作
|
// 删除操作
|
||||||
const handleDelete = async (ids: string[]) => {
|
const handleDelete = async (ids: string[]) => {
|
||||||
try {
|
try {
|
||||||
@@ -134,7 +161,7 @@ const handleDelete = async (ids: string[]) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await delObjs(ids)
|
await walletTypeApi.delObjs(ids)
|
||||||
getDataList()
|
getDataList()
|
||||||
useMessage().success("删除成功")
|
useMessage().success("删除成功")
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
|
|||||||
Reference in new issue
Block a user