表根据后端列表显示

发布于 2025-02-07 17:00:08 字数 1310 浏览 0 评论 0原文

后端有一个列表。传入列表是发票列表。我在2个不同的选项卡中显示这些发票,如付费和未付款。付费发票的“状态3”。付费发票的“状态6”。有时没有出色的发票。在这种情况下,我想删除未付费发票表,并用通知消息替换。

付款info.js

在这里您可以看到两个不同的选项卡

<TabPanel value={value} index={0} >
  <PaymentTable variant="edit" paymentList={paymentInfoData} value={value} collectionMethod={collectionMethod} />
  <div className={hiddenControlButtonClass}>
    <AS.Button variant="outlined" onClick={handlePayment}>
      Continue
    </AS.Button>
  </div>
</TabPanel>
<TabPanel value={value} index={1}>
  <PaymentTable variant="read" paymentList={paymentInfoData} value={value} />
</TabPanel>

payment-table.js

props.paymentlist.policyinstallmentdtolist =项目

if (props.value === 0 && item.status !== '3') { ... //unpaid bills
}

if (props.value === 0 && !props.paymentInfoData?.policyInstallmentDtoList?.some((e) => e['status'] === '6')) {
  return (
   <div>You do not have any outstanding invoices</div>
  );
} // I tried to print a message if there is no unpaid invoice by navigating the incoming list here.

if (props.value === 1 && item.status === '3') { ... //paid invoice 
}

它缩写了如何打印消息?

如果没有未付费发票,

There is a list from the backend. The incoming list is the invoices list. I show these invoices in 2 different tabs as paid and unpaid. "status 3" of paid invoices. "status 6" of paid invoices. Sometimes there are no outstanding invoices. In this case, I want to remove the unpaid invoices table and replace it with a notification message.

payment-info.js

Here you can see two different tabs

<TabPanel value={value} index={0} >
  <PaymentTable variant="edit" paymentList={paymentInfoData} value={value} collectionMethod={collectionMethod} />
  <div className={hiddenControlButtonClass}>
    <AS.Button variant="outlined" onClick={handlePayment}>
      Continue
    </AS.Button>
  </div>
</TabPanel>
<TabPanel value={value} index={1}>
  <PaymentTable variant="read" paymentList={paymentInfoData} value={value} />
</TabPanel>

payment-table.js

props.paymentList.policyInstallmentDtoList = item

if (props.value === 0 && item.status !== '3') { ... //unpaid bills
}

if (props.value === 0 && !props.paymentInfoData?.policyInstallmentDtoList?.some((e) => e['status'] === '6')) {
  return (
   <div>You do not have any outstanding invoices</div>
  );
} // I tried to print a message if there is no unpaid invoice by navigating the incoming list here.

if (props.value === 1 && item.status === '3') { ... //paid invoice 
}

Since there are too many lines in if blocks, I wrote it abbreviated

How do I print the message if there is no unpaid invoice?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文