提交 1b2ddf5c authored 作者: lgd's avatar lgd

1.修改数字增减框bug

2.//TODO 坩埚下单,mes其他页面,mes用户反馈空也展示,编辑任务担当无法修改
上级 36d33404
...@@ -20,7 +20,6 @@ import com.wd.workoffice.bean.workEnum.PermissionType; ...@@ -20,7 +20,6 @@ import com.wd.workoffice.bean.workEnum.PermissionType;
import com.wd.workoffice.ui.activity.bat.store.StoreSaleCarActivity; import com.wd.workoffice.ui.activity.bat.store.StoreSaleCarActivity;
import com.wd.workoffice.ui.adapter.StoreProductAdapter; import com.wd.workoffice.ui.adapter.StoreProductAdapter;
import com.wd.workoffice.util.WorkUtils; import com.wd.workoffice.util.WorkUtils;
import com.wd.workoffice.widget.AddAndReduceDoubleView;
import com.wd.workoffice.widget.AddAndReduceView; import com.wd.workoffice.widget.AddAndReduceView;
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.EventBus;
...@@ -65,13 +64,13 @@ public class AddCrucibleProductActivity extends WorkToolBarActivity { ...@@ -65,13 +64,13 @@ public class AddCrucibleProductActivity extends WorkToolBarActivity {
View view = LayoutInflater.from(this).inflate(R.layout.view_add_cart_double, null); View view = LayoutInflater.from(this).inflate(R.layout.view_add_cart_double, null);
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);
AddAndReduceDoubleView num = view.findViewById(R.id.ar_num); AddAndReduceView num = view.findViewById(R.id.ar_num);
num.setMaxNum(data.getCanUseProductSum()); num.setMaxNum(data.getCanUseProductSum());
EditText etPrice = view.findViewById(R.id.et_price); EditText etPrice = view.findViewById(R.id.et_price);
for (ProductBean.RecordsBean recordsBean : carList) { for (ProductBean.RecordsBean recordsBean : carList) {
if (data.getId() == recordsBean.getId()) { if (data.getId() == recordsBean.getId()) {
etPrice.setText(recordsBean.getCarPrice()); etPrice.setText(recordsBean.getCarPrice());
num.setNumber(recordsBean.getCarDoubleNum()); num.setNumber(recordsBean.getCarNum());
} }
} }
builder.setView(view); builder.setView(view);
...@@ -83,7 +82,7 @@ public class AddCrucibleProductActivity extends WorkToolBarActivity { ...@@ -83,7 +82,7 @@ public class AddCrucibleProductActivity extends WorkToolBarActivity {
toast("请填写外部价格"); toast("请填写外部价格");
return; return;
} }
if (num.getNumber() == 0d) { if (Double.valueOf(num.getNumber()) == 0d) {
toast("请填写数量"); toast("请填写数量");
return; return;
} }
...@@ -107,17 +106,17 @@ public class AddCrucibleProductActivity extends WorkToolBarActivity { ...@@ -107,17 +106,17 @@ public class AddCrucibleProductActivity extends WorkToolBarActivity {
* @param number 数量 * @param number 数量
* @param price 单价 * @param price 单价
*/ */
private void addCart(ProductBean.RecordsBean chooseProduct, double number, String price) { private void addCart(ProductBean.RecordsBean chooseProduct, String number, String price) {
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.setCarDoubleNum(number); recordsBean.setCarNum(number);
recordsBean.setCarPrice(price); recordsBean.setCarPrice(price);
} }
} }
if (!isHas) { if (!isHas) {
chooseProduct.setCarDoubleNum(number); chooseProduct.setCarNum(number);
chooseProduct.setCarPrice(price); chooseProduct.setCarPrice(price);
carList.add(chooseProduct); carList.add(chooseProduct);
} }
......
package com.wd.workoffice.ui.activity.bat.order; package com.wd.workoffice.ui.activity.bat.order;
import android.text.TextUtils;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.widget.Button; import android.widget.Button;
...@@ -9,25 +8,16 @@ import android.widget.RelativeLayout; ...@@ -9,25 +8,16 @@ import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.chad.library.adapter.base.BaseQuickAdapter; 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.ProAddBean; import com.wd.workoffice.bean.ProAddBean;
import com.wd.workoffice.bean.ProPriceBean;
import com.wd.workoffice.bean.TicketAddBean;
import com.wd.workoffice.bean.TicketDetailBean;
import com.wd.workoffice.bean.event.CheckTicketEvent; import com.wd.workoffice.bean.event.CheckTicketEvent;
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.StoreSaleCarActivity;
import com.wd.workoffice.ui.activity.bat.work.WorkFinancialReceiveTicketSubmitActivity;
import com.wd.workoffice.ui.activity.bat.work.WorkFinancialTicketSubmitActivity;
import com.wd.workoffice.ui.adapter.ProAddAdapter; import com.wd.workoffice.ui.adapter.ProAddAdapter;
import com.wd.workoffice.ui.adapter.WorkAddTicketOrderAdapter;
import com.wd.workoffice.util.WorkUtils; import com.wd.workoffice.util.WorkUtils;
import com.wd.workoffice.widget.AddAndReduceDoubleView;
import com.wd.workoffice.widget.AddAndReduceView; import com.wd.workoffice.widget.AddAndReduceView;
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.EventBus;
...@@ -44,7 +34,6 @@ import butterknife.BindView; ...@@ -44,7 +34,6 @@ import butterknife.BindView;
import butterknife.ButterKnife; import butterknife.ButterKnife;
import butterknife.OnClick; import butterknife.OnClick;
import flexible.xd.android_base.network.rtfhttp.Transformer; import flexible.xd.android_base.network.rtfhttp.Transformer;
import io.reactivex.Observable;
import io.reactivex.disposables.Disposable; import io.reactivex.disposables.Disposable;
/** /**
...@@ -86,13 +75,13 @@ public class ProductOrderProActivity extends WorkToolBarActivity { ...@@ -86,13 +75,13 @@ public class ProductOrderProActivity extends WorkToolBarActivity {
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);
TextView tvDesc = view.findViewById(R.id.tv_desc); TextView tvDesc = view.findViewById(R.id.tv_desc);
AddAndReduceDoubleView num = view.findViewById(R.id.ar_num); AddAndReduceView num = view.findViewById(R.id.ar_num);
TextView etPrice = view.findViewById(R.id.et_price); TextView etPrice = view.findViewById(R.id.et_price);
etPrice.setClickable(false); etPrice.setClickable(false);
for (ProAddBean.RecordsBean recordsBean : carList) { for (ProAddBean.RecordsBean recordsBean : carList) {
if (data.getId() == recordsBean.getId()) { if (data.getId() == recordsBean.getId()) {
// etPrice.setText(recordsBean.getCarPrice()); // etPrice.setText(recordsBean.getCarPrice());
num.setNumber(Double.valueOf(recordsBean.getCarNum())); num.setNumber(recordsBean.getCarNum());
} }
} }
etPrice.setText(String.valueOf(data.getCanPackageSum())); etPrice.setText(String.valueOf(data.getCanPackageSum()));
...@@ -102,7 +91,7 @@ public class ProductOrderProActivity extends WorkToolBarActivity { ...@@ -102,7 +91,7 @@ public class ProductOrderProActivity extends WorkToolBarActivity {
tvOk.setOnClickListener(new View.OnClickListener() { tvOk.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
if (num.getNumber() == 0d) { if (Double.valueOf(num.getNumber()) == 0d) {
toast("请填写数量"); toast("请填写数量");
return; return;
} }
...@@ -127,7 +116,7 @@ public class ProductOrderProActivity extends WorkToolBarActivity { ...@@ -127,7 +116,7 @@ public class ProductOrderProActivity extends WorkToolBarActivity {
* @param chooseProduct 产品 * @param chooseProduct 产品
* @param number 数量 * @param number 数量
*/ */
private void addCart(ProAddBean.RecordsBean chooseProduct, double number) { private void addCart(ProAddBean.RecordsBean chooseProduct, String number) {
boolean isHas = false; boolean isHas = false;
for (ProAddBean.RecordsBean recordsBean : carList) { for (ProAddBean.RecordsBean recordsBean : carList) {
if (chooseProduct.getId() == recordsBean.getId()) { if (chooseProduct.getId() == recordsBean.getId()) {
......
...@@ -317,7 +317,24 @@ public class SendApplyAddActivity extends WorkToolBarActivity { ...@@ -317,7 +317,24 @@ public class SendApplyAddActivity extends WorkToolBarActivity {
@Subscribe @Subscribe
public void refresh(SendWeightEvent event) { public void refresh(SendWeightEvent event) {
coverProInfo();
Map<Integer, Boolean> isChoose = dataAdapter.getIsChoose();
List<JSONObject> info = new ArrayList<>();
String totalWeight = "0";
for (Map.Entry<Integer, Boolean> entry : isChoose.entrySet()) {
if (entry.getValue()) {
OrderDetail.OrderItemsBean recordsBean = dataList.get(entry.getKey());
JSONObject returnData = new JSONObject();
if (TextUtils.isEmpty(recordsBean.getChooseNum()) || Double.valueOf(recordsBean.getChooseNum()) == 0d) {
}
totalWeight = MathUtils.add(totalWeight, MathUtils.multiply(recordsBean.getChooseNum(),
String.valueOf(recordsBean.getProductWeight()), 3), 3);
returnData.put("productId", recordsBean.getProductId());
returnData.put("productAmount", recordsBean.getChooseNum());
info.add(returnData);
}
}
tvWeight.setText(totalWeight);
} }
} }
...@@ -16,7 +16,6 @@ import com.alibaba.fastjson.JSON; ...@@ -16,7 +16,6 @@ import com.alibaba.fastjson.JSON;
import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseQuickAdapter;
import com.qmuiteam.qmui.widget.dialog.QMUIDialog; import com.qmuiteam.qmui.widget.dialog.QMUIDialog;
import com.wd.workoffice.R; import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.app.WorkToolBarActivity; import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.ProcessBean; import com.wd.workoffice.bean.ProcessBean;
import com.wd.workoffice.bean.ProductBean; import com.wd.workoffice.bean.ProductBean;
...@@ -27,15 +26,12 @@ import com.wd.workoffice.bean.workEnum.PagePermissionType; ...@@ -27,15 +26,12 @@ import com.wd.workoffice.bean.workEnum.PagePermissionType;
import com.wd.workoffice.bean.workEnum.PermissionType; import com.wd.workoffice.bean.workEnum.PermissionType;
import com.wd.workoffice.contract.BatChooseInfoContract; import com.wd.workoffice.contract.BatChooseInfoContract;
import com.wd.workoffice.presenter.BatChooseInfoPresenter; import com.wd.workoffice.presenter.BatChooseInfoPresenter;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.adapter.StoreProductAdapter; import com.wd.workoffice.ui.adapter.StoreProductAdapter;
import com.wd.workoffice.ui.adapter.TradingProDetailAdapter; import com.wd.workoffice.ui.adapter.TradingProDetailAdapter;
import com.wd.workoffice.ui.adapter.TradingProductAdapter; import com.wd.workoffice.ui.adapter.TradingProductAdapter;
import com.wd.workoffice.util.DialogUtils; import com.wd.workoffice.util.DialogUtils;
import com.wd.workoffice.util.UserKeeper; import com.wd.workoffice.util.UserKeeper;
import com.wd.workoffice.util.WorkUtils; import com.wd.workoffice.util.WorkUtils;
import com.wd.workoffice.widget.AddAndReduceDoubleView;
import com.wd.workoffice.widget.AddAndReduceView; import com.wd.workoffice.widget.AddAndReduceView;
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.EventBus;
...@@ -54,8 +50,6 @@ import androidx.recyclerview.widget.RecyclerView; ...@@ -54,8 +50,6 @@ import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView; import butterknife.BindView;
import butterknife.ButterKnife; import butterknife.ButterKnife;
import butterknife.OnClick; import butterknife.OnClick;
import flexible.xd.android_base.network.rtfhttp.Transformer;
import io.reactivex.disposables.Disposable;
/** /**
* 选择数据 * 选择数据
...@@ -93,7 +87,7 @@ public class ChooseInfoActivity extends WorkToolBarActivity implements BatChoose ...@@ -93,7 +87,7 @@ public class ChooseInfoActivity extends WorkToolBarActivity implements BatChoose
private Integer clientId; private Integer clientId;
private BatChooseInfoPresenter batChooseInfoPresenter; private BatChooseInfoPresenter batChooseInfoPresenter;
private List<String> processNameList = new ArrayList<>(); private List<String> processNameList = new ArrayList<>();
private List<ProcessBean> processList= new ArrayList<>(); private List<ProcessBean> processList = new ArrayList<>();
private ProcessBean chooseProcess; private ProcessBean chooseProcess;
private QMUIDialog.MenuDialogBuilder processDialog; private QMUIDialog.MenuDialogBuilder processDialog;
private QMUIDialog.MenuDialogBuilder stockDialog; private QMUIDialog.MenuDialogBuilder stockDialog;
...@@ -101,7 +95,7 @@ public class ChooseInfoActivity extends WorkToolBarActivity implements BatChoose ...@@ -101,7 +95,7 @@ public class ChooseInfoActivity extends WorkToolBarActivity implements BatChoose
private List<ProductBean.RecordsBean> carList = new ArrayList<>(); private List<ProductBean.RecordsBean> carList = new ArrayList<>();
private Integer supplyId; private Integer supplyId;
private Map<String, Object> stockParam; private Map<String, Object> stockParam;
private List<StockBean> stockList =new ArrayList<>(); private List<StockBean> stockList = new ArrayList<>();
private List<String> stockNameList = new ArrayList<>(); private List<String> stockNameList = new ArrayList<>();
private StockBean chooseStock; private StockBean chooseStock;
Map<String, Object> carMap = new HashMap<>(); Map<String, Object> carMap = new HashMap<>();
...@@ -303,7 +297,6 @@ public class ChooseInfoActivity extends WorkToolBarActivity implements BatChoose ...@@ -303,7 +297,6 @@ public class ChooseInfoActivity extends WorkToolBarActivity implements BatChoose
"supplierId", supplyId == null ? "" : supplyId.toString(), "supplierId", supplyId == null ? "" : supplyId.toString(),
"subProcess", chooseProcess == null ? "" : chooseProcess.getName(), "subProcess", chooseProcess == null ? "" : chooseProcess.getName(),
"subProcessId", chooseProcess == null ? "" : chooseProcess.getId() + "", "subProcessId", chooseProcess == null ? "" : chooseProcess.getId() + "",
"inStockId", chooseStock == null ? "" : chooseStock.getId() + "", "inStockId", chooseStock == null ? "" : chooseStock.getId() + "",
"customerId", clientId == null ? "" : clientId.toString(), "customerId", clientId == null ? "" : clientId.toString(),
"receiveDeptId", getIntent().getStringExtra("deptId"), "receiveDeptId", getIntent().getStringExtra("deptId"),
...@@ -698,7 +691,7 @@ public class ChooseInfoActivity extends WorkToolBarActivity implements BatChoose ...@@ -698,7 +691,7 @@ public class ChooseInfoActivity extends WorkToolBarActivity implements BatChoose
View view = LayoutInflater.from(this).inflate(R.layout.view_add_cart_trading, null); View view = LayoutInflater.from(this).inflate(R.layout.view_add_cart_trading, null);
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);
AddAndReduceDoubleView useNum = view.findViewById(R.id.ar_use_num); AddAndReduceView useNum = view.findViewById(R.id.ar_use_num);
useNum.setMaxNum(quantity.getQuantity()); useNum.setMaxNum(quantity.getQuantity());
AddAndReduceView num = view.findViewById(R.id.ar_num); AddAndReduceView num = view.findViewById(R.id.ar_num);
RecyclerView rvProduct = view.findViewById(R.id.rv_pro); RecyclerView rvProduct = view.findViewById(R.id.rv_pro);
...@@ -713,8 +706,8 @@ public class ChooseInfoActivity extends WorkToolBarActivity implements BatChoose ...@@ -713,8 +706,8 @@ 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) {
double number = useNum.getNumber(); String number = useNum.getNumber();
if (number == 0d) { if (Double.valueOf(number) == 0d) {
toast("请选择使用数量"); toast("请选择使用数量");
return; return;
} }
......
package com.wd.workoffice.ui.activity.bat.store; package com.wd.workoffice.ui.activity.bat.store;
import android.text.TextUtils;
import android.view.View; import android.view.View;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
...@@ -12,6 +13,7 @@ import com.wd.workoffice.R; ...@@ -12,6 +13,7 @@ import com.wd.workoffice.R;
import com.wd.workoffice.app.WorkToolBarActivity; import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.ProductBean; import com.wd.workoffice.bean.ProductBean;
import com.wd.workoffice.bean.event.ModifyCarEvent; import com.wd.workoffice.bean.event.ModifyCarEvent;
import com.wd.workoffice.bean.workEnum.PermissionType;
import com.wd.workoffice.ui.adapter.StoreCarAdapter; import com.wd.workoffice.ui.adapter.StoreCarAdapter;
import com.wd.workoffice.util.DialogUtils; import com.wd.workoffice.util.DialogUtils;
import com.wd.workoffice.util.MathUtils; import com.wd.workoffice.util.MathUtils;
...@@ -59,7 +61,11 @@ public class StoreSaleCarActivity extends WorkToolBarActivity { ...@@ -59,7 +61,11 @@ 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"))) {
productAdapter = new StoreCarAdapter(R.layout.item_store_car, productList, 2);
} else {
productAdapter = new StoreCarAdapter(R.layout.item_store_car, productList); productAdapter = new StoreCarAdapter(R.layout.item_store_car, productList);
}
productAdapter.bindToRecyclerView(rvProduct); productAdapter.bindToRecyclerView(rvProduct);
String pro = getIntent().getStringExtra("pro"); String pro = getIntent().getStringExtra("pro");
productList.addAll(JSON.parseArray(pro, ProductBean.RecordsBean.class)); productList.addAll(JSON.parseArray(pro, ProductBean.RecordsBean.class));
...@@ -100,17 +106,17 @@ public class StoreSaleCarActivity extends WorkToolBarActivity { ...@@ -100,17 +106,17 @@ public class StoreSaleCarActivity extends WorkToolBarActivity {
public void onViewClicked() { public void onViewClicked() {
String allPrice = ""; String allPrice = "";
for (ProductBean.RecordsBean recordsBean : productList) { for (ProductBean.RecordsBean recordsBean : productList) {
allPrice = MathUtils.add(allPrice, MathUtils.multiply(recordsBean.getCarNum() + "", recordsBean.getInternalPrice()+"", 2), 2); allPrice = MathUtils.add(allPrice, MathUtils.multiply(recordsBean.getCarNum() + "", recordsBean.getInternalPrice() + "", 2), 2);
} }
if (productList.size()==0){ if (productList.size() == 0) {
toast("购物车里没有产品哦"); toast("购物车里没有产品哦");
return; return;
} }
startActivity(StoreSaleConfirmActivity.class, "pro", JSON.toJSONString(productList), startActivity(StoreSaleConfirmActivity.class, "pro", JSON.toJSONString(productList),
"subProcess", getIntent().getStringExtra("subProcess"), "subProcess", getIntent().getStringExtra("subProcess"),
"supplierId",getIntent().getStringExtra("supplierId"), "supplierId", getIntent().getStringExtra("supplierId"),
"subProcessId", getIntent().getStringExtra("subProcessId"), "subProcessId", getIntent().getStringExtra("subProcessId"),
"inStockId",getIntent().getStringExtra("inStockId"), "inStockId", getIntent().getStringExtra("inStockId"),
"customerId", getIntent().getStringExtra("customerId"), "customerId", getIntent().getStringExtra("customerId"),
"receiveDeptId", getIntent().getStringExtra("receiveDeptId"), "receiveDeptId", getIntent().getStringExtra("receiveDeptId"),
"code", getIntent().getStringExtra("code"), "code", getIntent().getStringExtra("code"),
...@@ -138,7 +144,7 @@ public class StoreSaleCarActivity extends WorkToolBarActivity { ...@@ -138,7 +144,7 @@ public class StoreSaleCarActivity extends WorkToolBarActivity {
tvNum.setText("共 ".concat(productList.size() + "").concat(" 件")); tvNum.setText("共 ".concat(productList.size() + "").concat(" 件"));
String allPrice = ""; String allPrice = "";
for (ProductBean.RecordsBean recordsBean : productList) { for (ProductBean.RecordsBean recordsBean : productList) {
allPrice = MathUtils.add(allPrice, MathUtils.multiply(recordsBean.getCarNum(), recordsBean.getInternalPrice()+"", 3), 3); allPrice = MathUtils.add(allPrice, MathUtils.multiply(recordsBean.getCarNum(), recordsBean.getInternalPrice() + "", 3), 3);
} }
tvPrice.setText("总计: ¥ ".concat(allPrice)); tvPrice.setText("总计: ¥ ".concat(allPrice));
} }
......
package com.wd.workoffice.ui.activity.bat.store; package com.wd.workoffice.ui.activity.bat.store;
import android.os.Bundle;
import android.view.View;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.qmuiteam.qmui.widget.dialog.QMUIDialog;
import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction;
import com.wd.workoffice.R; import com.wd.workoffice.R;
import com.wd.workoffice.app.WorkToolBarActivity; import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.ProductBean; import com.wd.workoffice.bean.ProductBean;
import com.wd.workoffice.bean.TradingBean; import com.wd.workoffice.bean.TradingBean;
import com.wd.workoffice.bean.event.ModifyCarEvent; import com.wd.workoffice.bean.event.ModifyCarEvent;
import com.wd.workoffice.ui.adapter.TradingProCarAdapter; import com.wd.workoffice.ui.adapter.TradingProCarAdapter;
import com.wd.workoffice.util.DialogUtils;
import com.wd.workoffice.util.MathUtils; import com.wd.workoffice.util.MathUtils;
import com.wd.workoffice.widget.AddAndReduceDoubleView; import com.wd.workoffice.widget.AddAndReduceView;
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.Subscribe;
...@@ -60,7 +54,7 @@ public class StoreTradingCarActivity extends WorkToolBarActivity { ...@@ -60,7 +54,7 @@ public class StoreTradingCarActivity extends WorkToolBarActivity {
@BindView(R.id.tv_apply_num) @BindView(R.id.tv_apply_num)
TextView tvApplyNum; TextView tvApplyNum;
@BindView(R.id.ar_use_num) @BindView(R.id.ar_use_num)
AddAndReduceDoubleView arUseNum; AddAndReduceView arUseNum;
@BindView(R.id.rv_product) @BindView(R.id.rv_product)
RecyclerView rvProduct; RecyclerView rvProduct;
private List<ProductBean.RecordsBean> productList; private List<ProductBean.RecordsBean> productList;
...@@ -82,7 +76,7 @@ public class StoreTradingCarActivity extends WorkToolBarActivity { ...@@ -82,7 +76,7 @@ public class StoreTradingCarActivity extends WorkToolBarActivity {
tvApplyNum.setText(String.valueOf(pro.getQuantity())); tvApplyNum.setText(String.valueOf(pro.getQuantity()));
tvDept.setText(pro.getDeptName()); tvDept.setText(pro.getDeptName());
arUseNum.setMaxNum(pro.getQuantity()); arUseNum.setMaxNum(pro.getQuantity());
arUseNum.setNumber(Double.valueOf(pro.getChooseNum())); arUseNum.setNumber(pro.getChooseNum());
productList = new ArrayList<>(); productList = new ArrayList<>();
productAdapter = new TradingProCarAdapter(R.layout.item_trading_product_car, productList); productAdapter = new TradingProCarAdapter(R.layout.item_trading_product_car, productList);
productAdapter.bindToRecyclerView(rvProduct); productAdapter.bindToRecyclerView(rvProduct);
......
...@@ -24,7 +24,6 @@ import com.wd.workoffice.retrofit.WorkObserver; ...@@ -24,7 +24,6 @@ import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.adapter.TradingProDetailAdapter; import com.wd.workoffice.ui.adapter.TradingProDetailAdapter;
import com.wd.workoffice.ui.adapter.TradingProductAdapter; import com.wd.workoffice.ui.adapter.TradingProductAdapter;
import com.wd.workoffice.util.WorkUtils; import com.wd.workoffice.util.WorkUtils;
import com.wd.workoffice.widget.AddAndReduceDoubleView;
import com.wd.workoffice.widget.AddAndReduceView; import com.wd.workoffice.widget.AddAndReduceView;
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.EventBus;
...@@ -91,7 +90,7 @@ public class StoreTradingProductActivity extends WorkToolBarActivity { ...@@ -91,7 +90,7 @@ public class StoreTradingProductActivity extends WorkToolBarActivity {
View view = LayoutInflater.from(this).inflate(R.layout.view_add_cart_trading, null); View view = LayoutInflater.from(this).inflate(R.layout.view_add_cart_trading, null);
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);
AddAndReduceDoubleView useNum = view.findViewById(R.id.ar_use_num); AddAndReduceView useNum = view.findViewById(R.id.ar_use_num);
useNum.setMaxNum(quantity.getQuantity()); useNum.setMaxNum(quantity.getQuantity());
AddAndReduceView num = view.findViewById(R.id.ar_num); AddAndReduceView num = view.findViewById(R.id.ar_num);
RecyclerView rvProduct = view.findViewById(R.id.rv_pro); RecyclerView rvProduct = view.findViewById(R.id.rv_pro);
...@@ -106,8 +105,8 @@ public class StoreTradingProductActivity extends WorkToolBarActivity { ...@@ -106,8 +105,8 @@ public class StoreTradingProductActivity extends WorkToolBarActivity {
tvOk.setOnClickListener(new View.OnClickListener() { tvOk.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
double number = useNum.getNumber(); String number = useNum.getNumber();
if (number == 0d) { if (Double.valueOf(number) == 0d) {
toast("请选择使用数量"); toast("请选择使用数量");
return; return;
} }
......
...@@ -43,9 +43,9 @@ public class AddCrucibleCarAdapter extends BaseQuickAdapter<ProductBean.RecordsB ...@@ -43,9 +43,9 @@ public class AddCrucibleCarAdapter extends BaseQuickAdapter<ProductBean.RecordsB
helper.setText(R.id.tv_unit, String.valueOf(item.getWeight()).concat("吨")); helper.setText(R.id.tv_unit, String.valueOf(item.getWeight()).concat("吨"));
helper.setText(R.id.tv_all_price, MathUtils.multiply(item.getCarDoubleNum() + "", item.getInternalPrice() + "", 2)); helper.setText(R.id.tv_all_price, MathUtils.multiply(item.getCarDoubleNum() + "", item.getInternalPrice() + "", 2));
helper.addOnClickListener(R.id.tv_delete); helper.addOnClickListener(R.id.tv_delete);
AddAndReduceDoubleView num = helper.getView(R.id.ar_num); AddAndReduceView num = helper.getView(R.id.ar_num);
num.setMaxNum(item.getCanUseProductSum()); num.setMaxNum(item.getCanUseProductSum());
num.setOnNumberChangedListener(new AddAndReduceDoubleView.OnNumberChangedListener() { num.setOnNumberChangedListener(new AddAndReduceView.OnNumberChangedListener() {
@Override @Override
public void OnNumberChanged(String vs) { public void OnNumberChanged(String vs) {
item.setCarDoubleNum(Double.valueOf(vs)); item.setCarDoubleNum(Double.valueOf(vs));
...@@ -77,7 +77,7 @@ public class AddCrucibleCarAdapter extends BaseQuickAdapter<ProductBean.RecordsB ...@@ -77,7 +77,7 @@ public class AddCrucibleCarAdapter extends BaseQuickAdapter<ProductBean.RecordsB
EventBus.getDefault().post(new ModifyCarEvent(JSON.toJSONString(getData()))); EventBus.getDefault().post(new ModifyCarEvent(JSON.toJSONString(getData())));
} }
}); });
num.setNumber(item.getCarDoubleNum()); num.setNumber(item.getCarNum());
} }
} }
......
...@@ -27,7 +27,7 @@ import flexible.xd.android_base.utils.ToastUtil; ...@@ -27,7 +27,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;//1 确认订单页面 2 单数量无价格
public StoreCarAdapter(int layoutResId, List data) { public StoreCarAdapter(int layoutResId, List data) {
super(layoutResId, data); super(layoutResId, data);
...@@ -46,29 +46,29 @@ public class StoreCarAdapter extends BaseQuickAdapter<ProductBean.RecordsBean, B ...@@ -46,29 +46,29 @@ public class StoreCarAdapter extends BaseQuickAdapter<ProductBean.RecordsBean, B
helper.setText(R.id.tv_spec, item.getSpec()); helper.setText(R.id.tv_spec, item.getSpec());
helper.setText(R.id.tv_price, "¥".concat(String.valueOf(item.getInternalPrice()))); helper.setText(R.id.tv_price, "¥".concat(String.valueOf(item.getInternalPrice())));
helper.setText(R.id.tv_unit, String.valueOf(item.getWeight()).concat("吨")); helper.setText(R.id.tv_unit, String.valueOf(item.getWeight()).concat("吨"));
helper.setText(R.id.tv_all_price, MathUtils.multiply(item.getCarNum() , item.getInternalPrice()+"", 3)); helper.setText(R.id.tv_all_price, MathUtils.multiply(item.getCarNum(), item.getInternalPrice() + "", 3));
if (type == 1) { if (type == 1) {
helper.addOnClickListener(R.id.rl_choose_dep); helper.addOnClickListener(R.id.rl_choose_dep);
helper.addOnClickListener(R.id.rl_upload); helper.addOnClickListener(R.id.rl_upload);
if (!TextUtils.isEmpty(item.getFactoryName())) { if (!TextUtils.isEmpty(item.getFactoryName())) {
helper.setText(R.id.tv_choose_dep, item.getFactoryName()); helper.setText(R.id.tv_choose_dep, item.getFactoryName());
} }
if (!TextUtils.isEmpty(item.getUrl())){ if (!TextUtils.isEmpty(item.getUrl())) {
helper.setText(R.id.tv_upload,"已上传,点击替换"); helper.setText(R.id.tv_upload, "已上传,点击替换");
} }
} else if(type == 2){ } else if (type == 2) {
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);
num.setOnNumberChangedListener(new AddAndReduceView.OnNumberChangedListener() { num.setOnNumberChangedListener(new AddAndReduceView.OnNumberChangedListener() {
@Override @Override
public void OnNumberChanged(String vs) { public void OnNumberChanged(String vs) {
item.setCarNum(vs); item.setCarNum(vs);
helper.setText(R.id.tv_all_price, MathUtils.multiply(vs + "", item.getCarPrice(), 2)); helper.setText(R.id.tv_all_price, MathUtils.multiply(vs , String.valueOf(item.getInternalPrice()), 3));
EventBus.getDefault().post(new ModifyCarEvent(JSON.toJSONString(getData()))); EventBus.getDefault().post(new ModifyCarEvent(JSON.toJSONString(getData())));
} }
}); });
EditText etPrice = helper.getView(R.id.et_price); EditText etPrice = helper.getView(R.id.et_price);
helper.setGone(R.id.ll_price,false); helper.setGone(R.id.ll_price, false);
num.setNumber(item.getCarNum()); num.setNumber(item.getCarNum());
} else { } else {
helper.addOnClickListener(R.id.tv_delete); helper.addOnClickListener(R.id.tv_delete);
...@@ -77,7 +77,7 @@ public class StoreCarAdapter extends BaseQuickAdapter<ProductBean.RecordsBean, B ...@@ -77,7 +77,7 @@ public class StoreCarAdapter extends BaseQuickAdapter<ProductBean.RecordsBean, B
@Override @Override
public void OnNumberChanged(String vs) { public void OnNumberChanged(String vs) {
item.setCarNum(vs); item.setCarNum(vs);
helper.setText(R.id.tv_all_price, MathUtils.multiply(vs + "", item.getCarPrice(), 2)); helper.setText(R.id.tv_all_price, MathUtils.multiply(vs, String.valueOf(item.getInternalPrice()), 3));
EventBus.getDefault().post(new ModifyCarEvent(JSON.toJSONString(getData()))); EventBus.getDefault().post(new ModifyCarEvent(JSON.toJSONString(getData())));
} }
}); });
...@@ -101,7 +101,7 @@ public class StoreCarAdapter extends BaseQuickAdapter<ProductBean.RecordsBean, B ...@@ -101,7 +101,7 @@ public class StoreCarAdapter extends BaseQuickAdapter<ProductBean.RecordsBean, B
return; return;
} }
item.setCarPrice(s.toString()); item.setCarPrice(s.toString());
helper.setText(R.id.tv_all_price, MathUtils.multiply(item.getCarNum() + "", item.getCarPrice(), 2)); helper.setText(R.id.tv_all_price, MathUtils.multiply(item.getCarNum(), String.valueOf(item.getInternalPrice()), 3));
EventBus.getDefault().post(new ModifyCarEvent(JSON.toJSONString(getData()))); EventBus.getDefault().post(new ModifyCarEvent(JSON.toJSONString(getData())));
} }
}); });
......
...@@ -13,6 +13,7 @@ import com.wd.workoffice.bean.OrderDetail; ...@@ -13,6 +13,7 @@ import com.wd.workoffice.bean.OrderDetail;
import com.wd.workoffice.bean.event.SendWeightEvent; import com.wd.workoffice.bean.event.SendWeightEvent;
import com.wd.workoffice.util.WorkUtils; import com.wd.workoffice.util.WorkUtils;
import com.wd.workoffice.widget.AddAndReduceDoubleView; import com.wd.workoffice.widget.AddAndReduceDoubleView;
import com.wd.workoffice.widget.AddAndReduceView;
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.EventBus;
...@@ -49,9 +50,9 @@ public class WorkSendApplyAddAdapter extends BaseQuickAdapter<OrderDetail.OrderI ...@@ -49,9 +50,9 @@ public class WorkSendApplyAddAdapter extends BaseQuickAdapter<OrderDetail.OrderI
helper.setText(R.id.tv_num, String.valueOf(item.getProductCount())); helper.setText(R.id.tv_num, String.valueOf(item.getProductCount()));
helper.setText(R.id.tv_apply_send_num, String.valueOf(item.getStoreSum())); helper.setText(R.id.tv_apply_send_num, String.valueOf(item.getStoreSum()));
helper.setText(R.id.tv_send_num, "发货数量:"+String.valueOf(item.getUsedSum())); helper.setText(R.id.tv_send_num, "发货数量:"+String.valueOf(item.getUsedSum()));
AddAndReduceDoubleView nrcNum = helper.getView(R.id.arv_num); AddAndReduceView nrcNum = helper.getView(R.id.arv_num);
nrcNum.setMaxNum(item.getStoreSum()); nrcNum.setMaxNum(item.getStoreSum());
nrcNum.setOnNumberChangedListener(new AddAndReduceDoubleView.OnNumberChangedListener() { nrcNum.setOnNumberChangedListener(new AddAndReduceView.OnNumberChangedListener() {
@Override @Override
public void OnNumberChanged(String vs) { public void OnNumberChanged(String vs) {
item.setChooseNum(vs); item.setChooseNum(vs);
......
...@@ -22,7 +22,7 @@ public class AddAndReduceView extends LinearLayout implements View.OnClickListen ...@@ -22,7 +22,7 @@ public class AddAndReduceView extends LinearLayout implements View.OnClickListen
private final Button add; private final Button add;
private final Button remove; private final Button remove;
private final EditText tvNum; private final EditText tvNum;
private String num = "1"; private String num = "0";
private double maxNum = 10000f; private double maxNum = 10000f;
public AddAndReduceView(Context context, AttributeSet attrs) { public AddAndReduceView(Context context, AttributeSet attrs) {
......
...@@ -189,7 +189,7 @@ ...@@ -189,7 +189,7 @@
android:textColor="@color/flexible_text_sup" android:textColor="@color/flexible_text_sup"
android:textSize="16sp" /> android:textSize="16sp" />
<com.wd.workoffice.widget.AddAndReduceDoubleView <com.wd.workoffice.widget.AddAndReduceView
android:id="@+id/ar_use_num" android:id="@+id/ar_use_num"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
......
...@@ -202,7 +202,7 @@ ...@@ -202,7 +202,7 @@
android:textColor="@color/flexible_text_sup" android:textColor="@color/flexible_text_sup"
android:textSize="17sp" /> android:textSize="17sp" />
<com.wd.workoffice.widget.AddAndReduceDoubleView <com.wd.workoffice.widget.AddAndReduceView
android:id="@+id/ar_num" android:id="@+id/ar_num"
android:layout_width="150mm" android:layout_width="150mm"
android:layout_height="wrap_content" android:layout_height="wrap_content"
......
...@@ -216,11 +216,11 @@ ...@@ -216,11 +216,11 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="本次发货数" /> android:text="本次发货数" />
<com.wd.workoffice.widget.AddAndReduceDoubleView <com.wd.workoffice.widget.AddAndReduceView
android:id="@+id/arv_num" android:id="@+id/arv_num"
android:layout_width="100mm" android:layout_width="130mm"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="5mm" android:layout_marginLeft="5mm"
android:layout_gravity="right"></com.wd.workoffice.widget.AddAndReduceDoubleView> android:layout_gravity="right"/>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
android:textColor="@color/flexible_text_sup" android:textColor="@color/flexible_text_sup"
android:textSize="17sp" /> android:textSize="17sp" />
<com.wd.workoffice.widget.AddAndReduceDoubleView <com.wd.workoffice.widget.AddAndReduceView
android:id="@+id/ar_use_num" android:id="@+id/ar_use_num"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
android:background="@null" android:background="@null"
android:inputType="numberDecimal" android:inputType="numberDecimal"
android:gravity="center" android:gravity="center"
android:text="1" android:text="0"
android:textColor="#5C7589" android:textColor="#5C7589"
android:textSize="17sp" /> android:textSize="17sp" />
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
android:textColor="@color/flexible_text_sup" android:textColor="@color/flexible_text_sup"
android:textSize="17sp" /> android:textSize="17sp" />
<com.wd.workoffice.widget.AddAndReduceDoubleView <com.wd.workoffice.widget.AddAndReduceView
android:id="@+id/ar_num" android:id="@+id/ar_num"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论