套餐、订单修改

This commit is contained in:
墨大叔 2024-08-15 21:23:23 +08:00
parent e5314a07ea
commit 6685b187ae
6 changed files with 125 additions and 150 deletions

View File

@ -7,6 +7,7 @@ export const views = {
store: 'store', // 店铺
transfer: 'transfer', // 转账
withdraw: 'withdraw', // 提现
recharge: 'recharge', // 充值订单
}
// 收款账户类型
@ -92,3 +93,11 @@ export const SuitFeeMode = {
SINGLE: "1", // 单次收费
SMART: "2", // 智能收费
}
/**
* 支付订单业务类型
*/
export const PayBillBstType = {
RECHARGE: "3", // 充值订单
RECHARGE_DEPOSIT: "4", // 充值订单押金
}

View File

@ -1,15 +1,7 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="支付订单ID" prop="payId">
<el-input
v-model="queryParams.payId"
placeholder="请输入支付订单ID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="支付订单编号" prop="payNo">
<el-form-item label="支付编号" prop="payNo">
<el-input
v-model="queryParams.payNo"
placeholder="请输入支付订单编号"
@ -18,7 +10,7 @@
/>
</el-form-item>
<el-form-item label="业务类型" prop="bstType">
<el-select v-model="queryParams.bstType" placeholder="请选择业务类型" clearable>
<el-select v-model="queryParams.bstType" placeholder="请选择业务类型" clearable @change="handleQuery">
<el-option
v-for="dict in dict.type.pay_bill_bst_type"
:key="dict.value"
@ -27,24 +19,18 @@
/>
</el-select>
</el-form-item>
<el-form-item label="业务ID" prop="bstId">
<el-input
v-model="queryParams.bstId"
placeholder="请输入业务ID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="支付渠道ID" prop="channelId">
<el-input
v-model="queryParams.channelId"
placeholder="请输入支付渠道ID"
clearable
@keyup.enter.native="handleQuery"
/>
<el-form-item label="支付渠道" prop="channelId">
<el-select v-model="queryParams.channelId" placeholder="请选择支付状态" clearable @change="handleQuery">
<el-option
v-for="dict in dict.type.channel_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="支付状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择支付状态" clearable>
<el-select v-model="queryParams.status" placeholder="请选择支付状态" clearable @change="handleQuery">
<el-option
v-for="dict in dict.type.pay_bill_status"
:key="dict.value"
@ -53,6 +39,22 @@
/>
</el-select>
</el-form-item>
<el-form-item label="描述" prop="description">
<el-input
v-model="queryParams.description"
placeholder="请输入描述"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="支付账号" prop="account">
<el-input
v-model="queryParams.account"
placeholder="请输入支付账号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@ -60,38 +62,6 @@
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['ss:payBill:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['ss:payBill:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['ss:payBill:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
@ -117,16 +87,23 @@
:sort-orders="orderSorts"
:sortable="column.sortable"
:show-overflow-tooltip="column.overflow"
:width="column.width"
>
<template slot-scope="d">
<template v-if="column.key === 'payId'">
{{d.row[column.key]}}
</template>
<template v-else-if="column.key === 'bstType'">
<dict-tag :options="dict.type.pay_bill_bst_type" :value="d.row[column.key]"/>
<dict-tag :options="dict.type.pay_bill_bst_type" :value="d.row[column.key]"/>
</template>
<template v-else-if="column.key === 'status'">
<dict-tag :options="dict.type.pay_bill_status" :value="d.row[column.key]"/>
<dict-tag :options="dict.type.pay_bill_status" :value="d.row[column.key]"/>
</template>
<template v-else-if="column.key === 'channelId'">
<dict-tag :options="dict.type.channel_type" :value="d.row.channelId"/>
</template>
<template v-else-if="['channelCost', 'amount'].includes(column.key)">
{{d.row[column.key] | money}}
</template>
<template v-else>
{{d.row[column.key]}}
@ -136,20 +113,7 @@
</template>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['ss:payBill:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['ss:payBill:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
@ -161,61 +125,12 @@
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改支付订单对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="支付订单编号" prop="payNo">
<el-input v-model="form.payNo" placeholder="请输入支付订单编号" />
</el-form-item>
<el-form-item label="业务类型" prop="bstType">
<el-select v-model="form.bstType" placeholder="请选择业务类型">
<el-option
v-for="dict in dict.type.pay_bill_bst_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="业务ID" prop="bstId">
<el-input v-model="form.bstId" placeholder="请输入业务ID" />
</el-form-item>
<el-form-item label="订单金额" prop="amount">
<el-input v-model="form.amount" placeholder="请输入订单金额" />
</el-form-item>
<el-form-item label="支付渠道ID" prop="channelId">
<el-input v-model="form.channelId" placeholder="请输入支付渠道ID" />
</el-form-item>
<el-form-item label="支付状态" prop="status">
<el-radio-group v-model="form.status">
<el-radio
v-for="dict in dict.type.pay_bill_status"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="支付时间" prop="payTime">
<el-date-picker clearable
v-model="form.payTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择支付时间">
</el-date-picker>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listPayBill, getPayBill, delPayBill, addPayBill, updatePayBill } from "@/api/ss/payBill";
import { $showColumns } from '@/utils/mixins';
import { $showColumns, $view } from '@/utils/mixins'
//
const defaultSort = {
@ -225,20 +140,31 @@ const defaultSort = {
export default {
name: "PayBill",
mixins: [$showColumns],
dicts: ['pay_bill_status', 'pay_bill_bst_type'],
mixins: [$showColumns, $view],
dicts: ['pay_bill_status', 'pay_bill_bst_type', 'channel_type'],
props: {
query: {
type: Object,
default: () => {
return {}
}
}
},
data() {
return {
//
columns: [
{key: 'payId', visible: true, label: '支付订单ID', minWidth: null, sortable: true, overflow: false, align: 'center'},
{key: 'payNo', visible: true, label: '支付订单编号', minWidth: null, sortable: true, overflow: false, align: 'center'},
{key: 'bstType', visible: true, label: '业务类型', minWidth: null, sortable: true, overflow: false, align: 'center'},
{key: 'bstId', visible: true, label: '业务ID', minWidth: null, sortable: true, overflow: false, align: 'center'},
{key: 'amount', visible: true, label: '订单金额(元)', minWidth: null, sortable: true, overflow: false, align: 'center'},
{key: 'channelId', visible: true, label: '支付渠道ID', minWidth: null, sortable: true, overflow: false, align: 'center'},
{key: 'status', visible: true, label: '支付状态', minWidth: null, sortable: true, overflow: false, align: 'center'},
{key: 'payTime', visible: true, label: '支付时间', minWidth: "120", sortable: false, overflow: false, align: 'center'},
{key: 'payId', visible: false, label: 'ID', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'payNo', visible: true, label: '支付订单编号', minWidth: null, sortable: true, overflow: false, align: 'center', width: "180"},
{key: 'bstType', visible: true, label: '业务类型', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'bstId', visible: false, label: '业务ID', 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: 'channelId', visible: true, label: '支付渠道', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'status', visible: true, label: '支付状态', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
{key: 'payTime', visible: true, label: '支付时间', minWidth: "120", sortable: false, overflow: false, align: 'center', width: null},
{key: 'description', visible: true, label: '描述', minWidth: "200", sortable: true, overflow: true, align: 'center', width: null},
{key: 'account', visible: true, label: '支付账号', minWidth: "100", sortable: true, overflow: true, align: 'center', width: null},
{key: 'channelCost', visible: true, label: '渠道成本', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
],
//
orderSorts: ['ascending', 'descending', null],
@ -271,8 +197,13 @@ export default {
payNo: null,
bstType: null,
bstId: null,
amount: null,
channelId: null,
status: null,
payTime: null,
description: null,
account: null,
channelCost: null
},
//
form: {},
@ -282,7 +213,7 @@ export default {
{ required: true, message: "支付订单编号不能为空", trigger: "blur" }
],
bstType: [
{ required: true, message: "业务类型不能为空", trigger: "change" }
{ required: true, message: "业务类型1-月费账单2-电量充值订单3-计时收费订单不能为空", trigger: "change" }
],
bstId: [
{ required: true, message: "业务ID不能为空", trigger: "blur" }
@ -294,15 +225,25 @@ export default {
{ required: true, message: "支付渠道ID不能为空", trigger: "blur" }
],
status: [
{ required: true, message: "支付状态不能为空", trigger: "change" }
{ required: true, message: "支付状态1-待支付2-支付中3-支付成功4-已取消;不能为空", trigger: "change" }
],
createTime: [
{ required: true, message: "创建时间不能为空", trigger: "blur" }
],
account: [
{ required: true, message: "支付账号不能为空", trigger: "blur" }
],
channelCost: [
{ required: true, message: "渠道成本不能为空", trigger: "blur" }
]
}
};
},
created() {
this.queryParams = {
...this.queryParams,
...this.query
}
this.getList();
},
methods: {
@ -342,7 +283,10 @@ export default {
channelId: null,
status: null,
payTime: null,
createTime: null
createTime: null,
description: null,
account: null,
channelCost: null
};
this.resetForm("form");
},

View File

@ -430,6 +430,9 @@ export default {
gearAmount: [0,0,0,0],
gearTime: [],
};
if (this.$refs.form) {
this.$refs.form.clearValidate();
}
},
/** 搜索按钮操作 */
handleQuery() {

View File

@ -60,6 +60,9 @@
{{surplusTimeDesc(deviceData.remainTime).text}}
<span class="remark-text">最近更新时间{{deviceData.lastPullTime}}</span>
</el-descriptions-item>
<el-descriptions-item label="设备剩余电量">
{{deviceData.surplusEle | defaultValue}}
</el-descriptions-item>
</el-descriptions>
</el-card>

View File

@ -24,14 +24,24 @@
<el-descriptions-item label="设备充值状态">
<dict-tag :value="detail.deviceRechargeStatus" :options="dict.type.sm_transaction_bill_device_recharge_status" size="small"/>
</el-descriptions-item>
<el-descriptions-item label="套餐名称">{{detail.suitName | defaultValue}}</el-descriptions-item>
<el-descriptions-item label="套餐时长">{{detail.suitTime | defaultValue}} {{suitTimeUnit(detail.suitTimeUnit)}}</el-descriptions-item>
<el-descriptions-item label="套餐计费模式">
<dict-tag :value="detail.suitFeeMode" :options="dict.type.suit_fee_mode" size="small"/>
</el-descriptions-item>
<el-descriptions-item label="套餐计费类型">
<dict-tag :value="detail.suitFeeType" :options="dict.type.suit_fee_type" size="small"/>
</el-descriptions-item>
<el-descriptions-item label="套餐时长" v-if="detail.suitFeeType === SuitFeeType.TIMING">{{detail.suitTime | defaultValue}} {{suitTimeUnit(detail.suitTimeUnit)}}</el-descriptions-item>
<el-descriptions-item label="套餐度数" v-if="detail.suitFeeType === SuitFeeType.COUNT">{{detail.suitTime | defaultValue}} </el-descriptions-item>
<el-descriptions-item label="套餐使用状态">
<el-tag size="small" :type="suitUsingType[suitStatus]">{{suitUsingText[suitStatus]}}</el-tag>
</el-descriptions-item>
<el-descriptions-item label="套餐开始时间">{{detail.suitStartTime | defaultValue}}</el-descriptions-item>
<el-descriptions-item label="套餐结束时间">{{detail.suitEndTime | defaultValue}}</el-descriptions-item>
<el-descriptions-item label="套餐失效时间">{{detail.suitExpireTime | defaultValue}}</el-descriptions-item>
<el-descriptions-item label="套餐开始使用时总用电量">{{detail.suitStartEle | defaultValue}} W</el-descriptions-item>
<el-descriptions-item label="套餐结束使用时总用电量">{{detail.suitEndEle | defaultValue}} W</el-descriptions-item>
</el-descriptions>
</el-card>
@ -54,19 +64,17 @@
<el-descriptions-item label="店铺名称">{{detail.storeName | defaultValue}}</el-descriptions-item>
<el-descriptions-item label="店铺地址">{{detail.storeAddress | defaultValue}}</el-descriptions-item>
</el-descriptions>
<el-descriptions>
<el-descriptions-item label="总计退款金额">{{detail.refundAmount | money | defaultValue}} </el-descriptions-item>
<el-descriptions-item label="商户总计退款金额">{{detail.refundMchAmount | money | defaultValue}} </el-descriptions-item>
<el-descriptions-item label="服务费总计退款金额">{{detail.refundServiceAmount | money | defaultValue}} </el-descriptions-item>
</el-descriptions>
</el-card>
<el-card class="box-card">
<el-tabs>
<el-tab-pane label="退款信息" lazy>
<div style="padding: 16px 20px 0;">
<el-descriptions>
<el-descriptions-item label="总计退款金额">{{detail.refundAmount | money | defaultValue}} </el-descriptions-item>
<el-descriptions-item label="商户总计退款金额">{{detail.refundMchAmount | money | defaultValue}} </el-descriptions-item>
<el-descriptions-item label="服务费总计退款金额">{{detail.refundServiceAmount | money | defaultValue}} </el-descriptions-item>
</el-descriptions>
</div>
<refund v-if="detail.billId != null" :query="{billId: detail.billId}"/>
<el-tab-pane label="支付信息" lazy>
<pay-bill v-if="detail.billId != null" :query="{bstId: detail.billId}" :view="views.recharge"/>
</el-tab-pane>
</el-tabs>
</el-card>
@ -79,12 +87,20 @@ 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 { SuitFeeType, views } from '@/utils/constants'
import PayBill from '@/views/ss/payBill/index.vue'
export default {
name: 'RechargeDetail',
components: { UserLink, DeviceLink, Refund },
dicts: ['channel_type','sm_transaction_bill_status', 'sm_transaction_bill_device_recharge_status', 'time_unit'],
components: { 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'],
computed: {
views() {
return views
},
SuitFeeType() {
return SuitFeeType
},
//
suitTimeUnit() {
return (unit) => {

View File

@ -283,7 +283,7 @@ export default {
computed: {
canRefresh() {
return (row) => {
return row.status === '0' || row.status === '6';
return row.status === '1' || row.status === '6';
}
},
canRechargeDevice() {