|
|
@@ -3,14 +3,27 @@ package com.uas.rd_equipment.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.rd_equipment.R;
|
|
|
import com.uas.rd_equipment.activity.FunctionActivity;
|
|
|
+import com.uas.rd_equipment.bean.DeliceryListBean;
|
|
|
+import com.uas.rd_equipment.bean.DeliveruSearchBean;
|
|
|
import com.uas.rd_equipment.camera.CaptureActivity;
|
|
|
import com.uas.rd_equipment.camera.CodeUtils;
|
|
|
import com.uas.rd_equipment.global.GloableParams;
|
|
|
@@ -34,10 +59,16 @@ import com.uas.rd_equipment.util.StringUtil;
|
|
|
import com.uas.rd_equipment.util.VollyRequest;
|
|
|
import com.uas.rd_equipment.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;
|
|
|
@@ -66,6 +97,17 @@ public class DeliveryForRepairFragment extends BaseFragment{
|
|
|
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;
|
|
|
|
|
|
@Override
|
|
|
protected int getLayout() {
|
|
|
@@ -92,6 +134,12 @@ 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);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
ce_de_code.requestFocus();
|
|
|
}
|
|
|
|
|
|
@@ -147,7 +195,13 @@ 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
|
|
|
@@ -170,16 +224,241 @@ public class DeliveryForRepairFragment extends BaseFragment{
|
|
|
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()
|
|
|
@@ -203,12 +482,14 @@ public class DeliveryForRepairFragment extends BaseFragment{
|
|
|
dc_remark = FastjsonUtil.getText(dataObject, "dc_remark");
|
|
|
dc_id = FastjsonUtil.getText(dataObject, "dc_id");
|
|
|
|
|
|
- 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);
|
|
|
+ index_position_malfunction.setText(""+ dc_reason);
|
|
|
+ index_position_resource.setText(""+ dc_remark);
|
|
|
+
|
|
|
+ index_position_malfunction.requestFocus();
|
|
|
|
|
|
|
|
|
}
|
|
|
@@ -232,6 +513,27 @@ public class DeliveryForRepairFragment extends BaseFragment{
|
|
|
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();
|
|
|
@@ -248,6 +550,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 {
|
|
|
@@ -257,6 +560,13 @@ public class DeliveryForRepairFragment extends BaseFragment{
|
|
|
tv_prompt.setText("提交成功");
|
|
|
ce_de_code.setText("");
|
|
|
ce_de_code.requestFocus();
|
|
|
+
|
|
|
+ mFilterStorageInBeans.clear();
|
|
|
+ setFilterTableData(mFilterStorageInBeans);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -306,9 +616,99 @@ public class DeliveryForRepairFragment extends BaseFragment{
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
@@ -361,7 +761,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();
|
|
|
}
|
|
|
|
|
|
@@ -390,4 +790,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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|