运营商渠道成本

This commit is contained in:
墨大叔 2024-10-07 16:06:45 +08:00
parent d7bbc91225
commit aa9f54f4c4
5 changed files with 95 additions and 41 deletions

View File

@ -79,3 +79,12 @@ export function refundBill(billId, refundAmount) {
}
})
}
// 关闭订单
export function closeBill(data) {
return request({
url: `/system/bill/close`,
method: 'put',
data
})
}

View File

@ -154,3 +154,16 @@ export const BonusArrivalType = {
return [this.COMPANY, this.PLATFORM]
}
}
// 充值订单状态
export const RechargeStatus = {
WAIT_PAY: "1", // 未支付
PAY_SUCCESS: "2", // 支付成功
REFUNDED: "3", // 已退款
USER_CANCEL: "4", // 用户取消
SYS_CANCEL: "5", // 系统超时取消
PAYING: "6", // 支付中
REFUNDING: "7", // 退款中
DEPOSIT_WAIT_PAY: "8", // 押金待支付
DEPOSIT_SUCCESS: "9", // 押金已支付
}

View File

@ -60,6 +60,9 @@
<el-table-column prop="point" label="分成比例" align="center" width="100">
<template slot-scope="d">{{d.row.point | money | defaultValue}} %</template>
</el-table-column>
<el-table-column prop="channelRate" label="渠道成本" align="center" width="100">
<template slot-scope="d">{{d.row.channelRate | money | defaultValue}} %</template>
</el-table-column>
<el-table-column prop="balance" label="余额" align="center" width="100">
<template slot-scope="d">{{d.row.balance | money | defaultValue}} </template>
</el-table-column>
@ -116,14 +119,15 @@
<el-input v-model="form.deptName" placeholder="请输入运营商名称" />
</el-form-item>
</el-col>
<form-col :span="12" label="显示排序" prop="orderNum">
<el-input-number v-model="form.orderNum" controls-position="right" :min="0" style="width: 100%"/>
</form-col>
<form-col :span="12" label="分成比例" prop="point">
<el-input-number v-model="form.point" controls-position="right" :min="0" :max="100" placeholder="请输入分成比例" :precision="2" style="width: calc(100% - 1.5em)"/> %
</form-col>
<el-col :span="12">
<el-form-item label="显示排序" prop="orderNum">
<el-input-number v-model="form.orderNum" controls-position="right" :min="0" style="width: 100%"/>
</el-form-item>
</el-col>
<form-col :span="12" label="渠道成本" prop="channelRate">
<el-input-number v-model="form.channelRate" controls-position="right" :min="0" :max="100" placeholder="请输入渠道成本" :precision="2" style="width: calc(100% - 1.5em)"/> %
</form-col>
<el-col :span="12">
<el-form-item label="运营商状态">
<el-radio-group v-model="form.status">

View File

