Explorar o código

添加关闭转圈方法

李士越 hai 1 ano
pai
achega
f13ac1698d
Modificáronse 1 ficheiros con 14 adicións e 24 borrados
  1. 14 24
      src/com/jiaju/activity/SendOutGoods.java

+ 14 - 24
src/com/jiaju/activity/SendOutGoods.java

@@ -855,6 +855,7 @@ public class SendOutGoods extends Activity {
 				{
 					CustomToast.showToast(getApplicationContext(), "记账日期不能为空",
 							2000);
+					ProcessDialogUtils.closeProgressDilog();
 					return;
 				}else
 				{
@@ -864,6 +865,7 @@ public class SendOutGoods extends Activity {
 				{
 					CustomToast.showToast(getApplicationContext(), "送货日期不能为空",
 							2000);
+					ProcessDialogUtils.closeProgressDilog();
 					return;
 				}else
 				{
@@ -873,6 +875,7 @@ public class SendOutGoods extends Activity {
 				if (sendOutSpinner.getSelectedItem() == null) {
 					CustomToast.showToast(getApplicationContext(), "损坯原因不能为空",
 							2000);
+					ProcessDialogUtils.closeProgressDilog();
 					return;
 
 				} else if (sendOutSpinner.getSelectedItem() != null) {
@@ -880,6 +883,7 @@ public class SendOutGoods extends Activity {
 					if (model != null && model.getSendOutId() == "") {
 						CustomToast.showToast(getApplicationContext(),
 								"发货仓库不能为空", 2000);
+						ProcessDialogUtils.closeProgressDilog();
 						return;
 					}else
 					{
@@ -889,6 +893,7 @@ public class SendOutGoods extends Activity {
 				if (receiveSpinner.getSelectedItem() == null) {
 					CustomToast.showToast(getApplicationContext(), "损坯原因不能为空",
 							2000);
+					ProcessDialogUtils.closeProgressDilog();
 					return;
 
 				} else if (receiveSpinner.getSelectedItem() != null) {
@@ -896,6 +901,7 @@ public class SendOutGoods extends Activity {
 					if (rm != null && rm.getReceiveId() == "") {
 						CustomToast.showToast(getApplicationContext(),
 								"接收仓库不能为空", 2000);
+						ProcessDialogUtils.closeProgressDilog();
 						return;
 					}else
 					{
@@ -905,6 +911,7 @@ public class SendOutGoods extends Activity {
 				if (carBrandSpinner.getSelectedItem() == null) {
 					CustomToast.showToast(getApplicationContext(), "损坯原因不能为空",
 							2000);
+					ProcessDialogUtils.closeProgressDilog();
 					return;
 
 				} else if (carBrandSpinner.getSelectedItem() != null) {
@@ -912,6 +919,7 @@ public class SendOutGoods extends Activity {
 					if (model != null && model.getCarBrandId() == "") {
 						CustomToast.showToast(getApplicationContext(),
 								"车牌号不能为空", 2000);
+						ProcessDialogUtils.closeProgressDilog();
 						return;
 					}else
 					{
@@ -937,6 +945,7 @@ public class SendOutGoods extends Activity {
 				{
 					CustomToast.showToast(getApplicationContext(),
 							"发货单信息不能为空", 2000);
+					ProcessDialogUtils.closeProgressDilog();
 					return;
 				}
 				JSONObject js5 = new JSONObject();
@@ -1219,10 +1228,10 @@ public class SendOutGoods extends Activity {
 					jObject = new JSONObject(json2);
 					JSONObject object = (JSONObject) jObject.opt("d");
 					int status = object.optInt("Status");
-					String message = object.optString("Result");
+					String message = object.optString("Message");
 					//JSONObject result3 =(JSONObject) object.opt("Result");
 					//JSONArray resArray = (JSONArray)result3.opt("Result");
-					if (status == 0) {
+					if (status > 0) {
 						barcodeList.removeAll(barcodeList);
 						adapter.notifyDataSetChanged();
 						messageLst.getLayoutParams().height=(barcodeList.size()*Height);
@@ -1241,30 +1250,11 @@ public class SendOutGoods extends Activity {
 						mHandler = new Handler(thread.getLooper());
 						mHandler.post(responsibilityWorkNoRunnable);
 
-					} else if (status == 1) {	
-						CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, getApplicationContext());
-						CommonUtil.showSaveAlertDialog(0, "存在已发货产品", SendOutGoods.this, null, barcodeEdt, 2);					
-						
-					}else if (status == -100) {	
+					} else{	
 						CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, getApplicationContext());
-						CommonUtil.showSaveAlertDialog(0, message, SendOutGoods.this, null, barcodeEdt, 2);					
+						CommonUtil.showSaveAlertDialog(0,message , SendOutGoods.this, null, barcodeEdt, 2);					
 						
-					}else if (status == -101) {	
-						CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, getApplicationContext());
-						CommonUtil.showSaveAlertDialog(0, "同步返回空值", SendOutGoods.this, null, barcodeEdt, 2);					
-						
-					}else if (status == -102) {	
-						CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, getApplicationContext());
-						CommonUtil.showSaveAlertDialog(0, "库存不足", SendOutGoods.this, null, barcodeEdt, 2);					
-						
-					}else if (status == -103) {	
-						CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, getApplicationContext());
-						CommonUtil.showSaveAlertDialog(0, "发货单信息不能为空", SendOutGoods.this, null, barcodeEdt, 2);					
-						
-					}else  {
-						CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, getApplicationContext());
-						CommonUtil.showSaveAlertDialog(0, "失败", SendOutGoods.this, null, barcodeEdt, 2);
-					}
+					} 
 				} catch (JSONException e) {
 
 					e.printStackTrace();