|
|
@@ -3,14 +3,27 @@ package com.uas.hyequipment.fragment;
|
|
|
import android.app.Activity;
|
|
|
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.content.ContextCompat;
|
|
|
+import android.support.v7.widget.DividerItemDecoration;
|
|
|
+import android.support.v7.widget.LinearLayoutManager;
|
|
|
+import android.support.v7.widget.RecyclerView;
|
|
|
+import android.text.InputType;
|
|
|
+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;
|
|
|
import android.widget.ArrayAdapter;
|
|
|
import android.widget.Button;
|
|
|
import android.widget.ImageView;
|
|
|
+import android.widget.LinearLayout;
|
|
|
+import android.widget.PopupWindow;
|
|
|
import android.widget.Spinner;
|
|
|
import android.widget.TextView;
|
|
|
|
|
|
@@ -18,8 +31,20 @@ import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.android.volley.Request;
|
|
|
+import com.bin.david.form.core.SmartTable;
|
|
|
+import com.bin.david.form.core.TableConfig;
|
|
|
+import com.bin.david.form.data.CellInfo;
|
|
|
+import com.bin.david.form.data.column.Column;
|
|
|
+import com.bin.david.form.data.format.bg.BaseCellBackgroundFormat;
|
|
|
+import com.bin.david.form.data.style.FontStyle;
|
|
|
+import com.bin.david.form.data.table.TableData;
|
|
|
+import com.bin.david.form.listener.OnColumnItemClickListener;
|
|
|
+import com.chad.library.adapter.base.BaseQuickAdapter;
|
|
|
+import com.chad.library.adapter.base.BaseViewHolder;
|
|
|
import com.uas.hyequipment.R;
|
|
|
import com.uas.hyequipment.activity.FunctionActivity;
|
|
|
+import com.uas.hyequipment.bean.DeliceryListBean;
|
|
|
+import com.uas.hyequipment.bean.DeliveruSearchBean;
|
|
|
import com.uas.hyequipment.camera.CaptureActivity;
|
|
|
import com.uas.hyequipment.camera.CodeUtils;
|
|
|
import com.uas.hyequipment.global.GloableParams;
|
|
|
@@ -34,10 +59,16 @@ import com.uas.hyequipment.util.StringUtil;
|
|
|
import com.uas.hyequipment.util.VollyRequest;
|
|
|
import com.uas.hyequipment.view.ClearableEditText;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Collections;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+import razerdp.basepopup.BasePopupWindow;
|
|
|
+
|
|
|
/**
|
|
|
* Created by cjh-sail on 2023-02-01
|
|
|
*/
|
|
|
-public class DeliveryForRepairFragment extends BaseFragment{
|
|
|
+public class DeliveryForRepairFragment extends BaseFragment implements OnColumnItemClickListener<String> {
|
|
|
|
|
|
private String de_code;
|
|
|
private Spinner spinner;
|
|
|
@@ -47,7 +78,7 @@ public class DeliveryForRepairFragment extends BaseFragment{
|
|
|
private TextView tv_dc_emname;
|
|
|
private TextView tv_dc_devcode;
|
|
|
private TextView tv_de_name;
|
|
|
- private TextView tv_malfunction;
|
|
|
+ private TextView tv_remark;
|
|
|
private TextView tv_dc_remark;
|
|
|
private String dc_code;
|
|
|
private String dc_emname;
|
|
|
@@ -65,6 +96,21 @@ public class DeliveryForRepairFragment extends BaseFragment{
|
|
|
private ImageView storage_recharge_scan_iv;
|
|
|
private int mFocusId;
|
|
|
private static final int SCAN_BARCODE_CODE = 111;
|
|
|
+ private Button btn_confirm_repair;
|
|
|
+ private TextView tv_add;
|
|
|
+ private SmartTable mSmartTable;
|
|
|
+ private Column<String> va_classColumn,va_qtyColumn;
|
|
|
+ private TableData<DeliceryListBean> mTableData;
|
|
|
+ private List<DeliceryListBean> mFilterStorageInBeans;
|
|
|
+ private List<DeliveruSearchBean> linecodeBeanList;
|
|
|
+ private ClearableEditText edit_et;
|
|
|
+ private IpAndlinecodePortAdapter ipAndlinecodePortAdapter;
|
|
|
+ private String pr_code;
|
|
|
+ private String pr_detail;
|
|
|
+ private String pr_spec;
|
|
|
+ private TextView tv_fault_phenomenon;
|
|
|
+ private String dc_reasonanalyse;
|
|
|
+
|
|
|
@Override
|
|
|
protected int getLayout() {
|
|
|
return R.layout.fragment_deliveryforrepair;
|
|
|
@@ -80,7 +126,7 @@ public class DeliveryForRepairFragment extends BaseFragment{
|
|
|
tv_dc_emname = root.findViewById(R.id.tv_dc_emname);
|
|
|
tv_dc_devcode = root.findViewById(R.id.tv_dc_devcode);
|
|
|
tv_de_name = root.findViewById(R.id.tv_de_name);
|
|
|
- tv_malfunction = root.findViewById(R.id.tv_malfunction);
|
|
|
+ tv_remark = root.findViewById(R.id.tv_remark);
|
|
|
tv_dc_remark = root.findViewById(R.id.tv_dc_remark);
|
|
|
btn_commit = root.findViewById(R.id.btn_commit);
|
|
|
index_position_malfunction = root.findViewById(R.id.index_position_malfunction);
|
|
|
@@ -89,7 +135,15 @@ public class DeliveryForRepairFragment extends BaseFragment{
|
|
|
|
|
|
ce_de_code = root.findViewById(R.id.ce_de_code);
|
|
|
storage_recharge_scan_iv = root.findViewById(R.id.storage_recharge_scan_iv);
|
|
|
+ btn_confirm_repair = root.findViewById(R.id.btn_confirm_repair);
|
|
|
+ tv_add = root.findViewById(R.id.tv_add);
|
|
|
+ mSmartTable = root.findViewById(R.id.jlt_storage_in_filter_list_st);
|
|
|
+ tv_fault_phenomenon = root.findViewById(R.id.tv_fault_phenomenon);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
+ ce_de_code.requestFocus();
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -144,6 +198,21 @@ public class DeliveryForRepairFragment extends BaseFragment{
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+ tv_add.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ addData();
|
|
|
+// initlinecodePopupWindow();
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ btn_confirm_repair.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ getNewconfirm_repair();
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -151,23 +220,248 @@ public class DeliveryForRepairFragment extends BaseFragment{
|
|
|
Bundle arguments = getArguments();
|
|
|
if (arguments != null) {
|
|
|
de_code = arguments.getString("de_code");
|
|
|
- String de_name = arguments.getString("de_name");
|
|
|
+// String de_name = arguments.getString("de_name");
|
|
|
}
|
|
|
|
|
|
if (!StringUtil.isEmpty(de_code)){
|
|
|
getNewNameData();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ mFilterStorageInBeans = Collections.synchronizedList(new ArrayList<>());
|
|
|
+ WindowManager wm = mActivity.getWindowManager();
|
|
|
+ int screenWith = wm.getDefaultDisplay().getWidth();
|
|
|
+ mSmartTable.getConfig().setMinTableWidth(screenWith)
|
|
|
+ .setShowXSequence(false)
|
|
|
+ .setShowYSequence(false)
|
|
|
+ .setShowTableTitle(false)
|
|
|
+ .setFixedTitle(true)
|
|
|
+ .setVerticalPadding(CommonUtil.dip2px(mActivity, 12))
|
|
|
+ .setColumnTitleVerticalPadding(CommonUtil.dip2px(mActivity, 12))
|
|
|
+ .setHorizontalPadding(CommonUtil.dip2px(mActivity, 10))
|
|
|
+ .setSequenceHorizontalPadding(CommonUtil.dip2px(mActivity, 10))
|
|
|
+ .setColumnTitleHorizontalPadding(CommonUtil.dip2px(mActivity, 10))
|
|
|
+ .setColumnTitleStyle(new FontStyle(CommonUtil.sp2px(mActivity, 15), Color.parseColor("#000000")))
|
|
|
+ .setContentCellBackgroundFormat(new BaseCellBackgroundFormat<CellInfo>() {
|
|
|
+ @Override
|
|
|
+ public int getBackGroundColor(CellInfo cellInfo) {
|
|
|
+ if (cellInfo.row >=0) {
|
|
|
+ return ContextCompat.getColor(mActivity, R.color.blue_50);
|
|
|
+ }
|
|
|
+ return TableConfig.INVALID_COLOR;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ va_classColumn = new Column<String>("配件", "dd_ordername");
|
|
|
+ va_qtyColumn = new Column<String>("用量", "dd_qty");
|
|
|
+
|
|
|
+ va_classColumn.setOnColumnItemClickListener(this);
|
|
|
+
|
|
|
+ va_qtyColumn.setOnColumnItemClickListener(this);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
btn_commit.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
|
getNewCommitData();
|
|
|
}
|
|
|
});
|
|
|
+ linecodeBeanList = new ArrayList<>();
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 关于工单号弹框
|
|
|
+ */
|
|
|
+ private void initlinecodePopupWindow(List<DeliceryListBean> mList,int i,Column<String> column) {
|
|
|
+ ipAndlinecodePortAdapter = new IpAndlinecodePortAdapter(linecodeBeanList);
|
|
|
+ View contView = LayoutInflater.from(mActivity).inflate(R.layout.index_edit_pup, null);
|
|
|
+ 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);
|
|
|
+ ImageView search_im = contView.findViewById(R.id.search_im);
|
|
|
+
|
|
|
+ RecyclerView rv_ip_port_data = contView.findViewById(R.id.rv_ip_port_data);
|
|
|
+ rv_ip_port_data.addItemDecoration(new DividerItemDecoration(mActivity, LinearLayout.VERTICAL));
|
|
|
+ rv_ip_port_data.setLayoutManager(new LinearLayoutManager(mActivity));
|
|
|
+ ipAndlinecodePortAdapter.setmList(linecodeBeanList);
|
|
|
+ rv_ip_port_data.setAdapter(ipAndlinecodePortAdapter);
|
|
|
+ getfuzzySearchData(edit_et.getText().toString().trim(),"弹框");
|
|
|
+
|
|
|
+ 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);
|
|
|
+ search_im.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ getfuzzySearchData(edit_et.getText().toString().trim(),"弹框");
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ ipAndlinecodePortAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
|
|
|
+ List<DeliveruSearchBean> ipAndPortBeans = ipAndlinecodePortAdapter.getmList();
|
|
|
+ pr_code = ipAndPortBeans.get(position).getPR_CODE();
|
|
|
+ pr_detail = ipAndPortBeans.get(position).getPR_DETAIL();
|
|
|
+ pr_spec = ipAndPortBeans.get(position).getPR_SPEC();
|
|
|
+ for (int i = 0; i < ipAndPortBeans.size(); i++) {
|
|
|
+ ipAndPortBeans.get(i).setChecked(false);
|
|
|
+ }
|
|
|
+ ipAndPortBeans.get(position).setChecked(true);
|
|
|
+ edit_et.setText(pr_detail);
|
|
|
+ edit_et.setSelection(edit_et.getText().toString().length());
|
|
|
+ ipAndlinecodePortAdapter.notifyDataSetChanged();
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ //确定
|
|
|
+ sure_tv.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ if(StringUtil.isEmpty(pr_code)){
|
|
|
+ CommonUtil.toastNoRepeat(mActivity,"请选择或输入配件");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (column.getColumnName().equals("配件")){
|
|
|
+ mList.get(i).setDd_ordername(edit_et.getText().toString().trim());
|
|
|
+ }else if(column.getColumnName().equals("用量")){
|
|
|
+ mList.get(i).setDd_qty(edit_et.getText().toString().trim());
|
|
|
+ }
|
|
|
+
|
|
|
+ setFilterTableData(mList);
|
|
|
+ closeListPopupWindow();
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ //取消
|
|
|
+ cancle_tv.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+
|
|
|
+ closeListPopupWindow();
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+// edit_et.addTextChangedListener(new TextWatcher() {
|
|
|
+// @Override
|
|
|
+// public void beforeTextChanged(CharSequence s, int start, int count, int after) { }
|
|
|
+// @Override
|
|
|
+// public void onTextChanged(CharSequence s, int start, int before, int count) { }
|
|
|
+// @Override
|
|
|
+// public void afterTextChanged(Editable s) {
|
|
|
+// if (linecodeBeanList.isEmpty()){
|
|
|
+// getfuzzySearchData(et_linecode_smts.getText().toString().trim(),"弹框");
|
|
|
+// }
|
|
|
+// if (s.length() >= 0) {
|
|
|
+// String mSearchStr = s.toString().trim();
|
|
|
+// LogUtil.i("mSearchStr",mSearchStr);
|
|
|
+// List<DeliveruSearchBean> thisList = new ArrayList<>();
|
|
|
+// for(int i=0;i<linecodeBeanList.size();i++){
|
|
|
+// if(linecodeBeanList.get(i).getMA_CODE().contains(mSearchStr)){
|
|
|
+// thisList.add(linecodeBeanList.get(i));
|
|
|
+// }
|
|
|
+// if(i == linecodeBeanList.size() -1){
|
|
|
+// ipAndlinecodePortAdapter = new IpAndlinecodePortAdapter(thisList);
|
|
|
+// rv_ip_port_data.setAdapter(ipAndlinecodePortAdapter);
|
|
|
+// LogUtil.i("mSearchStr", JSON.toJSONString(thisList));
|
|
|
+// }
|
|
|
+// }
|
|
|
+// ipAndlinecodePortAdapter.notifyDataSetChanged();
|
|
|
+//
|
|
|
+// } else {
|
|
|
+//
|
|
|
+// ipAndlinecodePortAdapter = new IpAndlinecodePortAdapter(linecodeBeanList);
|
|
|
+// rv_ip_port_data.setAdapter(ipAndlinecodePortAdapter);
|
|
|
+//
|
|
|
+// }
|
|
|
+// ipAndlinecodePortAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
|
|
|
+// @Override
|
|
|
+// public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
|
|
|
+// List<DeliveruSearchBean> ipAndPortBeans = ipAndlinecodePortAdapter.getmList();
|
|
|
+// for (int i = 0; i < ipAndPortBeans.size(); i++) {
|
|
|
+// ipAndPortBeans.get(i).setChecked(false);
|
|
|
+// }
|
|
|
+// ipAndPortBeans.get(position).setChecked(true);
|
|
|
+// ipAndlinecodePortAdapter.notifyDataSetChanged();
|
|
|
+// }
|
|
|
+// });
|
|
|
+// }
|
|
|
+//
|
|
|
+// });
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ public void getfuzzySearchData(String inoutNo,String sone){
|
|
|
+ progressDialog.show();
|
|
|
+ VollyRequest.getInstance().stringRequest(new HttpParams.Builder()
|
|
|
+ .url(GloableParams.ASTATIONTHE_SELECT_FUZZYSEARCHPRODUCTS)
|
|
|
+ .method(Request.Method.GET)
|
|
|
+ .addParam("pr_detail", inoutNo)
|
|
|
+ .build(), new HttpCallback() {
|
|
|
+ @Override
|
|
|
+ public void onSuccess(int flag, Object o) throws Exception {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ String s = o.toString();
|
|
|
+ List<String> mAutoStrings = new ArrayList<String>();
|
|
|
+ try {
|
|
|
+ mAutoStrings.clear();
|
|
|
+ linecodeBeanList.clear();
|
|
|
+
|
|
|
+ JSONArray dataArrayone = FastjsonUtil.getJSONArray(o.toString(),"data");
|
|
|
+ if (sone.equals("弹框")){
|
|
|
+ if (dataArrayone == null|| dataArrayone.size() == 0){
|
|
|
+ CommonUtil.toastNoRepeat(mActivity,"未搜索到匹配数据");
|
|
|
+ }
|
|
|
+ for(Object index:dataArrayone){
|
|
|
+ JSONObject data = (JSONObject) index;
|
|
|
+ DeliveruSearchBean bean = new DeliveruSearchBean();
|
|
|
+ bean.setPR_CODE(data.getString("PR_CODE"));
|
|
|
+ bean.setPR_DETAIL(data.getString("PR_DETAIL"));
|
|
|
+ bean.setPR_SPEC(data.getString("PR_SPEC"));
|
|
|
+
|
|
|
+ linecodeBeanList.add(bean);
|
|
|
+ }
|
|
|
+ ipAndlinecodePortAdapter.setmList(linecodeBeanList);
|
|
|
+ ipAndlinecodePortAdapter.notifyDataSetChanged();
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onFail(int flag, String failStr) throws Exception {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, failStr);
|
|
|
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
public void getNewNameData(){
|
|
|
progressDialog.show();
|
|
|
VollyRequest.getInstance().stringRequest(new HttpParams.Builder()
|
|
|
@@ -175,8 +469,8 @@ public class DeliveryForRepairFragment extends BaseFragment{
|
|
|
.method(Request.Method.GET)
|
|
|
.addParam("caller", "DeviceChange!Repair")
|
|
|
.addParam("de_code", de_code)//设备编号
|
|
|
+ .tag(TAG + "getShopPlan")
|
|
|
.build(), new HttpCallback() {
|
|
|
-
|
|
|
@Override
|
|
|
public void onSuccess(int flag, Object o) throws Exception {
|
|
|
progressDialog.dismiss();
|
|
|
@@ -188,15 +482,20 @@ public class DeliveryForRepairFragment extends BaseFragment{
|
|
|
dc_devcode = FastjsonUtil.getText(dataObject, "dc_devcode");
|
|
|
de_name = FastjsonUtil.getText(dataObject, "de_name");
|
|
|
dc_reason = FastjsonUtil.getText(dataObject, "dc_reason");
|
|
|
- dc_remark = FastjsonUtil.getText(dataObject, "dc_remark");
|
|
|
+ dc_remark = FastjsonUtil.getText(dataObject, "dc_remark1");
|
|
|
dc_id = FastjsonUtil.getText(dataObject, "dc_id");
|
|
|
+ dc_reasonanalyse = FastjsonUtil.getText(dataObject, "dc_reasonanalyse");
|
|
|
|
|
|
- tv_de_code.setText("送修单:"+ dc_code);
|
|
|
- tv_dc_emname.setText("送修人:"+ dc_emname);
|
|
|
- tv_dc_devcode.setText("设备:"+ dc_devcode);
|
|
|
- tv_de_name.setText(de_name);
|
|
|
- tv_malfunction.setText("故障现象:"+ dc_reason);
|
|
|
- tv_dc_remark.setText("备注:"+ dc_remark);
|
|
|
+ tv_de_code.setText(""+ dc_code);
|
|
|
+ tv_dc_emname.setText(""+ dc_emname);
|
|
|
+ tv_dc_devcode.setText(""+ dc_devcode);
|
|
|
+ tv_de_name.setText(""+de_name);
|
|
|
+// tv_fault_phenomenon.setText(""+ dc_reason);
|
|
|
+ tv_fault_phenomenon.setText(""+ dc_reason);
|
|
|
+ index_position_malfunction.setText(""+dc_reasonanalyse);
|
|
|
+ tv_remark.setText(""+ dc_remark);
|
|
|
+ index_position_resource.setText(dc_remark);
|
|
|
+ index_position_malfunction.requestFocus();
|
|
|
|
|
|
|
|
|
}
|
|
|
@@ -216,21 +515,38 @@ public class DeliveryForRepairFragment extends BaseFragment{
|
|
|
CommonUtil.toastNoRepeat(mActivity, "请填写故障原因");
|
|
|
return;
|
|
|
}
|
|
|
- if (index_position_resource.getText().toString().trim().isEmpty()){
|
|
|
- CommonUtil.toastNoRepeat(mActivity, "请填写备注");
|
|
|
- return;
|
|
|
- }
|
|
|
- if (dc_id.isEmpty()){
|
|
|
+ if (StringUtil.isEmpty(dc_id)){
|
|
|
CommonUtil.toastNoRepeat(mActivity, "未能获取到设备信id");
|
|
|
return;
|
|
|
}
|
|
|
+ JSONObject jsonObject3 = new JSONObject();
|
|
|
+ JSONArray jsonArray3 = new JSONArray();
|
|
|
+ ArrayList<DeliceryListBean> DeliceryListBeanlist=new ArrayList<>();
|
|
|
+ for (int o=0;o<mFilterStorageInBeans.size();o++){
|
|
|
+ DeliceryListBean printListBean = mFilterStorageInBeans.get(o);
|
|
|
+ if (StringUtil.isEmpty(printListBean.getDd_ordername())){
|
|
|
+ printListBean.setDd_ordername("");
|
|
|
+ }
|
|
|
+ if (StringUtil.isEmpty(printListBean.getDd_qty())){
|
|
|
+ printListBean.setDd_qty("");
|
|
|
+ }
|
|
|
+ DeliceryListBean printListBean1=new DeliceryListBean(printListBean.getDd_ordername(),printListBean.getDd_qty());
|
|
|
+ DeliceryListBeanlist.add(printListBean1);
|
|
|
+ }
|
|
|
+
|
|
|
+ jsonArray3.add(DeliceryListBeanlist);
|
|
|
+ jsonObject3.put("param1",jsonArray3);
|
|
|
+ String substring3 = jsonArray3.toString().substring(0, jsonArray3.toString().length() - 1);//去除尾部
|
|
|
+ String substring13 = substring3.substring(1, substring3.length());//去除首部
|
|
|
+
|
|
|
+
|
|
|
progressDialog.show();
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
JSONObject object_1 = new JSONObject();
|
|
|
object_1.put("dc_id", dc_id);
|
|
|
object_1.put("dc_reasonanalyse", index_position_malfunction.getText().toString().trim());//原因分析
|
|
|
- object_1.put("dc_remark", index_position_resource.getText().toString().trim());//备注
|
|
|
+ object_1.put("dc_remark1", index_position_resource.getText().toString().trim());//备注
|
|
|
object_1.put("dc_actionresult", maintenanceType);
|
|
|
jsonArray.add(object_1);
|
|
|
jsonObject.put("formStore", jsonArray);
|
|
|
@@ -240,6 +556,7 @@ public class DeliveryForRepairFragment extends BaseFragment{
|
|
|
.addParam("caller", "DeviceChange!Repair")
|
|
|
.addParam("de_code",de_code)
|
|
|
.addParam("formStore",jsonArray.toString())
|
|
|
+ .addParam("param1",substring13)
|
|
|
.build(), new HttpCallback() {
|
|
|
@Override
|
|
|
public void onSuccess(int flag, Object o) throws Exception {
|
|
|
@@ -247,6 +564,15 @@ public class DeliveryForRepairFragment extends BaseFragment{
|
|
|
tv_prompt.setVisibility(View.VISIBLE);
|
|
|
tv_prompt.setTextColor(Color.GREEN);
|
|
|
tv_prompt.setText("提交成功");
|
|
|
+ ce_de_code.setText("");
|
|
|
+ ce_de_code.requestFocus();
|
|
|
+
|
|
|
+ mFilterStorageInBeans.clear();
|
|
|
+ setFilterTableData(mFilterStorageInBeans);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -255,6 +581,8 @@ public class DeliveryForRepairFragment extends BaseFragment{
|
|
|
tv_prompt.setVisibility(View.VISIBLE);
|
|
|
tv_prompt.setTextColor(Color.RED);
|
|
|
tv_prompt.setText(failStr);
|
|
|
+ ce_de_code.setText("");
|
|
|
+ ce_de_code.requestFocus();
|
|
|
// CommonUtil.toastNoRepeat(mActivity, failStr);
|
|
|
|
|
|
}
|
|
|
@@ -262,9 +590,131 @@ public class DeliveryForRepairFragment extends BaseFragment{
|
|
|
}
|
|
|
|
|
|
|
|
|
+ public void getNewconfirm_repair(){
|
|
|
+ progressDialog.show();
|
|
|
+ VollyRequest.getInstance().stringRequest(new HttpParams.Builder()
|
|
|
+ .url(GloableParams.ASTATIONTHE_SELECT_CONFIRM_REPAIR)
|
|
|
+ .method(Request.Method.GET)
|
|
|
+ .addParam("caller", "DeviceChange!Repair")
|
|
|
+ .addParam("de_code", de_code)//设备编号
|
|
|
+ .build(), new HttpCallback() {
|
|
|
|
|
|
+ @Override
|
|
|
+ public void onSuccess(int flag, Object o) throws Exception {
|
|
|
+ progressDialog.dismiss();
|
|
|
|
|
|
+ tv_prompt.setVisibility(View.VISIBLE);
|
|
|
+ tv_prompt.setTextColor(Color.GREEN);
|
|
|
+ tv_prompt.setText("确认已维修成功");
|
|
|
+ ce_de_code.setText("");
|
|
|
+ ce_de_code.requestFocus();
|
|
|
+ }
|
|
|
|
|
|
+ @Override
|
|
|
+ public void onFail(int flag, String failStr) throws Exception {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, failStr);
|
|
|
+ tv_prompt.setVisibility(View.VISIBLE);
|
|
|
+ tv_prompt.setTextColor(Color.RED);
|
|
|
+ tv_prompt.setText(failStr);
|
|
|
+ ce_de_code.setText("");
|
|
|
+ ce_de_code.requestFocus();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ public void addData(){
|
|
|
+ DeliceryListBean printListBean=new DeliceryListBean();
|
|
|
+ mFilterStorageInBeans.add(printListBean);
|
|
|
+ setFilterTableData(mFilterStorageInBeans);
|
|
|
+
|
|
|
+ }
|
|
|
+ private PopupWindow editPW;
|
|
|
+ private void initAddPopupWindow(List<DeliceryListBean> mList,int i,Column<String> column) {
|
|
|
+ View contView = LayoutInflater.from(mActivity).inflate(R.layout.index_edit_pup_change, null);
|
|
|
+ TextView tv_name = contView.findViewById(R.id.tv_name);
|
|
|
+ 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);
|
|
|
+ edit_et.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL);
|
|
|
+ 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(column.getColumnName());
|
|
|
+ edit_et.setHint(column.getColumnName());
|
|
|
+
|
|
|
+ //确定
|
|
|
+ sure_tv.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ if (edit_et.getText().toString().trim().isEmpty()){
|
|
|
+ CommonUtil.toastNoRepeat(mActivity,"请输入数据");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (column.getColumnName().equals("配件")){
|
|
|
+ mList.get(i).setDd_ordername(edit_et.getText().toString().trim());
|
|
|
+ }else if(column.getColumnName().equals("用量")){
|
|
|
+ mList.get(i).setDd_qty(edit_et.getText().toString().trim());
|
|
|
+ }
|
|
|
+
|
|
|
+ setFilterTableData(mList);
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ private void setFilterTableData(List<DeliceryListBean> filterTableData) {
|
|
|
+ mTableData = new TableData<DeliceryListBean>("收料单列表", filterTableData,
|
|
|
+ va_classColumn,va_qtyColumn);
|
|
|
+ mSmartTable.setTableData(mTableData);
|
|
|
+// mSmartTable.requestLayout();
|
|
|
+ mSmartTable.postDelayed(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ mSmartTable.postInvalidate();
|
|
|
+ }
|
|
|
+ }, 100);
|
|
|
+
|
|
|
+ }
|
|
|
+ @Override
|
|
|
+ public void onClick(Column<String> column, String value, String s, int position) {
|
|
|
+
|
|
|
+ if (column.getColumnName().equals("配件")){
|
|
|
+ initlinecodePopupWindow(mFilterStorageInBeans,position,column);
|
|
|
+
|
|
|
+ }else if(column.getColumnName().equals("用量")){
|
|
|
+ initAddPopupWindow(mFilterStorageInBeans,position,column);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
@@ -317,7 +767,7 @@ public class DeliveryForRepairFragment extends BaseFragment{
|
|
|
de_code=de_code1;
|
|
|
de_name=de_name1;
|
|
|
tv_de_code.setText(de_code1);
|
|
|
- tv_de_name.setText(de_name1);
|
|
|
+ tv_de_name.setText(""+de_name1);
|
|
|
getNewNameData();
|
|
|
}
|
|
|
|
|
|
@@ -346,4 +796,35 @@ public class DeliveryForRepairFragment extends BaseFragment{
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ private class IpAndlinecodePortAdapter extends BaseQuickAdapter<DeliveruSearchBean, BaseViewHolder> {
|
|
|
+ private List<DeliveruSearchBean> mmmmList;
|
|
|
+
|
|
|
+ public List<DeliveruSearchBean> getmList() {
|
|
|
+ return mmmmList;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setmList(List<DeliveruSearchBean> mList) {
|
|
|
+ this.mmmmList = mList;
|
|
|
+ }
|
|
|
+ public DeliveruSearchBean getBeanByPositon(int position){
|
|
|
+ return mmmmList.get(position);
|
|
|
+ }
|
|
|
+
|
|
|
+ private IpAndlinecodePortAdapter(@Nullable List<DeliveruSearchBean> data) {
|
|
|
+ super(R.layout.fuzzy_ipandport_item, data);
|
|
|
+ this.mmmmList = data;
|
|
|
+ }
|
|
|
+ @Override
|
|
|
+ protected void convert(BaseViewHolder helper, DeliveruSearchBean item) {
|
|
|
+ helper.setText(R.id.macode_ip__Tv,item.getPR_CODE()+"-"+item.getPR_DETAIL()+"-"+item.getPR_SPEC());
|
|
|
+ LinearLayout line_true = helper.itemView.findViewById(R.id.line_true);
|
|
|
+ if (item.getChecked()) {
|
|
|
+ line_true.setSelected(true);
|
|
|
+ } else {
|
|
|
+ line_true.setSelected(false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|