提交 dd77865f authored 作者: lgd's avatar lgd

1.坩埚销售发货,页面

2.TODO 供应订单三个功能测试,坩埚销售页面查接口/数量对应字段
上级 db27760e
...@@ -2384,7 +2384,7 @@ ...@@ -2384,7 +2384,7 @@
android:theme="@style/Work.Base" android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" /> android:windowSoftInputMode="adjustPan" />
<activity <activity
android:name=".ui.activity.bat.order.SendApplyAddCruibleActivity" android:name=".ui.activity.bat.order.SendApplyAddCrucibleActivity"
android:configChanges="orientation|screenSize|keyboardHidden" android:configChanges="orientation|screenSize|keyboardHidden"
android:label="申请发货" android:label="申请发货"
android:launchMode="singleTop" android:launchMode="singleTop"
...@@ -2399,6 +2399,16 @@ ...@@ -2399,6 +2399,16 @@
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/Work.Base" android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" /> android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.activity.bat.order.SendApplyCrucibleChooseActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
android:label="发货来源"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<provider <provider
android:name="androidx.core.content.FileProvider" android:name="androidx.core.content.FileProvider"
android:authorities="com.wd.workoffice.fileprovider" android:authorities="com.wd.workoffice.fileprovider"
......
package com.wd.workoffice.bean; package com.wd.workoffice.bean;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
...@@ -951,6 +952,24 @@ public class OrderDetail { ...@@ -951,6 +952,24 @@ public class OrderDetail {
private String chooseNum; private String chooseNum;
private double productBeyondCount; private double productBeyondCount;
private String canPickReturnProductSum; private String canPickReturnProductSum;
List<AddStockChooseBean.RecordsBean> backList;
String count;// backList的数量
public String getCount() {
return count;
}
public void setCount(String count) {
this.count = count;
}
public List<AddStockChooseBean.RecordsBean> getBackList() {
return backList;
}
public void setBackList(List<AddStockChooseBean.RecordsBean> backList) {
this.backList = backList;
}
public String getCanPickReturnProductSum() { public String getCanPickReturnProductSum() {
return canPickReturnProductSum; return canPickReturnProductSum;
......
...@@ -115,9 +115,11 @@ public class OrderMarkActivity extends WorkToolBarActivity { ...@@ -115,9 +115,11 @@ public class OrderMarkActivity extends WorkToolBarActivity {
toast(data.getMessage()); toast(data.getMessage());
return; return;
} }
if (null!=data.getData()){
markBean = JSON.parseObject(data.getData().toString(), MarkBean.class); markBean = JSON.parseObject(data.getData().toString(), MarkBean.class);
changeView(); changeView();
} }
}
}); });
} }
......
...@@ -442,6 +442,7 @@ public class SaleOrderDetailActivity extends WorkToolBarActivity { ...@@ -442,6 +442,7 @@ public class SaleOrderDetailActivity extends WorkToolBarActivity {
"status", dataBean.getStatus() + "", "status", dataBean.getStatus() + "",
"isCrucible", dataBean.getIsCrucible(), "isCrucible", dataBean.getIsCrucible(),
"orderType", dataBean.getExpandInfo().getOrderType(), "orderType", dataBean.getExpandInfo().getOrderType(),
"deptId", dataBean.getLaunchDeptId() + "",
"orderId", getIntent().getStringExtra("id")); "orderId", getIntent().getStringExtra("id"));
break; break;
} }
......
...@@ -103,8 +103,9 @@ public class SendApplyActivity extends WorkToolBarActivity { ...@@ -103,8 +103,9 @@ public class SendApplyActivity extends WorkToolBarActivity {
switch (item.getItemId()) { switch (item.getItemId()) {
case R.id.add: case R.id.add:
if (TextUtils.equals("1", getIntent().getStringExtra("isCrucible"))) { if (TextUtils.equals("1", getIntent().getStringExtra("isCrucible"))) {
startActivity(SendApplyAddCruibleActivity.class, startActivity(SendApplyAddCrucibleActivity.class,
"orderType", getIntent().getStringExtra("orderType"), "orderType", getIntent().getStringExtra("orderType"),
"deptId", getIntent().getStringExtra("deptId"),
"id", getIntent().getStringExtra("orderId")); "id", getIntent().getStringExtra("orderId"));
return super.onOptionsItemSelected(item); return super.onOptionsItemSelected(item);
} }
......
...@@ -10,9 +10,11 @@ import android.widget.TextView; ...@@ -10,9 +10,11 @@ import android.widget.TextView;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.bigkoo.pickerview.listener.OnTimeSelectListener; import com.bigkoo.pickerview.listener.OnTimeSelectListener;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.wd.workoffice.R; import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseBean; import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.app.WorkToolBarActivity; import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.AddStockChooseBean;
import com.wd.workoffice.bean.OrderDetail; import com.wd.workoffice.bean.OrderDetail;
import com.wd.workoffice.bean.event.CheckSendEvent; import com.wd.workoffice.bean.event.CheckSendEvent;
import com.wd.workoffice.bean.event.SendWeightEvent; import com.wd.workoffice.bean.event.SendWeightEvent;
...@@ -20,7 +22,7 @@ import com.wd.workoffice.bean.workEnum.OrderType; ...@@ -20,7 +22,7 @@ import com.wd.workoffice.bean.workEnum.OrderType;
import com.wd.workoffice.retrofit.RtfUtils; import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver; import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.activity.bat.store.StoreSaleClientActivity; import com.wd.workoffice.ui.activity.bat.store.StoreSaleClientActivity;
import com.wd.workoffice.ui.adapter.WorkSendApplyAddAdapter; import com.wd.workoffice.ui.adapter.SendApplyAddCrucibleAdapter;
import com.wd.workoffice.util.MathUtils; import com.wd.workoffice.util.MathUtils;
import com.wd.workoffice.util.PickTimeUtils; import com.wd.workoffice.util.PickTimeUtils;
import com.wd.workoffice.util.WorkUtils; import com.wd.workoffice.util.WorkUtils;
...@@ -52,7 +54,7 @@ import io.reactivex.disposables.Disposable; ...@@ -52,7 +54,7 @@ import io.reactivex.disposables.Disposable;
* email : lgd19940421@163.com * email : lgd19940421@163.com
* github: https://github.com/FlexibleXd * github: https://github.com/FlexibleXd
**/ **/
public class SendApplyAddCruibleActivity extends WorkToolBarActivity { public class SendApplyAddCrucibleActivity extends WorkToolBarActivity {
@BindView(R.id.tv_bottom) @BindView(R.id.tv_bottom)
TextView tvBottom; TextView tvBottom;
@BindView(R.id.rv_data) @BindView(R.id.rv_data)
...@@ -76,7 +78,7 @@ public class SendApplyAddCruibleActivity extends WorkToolBarActivity { ...@@ -76,7 +78,7 @@ public class SendApplyAddCruibleActivity extends WorkToolBarActivity {
@BindView(R.id.tv_input1) @BindView(R.id.tv_input1)
TextView tvInput1; TextView tvInput1;
private List<OrderDetail.OrderItemsBean> dataList; private List<OrderDetail.OrderItemsBean> dataList;
private WorkSendApplyAddAdapter dataAdapter; private SendApplyAddCrucibleAdapter dataAdapter;
private Map<String, Object> param; private Map<String, Object> param;
private OrderDetail dataBean; private OrderDetail dataBean;
private int clientId; private int clientId;
...@@ -93,7 +95,7 @@ public class SendApplyAddCruibleActivity extends WorkToolBarActivity { ...@@ -93,7 +95,7 @@ public class SendApplyAddCruibleActivity extends WorkToolBarActivity {
protected void initData() { protected void initData() {
orderType = getIntent().getStringExtra("orderType"); orderType = getIntent().getStringExtra("orderType");
dataList = new ArrayList<>(); dataList = new ArrayList<>();
dataAdapter = new WorkSendApplyAddAdapter(R.layout.item_send_apply_add, dataList); dataAdapter = new SendApplyAddCrucibleAdapter(R.layout.item_send_apply_add_crucible, dataList);
dataAdapter.bindToRecyclerView(rvData); dataAdapter.bindToRecyclerView(rvData);
param = new HashMap<>(); param = new HashMap<>();
param.put("orderId", getIntent().getStringExtra("id")); param.put("orderId", getIntent().getStringExtra("id"));
...@@ -103,6 +105,15 @@ public class SendApplyAddCruibleActivity extends WorkToolBarActivity { ...@@ -103,6 +105,15 @@ public class SendApplyAddCruibleActivity extends WorkToolBarActivity {
@Override @Override
protected void initEvent() { protected void initEvent() {
dataAdapter.setOnItemChildClickListener(new BaseQuickAdapter.OnItemChildClickListener() {
@Override
public void onItemChildClick(BaseQuickAdapter baseQuickAdapter, View view, int i) {
startActivityForResult(SendApplyCrucibleChooseActivity.class,
10002,"position", i+""
,"deptId", getIntent().getStringExtra("deptId"),
"productId", dataList.get(i).getProductId()+"");
}
});
} }
private void getData() { private void getData() {
...@@ -260,7 +271,7 @@ public class SendApplyAddCruibleActivity extends WorkToolBarActivity { ...@@ -260,7 +271,7 @@ public class SendApplyAddCruibleActivity extends WorkToolBarActivity {
case R.id.tv_bottom: case R.id.tv_bottom:
break; break;
case R.id.rl_time: case R.id.rl_time:
PickTimeUtils.showPickThree(SendApplyAddCruibleActivity.this, new OnTimeSelectListener() { PickTimeUtils.showPickThree(SendApplyAddCrucibleActivity.this, new OnTimeSelectListener() {
@Override @Override
public void onTimeSelect(Date date, View v) { public void onTimeSelect(Date date, View v) {
String time = TimeUtils.date2String(date, new SimpleDateFormat("yyyy-MM-dd")); String time = TimeUtils.date2String(date, new SimpleDateFormat("yyyy-MM-dd"));
...@@ -283,6 +294,13 @@ public class SendApplyAddCruibleActivity extends WorkToolBarActivity { ...@@ -283,6 +294,13 @@ public class SendApplyAddCruibleActivity extends WorkToolBarActivity {
String clientName = data.getStringExtra("clientName"); String clientName = data.getStringExtra("clientName");
clientId = data.getIntExtra("id", 0); clientId = data.getIntExtra("id", 0);
tvLogisticsCompany.setText(clientName); tvLogisticsCompany.setText(clientName);
}else if (requestCode == 10002 && resultCode == 10002){
List<AddStockChooseBean.RecordsBean> backList =JSON.parseArray(getIntent().getStringExtra("stock"),AddStockChooseBean.RecordsBean.class);
Integer position = Integer.valueOf(data.getStringExtra("position"));
String count = data.getStringExtra("count");
dataList.get(position).setBackList(backList);
dataList.get(position).setCount(count);
dataAdapter.notifyItemChanged(position);
} }
} }
......
package com.wd.workoffice.ui.activity.bat.order;
import android.content.Intent;
import android.text.TextUtils;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.alibaba.fastjson.JSON;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.AddStockChooseBean;
import com.wd.workoffice.bean.event.ModifyCarEvent;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.adapter.AddStockCrucibleChooseAdapter;
import com.wd.workoffice.ui.adapter.SendApplyCrucibleChooseAdapter;
import com.wd.workoffice.util.MathUtils;
import com.wd.workoffice.util.WorkUtils;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import flexible.xd.android_base.network.rtfhttp.Transformer;
import io.reactivex.disposables.Disposable;
/**
* 选择来源仓库
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class SendApplyCrucibleChooseActivity extends WorkToolBarActivity {
@BindView(R.id.tv_price)
TextView tvPrice;
@BindView(R.id.tv_ok)
TextView tvOk;
@BindView(R.id.ll_bottom)
RelativeLayout llBottom;
@BindView(R.id.rv_product)
RecyclerView rvProduct;
private List<AddStockChooseBean.RecordsBean> productList;
private SendApplyCrucibleChooseAdapter productAdapter;
private int page = 1;
private Map<String, Object> param;
@Override
protected void initView() {
ButterKnife.bind(this);
rvProduct.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false));
}
@Override
protected void initData() {
productList = new ArrayList<>();
productAdapter = new SendApplyCrucibleChooseAdapter(R.layout.item_add_stock_choose, productList);
productAdapter.bindToRecyclerView(rvProduct);
productAdapter.notifyDataSetChanged();
param = WorkUtils.pageKey();
param.put("current", page);
param.put("deptId", getIntent().getStringExtra("deptId"));
param.put("productId", getIntent().getStringExtra("productId"));
getData();
changeNumAndPrice();
}
private void changeChooseStatue() {
String pro = getIntent().getStringExtra("pro");
if (!TextUtils.isEmpty(pro)) {
Map<Integer, Boolean> isChoose = productAdapter.getIsChoose();
List<AddStockChooseBean.RecordsBean> chooseList = JSON.parseArray(pro, AddStockChooseBean.RecordsBean.class);
for (AddStockChooseBean.RecordsBean chooseStock : chooseList) {
for (int i = 0; i < productList.size(); i++) {
if (productList.get(i).getId() == chooseStock.getId()) {
isChoose.put(i, true);
productList.get(i).setChooseNum(chooseStock.getChooseNum());
}
}
}
productAdapter.notifyDataSetChanged();
}
}
@Override
protected void initEvent() {
// productAdapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
// @Override
// public void onLoadMoreRequested() {
// param.put("current", page);
// getData();
// }
// }, rvProduct);
}
@Override
protected int layoutId() {
return R.layout.activity_send_apply_choose;
}
@OnClick(R.id.tv_ok)
public void onViewClicked() {
submit();
}
private void submit() {
Map<Integer, Boolean> isChoose = productAdapter.getIsChoose();
boolean isHas = false;
List<AddStockChooseBean.RecordsBean> backList = new ArrayList<>();
for (Map.Entry<Integer, Boolean> entry : isChoose.entrySet()) {
if (entry.getValue()) {
isHas = true;
backList.add(productList.get(entry.getKey()));
if (TextUtils.isEmpty(productList.get(entry.getKey()).getChooseNum())||
TextUtils.equals(productList.get(entry.getKey()).getChooseNum(), "0")) {
toast("请输入数量");
return;
}
}
}
if (isHas) {
Intent intent = new Intent();
intent.putExtra("stock", JSON.toJSONString(backList));
intent.putExtra("position", getIntent().getStringExtra("position"));
intent.putExtra("count", tvPrice.getText().toString().split(": ")[1]);
setResult(10002, intent);
finish();
} else {
toast("请选择来源仓库");
}
}
@Override
public void onStart() {
super.onStart();
EventBus.getDefault().register(this);
}
@Override
public void onStop() {
super.onStop();
EventBus.getDefault().unregister(this);
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onMessageEvent(ModifyCarEvent event) {
changeNumAndPrice();
}
private void changeNumAndPrice() {
String allPrice = "";
Map<Integer, Boolean> isChoose = productAdapter.getIsChoose();
for (Map.Entry<Integer, Boolean> entry : isChoose.entrySet()) {
if (entry.getValue()) {
allPrice = MathUtils.add(allPrice, productList.get(entry.getKey()).getChooseNum(), 3);
}
}
tvPrice.setText("小计: ".concat(allPrice));
}
private void getData() {
RtfUtils.getRtf().productionPlan(param).compose(Transformer.schedule()).subscribe(new WorkObserver<BaseBean>() {
@Override
public void doOnSubscribe(Disposable d) {
}
@Override
public void onFail(String errorMsg) {
hideLoading();
toast(errorMsg);
}
@Override
public void onSuccess(BaseBean data) {
hideLoading();
if (data.getCode() != 0) {
toast(data.getMessage());
return;
}
List<AddStockChooseBean.RecordsBean> getList = JSON.parseObject(data.getData().toString(), AddStockChooseBean.class).getRecords();
productList.clear();
productList.addAll(getList);
productAdapter.notifyDataSetChanged();
changeChooseStatue();
// if (page == 1) {
// productList.clear();
// productList.addAll(getList);
// productAdapter.notifyDataSetChanged();
// productAdapter.loadMoreComplete();
// } else {
// productAdapter.loadMoreComplete();
// productList.addAll(getList);
// productAdapter.notifyDataSetChanged();
// }
// if (getList.size() == 0) {
// productAdapter.loadMoreEnd();
// } else {
// page++;
// }
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_finish, menu);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.finish:
submit();
break;
}
return super.onOptionsItemSelected(item);
}
}
package com.wd.workoffice.ui.adapter;
import android.text.TextUtils;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.wd.workoffice.R;
import com.wd.workoffice.bean.OrderDetail;
import com.wd.workoffice.bean.event.SendWeightEvent;
import com.wd.workoffice.util.MathUtils;
import com.wd.workoffice.widget.AddAndReduceView;
import org.greenrobot.eventbus.EventBus;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Created by flexible on 2018/8/13.
*/
public class SendApplyAddCrucibleAdapter extends BaseQuickAdapter<OrderDetail.OrderItemsBean, BaseViewHolder> {
Map<Integer, Boolean> isChoose = new HashMap<>();
public SendApplyAddCrucibleAdapter(int layoutResId, List data) {
super(layoutResId, data);
for (int i = 0; i < isChoose.entrySet().size(); i++) {
isChoose.put(i, false);
}
}
@Override
protected void convert(BaseViewHolder helper, OrderDetail.OrderItemsBean item) {
if (!TextUtils.isEmpty(item.getCount())){
helper.setText(R.id.tv_from, item.getCount());
}
helper.setText(R.id.tv_name, item.getProductSimpleCode());
helper.setText(R.id.tv_card, item.getProductSoleCode());
helper.setText(R.id.tv_card_name, item.getProductName());
helper.setText(R.id.tv_spec, item.getProductSpec());
helper.setText(R.id.tv_price, "¥".concat(MathUtils.converData(item.getInnerPrice(), 3)));
// helper.setText(R.id.tv_all_price, "¥".concat(String.valueOf(item.getInnerPrice())));
helper.setText(R.id.tv_unit, item.getProductUnit());
// helper.setText(R.id.tv_from, WorkUtils.getOrderFrom(item.getType()));
helper.setText(R.id.tv_num, MathUtils.converData(item.getProductCount(), 3));
helper.setText(R.id.tv_apply_send_num, MathUtils.converData(item.getCanOutStoreProductSum(), 3));
helper.setText(R.id.tv_send_num, MathUtils.converData(item.getShipSum(), 3));
CheckBox cbChoose = helper.getView(R.id.cb_check);
cbChoose.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
isChoose.put(helper.getAdapterPosition(), cbChoose.isChecked());
EventBus.getDefault().post(new SendWeightEvent());
}
});
helper.addOnClickListener(R.id.rl_from);
}
public Map<Integer, Boolean> getIsChoose() {
return isChoose;
}
public void setIsChoose(Map<Integer, Boolean> isChoose) {
this.isChoose = isChoose;
}
}
package com.wd.workoffice.ui.adapter;
import android.text.TextUtils;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import com.alibaba.fastjson.JSON;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.wd.workoffice.R;
import com.wd.workoffice.bean.AddStockChooseBean;
import com.wd.workoffice.bean.event.ModifyCarEvent;
import com.wd.workoffice.util.MathUtils;
import com.wd.workoffice.widget.AddAndReduceView;
import org.greenrobot.eventbus.EventBus;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
/**
* Created by flexible on 2018/8/13.
*/
public class SendApplyCrucibleChooseAdapter extends BaseQuickAdapter<AddStockChooseBean.RecordsBean, BaseViewHolder> {
int type;// 0 新增选择 1 新增展示 2 详情
Map<Integer, Boolean> isChoose = new LinkedHashMap<>();
public SendApplyCrucibleChooseAdapter(int layoutResId, List data) {
super(layoutResId, data);
for (int i = 0; i < getData().size(); i++) {
isChoose.put(i, false);
}
}
public SendApplyCrucibleChooseAdapter(int layoutResId, List data, int type) {
super(layoutResId, data);
this.type = type;
for (int i = 0; i < getData().size(); i++) {
isChoose.put(i, false);
}
}
@Override
protected void convert(BaseViewHolder helper, AddStockChooseBean.RecordsBean item) {
if (type == 1) {
helper.setGone(R.id.ll_bottom, false);
helper.setGone(R.id.cb_check, false);
helper.setText(R.id.tv_stock_num_desc, "可发货数量");
helper.setText(R.id.tv_stock_num, MathUtils.converData(item.getChooseNum(), 3));
} else if (type == 2) {
helper.setGone(R.id.ll_bottom, false);
helper.setGone(R.id.cb_check, false);
helper.setText(R.id.tv_stock_num_desc, "可发货数量");
helper.setText(R.id.tv_stock_num, MathUtils.converData(item.getQuantity(), 3));
} else {
helper.setText(R.id.tv_stock_num_desc, "可发货数量");
helper.setText(R.id.tv_add_desc, "申请发货数量");
helper.setText(R.id.tv_stock_num, MathUtils.converData(item.getActionQuantity(), 3));
}
helper.setText(R.id.tv_name, item.getCrucibleId());
helper.setText(R.id.tv_stock, item.getStockName());
CheckBox cbChoose = helper.getView(R.id.cb_check);
cbChoose.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
isChoose.put(helper.getAdapterPosition(), cbChoose.isChecked());
EventBus.getDefault().post(new ModifyCarEvent(JSON.toJSONString(getData())));
}
});
cbChoose.setChecked(isChoose.get(helper.getAdapterPosition()) == null ? false : isChoose.get(helper.getAdapterPosition()));
AddAndReduceView num = helper.getView(R.id.ar_num);
num.setMaxNum(item.getQuantity());
if (!TextUtils.isEmpty(item.getChooseNum()))
num.setNumber(item.getChooseNum());
num.setOnNumberChangedListener(new AddAndReduceView.OnNumberChangedListener() {
@Override
public void OnNumberChanged(String vs) {
item.setChooseNum(vs);
EventBus.getDefault().post(new ModifyCarEvent(JSON.toJSONString(getData())));
}
});
}
public Map<Integer, Boolean> getIsChoose() {
return isChoose;
}
public void setIsChoose(Map<Integer, Boolean> isChoose) {
this.isChoose = isChoose;
}
}
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/ll_bottom"
android:layout_width="match_parent"
android:layout_height="60mm"
android:layout_alignParentBottom="true"
android:orientation="horizontal"
android:visibility="gone">
<TextView
android:id="@+id/tv_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="15mm"
android:text="总计: ¥ "
android:textSize="16sp" />
<TextView
android:id="@+id/tv_ok"
android:layout_width="80mm"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:background="@color/red_btn_bg"
android:gravity="center"
android:text="确定"
android:textColor="@color/white" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/ll_bottom"
android:orientation="vertical">
<LinearLayout
android:id="@+id/ll_search"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal"
android:paddingHorizontal="20mm"
android:paddingVertical="10mm">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/shape_client_search"
android:gravity="center_vertical"
android:paddingHorizontal="10mm">
<ImageView
android:layout_width="15mm"
android:layout_height="15mm"
android:src="@mipmap/client_search" />
<EditText
android:id="@+id/et_key"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="2mm"
android:background="@null"
android:hint="输入订单号"
android:textColor="#91ABBA"
android:textColorHint="#91ABBA"
android:textSize="14sp" />
</LinearLayout>
<Button
android:id="@+id/btn_search"
android:layout_width="60mm"
android:layout_height="wrap_content"
android:layout_marginLeft="10mm"
android:background="@color/mainTextColor"
android:text="搜索"
android:textColor="@color/white"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingVertical="10mm">
<View
android:layout_width="8mm"
android:layout_height="18mm"
android:background="@color/red_btn_bg" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10mm"
android:text="货品信息"
android:textSize="16sp" />
<TextView
android:id="@+id/tv_count_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_product"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</LinearLayout>
</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
...@@ -98,6 +98,7 @@ ...@@ -98,6 +98,7 @@
android:layout_marginTop="5mm"> android:layout_marginTop="5mm">
<TextView <TextView
android:id="@+id/tv_add_desc"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="10mm"
android:background="@color/white"
android:orientation="vertical"
android:paddingHorizontal="20mm"
android:paddingTop="10mm"
android:paddingBottom="20mm">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5mm"
android:gravity="center_vertical">
<CheckBox
android:id="@+id/cb_check"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="14mm"
android:background="#FCFCFD"
android:orientation="vertical"
android:padding="10mm">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="品号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_card"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="品号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="品名"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_card_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="品号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="规格"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_spec"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="品号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="内部单价"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="品号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="单位"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_unit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="数量"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="可使用数量"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_apply_send_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="已使用"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_send_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</RelativeLayout>
</LinearLayout>
<RelativeLayout
android:id="@+id/rl_from"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingVertical="9mm"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:text="发货来源"
android:textSize="14sp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:gravity="center_vertical">
<TextView
android:id="@+id/tv_from"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginRight="3mm"
android:hint="请选择"
android:textSize="14sp" />
<ImageView
android:id="@+id/iv_from"
android:layout_width="15mm"
android:layout_height="20mm"
android:src="@mipmap/arrow_right_gray" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论