From 907f0f8361b548b88889b4aa45e69305ae964de0 Mon Sep 17 00:00:00 2001 From: 18650502300 <18650502300@163.com> Date: Sat, 27 Jul 2024 21:29:53 +0800 Subject: [PATCH] =?UTF-8?q?1.=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/dept/index.vue | 66 +++++++++++++++++++----- src/views/system/device/index.vue | 19 ++++--- src/views/system/partner/index.vue | 2 +- src/views/system/withdrawAudit/index.vue | 45 ++++++++++------ 4 files changed, 95 insertions(+), 37 deletions(-) diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue index ef50791..ccf07ce 100644 --- a/src/views/system/dept/index.vue +++ b/src/views/system/dept/index.vue @@ -74,9 +74,9 @@ :default-sort="defaultSort" @sort-change="handleSortChange"> - + - + @@ -87,9 +87,9 @@ {{ scope.row.platformServiceFee && scope.row.platformServiceFee != '0'?scope.row.platformServiceFee+'%':'' }} - + - {{ scope.row.handlingCharge && scope.row.handlingCharge != '0'?scope.row.handlingCharge+'‰':'' }} + {{ formatHandlingCharge(scope.row.handlingCharge,scope.row.handlingChargeType) }} @@ -153,7 +153,7 @@ - + - + - + + + 联系电话用于登录后台管理系统,如需修改请联系管理员 + @@ -244,8 +247,14 @@ - - + + + {{dict.label}} + @@ -255,6 +264,16 @@ + + + + + + + + + + @@ -368,7 +387,7 @@ import { bandAppUser, getUser } from '@/api/system/user' export default { name: "Dept", - dicts: ['sys_normal_disable','sys_yes_no'], + dicts: ['sys_normal_disable','sys_yes_no','et_handling_charge_type'], components: { Treeselect }, data() { return { @@ -417,9 +436,15 @@ export default { deptName: [ { required: true, message: "运营商名称不能为空", trigger: "blur" } ], - orderNum: [ - { required: true, message: "显示排序不能为空", trigger: "blur" } + handlingChargeType: [ + { required: true, message: "手续费类型不能为空", trigger: "blur" } ], + handlingCharge: [ + { required: true, message: "手续费不能为空", trigger: "blur" } + ], + // orderNum: [ + // { required: true, message: "显示排序不能为空", trigger: "blur" } + // ], email: [ { type: "email", @@ -453,6 +478,17 @@ export default { this.getList(); }, methods: { + formatHandlingCharge(charge, chargeType) { + if (!charge || charge === '0') { + return ''; + } + if (chargeType === '1') { + return `${charge}‰`; + } else if (chargeType === '2') { + return `每笔${charge}元`; + } + return charge; + }, /** 排序触发事件 */ handleSortChange(column, prop, order) { this.queryParams.orderByColumn = column.prop; @@ -514,6 +550,7 @@ export default { separateAccount: 'N', platformServiceFee: '4', handlingCharge: '5.4', + handlingChargeType: '1', isUsePlatformApp: true, merchantId: null, apiV3Key: null, @@ -617,4 +654,9 @@ export default { font-weight: bold; color: red; } + .el-form-item__tip{ + color: #ff0000; + font-size: 12px; + line-height: 18px; + } diff --git a/src/views/system/device/index.vue b/src/views/system/device/index.vue index b5c5715..9d6fa73 100644 --- a/src/views/system/device/index.vue +++ b/src/views/system/device/index.vue @@ -398,7 +398,7 @@ - + { + this.hardwareVersionOptions = response.rows; + this.loading2 = false; + }); console.log("当前用户信息:",this.$store.state.user.name) const sn = this.$route.params && this.$route.params.sn; const vehicleNum = this.$route.params && this.$route.params.vehicleNum; @@ -698,9 +703,6 @@ export default { }); this.userName = this.$store.state.user.name; this.getList(); - listHardwareVersion(this.queryParams).then(response => { - this.hardwareVersionOptions = response.rows; - }); if(this.userName === 'admin'){ listDept({status: '0' }).then(response => { this.deptOptions = response.data; @@ -758,8 +760,11 @@ export default { } }, formatVersion(versionId){ - if(versionId){ - return this.hardwareVersionOptions.find(item => item.id === versionId).version; + if (versionId && this.hardwareVersionOptions.length > 0) { + const versionItem = this.hardwareVersionOptions.find(item => item.id === versionId); + if (versionItem) { + return versionItem.version; + } } return ""; }, @@ -1187,7 +1192,7 @@ export default { .el-input__inner{ color: red; } - + } .el-input{ .el-input__inner{ diff --git a/src/views/system/partner/index.vue b/src/views/system/partner/index.vue index 7fb2a37..56ad001 100644 --- a/src/views/system/partner/index.vue +++ b/src/views/system/partner/index.vue @@ -176,7 +176,7 @@ - tips:非常重要!手机号用于分润和登录系统,保存后不可修改 + 手机号用于分润和登录系统,保存后不可修改 diff --git a/src/views/system/withdrawAudit/index.vue b/src/views/system/withdrawAudit/index.vue index f198854..842ebdd 100644 --- a/src/views/system/withdrawAudit/index.vue +++ b/src/views/system/withdrawAudit/index.vue @@ -219,16 +219,16 @@ export default { }, computed: { formattedFee() { - console.log("handlingCharge===========",this.handlingCharge) - // 将handlingCharge转换为浮点类型 - let handlingCharge = parseFloat(this.handlingCharge)/1000; - console.log("handlingCharge1===========", handlingCharge); - console.log("this.form.amount===========", this.form.amount); - // 计算手续费 - let fee = this.form.amount * handlingCharge; - // 保留两位小数,并确保四舍五入 - fee = fee.toFixed(2); - + let fee; + if(this.handlingChargeType === '1'){ + let handlingCharge = parseFloat(this.handlingCharge)/1000; + // 计算手续费 + let fee1 = this.form.amount * handlingCharge; + // 保留两位小数,并确保四舍五入 + fee = fee1.toFixed(2); + }else{ + fee = parseFloat(this.handlingCharge); + } // 判断手续费是否为0 if (fee === 0) { return '0.00 (免手续费)'; @@ -238,11 +238,16 @@ export default { }, actualAmount() { let amount = this.form.amount; - let handlingCharge = parseFloat(this.handlingCharge)/1000; - let fee = this.form.amount * handlingCharge; - // 四舍五入到两位小数 - fee = Math.round(fee * 100) / 100; - // 计算实际到账金额并四舍五入到两位小数 + let fee; + if(this.handlingChargeType === '1'){ + let handlingCharge = parseFloat(this.handlingCharge)/1000; + let fee1 = this.form.amount * handlingCharge; + // 四舍五入到两位小数 + fee = Math.round(fee1 * 100) / 100; + // 计算实际到账金额并四舍五入到两位小数 + }else{ + fee = parseFloat(this.handlingCharge); + } let actual = amount - fee; actual = actual.toFixed(2); return `${actual} `; @@ -318,7 +323,7 @@ export default { }; }, created() { - console.log("当前用户信息:",this.$store.state.user.name) + // console.log("当前用户信息:",this.$store.state.user.name) this.userName = this.$store.state.user.name; this.getList(); this.getAreaList(); @@ -333,6 +338,10 @@ export default { getDeptByToken(deptId).then(response => { this.balance = response.data.balance; this.handlingCharge = response.data.handlingCharge; + this.handlingChargeType = response.data.handlingChargeType; + this.form.amount = 0; + // console.log("11111handlingCharge===========",this.handlingCharge) + // console.log("22222handlingChargeType===========",this.handlingChargeType) }); }, /** 审核 */ @@ -411,6 +420,7 @@ export default { busType: null, amount: null, handlingCharge: null, + handlingChargeType: null, operatorDividend: null, operatorBalance: null, partnerDividend: null, @@ -443,6 +453,7 @@ export default { getDeptByToken().then(response => { this.balance = response.data.balance; this.handlingCharge = response.data.handlingCharge; + this.handlingChargeType = response.data.handlingChargeType; }); } this.reset(); @@ -495,7 +506,7 @@ export default { .el-input__inner{ color: red; } - + } .el-input{ .el-input__inner{