|
|
@@ -324,7 +324,8 @@ public class WorkDailyShowActivity extends BaseActivity {
|
|
|
int filterPosition = (int) msg.arg1;
|
|
|
int realPosition = (int) msg.arg2;
|
|
|
mWorkReportList.remove(realPosition);
|
|
|
- if (mWorkReportAdapter.filterWorkReportList != null) {
|
|
|
+ if (mWorkReportAdapter.filterWorkReportList != null
|
|
|
+ && mWorkReportAdapter.filterWorkReportList.size() > filterPosition) {
|
|
|
mWorkReportAdapter.filterWorkReportList.remove(filterPosition);
|
|
|
}
|
|
|
mWorkReportAdapter.notifyDataSetChanged();
|
|
|
@@ -508,22 +509,10 @@ public class WorkDailyShowActivity extends BaseActivity {
|
|
|
} else {
|
|
|
viewHolder = (ViewHolder) convertView.getTag();
|
|
|
}
|
|
|
- if (mReportType == Constants.WORK_REPORT_DAY) {
|
|
|
- String dailyTimeStr = getDailyTimeStr(workReportList.get(position).getDate(), workReportList.get(position).getWeekDays());
|
|
|
- viewHolder.WorkDailyDate
|
|
|
- .setText(dailyTimeStr
|
|
|
- == null ? workReportList.get(position).getDate() : dailyTimeStr);
|
|
|
- } else if (mReportType == Constants.WORK_REPORT_WEEK) {
|
|
|
- String weeklyTimeStr = getWeeklyTimeStr(workReportList.get(position).getStartTime(), workReportList.get(position).getEndTime(), workReportList.get(position).getSerial());
|
|
|
- viewHolder.WorkDailyDate
|
|
|
- .setText(weeklyTimeStr == null ? ((TextUtils.isEmpty(workReportList.get(position).getSerial()) ? "" : "第" + workReportList.get(position).getSerial() + "周 ")
|
|
|
- + workReportList.get(position).getDate()) : weeklyTimeStr);
|
|
|
- } else if (mReportType == Constants.WORK_REPORT_MONTH) {
|
|
|
- String monthlyTimeStr = getMonthlyTimeStr(workReportList.get(position).getDate());
|
|
|
- viewHolder.WorkDailyDate
|
|
|
- .setText(monthlyTimeStr == null ? ((TextUtils.isEmpty(workReportList.get(position).getSerial()) ? "" : workReportList.get(position).getSerial() + "月 ")
|
|
|
- + workReportList.get(position).getDate()) : monthlyTimeStr);
|
|
|
- }
|
|
|
+
|
|
|
+ String dateText = getDateText(workReportList, position);
|
|
|
+ viewHolder.WorkDailyDate.setText(dateText);
|
|
|
+
|
|
|
//为日报列表界面赋值(状态,总结),注意已审批和待审批的字体颜色
|
|
|
if (!TextUtils.isEmpty(workReportList.get(position).getReportStatus()) &&
|
|
|
workReportList.get(position).getReportStatus().equals("已审核")) {
|
|
|
@@ -591,6 +580,23 @@ public class WorkDailyShowActivity extends BaseActivity {
|
|
|
ViewUtil.httpSendRequest(mContext, url, params, handler, headers, DELETE_DOC_REQUEST_SUCCESSFULLY, null, null, "get");
|
|
|
}
|
|
|
|
|
|
+ private String getDateText(List<WorkReportBean> workReportList, int position) {
|
|
|
+ String dateText = null;
|
|
|
+ if (mReportType == Constants.WORK_REPORT_DAY) {
|
|
|
+ dateText = getDailyTimeStr(workReportList.get(position).getDate(), workReportList.get(position).getWeekDays());
|
|
|
+ dateText = (dateText == null ? workReportList.get(position).getDate() : dateText);
|
|
|
+ } else if (mReportType == Constants.WORK_REPORT_WEEK) {
|
|
|
+ dateText = getWeeklyTimeStr(workReportList.get(position).getStartTime(), workReportList.get(position).getEndTime(), workReportList.get(position).getSerial());
|
|
|
+ dateText = (dateText == null ? ((TextUtils.isEmpty(workReportList.get(position).getSerial()) ? "" : "第" + workReportList.get(position).getSerial() + "周 ")
|
|
|
+ + workReportList.get(position).getDate()) : dateText);
|
|
|
+ } else if (mReportType == Constants.WORK_REPORT_MONTH) {
|
|
|
+ dateText = getMonthlyTimeStr(workReportList.get(position).getStartTime());
|
|
|
+ dateText = (dateText == null ? ((TextUtils.isEmpty(workReportList.get(position).getSerial()) ? "" : workReportList.get(position).getSerial() + "月 ")
|
|
|
+ + workReportList.get(position).getDate()) : dateText);
|
|
|
+ }
|
|
|
+ return dateText;
|
|
|
+ }
|
|
|
+
|
|
|
private String getDailyTimeStr(String dailyDate, String dailyWeek) {
|
|
|
try {
|
|
|
String[] daily = dailyDate.split("-");
|
|
|
@@ -685,10 +691,12 @@ public class WorkDailyShowActivity extends BaseActivity {
|
|
|
if (constraint == null || constraint.length() == 0) {
|
|
|
filterResults.values = mWorkReportList;
|
|
|
filterResults.count = mWorkReportList.size();
|
|
|
+ filterWorkReportList = null;
|
|
|
} else {
|
|
|
filterWorkReportList = new ArrayList<>();
|
|
|
for (int i = 0; i < mWorkReportList.size(); i++) {
|
|
|
- String date = mWorkReportList.get(i).getDate();
|
|
|
+// String date = mWorkReportList.get(i).getDate();
|
|
|
+ String date = getDateText(mWorkReportList, i);
|
|
|
String comment = mWorkReportList.get(i).getComment();
|
|
|
String approvalStatus = "";
|
|
|
if (!TextUtils.isEmpty(mWorkReportList.get(i).getReportStatus()) &&
|