|
@@ -118,6 +118,7 @@
|
|
|
const showCustomerPreview = ref(false)
|
|
const showCustomerPreview = ref(false)
|
|
|
const modalType = ref('')
|
|
const modalType = ref('')
|
|
|
const allData = ref([])
|
|
const allData = ref([])
|
|
|
|
|
+ const filterData = ref()
|
|
|
const open = (type, data) => {
|
|
const open = (type, data) => {
|
|
|
customers.value = []
|
|
customers.value = []
|
|
|
total.value = 0
|
|
total.value = 0
|
|
@@ -134,6 +135,7 @@
|
|
|
liaisonName: ''
|
|
liaisonName: ''
|
|
|
}
|
|
}
|
|
|
if(type == 'detail'){
|
|
if(type == 'detail'){
|
|
|
|
|
+ filterData.value = data
|
|
|
allData.value = data
|
|
allData.value = data
|
|
|
customers.value = data.slice(0, 10)
|
|
customers.value = data.slice(0, 10)
|
|
|
total.value = data.length
|
|
total.value = data.length
|
|
@@ -169,7 +171,7 @@
|
|
|
if(modalType.value == 'add'){
|
|
if(modalType.value == 'add'){
|
|
|
getCustomerData()
|
|
getCustomerData()
|
|
|
}else{
|
|
}else{
|
|
|
- customers.value = allData.value.slice((page - 1) * customerParams.value.pageSize, page * customerParams.value.pageSize)
|
|
|
|
|
|
|
+ customers.value = filterData.value.slice((page - 1) * customerParams.value.pageSize, page * customerParams.value.pageSize)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -178,8 +180,8 @@
|
|
|
customerParams.value.pageIndex = 1
|
|
customerParams.value.pageIndex = 1
|
|
|
getCustomerData()
|
|
getCustomerData()
|
|
|
}else{
|
|
}else{
|
|
|
- const filterData = allData.value.filter(item => {
|
|
|
|
|
- const blurryMatch = customerParams.value.blurry ? (item.customerName.includes(customerParams.value.blurry) || item.company.includes(customerParams.value.blurry) || item.email.includes(customerParams.value.blurry)) : true
|
|
|
|
|
|
|
+ filterData.value = allData.value.filter(item => {
|
|
|
|
|
+ const blurryMatch = customerParams.value.blurry ? (item.customerName.includes(customerParams.value.blurry)) : true
|
|
|
const liaisonMatch = customerParams.value.liaisonName ? (item.liaisonName && item.liaisonName.includes(customerParams.value.liaisonName)) : true
|
|
const liaisonMatch = customerParams.value.liaisonName ? (item.liaisonName && item.liaisonName.includes(customerParams.value.liaisonName)) : true
|
|
|
const statusMatch = customerParams.value.customerStatusDictValue ? (item.customerStatusDictValue == customerParams.value.customerStatusDictValue) : true
|
|
const statusMatch = customerParams.value.customerStatusDictValue ? (item.customerStatusDictValue == customerParams.value.customerStatusDictValue) : true
|
|
|
const typeMatch = customerParams.value.customerTypeDictValue ? (item.customerTypeDictValue == customerParams.value.customerTypeDictValue) : true
|
|
const typeMatch = customerParams.value.customerTypeDictValue ? (item.customerTypeDictValue == customerParams.value.customerTypeDictValue) : true
|
|
@@ -187,8 +189,8 @@
|
|
|
const countryMatch = customerParams.value.country ? (item.country == customerParams.value.country) : true
|
|
const countryMatch = customerParams.value.country ? (item.country == customerParams.value.country) : true
|
|
|
return blurryMatch && liaisonMatch && statusMatch && typeMatch && levelMatch && countryMatch
|
|
return blurryMatch && liaisonMatch && statusMatch && typeMatch && levelMatch && countryMatch
|
|
|
})
|
|
})
|
|
|
- customers.value = filterData.slice(0, 10)
|
|
|
|
|
- total.value = filterData.length
|
|
|
|
|
|
|
+ customers.value = filterData.value.slice(0, 10)
|
|
|
|
|
+ total.value = filterData.value.length
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|