提交 4b8bfe29 authored 作者: lgd's avatar lgd

1.组装订单申请

2.//TODO erp用户激活测试,忘记/重置密码测试,质检接口数据无对应问题,内部交易订单审核,审核规则,领用申请列表/退件列表/参数,组装下单,产品下单还差附件测试,mes,刷新token
上级 be28b80d
......@@ -1072,6 +1072,38 @@
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.activity.bat.order.ProductOrderAddActivity"
android:configChanges="keyboardHidden|orientation"
android:label="添加组装订单"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.activity.bat.order.ProductOrderProActivity"
android:configChanges="keyboardHidden|orientation"
android:label="选择来源产品"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.activity.bat.order.ProductOrderProTargetActivity"
android:configChanges="keyboardHidden|orientation"
android:label="选择目标产品"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.activity.bat.order.ProductConfirmActivity"
android:configChanges="keyboardHidden|orientation"
android:label="组装申请"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.wd.workoffice.fileprovider"
......
......@@ -490,6 +490,9 @@ public interface ApiService {
@POST("/purchaseOrder/start")
Observable<BaseBean> submitPurchaseOrder(@Body RequestBody requestBody);
@POST("/procedureStart/ao/applyPackage")
Observable<BaseBean> submitProcedureOrder(@Body RequestBody requestBody);
/**
* 获取客户分厂
*
......@@ -1521,5 +1524,21 @@ public interface ApiService {
*/
@PUT("/purchaseOrder/enter-stock-type")
Observable<BaseBean> purchaseOrderStockType(@QueryMap Map<String, Object> param);
/**
* 2组装来源列表
*
* @return
*/
@GET("/saleOrder/item/page/list")
Observable<BaseBean> saleOrderPro(@QueryMap Map<String, Object> param);
/**
* 3获取当前客户可组装成品(分页)
*
* @return
*/
@GET("/product/can-package/page/list")
Observable<BaseBean> saleOrderTargetPro(@QueryMap Map<String, Object> param);
}
package com.wd.workoffice.ui.activity.bat.order;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.widget.EditText;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.qmuiteam.qmui.widget.dialog.QMUIDialog;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.ProAddBean;
import com.wd.workoffice.bean.ProductBean;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.activity.bat.store.StoreOrderSuccessActivity;
import com.wd.workoffice.ui.adapter.ProAddAdapter;
import com.wd.workoffice.ui.adapter.ProTargetAddAdapter;
import com.wd.workoffice.util.MathUtils;
import com.wd.workoffice.util.UserKeeper;
import com.wd.workoffice.util.WorkUtils;
import java.util.ArrayList;
import java.util.HashMap;
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 ProductConfirmActivity 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.tv_base1)
TextView tvBase1;
@BindView(R.id.tv_base2)
TextView tvBase2;
@BindView(R.id.tv_base3)
TextView tvBase3;
@BindView(R.id.tv_base4)
TextView tvBase4;
@BindView(R.id.tv_base5)
TextView tvBase5;
@BindView(R.id.rv_from)
RecyclerView rvFrom;
@BindView(R.id.rv_to)
RecyclerView rvTo;
@BindView(R.id.et_remark)
EditText etRemark;
@BindView(R.id.tv_remark_num)
TextView tvRemarkNum;
private ProTargetAddAdapter toAdapter;
private Map<String, Object> param;
private List<JSONObject> packageTargetList;
private List<ProductBean.RecordsBean> toList;
private List<ProAddBean.RecordsBean> fromList;
private List<JSONObject> packageSourceList;
@Override
protected void initView() {
ButterKnife.bind(this);
rvFrom.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false));
rvTo.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false));
}
@Override
protected void initData() {
fromList = new ArrayList<>();
ProAddAdapter fromAdapter = new ProAddAdapter(R.layout.item_product_add_pro, fromList, 1);
fromAdapter.bindToRecyclerView(rvFrom);
fromList.addAll(JSON.parseArray(getIntent().getStringExtra("from"), ProAddBean.RecordsBean.class));
fromAdapter.notifyDataSetChanged();
toList = new ArrayList<>();
toAdapter = new ProTargetAddAdapter(R.layout.item_product_target_pro, toList, 1);
toAdapter.bindToRecyclerView(rvTo);
toList.addAll(JSON.parseArray(getIntent().getStringExtra("to"), ProductBean.RecordsBean.class));
toAdapter.notifyDataSetChanged();
changeNumAndPrice();
param = new HashMap<>();
param.put("usedStockId", getIntent().getStringExtra("usedStockId"));
param.put("targetStockId", getIntent().getStringExtra("targetStockId"));
param.put("enterStockId", getIntent().getStringExtra("usedStockId"));
param.put("customerId", getIntent().getStringExtra("customerId"));
JSONObject data = JSON.parseObject(getIntent().getStringExtra("base"));
tvBase1.setText(data.getString("1"));
tvBase2.setText(data.getString("2"));
tvBase3.setText(data.getString("3"));
tvBase4.setText(data.getString("4"));
}
/**
* 转换pro,生成上传参数
*
* @param proList
* @return
*/
private List<JSONObject> coverToInfo(List<ProductBean.RecordsBean> proList) {
List<JSONObject> orderItems = new ArrayList<>();
for (ProductBean.RecordsBean recordsBean : proList) {
JSONObject data = new JSONObject();
data.put("quantity", recordsBean.getCarNum());
data.put("productId", recordsBean.getId());
data.put("outerPrice", recordsBean.getCarPrice());
orderItems.add(data);
}
return orderItems;
}
@Override
protected void initEvent() {
addNumListener(etRemark, tvRemarkNum);
}
/**
* 添加字数监听器
*
* @param et
* @param tv
*/
private void addNumListener(EditText et, TextView tv) {
et.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) {
tv.setText(s.length() + "/140");
}
});
}
@Override
protected int layoutId() {
return R.layout.activity_product_confirm;
}
@OnClick({R.id.tv_ok})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.tv_ok:
packageTargetList = coverToInfo(toList);
packageSourceList = coverFromInfo(fromList);
submitOrder();
break;
}
}
private List<JSONObject> coverFromInfo(List<ProAddBean.RecordsBean> fromList) {
List<JSONObject> orderItems = new ArrayList<>();
for (ProAddBean.RecordsBean recordsBean : fromList) {
JSONObject data = new JSONObject();
data.put("orderType", recordsBean.getOrderType());
data.put("orderId", recordsBean.getOrderId());
data.put("quantity", recordsBean.getCarNum());
data.put("productId", recordsBean.getProductId());
data.put("orderItemId", recordsBean.getSerialNumber());
data.put("stockId", getIntent().getStringExtra("usedStockId"));
orderItems.add(data);
}
return orderItems;
}
/**
* 下单
*/
private void submitOrder() {
param.put("packageTargetList", packageTargetList);
param.put("packageSourceList", packageSourceList);
param.put("applyRemark", etRemark.getText().toString());
showLoading();
RtfUtils.getRtf().submitProcedureOrder(WorkUtils.convertMapToBody(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;
}
toast("下单成功");
startActivity(StoreOrderSuccessActivity.class);
}
});
}
private void changeNumAndPrice() {
String allPrice = "";
for (ProductBean.RecordsBean recordsBean : toList) {
allPrice = MathUtils.add(allPrice, MathUtils.multiply(recordsBean.getCarNum() + "", recordsBean.getInternalPrice() + "", 3), 3);
}
tvPrice.setText("总计: ¥ ".concat(allPrice));
tvBase5.setText(String.valueOf(allPrice));
}
}
package com.wd.workoffice.ui.activity.bat.order;
import android.content.DialogInterface;
import android.content.Intent;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.qmuiteam.qmui.widget.dialog.QMUIDialog;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.WarehoustBean;
import com.wd.workoffice.bean.event.CheckTicketEvent;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.activity.bat.store.StoreSaleClientActivity;
import com.wd.workoffice.util.DialogUtils;
import com.wd.workoffice.util.UserKeeper;
import com.wd.workoffice.util.WorkUtils;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import androidx.annotation.Nullable;
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 ProductOrderAddActivity extends WorkToolBarActivity {
@BindView(R.id.tv_next)
TextView tvNext;
@BindView(R.id.tv_client)
TextView tvClient;
@BindView(R.id.rl_client)
LinearLayout rlClient;
@BindView(R.id.tv_from_stock)
TextView tvFromStock;
@BindView(R.id.rl_from_stock)
LinearLayout rlFromStock;
@BindView(R.id.tv_to_stock)
TextView tvToStock;
@BindView(R.id.rl_to_stock)
LinearLayout rlToStock;
@BindView(R.id.tv_use_stock)
TextView tvUseStock;
@BindView(R.id.rl_use_stock)
LinearLayout rlUseStock;
private Map<String, Object> param;
private Integer clientId;
private List<String> stockNameList = new ArrayList<>();
private List<WarehoustBean.RecordsBean> stockList;
private QMUIDialog.MenuDialogBuilder fromStockDialog;
private QMUIDialog.MenuDialogBuilder useStockDialog;
private WarehoustBean.RecordsBean chooseFromStock;
private WarehoustBean.RecordsBean useFromStock;
@Override
protected void initView() {
ButterKnife.bind(this);
param = WorkUtils.simpleParam();
param.put("deptId", UserKeeper.getInstance().getUserDepId());
param.put("sign", "SEND");
fromStockDialog = DialogUtils.listDialog(this);
useStockDialog = DialogUtils.listDialog(this);
}
@Override
protected void initData() {
}
@Override
protected void initEvent() {
}
@Override
protected int layoutId() {
return R.layout.activity_product_order_add;
}
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 10001 && resultCode == 10001) {
String clientName = data.getStringExtra("clientName");
clientId = data.getIntExtra("id", 0);
tvClient.setText(clientName);
param.put("customerId", clientId);
getData();
}
}
@Override
public void onStart() {
super.onStart();
EventBus.getDefault().register(this);
}
@Override
public void onStop() {
super.onStop();
EventBus.getDefault().unregister(this);
}
@Subscribe
public void refresh(CheckTicketEvent event) {
finish();
}
@OnClick({R.id.rl_client, R.id.rl_from_stock, R.id.tv_next, R.id.rl_use_stock})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.rl_client:
startActivityForResult(StoreSaleClientActivity.class, 10001,
"flag", "1", "depId", UserKeeper.getInstance().getUserDepId(), "code", "CUSTOMER");
break;
case R.id.rl_from_stock:
if (clientId == null) {
toast("请先选择客户");
return;
}
fromStockDialog.show();
break;
case R.id.tv_next:
if (clientId == null) {
toast("请先选择客户");
return;
}
if (fromStockDialog == null) {
toast("请先选择来源仓库");
return;
}
if (useFromStock == null) {
toast("请先选择领用仓库");
return;
}
JSONObject base =new JSONObject();
base.put("1",tvClient.getText().toString());
base.put("2",tvFromStock.getText().toString());
base.put("3",tvToStock.getText().toString());
base.put("4",tvUseStock.getText().toString());
startActivity(ProductOrderProActivity.class,
"base",base.toJSONString(),
"customerId", clientId.toString(),
"usedStockId", useFromStock.getId() + "",
"targetStockId", chooseFromStock.getId() + "");
break;
case R.id.rl_use_stock:
if (clientId == null) {
toast("请先选择客户");
return;
}
useStockDialog.show();
break;
}
}
private void getData() {
RtfUtils.getRtf().getStock(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<WarehoustBean.RecordsBean> getList = JSON.parseArray(data.getData().toString(), WarehoustBean.RecordsBean.class);
stockList = getList;
stockNameList.clear();
for (WarehoustBean.RecordsBean process : stockList) {
stockNameList.add(process.getName());
}
fromStockDialog.addItems(stockNameList.toArray(new String[stockNameList.size()]), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
chooseFromStock = stockList.get(which);
tvFromStock.setText(stockNameList.get(which));
tvToStock.setText(stockNameList.get(which));
dialog.dismiss();
}
});
useStockDialog.addItems(stockNameList.toArray(new String[stockNameList.size()]), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
useFromStock = stockList.get(which);
tvUseStock.setText(stockNameList.get(which));
dialog.dismiss();
}
});
}
});
}
}
\ No newline at end of file
package com.wd.workoffice.ui.activity.bat.order;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.app.WorkToolBarActivity;
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.retrofit.RtfUtils;
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.WorkAddTicketOrderAdapter;
import com.wd.workoffice.util.WorkUtils;
import com.wd.workoffice.widget.AddAndReduceDoubleView;
import com.wd.workoffice.widget.AddAndReduceView;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import androidx.appcompat.app.AlertDialog;
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.Observable;
import io.reactivex.disposables.Disposable;
/**
* 财务 开票 选择产品
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class ProductOrderProActivity extends WorkToolBarActivity {
@BindView(R.id.tv_num)
TextView tvNum;
@BindView(R.id.tv_ok)
TextView tvOk;
@BindView(R.id.ll_bottom)
RelativeLayout llBottom;
@BindView(R.id.et_key)
EditText etKey;
@BindView(R.id.btn_search)
Button btnSearch;
@BindView(R.id.rv_product)
RecyclerView rvProduct;
private Map<String, Object> param;
private List<ProAddBean.RecordsBean> clientList;
private ProAddAdapter clientAdapter;
private int page = 1;
private List<ProAddBean.RecordsBean> carList = new ArrayList<>();
@Override
protected void initView() {
ButterKnife.bind(this);
rvProduct.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false));
}
private void openDialog(ProAddBean.RecordsBean data, int position) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
View view = LayoutInflater.from(this).inflate(R.layout.view_choose_pro_from, null);
TextView tvOk = view.findViewById(R.id.tv_ok);
TextView tvCancel = view.findViewById(R.id.tv_cancel);
TextView tvDesc = view.findViewById(R.id.tv_desc);
AddAndReduceDoubleView num = view.findViewById(R.id.ar_num);
TextView etPrice = view.findViewById(R.id.et_price);
etPrice.setClickable(false);
for (ProAddBean.RecordsBean recordsBean : carList) {
if (data.getId() == recordsBean.getId()) {
// etPrice.setText(recordsBean.getCarPrice());
num.setNumber(Double.valueOf(recordsBean.getCarNum()));
}
}
etPrice.setText(String.valueOf(data.getCanPackageSum()));
num.setMaxNum(data.getCanPackageSum());
builder.setView(view);
AlertDialog addCartDialog = builder.create();
tvOk.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (num.getNumber() == 0d) {
toast("请填写数量");
return;
}
clientList.get(position).setCarNum(String.valueOf(num.getNumber()));
addCart(data, num.getNumber());
tvNum.setText("共 ".concat(clientList.size() + "").concat(" 件"));
addCartDialog.dismiss();
}
});
tvCancel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
addCartDialog.dismiss();
}
});
addCartDialog.show();
}
/**
* 添加购物车
*
* @param chooseProduct 产品
* @param number 数量
*/
private void addCart(ProAddBean.RecordsBean chooseProduct, double number) {
boolean isHas = false;
for (ProAddBean.RecordsBean recordsBean : carList) {
if (chooseProduct.getId() == recordsBean.getId()) {
isHas = true;
recordsBean.setCarNum(String.valueOf(number));
// recordsBean.setCarPrice(price);
}
}
if (!isHas) {
chooseProduct.setCarNum(String.valueOf(number));
// chooseProduct.setCarPrice(price);
carList.add(chooseProduct);
}
toast("加入购物车成功");
}
@Override
protected void initData() {
clientList = new ArrayList<>();
clientAdapter = new ProAddAdapter(R.layout.item_product_add_pro, clientList);
clientAdapter.bindToRecyclerView(rvProduct);
param = WorkUtils.pageKey();
param.put("current", 1);
param.put("customerId", getIntent().getStringExtra("customerId"));
param.put("tranFromStockId", getIntent().getStringExtra("targetStockId"));
getData();
}
private void getData() {
RtfUtils.getRtf().saleOrderPro(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<ProAddBean.RecordsBean> dataList = JSON.parseObject(data.getData().toString(), ProAddBean.class).getRecords();
if (page == 1) {
clientList.clear();
clientList.addAll(dataList);
clientAdapter.notifyDataSetChanged();
clientAdapter.loadMoreComplete();
} else {
clientAdapter.loadMoreComplete();
clientList.addAll(dataList);
clientAdapter.notifyDataSetChanged();
}
if (dataList.size() == 0) {
clientAdapter.loadMoreEnd();
} else {
page++;
}
}
});
}
@Override
protected void initEvent() {
clientAdapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
@Override
public void onLoadMoreRequested() {
param.put("current", page);
getData();
}
}, rvProduct);
clientAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
openDialog(clientList.get(position), position);
}
});
}
@Override
protected int layoutId() {
return R.layout.activity_product_add_pro;
}
@OnClick({R.id.tv_ok, R.id.btn_search})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.tv_ok:
// if (carList.size() == 0) {
// toast("请选择产品");
// return;
// }
startActivity(ProductOrderProTargetActivity.class,
"base",getIntent().getStringExtra("base"),
"usedStockId", getIntent().getStringExtra("usedStockId"),
"targetStockId", getIntent().getStringExtra("targetStockId"),
"customerId", getIntent().getStringExtra("customerId"),
"from", JSON.toJSONString(carList));
break;
case R.id.btn_search:
param.put("name", etKey.getText().toString());
param.put("current", 1);
page = 1;
getData();
break;
}
}
@Override
public void onStart() {
super.onStart();
EventBus.getDefault().register(this);
}
@Override
public void onStop() {
super.onStop();
EventBus.getDefault().unregister(this);
}
@Subscribe
public void refresh(CheckTicketEvent event) {
finish();
}
}
package com.wd.workoffice.ui.activity.bat.order;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.alibaba.fastjson.JSON;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.ProductBean;
import com.wd.workoffice.bean.ProductBean;
import com.wd.workoffice.bean.TicketAddBean;
import com.wd.workoffice.bean.event.CheckTicketEvent;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.activity.bat.work.WorkFinancialReceiveTicketSubmitActivity;
import com.wd.workoffice.ui.activity.bat.work.WorkFinancialTicketSubmitActivity;
import com.wd.workoffice.ui.adapter.ProTargetAddAdapter;
import com.wd.workoffice.ui.adapter.WorkAddTicketOrderAdapter;
import com.wd.workoffice.util.WorkUtils;
import com.wd.workoffice.widget.AddAndReduceView;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import androidx.appcompat.app.AlertDialog;
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.Observable;
import io.reactivex.disposables.Disposable;
/**
* 选择目标产品
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class ProductOrderProTargetActivity extends WorkToolBarActivity {
@BindView(R.id.tv_num)
TextView tvNum;
@BindView(R.id.tv_ok)
TextView tvOk;
@BindView(R.id.ll_bottom)
RelativeLayout llBottom;
@BindView(R.id.et_key)
EditText etKey;
@BindView(R.id.btn_search)
Button btnSearch;
@BindView(R.id.rv_product)
RecyclerView rvProduct;
private Map<String, Object> param;
private List<ProductBean.RecordsBean> clientList;
private ProTargetAddAdapter clientAdapter;
private int page = 1;
private List<ProductBean.RecordsBean> carList = new ArrayList<>();
@Override
protected void initView() {
ButterKnife.bind(this);
rvProduct.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false));
}
private void openDialog(ProductBean.RecordsBean data, int position) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
View view = LayoutInflater.from(this).inflate(R.layout.view_add_cart, null);
TextView tvOk = view.findViewById(R.id.tv_ok);
TextView tvCancel = view.findViewById(R.id.tv_cancel);
TextView tvDesc = view.findViewById(R.id.tv_desc);
tvDesc.setText("组装单价");
AddAndReduceView num = view.findViewById(R.id.ar_num);
EditText etPrice = view.findViewById(R.id.et_price);
for (ProductBean.RecordsBean recordsBean : carList) {
if (data.getId() == recordsBean.getId()) {
etPrice.setText(recordsBean.getCarPrice());
num.setNumber(Integer.valueOf(recordsBean.getCarNum()));
}
}
builder.setView(view);
AlertDialog addCartDialog = builder.create();
tvOk.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (TextUtils.isEmpty(etPrice.getText().toString())) {
toast("请填写组装单价");
return;
}
clientList.get(position).setCarNum(num.getNumber());
clientList.get(position).setCarPrice(etPrice.getText().toString());
clientAdapter.notifyItemChanged(position);
addCart(data, num.getNumber(), etPrice.getText().toString());
tvNum.setText("共 ".concat(carList.size() + "").concat(" 件"));
addCartDialog.dismiss();
}
});
tvCancel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
addCartDialog.dismiss();
}
});
addCartDialog.show();
}
/**
* 添加购物车
*
* @param chooseProduct 产品
* @param number 数量
* @param price 单价
*/
private void addCart(ProductBean.RecordsBean chooseProduct, int number, String price) {
boolean isHas = false;
for (ProductBean.RecordsBean recordsBean : carList) {
if (chooseProduct.getId() == recordsBean.getId()) {
isHas = true;
recordsBean.setCarNum(number);
recordsBean.setCarPrice(price);
}
}
if (!isHas) {
chooseProduct.setCarNum(number);
chooseProduct.setCarPrice(price);
carList.add(chooseProduct);
}
toast("加入购物车成功");
}
@Override
protected void initData() {
clientList = new ArrayList<>();
clientAdapter = new ProTargetAddAdapter(R.layout.item_product_target_pro, clientList);
clientAdapter.bindToRecyclerView(rvProduct);
param = WorkUtils.pageKey();
param.put("current", 1);
param.put("transitPartId", getIntent().getStringExtra("customerId"));
getData();
}
private void getData() {
RtfUtils.getRtf().saleOrderTargetPro(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<ProductBean.RecordsBean> dataList = JSON.parseObject(data.getData().toString(), ProductBean.class).getRecords();
if (page == 1) {
clientList.clear();
clientList.addAll(dataList);
clientAdapter.notifyDataSetChanged();
clientAdapter.loadMoreComplete();
} else {
clientAdapter.loadMoreComplete();
clientList.addAll(dataList);
clientAdapter.notifyDataSetChanged();
}
if (dataList.size() == 0) {
clientAdapter.loadMoreEnd();
} else {
page++;
}
}
});
}
@Override
protected void initEvent() {
clientAdapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
@Override
public void onLoadMoreRequested() {
param.put("current", page);
getData();
}
}, rvProduct);
clientAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
openDialog(clientList.get(position), position);
}
});
}
@Override
protected int layoutId() {
return R.layout.activity_product_add_pro;
}
@OnClick({R.id.tv_ok, R.id.btn_search})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.tv_ok:
if (carList.size() == 0) {
toast("购物车没有产品");
return;
}
startActivity(ProductConfirmActivity.class,
"base",getIntent().getStringExtra("base"),
"usedStockId", getIntent().getStringExtra("usedStockId"),
"targetStockId", getIntent().getStringExtra("targetStockId"),
"customerId", getIntent().getStringExtra("customerId"),
"to", JSON.toJSONString(carList),
"from", getIntent().getStringExtra("from"));
break;
case R.id.btn_search:
param.put("name", etKey.getText().toString());
param.put("current", 1);
page = 1;
getData();
break;
}
}
@Override
public void onStart() {
super.onStart();
EventBus.getDefault().register(this);
}
@Override
public void onStop() {
super.onStop();
EventBus.getDefault().unregister(this);
}
@Subscribe
public void refresh(CheckTicketEvent event) {
finish();
}
}
......@@ -67,7 +67,7 @@ public class ReturnApplyActivity extends WorkToolBarActivity {
page = 1;
param.put("current", page);
param.put("orderId", getIntent().getStringExtra("orderId"));
// param.put("productId", getIntent().getStringExtra("productId"));
param.put("productId", getIntent().getStringExtra("productId"));
getData();
}
......
......@@ -7,6 +7,7 @@ import android.view.MenuItem;
import com.google.android.material.tabs.TabLayout;
import com.wd.workoffice.R;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.ui.activity.bat.order.ProductOrderAddActivity;
import com.wd.workoffice.ui.activity.bat.order.ProductOrderSearchActivity;
import com.wd.workoffice.ui.adapter.VpDataAdapter;
import com.wd.workoffice.ui.fg.ProductOrderApplyFragment;
......@@ -85,7 +86,7 @@ public class SaleProductOrderActivity extends WorkToolBarActivity {
startActivity(ProductOrderSearchActivity.class, "identity", getIntent().getStringExtra("identity"));
break;
case R.id.add:
startActivity(ProductOrderSearchActivity.class, "identity", getIntent().getStringExtra("identity"));
startActivity(ProductOrderAddActivity.class, "identity", getIntent().getStringExtra("identity"));
break;
}
return super.onOptionsItemSelected(item);
......
package com.wd.workoffice.ui.adapter;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.wd.workoffice.R;
import com.wd.workoffice.bean.ProAddBean;
import com.wd.workoffice.bean.TicketAddBean;
import java.util.List;
import androidx.annotation.Nullable;
/**
* Created by flexible on 2018/8/13.
*/
public class ProAddAdapter extends BaseQuickAdapter<ProAddBean.RecordsBean, BaseViewHolder> {
int type;//0,add 1,submit
public ProAddAdapter(int layoutResId, List data) {
super(layoutResId, data);
}
public ProAddAdapter(int layoutResId, @Nullable List<ProAddBean.RecordsBean> data, int type) {
super(layoutResId, data);
this.type = type;
}
@Override
protected void convert(BaseViewHolder helper, ProAddBean.RecordsBean item) {
helper.setText(R.id.tv_name, item.getProductName());
helper.setText(R.id.tv_order, item.getOrderId());
helper.setText(R.id.tv_order_type, item.getOrderTypeName());
helper.setText(R.id.tv_pd_code, item.getSerialNumber());
helper.setText(R.id.tv_spec, item.getProductSpec());
helper.setText(R.id.tv_unit, item.getProductUnit());
helper.setText(R.id.tv_apply_num, item.getCanPackageSum() + "");
if (type == 1) {
helper.setVisible(R.id.iv_cart, false);
}
}
}
package com.wd.workoffice.ui.adapter;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.wd.workoffice.R;
import com.wd.workoffice.bean.ProAddBean;
import com.wd.workoffice.bean.ProductBean;
import java.util.List;
import androidx.annotation.Nullable;
/**
* Created by flexible on 2018/8/13.
*/
public class ProTargetAddAdapter extends BaseQuickAdapter<ProductBean.RecordsBean, BaseViewHolder> {
int type;//0,add 1,submit
public ProTargetAddAdapter(int layoutResId, List data) {
super(layoutResId, data);
}
public ProTargetAddAdapter(int layoutResId, @Nullable List<ProductBean.RecordsBean> data, int type) {
super(layoutResId, data);
this.type = type;
}
@Override
protected void convert(BaseViewHolder helper, ProductBean.RecordsBean item) {
helper.setText(R.id.tv_name, item.getName());
helper.setText(R.id.tv_in_price, String.valueOf(item.getInternalPrice()));
helper.setText(R.id.tv_spec, item.getSpec());
helper.setText(R.id.tv_num, item.getCarNum() +"");
helper.setText(R.id.tv_price, item.getCarPrice() );
if (type == 1) {
helper.setVisible(R.id.iv_cart, false);
}
}
}
<?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">
<TextView
android:id="@+id/tv_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="15mm"
android:text="共选中 0 件"
android:textSize="13sp" />
<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: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:maxLines="1"
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>
<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>
<?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">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5mm"
android:text="邢台德龙钢铁客户"
android:textSize="16sp"
android:textStyle="bold" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="14mm"
android:background="#FCFCFD"
android:orientation="vertical"
android:paddingVertical="10mm">
<RelativeLayout
android:id="@+id/rl_dep"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="10mm"
android:text="订单编号"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
<TextView
android:id="@+id/tv_order"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm"
android:paddingHorizontal="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="10mm"
android:text="订单类型"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
<TextView
android:id="@+id/tv_order_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm"
android:paddingHorizontal="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="10mm"
android:text="订单编号"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
<TextView
android:id="@+id/tv_pd_code"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm"
android:paddingHorizontal="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="10mm"
android:text="规格"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
<TextView
android:id="@+id/tv_spec"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm"
android:paddingHorizontal="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="10mm"
android:text="单位"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
<TextView
android:id="@+id/tv_unit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm"
android:paddingHorizontal="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="10mm"
android:text="可申请数量"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
<TextView
android:id="@+id/tv_apply_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
</RelativeLayout>
</LinearLayout>
<ImageView
android:id="@+id/iv_cart"
android:layout_width="25mm"
android:layout_height="25mm"
android:layout_gravity="right"
android:src="@mipmap/ticket_add_cart" />
</LinearLayout>
\ No newline at end of file
<?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">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5mm"
android:text="邢台德龙钢铁客户"
android:textSize="16sp"
android:textStyle="bold" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="14mm"
android:background="#FCFCFD"
android:orientation="vertical"
android:paddingVertical="10mm">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="10mm"
android:text="规格"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
<TextView
android:id="@+id/tv_spec"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm"
android:paddingHorizontal="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="10mm"
android:text="内部单价"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
<TextView
android:id="@+id/tv_in_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:textColor="@color/flexible_text_gray"
android:textSize="13sp" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="开单单价:"
android:textColor="@color/red_btn_bg"
android:textSize="13sp" />
<TextView
android:id="@+id/tv_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/red_btn_bg"
android:textSize="13sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15mm"
android:text="申请数量:"
android:textColor="@color/red_btn_bg"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_num"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/red_btn_bg"
android:textSize="12sp" />
<ImageView
android:id="@+id/iv_cart"
android:layout_width="25mm"
android:layout_height="25mm"
android:layout_gravity="right"
android:src="@mipmap/ticket_add_cart" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#d1f8f8f8"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20mm"
android:gravity="center"
android:text="选择产品来源"
android:textSize="17sp"
android:textStyle="bold" />
<LinearLayout
android:id="@+id/ll_price"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30mm"
android:orientation="horizontal"
android:paddingHorizontal="20mm">
<TextView
android:id="@+id/tv_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="可申请数量"
android:textColor="@color/flexible_text_sup"
android:textSize="17sp" />
<TextView
android:id="@+id/et_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:inputType="numberDecimal"
android:paddingHorizontal="10mm"
android:paddingVertical="4mm"
android:textColor="@color/flexible_text_sup"
android:textColorHint="#91ABBA"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="25mm"
android:gravity="center_vertical"
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" />
<com.wd.workoffice.widget.AddAndReduceDoubleView
android:id="@+id/ar_num"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10mm" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30mm"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_cancel"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:paddingVertical="15mm"
android:text="取消"
android:textColor="#007AFF"
android:textSize="17sp" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#D8DCE6" />
<TextView
android:id="@+id/tv_ok"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:paddingVertical="15mm"
android:text="确定"
android:textColor="#007AFF"
android:textSize="17sp" />
</LinearLayout>
</LinearLayout>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论