修改套餐、订单
This commit is contained in:
parent
8be60ed4e1
commit
2e844067ac
src/views
|
@ -33,9 +33,6 @@
|
|||
<form-col :span="span" label="价格" prop="price" v-if="[SuitFeeType.TIMING, SuitFeeType.COUNT].includes(form.feeType)">
|
||||
<el-input-number v-model="form.price" placeholder="请输入价格(元)" :min="0" :precision="2" controls-position="right" style="width: calc(100% - 2em)"/> 元
|
||||
</form-col>
|
||||
<form-col :span="span" label="押金" prop="price" v-else>
|
||||
<el-input-number v-model="form.price" placeholder="请输入押金(元)" :min="0" :precision="2" controls-position="right" style="width: calc(100% - 2em)"/> 元
|
||||
</form-col>
|
||||
<form-col :span="span" label="通电时间" prop="value" v-if="form.feeType === SuitFeeType.TIMING">
|
||||
<el-input v-model="form.value" placeholder="请输入通电时间" type="number">
|
||||
<template #append>
|
||||
|
@ -55,6 +52,9 @@
|
|||
<template #append>度</template>
|
||||
</el-input>
|
||||
</form-col>
|
||||
<form-col :span="span" label="押金" prop="deposit" v-if="SuitFeeMode.SMART === form.feeMode">
|
||||
<el-input-number v-model="form.deposit" placeholder="请输入押金(元)" :min="0" :precision="2" controls-position="right" style="width: calc(100% - 2em)"/> 元
|
||||
</form-col>
|
||||
<form-col :span="span * 2" label="详细说明" prop="description">
|
||||
<el-input v-model="form.description" placeholder="请输入详细说明" type="textarea" />
|
||||
</form-col>
|
||||
|
@ -91,7 +91,7 @@
|
|||
</el-input>
|
||||
</form-col>
|
||||
</el-row>
|
||||
<el-row v-if="SuitFeeType.timeList().includes(form.feeType)">
|
||||
<el-row v-if="SuitFeeType.TIMING === form.feeType">
|
||||
<form-col :span="10" label="时长语音播报" prop="enabledVoice" label-width="8em">
|
||||
<el-switch v-model="form.enabledVoice" active-text="开启" inactive-text="关闭"/>
|
||||
</form-col>
|
||||
|
@ -122,6 +122,9 @@ export default {
|
|||
components: { UserInput, DeviceInput },
|
||||
dicts: ['time_unit', 'suit_fee_mode', 'suit_fee_type'],
|
||||
computed: {
|
||||
SuitFeeMode() {
|
||||
return SuitFeeMode
|
||||
},
|
||||
SuitFeeType() {
|
||||
return SuitFeeType
|
||||
},
|
||||
|
@ -192,11 +195,14 @@ export default {
|
|||
{ required: true, message: "套餐名称不能为空", trigger: "blur" }
|
||||
],
|
||||
value: [
|
||||
{ required: true, message: "通电时间不能为空", trigger: "blur" }
|
||||
{ required: true, message: "通电时间/电量不能为空", trigger: "blur" }
|
||||
],
|
||||
price: [
|
||||
{ required: true, message: "价格不能为空", trigger: "blur" }
|
||||
],
|
||||
deposit: [
|
||||
{ required: true, message: "押金不能为空", trigger: "blur" }
|
||||
],
|
||||
feeMode: [
|
||||
{ required: true, message: "收费方式不能为空", trigger: "change" }
|
||||
],
|
||||
|
@ -225,7 +231,8 @@ export default {
|
|||
suitId: null,
|
||||
name: null,
|
||||
value: null,
|
||||
price: null,
|
||||
price: 0,
|
||||
deposit: 0,
|
||||
description: null,
|
||||
timeUnit: "3",
|
||||
deviceIds: this.initForm.deviceId ? [this.initForm.deviceId] : [],
|
||||
|
|
|
@ -25,13 +25,15 @@
|
|||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="通电时间" prop="value">
|
||||
<el-input
|
||||
v-model="queryParams.value"
|
||||
placeholder="请输入通电时间"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-form-item label="收费模式" prop="feeMode">
|
||||
<el-select v-model="queryParams.feeMode" placeholder="请选择收费模式" clearable @change="handleQuery">
|
||||
<el-option v-for="dict in dict.type.suit_fee_mode" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="收费类型" prop="feeType">
|
||||
<el-select v-model="queryParams.feeType" placeholder="请选择收费类型" clearable @change="handleQuery">
|
||||
<el-option v-for="dict in dict.type.suit_fee_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
|
@ -89,19 +91,30 @@
|
|||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="套餐ID" align="center" prop="suitId" width="80"/>
|
||||
<el-table-column label="套餐名称" align="center" prop="name" width="100"/>
|
||||
<el-table-column label="所属用户" align="center" prop="userName" width="180">
|
||||
<el-table-column label="所属用户" align="center" prop="userName" width="100">
|
||||
<user-link slot-scope="d" :id="d.row.userId" :name="d.row.userName"/>
|
||||
</el-table-column>
|
||||
<el-table-column label="收费模式" align="center" prop="feeMode">
|
||||
<el-table-column label="收费模式" align="center" prop="feeMode" width="100">
|
||||
<dict-tag slot-scope="d" :value="d.row.feeMode" :options="dict.type.suit_fee_mode"/>
|
||||
</el-table-column>
|
||||
<el-table-column label="收费类型" align="center" prop="feeType" width="160">
|
||||
<el-table-column label="收费类型" align="center" prop="feeType" width="120">
|
||||
<dict-tag slot-scope="d" :value="d.row.feeType" :options="dict.type.suit_fee_type"/>
|
||||
</el-table-column>
|
||||
<el-table-column label="价格/押金" align="center" prop="price" width="100">
|
||||
<template slot-scope="d">{{d.row.price | money}} 元</template>
|
||||
<el-table-column label="价格" align="center" prop="price" width="180">
|
||||
<template slot-scope="d">
|
||||
<template v-if="SuitFeeType.TIMING === d.row.feeType">
|
||||
{{d.row.price | money}} 元 / {{d.row.value}} {{suitTimeUnit(d.row.timeUnit)}}
|
||||
</template>
|
||||
<template v-else-if="SuitFeeType.COUNT === d.row.feeType">
|
||||
{{d.row.price | money}} 元 / {{d.row.value}} 度
|
||||
</template>
|
||||
<template v-else>动态计算</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="详细说明" align="center" prop="description" show-overflow-tooltip min-width="300"/>
|
||||
<el-table-column label="押金" align="center" prop="deposit" width="100">
|
||||
<template slot-scope="d">{{d.row.deposit | money}} 元</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="详细说明" align="center" prop="description" show-overflow-tooltip/>
|
||||
<el-table-column label="应用设备" align="center" prop="deviceList" min-width="200">
|
||||
<template slot-scope="d">
|
||||
<template v-for="(item, index) in d.row.deviceList" >
|
||||
|
@ -109,7 +122,7 @@
|
|||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180"/>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="100"/>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
|
@ -169,6 +182,9 @@ export default {
|
|||
mixins: [$view],
|
||||
dicts: ['time_unit', 'suit_fee_mode', 'suit_fee_type'],
|
||||
computed: {
|
||||
SuitFeeType() {
|
||||
return SuitFeeType
|
||||
},
|
||||
// 时长单位
|
||||
suitTimeUnit() {
|
||||
return (unit) => {
|
||||
|
|
|
@ -84,8 +84,16 @@
|
|||
<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="套餐价格" >
|
||||
<template v-if="SuitFeeType.TIMING === detail.suitFeeType">
|
||||
{{detail.suitPrice | money}} 元 / {{detail.suitTime}} {{suitTimeUnit(detail.suitTimeUnit)}}
|
||||
</template>
|
||||
<template v-else-if="SuitFeeType.COUNT === detail.suitFeeType">
|
||||
{{detail.suitPrice | money}} 元 / {{detail.suitTime}} 度
|
||||
</template>
|
||||
<template v-else>动态计算</template>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="套餐押金" >{{detail.suitDeposit | money | defaultValue}} 元</el-descriptions-item>
|
||||
<el-descriptions-item label="使用时长" v-if="SuitFeeType.timeList().includes(detail.suitFeeType)">{{toDescriptionFromSecond(detail.totalUse).text | defaultValue}}</el-descriptions-item>
|
||||
<el-descriptions-item label="开始时间">{{detail.suitStartTime | defaultValue}}</el-descriptions-item>
|
||||
<el-descriptions-item label="结束时间">{{detail.suitEndTime | defaultValue}}</el-descriptions-item>
|
||||
|
|
Loading…
Reference in New Issue
Block a user