配件、订单、收费方式
This commit is contained in:
parent
e7fe260843
commit
f2e7c87e0f
44
src/api/rl/accessory.js
Normal file
44
src/api/rl/accessory.js
Normal file
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询配件列表
|
||||
export function listAccessory(query) {
|
||||
return request({
|
||||
url: '/system/accessory/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询配件详细
|
||||
export function getAccessory(accessoryId) {
|
||||
return request({
|
||||
url: '/system/accessory/' + accessoryId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增配件
|
||||
export function addAccessory(data) {
|
||||
return request({
|
||||
url: '/system/accessory',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改配件
|
||||
export function updateAccessory(data) {
|
||||
return request({
|
||||
url: '/system/accessory',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除配件
|
||||
export function delAccessory(accessoryId) {
|
||||
return request({
|
||||
url: '/system/accessory/' + accessoryId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
44
src/api/rl/order.js
Normal file
44
src/api/rl/order.js
Normal file
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询订单列表
|
||||
export function listOrder(query) {
|
||||
return request({
|
||||
url: '/system/order/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询订单详细
|
||||
export function getOrder(orderId) {
|
||||
return request({
|
||||
url: '/system/order/' + orderId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增订单
|
||||
export function addOrder(data) {
|
||||
return request({
|
||||
url: '/system/order',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改订单
|
||||
export function updateOrder(data) {
|
||||
return request({
|
||||
url: '/system/order',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除订单
|
||||
export function delOrder(orderId) {
|
||||
return request({
|
||||
url: '/system/order/' + orderId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
44
src/api/rl/rule.js
Normal file
44
src/api/rl/rule.js
Normal file
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询收费模板列表
|
||||
export function listRule(query) {
|
||||
return request({
|
||||
url: '/system/rule/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询收费模板详细
|
||||
export function getRule(ruleId) {
|
||||
return request({
|
||||
url: '/system/rule/' + ruleId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增收费模板
|
||||
export function addRule(data) {
|
||||
return request({
|
||||
url: '/system/rule',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改收费模板
|
||||
export function updateRule(data) {
|
||||
return request({
|
||||
url: '/system/rule',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除收费模板
|
||||
export function delRule(ruleId) {
|
||||
return request({
|
||||
url: '/system/rule/' + ruleId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
265
src/views/system/accessory/index.vue
Normal file
265
src/views/system/accessory/index.vue
Normal file
|
@ -0,0 +1,265 @@
|
|||
<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="配件名称" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入配件名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="车型id" prop="modelId">
|
||||
<el-input
|
||||
v-model="queryParams.modelId"
|
||||
placeholder="请输入车型id"
|
||||
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>
|
||||
</el-form-item>
|
||||
</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="['system:accessory: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="['system:accessory: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="['system:accessory:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['system:accessory:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="accessoryList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="id" align="center" prop="accessoryId" />
|
||||
<el-table-column label="配件名称" align="center" prop="name" />
|
||||
<el-table-column label="车型id" align="center" prop="modelId" />
|
||||
<el-table-column label="状态:" align="center" prop="status" />
|
||||
<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="['system:accessory:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:accessory:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
: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="name">
|
||||
<el-input v-model="form.name" placeholder="请输入配件名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="车型id" prop="modelId">
|
||||
<el-input v-model="form.modelId" placeholder="请输入车型id" />
|
||||
</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 { listAccessory, getAccessory, delAccessory, addAccessory, updateAccessory } from "@/api/rl/accessory";
|
||||
|
||||
export default {
|
||||
name: "Accessory",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 配件表格数据
|
||||
accessoryList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: null,
|
||||
modelId: null,
|
||||
status: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询配件列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listAccessory(this.queryParams).then(response => {
|
||||
this.accessoryList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
accessoryId: null,
|
||||
name: null,
|
||||
modelId: null,
|
||||
status: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.accessoryId)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加配件";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const accessoryId = row.accessoryId || this.ids
|
||||
getAccessory(accessoryId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改配件";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.accessoryId != null) {
|
||||
updateAccessory(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addAccessory(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const accessoryIds = row.accessoryId || this.ids;
|
||||
this.$modal.confirm('是否确认删除配件编号为"' + accessoryIds + '"的数据项?').then(function() {
|
||||
return delAccessory(accessoryIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/accessory/export', {
|
||||
...this.queryParams
|
||||
}, `accessory_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
798
src/views/system/order/index.vue
Normal file
798
src/views/system/order/index.vue
Normal file
|
@ -0,0 +1,798 @@
|
|||
<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="订单号" prop="orderNo">
|
||||
<el-input
|
||||
v-model="queryParams.orderNo"
|
||||
placeholder="请输入订单号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="微信商户系统内部的订单号,32个字符内、可包含字母, 其他说明见商户订单号" prop="outTradeNo">
|
||||
<el-input
|
||||
v-model="queryParams.outTradeNo"
|
||||
placeholder="请输入微信商户系统内部的订单号,32个字符内、可包含字母, 其他说明见商户订单号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户ID" prop="userId">
|
||||
<el-input
|
||||
v-model="queryParams.userId"
|
||||
placeholder="请输入用户ID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="计费规则id" prop="ruleId">
|
||||
<el-input
|
||||
v-model="queryParams.ruleId"
|
||||
placeholder="请输入计费规则id"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备mac" prop="deviceMac">
|
||||
<el-input
|
||||
v-model="queryParams.deviceMac"
|
||||
placeholder="请输入设备mac"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="sn码" prop="sn">
|
||||
<el-input
|
||||
v-model="queryParams.sn"
|
||||
placeholder="请输入sn码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="支付时间" prop="payTime">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.payTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择支付时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="支付方式" prop="payType">
|
||||
<el-select v-model="queryParams.payType" placeholder="请选择支付方式" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.et_pay_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="支付状态" prop="paid">
|
||||
<el-input
|
||||
v-model="queryParams.paid"
|
||||
placeholder="请输入支付状态"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="订单总金额" prop="totalFee">
|
||||
<el-input
|
||||
v-model="queryParams.totalFee"
|
||||
placeholder="请输入订单总金额"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="实际支付金额" prop="payFee">
|
||||
<el-input
|
||||
v-model="queryParams.payFee"
|
||||
placeholder="请输入实际支付金额"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="调度费" prop="dispatchFee">
|
||||
<el-input
|
||||
v-model="queryParams.dispatchFee"
|
||||
placeholder="请输入调度费"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="骑行费" prop="ridingFee">
|
||||
<el-input
|
||||
v-model="queryParams.ridingFee"
|
||||
placeholder="请输入骑行费"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="订单时长" prop="duration">
|
||||
<el-input
|
||||
v-model="queryParams.duration"
|
||||
placeholder="请输入订单时长"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.rl_order_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="还车时间" prop="returnTime">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.returnTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择还车时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否押金抵扣" prop="depositDeduction">
|
||||
<el-input
|
||||
v-model="queryParams.depositDeduction"
|
||||
placeholder="请输入是否押金抵扣"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="扣除金额" prop="deductionAmount">
|
||||
<el-input
|
||||
v-model="queryParams.deductionAmount"
|
||||
placeholder="请输入扣除金额"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="还车结算___小时后自动退押金" prop="autoRefundDeposit">
|
||||
<el-input
|
||||
v-model="queryParams.autoRefundDeposit"
|
||||
placeholder="请输入还车结算___小时后自动退押金"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="租赁单位" prop="rentalUnit">
|
||||
<el-select v-model="queryParams.rentalUnit" placeholder="请选择租赁单位" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.rl_rental_unit"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="手续费" prop="handlingCharge">
|
||||
<el-input
|
||||
v-model="queryParams.handlingCharge"
|
||||
placeholder="请输入手续费"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="服务费" prop="platformServiceFee">
|
||||
<el-input
|
||||
v-model="queryParams.platformServiceFee"
|
||||
placeholder="请输入服务费"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="运营商分账" prop="operatorDividend">
|
||||
<el-input
|
||||
v-model="queryParams.operatorDividend"
|
||||
placeholder="请输入运营商分账"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="支付渠道id" prop="payChannel">
|
||||
<el-input
|
||||
v-model="queryParams.payChannel"
|
||||
placeholder="请输入支付渠道id"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="配送方式" prop="deliveryMethod">
|
||||
<el-select v-model="queryParams.deliveryMethod" placeholder="请选择配送方式" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.rl_distribution_mode"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="取车时间" prop="pickupTime">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.pickupTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择取车时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="代理商id" prop="agentId">
|
||||
<el-input
|
||||
v-model="queryParams.agentId"
|
||||
placeholder="请输入代理商id"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="店铺id" prop="storeId">
|
||||
<el-input
|
||||
v-model="queryParams.storeId"
|
||||
placeholder="请输入店铺id"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="取车城市" prop="pickupCity">
|
||||
<el-input
|
||||
v-model="queryParams.pickupCity"
|
||||
placeholder="请输入取车城市"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="取车地点 " prop="pickupLoc">
|
||||
<el-input
|
||||
v-model="queryParams.pickupLoc"
|
||||
placeholder="请输入取车地点 "
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="取车经度" prop="pickupLon">
|
||||
<el-input
|
||||
v-model="queryParams.pickupLon"
|
||||
placeholder="请输入取车经度"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="取车纬度" prop="pickupLat">
|
||||
<el-input
|
||||
v-model="queryParams.pickupLat"
|
||||
placeholder="请输入取车纬度"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="租车周期" prop="rentalPeriod">
|
||||
<el-input
|
||||
v-model="queryParams.rentalPeriod"
|
||||
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>
|
||||
</el-form-item>
|
||||
</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="['system:order: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="['system:order: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="['system:order:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['system:order:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="orderList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="订单id" align="center" prop="orderId" />
|
||||
<el-table-column label="订单号" align="center" prop="orderNo" />
|
||||
<el-table-column label="微信商户系统内部的订单号,32个字符内、可包含字母, 其他说明见商户订单号" align="center" prop="outTradeNo" />
|
||||
<el-table-column label="用户ID" align="center" prop="userId" />
|
||||
<el-table-column label="计费规则id" align="center" prop="ruleId" />
|
||||
<el-table-column label="设备mac" align="center" prop="deviceMac" />
|
||||
<el-table-column label="sn码" align="center" prop="sn" />
|
||||
<el-table-column label="支付时间" align="center" prop="payTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.payTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="支付方式" align="center" prop="payType">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.et_pay_type" :value="scope.row.payType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="支付状态" align="center" prop="paid" />
|
||||
<el-table-column label="类型" align="center" prop="type" />
|
||||
<el-table-column label="订单总金额" align="center" prop="totalFee" />
|
||||
<el-table-column label="实际支付金额" align="center" prop="payFee" />
|
||||
<el-table-column label="调度费" align="center" prop="dispatchFee" />
|
||||
<el-table-column label="骑行费" align="center" prop="ridingFee" />
|
||||
<el-table-column label="备注" align="center" prop="mark" />
|
||||
<el-table-column label="订单时长" align="center" prop="duration" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.rl_order_status" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="还车时间" align="center" prop="returnTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.returnTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否押金抵扣" align="center" prop="depositDeduction" />
|
||||
<el-table-column label="扣除金额" align="center" prop="deductionAmount" />
|
||||
<el-table-column label="还车结算___小时后自动退押金" align="center" prop="autoRefundDeposit" />
|
||||
<el-table-column label="租赁单位" align="center" prop="rentalUnit">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.rl_rental_unit" :value="scope.row.rentalUnit"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="手续费" align="center" prop="handlingCharge" />
|
||||
<el-table-column label="服务费" align="center" prop="platformServiceFee" />
|
||||
<el-table-column label="运营商分账" align="center" prop="operatorDividend" />
|
||||
<el-table-column label="支付渠道id" align="center" prop="payChannel" />
|
||||
<el-table-column label="配送方式" align="center" prop="deliveryMethod">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.rl_distribution_mode" :value="scope.row.deliveryMethod"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="取车时间" align="center" prop="pickupTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.pickupTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="代理商id" align="center" prop="agentId" />
|
||||
<el-table-column label="店铺id" align="center" prop="storeId" />
|
||||
<el-table-column label="取车城市" align="center" prop="pickupCity" />
|
||||
<el-table-column label="取车地点 " align="center" prop="pickupLoc" />
|
||||
<el-table-column label="取车经度" align="center" prop="pickupLon" />
|
||||
<el-table-column label="取车纬度" align="center" prop="pickupLat" />
|
||||
<el-table-column label="租车周期" align="center" prop="rentalPeriod" />
|
||||
<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="['system:order:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:order:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
: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="orderNo">
|
||||
<el-input v-model="form.orderNo" placeholder="请输入订单号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="微信商户系统内部的订单号,32个字符内、可包含字母, 其他说明见商户订单号" prop="outTradeNo">
|
||||
<el-input v-model="form.outTradeNo" placeholder="请输入微信商户系统内部的订单号,32个字符内、可包含字母, 其他说明见商户订单号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用户ID" prop="userId">
|
||||
<el-input v-model="form.userId" placeholder="请输入用户ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="计费规则id" prop="ruleId">
|
||||
<el-input v-model="form.ruleId" placeholder="请输入计费规则id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备mac" prop="deviceMac">
|
||||
<el-input v-model="form.deviceMac" placeholder="请输入设备mac" />
|
||||
</el-form-item>
|
||||
<el-form-item label="sn码" prop="sn">
|
||||
<el-input v-model="form.sn" placeholder="请输入sn码" />
|
||||
</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-item label="支付方式" prop="payType">
|
||||
<el-select v-model="form.payType" placeholder="请选择支付方式">
|
||||
<el-option
|
||||
v-for="dict in dict.type.et_pay_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="支付状态" prop="paid">
|
||||
<el-input v-model="form.paid" placeholder="请输入支付状态" />
|
||||
</el-form-item>
|
||||
<el-form-item label="订单总金额" prop="totalFee">
|
||||
<el-input v-model="form.totalFee" placeholder="请输入订单总金额" />
|
||||
</el-form-item>
|
||||
<el-form-item label="实际支付金额" prop="payFee">
|
||||
<el-input v-model="form.payFee" placeholder="请输入实际支付金额" />
|
||||
</el-form-item>
|
||||
<el-form-item label="调度费" prop="dispatchFee">
|
||||
<el-input v-model="form.dispatchFee" placeholder="请输入调度费" />
|
||||
</el-form-item>
|
||||
<el-form-item label="骑行费" prop="ridingFee">
|
||||
<el-input v-model="form.ridingFee" placeholder="请输入骑行费" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="mark">
|
||||
<el-input v-model="form.mark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="订单时长" prop="duration">
|
||||
<el-input v-model="form.duration" placeholder="请输入订单时长" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="form.status" placeholder="请选择状态">
|
||||
<el-option
|
||||
v-for="dict in dict.type.rl_order_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="还车时间" prop="returnTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.returnTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择还车时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否押金抵扣" prop="depositDeduction">
|
||||
<el-input v-model="form.depositDeduction" placeholder="请输入是否押金抵扣" />
|
||||
</el-form-item>
|
||||
<el-form-item label="扣除金额" prop="deductionAmount">
|
||||
<el-input v-model="form.deductionAmount" placeholder="请输入扣除金额" />
|
||||
</el-form-item>
|
||||
<el-form-item label="还车结算___小时后自动退押金" prop="autoRefundDeposit">
|
||||
<el-input v-model="form.autoRefundDeposit" placeholder="请输入还车结算___小时后自动退押金" />
|
||||
</el-form-item>
|
||||
<el-form-item label="租赁单位" prop="rentalUnit">
|
||||
<el-select v-model="form.rentalUnit" placeholder="请选择租赁单位">
|
||||
<el-option
|
||||
v-for="dict in dict.type.rl_rental_unit"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="手续费" prop="handlingCharge">
|
||||
<el-input v-model="form.handlingCharge" placeholder="请输入手续费" />
|
||||
</el-form-item>
|
||||
<el-form-item label="服务费" prop="platformServiceFee">
|
||||
<el-input v-model="form.platformServiceFee" placeholder="请输入服务费" />
|
||||
</el-form-item>
|
||||
<el-form-item label="运营商分账" prop="operatorDividend">
|
||||
<el-input v-model="form.operatorDividend" placeholder="请输入运营商分账" />
|
||||
</el-form-item>
|
||||
<el-form-item label="支付渠道id" prop="payChannel">
|
||||
<el-input v-model="form.payChannel" placeholder="请输入支付渠道id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="配送方式" prop="deliveryMethod">
|
||||
<el-select v-model="form.deliveryMethod" placeholder="请选择配送方式">
|
||||
<el-option
|
||||
v-for="dict in dict.type.rl_distribution_mode"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="parseInt(dict.value)"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="取车时间" prop="pickupTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.pickupTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择取车时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="代理商id" prop="agentId">
|
||||
<el-input v-model="form.agentId" placeholder="请输入代理商id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="店铺id" prop="storeId">
|
||||
<el-input v-model="form.storeId" placeholder="请输入店铺id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="取车城市" prop="pickupCity">
|
||||
<el-input v-model="form.pickupCity" placeholder="请输入取车城市" />
|
||||
</el-form-item>
|
||||
<el-form-item label="取车地点 " prop="pickupLoc">
|
||||
<el-input v-model="form.pickupLoc" placeholder="请输入取车地点 " />
|
||||
</el-form-item>
|
||||
<el-form-item label="取车经度" prop="pickupLon">
|
||||
<el-input v-model="form.pickupLon" placeholder="请输入取车经度" />
|
||||
</el-form-item>
|
||||
<el-form-item label="取车纬度" prop="pickupLat">
|
||||
<el-input v-model="form.pickupLat" placeholder="请输入取车纬度" />
|
||||
</el-form-item>
|
||||
<el-form-item label="租车周期" prop="rentalPeriod">
|
||||
<el-input v-model="form.rentalPeriod" placeholder="请输入租车周期" />
|
||||
</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 { listOrder, getOrder, delOrder, addOrder, updateOrder } from "@/api/rl/order";
|
||||
|
||||
export default {
|
||||
name: "Order",
|
||||
dicts: ['rl_order_status', 'et_pay_type', 'rl_distribution_mode', 'rl_rental_unit'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 订单表格数据
|
||||
orderList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
orderNo: null,
|
||||
outTradeNo: null,
|
||||
userId: null,
|
||||
ruleId: null,
|
||||
deviceMac: null,
|
||||
sn: null,
|
||||
payTime: null,
|
||||
payType: null,
|
||||
paid: null,
|
||||
type: null,
|
||||
totalFee: null,
|
||||
payFee: null,
|
||||
dispatchFee: null,
|
||||
ridingFee: null,
|
||||
mark: null,
|
||||
duration: null,
|
||||
status: null,
|
||||
returnTime: null,
|
||||
depositDeduction: null,
|
||||
deductionAmount: null,
|
||||
autoRefundDeposit: null,
|
||||
rentalUnit: null,
|
||||
handlingCharge: null,
|
||||
platformServiceFee: null,
|
||||
operatorDividend: null,
|
||||
payChannel: null,
|
||||
deliveryMethod: null,
|
||||
pickupTime: null,
|
||||
agentId: null,
|
||||
storeId: null,
|
||||
pickupCity: null,
|
||||
pickupLoc: null,
|
||||
pickupLon: null,
|
||||
pickupLat: null,
|
||||
rentalPeriod: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
orderNo: [
|
||||
{ required: true, message: "订单号不能为空", trigger: "blur" }
|
||||
],
|
||||
userId: [
|
||||
{ required: true, message: "用户ID不能为空", trigger: "blur" }
|
||||
],
|
||||
paid: [
|
||||
{ required: true, message: "支付状态不能为空", trigger: "blur" }
|
||||
],
|
||||
type: [
|
||||
{ required: true, message: "类型不能为空", trigger: "change" }
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询订单列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listOrder(this.queryParams).then(response => {
|
||||
this.orderList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
orderId: null,
|
||||
orderNo: null,
|
||||
outTradeNo: null,
|
||||
userId: null,
|
||||
ruleId: null,
|
||||
deviceMac: null,
|
||||
sn: null,
|
||||
payTime: null,
|
||||
payType: null,
|
||||
paid: null,
|
||||
type: null,
|
||||
totalFee: null,
|
||||
payFee: null,
|
||||
dispatchFee: null,
|
||||
ridingFee: null,
|
||||
mark: null,
|
||||
duration: null,
|
||||
status: null,
|
||||
createTime: null,
|
||||
returnTime: null,
|
||||
depositDeduction: null,
|
||||
depositOrderNo: null,
|
||||
deductionAmount: null,
|
||||
usedSn: null,
|
||||
changeReason: null,
|
||||
autoRefundDeposit: null,
|
||||
rentalUnit: null,
|
||||
handlingCharge: null,
|
||||
platformServiceFee: null,
|
||||
operatorDividend: null,
|
||||
payChannel: null,
|
||||
deliveryMethod: null,
|
||||
pickupTime: null,
|
||||
agentId: null,
|
||||
storeId: null,
|
||||
pickupCity: null,
|
||||
pickupLoc: null,
|
||||
pickupLon: null,
|
||||
pickupLat: null,
|
||||
rentalPeriod: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.orderId)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加订单";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const orderId = row.orderId || this.ids
|
||||
getOrder(orderId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改订单";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.orderId != null) {
|
||||
updateOrder(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addOrder(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const orderIds = row.orderId || this.ids;
|
||||
this.$modal.confirm('是否确认删除订单编号为"' + orderIds + '"的数据项?').then(function() {
|
||||
return delOrder(orderIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/order/export', {
|
||||
...this.queryParams
|
||||
}, `order_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
355
src/views/system/rule/index.vue
Normal file
355
src/views/system/rule/index.vue
Normal file
|
@ -0,0 +1,355 @@
|
|||
<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="数量" prop="num">
|
||||
<el-input
|
||||
v-model="queryParams.num"
|
||||
placeholder="请输入数量"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="租赁单位" prop="rentalUnit">
|
||||
<el-select v-model="queryParams.rentalUnit" placeholder="请选择租赁单位" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.rl_rental_unit"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="售价" prop="price">
|
||||
<el-input
|
||||
v-model="queryParams.price"
|
||||
placeholder="请输入售价"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="超出数量" prop="outNum">
|
||||
<el-input
|
||||
v-model="queryParams.outNum"
|
||||
placeholder="请输入超出数量"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="超出单位" prop="outUnit">
|
||||
<el-input
|
||||
v-model="queryParams.outUnit"
|
||||
placeholder="请输入超出单位"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="超出价格" prop="outPrice">
|
||||
<el-input
|
||||
v-model="queryParams.outPrice"
|
||||
placeholder="请输入超出价格"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否删除:1-删除" prop="isDeleted">
|
||||
<el-input
|
||||
v-model="queryParams.isDeleted"
|
||||
placeholder="请输入是否删除:1-删除"
|
||||
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>
|
||||
</el-form-item>
|
||||
</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="['system:rule: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="['system:rule: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="['system:rule:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['system:rule:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="ruleList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="id" align="center" prop="ruleId" />
|
||||
<el-table-column label="数量" align="center" prop="num" />
|
||||
<el-table-column label="租赁单位" align="center" prop="rentalUnit">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.rl_rental_unit" :value="scope.row.rentalUnit"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="售价" align="center" prop="price" />
|
||||
<el-table-column label="说明" align="center" prop="explain" />
|
||||
<el-table-column label="骑行价格说明" align="center" prop="instructions" />
|
||||
<el-table-column label="超出数量" align="center" prop="outNum" />
|
||||
<el-table-column label="超出单位" align="center" prop="outUnit" />
|
||||
<el-table-column label="超出价格" align="center" prop="outPrice" />
|
||||
<el-table-column label="是否删除:1-删除" align="center" prop="isDeleted" />
|
||||
<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="['system:rule:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:rule:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
: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="num">
|
||||
<el-input v-model="form.num" placeholder="请输入数量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="租赁单位" prop="rentalUnit">
|
||||
<el-select v-model="form.rentalUnit" placeholder="请选择租赁单位">
|
||||
<el-option
|
||||
v-for="dict in dict.type.rl_rental_unit"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="售价" prop="price">
|
||||
<el-input v-model="form.price" placeholder="请输入售价" />
|
||||
</el-form-item>
|
||||
<el-form-item label="说明" prop="explain">
|
||||
<el-input v-model="form.explain" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="骑行价格说明" prop="instructions">
|
||||
<el-input v-model="form.instructions" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="超出数量" prop="outNum">
|
||||
<el-input v-model="form.outNum" placeholder="请输入超出数量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="超出单位" prop="outUnit">
|
||||
<el-input v-model="form.outUnit" placeholder="请输入超出单位" />
|
||||
</el-form-item>
|
||||
<el-form-item label="超出价格" prop="outPrice">
|
||||
<el-input v-model="form.outPrice" placeholder="请输入超出价格" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否删除:1-删除" prop="isDeleted">
|
||||
<el-input v-model="form.isDeleted" placeholder="请输入是否删除:1-删除" />
|
||||
</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 { listRule, getRule, delRule, addRule, updateRule } from "@/api/rl/rule";
|
||||
|
||||
export default {
|
||||
name: "Rule",
|
||||
dicts: ['rl_rental_unit'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 收费模板表格数据
|
||||
ruleList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
num: null,
|
||||
rentalUnit: null,
|
||||
price: null,
|
||||
explain: null,
|
||||
instructions: null,
|
||||
outNum: null,
|
||||
outUnit: null,
|
||||
outPrice: null,
|
||||
isDeleted: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询收费模板列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listRule(this.queryParams).then(response => {
|
||||
this.ruleList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
ruleId: null,
|
||||
num: null,
|
||||
rentalUnit: null,
|
||||
price: null,
|
||||
explain: null,
|
||||
instructions: null,
|
||||
outNum: null,
|
||||
outUnit: null,
|
||||
outPrice: null,
|
||||
isDeleted: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.ruleId)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加收费模板";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const ruleId = row.ruleId || this.ids
|
||||
getRule(ruleId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改收费模板";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.ruleId != null) {
|
||||
updateRule(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addRule(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ruleIds = row.ruleId || this.ids;
|
||||
this.$modal.confirm('是否确认删除收费模板编号为"' + ruleIds + '"的数据项?').then(function() {
|
||||
return delRule(ruleIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/rule/export', {
|
||||
...this.queryParams
|
||||
}, `rule_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user