Commit 1598a7eabdd83a0247960f6d20585a0c2f395eb7
Merge branch 'warning' of http://39.108.227.113:8001/zhusen/canrd-erp-front into warning
Showing
1 changed file
with
9 additions
and
5 deletions
src/pages/Order/OrderWarning/index.tsx
@@ -192,7 +192,9 @@ const OrderPage = () => { | @@ -192,7 +192,9 @@ const OrderPage = () => { | ||
192 | const [subOrderCount, setSubOrderCount] = useState(0); | 192 | const [subOrderCount, setSubOrderCount] = useState(0); |
193 | const [sorted] = useState(false); | 193 | const [sorted] = useState(false); |
194 | const mainTableRef = useRef<ActionType>(); | 194 | const mainTableRef = useRef<ActionType>(); |
195 | + const mainTableSecondRef = useRef<ActionType>(); | ||
195 | const mainTableFormRef = useRef<ProFormInstance>(); | 196 | const mainTableFormRef = useRef<ProFormInstance>(); |
197 | + const mainTableSecondFormRef = useRef<ProFormInstance>(); | ||
196 | let [searchParams, setSearchParam] = useState(Object); //表格的查询条件存储 | 198 | let [searchParams, setSearchParam] = useState(Object); //表格的查询条件存储 |
197 | console.log(searchParams); | 199 | console.log(searchParams); |
198 | const [messageApi, contextHolder] = message.useMessage(); | 200 | const [messageApi, contextHolder] = message.useMessage(); |
@@ -4211,7 +4213,8 @@ const OrderPage = () => { | @@ -4211,7 +4213,8 @@ const OrderPage = () => { | ||
4211 | // 监听 calDate 变化,触发请求 | 4213 | // 监听 calDate 变化,触发请求 |
4212 | useEffect(() => { | 4214 | useEffect(() => { |
4213 | if (calDate2) { | 4215 | if (calDate2) { |
4214 | - mainTableRef.current?.reload(); | 4216 | + // mainTableRef.current?.reload(); |
4217 | + mainTableSecondRef.current?.reload(); | ||
4215 | } | 4218 | } |
4216 | }, [calDate2]); | 4219 | }, [calDate2]); |
4217 | 4220 | ||
@@ -4235,8 +4238,9 @@ const OrderPage = () => { | @@ -4235,8 +4238,9 @@ const OrderPage = () => { | ||
4235 | * 以params中的id为主,如果params没id,则取url中的id | 4238 | * 以params中的id为主,如果params没id,则取url中的id |
4236 | * 第一次进来这个页面,url带有id的话,会自动填充到查询表单中,但是第一次查询params不会带这个id进来 | 4239 | * 第一次进来这个页面,url带有id的话,会自动填充到查询表单中,但是第一次查询params不会带这个id进来 |
4237 | */ | 4240 | */ |
4238 | - let orderIds = mainTableFormRef.current?.getFieldValue('id'); | ||
4239 | - let subOrderId = mainTableFormRef.current?.getFieldValue('subOrderId'); | 4241 | + let orderIds = mainTableSecondFormRef.current?.getFieldValue('id'); |
4242 | + let subOrderId = | ||
4243 | + mainTableSecondFormRef.current?.getFieldValue('subOrderId'); | ||
4240 | params.id = params.id || orderIds; | 4244 | params.id = params.id || orderIds; |
4241 | params.subOrderId = params.subOrderId || subOrderId; | 4245 | params.subOrderId = params.subOrderId || subOrderId; |
4242 | if (params.id !== '') { | 4246 | if (params.id !== '') { |
@@ -4920,8 +4924,8 @@ const OrderPage = () => { | @@ -4920,8 +4924,8 @@ const OrderPage = () => { | ||
4920 | id="main-table" | 4924 | id="main-table" |
4921 | // tableStyle={{backgroundColor:'red'}} | 4925 | // tableStyle={{backgroundColor:'red'}} |
4922 | 4926 | ||
4923 | - actionRef={mainTableRef} | ||
4924 | - formRef={mainTableFormRef} | 4927 | + actionRef={mainTableSecondRef} |
4928 | + formRef={mainTableSecondFormRef} | ||
4925 | expandIconColumnIndex={-1} | 4929 | expandIconColumnIndex={-1} |
4926 | columns={mainOrdersColumns} | 4930 | columns={mainOrdersColumns} |
4927 | rowKey="id" | 4931 | rowKey="id" |