RaoMeng 6 лет назад
Родитель
Сommit
51a8e40bd7

+ 4 - 0
app_modular/apputils/src/main/java/com/modular/apputils/adapter/BillAdapter.java

@@ -677,9 +677,11 @@ public class BillAdapter extends RecyclerView.Adapter<BillAdapter.BaseViewHolder
         newBillGroupModel.setLastInType(true);
         newBillGroupModel.setGroupIndex(mGroupIndex + 1);
         for (BillGroupModel.BillModel e : oldBillGroupModel.getShowBillFields()) {
+            e.setGroupIndex(mGroupIndex);//保证添加的明细groupindex是正确的
             newBillGroupModel.addShow(new BillGroupModel.BillModel(e));
         }
         for (BillGroupModel.BillModel e : oldBillGroupModel.getHideBillFields()) {
+            e.setGroupIndex(mGroupIndex);
             newBillGroupModel.addHide(new BillGroupModel.BillModel(e));
         }
         return newBillGroupModel;
@@ -701,6 +703,8 @@ public class BillAdapter extends RecyclerView.Adapter<BillAdapter.BaseViewHolder
             if (!deleteGroupModel.isForm()
                     && (billGroupModel.isForm() || (billGroupModel.getGridTabs() != null && billGroupModel.getGridTabs().size() > 0))) {
                 //明细删除光了,要默认添加一个空明细表
+                deleteGroupModel.setGroupIndex(groupIndex - 1);
+                deleteGroupModel.setGridIndex(0);
                 BillGroupModel newGridGroup = newGridBillGroup(groupIndex - 1, deleteGroupModel);
                 newGridGroup.setDeleteAble(false);
                 mBillGroupModels.remove(groupIndex);

+ 8 - 4
app_modular/apputils/src/main/java/com/modular/apputils/presenter/BillPresenter.java

@@ -136,8 +136,8 @@ public class BillPresenter extends BaseNetPresenter implements OnSmartHttpListen
         String formStoreStr = JSON.toJSONString(formStore);
         String gridStoreStr = JSON.toJSONString(gridStoreList);
 
-        LogUtil.prinlnLongMsg("raomengForm",formStoreStr);
-        LogUtil.prinlnLongMsg("raomengGrid",gridStoreStr);
+        LogUtil.prinlnLongMsg("raomengForm", formStoreStr);
+        LogUtil.prinlnLongMsg("raomengGrid", gridStoreStr);
         try {
             requestCompanyHttp(new Parameter.Builder()
                             .url(mId == 0 ? saveUrl : updateUrl)
@@ -207,8 +207,8 @@ public class BillPresenter extends BaseNetPresenter implements OnSmartHttpListen
         String formStoreStr = JSON.toJSONString(formStore);
         String otherGridStoreListStr = JSON.toJSONString(otherGridStoreList);
 
-        LogUtil.prinlnLongMsg("raomengForm",formStoreStr);
-        LogUtil.prinlnLongMsg("raomengGrid",otherGridStoreListStr);
+        LogUtil.prinlnLongMsg("raomengForm", formStoreStr);
+        LogUtil.prinlnLongMsg("raomengGrid", otherGridStoreListStr);
         try {
             requestCompanyHttp(new Parameter.Builder()
                             .url(mId == 0 ? saveUrl : updateUrl)
@@ -488,6 +488,10 @@ public class BillPresenter extends BaseNetPresenter implements OnSmartHttpListen
                         judgeApproval(mId, "");
                         iBill.showToast(R.string.submit_success);
                     }
+                } else {
+                    if (JSONUtil.validateJSONObject(message)) {
+                        iBill.showToast(JSONUtil.getText(message, "exceptionInfo"));
+                    }
                 }
                 break;
             case LOAD_JUDGE_APPROVAL: