This commit is contained in:
邱贞招 2024-07-01 09:36:07 +08:00
parent 3d0334df5a
commit 29924c6da7
15 changed files with 855 additions and 41 deletions

View File

@ -49,4 +49,11 @@ export function delDept(deptId) {
url: '/system/dept/' + deptId,
method: 'delete'
})
}
}
// 查询余额
export function getBalance(){
return request({
url: '/system/dept/getBalance',
method: 'get'
})
}

View File

@ -18,6 +18,15 @@ export function getUser(userId) {
})
}
// 绑定APP用户
export function bandAppUser(data) {
return request({
url: '/system/user/bandAppUser',
method: 'put',
data: data
})
}
// 新增用户
export function addUser(data) {
return request({

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询提现记录列表
export function listWithdraw(query) {
return request({
url: '/system/withdraw/list',
method: 'get',
params: query
})
}
// 查询提现记录详细
export function getWithdraw(id) {
return request({
url: '/system/withdraw/' + id,
method: 'get'
})
}
// 新增提现记录
export function addWithdraw(data) {
return request({
url: '/system/withdraw',
method: 'post',
data: data
})
}
// 修改提现记录
export function updateWithdraw(data) {
return request({
url: '/system/withdraw',
method: 'put',
data: data
})
}
// 删除提现记录
export function delWithdraw(id) {
return request({
url: '/system/withdraw/' + id,
method: 'delete'
})
}

View File

@ -10,6 +10,16 @@ export function listUser(query) {
})
}
// 根据手机号快速搜索用户列表
export function fastSearch(query) {
return request({
url: '/user/user/fast/search',
method: 'get',
params: query
})
}
// 查询用户详细
export function getUser(userId) {
return request({

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1719491574837" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4324" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M-112.64 2567.68z" p-id="4325" fill="#bfbfbf"></path><path d="M1018.88 98.304c0-21.504-7.68-43.008-22.528-60.928l-0.512 0.512c14.336 17.92 22.016 39.424 22.528 60.928l0.512-0.512z" fill="#bfbfbf" p-id="4326"></path><path d="M922.624 8.192h-821.76c-50.176 0-91.136 40.96-91.136 91.136v189.44c0 50.176 40.96 91.136 91.136 91.136h30.72V924.16c0 50.176 40.96 91.136 91.136 91.136h577.536c50.176 0 91.136-40.96 91.136-91.136V378.88h30.72c50.176 0 91.136-40.96 91.136-91.136V98.816c0-20.48-7.68-41.472-21.504-58.368-16.384-19.968-42.496-32.256-69.12-32.256zM834.56 922.624c0 9.728-3.584 18.432-9.728 25.088-5.632 6.656-15.36 10.752-25.088 10.752H222.208c-19.968 0-35.328-15.872-35.328-35.84v-701.44h647.68v701.44z m87.04-599.04h-30.72V220.16h3.584c13.312-2.56 23.04-13.312 23.04-27.136 0-15.36-12.8-27.648-28.16-27.648H133.12a27.533 27.533 0 0 0-27.648 27.648c0 13.312 10.24 25.088 23.552 27.136h3.072v103.424h-30.208c-19.968 0-35.84-15.872-35.84-35.84V98.304c0-19.968 15.872-35.328 35.84-35.328H921.6c19.968 0 35.84 15.872 35.84 35.328l0.512 189.44c-2.048 20.48-17.408 35.84-36.352 35.84z" p-id="4327" fill="#bfbfbf"></path><path d="M1015.808 98.304h2.56c0-21.504-8.192-43.008-22.528-60.928l-2.048 1.536c13.312 16.896 22.016 37.376 22.016 59.392z" fill="#bfbfbf" p-id="4328"></path><path d="M992.768 40.96c13.312 16.384 20.992 36.864 21.504 57.856h2.048c0-22.016-8.704-43.008-22.016-59.392l-1.536 1.536z" fill="#bfbfbf" p-id="4329"></path><path d="M473.6 535.04h-66.048c-14.336 0-26.624 12.288-26.624 26.624s12.288 26.624 26.624 26.624h83.968v60.416h-84.48c-15.872 0-29.184 13.312-29.184 29.184s13.312 29.184 29.184 29.184h84.48V780.8c0 14.336 12.288 26.624 26.624 26.624 14.336 0 26.624-12.288 26.624-26.624v-74.24h83.456c15.872 0 29.184-13.312 29.184-29.184s-13.312-29.184-29.184-29.184h-83.968v-60.416h84.48c14.336 0 26.624-12.288 26.624-26.624s-12.288-26.624-26.624-26.624h-68.608L669.696 424.96c5.12-5.12 8.192-11.776 8.192-18.432s-2.56-13.312-8.192-18.432c-10.24-9.728-27.136-9.216-37.376 1.024l-115.2 114.688-115.712-115.712c-5.12-5.12-11.776-8.192-18.432-8.192s-13.312 2.56-18.432 8.192c-5.12 5.12-8.192 11.776-8.192 18.432 0 7.168 2.56 13.312 8.192 18.432L473.6 535.04z" p-id="4330" fill="#bfbfbf"></path></svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -58,7 +58,7 @@ export default {
lat2: null
};
},
props: ["pathList", "dataId","lon","lat"],
props: ["pathList", "dataId","lon","lat","zoom"],
mounted() {
if (this.dataId) {
this.start();
@ -132,7 +132,7 @@ export default {
this.map = new AMap.Map("container", {
//id
viewMode: "3D", //3D
zoom: 13, //
zoom: this.zoom?this.zoom:13, //
center: [this.lon2, this.lat2], //
});
this.map.setFitView();

View File

@ -54,6 +54,10 @@ export default {
type: String,
default: '0'
},
deviceSn: {
type: String,
default: ''
}
},
data() {
return {
@ -124,7 +128,7 @@ export default {
//
this.removeAllMarker();
console.log("添加标记点")
this.addMarker(this.initLng, this.initLat, res.regeocode.formattedAddress, this.status, this.onlineStatus);
this.addMarker(this.initLng, this.initLat, this.deviceSn, this.status, this.onlineStatus);
this.$emit('map-geo', res, this.initLng, this.initLat);
//
@ -140,14 +144,35 @@ export default {
},
addMarker(lng, lat, title,status,onlineStatus) {
// Marker
console.log("title==========="+title)
let marker = new AMap.Marker({
position: new AMap.LngLat(lng, lat), //
icon: this.formarStatus(status,onlineStatus),
title: title,
offset: new AMap.Pixel(-20, -40)
});
//
this.map.add(marker);
this.markers.push(marker);
// Text
let text = new AMap.Text({
text: title,
anchor: 'center', //
position: new AMap.LngLat(lng, lat), //
offset: new AMap.Pixel(0, -55),
style: {
'background-color': '#1890ff', //
'border': 'none', //
'border-radius': '5px', // 5px
'color': 'white', //
'font-size': '14px', //
'padding': '5px 10px' //
}
});
//
this.map.add(text);
},
formarStatus(status,onlineStatus){
if(onlineStatus == "0"){

View File

@ -336,7 +336,7 @@
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="安全协议">
<el-form-item label="弹窗公告">
<editor v-model="form.agreement" :min-height="192" />
</el-form-item>
</el-col>

View File

@ -1,7 +1,7 @@
<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="dictType">
<el-form-item label="运营区" prop="dictType">
<el-select v-model="queryParams.areaId">
<el-option
v-for="item in areaOptions"
@ -146,7 +146,7 @@
</el-col>
<el-col :span="24">
<el-form-item label="边界" prop="boundaryStr">
<area-map :key="key" v-model="form.boundaryStr" :dataId="form.areaId" :lon="areaLon" :lat="areaLat" :pathList="form.boundaryStr" @mapList="mapList" @center="center" />
<area-map :key="key" :zoom="19" v-model="form.boundaryStr" :dataId="form.areaId" :lon="areaLon" :lat="areaLat" :pathList="form.boundaryStr" @mapList="mapList" @center="center" />
</el-form-item>
<!-- <span style="color: red">双击区域可重新编辑</span>-->
</el-col>

View File

@ -157,7 +157,7 @@
</el-col>
<el-col :span="24">
<el-form-item label="边界" prop="boundaryStr">
<area-map :key="key" v-model="form.boundaryStr" :dataId="form.areaId" :lon="areaLon" :lat="areaLat" :pathList="form.boundaryStr" @mapList="mapList" @center="center" />
<area-map :key="key" :zoom="19" v-model="form.boundaryStr" :dataId="form.areaId" :lon="areaLon" :lat="areaLat" :pathList="form.boundaryStr" @mapList="mapList" @center="center" />
</el-form-item>
<!-- <span style="color: red">双击区域可重新编辑</span>-->
</el-col>

View File

@ -85,6 +85,7 @@
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="id" align="center" prop="parkingId" />
<el-table-column label="名称" align="center" prop="parkingName" />
<el-table-column label="误差距离" align="center" prop="error" :formatter="formatDistance"/>
<el-table-column label="类型" align="center" prop="type">
<template slot-scope="scope">
<dict-tag :options="dict.type.et_parking_type" :value="scope.row.type"/>
@ -149,10 +150,15 @@
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="还车误差(米)" label-width="100">
<el-input-number v-model="form.error" placeholder="还车误差"></el-input-number>
</el-form-item>
</el-col>
</el-col>
<el-col :span="24">
<el-form-item label="边界" prop="boundaryStr">
<area-map :key="key" v-model="form.boundaryStr" :dataId="form.areaId" :lon="areaLon" :lat="areaLat" :pathList="form.boundaryStr" @mapList="mapList" @center="center" />
<area-map :key="key" v-model="form.boundaryStr" :zoom="19" :dataId="form.areaId" :lon="areaLon" :lat="areaLat" :pathList="form.boundaryStr" @mapList="mapList" @center="center" />
</el-form-item>
</el-col>
<el-col >
@ -244,7 +250,10 @@ export default {
],
boundaryStr: [
{ required: true, message: "边界不能为空", trigger: "blur" }
]
],
error: [
{ pattern: /^[0-9]*$/, message: "还车误差必须为正整数", trigger: "blur" }
],
}
};
},
@ -254,6 +263,13 @@ export default {
this.getAreaList();
},
methods: {
formatDistance(row) {
if (typeof row.error === 'number') {
return `${row.error}`;
} else {
return '-';
}
},
mapList(data){
let mapListJson = JSON.stringify(data);
console.log("mapListJson:"+mapListJson);
@ -346,6 +362,8 @@ export default {
const parkingId = row.parkingId || this.ids
getParking(parkingId).then(response => {
this.form = response.data;
this.areaLon = response.data.longitude;
this.areaLat = response.data.latitude;
this.open = true;
this.title = "修改停车区";
this.key++;

View File

@ -373,6 +373,7 @@
:init-lng="form.longitude"
:status="form.status"
:online-status="form.onlineStatus"
:device-sn="form.sn"
/>
</el-col>
</el-row>

View File

@ -14,6 +14,7 @@
import globalConfig from "@/utils/config/globalConfig";
import {listDevice} from "@/api/system/device";
import {listArea} from "@/api/system/area";
import { listParking } from '@/api/system/parking'
export default {
@ -26,18 +27,55 @@
tips: null,
//
areaList: [],
lon: null,
lat: null,
area:null,
//
deviceList: [],
parkingList: [],
noParkingList: [],
noridingList: [],
type: null
}
},
mounted() {
this.initAMap();
this.getAreaList();
},
unmounted() {
this.map?.destroy();
},
methods: {
async getAreaList(){
listArea().then(response => {
this.areaList = response.rows;
if (this.areaList.length > 0) { //
const firstArea = this.areaList[0]; //
this.area = firstArea;
console.log('第一个区域的信息:', firstArea);
this.lon = firstArea.longitude;
this.lat = firstArea.latitude;
console.log("area============="+JSON.stringify(this.area))
listParking({areaId: this.area.areaId}).then(response => {
let list = response.rows;
list.forEach(item => {
if (item.type === '1') {
this.parkingList.push(item);
} else if (item.type === '2') {
this.noParkingList.push(item);
} else if (item.type === '3') {
this.noridingList.push(item);
}
});
console.log("parkingList============="+JSON.stringify(this.parkingList));
console.log("noParkingList============="+JSON.stringify(this.noParkingList));
console.log("noriding============="+JSON.stringify(this.noridingList));
this.initAMap();
});
}else{
console.log('区域列表为空');
}
});
},
changeMapStyle(){
//
let defaultLayer = new AMap.TileLayer();
@ -73,12 +111,29 @@
// id
viewMode: "3D", // 3D
zoom: 13, //
center: [120.356031,26.94088], //--
center: [this.lon,this.lat], //
});
//
this.deviceMarker();
//
this.areaBoundary();
this.areaList.forEach(area => {
this.addArea(JSON.parse(area.boundaryStr) || []);
});
//
this.parkingList.forEach(parking => {
this.addParking(JSON.parse(parking.boundaryStr) || [],parking.parkingName,parking.longitude,parking.latitude);
this.addMarker2(parking,"https://lxnapi.ccttiot.com/FqcYf6ecsnbC0OT6YYAF5npgu-kh",parking.parkingName,"#1890ff");
});
//
this.noParkingList.forEach(noparking => {
this.addNoParking(JSON.parse(noparking.boundaryStr) || []);
this.addMarker2(noparking,"https://lxnapi.ccttiot.com/FjKE5PWbnEnZUq3k-wVIvV4lv8Ab",noparking.parkingName,"#ff4444");
});
//
this.noridingList.forEach(noriding => {
this.addNoriding(JSON.parse(noriding.boundaryStr) || [],noriding.parkingName,noriding.longitude,noriding.latitude);
this.addMarker2(noriding,"https://lxnapi.ccttiot.com/FmX1diEPPbFYe1vcUfKp6qbKzzh2",noriding.parkingName,"#ffcc00");
});
setTimeout(() => {
this.setFitView();
}, 1000);
@ -86,6 +141,38 @@
console.log(e);
});
},
addMarker2(parking, icon,title,color) {
let marker = new AMap.Marker({
map: this.map,
icon: new AMap.Icon({
image: icon,
size: new AMap.Size(38, 55), //
imageSize: new AMap.Size(38, 55) //
}),
position: [parking.longitude, parking.latitude],
offset: new AMap.Pixel(-20, -50)
});
console.log("title============="+title)
// Text
let text = new AMap.Text({
text: title,
anchor: 'center', //
position: [parking.longitude, parking.latitude],
offset: new AMap.Pixel(0, -70),
style: {
'background-color': color, //
'border': 'none', //
'border-radius': '5px', // 5px
'color': 'white', //
'font-size': '14px', //
'padding': '5px 10px' //
}
});
//
this.map.add(text);
},
deviceMarker(){
listDevice({pageNum: 1,pageSize: 999}).then(response => {
this.deviceList = response.rows;
@ -93,7 +180,7 @@
//
if (device.longitude !== null && device.latitude !== null &&
!isNaN(device.longitude) && !isNaN(device.latitude)) {
this.addMarker(device.longitude, device.latitude, device.status, device.onlineStatus);
this.addMarker(device.longitude, device.latitude, device.status, device.onlineStatus,device.sn);
} else {
console.warn(`无效的经纬度值: 经度=${device.longitude}, 纬度=${device.latitude}`);
}
@ -102,15 +189,7 @@
console.error('获取设备列表失败:', error);
});
},
areaBoundary(){
listArea().then(response => {
this.areaList = response.rows;
this.areaList.forEach(area => {
this.addPolygon(JSON.parse(area.boundaryStr) || []);
});
});
},
addMarker(lng, lat, status, onlineStatus) {
addMarker(lng, lat, status, onlineStatus,title) {
function formarStatus(status,onlineStatus) {
if(onlineStatus == "0"){
return globalConfig.icon.red;
@ -137,12 +216,31 @@
map: this.map,
icon: formarStatus(status,onlineStatus),
position: [lng, lat],
// offset: new AMap.Pixel(-13, -30)
offset: new AMap.Pixel(-20, -40)
});
// Text
let text = new AMap.Text({
text: title,
anchor: 'center', //
position: [lng, lat],
offset: new AMap.Pixel(0, -55),
style: {
'background-color': '#1890ff', //
'border': 'none', //
'border-radius': '5px', // 5px
'color': 'white', //
'font-size': '14px', //
'padding': '5px 10px' //
}
});
//
this.map.add(text);
},
//
addPolygon(data) {
//
addArea(data) {
let polygon = new AMap.Polygon({
path: data,
fillColor: '#ccebc5',
@ -153,20 +251,124 @@
strokeStyle: 'dashed',
strokeDasharray: [5, 5],
});
// polygon.on('mouseover', () => {
// polygon.setOptions({
// fillOpacity: 0.7,
// fillColor: '#7bccc4'
// })
// })
// polygon.on('mouseout', () => {
// polygon.setOptions({
// fillOpacity: 0.5,
// fillColor: '#ccebc5'
// })
// })
this.map.add(polygon);
},
addParking(data,title,lon,lat) {
let polygon = new AMap.Polygon({
path: data,
fillColor: '#ccebc5',
strokeOpacity: 1,
fillOpacity: 0.5,
strokeColor: '#3b7ed9', //
strokeWeight: 2, //
strokeStyle: 'solid',
strokeDasharray: [5, 5],
});
polygon.on('mouseover', () => {
polygon.setOptions({
fillOpacity: 0.7,
fillColor: '#7bccc4'
})
})
fillColor: '#71b7cc' //
});
});
polygon.on('mouseout', () => {
polygon.setOptions({
fillOpacity: 0.5,
fillColor: '#ccebc5'
})
})
fillColor: '#a7c1d0' //
});
});
this.map.add(polygon);
//
// let text = new AMap.Text({
// text: title,
// anchor: 'center', //
// style: {
// 'background-color': 'transparent', //
// 'border': 'none', //
// 'color': '#ff0000', //
// 'font-size': '14px'
// },
// position: [lon,lat] //
// });
//
// this.map.add(text);
},
addNoParking(data) {
let polygon = new AMap.Polygon({
path: data,
fillColor: '#ccebc5',
strokeOpacity: 1,
fillOpacity: 0.5,
strokeColor: '#ff0000', //
strokeWeight: 2, //
strokeStyle: 'solid',
strokeDasharray: [5, 5],
});
polygon.on('mouseover', () => {
polygon.setOptions({
fillOpacity: 0.7,
fillColor: '#ff0000' //
});
});
polygon.on('mouseout', () => {
polygon.setOptions({
fillOpacity: 0.5,
fillColor: '#cc7b7b' //
});
});
this.map.add(polygon);
},
addNoriding(data,title,lon,lat) {
let polygon = new AMap.Polygon({
path: data,
fillColor: '#ccebc5',
strokeOpacity: 1,
fillOpacity: 0.5,
strokeColor: '#ffcc00', //
strokeWeight: 2, //
strokeStyle: 'solid',
strokeDasharray: [5, 5],
});
polygon.on('mouseover', () => {
polygon.setOptions({
fillOpacity: 0.7,
fillColor: '#FFEBA4FF'
});
});
polygon.on('mouseout', () => {
polygon.setOptions({
fillOpacity: 0.5,
fillColor: '#ffeba4'
});
});
this.map.add(polygon);
//
// let text = new AMap.Text({
// text: title,
// anchor: 'center', //
// style: {
// 'background-color': 'transparent', //
// 'border': 'none', //
// 'color': '#ff0000', //
// 'font-size': '14px'
// },
// position: [lon,lat] //
// });
//
// this.map.add(text);
}
},
};

