提交 23d384e7 authored 作者: lgd's avatar lgd

1.订单审核

2.//TODO erp用户激活测试,忘记/重置密码测试,审核规则,领用申请列表/退件列表/参数,坩埚下单页面,组装下单,产品下单还差附件测试,mes,消息,刷新token
上级 45089f12
......@@ -1234,4 +1234,13 @@ public interface ApiService {
*/
@GET("/orderFlow/orderItem/allFlows/{orderItemId}")
Observable<BaseBean> orderItemFlow(@Path("orderItemId") String orderItemId);
/**
* step2-审核
*
* @return
*/
@PUT("/saleOrder/audit/{orderId}")
Observable<BaseBean> saleOrderCheck(@Path("orderId") String orderId,@Body RequestBody requestBody);
}
......@@ -17,6 +17,7 @@ import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.OrderDetail;
import com.wd.workoffice.bean.event.CheckOrderEvent;
import com.wd.workoffice.bean.event.CheckTicketEvent;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
......@@ -35,6 +36,7 @@ import org.greenrobot.eventbus.EventBus;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import androidx.appcompat.app.AlertDialog;
import androidx.recyclerview.widget.LinearLayoutManager;
......@@ -129,7 +131,7 @@ public class SaleOrderDetailActivity extends WorkToolBarActivity {
// "600"};
case 100:
llBottom.setVisibility(View.VISIBLE);
llApply.setVisibility(View.VISIBLE);
llCheck.setVisibility(View.VISIBLE);
break;
case 200:
break;
......@@ -279,8 +281,10 @@ public class SaleOrderDetailActivity extends WorkToolBarActivity {
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.tv_refuse:
checkDialog(2);
break;
case R.id.tv_agree:
checkDialog(1);
break;
case R.id.tv_finish_apply:
if (dataBean == null) {
......@@ -298,5 +302,80 @@ public class SaleOrderDetailActivity extends WorkToolBarActivity {
}
}
private void checkDialog(int status) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
View view = LayoutInflater.from(this).inflate(R.layout.view_check_order, null);
TextView tvOk = view.findViewById(R.id.tv_ok);
TextView tvPrice = view.findViewById(R.id.tv_price);
tvPrice.setText(String.valueOf(dataBean.getLaunchOrderAmount()));
TextView tvNum = view.findViewById(R.id.tv_num);
TextView tvCancel = view.findViewById(R.id.tv_cancel);
EditText etRemark = view.findViewById(R.id.et_content);
etRemark.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) {
tvNum.setText(s.length() + "/140");
}
});
builder.setView(view);
AlertDialog addCartDialog = builder.create();
tvOk.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (TextUtils.isEmpty(etRemark.getText().toString())) {
toast("请填写备注");
return;
}
check(status, etRemark.getText().toString());
addCartDialog.dismiss();
}
});
tvCancel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
addCartDialog.dismiss();
}
});
addCartDialog.show();
}
private void check(int status, String remark) {
Map<String, Object> dataParam = WorkUtils.simpleParam();
dataParam.put("result", status);
dataParam.put("comment", remark);
RtfUtils.getRtf().saleOrderCheck(dataBean.getId(),WorkUtils.convertMapToBody(dataParam)).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("操作成功");
llBottom.setVisibility(View.GONE);
EventBus.getDefault().post(new CheckOrderEvent());
}
});
}
}
......@@ -116,7 +116,7 @@ public class StoreSaleActivity extends WorkToolBarActivity implements BatSaleCon
startActivity(StoreSaleProductActivity.class,
"depId", chooseDep.getId() + "",
"process", chooseProcess.getName(),
"subProcess", chooseProcess.getId() + "",
"subProcessId", chooseProcess.getId() + "",
"clientName", tvClient.getText().toString(),
"depName", chooseDep.getName(),
"transitPartId", clientId.toString(),
......
......@@ -6,11 +6,15 @@ import com.chad.library.adapter.base.BaseQuickAdapter;
import com.wd.workoffice.R;
import com.wd.workoffice.app.WorkBaseFg;
import com.wd.workoffice.bean.OrderBean;
import com.wd.workoffice.bean.event.CheckOrderEvent;
import com.wd.workoffice.contract.SaleSaleContract;
import com.wd.workoffice.presenter.SaleSalePresenter;
import com.wd.workoffice.ui.adapter.ProSaleAdapter;
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;
......@@ -121,4 +125,22 @@ public class ProSaleFragment extends WorkBaseFg implements SaleSaleContract.View
public void supplierList(List<OrderBean> dataList) {
}
@Override
public void onStart() {
super.onStart();
EventBus.getDefault().register(this);
}
@Override
public void onStop() {
super.onStop();
EventBus.getDefault().unregister(this);
}
@Subscribe
public void refresh(CheckOrderEvent event) {
page = 1;
param.put("current", page);
saleSalePresenter.getOrder(param);
}
}
......@@ -4,19 +4,27 @@ import android.os.Bundle;
import android.view.View;
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.WorkBaseFg;
import com.wd.workoffice.bean.OrderBean;
import com.wd.workoffice.bean.event.CheckOrderEvent;
import com.wd.workoffice.contract.SaleSaleContract;
import com.wd.workoffice.presenter.SaleSalePresenter;
import com.wd.workoffice.ui.activity.bat.order.sale.SaleOrderDetailActivity;
import com.wd.workoffice.ui.adapter.SaleSaleAdapter;
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.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
......@@ -33,6 +41,8 @@ public class SaleSaleFragment extends WorkBaseFg implements SaleSaleContract.Vie
@BindView(R.id.rv_data)
RecyclerView rvData;
@BindView(R.id.srl_refresh)
SmartRefreshLayout srlRefresh;
private String state;
private SaleSalePresenter saleSalePresenter;
private Map<String, Object> param;
......@@ -68,6 +78,14 @@ public class SaleSaleFragment extends WorkBaseFg implements SaleSaleContract.Vie
@Override
protected void initEvent() {
srlRefresh.setOnRefreshListener(new OnRefreshListener() {
@Override
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
page = 1;
param.put("current", page);
saleSalePresenter.getOrder(param);
}
});
orderAdapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
@Override
public void onLoadMoreRequested() {
......@@ -78,7 +96,7 @@ public class SaleSaleFragment extends WorkBaseFg implements SaleSaleContract.Vie
orderAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
startActivity(SaleOrderDetailActivity.class, "id", orderList.get(position).getId()+"","status",orderList.get(position).getStatus()+"");
startActivity(SaleOrderDetailActivity.class, "id", orderList.get(position).getId() + "", "status", orderList.get(position).getStatus() + "");
}
});
}
......@@ -101,6 +119,7 @@ public class SaleSaleFragment extends WorkBaseFg implements SaleSaleContract.Vie
@Override
public void saleList(List<OrderBean> dataList) {
if (page == 1) {
srlRefresh.finishRefresh();
orderList.clear();
orderList.addAll(dataList);
orderAdapter.notifyDataSetChanged();
......@@ -131,4 +150,23 @@ public class SaleSaleFragment extends WorkBaseFg implements SaleSaleContract.Vie
public void supplierList(List<OrderBean> dataList) {
}
@Override
public void onStart() {
super.onStart();
EventBus.getDefault().register(this);
}
@Override
public void onStop() {
super.onStop();
EventBus.getDefault().unregister(this);
}
@Subscribe
public void refresh(CheckOrderEvent event) {
page = 1;
param.put("current", page);
saleSalePresenter.getOrder(param);
}
}
<?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:id="@+id/tv_price"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20mm"
android:gravity="center"
android:text="0"
android:textSize="17sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_desc"
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:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="20mm"
android:layout_marginTop="10mm"
android:background="@drawable/shape_confirm_order"
android:orientation="vertical">
<EditText
android:id="@+id/et_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="3mm"
android:background="@null"
android:gravity="top"
android:hint="请输入原因"
android:minLines="4"
android:padding="5mm"
android:textSize="16sp" />
<TextView
android:id="@+id/tv_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_margin="4mm"
android:text="0/140"
android:textColor="@color/flexible_text_gray" />
</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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论