diff --git a/src/App.vue b/src/App.vue
index 759fecd..b9a0887 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -40,7 +40,7 @@ import Login from './views/components/login.vue'
function update() {
openpop.value = false
- //location.reload()
+ location.reload() //??
}
diff --git a/src/api/operation/wxuser.ts b/src/api/operation/wxuser.ts
index 9ce1691..03e1d53 100644
--- a/src/api/operation/wxuser.ts
+++ b/src/api/operation/wxuser.ts
@@ -17,7 +17,7 @@ interface Querydata{
url: '/cloud/wechat/user/list',
method: 'get',
params
- })
+ },false)
}
//关联公司
diff --git a/src/api/order/reservation.ts b/src/api/order/reservation.ts
index 20cbeff..0e1012a 100644
--- a/src/api/order/reservation.ts
+++ b/src/api/order/reservation.ts
@@ -2,7 +2,9 @@ import server from '@/utils/request'
//新增
interface Addobj{
+ source:String //来源:1-小程序,2-云端,3-站端
userId:String //预约人ID
+ ucode:String
uname:String //预约人姓名
phone:String //手机号码
plateNum:String //车牌号
@@ -10,7 +12,7 @@ interface Addobj{
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 //预约人编码
@@ -52,7 +54,7 @@ interface Querydata{
swapDayEnd?:String //预约换电日期结束
stationCode?:String //换电站编码
}
-export function getjqrlist(params:Querydata) {
+export function getyylist(params:Querydata) {
return server.request({
url: '/cloud/order/swap/pre/list',
method: 'get',
diff --git a/src/api/swapstation/hdz.ts b/src/api/swapstation/hdz.ts
index ed2ee49..fc4fb7a 100644
--- a/src/api/swapstation/hdz.ts
+++ b/src/api/swapstation/hdz.ts
@@ -61,7 +61,7 @@ export function gethdzlist(params:Querydata) {
url: '/cloud/batterystation/list',
method: 'get',
params
- })
+ },false)
}
//删除
diff --git a/src/layout/components/Header/index.vue b/src/layout/components/Header/index.vue
index 9f7fd79..714cc31 100644
--- a/src/layout/components/Header/index.vue
+++ b/src/layout/components/Header/index.vue
@@ -49,7 +49,7 @@
- 个人中心
+
退出登录
diff --git a/src/utils/validate.ts b/src/utils/validate.ts
index 8797d2c..26a88f4 100644
--- a/src/utils/validate.ts
+++ b/src/utils/validate.ts
@@ -129,4 +129,18 @@ export function carNum(rule:any, value:any, callback:any) {
return callback()
}
return callback()
+}
+
+export function getDateDaysAgo(days:number = 0,time?:string) {
+ const date = new Date();
+ date.setDate(date.getDate() - days);
+
+ const year = date.getFullYear();
+ const month = String(date.getMonth() + 1).padStart(2, '0');
+ const day = String(date.getDate()).padStart(2, '0');
+
+ if(time){
+ return `${year}-${month}-${day} ${time}`
+ }
+ return `${year}-${month}-${day}`
}
\ No newline at end of file
diff --git a/src/views/index.vue b/src/views/index.vue
index a51e38a..86017a4 100644
--- a/src/views/index.vue
+++ b/src/views/index.vue
@@ -15,7 +15,7 @@
-
+
{{ operatotal }}
@@ -55,19 +55,19 @@
-
+
-
+
-
+
{{ rzvehicle }}
@@ -120,15 +120,15 @@
-
+
-
+
-
+
diff --git a/src/views/order/account/baldetails.vue b/src/views/order/account/baldetails.vue
index f75462c..156e6ff 100644
--- a/src/views/order/account/baldetails.vue
+++ b/src/views/order/account/baldetails.vue
@@ -14,18 +14,55 @@
highlight-current-row
max-height="620px"
>
-
-
-
-
+
+
+
+ {{scope.row.preTotalAmount/100}}
+
+
+
+
+ {{scope.row.preRechargeAmount/100}}
+
+
+
+
+ {{scope.row.preGiftAmount/100}}
+
+
-
-
-
+
+
+ {{scope.row.tradeTotalAmount/100}}
+
+
-
-
-
+
+
+ {{scope.row.tradeRechargeAmount/100}}
+
+
+
+
+ {{scope.row.tradeGiftAmount/100}}
+
+
+
+
+
+ {{scope.row.afterTotalAmount/100}}
+
+
+
+
+ {{scope.row.afterRechargeAmount/100}}
+
+
+
+
+ {{scope.row.afterGiftAmount/100}}
+
+
@@ -85,7 +122,7 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
addata.preTotalAmount,v => {
+ addata.preTotalAmount = setNum(addata.preTotalAmount)
+ })
+
+ watch(() => addata.preRechargeAmount,v => {
+ addata.preRechargeAmount = setNum(addata.preRechargeAmount)
+ })
+
+ watch(() => addata.preGiftAmount,v => {
+ addata.preGiftAmount = setNum(addata.preGiftAmount)
+ })
+
+
+
+ watch(() => addata.tradeTotalAmount,v => {
+ addata.tradeTotalAmount = setNum(addata.tradeTotalAmount)
+ })
+
+ watch(() => addata.tradeRechargeAmount,v => {
+ addata.tradeRechargeAmount = setNum(addata.tradeRechargeAmount)
+ })
+
+ watch(() => addata.tradeGiftAmount,v => {
+ addata.tradeGiftAmount = setNum(addata.tradeGiftAmount)
+ })
+
+ watch(() => addata.afterTotalAmount,v => {
+ addata.afterTotalAmount = setNum(addata.afterTotalAmount)
+ })
+
+
+ watch(() => addata.afterRechargeAmount,v => {
+ addata.afterRechargeAmount = setNum(addata.afterRechargeAmount)
+ })
+
+ watch(() => addata.afterGiftAmount,v => {
+ addata.afterGiftAmount = setNum(addata.afterGiftAmount)
+ })
+
+
function showpop(num:any,row?:any){
type.value = num
openpop.value = true
diff --git a/src/views/order/account/index.vue b/src/views/order/account/index.vue
index 08eeba9..a855d7c 100644
--- a/src/views/order/account/index.vue
+++ b/src/views/order/account/index.vue
@@ -46,21 +46,46 @@
{{scope.row.code}}
-
+
个人
企业
-
-
-
+
+
+ {{scope.row.totalAmount/100}}
+
+
+
+
+ {{scope.row.rechargeAmount/100}}
+
+
+
+
+
+ {{scope.row.giftAmount/100}}
+
+
-
-
-
-
+
+
+ {{scope.row.point/100}}
+
+
+
+
+ {{scope.row.deposit/100}}
+
+
+
+
+
+ {{scope.row.rent/100}}
+
+
@@ -99,11 +124,12 @@
ref="yysRef"
:model="addata"
:rules="rules"
- label-width="90px">
+ label-width="120px">
@@ -118,6 +144,21 @@
+
+
+
+
+
+
@@ -136,7 +177,7 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
基本信息
-
-
+ label-width="120px">
+
+
@@ -247,7 +288,7 @@
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
-
+
+
- 确 定
+ 保 存
重 置
@@ -335,7 +376,7 @@
-
+
余额明细
([])
gethdzlist({
- pageSize:100, //每页条数
+ pageSize:200, //每页条数
pageNo:1, //页数
proxyId:'', //归属运营商ID
name:'', //站点名称
@@ -440,10 +489,10 @@
let bzName = ref('')
let code = ref('')
let stationName = ref('')
- let addata = reactive({
+ let addata = reactive({
pkId:'',
- ownerType:'', //户主类型:1-个人,2-企业
- ownerId:'123', //户主ID
+ ownerType:'2', //户主类型:1-个人,2-企业
+ ownerId:'', //户主ID
stationCode:'', //引入站点
stationName:'', //换电站名称 ??
totalAmount:'', //账户总金额,分:总金额=充值金额+赠送金额
@@ -461,10 +510,10 @@
],
ownerId:[
{ required: true, message: "请选择户主", trigger: "blur" }
- ],
- stationCode:[
- { required: true, message: "请选择站点", trigger: "blur" }
]
+ // stationCode:[
+ // { required: true, message: "请选择站点", trigger: "blur" }
+ // ]
})
watch(() => addata.totalAmount,v => {
@@ -516,13 +565,13 @@
addata.ownerId = row.ownerId
addata.stationCode = row.stationCode
addata.stationName = row.stationName
- addata.totalAmount = row.totalAmount+''
- addata.rechargeAmount = row.rechargeAmount+''
- addata.giftAmount = row.giftAmount+''
- addata.point = row.point+''
- addata.deposit = row.deposit+''
- addata.snCode = row.snCode+''
- addata.rent = row.rent+''
+ 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.snCode = row.snCode?row.snCode:''
+ addata.rent = row.rent
standardId.value = row.pkId
bzName.value = row.name
@@ -531,8 +580,8 @@
mxlist.value = row.detailList
}else{
addata.pkId = ''
- addata.ownerType = ''
- addata.ownerId = '1' //??
+ addata.ownerType = '2'
+ addata.ownerId = ''
addata.stationCode = ''
addata.stationName = ''
addata.totalAmount = ''
@@ -555,6 +604,12 @@
function handleAdd() {
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({
type: 'success',
@@ -566,6 +621,8 @@
setTimeout(()=> {
if(type.value == 1){
openpop.value = false
+ }else{
+ drawer.value = false
}
getyys()
},600)
@@ -582,7 +639,7 @@
//删除
function handleDelete(row:any) {
ElMessageBox.confirm(
- `确定删除:${row.name}`,
+ `确定删除?`,
'温馨提示',
{
// confirmButtonText: '',
@@ -620,6 +677,74 @@
// standardId.value = id
// }
+ let qswxuser = ref('')
+
+ function changetype() {
+ qswxuser.value = ''
+ addata.ownerId = ''
+ }
+ //获取微信用户
+ function getuser(v:any) {
+ if(addata.ownerType == '1'){
+ return getwxlist({
+ pageSize:100, //每页条数
+ pageNo:1, //页数
+ phoneNumber:v, //手机号
+ // nickName:queryString, //昵称
+ // name:queryString //名称
+ })
+ }
+ return getlist({
+ pageSize:1000, //每页条数
+ pageNo:1, //页数
+ cname:v
+ })
+ }
+
+ async function querySearchAsync (queryString: string, cb:any) {
+ getuser(queryString).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) => {
+ if(addata.ownerType == '1'){
+ return {
+ value: `${n.name?n.name:'暂未设置姓名'}—${n.phoneNumber?n.phoneNumber:'暂未绑定手机号'}`,
+ name: n.name,
+ phoneNumber:n.phoneNumber,
+ id:n.wuid //??
+ }
+ }
+ return {
+ value: n.cname,
+ id: n.ccode
+ }
+
+ })
+ cb(listss)
+ //return listss
+ // callback(mapList.value);
+ }else{
+ cb([])
+ }
+ }).catch(() => {
+ cb([])
+ })
+ }
+
+ function qsautoblur() {
+ if(addata.ownerId === ''){
+ qswxuser.value = ''
+ }
+ }
+
+ function qsautoclear() {
+ addata.ownerId = ''
+ }
+
+ function qshandleSelect(v: any) {
+ addata.ownerId = v.id
+ }
+
getyys()