token问题使用sotorage方式存储和读取
This commit is contained in:
@ -101,12 +101,9 @@ export default {
|
||||
},
|
||||
methods:{
|
||||
isUse(e){
|
||||
console.log("是否启用",e)
|
||||
this.states=e
|
||||
},
|
||||
async submitBtn(){
|
||||
this.$toast(1111)
|
||||
try {
|
||||
let res = await saveDriver({
|
||||
driverId:this.id ? this.id : '',
|
||||
driverName:this.driverName ,
|
||||
@ -127,16 +124,12 @@ export default {
|
||||
this.$router.back();
|
||||
},2000)
|
||||
}
|
||||
}catch (e){
|
||||
this.$toast(JSON.stringify(e), "eeeeeeee")
|
||||
}
|
||||
},
|
||||
cancelBtn(){//取消
|
||||
this.$router.back()
|
||||
},
|
||||
validatePhoneNumber() {
|
||||
const phoneNumberRegex = /^1[0-9]{10}$/;
|
||||
|
||||
if (!phoneNumberRegex.test(this.driverPhone)) {
|
||||
this.phoneNumberError = true;
|
||||
this.phoneNumberErrorMessage = '电话号码格式不正确,请输入有效的11位手机号码。';
|
||||
|
@ -98,7 +98,7 @@ export default {
|
||||
await this.getDriverList();
|
||||
setTimeout(()=>{
|
||||
this.$toast('操作成功')
|
||||
},)
|
||||
},2000)
|
||||
console.log("item",res)
|
||||
},
|
||||
updateDriver(item){
|
||||
@ -120,7 +120,6 @@ export default {
|
||||
if(num <= this.pageNum){
|
||||
// console.log("不在加载数据")
|
||||
}else{
|
||||
console.log("111111111111")
|
||||
this.pageNum++;
|
||||
await this.getDriverList()
|
||||
}
|
||||
|
@ -12,7 +12,7 @@
|
||||
/>
|
||||
</div>
|
||||
<div class="addContentWrap">
|
||||
<cell-group label="车牌号" placeholder="请输入车牌号" @input="getPLateNum(carNum)" v-model="carNum" />
|
||||
<cell-group label="车牌号" placeholder="请输入车牌号" v-model="carNum" />
|
||||
<div class="itemContent">
|
||||
<div class="titleType">
|
||||
<img class="startImg" src="@/assets/start.png" />
|
||||
@ -182,29 +182,18 @@ export default {
|
||||
}
|
||||
},
|
||||
change(e) {
|
||||
// console.log("拖车服务",e)
|
||||
this.trailerService=e
|
||||
},
|
||||
change2(e) {
|
||||
// console.log("小修服务",e)
|
||||
this.smallRepairService=e
|
||||
},
|
||||
isChange(e){
|
||||
// console.log("是否参与",e)
|
||||
this.isJoin=e
|
||||
},
|
||||
cancelBtn(){//取消车辆
|
||||
this.$router.back()
|
||||
},
|
||||
async submitBtn(){
|
||||
this.$toast(JSON.stringify({
|
||||
vehicleId:this.id ? this.id : '',
|
||||
plateNumber:this.carNum ? this.carNum :'',
|
||||
vehicleType:this.selectedOption ? this.selectedOption : '',
|
||||
hasPolymerization:Number(this.isJoin ? this.isJoin : '') ,
|
||||
serviceIds:this.serviceIds ? this.serviceIds : []
|
||||
}))
|
||||
console.log("提交车辆");
|
||||
let res=await saveVehicle({
|
||||
vehicleId:this.id ? this.id : '',
|
||||
plateNumber:this.carNum ? this.carNum :'',
|
||||
@ -219,17 +208,10 @@ export default {
|
||||
}else{
|
||||
this.$toast('添加成功')
|
||||
}
|
||||
|
||||
setTimeout(()=>{
|
||||
this.$router.back();
|
||||
},2000)
|
||||
}else{
|
||||
this.$toast(res.msg)
|
||||
}
|
||||
console.log("res",res)
|
||||
},
|
||||
getPLateNum(e){
|
||||
console.log("e",e)
|
||||
},
|
||||
},
|
||||
components:{
|
||||
|
@ -53,25 +53,13 @@ export default {
|
||||
pageSize:10,
|
||||
total:'',
|
||||
loading:false,
|
||||
items: [], // 当前页数
|
||||
token:'',
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// this.$toast('window.location'+window.location)
|
||||
this.getVehicleList();
|
||||
},
|
||||
methods:{
|
||||
updateVehicle(item){
|
||||
this.$router.push({
|
||||
name:'vehicleAdd',
|
||||
params:{
|
||||
// token:this.token,
|
||||
id:item.vehicleId
|
||||
}
|
||||
})
|
||||
},
|
||||
async getVehicleList(){
|
||||
async getVehicleList(){
|
||||
let result = await supplierVehicleList({
|
||||
pageNum:this.pageNum,
|
||||
pageSize:this.pageSize
|
||||
@ -98,10 +86,16 @@ export default {
|
||||
if(result.code === 200){
|
||||
this.$toast('删除成功');
|
||||
await this.getVehicleList();
|
||||
}else{
|
||||
this.$toast(result.msg)
|
||||
}
|
||||
},
|
||||
updateVehicle(item){//修改
|
||||
this.$router.push({
|
||||
name:'vehicleAdd',
|
||||
params:{
|
||||
id:item.vehicleId
|
||||
}
|
||||
})
|
||||
},
|
||||
async handleScroll(){
|
||||
let num = Math.ceil( this.total / 10)
|
||||
if(num <= this.pageNum){
|
||||
@ -109,7 +103,6 @@ export default {
|
||||
}else{
|
||||
this.pageNum++;
|
||||
await this.getVehicleList()
|
||||
// console.log("111111111111")
|
||||
}
|
||||
},
|
||||
|
||||
|
Reference in New Issue
Block a user