上面是一个输入框。 触发粘贴事件之后。 对应的行会选中
<
td
><
input
type=
"checkBox" (
click)=
"setRowEditAble(item)" [(
ngModel)]=
"item.checked"
/></
td
>
inputpaste(e
:
any) {
const
value
=
e.
clipboardData.
getData(
'text/plain');
this.
matchMaterial(
value);
}
matchMaterial(value
:
string) {
if (
this.
handlingUnitMaterials) {
this.
handlingUnitMaterials.
forEach((item
:
any)
=> {
if (
item.
material
===
value) {
console.
log(
item);
item.checked
=
true;
this.
setRowEditAble(
item);
// item.disableRemovedQty = false;
// item.disableReason = false;
this.
clearSearch();
}
})
}
}
setRowEditAble(item
:
any) {
if (
item) {
// console.log(item);
item.
disableRemovedQty
=
!
item.
disableRemovedQty;
item.
disableReason
=
!
item.
disableReason;
if (
item.
disableRemovedQty) {
item.
removedQty
=
0;
}
else {
item.
removedQtyInvalid
=
true;
}
if (
item.
disableReason) {
item.
reason
=
'';
item.
removedQtyInvalid
=
false;
}
}
}