View File

@ -1,13 +1,15 @@
<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="area">
<el-input
v-model="queryParams.area"
placeholder="请输入区域"
clearable
@keyup.enter.native="handleQuery"
/>
<el-form-item label="运营区" prop="areaId" v-if="userName == 'admin'">
<el-select v-model="queryParams.areaId" placeholder="请选择运营区" clearable>
<el-option
v-for="item in areaOptions"
:key="item.areaId"
:label="item.areaName"
:value="item.areaId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="订单号" prop="orderNo">
<el-input
@ -27,12 +29,22 @@
</el-form-item>
<el-form-item label="设备SN" prop="sn">
<el-input
v-model="queryParams.deviceMac"
v-model="queryParams.sn"
placeholder="请输入设备SN"
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.et_order_status"
: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>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@ -298,6 +310,7 @@
<script>
import { listOrder, getOrder, delOrder, addOrder, updateOrder, changePrice, refund,returnVehicle } from '@/api/system/order'
import TrajectoryMap from '@/components/Map/TrajectoryMap'
import { optionselect as getAreaOptionselect } from '@/api/system/area'
export default {
name: "Order",
@ -308,6 +321,7 @@ export default {
//
loading: true,
//
userName: undefined,
ids: [],
//
single: true,
@ -317,6 +331,7 @@ export default {
showSearch: true,
// keyarea-map
key: 0,
areaOptions: [],
//
total: 0,
//
@ -389,9 +404,12 @@ export default {
};
},
created() {
console.log("当前用户信息:",this.$store.state.user.name)
this.userName = this.$store.state.user.name;
this.reset();
this.reset2();
this.getList();
this.getAreaList();
},
methods: {
getTypeText(type) {
@ -408,6 +426,12 @@ export default {
return ''; //
}
},
/** 查询字典类型列表 */
getAreaList() {
getAreaOptionselect().then(response => {
this.areaOptions = response.data;
});
},
changePrice(row){
// console.log('changePrice')
const orderId = row.orderId || this.ids

View File

@ -0,0 +1,473 @@
<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="deptId" v-if="userName == 'admin'">
<el-select v-model="queryParams.deptId" placeholder="请选择运营商" clearable>
<el-option
v-for="item in deptOptions"
:key="item.deptId"
:label="item.deptName"
:value="item.deptId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="提现单号" prop="withdrawNo">
<el-input
v-model="queryParams.withdrawNo"
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.et_withdraw_status"
: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>
<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" v-if="userName != 'admin'">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:withdraw:add']"
>申请</el-button>
</el-col>
<el-col :span="1.5" v-if="userName != 'admin' && user.appUserId == null" >
<el-button
type="success"
plain
icon="el-icon-link"
size="mini"
@click="bandWxUser"
v-hasPermi="['system:withdraw:add']"
>绑定微信用户</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:withdraw:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="withdrawList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="提现id" align="center" prop="id" />-->
<el-table-column label="运营商" align="center" prop="deptName" v-if="userName == 'admin'"/>
<el-table-column label="提现单号" align="center" prop="withdrawNo" />
<el-table-column label="提现金额:元" align="center" prop="amount" />
<el-table-column label="申请状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="dict.type.et_withdraw_status" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="申请人" align="center" prop="applicant" />
<el-table-column label="微信openid" align="center" prop="wxopenid" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="回调状态" align="center" prop="callStatus">
<template slot-scope="scope">
<dict-tag :options="dict.type.et_call_status" :value="scope.row.callStatus"/>
</template>
</el-table-column>
<el-table-column v-if="userName == 'admin'" label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button v-if="scope.row.status == 0"
size="mini"
type="text"
icon="el-icon-edit"
@click="handleEdit(scope.row)"
v-hasPermi="['system:fault:query']"
>审核</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="120px">
<el-form-item label="可用余额">
<span style="color: red;font-weight: 700">{{balance}}</span>
</el-form-item>
</el-form>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="提现金额:元" prop="amount">
<el-input style="width: 70%" v-model="form.amount" 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>
<!-- 添加或修改提现记录对话框 -->
<el-dialog :title="title2" :visible.sync="open2" width="500px" append-to-body>
<el-form ref="form2" :model="form2" :rules="rules2" label-width="120px">
<el-form-item label="手机号码" prop="phonenumber">
<el-select
ref="headerSearchSelect"
v-model="form2.phonenumber"
:remote-method="queryPhonenumber"
filterable
default-first-option
remote
:loading="loading2"
placeholder="输入手机号搜索"
class="header-search-select" >
<el-option
v-for="item in options"
:key="item.value"
:label="item.label+'---'+item.appName"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</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>
<el-dialog title="提现详细" :visible.sync="open3" width="700px" append-to-body>
<el-form ref="form3" :model="form3" label-width="100px" size="mini">
<el-row>
<el-col :span="24">
<el-form-item label="运营商:">{{ form3.deptName }}</el-form-item>
<el-form-item label="提现单号:">{{ form3.withdrawNo }}</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="提现金额:"><span style="color: red;font-weight: 700">{{ form3.amount }}</span> </el-form-item>
<el-form-item label="申请人:">{{ form3.applicant }}</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="申请时间:">{{ form3.createTime }}</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="状态:">
<dict-tag :options="dict.type.et_withdraw_status" :value="form3.status"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button v-show="view == true" @click="open3 = false"> </el-button>
<el-button v-show="view == false" type="success" @click="pass"> </el-button>
<el-button v-show="view == false" type="danger" @click="reject"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listWithdraw, getWithdraw, delWithdraw, addWithdraw, updateWithdraw } from "@/api/system/withdraw";
import { getBalance, listDept } from '@/api/system/dept'
import { fastSearch } from '@/api/user/user'
import { bandAppUser } from '@/api/system/user'
import { getInfo } from '@/api/login'
export default {
name: "Withdraw",
dicts: ['et_call_status', 'et_withdraw_status'],
data() {
return {
//
loading: true,
//
ids: [],
deptOptions: [],
search: '',
options: [],
fuse: undefined,
//
single: true,
loading2: false,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
withdrawList: [],
balance: null,
userName:null,
user: null,
view: false,
//
title: "",
//
open: false,
title2: "",
//
open2: false,
//
open3: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
withdrawNo: null,
deptId: null,
status: null,
applicant: null,
phonenumber: null
},
//
form: {},
//
form2: {},
form3: {},
//
rules: {
amount: [
{ required: true, message: "提现金额不能为空", trigger: "blur" },
{ pattern: /^\d+$/, message: '满电续航必须为正整数', trigger: 'blur' },
// balance
{
validator: (rule, value, callback) => {
if (value > this.form.balance) {
callback(new Error('提现金额不能超过余额'));
} else {
callback();
}
},
trigger: 'blur',
},
]
},
rules2: {
phonenumber: [
{ required: true, message: "手机号码不能为空", trigger: "blur" },
// { pattern: /^1[3-9]\d{9}$/, message: '', trigger: 'blur' },
]
}
};
},
created() {
console.log("当前用户信息:",this.$store.state.user.name)
this.userName = this.$store.state.user.name;
getInfo().then(response => {
this.user = response.user;
});
this.getList();
if(this.userName === 'admin'){
listDept({status: '0' }).then(response => {
this.deptOptions = response.data;
});
}
},
methods: {
/** 审核 */
handleEdit(row) {
this.open3 = true;
this.form3 = row;
this.view = false;
},
/** 通过 */
pass(){
this.$refs["form3"].validate(valid => {
if (valid) {
if (this.form3.id != null) {
this.form3.status = "1";
console.log("---------"+JSON.stringify(this.form3))
updateWithdraw(this.form3).then(response => {
this.$modal.msgSuccess("操作成功");
this.open3 = false;
this.getList();
});
}
}
});
},
/** 拒绝 */
reject(){
this.$refs["form3"].validate(valid => {
if (valid) {
if (this.form3.id != null) {
this.form3.status = "2";
updateWithdraw(this.form3).then(response => {
this.$modal.msgSuccess("操作成功");
this.open3 = false;
this.getList();
});
}
}
});
},
queryPhonenumber(query) {
console.log("query:",query)
if (query !== '') {
this.loading2 = true;
setTimeout(() => {
this.loading2 = false;
fastSearch({"phonenumber":query}).then(response => {
this.options = response.data;
}
);
}, 200);
} else {
this.options = []
}
},
/** 查询提现记录列表 */
getList() {
this.loading = true;
listWithdraw(this.queryParams).then(response => {
this.withdrawList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.open2 = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
withdrawNo: null,
amount: null,
deptId: null,
status: null,
applicant: null,
wxopenid: null,
createTime: null,
callStatus: null
};
this.form2 = {
appUserId: null,
};
this.resetForm("form");
this.resetForm("form2");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
//
getBalance().then(response => {
this.balance = response.data;
});
this.reset();
this.open = true;
this.title = "申请提现";
},
bandWxUser(){
this.reset();
this.open2 = true;
this.title2 = "绑定微信用户";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getWithdraw(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改提现记录";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateWithdraw(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addWithdraw(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
submitForm2: function() {
let form2 = this.form2
this.$refs['form2'].validate(valid => {
if (valid) {
this.$modal.confirm('绑定微信用户操作需要重新登录,是否确认绑定?').then(function() {
return bandAppUser({appUserId:form2.phonenumber})
}).then(() => {
console.log(2222222222)
this.getList()
this.$modal.msgSuccess('操作成功')
}).catch(() => {
})
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除提现记录编号为"' + ids + '"的数据项?').then(function() {
return delWithdraw(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/withdraw/export', {
...this.queryParams
}, `withdraw_${new Date().getTime()}.xlsx`)
}
}
};
</script>