提交 08b617ff authored 作者: lgd's avatar lgd

1.工单详情页面

2.//TODO erp用户是否选择新部门为空,质检接口数据无对应问题,内部交易订单审核,审核规则,领用申请列表/退件列表/参数,坩埚下单,mes,刷新token
上级 bee3291e
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.wd.workoffice">
<uses-permission android:name="com.qdredsoft.ylh.permission.JPUSH_MESSAGE" />
<uses-permission android:name="android.permission.RECEIVE_USER_PRESENT" />
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
......@@ -25,6 +26,7 @@
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<application
android:name=".app.WorkApp"
android:allowBackup="true"
......@@ -1207,6 +1209,39 @@
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.activity.mes.ticket.MesTicketDetailFinishActivity"
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.ticket.MesTicketDetailReviewActivity"
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.ticket.MesTicketAddSummaryActivity"
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.ticket.MesTicketAddLogActivity"
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"
android:authorities="com.wd.workoffice.fileprovider"
......
package com.wd.workoffice.ui.activity.mes.ticket;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
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.wd.workoffice.R;
import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.AccountBean;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.adapter.ImgAdapter;
import com.wd.workoffice.ui.adapter.StarAdapter;
import com.wd.workoffice.util.DialogUtils;
import com.wd.workoffice.util.WorkUtils;
import java.util.ArrayList;
import java.util.List;
import androidx.appcompat.app.AlertDialog;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
......@@ -26,48 +44,62 @@ import io.reactivex.disposables.Disposable;
public class MesTicketDetailFinishActivity extends WorkToolBarActivity {
@BindView(R.id.tv_code)
TextView tvCode;
@BindView(R.id.tv_client)
TextView tvClient;
@BindView(R.id.rl_client)
RelativeLayout rlClient;
@BindView(R.id.tv_company)
TextView tvCompany;
@BindView(R.id.rl_company)
RelativeLayout rlCompany;
@BindView(R.id.tv_manager)
TextView tvManager;
@BindView(R.id.rl_manager)
RelativeLayout rlManager;
@BindView(R.id.tv_desc)
TextView tvDesc;
@BindView(R.id.tv_take_on)
TextView tvTakeOn;
@BindView(R.id.rl_take_on)
RelativeLayout rlTakeOn;
@BindView(R.id.tv_person)
TextView tvPerson;
@BindView(R.id.tv_start_time)
TextView tvStartTime;
@BindView(R.id.tv_end_time)
TextView tvEndTime;
@BindView(R.id.tv_time)
TextView tvTime;
@BindView(R.id.rl_time)
RelativeLayout rlTime;
@BindView(R.id.rl_log)
RelativeLayout rlLog;
@BindView(R.id.btn_reviews)
Button btnReviews;
@BindView(R.id.ll_bottom)
LinearLayout llBottom;
@BindView(R.id.rv_img)
RecyclerView rvImg;
private AccountBean dataBean;
private List<Object> imgList;
private ImgAdapter imgAdapter;
@Override
protected void initView() {
ButterKnife.bind(this);
rvImg.setLayoutManager(new LinearLayoutManager(this, RecyclerView.HORIZONTAL, false));
}
@Override
protected void initData() {
imgList = new ArrayList<>();
imgAdapter = new ImgAdapter(R.layout.item_mes_ticket_img, imgList);
imgAdapter.bindToRecyclerView(rvImg);
imgList.add(null);
imgList.add(null);
imgList.add(null);
imgAdapter.notifyDataSetChanged();
getData();
}
/**
* 评价
*
* @param id
*/
private void openStar(int id) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
View view = LayoutInflater.from(this).inflate(R.layout.view_reviews, null);
RecyclerView rvStar = view.findViewById(R.id.rv_reviews);
TextView tvScore = view.findViewById(R.id.tv_score);
StarAdapter starAdapter = WorkUtils.starView(rvStar, this);
starAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
starAdapter.setScore(position + 1);
tvScore.setText(String.format("%s分", position + 1));
}
});
builder.setView(view);
AlertDialog addCartDialog = builder.create();
addCartDialog.show();
}
private void getData() {
RtfUtils.getRtf().getAccount().compose(Transformer.schedule()).subscribe(new WorkObserver<BaseBean>() {
......@@ -108,7 +140,8 @@ public class MesTicketDetailFinishActivity extends WorkToolBarActivity {
}
@OnClick(R.id.rl_log)
@OnClick(R.id.btn_reviews)
public void onViewClicked() {
openStar(0);
}
}
......@@ -18,7 +18,7 @@ import flexible.xd.android_base.network.rtfhttp.Transformer;
import io.reactivex.disposables.Disposable;
/**
* 工单详情
* 工单详情 已评价
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
......
......@@ -168,6 +168,7 @@ public class MesTicketListActivity extends WorkToolBarActivity {
dataAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
startActivity(MesTicketDetailFinishActivity.class);
}
});
}
......@@ -177,6 +178,7 @@ public class MesTicketListActivity extends WorkToolBarActivity {
protected int layoutId() {
return R.layout.activity_mes_ticket_list;
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_ticket_add, menu);
......
package com.wd.workoffice.ui.adapter;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import java.util.List;
/**
* Created by flexible on 2018/8/13.
*/
public class ImgAdapter extends BaseQuickAdapter<Object, BaseViewHolder> {
public ImgAdapter(int layoutResId, List data) {
super(layoutResId, data);
}
@Override
protected void convert(BaseViewHolder helper, Object item) {
}
}
......@@ -6,6 +6,7 @@ import com.chad.library.adapter.base.BaseViewHolder;
import com.wd.workoffice.R;
import com.wd.workoffice.bean.ProductBean;
import java.util.ArrayList;
import java.util.List;
/**
......@@ -19,18 +20,22 @@ public class StarAdapter extends BaseQuickAdapter<Object, BaseViewHolder> {
super(layoutResId, data);
}
@Override
public int getItemCount() {
return 5;
}
@Override
protected void convert(BaseViewHolder helper, Object item) {
if (helper.getAdapterPosition()>=score){
helper.setImageResource(R.id.iv_img,R.mipmap.ticket_star_gray);
}else {
helper.setImageResource(R.id.iv_img,R.mipmap.ticket_star_yellow);
if (helper.getAdapterPosition() >= score) {
helper.setImageResource(R.id.iv_img, R.mipmap.ticket_star_gray);
} else {
helper.setImageResource(R.id.iv_img, R.mipmap.ticket_star_yellow);
}
}
public int getScore() {
return score;
}
public void setScore(int score) {
this.score = score;
notifyDataSetChanged();
}
}
......@@ -21,7 +21,4 @@ public class DialogUtils {
return dialog;
}
}
......@@ -24,6 +24,7 @@ import com.wd.workoffice.ui.adapter.StarAdapter;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -329,7 +330,8 @@ public class WorkUtils {
*/
public static StarAdapter starView(RecyclerView rvData, Context context) {
rvData.setLayoutManager(new LinearLayoutManager(context, RecyclerView.HORIZONTAL, false));
StarAdapter starAdapter = new StarAdapter(R.layout.item_star, null);
List<String> dataList = Arrays.asList("", "", "", "", "");
StarAdapter starAdapter = new StarAdapter(R.layout.item_star, dataList);
starAdapter.bindToRecyclerView(rvData);
return starAdapter;
}
......
......@@ -4,11 +4,32 @@
android:layout_height="match_parent"
android:background="@color/white">
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout
android:id="@+id/ll_bottom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@color/white"
android:gravity="center"
android:paddingVertical="10mm">
<Button
android:id="@+id/btn_reviews"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape_blue_circle"
android:paddingHorizontal="40mm"
android:text="评价"
android:textColor="@color/white" />
</LinearLayout>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/ll_bottom"
android:paddingHorizontal="10mm"
android:paddingVertical="8mm">
android:paddingTop="8mm"
android:paddingBottom="40mm">
<LinearLayout
android:layout_width="match_parent"
......@@ -134,7 +155,6 @@
android:layout_marginBottom="10mm"
android:background="@drawable/shape_input_white"
android:gravity="top"
android:hint="请输入"
android:minLines="3"
android:padding="5mm"
android:textSize="14sp" />
......@@ -153,7 +173,6 @@
android:layout_marginBottom="10mm"
android:background="@drawable/shape_input_white"
android:gravity="top"
android:hint="请输入"
android:minLines="3"
android:padding="5mm"
android:textSize="14sp" />
......@@ -172,12 +191,12 @@
android:layout_marginBottom="10mm"
android:background="@drawable/shape_input_white"
android:gravity="top"
android:hint="请输入"
android:minLines="3"
android:padding="5mm"
android:textSize="14sp" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_img"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="10mm" />
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="6mm"
android:background="@color/white"
android:orientation="vertical"
>
android:orientation="vertical">
<ImageView
android:id="@+id/iv_img"
android:layout_width="104mm"
android:layout_height="104mm"
/>
android:src="@mipmap/ic_launcher" />
</LinearLayout>
\ No newline at end of file
<?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="wrap_content"
android:gravity="center"
android:orientation="horizontal">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_reviews"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/tv_score"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="10mm"
android:text="0分"
android:textSize="19sp" />
</LinearLayout>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论