|
@@ -396,28 +396,30 @@ public class OAActivity extends BaseActivity implements View.OnClickListener, Wo
|
|
|
intent.putExtra("data", object.toString());
|
|
intent.putExtra("data", object.toString());
|
|
|
startActivityForResult(intent, isMe ? 0x20 : 0x21);
|
|
startActivityForResult(intent, isMe ? 0x20 : 0x21);
|
|
|
} else if (adapter.isOutplan(object)) {
|
|
} else if (adapter.isOutplan(object)) {
|
|
|
- String status = adapter.getJSONString(object, "mpd_status");
|
|
|
|
|
- String actdate = adapter.getJSONString(object, "mpd_actdate");
|
|
|
|
|
- String outdate = adapter.getJSONString(object, "mpd_outdate");
|
|
|
|
|
- //TODO 根据状态判断是否可以对外勤计划进行录入
|
|
|
|
|
- if ("已完成".equals(status)) {
|
|
|
|
|
- intent = new Intent(activity, VisitReportAddActivity.class);
|
|
|
|
|
- intent.putExtra("type", 3);
|
|
|
|
|
- intent.putExtra("isMe", false);//可以提交拜访报告
|
|
|
|
|
- intent.putExtra("data", object.toString());
|
|
|
|
|
- startActivityForResult(intent, isMe ? 0x20 : 0x21);
|
|
|
|
|
- } else {
|
|
|
|
|
- if (StringUtils.isEmpty(actdate) || StringUtils.isEmpty(outdate)) {
|
|
|
|
|
- if (isMe)
|
|
|
|
|
- Crouton.makeText(ct, "外勤计划尚未完成");
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (outPlanClick(object)) {//外勤计划
|
|
|
intent = new Intent(activity, VisitReportAddActivity.class);
|
|
intent = new Intent(activity, VisitReportAddActivity.class);
|
|
|
intent.putExtra("type", 3);
|
|
intent.putExtra("type", 3);
|
|
|
intent.putExtra("isMe", isMe);//可以提交拜访报告
|
|
intent.putExtra("isMe", isMe);//可以提交拜访报告
|
|
|
intent.putExtra("data", object.toString());
|
|
intent.putExtra("data", object.toString());
|
|
|
startActivityForResult(intent, isMe ? 0x20 : 0x21);
|
|
startActivityForResult(intent, isMe ? 0x20 : 0x21);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ Crouton.makeText(ct, "外勤计划尚未完成");
|
|
|
}
|
|
}
|
|
|
|
|
+// if ("已完成".equals(status)) {
|
|
|
|
|
+// intent = new Intent(activity, VisitReportAddActivity.class);
|
|
|
|
|
+// intent.putExtra("type", 3);
|
|
|
|
|
+// intent.putExtra("isMe", false);//可以提交拜访报告
|
|
|
|
|
+// intent.putExtra("data", object.toString());
|
|
|
|
|
+// startActivityForResult(intent, isMe ? 0x20 : 0x21);
|
|
|
|
|
+// } else {
|
|
|
|
|
+// if (StringUtils.isEmpty(actdate) || StringUtils.isEmpty(outdate)) {
|
|
|
|
|
+// if (isMe)
|
|
|
|
|
+//
|
|
|
|
|
+// return;
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -588,7 +590,7 @@ public class OAActivity extends BaseActivity implements View.OnClickListener, Wo
|
|
|
adapter = new OAListAdapter(ct);
|
|
adapter = new OAListAdapter(ct);
|
|
|
for (int i = 0; i < a.size(); i++) {
|
|
for (int i = 0; i < a.size(); i++) {
|
|
|
o = a.getJSONObject(i);
|
|
o = a.getJSONObject(i);
|
|
|
- if (adapter.isVisit(o) || adapter.isVisitRecord(o)||adapter.isOutplan(o))
|
|
|
|
|
|
|
+ if (adapter.isVisit(o) || adapter.isVisitRecord(o) || adapter.isOutplan(o))
|
|
|
chcheArray.add(o);
|
|
chcheArray.add(o);
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
@@ -639,7 +641,7 @@ public class OAActivity extends BaseActivity implements View.OnClickListener, Wo
|
|
|
CommonUtil.textSpanForStyle(uok_task_num, "未完成 " + (size - ok), (size - ok) + "", getResources().getColor(R.color.orange_text));
|
|
CommonUtil.textSpanForStyle(uok_task_num, "未完成 " + (size - ok), (size - ok) + "", getResources().getColor(R.color.orange_text));
|
|
|
|
|
|
|
|
//当前日期小于等于选中日期
|
|
//当前日期小于等于选中日期
|
|
|
- adapter.setArray(chche, isMe, TimeUtils.s_long_2_str(System.currentTimeMillis()).compareTo(TimeUtils.s_format.format(curDate)) <= 0);
|
|
|
|
|
|
|
+ adapter.setArray(chche, isMe, isToday());
|
|
|
adapter.notifyDataSetChanged();
|
|
adapter.notifyDataSetChanged();
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -943,6 +945,27 @@ public class OAActivity extends BaseActivity implements View.OnClickListener, Wo
|
|
|
setAdapterBeans();
|
|
setAdapterBeans();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private boolean outPlanClick(JSONObject object) {
|
|
|
|
|
+ if (isToday()) {
|
|
|
|
|
+ String status = adapter.getJSONString(object, "mpd_status");
|
|
|
|
|
+ if ("签退".equals(status)) return true;
|
|
|
|
|
+ else return false;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ String actdate = adapter.getJSONString(object, "mpd_actdate");
|
|
|
|
|
+ String outdate = adapter.getJSONString(object, "mpd_outdate");
|
|
|
|
|
+ if (StringUtils.isEmpty(actdate) || StringUtils.isEmpty(outdate))
|
|
|
|
|
+ return false;
|
|
|
|
|
+ else return true;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private boolean isToday() {
|
|
|
|
|
+ boolean isToday = TimeUtils.s_long_2_str(System.currentTimeMillis()).
|
|
|
|
|
+ equals(TimeUtils.s_format.format(curDate));
|
|
|
|
|
+ Log.i("gongpengming", "isToday=" + isToday);
|
|
|
|
|
+ return isToday;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/*判断*/
|
|
/*判断*/
|
|
|
private boolean getIsDecorat(String text, String chche) {
|
|
private boolean getIsDecorat(String text, String chche) {
|
|
|
Pattern p = Pattern.compile(chche);//遍历对象
|
|
Pattern p = Pattern.compile(chche);//遍历对象
|