|
|
@@ -1,13 +1,11 @@
|
|
|
package com.uas.appworks.OA.erp.activity;
|
|
|
|
|
|
-import android.content.DialogInterface;
|
|
|
import android.content.Intent;
|
|
|
import android.os.Bundle;
|
|
|
import android.os.Handler;
|
|
|
import android.os.Message;
|
|
|
import android.support.annotation.IdRes;
|
|
|
import android.support.annotation.NonNull;
|
|
|
-import android.support.v7.app.AlertDialog;
|
|
|
import android.text.Editable;
|
|
|
import android.text.TextUtils;
|
|
|
import android.text.TextWatcher;
|
|
|
@@ -45,6 +43,7 @@ import com.me.network.app.http.HttpClient;
|
|
|
import com.me.network.app.http.Method;
|
|
|
import com.me.network.app.http.rx.Result2Listener;
|
|
|
import com.me.network.app.http.rx.ResultSubscriber;
|
|
|
+import com.modular.apputils.utils.PopupWindowHelper;
|
|
|
import com.uas.appworks.OA.erp.model.WorkReportBean;
|
|
|
import com.uas.appworks.R;
|
|
|
|
|
|
@@ -749,7 +748,7 @@ public class WorkReportAddActivity extends BaseActivity implements View.OnClickL
|
|
|
mNewScheduleTitleTv.setText(R.string.work_schedule_tomorrow);
|
|
|
mNewScheduleContentEt.setHint(R.string.please_input_work_schedule_tomorrow);
|
|
|
} else if (mReportType == Constants.WORK_REPORT_WEEK) {
|
|
|
- setTitle(R.string.oaworkweekly_title);
|
|
|
+ setTitle(R.string.oaworkweekly_title);
|
|
|
mCaller = "WorkWeekly";
|
|
|
mReportTimeBeforeRb.setText(R.string.str_last_week);
|
|
|
mReportTimePresentRb.setText(R.string.str_this_week);
|
|
|
@@ -1180,17 +1179,15 @@ public class WorkReportAddActivity extends BaseActivity implements View.OnClickL
|
|
|
} else if (mReportType == Constants.WORK_REPORT_MONTH) {
|
|
|
submitNotice = String.format(submiString, "月");
|
|
|
}
|
|
|
- new AlertDialog
|
|
|
- .Builder(mContext)
|
|
|
- .setTitle(getString(R.string.common_notice))
|
|
|
- .setMessage(submitNotice)
|
|
|
- .setNegativeButton(getString(R.string.common_cancel), null)
|
|
|
- .setPositiveButton(getString(R.string.common_sure), new DialogInterface.OnClickListener() {
|
|
|
+ PopupWindowHelper.showAlart(WorkReportAddActivity.this, getString(R.string.common_notice),
|
|
|
+ submitNotice, new PopupWindowHelper.OnSelectListener() {
|
|
|
@Override
|
|
|
- public void onClick(DialogInterface dialog, int which) {
|
|
|
- sendWorkDailyByErp();
|
|
|
+ public void select(boolean selectOk) {
|
|
|
+ if (selectOk) {
|
|
|
+ sendWorkDailyByErp();
|
|
|
+ }
|
|
|
}
|
|
|
- }).show();
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
private void sendWorkDailyByErp() {
|
|
|
@@ -1385,50 +1382,43 @@ public class WorkReportAddActivity extends BaseActivity implements View.OnClickL
|
|
|
final boolean isResubmit = !TextUtils.isEmpty(resubmit) && ("unsub_tosub".equals(resubmit) || "resubmit".equals(resubmit));
|
|
|
if ((isResubmit && isUpdateModify) || (mReportTimePresentRb.isChecked() && isPresentExist && isPresentModify)
|
|
|
|| (mReportTimeBeforeRb.isChecked() && isBeforeExist && isBeforeModify)) {
|
|
|
-
|
|
|
- new AlertDialog
|
|
|
- .Builder(mContext)
|
|
|
- .setTitle(getString(R.string.common_notice))
|
|
|
- .setMessage("正在离开录入页面,是否更新汇报内容?")
|
|
|
- .setNegativeButton(R.string.give_up, new DialogInterface.OnClickListener() {
|
|
|
+ PopupWindowHelper.showAlart(WorkReportAddActivity.this,
|
|
|
+ getString(R.string.common_notice), "正在离开录入页面,是否更新汇报内容?",
|
|
|
+ new PopupWindowHelper.OnSelectListener() {
|
|
|
@Override
|
|
|
- public void onClick(DialogInterface dialog, int which) {
|
|
|
- if (isResubmit || isOptionEvent) {
|
|
|
- Intent intent1 = new Intent(WorkReportAddActivity.this, WorkDailyShowActivity.class);
|
|
|
- intent1.putExtra("caller", mCaller);
|
|
|
- intent1.putExtra("report_type", mReportType);
|
|
|
- if (isOptionEvent) {
|
|
|
- intent1.putExtra("fromwhere", "nosubmitdaily");
|
|
|
- }
|
|
|
- startActivityForResult(intent1, WORK_REPORT_LIST);
|
|
|
- }
|
|
|
- if (!isOptionEvent) {
|
|
|
- finish();
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- .setPositiveButton(R.string.updata, new DialogInterface.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(DialogInterface dialog, int which) {
|
|
|
- if (mSummaryContentEt.testValidity()) {
|
|
|
- if (mNewScheduleContentEt.getText().toString().length() <= WORD_RESTRICTION_NUMBER &&
|
|
|
- mExperienceContentEt.getText().toString().length() <= WORD_RESTRICTION_NUMBER) {
|
|
|
- if (CommonUtil.isNetWorkConnected(WorkReportAddActivity.this)) {
|
|
|
- isOnlyUpdate = true;
|
|
|
- progressDialog.show();
|
|
|
- updateWorkReport();
|
|
|
+ public void select(boolean selectOk) {
|
|
|
+ if (selectOk) {
|
|
|
+ if (mSummaryContentEt.testValidity()) {
|
|
|
+ if (mNewScheduleContentEt.getText().toString().length() <= WORD_RESTRICTION_NUMBER &&
|
|
|
+ mExperienceContentEt.getText().toString().length() <= WORD_RESTRICTION_NUMBER) {
|
|
|
+ if (CommonUtil.isNetWorkConnected(WorkReportAddActivity.this)) {
|
|
|
+ isOnlyUpdate = true;
|
|
|
+ progressDialog.show();
|
|
|
+ updateWorkReport();
|
|
|
+ } else {
|
|
|
+ ToastUtil.showToast(WorkReportAddActivity.this, R.string.networks_out);
|
|
|
+ }
|
|
|
+
|
|
|
} else {
|
|
|
- ToastUtil.showToast(WorkReportAddActivity.this, R.string.networks_out);
|
|
|
+ ToastUtil.showToast(WorkReportAddActivity.this, "字数已超限!");
|
|
|
}
|
|
|
-
|
|
|
- } else {
|
|
|
- ToastUtil.showToast(WorkReportAddActivity.this, "字数已超限!");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (isResubmit || isOptionEvent) {
|
|
|
+ Intent intent1 = new Intent(WorkReportAddActivity.this, WorkDailyShowActivity.class);
|
|
|
+ intent1.putExtra("caller", mCaller);
|
|
|
+ intent1.putExtra("report_type", mReportType);
|
|
|
+ if (isOptionEvent) {
|
|
|
+ intent1.putExtra("fromwhere", "nosubmitdaily");
|
|
|
+ }
|
|
|
+ startActivityForResult(intent1, WORK_REPORT_LIST);
|
|
|
+ }
|
|
|
+ if (!isOptionEvent) {
|
|
|
+ finish();
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
- }).create().show();
|
|
|
-
|
|
|
+ });
|
|
|
} else {
|
|
|
if (((mReportTimePresentRb.isChecked() && !isPresentExist)
|
|
|
|| (mReportTimeBeforeRb.isChecked() && !isBeforeExist)) && !isResubmit) {
|
|
|
@@ -1437,53 +1427,47 @@ public class WorkReportAddActivity extends BaseActivity implements View.OnClickL
|
|
|
mExperienceText.length() > 0) {
|
|
|
if (mNewScheduleContentEt.getText().toString().length() <= WORD_RESTRICTION_NUMBER &&
|
|
|
mExperienceContentEt.getText().toString().length() <= WORD_RESTRICTION_NUMBER) {
|
|
|
- new AlertDialog
|
|
|
- .Builder(mContext)
|
|
|
- .setTitle(getString(R.string.common_notice))
|
|
|
- .setMessage(getString(R.string.work_report_exit_notice))
|
|
|
- .setNegativeButton(R.string.give_up, new DialogInterface.OnClickListener() {
|
|
|
+ PopupWindowHelper.showAlart(WorkReportAddActivity.this, getString(R.string.common_notice),
|
|
|
+ getString(R.string.work_report_exit_notice), new PopupWindowHelper.OnSelectListener() {
|
|
|
@Override
|
|
|
- public void onClick(DialogInterface dialog, int which) {
|
|
|
- boolean isResubmit = !TextUtils.isEmpty(resubmit) && ("unsub_tosub".equals(resubmit) || "resubmit".equals(resubmit));
|
|
|
- if (isResubmit || isOptionEvent) {
|
|
|
- Intent optionIntent = new Intent(WorkReportAddActivity.this, WorkDailyShowActivity.class);
|
|
|
- optionIntent.putExtra("caller", mCaller);
|
|
|
- optionIntent.putExtra("report_type", mReportType);
|
|
|
- if (isOptionEvent) {
|
|
|
- optionIntent.putExtra("fromwhere", "nosubmitdaily");
|
|
|
- }
|
|
|
- startActivityForResult(optionIntent, WORK_REPORT_LIST);
|
|
|
- } else if (!TextUtils.isEmpty(fromqzone) && "fromqzone".equals(fromqzone)) {
|
|
|
+ public void select(boolean selectOk) {
|
|
|
+ if (selectOk) {
|
|
|
+ if (mSummaryContentEt.testValidity()) {
|
|
|
+ if (mNewScheduleContentEt.getText().toString().length() <= WORD_RESTRICTION_NUMBER &&
|
|
|
+ mExperienceContentEt.getText().toString().length() <= WORD_RESTRICTION_NUMBER) {
|
|
|
+ if (CommonUtil.isNetWorkConnected(WorkReportAddActivity.this)) {
|
|
|
+ progressDialog.show();
|
|
|
+ saveWorkReport();
|
|
|
+ } else {
|
|
|
+ ToastUtil.showToast(WorkReportAddActivity.this, R.string.networks_out);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ ToastUtil.showToast(WorkReportAddActivity.this, "字数已超限!");
|
|
|
+ }
|
|
|
|
|
|
+ }
|
|
|
} else {
|
|
|
- Intent intent1 = new Intent(WorkReportAddActivity.this, WorkReportMenuActivity.class);
|
|
|
- startActivity(intent1);
|
|
|
- }
|
|
|
- if (!isOptionEvent) {
|
|
|
- finish();
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- .setPositiveButton(R.string.save, new DialogInterface.OnClickListener() {
|
|
|
-
|
|
|
- @Override
|
|
|
- public void onClick(DialogInterface dialog, int which) {
|
|
|
- if (mSummaryContentEt.testValidity()) {
|
|
|
- if (mNewScheduleContentEt.getText().toString().length() <= WORD_RESTRICTION_NUMBER &&
|
|
|
- mExperienceContentEt.getText().toString().length() <= WORD_RESTRICTION_NUMBER) {
|
|
|
- if (CommonUtil.isNetWorkConnected(WorkReportAddActivity.this)) {
|
|
|
- progressDialog.show();
|
|
|
- saveWorkReport();
|
|
|
- } else {
|
|
|
- ToastUtil.showToast(WorkReportAddActivity.this, R.string.networks_out);
|
|
|
+ boolean isResubmit = !TextUtils.isEmpty(resubmit) && ("unsub_tosub".equals(resubmit) || "resubmit".equals(resubmit));
|
|
|
+ if (isResubmit || isOptionEvent) {
|
|
|
+ Intent optionIntent = new Intent(WorkReportAddActivity.this, WorkDailyShowActivity.class);
|
|
|
+ optionIntent.putExtra("caller", mCaller);
|
|
|
+ optionIntent.putExtra("report_type", mReportType);
|
|
|
+ if (isOptionEvent) {
|
|
|
+ optionIntent.putExtra("fromwhere", "nosubmitdaily");
|
|
|
}
|
|
|
+ startActivityForResult(optionIntent, WORK_REPORT_LIST);
|
|
|
+ } else if (!TextUtils.isEmpty(fromqzone) && "fromqzone".equals(fromqzone)) {
|
|
|
+
|
|
|
} else {
|
|
|
- ToastUtil.showToast(WorkReportAddActivity.this, "字数已超限!");
|
|
|
+ Intent intent1 = new Intent(WorkReportAddActivity.this, WorkReportMenuActivity.class);
|
|
|
+ startActivity(intent1);
|
|
|
+ }
|
|
|
+ if (!isOptionEvent) {
|
|
|
+ finish();
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
- }).show();
|
|
|
+ });
|
|
|
}
|
|
|
} else if (!TextUtils.isEmpty(fromqzone) && "fromqzone".equals(fromqzone)) {
|
|
|
finish();
|