@ -3,15 +3,30 @@
<el-row :gutter="12">
<el-col :span="18">
<el-card class="box-card" header="基本信息">
<el-descriptions>
<el-descriptions :column="4">
<el-descriptions-item label="订单编号">{{detail.billNo | defaultValue}}</el-descriptions-item>
<el-descriptions-item label="交易状态">
<dict-tag :value="detail.status" :options="dict.type.sm_transaction_bill_status" size="small"/>
</el-descriptions-item>
<el-descriptions-item label="订单金额">{{detail.money | money | defaultValue}} </el-descriptions-item>
<el-descriptions-item label="设备编号">
<device-link :id="detail.deviceId" :text="detail.deviceNo"/>
<el-descriptions-item label="订单金额">
{{detail.money | money | defaultValue}}
<template v-if="detail.refundAmount">(退款: {{detail.refundAmount | money | defaultValue}} )</template>
</el-descriptions-item>
<el-descriptions-item label="运营渠道成本">
{{detail.deptChannelCost | money | defaultValue}}
<template v-if="detail.refundDeptChannel">(退款: {{detail.refundDeptChannel | money | defaultValue}} )</template>
</el-descriptions-item>
<el-descriptions-item label="平台渠道成本" v-if="deptId === ROOT_DEPT">
{{detail.channelCost | money | defaultValue}}
<template v-if="detail.refundChannel">(退款: {{detail.refundChannel | money | defaultValue}} )</template>
</el-descriptions-item>
</el-descriptions>
</el-card>
<el-card class="box-card" header="设备信息">
<el-descriptions><el-descriptions-item label="设备编号">
<device-link :id="detail.deviceId" :text="detail.deviceNo"/>
</el-descriptions-item>
<el-descriptions-item label="设备名称">
<device-link :id="detail.deviceId" :text="detail.deviceName"/>
</el-descriptions-item>
@ -40,6 +55,7 @@
</el-descriptions-item>
</el-descriptions>
</el-card>
<el-card class="box-card" header="套餐信息">
<el-descriptions>
<el-descriptions-item label="套餐名称">{{detail.suitName | defaultValue}}</el-descriptions-item>
@ -102,19 +118,21 @@ import Refund from '@/views/ss/refund/index.vue'
import { findLabel } from '@/utils'
import DeviceLink from '@/components/Business/Device/DeviceLink.vue'
import UserLink from '@/components/Business/SmUser/UserLink.vue'
import { BonusArrivalType, FieldName, SuitFeeType, views } from '@/utils/constants'
import { BonusArrivalType, FieldName, ROOT_DEPT, SuitFeeType, views } from '@/utils/constants'
import PayBill from '@/views/ss/payBill/index.vue'
import StoreLink from '@/components/Business/Store/StoreLink.vue'
import Bonus from '@/views/ss/bonus/index.vue'
import { checkPermi } from '@/utils/permission'
import { listBonusByBill } from '@/api/ss/bonus'
import LineField from '@/components/LineField/index.vue'
import { mapGetters } from 'vuex'
export default {
name: 'RechargeDetail',
components: { LineField, Bonus, StoreLink, PayBill, UserLink, DeviceLink, Refund },
dicts: ['channel_type','sm_transaction_bill_status', 'sm_transaction_bill_device_recharge_status', 'time_unit', 'suit_fee_mode', 'suit_fee_type', 'bonus_status', 'bonus_arrival_type'],
computed: {
...mapGetters(['deptId']),
BonusArrivalType() {
return BonusArrivalType
},
@ -136,6 +154,7 @@ export default {
},
data() {
return {
ROOT_DEPT,
loading: false,
detail: {},
bonusList: [], //

View File

@ -106,39 +106,19 @@
</el-table-column>
<el-table-column label="交易金额" align="center">
<template slot-scope="d">
{{d.row.money | money}}
{{d.row.money | money | defaultValue}}
</template>
</el-table-column>
<!-- <el-table-column label="到账金额" align="center">-->
<!-- <template slot-scope="d">-->
<!-- {{d.row.arrivalAmount | money}} -->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="手续费" align="center">-->
<!-- <template slot-scope="d">-->
<!-- {{d.row.serviceCharge | money | defaultValue}} -->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="渠道成本" align="center" v-if="deptId === ROOT_DEPT">
<template slot-scope="d">
{{d.row.channelCost | money}}
{{d.row.channelCost | money | defaultValue}}
</template>
</el-table-column>
<el-table-column label="运营成本" align="center">
<template slot-scope="d">
{{d.row.deptChannelCost | money | defaultValue}}
</template>
</el-table-column>
<!-- <el-table-column label="利润" align="center">-->
<!-- <template slot-scope="d">-->
<!-- {{d.row.serviceCharge - d.row.channelCost | money}} -->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="收费模式" align="center">-->
<!-- <template slot-scope="d">-->
<!-- <dict-tag :value="d.row.suitFeeMode" :options="dict.type.suit_fee_mode"/>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="收费方式" align="center">-->
<!-- <template slot-scope="d">-->
<!-- <dict-tag :value="d.row.suitFeeType" :options="dict.type.suit_fee_type"/>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="交易状态" align="center" width="120">
<template slot-scope="d">
<dict-tag :value="d.row.status" :options="dict.type.sm_transaction_bill_status"/>
@ -182,6 +162,14 @@
v-has-permi="['system:bill:refund']"
v-show="canRefund(d.row)"
>订单退款</el-button>
<el-button
size="small"
type="text"
icon="el-icon-close"
@click="handleClose(d.row)"
v-has-permi="['system:bill:close']"
v-show="canClose(d.row)"
>结束订单</el-button>
</template>
</el-table-column>
</el-table>
@ -230,12 +218,12 @@ import {
updateBill,
refreshPayResult,
rechargeDevice,
refundBill
refundBill, closeBill
} from '@/api/system/recharge'
import UserLink from '@/components/Business/SmUser/UserLink.vue'
import DeviceLink from '@/components/Business/Device/DeviceLink.vue'
import RechargeLink from '@/components/Business/Transaction/RechargeLink.vue'
import { FieldName, ROOT_DEPT, SuitFeeType } from '@/utils/constants'
import { FieldName, RechargeStatus, ROOT_DEPT, SuitFeeType } from '@/utils/constants'
import { $view } from '@/utils/mixins'
import StoreLink from '@/components/Business/Store/StoreLink.vue'
import { mapGetters } from 'vuex'
@ -316,9 +304,15 @@ export default {
},
canRefund() {
return (row) => {
return row.status === '2';
return row.status === '2' && row.isFinished;
}
}
},
canClose() {
return (row) => {
//
return [RechargeStatus.PAY_SUCCESS, RechargeStatus.DEPOSIT_SUCCESS].includes(row.status) && !row.isFinished;
}
},
},
created() {
this.queryParams = {
@ -350,6 +344,21 @@ export default {
}
this.showRefund = true;
},
//
handleClose(row) {
this.$confirm(`确定结束订单【${row.billNo}】吗?`, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
closeBill({billId: row.billId, totalEle: null}).then(res => {
if (res.code === 200) {
this.$message.success("操作成功");
this.getList();
}
})
})
},
rechargeDevice(id) {
rechargeDevice(id).then(res => {
if (res.code === 200) {