fix:【antd】【erp 系统】tableData.value.findIndex((item) => item.id === row.id) 不正确的问题,使用 seq 比对
This commit is contained in:
@@ -71,7 +71,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
autoResize: true,
|
||||
border: true,
|
||||
rowConfig: {
|
||||
keyField: 'row_id',
|
||||
keyField: 'seq',
|
||||
isHover: true,
|
||||
},
|
||||
pagerConfig: {
|
||||
@@ -131,7 +131,7 @@ watch(
|
||||
|
||||
/** 处理删除 */
|
||||
function handleDelete(row: ErpPurchaseInApi.PurchaseInItem) {
|
||||
const index = tableData.value.findIndex((item) => item.id === row.id);
|
||||
const index = tableData.value.findIndex((item) => item.seq === row.seq);
|
||||
if (index !== -1) {
|
||||
tableData.value.splice(index, 1);
|
||||
}
|
||||
@@ -151,7 +151,7 @@ const handleWarehouseChange = async (row: ErpPurchaseInApi.PurchaseInItem) => {
|
||||
|
||||
/** 处理行数据变更 */
|
||||
function handleRowChange(row: any) {
|
||||
const index = tableData.value.findIndex((item) => item.id === row.id);
|
||||
const index = tableData.value.findIndex((item) => item.seq === row.seq);
|
||||
if (index === -1) {
|
||||
tableData.value.push(row);
|
||||
} else {
|
||||
|
||||
@@ -67,7 +67,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
autoResize: true,
|
||||
border: true,
|
||||
rowConfig: {
|
||||
keyField: 'row_id',
|
||||
keyField: 'seq',
|
||||
isHover: true,
|
||||
},
|
||||
pagerConfig: {
|
||||
@@ -142,7 +142,7 @@ function handleAdd() {
|
||||
|
||||
/** 处理删除 */
|
||||
function handleDelete(row: ErpPurchaseOrderApi.PurchaseOrderItem) {
|
||||
const index = tableData.value.findIndex((item) => item.id === row.id);
|
||||
const index = tableData.value.findIndex((item) => item.seq === row.seq);
|
||||
if (index !== -1) {
|
||||
tableData.value.splice(index, 1);
|
||||
}
|
||||
@@ -169,7 +169,7 @@ async function handleProductChange(productId: any, row: any) {
|
||||
|
||||
/** 处理行数据变更 */
|
||||
function handleRowChange(row: any) {
|
||||
const index = tableData.value.findIndex((item) => item.id === row.id);
|
||||
const index = tableData.value.findIndex((item) => item.seq === row.seq);
|
||||
if (index === -1) {
|
||||
tableData.value.push(row);
|
||||
} else {
|
||||
|
||||
@@ -71,7 +71,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
autoResize: true,
|
||||
border: true,
|
||||
rowConfig: {
|
||||
keyField: 'row_id',
|
||||
keyField: 'seq',
|
||||
isHover: true,
|
||||
},
|
||||
pagerConfig: {
|
||||
@@ -131,7 +131,7 @@ watch(
|
||||
|
||||
/** 处理删除 */
|
||||
function handleDelete(row: ErpPurchaseReturnApi.PurchaseReturnItem) {
|
||||
const index = tableData.value.findIndex((item) => item.id === row.id);
|
||||
const index = tableData.value.findIndex((item) => item.seq === row.seq);
|
||||
if (index !== -1) {
|
||||
tableData.value.splice(index, 1);
|
||||
}
|
||||
@@ -153,7 +153,7 @@ const handleWarehouseChange = async (
|
||||
|
||||
/** 处理行数据变更 */
|
||||
function handleRowChange(row: any) {
|
||||
const index = tableData.value.findIndex((item) => item.id === row.id);
|
||||
const index = tableData.value.findIndex((item) => item.seq === row.seq);
|
||||
if (index === -1) {
|
||||
tableData.value.push(row);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user