提交 473ac3a7 authored 作者: lgd's avatar lgd

1.订单追踪

2.//TODO erp用户是否选择新部门为空,质检接口数据无对应问题,内部交易订单审核,审核规则,领用申请列表/退件列表/参数,坩埚下单,mes,刷新token
上级 a72f1248
......@@ -1186,7 +1186,7 @@
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.activity.mes.MesTicketActivity"
android:name=".ui.activity.mes.ticket.MesTicketActivity"
android:configChanges="keyboardHidden|orientation"
android:label="工单管理"
android:launchMode="singleTop"
......@@ -1265,6 +1265,22 @@
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.activity.mes.order.MesOrderActivity"
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.mes.order.MesOrderDetailActivity"
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"
......
package com.wd.workoffice.ui.activity.mes.order;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.Menu;
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.bean.workEnum.OrderType;
import com.wd.workoffice.bean.workEnum.PagePermissionType;
import com.wd.workoffice.ui.activity.bat.order.SendApplyAddActivity;
import com.wd.workoffice.ui.adapter.VpDataAdapter;
import com.wd.workoffice.ui.fg.MesOrderFragment;
import com.wd.workoffice.ui.fg.SendApplyFragment;
import com.wd.workoffice.util.WorkUtils;
import java.util.ArrayList;
import java.util.List;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.viewpager.widget.ViewPager;
import butterknife.BindView;
import butterknife.ButterKnife;
/**
* 订单追踪
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class MesOrderActivity extends WorkToolBarActivity {
@BindView(R.id.tl_tab)
TabLayout tlTab;
@BindView(R.id.vp_data)
ViewPager vpData;
private String tab[] = {
"全部", "已排程", "未排程"};
private String order[] = {
"0", "1", "2"};
@Override
protected void initView() {
ButterKnife.bind(this);
tlTab.setupWithViewPager(vpData);
tlTab.setTabMode(TabLayout.MODE_FIXED);
}
@Override
protected void initData() {
FragmentManager sfm = getSupportFragmentManager();
List<Fragment> data = new ArrayList<>();
for (int i = 0; i < tab.length; i++) {
MesOrderFragment saleFragment = new MesOrderFragment();
Bundle bundle = new Bundle();
bundle.putString("state", order[i]);
bundle.putString("orderId", getIntent().getStringExtra("orderId"));
bundle.putString("orderType", getIntent().getStringExtra("orderType"));
saleFragment.setArguments(bundle);
data.add(saleFragment);
}
VpDataAdapter vpFgAdapter = new VpDataAdapter(sfm, data);
vpData.setAdapter(vpFgAdapter);
for (int i = 0; i < tab.length; i++) {
tlTab.getTabAt(i).setText(tab[i]);
}
}
@Override
protected void initEvent() {
}
@Override
protected int layoutId() {
return R.layout.activity_order;
}
}
package com.wd.workoffice.ui.activity.mes.order;
import com.wd.workoffice.R;
import com.wd.workoffice.app.WorkToolBarActivity;
import butterknife.ButterKnife;
/**
* 订单追踪 详情
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class MesOrderDetailActivity extends WorkToolBarActivity {
@Override
protected void initView() {
ButterKnife.bind(this);
}
@Override
protected void initData() {
}
@Override
protected void initEvent() {
}
@Override
protected int layoutId() {
return R.layout.activity_mes_order_detail;
}
}
package com.wd.workoffice.ui.activity.mes;
package com.wd.workoffice.ui.activity.mes.ticket;
import android.view.View;
import android.widget.LinearLayout;
......
package com.wd.workoffice.ui.adapter;
import android.graphics.Color;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.wd.workoffice.R;
import com.wd.workoffice.bean.SendApplyBean;
import java.util.List;
import androidx.annotation.Nullable;
/**
* Created by flexible on 2018/8/13.
*/
public class MesOrderAdapter extends BaseQuickAdapter<Object, BaseViewHolder> {
public MesOrderAdapter(int layoutResId, List data) {
super(layoutResId, data);
}
@Override
protected void convert(BaseViewHolder helper, Object item) {
if (helper.getAdapterPosition() % 2 == 0) {
helper.setTextColor(R.id.tv_status, Color.parseColor("#FF34AA68"));
helper.setText(R.id.tv_status,"已排程");
} else {
helper.setTextColor(R.id.tv_status, Color.parseColor("#FFD16A6A"));
helper.setText(R.id.tv_status,"未排程");
}
// helper.setText(R.id.tv_name, item.getSerialNumber());
// helper.setText(R.id.tv_reason, item.getApplyRemark());
// helper.setText(R.id.tv_time, item.getCreatedTime());
// if (status == 0) {
// helper.setVisible(R.id.ll_btn, true);
// helper.addOnClickListener(R.id.tv_agree);
// helper.addOnClickListener(R.id.tv_refuse);
// }
// }
}
}
package com.wd.workoffice.ui.fg;
import android.view.View;
import android.widget.TextView;
import com.alibaba.fastjson.JSON;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.app.WorkBaseFg;
import com.wd.workoffice.bean.MsgBean;
import com.wd.workoffice.bean.vo.BatLayoutVo;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.activity.NoticeActivity;
import com.wd.workoffice.ui.activity.bat.approval.ApprovalFromMeActivity;
import com.wd.workoffice.ui.activity.bat.approval.ApprovalToMeActivity;
import com.wd.workoffice.ui.activity.bat.order.product.ProductInsideOrderActivity;
import com.wd.workoffice.ui.activity.bat.order.product.ProductOutOrderActivity;
import com.wd.workoffice.ui.activity.bat.order.product.ProductSaleOrderActivity;
import com.wd.workoffice.ui.activity.bat.order.product.ProductSupplierOrderActivity;
import com.wd.workoffice.ui.activity.bat.order.sale.SaleCrucibleOrderActivity;
import com.wd.workoffice.ui.activity.bat.order.sale.SaleInsideOrderActivity;
import com.wd.workoffice.ui.activity.bat.order.sale.SaleOutOrderActivity;
import com.wd.workoffice.ui.activity.bat.order.sale.SaleProductOrderActivity;
import com.wd.workoffice.ui.activity.bat.order.sale.SaleSaleOrderActivity;
import com.wd.workoffice.ui.activity.bat.order.sale.SaleSupplierOrderActivity;
import com.wd.workoffice.ui.activity.bat.store.StoreCrucibleActivity;
import com.wd.workoffice.ui.activity.bat.store.StoreFinancialActivity;
import com.wd.workoffice.ui.activity.bat.store.StoreOutsourcingActivity;
import com.wd.workoffice.ui.activity.bat.store.StoreSaleActivity;
import com.wd.workoffice.ui.activity.bat.store.StoreSupplierActivity;
import com.wd.workoffice.ui.activity.bat.store.StoreTradingActivity;
import com.wd.workoffice.ui.activity.bat.work.WorkAccountActivity;
import com.wd.workoffice.ui.activity.bat.work.WorkContactsActivity;
import com.wd.workoffice.ui.activity.bat.work.WorkDepActivity;
import com.wd.workoffice.ui.activity.bat.work.WorkFinancialActivity;
import com.wd.workoffice.ui.activity.bat.work.WorkInStockActivity;
import com.wd.workoffice.ui.activity.bat.work.WorkProActivity;
import com.wd.workoffice.ui.activity.bat.work.WorkWarehouseActivity;
import com.wd.workoffice.ui.activity.mes.MesTicketActivity;
import com.wd.workoffice.ui.activity.mes.order.MesOrderActivity;
import com.wd.workoffice.ui.activity.mes.ticket.MesTicketActivity;
import com.wd.workoffice.ui.adapter.BatLayoutAdapter;
import com.wd.workoffice.util.UserKeeper;
import com.wd.workoffice.util.WorkUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import androidx.recyclerview.widget.GridLayoutManager;
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;
/**
......@@ -128,6 +91,7 @@ public class MesFragment extends WorkBaseFg {
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
switch (position) {
case 0:
startActivity(MesOrderActivity.class);
break;
case 1:
break;
......
package com.wd.workoffice.ui.fg;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import com.alibaba.fastjson.JSON;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.app.WorkBaseFg;
import com.wd.workoffice.bean.SendApplyBean;
import com.wd.workoffice.bean.event.CheckSendEvent;
import com.wd.workoffice.bean.workEnum.OrderType;
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.SendApplyDetailActivity;
import com.wd.workoffice.ui.activity.mes.order.MesOrderDetailActivity;
import com.wd.workoffice.ui.adapter.MesOrderAdapter;
import com.wd.workoffice.ui.adapter.SendApplyAdapter;
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.Nullable;
import androidx.appcompat.app.AlertDialog;
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.Observable;
import io.reactivex.disposables.Disposable;
/**
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class MesOrderFragment extends WorkBaseFg {
@BindView(R.id.rv_data)
RecyclerView rvData;
@BindView(R.id.srl_refresh)
SmartRefreshLayout srlRefresh;
private String state;
private int page = 1;
private Map<String, Object> param;
private MesOrderAdapter dataAdapter;
private List<Object> dataList;
private String orderId;
private String orderType;
@Override
protected void initView() {
ButterKnife.bind(this, getContentView());
rvData.setLayoutManager(new LinearLayoutManager(getActivity(), RecyclerView.VERTICAL, false));
}
@Override
protected void initData() {
param = WorkUtils.pageKey();
param.put("status", state);
param.put("orderId", orderId);
page = 1;
param.put("current", page);
dataList = new ArrayList<>();
dataAdapter = new MesOrderAdapter(R.layout.item_mes_order, dataList);
dataAdapter.bindToRecyclerView(rvData);
dataAdapter.setEmptyView(R.layout.view_empty_content, rvData);
dataList.add(null);
dataList.add(null);
dataList.add(null);
dataAdapter.notifyDataSetChanged();
// getData();
}
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Bundle arguments = getArguments();
if (arguments != null) {
state = arguments.getString("state");
orderId = arguments.getString("orderId");
orderType = arguments.getString("orderType");
}
}
private void getData() {
Observable<BaseBean> observable;
if (TextUtils.equals(orderType, OrderType.SALE.getCode())) {
observable = RtfUtils.getRtf().sendApplyList(param);
} else if (TextUtils.equals(orderType, OrderType.OUT_BUY.getCode())) {
observable = RtfUtils.getRtf().sendPoApplyList(param);
} else if (TextUtils.equals(orderType, OrderType.CRUCIBLE.getCode())) {
observable = RtfUtils.getRtf().sendCoApplyList(param);
} else {
observable = RtfUtils.getRtf().sendApplyList(param);
}
observable.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<SendApplyBean.RecordsBean> getList = JSON.parseObject(data.getData().toString(), SendApplyBean.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(refreshLayout -> {
page = 1;
param.put("current", page);
getData();
});
dataAdapter.setOnLoadMoreListener(() -> {
param.put("current", page);
getData();
}, rvData);
dataAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
startActivity(MesOrderDetailActivity.class);
}
});
}
private void checkDialog(int status, int id) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
View view = LayoutInflater.from(getActivity()).inflate(R.layout.view_check, null);
TextView tvOk = view.findViewById(R.id.tv_ok);
TextView tvDesc = view.findViewById(R.id.tv_desc);
tvDesc.setText(status == 1 ? "通过" : "拒绝");
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(), id);
addCartDialog.dismiss();
}
});
tvCancel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
addCartDialog.dismiss();
}
});
addCartDialog.show();
}
private void check(int status, String remark, int id) {
Map<String, Object> param = WorkUtils.simpleParam();
param.put("status", status);
param.put("auditRemark", remark);
param.put("id", id);
Observable<BaseBean> observable;
if (TextUtils.equals(orderType, OrderType.SALE.getCode())) {
observable = RtfUtils.getRtf().sendApplyCheck(WorkUtils.convertMapToBody(param));
} else if (TextUtils.equals(orderType, OrderType.OUT_BUY.getCode())) {
observable = RtfUtils.getRtf().sendPoApplyCheck(WorkUtils.convertMapToBody(param));
} else if (TextUtils.equals(orderType, OrderType.CRUCIBLE.getCode())) {
observable = RtfUtils.getRtf().sendCoApplyCheck(WorkUtils.convertMapToBody(param));
} else {
observable = RtfUtils.getRtf().sendApplyCheck(WorkUtils.convertMapToBody(param));
}
observable.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 CheckSendEvent());
}
});
}
@Override
protected int layoutId() {
return R.layout.fg_work_contacts;
}
@Override
public void onStart() {
super.onStart();
EventBus.getDefault().register(this);
}
@Override
public void onStop() {
super.onStop();
EventBus.getDefault().unregister(this);
}
@Subscribe
public void refresh(CheckSendEvent event) {
page = 1;
param.put("current", page);
getData();
}
}
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.google.android.material.tabs.TabLayout
android:id="@+id/tl_tab"
android:layout_width="match_parent"
android:layout_height="48mm"
android:background="@android:color/white"
app:tabBackground="@android:color/white"
app:tabGravity="fill"
app:tabIndicatorColor="@color/blue_btn"
app:tabIndicatorFullWidth="false"
app:tabMode="scrollable"
app:tabSelectedTextColor="@color/blue_btn"
app:tabTextAppearance="@style/tabText"
app:tabTextColor="@color/flexible_text_sup" />
<androidx.viewpager.widget.ViewPager
android:id="@+id/vp_data"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView 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_marginHorizontal="15mm"
android:layout_marginTop="15mm"
android:background="@color/white"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingHorizontal="15mm"
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:text="订单编号:DD10001"
android:textSize="16sp" />
<TextView
android:id="@+id/tv_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:text="已排程"
android:textColor="#ff34aa68"
android:textSize="14sp" />
</RelativeLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12mm"
android:maxLines="1"
android:text="--------------------------------------------------------------------------------------------------------------------------------" />
<LinearLayout
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:text="订单日期:"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_reason"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
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:text="计划数量"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
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:text="产品名称"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
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:text="工厂名称"
android:textColor="@color/flexible_text_gray"
android:textSize="14sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论