This commit is contained in:
磷叶 2025-05-21 18:17:23 +08:00
parent d0cf6b119d
commit af44a7aa49
13 changed files with 101 additions and 79 deletions

View File

@ -1,5 +1,5 @@
# 页面标题
VUE_APP_TITLE = 电动车v2
VUE_APP_TITLE = 小鹿骑行-开发
# 开发环境配置
ENV = 'development'

View File

@ -1,5 +1,5 @@
# 页面标题
VUE_APP_TITLE = 小鹿骑行管理系统
VUE_APP_TITLE = 小鹿骑行
# 生产环境配置
ENV = 'production'

View File

@ -1,5 +1,5 @@
# 页面标题
VUE_APP_TITLE = 小鹿骑行管理系统
VUE_APP_TITLE = 小鹿骑行
NODE_ENV = production

View File

@ -214,7 +214,8 @@ export const OrderStatus = {
// 支付业务类型
export const PayBstType = {
ORDER: "1", // 订单
ORDER: "1", // 订单押金
ORDER_RIDE: "2", // 订单骑行费
}
// 分成业务类型
@ -389,3 +390,10 @@ export const LogBizType = {
USER: "USER", // 用户
COMMAND_LOG: "COMMAND_LOG", // 命令日志
}
// 订单退款类型
export const OrderRefundType = {
DEPOSIT: "1", // 押金
RIDE: "2", // 骑行费
}

View File

@ -196,9 +196,9 @@ export default {
{key: 'arrivalId', visible: false, label: '分成方ID', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'point', visible: true, label: '比例', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'amount', visible: true, label: '总金额', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'invalidAmount', visible: true, label: '未出账', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'invalidAmount', visible: false, label: '未出账', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'waitAmount', visible: true, label: '待分成', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'payedAmount', visible: true, label: '已分成', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'payedAmount', visible: true, label: '已到账', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'refundAmount', visible: true, label: '已退款', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'prePayTime', visible: true, label: '预计分成', minWidth: null, sortable: false, overflow: false, align: 'center', width: "100"},
{key: 'payTime', visible: true, label: '实际分成', minWidth: null, sortable: false, overflow: false, align: 'center', width: "100"},

View File

@ -6,21 +6,14 @@
append-to-body
@open="handleOpen"
>
<el-form :model="form" :rules="rules" ref="form" label-width="5em" v-loading="loading" size="small">
<el-form-item label="抵扣金额" prop="amount">
<el-input-number
v-model="form.amount"
type="number"
placeholder="请输入抵扣金额"
:min="0"
controls-position="right"
style="width: 100%;"
/>
</el-form-item>
</el-form>
<div v-loading="loading">
<p>即将进行押金抵扣请确认</p>
<p>抵扣金额{{ detail.totalFee | fix2 | dv }} </p>
<p>剩余可抵扣押金{{ detail.depositDeductRemain | fix2 | dv }} </p>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="success" plain @click="handleSubmit()" icon="el-icon-check" :loading="submitLoading">确定</el-button>
<el-button plain @click="handleCancel()" icon="el-icon-close" :loading="submitLoading">取消</el-button>
<el-button type="primary" @click="handleSubmit()" icon="el-icon-wallet" :loading="submitLoading">确认抵扣</el-button>
<el-button @click="handleCancel()" icon="el-icon-close">取消</el-button>
</div>
</el-dialog>
</template>
@ -74,23 +67,20 @@ export default {
},
reset() {
this.form = {
id: this.id,
amount: null,
id: this.id
};
this.resetForm('form');
},
handleSubmit() {
this.$refs.form.validate().then(() => {
this.submitLoading = true;
deductOrder(this.form).then((response) => {
if (response.code == 200) {
this.$message.success('操作成功');
this.dialogVisible = false;
this.$emit('success');
}
}).finally(() => {
this.submitLoading = false;
});
this.submitLoading = true;
deductOrder(this.form).then((response) => {
if (response.code == 200) {
this.$message.success('操作成功');
this.dialogVisible = false;
this.$emit('success');
}
}).finally(() => {
this.submitLoading = false;
});
},
handleCancel() {

View File

@ -1,15 +1,28 @@
<template>
<el-dialog
title="押金退款"
title="退款"
:visible.sync="dialogVisible"
width="500px"
append-to-body
@open="handleOpen"
>
<el-form :model="form" :rules="rules" ref="form" label-width="6em" v-loading="loading" size="small">
<el-form-item label="退款类型" prop="refundType">
<el-radio-group v-model="form.refundType" placeholder="请选择退款类型" style="width: 100%;" @change="handleRefundTypeChange">
<el-radio-button :label="OrderRefundType.DEPOSIT">押金 ({{ detail.canDepositRefundAmount | fix2 | dv }} )</el-radio-button>
<el-radio-button :label="OrderRefundType.RIDE">骑行费 ({{ detail.canRideRefundAmount | fix2 | dv }} )</el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item label="退款金额" prop="amount">
<el-input-number v-model="form.amount" :max="canRefundAmount" :min="0" :placeholder="`请输入退款金额,最多可退款 ${canRefundAmount} 元`" :precision="2" style="width: 100%;" />
<div>当前最多可退款{{canRefundAmount | fix2 | dv}} </div>
<el-input-number
v-model="form.amount"
:max="canRefundAmount"
:min="0"
:placeholder="`请输入退款金额,最多可退款 ${canRefundAmount} 元`"
:precision="2"
style="width: 100%;"
controls-position="right"
/>
</el-form-item>
<el-form-item label="退款原因" prop="reason">
<el-input v-model="form.reason" type="textarea" placeholder="请输入退款原因" show-word-limit maxlength="200" />
@ -24,6 +37,7 @@
<script>
import { getOrder, refundOrder } from '@/api/bst/order';
import { OrderRefundType } from '@/utils/enums';
export default {
props: {
@ -38,6 +52,7 @@ export default {
},
data() {
return {
OrderRefundType,
detail: {},
form: {},
loading: false,
@ -46,6 +61,9 @@ export default {
amount: [
{ required: true, message: '请输入退款金额', trigger: 'blur' },
],
refundType: [
{ required: true, message: '请选择退款类型', trigger: 'blur' },
],
}
}
},
@ -63,10 +81,18 @@ export default {
if (this.detail == null || this.detail.id == null) {
return 0;
}
return this.detail.payedAmount - this.detail.payRefunded - this.detail.payRefunding;
if (this.form.refundType == OrderRefundType.DEPOSIT) {
return this.detail.canDepositRefundAmount;
} else if (this.form.refundType == OrderRefundType.RIDE) {
return this.detail.canRideRefundAmount;
}
return 0;
}
},
methods: {
handleRefundTypeChange() {
this.form.amount = null;
},
getDetail() {
this.loading = true;
getOrder(this.id).then(response => {
@ -82,6 +108,7 @@ export default {
reset() {
this.form = {
orderId: this.id,
refundType: OrderRefundType.DEPOSIT,
amount: null,
reason: null,
};

View File

@ -177,31 +177,31 @@
<div>管理费{{d.row.manageFee | fix2 | dv}} </div>
<div>车损费{{d.row.deductionFee | fix2 | dv}} </div>
</div>
<div slot="reference">结算{{d.row.totalFee | fix2 | dv}} <i class="el-icon-info" /></div>
<div slot="reference">应收{{d.row.totalFee | fix2 | dv}} <i class="el-icon-info" /></div>
</el-popover>
</el-col>
<el-col :span="12" v-if="d.row.actualAmount != null && OrderStatus.finishedList().includes(d.row.status)" style="color: green;font-weight: bold;">
<el-popover
placement="bottom"
width="200"
trigger="hover"
>
<div>
<div>骑行费{{d.row.actualRidingFee | fix2 | dv}} </div>
<div>调度费{{d.row.actualDispatchFee | fix2 | dv}} </div>
<div>管理费{{d.row.actualManageFee | fix2 | dv}} </div>
<div>车损费{{d.row.actualDeductionFee | fix2 | dv}} </div>
</div>
<div slot="reference">已付{{d.row.actualAmount | fix2 | dv}} <i class="el-icon-info" /></div>
</el-popover>
</el-col>
<el-col :span="12">
押金抵扣{{d.row.depositDeductionAmount | fix2 | dv}}
</el-col>
<el-col :span="24" v-if="d.row.payRefunded || d.row.payRefunding" style="color: red;">
退款{{d.row.payRefunded | fix2 | dv}}
<template v-if="d.row.payRefunding">(退款中{{d.row.payRefunding | fix2 | dv}} )</template>
</el-col>
<template v-if="OrderStatus.finishedList().includes(d.row.status)">
<el-col :span="12" v-if="d.row.actualAmount != null" style="color: green;font-weight: bold;">
<el-popover
placement="bottom"
width="200"
trigger="hover"
>
<div>
<div>骑行费{{d.row.actualRidingFee | fix2 | dv}} </div>
<div>调度费{{d.row.actualDispatchFee | fix2 | dv}} </div>
<div>管理费{{d.row.actualManageFee | fix2 | dv}} </div>
<div>车损费{{d.row.actualDeductionFee | fix2 | dv}} </div>
<div v-if="d.row.depositDeductionAmount"><br/>押金抵扣{{d.row.depositDeductionAmount | fix2 | dv}} </div>
</div>
<div slot="reference">实收{{d.row.actualAmount | fix2 | dv}} <i class="el-icon-info" /></div>
</el-popover>
</el-col>
<el-col :span="24" v-if="d.row.adminRefundAmount" style="color: red;">
人工退款{{d.row.adminRefundAmount | fix2 | dv}}
({{ d.row.adminRefundCount | dv}} )
</el-col>
</template>
</el-row>
</div>
</template>
@ -278,7 +278,7 @@
@click="handleRefund(scope.row)"
v-has-permi="['bst:order:refund']"
v-show="OrderStatus.canRefund().includes(scope.row.status)"
>押金退款</el-button>
>退款</el-button>
<el-button
size="mini"
type="text"

View File

@ -52,16 +52,13 @@
<el-col>
<el-statistic
title="总退款"
:value="detail.payRefunded"
:value="detail.totalRefundAmount"
:precision="2"
suffix="元"
value-style="color: #F56C6C">
<template slot="prefix">
<i class="el-icon-refresh-left" style="color: #F56C6C"></i>
</template>
<template v-if="detail.payRefunding" slot="suffix">
<span style="color: #F56C6C; font-size: 12px">退款中{{ detail.payRefunding | fix2 | dv }} </span>
</template>
</el-statistic>
</el-col>
<el-col>
@ -79,7 +76,7 @@
<el-col>
<el-statistic
title="人工退款"
:value="detail.payAdminRefund"
:value="detail.adminRefundAmount"
:precision="2"
suffix="元"
value-style="color: #F56C6C">
@ -110,7 +107,7 @@
@click="handleRefund(detail)"
v-has-permi="['bst:order:refund']"
v-show="OrderStatus.canRefund().includes(detail.status)"
>押金退款</el-button>
>退款</el-button>
<el-button
size="small"
plain
@ -234,7 +231,7 @@
<order-device :query="{orderId: detail.id}" />
</el-tab-pane>
<el-tab-pane label="支付信息" v-if="checkPermi(['bst:pay:list'])">
<pay :query="{bstId: detail.id, bstType: PayBstType.ORDER}"/>
<pay :query="{bstId: detail.id, bstTypes: [PayBstType.ORDER, PayBstType.ORDER_RIDE]}"/>
</el-tab-pane>
<el-tab-pane label="退款信息" v-if="checkPermi(['bst:refund:list'])">
<refund :query="{payBstId: detail.id, payBstType: PayBstType.ORDER}"/>

View File

@ -124,7 +124,7 @@
{{d.row[column.key]}}
</template>
<template v-else-if="column.key === 'description'">
<order-link v-if="PayBstType.ORDER === d.row.bstType" :id="d.row.bstId" :text="d.row.description" size="mini" />
<order-link v-if="[PayBstType.ORDER, PayBstType.ORDER_RIDE].includes(d.row.bstType)" :id="d.row.bstId" :text="d.row.description" size="mini" />
<span v-else>{{d.row.description | dv}}</span>
<dict-tag :options="dict.type.pay_bst_type" :value="d.row.bstType" size="mini" style="margin-left: 4px;"/>
<dict-tag :options="dict.type.pay_status" :value="d.row.status" size="mini" style="margin-left: 4px;"/>
@ -155,11 +155,11 @@
</template>
<script>
import { listPay, getPay, delPay, addPay, updatePay } from "@/api/bst/pay";
import { $showColumns } from '@/utils/mixins';
import { addPay, delPay, getPay, listPay, updatePay } from "@/api/bst/pay";
import OrderLink from '@/components/Business/Order/OrderLink.vue';
import FormCol from "@/components/FormCol/index.vue";
import OrderLink from '@/components/Business/Order/OrderLink.vue'
import { PayBstType } from "@/utils/enums";
import { $showColumns } from '@/utils/mixins';
//
const defaultSort = {

View File

@ -4,7 +4,7 @@
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
<h3 class="title-box">
<img :src="logo" class="logo"/>
<span class="title">小鹿骑行管理系统</span>
<span class="title">小鹿骑行</span>
</h3>
<el-form-item prop="username">
<el-input
@ -66,10 +66,10 @@
<script>
import { getCodeImg } from '@/api/login'
import Cookies from 'js-cookie'
import { decrypt, encrypt } from '@/utils/jsencrypt'
import Logo from '@/layout/components/Sidebar/Logo.vue'
import logoImg from '@/assets/logo/logo.png'
import Logo from '@/layout/components/Sidebar/Logo.vue'
import { decrypt, encrypt } from '@/utils/jsencrypt'
import Cookies from 'js-cookie'
export default {
name: "Login",

View File

@ -1,7 +1,7 @@
<template>
<div class="register">
<el-form ref="registerForm" :model="registerForm" :rules="registerRules" class="register-form">
<h3 class="title">小鹿骑行管理系统</h3>
<h3 class="title">小鹿骑行</h3>
<el-form-item prop="username">
<el-input v-model="registerForm.username" type="text" auto-complete="off" placeholder="账号">
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
@ -66,7 +66,7 @@
</template>
<script>
import { getCodeImg, register } from '@/api/login'
import { getCodeImg, register } from '@/api/login';
export default {
name: "Register",

View File

@ -7,7 +7,7 @@ function resolve(dir) {
const CompressionPlugin = require('compression-webpack-plugin')
const name = process.env.VUE_APP_TITLE || '小鹿骑行管理系统' // 网页标题
const name = process.env.VUE_APP_TITLE || '小鹿骑行' // 网页标题
const port = process.env.port || process.env.npm_config_port || 4100 // 端口