添加车辆优化
This commit is contained in:
parent
c03f00cf94
commit
e99495791d
@ -644,9 +644,35 @@ export default {
|
||||
* 添加车辆和客户信息
|
||||
*/
|
||||
addCarUserInfo(){
|
||||
uni.navigateTo({
|
||||
url: `/pages/myCar/addCarUser`
|
||||
})
|
||||
if(this.userInfo){
|
||||
//已查出客户信息
|
||||
uni.navigateTo({
|
||||
url: '/pages/myCar/addCarUser?userInfo='+JSON.stringify(this.userInfo)
|
||||
})
|
||||
}else if(this.phone != ''){
|
||||
//输入了内容
|
||||
const params = {
|
||||
phoneOrCar: this.phone
|
||||
}
|
||||
request({
|
||||
url: '/admin-api/base/custom/page',
|
||||
method: 'GET',
|
||||
params: params
|
||||
}).then(res => {
|
||||
if (res.data.records.length > 0) {
|
||||
this.userInfo = res.data.records[0]
|
||||
//跳转添加客户车辆信息页
|
||||
uni.navigateTo({
|
||||
url: '/pages/myCar/addCarUser?userInfo='+JSON.stringify(this.userInfo)
|
||||
})
|
||||
}
|
||||
})
|
||||
}else{
|
||||
//没输入,直接加
|
||||
uni.navigateTo({
|
||||
url: `/pages/myCar/addCarUser`
|
||||
})
|
||||
}
|
||||
},
|
||||
editUserInfo(userInfo) {
|
||||
if (this.phone == '') return uni.showToast({
|
||||
|
@ -202,8 +202,15 @@ export default {
|
||||
natureIndex: 0,
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
onLoad(data) {
|
||||
// 没有数据 需要赋值一下初始化
|
||||
if(data && data.hasOwnProperty("userInfo")){
|
||||
let thisUserInfoObj = JSON.parse(data.userInfo)
|
||||
console.log("thisUserInfoObj",thisUserInfoObj)
|
||||
this.userInfo.cusName = thisUserInfoObj.cusName
|
||||
this.userInfo.sex = thisUserInfoObj.sex
|
||||
this.userInfo.phoneNumber = thisUserInfoObj.phoneNumber
|
||||
}
|
||||
this.bo1 = false;
|
||||
this.bo2 = true;
|
||||
this.pageTitle = '添加车辆信息'
|
||||
|
Loading…
Reference in New Issue
Block a user