From f7a5c9e87d924b513b70e5e63d43ceccacbf74c2 Mon Sep 17 00:00:00 2001 From: cjb <646858191@qq.com> Date: Wed, 16 Apr 2025 11:00:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 1 + src/api/order/account.ts | 3 +- src/api/swapstation/hdz.ts | 13 ++- src/utils/validate.ts | 5 +- src/views/components/detailstit.vue | 63 ++++++++++- src/views/order/account/baldetails.vue | 36 +++--- src/views/order/account/index.vue | 145 ++++++++++++++++--------- src/views/order/replabatt/index.vue | 54 +++++---- src/views/order/reservation/index.vue | 36 ++++-- src/views/system/role/index.vue | 13 ++- src/views/system/user/index.vue | 26 +++-- src/views/vehicle/car/index.vue | 16 ++- vite/vite.config.serve.ts | 4 +- 13 files changed, 289 insertions(+), 126 deletions(-) diff --git a/.env.development b/.env.development index c755677..dd4d3cb 100644 --- a/.env.development +++ b/.env.development @@ -6,5 +6,6 @@ VITE_APP_ENV = 'development' # 开发环境 VITE_APP_BASE_API = 'http://192.168.5.213:9100/gateway' +#VITE_APP_BASE_API = 'http://192.168.5.14:9100/gateway' #VITE_APP_BASE_API = '/dev-api' #VITE_APP_BASE_API = 'https://api.evo-techina.com' diff --git a/src/api/order/account.ts b/src/api/order/account.ts index 8faca85..8860233 100644 --- a/src/api/order/account.ts +++ b/src/api/order/account.ts @@ -4,7 +4,8 @@ import server from '@/utils/request' interface Addobj{ ownerType:String //户主类型:1-个人,2-企业 ownerId:String //户主ID - stationCode:String //引入站点 + accName?:String //户主名称 + stationCode?:String //引入站点 pkId?:String totalAmount?:String|Number //账户总金额,分:总金额=充值金额+赠送金额 rechargeAmount?:String|Number //充值余额,分 diff --git a/src/api/swapstation/hdz.ts b/src/api/swapstation/hdz.ts index fc4fb7a..8996ec9 100644 --- a/src/api/swapstation/hdz.ts +++ b/src/api/swapstation/hdz.ts @@ -90,4 +90,15 @@ export function getqrcode(params:Codeqs) { params, responseType:'blob' }) -} \ No newline at end of file +} + +//生成站点公钥 +export function publicKey(stationCode:any) { + return server.request({ + url: '/cloud/batterystation/rsa_secret_key', + method: 'post', + data:{ + stationCode + } + }) +} diff --git a/src/utils/validate.ts b/src/utils/validate.ts index 26a88f4..174b28b 100644 --- a/src/utils/validate.ts +++ b/src/utils/validate.ts @@ -109,10 +109,10 @@ export function setNum(v?:any){ //只能输入两个小数 v = v.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3') - if(/^0+[1-9]$/.test(v) || /^0+\d+\./.test(v)) { + if(/^0+[1-9]\d*\.*/.test(v)) { v = v.replace(/^0+/,'') } - if(/^(0+\.)/.test(v) || /^0+\.$/.test(v) || /^0+$/.test(v)) { + if(/^0+\.*/.test(v)) { v = v.replace(/^0+/,'0') } return v @@ -123,6 +123,7 @@ export function setNum(v?:any){ export function carNum(rule:any, value:any, callback:any) { if(value.length > 0){ const regExp = new RegExp(/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF])|([DF][A-HJ-NP-Z0-9][0-9]{4}))$/) + //const regExp = new RegExp(/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[0-9][A-Z]$/) if (!regExp.test(value)) { return callback(new Error('车牌号格式不正确')) } diff --git a/src/views/components/detailstit.vue b/src/views/components/detailstit.vue index 8f0a819..983ab01 100644 --- a/src/views/components/detailstit.vue +++ b/src/views/components/detailstit.vue @@ -10,8 +10,12 @@ -
-
查看小程序码
+ + + +
+
生成公钥
+
查看小程序码
@@ -20,6 +24,24 @@
+ + + + +
+
{{publickey}}
+
复制
+
+ +
+ + + 下载 + \ No newline at end of file diff --git a/src/views/order/account/baldetails.vue b/src/views/order/account/baldetails.vue index 156e6ff..a997f12 100644 --- a/src/views/order/account/baldetails.vue +++ b/src/views/order/account/baldetails.vue @@ -1,11 +1,11 @@ - + --> diff --git a/src/views/order/account/index.vue b/src/views/order/account/index.vue index a855d7c..91ada9d 100644 --- a/src/views/order/account/index.vue +++ b/src/views/order/account/index.vue @@ -12,6 +12,13 @@ + + + @@ -24,7 +31,7 @@
-
+ - - - + + + - - + + + + - + - + - + - + - + - + - + - 删除 - + -->
- + + @@ -256,7 +264,7 @@ @@ -268,6 +276,7 @@ :model="addata" :rules="rules" label-width="120px"> + @@ -287,7 +296,15 @@ - + + + + + - ({ pkId:'', - ownerType:'2', //户主类型:1-个人,2-企业 + ownerType:'2', //户主类型:1-个人,2-企业 ownerId:'', //户主ID + accName:'', //户主名称 stationCode:'', //引入站点 stationName:'', //换电站名称 ?? totalAmount:'', //账户总金额,分:总金额=充值金额+赠送金额 @@ -562,16 +588,17 @@ addata.pkId = row.pkId addata.ownerType = row.ownerType+'' - addata.ownerId = row.ownerId + addata.ownerId = row.ownerId + addata.accName = row.accName addata.stationCode = row.stationCode addata.stationName = row.stationName addata.totalAmount = row.totalAmount?row.totalAmount/100:0 addata.rechargeAmount = row.rechargeAmount?row.rechargeAmount/100:0 addata.giftAmount = row.giftAmount?row.giftAmount/100:0 - addata.point = row.point - addata.deposit = row.deposit + addata.point = row.point?row.point/100:0 + addata.deposit = row.deposit?row.deposit/100:0 addata.snCode = row.snCode?row.snCode:'' - addata.rent = row.rent + addata.rent = row.rent?row.rent/100:0 standardId.value = row.pkId bzName.value = row.name @@ -581,7 +608,8 @@ }else{ addata.pkId = '' addata.ownerType = '2' - addata.ownerId = '' + addata.ownerId = '' + addata.accName = '' addata.stationCode = '' addata.stationName = '' addata.totalAmount = '' @@ -590,14 +618,21 @@ addata.point = '' addata.deposit = '' addata.snCode = '' - addata.rent = '' + addata.rent = '' + + qswxuser.value = '' } } function savehand() { + let objData = Object.assign({},addata,{ + totalAmount:addata.totalAmount*100, + rechargeAmount:addata.rechargeAmount*100, + giftAmount:addata.giftAmount*100 + }) if(type.value == 1){ - return addhdz(addata) + return addhdz(objData) } - return update(addata) + return update(objData) } //保存 @@ -605,10 +640,7 @@ yysRef.value?.validate((valid:Boolean) => { if (valid) { - addata.totalAmount = addata.totalAmount*100 - - addata.rechargeAmount = addata.rechargeAmount*100 - addata.giftAmount = addata.giftAmount*100 + savehand().then(() => { ElMessage({ @@ -682,6 +714,7 @@ function changetype() { qswxuser.value = '' addata.ownerId = '' + addata.accName = '' } //获取微信用户 function getuser(v:any) { @@ -716,6 +749,7 @@ } return { value: n.cname, + name:n.cname, id: n.ccode } @@ -732,18 +766,21 @@ } function qsautoblur() { - if(addata.ownerId === ''){ - qswxuser.value = '' - } - } + if(addata.ownerId === ''){ + qswxuser.value = '' + addata.accName = '' + } + } - function qsautoclear() { - addata.ownerId = '' - } + function qsautoclear() { + addata.ownerId = '' + addata.accName = '' + } - function qshandleSelect(v: any) { - addata.ownerId = v.id - } + function qshandleSelect(v: any) { + addata.ownerId = v.id + addata.accName = v.name + } getyys() diff --git a/src/views/order/replabatt/index.vue b/src/views/order/replabatt/index.vue index 18761d4..b4ca0d5 100644 --- a/src/views/order/replabatt/index.vue +++ b/src/views/order/replabatt/index.vue @@ -61,11 +61,11 @@
- 新增 + @click="showpop(1)">新增 --> + + @@ -162,12 +164,11 @@ - + 删除 - + -->
- + @@ -487,6 +488,27 @@ + + + + 预约人: + {{xqobj.orderPreUname}} + + + + + 预约人电话: + {{xqobj.orderPrePhone?xqobj.orderPrePhone:''}} + + + + + 交易编码: + {{xqobj.tradeNo}} + + + + @@ -503,7 +525,7 @@ 基础费用: - {{xqobj.basicFee}}元 + {{xqobj.basicFee/100}}元 @@ -524,7 +546,7 @@ 服务费: - {{xqobj.serviceFee}}元 + {{xqobj.serviceFee/100}}元 @@ -626,33 +648,27 @@ {{xqobj.changeLane == 1?'A车道':'B车道'}} - - - 交易编码: - {{xqobj.tradeNo}} - - - + +
换电步骤
diff --git a/src/views/order/reservation/index.vue b/src/views/order/reservation/index.vue index 38aedfa..2d5975e 100644 --- a/src/views/order/reservation/index.vue +++ b/src/views/order/reservation/index.vue @@ -106,6 +106,7 @@
已过期
+