Commit 777ceed3 by xuxuan

提交验收

parent 527970eb
......@@ -18,6 +18,17 @@ public class LearnTabBean {
private int totalProviderCourses;
private String gptUrl;
public int getEnterKnowledge() {
return enterKnowledge;
}
public void setEnterKnowledge(int enterKnowledge) {
this.enterKnowledge = enterKnowledge;
}
private int enterKnowledge;
public String getGptUrl() {
return gptUrl;
}
......
......@@ -100,9 +100,14 @@ public class HomeLearnFragment extends BaseFragment<SImplePresenter, FragmentHom
Api.getService(LearnService.class).getLearTabNum(mUserId).compose(Api.applySchedulers())
.subscribe(mPresenter.baseObserver(data -> {
tabBean = data;
String url = data.getPaperListUrl() + "?accountId=" + mUserInfo.getAccountId() + "&token=" + mUserInfo.getToken();
webFragment.setUrl(url);
if (data.getEnterKnowledge() == 1){
list_fragments.remove(webFragment);
commeWebViewFragment = CommeWebViewFragment.newInstance();
list_fragments.add(commeWebViewFragment);
}else {
String url = data.getPaperListUrl() + "?accountId=" + mUserInfo.getAccountId() + "&token=" + mUserInfo.getToken();
webFragment.setUrl(url);
}
commeWebViewFragment.setUrl(data.getGptUrl() + "?accountId=" + mUserInfo.getAccountId() + "&token=" + mUserInfo.getToken());
setTabNum();
}));
......@@ -119,11 +124,11 @@ public class HomeLearnFragment extends BaseFragment<SImplePresenter, FragmentHom
list_fragments.add(webFragment);
//智能助手
commeWebViewFragment = CommeWebViewFragment.newInstance();
list_fragments.add(commeWebViewFragment);
// commeWebViewFragment = CommeWebViewFragment.newInstance();
// list_fragments.add(commeWebViewFragment);
//HTO 知识库
// list_fragments.add(KnowledgeCenterFragment.newInstance());
list_fragments.add(KnowledgeCenterFragment.newInstance());
// list_fragments.add(new TCVideoListFragment());
adapter = new FragmentAdapter(getFragmentManager(), list_fragments);
......
......@@ -30,6 +30,7 @@ import com.dayu.order.api.protocol.data.AddDialRecordData;
import com.dayu.order.common.OrderConstant;
import com.dayu.order.ui.activity.CheckInTakePhotoActivity;
import com.dayu.order.ui.activity.MultiProcessOrderActivity;
import com.dayu.order.ui.activity.MultipleProcessActivity;
import com.dayu.order.ui.activity.OrderDetailsActivity;
import com.dayu.order.ui.activity.OrderDetailsClockActivity;
import com.dayu.order.ui.activity.SopWebViewActivity;
......@@ -51,6 +52,7 @@ import org.json.JSONObject;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
......@@ -357,6 +359,16 @@ public class OrderDoingPresenter extends orderDoingContract.Presenter {
}
//跳转提交订单页面
public void dumpToProcess(ArrayList<Spu> spus, int position){
Bundle bundle = new Bundle();
bundle.putParcelableArrayList(OrderConstant.SPUS, spus);
bundle.putBoolean("isDaysOrder",true);
mView.startActivity(MultipleProcessActivity.class, bundle);
}
public void refreshClear() {
getOrders(mState, mUserId, mSiteId, mPage, Constants.PAGESIZE);
}
......
......@@ -102,6 +102,10 @@ public class MultipleProcessActivity extends BaseActivity<MultipleProcessPresent
public void initView() {
path = mActivity.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS) + "/dayu/image/signature.png";
mBind.tvTitle.setText(getString(R.string.submit_order));
if (getBundle().getBoolean("isDaysOrder")){
//按天用工单,修改UI展示
mBind.recyclerView.setViewType(R.layout.item_multi_process_order_day);
}
mBind.recyclerView.mCoreAdapter.addFooterViewType(R.layout.item_multi_process_foot, null);
View view = LayoutInflater.from(mActivity).inflate(R.layout.item_multi_process_foot, null);
mBind.recyclerView.mCoreAdapter.addFootViwe(view, R.layout.item_multi_process_foot);
......
......@@ -112,6 +112,11 @@ public class OrderDetailsClockActivity extends BaseActivity<OrderDetailClockPres
mBind.tvProName.setText(detail.getCreated());
mBind.tvProNum.setText(detail.getCustomerTelphome());
if (detail.getShowPrice().endsWith("2")){
mBind.tvPrice.setVisibility(View.GONE);
mBind.tvEight.setVisibility(View.GONE);
}
boolean isShowBtn = mPresenter.getIsShowBtn();
if (isShowBtn){
mBind.tvButton.setVisibility(View.VISIBLE);
......@@ -129,7 +134,9 @@ public class OrderDetailsClockActivity extends BaseActivity<OrderDetailClockPres
Spu s = detail.getSpus().get(0);
mBind.tvButton.setText((((s.getFinNum() + 1) % 2) == 0) ? "下班打卡" : "上班打卡");
} else {
mBind.tvButton.setText(getString(R.string.submit_order));
// mBind.tvButton.setText(getString(R.string.submit_order));
//提交验收按钮隐藏
mBind.tvButton.setVisibility(View.GONE);
}
} else if (1 == detail.getStatus()) {
mBind.tvButton.setText(getString(R.string.receive_now));
......
......@@ -677,15 +677,25 @@ public class OrderAdapter extends CoreAdapter<Order, FragmentOrderdoingItemBindi
// }));
mPresenter.takePhoto(it.getId(), position);
}else{
mPresenter.commit(it)
.observeOn(AndroidSchedulers.mainThread())
.subscribe(mPresenter.baseObserver(integer -> {
ToastUtils.showShortToast("提交验收成功");
mPresenter.setPosition(position);
EventBus.getDefault().post(new RefreshServe(1));
}, responeThrowable -> {
}));
// mPresenter.commit(it)
// .observeOn(AndroidSchedulers.mainThread())
// .subscribe(mPresenter.baseObserver(integer -> {
// ToastUtils.showShortToast("提交验收成功");
// mPresenter.setPosition(position);
// EventBus.getDefault().post(new RefreshServe(1));
// }, responeThrowable -> {
//
// }));
//跳转提交验收页面
ArrayList<Spu> arrayList = new ArrayList();
for (int i = 0; i < it.getSpus().size(); i++) {
Spu spu = it.getSpus().get(i);
spu.setProviderTypeName(spu.getKaSpuName());
spu.setKaSpuName(it.getReferenceTime() + "天");
arrayList.add(spu);
}
mPresenter.dumpToProcess(arrayList, position);
}
}
}else{
......
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
name="item"
type="com.dayu.order.api.protocol.Spu" />
</data>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="82dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
android:background="@color/white"
android:paddingLeft="@dimen/dp_15">
<TextView
android:id="@+id/tv_repair_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginTop="@dimen/dp_20"
android:text='@{item.providerTypeName}'
android:textColor="@color/default_text_color"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_repair_type"
android:layout_marginTop="6dp"
android:text="@{item.kaSpuName}"
android:textColor="@color/default_editext_color" />
<TextView
android:id="@+id/tv_state"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="15sp"
android:text='@{@string/order_finish}'
android:textColor="@color/bg_button"
android:textSize="@dimen/sp_14" />
<!--android:text='@{item.status==1?@string/process:@string/order_finish}'-->
</RelativeLayout>
</layout>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment