Commit 4565d018 by 张建升

SN查詢 詳細列表

parent 9abc1890
...@@ -2,7 +2,6 @@ package com.gingersoft.supply_chain.mvp.presenter; ...@@ -2,7 +2,6 @@ package com.gingersoft.supply_chain.mvp.presenter;
import android.app.Application; import android.app.Application;
import com.chad.library.adapter.base.BaseBinderAdapter;
import com.gingersoft.gsa.cloud.common.bean.BaseResult; import com.gingersoft.gsa.cloud.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.common.constans.AppConstant; import com.gingersoft.gsa.cloud.common.constans.AppConstant;
import com.gingersoft.gsa.cloud.common.utils.CollectionUtils; import com.gingersoft.gsa.cloud.common.utils.CollectionUtils;
...@@ -11,29 +10,28 @@ import com.gingersoft.gsa.cloud.common.utils.other.TextUtil; ...@@ -11,29 +10,28 @@ import com.gingersoft.gsa.cloud.common.utils.other.TextUtil;
import com.gingersoft.supply_chain.R; import com.gingersoft.supply_chain.R;
import com.gingersoft.supply_chain.mvp.bean.SnInOutBoundRecordDetailsBean; import com.gingersoft.supply_chain.mvp.bean.SnInOutBoundRecordDetailsBean;
import com.gingersoft.supply_chain.mvp.bean.SnInoutBoundRecordBean; import com.gingersoft.supply_chain.mvp.bean.SnInoutBoundRecordBean;
import com.gingersoft.supply_chain.mvp.content.PurchaseConstant; import com.gingersoft.supply_chain.mvp.contract.SnInOutboundRecordsContract;
import com.gingersoft.supply_chain.mvp.ui.adapter.binder.SnInOutRecordAdapter;
import com.gingersoft.supply_chain.mvp.ui.adapter.binder.SnInOutRecordBinder; import com.gingersoft.supply_chain.mvp.ui.adapter.binder.SnInOutRecordBinder;
import com.gingersoft.supply_chain.mvp.ui.adapter.binder.SnInRecordDetailsBinder; import com.gingersoft.supply_chain.mvp.ui.adapter.binder.SnInRecordDetailsBinder;
import com.gingersoft.supply_chain.mvp.ui.adapter.binder.SnOutRecordDetailsBinder; import com.gingersoft.supply_chain.mvp.ui.adapter.binder.SnOutRecordDetailsBinder;
import com.jess.arms.integration.AppManager;
import com.jess.arms.di.scope.FragmentScope; import com.jess.arms.di.scope.FragmentScope;
import com.jess.arms.mvp.BasePresenter;
import com.jess.arms.http.imageloader.ImageLoader; import com.jess.arms.http.imageloader.ImageLoader;
import com.jess.arms.integration.AppManager;
import io.reactivex.android.schedulers.AndroidSchedulers; import com.jess.arms.mvp.BasePresenter;
import io.reactivex.schedulers.Schedulers;
import me.jessyan.rxerrorhandler.core.RxErrorHandler;
import me.jessyan.rxerrorhandler.handler.ErrorHandleSubscriber;
import javax.inject.Inject;
import com.gingersoft.supply_chain.mvp.contract.SnInOutboundRecordsContract;
import com.jess.arms.utils.RxLifecycleUtils; import com.jess.arms.utils.RxLifecycleUtils;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import javax.inject.Inject;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
import me.jessyan.rxerrorhandler.core.RxErrorHandler;
import me.jessyan.rxerrorhandler.handler.ErrorHandleSubscriber;
/** /**
* ================================================ * ================================================
...@@ -57,7 +55,7 @@ public class SnInOutboundRecordsPresenter extends BasePresenter<SnInOutboundReco ...@@ -57,7 +55,7 @@ public class SnInOutboundRecordsPresenter extends BasePresenter<SnInOutboundReco
ImageLoader mImageLoader; ImageLoader mImageLoader;
@Inject @Inject
AppManager mAppManager; AppManager mAppManager;
private BaseBinderAdapter baseBinderAdapter; private SnInOutRecordAdapter baseBinderAdapter;
@Inject @Inject
public SnInOutboundRecordsPresenter(SnInOutboundRecordsContract.Model model, SnInOutboundRecordsContract.View rootView) { public SnInOutboundRecordsPresenter(SnInOutboundRecordsContract.Model model, SnInOutboundRecordsContract.View rootView) {
...@@ -107,7 +105,7 @@ public class SnInOutboundRecordsPresenter extends BasePresenter<SnInOutboundReco ...@@ -107,7 +105,7 @@ public class SnInOutboundRecordsPresenter extends BasePresenter<SnInOutboundReco
private void loadAdapter(List<SnInoutBoundRecordBean> snInoutBoundRecordBeans) { private void loadAdapter(List<SnInoutBoundRecordBean> snInoutBoundRecordBeans) {
if (baseBinderAdapter == null) { if (baseBinderAdapter == null) {
baseBinderAdapter = new BaseBinderAdapter(); baseBinderAdapter = new SnInOutRecordAdapter();
baseBinderAdapter.addItemBinder(SnInoutBoundRecordBean.class, new SnInOutRecordBinder()) baseBinderAdapter.addItemBinder(SnInoutBoundRecordBean.class, new SnInOutRecordBinder())
.addItemBinder(SnInOutBoundRecordDetailsBean.ConsumeDetailsBean.class, new SnOutRecordDetailsBinder()) .addItemBinder(SnInOutBoundRecordDetailsBean.ConsumeDetailsBean.class, new SnOutRecordDetailsBinder())
.addItemBinder(SnInOutBoundRecordDetailsBean.InventoryDetailsBean.class, new SnInRecordDetailsBinder()); .addItemBinder(SnInOutBoundRecordDetailsBean.InventoryDetailsBean.class, new SnInRecordDetailsBinder());
...@@ -117,10 +115,8 @@ public class SnInOutboundRecordsPresenter extends BasePresenter<SnInOutboundReco ...@@ -117,10 +115,8 @@ public class SnInOutboundRecordsPresenter extends BasePresenter<SnInOutboundReco
Object item = baseBinderAdapter.getItem(position); Object item = baseBinderAdapter.getItem(position);
if (item instanceof SnInoutBoundRecordBean) { if (item instanceof SnInoutBoundRecordBean) {
SnInoutBoundRecordBean recordBean = (SnInoutBoundRecordBean) item; SnInoutBoundRecordBean recordBean = (SnInoutBoundRecordBean) item;
if (!recordBean.isLoadDetails()) {
getFoodInOutBoundDetails(recordBean.getPurchaseWarehousingOrderDetailsIds(), recordBean.getEncodeSnNo(), recordBean.getEncodeFoodNo()); getFoodInOutBoundDetails(recordBean.getPurchaseWarehousingOrderDetailsIds(), recordBean.getEncodeSnNo(), recordBean.getEncodeFoodNo());
recordBean.setLoadDetails(true); baseBinderAdapter.hideRecordList();
}
} }
}); });
} else { } else {
...@@ -166,4 +162,12 @@ public class SnInOutboundRecordsPresenter extends BasePresenter<SnInOutboundReco ...@@ -166,4 +162,12 @@ public class SnInOutboundRecordsPresenter extends BasePresenter<SnInOutboundReco
} }
}); });
} }
public boolean goBack(){
if (baseBinderAdapter != null) {
return baseBinderAdapter.canBack();
}else {
return false;
}
}
} }
package com.gingersoft.supply_chain.mvp.ui.adapter.binder;
import com.chad.library.adapter.base.BaseBinderAdapter;
import com.gingersoft.supply_chain.mvp.bean.SnInoutBoundRecordBean;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class SnInOutRecordAdapter extends BaseBinderAdapter {
private List<SnInoutBoundRecordBean> hides;
public void hideRecordList(){
List<Object> records= getData();
hides=new ArrayList<>();
Iterator<Object> iter = records.iterator();
while (iter.hasNext()) {
Object record = iter.next();
if (record instanceof SnInoutBoundRecordBean) {
hides.add((SnInoutBoundRecordBean) record);
iter.remove();
}
}
notifyItemRangeRemoved(0,hides.size());
}
public boolean canBack(){
if (hides != null) {
setList(hides);
hides.clear();
hides=null;
return true;
}else {
return false;
}
}
}
...@@ -81,6 +81,19 @@ public class SnInOutboundRecordsFragment extends BaseSupplyChainFragment<SnInOut ...@@ -81,6 +81,19 @@ public class SnInOutboundRecordsFragment extends BaseSupplyChainFragment<SnInOut
initTopBar(supplyTopBar, getString(R.string.str_title_sn_query)); initTopBar(supplyTopBar, getString(R.string.str_title_sn_query));
} }
@Override
protected void initTopBar(QMUITopBar topBar, String title) {
if (topBar.getLeftViewList().size() <= 0) {
topBar.setTitle(title);
topBar.addLeftBackImageButton().setOnClickListener(v -> {
if (mPresenter.goBack()) {
}else {
killMyself();
}
});
}
}
@OnClick({R2.id.btn_inout_bound_record_search}) @OnClick({R2.id.btn_inout_bound_record_search})
@Override @Override
public void onClick(View v) { public void onClick(View v) {
......
...@@ -2,7 +2,6 @@ package com.gingersoft.supply_chain.mvp.ui.fragment.warehouse; ...@@ -2,7 +2,6 @@ package com.gingersoft.supply_chain.mvp.ui.fragment.warehouse;
import android.os.Bundle; import android.os.Bundle;
import android.text.InputFilter; import android.text.InputFilter;
import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
...@@ -13,10 +12,7 @@ import android.widget.TextView; ...@@ -13,10 +12,7 @@ import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.gingersoft.gsa.cloud.common.loadsir.EmptyCallback; import com.gingersoft.gsa.cloud.common.loadsir.EmptyCallback;
import com.gingersoft.gsa.cloud.common.loadsir.ErrorCallback; import com.gingersoft.gsa.cloud.common.loadsir.ErrorCallback;
import com.gingersoft.gsa.cloud.common.utils.inputFilter.InputFilterUtils; import com.gingersoft.gsa.cloud.common.utils.inputFilter.InputFilterUtils;
...@@ -29,14 +25,12 @@ import com.gingersoft.supply_chain.mvp.bean.PurchaseWarehousingOrderDetailsVO; ...@@ -29,14 +25,12 @@ import com.gingersoft.supply_chain.mvp.bean.PurchaseWarehousingOrderDetailsVO;
import com.gingersoft.supply_chain.mvp.bean.WareHouseListBean; import com.gingersoft.supply_chain.mvp.bean.WareHouseListBean;
import com.gingersoft.supply_chain.mvp.contract.WareHouseListContract; import com.gingersoft.supply_chain.mvp.contract.WareHouseListContract;
import com.gingersoft.supply_chain.mvp.presenter.WareHouseListPresenter; import com.gingersoft.supply_chain.mvp.presenter.WareHouseListPresenter;
import com.gingersoft.supply_chain.mvp.ui.adapter.WarehousingFirstColumnAdapter;
import com.gingersoft.supply_chain.mvp.ui.adapter.WarehousingQueryAdapter; import com.gingersoft.supply_chain.mvp.ui.adapter.WarehousingQueryAdapter;
import com.gingersoft.supply_chain.mvp.ui.fragment.BaseSupplyChainFragment; import com.gingersoft.supply_chain.mvp.ui.fragment.BaseSupplyChainFragment;
import com.gingersoft.supply_chain.mvp.ui.widget.TableView; import com.gingersoft.supply_chain.mvp.ui.widget.TableView;
import com.jess.arms.di.component.AppComponent; import com.jess.arms.di.component.AppComponent;
import com.kingja.loadsir.core.LoadSir; import com.kingja.loadsir.core.LoadSir;
import com.qmuiteam.qmui.widget.QMUITopBar; import com.qmuiteam.qmui.widget.QMUITopBar;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import java.util.List; import java.util.List;
...@@ -125,7 +119,7 @@ public class WareHouseListFragment extends BaseSupplyChainFragment<WareHouseList ...@@ -125,7 +119,7 @@ public class WareHouseListFragment extends BaseSupplyChainFragment<WareHouseList
} }
//R2.id.tv_warehouse_item_unit_price, R2.id.tv_warehouse_item_inventory_quantity, R2.id.tv_warehouse_item_total_amount //R2.id.tv_warehouse_item_unit_price, R2.id.tv_warehouse_item_inventory_quantity, R2.id.tv_warehouse_item_total_amount
@OnClick({R2.id.iv_warehouse_list_search, R.id.bt_warehouse_list_search}) @OnClick({R2.id.iv_warehouse_list_search, R2.id.bt_warehouse_list_search})
@Override @Override
public void onClick(View view) { public void onClick(View view) {
int id = view.getId(); int id = view.getId();
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@drawable/shape_app_btn" android:background="@drawable/shape_app_btn"
android:text="搜索" android:text="搜索"
android:textColor="@color/theme_333_color" android:textColor="@color/theme_white_color"
android:textSize="@dimen/dp_14" /> android:textSize="@dimen/dp_14" />
</LinearLayout> </LinearLayout>
<!-- android:background="@drawable/shape_app_btn"--> <!-- android:background="@drawable/shape_app_btn"-->
......
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