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"
>
<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] : '/'
}}</span>
</template>
@ -1886,14 +1886,44 @@ const soclear=()=>{
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 = () => {
if(multifunctional.value){
scrollToElementWithPartialId(multifunctional.value)
}else{
document.querySelectorAll('[id]').forEach(function(el) {
el.style.backgroundColor = ''; //
el.style.color = ''; //
});
}
return
if(multifunctional.value){
document.getElementById(multifunctional.value).scrollIntoView()
}
return
console.log(soInpuState.value, '当前搜索状态');
if (!multifunctional.value && !dataInfoTemp.value.length) {
soInpuState.value = false; //
ElMessage({
@ -3050,7 +3080,12 @@ const SubmitCommercial = () => {
width: 100px;
}
}
.static-class {
background-color: seagreen;
padding: 0 4px;
scroll-behavior: smooth;
background-color: #ff0000;
color: #fff;
}
</style>

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

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

Loading…
Cancel
Save