调整优化等

This commit is contained in:
邱贞招 2024-06-25 09:30:33 +08:00
parent 6411c17fe5
commit 65dd5f5ff6
14 changed files with 327 additions and 126 deletions

View File

@ -51,3 +51,30 @@ export function delOrder(orderId) {
method: 'delete'
})
}
// 改价
export function changePrice(data) {
return request({
url: '/appVerify/order/editPrice',
method: 'put',
data: data
})
}
// 退款
export function refund(data) {
return request({
url: '/appVerify/order/refund',
method: 'put',
data: data
})
}
// 退款
export function returnVehicle(data) {
return request({
url: '/appVerify/device/return',
method: 'post',
params: data
})
}

View File

@ -54,6 +54,8 @@ export default {
coordList: "",
timer: "",
status:true,
lon2: null,
lat2: null
};
},
props: ["pathList", "dataId","lon","lat"],
@ -114,6 +116,8 @@ export default {
console.log("接收参数", this.pathList);
console.log("接收参数", this.lon);
console.log("接收参数", this.lat);
this.lon2 = this.lon === undefined ? 120.35218 : this.lon;
this.lat2 = this.lat === undefined ? 26.944335 : this.lat;
// console.log(typeof JSON.parse(this.pathList));
await AMapLoader.load({
key: globalConfig.aMap.key, // WebKey load
@ -129,7 +133,7 @@ export default {
//id
viewMode: "3D", //3D
zoom: 13, //
center: [this.lon,this.lat], //--
center: [this.lon2, this.lat2], //
});
this.map.setFitView();
})
@ -222,7 +226,7 @@ export default {
}
.input-card-left {
position: absolute;
top: -40px;
top: 5px;
left: 20px;
font-size: 13px;
line-height: 20px;

View File

@ -91,17 +91,8 @@ export default {
},
//
trajectory() {
console.log("this.tripRouteStr-----------------"+JSON.stringify(this.tripRouteStr))
this.line = JSON.parse(this.tripRouteStr)
let line = this.line;
console.log("this.tripRouteStr-----------------"+JSON.parse(this.tripRouteStr))
if (Array.isArray(line)) {
// this.lineArr
console.log("this.lineArr-是数组");
} else {
// this.lineArr
console.log("this.lineArr-不是数组");
}
this.marker = new AMap.Marker({
map: this.map,
position: line[0],
@ -136,25 +127,11 @@ export default {
this.map.setFitView();
},
// /**
// * 线
// *
// * @param pointerArray [[a,b],[c,d]]
// * @return Array {min:number[a,b], max:number[c,d]}
// */
// getMaxBoundsPointer(pointerArray){
// console.log("JSON-------------"+JSON.stringify(pointerArray))
// let lngArray = pointerArray.map(item => item[0])
// let latArray = pointerArray.map(item => item[1])
// console.log("lngArray-------------"+lngArray)
// console.log("latArray-------------"+latArray)
// return {
// min: [Math.min(...lngArray), Math.min(...latArray)],
// max: [Math.max(...lngArray), Math.max(...latArray)],
// }
// },
startAnimation() {
this.marker.moveAlong(this.line, 200);
this.marker.moveAlong(this.line, {
//
duration: 100,//
});
},
pauseAnimation() {
this.marker.pauseMove();

View File

@ -72,6 +72,7 @@
<!-- <el-table-column label="主键" align="center" prop="id" />-->
<el-table-column label="工单编号" width="180" align="center" prop="orderNo" />
<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="adminName" />
<el-table-column label="换电前电量(%)" width="120" align="center">
<template slot-scope="scope">
@ -113,7 +114,7 @@
<dict-tag :options="dict.type.et_order_is_success" :value="scope.row.isSuccess"/>
</template>
</el-table-column>
<el-table-column label="是否有效1111111111" align="center" prop="isEffective">
<el-table-column label="是否有效" align="center" prop="isEffective">
<template slot-scope="scope">
<dict-tag :options="dict.type.et_order_is_effective" :value="scope.row.isEffective"/>
</template>

View File

@ -248,7 +248,7 @@
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="停车点还车" label-width="90">
<el-form-item label="强制停车点还车" label-width="90">
<el-radio-group v-model="form.parkingReturn" style="width: 60%">
<el-radio v-for="dict in dict.type.et_business_switch" :key="dict.value"
:label="dict.value">{{ dict.label }}</el-radio>

View File

@ -90,12 +90,6 @@
<dict-tag :options="dict.type.et_parking_type" :value="scope.row.type"/>
</template>
</el-table-column>
<!-- <el-table-column label="照片" align="center" prop="picture" width="100">-->
<!-- <template slot-scope="scope">-->
<!-- <image-preview :src="scope.row.picture" :width="50" :height="50"/>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="区域" align="center" prop="areaId" />-->
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
@ -130,7 +124,7 @@
/>
<!-- 添加或修改禁停区对话框 -->
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
<el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-col :span="24">
<el-form-item label="禁停区" label-width="90" prop="parkingName">
@ -149,11 +143,6 @@
</el-radio-group>
</el-form-item>
</el-col>
<!-- <el-col :span="12" v-show="form.type =='1' ">-->
<!-- <el-form-item label="图片" prop="picture" >-->
<!-- <image-upload v-model="form.picture"/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
</el-col>
<el-col :span="24">
<el-form-item label="边界" prop="boundaryStr">
@ -296,7 +285,7 @@ export default {
latitude: null,
createBy: null,
createTime: null,
type: "1"
type: "2"
};
this.resetForm("form");
},

View File

@ -130,7 +130,7 @@
/>
<!-- 添加或修改禁行区对话框 -->
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
<el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-col :span="24">
<el-form-item label="禁行区" label-width="90" prop="parkingName">
@ -296,7 +296,7 @@ export default {
latitude: null,
createBy: null,
createTime: null,
type: "1"
type: "3"
};
this.resetForm("form");
},

View File

@ -130,7 +130,7 @@
/>
<!-- 添加或修改停车区对话框 -->
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
<el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-col :span="24">
<el-form-item label="停车区" label-width="90" prop="parkingName">
@ -149,11 +149,6 @@
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12" v-show="form.type =='1' ">
<el-form-item label="周边环境图片" prop="picture" >
<image-upload v-model="form.picture"/>
</el-form-item>
</el-col>
</el-col>
<el-col :span="24">
<el-form-item label="边界" prop="boundaryStr">
@ -172,6 +167,11 @@
</el-form-item>
</el-col>
</el-col>
<el-col :span="24" v-show="form.type =='1' ">
<el-form-item label="周边环境图片" prop="picture" >
<image-upload v-model="form.picture"/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>

View File

@ -36,6 +36,16 @@
v-hasPermi="['system:articleClassify:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd2"
v-hasPermi="['system:articleClassify:add']"
>新增顶级分类</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
@ -57,6 +67,7 @@
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
>
<el-table-column prop="classifyName" label="分类名称" width="260"></el-table-column>
<el-table-column prop="deptName" label="运营商" width="260"></el-table-column>
<el-table-column prop="orderNum" label="排序" width="200"></el-table-column>
<el-table-column prop="status" label="状态" width="100">
<template slot-scope="scope">
@ -137,6 +148,40 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<el-dialog :title="title2" :visible.sync="open2" width="600px" append-to-body>
<el-form ref="form2" :model="form2" :rules="rules2" label-width="80px">
<el-row>
<el-col :span="12">
<el-form-item label="顶级分类名称" label-width="120" prop="classifyName">
<el-input style="width: 60%" v-model="form2.classifyName" placeholder="请输入分类名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="显示排序" prop="orderNum">
<el-input-number v-model="form2.orderNum" controls-position="right" :min="0" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="分类状态">
<el-radio-group v-model="form2.status">
<el-radio
v-for="dict in dict.type.sys_normal_disable"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm2"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
@ -161,6 +206,7 @@ export default {
deptOptions: [],
//
title: "",
title2: "",
//
open: false,
//
@ -174,6 +220,8 @@ export default {
},
//
form: {},
//
form2: {},
//
rules: {
parentId: [
@ -185,6 +233,14 @@ export default {
orderNum: [
{ required: true, message: "显示排序不能为空", trigger: "blur" }
],
},
rules2: {
classifyName: [
{ required: true, message: "分类名称不能为空", trigger: "blur" }
],
orderNum: [
{ required: true, message: "显示排序不能为空", trigger: "blur" }
],
}
};
},
@ -214,6 +270,7 @@ export default {
//
cancel() {
this.open = false;
this.open2 = false;
this.reset();
},
//
@ -225,7 +282,15 @@ export default {
orderNum: undefined,
status: "0"
};
this.form2 = {
classifyId: undefined,
parentId: "0",
classifyName: undefined,
orderNum: undefined,
status: "0"
};
this.resetForm("form");
this.resetForm("form2");
},
/** 搜索按钮操作 */
handleQuery() {
@ -248,6 +313,12 @@ export default {
this.deptOptions = this.handleTree(response.data, "classifyId");
});
},
/** 新增按钮操作 */
handleAdd2() {
this.reset();
this.open2 = true;
this.title2 = "添加顶级分类";
},
/** 展开/折叠操作 */
toggleExpandAll() {
this.refreshTable = false;
@ -292,6 +363,26 @@ export default {
}
});
},
/** 提交按钮 */
submitForm2: function() {
this.$refs["form2"].validate(valid => {
if (valid) {
if (this.form2.classifyId != undefined) {
updateDept(this.form2).then(response => {
this.$modal.msgSuccess("修改成功");
this.open2 = false;
this.getList();
});
} else {
addDept(this.form2).then(response => {
this.$modal.msgSuccess("新增成功");
this.open2 = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
this.$modal.confirm('是否确认删除名称为"' + row.classifyName + '"的数据项?').then(function() {

View File

@ -108,6 +108,8 @@
<el-table-column label="车牌号" align="center" prop="vehicleNum" />
<el-table-column label="运营区" align="center" prop="areaName" />
<el-table-column label="定位" align="center" prop="location" :show-overflow-tooltip="true"/>
<el-table-column label="电压(V)" align="center" prop="voltage" />
<el-table-column label="版本" align="center" prop="version" />
<el-table-column label="剩余电量(%)" align="center" prop="remainingPower" />
<el-table-column label="车辆状态" align="center" prop="status">
<template slot-scope="scope">
@ -119,7 +121,7 @@
<dict-tag :options="dict.type.et_device_lock_status" :value="scope.row.lockStatus"/>
</template>
</el-table-column>
<el-table-column label="车辆上下线" align="center" prop="onlineStatus">
<el-table-column label="网络状态" align="center" prop="onlineStatus">
<template slot-scope="scope">
<dict-tag :options="dict.type.as_online_status" :value="scope.row.onlineStatus"/>
</template>
@ -222,7 +224,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="SN" prop="sn">
<el-input v-model="form.sn" placeholder="请输入设备SN" :disabled="title=='修改设备'"/>
<el-input v-model="form.sn" placeholder="请输入设备SN" :disabled="title=='修改设备' && userName != 'admin'"/>
</el-form-item>
</el-col>
<el-col :span="12">
@ -249,7 +251,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="运营区" prop="areaId" >
<el-select v-model="form.areaId" placeholder="请选择运营区">
<el-select v-model="form.areaId" clearable placeholder="请选择运营区">
<el-option
v-for="item in areaOptions"
:key="item.areaId"
@ -313,7 +315,7 @@
</el-popover>
</template>
</el-form-item>
<el-form-item label="车辆上下线" style="color: #ffcc00;font-weight: 700">{{ form.onlineStatus == 1 ? '在线' : '离线' }}</el-form-item>
<el-form-item label="网络状态" style="color: #ffcc00;font-weight: 700">{{ form.onlineStatus == 1 ? '在线' : '离线' }}</el-form-item>
</el-col>
</el-row>
<el-row>
@ -455,9 +457,9 @@ export default {
mac: [
{ required: true, message: "MAC不能为空", trigger: "blur" }
],
areaId: [
{ required: true, message: "运营区不能为空", trigger: "blur" }
],
// areaId: [
// { required: true, message: "", trigger: "blur" }
// ],
}
};
},
@ -595,7 +597,7 @@ export default {
const deviceId = row.deviceId || this.ids
getDevice(deviceId).then(response => {
let form1 = response.data;
let text = form1.status === '0'? '上架': '下架';
let text = form1.status === '0'? '上线': '下线';
form1.status = form1.status === '0'? '1': '0';
if(form1.areaId == null){
this.$modal.msgError("未绑定运营区,无法上架!")

View File

@ -1,14 +1,6 @@
<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="userName">-->
<!-- <el-input-->
<!-- v-model="queryParams.userName"-->
<!-- placeholder="请输入用户名称"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item label="故障部位" prop="type">
<el-select v-model="queryParams.type" placeholder="请选择故障部位" clearable>
<el-option
@ -36,38 +28,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="['system:fault: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:fault: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:fault:remove']"-->
<!-- >删除</el-button>-->
<!-- </el-col>-->
<el-col :span="1.5">
<el-button
type="warning"
@ -85,7 +45,7 @@
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="报修id" align="center" prop="faultId" />-->
<el-table-column label="用户" align="center" prop="userName" />
<el-table-column label="车辆编号" align="center" prop="deviceMac" />
<el-table-column label="车辆编号" align="center" prop="sn" />
<el-table-column label="图片" align="center" prop="picture" width="100">
<template slot-scope="scope">
<image-preview :src="scope.row.picture" :width="50" :height="50"/>
@ -126,13 +86,6 @@
@click="handleEdit(scope.row)"
v-hasPermi="['system:fault:query']"
>审核</el-button>
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-delete"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- v-hasPermi="['system:fault:remove']"-->
<!-- >删除</el-button>-->
</template>
</el-table-column>
</el-table>
@ -151,7 +104,7 @@
<el-row>
<el-col :span="24">
<el-form-item label="用户:">{{ form.userName }}</el-form-item>
<el-form-item label="车辆编号:">{{ form.deviceMac }}</el-form-item>
<el-form-item label="车辆编号:">{{ form.sn }}</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="图片:">

View File

@ -107,7 +107,7 @@
:value="dict.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="还车结算">
<el-form-item label="还车结算" prop="autoRefundDeposit">
<el-col :span="4">
<el-input v-model="form.autoRefundDeposit" placeholder="请输入" />
</el-col>
@ -386,9 +386,9 @@ export default {
status: [
{ required: true, message: '请选择状态', trigger: 'change' },
],
// autoRefundDeposit: [
// { required: true, message: '', trigger: 'blur' },
// ],
autoRefundDeposit: [
{ required: true, message: '请输入还车结算时间', trigger: 'blur' },
],
orderExceedMinutes: [
{ required: true, message: '请输入订单超过时间', trigger: 'blur' },
],

View File

@ -194,11 +194,13 @@ export default {
],
fullVoltage: [
{ required: true, message: "满电电压不能为空", trigger: "blur" },
{ pattern: /^\d+$/, message: '满电电压必须为正整数', trigger: 'blur' }
{ pattern: /^\d+(\.\d{1,2})?$/, message: '请输入最多两位小数的浮点数', trigger: 'blur' }
],
lowVoltage: [
{ required: true, message: "亏电电压不能为空", trigger: "blur" },
{ pattern: /^\d+$/, message: '亏电电压必须为正整数', trigger: 'blur' }
{ pattern: /^\d+(\.\d{1,2})?$/, message: '请输入最多两位小数的浮点数', trigger: 'blur' }
],
fullEndurance: [
{ required: true, message: "满电续航不能为空", trigger: "blur" },

View File

@ -60,6 +60,7 @@
<el-table-column label="订单号" :show-overflow-tooltip="true" align="center" prop="orderNo" />
<el-table-column label="用户" align="center" prop="userName" />
<el-table-column label="设备SN" align="center" prop="sn" />
<el-table-column label="车牌号" align="center" prop="vehicleNum" />
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="dict.type.et_order_status" :value="scope.row.status"/>
@ -98,8 +99,8 @@
<el-table-column label="金额(元)" align="center" prop="totalFee" />
<el-table-column label="备注" align="center" prop="mark" />
<el-table-column label="订单时长" align="center" prop="duration" :formatter="formatDuration"/>
<el-table-column label="距离" align="center" prop="distance" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<el-table-column label="距离(公里)" align="center" prop="distance" :formatter="formatDistance"/>
<el-table-column label="操作" align="center" width="150" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
@ -108,6 +109,30 @@
@click="handleUpdate(scope.row)"
v-hasPermi="['system:order:edit']"
>详情</el-button>
<el-button
size="mini"
type="text"
v-if="scope.row.status == 1 || scope.row.status == 3"
icon="el-icon-edit"
@click="changePrice(scope.row)"
v-hasPermi="['system:order:edit']"
>改价</el-button>
<el-button
size="mini"
type="text"
v-if="scope.row.status == 4"
icon="el-icon-edit"
@click="refund(scope.row)"
v-hasPermi="['system:order:edit']"
>退款</el-button>
<el-button
size="mini"
type="text"
v-if="scope.row.status == 2"
icon="el-icon-edit"
@click="returnVehicle(scope.row)"
v-hasPermi="['system:order:edit']"
>辅助还车</el-button>
</template>
</el-table-column>
</el-table>
@ -130,7 +155,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="租赁用户:" >{{ form.phonenumber }}</el-form-item>
<el-form-item label="行驶距离:" >{{ form.distance }}</el-form-item>
<el-form-item label="行驶距离:" >{{ formatDistance(form) }}</el-form-item>
</el-col>
</el-row>
<el-row>
@ -156,6 +181,7 @@
<trajectory-map
v-if="showPlaceSearchMap"
ref="map"
:key="key"
height="400px"
:trip-route-str="form.tripRouteStr"
/>
@ -179,11 +205,11 @@
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="支付方式:">{{ formatType(form.wx) }}</el-form-item>
<el-form-item label="支付方式:">{{ formatType(form.payType) }}</el-form-item>
<el-form-item label="支付时间:">{{ form.payTime }}</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="收费方式:" >{{ form.areaName }}</el-form-item>
<el-form-item label="计费模板:" >{{ form.rule.name }}</el-form-item>
</el-col>
</el-row>
<el-row>
@ -209,15 +235,52 @@
</el-row>
</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>
<!-- 改价退款 -->
<el-dialog :title="title2" :visible.sync="open2" width="600px" append-to-body>
<el-form ref="form2" :model="form2" label-width="110px">
<el-col>
<el-col :span="24">
<el-form-item label="预约费(元)" prop="appointmentFee">
<el-input v-model="form2.appointmentFee" placeholder="请输入预约费"/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="骑行费(元)" prop="ridingFee">
<el-input v-model="form2.ridingFee" placeholder="请输入骑行费"/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="调度费(元)" prop="dispatchFee">
<el-input v-model="form2.dispatchFee" placeholder="请输入调度费"/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="管理费(元)" prop="manageFee">
<el-input v-model="form2.manageFee" placeholder="请输入管理费"/>
</el-form-item>
</el-col>
<el-col :span="24" v-if="title2 === '退款'">
<el-form-item label="原因" prop="reason">
<el-input v-model="form2.reason" placeholder="请输入管理费"/>
</el-form-item>
</el-col>
</el-col>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button v-if="title2 === '改价'" type="success" @click="submitChangePrice"> </el-button>
<el-button v-if="title2 === '退款'" type="success" @click="submitRefund"> </el-button>
<el-button @click="cancel2"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listOrder, getOrder, delOrder, addOrder, updateOrder } from "@/api/system/order";
import { listOrder, getOrder, delOrder, addOrder, updateOrder, changePrice, refund,returnVehicle } from '@/api/system/order'
import TrajectoryMap from '@/components/Map/TrajectoryMap'
export default {
@ -236,12 +299,15 @@ export default {
multiple: true,
//
showSearch: true,
// keyarea-map
key: 0,
//
total: 0,
//
orderList: [],
//
title: "",
title2: "",
showPlaceSearchMap: false,
//
open: false,
@ -264,6 +330,9 @@ export default {
vehicleNum: null,
mac: null
},
rule: {
name: null
},
status: null,
payType: null,
payFee: null,
@ -271,6 +340,10 @@ export default {
tripRouteStr: null,
vehicleNum: null
},
form2: {
orderNo: null,
},
//
rules: {
orderNo: [
@ -289,9 +362,56 @@ export default {
this.getList();
},
methods: {
changePrice(row){
console.log('changePrice')
const orderId = row.orderId || this.ids
this.reset2();
getOrder(orderId).then(response => {
this.form2 = response.data;
console.log("this.form2============="+JSON.stringify(this.form2));
this.open2 = true;
this.title2 = "改价";
});
},
refund(row){
console.log('changePrice')
const orderId = row.orderId || this.ids
this.reset2();
getOrder(orderId).then(response => {
this.form2 = response.data;
console.log("this.form2============="+JSON.stringify(this.form2));
this.open2 = true;
this.title2 = "退款";
});
},
returnVehicle(row){
console.log('returnVehicle--------------'+JSON.stringify(row))
this.$modal.confirm('是否确认辅助还车MAC为' + row.sn + '"的设备吗?').then(function() {
return returnVehicle({orderNo:row.orderNo,returnType:"2"});
}).then(() => {
this.getList();
this.$modal.msgSuccess("操作成功");
}).catch(() => {
});
},
formatDistance(row){
console.log("============"+JSON.stringify(row))
// console.log("============"+row.distance)
if(row == undefined || row.distance == null){
return "";
}
return (row.distance / 1000).toFixed(1) + ' 公里';
},
//null0.00
formatFee(fee){
if (!fee) return '0.00';
return parseFloat(this.form.appointmentFee).toFixed(2);
if (!fee) return '0.00元';
const feeStr = fee.toString();
const twoDecimalPattern = /^\d+(\.\d{2})?$/;
if (twoDecimalPattern.test(feeStr)) {
return `${feeStr}`;
}
const formattedFee = parseFloat(fee).toFixed(2);
return `${formattedFee}`;
},
formatStatus(status) {
//0-1-2-3-4-
@ -350,6 +470,11 @@ export default {
this.open = false;
this.reset();
},
//
cancel2() {
this.open2 = false;
this.reset2();
},
//
reset() {
this.form = {
@ -367,10 +492,22 @@ export default {
distance: null,
status: null,
createTime: null,
vehicleNum: null
device: {
vehicleNum: null,
mac: null
},
rule: {
name: null
}
};
this.resetForm("form");
},
reset2() {
this.form2 = {
orderId: null,
};
this.resetForm("form2");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
@ -399,10 +536,28 @@ export default {
const orderId = row.orderId || this.ids
getOrder(orderId).then(response => {
this.form = response.data;
// console.log("111111111111111111111111---------------"+JSON.stringify(response.data))
this.showPlaceSearchMap = true;
this.open = true;
this.title = "订单详情";
this.key++;
});
},
/** 提交改价 */
submitChangePrice(){
console.log("=====submitChangePrice======="+this.form2)
changePrice(this.form2).then(response => {
this.$modal.msgSuccess("改价成功");
this.open2 = false;
this.getList();
});
},
/** 提交退款 */
submitRefund(){
console.log("=====submitRefund======="+this.form2)
refund(this.form2).then(response => {
this.$modal.msgSuccess("退款成功");
this.open2 = false;
this.getList();
});
},
/** 提交按钮 */