提交 58e3e73c authored 作者: lgd's avatar lgd

1.添加单据

2.//todo  回款管理的客户接口
上级 e73b4978
package com.wd.workoffice.bean;
import java.util.List;
/**
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class OrderBillBean {
/**
* createdBy : null
* createdByName : null
* createdTime : null
* updatedBy : null
* updatedByName : null
* updatedTime : null
* id : 3
* bilId : SA
* spcId : OB
* spcNo : 001
* name : 铝碳
* rem : 01
* mrk : null
* mdId : null
*/
private Object createdBy;
private Object createdByName;
private Object createdTime;
private Object updatedBy;
private Object updatedByName;
private Object updatedTime;
private int id;
private String bilId;
private String spcId;
private String spcNo;
private String name;
private String rem;
private Object mrk;
private Object mdId;
public Object getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Object createdBy) {
this.createdBy = createdBy;
}
public Object getCreatedByName() {
return createdByName;
}
public void setCreatedByName(Object createdByName) {
this.createdByName = createdByName;
}
public Object getCreatedTime() {
return createdTime;
}
public void setCreatedTime(Object createdTime) {
this.createdTime = createdTime;
}
public Object getUpdatedBy() {
return updatedBy;
}
public void setUpdatedBy(Object updatedBy) {
this.updatedBy = updatedBy;
}
public Object getUpdatedByName() {
return updatedByName;
}
public void setUpdatedByName(Object updatedByName) {
this.updatedByName = updatedByName;
}
public Object getUpdatedTime() {
return updatedTime;
}
public void setUpdatedTime(Object updatedTime) {
this.updatedTime = updatedTime;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getBilId() {
return bilId;
}
public void setBilId(String bilId) {
this.bilId = bilId;
}
public String getSpcId() {
return spcId;
}
public void setSpcId(String spcId) {
this.spcId = spcId;
}
public String getSpcNo() {
return spcNo;
}
public void setSpcNo(String spcNo) {
this.spcNo = spcNo;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getRem() {
return rem;
}
public void setRem(String rem) {
this.rem = rem;
}
public Object getMrk() {
return mrk;
}
public void setMrk(Object mrk) {
this.mrk = mrk;
}
public Object getMdId() {
return mdId;
}
public void setMdId(Object mdId) {
this.mdId = mdId;
}
}
......@@ -509,6 +509,14 @@ public interface ApiService {
@GET("/customer-branch-factory/page/init")
Observable<BaseBean> getClientFactory(@QueryMap Map<String, Object> param);
/**
* 获取客单据
*
* @return
*/
@GET("/bil-spc/list")
Observable<BaseBean> getBill();
/**
* app端往来单位分页列表
*
......
......@@ -4,6 +4,7 @@ import android.Manifest;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
......@@ -22,6 +23,8 @@ import com.tbruyelle.rxpermissions2.RxPermissions;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.OrderBillBean;
import com.wd.workoffice.bean.ProcessBean;
import com.wd.workoffice.bean.ProductBean;
import com.wd.workoffice.bean.workEnum.PermissionType;
import com.wd.workoffice.retrofit.ApiService;
......@@ -46,8 +49,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.xml.transform.Result;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
......@@ -56,7 +57,6 @@ import butterknife.ButterKnife;
import butterknife.OnClick;
import flexible.xd.android_base.network.rtfhttp.RtfHelper;
import flexible.xd.android_base.network.rtfhttp.Transformer;
import flexible.xd.android_base.network.rtfhttp.observer.BaseObserver;
import flexible.xd.android_base.utils.TimeUtils;
import io.reactivex.Observable;
import io.reactivex.disposables.Disposable;
......@@ -65,7 +65,7 @@ import okhttp3.MultipartBody;
import okhttp3.RequestBody;
/**
* 商店-销售/供应/外采购-产品-确认订单
* 商店-销售/供应/外采购/坩埚-产品-确认订单
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
......@@ -112,6 +112,10 @@ public class StoreSaleConfirmActivity extends WorkToolBarActivity {
EditText etInput5;
@BindView(R.id.tv_input5)
TextView tvInput5;
@BindView(R.id.tv_bill)
TextView tvBill;
@BindView(R.id.rl_bill)
RelativeLayout rlBill;
private List<ProductBean.RecordsBean> proList;
private StoreCarAdapter proAdapter;
private QMUIDialog.MenuDialogBuilder setDialog;
......@@ -120,6 +124,10 @@ public class StoreSaleConfirmActivity extends WorkToolBarActivity {
private Map<String, Object> expandInfo;
private List<JSONObject> orderItems;
private Integer choosePosition;
private QMUIDialog.MenuDialogBuilder billDialog;
private List<String> billNameList = new ArrayList<>();
private List<OrderBillBean> billList = new ArrayList<>();
private OrderBillBean chooseBill;
@Override
protected void initView() {
......@@ -138,6 +146,15 @@ public class StoreSaleConfirmActivity extends WorkToolBarActivity {
dialog.dismiss();
}
});
billDialog = DialogUtils.listDialog(this);
String code = getIntent().getStringExtra("code");
if (TextUtils.equals(code, PermissionType.PROCESS_PURCHASE.getCode()) ||
TextUtils.equals(code, PermissionType.PROCESS_SALE.getCode()) ||
TextUtils.equals(code, PermissionType.PROCESS_SUPPLY.getCode())) {
rlBill.setVisibility(View.VISIBLE);
}else {
rlBill.setVisibility(View.GONE);
}
}
......@@ -167,6 +184,45 @@ public class StoreSaleConfirmActivity extends WorkToolBarActivity {
param.put("launchUserId", UserKeeper.getInstance().getUserId());
param.put("launchDeptId", UserKeeper.getInstance().getUserDepId());
expandInfo = new HashMap<>();
getBillData();
}
private void getBillData() {
RtfUtils.getRtf().getBill().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<OrderBillBean> dataList = JSON.parseArray(data.getData().toString(), OrderBillBean.class);
billList.clear();
billList.addAll(dataList);
billNameList.clear();
for (OrderBillBean process : dataList) {
billNameList.add(process.getName());
}
billDialog.addItems(billNameList.toArray(new String[billNameList.size()]), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
chooseBill = billList.get(which);
tvBill.setText(billNameList.get(which));
dialog.dismiss();
}
});
}
});
}
/**
......@@ -182,7 +238,7 @@ public class StoreSaleConfirmActivity extends WorkToolBarActivity {
data.put("productId", recordsBean.getId());
data.put("type", "PDS");
// data.put("tranFromStockId", recordsBean.getCarPrice());
data.put("innerPrice", MathUtils.converData(recordsBean.getInternalPrice(),3));
data.put("innerPrice", MathUtils.converData(recordsBean.getInternalPrice(), 3));
data.put("customerBranchFactoryId", recordsBean.getFactoryId());//3.分厂客户ID
data.put("outerPrice", recordsBean.getCarPrice());
data.put("productCount", recordsBean.getCarNum());
......@@ -224,22 +280,7 @@ public class StoreSaleConfirmActivity extends WorkToolBarActivity {
* @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");
}
});
WorkUtils.addNumListener(et, tv);
}
@Override
......@@ -248,14 +289,28 @@ public class StoreSaleConfirmActivity extends WorkToolBarActivity {
}
@OnClick({R.id.tv_ok, R.id.rl_set, R.id.rl_time})
@OnClick({R.id.rl_bill, R.id.tv_ok, R.id.rl_set, R.id.rl_time})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.rl_bill:
billDialog.show();
break;
case R.id.tv_ok:
if (expandInfo.get("outdeptLedger") == null) {
toast("请选择账套");
return;
}
String code = getIntent().getStringExtra("code");
if (TextUtils.equals(code, PermissionType.PROCESS_PURCHASE.getCode()) ||
TextUtils.equals(code, PermissionType.PROCESS_SALE.getCode()) ||
TextUtils.equals(code, PermissionType.PROCESS_SUPPLY.getCode())) {
if (chooseBill == null) {
toast("请选择单据");
return;
} else {
param.put("erpSpcNo", chooseBill.getSpcNo());
}
}
if (expandInfo.get("requireTime") == null) {
toast("请选择客户要求交货时间");
return;
......@@ -435,4 +490,5 @@ public class StoreSaleConfirmActivity extends WorkToolBarActivity {
}
});
}
}
......@@ -142,7 +142,44 @@
android:src="@mipmap/arrow_right_gray" />
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_bill"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="20mm"
android:paddingVertical="9mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:text="选择单据"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:gravity="center_vertical">
<TextView
android:id="@+id/tv_bill"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginRight="3mm"
android:text="请选择单据"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
<ImageView
android:layout_width="15mm"
android:layout_height="20mm"
android:src="@mipmap/arrow_right_gray" />
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_time"
android:layout_width="match_parent"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论