提交修改

This commit is contained in:
cjb 2025-03-22 17:33:29 +08:00
parent 94853b0e61
commit df9e1dd0d8
36 changed files with 4214 additions and 429 deletions

21
.gitignore vendored Normal file
View File

@ -0,0 +1,21 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
.DS_Store
dist
*.local
# Editor directories and files
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

View File

@ -12,7 +12,7 @@ import Login from './views/components/login.vue'
watch(() => appStore().isEffecti,(v) => {
openpop.value = false
if(!v && getToken()){
if(!v && getToken() && !appStore().loginPage){
openpop.value = true
}
})

82
src/api/home.ts Normal file
View File

@ -0,0 +1,82 @@
import server from '@/utils/request'
//查询运营商 换电站 电池 机器人
interface Querydata{
poCode?:String //运营商编码
stationCode?:String //换电站编码
timeBegin?:String //开始时间,示例值(2024-10-01 00:00:00)
timeEnd?:String //结束时间,示例值(2025-04-01 23:59:59)
}
export function gethdztotal(params?:Querydata) {
return server.request({
url: '/cloud/home/data1',
method: 'get',
params
})
}
//查询 公司 用户 车辆
export function getgyctotal() {
return server.request({
url: '/cloud/home/data2',
method: 'get'
})
}
//订单-按换电站统计
export function gethdztj(params?:Querydata) {
return server.request({
url: '/cloud/home/data3',
method: 'get',
params
})
}
//交易-不安换电站统计
export function getjytj(params?:Querydata) {
return server.request({
url: '/cloud/home/data4',
method: 'get',
params
})
}
//近6个月订单统计
export function getddtj(params?:Querydata) {
return server.request({
url: '/cloud/home/data5',
method: 'get',
params
})
}
//近6个月交易统计
export function get6jytj(params?:Querydata) {
return server.request({
url: '/cloud/home/data6',
method: 'get',
params
})
}
//同比 环比
export function gettbhb(type:number) {
return server.request({
url: '/cloud/home/data7',
method: 'get',
params:{
type
}
})
}
// export function addhdz(data:Addobj) {
// return server.request({
// url: '/cloud/batterystation/fee/detail/add',
// method: 'post',
// data
// })
// }

View File

@ -32,7 +32,7 @@ interface Addata{
status?:String|Number //状态1-启用0-禁用
logo?:String //logo地址
delFlag?:String //删除标识1-已删除0-未删除
accountBalance?:String //账户余额
accountBalance?:String|Number //账户余额
}
export function addyunys(data:Addata) {
return server.request({

View File

@ -2,17 +2,17 @@ import server from '@/utils/request'
//新增
interface Addobj{
ownerType:String //户主类型1-个人2-企业
ownerId:String //户主ID
stationCode:String //引入站点
ownerType:String //户主类型1-个人2-企业
ownerId:String //户主ID
stationCode:String //引入站点
pkId?:String
totalAmount?:String //账户总金额,分:总金额=充值金额+赠送金额
rechargeAmount?:String //充值余额,分
giftAmount?:String //赠送金额,分
point?:String //积分余额
deposit?:String //押金
snCode?:String //SN码
rent?:String //租金
totalAmount?:String|Number //账户总金额,分:总金额=充值金额+赠送金额
rechargeAmount?:String|Number //充值余额,分
giftAmount?:String|Number //赠送金额,分
point?:String|Number //积分余额
deposit?:String|Number //押金
snCode?:String //SN码
rent?:String|Number //租金
}
export function addhdz(data:Addobj) {

View File

@ -4,34 +4,34 @@ import server from '@/utils/request'
interface Addobj{
orderType:String|Number //类型1-换电2-充电
plateNum:String //车牌号
orderTime:String //订单时间,示例值(yyyy-MM-dd HH:mm:ss)
orderTime?:String //订单时间,示例值(yyyy-MM-dd HH:mm:ss)
stationCode:String //换电站编码
stationName:String //换电站名称
accountCode:String //金额账号
amount:String|Number //订单金额
status:String|Number //订单状态1-已创建2-换电中3-换电完成4-充电中5-充电完成6-待结算7-已完成9-已取消 //1-等待受理2-换电中3-换电完成4-出现异常5-未结算6-订单取消7-已结算
feeType:String //计算费用方式1-ODO2-SOC3-按电量
basicFee:String //基础费用
serviceTimeBegin:String|Number //服务开始时间
serviceTimeEnd:String //服务结束时间
serviceFee:String|Number //服务费
lastRentBatCarOdo:String //上次租赁电池时车辆里程
nowReturnBatCarOdo:String //归还电池时车辆里程
odoAmount:String|Number //按ODO换电费
electAmount:String|Number //总充电量
rentBatNo:String|Number //租借电池包仓位
rentBatCode:String //租用电池包编码
rentBatSoc:String //租用电池包SOC
returnBatCode:String //归还电池包编码
returnBatNo:String|Number //归还电池包仓位
returnBatSoc:String //归还电池包SOC
returnBatRentSoc:String //归还电池租出时soc
returnBatRentStationCode:String //归还电池租出的换电站编码
returnBatRentStationName:String //归还电池租出的换电站
changeMode:String|Number //换电模式1-全自动2-半自动3-人工干预
changeLane:String|Number //换电车道 1-A 车道;2-B 车道
userId:String //换电车主ID
tradeNo:String //交易编码
accountCode?:String //金额账号
amount?:String|Number //订单金额
status?:String|Number //订单状态1-已创建2-换电中3-换电完成4-充电中5-充电完成6-待结算7-已完成9-已取消 //1-等待受理2-换电中3-换电完成4-出现异常5-未结算6-订单取消7-已结算
feeType?:String //计算费用方式1-ODO2-SOC3-按电量
basicFee?:String //基础费用
serviceTimeBegin?:String|Number //服务开始时间
serviceTimeEnd?:String //服务结束时间
serviceFee?:String|Number //服务费
lastRentBatCarOdo?:String //上次租赁电池时车辆里程
nowReturnBatCarOdo?:String //归还电池时车辆里程
odoAmount?:String|Number //按ODO换电费
electAmount?:String|Number //总充电量
rentBatNo?:String|Number //租借电池包仓位
rentBatCode?:String //租用电池包编码
rentBatSoc?:String //租用电池包SOC
returnBatCode?:String //归还电池包编码
returnBatNo?:String|Number //归还电池包仓位
returnBatSoc?:String //归还电池包SOC
returnBatRentSoc?:String //归还电池租出时soc
returnBatRentStationCode?:String //归还电池租出的换电站编码
returnBatRentStationName?:String //归还电池租出的换电站
changeMode?:String|Number //换电模式1-全自动2-半自动3-人工干预
changeLane?:String|Number //换电车道 1-A 车道;2-B 车道
userId?:String //换电车主ID
tradeNo?:String //交易编码
}
export function addhdz(data:Addobj) {
@ -55,14 +55,16 @@ export function update(data:Addobj) {
interface Querydata{
pageSize:String|Number //每页条数
pageNo:String|Number //页数
orderNo:String //订单编码
plateNum:String //车牌号
orderTimeBegin:String //订单时间开始,示例值(yyyy-MM-dd HH:mm:ss)
orderTimeEnd:String //订单时间结束
stationCode:String //换电站编码
stationName:String //换电站名称
userId:String //换电车主ID
tradeNo:String //交易编码
orderNo?:String //订单编码
plateNum?:String //车牌号
orderTimeBegin?:String //订单时间开始,示例值(yyyy-MM-dd HH:mm:ss)
orderTimeEnd?:String //订单时间结束
stationCode?:String //换电站编码
stationName?:String //换电站名称
userId?:String //换电车主ID
tradeNo?:String //交易编码
status?:String //订单状态
ccode?:String //公司编码
}
export function getjqrlist(params:Querydata) {
return server.request({
@ -104,3 +106,35 @@ export function jsfeiy(orderNo:string) {
}
})
}
//批量支付
export function batchpayment(data:string) {
return server.request({
headers: {
'Content-Type': 'application/json',
},
url: '/cloud/order/swap/wechat/nativepay',
method: 'post',
data
})
}
//获取ip
export function getip() {
return server.request({
url: '/resource/util/ip',
method: 'get'
})
}
//查询支付订单状态
export function paystatus(outTradeNo:string) {
return server.request({
url: '/cloud/order/swap/paystatus/query',
method: 'get',
params:{
outTradeNo
}
},false)
}

View File

@ -2,15 +2,26 @@ import server from '@/utils/request'
//新增
interface Addobj{
userId:String //预约人ID
uname:String //预约人姓名
phone:String //手机号码
userId:String //预约人ID
uname:String //预约人姓名
phone:String //手机号码
plateNum:String //车牌号
stationCode:String //换电站编码
stationName:String //换电站名称
swapDay:String //预约换电日期,示例值(yyyyMMdd)
swapDuration:String //预约换电时间段,示例值(8:00-10:00)
status:String|Number //状态1-预约成功2-到店使用3-取消4-过期
status:String|Number //状态1-预约成功2-到店使用3-取消4-过期
// source:String //来源1-小程序2-云端3-站端
// ucode:String //预约人编码
// uname:String //预约人姓名
// phone:String //手机号码
// plateNum:String //车牌号
// stationCode:String //换电站编码
// stationName:String //换电站名称
// swapDay:String //预约换电日期,示例值(yyyyMMdd)
// reservationTime?:String //预约时间
// swapDuration?:String //预约换电时间段,示例值(8:00-10:00)
}
export function addhdz(data:Addobj) {
@ -33,9 +44,13 @@ export function update(data:Addobj) {
//查询
interface Querydata{
pageSize:String|Number //每页条数
pageNo:String|Number //页数
userId:String //车主id
status:String //状态
pageNo:String|Number //页数
ucode?:String //车主id
status?:String //状态
plateNum?:String //车牌号
swapDayBegin?:String //预约换电日期开始,示例值(yyyyMMdd)
swapDayEnd?:String //预约换电日期结束
stationCode?:String //换电站编码
}
export function getjqrlist(params:Querydata) {
return server.request({

106
src/api/swapstation/cdcl.ts Normal file
View File

@ -0,0 +1,106 @@
import server from '@/utils/request'
//新增
interface Addobj{
pkId?:String
name:String //名称
stationCode:String //换电站编码
stationName:String //换电站名称
miniLimit:String|Number //最低数量
status?:String|Number //状态0-未启用1-启用
}
export function addhdz(data:Addobj) {
return server.request({
url: '/cloud/batterystation/cd/strategy/add',
method: 'post',
data
})
}
//修改
export function update(data:Addobj) {
return server.request({
url: '/cloud/batterystation/cd/strategy/update',
method: 'post',
data
})
}
//查询
interface Querydata{
stationCode:String //换电站编码
status:String|Number //状态
}
export function getjqrlist(params:Querydata) {
return server.request({
url: '/cloud/batterystation/cd/strategy/list',
method: 'get',
params
})
}
//删除
export function delhdz(id:string) {
return server.request({
url: '/cloud/batterystation/cd/strategy/del',
method: 'post',
data:{
id
}
})
}
interface Addxq{
pkId?:String
stationCode:String //换电站编码
stationName:String //换电站名称
strategyId:String //策略ID
beginTime:String //开始时间,示例值(20:01:32)
endTime:String //结束时间,示例值(23:05:41)
chargingPower?:String //充电功率
}
//新增详情
export function addxq(data:Addxq) {
return server.request({
url: '/cloud/batterystation/cd/strategy/detail/add',
method: 'post',
data
})
}
//修改详情
export function updatexq(data:Addxq) {
return server.request({
url: '/cloud/batterystation/cd/strategy/detail/update',
method: 'post',
data
})
}
//删除详情
export function delxq(id:string) {
return server.request({
url: '/cloud/batterystation/cd/strategy/detail/del',
method: 'post',
data:{
id
}
})
}
//查询详情
export function getxql(strategyId:String) {
return server.request({
url: '/cloud/batterystation/cd/strategy/detail/list',
method: 'get',
params:{
strategyId
}
})
}

View File

@ -53,7 +53,7 @@ interface Querydata{
pkId?:String
name?:String //站点名称
code?:String //站点编码
status?:String //状态1-正常营业2-正常停运3-故障停运4-指令停运9-其它
status?:any //状态1-正常营业2-正常停运3-故障停运4-指令停运9-其它
type?:String //站点类型ID
}
export function gethdzlist(params:Querydata) {
@ -87,6 +87,7 @@ export function getqrcode(params:Codeqs) {
return server.request({
url: '/cloud/batterystation/xcx/qrcode/get',
method: 'get',
params
params,
responseType:'blob'
})
}

View File

@ -0,0 +1,19 @@
import server from '@/utils/request'
//新增
interface Querydata{
pageSize:String|Number //每页条数
pageNo:String|Number //页数
stationCode?:String //换电站
direction?:String //传送方向
type?:String //消息类型: 状态信息类、事件记录类、请求与响应类 query
messageFunction?:String //方法 stationInfo
}
export function mqttlist(params:Querydata) {
return server.request({
url: '/cloud/mqttmessage/list',
method: 'get',
params
})
}

View File

@ -107,4 +107,24 @@ export function Bingwx(params:Wxbin) {
method: 'post',
params
})
}
//解绑微信用户
export function unbindwx(id:String|Number) {
return server.request({
url: '/cloud/vehicle/wechatuser/relation/del',
method: 'post',
params:{id}
})
}
//查询车辆绑关联微信用户
export function getcarwxlist(PlantNo:any) {
return server.request({
url: '/cloud/vehicle/relationuser/list',
method: 'get',
params:{
PlantNo
}
})
}

View File

@ -48,7 +48,9 @@ let init = true
router.beforeEach((to, from, next) => {
NProgress.start();
if(to.path === "/login"){
appStore().setloginPage()
appStore().setloginPage(true)
}else{
appStore().setloginPage(false)
}
if (getToken()) {
/* has token*/

View File

@ -27,8 +27,8 @@ const store = defineStore({
seteff(v:boolean) {
this.isEffecti = v
},
setloginPage() {
this.loginPage = true
setloginPage(v:boolean) {
this.loginPage = v
},
toggleSideBar() {
if (this.sidebar.hide) {

View File

@ -46,7 +46,7 @@ export class Service {
//https://api.evo-techina.com'
baseConfig: AxiosRequestConfig = { baseURL:import.meta.env.VITE_APP_BASE_API, timeout: 30000 };
baseConfig: AxiosRequestConfig = { baseURL:import.meta.env.VITE_APP_BASE_API, timeout: 60000 };
isloading:Boolean = true
@ -157,7 +157,8 @@ export class Service {
return Promise.reject('S0405')
//return Promise.reject()
}else if(code == 'D0402'){
return Promise.reject()
return []
//return Promise.reject()
}else if (code == 500) {
ElMessage({ message: msg, type: "error" });
return Promise.reject(new Error(msg));

View File

@ -187,3 +187,11 @@ export async function blobValidate(data: Blob) {
return true;
}
}
//格式日期
export function formatDate(s:any) {
if(s){
return (s+'').replace(/^(\d{4})(\d{2})(\d{2})$/, '$1-$2-$3')
}
return ''
}

View File

@ -7,18 +7,33 @@
{{name}}
</div>
<div style="display: flex;">
<a v-if="showcode" :href="url" style="display: flex;align-items: center;padding-right: 30px;color: #80aedd;">
<!-- <a v-if="showcode" :href="url" style="display: flex;align-items: center;padding-right: 30px;color: #80aedd;">
<div style="padding-right: 6px;">下载小程序码</div><el-icon><Download /></el-icon>
</a>
</a> -->
<div v-if="showcode" @click="xcxcode" style="display: flex;align-items: center;padding-right: 30px;color: #80aedd;cursor: pointer;">
<div style="padding-right: 6px;">查看小程序码</div>
<!-- <el-icon><Download /></el-icon> -->
</div>
<el-icon v-if="showcls" color="#ccc" @click="handleClose" style="cursor: pointer;">
<CloseBold />
</el-icon>
</div>
</div>
<el-dialog
v-model="openpop"
width="450"
append-to-body
destroy-on-close
:close-on-click-modal="false"
>
<img :src="urlcode" width="400" height="400" />
</el-dialog>
</template>
<script setup lang="ts">
//import { ref } from 'vue'
// import{ getqrcode } from '@/api/swapstation/hdz'
import { ref } from 'vue'
import{ getqrcode } from '@/api/swapstation/hdz'
const props = withDefaults(defineProps<{
name?:string
showjt?:boolean
@ -33,6 +48,8 @@
})
//${import.meta.env.VITE_APP_BASE_API} http://192.168.5.200:9103
let url = `${import.meta.env.VITE_APP_BASE_API}/cloud/batterystation/xcx/qrcode/get?path=pages/home/index?code=${props.hdzcode}&width=400&env_version=trial`
const emit = defineEmits<{
close: []
@ -42,15 +59,23 @@
emit('close')
}
let openpop = ref(false)
let urlcode = ref<any>('')
//
// function xcxcode(){
// getqrcode({
// path:'pages/home/index',
// width:'400',
// env_version:'trial' //"release""trial""develop"
// }).then((rps:any) => {
// console.log(rps)
// })
// }
function xcxcode(){
getqrcode({
path:`pages/home/index?code=${props.hdzcode}`,
width:'400',
env_version:'trial' //"release""trial""develop"
}).then((rps:any) => {
openpop.value = true
let reader = new FileReader()
reader.readAsDataURL(rps) // base64
reader.onload = function () {
urlcode.value = reader.result
}
})
}
</script>

View File

@ -7,7 +7,99 @@
@click="testsx()">测试失效</el-button> -->
<el-row :gutter="20" class="mgb20">
<el-col v-for="(item, index) in messageList" :key="index" :span="messageList.length -1 == index?4:5">
<!--运营商-->
<el-col :span="4">
<div style="width: 100%;border-radius: 12px;box-shadow: 0 0 20px -5px rgba(84, 151, 232, 0.5);">
<div class="grid-message" style="background: #fff;border-radius:15px">
<el-icon class="grid-msg-icon" style="border-radius: 12px 0 0 12px;" :style="{background:'#409EFF'}">
<component is="Promotion" />
</el-icon>
<div class="grid-msg-right" style="border: none;" @click="toRout('/system/operator')">
<div class="grid-msg-num" :style="{ color: '#409EFF'}">
{{ operatotal }}
</div>
<div style="font-size: 16px;">运营商</div>
</div>
</div>
</div>
</el-col>
<!--换电站-->
<el-col :span="6">
<div style="width: 100%;border-radius: 12px;box-shadow: 0 0 20px -5px rgba(84, 151, 232, 0.5);">
<div class="grid-message" style="background: #fff;border-radius:15px">
<el-icon class="grid-msg-icon" style="border-radius: 12px 0 0 12px;" :style="{background:'#28b3a1'}">
<component is="Flag" />
</el-icon>
<div class="grid-msg-right" @click="toRout('/swapstation/hdz')">
<div class="grid-msg-num" :style="{ color: '#28b3a1'}">
{{ hdztotal }}
</div>
<div style="font-size: 16px;">换电站</div>
</div>
<div class="grid-msg-right" style="border: none;" @click="toRout('/swapstation/hdz',{status: 1})">
<div class="grid-msg-num" :style="{ color: '#b5a210'}">
{{ kyhdz }}
</div>
<div style="font-size: 16px;">可用换电站</div>
</div>
</div>
</div>
</el-col>
<!--电池总量-->
<el-col :span="7">
<div style="width: 100%;border-radius: 12px;box-shadow: 0 0 20px -5px rgba(84, 151, 232, 0.5);">
<div class="grid-message" style="background: #fff;border-radius:15px">
<el-icon class="grid-msg-icon" style="border-radius: 12px 0 0 12px;" :style="{background:'#67C23A'}">
<component is="SuccessFilled" />
</el-icon>
<div class="grid-msg-right" @click="toRout('/swapstation/battery')">
<div class="grid-msg-num" :style="{ color: '#67C23A'}">
{{ rzcompany }}
</div>
<div style="font-size: 16px;">认证公司</div>
</div>
<div class="grid-msg-right" @click="toRout('/swapstation/battery')">
<div class="grid-msg-num" :style="{ color: '#bc92c9'}">
{{ rzuser }}
</div>
<div style="font-size: 16px;">认证用户</div>
</div>
<div class="grid-msg-right" style="border: none;" @click="toRout('/swapstation/battery')">
<div class="grid-msg-num" :style="{ color: '#3aaec2'}">
{{ rzvehicle }}
</div>
<div style="font-size: 16px;">认证车辆</div>
</div>
</div>
</div>
</el-col>
<!--机器人数量-->
<el-col :span="7">
<div style="width: 100%;border-radius: 12px;box-shadow: 0 0 20px -5px rgba(84, 151, 232, 0.5);">
<div class="grid-message" style="background: #fff;border-radius:15px">
<el-icon class="grid-msg-icon" style="border-radius: 12px 0 0 12px;" :style="{background:'#E6A23C'}">
<component is="BellFilled" />
</el-icon>
<div class="grid-msg-right" @click="toRout('swapstation/robot')">
<div class="grid-msg-num" :style="{ color: '#E6A23C'}">
{{ robottotal }}
</div>
<div style="font-size: 16px;">机器人总数</div>
</div>
<div class="grid-msg-right" style="border: none;" @click="toRout('swapstation/robot')">
<div class="grid-msg-num" :style="{ color: '#34a312'}">
{{ kyrobot }}
</div>
<div style="font-size: 16px;">可用机器人</div>
</div>
</div>
</div>
</el-col>
<!-- <el-col v-for="(item, index) in messageList" :key="index" :span="messageList.length -1 == index?4:5">
<div style="width: 100%;border-radius: 12px;box-shadow: 0 0 20px -5px rgba(84, 151, 232, 0.5);">
<div class="grid-message" style="background: #fff;border-radius:15px">
<el-icon class="grid-msg-icon" style="border-radius: 12px 0 0 12px;" :style="{ background: item.color }">
@ -21,37 +113,38 @@
</div>
</div>
</div>
</el-col>
</el-col> -->
</el-row>
<el-row :gutter="20" class="mgb20">
<el-col :span="12">
<div style="width: 100%;height: 200px;border-radius: 10px;box-shadow: 0 0 20px -5px rgba(84, 151, 232, 0.5);">
<div style="display: flex;justify-content: space-between;">
<div style="width:31%;height: 92px;border-radius: 10px 0 0 0;text-align: center;background: #fff;">
<div style="width: 100%;height: 40px;line-height: 40px;font-size: 18px;color: #409eff;border-radius: 10px 10px 0 0;border-bottom: 3px solid #ebf5ff;">认证公司</div>
<div style="height: 55px;line-height: 55px;font-size: 30px;font-weight: bold;color: #409eff;">989</div>
<div style="display: flex;justify-content: space-between;cursor:pointer;">
<div style="width:31%;height: 92px;border-radius: 10px 0 0 0;text-align: center;background: #fff;" @click="toRout('/vehicle/company')">
<div style="width: 100%;height: 40px;line-height: 40px;font-size: 18px;color: #409eff;border-radius: 10px 10px 0 0;border-bottom: 3px solid #ebf5ff;">电池总量</div>
<div style="height: 55px;line-height: 55px;font-size: 30px;font-weight: bold;color: #409eff;">{{ dctotal }}</div>
</div>
<div style="width:31%;height: 92px;text-align: center;background: #fff;">
<div style="width: 100%;height: 40px;line-height: 40px;font-size: 18px;color: #67c23a;border-radius: 10px 10px 0 0;border-bottom: 3px solid #ebf5ff;">认证用户</div>
<div style="height: 55px;line-height: 55px;font-size: 30px;font-weight: bold;color: #67c23a;">662</div>
<div style="width:31%;height: 92px;text-align: center;background: #fff;" @click="toRout('/vehicle/wxuser')">
<div style="width: 100%;height: 40px;line-height: 40px;font-size: 18px;color: #67c23a;border-radius: 10px 10px 0 0;border-bottom: 3px solid #ebf5ff;">充电电池</div>
<div style="height: 55px;line-height: 55px;font-size: 30px;font-weight: bold;color: #67c23a;">{{cddctotal}}</div>
</div>
<div style="width:31%;height: 90px;border-radius: 0 10px 0 0;text-align: center;background: #fff;">
<div style="width: 100%;height: 40px;line-height: 40px;font-size: 18px;color: #e6a23c;border-radius: 10px 10px 0 0;border-bottom: 3px solid #ebf5ff;">认证车辆</div>
<div style="height: 55px;line-height: 55px;font-size: 30px;font-weight: bold;color: #e6a23c;">599</div>
<div style="width:31%;height: 90px;border-radius: 0 10px 0 0;text-align: center;background: #fff;" @click="toRout('/vehicle/car')">
<div style="width: 100%;height: 40px;line-height: 40px;font-size: 18px;color: #e6a23c;border-radius: 10px 10px 0 0;border-bottom: 3px solid #ebf5ff;">可用电池</div>
<div style="height: 55px;line-height: 55px;font-size: 30px;font-weight: bold;color: #e6a23c;">{{kydctotal}}</div>
</div>
</div>
<div style="display: flex;width:100%;height: 90px;border-radius: 0 0 10px 10px;margin-top: 18px;justify-content: space-between;">
<div style="width:31%;height: 90px;border-radius: 0 0 0 10px;text-align: center;background: #fff;">
<div style="width: 100%;height: 40px;line-height: 40px;font-size: 18px;color: #20b2aa;border-radius: 10px 10px 0 0;border-bottom: 3px solid #ebf5ff;">充电桩总数量</div>
<div style="height: 55px;line-height: 55px;font-size: 30px;font-weight: bold;color: #20b2aa;">789</div>
<div style="height: 55px;line-height: 55px;font-size: 30px;font-weight: bold;color: #20b2aa;">--</div>
</div>
<div style="width:31%;height: 90px;text-align: center;background: #fff;">
<div style="width: 100%;height: 40px;line-height: 40px;font-size: 18px;color: #b7a948;border-radius: 10px 10px 0 0;border-bottom: 3px solid #ebf5ff;">充电桩在用数量</div>
<div style="height: 55px;line-height: 55px;font-size: 30px;font-weight: bold;color: #b7a948;">489</div>
<div style="height: 55px;line-height: 55px;font-size: 30px;font-weight: bold;color: #b7a948;">--</div>
</div>
<div style="width:31%;height: 90px;border-radius: 0 0 10px 0;text-align: center;background: #fff;">
<div style="width: 100%;height: 40px;line-height: 40px;font-size: 18px;color: #83abc3;border-radius: 10px 10px 0 0;border-bottom: 3px solid #ebf5ff;">充电桩可用数量</div>
<div style="height: 55px;line-height: 55px;font-size: 30px;font-weight: bold;color: #83abc3;">367</div>
<div style="height: 55px;line-height: 55px;font-size: 30px;font-weight: bold;color: #83abc3;">--</div>
</div>
</div>
</div>
@ -59,17 +152,32 @@
<el-col :span="12">
<div style="width: 100%;height: 200px;border-radius: 10px;box-shadow: 0 0 20px -5px rgba(84, 151, 232, 0.5);">
<div style="display: flex;justify-content: space-between;">
<div style="width:31%;height: 200px;border-radius: 10px 0 0 10px;text-align: center;background: #fff;">
<div style="width:31%;height: 200px;border-radius: 10px 0 0 10px;text-align: center;background: #fff; cursor: pointer;" @click="toRout('/order/replabatt')">
<div style="width: 100%;height: 50px;line-height: 50px;font-size: 18px;color: #409eff;border-radius: 20px 20px 0 0;border-bottom: 3px solid #ebf5ff;">换电订单数</div>
<div style="height: 150px;line-height: 150px;font-size: 40px;font-weight: bold;color: #409eff;">89</div>
<div style="height: 150px;line-height: 150px;font-size: 40px;font-weight: bold;color: #409eff;">{{totalOrder}}</div>
</div>
<div style="width:31%;height: 200px;text-align: center;background: #fff;">
<div style="width: 100%;height: 50px;line-height: 50px;font-size: 18px;color: #67c23a;border-radius: 20px 20px 0 0;border-bottom: 3px solid #ebf5ff;">充电订单数</div>
<div style="height: 150px;line-height: 150px;font-size: 40px;font-weight: bold;color: #67c23a;">66</div>
<div style="height: 150px;line-height: 150px;font-size: 40px;font-weight: bold;color: #67c23a;">--</div>
</div>
<div style="width:31%;height: 200px;border-radius: 0 10px 10px 0;text-align: center;background: #fff;">
<div style="width: 100%;height: 50px;line-height: 50px;font-size: 18px;color: #e6a23c;border-radius: 20px 20px 0 0;border-bottom: 3px solid #ebf5ff;">订单金额</div>
<div style="height: 150px;line-height: 150px;font-size: 40px;font-weight: bold;color: #e6a23c;">599</div>
<div style="width: 100%;height: 40px;line-height: 40px;font-size: 18px;color: #e6a23c;border-radius: 20px 20px 0 0;">收入金额{{totalmoney > 10000000?'(万元)':'(元)'}}</div>
<div style="height: 60px;line-height: 50px;font-size: 40px;font-weight: bold;color: #e6a23c;">
<el-tooltip
class="box-item"
effect="dark"
:content="Math.trunc(totalmoney/100)+' 元'"
placement="top-start"
>
{{ jyamount }}
</el-tooltip>
</div>
<div style="width: 100%;height: 40px;line-height: 40px;font-size: 18px;color: #747d90;border-top: 6px solid #ebf5ff;">支出金额{{totalRefund > 10000000?'(万元)':'(元)'}}</div>
<div style="height: 60px;line-height: 50px;font-size: 40px;font-weight: bold;color: #747d90;">{{zcamount}}</div>
<!-- <div style="height: 75px;font-weight: bold;font-size: 18px;color: #747d90;">
<div style="padding-bottom: 10px;">支出金额</div>
<div style="font-size: 22px;">9999{{zcamount}}</div>
</div> -->
</div>
</div>
</div>
@ -77,26 +185,224 @@
</el-row>
<el-row :gutter="20" class="mgb20">
<el-col :span="8">
<el-col :span="9">
<div ref="refChart4" class="chart-cont2" style="padding:10px;border-radius: 10px;box-shadow: 0 0 20px -5px rgba(84, 151, 232, 0.5);background: #fff;"></div>
</el-col>
<el-col :span="16">
<el-col :span="15">
<div ref="refChart5" class="chart-cont2" style="padding:10px;border-radius: 10px;box-shadow: 0 0 20px -5px rgba(84, 151, 232, 0.5);background: #fff;"></div>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div ref="refChart6" class="chart-cont2" style="height: 240px;padding:10px;border-radius: 10px;box-shadow: 0 0 20px -5px rgba(84, 151, 232, 0.5);background: #fff;"></div>
<el-row :gutter="20">
<el-col :span="9">
<!-- <el-table
style="width:100%;"
:data="tbList"
height="240"
border
>
<el-table-column label="日期" align="center" prop="name" :show-overflow-tooltip="true" />
<el-table-column label="同比" align="center" prop="stationName" :show-overflow-tooltip="true" />
<el-table-column label="同比增长" align="center" prop="stationName" :show-overflow-tooltip="true" />
<el-table-column label="环比" align="center" prop="miniLimit" :show-overflow-tooltip="true" />
<el-table-column label="环比增长" align="center" prop="miniLimit" :show-overflow-tooltip="true" />
</el-table> -->
<div style="border-radius: 10px;box-shadow: 0 0 20px -5px rgba(84, 151, 232, 0.5);background: #fff;">
<el-row style="height: 40px;padding: 0 10px;line-height: 40px;background: #20b2aa;border-radius: 10px 10px 0 0;color: #fff;">
<el-col :span="4" style="text-align: center;">日期</el-col>
<el-col :span="4" style="text-align: center;">订单量</el-col>
<el-col :span="4" style="text-align: center;">同比</el-col>
<el-col :span="4" style="text-align: center;">同比增长</el-col>
<el-col :span="4" style="text-align: center;">环比</el-col>
<el-col :span="4" style="text-align: center;">环比增长</el-col>
</el-row>
<el-row v-if="tbhbdata.month" style="padding:18px 0;">
<el-col :span="4" style="text-align: center;">{{tbhbdata.month}}</el-col>
<el-col :span="4" style="text-align: center;">{{tbhbdata.quantity}}</el-col>
<el-col :span="4" style="text-align: center;">{{tbhbdata.lastMonthQuantity}}</el-col>
<!-- <el-col v-if="jytb > 0" :span="4" style="text-align: center;color: #f89898;">+{{jytb}}</el-col>
<el-col v-else-if="jytb == 0 " :span="4" style="text-align: center;">{{jytb}}</el-col>
<el-col v-else :span="4" style="text-align: center;color: #1664b5;">{{jytb}}</el-col> -->
<template v-if="tbhbdata.lastMonthQuantity == 0">
<el-col v-if="jytb > 0" :span="4" style="display: flex;align-items: center;justify-content: center;text-align: center;color: #1664b5;">
<el-icon color="#1664b5">
<Top />
</el-icon>{{jytb}}</el-col>
<el-col v-else-if="jytb == 0 " :span="4" style="text-align: center;">{{jytb}}</el-col>
<el-col v-else :span="4" style="display: flex;align-items: center;justify-content: center;color: #f89898;"><el-icon color="#f89898">
<Bottom />
</el-icon>{{jytb}}</el-col>
</template>
<template v-else>
<el-col v-if="jytb > 0" :span="4" style="display: flex;align-items: center;justify-content: center;color: #1664b5;">
<el-icon color="#1664b5">
<Top />
</el-icon>
{{parseInt((jytb/tbhbdata.lastMonthQuantity)*100+'')}}%
</el-col>
<el-col v-else-if="jytb == 0" :span="4" style="text-align: center;">0%</el-col>
<el-col v-else :span="4" style="display: flex;align-items: center;justify-content: center;color: #f89898;">
<el-icon color="#f89898">
<Bottom />
</el-icon>
{{parseInt((jytb*-1/tbhbdata.lastMonthQuantity)*100+'')}}%
</el-col>
</template>
<el-col :span="4" style="text-align: center;">{{tbhbdata.lastYearQuantity}}</el-col>
<!-- <el-col v-if="jyhb > 0" :span="4" style="text-align: center;color: #f89898;">+{{jyhb}}</el-col>
<el-col v-else-if="jyhb == 0" :span="4" style="text-align: center;">{{jyhb}}</el-col>
<el-col v-else :span="4" style="text-align: center;color: #1664b5;">{{jyhb}}</el-col> -->
<template v-if="tbhbdata.lastYearQuantity == 0">
<el-col v-if="jyhb > 0" :span="4" style="display: flex;align-items: center;justify-content: center;color: #1664b5;">
<el-icon color="#1664b5">
<Top />
</el-icon>
{{jyhb}}</el-col>
<el-col v-else-if="jyhb == 0" :span="4" style="text-align: center;">{{jyhb}}</el-col>
<el-col v-else :span="4" style="display: flex;align-items: center;text-align: center;color: #f89898;">
<el-icon color="#f89898">
<Bottom />
</el-icon>
{{jyhb}}</el-col>
</template>
<template v-else>
<el-col v-if="jyhb > 0" :span="4" style="display: flex;align-items: center;justify-content: center;color: #1664b5;">
<el-icon color="#1664b5">
<Top />
</el-icon>
{{parseInt((jyhb/tbhbdata.lastYearQuantity)*100+'')}}%
</el-col>
<el-col v-else-if="jyhb == 0" :span="4" style="text-align: center;">0%</el-col>
<el-col v-else :span="4" style="display: flex;align-items: center;justify-content: center;color: #f89898;">
<el-icon color="#f89898">
<Bottom />
</el-icon>
{{parseInt((jyhb*-1/tbhbdata.lastYearQuantity)*100+'')}}%
</el-col>
</template>
</el-row>
</div>
<div style="margin-top: 20px;border-radius: 10px;box-shadow: 0 0 20px -5px rgba(84, 151, 232, 0.5);background: #fff;">
<el-row style="height: 40px;padding: 0 10px;line-height: 40px;background: #e6a23c;border-radius: 10px 10px 0 0;color: #fff;">
<el-col :span="4" style="text-align: center;">日期</el-col>
<el-col :span="4" style="text-align: center;">交易金额</el-col>
<el-col :span="4" style="text-align: center;">同比</el-col>
<el-col :span="4" style="text-align: center;">同比增长</el-col>
<el-col :span="4" style="text-align: center;">环比</el-col>
<el-col :span="4" style="text-align: center;">环比增长</el-col>
</el-row>
<el-row v-if="tbhbdata.month" style="padding: 18px 0;">
<el-col :span="4" style="text-align: center;">{{tbhbdata.month}}</el-col>
<el-col :span="4" style="text-align: center;">{{Math.trunc(tbhbdata.tradeAmount/100)}}</el-col>
<el-col :span="4" style="text-align: center;">{{Math.trunc(tbhbdata.lastMonthTradeAmount/100)}}</el-col>
<!-- <el-col v-if="jetb > 0" :span="4" style="text-align: center;color: #f89898;">+{{jetb}}</el-col>
<el-col v-else-if="jetb == 0 " :span="4" style="text-align: center;">{{jetb}}</el-col>
<el-col v-else :span="4" style="text-align: center;color: #1664b5;">{{jetb}}</el-col> -->
<template v-if="tbhbdata.lastMonthTradeAmount == 0">
<el-col v-if="jetb > 0" :span="4" style="display: flex;align-items: center;justify-content: center;text-align: center;color: #1664b5;">
<el-icon color="#1664b5">
<Top />
</el-icon>{{jetb}}</el-col>
<el-col v-else-if="jetb == 0 " :span="4" style="text-align: center;">{{jetb}}</el-col>
<el-col v-else :span="4" style="display: flex;align-items: center;justify-content: center;color: #f89898;"><el-icon color="#f89898">
<Bottom />
</el-icon>{{jetb}}</el-col>
</template>
<template v-else>
<el-col v-if="jetb > 0" :span="4" style="display: flex;align-items: center;justify-content: center;color: #1664b5;">
<el-icon color="#1664b5">
<Top />
</el-icon>
{{parseInt((jetb/(tbhbdata.lastMonthTradeAmount/100))*100+'')}}%
</el-col>
<el-col v-else-if="jetb == 0" :span="4" style="text-align: center;">0%</el-col>
<el-col v-else :span="4" style="display: flex;align-items: center;justify-content: center;color: #f89898;">
<el-icon color="#f89898">
<Bottom />
</el-icon>
{{parseInt((jetb*-1/(tbhbdata.lastMonthTradeAmount/100))*100+'')}}%
</el-col>
</template>
<el-col :span="4" style="text-align: center;">{{Math.trunc(tbhbdata.lastYearTradeAmount/100)}}</el-col>
<!-- <el-col v-if="jehb > 0" :span="4" style="text-align: center;color: #f89898;">+{{jehb}}</el-col>
<el-col v-else-if="jehb == 0" :span="4" style="text-align: center;">{{jehb}}</el-col>
<el-col v-else :span="4" style="text-align: center;color: #1664b5;">{{jehb}}</el-col> -->
<template v-if="tbhbdata.lastYearTradeAmount == 0">
<el-col v-if="jehb > 0" :span="4" style="display: flex;align-items: center;justify-content: center;text-align: center;color: #1664b5;">
<el-icon color="#1664b5">
<Top />
</el-icon>{{jehb}}</el-col>
<el-col v-else-if="jehb == 0 " :span="4" style="text-align: center;">{{jehb}}</el-col>
<el-col v-else :span="4" style="display: flex;align-items: center;justify-content: center;color: #f89898;"><el-icon color="#f89898">
<Bottom />
</el-icon>{{jehb*-1}}</el-col>
</template>
<template v-else>
<el-col v-if="jehb > 0" :span="4" style="text-align: center;color: #f89898;">+{{parseInt((jehb/tbhbdata.lastYearTradeAmount)*100+'')}}%</el-col>
<el-col v-else-if="jehb == 0" :span="4" style="text-align: center;">{{parseInt((jehb/tbhbdata.lastYearTradeAmount)*100+'')}}%</el-col>
<el-col v-else :span="4" style="text-align: center;color: #1664b5;">{{parseInt((jehb/tbhbdata.lastYearTradeAmount)*100+'')}}%</el-col>
<el-col v-if="jehb > 0" :span="4" style="display: flex;align-items: center;justify-content: center;color: #1664b5;">
<el-icon color="#1664b5">
<Top />
</el-icon>
{{parseInt((jetb/(tbhbdata.lastYearTradeAmount/100))*100+'')}}%
</el-col>
<el-col v-else-if="jehb == 0" :span="4" style="text-align: center;">0%</el-col>
<el-col v-else :span="4" style="display: flex;align-items: center;justify-content: center;color: #f89898;">
<el-icon color="#f89898">
<Bottom />
</el-icon>
{{parseInt((jetb*-1/(tbhbdata.lastYearTradeAmount/100))*100+'')}}%
</el-col>
</template>
</el-row>
</div>
</el-col>
<el-col :span="15">
<div ref="refChart6" class="chart-cont2" style="height: 210px;padding:10px;border-radius: 10px;box-shadow: 0 0 20px -5px rgba(84, 151, 232, 0.5);background: #fff;"></div>
</el-col>
</el-row>
</div>
</template>
<script lang="ts" setup name="homePage">
import { nextTick, onMounted, ref } from "vue";
import { useRouter } from 'vue-router';
import * as echarts from "echarts";
import { onBeforeUnmount } from "vue";
import { watch } from "vue";
import { useElementSize } from "@vueuse/core";
import {
gethdztotal,
getgyctotal,
gethdztj,
getjytj,
getddtj,
get6jytj,
gettbhb
} from '@/api/home'
// import { getToken,removeToken } from '@/utils/auth'
// import { checktoken } from '@/api/login'
@ -112,6 +418,70 @@ import { useElementSize } from "@vueuse/core";
// })
// }
function glnum(n:any){
if(n>10000000){
return Math.round((n/1000000)*100)/100
}
return n/100
}
let router = useRouter()
function toRout(path:string,query:Record<string, any> = {}) {
router.push({
path,
query
})
}
//
let operatotal = ref('')
//
let hdztotal = ref('')
//
let kyhdz = ref('')
//
let dctotal = ref('')
//
let cddctotal = ref('')
//
let kydctotal = ref('')
//
let robottotal = ref('')
//
let kyrobot = ref('')
//
let rzcompany = ref('')
//
let rzuser = ref('')
//
let rzvehicle = ref('')
//
let tbList = ref<any>([])
//
gethdztotal().then(rps => {
operatotal.value = (rps.data as any).proxyer
hdztotal.value = (rps.data as any).totalStation
kyhdz.value = (rps.data as any).workStation
dctotal.value = (rps.data as any).totalDC
cddctotal.value = (rps.data as any).chargeDC
kydctotal.value = (rps.data as any).availableDC
robottotal.value = (rps.data as any).totalRobot
kyrobot.value = (rps.data as any).availableRobot
})
//
getgyctotal().then(rps => {
rzcompany.value = (rps.data as any).conpany
rzuser.value = (rps.data as any).totalUser
rzvehicle.value = (rps.data as any).totalCar
})
const messageList = ref([
{
@ -148,7 +518,7 @@ const messageList = ref([
},
{
type: "message",
name: "可用电池数量",
name: "机器人数量",
count: 0,
color: "#E6A23C",
icon: "BellFilled",
@ -175,34 +545,32 @@ const initChart4 = () => {
//
const option = {
title: {
text: "换电站收入占比",
text: "换电站订单占比",
left: "left",
textStyle: {
color: '#2363a5',
fontSize: 16
}
},
label: {
show: true, //
formatter: '{b}({d}%)' // 使 formatter {b} {d} {@2019}
},
tooltip: {
trigger: "item",
},
legend: {
type: "scroll",
orient: "horizontal",
left: "center",
bottom: 0,
},
// legend: {
// type: "scroll",
// orient: "horizontal",
// left: "center",
// bottom: 0,
// },
series: [
{
name: "数量",
type: "pie",
radius: ['40%','70%'],
data: [
{ value: 1048, name: "充电订单" },
{ value: 735, name: "换电订单" },
{ value: 580, name: "认证" },
{ value: 484, name: "换电" },
{ value: 300, name: "充电" },
],
data: bzdata.value,
padAngle: 2,
emphasis: {
itemStyle: {
@ -232,7 +600,7 @@ const initChart5 = () => {
//
const option = {
title: {
text: "换电站信息统计",
text: "换电站近半年订单统计",
left: "center",
textStyle: {
color: '#2363a5',
@ -267,13 +635,14 @@ const initChart5 = () => {
// },
// },
legend: {
data: [ "换电营收", "换电量"],
bottom: 0,
data: [ "订单", "金额"],
top:25
//bottom: 0,
},
xAxis: [
{
type: "category",
data: ["1月", "2月", "3月", "4月", "5月", "6月", "7月"],
data:xdata.value, //["1", "2", "3", "4", "5", "6", "7"],
axisPointer: {
type: "shadow",
},
@ -282,66 +651,68 @@ const initChart5 = () => {
yAxis: [
{
type: "value",
name: "换电营收",
min: 0,
max: 250,
interval: 50,
name: "订单",
// min: 0,
// max: 50,
// interval: 50,
axisLabel: {
formatter: "{value}",
formatter: "{value}",
},
},
{
type: "value",
name: "换电量",
min: 0,
max: 25,
interval: 5,
name: "金额",
// min: 0,
// max: 50,
// interval: 50,
axisLabel: {
formatter: "{value} ",
},
formatter: "{value} ",
}
},
],
series: [
{
name: "换电营收",
name: "订单",
type: "bar",
tooltip: {
valueFormatter: function (value: string) {
return value + " ml";
return value;
},
},
data: [80.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3],
data:yOrder.value, //[80.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3],
yAxisIndex:0
},
{
name: "换电量",
name: "金额",
type: "bar",
tooltip: {
valueFormatter: function (value: string) {
return value + " ml";
return value + " ";
},
},
data: [2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3],
data:yMoney.value, //[2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3],
yAxisIndex:1
},
{
name: "换电营收",
type: "line",
tooltip: {
valueFormatter: function (value: string) {
return value + " ml";
},
},
data: [5.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3],
},
{
name: "换电量",
type: "line",
tooltip: {
valueFormatter: function (value: string) {
return value + " ml";
},
},
data: [2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3],
}
// {
// name: "",
// type: "line",
// tooltip: {
// valueFormatter: function (value: string) {
// return value + " ";
// },
// },
// data:yMoney.value //[5.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3],
// },
// {
// name: "",
// type: "line",
// tooltip: {
// valueFormatter: function (value: string) {
// return value + " ml";
// },
// },
// data: [2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3],
// }
],
};
// 使
@ -357,9 +728,10 @@ const initChart6 = () => {
//echarts
myChart6 = echarts.init(refChart6.value)
//
const option = {
title: {
text: "换电车辆统计",
text: "近半年交易统计",
left: "center",
textStyle: {
color: '#2363a5',
@ -381,10 +753,15 @@ const initChart6 = () => {
},
},
},
legend: {
data: [ "收入交易","余额支付交易","退款交易","收入金额","余额支付金额","退款金额"],
top:25
//bottom: 0,
},
xAxis: [
{
type: "category",
data: ["合肥站", "南京站", "长沙站", "石家庄站", "海口站", "无锡汇聚换电站"],
data:xjydata.value,
axisPointer: {
type: "shadow",
},
@ -392,15 +769,93 @@ const initChart6 = () => {
],
yAxis: [
{
type: "value"
}
type: "value",
name: "交易",
// min: 0,
// max: 50,
// interval: 50,
axisLabel: {
formatter: "{value}",
},
},
{
type: "value",
name: "金额",
// min: 0,
// max: 50,
// interval: 50,
axisLabel: {
formatter: "{value} 元",
}
},
],
series: [
{
name: "收入交易",
type: "bar",
barWidth:'15%',
data: [80.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4],
}
tooltip: {
valueFormatter: function (value: string) {
return value;
},
},
data:yjydata.value,
yAxisIndex:0
},
{
name: "余额支付交易",
type: "bar",
tooltip: {
valueFormatter: function (value: string) {
return value;
},
},
data:walletQuantity.value,
yAxisIndex:0
},
{
name: "退款交易",
type: "bar",
tooltip: {
valueFormatter: function (value: string) {
return value;
},
},
data:refundQuantity.value,
yAxisIndex:0
},
{
name: "收入金额",
type: "line",
tooltip: {
valueFormatter: function (value: string) {
return value + " 元";
},
},
data:jyMoney.value,
yAxisIndex:1
},
{
name: "余额支付金额",
type: "line",
tooltip: {
valueFormatter: function (value: string) {
return value + " 元";
},
},
data:walletMoney.value,
yAxisIndex:1
},
{
name: "退款金额",
type: "line",
tooltip: {
valueFormatter: function (value: string) {
return value + " 元";
},
},
data:refundMoney.value,
yAxisIndex:1
},
],
};
// 使
@ -425,21 +880,179 @@ watch(pageWidth, () => {
resizeChart();
});
//
let totalOrder = ref('')
//
let jyamount = ref<any>('')
let totalmoney = ref<any>('')
//
let zcamount = ref<any>('')
let totalRefund = ref<any>('')
//
let bzdata = ref<any>([])
//6
let xdata = ref<any>([])
let yMoney = ref<any>([])
let yOrder = ref<any>([])
//6
let xjydata = ref<any>([])
let yjydata = ref<any>([])
let jyMoney = ref<any>([])
let walletQuantity = ref<any>([]) //
let refundQuantity = ref<any>([]) //退
let walletMoney = ref<any>([]) //
let refundMoney = ref<any>([]) //退
let tbhbdata = ref<any>({})
let jytb = ref<any>('') //
let jyhb = ref<any>('') //
let jetb = ref<any>('') //
let jehb = ref<any>('') //
//
onMounted(() => {
nextTick(() => {
//6
getddtj().then(rps => {
if(rps.data){
xdata.value = (rps.data as any).map((n:any) => {
return n.month
})
yOrder.value = (rps.data as any).map((n:any) => {
return n.quantity
})
yMoney.value = (rps.data as any).map((n:any) => {
return n.totalMoney
})
initChart5()
}
})
//6
get6jytj().then(rps => {
xjydata.value = (rps.data as any).map((n:any) => {
return n.month
})
yjydata.value = (rps.data as any).map((n:any) => {
return n.inQuantity
})
jyMoney.value = (rps.data as any).map((n:any) => {
return Math.trunc(n.inMoney/100)
})
walletQuantity.value = (rps.data as any).map((n:any) => {
return n.walletQuantity
})
refundQuantity.value = (rps.data as any).map((n:any) => {
return n.refundQuantity
})
walletMoney.value = (rps.data as any).map((n:any) => {
return Math.trunc(n.walletMoney/100)
})
refundMoney.value = (rps.data as any).map((n:any) => {
return Math.trunc(n.walletMoney/100)
})
initChart6()
})
//
gettbhb(1).then(rps => {
tbhbdata.value = rps.data
jytb.value = tbhbdata.value.quantity - tbhbdata.value.lastMonthQuantity //
jyhb.value = tbhbdata.value.quantity - tbhbdata.value.lastYearQuantity //
jetb.value = Math.trunc((tbhbdata.value.tradeAmount - tbhbdata.value.lastMonthTradeAmount)/100) //
jehb.value =Math.trunc((tbhbdata.value.tradeAmount - tbhbdata.value.lastYearTradeAmount)/100) //
})
//gettbhb(2).then(rps => {})
let year = new Date().getFullYear()
let moth:any = String((new Date().getMonth() + 1)).padStart(2,'0')
let date = String(new Date().getDate()).padStart(2,'0')
// if(moth < 10){
// moth = '0'+ moth
// }
//-
gethdztj({
timeBegin:`${year}-01-01 00:00:00`,
timeEnd:`${year}-${moth}-${date} 23:59:59`
}).then(rps => {
totalOrder.value = (rps.data as any).quantity
bzdata.value = (rps.data as any).stationOrderDataList.map((n:any) => {
return {
name:n.stationName,
value:n.quantity
}
})
// let keys = Object.keys((rps.data as any).stationRatio)
// let values = Object.values((rps.data as any).stationRatio)
// bzdata.value = keys.map((n,i) => {
// return {
// name:n.split('---')[1],
// value:values[i]
// }
// })
// data: [
// { value: 1048, name: "" },
// { value: 735, name: "" },
// { value: 580, name: "" },
// { value: 484, name: "" },
// { value: 300, name: "" },
// ],
initChart4();
initChart5();
initChart6();
window.addEventListener("resize", resizeChart);
});
});
})
//
getjytj({
timeBegin:`${year}-01-01 00:00:00`,
timeEnd:`${year}-${moth}-${date} 23:59:59`
}).then(rps => {
totalmoney.value = (rps.data as any).totalMoney
jyamount.value = (rps.data as any).totalMoney
jyamount.value = glnum(jyamount.value)
zcamount.value = (rps.data as any).totalRefund
zcamount.value = glnum(zcamount.value)
totalRefund.value = (rps.data as any).totalRefund
})
window.addEventListener("resize", resizeChart)
})
})
//
onBeforeUnmount(() => {
window.removeEventListener("resize", resizeChart);
});
window.removeEventListener("resize", resizeChart)
})
// defineExpose使
// defineExpose({ value });
@ -464,6 +1077,7 @@ onBeforeUnmount(() => {
text-align: center;
font-size: 14px;
color: #999;
border-right:1px solid #ccc;
}
.grid-msg-num {

View File

@ -1,6 +1,6 @@
<template>
<div>
<div class="app-container" style="margin-bottom: 12px;padding-bottom: 5px;border-radius: 10px;">
<div v-if="search" class="app-container" style="margin-bottom: 12px;padding-bottom: 5px;border-radius: 10px;">
<el-form
ref="querform"
:model="queryParams"
@ -24,17 +24,22 @@
</el-form>
</div>
<div class="app-container" style="margin-bottom: 12px;border-radius: 10px;">
<el-button
<div style="display: flex;justify-content: space-between;">
<el-button
type="primary"
plain
icon="Plus"
@click="showpop(1)">新增</el-button>
<el-tooltip class="item" effect="dark" :content="search? '隐藏搜索' : '显示搜索'" placement="top">
<el-button size="mini" circle icon="Search" @click="search = !search" />
</el-tooltip>
</div>
<el-table
style="width:100%;margin-top: 10px;"
:data="yysList"
border
stripe
max-height="600px"
:max-height="search?'600px':'680px'"
>
<el-table-column label="账户编码" min-width="300" align="center" prop="code" :show-overflow-tooltip="true">
<template #default="scope">
@ -367,6 +372,7 @@
return new Date().getTime()
}
let search = ref(true)
let queryParams = reactive({
pageSize:20, //
@ -388,7 +394,7 @@
//
let yunList = ref<any>([])
gethdzlist({
pageSize:20, //
pageSize:100, //
pageNo:1, //
proxyId:'', //ID
name:'', //

View File

@ -1,6 +1,6 @@
<template>
<div>
<div class="app-container" style="margin-bottom: 12px;padding-bottom: 5px;border-radius: 10px;">
<div v-if="search" class="app-container" style="margin-bottom: 12px;padding-bottom: 5px;border-radius: 10px;">
<el-form
ref="querform"
:model="queryParams"
@ -12,6 +12,18 @@
<el-form-item label="车牌号" prop="plateNum">
<el-input v-model="queryParams.plateNum" placeholder="请输入车牌号" clearable />
</el-form-item>
<el-form-item label="订单状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择状态" style="width: 200px;">
<el-option label="已创建" value="1" />
<el-option label="换电中" value="2" />
<el-option label="换电完成" value="3" />
<el-option label="充电中" value="4" />
<el-option label="充电完成" value="5" />
<el-option label="待结算" value="6" />
<el-option label="已完成" value="7" />
<el-option label="已取消" value="9" />
</el-select>
</el-form-item>
<el-form-item label="订单开始时间" prop="orderTimeBegin">
<el-date-picker
v-model="queryParams.orderTimeBegin"
@ -45,18 +57,37 @@
</el-form>
</div>
<div class="app-container" style="margin-bottom: 12px;border-radius: 10px;">
<el-button
type="primary"
plain
icon="Plus"
@click="showpop(1)">新增</el-button>
<div style="display: flex;justify-content: space-between;">
<div>
<el-button
type="primary"
plain
icon="Plus"
@click="showpop(1)">新增</el-button>
<el-button
type="primary"
plain
icon="Wallet"
@click="zfdrawer = true">批量支付</el-button>
</div>
<el-tooltip class="item" effect="dark" :content="search? '隐藏搜索' : '显示搜索'" placement="top">
<el-button size="mini" circle icon="Search" @click="search = !search" />
</el-tooltip>
</div>
<!--@selection-change="selChange"-->
<el-table
style="width:100%;margin-top: 10px;"
:data="yysList"
border
stripe
max-height="600px"
:max-height="search?'550px':'680px'"
>
<!-- <el-table-column type="selection" width="55" /> -->
<el-table-column label="订单号" min-width="320" align="center" prop="orderNo" :show-overflow-tooltip="true">
<template #default="scope">
<div @click="getdetails(scope.row)" style="display: inline-block;color:#16599d;border-bottom: 1px solid #417ebb;cursor:pointer">{{scope.row.orderNo}}</div>
@ -79,7 +110,7 @@
<div v-else-if="scope.row.status == 3">换电完成</div>
<div v-else-if="scope.row.status == 4">充电中</div>
<div v-else-if="scope.row.status == 5">充电完成</div>
<div v-else-if="scope.row.status == 6">待结算</div>
<div v-else-if="scope.row.status == 6" style="color: #ff6000;">待结算</div>
<div v-else-if="scope.row.status == 7">已完成</div>
<div v-else-if="scope.row.status == 7">已取消</div>
</template>
@ -387,6 +418,15 @@
</template>
</el-dialog>
<!--批量支付-->
<el-drawer
v-model="zfdrawer"
:with-header="false"
size="1200px"
>
<Payment v-if="zfdrawer" />
</el-drawer>
<!--详情修改-->
<el-drawer
v-model="drawer"
@ -426,7 +466,7 @@
<el-col :span="8">
<el-row>
<el-col :span="5">订单状态</el-col>
<el-col :span="19" style="color: #417ebb;">{{getstu(xqobj.status)}}</el-col>
<el-col :span="19" :style="{color:xqobj.status == 6?'#ff6000':'#417ebb'}">{{getstu(xqobj.status)}}</el-col>
</el-row>
</el-col>
<el-col :span="8">
@ -594,6 +634,7 @@
<el-row style="margin-bottom: 20px;padding-bottom: 20px;border-bottom: 1px solid #ccc;">
<el-col :span="xqobj.status == 5?12:24" :style="{textAlign:xqobj.status == 5?'right':'center'}">
<el-button
v-if="xqobj.status != 7 || xqobj.status != 9"
style="margin-right: 25px;"
type="primary"
plain
@ -635,14 +676,28 @@
import {
getwxlist
} from '@/api/operation/wxuser'
import { carNum } from '@/utils/validate'
import Payment from './payment.vue'
// import {
// getdict
// } from '@/api/systemSet/dict'
import { jsonp } from 'vue-jsonp'
import { ref,reactive} from 'vue'
// import { jsonp } from 'vue-jsonp'
import { ref,reactive,watch} from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
//
let zfdrawer = ref(false)
watch(zfdrawer,v =>{
if(!v){
handBtnqu()
}
})
let search = ref(true)
let queryParams = reactive({
pageSize:20, //
pageNo:1, //
@ -653,7 +708,8 @@
stationCode:'', //
stationName:'', //
userId:'', //ID
tradeNo:'' //
tradeNo:'', //
status:''
})
//
@ -713,22 +769,24 @@
})
}
function autoblur() {
if(addata.userId === ''){
if(addata.orderPreUid === ''){
wxuser.value = ''
}
}
function autoclear() {
addata.userId = ''
addata.orderPreUid = ''
addata.orderPreUname = ''
addata.orderPrePhone = ''
}
function handleSelect(v: any) {
console.log(v)
//addata.userId = v.id
addata.orderPreUid = v.pkId //
addata.orderPreUname = v.name //
addata.orderPrePhone = v.phoneNumber //
}
function getyys() {
yysList.value.splice(0)
getjqrlist(queryParams).then(rps => {
@ -806,7 +864,7 @@
returnBatRentStationName:'', //
changeMode:'', //1-2-3-
changeLane:'', // 1-A ;2-B
userId:'', //ID
//userId:'', //ID
tradeNo:'', //
orderPreId:'', //ID
@ -873,7 +931,7 @@
addata.returnBatRentStationName = row.returnBatRentStationName
addata.changeMode = row.changeMode
addata.changeLane = row.changeLane
addata.userId = row.userId
//addata.userId = row.userId
addata.tradeNo= row.tradeNo
}else{
@ -905,7 +963,7 @@
addata.returnBatRentStationName = ''
addata.changeMode = ''
addata.changeLane = ''
addata.userId = '' //??
// addata.userId = '' //??
addata.tradeNo = ''
}
}
@ -988,6 +1046,27 @@
})
}
//
let dzarr = ref<any[]>([])
function selChange(v:any) {
dzarr.value = v
}
function payment() {
if(dzarr.value.length > 0){
// ElMessage({
// type: 'success',
// message: ''
// })
}else{
ElMessage({
type: 'warning',
message: '请选择订单'
})
}
}
getyys()
</script>
<style scoped>

View File

@ -0,0 +1,479 @@
<template>
<div>
<div class="app-container" style="margin-bottom: 12px;padding-bottom: 5px;border-radius: 10px;">
<el-form
ref="querform"
:model="queryParams"
:inline="true"
>
<el-form-item label="所属公司" prop="ccode">
<el-select v-model="queryParams.ccode" style="width: 200px;">
<el-option v-for="n in gongslist" :label="n.cname" :value="n.ccode" @click="getcname(n)" />
</el-select>
</el-form-item>
<el-form-item label="订单号" prop="orderNo">
<el-input v-model="queryParams.orderNo" placeholder="请输入订单号" clearable />
</el-form-item>
<el-form-item label="车牌号" prop="plateNum">
<el-input v-model="queryParams.plateNum" placeholder="请输入车牌号" clearable />
</el-form-item>
<el-form-item label="订单开始时间" prop="orderTimeBegin">
<el-date-picker
v-model="queryParams.orderTimeBegin"
value-format="YYYY-MM-DD HH:mm:ss"
style="width: 100%;"
type="datetime"
placeholder="请选择时间"
/>
</el-form-item>
<el-form-item label="订单结束时间" prop="orderTimeEnd">
<el-date-picker
v-model="queryParams.orderTimeEnd"
value-format="YYYY-MM-DD HH:mm:ss"
style="width: 100%;"
type="datetime"
placeholder="请选择时间"
/>
</el-form-item>
<el-form-item label="换电站" prop="stationCode">
<el-select v-model="queryParams.stationCode" placeholder="请选择换电站" style="width: 200px;">
<el-option v-for="n in yunList" :label="n.name" :value="n.code" />
</el-select>
</el-form-item>
<!-- <el-form-item label="交易编码" prop="tradeNo">
<el-input v-model="queryParams.tradeNo" placeholder="请输入交易编码" clearable />
</el-form-item> -->
<el-form-item>
<el-button type="primary" icon="Search" @click="handBtnqu">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
</div>
<div class="app-container" style="margin-bottom: 12px;border-radius: 10px;">
<el-button
type="primary"
plain
icon="Wallet"
@click="payment(1)">支付</el-button>
<el-table
style="width:100%;margin-top: 10px;"
:data="yysList"
border
stripe
max-height="600px"
@selection-change="selChange"
>
<el-table-column type="selection" width="55" />
<el-table-column label="订单号" min-width="320" align="center" prop="orderNo" :show-overflow-tooltip="true" />
<el-table-column label="订单类型" min-width="80" align="center" prop="sourceFrom" :show-overflow-tooltip="true">
<template #default="scope">
<div v-if="scope.row.status == 1">换电</div>
<div v-else-if="scope.row.status == 2">充电</div>
</template>
</el-table-column>
<el-table-column label="车牌号" min-width="120" align="center" prop="plateNum" :show-overflow-tooltip="true" />
<el-table-column label="订单时间" min-width="200" align="center" prop="orderTime" :show-overflow-tooltip="true" />
<el-table-column label="金额账号" min-width="120" align="center" prop="accountCode" :show-overflow-tooltip="true" />
<el-table-column label="订单金额" min-width="120" align="center" prop="amount" :show-overflow-tooltip="true" />
<el-table-column label="订单状态" min-width="120" align="center" prop="status" :show-overflow-tooltip="true">
<template #default="scope">
<div v-if="scope.row.status == 1">已创建</div>
<div v-else-if="scope.row.status == 2">换电中</div>
<div v-else-if="scope.row.status == 3">换电完成</div>
<div v-else-if="scope.row.status == 4">充电中</div>
<div v-else-if="scope.row.status == 5">充电完成</div>
<div v-else-if="scope.row.status == 6" style="color: #ff6000;">待结算</div>
<div v-else-if="scope.row.status == 7">已完成</div>
<div v-else-if="scope.row.status == 7">已取消</div>
</template>
</el-table-column>
<el-table-column label="计费方式" min-width="120" align="center" prop="feeType" :show-overflow-tooltip="true">
<template #default="scope">
<div v-if="scope.row.feeType == 1">ODO</div>
<div v-else-if="scope.row.feeType == 2">SOC</div>
<div v-else-if="scope.row.feeType == 3">换电量</div>
</template>
</el-table-column>
<el-table-column label="基础费用" min-width="120" align="center" prop="basicFee" :show-overflow-tooltip="true" />
<el-table-column label="服务开始时间" min-width="120" align="center" prop="serviceTimeBegin" :show-overflow-tooltip="true" />
<el-table-column label="服务结束时间" min-width="120" align="center" prop="serviceTimeEnd" :show-overflow-tooltip="true" />
<el-table-column label="服务费" min-width="120" align="center" prop="serviceFee" :show-overflow-tooltip="true" />
<el-table-column label="上次租赁电池时车辆里程" min-width="180" align="center" prop="lastRentBatCarOdo" :show-overflow-tooltip="true" />
<el-table-column label="归还电池时车辆里程" min-width="150" align="center" prop="nowReturnBatCarOdo" :show-overflow-tooltip="true" />
<el-table-column label="按ODO换电费" min-width="120" align="center" prop="odoAmount" :show-overflow-tooltip="true" />
<el-table-column label="总充电量" min-width="120" align="center" prop="electAmount" :show-overflow-tooltip="true" />
<el-table-column label="租借电池包仓位" min-width="120" align="center" prop="rentBatNo" :show-overflow-tooltip="true" />
<el-table-column label="租用电池包编码" min-width="120" align="center" prop="rentBatCode" :show-overflow-tooltip="true" />
<el-table-column label="租用电池包SOC" min-width="120" align="center" prop="rentBatSoc" :show-overflow-tooltip="true" />
<el-table-column label="归还电池包编码" min-width="120" align="center" prop="returnBatCode" :show-overflow-tooltip="true" />
<el-table-column label="归还电池包仓位" min-width="120" align="center" prop="returnBatNo" :show-overflow-tooltip="true" />
<el-table-column label="归还电池包SOC" min-width="120" align="center" prop="returnBatSoc" :show-overflow-tooltip="true" />
<el-table-column label="归还电池租出时soc" min-width="150" align="center" prop="returnBatRentSoc" :show-overflow-tooltip="true" />
<el-table-column label="归还电池租出的换电站" min-width="160" align="center" prop="returnBatRentStationName" :show-overflow-tooltip="true" />
<el-table-column label="换电模式" min-width="120" align="center" prop="changeMode" :show-overflow-tooltip="true">
<template #default="scope">
<div v-if="scope.row.changeMode == 1">全自动</div>
<div v-else-if="scope.row.changeMode == 2">半自动</div>
<div v-else-if="scope.row.changeMode == 3">人工干预</div>
</template>
</el-table-column>
<el-table-column label="换电车道" min-width="120" align="center" prop="changeLane" :show-overflow-tooltip="true">
<template #default="scope">
<div v-if="scope.row.changeMode == 1">A车道</div>
<div v-else-if="scope.row.changeMode == 2">B车道</div>
<div v-else-if="scope.row.changeMode == 3">人工干预</div>
</template>
</el-table-column>
<el-table-column label="交易编码" min-width="120" align="center" prop="tradeNo" :show-overflow-tooltip="true" />
</el-table>
<div v-if="total > 10" style="display: flex;justify-content: right;padding-top:20px;">
<el-pagination
v-model:current-page="queryParams.pageNo"
v-model:page-size="queryParams.pageSize"
:page-sizes="[10, 20, 30, 40]"
background
size="small"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
@size-change="handleSizeChange"
@current-change="getyys"
/>
</div>
</div>
<el-dialog
v-model="openpop"
width="500"
:align-center="true"
:close-on-click-modal="false"
@close="zfclose"
>
<div style="width: 100%;padding: 25px;text-align: center;">
<div style="padding-bottom: 15px;font-size: 22px;">请打开微信扫一扫完成支付</div>
<div v-if="qscode" style="display: flex;padding-bottom: 15px;align-items: center;justify-content: center;">
<div style="padding-right: 10px;">剩余支付时间</div>
<div style="padding-right: 6px;color: #ff6000;"><span style="font-size: 22px;">{{tmminute}} </span></div>
<div style="color: #ff6000;"><span style="font-size: 22px;">{{tmsecond}} </span></div>
</div>
<div v-if="qscode" style="position: relative;width: 200px;height: 200px;margin: 0 auto;">
<div v-if="issx" @click="payment()" style="position: absolute;top: 0;left: 0;width: 200px;height: 200px;line-height: 200px;font-size: 20px;color: #fff;background:rgba(0, 0, 0, 0.7);cursor: pointer;">点击重新获取</div>
<img :src="qscode" width="200" height="200" />
</div>
<div v-else style="width:200px;height:200px;margin: 0 auto;line-height: 200px;text-align: center;">正在生成二维码...</div>
</div>
</el-dialog>
</div>
</template>
<script setup lang="ts" name="UserPage">
import {
gethdzlist
} from '@/api/swapstation/hdz'
import {
getjqrlist,
batchpayment,
getip,
paystatus
} from '@/api/order/replabatt'
import {
getlist
} from '@/api/operation/company'
// import {
// getdict
// } from '@/api/systemSet/dict'
// import { jsonp } from 'vue-jsonp'
import { ref,reactive} from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
// const emit = defineEmits<{
// close: []
// }>()
let queryParams = reactive({
pageSize:20, //
pageNo:1, //
orderNo:'', //
plateNum:'', //
orderTimeBegin:'', //,(yyyy-MM-dd HH:mm:ss)
orderTimeEnd:'', //
stationCode:'', //
stationName:'', //
userId:'', //ID
tradeNo:'', //
status:'6', //
ccode:'' //
})
//
let total = ref(0)
let yysList = ref<any>([])
function handBtnqu(){
queryParams.pageNo = 1
getyys()
}
let cname = ref('')
//
let gongslist = ref<any>([])
getlist({
pageSize:100, //
pageNo:1 //
}).then(rps => {
if(rps.data){
let list = (rps.data as any).records
gongslist.value = list?list:[]
queryParams.ccode = gongslist.value[0].ccode
cname.value = gongslist.value[0].cname
getyys()
}
})
function getcname(n:any){
cname.value = n.cname
}
//
let yunList = ref<any>([])
gethdzlist({
pageSize:20, //
pageNo:1, //
proxyId:'', //ID
name:'', //
code:'', //
status:'', //1-2-3-4-9-
type:'', //ID
}).then(rps => {
if(rps.data){
let list = (rps.data as any).records
yunList.value = list?list:[]
//queryParams.stationCode = list[0].code
//getyys()
}
})
let wxuser = ref('')
function getyys() {
yysList.value.splice(0)
getjqrlist(queryParams).then(rps => {
if(rps.data){
yysList.value = (rps.data as any).records
total.value = (rps.data as any).total
}
})
}
function handleSizeChange(val:number) {
queryParams.pageSize = val
getyys()
}
//
let querform = ref()
function resetQuery() {
querform.value?.resetFields()
}
//
let dzarr = ref<any[]>([])
//ip
getip().then(rps => {
payqs.payerClientIp = rps.data
})
let openpop = ref(false)
//
let totalAmount = ref<any>(0)
//
let orderNo = ref('')
function selChange(v:any) {
dzarr.value = v
totalAmount.value = 0
let odrarr = []
if(v.length > 0){
odrarr = v.map((e:any) => {
e.amount = e.amount*1
totalAmount.value += e.amount
return e.orderNo
})
}
orderNo.value = odrarr.join()
}
let payqs = reactive<any>({
//wuid:'', //,
ccode:'', //
description:'', // +
total:0, //
timeExp:'', //
attach:{ //
type: 2, //"1-,2- number"
orderNo:'', //"",
trader:'', //
tradercode:'', //uni.getStorageSync('wxuid') //
description:''
//walletCode:'' //
// ownerId:'', //"IDwuid:",
// walletCode:'' //""
},
// goodsDetail:[
// {
// merchantGoodsId:'', //
// wechatpayGoodsId:'', //
// goodsName:'', //
// quantity:1, //
// unitPrice:0 //
// }
// ],
payerClientIp:'', //IP
//deviceId:'', //
//stationCode:''
})
let timer:any = null
let qscode = ref('')
function zfclose() {
payqs.attach = JSON.parse(payqs.attach)
clearInterval(timer)
}
//
let minute = ref<any>(29)
let second = ref<any>(59)
let tmminute = ref<any>(29)
let tmsecond = ref<any>(59)
let djstimet:any = null
//
let issx = ref(false)
function payment(type?:number) {
if(dzarr.value.length > 0){
//
let sxtime:any = new Date().getTime()
sxtime = sxtime + 30 * 60 * 1000
sxtime = new Date(sxtime)
let sxyear = sxtime.getFullYear()
let sxmoth = String((sxtime.getMonth() + 1)).padStart(2,'0')
let sxdate = String(sxtime.getDate()).padStart(2,'0')
let sxhhour = String(sxtime.getHours()).padStart(2,'0')
let sxminute = String(sxtime.getMinutes()).padStart(2,'0')
let sxSeconds = String(sxtime.getSeconds()).padStart(2,'0')
payqs.timeExp = `${sxyear}-${sxmoth}-${sxdate} ${sxhhour}:${sxminute}:${sxSeconds}`
payqs.ccode = queryParams.ccode
payqs.total = totalAmount
payqs.attach.orderNo = orderNo.value
payqs.attach.tradercode = queryParams.ccode
let dateTime = new Date()
let year = dateTime.getFullYear()
let moth:any = String((dateTime.getMonth() + 1)).padStart(2,'0')
//let date = String(dateTime.getDate()).padStart(2,'0')
let ddms = `${cname.value}支付${year}${moth}月订单`
payqs.description = ddms
payqs.attach.description = ddms
if(type == 1){
payqs.attach = JSON.stringify(payqs.attach)
}else{
issx.value = false
}
openpop.value = true
qscode.value = ''
if(timer){
clearInterval(timer)
}
if(djstimet){
clearInterval(djstimet)
}
batchpayment(payqs).then(rps => {
qscode.value = (rps.data as any).codeUrl
djstimet = setInterval(() => {
second.value--
tmsecond.value = second.value
if(second.value == 0 && minute.value == 0) {
tmminute.value = '00'
tmsecond.value = '00'
issx.value = true
clearInterval(djstimet)
}
if(second.value == 0) {
second.value = 59
tmsecond.value = 59
minute.value--
if(minute.value < 10){
tmminute.value = '0'+ minute.value
}else{
tmminute.value = minute.value
}
}
if(second.value < 10){
tmsecond.value = '0' + second.value
}else{
tmsecond.value = second.value
}
}, 1000)
timer = setInterval(() => {
paystatus((rps.data as any).OutTradeNo).then(rps => {
if((rps.data as any).tradeState == 'SUCCESS'){ //'NOTPAY'
ElMessage({
type: 'warning',
message: '支付成功'
})
openpop.value = false
handBtnqu()
}
})
},5000)
})
// ElMessage({
// type: 'success',
// message: ''
// })
}else{
ElMessage({
type: 'warning',
message: '请选择订单'
})
}
}
</script>
<style scoped>
.el-divider--horizontal{
border-color:#5b98cd;
}
</style>

View File

@ -1,24 +1,24 @@
<template>
<div>
<div class="app-container" style="margin-bottom: 12px;padding-bottom: 5px;border-radius: 10px;">
<div v-if="search" class="app-container" style="margin-bottom: 12px;padding-bottom: 5px;border-radius: 10px;">
<el-form
ref="querform"
:model="queryParams"
:inline="true"
>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" style="width: 200px" placeholder="请选择状态">
<el-select v-model="queryParams.status" style="width: 180px" placeholder="请选择状态">
<el-option label="预约成功" value="1" />
<el-option label="到店使用" value="2" />
<el-option label="取消" value="3" />
<el-option label="过期" value="4" />
<el-option label="使用" value="2" />
<el-option label="取消" value="3" />
<el-option label="过期" value="4" />
</el-select>
</el-form-item>
<!-- <el-form-item label="预约车主" prop="userId">
<el-input v-model="queryParams.userId" placeholder="请输入车主" clearable />
</el-form-item> -->
<el-form-item label="预约人" prop="userId">
<el-form-item label="预约人" prop="ucode">
<el-autocomplete
style="width: 100%"
v-model="qswxuser"
@ -30,6 +30,39 @@
@clear="qsautoclear"
/>
</el-form-item>
<el-form-item label="车牌号" prop="plateNum">
<el-input v-model="queryParams.plateNum" placeholder="请输入车牌号" clearable />
</el-form-item>
<el-form-item v-if="yunList.length > 0" label="换电站" prop="stationCode">
<el-select style="width: 200px;" v-model="queryParams.stationCode" placeholder="请选择换电站">
<el-option
v-for="n in yunList"
:label="n.name"
:value="n.code"
/>
</el-select>
</el-form-item>
<el-form-item label="开始日期" prop="swapDayBegin">
<el-date-picker
v-model="queryParams.swapDayBegin"
value-format="YYYYMMDD"
style="width: 150px;"
type="date"
placeholder="开始日期"
/>
</el-form-item>
<el-form-item label="结束日期" prop="swapDayEnd">
<el-date-picker
v-model="queryParams.swapDayEnd"
value-format="YYYYMMDD"
style="width: 150px;"
type="date"
placeholder="结束日期"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handBtnqu">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
@ -37,31 +70,40 @@
</el-form>
</div>
<div class="app-container" style="margin-bottom: 12px;border-radius: 10px;">
<el-button
type="primary"
plain
icon="Plus"
@click="showpop(1)">新增</el-button>
<div style="display: flex;justify-content: space-between;">
<el-button
type="primary"
plain
icon="Plus"
@click="showpop(1)">新增</el-button>
<el-tooltip class="item" effect="dark" :content="search? '隐藏搜索' : '显示搜索'" placement="top">
<el-button size="mini" circle icon="Search" @click="search = !search" />
</el-tooltip>
</div>
<el-table
style="width:100%;margin-top: 10px;"
:data="yysList"
border
stripe
max-height="600px"
:max-height="search?'550px':'680px'"
>
<el-table-column label="预约人姓名" min-width="120" align="center" prop="uname" :show-overflow-tooltip="true" />
<el-table-column label="手机号码" min-width="120" align="center" prop="phone" :show-overflow-tooltip="true" />
<el-table-column label="车牌号" min-width="120" align="center" prop="plateNum" :show-overflow-tooltip="true" />
<el-table-column label="换电站名称" min-width="120" align="center" prop="stationName" :show-overflow-tooltip="true" />
<el-table-column label="预约换电日期" min-width="120" align="center" prop="swapDay" :show-overflow-tooltip="true" />
<el-table-column label="预约换电日期" min-width="120" align="center" prop="swapDay" :show-overflow-tooltip="true">
<template #default="scope">
<div>{{formatDa(scope.row.swapDay)}}</div>
</template>
</el-table-column>
<el-table-column label="换电时间段" min-width="120" align="center" prop="swapDuration" :show-overflow-tooltip="true" />
<el-table-column label="状态" min-width="120" align="center" prop="status" :show-overflow-tooltip="true">
<template #default="scope">
<div v-if="scope.row.status == 1">预约成功</div>
<div v-else-if="scope.row.status == 2">到店使用</div>
<div v-else-if="scope.row.status == 3">取消</div>
<div v-else-if="scope.row.status == 4">过期</div>
<div v-if="scope.row.status == 1" style="color: #59c325;">预约成功</div>
<div v-else-if="scope.row.status == 2" style="color: #b88230;">使用</div>
<div v-else-if="scope.row.status == 3">取消</div>
<div v-else-if="scope.row.status == 4">过期</div>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="100" fixed="right">
@ -204,19 +246,35 @@
delhdz
} from '@/api/order/reservation'
import { carNum } from '@/utils/validate'
import {
getwxlist
} from '@/api/operation/wxuser'
import { formatDate } from '@/utils/ruoyi'
// import {
// getdict
// } from '@/api/systemSet/dict'
import { jsonp } from 'vue-jsonp'
import { ref,reactive} from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
function formatDa(s:any) {
return formatDate(s)
}
let search = ref(true)
let queryParams = reactive({
pageSize:20, //
pageNo:1, //
userId:'', //ID
status:''
ucode:'', //ID
status:'',
plateNum:'', //
swapDayBegin:'', //,(yyyyMMdd)
swapDayEnd:'', //
stationCode:'' //
})
//
@ -230,7 +288,7 @@
//
let yunList = ref<any>([])
gethdzlist({
pageSize:20, //
pageSize:100, //
pageNo:1, //
proxyId:'', //ID
name:'', //
@ -263,9 +321,9 @@
yysList.value.splice(0)
getjqrlist(queryParams).then(rps => {
if(rps.data){
yysList.value = rps.data
// yysList.value = (rps.data as any).records
// total.value = (rps.data as any).total
//yysList.value = rps.data
yysList.value = (rps.data as any).records
total.value = (rps.data as any).total
}
})
}
@ -292,6 +350,7 @@
let wxuser = ref('')
let addata = reactive({
userId:'', //ID
//ucode:'', //
uname:'', //
phone:'', //
plateNum:'', //
@ -300,6 +359,17 @@
swapDay:'', //,(yyyyMMdd)
swapDuration:'', //,(8:00-10:00)
status:'1' //1-2-使3-4-
// source:'2', //1-2-3-
// ucode:'', //
// uname:'', //
// phone:'', //
// plateNum:'', //
// stationCode:'', //
// stationName:'', //
// swapDay:'', //,(yyyyMMdd)
// //reservationTime:'' //
// swapDuration:'' //,(8:00-10:00)
})
const rules = ref({
userId:[
@ -321,38 +391,34 @@
})
// ?? qq
// ??
async function querySearchAsync (queryString: string, cb:any) {
if(queryString !== ''){
const url = 'https://apis.map.qq.com/ws/place/v1/suggestion' // ??
jsonp(url, {
key: '3WDBZ-HMUCX-NIE43-ZPLQ4-OOHAO-OKBES', //ZJABZ-FWV6G-F7ZQ2-QKQKL-KQ3I5-DNBT7
keyword: queryString,
output: 'jsonp',
}).then((res) => {
console.log(res)
if (res.status == 0) {
// mapList.value = res.data;
let listss
listss = res.data.map((domain:any) => {
return {
value: domain.title ?`手机号:${domain.title}--昵称:${domain.address}`:domain.address,
id: '123456' //??
}
})
cb(listss)
//return listss
// callback(mapList.value);
}else{
cb([])
}
}).catch(() => {
cb([])
getwxlist({
pageSize:100, //
pageNo:1, //
phoneNumber:'' //
}).then((res) => {
if (res.data && (res.data as any).records.length > 0) {
// mapList.value = res.data;
let listss = (res.data as any).records.map((n:any) => {
return {
value: `${n.name?n.name:'--'}——${n.phoneNumber?n.phoneNumber:'--'}`,
name: n.name,
phoneNumber:n.phoneNumber,
id:n.wuid //??
}
})
}{
cb([])
cb(listss)
//return listss
// callback(mapList.value);
}else{
cb([])
}
}).catch(() => {
cb([])
})
}
function autoblur() {
if(addata.userId === ''){
@ -366,21 +432,23 @@
function handleSelect(v: any) {
addata.userId = v.id
addata.uname = v.name //
addata.phone = v.phoneNumber //
}
function qsautoblur() {
if(queryParams.userId === ''){
if(queryParams.ucode === ''){
qswxuser.value = ''
}
}
function qsautoclear() {
queryParams.userId = ''
queryParams.ucode = ''
}
function qshandleSelect(v: any) {
queryParams.userId = v.id
queryParams.ucode = v.id
}
//
function getlabel(n:string){
@ -410,6 +478,7 @@
function handleAdd() {
yysRef.value?.validate((valid:Boolean) => {
console.log(addata,'addata')
if (valid) {
savehand().then(() => {
ElMessage({

View File

@ -1,6 +1,6 @@
<template>
<div>
<div v-if="zjtype == 1" class="app-container" style="margin-bottom: 12px;padding-bottom: 5px;border-radius: 10px;">
<div v-if="zjtype == 1 && search" class="app-container" style="margin-bottom: 12px;padding-bottom: 5px;border-radius: 10px;">
<el-form
ref="querform"
:model="queryParams"
@ -18,17 +18,32 @@
</el-form>
</div>
<div class="app-container" style="margin-bottom: 12px;border-radius: 10px;">
<el-button
type="primary"
plain
icon="Plus"
@click="showpop(1)">新增</el-button>
<template v-if="zjtype == 1">
<div style="display: flex;justify-content: space-between;">
<el-button
type="primary"
plain
icon="Plus"
@click="showpop(1)">新增</el-button>
<el-tooltip class="item" effect="dark" :content="search? '隐藏搜索' : '显示搜索'" placement="top">
<el-button size="mini" circle icon="Search" @click="search = !search" />
</el-tooltip>
</div>
</template>
<template v-else>
<el-button
type="primary"
plain
icon="Plus"
@click="showpop(1)">新增</el-button>
</template>
<el-table
style="width:100%;margin-top: 10px;"
:data="yysList"
border
stripe
:max-height="zjtype == 1?'600px':'400px'"
:max-height="theight"
>
<el-table-column label="电池编码" min-width="150" align="center" prop="batCode" :show-overflow-tooltip="true">
@ -287,7 +302,7 @@
// import {
// getdict
// } from '@/api/systemSet/dict'
import { ref,reactive} from 'vue'
import { ref,reactive,computed} from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
const props = withDefaults(defineProps<{
@ -304,6 +319,19 @@
update: []
}>()
let search = ref(true)
let theight = computed(() => {
if(props.zjtype == 1 && !search.value){
//?'600px':'400px'
return '680px'
}
if(props.zjtype == 1){
return '600px'
}
return '400px'
})
let queryParams = reactive({
pageSize:20, //
pageNo:1, //

View File

@ -0,0 +1,227 @@
<template>
<div>
<div style="padding:10px 0 20px;">
<el-button
type="primary"
plain
icon="Plus"
@click="showpop(1)">新增</el-button>
<el-table
style="width:100%;margin-top: 10px;"
:data="yysList"
border
stripe
highlight-current-row
max-height="650px"
>
<el-table-column label="开始时间" min-width="150" align="center" prop="beginTime" :show-overflow-tooltip="true" />
<el-table-column label="结束时间" min-width="150" align="center" prop="endTime" :show-overflow-tooltip="true" />
<el-table-column label="充电功率" min-width="150" align="center" prop="chargingPower" :show-overflow-tooltip="true" />
<el-table-column label="操作" align="center" width="150" fixed="right">
<template #default="scope">
<el-button link type="primary" icon="Edit" @click="showpop(2,scope.row)">修改</el-button>
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!-- 添加或修改用户配置对话框 -->
<el-dialog
v-model="openpop"
:title="ystit"
width="500px"
append-to-body
:close-on-click-modal="false"
>
<el-form
ref="yysRef"
:model="addata"
:rules="rules"
label-width="120px">
<el-row :gutter="30">
<el-col :span="24">
<el-form-item label="开始和结束时间" prop="beginTime">
<el-time-picker
v-model="tiem"
:editable="false"
is-range
range-separator="至"
value-format="HH:mm:ss"
start-placeholder="开始时间"
end-placeholder="结束时间"
@change="tiemchange"
/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="充电功率" prop="chargingPower">
<el-input
v-model="addata.chargingPower"
placeholder="请输入充电功率"
maxlength="50"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="handleAdd"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup lang="ts">
import {
addxq,
updatexq,
delxq,
getxql
} from '@/api/swapstation/cdcl'
import { ref,reactive} from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
const props = defineProps<{
stationCode:String
stationName:String
strategyId:String
list:any[]
}>()
//
let yysList = ref<any>([])
if(props.list.length > 0){
yysList.value = props.list
}
function getyys() {
yysList.value.splice(0)
getxql(props.strategyId).then(rps => {
if(rps.data){
yysList.value = rps.data
}
})
}
//
let type = ref(1)
let openpop = ref(false)
let ystit = ref('添加充电策略详情')
let yysRef = ref()
let addata = reactive({
pkId:'',
stationCode:props.stationCode, //
stationName:props.stationName, //
strategyId:props.strategyId, //ID
beginTime:'', //,(20:01:32)
endTime:'', //,(23:05:41)
chargingPower:'' //
})
const rules = ref({
beginTime:[
{ required: true, message: "请选择开始和结束时间", trigger: "blur" },
]
})
//
let tiem = ref<any[]>([])
function tiemchange(v:any) {
if(v){
addata.beginTime = v[0] //
addata.endTime = v[1] //
}else{
addata.beginTime = ''
addata.endTime = ''
}
}
function showpop(num:any,row?:any){
type.value = num
openpop.value = true
ystit.value = num == 1?'添加充电策略详情':'修改充电策略详情'
yysRef.value?.resetFields()
if(row){
tiem.value.push(row.beginTime)
tiem.value.push(row.endTime)
addata.pkId = row.pkId
addata.beginTime = row.beginTime //,(20:01:32)
addata.endTime = row.endTime //,(23:05:41)
addata.chargingPower = row.chargingPower?row.chargingPower:'' //
}else{
tiem.value.splice(0)
addata.pkId = ''
addata.beginTime = ''
addata.endTime = ''
addata.chargingPower = ''
}
}
function savehand() {
if(type.value == 1){
return addxq(addata)
}
return updatexq(addata)
}
//
function handleAdd() {
yysRef.value?.validate((valid:Boolean) => {
if (valid) {
savehand().then(() => {
ElMessage({
type: 'success',
message: type.value == 1?'添加成功':'修改成功'
})
setTimeout(()=> {
openpop.value = false
getyys()
},600)
})
}
})
}
//
function cancel() {
openpop.value = false
}
//
function handleDelete(row:any) {
ElMessageBox.confirm(
`确定删除?`,
'温馨提示',
{
// confirmButtonText: '',
// cancelButtonText: 'Cancel',
type: 'warning',
}
).then(() => {
delxq(row.pkId).then(() => {
ElMessage({
type: 'success',
message: '删除成功'
})
getyys()
})
})
}
//getyys()
</script>
<style scoped>
.el-divider--horizontal{
border-color:#5b98cd;
}
</style>

View File

@ -0,0 +1,465 @@
<template>
<div>
<div v-if="search" class="app-container" style="margin-bottom: 12px;padding-bottom: 5px;border-radius: 10px;">
<el-form
ref="querform"
:model="queryParams"
:inline="true"
>
<el-form-item label="换电站" prop="stationCode">
<el-select v-model="queryParams.stationCode" placeholder="请选择换电站" style="width: 200px;">
<el-option v-for="n in yunList" :label="n.name" :value="n.code" />
</el-select>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择状态" style="width: 200px;">
<el-option label="启用" :value="1" />
<el-option label="未启用" :value="0" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handBtnqu">搜索</el-button>
<!-- <el-button icon="Refresh" @click="resetQuery">重置</el-button> -->
</el-form-item>
</el-form>
</div>
<div class="app-container" style="margin-bottom: 12px;border-radius: 10px;">
<div style="display: flex;justify-content: space-between;">
<el-button
type="primary"
plain
icon="Plus"
@click="showpop(1)">新增</el-button>
<el-tooltip class="item" effect="dark" :content="search? '隐藏搜索' : '显示搜索'" placement="top">
<el-button size="mini" circle icon="Search" @click="search = !search" />
</el-tooltip>
</div>
<el-table
style="width:100%;margin-top: 10px;"
:data="yysList"
border
stripe
:max-height="search?'680px':'600px'"
>
<el-table-column label="名称" min-width="250" align="center" prop="name" :show-overflow-tooltip="true">
<template #default="scope">
<div @click="showdetails(scope.row)" style="display: inline-block;color:#16599d;border-bottom: 1px solid #417ebb;cursor:pointer">{{scope.row.name}}</div>
</template>
</el-table-column>
<el-table-column label="换电站" min-width="250" align="center" prop="stationName" :show-overflow-tooltip="true" />
<el-table-column label="最低数量" min-width="250" align="center" prop="miniLimit" :show-overflow-tooltip="true" />
<el-table-column label="操作" align="center" width="100" fixed="right">
<template #default="scope">
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!-- 添加或修改用户配置对话框 -->
<el-dialog
v-model="openpop"
:title="ystit"
width="500px"
append-to-body
:close-on-click-modal="false"
>
<div style="padding: 20px;">
<el-form
ref="yysRef"
:model="addata"
:rules="rules"
label-width="80px">
<el-row :gutter="30">
<el-col :span="24">
<el-form-item label="策略名称" prop="name">
<el-input
v-model="addata.name"
placeholder="请输入策略名称"
/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="换电站" prop="stationCode">
<el-select
v-model="addata.stationCode"
placeholder="请选择换电站"
>
<el-option
v-for="n in yunList"
:label="n.name"
:value="n.code"
@click="getlabel(n.name)"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="最低数量" prop="miniLimit">
<el-input
v-model="addata.miniLimit"
placeholder="请输入最低数量"
maxlength="3"
/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="状态" prop="status">
<el-select
v-model="addata.status"
placeholder="请选择状态"
>
<el-option label="启用" :value="1" />
<el-option label="未启用" :value="0" />
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="handleAdd"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
<el-drawer
v-model="drawer"
:with-header="false"
size="900px"
>
<el-row style="margin-bottom: 20px;">
<el-col :span="24" style="position: relative;margin-bottom: 20px;padding-bottom: 10px;text-align: center;font-size: 20px;color: #417ebb;border-bottom:1px solid #16599d;">
{{detalobj.name}}
<el-icon color="#ccc" @click="drawer = false" style="position: absolute;right: 20px;cursor: pointer;">
<CloseBold />
</el-icon>
</el-col>
<el-col :span="24">
<el-row style="margin-bottom: 20px;">
<el-col :span="10">
<el-row>
<el-col :span="6">换电站</el-col>
<el-col :span="18" style="color: #417ebb;">{{detalobj.stationName}}</el-col>
</el-row>
</el-col>
<el-col :span="6">
<el-row>
<el-col :span="12" style="text-align: right;">最低数量</el-col>
<el-col :span="6" style="color: #417ebb;">{{detalobj.miniLimit}}</el-col>
</el-row>
</el-col>
<el-col :span="4">
<el-row>
<el-col :span="10">状态</el-col>
<el-col :span="10" style="color: #417ebb;">{{detalobj.status == 1?'启用':'未启用'}}</el-col>
</el-row>
</el-col>
<el-col :span="2">
<el-button
type="primary"
plain
icon="Edit"
@click="showpop(2,detalobj)">修改</el-button>
</el-col>
</el-row>
</el-col>
<el-col style="border-top: 2px dashed #9ec9e1;">
<!-- <div style="padding: 20px 0 10px;text-align: center;color:#9ec9e1;">策略详情</div> -->
<el-row>
<el-col>
<costdetails
v-if="drawer"
style="padding: 20px;"
:stationCode="stationCode"
:stationName="stationName"
:strategyId="strategyId"
:list="mxlist"
/>
</el-col>
</el-row>
</el-col>
</el-row>
</el-drawer>
</div>
</template>
<script setup lang="ts" name="UserPage">
import {
gethdzlist
} from '@/api/swapstation/hdz'
import {
getjqrlist,
addhdz,
update,
delhdz
} from '@/api/swapstation/cdcl'
import { ref,reactive } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import Costdetails from './costdetails.vue'
function timestamp() {
return new Date().getTime()
}
let search = ref(true)
let queryParams = reactive({
// pageSize:20, //
// pageNo:1, //
stationCode:'', //
status:1
})
//
let total = ref(0)
let yysList = ref<any>([])
function handBtnqu(){
//queryParams.pageNo = 1
getyys()
}
//
let yunList = ref<any>([])
gethdzlist({
pageSize:20, //
pageNo:1, //
proxyId:'', //ID
name:'', //
code:'', //
status:'', //1-2-3-4-9-
type:'', //ID
}).then(rps => {
if(rps.data){
let list = (rps.data as any).records
yunList.value = list?list:[]
queryParams.stationCode = list[0].code
getyys()
}
})
function getyys() {
yysList.value.splice(0)
getjqrlist(queryParams).then(rps => {
if(rps.data){
yysList.value = rps.data
}
})
}
// function handleSizeChange(val:number) {
// queryParams.pageSize = val
// getyys()
// }
//
let querform = ref()
function resetQuery() {
querform.value?.resetFields()
}
//
let type = ref(1)
let openpop = ref(false)
let ystit = ref('添加充电策略')
let yysRef = ref()
let strategyId = ref('')
let stationCode = ref('')
let stationName = ref('')
let addata = reactive({
pkId:'',
name:'', //
stationCode:'', //
stationName:'', //
miniLimit:'', //
status:1 //0-1-
})
const rules = ref({
name:[
{ required: true, message: "请输入策略名称", trigger: "blur" }
],
stationCode:[
{ required: true, message: "请选择换电站", trigger: "blur" }
],
miniLimit:[
{ required: true, message: "最低数量", trigger: "blur" }
]
})
//
function getlabel(n:string){
addata.stationName = n
}
let mxlist = ref<any[]>([])
let detalobj = ref<any>({})
function showdetails(v:any){
detalobj.value = v
drawer.value = true
strategyId.value = v.pkId
stationName.value = v.stationName
stationCode.value = v.stationCode
mxlist.value = v.detailList
}
function showpop(num:any,row?:any){
type.value = num
openpop.value = true
// if(type.value == 1){
// openpop.value = true
// }else if(type.value == 2){
// drawer.value = true
// }
ystit.value = num == 1?'添加充电策略':'修改充电策略'
yysRef.value?.resetFields()
if(row){
addata.pkId = row.pkId
addata.name = row.name
addata.stationCode = row.stationCode
addata.stationName = row.stationName
addata.miniLimit = row.miniLimit
addata.status = 1
// standardId.value = row.pkId
// bzName.value = row.name
// stationName.value = row.stationName
// stationCode.value = row.stationCode
// mxlist.value = row.detailList
}else{
addata.pkId = ''
addata.name = ''
addata.stationCode = ''
addata.stationName = ''
addata.miniLimit = ''
addata.status = 1
}
}
function savehand() {
if(type.value == 1){
return addhdz(addata)
}
return update(addata)
}
//
function handleAdd() {
yysRef.value?.validate((valid:Boolean) => {
if (valid) {
savehand().then(() => {
ElMessage({
type: 'success',
message: type.value == 1?'添加成功':'修改成功'
})
// if(type.value == 2){
// //bzName.value = addata.name
// stationName.value = addata.stationName
// stationCode.value = addata.stationCode
// }
setTimeout(()=> {
// if(type.value == 1){
// openpop.value = false
// }
openpop.value = false
drawer.value = false
getyys()
},600)
})
}
})
}
//
function cancel() {
openpop.value = false
}
//
function handleDelete(row:any) {
ElMessageBox.confirm(
`确定删除?`,
'温馨提示',
{
// confirmButtonText: '',
// cancelButtonText: 'Cancel',
type: 'warning',
}
).then(() => {
delhdz(row.pkId).then(() => {
ElMessage({
type: 'success',
message: '删除成功'
})
getyys()
})
})
}
//
let drawer = ref(false)
//let standardId = ref('')
function handleClose() {
drawer.value = false
}
function resetupdate() {
yysRef.value?.resetFields()
}
// function bzmingx(id:string) {
// drawer.value = true
// standardId.value = id
// }
</script>
<style scoped>
.el-divider--horizontal{
border-color:#5b98cd;
}
.mktit{
width: 100%;
height: 40px;
line-height: 40px;
border-radius: 10px 10px 0 0;
font-size: 18px;
font-weight: bold;
color: #fff;
text-align: center;
background: #98c3ef;
}
.jqbg{
background: #73b9c9;
}
</style>

View File

@ -1,6 +1,6 @@
<template>
<div>
<div v-if="zjtype == 1" class="app-container" style="margin-bottom: 12px;padding-bottom: 5px;border-radius: 10px;">
<div v-if="zjtype == 1 && search" class="app-container" style="margin-bottom: 12px;padding-bottom: 5px;border-radius: 10px;">
<el-form
ref="querform"
:model="queryParams"
@ -18,11 +18,26 @@
</el-form>
</div>
<div class="app-container" style="margin-bottom: 12px;border-radius: 10px;">
<el-button
type="primary"
plain
icon="Plus"
@click="showpop(1)">新增</el-button>
<template v-if="zjtype == 1">
<div style="display: flex;justify-content: space-between;">
<el-button
type="primary"
plain
icon="Plus"
@click="showpop(1)">新增</el-button>
<el-tooltip class="item" effect="dark" :content="search? '隐藏搜索' : '显示搜索'" placement="top">
<el-button size="mini" circle icon="Search" @click="search = !search" />
</el-tooltip>
</div>
</template>
<template v-else>
<el-button
type="primary"
plain
icon="Plus"
@click="showpop(1)">新增</el-button>
</template>
<el-table
style="width:100%;margin-top: 10px;"
:data="yysList"
@ -140,6 +155,8 @@
update: []
}>()
let search = ref(true)
let queryParams = reactive({
pageSize:20, //
pageNo:1, //

View File

@ -1,6 +1,6 @@
<template>
<div>
<div v-if="zjtype == 1" class="app-container" style="margin-bottom: 12px;padding-bottom: 5px;border-radius: 10px;">
<div v-if="zjtype == 1 && search" class="app-container" style="margin-bottom: 12px;padding-bottom: 5px;border-radius: 10px;">
<el-form
ref="querform"
:model="queryParams"
@ -18,11 +18,25 @@
</el-form>
</div>
<div class="app-container" style="margin-bottom: 12px;border-radius: 10px;">
<el-button
type="primary"
plain
icon="Plus"
@click="showpop(1)">新增</el-button>
<template v-if="zjtype == 1">
<div style="display: flex;justify-content: space-between;">
<el-button
type="primary"
plain
icon="Plus"
@click="showpop(1)">新增</el-button>
<el-tooltip class="item" effect="dark" :content="search? '隐藏搜索' : '显示搜索'" placement="top">
<el-button size="mini" circle icon="Search" @click="search = !search" />
</el-tooltip>
</div>
</template>
<template v-else>
<el-button
type="primary"
plain
icon="Plus"
@click="showpop(1)">新增</el-button>
</template>
<el-table
style="width:100%;margin-top: 10px;"
:data="yysList"
@ -160,6 +174,8 @@
import { ref,reactive} from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
let search = ref(true)
const props = withDefaults(defineProps<{
zjtype?:string|number
stationCode?:string

View File

@ -16,10 +16,10 @@
>
<el-table-column min-width="100" label="开始时间" align="center" prop="timeBegin" :show-overflow-tooltip="true" />
<el-table-column min-width="100" label="结束时间" align="center" prop="timeEnd" :show-overflow-tooltip="true" />
<el-table-column min-width="100" label="每公里收费" align="center" prop="eachKmFee" :show-overflow-tooltip="true" />
<el-table-column min-width="100" label="每SOC收费" align="center" prop="eachSocFee" :show-overflow-tooltip="true" />
<el-table-column min-width="100" label="每度电收费" align="center" prop="eachKwhFee" :show-overflow-tooltip="true" />
<el-table-column min-width="100" label="谷段服务费" align="center" prop="timeServiceFee" :show-overflow-tooltip="true" />
<el-table-column min-width="100" label="每公里收费(元)" align="center" prop="eachKmFee" :show-overflow-tooltip="true" />
<el-table-column min-width="100" label="每SOC收费(元)" align="center" prop="eachSocFee" :show-overflow-tooltip="true" />
<el-table-column min-width="100" label="每度电收费(元)" align="center" prop="eachKwhFee" :show-overflow-tooltip="true" />
<el-table-column min-width="100" label="谷段服务费(元)" align="center" prop="timeServiceFee" :show-overflow-tooltip="true" />
<el-table-column label="操作" align="center" width="150" fixed="right">
<template #default="scope">
<el-button link type="primary" icon="Edit" @click="showpop(2,scope.row)">修改</el-button>
@ -78,7 +78,7 @@
</el-form-item>
</el-col> -->
<el-col :span="12">
<el-form-item label="每公里收费" prop="eachKmFee">
<el-form-item label="每公里收费(元)" prop="eachKmFee">
<el-input
v-model="addata.eachKmFee"
placeholder="请输入每公里收费"
@ -87,7 +87,7 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="每SOC收费" prop="eachSocFee">
<el-form-item label="每SOC收费(元)" prop="eachSocFee">
<el-input
v-model="addata.eachSocFee"
placeholder="请输入每SOC收费"
@ -96,7 +96,7 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="每度电收费" prop="eachKwhFee">
<el-form-item label="每度电收费(元)" prop="eachKwhFee">
<el-input
v-model="addata.eachKwhFee"
placeholder="请输入每度电收费"
@ -105,7 +105,7 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="谷段服务费" prop="timeServiceFee">
<el-form-item label="谷段服务费(元)" prop="timeServiceFee">
<el-input
v-model="addata.timeServiceFee"
placeholder="请输入谷段服务费"

View File

@ -1,6 +1,6 @@
<template>
<div>
<div class="app-container" style="margin-bottom: 12px;padding-bottom: 5px;border-radius: 10px;">
<div v-if="search" class="app-container" style="margin-bottom: 12px;padding-bottom: 5px;border-radius: 10px;">
<el-form
ref="querform"
:model="queryParams"
@ -18,32 +18,47 @@
</el-form>
</div>
<div class="app-container" style="margin-bottom: 12px;border-radius: 10px;">
<el-button
<div style="display: flex;justify-content: space-between;">
<el-button
type="primary"
plain
icon="Plus"
@click="showpop(1)">新增</el-button>
<el-tooltip class="item" effect="dark" :content="search? '隐藏搜索' : '显示搜索'" placement="top">
<el-button size="mini" circle icon="Search" @click="search = !search" />
</el-tooltip>
</div>
<el-table
style="width:100%;margin-top: 10px;"
:data="yysList"
border
stripe
max-height="600px"
:max-height="search?'600px':'680px'"
>
<el-table-column label="费用标准名称" min-width="200" align="center" prop="name" :show-overflow-tooltip="true">
<template #default="scope">
<div @click="showpop(2,scope.row)" style="display: inline-block;color:#16599d;border-bottom: 1px solid #417ebb;cursor:pointer">{{scope.row.name}}</div>
</template>
</el-table-column>
<el-table-column label="开始日期" min-width="100" align="center" prop="dayBegin" :show-overflow-tooltip="true" />
<el-table-column label="结束日期" min-width="100" align="center" prop="dayEnd" :show-overflow-tooltip="true" />
<el-table-column label="开始日期" min-width="100" align="center" prop="dayBegin" :show-overflow-tooltip="true">
<template #default="scope">
<div>{{scope.row.dayBegin.replace(/^(\d{4})(\d{2})(\d{2})$/, '$1-$2-$3')}}</div>
</template>
</el-table-column>
<el-table-column label="结束日期" min-width="100" align="center" prop="dayEnd" :show-overflow-tooltip="true">
<template #default="scope">
<div>{{scope.row.dayEnd.replace(/^(\d{4})(\d{2})(\d{2})$/, '$1-$2-$3')}}</div>
</template>
</el-table-column>
<el-table-column label="换电站" min-width="250" align="center" prop="stationName" :show-overflow-tooltip="true" />
<el-table-column label="正常换电服务费" min-width="140" align="center" prop="commonRemainFee" :show-overflow-tooltip="true" />
<el-table-column label="正常换电服务费(元)" min-width="140" align="center" prop="commonRemainFee" :show-overflow-tooltip="true" />
<el-table-column label="换电时正常电量范围" min-width="180" align="center" prop="commonRemainSocRange" :show-overflow-tooltip="true" />
<el-table-column label="换电时电量剩余过多的soc界定" min-width="220" align="center" prop="moreRemainSoc" :show-overflow-tooltip="true" />
<el-table-column label="换电时电量剩余过多的服务费" min-width="220" align="center" prop="moreRemainFee" :show-overflow-tooltip="true" />
<el-table-column label="换电时电量剩余过多的服务费(元)" min-width="220" align="center" prop="moreRemainFee" :show-overflow-tooltip="true" />
<el-table-column label="换电时电量剩余一般的soc界定" min-width="220" align="center" prop="fewRemainSoc" :show-overflow-tooltip="true" />
<el-table-column label="换电时电量剩余一般的服务费" min-width="220" align="center" prop="fewRemainFee" :show-overflow-tooltip="true" />
<el-table-column label="换电时电量剩余一般的服务费(元)" min-width="220" align="center" prop="fewRemainFee" :show-overflow-tooltip="true" />
<el-table-column label="操作" align="center" width="100" fixed="right">
<template #default="scope">
<!-- <el-button link type="primary" icon="Collection" @click="bzmingx(scope.row.pkId)">标准明细</el-button> -->
@ -133,7 +148,7 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="正常换电服务费" prop="commonRemainFee">
<el-form-item label="正常换电服务费(元)" prop="commonRemainFee">
<el-input
v-model="addata.commonRemainFee"
placeholder="请输入正常换电服务费"
@ -160,7 +175,7 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="换电时电量剩余过多的服务费" prop="moreRemainFee">
<el-form-item label="换电时电量剩余过多的服务费(元)" prop="moreRemainFee">
<el-input
v-model="addata.moreRemainFee"
placeholder="请输入换电时电量剩余过多的服务费"
@ -178,7 +193,7 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="换电时电量剩余一般的服务费" prop="fewRemainFee">
<el-form-item label="换电时电量剩余一般的服务费(元)" prop="fewRemainFee">
<el-input
v-model="addata.fewRemainFee"
placeholder="请输入换电时电量剩余一般的服务费"
@ -187,7 +202,7 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="每公里收费" prop="eachKmFee">
<el-form-item label="每公里收费(元)" prop="eachKmFee">
<el-input
v-model="addata.eachKmFee"
placeholder="请输入每公里收费"
@ -196,7 +211,7 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="每SOC收费" prop="eachSocFee">
<el-form-item label="每SOC收费(元)" prop="eachSocFee">
<el-input
v-model="addata.eachSocFee"
placeholder="请输入每SOC收费"
@ -205,7 +220,7 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="每度电收费" prop="eachKwhFee">
<el-form-item label="每度电收费(元)" prop="eachKwhFee">
<el-input
v-model="addata.eachKwhFee"
placeholder="请输入每度电收费"
@ -234,7 +249,7 @@
>
<tit @close="handleClose" :name="bzName" />
<el-row :gutter="25">
<el-col :span="7">
<el-col :span="8">
<div style="padding: 0;border: 2px solid #73b9c9;border-radius: 10px;">
<div class="mktit jqbg">费用标准</div>
<el-form
@ -287,8 +302,8 @@
/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="正常换电服务费" prop="commonRemainFee">
<el-col :span="12">
<el-form-item label="正常换电服务费(元)" prop="commonRemainFee">
<el-input
v-model="addata.commonRemainFee"
placeholder="请输入正常换电服务费"
@ -296,7 +311,7 @@
/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-col :span="12">
<el-form-item label="换电时正常电量范围" prop="commonRemainSocRange">
<el-input
v-model="addata.commonRemainSocRange"
@ -315,7 +330,7 @@
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="换电时电量剩余过多的服务费" prop="moreRemainFee">
<el-form-item label="换电时电量剩余过多的服务费(元)" prop="moreRemainFee">
<el-input
v-model="addata.moreRemainFee"
placeholder="请输入换电时电量剩余过多的服务费"
@ -333,7 +348,7 @@
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="换电时电量剩余一般的服务费" prop="fewRemainFee">
<el-form-item label="换电时电量剩余一般的服务费(元)" prop="fewRemainFee">
<el-input
v-model="addata.fewRemainFee"
placeholder="请输入换电时电量剩余一般的服务费"
@ -341,6 +356,33 @@
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="每公里收费(元)" prop="eachKmFee">
<el-input
v-model="addata.eachKmFee"
placeholder="请输入每公里收费"
maxlength="50"
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="每SOC收费(元)" prop="eachSocFee">
<el-input
v-model="addata.eachSocFee"
placeholder="请输入每SOC收费"
maxlength="50"
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="每度电收费(元)" prop="eachKwhFee">
<el-input
v-model="addata.eachKwhFee"
placeholder="请输入每度电收费"
maxlength="50"
/>
</el-form-item>
</el-col>
<el-col :span="24" style="text-align: center;">
<el-button type="success" @click="handleAdd"> </el-button>
<el-button @click="resetupdate"> </el-button>
@ -350,7 +392,7 @@
</div>
</el-col>
<el-col :span="17">
<el-col :span="16">
<div style="height: 100%;margin-bottom: 20px;border: 1px solid #98c3ef; border-radius: 10px;">
<div class="mktit">费用标准明细</div>
<costdetails
@ -387,6 +429,8 @@
return new Date().getTime()
}
let search = ref(true)
let queryParams = reactive({
// pageSize:20, //
// pageNo:1, //
@ -505,8 +549,8 @@
addata.pkId = row.pkId
addata.stationCode = row.stationCode
addata.dayBegin = row.dayBegin
addata.dayEnd = row.dayEnd
addata.dayBegin = row.dayBegin.replace(/^(\d{4})(\d{2})(\d{2})$/, '$1-$2-$3')
addata.dayEnd = row.dayEnd.replace(/^(\d{4})(\d{2})(\d{2})$/, '$1-$2-$3')
addata.stationName = row.stationName
addata.name = row.name
addata.commonRemainFee = row.commonRemainFee

View File

@ -1,6 +1,6 @@
<template>
<div>
<div class="app-container" style="margin-bottom: 12px;padding-bottom: 5px;border-radius: 10px;">
<div v-if="search" class="app-container" style="margin-bottom: 12px;padding-bottom: 5px;border-radius: 10px;">
<el-form
ref="querform"
:model="queryParams"
@ -55,17 +55,24 @@
</el-form>
</div>
<div class="app-container" style="margin-bottom: 12px;border-radius: 10px;">
<el-button
<div style="display: flex;justify-content: space-between;">
<el-button
type="primary"
plain
icon="Plus"
@click="showpop(1)">新增</el-button>
<el-tooltip class="item" effect="dark" :content="search? '隐藏搜索' : '显示搜索'" placement="top">
<el-button size="mini" circle icon="Search" @click="search = !search" />
</el-tooltip>
</div>
<el-table
style="width:100%;margin-top: 10px;"
:data="yysList"
border
stripe
max-height="600px"
:max-height="search?'600px':'680px'"
>
<el-table-column label="站点名称" min-width="200" align="center" prop="name" :show-overflow-tooltip="true">
<template #default="scope">
@ -334,33 +341,54 @@
<el-drawer
v-model="drawer"
:with-header="false"
size="88%"
size="70%"
>
<tit @close="handleClose" :name="addata.name" :hdzcode="addata.code" :showcode="true" />
<el-row :gutter="25">
<el-col :span="7">
<el-col :span="24" style="margin-bottom: 20px;">
<div style="padding: 0;border: 2px solid #73b9c9;border-radius: 10px;">
<div class="mktit jqbg">基础信息</div>
<el-form ref="yysRef" :model="addata" :rules="rules" label-width="110px">
<!-- <div style="padding: 20px;">
<el-row :gutter="50">
<el-col :span="24">
<el-col :span="12" style="border: 1px solid #ccc;text-align: center;"><img :src="urlcode" width="200" height="200" /></el-col>
</el-col>
<el-col :span="12">
<el-row style="border: 1px solid #ccc;border-bottom: none;">
<el-col :span="9" style="padding: 10px 0;background: #4e98a9;color: #fff;text-align: center;">运营商</el-col>
<el-col :span="15" style="padding: 10px 0;text-align: center;">河北伊特</el-col>
</el-row>
</el-col>
<el-col :span="12">
<el-row style="border: 1px solid #ccc;border-bottom: none;">
<el-col :span="9" style="padding: 10px 0;background: #4e98a9;color: #fff;text-align: center;">站点名称</el-col>
<el-col :span="15" style="padding: 10px 0;text-align: center;">北京一号换电站</el-col>
</el-row>
</el-col>
</el-row>
</div> -->
<el-form ref="yysRef" :model="addata" :rules="rules" label-width="150px">
<el-row style="padding:20px">
<el-col :span="24">
<el-col :span="12">
<el-form-item label="运营商" prop="proxyId">
<el-select v-model="addata.proxyId" placeholder="请选择运营商">
<el-option v-for="n in yunList" :label="n.poname" :value="n.pocode" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-col :span="12">
<el-form-item label="站点名称" prop="name">
<el-input v-model="addata.name" placeholder="请输入站点名称" clearable />
</el-form-item>
</el-col>
<el-col :span="24">
<el-col :span="12">
<el-form-item label="站点编码" prop="code">
<el-input v-model="addata.code" placeholder="请输入站点编码" clearable />
</el-form-item>
</el-col>
<el-col :span="24">
<el-col :span="12">
<el-form-item label="状态" prop="status">
<el-select v-model="addata.status" placeholder="请选择状态">
<el-option
@ -371,7 +399,7 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-col :span="12">
<el-form-item label="站点类型" prop="type">
<el-select v-model="addata.type" placeholder="请选择站点类型">
<el-option
@ -382,7 +410,7 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-col :span="12">
<el-form-item label="支持车辆类型" prop="carTypeCode">
<el-select multiple v-model="addata.carTypeCode" placeholder="请选择车辆类型">
<el-option v-for="n in cartypelist" :label="n.typeName" :value="n.typeCode" />
@ -391,7 +419,7 @@
</el-col>
<el-col :span="24">
<el-col :span="12">
<el-form-item label="区划" prop="division">
<el-cascader
ref="cascader"
@ -409,7 +437,7 @@
<!-- <el-input v-model="addata.division" placeholder="请选择区划" maxlength="20" /> -->
</el-form-item>
</el-col>
<el-col :span="24">
<el-col :span="12">
<el-form-item label="详细地址" prop="address">
<el-input
v-model="addata.address"
@ -419,7 +447,7 @@
</el-form-item>
</el-col>
<el-col :span="24">
<el-col :span="12">
<el-form-item label="注册日期" prop="registerDate">
<el-date-picker
v-model="addata.registerDate"
@ -430,7 +458,7 @@
/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-col :span="12">
<el-form-item label="激活日期" prop="activeDate">
<el-date-picker
v-model="addata.activeDate"
@ -460,7 +488,7 @@
</el-form-item>
</el-col>
<el-col :span="24">
<el-col :span="12">
<el-form-item label="经纬度" prop="locationPoint">
<el-input
readonly
@ -471,7 +499,7 @@
/>
</el-form-item>
</el-col>
<el-col :span="14">
<el-col :span="12">
<el-form-item label="全天营业" prop="openAllDay">
<el-radio-group v-model="addata.openAllDay">
<el-radio value="1"></el-radio>
@ -479,7 +507,7 @@
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="10">
<el-col :span="12">
<el-form-item label="通道数" prop="tdQuantity">
<el-input
v-model="addata.tdQuantity"
@ -525,14 +553,14 @@
</el-form-item>
</el-col>
<el-col :span="24" style="text-align: center;">
<el-button type="success" @click="handleAdd"></el-button>
<el-button type="success" @click="handleAdd"></el-button>
<el-button @click="resetupdate"> </el-button>
</el-col>
</el-row>
</el-form>
</div>
</el-col>
<el-col :span="17">
<el-col :span="24">
<div style="margin-bottom: 20px;border: 1px solid #98c3ef; border-radius: 10px;">
<div class="mktit">机器人</div>
<robot
@ -600,7 +628,8 @@
gethdzlist,
addhdz,
update,
delhdz
delhdz,
getqrcode
} from '@/api/swapstation/hdz'
import {
getlist
@ -623,18 +652,22 @@
import Tit from '@/views/components/detailstit.vue'
import Latilonmap from '@/views/components/latilonmap.vue'
import { useRoute } from 'vue-router'
function timestamp() {
return new Date().getTime()
}
let search = ref(true)
let queryParams = reactive({
pageSize:20, //
pageNo:1, //
proxyId:'', //ID
name:'', //
code:'', //
status:'', //1-2-3-4-9-
type:'', //ID
pageSize:20, //
pageNo:1, //
proxyId:'', //ID
name:'', //
code:'', //
status:useRoute().query.status, //1-2-3-4-9-
type:'', //ID
})
//
@ -787,7 +820,7 @@
watch(() => addata.dcQuantity,(v)=> {
addata.dcQuantity = addata.dcQuantity.replace(/[^\d]/g,'')
})
let urlcode = ref<any>('')
function showpop(num:any,row?:any){
type.value = num
if(type.value == 1){
@ -839,6 +872,19 @@
dcclist.value = row.dccList
batlist.value = row.dcList
//
getqrcode({
path:`pages/home/index?code=${addata.code}`,
width:'400',
env_version:'trial' //"release""trial""develop"
}).then((rps:any) => {
let reader = new FileReader()
reader.readAsDataURL(rps) // base64
reader.onload = function () {
urlcode.value = reader.result
}
})
}else{
slecas.value = ''
@ -971,6 +1017,8 @@
options.value = rps.data
})
getyys()
</script>
<style scoped>

View File

@ -0,0 +1,189 @@
<template>
<div>
<div class="app-container" style="margin-bottom: 12px;padding-bottom: 5px;border-radius: 10px;">
<el-form
ref="querform"
:model="queryParams"
:inline="true"
>
<el-form-item label="换电站" prop="stationCode">
<el-select v-model="queryParams.stationCode" placeholder="请选择换电站" style="width: 200px;">
<el-option v-for="n in yunList" :label="n.name" :value="n.code" />
</el-select>
</el-form-item>
<el-form-item label="传送方向" prop="direction">
<el-select v-model="queryParams.direction" placeholder="请选择传送方向" style="width: 200px;">
<el-option
v-for="n in direction"
:value="n.dictValue"
:label="n.dictName"
/>
</el-select>
</el-form-item>
<el-form-item label="消息类型" prop="type">
<el-select v-model="queryParams.type" placeholder="请选择信息类型" style="width: 200px;">
<el-option
v-for="n in msgtype"
:value="n.dictValue"
:label="n.dictName"
/>
</el-select>
</el-form-item>
<el-form-item label="方法" prop="messageFunction">
<el-input v-model="queryParams.messageFunction" placeholder="请输入方法" clearable style="width: 160px" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handBtnqu">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
</div>
<div class="app-container" style="margin-bottom: 12px;border-radius: 10px;">
<!-- <el-tooltip class="item" effect="dark" :content="search? '隐藏搜索' : '显示搜索'" placement="top">
<el-button size="mini" circle icon="Search" @click="search = !search" />
</el-tooltip> -->
<el-table
style="width:100%;margin-top: 10px;"
:data="yysList"
border
stripe
max-height="620px"
>
<!-- {{ (queryParams.pageNo - 1) * queryParams.pageSize + index + 1 }} -->
<el-table-column type="index" min-width="50" align="center">
<template #default="{ $index }">
<div>{{(queryParams.pageNo - 1) * queryParams.pageSize+ $index + 1}}</div>
</template>
</el-table-column>
<el-table-column label="换电站" min-width="100" align="center" prop="stationCode" :show-overflow-tooltip="true" />
<el-table-column label="传送方向" min-width="100" align="center" prop="direction" :show-overflow-tooltip="true" />
<el-table-column label="消息类型" min-width="100" align="center" prop="type" :show-overflow-tooltip="true" />
<el-table-column label="方法" min-width="120" align="center" prop="messageFunction" :show-overflow-tooltip="true" />
<el-table-column label="内容" min-width="500" prop="content">
<template #default="scope">
<div style="word-wrap: break-word;">{{scope.row.content}}</div>
</template>
</el-table-column>
</el-table>
<div v-if="total > 10" style="display: flex;justify-content: right;padding-top:20px;">
<el-pagination
v-model:current-page="queryParams.pageNo"
v-model:page-size="queryParams.pageSize"
:page-sizes="[10, 20, 30, 40]"
background
size="small"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
@size-change="handleSizeChange"
@current-change="getyys"
/>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import {
gethdzlist
} from '@/api/swapstation/hdz'
import {
mqttlist
} from '@/api/swapstation/mqtt'
import {
getdict
} from '@/api/systemSet/dict'
import { ref,reactive} from 'vue'
let search = ref(true)
let queryParams = reactive({
pageSize:20, //
pageNo:1, //
stationCode:'', //
direction:'', //
type:'', //
messageFunction:'' // stationInfo
})
//
let total = ref(0)
let yysList = ref<any>([])
function handBtnqu(){
queryParams.pageNo = 1
total.value = 0
getyys()
}
//
let direction = ref<any>([])
getdict({
typeCode:'mqttcsfx'
}).then(rps => {
direction.value = rps.data
})
//
let msgtype = ref<any>([])
getdict({
typeCode:'mqttxxtype'
}).then(rps => {
msgtype.value = rps.data
})
//
let yunList = ref<any>([])
gethdzlist({
pageSize:100, //
pageNo:1, //
proxyId:'', //ID
name:'', //
code:'', //
status:'', //1-2-3-4-9-
type:'', //ID
}).then(rps => {
if(rps.data){
let list = (rps.data as any).records
yunList.value = list?list:[]
//queryParams.stationCode = list[0].code
//getyys()
}
})
getyys()
function getyys() {
yysList.value.splice(0)
mqttlist(queryParams).then(rps => {
if(rps.data){
yysList.value = (rps.data as any).records
total.value = (rps.data as any).total
}
})
}
function handleSizeChange(val:number) {
queryParams.pageSize = val
getyys()
}
//
let querform = ref()
function resetQuery() {
querform.value?.resetFields()
}
</script>
<style scoped>
.el-divider--horizontal{
border-color:#5b98cd;
}
</style>

View File

@ -1,6 +1,6 @@
<template>
<div>
<div v-if="zjtype == 1" class="app-container" style="margin-bottom: 12px;padding-bottom: 5px;border-radius: 10px;">
<div v-if="zjtype == 1 && search" class="app-container" style="margin-bottom: 12px;padding-bottom: 5px;border-radius: 10px;">
<el-form
ref="querform"
:model="queryParams"
@ -18,11 +18,27 @@
</el-form>
</div>
<div class="app-container" style="margin-bottom: 12px;border-radius: 10px;">
<el-button
type="primary"
plain
icon="Plus"
@click="showpop(1)">新增</el-button>
<template v-if="zjtype == 1">
<div style="display: flex;justify-content: space-between;">
<el-button
type="primary"
plain
icon="Plus"
@click="showpop(1)">新增</el-button>
<el-tooltip class="item" effect="dark" :content="search? '隐藏搜索' : '显示搜索'" placement="top">
<el-button size="mini" circle icon="Search" @click="search = !search" />
</el-tooltip>
</div>
</template>
<template v-else>
<el-button
type="primary"
plain
icon="Plus"
@click="showpop(1)">新增</el-button>
</template>
<el-table
style="width:100%;margin-top: 10px;"
:data="yysList"
@ -141,6 +157,8 @@
import { ref,reactive} from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
let search = ref(true)
const props = withDefaults(defineProps<{
zjtype?:string|number
stationCode?:string

View File

@ -85,7 +85,7 @@
stripe
>
<el-table-column min-width="160" label="字典名称" align="center" prop="dictName" />
<el-table-column label="字典编码" align="center" prop="dictCode" />
<el-table-column min-width="160" label="字典编码" align="center" prop="dictCode" />
<el-table-column min-width="160" label="字典值" align="center" prop="dictValue" />
<el-table-column label="排序" align="center" prop="sort" />
<el-table-column width="160" label="操作" align="center" class-name="small-padding fixed-width">
@ -340,7 +340,7 @@
zidform.sort = row.sort
}else{
zidform.typeId = typeId.value
zidform.typeCode =
zidform.typeCode = typecode.value
zidform.dictName = ''
zidform.dictCode = ''
zidform.dictValue = ''
@ -368,7 +368,13 @@
setTimeout(() => {
zidpop.value = false
showzdv(typeId.value)
getdict({
typeId:typeId.value
}).then(rps => {
valist.value = rps.data as any
})
},1000)
})
}

View File

@ -1,6 +1,6 @@
<template>
<div>
<div class="app-container" style="margin-bottom: 12px;padding-bottom: 5px;border-radius: 10px;">
<div v-if="search" class="app-container" style="position: relative;margin-bottom: 12px;padding-bottom: 5px;border-radius: 10px;">
<el-form
ref="querform"
:model="queryParams"
@ -43,33 +43,39 @@
</el-form>
</div>
<div class="app-container" style="margin-bottom: 12px;border-radius: 10px;">
<el-button
<div style="display: flex;justify-content: space-between;">
<el-button
type="primary"
plain
icon="Plus"
@click="showpop(1)">新增</el-button>
<el-tooltip class="item" effect="dark" :content="search? '隐藏搜索' : '显示搜索'" placement="top">
<el-button size="mini" circle icon="Search" @click="search = !search" />
</el-tooltip>
</div>
<el-table
style="width:100%;margin-top: 10px;"
:data="yysList"
border
stripe
max-height="600px"
:max-height="search?'550px':'680px'"
>
<el-table-column label="车牌号" min-width="100" align="center" prop="plateNum" :show-overflow-tooltip="true">
<template #default="scope">
<div @click="showpop(2,scope.row)" style="display: inline-block;color:#16599d;border-bottom: 1px solid #417ebb;cursor:pointer">{{scope.row.plateNum}}</div>
</template>
</el-table-column>
<el-table-column label="VIN号" min-width="150" align="center" prop="vinNo" :show-overflow-tooltip="true" />
<el-table-column label="车架号" min-width="150" align="center" prop="frameworkNo" :show-overflow-tooltip="true" />
<el-table-column label="VIN号" min-width="180" align="center" prop="vinNo" :show-overflow-tooltip="true" />
<el-table-column label="车架号" min-width="200" align="center" prop="frameworkNo" :show-overflow-tooltip="true" />
<el-table-column label="车主类型" min-width="80" align="center" prop="sourceFrom" :show-overflow-tooltip="true">
<template #default="scope">
<div v-if="scope.row.ownerType == 1">个人</div>
<div v-else-if="scope.row.ownerType == 2">企业</div>
</template>
</el-table-column>
<el-table-column label="车主名称" min-width="100" align="center" prop="ownerName" :show-overflow-tooltip="true" />
<el-table-column label="引擎号" min-width="150" align="center" prop="engineNo" :show-overflow-tooltip="true" />
<el-table-column label="车主名称" min-width="160" align="center" prop="ownerName" :show-overflow-tooltip="true" />
<el-table-column label="引擎号" min-width="220" align="center" prop="engineNo" :show-overflow-tooltip="true" />
<el-table-column label="消费方式" min-width="80" align="center" prop="usageType" :show-overflow-tooltip="true">
<template #default="scope">
<div v-if="scope.row.usageType == 1">电量</div>
@ -79,18 +85,36 @@
<el-table-column label="座位数" min-width="80" align="center" prop="seatsCount" :show-overflow-tooltip="true" />
<el-table-column label="车身颜色" min-width="100" align="center" prop="carColor" :show-overflow-tooltip="true" />
<el-table-column label="车籍/归属地" min-width="200" align="center" prop="carArea" :show-overflow-tooltip="true" />
<el-table-column label="出厂日期" min-width="100" align="center" prop="productionDate" :show-overflow-tooltip="true" />
<el-table-column label="购车日期" min-width="100" align="center" prop="purchaseDate" :show-overflow-tooltip="true" />
<el-table-column label="上牌日期" min-width="100" align="center" prop="boardDate" :show-overflow-tooltip="true" />
<el-table-column label="首次登记日期" min-width="120" align="center" prop="registrationDate" :show-overflow-tooltip="true" />
<el-table-column label="出厂日期" min-width="100" align="center" prop="productionDate" :show-overflow-tooltip="true">
<template #default="scope">
<div>{{formatDa(scope.row.productionDate)}}</div>
</template>
</el-table-column>
<el-table-column label="购车日期" min-width="100" align="center" prop="purchaseDate" :show-overflow-tooltip="true">
<template #default="scope">
<div>{{formatDa(scope.row.purchaseDate)}}</div>
</template>
</el-table-column>
<el-table-column label="上牌日期" min-width="100" align="center" prop="boardDate" :show-overflow-tooltip="true">
<template #default="scope">
<div>{{formatDa(scope.row.boardDate)}}</div>
</template>
</el-table-column>
<el-table-column label="首次登记日期" min-width="120" align="center" prop="registrationDate" :show-overflow-tooltip="true">
<template #default="scope">
<div>{{formatDa(scope.row.registrationDate)}}</div>
</template>
</el-table-column>
<el-table-column label="总里程(公里)" min-width="100" align="center" prop="totalMileage" :show-overflow-tooltip="true" />
<el-table-column label="联系电话" min-width="120" align="center" prop="phone" :show-overflow-tooltip="true" />
<el-table-column label="公司名称" min-width="200" align="center" prop="cname" :show-overflow-tooltip="true" />
<el-table-column label="组织机构代码" min-width="130" align="center" prop="ccode" :show-overflow-tooltip="true" />
<el-table-column label="操作" align="center" min-width="300" fixed="right">
<el-table-column label="组织机构代码" min-width="180" align="center" prop="ccode" :show-overflow-tooltip="true" />
<el-table-column label="操作" align="center" min-width="100" fixed="right">
<template #default="scope">
<el-button link type="primary" icon="Edit" @click="showbdgs(1,scope.row.plateNum)">绑定公司</el-button>
<el-button link type="primary" icon="Edit" @click="showbdgs(2,scope.row.plateNum)">绑定个人</el-button>
<!-- <el-button link type="primary" icon="Edit" @click="showbdgs(1,scope.row.plateNum)">绑定公司</el-button>
<el-button link type="primary" icon="Edit" @click="showbdgs(2,scope.row.plateNum)">绑定个人</el-button> -->
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
@ -110,7 +134,231 @@
</div>
</div>
<!--换电站详情-->
<el-drawer
v-model="xqdaropen"
:with-header="false"
size="65%"
>
<!-- <tit @close="handleClose" :name="addata.name" :hdzcode="addata.code" :showcode="true" /> -->
<div style="padding: 0;border: 2px solid #98c3ef;border-radius: 10px;">
<div class="mktit" style="margin-bottom: 20px;">车辆信息</div>
<el-form ref="yysRef" :model="addata" :rules="rules" label-width="110px">
<el-row :gutter="20" style="padding: 20px;">
<el-col :span="12">
<el-form-item label="车辆类型" prop="typeCode">
<el-select v-model="addata.typeCode" placeholder="请选择车辆类型">
<el-option v-for="n in cartypelist" :label="n.typeName" :value="n.typeCode" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="VIN号" prop="vinNo">
<el-input v-model="addata.vinNo" maxlength="17" placeholder="请输入VIN号" clearable />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="车架号" prop="frameworkNo">
<el-input v-model="addata.frameworkNo" maxlength="17" placeholder="请输入车架号" clearable />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="车主类型" prop="ownerType">
<el-radio-group v-model="addata.ownerType">
<el-radio value="1">个人</el-radio>
<el-radio value="2">企业</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<template v-if="addata.ownerType == '2'">
<el-col :span="12">
<el-form-item label="公司名称" prop="cname">
<!-- <el-input v-model="addata.cname" maxlength="30" placeholder="请输入公司名称" clearable /> -->
<el-autocomplete
v-if="isgongs"
style="width: 100%"
v-model="state"
:fetch-suggestions="querySearchAsync"
placeholder="请输入公司名称查询"
clearable
@select="handleSelect"
/>
<div v-else style="display: flex;align-items: center;color: #ccc;">暂无公司 <span @tap="tocompage" style="padding:0 5px 0 10px;font-size:16px;color:#0050b3;">去添加</span><el-icon color="#0050b3"><Plus /></el-icon></div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="组织机构代码" prop="ccode">
<el-input v-model="addata.ccode" maxlength="30" disabled placeholder="请输入组织机构代码" clearable />
</el-form-item>
</el-col>
</template>
<el-col :span="12">
<el-form-item label="车主名称" prop="ownerName">
<el-input v-model="addata.ownerName" maxlength="15" placeholder="请输入车主名称" clearable />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="车牌号" prop="plateNum">
<el-input v-model="addata.plateNum" disabled placeholder="请输入车牌号" clearable />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="引擎号" prop="engineNo">
<el-input v-model="addata.engineNo" maxlength="17" placeholder="请输入引擎号" clearable />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="消费方式" prop="usageType">
<el-select v-model="addata.usageType" placeholder="请选择消费方式">
<el-option label="电量" :value="1" />
<el-option label="里程" :value="2" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="座位数" prop="seatsCount">
<el-input v-model="addata.seatsCount" max="3" placeholder="请输入座位数" clearable />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="车身颜色" prop="carColor">
<el-input v-model="addata.carColor" placeholder="请输入车身颜色" clearable />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="车籍/归属地" prop="carArea">
<!-- <el-input v-model="addata.carArea" placeholder="请输入车籍/归属地" clearable /> -->
<el-cascader
ref="cascader"
v-model="slecas"
style="width: 100%;"
:options="options"
clearable
:props="{
label:'admdvsName',
value:'admdvsNo',
children:'subAdmdvsInfoList'
}"
@change="change"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="出厂日期" prop="productionDate">
<el-date-picker
v-model="addata.productionDate"
value-format="YYYYMMDD"
style="width: 100%;"
type="date"
placeholder="请选择日期"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="购车时间" prop="purchaseDate">
<el-date-picker
v-model="addata.purchaseDate"
value-format="YYYYMMDD"
style="width: 100%;"
type="date"
placeholder="请选择日期"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="上牌时间" prop="boardDate">
<el-date-picker
v-model="addata.boardDate"
value-format="YYYYMMDD"
style="width: 100%;"
type="date"
placeholder="请选择日期"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="首次登记日期" prop="registrationDate">
<el-date-picker
v-model="addata.registrationDate"
value-format="YYYYMMDD"
style="width: 100%;"
type="date"
placeholder="请选择日期"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="总里程(公里)" prop="totalMileage">
<el-input v-model="addata.totalMileage" placeholder="请输入总里程" clearable />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系电话" prop="phone">
<el-input v-model="addata.phone" maxlength="11" placeholder="请输入联系电话" clearable />
</el-form-item>
</el-col>
<el-col :span="24" style="text-align: center;">
<el-button type="success" @click="handleAdd"> </el-button>
<el-button @click="resetupdate"> </el-button>
</el-col>
</el-row>
</el-form>
</div>
<div style="margin-top: 20px;padding: 0;border: 2px solid #73b9c9;border-radius: 10px;">
<div class="mktit" style="margin-bottom: 20px;background: #73b9c9;">车辆绑定</div>
<!-- <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
<el-tab-pane label="User" name="first">User</el-tab-pane>
<el-tab-pane label="Config" name="second">Config</el-tab-pane>
<el-tab-pane label="Role" name="third">Role</el-tab-pane>
<el-tab-pane label="Task" name="fourth">Task</el-tab-pane>
</el-tabs> -->
<div style="padding: 0 20px 20px;">
<div style="display: flex;;align-items: center;justify-content: space-between;padding-bottom:20px;">
<div>已绑定用户</div>
<el-button
type="primary"
plain
icon="Plus"
@click="showbdgs(2,addata.plateNum)">绑定用户</el-button>
</div>
<el-table
style="width: 100%;"
:data="caruserlist"
border
stripe
max-height="500px"
>
<el-table-column label="手机号" min-width="100" align="center" prop="phone" :show-overflow-tooltip="true" />
<el-table-column label="用户名" min-width="150" align="center" prop="uname" :show-overflow-tooltip="true" />
<el-table-column label="操作" align="center" width="100" fixed="right">
<template #default="scope">
<el-button link type="primary" icon="Edit" @click="unbinduser(scope.row)">解绑</el-button>
</template>
</el-table-column>
</el-table>
</div>
</div>
<!-- <el-tabs type="border-card" class="demo-tabs">
<el-tab-pane>
</el-tab-pane>
<el-tab-pane label="Config">Config</el-tab-pane>
<el-tab-pane label="Role">Role</el-tab-pane>
<el-tab-pane label="Task">Task</el-tab-pane>
</el-tabs> -->
</el-drawer>
<!-- 添加或修改配置对话框 -->
<el-dialog
@ -166,7 +414,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="组织机构代码" prop="ccode">
<el-input v-model="addata.ccode" maxlength="20" placeholder="请输入组织机构代码" clearable />
<el-input v-model="addata.ccode" maxlength="20" disabled placeholder="请输入组织机构代码" clearable />
</el-form-item>
</el-col>
</template>
@ -189,8 +437,8 @@
<el-col :span="12">
<el-form-item label="消费方式" prop="usageType">
<el-select v-model="addata.usageType" placeholder="请选择消费方式">
<el-option label="电量" value="1" />
<el-option label="里程" value="2" />
<el-option label="电量" :value="1" />
<el-option label="里程" :value="2" />
</el-select>
</el-form-item>
</el-col>
@ -226,7 +474,7 @@
<el-form-item label="出厂日期" prop="productionDate">
<el-date-picker
v-model="addata.productionDate"
value-format="YYYY-MM-DD"
value-format="YYYYMMDD"
style="width: 100%;"
type="date"
placeholder="请选择日期"
@ -237,7 +485,7 @@
<el-form-item label="购车时间" prop="purchaseDate">
<el-date-picker
v-model="addata.purchaseDate"
value-format="YYYY-MM-DD"
value-format="YYYYMMDD"
style="width: 100%;"
type="date"
placeholder="请选择日期"
@ -248,7 +496,7 @@
<el-form-item label="上牌时间" prop="boardDate">
<el-date-picker
v-model="addata.boardDate"
value-format="YYYY-MM-DD"
value-format="YYYYMMDD"
style="width: 100%;"
type="date"
placeholder="请选择日期"
@ -259,7 +507,7 @@
<el-form-item label="首次登记日期" prop="registrationDate">
<el-date-picker
v-model="addata.registrationDate"
value-format="YYYY-MM-DD"
value-format="YYYYMMDD"
style="width: 100%;"
type="date"
placeholder="请选择日期"
@ -290,18 +538,51 @@
<!--绑定公司-->
<el-dialog
v-model="bdgspop"
title="绑定公司"
width="800px"
:title="bdtype == 1?'绑定公司':'绑定个人'"
width="1200px"
append-to-body
:close-on-click-modal="false"
>
<el-form
ref="wxquerform"
:model="wxParams"
:inline="true"
label-width="auto"
>
<el-form-item label="手机号" prop="phoneNumber">
<el-input v-model="wxParams.phoneNumber" placeholder="请输入手机号" clearable style="width: 200px;" />
</el-form-item>
<el-form-item label="所属公司" prop="cname">
<!-- <el-input v-model="addata.cname" maxlength="30" placeholder="请输入公司名称" clearable /> -->
<el-autocomplete
:disabled="bddisabled"
style="width: 100%"
v-model="wxstate"
:fetch-suggestions="querySearchAsync"
placeholder="请输入公司名称查询"
clearable
@select="wxhandleSelect"
/>
</el-form-item>
<el-form-item label="用户名称" prop="name">
<el-input v-model="wxParams.name" placeholder="请输入车主名称" clearable style="width: 200px;" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="wxhandBtnqu">搜索</el-button>
<el-button icon="Refresh" @click="wresetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table
style="width:100%;margin-top: 10px;"
:data="gsList"
border
stripe
max-height="800px"
max-height="600px"
ref="taskTableRef"
@select="selectClick"
:header-cell-class-name="cellClass"
@ -320,19 +601,20 @@
<el-table-column type="selection" width="40" />
<el-table-column label="手机号" min-width="150" align="center" prop="phoneNumber" :show-overflow-tooltip="true" />
<el-table-column label="用户名称" min-width="150" align="center" prop="name" :show-overflow-tooltip="true" />
<el-table-column label="用户昵称" min-width="150" align="center" prop="nickName" :show-overflow-tooltip="true" />
<el-table-column label="用户性别" min-width="150" align="center" prop="gender" :show-overflow-tooltip="true">
<el-table-column label="所属公司" min-width="200" align="center" prop="pname" :show-overflow-tooltip="true" />
<!-- <el-table-column label="用户昵称" min-width="150" align="center" prop="nickName" :show-overflow-tooltip="true" /> -->
<!-- <el-table-column label="用户性别" min-width="150" align="center" prop="gender" :show-overflow-tooltip="true">
<template #default="scope">
<div v-if="scope.row.ownerType == 1"></div>
<div v-else-if="scope.row.ownerType == 2"></div>
</template>
</el-table-column>
<el-table-column label="户类型" min-width="150" align="center" prop="gender" :show-overflow-tooltip="true">
<el-table-column label="户类型" min-width="150" align="center" prop="gender" :show-overflow-tooltip="true">
<template #default="scope">
<div v-if="scope.row.type == 1">个人</div>
<div v-else-if="scope.row.type == 2">公司</div>
</template>
</el-table-column>
</el-table-column> -->
</template>
@ -355,7 +637,7 @@
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="savegs"> </el-button>
<el-button type="primary" @click="savegs"> </el-button>
<el-button @click="cancelgs"> </el-button>
</div>
</template>
@ -369,7 +651,9 @@
update,
delhdz,
Binggs,
Bingwx
Bingwx,
getcarwxlist,
unbindwx
} from '@/api/swapstation/vehicle'
import {
getdicttype
@ -386,6 +670,8 @@
} from '@/api/operation/wxuser'
import { carNum } from '@/utils/validate'
import { formatDate } from '@/utils/ruoyi'
// import {
// getdict
// } from '@/api/systemSet/dict'
@ -394,6 +680,12 @@
import { useRouter } from 'vue-router'
function formatDa(s:any) {
return formatDate(s)
}
let search = ref(true)
//
let isgongs = ref(true)
const router = useRouter()
@ -407,7 +699,7 @@
typeCode:'', //
vinNo:'', //VIN
frameworkNo:'', //
ownerType:'1', //1-2-
ownerType:'', //1-2-
ownerId:'', //ID
ownerName:'', //
plateNum:'', //
@ -496,7 +788,18 @@
addata.cname = v.value //
addata.ccode = v.code //
}
let wxstate = ref('')
function wxhandleSelect(v: any) {
wxParams.pcode = v.code //
}
//
let xqdaropen = ref(false)
//
let type = ref(1)
let openpop = ref(false)
@ -582,14 +885,29 @@
addata.totalMileage = v.replace(/[^0-9]/g,'')
})
watch(() => addata.phone,v => {
addata.phone = v.replace(/[^0-9]/g,'')
if(v){
addata.phone = v.replace(/[^0-9]/g,'')
}
})
function resetupdate() {
yysRef.value?.resetFields()
}
function showpop(num:any,row?:any){
type.value = num
openpop.value = true
// openpop.value = true
ystit.value = num == 1?'添加车辆':'修改车辆'
yysRef.value?.resetFields()
if(type.value == 1){
openpop.value = true
}else if(type.value == 2){
xqdaropen.value = true
}
if(row){
addata.typeCode = row.typeCode
addata.vinNo = row.vinNo
@ -613,7 +931,9 @@
addata.phone = row.phone
addata.cname = row.cname
state.value = row.cname
addata.ccode = row.ccode
addata.ccode = row.ccode
getcaruser(row.plateNum)
}else{
addata.typeCode = ''
addata.vinNo = ''
@ -658,6 +978,7 @@
})
setTimeout(()=> {
openpop.value = false
xqdaropen.value = false
getyys()
},600)
})
@ -717,6 +1038,16 @@
pageSize:20, //
pageNo:1 //
})
let wxParams = reactive({
pageSize:20, //
pageNo:1, //
phoneNumber:'', //
name:'', //
pcode:'' //
})
let bddisabled = ref(false)
function showbdgs(type:number,plateNum:string){
bdtype.value = type
bdgspop.value = true
@ -731,8 +1062,25 @@
wxobj.uname = ''
wxobj.ownerType = ''
wxobj.phone = ''
wxobj.openid = ''
wxobj.openid = ''
}
wxParams.pageSize = 20 //
wxParams.pageNo = 1 //
wxParams.phoneNumber = '' //
wxParams.name = '' //
if(addata.ownerType == '2'){
bddisabled.value = true
wxParams.pcode = addata.ccode
wxstate.value = addata.cname
}else{
bddisabled.value = false
wxParams.pcode = ''
wxstate.value = ''
}
getsglist()
}
@ -740,7 +1088,7 @@
if(bdtype.value == 1){
return getlist(gsqueryParams)
}
return getwxlist(gsqueryParams)
return getwxlist(wxParams)
}
function bingsave(){
@ -773,7 +1121,8 @@
message: '绑定成功'
})
bdgspop.value = false
getyys()
getcaruser(addata.plateNum)
//getyys()
})
}else{
ElMessage({
@ -836,9 +1185,68 @@
}
}
//
let wxquerform = ref()
function wxhandBtnqu() {
wxParams.pageNo = 1
getsglist()
}
function wresetQuery() {
wxquerform.value?.resetFields()
}
//
let activeName = ref(0)
//
let caruserlist = ref<any>([])
function getcaruser(plateNum:string){
getcarwxlist(plateNum).then(rps => {
caruserlist.value = rps.data
})
}
//
function unbinduser(row:any) {
ElMessageBox.confirm(
`${row.uname}确定解绑车辆?`,
'温馨提示',
{
// confirmButtonText: '',
// cancelButtonText: 'Cancel',
type: 'warning',
}
).then(() => {
unbindwx(row.pkId).then(() => {
ElMessage({
type: 'success',
message: '解绑成功'
})
getcaruser(addata.plateNum)
})
})
}
function handleClick() {}
</script>
<style scoped>
.el-divider--horizontal{
border-color:#5b98cd;
}
.mktit{
width: 100%;
height: 40px;
line-height: 40px;
border-radius: 10px 10px 0 0;
font-size: 18px;
font-weight: bold;
color: #fff;
text-align: center;
background: #98c3ef;
}
</style>

View File

@ -0,0 +1,495 @@
<template>
<div style="padding: 20px;">
<el-form
v-if="iskh"
ref="yysRef"
:model="addata"
:rules="rules"
label-width="110px">
<el-row :gutter="30">
<el-col :span="12">
<el-form-item label="户主类型" prop="ownerType">
<el-select
disabled
v-model="addata.ownerType"
placeholder="请选择类型"
>
<el-option
label="个人"
value="1"
/>
<el-option
label="企业"
value="2"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="引入站点" prop="stationCode">
<el-select
v-model="addata.stationCode"
placeholder="请选择换电站"
>
<el-option
v-for="n in yunList"
:label="n.name"
:value="n.code"
@click="getlabel(n.name)"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="账户总金额(元)" prop="totalAmount">
<el-input
v-model="addata.totalAmount"
placeholder="请输入总金额"
maxlength="50"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="充值金额(元)" prop="rechargeAmount">
<el-input
v-model="addata.rechargeAmount"
placeholder="请输入充值金额"
maxlength="50"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="赠送金额(元)" prop="giftAmount">
<el-input
v-model="addata.giftAmount"
placeholder="请输入赠送金额"
maxlength="50"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="积分余额(元)" prop="point">
<el-input
v-model="addata.point"
placeholder="请输入积分余额"
maxlength="50"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="押金(元)" prop="deposit">
<el-input
v-model="addata.deposit"
placeholder="请输入押金"
maxlength="50"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="SN码" prop="snCode">
<el-input
v-model="addata.snCode"
placeholder="请输入SN码"
maxlength="50"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="租金(元)" prop="rent">
<el-input
v-model="addata.rent"
placeholder="请输入租金"
maxlength="50"
/>
</el-form-item>
</el-col>
<el-col :span="24" style="text-align: center;">
<el-button type="success" @click="handleAdd"> </el-button>
<el-button @click="resetupdate"> </el-button>
</el-col>
</el-row>
</el-form>
<el-row v-else :gutter="30">
<el-col :span="5">暂未开通账户</el-col>
<el-col :span="5"><el-button type="primary" @click="showpop(1)"> </el-button></el-col>
</el-row>
<!-- 添加或修改用户配置对话框 -->
<el-dialog
v-model="openpop"
:title="ystit"
width="500px"
append-to-body
:close-on-click-modal="false"
>
<div style="padding: 20px;">
<el-form
ref="yysRef"
:model="addata"
:rules="rules"
label-width="90px">
<el-row :gutter="30">
<el-col :span="24">
<el-form-item label="户主类型" prop="ownerType">
<el-select
disabled
v-model="addata.ownerType"
placeholder="请选择类型"
>
<el-option
label="个人"
value="1"
/>
<el-option
label="企业"
value="2"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="引入站点" prop="stationCode">
<el-select
v-model="addata.stationCode"
placeholder="请选择换电站"
>
<el-option
v-for="n in yunList"
:label="n.name"
:value="n.code"
@click="getlabel(n.name)"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="账户总金额" prop="totalAmount">
<el-input
v-model="addata.totalAmount"
placeholder="请输入总金额"
maxlength="50"
/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="充值金额" prop="rechargeAmount">
<el-input
v-model="addata.rechargeAmount"
placeholder="请输入充值金额"
maxlength="50"
/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="赠送金额" prop="giftAmount">
<el-input
v-model="addata.giftAmount"
placeholder="请输入赠送金额"
maxlength="50"
/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="积分余额" prop="point">
<el-input
v-model="addata.point"
placeholder="请输入积分余额"
maxlength="50"
/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="押金" prop="deposit">
<el-input
v-model="addata.deposit"
placeholder="请输入押金"
maxlength="50"
/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="SN码" prop="snCode">
<el-input
v-model="addata.snCode"
placeholder="请输入SN码"
maxlength="50"
/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="租金" prop="rent">
<el-input
v-model="addata.rent"
placeholder="请输入租金"
maxlength="50"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="handleAdd"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup lang="ts" name="UserPage">
import { ref,reactive,watch } from 'vue'
import { ElMessage } from 'element-plus'
import {
gethdzlist
} from '@/api/swapstation/hdz'
import {
getjqrlist,
addhdz,
update
} from '@/api/order/account'
import { setNum } from '@/utils/validate'
function timestamp() {
return new Date().getTime()
}
const props = defineProps<{
ownerId:string
}>()
let search = ref(true)
let queryParams = reactive({
pageSize:20, //
pageNo:1, //
ownerType:'', //1-2-
ownerId:props.ownerId, //ID
code:'', //
stationCode:'' //
})
//
let yysList = ref<any>({})
//
let yunList = ref<any>([])
gethdzlist({
pageSize:20, //
pageNo:1, //
proxyId:'', //ID
name:'', //
code:'', //
status:'', //1-2-3-4-9-
type:'', //ID
}).then(rps => {
if(rps.data){
let list = (rps.data as any).records
yunList.value = list?list:[]
}
})
//
let type = ref(1)
let openpop = ref(false)
let ystit = ref('开通账户')
let yysRef = ref()
let standardId = ref('')
let bzName = ref('')
let code = ref('')
let stationName = ref('')
let addata = reactive<any>({
pkId:'',
ownerType:'2', //1-2-
ownerId:props.ownerId, //ID
stationCode:'', //
stationName:'', // ??
totalAmount:'', //=+
rechargeAmount:'', //
giftAmount:'', //
point:'', //
deposit:'', //
snCode:'', //SN
rent:'' //
})
let iskh = ref(false)
const rules = ref({
ownerType:[
{ required: true, message: "请选择户主类型", trigger: "blur" }
],
ownerId:[
{ required: true, message: "请选择户主", trigger: "blur" }
],
stationCode:[
{ required: true, message: "请选择站点", trigger: "blur" }
]
})
watch(() => addata.totalAmount,v => {
addata.totalAmount = setNum(addata.totalAmount)
})
watch(() => addata.rechargeAmount,v => {
addata.rechargeAmount = setNum(addata.rechargeAmount)
})
watch(() => addata.giftAmount,v => {
addata.giftAmount = setNum(addata.giftAmount)
})
watch(() => addata.point,v => {
addata.point = setNum(addata.point)
})
watch(() => addata.deposit,v => {
addata.deposit = setNum(addata.deposit)
})
watch(() => addata.rent,v => {
addata.rent = setNum(addata.rent)
})
//
function getlabel(n:string){
addata.stationName = n
}
function getyys() {
getjqrlist(queryParams).then(rps => {
if(rps.data && (rps.data as any).records.length > 0){
const v = (rps.data as any).records[0]
addata.stationCode = v.stationCode
addata.pkId = v.pkId
addata.stationCode = v.stationCode
addata.stationName = v.stationName
addata.totalAmount = v.totalAmount?v.totalAmount/100:0
addata.rechargeAmount = v.rechargeAmount?v.rechargeAmount/100:0
addata.giftAmount = v.giftAmount?v.giftAmount/100:0
addata.point = v.point?v.point/100:0
addata.deposit = v.deposit?v.deposit/100:0
addata.snCode = v.snCode?v.snCode:''
addata.rent = v.rent?v.rent/100:0
iskh.value = true
type.value = 2
}
})
}
let mxlist = ref<any[]>([])
function showpop(num:any,row?:any){
type.value = num
if(type.value == 1){
openpop.value = true
}else if(type.value == 2){
drawer.value = true
}
yysRef.value?.resetFields()
addata.pkId = ''
addata.stationCode = ''
addata.stationName = ''
addata.totalAmount = ''
addata.rechargeAmount = ''
addata.giftAmount = ''
addata.point = ''
addata.deposit = ''
addata.snCode = ''
addata.rent = ''
}
function savehand() {
if(type.value == 1){
return addhdz(addata)
}
return update(addata)
}
//
function handleAdd() {
yysRef.value?.validate((valid:Boolean) => {
if (valid) {
addata.totalAmount = addata.totalAmount*100
addata.rechargeAmount = addata.rechargeAmount*100
addata.giftAmount = addata.giftAmount*100
addata.point = addata.point*100
addata.deposit = addata.deposit*100
addata.rent = addata.rent*100
savehand().then(() => {
ElMessage({
type: 'success',
message: type.value == 1?'添加成功':'修改成功'
})
if(type.value == 2){
stationName.value = addata.stationName
}
setTimeout(()=> {
if(type.value == 1){
openpop.value = false
}
getyys()
},600)
})
}
})
}
//
function cancel() {
openpop.value = false
}
//
let drawer = ref(false)
//let standardId = ref('')
function handleClose() {
drawer.value = false
}
function resetupdate() {
yysRef.value?.resetFields()
}
// function bzmingx(id:string) {
// drawer.value = true
// standardId.value = id
// }
getyys()
</script>
<style scoped>
.el-divider--horizontal{
border-color:#5b98cd;
}
.mktit{
width: 100%;
height: 40px;
line-height: 40px;
border-radius: 10px 10px 0 0;
font-size: 18px;
font-weight: bold;
color: #fff;
text-align: center;
background: #98c3ef;
}
.jqbg{
background: #73b9c9;
}
</style>

View File

@ -1,6 +1,6 @@
<template>
<div>
<div class="app-container" style="margin-bottom: 12px;padding-bottom: 5px;border-radius: 10px;">
<div v-if="search" class="app-container" style="margin-bottom: 12px;padding-bottom: 5px;border-radius: 10px;">
<el-form
ref="querform"
:model="queryParams"
@ -45,26 +45,41 @@
</el-form>
</div>
<div class="app-container" style="margin-bottom: 12px;border-radius: 10px;">
<el-button
<div style="display: flex;justify-content: space-between;">
<el-button
type="primary"
plain
icon="Plus"
@click="showpop(1)">新增</el-button>
@click="showpop()">新增</el-button>
<el-tooltip class="item" effect="dark" :content="search? '隐藏搜索' : '显示搜索'" placement="top">
<el-button size="mini" circle icon="Search" @click="search = !search" />
</el-tooltip>
</div>
<el-table
style="width:100%;margin-top: 10px;"
:data="yysList"
border
stripe
max-height="600px"
:max-height="search?'600px':'680px'"
>
<el-table-column label="区划" width="200" align="center" prop="division" :show-overflow-tooltip="true" />
<el-table-column label="公司名称" width="200" align="center" prop="cname" :show-overflow-tooltip="true" />
<el-table-column label="组织机构代码" width="200" align="center" prop="ccode" :show-overflow-tooltip="true" />
<el-table-column label="详细地址" width="400" align="center" prop="address" :show-overflow-tooltip="true" />
<el-table-column label="联系人" width="130" align="center" prop="contacts" :show-overflow-tooltip="true" />
<el-table-column label="联系电话" width="160" align="center" prop="phone" :show-overflow-tooltip="true" />
<el-table-column label="账户余额" width="100" align="center" prop="accountBalance" :show-overflow-tooltip="true" />
<el-table-column label="状态" width="100" align="center" prop="status">
<el-table-column label="公司名称" min-width="200" align="center" prop="cname" :show-overflow-tooltip="true">
<template #default="scope">
<div @click="xqshpop(scope.row)" style="display: inline-block;color:#16599d;border-bottom: 1px solid #417ebb;cursor:pointer">{{scope.row.cname}}</div>
</template>
</el-table-column>
<el-table-column label="组织机构代码" min-width="200" align="center" prop="ccode" :show-overflow-tooltip="true" />
<el-table-column label="区划" min-width="200" align="center" prop="division" :show-overflow-tooltip="true" />
<el-table-column label="详细地址" min-width="400" align="center" prop="address" :show-overflow-tooltip="true" />
<el-table-column label="联系人" min-width="130" align="center" prop="contacts" :show-overflow-tooltip="true" />
<el-table-column label="联系电话" min-width="160" align="center" prop="phone" :show-overflow-tooltip="true" />
<el-table-column label="账户余额(元)" min-width="100" align="center" prop="accountBalance" :show-overflow-tooltip="true">
<template #default="scope">
<div>{{scope.row.accountBalance/100}}</div>
</template>
</el-table-column>
<el-table-column label="状态" min-width="100" align="center" prop="status">
<template #default="scope">
<div v-if="scope.row.status == 1">启用</div>
<div v-else style="color: #ccc;">禁用</div>
@ -75,9 +90,9 @@
<span>{{ dayjs(scope.row.createTime).format("YYYY-MM-DD HH:mm:ss") }}</span>
</template>
</el-table-column> -->
<el-table-column label="操作" align="center" width="150" fixed="right">
<el-table-column label="操作" align="center" width="100" fixed="right">
<template #default="scope">
<el-button link type="primary" icon="Edit" @click="showpop(2,scope.row)">修改</el-button>
<!-- <el-button link type="primary" icon="Edit" @click="showpop(2,scope.row)">修改</el-button> -->
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
@ -213,6 +228,143 @@
</div>
</template>
</el-dialog>
<!--企业详情-->
<el-drawer
v-model="xqdaropen"
:with-header="false"
size="50%"
>
<!-- <tit @close="handleClose" :name="addata.name" :hdzcode="addata.code" :showcode="true" /> -->
<div style="padding:0;border: 2px solid #98c3ef;border-radius: 10px;">
<div class="mktit" style="margin-bottom: 20px;">基本信息</div>
<el-form style="padding: 20px;" ref="yysRef" :model="addata" :rules="rules" label-width="110px">
<el-row>
<el-col :span="12">
<el-form-item label="区划" prop="division">
<el-cascader
ref="cascader"
v-model="slecas"
style="width: 100%;"
:options="options"
clearable
:props="{
label:'admdvsName',
value:'admdvsNo',
children:'subAdmdvsInfoList'
}"
@change="change"
/>
<!-- <el-input v-model="addata.division" placeholder="请选择区划" maxlength="20" /> -->
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="公司名称" prop="cname">
<el-input v-model="addata.cname" placeholder="请输入公司名称" maxlength="50" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="组织机构代码" prop="ccode">
<el-input
v-model="addata.ccode"
disabled
placeholder="请输入组织机构代码"
maxlength="50"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="详细地址" prop="address">
<el-input
v-model="addata.address"
placeholder="请输入详细地址"
maxlength="50"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系人" prop="contacts">
<el-input
v-model="addata.contacts"
placeholder="请输入联系人"
maxlength="20"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系电话" prop="phone">
<el-input
v-model="addata.phone"
placeholder="请输入联系电话"
maxlength="11"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<!-- <el-form-item label="只读" prop="readonly">
<el-radio-group v-model="addata.readonly">
<el-radio value="1"></el-radio>
<el-radio value="0"></el-radio>
</el-radio-group>
</el-form-item> -->
<el-form-item label="账户余额(元)" prop="accountBalance">
<el-input
v-model="addata.accountBalance"
placeholder="请输入账户余额"
maxlength="20"
/>
</el-form-item>
<!-- <el-form-item label="logo" prop="logo">
<el-upload
class="avatar-uploader"
action="http://localhost:5173/dev-api/resource/file/upload"
:show-file-list="false"
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload"
>
<img v-if="imageUrl" :src="imageUrl" class="avatar" />
<el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
</el-upload>
</el-form-item> -->
</el-col>
<el-col :span="12">
<el-form-item label="状态" prop="status">
<el-radio-group v-model="addata.status">
<el-radio :value="1">启用</el-radio>
<el-radio :value="0">禁用</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-col :span="24" style="text-align: center;">
<el-button type="success" @click="handleAdd"> </el-button>
<el-button @click="resetupdate"> </el-button>
</el-col>
</el-form>
</div>
<div style="margin-top: 20px;padding: 0;border: 2px solid #73b9c9;border-radius: 10px;">
<div class="mktit" style="margin-bottom: 20px;background: #73b9c9;">账户信息</div>
<Accountmb v-if="xqdaropen" :ownerId="addata.ccode" />
</div>
<!-- <el-tabs type="border-card" class="demo-tabs">
<el-tab-pane>
</el-tab-pane>
<el-tab-pane label="Config">Config</el-tab-pane>
<el-tab-pane label="Role">Role</el-tab-pane>
<el-tab-pane label="Task">Task</el-tab-pane>
</el-tabs> -->
</el-drawer>
</div>
</template>
<script setup lang="ts" name="UserPage">
@ -225,10 +377,17 @@
import {
getArea
} from '@/api/common'
import { ref,reactive } from 'vue'
import Accountmb from './account.vue'
import { setNum } from '@/utils/validate'
import { ref,reactive,watch } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import type { UploadProps } from 'element-plus'
let search = ref(true)
let queryParams = reactive({
pageSize:20, //
pageNo:1, //
@ -310,31 +469,24 @@
{ required: true, message: "请输入组织机构代码", trigger: "blur" },
]
})
function showpop(num:any,row?:any){
type.value = num
watch(() => addata.phone,v => {
if(v){
addata.phone = v.replace(/[^\d]/g,'')
}
})
watch(() => addata.accountBalance,v => {
if(v){
addata.accountBalance =setNum(v)
}
})
function showpop(){
type.value = 1
openpop.value = true
ystit.value = num == 1?'添加公司':'修改公司'
ystit.value = '添加公司'
yysRef.value?.resetFields()
if(row){
slecas.value = row.divisionNo
addata.pkId = row.pkId
addata.cname = row.cname
addata.ccode = row.ccode
addata.division = row.division
addata.divisionNo = row.divisionNo
addata.address = row.address
addata.addressProvince = row.addressProvince
addata.addressCity = row.addressCity
addata.addressArea = row.addressArea
addata.contacts = row.contacts
addata.phone = row.phone
addata.status = row.status
addata.logo = row.logo
//addata.delFlag = row.delFlag
addata.accountBalance = row.accountBalance
}else{
slecas.value = ''
addata.pkId = ''
@ -350,8 +502,7 @@
addata.phone = ''
addata.status = ''
addata.logo = ''
addata.accountBalance = ''
}
addata.accountBalance = ''
}
function savehand() {
if(type.value == 1){
@ -364,6 +515,9 @@
function handleAdd() {
yysRef.value?.validate((valid:Boolean) => {
if (valid) {
if(addata.accountBalance){
(addata.accountBalance as any) = (addata.accountBalance as any)*100
}
savehand().then(() => {
ElMessage({
type: 'success',
@ -371,6 +525,7 @@
})
setTimeout(()=> {
openpop.value = false
xqdaropen.value = false
getyys()
},600)
})
@ -404,6 +559,10 @@
})
}
function resetupdate() {
yysRef.value?.resetFields()
}
//
let options = ref<any>([])
let cascader = ref()
@ -434,6 +593,36 @@
})
//
let xqdaropen = ref(false)
function xqshpop(row:any){
type.value = 2
xqdaropen.value = true
yysRef.value?.resetFields()
if(row){
slecas.value = row.divisionNo
addata.pkId = row.pkId
addata.cname = row.cname
addata.ccode = row.ccode
addata.division = row.division
addata.divisionNo = row.divisionNo
addata.address = row.address
addata.addressProvince = row.addressProvince
addata.addressCity = row.addressCity
addata.addressArea = row.addressArea
addata.contacts = row.contacts
addata.phone = row.phone
addata.status = row.status
addata.logo = row.logo
//addata.delFlag = row.delFlag
addata.accountBalance = row.accountBalance == null?'':(row.accountBalance/100)+''
}
}
//
let imageUrl = ref('')
const handleAvatarSuccess: UploadProps['onSuccess'] = (
@ -457,7 +646,18 @@
getyys()
</script>
<style scoped>
.el-divider--horizontal{
border-color:#5b98cd;
}
.el-divider--horizontal{
border-color:#5b98cd;
}
.mktit{
width: 100%;
height: 40px;
line-height: 40px;
border-radius: 10px 10px 0 0;
font-size: 18px;
font-weight: bold;
color: #fff;
text-align: center;
background: #98c3ef;
}
</style>

View File

@ -1,6 +1,6 @@
<template>
<div>
<div class="app-container" style="margin-bottom: 12px;padding-bottom: 5px;border-radius: 10px;">
<div v-if="search" class="app-container" style="margin-bottom: 12px;padding-bottom: 5px;border-radius: 10px;">
<el-form
ref="querform"
:model="queryParams"
@ -24,28 +24,46 @@
</el-form>
</div>
<div class="app-container" style="margin-bottom: 12px;border-radius: 10px;">
<div style="display: flex;justify-content: right;">
<el-tooltip class="item" effect="dark" :content="search? '隐藏搜索' : '显示搜索'" placement="top">
<el-button size="mini" circle icon="Search" @click="search = !search" />
</el-tooltip>
</div>
<el-table
style="width:100%;margin-top: 10px;"
:data="yysList"
border
stripe
max-height="600px"
:max-height="search?'600px':'680px'"
>
<el-table-column label="手机号" min-width="150" align="center" prop="phoneNumber" :show-overflow-tooltip="true">
<template #default="scope">
<div @click="showpop(scope.row)" style="display: inline-block;color:#16599d;border-bottom: 1px solid #417ebb;cursor:pointer">{{scope.row.phoneNumber}}</div>
<el-table-column type="index" min-width="50" align="center">
<template #default="{ $index }">
<div>{{(queryParams.pageNo - 1) * queryParams.pageSize+ $index + 1}}</div>
</template>
</el-table-column>
<el-table-column label="手机号" min-width="150" align="center" prop="phoneNumber" :show-overflow-tooltip="true">
<template #default="scope">
<div @click="showpop(scope.row)" style="display: inline-block;color:#16599d;border-bottom: 1px solid #417ebb;cursor:pointer">{{scope.row.phoneNumber?scope.row.phoneNumber:'暂未绑定'}}</div>
</template>
</el-table-column>
<el-table-column label="用户名称" min-width="150" align="center" prop="name" :show-overflow-tooltip="true">
<template #default="scope">
<div>{{scope.row.name?scope.row.name:'暂未设置'}}</div>
</template>
</el-table-column>
<el-table-column label="用户昵称" min-width="150" align="center" prop="nickName" :show-overflow-tooltip="true">
<template #default="scope">
<div>{{scope.row.nickName?scope.row.nickName:'暂未设置'}}</div>
</template>
</el-table-column>
<el-table-column label="用户名称" min-width="150" align="center" prop="name" :show-overflow-tooltip="true" />
<el-table-column label="用户昵称" min-width="150" align="center" prop="nickName" :show-overflow-tooltip="true" />
<el-table-column label="用户性别" min-width="150" align="center" prop="gender" :show-overflow-tooltip="true">
<template #default="scope">
<div v-if="scope.row.ownerType == 1"></div>
<div v-else-if="scope.row.ownerType == 2"></div>
<div v-if="scope.row.gender == 1"></div>
<div v-else-if="scope.row.gender == 2"></div>
<div v-else>暂未设置</div>
</template>
</el-table-column>
<el-table-column label="账户类型" min-width="150" align="center" prop="gender" :show-overflow-tooltip="true">
<el-table-column label="户类型" min-width="150" align="center" prop="type" :show-overflow-tooltip="true">
<template #default="scope">
<div v-if="scope.row.type == 1">个人</div>
<div v-else-if="scope.row.type == 2">公司</div>
@ -144,6 +162,11 @@
<el-input v-model="addata.name" maxlength="20" placeholder="请输入用户名" clearable />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="账户余额(元)">
<el-input v-model="totalAmount" disabled placeholder="请输入用户名" clearable />
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
@ -164,9 +187,14 @@
import {
getlist
} from '@/api/operation/company'
import {
getjqrlist
} from '@/api/order/account'
import { ref,reactive,watch} from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
let search = ref(true)
let queryParams = reactive({
pageSize:20, //
pageNo:1, //
@ -305,6 +333,8 @@
addata.phone = v.replace(/[^\d]/g,'')
})
let totalAmount = ref<any>('')
function showpop(row?:any){
openpop.value = true
yysRef.value?.resetFields()
@ -312,6 +342,19 @@
addata.wuid = row.wuid
addata.name = row.name?row.name:''
addata.phone = row.phoneNumber?row.phoneNumber:''
getjqrlist({
pageSize:20, //
pageNo:1, //
ownerId:row.wuid //ID
}).then(rps => {
if(rps.data && (rps.data as any).records.length > 0){
totalAmount.value = (rps.data as any).records[0].totalAmount
totalAmount.value = totalAmount.value/100
}else{
totalAmount.value = '暂未开通'
}
})
}
}