Commit 5432ea82 authored by TZW's avatar TZW

111

parent d80e190e
import * as React from 'react';
import { useState, useMemo, useRef } from 'react';
import { useState, useMemo, useRef, useEffect } from 'react';
import DrawerPro from '@/components/DrawerPro';
import AutoTable from '@/components/AutoTable';
import PremButton from '@/components/PremButton';
......@@ -32,7 +32,6 @@ function Outstore(props) {
}
},
});
const detail = (text, row, _, action) => {
return (
<PremButton
......@@ -230,7 +229,7 @@ function Outstore(props) {
},
]}
pagetitle="备件信息"
dataSource={drawer?.submitdata}
dataSource={drawer?.submitdata || []}
expandable={{
expandedRowRender: (record) => {
return (
......@@ -275,22 +274,26 @@ function Outstore(props) {
preserveSelectedRowKeys: true,
selectedRowKeys:
value && value.length > 0
? value?.filter?.((it) => it?.id == record.id)[0]
? value
?.filter?.((it) => it?.id == record.id)[0]
?.taskSpareSupplierList?.map?.((it) => it?.spareSupplierStockId)
: []
: [],
onChange: (selectedKeys, selectedRows) => {
// debugger;
const curval =
value?.filter?.((it) => it?.id == record.id)[0]
?.taskSpareSupplierList ?? [];
const rowkeylist = curval
const rowkeylist =
curval && curval.length > 0
? curval?.map((it) => it?.spareSupplierStockId)
: [];
const newValue = selectedRows?.map((its) => {
if (rowkeylist.includes(its?.id)) {
return curval.filter(
if (rowkeylist?.includes(its?.id)) {
return curval?.filter(
(it) => it?.spareSupplierStockId == its?.id,
)[0];
} else {
......@@ -310,11 +313,10 @@ function Outstore(props) {
});
} else {
nvalue.push({
id: record.id,
id: record?.id,
taskSpareSupplierList: newValue,
});
}
setvalue(nvalue);
},
}}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment