更新,扣减代理商余额

This commit is contained in:
磷叶 2025-05-12 15:34:39 +08:00
parent ef660f1149
commit b845da2be8
5 changed files with 151 additions and 29 deletions

View File

@ -99,3 +99,11 @@ export function getIncomeList(query) {
params: query
})
}
// 增减运营商余额
export function changeBalance(query) {
return request({
url: '/system/dept/changeBalance',
method: 'put',
params: query
})
}

View File

@ -6,6 +6,7 @@
<script>
import AMapLoader from "@amap/amap-jsapi-loader";
import globalConfig from "@/utils/config/globalConfig";
var polyEditor = "";
export default {
@ -32,7 +33,7 @@
console.log("接收参数", this.pathList);
// console.log(typeof JSON.parse(this.pathList));
await AMapLoader.load({
key: "9a48843dd0ab33ca198ee67930cb124d", // WebKey load
key: globalConfig.aMap.key, // WebKey load
version: "2.0", // JSAPI 1.4.15
plugins: [
"AMap.ToolBar",

View File

@ -1,10 +1,10 @@
export default {
/**
* 高德地图配置 浅蓝
* 高德地图配置
*/
aMap: {
key: '11da89fddf9340d0a69d4fff53c0ec4b',
secret: '32dca5ef246f3b96234cd8ef891e4d59'
key: 'cc70402d7ec5ab19cb5c3d88b92a0b7b',
secret: '5c5bfb20421c5869760661e95a39b1d0'
},
/**
* 正常blue,

View File

@ -0,0 +1,97 @@
<template>
<el-dialog :visible.sync="dialogVisible" title="增减余额" width="400px" @open="onOpen">
<el-form :model="form" label-width="6em" :rules="rules" ref="formRef">
<el-form-item label="变动金额" prop="amount">
<el-input-number v-model="form.amount" style="width: calc(100% - 2em)"/>
</el-form-item>
<el-form-item label="关联订单" prop="reason">
<el-input v-model="form.reason" placeholder="请输入关联订单号"/>
</el-form-item>
</el-form>
<template #footer>
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="handleSubmit" :loading="loading">确定</el-button>
</template>
</el-dialog>
</template>
<script>
import { changeBalance } from '@/api/system/dept'
export default {
name: 'DeptBalanceDialog',
props: {
visible: {
type: Boolean,
default: false,
},
deptId: {
type: Number,
default: null,
},
},
data() {
return {
loading: false,
form: {
deptId: null,
amount: null,
reason: null,
},
rules: {
amount: [
{ required: true, message: '请输入变动金额', trigger: 'blur' },
],
reason: [
{ required: true, message: '请输入关联订单号', trigger: 'blur' },
]
}
}
},
computed: {
dialogVisible: {
get() {
return this.visible
},
set(val) {
this.$emit('update:visible', val)
}
}
},
methods: {
onOpen() {
this.reset()
},
handleSubmit() {
this.$refs.formRef.validate((valid) => {
if (valid) {
this.form.deptId = this.deptId
this.loading = true
changeBalance(this.form).then(res => {
this.$message.success('操作成功')
this.dialogVisible = false
this.$emit('refresh')
}).finally(() => {
this.loading = false
})
}
})
},
handleCancel() {
this.dialogVisible = false
},
reset() {
this.form = {
deptId: null,
amount: null,
reason: null,
}
}
}
}
</script>
<style lang="scss" scoped>
</style>

View File

@ -8,12 +8,20 @@
<template #header>
<div class="card-header">
<span>代理商详情</span>
<div>
<el-button
type="text"
icon="el-icon-setting"
@click="showConfigDialog = true">
代理商配置
</el-button>
<el-button
type="text"
icon="el-icon-plus"
@click="showBalanceLog = true">
增减余额
</el-button>
</div>
</div>
</template>
@ -36,7 +44,7 @@
<dict-tag :options="dict.type.sys_yes_no" :value="detail.separateAccount" />
</el-descriptions-item>
<el-descriptions-item label="余额">
{{ deptInfo.balance }}
{{ detail.balance }}
</el-descriptions-item>
<el-descriptions-item label="服务费">
{{ detail.platformServiceFee }}%
@ -169,29 +177,35 @@
:dept-id="detail.deptId"
v-if="detail.deptId"
/>
<!-- 增减余额对话框 -->
<dept-balance-dialog
:visible.sync="showBalanceLog"
:dept-id="detail.deptId"
/>
</div>
</template>
<script>
import { getDept, getDeptInfo } from '@/api/system/dept'
import UserRechargeReport from '@/views/system/dept/components/userRechargeReport.vue'
import UserConfigDialog from '@/views/system/dept/components/UserConfigDialog.vue'
import Area from "@/views/system/area/index"
import Fees from "@/views/system/fee/index"
import Model from "@/views/system/model/index"
import device from "@/views/system/device/index"
import order from "@/views/system/order/index"
import partner from "@/views/system/partner/index"
import refund from "@/views/system/refund/index"
import audit from "@/views/system/audit/index"
import flow from "@/views/system/flow/index"
import withdraw from "@/views/system/withdrawAudit/index"
import user from "@/views/system/user/index"
import recharge from '@/views/system/recharge/index.vue'
import Area from "@/views/system/area/index"
import audit from "@/views/system/audit/index"
import DeptBalanceDialog from '@/views/system/dept/components/DeptBalanceDialog.vue'
import UserConfigDialog from '@/views/system/dept/components/UserConfigDialog.vue'
import UserRechargeReport from '@/views/system/dept/components/userRechargeReport.vue'
import device from "@/views/system/device/index"
import Fees from "@/views/system/fee/index"
import flow from "@/views/system/flow/index"
import Model from "@/views/system/model/index"
import order from "@/views/system/order/index"
import partner from "@/views/system/partner/index"
import recharge from '@/views/system/recharge/index.vue'
import refund from "@/views/system/refund/index"
import user from "@/views/system/user/index"
import withdraw from "@/views/system/withdrawAudit/index"
export default {
name: 'DeptDetail',
components: {
UserRechargeReport,
UserConfigDialog,
@ -206,7 +220,8 @@
flow,
withdraw,
user,
recharge
recharge,
DeptBalanceDialog
},
dicts: ['sys_normal_disable', 'sys_yes_no'],
@ -217,6 +232,7 @@
loading: false,
showConfigDialog: false,
deptInfo: {},
showBalanceLog: false,
activeTab: localStorage.getItem('deptDetailActiveTab') || '运营区'
}
},