diff --git a/src/api/base/carmain/index.js b/src/api/base/carmain/index.js index 11ccaab..7ee64df 100644 --- a/src/api/base/carmain/index.js +++ b/src/api/base/carmain/index.js @@ -87,4 +87,13 @@ export function exportCarMainExcel(params) { }) } +// 根据车牌查单条记录 +export function getByLicenseNumber(data){ + return request({ + url: "/base/carMain/getByLicenseNumber", + method: 'post', + data + }) +} + diff --git a/src/api/base/customer/index.js b/src/api/base/customer/index.js index 711b32a..2c9d9ef 100644 --- a/src/api/base/customer/index.js +++ b/src/api/base/customer/index.js @@ -67,3 +67,12 @@ export function exportCustomerMainExcel(params) { responseType: 'blob' }) } + +// 根据姓名和电话查询单条记录 +export function getByNameAndMobile(data){ + return request({ + url: "/base/custom/getByNameAndMobile", + method: 'post', + data + }) +} diff --git a/src/api/company/staff/index.js b/src/api/company/staff/index.js index 4b66933..db55bd3 100644 --- a/src/api/company/staff/index.js +++ b/src/api/company/staff/index.js @@ -69,9 +69,9 @@ export function getLabels(){ } // 获取当前登录用户部门下的员工信息 -export function getStaffList(){ +export function getStaffList(query){ return request({ - url: '/company/staff/list', + url: '/company/staff/list' + (query ? '?query=' + query : ''), method: 'get' }) } diff --git a/src/api/repair/tickets/Tickets.js b/src/api/repair/tickets/Tickets.js index 354c526..4e46991 100644 --- a/src/api/repair/tickets/Tickets.js +++ b/src/api/repair/tickets/Tickets.js @@ -45,3 +45,12 @@ export function setTicketsPaid(data){ data }) } + +// 新增客户、车辆信息 +export function updateCustomerAndCar(data){ + return request({ + url: preUrl + "/updateUserAndCar", + method: "post", + data + }) +} diff --git a/src/views/repair/Components/CarChoose.vue b/src/views/repair/Components/CarChoose.vue index 0d83f5d..782c694 100644 --- a/src/views/repair/Components/CarChoose.vue +++ b/src/views/repair/Components/CarChoose.vue @@ -18,6 +18,11 @@ export default { }, cusName: { type: String, + }, + inList:{ + type: Object, + default: null, + required: false } }, watch: { @@ -35,6 +40,16 @@ export default { // this.carSelected = null this.getCarList() } + }, + inList(val){ + if (val){ + const flag = this.carList.findIndex(item => item.id === val.id) + if (flag > 0){ + this.carList.splice(flag, 1) + } + this.carList.unshift(val) + this.carSelected = val.id + } } }, data() { diff --git a/src/views/repair/Components/StaffChoose.vue b/src/views/repair/Components/StaffChoose.vue index 2f2092a..7f43a1f 100644 --- a/src/views/repair/Components/StaffChoose.vue +++ b/src/views/repair/Components/StaffChoose.vue @@ -1,5 +1,5 @@ @@ -24,7 +24,9 @@ export default { return { staffList: [], staffSelected: undefined, - hasRequest: false + hasRequest: false, + query: null, + selectLoading: false, } }, watch: { @@ -45,13 +47,19 @@ export default { }, methods: { async listStaff() { + this.selectLoading = true try { if (!this.isGet) return; - const res = await getStaffList() + const res = await getStaffList(this.query) this.staffList = res.data this.hasRequest = true - } catch { + } finally { + this.selectLoading = false } + }, + changeQuery(val){ + this.query = val + this.listStaff() } } } diff --git a/src/views/repair/Components/UserChoose.vue b/src/views/repair/Components/UserChoose.vue index 6a1b825..9223c73 100644 --- a/src/views/repair/Components/UserChoose.vue +++ b/src/views/repair/Components/UserChoose.vue @@ -13,6 +13,11 @@ export default { props:{ value:{ type: Object, + }, + inList:{ + type: Object, + default: null, + required: false } }, data() { @@ -35,6 +40,17 @@ export default { }, value(val){ this.userSelected = val ? val.id : null + }, + inList(val){ + if (val){ + // 不存在才添加 + const flag = this.userList.findIndex(item => item.id === val.id) + if (flag > 0){ + this.userList.splice(flag, 1) + } + this.userList.unshift(val) + this.userSelected = val.id + } } }, mounted() { diff --git a/src/views/repair/tickets/Components/UserInfo.vue b/src/views/repair/tickets/Components/UserInfo.vue index cb51559..5245a2a 100644 --- a/src/views/repair/tickets/Components/UserInfo.vue +++ b/src/views/repair/tickets/Components/UserInfo.vue @@ -1,125 +1,15 @@