修改站点详情订单页面

This commit is contained in:
admin-lmm
2023-08-30 15:02:00 +08:00
parent 9ca633dcaf
commit ca21baa343

View File

@@ -1,7 +1,14 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="168px" @submit.native.prevent>
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="168px"
@submit.native.prevent
>
<el-form-item label="订单编号" prop="orderCode">
<el-input
v-model="queryParams.orderCode"
@@ -46,33 +53,60 @@
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
:clearable=false
:clearable="false"
></el-date-picker>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
</el-col>
<el-col :span="1.5">
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['order:order:export']">导出</el-button>
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['order:order:export']"
>导出</el-button
>
</el-col>
<div>
{{dateDescription}}期间总用电量{{sumUsedElectricity}}总消费金额{{sumOrderAmount}}
{{ dateDescription }}期间总用电量{{
sumUsedElectricity
}}总消费金额{{ sumOrderAmount }}
</div>
</el-row>
<el-table v-loading="loading" :data="orderList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table
v-loading="loading"
:data="orderList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<!--<el-table-column label="主键" align="center" prop="id"/>-->
<el-table-column label="订单编号" align="center" prop="orderCode" width="180px">
<el-table-column
label="订单编号"
align="center"
prop="orderCode"
width="180px"
>
<template slot-scope="scope">
<router-link
:to="'/order/index/orderDetail/'+scope.row.orderCode"
:to="'/order/index/orderDetail/' + scope.row.orderCode"
class="link-type"
>
<span>{{ scope.row.orderCode }}</span>
@@ -87,15 +121,44 @@
/>
</template>
</el-table-column>-->
<el-table-column label="订单状态描述" align="center" prop="orderStatusDescribe"/>
<el-table-column label="会员昵称" align="center" prop="nickName" width="120px"/>
<el-table-column
label="订单状态描述"
align="center"
prop="orderStatusDescribe"
/>
<el-table-column
label="会员昵称"
align="center"
prop="nickName"
width="120px"
/>
<el-table-column label="电话号码" align="center" prop="mobileNumber" width="120px"/>
<el-table-column
label="电话号码"
align="center"
prop="mobileNumber"
width="120px"
/>
<el-table-column label="站点" align="center" prop="stationName"/>
<el-table-column label="充电桩枪口号" align="center" prop="pileConnectorCode" width="200px"/>
<el-table-column label="微信商户订单号" align="center" prop="outTradeNo" width="165px"/>
<el-table-column label="启动方式" align="center" prop="startMode" width="100px">
<el-table-column label="站点" align="center" prop="stationName" />
<el-table-column
label="充电桩枪口号"
align="center"
prop="pileConnectorCode"
width="200px"
/>
<el-table-column
label="微信商户订单号"
align="center"
prop="outTradeNo"
width="165px"
/>
<el-table-column
label="启动方式"
align="center"
prop="startMode"
width="100px"
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.start_mode"
@@ -106,10 +169,7 @@
<el-table-column label="支付方式" align="center" prop="payMode">
<template slot-scope="scope">
<dict-tag
:options="dict.type.pay_mode"
:value="scope.row.payMode"
/>
<dict-tag :options="dict.type.pay_mode" :value="scope.row.payMode" />
</template>
</el-table-column>
@@ -122,18 +182,38 @@
</template>
</el-table-column>
<el-table-column label="支付金额" align="center" prop="payAmount"/>
<el-table-column label="充电度数" align="center" prop="chargingDegree" width="100px"/>
<el-table-column label="支付金额" align="center" prop="payAmount" />
<el-table-column
label="充电度数"
align="center"
prop="chargingDegree"
width="100px"
/>
<el-table-column label="起始soc" align="center" prop="startSoc" />
<el-table-column label="终止soc" align="center" prop="endSoc" />
<!--<el-table-column label="订单生成日期" align="center" prop="createTime" width="180"/>-->
<el-table-column label="开始充电时间" align="center" prop="chargeStartTime" width="180"/>
<el-table-column label="结束充电时间" align="center" prop="chargeEndTime" width="180"/>
<el-table-column label="订单总金额" align="center" prop="orderAmount" width="100px"/>
<el-table-column
label="开始充电时间"
align="center"
prop="chargeStartTime"
width="180"
/>
<el-table-column
label="结束充电时间"
align="center"
prop="chargeEndTime"
width="180"
/>
<el-table-column
label="订单总金额"
align="center"
prop="orderAmount"
width="100px"
/>
</el-table>
<pagination
v-show="total>0"
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@@ -143,23 +223,23 @@
</template>
<script>
import {listOrder, totalData} from "@/api/order/order";
import { listOrder, totalData } from "@/api/order/order";
import Template from "@/views/billing/template";
import {listStation} from "@/api/pile/station";
import {getDay} from "@/utils/common";
import { listStation } from "@/api/pile/station";
import { getDay } from "@/utils/common";
export default {
name: "stationOrderList",
components: {Template},
components: { Template },
props: {
stationId: "",
},
dicts: ['order_status', 'start_mode', 'pay_mode', 'pay_status'],
dicts: ["order_status", "start_mode", "pay_mode", "pay_status"],
data() {
return {
dateDescription: "",
sumOrderAmount:'',
sumUsedElectricity:'',
sumOrderAmount: "",
sumUsedElectricity: "",
// 遮罩
loading: true,
// 选中数组
@@ -184,6 +264,8 @@ export default {
open: false,
// 查询参数
queryParams: {
startTime: null,
endTime: null,
pageNum: 1,
pageSize: 10,
orderCode: null,
@@ -209,7 +291,7 @@ export default {
},
methods: {
async dataLoading() {
console.log("加载站点订单数据...")
console.log("加载站点订单数据...");
// 设置默认日期
await this.defaultDate();
// 查询订单列表
@@ -220,18 +302,19 @@ export default {
/** 查询订单列表 */
getList() {
this.loading = true;
listOrder(this.queryParams).then(response => {
console.log("查询订单列表 this.queryParams", this.queryParams);
listOrder(this.queryParams).then((response) => {
this.orderList = response.rows;
console.log('this.queryParams', this.queryParams)
console.log('response', response)
console.log("this.queryParams", this.queryParams);
console.log("response", response);
this.total = response.total;
this.loading = false;
});
},
// 获取订单总金额数据
getOrderTotalData() {
totalData(this.queryParams).then(response => {
console.log('getOrderTotalData', response);
totalData(this.queryParams).then((response) => {
console.log("getOrderTotalData", response);
this.dateDescription = response.data.dateDescription;
this.sumOrderAmount = response.data.sumOrderAmount;
this.sumUsedElectricity = response.data.sumUsedElectricity;
@@ -265,7 +348,7 @@ export default {
createTime: null,
updateBy: null,
updateTime: null,
delFlag: null
delFlag: null,
};
this.orderDetailList = [];
this.resetForm("form");
@@ -285,55 +368,59 @@ export default {
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 订单详情序号 */
rowOrderDetailIndex({row, rowIndex}) {
rowOrderDetailIndex({ row, rowIndex }) {
row.index = rowIndex + 1;
},
/** 复选框选中数据 */
handleOrderDetailSelectionChange(selection) {
this.checkedOrderDetail = selection.map(item => item.index)
this.checkedOrderDetail = selection.map((item) => item.index);
},
/** 导出按钮操作 */
handleExport() {
this.download('order/order/export', {
...this.queryParams
}, `order_${new Date().getTime()}.xlsx`)
this.download(
"order/order/export",
{
...this.queryParams,
},
`order_${new Date().getTime()}.xlsx`
);
},
/** 查询充电站信息列表 */
getStationList() {
const queryStationParams = {
pageNum: 1,
pageSize: 999
pageSize: 999,
};
listStation(queryStationParams).then((response) => {
console.log("订单列表页-查询站点列表", response)
console.log("订单列表页-查询站点列表", response);
this.stationList = response.rows;
});
},
//设置默认日期
defaultDate () {
defaultDate() {
console.log(getDay(-7));
//字符串拼接,开始时间,结束时间
let beg = getDay(-7) + " 00:00:00"; //当月第一天
let beg = getDay(-7) + " 00:00:00"; //当月第一天
let end = getDay(0) + " 23:59:59"; //当天
this.settleTimeRange = [beg, end] //将值设置给插件绑定的数据
this.settleTimeRange = [beg, end]; //将值设置给插件绑定的数据
// console.log("defaultDate", this.settleTimeRange);
},
},
watch: {
settleTimeRange(newValue, oldValue) {
if (newValue != null && newValue.length > 0) {
this.queryParams.startSettleTime = newValue[0];
this.queryParams.endSettleTime = newValue[1];
this.queryParams.startTime = newValue[0];
this.queryParams.endTime = newValue[1];
}
},
}
},
};
</script>