-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 新增客户信息
-
+
+ 新增客户信息
+
+
完善更多客户信息
@@ -127,13 +17,13 @@
用户选择
-
+
车辆选择
-
+
@@ -147,12 +37,6 @@
-
-
-
-
-
-
品牌车系
@@ -218,12 +102,6 @@
:label="item.bookingTime"/>
-
-
-
-
-
-
服务顾问
@@ -244,11 +122,6 @@
size="mini"
height="270"
style="width: 100%">
-
-
-
-
-
@@ -281,12 +154,6 @@
{{ parseTime(scope.row.endTime) }}
-
-
-
-
-
-
@@ -394,7 +261,7 @@
-
+
@@ -411,12 +278,15 @@ import TicketChoose from "@/views/repair/tickets/Components/TicketChoose.vue";
import request from "@/utils/request";
import * as CustomerMainApi from "@/api/base/customer";
import UserAndCarForm from "@/views/repair/tickets/form/UserAndCarForm.vue";
+import {getByNameAndMobile} from "@/api/base/customer";
+import {getByLicenseNumber} from "@/api/base/carmain";
export default {
name: "UserInfo",
components: {
UserAndCarForm,
- TicketChoose, QualityExplain, RepairAdvice, CarChoose, TicketItem, StaffChoose, UserChoose},
+ TicketChoose, QualityExplain, RepairAdvice, CarChoose, TicketItem, StaffChoose, UserChoose
+ },
props: {
createTicketType: {
type: Boolean,
@@ -426,14 +296,16 @@ export default {
watch: {
selectUser(val) {
if (val) {
- this.selectCar = {}
- this.bookingList = []
- this.couponList = []
- if (val.userId) {
- this.getBooking(val.userId)
- }
- if (val.id) {
- this.getCouponList(val.id)
+ if (!val.isRes) {
+ this.selectCar = {}
+ this.bookingList = []
+ this.couponList = []
+ if (val.userId) {
+ this.getBooking(val.userId)
+ }
+ if (val.id) {
+ this.getCouponList(val.id)
+ }
}
} else {
this.selectCar = {}
@@ -496,7 +368,9 @@ export default {
otherList: [],
bookingList: [],
couponList: [],
- finaCouponList: []
+ finaCouponList: [],
+ userInData: null,
+ carInData: null,
}
},
methods: {
@@ -747,7 +621,6 @@ export default {
item.bookingTime = this.parseTime(item.bookingTime, '{y}-{m}-{d} {h}:{m}')
})
}
- // console.log(this.bookingList,723)
},
// 权益更改
changeCoupon(data) {
@@ -758,21 +631,39 @@ export default {
this.couponList = this.finaCouponList.filter(item => !item.isChoose)
},
// 新增客户信息
- updateUserInfo(flag){
+ updateUserInfo(flag) {
const data = {}
- if (flag){
- if (this.selectUser){
+ if (flag) {
+ if (this.selectUser) {
data.userInfo = this.selectUser
}
- if (this.selectCar){
+ if (this.selectCar) {
data.carInfo = this.selectCar
}
}
this.$refs.userAndCarInfo.open(data)
},
// 新增客户信息回调
- successCreateUserInfo(){
-
+ async successCusAndCar(data) {
+ const cus = {
+ cusName: data.userInfo.cusName,
+ phoneNumber: data.userInfo.phoneNumber
+ }
+ const car = {
+ licenseNumber: data.carInfo.licenseNumber
+ }
+ // 查客户
+ const cusRes = await getByNameAndMobile(cus)
+ this.userInData = {
+ ...cusRes.data,
+ isRes: true
+ }
+ // 查车辆
+ const carRes = await getByLicenseNumber(car)
+ this.carInData = {
+ ...carRes.data,
+ brandAndModel: car.data.carInfo.brandAndModel
+ }
}
// // 权益选择
// handleSelectionChange(val){
diff --git a/src/views/repair/tickets/form/UserAndCarForm.vue b/src/views/repair/tickets/form/UserAndCarForm.vue
index 869333e..d9738f4 100644
--- a/src/views/repair/tickets/form/UserAndCarForm.vue
+++ b/src/views/repair/tickets/form/UserAndCarForm.vue
@@ -244,6 +244,9 @@