|
|
@@ -1,11 +1,9 @@
|
|
|
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.v7.app.AlertDialog;
|
|
|
import android.text.TextUtils;
|
|
|
import android.util.Log;
|
|
|
import android.view.KeyEvent;
|
|
|
@@ -47,6 +45,7 @@ import com.core.widget.EmptyLayout;
|
|
|
import com.core.widget.MyListView;
|
|
|
import com.core.widget.SquareCenterImageView;
|
|
|
import com.core.widget.view.MyGridView;
|
|
|
+import com.modular.apputils.utils.PopupWindowHelper;
|
|
|
import com.nostra13.universalimageloader.core.ImageLoader;
|
|
|
import com.uas.appworks.CRM.erp.activity.DeviceDataFormAddActivity;
|
|
|
import com.uas.appworks.OA.erp.activity.form.DataFormDetailActivity;
|
|
|
@@ -154,7 +153,7 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
if (intent != null) {
|
|
|
device = intent.getBooleanExtra("device", false);
|
|
|
message = intent.getBooleanExtra("message", false);
|
|
|
- statusKey=intent.getStringExtra("statusKey");
|
|
|
+ statusKey = intent.getStringExtra("statusKey");
|
|
|
}
|
|
|
|
|
|
platform = ApiUtils.getApiModel() instanceof ApiPlatform;
|
|
|
@@ -315,11 +314,11 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
getMenuInflater().inflate(R.menu.menu_common_docdetails, menu);
|
|
|
MenuItem item = menu.getItem(0);
|
|
|
String title = null;
|
|
|
- if (getToolBarTitle()!=null) {
|
|
|
+ if (getToolBarTitle() != null) {
|
|
|
title = getToolBarTitle().toString();
|
|
|
}
|
|
|
- if (real_status==null||!(real_status.equals("已提交")||real_status.equals("已审核"))
|
|
|
- ||title == null || !"出差单详情".equals(title)) {
|
|
|
+ if (real_status == null || !(real_status.equals("已提交") || real_status.equals("已审核"))
|
|
|
+ || title == null || !"出差单详情".equals(title)) {
|
|
|
item.setVisible(false);
|
|
|
}
|
|
|
}
|
|
|
@@ -333,7 +332,7 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
.putExtra("caller", mCaller).putExtra("title", mTitle)
|
|
|
);
|
|
|
finish();
|
|
|
- }else if (R.id.toTravel==item.getItemId()){
|
|
|
+ } else if (R.id.toTravel == item.getItemId()) {
|
|
|
startActivity(new Intent(ct, BusinessTravelActivity.class));
|
|
|
finish();
|
|
|
}
|
|
|
@@ -350,7 +349,7 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
LogUtil.d("非正常返回...");
|
|
|
startActivity(new Intent(mContext, FormListSelectActivity.class)
|
|
|
.putExtra("caller", mCaller)
|
|
|
- .putExtra("statusKey",statusKey)
|
|
|
+ .putExtra("statusKey", statusKey)
|
|
|
.putExtra("title", mTitle));
|
|
|
finish();
|
|
|
}
|
|
|
@@ -1030,66 +1029,63 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
|
if (!TextUtils.isEmpty(real_status) && real_status.equals("在录入")) {
|
|
|
- new AlertDialog
|
|
|
- .Builder(mContext)
|
|
|
- .setTitle(getString(R.string.common_notice))
|
|
|
- .setMessage(getString(R.string.delete_doc_notice2))
|
|
|
- .setNegativeButton(getString(R.string.common_cancel), null)
|
|
|
- .setPositiveButton(getString(R.string.common_sure), new DialogInterface.OnClickListener() {
|
|
|
+ PopupWindowHelper.showAlart(CommonDocDetailsActivity.this,
|
|
|
+ getString(R.string.common_notice), getString(R.string.delete_doc_notice2),
|
|
|
+ new PopupWindowHelper.OnSelectListener() {
|
|
|
@Override
|
|
|
- public void onClick(DialogInterface dialog, int which) {
|
|
|
- DeleteComDocRequest(mCaller, mkeyValue);
|
|
|
+ public void select(boolean selectOk) {
|
|
|
+ if (selectOk) {
|
|
|
+ DeleteComDocRequest(mCaller, mkeyValue);
|
|
|
+ }
|
|
|
}
|
|
|
- }).show();
|
|
|
+ });
|
|
|
} else if (!TextUtils.isEmpty(real_status) && real_status.equals("已提交")) {
|
|
|
- new AlertDialog
|
|
|
- .Builder(mContext)
|
|
|
- .setTitle(getString(R.string.common_notice))
|
|
|
- .setMessage(getString(R.string.delete_sumited_notice1))
|
|
|
- .setNegativeButton(getString(R.string.common_cancel), null)
|
|
|
- .setPositiveButton(getString(R.string.common_sure), new DialogInterface.OnClickListener() {
|
|
|
+ PopupWindowHelper.showAlart(CommonDocDetailsActivity.this,
|
|
|
+ getString(R.string.common_notice), getString(R.string.delete_sumited_notice1),
|
|
|
+ new PopupWindowHelper.OnSelectListener() {
|
|
|
@Override
|
|
|
- public void onClick(DialogInterface dialog, int which) { //反提交
|
|
|
- if (device && "DeviceChange!Inspect".equals(mCaller)) {
|
|
|
- ToastUtil.showToast(ct, "送检单不允许删除");
|
|
|
- } else {
|
|
|
- progressDialog.show();
|
|
|
- Map<String, Object> params = new HashMap<>();
|
|
|
- params.put("caller", mCaller);
|
|
|
- params.put("id", mkeyValue);
|
|
|
- LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
|
|
|
- headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
|
|
|
- String url = "";
|
|
|
- if ("ExtraWork$".equals(mCaller)) { // 新的加班单反提交
|
|
|
- url = CommonUtil.getAppBaseUrl(ct) + "/hr/attendance/resSubmitExtraWork.action";
|
|
|
- ViewUtil.httpSendRequest(ct, url, params, mHandler, headers, New_DOC_REDELETE_SUCCESSFUL, null, null, "post");
|
|
|
- } else if ("FeePlease!FYBX".equals(mCaller)) {
|
|
|
- url = CommonUtil.getAppBaseUrl(ct) + "oa/fee/resSubmitFeePlease.action";
|
|
|
- ViewUtil.httpSendRequest(ct, url, params, mHandler, headers, 0x02, null, null, "post");
|
|
|
- } else { // 通用老的反提交s
|
|
|
- url = CommonUtil.getAppBaseUrl(ct) + "/mobile/commonres.action";
|
|
|
- ViewUtil.httpSendRequest(ct, url, params, mHandler, headers, COM_DOC_REDELETE_SUCCESSFUL, null, null, "post");
|
|
|
+ public void select(boolean selectOk) {
|
|
|
+ if (selectOk) {
|
|
|
+ if (device && "DeviceChange!Inspect".equals(mCaller)) {
|
|
|
+ ToastUtil.showToast(ct, "送检单不允许删除");
|
|
|
+ } else {
|
|
|
+ progressDialog.show();
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
+ params.put("caller", mCaller);
|
|
|
+ params.put("id", mkeyValue);
|
|
|
+ LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
|
|
|
+ headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
|
|
|
+ String url = "";
|
|
|
+ if ("ExtraWork$".equals(mCaller)) { // 新的加班单反提交
|
|
|
+ url = CommonUtil.getAppBaseUrl(ct) + "/hr/attendance/resSubmitExtraWork.action";
|
|
|
+ ViewUtil.httpSendRequest(ct, url, params, mHandler, headers, New_DOC_REDELETE_SUCCESSFUL, null, null, "post");
|
|
|
+ } else if ("FeePlease!FYBX".equals(mCaller)) {
|
|
|
+ url = CommonUtil.getAppBaseUrl(ct) + "oa/fee/resSubmitFeePlease.action";
|
|
|
+ ViewUtil.httpSendRequest(ct, url, params, mHandler, headers, 0x02, null, null, "post");
|
|
|
+ } else { // 通用老的反提交s
|
|
|
+ url = CommonUtil.getAppBaseUrl(ct) + "/mobile/commonres.action";
|
|
|
+ ViewUtil.httpSendRequest(ct, url, params, mHandler, headers, COM_DOC_REDELETE_SUCCESSFUL, null, null, "post");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }).show();
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
private void reSubmit() {
|
|
|
- new AlertDialog
|
|
|
- .Builder(mContext)
|
|
|
- .setTitle(getString(R.string.common_notice))
|
|
|
- .setMessage(getString(R.string.daily_resubmit_notice1))
|
|
|
- .setNegativeButton(getString(R.string.common_cancel), null)
|
|
|
- .setPositiveButton(getString(R.string.common_sure), new DialogInterface.OnClickListener() {
|
|
|
+ PopupWindowHelper.showAlart(CommonDocDetailsActivity.this,
|
|
|
+ getString(R.string.common_notice), getString(R.string.daily_resubmit_notice1),
|
|
|
+ new PopupWindowHelper.OnSelectListener() {
|
|
|
@Override
|
|
|
- public void onClick(DialogInterface dialog, int which) {
|
|
|
- reSubmitNet();
|
|
|
+ public void select(boolean selectOk) {
|
|
|
+ if (selectOk) {
|
|
|
+ reSubmitNet();
|
|
|
+ }
|
|
|
}
|
|
|
- }).show();
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
private void reSubmitNet() {
|
|
|
@@ -1188,7 +1184,7 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
startActivity(new Intent(mContext, FormListSelectActivity.class)
|
|
|
.putExtra("caller", mCaller)
|
|
|
.putExtra("update", update)
|
|
|
- .putExtra("statusKey",statusKey)
|
|
|
+ .putExtra("statusKey", statusKey)
|
|
|
.putExtra("title", mTitle));
|
|
|
finish();
|
|
|
} else {
|
|
|
@@ -1204,7 +1200,7 @@ public class CommonDocDetailsActivity extends BaseActivity {
|
|
|
startActivity(
|
|
|
new Intent(mContext, FormListSelectActivity.class)
|
|
|
.putExtra("caller", mCaller)
|
|
|
- .putExtra("statusKey",statusKey)
|
|
|
+ .putExtra("statusKey", statusKey)
|
|
|
.putExtra("title", mTitle));
|
|
|
finish();
|
|
|
}
|