|
|
@@ -76,7 +76,7 @@ public class DailyDetailsApprovalFlowAdapter extends BaseAdapter {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public View getView(int position, View convertView, ViewGroup parent) {
|
|
|
+ public View getView(final int position, View convertView, ViewGroup parent) {
|
|
|
ViewHolder viewHolder = null;
|
|
|
if (convertView == null) {
|
|
|
convertView = View.inflate(mContext, R.layout.item_daily_details_approval_flow, null);
|
|
|
@@ -96,13 +96,13 @@ public class DailyDetailsApprovalFlowAdapter extends BaseAdapter {
|
|
|
//ToDo 日报详情审批流过程显示,逻辑比较繁琐
|
|
|
|
|
|
//获取 已审批节点数量 和总审批节点数
|
|
|
- int currposition = position;
|
|
|
- position = getCount() - position-1;
|
|
|
- int nodesnum = mCommonApprovalFlowBean.getNodes().size();
|
|
|
+ /*int currposition = position;
|
|
|
+ position = getCount() - position - 1;*/
|
|
|
+ final int nodesnum = mCommonApprovalFlowBean.getNodes().size();
|
|
|
int datanum = mCommonApprovalFlowBean.getData().size();
|
|
|
int processnum = mCommonApprovalFlowBean.getProcesss().size();
|
|
|
- viewHolder.AppFlowName.setText(mCommonApprovalFlowBean.getData().get(position).getJP_NODEDEALMANNAME());
|
|
|
- if (im_ids != null && im_ids.get(position).equals("")) {
|
|
|
+ viewHolder.AppFlowName.setText(mCommonApprovalFlowBean.getData().get(getCount() - position - 1).getJP_NODEDEALMANNAME());
|
|
|
+ if (im_ids != null && im_ids.get(getCount() - position - 1).equals("")) {
|
|
|
|
|
|
Resources r = mContext.getResources();
|
|
|
String url = Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://"
|
|
|
@@ -114,19 +114,76 @@ public class DailyDetailsApprovalFlowAdapter extends BaseAdapter {
|
|
|
|
|
|
} else {
|
|
|
// ImageLoader.getInstance().displayImage(url, viewHolder.AppFlowPhoto, MyApplication.mAvatarRoundImageOptions);
|
|
|
- AvatarHelper.getInstance().display(im_ids.get(position),viewHolder.AppFlowPhoto,true,false);//显示圆角图片
|
|
|
+ AvatarHelper.getInstance().display(im_ids.get(getCount() - position - 1),viewHolder.AppFlowPhoto,true,false);//显示圆角图片
|
|
|
|
|
|
}
|
|
|
|
|
|
if (nodesnum == 0) {
|
|
|
- if (position == 0) {
|
|
|
+ if (mCommonApprovalFlowBean.getCurrentnode().getNodename()
|
|
|
+ .equals(mCommonApprovalFlowBean.getData().get(getCount() - position - 1).getJP_NODENAME())) {
|
|
|
viewHolder.AppFlowStatus.setTextColor(mContext.getResources().getColor(R.color.no_approval));
|
|
|
viewHolder.AppFlowStatus.setText("待审批");
|
|
|
viewHolder.AppFlowNode.setImageResource(R.drawable.node_wait3);
|
|
|
} else {
|
|
|
+ viewHolder.AppFlowStatus.setText("");
|
|
|
viewHolder.AppFlowNode.setImageResource(R.drawable.node_none3);
|
|
|
}
|
|
|
- } else if ((nodesnum > 0 && position < nodesnum) || (nodesnum == 1 && datanum == 1)) {
|
|
|
+ } else {
|
|
|
+ if (position > (datanum - nodesnum - 1)) {
|
|
|
+ if (mCommonApprovalFlowBean.getNodes().get(position - (datanum - nodesnum)).getJn_dealResult().equals("同意")) {
|
|
|
+ viewHolder.AppFlowStatus.setTextColor(mContext.getResources().getColor(R.color.done_approval));
|
|
|
+ viewHolder.AppFlowStatus.setText("已审批");
|
|
|
+ viewHolder.AppFlowNode.setImageResource(R.drawable.node_finished3);
|
|
|
+ viewHolder.AppFlowTime.setText(mCommonApprovalFlowBean.getNodes().get(position - (datanum - nodesnum)).getJn_dealTime());
|
|
|
+
|
|
|
+ final int i = position - (datanum - nodesnum);
|
|
|
+ //当有审批时判断有没有审批语
|
|
|
+ if (mCommonApprovalFlowBean.getNodes().get(position - (datanum - nodesnum)).getJn_dealResult() != null &&
|
|
|
+ mCommonApprovalFlowBean.getNodes().get(position - (datanum - nodesnum)).getJn_nodeDescription() != null) {
|
|
|
+ viewHolder.AppFlowDescriptionll.setVisibility(View.VISIBLE);
|
|
|
+ viewHolder.AppFlowDescriptiontv.setTextColor(mContext.getResources().getColor(R.color.done_approval));
|
|
|
+ viewHolder.AppFlowDescriptiontv.setText("( " + mCommonApprovalFlowBean.getNodes().get(position - (datanum - nodesnum)).getJn_nodeDescription().toString() + " )");
|
|
|
+ viewHolder.AppFlowDescriptionll.setOnClickListener(new View.OnClickListener() {
|
|
|
+ //点击查看详细批语
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ new AlertDialog
|
|
|
+ .Builder(mContext)
|
|
|
+ .setTitle("审批语详情")
|
|
|
+ .setMessage("\t" + mCommonApprovalFlowBean.getNodes().get(i).getJn_nodeDescription().toString())
|
|
|
+ .setPositiveButton("确定", null)
|
|
|
+ .show();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } else if (mCommonApprovalFlowBean.getNodes().get(position - (datanum - nodesnum)).getJn_dealResult().equals("不同意")) {
|
|
|
+ viewHolder.AppFlowStatus.setTextColor(mContext.getResources().getColor(R.color.no_approval));
|
|
|
+ viewHolder.AppFlowStatus.setText("不同意");
|
|
|
+ viewHolder.AppFlowNode.setImageResource(R.drawable.node_wait3);
|
|
|
+ viewHolder.AppFlowTime.setText(mCommonApprovalFlowBean.getNodes().get(position - (datanum - nodesnum)).getJn_dealTime());
|
|
|
+ }
|
|
|
+ /*if (mCommonApprovalFlowBean.getNodes().get(nodesnum - 1).getJn_dealResult().equals("同意")){
|
|
|
+
|
|
|
+ }*/
|
|
|
+ }else {
|
|
|
+ if (position == (datanum - nodesnum - 1)){
|
|
|
+ if (mCommonApprovalFlowBean.getNodes().get(position).getJn_dealResult().equals("同意")){
|
|
|
+ viewHolder.AppFlowNode.setImageResource(R.drawable.node_wait3);
|
|
|
+ viewHolder.AppFlowStatus.setTextColor(mContext.getResources().getColor(R.color.no_approval));
|
|
|
+ viewHolder.AppFlowStatus.setText("待审批");
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ viewHolder.AppFlowStatus.setText("");
|
|
|
+ viewHolder.AppFlowNode.setImageResource(R.drawable.node_none3);
|
|
|
+ viewHolder.AppFlowTime.setText("");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /*
|
|
|
+ if ((nodesnum > 0 && position > nodesnum-1 && position < datanum) || (nodesnum == 1 && datanum == 1)) {
|
|
|
if (mCommonApprovalFlowBean.getNodes().get(position).getJn_dealResult().equals("同意")) {
|
|
|
viewHolder.AppFlowStatus.setTextColor(mContext.getResources().getColor(R.color.done_approval));
|
|
|
viewHolder.AppFlowStatus.setText("已审批");
|
|
|
@@ -138,6 +195,10 @@ public class DailyDetailsApprovalFlowAdapter extends BaseAdapter {
|
|
|
viewHolder.AppFlowStatus.setText("不同意");
|
|
|
viewHolder.AppFlowNode.setImageResource(R.drawable.node_wait3);
|
|
|
viewHolder.AppFlowTime.setText(mCommonApprovalFlowBean.getNodes().get(position).getJn_dealTime());
|
|
|
+ }else {
|
|
|
+ viewHolder.AppFlowStatus.setText("");
|
|
|
+ viewHolder.AppFlowNode.setImageResource(R.drawable.node_none3);
|
|
|
+ viewHolder.AppFlowTime.setText("");
|
|
|
}
|
|
|
|
|
|
//当有审批时判断有没有审批语
|
|
|
@@ -165,7 +226,7 @@ public class DailyDetailsApprovalFlowAdapter extends BaseAdapter {
|
|
|
viewHolder.AppFlowNode.setImageResource(R.drawable.node_wait3);
|
|
|
viewHolder.AppFlowStatus.setTextColor(mContext.getResources().getColor(R.color.no_approval));
|
|
|
viewHolder.AppFlowStatus.setText("待审批");
|
|
|
- }
|
|
|
+ }*/
|
|
|
return convertView;
|
|
|
}
|
|
|
|