提交 d8acb850 authored 作者: lgd's avatar lgd

1.退货

2.//TODO 设备三个子菜单,退件详情(审核历史(缺接口)),领用申请列表(数据不对),坩埚下单,mes其他页面,编辑任务担当无法修改.支数参数
上级 95edff1e
package com.wd.workoffice.bean.event;
/**
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class CheckReturnEvent {
public CheckReturnEvent() {
}
}
......@@ -256,6 +256,7 @@ public class OutOrderDetailActivity extends WorkToolBarActivity {
llBottom.setVisibility(View.VISIBLE);
llApply.setVisibility(View.VISIBLE);
rlSet.setVisibility(View.VISIBLE);
tvSendApply.setVisibility(View.GONE);
break;
default:
llBottom.setVisibility(View.VISIBLE);
......
......@@ -12,12 +12,17 @@ import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.ReturnApplyBean;
import com.wd.workoffice.bean.event.CheckMoneytEvent;
import com.wd.workoffice.bean.event.CheckReturnEvent;
import com.wd.workoffice.bean.workEnum.OrderType;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.adapter.RetrunSendApplyAdapter;
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;
......@@ -155,4 +160,23 @@ public class ReturnApplyActivity extends WorkToolBarActivity {
return R.layout.activity_pro_price;
}
@Override
public void onStart() {
super.onStart();
EventBus.getDefault().register(this);
}
@Override
public void onStop() {
super.onStop();
EventBus.getDefault().unregister(this);
}
@Subscribe
public void refresh(CheckReturnEvent event) {
page = 1;
param.put("current", page);
getData();
}
}
......@@ -18,6 +18,7 @@ import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.ReturnApplyBean;
import com.wd.workoffice.bean.event.CheckAddStockEvent;
import com.wd.workoffice.bean.event.CheckReturnEvent;
import com.wd.workoffice.bean.workEnum.OrderType;
import com.wd.workoffice.bean.workEnum.PagePermissionType;
import com.wd.workoffice.retrofit.RtfUtils;
......@@ -121,6 +122,8 @@ public class ReturnDetailActivity extends WorkToolBarActivity {
TextView tvDep4;
@BindView(R.id.tv_dep5)
TextView tvDep5;
@BindView(R.id.ll_process)
LinearLayout llProcess;
private ReturnApplyBean.RecordsBean info;
private String orderType;
......@@ -171,7 +174,7 @@ public class ReturnDetailActivity extends WorkToolBarActivity {
llCheck.setVisibility(View.GONE);
}
} else if (TextUtils.equals(orderType, OrderType.OUT_BUY.getCode())) {
if (TextUtils.equals("0", status)) {
if (status.startsWith("1") && !status.endsWith("4")) {
llBottom.setVisibility(View.VISIBLE);
llCheck.setVisibility(View.VISIBLE);
} else {
......@@ -179,7 +182,7 @@ public class ReturnDetailActivity extends WorkToolBarActivity {
llCheck.setVisibility(View.GONE);
}
rlHistory.setVisibility(View.GONE);
llCheck.setVisibility(View.GONE);
llProcess.setVisibility(View.GONE);
}
}
......@@ -360,8 +363,12 @@ public class ReturnDetailActivity extends WorkToolBarActivity {
private void check(int status, String remark, int id) {
Map<String, Object> param = WorkUtils.simpleParam();
param.put("status", status == 1 ? Integer.valueOf(info.getStatus()) + 1 : Integer.valueOf(info.getStatus()) + 11);
param.put("productAmount", info.getProductAmount());
if (TextUtils.equals(orderType, OrderType.SALE.getCode())) {
param.put("status", status == 1 ? Integer.valueOf(info.getStatus()) + 1 : Integer.valueOf(info.getStatus()) + 11);
} else if (TextUtils.equals(orderType, OrderType.OUT_BUY.getCode())) {
param.put("status", status);
param.put("productAmount", info.getProductAmount());
}
param.put("auditRemark", remark);
param.put("id", id);
Observable<BaseBean> observable;
......@@ -401,10 +408,14 @@ public class ReturnDetailActivity extends WorkToolBarActivity {
return;
}
toast("操作成功");
EventBus.getDefault().post(new CheckAddStockEvent());
int changeStatus = status == 1 ? Integer.valueOf(info.getStatus()) + 1 : Integer.valueOf(info.getStatus()) + 11;
info.setStatus(changeStatus + "");
changeView();
if (TextUtils.equals(orderType, OrderType.SALE.getCode())) {
int changeStatus = status == 1 ? Integer.valueOf(info.getStatus()) + 1 : Integer.valueOf(info.getStatus()) + 11;
info.setStatus(changeStatus + "");
changeView();
} else if (TextUtils.equals(orderType, OrderType.OUT_BUY.getCode())) {
llBottom.setVisibility(View.GONE);
}
EventBus.getDefault().post(new CheckReturnEvent());
}
});
}
......@@ -435,5 +446,4 @@ public class ReturnDetailActivity extends WorkToolBarActivity {
break;
}
}
}
......@@ -62,20 +62,15 @@ public class OutOrderDetailProductAdapter extends BaseQuickAdapter<OrderDetail.O
break;
case 600:
helper.setGone(R.id.ll_btn, true);
helper.setGone(R.id.tv_get, false);
helper.setGone(R.id.tv_return, false);
helper.setGone(R.id.tv_add, false);
break;
}
if (WorkUtils.hasPermission(PagePermissionType.PO_ENTER_PAGE.getPermission())) {
helper.setGone(R.id.tv_add, true);
} else {
helper.setGone(R.id.tv_add, false);
}
if (WorkUtils.hasPermission(PagePermissionType.PO_RETURN_APPLY_LIST.getPermission())) {
helper.setGone(R.id.tv_return, true);
} else {
if (!WorkUtils.hasPermission(PagePermissionType.PO_RETURN_APPLY_LIST.getPermission())) {
helper.setGone(R.id.tv_return, false);
}
if (!WorkUtils.hasPermission(PagePermissionType.PO_ENTER_PAGE.getPermission())) {
helper.setGone(R.id.tv_add, false);
}
}
}
......@@ -106,7 +106,7 @@
android:visibility="gone" />
<include
android:id="@+id/ll_process"
layout="@layout/view_return_process"
android:layout_marginVertical="10mm"
android:layout_height="wrap_content"
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout
android:id="@+id/ll_process"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论