提交 882b7822 authored 作者: lgd's avatar lgd

1.物流单

上级 ccdc0bad
...@@ -2473,7 +2473,30 @@ ...@@ -2473,7 +2473,30 @@
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/Work.Base" android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" /> android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.activity.bat.work.FareListActivity"
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.work.FareAddActivity"
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.work.FareAddConfirmActivity"
android:configChanges="keyboardHidden|orientation"
android:label="生成运费单"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<activity <activity
android:name=".ui.activity.mes.work.QualityWorkActivity" android:name=".ui.activity.mes.work.QualityWorkActivity"
android:configChanges="orientation|screenSize|keyboardHidden" android:configChanges="orientation|screenSize|keyboardHidden"
......
package com.wd.workoffice.bean.event;
/**
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class FareConfirmEvent {
public FareConfirmEvent() {
}
}
package com.wd.workoffice.bean.workEnum; package com.wd.workoffice.bean.workEnum;
import com.wd.workoffice.ui.activity.bat.work.WorkFinancialProfitActivity;
/** /**
* author : flexible * author : flexible
* email : lgd19940421@163.com * email : lgd19940421@163.com
...@@ -203,7 +205,11 @@ public enum PagePermissionType { ...@@ -203,7 +205,11 @@ public enum PagePermissionType {
LOGISTICS_SAVE("finance:logistics-apply:save", "添加开票申请 "), LOGISTICS_SAVE("finance:logistics-apply:save", "添加开票申请 "),
LOGISTICS_UPDATE("finance:logistics-apply:update", "审批开票申请"), LOGISTICS_UPDATE("finance:logistics-apply:update", "审批开票申请"),
LOGISTICS_PAGE("finance:logistics:page:list", "获取生产商与物流公司账款分页列表"), LOGISTICS_PAGE("finance:logistics:page:list", "获取生产商与物流公司账款分页列表"),
LOGISTICS_FLOW_PAGE("finance:logistics-flow:page:list", "获取运费账款流水分页记录"); LOGISTICS_FLOW_PAGE("finance:logistics-flow:page:list", "获取运费账款流水分页记录"),
FARE_PAGE("finance:fare:page:list", "运费分页列表"),
FARE_SAVE("finance:fare:save", "生成运费单");
//巡查服务 //巡查服务
//派遣服务 //派遣服务
//请购单 //请购单
......
...@@ -2345,6 +2345,28 @@ public interface ApiService { ...@@ -2345,6 +2345,28 @@ public interface ApiService {
*/ */
@PUT("/mark-order-rel") @PUT("/mark-order-rel")
Observable<BaseBean> changeOrderMark(@Body RequestBody requestBody); Observable<BaseBean> changeOrderMark(@Body RequestBody requestBody);
/**
* 运费单分页列
*
* @return
*/
@GET("/finance-fare/page/list")
Observable<BaseBean> fareList(@QueryMap Map<String, Object> param);
/**
* 运费单分页列
*
* @return
*/
@GET("/send-out-store-apply/logistics/page/list")
Observable<BaseBean> logisticsList(@QueryMap Map<String, Object> param);
/**
* 新增运费单
*
* @return
*/
@POST("/finance-fare")
Observable<BaseBean> fareAdd(@Body RequestBody requestBody);
} }
package com.wd.workoffice.ui.activity.bat.work;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.alibaba.fastjson.JSON;
import com.chad.library.adapter.base.BaseQuickAdapter;
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.AddStockChooseBean;
import com.wd.workoffice.bean.FareOrderBean;
import com.wd.workoffice.bean.ProAddBean;
import com.wd.workoffice.bean.ProcessBean;
import com.wd.workoffice.bean.ProductBean;
import com.wd.workoffice.bean.StockBean;
import com.wd.workoffice.bean.TradingBean;
import com.wd.workoffice.bean.event.CheckTicketEvent;
import com.wd.workoffice.bean.event.FareConfirmEvent;
import com.wd.workoffice.bean.event.ModifyCarEvent;
import com.wd.workoffice.bean.workEnum.PagePermissionType;
import com.wd.workoffice.bean.workEnum.PermissionType;
import com.wd.workoffice.presenter.BatChooseInfoPresenter;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.activity.bat.order.ProductOrderProTargetActivity;
import com.wd.workoffice.ui.activity.bat.store.ChooseProcessActivity;
import com.wd.workoffice.ui.activity.bat.store.ChooseStockActivity;
import com.wd.workoffice.ui.activity.bat.store.StoreSaleClientActivity;
import com.wd.workoffice.ui.adapter.FareOrderAdapter;
import com.wd.workoffice.ui.adapter.StoreProductAdapter;
import com.wd.workoffice.ui.adapter.TradingProDetailAdapter;
import com.wd.workoffice.ui.adapter.TradingProductAdapter;
import com.wd.workoffice.util.DialogUtils;
import com.wd.workoffice.util.MathUtils;
import com.wd.workoffice.util.UserKeeper;
import com.wd.workoffice.util.WorkUtils;
import com.wd.workoffice.widget.BadgeCarProvider;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import androidx.annotation.Nullable;
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 FareAddActivity 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.tv_client)
TextView tvClient;
@BindView(R.id.ll_client)
LinearLayout llClient;
@BindView(R.id.et_key)
EditText etKey;
@BindView(R.id.btn_search)
Button btnSearch;
@BindView(R.id.rv_product)
RecyclerView rvData;
private Map<String, Object> param;
private List<FareOrderBean.RecordsBean> proList;
private FareOrderAdapter proAdapter;
private int page = 1;
private Integer clientId;
@Override
protected void initView() {
ButterKnife.bind(this);
rvData.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false));
}
@Override
protected void initData() {
proList = new ArrayList<>();
proAdapter = new FareOrderAdapter(R.layout.item_fare_order, proList, 0);
proAdapter.bindToRecyclerView(rvData);
proAdapter.setEmptyView(R.layout.view_empty_order, rvData);
param = WorkUtils.pageKey();
param.put("current", 1);
}
@Override
protected void initEvent() {
proAdapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
@Override
public void onLoadMoreRequested() {
param.put("current", page);
getData();
}
}, rvData);
}
@Override
protected int layoutId() {
return R.layout.activity_fare_add;
}
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch (requestCode) {
case 10001:
if (resultCode == 10001) {
String clientName = data.getStringExtra("clientName");
clientId = data.getIntExtra("id", 0);
tvClient.setText(clientName);
param.put("customerId", clientId);
page = 1;
param.put("current", 1);
getData();
break;
}
}
}
@Override
public void onStart() {
super.onStart();
EventBus.getDefault().register(this);
}
@Override
public void onStop() {
super.onStop();
EventBus.getDefault().unregister(this);
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onMessageEvent(ModifyCarEvent event) {
changeNumAndPrice();
}
private void changeNumAndPrice() {
Map<Integer, Boolean> isChoose = proAdapter.getIsChoose();
int chooseNum = 0;
for (Map.Entry<Integer, Boolean> entry : isChoose.entrySet()) {
if (entry.getValue()) {
chooseNum += 1;
}
}
tvNum.setText(String.format("共选中 %s 条", chooseNum));
}
@OnClick({R.id.ll_client, R.id.tv_ok, R.id.btn_search})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.ll_client:
startActivityForResult(StoreSaleClientActivity.class, 10001,
"depId", UserKeeper.getInstance().getUserDepId(),
"code", "CUSTOMER");
break;
case R.id.tv_ok:
Map<Integer, Boolean> isChoose = proAdapter.getIsChoose();
if (isChoose.entrySet().size() == 0) {
toast("请选择订单");
return;
}
List<FareOrderBean.RecordsBean> addList = new ArrayList<>();
for (Map.Entry<Integer, Boolean> entry : isChoose.entrySet()) {
if (entry.getValue()) {
addList.add(proList.get(entry.getKey()));
}
}
startActivity(FareAddConfirmActivity.class,
"customerId", clientId.toString(),
"data", JSON.toJSONString(addList));
break;
case R.id.btn_search:
param.put("orderId", etKey.getText().toString());
param.put("current", 1);
page = 1;
getData();
break;
}
}
private void getData() {
RtfUtils.getRtf().logisticsList(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<FareOrderBean.RecordsBean> getList = JSON.parseObject(data.getData().toString(), FareOrderBean.class).getRecords();
if (page == 1) {
proList.clear();
proList.addAll(getList);
proAdapter.initChoose();
proAdapter.notifyDataSetChanged();
proAdapter.loadMoreComplete();
} else {
proAdapter.loadMoreComplete();
proList.addAll(getList);
proAdapter.notifyDataSetChanged();
}
if (proList.size() == 0) {
proAdapter.loadMoreEnd();
} else {
page++;
}
}
});
}
@Subscribe
public void refresh(FareConfirmEvent event) {
finish();
}
}
package com.wd.workoffice.ui.activity.bat.work;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.bigkoo.pickerview.listener.OnTimeSelectListener;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.FareOrderBean;
import com.wd.workoffice.bean.OrderDetail;
import com.wd.workoffice.bean.event.CheckSendEvent;
import com.wd.workoffice.bean.event.FareConfirmEvent;
import com.wd.workoffice.bean.event.SendWeightEvent;
import com.wd.workoffice.bean.workEnum.OrderType;
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.ui.adapter.FareOrderAdapter;
import com.wd.workoffice.ui.adapter.WorkSendApplyAddAdapter;
import com.wd.workoffice.util.MathUtils;
import com.wd.workoffice.util.PickTimeUtils;
import com.wd.workoffice.util.WorkUtils;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import androidx.annotation.Nullable;
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 flexible.xd.android_base.utils.TimeUtils;
import io.reactivex.Observable;
import io.reactivex.disposables.Disposable;
/**
* 物流单确认
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class FareAddConfirmActivity 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.rv_from)
RecyclerView rvData;
@BindView(R.id.et_logistics_price)
EditText etLogisticsPrice;
@BindView(R.id.ll_logistics_price)
LinearLayout llLogisticsPrice;
@BindView(R.id.et_tax)
EditText etTax;
@BindView(R.id.ll_tax)
LinearLayout llTax;
@BindView(R.id.et_logistics_code)
EditText etLogisticsCode;
@BindView(R.id.ll_logistics_code)
LinearLayout llLogisticsCode;
@BindView(R.id.tv_logistics_company)
TextView tvLogisticsCompany;
@BindView(R.id.rl_set)
RelativeLayout rlSet;
private List<FareOrderBean.RecordsBean> dataList;
private FareOrderAdapter dataAdapter;
private Map<String, Object> param;
private int clientId;
@Override
protected void initView() {
ButterKnife.bind(this);
rvData.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false));
WorkUtils.addDecimalsListener(etTax);
}
@Override
protected void initData() {
dataList = JSON.parseArray(getIntent().getStringExtra("data"), FareOrderBean.RecordsBean.class);
dataAdapter = new FareOrderAdapter(R.layout.item_fare_order, dataList, 1);
dataAdapter.bindToRecyclerView(rvData);
param = new HashMap<>();
param.put("customerId", getIntent().getStringExtra("customerId"));
tvPrice.setText(String.format("共选中 %s 条", dataList.size()));
}
@Override
protected void initEvent() {
}
@Override
protected int layoutId() {
return R.layout.activity_fare_confirm;
}
private boolean coverProInfo() {
List<JSONObject> fareItemList = new ArrayList<>();
for (FareOrderBean.RecordsBean recordsBean : dataList) {
JSONObject data = new JSONObject();
data.put("sendOutStoreApplyId", recordsBean.getId());
fareItemList.add(data);
}
param.put("fareItemList", fareItemList);
return true;
}
private void submit() {
String price = etLogisticsPrice.getText().toString();
String code = etLogisticsCode.getText().toString();
String tax = etTax.getText().toString();
if (TextUtils.isEmpty(price)) {
toast("请输入运费");
return;
}
if (TextUtils.isEmpty(tax)) {
toast("请输入税率");
return;
}
if (clientId == 0) {
toast("请选择物流公司");
return;
}
param.put("trackingNumber", code);
param.put("fareMoney", price);
param.put("tax", tax);
param.put("transitPartId", clientId);
RtfUtils.getRtf().fareAdd(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("提交申请成功");
EventBus.getDefault().post(new FareConfirmEvent());
finish();
}
});
}
@OnClick({R.id.tv_ok, R.id.rl_set})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.tv_ok:
if (coverProInfo()) {
submit();
}
break;
case R.id.rl_set:
startActivityForResult(StoreSaleClientActivity.class, 10001,
"flag", "1", "supplier", "选择运输商", "code", "TRANSPORTERS");
break;
}
}
@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);
tvLogisticsCompany.setText(clientName);
}
}
}
package com.wd.workoffice.ui.activity.bat.work;
import android.view.Menu;
import android.view.MenuItem;
import com.alibaba.fastjson.JSON;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.scwang.smartrefresh.layout.api.RefreshLayout;
import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.FareBean;
import com.wd.workoffice.bean.ProPriceBean;
import com.wd.workoffice.bean.event.FareConfirmEvent;
import com.wd.workoffice.bean.workEnum.PagePermissionType;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.activity.bat.order.ProductOrderAddActivity;
import com.wd.workoffice.ui.activity.bat.order.ProductOrderSearchActivity;
import com.wd.workoffice.ui.adapter.FareAdapter;
import com.wd.workoffice.ui.adapter.WorkProPriceAdapter;
import com.wd.workoffice.util.WorkUtils;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
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 FareListActivity extends WorkToolBarActivity {
@BindView(R.id.rv_data)
RecyclerView rvData;
@BindView(R.id.srl_refresh)
SmartRefreshLayout srlRefresh;
private Map<String, Object> param;
private List<FareBean.RecordsBean> dataList;
private FareAdapter dataAdapter;
private int page = 1;
@Override
protected void initView() {
ButterKnife.bind(this);
rvData.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false));
}
@Override
protected void initData() {
dataList = new ArrayList<>();
dataAdapter = new FareAdapter(R.layout.item_fare, dataList);
dataAdapter.bindToRecyclerView(rvData);
dataAdapter.setEmptyView(R.layout.view_empty_content,rvData);
param = WorkUtils.pageKey();
param.put("current", page);
getData();
}
private void getData() {
RtfUtils.getRtf().fareList(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<FareBean.RecordsBean> getList = JSON.parseObject(data.getData().toString(), FareBean.class).getRecords();
if (page == 1) {
srlRefresh.finishRefresh();
dataList.clear();
dataList.addAll(getList);
dataAdapter.notifyDataSetChanged();
dataAdapter.loadMoreComplete();
} else {
dataAdapter.loadMoreComplete();
dataList.addAll(getList);
dataAdapter.notifyDataSetChanged();
}
if (getList.size() == 0) {
dataAdapter.loadMoreEnd();
} else {
page++;
}
}
});
}
@Override
protected void initEvent() {
srlRefresh.setOnRefreshListener(new OnRefreshListener() {
@Override
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
page = 1;
param.put("current", page);
getData();
}
});
dataAdapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
@Override
public void onLoadMoreRequested() {
param.put("current", page);
getData();
}
}, rvData);
}
@Override
protected int layoutId() {
return R.layout.activity_pro_price;
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
if (WorkUtils.hasPermission(PagePermissionType.FARE_SAVE.getPermission())) {
getMenuInflater().inflate(R.menu.menu_add_and_search, menu);
}
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.search:
// startActivity(ProductOrderSearchActivity.class, "identity", getIntent().getStringExtra("identity"));
break;
case R.id.add:
startActivity(FareAddActivity.class);
break;
}
return super.onOptionsItemSelected(item);
}
@Override
public void onStart() {
super.onStart();
EventBus.getDefault().register(this);
}
@Override
public void onStop() {
super.onStop();
EventBus.getDefault().unregister(this);
}
@Subscribe
public void refresh(FareConfirmEvent event) {
page = 1;
param.put("current", page);
getData();
}
}
...@@ -54,9 +54,16 @@ public class WorkFinancialActivity extends WorkToolBarActivity { ...@@ -54,9 +54,16 @@ public class WorkFinancialActivity extends WorkToolBarActivity {
} }
@OnClick({R.id.ll_profit, R.id.ll_back, R.id.ll_pay, R.id.ll_open_ticket, R.id.ll_receive_ticket, R.id.ll_account, R.id.ll_logistics}) @OnClick({R.id.ll_freight_bill,R.id.ll_profit, R.id.ll_back, R.id.ll_pay, R.id.ll_open_ticket, R.id.ll_receive_ticket, R.id.ll_account, R.id.ll_logistics})
public void onViewClicked(View view) { public void onViewClicked(View view) {
switch (view.getId()) { switch (view.getId()) {
case R.id.ll_freight_bill:
if (!WorkUtils.hasPermission(PagePermissionType.FARE_PAGE.getPermission())) {
toast(R.string.permission);
return;
}
startActivity(FareListActivity.class);
break;
case R.id.ll_profit: case R.id.ll_profit:
if (!WorkUtils.hasPermission(PagePermissionType.SALE_ORDER_AUDIT.getPermission()) && if (!WorkUtils.hasPermission(PagePermissionType.SALE_ORDER_AUDIT.getPermission()) &&
!WorkUtils.hasPermission(PagePermissionType.PO_PURCHASE_AUDIT.getPermission())) { !WorkUtils.hasPermission(PagePermissionType.PO_PURCHASE_AUDIT.getPermission())) {
......
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.FareBean;
import com.wd.workoffice.bean.ProPriceBean;
import com.wd.workoffice.util.MathUtils;
import java.util.List;
/**
* Created by flexible on 2018/8/13.
*/
public class FareAdapter extends BaseQuickAdapter<FareBean.RecordsBean, BaseViewHolder> {
public FareAdapter(int layoutResId, List data) {
super(layoutResId, data);
}
@Override
protected void convert(BaseViewHolder helper, FareBean.RecordsBean item) {
helper.setText(R.id.tv_price, MathUtils.converData(item.getFareMoney(),3));
helper.setText(R.id.tv_time, item.getCreatedTime());
helper.setText(R.id.tv_title, "快递单号:".concat(item.getTrackingNumber()));
helper.setText(R.id.tv_create_by, item.getCreatedByName());
}
}
package com.wd.workoffice.ui.adapter;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import com.alibaba.fastjson.JSON;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.wd.workoffice.R;
import com.wd.workoffice.bean.AddStockChooseBean;
import com.wd.workoffice.bean.FareBean;
import com.wd.workoffice.bean.FareOrderBean;
import com.wd.workoffice.bean.event.ModifyCarEvent;
import com.wd.workoffice.util.MathUtils;
import org.greenrobot.eventbus.EventBus;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
/**
* Created by flexible on 2018/8/13.
*/
public class FareOrderAdapter extends BaseQuickAdapter<FareOrderBean.RecordsBean, BaseViewHolder> {
int type;// 0 新增选择 1 新增展示 2 详情
Map<Integer, Boolean> isChoose = new LinkedHashMap<>();
public FareOrderAdapter(int layoutResId, List data) {
super(layoutResId, data);
for (int i = 0; i < getData().size(); i++) {
isChoose.put(i, false);
}
}
public FareOrderAdapter(int layoutResId, List data, int type) {
super(layoutResId, data);
this.type = type;
for (int i = 0; i < getData().size(); i++) {
isChoose.put(i, false);
}
}
@Override
protected void convert(BaseViewHolder helper, FareOrderBean.RecordsBean item) {
if (type == 1) {
helper.setGone(R.id.cb_check, false);
} else if (type == 2) {
helper.setGone(R.id.cb_check, false);
} else {
}
helper.setText(R.id.tv_name, String.format("订单号:%s", item.getOrderId()));
helper.setText(R.id.tv_time, item.getUpdatedTime());
helper.setText(R.id.tv_weight, MathUtils.converData(item.getTotalWeight(), 3));
helper.setText(R.id.tv_company, item.getReceiveDeptName());
CheckBox cbChoose = helper.getView(R.id.cb_check);
cbChoose.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
isChoose.put(helper.getAdapterPosition(), cbChoose.isChecked());
EventBus.getDefault().post(new ModifyCarEvent(JSON.toJSONString(getData())));
}
});
cbChoose.setChecked(isChoose.get(helper.getAdapterPosition()) == null ? false : isChoose.get(helper.getAdapterPosition()));
}
public Map<Integer, Boolean> getIsChoose() {
return isChoose;
}
public void setIsChoose(Map<Integer, Boolean> isChoose) {
this.isChoose = isChoose;
}
public void initChoose() {
for (int i = 0; i < getData().size(); i++) {
isChoose.put(i, 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:id="@+id/ll_client"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:paddingHorizontal="20mm"
android:paddingVertical="12mm">
<TextView
android:id="@+id/tv_client"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="请选择客户"
android:textColor="#ff3f617f"
android:textSize="16sp" />
<ImageView
android:layout_width="20mm"
android:layout_height="20mm"
android:src="@mipmap/arrow_right_blue" />
</LinearLayout>
<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"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
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">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_marginLeft="15mm"
android:gravity="center_vertical"
android:orientation="vertical">
<TextView
android:id="@+id/tv_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10mm"
android:textSize="16sp" />
</LinearLayout>
<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>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/ll_bottom"
android:background="@color/white">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/ll_bottom"
android:orientation="vertical"
android:paddingBottom="20mm">
<View style="@style/ViewX" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingVertical="10mm">
<View
android:layout_width="8mm"
android:layout_height="18mm"
android:background="@color/red_btn_bg" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10mm"
android:text="组装来源"
android:textSize="16sp" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_from"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<View style="@style/ViewX" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingVertical="10mm">
<View
android:layout_width="8mm"
android:layout_height="18mm"
android:background="@color/red_btn_bg" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10mm"
android:text="基本信息"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_logistics_price"
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:textSize="14sp" />
<EditText
android:id="@+id/et_logistics_price"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginLeft="10mm"
android:layout_weight="1"
android:background="@null"
android:gravity="right"
android:hint="输入运费"
android:inputType="numberDecimal"
android:padding="3mm"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_tax"
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:textSize="14sp" />
<EditText
android:id="@+id/et_tax"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginLeft="10mm"
android:layout_weight="1"
android:background="@null"
android:gravity="right"
android:hint="如果为5%,这里应该填写0.05"
android:inputType="numberDecimal"
android:padding="3mm"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_logistics_code"
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:textSize="14sp" />
<EditText
android:id="@+id/et_logistics_code"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginLeft="10mm"
android:layout_weight="1"
android:background="@null"
android:gravity="right"
android:hint="输入快递单号"
android:padding="3mm"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
</LinearLayout>
<RelativeLayout
android:id="@+id/rl_set"
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: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_logistics_company"
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>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</RelativeLayout>
\ No newline at end of file
...@@ -190,7 +190,31 @@ ...@@ -190,7 +190,31 @@
android:layout_height="20mm" android:layout_height="20mm"
android:background="@mipmap/arrow_right_my" /> android:background="@mipmap/arrow_right_my" />
</LinearLayout> </LinearLayout>
<View style="@style/dividerX" />
<LinearLayout
android:id="@+id/ll_freight_bill"
style="@style/llStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="@dimen/dp_10"
android:layout_weight="3"
android:text="运费单"
android:textSize="16sp" />
<ImageView
android:layout_width="20mm"
android:layout_height="20mm"
android:background="@mipmap/arrow_right_my" />
</LinearLayout>
<View style="@style/dividerX" /> <View style="@style/dividerX" />
</LinearLayout> </LinearLayout>
</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"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="vertical"
android:paddingHorizontal="20mm"
android:paddingVertical="10mm">
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:textSize="16sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="14mm"
android:background="#FCFCFD"
android:orientation="vertical"
android:padding="10mm">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="物流单号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="品号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="运费"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="品号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="创建人"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_create_by"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="品号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="创建时间"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="品号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</RelativeLayout>
</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"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="vertical"
android:layout_marginTop="10mm"
android:paddingHorizontal="20mm"
android:paddingVertical="10mm">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<CheckBox
android:id="@+id/cb_check"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="图号TH82739857"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15mm"
android:background="#FCFCFD"
android:orientation="vertical"
android:paddingVertical="10mm">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="运费承担公司"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_company"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="发货重量"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_weight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="品号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="发货时间"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="品号"
android:textColor="@color/flexible_text_gray"
android:textSize="12sp" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论