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

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

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