|
|
@@ -1,18 +1,23 @@
|
|
|
-package com.uas.rd_equipment.fragment;
|
|
|
-
|
|
|
import android.annotation.SuppressLint;
|
|
|
import android.app.Activity;
|
|
|
+import android.app.AlertDialog;
|
|
|
+import android.content.DialogInterface;
|
|
|
import android.content.Intent;
|
|
|
import android.graphics.Color;
|
|
|
+import android.graphics.drawable.BitmapDrawable;
|
|
|
import android.os.Bundle;
|
|
|
import android.support.annotation.Nullable;
|
|
|
import android.support.v4.app.Fragment;
|
|
|
import android.support.v4.content.ContextCompat;
|
|
|
import android.text.Editable;
|
|
|
+import android.text.InputType;
|
|
|
import android.text.TextWatcher;
|
|
|
import android.util.Log;
|
|
|
+import android.view.Gravity;
|
|
|
import android.view.KeyEvent;
|
|
|
+import android.view.LayoutInflater;
|
|
|
import android.view.View;
|
|
|
+import android.view.Window;
|
|
|
import android.view.WindowManager;
|
|
|
import android.view.inputmethod.EditorInfo;
|
|
|
import android.widget.AdapterView;
|
|
|
@@ -48,6 +53,7 @@ import com.uas.rd_equipment.bean.MakerecordBean;
|
|
|
import com.uas.rd_equipment.bean.ResourcesBean;
|
|
|
import com.uas.rd_equipment.bean.User;
|
|
|
import com.uas.rd_equipment.camera.CaptureActivity;
|
|
|
+import com.uas.rd_equipment.fragment.BaseFragment;
|
|
|
import com.uas.rd_equipment.global.GloableParams;
|
|
|
import com.uas.rd_equipment.tools.SharedPreUtil;
|
|
|
import com.uas.rd_equipment.util.CameraUtil;
|
|
|
@@ -75,6 +81,8 @@ import java.util.LinkedHashSet;
|
|
|
import java.util.List;
|
|
|
import java.util.Set;
|
|
|
|
|
|
+import razerdp.basepopup.BasePopupWindow;
|
|
|
+
|
|
|
/**
|
|
|
* Created by cjh on 2023-05-31
|
|
|
* cjh生产信息绑定
|
|
|
@@ -133,6 +141,7 @@ public class AddEquipmentGrantFragment extends BaseFragment implements OnColumnI
|
|
|
private TextView tv_confirm_receipt;
|
|
|
private String dc_code;
|
|
|
private String dc_status;
|
|
|
+ private ImageView mListImageView;
|
|
|
|
|
|
@Override
|
|
|
protected int getLayout() {
|
|
|
@@ -142,6 +151,7 @@ public class AddEquipmentGrantFragment extends BaseFragment implements OnColumnI
|
|
|
@Override
|
|
|
protected void initViews() {
|
|
|
FunctionActivity.setTitle(getString(R.string.addequipmentgrant));
|
|
|
+ ((FunctionActivity) getActivity()).setListIconIvVisible(true);
|
|
|
storage_recharge_collect_et = root.findViewById(R.id.storage_recharge_collect_et);
|
|
|
mSmartTable = root.findViewById(R.id.addgrant);
|
|
|
mScanImageView = (ImageView) root.findViewById(R.id.storage_recharge_scan_iv);
|
|
|
@@ -167,7 +177,8 @@ public class AddEquipmentGrantFragment extends BaseFragment implements OnColumnI
|
|
|
tv_prompt = root.findViewById(R.id.tv_prompt);
|
|
|
tv_confirm_receipt = root.findViewById(R.id.tv_confirm_receipt);
|
|
|
|
|
|
-
|
|
|
+ mListImageView = mActivity.findViewById(R.id.btn_actionbar_list_icon_iv);
|
|
|
+ mListImageView.setOnClickListener(this);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -241,7 +252,8 @@ public class AddEquipmentGrantFragment extends BaseFragment implements OnColumnI
|
|
|
va_vendcodeColumn = new Column<String>("名称", "PR_DETAIL");
|
|
|
va_codeColumn = new Column<String>("日期", "MBR_INDATE");
|
|
|
va_inmancolumn = new Column<String>("操作员", "MBR_INMAN");
|
|
|
- va_classColumn = new Column<String>("单据编号", "MBR_MAKECODE");
|
|
|
+// va_classColumn = new Column<String>("单据编号", "MBR_MAKECODE");
|
|
|
+ va_classColumn = new Column<String>("数量", "MBR_OUTQTY");
|
|
|
va_DELETEColumn = new Column<String>("操作", "MBR_DELETE");
|
|
|
va_DELETEColumn.setOnColumnItemClickListener(this);
|
|
|
mScanImageView.setOnClickListener(this);
|
|
|
@@ -254,7 +266,7 @@ public class AddEquipmentGrantFragment extends BaseFragment implements OnColumnI
|
|
|
if (actionId == EditorInfo.IME_ACTION_DONE
|
|
|
|| actionId == EditorInfo.IME_ACTION_SEND
|
|
|
|| (event != null && event.getAction() == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
|
|
|
- getsaVeData();
|
|
|
+ getsaVeData("");
|
|
|
return true;
|
|
|
}
|
|
|
return false;
|
|
|
@@ -417,9 +429,54 @@ public class AddEquipmentGrantFragment extends BaseFragment implements OnColumnI
|
|
|
|
|
|
masterFuncList = new ArrayList<String>();
|
|
|
getworkshopData();
|
|
|
+ initPopupWindow();
|
|
|
// ceshiData();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ private void initPopupWindow() {
|
|
|
+ View view = View.inflate(getActivity(), R.layout.pop_outboundlist_quantity, null);
|
|
|
+ bt_add = (Button) view.findViewById(R.id.bt_add);
|
|
|
+ bt_add.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ new AlertDialog.Builder(getActivity()).setTitle("提示").setMessage("确定要进行过账吗?")
|
|
|
+ .setPositiveButton(getString(R.string.confirm), new DialogInterface.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(DialogInterface dialog, int which) {
|
|
|
+ getNewCommitpost();
|
|
|
+ }
|
|
|
+ }).setNegativeButton(getString(R.string.cancel), null).create().show();
|
|
|
+ closeMenuPopupWindow();
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ mMenuPopupWindow = new PopupWindow(view, LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT, true);
|
|
|
+ mMenuPopupWindow.setBackgroundDrawable(new BitmapDrawable());
|
|
|
+ mMenuPopupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
|
|
|
+ @Override
|
|
|
+ public void onDismiss() {
|
|
|
+ closeMenuPopupWindow();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ private void closeMenuPopupWindow() {
|
|
|
+ if (mMenuPopupWindow != null) {
|
|
|
+ mMenuPopupWindow.dismiss();
|
|
|
+ CommonUtil.setBackgroundAlpha(mActivity, 1f);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
String inputString ="" ;
|
|
|
public void getNewdc_emcodeData(String input){
|
|
|
|
|
|
@@ -662,6 +719,7 @@ public class AddEquipmentGrantFragment extends BaseFragment implements OnColumnI
|
|
|
jltStorageInBean.setMBR_BARCODE(FastjsonUtil.getText(dataObject, "MBR_BARCODE"));
|
|
|
jltStorageInBean.setMBR_PRODCODE(FastjsonUtil.getText(dataObject, "MBR_PRODCODE"));
|
|
|
jltStorageInBean.setMBR_MAKECODE(FastjsonUtil.getText(dataObject, "MBR_MAKECODE"));
|
|
|
+ jltStorageInBean.setMBR_OUTQTY(FastjsonUtil.getText(dataObject, "MBR_OUTQTY"));
|
|
|
jltStorageInBean.setMBR_SOURCECODE(FastjsonUtil.getText(dataObject, "MBR_SOURCECODE"));
|
|
|
jltStorageInBean.setMBR_TYPE(FastjsonUtil.getText(dataObject, "MBR_TYPE"));
|
|
|
if (!StringUtil.isEmpty(FastjsonUtil.getText(dataObject, "MBR_INDATE"))){
|
|
|
@@ -735,16 +793,9 @@ public class AddEquipmentGrantFragment extends BaseFragment implements OnColumnI
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- public void getsaVeData(){
|
|
|
- if (rb_equipment.isChecked()){
|
|
|
- rb_changetext="设备";
|
|
|
- }
|
|
|
- if (rb_fixture.isChecked()){
|
|
|
- rb_changetext="夹具";
|
|
|
- }
|
|
|
- if (rb_ingredients.isChecked()){
|
|
|
- rb_changetext="辅料";
|
|
|
- }
|
|
|
+ public void getsaVeData(String quantity){
|
|
|
+ JSONArray jsonArray = new JSONArray();
|
|
|
+ JSONObject object_1 = new JSONObject();
|
|
|
String tv_grantcodetrim = tv_grantcode.getText().toString().trim();
|
|
|
if (tv_grantcodetrim.isEmpty()){
|
|
|
CommonUtil.toastNoRepeat(mActivity, "单据编号为空");
|
|
|
@@ -756,8 +807,25 @@ public class AddEquipmentGrantFragment extends BaseFragment implements OnColumnI
|
|
|
CommonUtil.toastNoRepeat(mActivity, "请选择工单号");
|
|
|
return;
|
|
|
}
|
|
|
- JSONArray jsonArray = new JSONArray();
|
|
|
- JSONObject object_1 = new JSONObject();
|
|
|
+
|
|
|
+ if (rb_equipment.isChecked()){
|
|
|
+ rb_changetext="设备";
|
|
|
+ }else if (rb_fixture.isChecked()){
|
|
|
+ rb_changetext="夹具";
|
|
|
+ } else if (rb_ingredients.isChecked()){
|
|
|
+ rb_changetext="辅料";
|
|
|
+ if (StringUtil.isEmpty(quantity)){
|
|
|
+
|
|
|
+ }else {
|
|
|
+ object_1.put("MBR_OUTQTY", quantity);//数量
|
|
|
+ }
|
|
|
+
|
|
|
+ }else {
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, "请选择物料类型");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
object_1.put("MBR_MAKECODE", ce_work_codetrim);//工单号
|
|
|
object_1.put("MBR_TYPE", rb_changetext);//设备\夹具\辅料
|
|
|
object_1.put("MBR_PRODCODE", tv_pr_code.getText());//产品编号
|
|
|
@@ -788,16 +856,84 @@ public class AddEquipmentGrantFragment extends BaseFragment implements OnColumnI
|
|
|
@Override
|
|
|
public void onFail(int flag, String failStr) throws Exception {
|
|
|
progressDialog.dismiss();
|
|
|
- CommonUtil.toastNoRepeat(mActivity, failStr);
|
|
|
- storage_recharge_collect_et.setText("");
|
|
|
+
|
|
|
+ if (failStr.contains("为物料编号")){
|
|
|
+ //弹框
|
|
|
+ initEditPopupWindow();
|
|
|
+ }else {
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, failStr);
|
|
|
+ storage_recharge_collect_et.setText("");
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ private void initEditPopupWindow() {
|
|
|
+ View contView = LayoutInflater.from(mActivity).inflate(R.layout.index_edit_pup_remark_change, null);
|
|
|
+ ClearableEditText edit_et = (ClearableEditText) contView.findViewById(R.id.edit_et);
|
|
|
+ TextView sure_tv = (TextView) contView.findViewById(R.id.sure_tv);
|
|
|
+ TextView cancle_tv = (TextView) contView.findViewById(R.id.cancle_tv);
|
|
|
+ TextView tv_name = (TextView) contView.findViewById(R.id.tv_name);
|
|
|
+ editPW = new PopupWindow(contView, LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT, true);
|
|
|
+ editPW.setTouchable(true);
|
|
|
+ editPW.setBackgroundDrawable(new BitmapDrawable());
|
|
|
+ editPW.setOnDismissListener(new BasePopupWindow.OnDismissListener() {
|
|
|
+ @Override
|
|
|
+ public void onDismiss() {
|
|
|
+ closeListPopupWindow();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ View parentView =mActivity.getWindow().findViewById(Window.ID_ANDROID_CONTENT);
|
|
|
+ editPW.showAtLocation(parentView, Gravity.CENTER, 0, 0);
|
|
|
+ CommonUtil.setBackgroundAlpha(mActivity, 0.5f);
|
|
|
+ tv_name.setText("数量");
|
|
|
+ edit_et.setHint("请输入数量");
|
|
|
+ edit_et.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL);
|
|
|
+ edit_et.requestFocus();
|
|
|
+ edit_et.setSelection(edit_et.getText().toString().length());
|
|
|
+ //确定
|
|
|
+ sure_tv.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ if (StringUtil.isEmpty(edit_et.getText().toString().trim())){
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, "请输入数量");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (edit_et.getText().toString().trim().equals("0")){
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, "数量不可为0");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+// String substring = edit_et.getText().toString().trim().substring(0, 1);
|
|
|
+// if (substring.equals("0")){
|
|
|
+// CommonUtil.toastNoRepeat(mActivity, "数量不可为0开头");
|
|
|
+// return;
|
|
|
+// }
|
|
|
+ getsaVeData(edit_et.getText().toString().trim());
|
|
|
+ closeListPopupWindow();
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ //取消
|
|
|
+ cancle_tv.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ closeListPopupWindow();
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
|
|
|
+ }
|
|
|
|
|
|
+ private void closeListPopupWindow() {
|
|
|
+ if (editPW != null) {
|
|
|
+ editPW.dismiss();
|
|
|
+ editPW = null;
|
|
|
+ CommonUtil.setBackgroundAlpha(mActivity, 1f);
|
|
|
+ }
|
|
|
|
|
|
+ }
|
|
|
public void getNewCommitData(){
|
|
|
progressDialog.show();
|
|
|
VollyRequest.getInstance().stringRequest(new HttpParams.Builder()
|
|
|
@@ -834,6 +970,11 @@ public class AddEquipmentGrantFragment extends BaseFragment implements OnColumnI
|
|
|
|
|
|
//确认领用
|
|
|
public void getOKTconfirmReceipt(){
|
|
|
+ String tv_grantcodetrim = tv_grantcode.getText().toString().trim();
|
|
|
+ if (tv_grantcodetrim.isEmpty()){
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, "单据编号为空");
|
|
|
+ return;
|
|
|
+ }
|
|
|
progressDialog.show();
|
|
|
VollyRequest.getInstance().stringRequest(new HttpParams.Builder()
|
|
|
.url(GloableParams.ASTATIONTHE_SELECT_CONFIRMUSE)
|
|
|
@@ -866,7 +1007,27 @@ public class AddEquipmentGrantFragment extends BaseFragment implements OnColumnI
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ public void getNewCommitpost(){
|
|
|
+ progressDialog.show();
|
|
|
+ VollyRequest.getInstance().stringRequest(new HttpParams.Builder()
|
|
|
+ .url(GloableParams.ASTATIONTHE_SELECT_POST)
|
|
|
+ .method(Request.Method.GET)
|
|
|
+ .addParam("dc_code",tv_grantcode.getText().toString().trim())
|
|
|
+ .build(), new HttpCallback() {
|
|
|
+ @Override
|
|
|
+ public void onSuccess(int flag, Object o) throws Exception {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ CommonUtil.toastYESRepeat(mActivity, "过账成功");
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onFail(int flag, String failStr) throws Exception {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, failStr);
|
|
|
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
|
|
|
private void setFilterTableData(List<MakerecordBean> filterTableData) {
|
|
|
@@ -1019,6 +1180,10 @@ public class AddEquipmentGrantFragment extends BaseFragment implements OnColumnI
|
|
|
CommonUtil.toastNoRepeat(mActivity, getString(R.string.no_camera_detected));
|
|
|
}
|
|
|
break;
|
|
|
+ case R.id.btn_actionbar_list_icon_iv:
|
|
|
+ CommonUtil.setBackgroundAlpha(getActivity(), 0.5f);
|
|
|
+ mMenuPopupWindow.showAsDropDown(mListImageView);
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1035,7 +1200,7 @@ public class AddEquipmentGrantFragment extends BaseFragment implements OnColumnI
|
|
|
if (mFocusId == R.id.storage_recharge_collect_et) {
|
|
|
storage_recharge_collect_et.setText(result);
|
|
|
storage_recharge_collect_et.setSelection(result.length());
|
|
|
- getsaVeData();
|
|
|
+ getsaVeData("");
|
|
|
}
|
|
|
}
|
|
|
}
|