|
@@ -5,18 +5,16 @@
|
|
|
ref="userRef"
|
|
ref="userRef"
|
|
|
:model="userModel"
|
|
:model="userModel"
|
|
|
:rules="rules"
|
|
:rules="rules"
|
|
|
- label-width="130px"
|
|
|
|
|
- label-position="left"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ label-width="140px"
|
|
|
|
|
+ label-position="left">
|
|
|
|
|
+ <div class="section-title">
|
|
|
|
|
+ Profile
|
|
|
|
|
+ </div>
|
|
|
<el-row>
|
|
<el-row>
|
|
|
- <div class="section-title">
|
|
|
|
|
- Profile
|
|
|
|
|
- </div>
|
|
|
|
|
- <el-col :span="12">
|
|
|
|
|
|
|
+ <el-col :xs="24" :md="12">
|
|
|
<el-form-item
|
|
<el-form-item
|
|
|
prop='profile.nickName'
|
|
prop='profile.nickName'
|
|
|
- label="Display Name:"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ label="Display Name:">
|
|
|
<el-input
|
|
<el-input
|
|
|
class="input-text"
|
|
class="input-text"
|
|
|
v-model="userModel.profile.nickName"
|
|
v-model="userModel.profile.nickName"
|
|
@@ -50,6 +48,53 @@
|
|
|
</div>
|
|
</div>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
+ <el-col :xs="24" :md="12" v-if="isEdit">
|
|
|
|
|
+ <el-form-item
|
|
|
|
|
+ label="Charging History:">
|
|
|
|
|
+ <div class="flexc">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ class="input-text input-text-1"
|
|
|
|
|
+ v-model="userInfo.chargingCount"
|
|
|
|
|
+ readonly
|
|
|
|
|
+ />
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ @click="toHistoryCharge">
|
|
|
|
|
+ VIEW HISTORY
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item
|
|
|
|
|
+ label="Top-up History:">
|
|
|
|
|
+ <div class="flexc">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ class="input-text input-text-1"
|
|
|
|
|
+ v-model="userInfo.topUpCount"
|
|
|
|
|
+ readonly
|
|
|
|
|
+ />
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ @click="toHistoryTopup">
|
|
|
|
|
+ VIEW HISTORY
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item
|
|
|
|
|
+ label="Credit Amount:">
|
|
|
|
|
+ <div class="flexc">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ class="input-text input-text-1"
|
|
|
|
|
+ :value="userInfo.currencySymbol + ' ' + userInfo.credit"
|
|
|
|
|
+ readonly
|
|
|
|
|
+ />
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="success"
|
|
|
|
|
+ @click="showTopupModal">
|
|
|
|
|
+ TOP UP
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
|
|
|
<div class="sparator" ></div>
|
|
<div class="sparator" ></div>
|
|
@@ -57,7 +102,7 @@
|
|
|
Address
|
|
Address
|
|
|
</div>
|
|
</div>
|
|
|
<el-row :gutter="20">
|
|
<el-row :gutter="20">
|
|
|
- <el-col :span="12">
|
|
|
|
|
|
|
+ <el-col :xs="24" :md="12">
|
|
|
<el-form-item
|
|
<el-form-item
|
|
|
label="Country:"
|
|
label="Country:"
|
|
|
prop="address.country"
|
|
prop="address.country"
|
|
@@ -73,7 +118,7 @@
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
|
|
|
|
+ <el-col :xs="24" :md="12">
|
|
|
<el-form-item
|
|
<el-form-item
|
|
|
label="Street:"
|
|
label="Street:"
|
|
|
prop="address.street"
|
|
prop="address.street"
|
|
@@ -85,7 +130,7 @@
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
<el-row :gutter="20">
|
|
<el-row :gutter="20">
|
|
|
- <el-col :span="12">
|
|
|
|
|
|
|
+ <el-col :xs="24" :md="12">
|
|
|
<el-form-item
|
|
<el-form-item
|
|
|
label="City:"
|
|
label="City:"
|
|
|
prop="address.city"
|
|
prop="address.city"
|
|
@@ -95,7 +140,7 @@
|
|
|
v-model="userModel.address.city" />
|
|
v-model="userModel.address.city" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
|
|
|
|
+ <el-col :xs="24" :md="12">
|
|
|
<el-form-item
|
|
<el-form-item
|
|
|
label="Postal Code:"
|
|
label="Postal Code:"
|
|
|
prop="address.zipCode"
|
|
prop="address.zipCode"
|
|
@@ -139,15 +184,18 @@
|
|
|
class="vehicle-input"
|
|
class="vehicle-input"
|
|
|
v-model="vehicle.licensePlate" />
|
|
v-model="vehicle.licensePlate" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <img
|
|
|
|
|
- class="list-item-icon"
|
|
|
|
|
- @click="handleClickSubVehicleButton(vehicle, index)"
|
|
|
|
|
- src="../../assets/form-list-sub.png"/>
|
|
|
|
|
- <img
|
|
|
|
|
- v-if="index === userModel.vehicleList.length - 1"
|
|
|
|
|
- class="list-item-icon"
|
|
|
|
|
- @click="handleClickAddVehicleButton"
|
|
|
|
|
- src="../../assets/form-list-add.png"/>
|
|
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <img
|
|
|
|
|
+ class="list-item-icon"
|
|
|
|
|
+ @click="handleClickSubVehicleButton(vehicle, index)"
|
|
|
|
|
+ src="../../assets/form-list-sub.png"/>
|
|
|
|
|
+ <img
|
|
|
|
|
+ v-if="index === userModel.vehicleList.length - 1"
|
|
|
|
|
+ class="list-item-icon"
|
|
|
|
|
+ @click="handleClickAddVehicleButton"
|
|
|
|
|
+ src="../../assets/form-list-add.png"/>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="sparator" style="margin: 10px -80px;"></div>
|
|
<div class="sparator" style="margin: 10px -80px;"></div>
|
|
@@ -167,6 +215,11 @@
|
|
|
</div>
|
|
</div>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <TopUp
|
|
|
|
|
+ :visible="showTopup"
|
|
|
|
|
+ :userInfo="userInfo"
|
|
|
|
|
+ @hide="hideTopupModal"
|
|
|
|
|
+ @success="hideTopupModal(true)"/>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -180,34 +233,22 @@ import {
|
|
|
import { mapState } from 'vuex'
|
|
import { mapState } from 'vuex'
|
|
|
import site from '../../http/api/site'
|
|
import site from '../../http/api/site'
|
|
|
import {getCountryList} from '../../utils/index.js'
|
|
import {getCountryList} from '../../utils/index.js'
|
|
|
-
|
|
|
|
|
|
|
+import TopUp from './TopUp.vue'
|
|
|
export default {
|
|
export default {
|
|
|
name: 'UserDetial',
|
|
name: 'UserDetial',
|
|
|
computed: {
|
|
computed: {
|
|
|
...mapState('userManagement', ['selectedUser']),
|
|
...mapState('userManagement', ['selectedUser']),
|
|
|
},
|
|
},
|
|
|
- mounted() {
|
|
|
|
|
- this.getCountryList()
|
|
|
|
|
- if (this.selectedUser.userId) {
|
|
|
|
|
- this.getUserInfo()
|
|
|
|
|
- } else {
|
|
|
|
|
- this.userModel.profile.hasAreaCode = true
|
|
|
|
|
- this.userModel.vehicleList.push({
|
|
|
|
|
- brand: '',
|
|
|
|
|
- model: '',
|
|
|
|
|
- licensePlate: '',
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- beforeRouteLeave(to, form, next) {
|
|
|
|
|
- this.$store.commit('userManagement/RESET_SELECTED_USER')
|
|
|
|
|
- next()
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ components: {TopUp},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
loading: false,
|
|
loading: false,
|
|
|
countryOptions: [],
|
|
countryOptions: [],
|
|
|
areaCodeOptions: [],
|
|
areaCodeOptions: [],
|
|
|
|
|
+ userInfo: {
|
|
|
|
|
+ credit: 0,
|
|
|
|
|
+ currencySymbol: "$"
|
|
|
|
|
+ },
|
|
|
userModel: {
|
|
userModel: {
|
|
|
profile: {
|
|
profile: {
|
|
|
userPk: '',
|
|
userPk: '',
|
|
@@ -290,8 +331,28 @@ export default {
|
|
|
}],
|
|
}],
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ isEdit: false,
|
|
|
|
|
+ showTopup: false
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ mounted() {
|
|
|
|
|
+ this.getCountryList()
|
|
|
|
|
+ if (this.$route.params.id) {
|
|
|
|
|
+ this.isEdit = true;
|
|
|
|
|
+ this.getUserInfo()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.userModel.profile.hasAreaCode = true
|
|
|
|
|
+ this.userModel.vehicleList.push({
|
|
|
|
|
+ brand: '',
|
|
|
|
|
+ model: '',
|
|
|
|
|
+ licensePlate: '',
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ beforeRouteLeave(to, form, next) {
|
|
|
|
|
+ this.$store.commit('userManagement/RESET_SELECTED_USER')
|
|
|
|
|
+ next()
|
|
|
|
|
+ },
|
|
|
methods: {
|
|
methods: {
|
|
|
handleClickSubVehicleButton(vehicle, index) {
|
|
handleClickSubVehicleButton(vehicle, index) {
|
|
|
const callback = () => {
|
|
const callback = () => {
|
|
@@ -428,7 +489,7 @@ export default {
|
|
|
return phone
|
|
return phone
|
|
|
},*/
|
|
},*/
|
|
|
getUserInfo() {
|
|
getUserInfo() {
|
|
|
- getUser(this.selectedUser.userId)
|
|
|
|
|
|
|
+ getUser(this.$route.params.id)
|
|
|
.then(({ data }) => {
|
|
.then(({ data }) => {
|
|
|
const {
|
|
const {
|
|
|
userPk,
|
|
userPk,
|
|
@@ -442,10 +503,10 @@ export default {
|
|
|
} = data
|
|
} = data
|
|
|
this.userModel.profile.nickName = nickName
|
|
this.userModel.profile.nickName = nickName
|
|
|
this.userModel.profile.email = email
|
|
this.userModel.profile.email = email
|
|
|
- this.userModel.profile.areaCode = callingCode
|
|
|
|
|
|
|
+ this.userModel.profile.areaCode = callingCode + ""
|
|
|
this.userModel.profile.phoneNumber = phone //this.getPhoneNumber(phone)
|
|
this.userModel.profile.phoneNumber = phone //this.getPhoneNumber(phone)
|
|
|
this.userModel.profile.userPk = userPk
|
|
this.userModel.profile.userPk = userPk
|
|
|
-
|
|
|
|
|
|
|
+ this.userInfo = data;
|
|
|
const {
|
|
const {
|
|
|
street = '',
|
|
street = '',
|
|
|
zipCode = '',
|
|
zipCode = '',
|
|
@@ -476,12 +537,28 @@ export default {
|
|
|
|
|
|
|
|
this.userModel.ocppTagResponse = ocppTagResponse
|
|
this.userModel.ocppTagResponse = ocppTagResponse
|
|
|
})
|
|
})
|
|
|
|
|
+ },
|
|
|
|
|
+ showTopupModal() {
|
|
|
|
|
+ this.showTopup = true
|
|
|
|
|
+ },
|
|
|
|
|
+ hideTopupModal(success) {
|
|
|
|
|
+ this.showTopup = false;
|
|
|
|
|
+ if (success) {
|
|
|
|
|
+ this.getUserInfo()
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ toHistoryCharge() {
|
|
|
|
|
+ this.$router.push("/user-management/charging-history/" + this.$route.params.id)
|
|
|
|
|
+ },
|
|
|
|
|
+ toHistoryTopup() {
|
|
|
|
|
+ this.$router.push("/user-management/topup-history/" + this.$route.params.id)
|
|
|
}
|
|
}
|
|
|
- },
|
|
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang='scss'>
|
|
<style scoped lang='scss'>
|
|
|
|
|
+ @import '../../styles/element-ui.scss';
|
|
|
@import '../../styles/variables.scss';
|
|
@import '../../styles/variables.scss';
|
|
|
|
|
|
|
|
.view-container {
|
|
.view-container {
|
|
@@ -518,6 +595,11 @@ export default {
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
max-width: 300px;
|
|
max-width: 300px;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ .input-text-1 {
|
|
|
|
|
+ flex: 1;
|
|
|
|
|
+ margin-right: 10px;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
.area-code {
|
|
.area-code {
|
|
|
width: 75px;
|
|
width: 75px;
|
|
@@ -531,6 +613,7 @@ export default {
|
|
|
|
|
|
|
|
.vehicle-list-view-item {
|
|
.vehicle-list-view-item {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
|
|
+ flex-wrap: wrap;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -549,19 +632,14 @@ export default {
|
|
|
.cancel-button {
|
|
.cancel-button {
|
|
|
width: 94px;
|
|
width: 94px;
|
|
|
height: 40px;
|
|
height: 40px;
|
|
|
- color: #555;
|
|
|
|
|
- background: #FFFFFF;
|
|
|
|
|
- border: 1px solid #001489;
|
|
|
|
|
- box-sizing: border-box;
|
|
|
|
|
- border-radius: 4px;
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.confirm-button {
|
|
.confirm-button {
|
|
|
width: 94px;
|
|
width: 94px;
|
|
|
height: 40px;
|
|
height: 40px;
|
|
|
margin-left: 20px;
|
|
margin-left: 20px;
|
|
|
- background: #001489;
|
|
|
|
|
- border: 1px solid #001489;
|
|
|
|
|
|
|
+ background: $--color-primary;
|
|
|
|
|
+ border: 1px solid $--color-primary;
|
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
|
border-radius: 4px;
|
|
border-radius: 4px;
|
|
|
}
|
|
}
|