提交 403825c7 authored 作者: lgd's avatar lgd

1.交付时间小于30天提醒取消(app

2.外采购、供应账套默认设为钢控(app)
3.外采购订单下单选产品的时候,可编辑内部价格(销售价格上面加一个内部价);   供应订单下单选产品可编辑价格,默认为渠道价格
销售,外采购,供应,组装下单选择客户或者供应商是同一个接口,参数不同
上级 d902ec75
...@@ -172,6 +172,15 @@ public class ProductBean { ...@@ -172,6 +172,15 @@ public class ProductBean {
private double innerPrice; private double innerPrice;
private int flag;// 0 未超出,1 超出预警值 private int flag;// 0 未超出,1 超出预警值
private MarkBean markOrderRel; private MarkBean markOrderRel;
private String carInnerPrice;
public String getCarInnerPrice() {
return carInnerPrice;
}
public void setCarInnerPrice(String carInnerPrice) {
this.carInnerPrice = carInnerPrice;
}
public MarkBean getMarkOrderRel() { public MarkBean getMarkOrderRel() {
return markOrderRel; return markOrderRel;
......
...@@ -140,7 +140,7 @@ public class ChooseInfoActivity extends WorkToolBarActivity implements BatChoose ...@@ -140,7 +140,7 @@ public class ChooseInfoActivity extends WorkToolBarActivity implements BatChoose
@Override @Override
protected void initData() { protected void initData() {
proList = new ArrayList<>(); proList = new ArrayList<>();
if (TextUtils.equals("3", type)) { if (TextUtils.equals("2", type)) {
proAdapter = new StoreProductAdapter(R.layout.item_store_product, proList, 2); proAdapter = new StoreProductAdapter(R.layout.item_store_product, proList, 2);
} else { } else {
proAdapter = new StoreProductAdapter(R.layout.item_store_product, proList); proAdapter = new StoreProductAdapter(R.layout.item_store_product, proList);
...@@ -259,12 +259,19 @@ public class ChooseInfoActivity extends WorkToolBarActivity implements BatChoose ...@@ -259,12 +259,19 @@ public class ChooseInfoActivity extends WorkToolBarActivity implements BatChoose
); );
break; break;
case R.id.ll_client: case R.id.ll_client:
//TODO 确认接口
switch (type) { switch (type) {
case "1": case "1":
startActivityForResult(StoreSaleClientActivity.class, 10001, "code", "CUSTOMER"); startActivityForResult(StoreSaleClientActivity.class, 10001,
"depId",UserKeeper.getInstance().getUserDepId(),
"code", "CUSTOMER",
"processes", permissionCode);
break; break;
case "2": case "2":
startActivityForResult(StoreSaleClientActivity.class, 10001, "code", "CUSTOMER"); startActivityForResult(StoreSaleClientActivity.class, 10001,
"depId",UserKeeper.getInstance().getUserDepId(),
"code", "CUSTOMER",
"processes", permissionCode);
break; break;
case "3": case "3":
break; break;
...@@ -283,13 +290,15 @@ public class ChooseInfoActivity extends WorkToolBarActivity implements BatChoose ...@@ -283,13 +290,15 @@ public class ChooseInfoActivity extends WorkToolBarActivity implements BatChoose
case "2": case "2":
startActivityForResult(StoreSaleClientActivity.class, 10002, startActivityForResult(StoreSaleClientActivity.class, 10002,
"depId", getIntent().getStringExtra("deptId"), "depId", getIntent().getStringExtra("deptId"),
"flag", "1", "code", "SUPPLIER", "supplier", "选择供应商"); "flag", "1", "code", "SUPPLIER", "supplier", "选择供应商",
"processes", "PROCESS_PACKAGE");
break; break;
case "3": case "3":
startActivityForResult(StoreSaleClientActivity.class, 10002, startActivityForResult(StoreSaleClientActivity.class, 10002,
"flag", "1", "flag", "1",
"depId", getIntent().getStringExtra("deptId"), "depId", getIntent().getStringExtra("deptId"),
"code", "SUPPLIER", "supplier", "选择供应商"); "code", "SUPPLIER", "supplier", "选择供应商",
"processes", "PROCESS_PACKAGE");
break; break;
case "4": case "4":
break; break;
...@@ -727,20 +736,26 @@ public class ChooseInfoActivity extends WorkToolBarActivity implements BatChoose ...@@ -727,20 +736,26 @@ public class ChooseInfoActivity extends WorkToolBarActivity implements BatChoose
AlertDialog.Builder builder = new AlertDialog.Builder(this); AlertDialog.Builder builder = new AlertDialog.Builder(this);
View view = LayoutInflater.from(this).inflate(R.layout.view_add_cart, null); View view = LayoutInflater.from(this).inflate(R.layout.view_add_cart, null);
LinearLayout llPrice = view.findViewById(R.id.ll_price); LinearLayout llPrice = view.findViewById(R.id.ll_price);
LinearLayout llInnerPrice = view.findViewById(R.id.ll_inner_price);
TextView tvOk = view.findViewById(R.id.tv_ok); TextView tvOk = view.findViewById(R.id.tv_ok);
TextView tvCancel = view.findViewById(R.id.tv_cancel); TextView tvCancel = view.findViewById(R.id.tv_cancel);
AddAndReduceView num = view.findViewById(R.id.ar_num); AddAndReduceView num = view.findViewById(R.id.ar_num);
EditText etPrice = view.findViewById(R.id.et_price); EditText etPrice = view.findViewById(R.id.et_price);
EditText etInnerPrice = view.findViewById(R.id.et_inner_price);
WorkUtils.addDecimalsListener(etPrice); WorkUtils.addDecimalsListener(etPrice);
etPrice.setText(MathUtils.converData(data.getInternalPrice(), 3)); etPrice.setText(MathUtils.converData(data.getInternalPrice(), 3));
if (TextUtils.equals(permissionCode, PermissionType.PROCESS_SUPPLY.getCode())) { etInnerPrice.setText(MathUtils.converData(data.getInternalPrice(), 3));
llPrice.setVisibility(View.GONE); //TODO 供应价格显示文案,渠道价格是InternalPrice吗?
if (TextUtils.equals(permissionCode, PermissionType.PROCESS_PURCHASE.getCode())) {
llInnerPrice.setVisibility(View.VISIBLE);
} else { } else {
for (ProductBean.RecordsBean recordsBean : carList) { llInnerPrice.setVisibility(View.GONE);
if (data.getId() == recordsBean.getId()) { }
etPrice.setText(recordsBean.getCarPrice()); for (ProductBean.RecordsBean recordsBean : carList) {
num.setNumber(recordsBean.getCarNum()); if (data.getId() == recordsBean.getId()) {
} etInnerPrice.setText(recordsBean.getCarInnerPrice());
etPrice.setText(recordsBean.getCarPrice());
num.setNumber(recordsBean.getCarNum());
} }
} }
builder.setView(view); builder.setView(view);
...@@ -748,7 +763,12 @@ public class ChooseInfoActivity extends WorkToolBarActivity implements BatChoose ...@@ -748,7 +763,12 @@ public class ChooseInfoActivity extends WorkToolBarActivity implements BatChoose
tvOk.setOnClickListener(new View.OnClickListener() { tvOk.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
if (!TextUtils.equals(permissionCode, PermissionType.PROCESS_SUPPLY.getCode()) && TextUtils.isEmpty(etPrice.getText().toString())) { if (TextUtils.equals(permissionCode, PermissionType.PROCESS_PURCHASE.getCode())
&& TextUtils.isEmpty(etInnerPrice.getText().toString())) {
toast("请填写内部单价");
return;
}
if (TextUtils.isEmpty(etPrice.getText().toString())) {
toast("请填写销售单价"); toast("请填写销售单价");
return; return;
} }
...@@ -756,7 +776,7 @@ public class ChooseInfoActivity extends WorkToolBarActivity implements BatChoose ...@@ -756,7 +776,7 @@ public class ChooseInfoActivity extends WorkToolBarActivity implements BatChoose
toast("请选择数量"); toast("请选择数量");
return; return;
} }
addCart(data, num.getNumber(), etPrice.getText().toString()); addCart(data, num.getNumber(), etPrice.getText().toString(), etInnerPrice.getText().toString());
addCartDialog.dismiss(); addCartDialog.dismiss();
} }
}); });
...@@ -771,23 +791,27 @@ public class ChooseInfoActivity extends WorkToolBarActivity implements BatChoose ...@@ -771,23 +791,27 @@ public class ChooseInfoActivity extends WorkToolBarActivity implements BatChoose
/** /**
* 添加购物车 * 添加购物车
* * @param chooseProduct 产品
* @param chooseProduct 产品
* @param number 数量 * @param number 数量
* @param price 单价 * @param price 单价
* @param innerPrice 外采购修改内部单价
*/ */
private void addCart(ProductBean.RecordsBean chooseProduct, String number, String price) { private void addCart(ProductBean.RecordsBean chooseProduct, String number, String price, String innerPrice) {
boolean isHas = false; boolean isHas = false;
for (ProductBean.RecordsBean recordsBean : carList) { for (ProductBean.RecordsBean recordsBean : carList) {
if (chooseProduct.getId() == recordsBean.getId()) { if (chooseProduct.getId() == recordsBean.getId()) {
isHas = true; isHas = true;
recordsBean.setCarNum(number); recordsBean.setCarNum(number);
recordsBean.setCarPrice(price); recordsBean.setCarPrice(price);
recordsBean.setCarInnerPrice(innerPrice);
recordsBean.setInternalPrice(Double.parseDouble(innerPrice));
} }
} }
if (!isHas) { if (!isHas) {
chooseProduct.setCarNum(number); chooseProduct.setCarNum(number);
chooseProduct.setCarPrice(price); chooseProduct.setCarPrice(price);
chooseProduct.setCarInnerPrice(innerPrice);
chooseProduct.setInternalPrice(Double.parseDouble(innerPrice));
carList.add(chooseProduct); carList.add(chooseProduct);
} }
proAdapter.notifyDataSetChanged(); proAdapter.notifyDataSetChanged();
...@@ -842,7 +866,7 @@ public class ChooseInfoActivity extends WorkToolBarActivity implements BatChoose ...@@ -842,7 +866,7 @@ public class ChooseInfoActivity extends WorkToolBarActivity implements BatChoose
@Override @Override
public void onClick(View v) { public void onClick(View v) {
String number = useNum.getNumber(); String number = useNum.getNumber();
if (Double.valueOf(number) == 0d) { if (Double.parseDouble(number) == 0d) {
toast("请选择使用数量"); toast("请选择使用数量");
return; return;
} }
...@@ -949,12 +973,14 @@ public class ChooseInfoActivity extends WorkToolBarActivity implements BatChoose ...@@ -949,12 +973,14 @@ public class ChooseInfoActivity extends WorkToolBarActivity implements BatChoose
for (ProductBean.RecordsBean proInfo : proList) {//购物车信息置空 for (ProductBean.RecordsBean proInfo : proList) {//购物车信息置空
proInfo.setCarNum(null); proInfo.setCarNum(null);
proInfo.setCarPrice(null); proInfo.setCarPrice(null);
proInfo.setCarInnerPrice(null);
} }
for (ProductBean.RecordsBean recordsBean : carList) { for (ProductBean.RecordsBean recordsBean : carList) {
for (ProductBean.RecordsBean bean : proList) { for (ProductBean.RecordsBean bean : proList) {
if (bean.getId() == recordsBean.getId()) { if (bean.getId() == recordsBean.getId()) {
bean.setCarNum(recordsBean.getCarNum()); bean.setCarNum(recordsBean.getCarNum());
bean.setCarPrice(recordsBean.getCarPrice()); bean.setCarPrice(recordsBean.getCarPrice());
bean.setCarInnerPrice(recordsBean.getCarInnerPrice());
} }
} }
......
...@@ -74,7 +74,7 @@ public class StoreSaleCarActivity extends WorkToolBarActivity { ...@@ -74,7 +74,7 @@ public class StoreSaleCarActivity extends WorkToolBarActivity {
@Override @Override
protected void initData() { protected void initData() {
productList = new ArrayList<>(); productList = new ArrayList<>();
if (TextUtils.equals(PermissionType.PROCESS_SUPPLY.getCode(), getIntent().getStringExtra("code"))) { if (!TextUtils.equals(PermissionType.PROCESS_PURCHASE.getCode(), getIntent().getStringExtra("code"))) {
productAdapter = new StoreCarAdapter(R.layout.item_store_car, productList, 2); productAdapter = new StoreCarAdapter(R.layout.item_store_car, productList, 2);
} else { } else {
productAdapter = new StoreCarAdapter(R.layout.item_store_car, productList); productAdapter = new StoreCarAdapter(R.layout.item_store_car, productList);
......
...@@ -68,6 +68,11 @@ public class StoreSaleClientActivity extends WorkToolBarActivity { ...@@ -68,6 +68,11 @@ public class StoreSaleClientActivity extends WorkToolBarActivity {
clientAdapter.bindToRecyclerView(rvClient); clientAdapter.bindToRecyclerView(rvClient);
clientAdapter.setEmptyView(R.layout.view_empty_content, rvClient); clientAdapter.setEmptyView(R.layout.view_empty_content, rvClient);
param = WorkUtils.pageKey(); param = WorkUtils.pageKey();
String processes = getIntent().getStringExtra("processes");
//下单页面参数
if (!TextUtils.isEmpty(processes)) {
param.put("processes", processes);
}
if (TextUtils.isEmpty(getIntent().getStringExtra("flag"))) { if (TextUtils.isEmpty(getIntent().getStringExtra("flag"))) {
param.put("partTypeCode", getIntent().getStringExtra("code")); param.put("partTypeCode", getIntent().getStringExtra("code"));
} else { } else {
......
...@@ -162,10 +162,16 @@ public class StoreSaleConfirmActivity extends WorkToolBarActivity { ...@@ -162,10 +162,16 @@ public class StoreSaleConfirmActivity extends WorkToolBarActivity {
rlBill.setVisibility(View.GONE); rlBill.setVisibility(View.GONE);
} }
//隐藏唛头 //隐藏唛头
if (!TextUtils.equals(code, PermissionType.PROCESS_SALE.getCode())){ if (!TextUtils.equals(code, PermissionType.PROCESS_SALE.getCode())) {
llSaleMark.setVisibility(View.GONE); llSaleMark.setVisibility(View.GONE);
} }
expandInfo = new HashMap<>();
//外采购、供应账套默认设为钢控
if (TextUtils.equals(code, PermissionType.PROCESS_PURCHASE.getCode()) ||
TextUtils.equals(code, PermissionType.PROCESS_SUPPLY.getCode())) {
expandInfo.put("outdeptLedger", "gk");
tvSet.setText(setArray[0]);
}
} }
...@@ -195,7 +201,6 @@ public class StoreSaleConfirmActivity extends WorkToolBarActivity { ...@@ -195,7 +201,6 @@ public class StoreSaleConfirmActivity extends WorkToolBarActivity {
param.put("launchOrderAmount", getIntent().getStringExtra("launchOrderAmount")); param.put("launchOrderAmount", getIntent().getStringExtra("launchOrderAmount"));
param.put("launchUserId", UserKeeper.getInstance().getUserId()); param.put("launchUserId", UserKeeper.getInstance().getUserId());
param.put("launchDeptId", UserKeeper.getInstance().getUserDepId()); param.put("launchDeptId", UserKeeper.getInstance().getUserDepId());
expandInfo = new HashMap<>();
getBillData(); getBillData();
} }
...@@ -255,7 +260,7 @@ public class StoreSaleConfirmActivity extends WorkToolBarActivity { ...@@ -255,7 +260,7 @@ public class StoreSaleConfirmActivity extends WorkToolBarActivity {
} }
if (TextUtils.equals(getIntent().getStringExtra("code"), if (TextUtils.equals(getIntent().getStringExtra("code"),
PermissionType.PROCESS_SALE.getCode())) { PermissionType.PROCESS_SALE.getCode())) {
if (null!= recordsBean.getMarkOrderRel()){ if (null != recordsBean.getMarkOrderRel()) {
recordsBean.getMarkOrderRel().setReceiveCompany(etCompany.getText().toString()); recordsBean.getMarkOrderRel().setReceiveCompany(etCompany.getText().toString());
recordsBean.getMarkOrderRel().setContinuousCastingMachine(etMachine.getText().toString()); recordsBean.getMarkOrderRel().setContinuousCastingMachine(etMachine.getText().toString());
recordsBean.getMarkOrderRel().setShipCompany(etSendCompany.getText().toString()); recordsBean.getMarkOrderRel().setShipCompany(etSendCompany.getText().toString());
...@@ -366,28 +371,29 @@ public class StoreSaleConfirmActivity extends WorkToolBarActivity { ...@@ -366,28 +371,29 @@ public class StoreSaleConfirmActivity extends WorkToolBarActivity {
expandInfo.put("outerStore", getIntent().getStringExtra("outerStore")); expandInfo.put("outerStore", getIntent().getStringExtra("outerStore"));
} }
orderItems = coverProInfo(proList); orderItems = coverProInfo(proList);
String stringByNow = TimeUtils.getFitTimeSpanByNow(tvTime.getText().toString(), new SimpleDateFormat("yyyy-MM-dd"), 1); //去掉30天交付判断
if (stringByNow.endsWith("天")) { // String stringByNow = TimeUtils.getFitTimeSpanByNow(tvTime.getText().toString(), new SimpleDateFormat("yyyy-MM-dd"), 1);
String day = stringByNow.substring(0, stringByNow.length() - 1); // if (stringByNow.endsWith("天")) {
if (Integer.valueOf(day) < 30) { // String day = stringByNow.substring(0, stringByNow.length() - 1);
QMUIDialog.MessageDialogBuilder builder = DialogUtils.okAndCancelDialog(this); // if (Integer.valueOf(day) < 30) {
builder.setTitle("提示").setMessage("交付日期小于30天,订单价格会增加"). // QMUIDialog.MessageDialogBuilder builder = DialogUtils.okAndCancelDialog(this);
addAction("取消", new QMUIDialogAction.ActionListener() { // builder.setTitle("提示").setMessage("交付日期小于30天,订单价格会增加").
@Override // addAction("取消", new QMUIDialogAction.ActionListener() {
public void onClick(QMUIDialog dialog, int index) { // @Override
dialog.dismiss(); // public void onClick(QMUIDialog dialog, int index) {
} // dialog.dismiss();
}) // }
.addAction("确定", new QMUIDialogAction.ActionListener() { // })
@Override // .addAction("确定", new QMUIDialogAction.ActionListener() {
public void onClick(QMUIDialog dialog, int index) { // @Override
submitOrder(); // public void onClick(QMUIDialog dialog, int index) {
dialog.dismiss(); // submitOrder();
} // dialog.dismiss();
}).show(); // }
return; // }).show();
} // return;
} // }
// }
submitOrder(); submitOrder();
break; break;
case R.id.rl_set: case R.id.rl_set:
......
...@@ -247,28 +247,28 @@ public class StoreTradingConfirmActivity extends WorkToolBarActivity { ...@@ -247,28 +247,28 @@ public class StoreTradingConfirmActivity extends WorkToolBarActivity {
expandInfo.put("demond5", etInput1.getText().toString()); expandInfo.put("demond5", etInput1.getText().toString());
expandInfo.put("comments", etInput5.getText().toString()); expandInfo.put("comments", etInput5.getText().toString());
orderItems = coverProInfo(proList); orderItems = coverProInfo(proList);
String stringByNow = TimeUtils.getFitTimeSpanByNow(tvTime.getText().toString(), new SimpleDateFormat("yyyy-MM-dd"), 1); // String stringByNow = TimeUtils.getFitTimeSpanByNow(tvTime.getText().toString(), new SimpleDateFormat("yyyy-MM-dd"), 1);
if (stringByNow.endsWith("天")) { // if (stringByNow.endsWith("天")) {
String day = stringByNow.substring(0, stringByNow.length() - 1); // String day = stringByNow.substring(0, stringByNow.length() - 1);
if (Integer.valueOf(day) < 30) { // if (Integer.valueOf(day) < 30) {
QMUIDialog.MessageDialogBuilder builder = DialogUtils.okAndCancelDialog(this); // QMUIDialog.MessageDialogBuilder builder = DialogUtils.okAndCancelDialog(this);
builder.setTitle("提示").setMessage("交付日期小于30天,订单价格会增加"). // builder.setTitle("提示").setMessage("交付日期小于30天,订单价格会增加").
addAction("取消", new QMUIDialogAction.ActionListener() { // addAction("取消", new QMUIDialogAction.ActionListener() {
@Override // @Override
public void onClick(QMUIDialog dialog, int index) { // public void onClick(QMUIDialog dialog, int index) {
dialog.dismiss(); // dialog.dismiss();
} // }
}) // })
.addAction("确定", new QMUIDialogAction.ActionListener() { // .addAction("确定", new QMUIDialogAction.ActionListener() {
@Override // @Override
public void onClick(QMUIDialog dialog, int index) { // public void onClick(QMUIDialog dialog, int index) {
submitOrder(); // submitOrder();
dialog.dismiss(); // dialog.dismiss();
} // }
}).show(); // }).show();
return; // return;
} // }
} // }
submitOrder(); submitOrder();
break; break;
case R.id.rl_set: case R.id.rl_set:
......
...@@ -29,7 +29,7 @@ import flexible.xd.android_base.utils.ToastUtil; ...@@ -29,7 +29,7 @@ import flexible.xd.android_base.utils.ToastUtil;
*/ */
public class StoreCarAdapter extends BaseQuickAdapter<ProductBean.RecordsBean, BaseViewHolder> { public class StoreCarAdapter extends BaseQuickAdapter<ProductBean.RecordsBean, BaseViewHolder> {
int type = 0;//1 确认订单页面 2 单数量无价格 int type = 0;// 0 购物车外采购 1 确认订单页面 2 购物车除了外采购
private int curFocusPosition = -1; private int curFocusPosition = -1;
private String orderType; private String orderType;
...@@ -78,6 +78,7 @@ public class StoreCarAdapter extends BaseQuickAdapter<ProductBean.RecordsBean, B ...@@ -78,6 +78,7 @@ public class StoreCarAdapter extends BaseQuickAdapter<ProductBean.RecordsBean, B
} }
helper.setGone(R.id.rl_mark, TextUtils.equals(orderType, PermissionType.PROCESS_SALE.getCode())); helper.setGone(R.id.rl_mark, TextUtils.equals(orderType, PermissionType.PROCESS_SALE.getCode()));
} else if (type == 2) { } else if (type == 2) {
helper.setGone(R.id.ll_inner_price, false);
helper.setGone(R.id.tv_desc, item.getFlag() == 1); helper.setGone(R.id.tv_desc, item.getFlag() == 1);
helper.addOnClickListener(R.id.tv_delete); helper.addOnClickListener(R.id.tv_delete);
AddAndReduceView num = helper.getView(R.id.ar_num); AddAndReduceView num = helper.getView(R.id.ar_num);
...@@ -92,7 +93,33 @@ public class StoreCarAdapter extends BaseQuickAdapter<ProductBean.RecordsBean, B ...@@ -92,7 +93,33 @@ public class StoreCarAdapter extends BaseQuickAdapter<ProductBean.RecordsBean, B
} }
}); });
EditText etPrice = helper.getView(R.id.et_price); EditText etPrice = helper.getView(R.id.et_price);
helper.setGone(R.id.ll_price, false); etPrice.setText(item.getCarPrice());
WorkUtils.addDecimalsListener(etPrice);
etPrice.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
if (TextUtils.isEmpty(s)) {
ToastUtil.showShort("请输入销售单价");
return;
}
if (!TextUtils.equals(s.toString(), item.getCarPrice())) {
item.setCarPrice(s.toString());
helper.setText(R.id.tv_all_price, MathUtils.multiply(item.getCarNum(), MathUtils.converData(item.getInternalPrice(), 3), 3));
EventBus.getDefault().post(new ModifyCarEvent(JSON.toJSONString(getData())));
}
}
});
num.setNumber(item.getCarNum()); num.setNumber(item.getCarNum());
num.setNumFocusListener(new View.OnFocusChangeListener() { num.setNumFocusListener(new View.OnFocusChangeListener() {
@Override @Override
...@@ -119,7 +146,36 @@ public class StoreCarAdapter extends BaseQuickAdapter<ProductBean.RecordsBean, B ...@@ -119,7 +146,36 @@ public class StoreCarAdapter extends BaseQuickAdapter<ProductBean.RecordsBean, B
EditText etPrice = helper.getView(R.id.et_price); EditText etPrice = helper.getView(R.id.et_price);
etPrice.setText(item.getCarPrice()); etPrice.setText(item.getCarPrice());
WorkUtils.addDecimalsListener(etPrice); WorkUtils.addDecimalsListener(etPrice);
EditText etInnerPrice = helper.getView(R.id.et_inner_price);
etInnerPrice.setText(item.getCarInnerPrice());
WorkUtils.addDecimalsListener(etInnerPrice);
etInnerPrice.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
if (TextUtils.isEmpty(s)) {
ToastUtil.showShort("请输入内部单价");
return;
}
if (!TextUtils.equals(s.toString(), item.getCarInnerPrice())) {
item.setCarInnerPrice(s.toString());
item.setInternalPrice(Double.parseDouble(s.toString()));
EventBus.getDefault().post(new ModifyCarEvent(JSON.toJSONString(getData())));
}
}
});
etPrice.addTextChangedListener(new TextWatcher() { etPrice.addTextChangedListener(new TextWatcher() {
@Override @Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) { public void beforeTextChanged(CharSequence s, int start, int count, int after) {
......
...@@ -18,7 +18,7 @@ import androidx.annotation.Nullable; ...@@ -18,7 +18,7 @@ import androidx.annotation.Nullable;
*/ */
public class StoreProductAdapter extends BaseQuickAdapter<ProductBean.RecordsBean, BaseViewHolder> { public class StoreProductAdapter extends BaseQuickAdapter<ProductBean.RecordsBean, BaseViewHolder> {
int type;//1坩埚页面 ,2 供应不显示销售价格 int type;//1坩埚页面 ,2 外采购多显示内部价格
public StoreProductAdapter(int layoutResId, List data) { public StoreProductAdapter(int layoutResId, List data) {
super(layoutResId, data); super(layoutResId, data);
...@@ -50,8 +50,10 @@ public class StoreProductAdapter extends BaseQuickAdapter<ProductBean.RecordsBea ...@@ -50,8 +50,10 @@ public class StoreProductAdapter extends BaseQuickAdapter<ProductBean.RecordsBea
helper.setText(R.id.tv_num, String.valueOf(item.getCanUseProductSum())); helper.setText(R.id.tv_num, String.valueOf(item.getCanUseProductSum()));
} }
if (type == 2) { if (type == 2) {
helper.setGone(R.id.tv_price_desc, false); //TODO 外采购显示内部价格desc
helper.setGone(R.id.tv_sale_price, false); // helper.setGone(R.id.tv_inner_price_desc, true);
// helper.setGone(R.id.tv_inner_price, true);
// helper.setText(R.id.tv_inner_price, "¥".concat(MathUtils.converData(item.getCarInnerPrice(), 3)));
} }
} }
} }
......
...@@ -153,7 +153,37 @@ ...@@ -153,7 +153,37 @@
</RelativeLayout> </RelativeLayout>
</LinearLayout> </LinearLayout>
<LinearLayout
android:id="@+id/ll_inner_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginTop="30mm"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="内部单价"
android:textColor="@color/flexible_text_sup"
android:textSize="17sp" />
<EditText
android:id="@+id/et_inner_price"
android:layout_width="150mm"
android:layout_height="30mm"
android:layout_marginLeft="10mm"
android:background="@drawable/shape_add_cart"
android:gravity="right|center_vertical"
android:hint="¥0.00"
android:inputType="numberDecimal"
android:paddingHorizontal="10mm"
android:paddingVertical="4mm"
android:textColor="@color/flexible_text_sup"
android:textColorHint="#91ABBA"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/ll_price" android:id="@+id/ll_price"
android:layout_width="wrap_content" android:layout_width="wrap_content"
......
...@@ -175,11 +175,29 @@ ...@@ -175,11 +175,29 @@
android:layout_weight="1" android:layout_weight="1"
android:visibility="invisible"> android:visibility="invisible">
<TextView
android:id="@+id/tv_inner_price_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="内部单价:"
android:visibility="gone"
android:textColor="@color/red_btn_bg"
android:textSize="13sp" />
<TextView
android:id="@+id/tv_inner_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
android:maxWidth="100mm"
android:textColor="@color/red_btn_bg"
android:textSize="13sp" />
<TextView <TextView
android:id="@+id/tv_price_desc" android:id="@+id/tv_price_desc"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="销售单价:" android:text="销售单价:"
android:layout_marginLeft="15mm"
android:textColor="@color/red_btn_bg" android:textColor="@color/red_btn_bg"
android:textSize="13sp" /> android:textSize="13sp" />
......
...@@ -15,7 +15,37 @@ ...@@ -15,7 +15,37 @@
android:text="加入购物车" android:text="加入购物车"
android:textSize="17sp" android:textSize="17sp"
android:textStyle="bold" /> android:textStyle="bold" />
<LinearLayout
android:id="@+id/ll_inner_price"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30mm"
android:orientation="horizontal"
android:paddingHorizontal="20mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="内部单价"
android:textColor="@color/flexible_text_sup"
android:textSize="17sp" />
<EditText
android:id="@+id/et_inner_price"
android:layout_width="match_parent"
android:layout_height="30mm"
android:layout_marginLeft="10mm"
android:background="@drawable/shape_add_cart"
android:gravity="right|center_vertical"
android:hint="预计内部单价"
android:inputType="numberDecimal"
android:paddingHorizontal="10mm"
android:paddingVertical="4mm"
android:textColor="@color/flexible_text_sup"
android:textColorHint="#91ABBA"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/ll_price" android:id="@+id/ll_price"
android:layout_width="match_parent" android:layout_width="match_parent"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论