Browse Source

商品增加本地搜索

dev-xx
马远东 1 year ago
parent
commit
1d1f0fc86e
  1. 41
      src/views/distribution/turndelivery/deliveryDiscuss.vue
  2. 10
      src/views/warehouse/parcelList/distributionParcelList.vue

41
src/views/distribution/turndelivery/deliveryDiscuss.vue

@ -320,7 +320,7 @@
align="center" align="center"
> >
<template #default="props"> <template #default="props">
<span :id="props.row[item.prop]" :class="props.row[item.prop] == 'state' ? '.static-class' : ''">{{ <span :id="props.row[item.prop]" :class="props.row[item.prop] == multifunctional ? 'static-class' : ''">{{
props.row[item.prop] ? props.row[item.prop] : '/' props.row[item.prop] ? props.row[item.prop] : '/'
}}</span> }}</span>
</template> </template>
@ -1886,14 +1886,44 @@ const soclear=()=>{
SearchFu() SearchFu()
} }
function scrollToElementWithPartialId(partialId) {
//
document.querySelectorAll('[id]').forEach(function(el) {
el.style.backgroundColor = ''; //
el.style.color = ''; //
});
// partialId
const allElements = document.querySelectorAll(`[id*="${partialId}"]`);
if (allElements.length > 0) {
//
const targetElement = allElements[0];
//
targetElement.style.backgroundColor = '#ff0000'; //
targetElement.style.color = '#fff'; //
//
targetElement.scrollIntoView();
}
}
// //
const SearchFu = () => { const SearchFu = () => {
if(multifunctional.value){
scrollToElementWithPartialId(multifunctional.value)
}else{
document.querySelectorAll('[id]').forEach(function(el) {
el.style.backgroundColor = ''; //
el.style.color = ''; //
});
}
return
if(multifunctional.value){ if(multifunctional.value){
document.getElementById(multifunctional.value).scrollIntoView() document.getElementById(multifunctional.value).scrollIntoView()
} }
return return
console.log(soInpuState.value, '当前搜索状态'); console.log(soInpuState.value, '当前搜索状态');
if (!multifunctional.value && !dataInfoTemp.value.length) { if (!multifunctional.value && !dataInfoTemp.value.length) {
soInpuState.value = false; // soInpuState.value = false; //
ElMessage({ ElMessage({
@ -3050,7 +3080,12 @@ const SubmitCommercial = () => {
width: 100px; width: 100px;
} }
} }
.static-class { .static-class {
background-color: seagreen; padding: 0 4px;
scroll-behavior: smooth;
background-color: #ff0000;
color: #fff;
} }
</style> </style>

10
src/views/warehouse/parcelList/distributionParcelList.vue

@ -450,10 +450,14 @@ export default {
sortable: true, sortable: true,
}, },
{ {
label: '配送车牌',
prop: 'dvehicleName', prop: 'dvehicleName',
display: false, label: '配送车牌',
hide: true, type: 2,
values: '',
width: '130',
checkarr: [],
fixed: false,
sortable: true,
}, },
{ {
prop: 'firsts', prop: 'firsts',

Loading…
Cancel
Save