Compare commits

..

2 Commits

Author SHA1 Message Date
磷叶
041ca82142 Merge branch 'master' of http://61.174.243.28:15863/chuangte/electripper-v2-ui 2025-03-27 18:04:12 +08:00
磷叶
cb5c9f1549 订单、支付回调 2025-03-27 18:04:06 +08:00
4 changed files with 115 additions and 65 deletions

View File

@ -30,12 +30,11 @@ export const ChannelType = {
// 渠道API类型 // 渠道API类型
export const ChannelApiType = { export const ChannelApiType = {
WECHAT: "1", // 微信 WECHAT: "WX", // 微信
ALI_PAY: "2", // 支付宝 ALI_PAY: "ALI", // 支付宝
BANK: "3", // 银行卡 BANK: "BANK", // 银行卡
TL_WX: "5", // 通联微信 BALANCE: "BALANCE", // 余额
TM_WX: "6", // 太米微信 TM_WX: "TM_WX", // 太米微信
XY_WX: "7", // 国通星驿微信
} }
// 运营区状态 // 运营区状态
@ -123,6 +122,12 @@ export const DeviceStatus = {
}, },
} }
// 设备锁状态
export const DeviceLockStatus = {
LOCKED: "0", // 锁车
UNLOCKED: "1", // 开锁
}
// 加盟类型 // 加盟类型
export const AreaJoinType = { export const AreaJoinType = {
JOIN: "1", // 加盟 JOIN: "1", // 加盟

View File

@ -276,7 +276,7 @@
icon="el-icon-unlock" icon="el-icon-unlock"
@click="handleUnlock(scope.row)" @click="handleUnlock(scope.row)"
v-has-permi="['bst:device:unlock']" v-has-permi="['bst:device:unlock']"
v-show="DeviceStatus.canAdminUnlock().includes(scope.row.status)" v-show="canUnlock(scope.row)"
>开锁</el-button> >开锁</el-button>
<el-button <el-button
size="mini" size="mini"
@ -284,7 +284,7 @@
icon="el-icon-lock" icon="el-icon-lock"
@click="handleLock(scope.row)" @click="handleLock(scope.row)"
v-has-permi="['bst:device:lock']" v-has-permi="['bst:device:lock']"
v-show="DeviceStatus.canLock().includes(scope.row.status)" v-show="canLock(scope.row)"
>锁车</el-button> >锁车</el-button>
<el-button <el-button
size="mini" size="mini"
@ -350,6 +350,7 @@ import FormCol from "@/components/FormCol/index.vue";
import DeviceEditDialog from './components/DeviceEditDialog.vue'; import DeviceEditDialog from './components/DeviceEditDialog.vue';
import BooleanTag from '@/components/BooleanTag/index.vue'; import BooleanTag from '@/components/BooleanTag/index.vue';
import { DeviceStatus } from '@/utils/enums'; import { DeviceStatus } from '@/utils/enums';
import { $device } from '@/views/bst/device/mixins';
// //
const defaultSort = { const defaultSort = {
@ -359,7 +360,7 @@ const defaultSort = {
export default { export default {
name: "Device", name: "Device",
mixins: [$showColumns], mixins: [$showColumns, $device],
dicts: ['device_status', 'device_lock_status', 'device_iot_status', 'device_online_status', 'device_quality'], dicts: ['device_status', 'device_lock_status', 'device_iot_status', 'device_online_status', 'device_quality'],
components: {FormCol, DeviceEditDialog, BooleanTag}, components: {FormCol, DeviceEditDialog, BooleanTag},
data() { data() {

View File

@ -0,0 +1,18 @@
import { DeviceLockStatus, DeviceStatus } from '@/utils/enums';
export const $device = {
computed: {
canUnlock() {
return (row) => {
return DeviceStatus.canAdminUnlock().includes(row.status)
&& DeviceLockStatus.LOCKED == row.lockStatus
}
},
canLock() {
return (row) => {
return DeviceStatus.canLock().includes(row.status)
&& DeviceLockStatus.UNLOCKED == row.lockStatus
}
},
}
}

View File

@ -26,9 +26,14 @@
</el-select> </el-select>
</form-col> </form-col>
<form-col :span="span" label="预存金额" prop="depositAmount"> <form-col :span="span" label="预存金额" prop="depositAmount">
<el-input v-model="form.depositAmount" placeholder="请输入预存金额" type="number"> <el-input-number
<template slot="append"></template> v-model="form.depositAmount"
</el-input> placeholder="请输入预存金额"
type="number"
:precision="2"
controls-position="right"
style="width: calc(100% - 2em)"
/>
</form-col> </form-col>
<form-col :span="span" label="免费时长" prop="freeRideTime"> <form-col :span="span" label="免费时长" prop="freeRideTime">
<el-input v-model="form.freeRideTime" placeholder="请输入免费时长(分钟)"> <el-input v-model="form.freeRideTime" placeholder="请输入免费时长(分钟)">
@ -74,62 +79,76 @@
<el-row :gutter="10"> <el-row :gutter="10">
<collapse-panel title="计费规则" :value="true"> <collapse-panel title="计费规则" :value="true">
<template v-if="form.ridingRule === SuitRidingRule.START && form.startRule"> <template v-if="form.ridingRule === SuitRidingRule.START && form.startRule">
<div class="rule-row">
<el-input-number <el-input-number
size="small"
v-model="form.startRule.startingTime" v-model="form.startRule.startingTime"
placeholder="起步时间" placeholder="起步时间"
:min="0" :min="0"
:precision="1" :precision="0"
controls-position="right" controls-position="right"
style="width: 120px;" style="width: 120px;"
/> />
{{unitLabel(form.rentalUnit)}}以内起步价 {{unitLabel(form.rentalUnit)}}以内起步价
<el-input-number <el-input-number
size="small"
v-model="form.startRule.startingPrice" v-model="form.startRule.startingPrice"
placeholder="起步价" placeholder="起步价"
type="number" type="number"
:precision="2"
controls-position="right" controls-position="right"
style="width: 120px;" style="width: 120px;"
/> />
<br/>超出起步时间后超出的时间每
</div>
<div class="rule-row">
超出起步时间后超出的时间每
<el-input-number <el-input-number
size="small"
v-model="form.startRule.timeoutTime" v-model="form.startRule.timeoutTime"
placeholder="超时时间" placeholder="超时时间"
type="number" type="number"
:precision="0"
controls-position="right" controls-position="right"
style="width: 120px;" style="width: 120px;"
/> />
{{unitLabel(form.rentalUnit)}} {{unitLabel(form.rentalUnit)}}
<el-input-number <el-input-number
size="small"
v-model="form.startRule.timeoutPrice" v-model="form.startRule.timeoutPrice"
placeholder="超时价格" placeholder="超时价格"
type="number" type="number"
:precision="2"
controls-position="right" controls-position="right"
style="width: 120px;" style="width: 120px;"
/> />
不满{{form.startRule.timeoutTime}}{{unitLabel(form.rentalUnit)}}{{form.startRule.timeoutTime}}{{unitLabel(form.rentalUnit)}}计算 不满{{form.startRule.timeoutTime}}{{unitLabel(form.rentalUnit)}}{{form.startRule.timeoutTime}}{{unitLabel(form.rentalUnit)}}计算
</div>
</template> </template>
<template v-else-if="form.ridingRule === SuitRidingRule.INTERVAL && form.intervalRule"> <template v-else-if="form.ridingRule === SuitRidingRule.INTERVAL && form.intervalRule">
<div v-for="(item, index) in form.intervalRule" :key="index"> <div v-for="(item, index) in form.intervalRule" :key="index" class="rule-row">
<el-input-number <el-input-number
size="small"
:value="startTime(index)" :value="startTime(index)"
controls-position="right" controls-position="right"
style="width: 120px;" style="width: 120px;"
placeholder="开始" placeholder="开始"
disabled disabled
:precision="1" :precision="0"
/> />
<template v-if="index < form.intervalRule.length - 1"> <template v-if="index < form.intervalRule.length - 1">
~ ~
<el-input-number <el-input-number
size="small"
v-model="item.end" v-model="item.end"
controls-position="right" controls-position="right"
style="width: 120px;" style="width: 120px;"
placeholder="结束" placeholder="结束"
:min="minEnd(index)" :min="minEnd(index)"
:max="maxEnd(index)" :max="maxEnd(index)"
:precision="1" :precision="0"
/> />
{{unitLabel(form.rentalUnit)}}之间 {{unitLabel(form.rentalUnit)}}之间
</template> </template>
@ -138,16 +157,18 @@
</template> </template>
<el-input-number <el-input-number
size="small"
v-model="item.eachUnit" v-model="item.eachUnit"
controls-position="right" controls-position="right"
style="width: 120px;" style="width: 120px;"
placeholder="间隔" placeholder="间隔"
:min="0.1" :min="1"
:precision="1" :precision="0"
:max="maxEachUnit(index)" :max="maxEachUnit(index)"
/> />
{{unitLabel(form.rentalUnit)}}收费 {{unitLabel(form.rentalUnit)}}收费
<el-input-number <el-input-number
size="small"
v-model="item.fee" v-model="item.fee"
controls-position="right" controls-position="right"
style="width: 120px;" style="width: 120px;"
@ -251,7 +272,7 @@ export default {
if (index == 0) { if (index == 0) {
return 0; return 0;
} }
return this.form.intervalRule[index - 1].end; return this.form.intervalRule[index - 1].end + 1;
} }
}, },
// //
@ -260,7 +281,7 @@ export default {
if (index >= this.form.intervalRule.length - 2 ) { if (index >= this.form.intervalRule.length - 2 ) {
return 999999999; return 999999999;
} else { } else {
return this.form.intervalRule[index + 1].end; return this.form.intervalRule[index + 1].end - 1;
} }
} }
}, },
@ -293,7 +314,7 @@ export default {
addRidingRule(index) { addRidingRule(index) {
let current = this.form.intervalRule[index]; let current = this.form.intervalRule[index];
this.form.intervalRule.splice(index + 1, 0, { this.form.intervalRule.splice(index + 1, 0, {
start: current.end, start: null,
end: current.end + 1, end: current.end + 1,
eachUnit: 1, eachUnit: 1,
fee: null, fee: null,
@ -370,11 +391,13 @@ export default {
data.intervalRule.forEach((item,index) => { data.intervalRule.forEach((item,index) => {
if (index == 0) { if (index == 0) {
item.start = 0; item.start = 0;
} else if (index == data.intervalRule.length - 1) {
item.end = null;
} else { } else {
item.start = data.intervalRule[index - 1].end; item.start = data.intervalRule[index - 1].end;
} }
if (index == data.intervalRule.length - 1) {
item.end = null;
}
}); });
} }
const promise = this.form.id != null ? updateSuit(data) : addSuit(data); const promise = this.form.id != null ? updateSuit(data) : addSuit(data);
@ -395,4 +418,7 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.rule-row {
margin-bottom: 4px;
}
</style> </style>