Compare commits
No commits in common. "2a0c04175da929dffb1319e8261d6181f4f8e52a" and "0466a707393bbb2e0253e511fda8955de6cbba3f" have entirely different histories.
2a0c04175d
...
0466a70739
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-select v-model="userSelected" clearable filterable :filter-method="handleQuery">
|
<el-select v-model="userSelected" clearable filterable >
|
||||||
<el-option v-for="user in userList" :key="user.id" :label="user.cusName + ' ' + user.phoneNumber" :value="user.id"/>
|
<el-option v-for="user in userList" :key="user.id" :label="user.cusName + ' ' + user.phoneNumber" :value="user.id" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -10,11 +10,11 @@ import {getCustomerMainPage} from "@/api/base/customer";
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "UserChoose",
|
name: "UserChoose",
|
||||||
props: {
|
props:{
|
||||||
value: {
|
value:{
|
||||||
type: Object,
|
type: Object,
|
||||||
},
|
},
|
||||||
inList: {
|
inList:{
|
||||||
type: Object,
|
type: Object,
|
||||||
default: null,
|
default: null,
|
||||||
required: false
|
required: false
|
||||||
@ -24,30 +24,28 @@ export default {
|
|||||||
return {
|
return {
|
||||||
userList: [],
|
userList: [],
|
||||||
userSelected: undefined,
|
userSelected: undefined,
|
||||||
queryParams: {
|
queryParams:{
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 10,
|
pageSize: 10
|
||||||
cusName: null,
|
|
||||||
phoneNumber: null,
|
|
||||||
},
|
},
|
||||||
total: 0
|
total: 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch:{
|
||||||
userSelected(val) {
|
userSelected(val){
|
||||||
if (val) {
|
if (val){
|
||||||
const user = this.userList.find(item => item.id === val)
|
const user = this.userList.find(item => item.id === val)
|
||||||
this.$emit("input", user)
|
this.$emit("input", user)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
value(val) {
|
value(val){
|
||||||
this.userSelected = val ? val.id : null
|
this.userSelected = val ? val.id : null
|
||||||
},
|
},
|
||||||
inList(val) {
|
inList(val){
|
||||||
if (val) {
|
if (val){
|
||||||
// 不存在才添加
|
// 不存在才添加
|
||||||
const flag = this.userList.findIndex(item => item.id === val.id)
|
const flag = this.userList.findIndex(item => item.id === val.id)
|
||||||
if (flag > 0) {
|
if (flag > 0){
|
||||||
this.userList.splice(flag, 1)
|
this.userList.splice(flag, 1)
|
||||||
}
|
}
|
||||||
this.userList.unshift(val)
|
this.userList.unshift(val)
|
||||||
@ -59,18 +57,10 @@ export default {
|
|||||||
this.listCustomer()
|
this.listCustomer()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async listCustomer() {
|
async listCustomer(){
|
||||||
const res = await getCustomerMainPage(this.queryParams)
|
const res = await getCustomerMainPage(this.queryParams)
|
||||||
this.userList = res.data.records
|
this.userList = res.data.records
|
||||||
this.total = res.data.total
|
this.total = res.data.total
|
||||||
},
|
|
||||||
handleQuery(data) {
|
|
||||||
if (/^\d+$/.test(data)) {
|
|
||||||
this.queryParams.phoneNumber = data
|
|
||||||
} else {
|
|
||||||
this.queryParams.cusName = data
|
|
||||||
}
|
|
||||||
this.listCustomer()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -77,9 +77,6 @@
|
|||||||
v-if="(userRole === 'repair_staff' ? (leader ? !isFinish : false) : false) && !(scope.row.ticketsWorkStatus !== '01' && userRole === 'repair_staff' && !isFinish)">
|
v-if="(userRole === 'repair_staff' ? (leader ? !isFinish : false) : false) && !(scope.row.ticketsWorkStatus !== '01' && userRole === 'repair_staff' && !isFinish)">
|
||||||
重新指派
|
重新指派
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-if="userRole === 'repair_staff' && !isFinish && scope.row.ticketsWorkStatus === '01' && !(nowUser.id === scope.row.nowRepairId)" @click="handleGet(scope.row)" size="mini" type="text" icon="el-icon-document-add">
|
|
||||||
申请配件
|
|
||||||
</el-button>
|
|
||||||
<el-dropdown
|
<el-dropdown
|
||||||
v-if="(scope.row.ticketsWorkStatus !== '01' && ((userRole === 'service_advisor' || userRole === 'general_inspection') && !isFinish)) || (userRole === 'repair_staff' && !isFinish && scope.row.ticketsWorkStatus !== '01')"
|
v-if="(scope.row.ticketsWorkStatus !== '01' && ((userRole === 'service_advisor' || userRole === 'general_inspection') && !isFinish)) || (userRole === 'repair_staff' && !isFinish && scope.row.ticketsWorkStatus !== '01')"
|
||||||
@command="(command) => handleCommand(command, scope.$index, scope.row)">
|
@command="(command) => handleCommand(command, scope.$index, scope.row)">
|
||||||
|
@ -308,10 +308,7 @@ export default {
|
|||||||
formRules: {
|
formRules: {
|
||||||
'userInfo.cusName':[{required: true, message: "客户名称不能为空", trigger: 'blur'}],
|
'userInfo.cusName':[{required: true, message: "客户名称不能为空", trigger: 'blur'}],
|
||||||
'userInfo.phoneNumber': [{required: true, message: "联系方式不能为空", trigger: 'blur'}],
|
'userInfo.phoneNumber': [{required: true, message: "联系方式不能为空", trigger: 'blur'}],
|
||||||
'carInfo.licenseNumber': [{required: true, message: "车牌号不能为空", trigger: 'blur'}],
|
'carInfo.licenseNumber': [{required: true, message: "车牌号不能为空", trigger: 'blur'}]
|
||||||
'carInfo.brandAndModel': [{required: true, message: "品牌型号不能为空", trigger: 'blur'}],
|
|
||||||
'carInfo.carCategory': [{required: true, message: '车辆类别不能为空', trigger: 'blur'}],
|
|
||||||
'carInfo.carNature': [{required: true, message: '车辆性质不能为空', trigger: 'blur'}]
|
|
||||||
},
|
},
|
||||||
formLoading: false,
|
formLoading: false,
|
||||||
//折叠面板默认展开
|
//折叠面板默认展开
|
||||||
@ -372,11 +369,9 @@ export default {
|
|||||||
await updateCustomerAndCar(this.formData)
|
await updateCustomerAndCar(this.formData)
|
||||||
this.$modal.msgSuccess(this.formData?.userInfo?.id ? "修改成功" : "新增成功")
|
this.$modal.msgSuccess(this.formData?.userInfo?.id ? "修改成功" : "新增成功")
|
||||||
this.$emit("success", this.formData)
|
this.$emit("success", this.formData)
|
||||||
|
}finally {
|
||||||
this.formLoading = false
|
this.formLoading = false
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
}catch {}
|
|
||||||
finally {
|
|
||||||
this.formLoading = false
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
reset(){
|
reset(){
|
||||||
|
Loading…
Reference in New Issue
Block a user