7.26工作总结内容“pda盘查和盘库功能”

一、遇到的问题:比如说盘库之后跳到盘查确认界面把没有盘到的芯片出库,出库完成之后需要回到盘查界面。因为出库完成之后会回到上一个界面,那么如何回到盘库界面呢?

二、解决方案,参考入库界面,入库成功之后回到主界面。这也是我之前没有接触过的,就是当你

把盘查确认界面没有查到的芯片出库。出库成功之后回到盘查界面,并且把之前出库的芯片数量减掉。

1.回到盘查界面:

      new XPopup.Builder(getContext()).dismissOnBackPressed(false).dismissOnTouchOutside(false).asConfirm("提示", "出库成功!", null, "确定", new OnConfirmListener() {
                    @Override
                    public void onConfirm() {
                        ExWarehouseScanViewModel scanViewModel = new ViewModelProvider(requireActivity()).get(ExWarehouseScanViewModel.class);
                        scanViewModel.cleanData();
                        popBackFragment();
                        AICalculateListViewModel aiCalculateListViewModel=new ViewModelProvider(requireActivity()).get(AICalculateListViewModel.class);
                        aiCalculateListViewModel.viewModelObservableList.clear();
                        aiCalculateListViewModel.loadListData();
                        try {
                            FragmentManager fragmentManager = getParentFragmentManager();
                            fragmentManager.popBackStackImmediate("exWarehouseCommit", 1);
                            fragmentManager.popBackStackImmediate("AIScanFragmentPage", 1);
                        } catch (IllegalStateException e) {
                        }
                    }
                }, null, true).show();

是在“盘库确认界面调转过来的

  navigationToFragment(new ExWarehouseCommitFragment(), "exWarehouseCommit");

如上代码:在跳转的时候把这个fragment打个标签,当再次回到该页面时直接用

   try {
                            FragmentManager fragmentManager = getParentFragmentManager();
                            fragmentManager.popBackStackImmediate("AIScanFragmentPage", 1);
                        } catch (IllegalStateException e) {
                        }

2.当你回到这个页面时扫描的芯片编码还在,因此我们要把他的数量写进去,那么在什么时间写入呢,一般在接口掉完之后。

你可能感兴趣的:(android)