Jelajahi Sumber

增加物料发放模块

ChengJH 2 tahun lalu
induk
melakukan
2c168f509a

+ 4 - 0
app/src/main/java/com/uas/rd_equipment/activity/FunctionActivity.java

@@ -16,6 +16,7 @@ import com.uas.rd_equipment.R;
 import com.uas.rd_equipment.fragment.BaseFragment;
 import com.uas.rd_equipment.fragment.BreakdownRepairFragment;
 import com.uas.rd_equipment.fragment.DeliveryForRepairFragment;
+import com.uas.rd_equipment.fragment.DeviceProvisioningListFragment;
 import com.uas.rd_equipment.fragment.IndexSettingFragment;
 import com.uas.rd_equipment.fragment.MaintenanceManagementListFragment;
 import com.uas.rd_equipment.fragment.ProduceMassageBindingFragment;
@@ -99,6 +100,9 @@ public class FunctionActivity extends BaseActivity implements View.OnClickListen
                 case GloableParams.PRODUCTION_REMOULD_UNIT://设备改造
                     mFragment = new RemouIdRepairFragment();
                     break;
+                case GloableParams.PRODUCTION_REMOULD_GRAN://物料发放
+                    mFragment = new DeviceProvisioningListFragment();
+                    break;
                 case GloableParams.GRIDNAME_SETTING://设置
                     mFragment = new IndexSettingFragment();
 //                    mFragment = new CwShiFragment();

+ 4 - 0
app/src/main/java/com/uas/rd_equipment/activity/HomeActivity.java

@@ -334,6 +334,10 @@ public class HomeActivity extends BaseActivity implements AdapterView.OnItemClic
                 intent.putExtra(DataSourceManager.KEY_GRID_ITEMNAME, itemName);
                 startActivity(intent);
                 break;
+            case GloableParams.PRODUCTION_REMOULD_GRAN://设备发放
+                intent.putExtra(DataSourceManager.KEY_GRID_ITEMNAME, itemName);
+                startActivity(intent);
+                break;
             case GloableParams.GRIDNAME_SETTING://设置
                 intent.putExtra(DataSourceManager.KEY_GRID_ITEMNAME, itemName);
                 startActivity(intent);

+ 1059 - 0
app/src/main/java/com/uas/rd_equipment/fragment/AddEquipmentGrantFragment.java

@@ -0,0 +1,1059 @@
+package com.uas.rd_equipment.fragment;
+
+import android.annotation.SuppressLint;
+import android.app.Activity;
+import android.content.Intent;
+import android.graphics.Color;
+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.TextWatcher;
+import android.util.Log;
+import android.view.KeyEvent;
+import android.view.View;
+import android.view.WindowManager;
+import android.view.inputmethod.EditorInfo;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
+import android.widget.AutoCompleteTextView;
+import android.widget.Button;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.PopupWindow;
+import android.widget.RadioButton;
+import android.widget.RadioGroup;
+import android.widget.Spinner;
+import android.widget.TextView;
+
+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.LinecodeBean;
+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.global.GloableParams;
+import com.uas.rd_equipment.tools.SharedPreUtil;
+import com.uas.rd_equipment.util.CameraUtil;
+import com.uas.rd_equipment.util.CommonUtil;
+import com.uas.rd_equipment.util.Constants;
+import com.uas.rd_equipment.util.FastjsonUtil;
+import com.uas.rd_equipment.util.HttpCallback;
+import com.uas.rd_equipment.util.HttpParams;
+import com.uas.rd_equipment.util.LogUtil;
+import com.uas.rd_equipment.util.StringUtil;
+import com.uas.rd_equipment.util.VolleyRequest;
+import com.uas.rd_equipment.util.VollyRequest;
+import com.uas.rd_equipment.view.ClearableEditText;
+import com.uuzuche.lib_zxing.activity.CodeUtils;
+
+import org.json.JSONException;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Created by cjh on 2023-05-31
+ * cjh生产信息绑定
+ */
+public class AddEquipmentGrantFragment extends BaseFragment implements OnColumnItemClickListener<String>, View.OnClickListener ,AdapterView.OnItemSelectedListener{
+
+    private AutoCompleteTextView storage_recharge_collect_et;
+    private PopupWindow mMenuPopupWindow;
+    private Fragment mFragment;
+    private SmartTable mSmartTable;
+    private Column<String> va_classColumn,va_codeColumn,va_vendnameColumn,va_vendcodeColumn,va_inmancolumn,va_DELETEColumn;
+    private TableData<MakerecordBean> mTableData;
+    private List<MakerecordBean> mFilterStorageInBeans;
+    private ImageView mScanImageView;
+    private static final int SCAN_BARCODE_CODE = 111;
+    private static final int SCAN_ID_BARCODE_CODE = 890;
+    private static final int SCAN_BARCODE_CODESD = 925;
+    private int mFocusId;
+    private Button bt_add;
+    private AutoCompleteTextView et_linecode_smts;
+    private ImageView iocout_smts;
+    private TextView tv_pr_code;
+    private TextView tv_pr_detail;
+    private TextView tv_save;
+    private RadioGroup rg_change;
+    private RadioButton rb_equipment;
+    private RadioButton rb_fixture;
+    private RadioButton rb_ingredients;
+    private String rb_changetext = null;
+    private IpAndlinecodePortAdapter ipAndlinecodePortAdapter;
+    private String ma_code;
+    private List<LinecodeBean> linecodeBeanList;
+    private ClearableEditText edit_et;
+    private PopupWindow editPW;
+    private String adapterpr_code;
+    private String adapterpr_detail;
+    private IpAndResourcesPortAdapter ipAndResourcesPortAdapter;
+    private String sc_code;
+    private List<ResourcesBean> resourcesBeanList;
+    private AutoCompleteTextView tv_dc_emcode;
+    private ImageView iv_dc_emcode;
+    private TextView tv_dc_emname;
+    private String substring;
+    private TextView work_code_code;
+    Spinner masterSpinner;
+    static ArrayAdapter adapter;
+    private List<String> masterFuncList;
+    private String maFunName = null;
+    private ImageView shaopwork_id;
+    private List<String> stringList;
+    private Set<String> setstring;
+    private ImageView tv_dc_emcode_delete;
+    private List<User> list;
+    private TextView tv_grantcode;
+    private TextView tv_prompt;
+    private TextView tv_confirm_receipt;
+    private String dc_code;
+    private String dc_status;
+
+    @Override
+    protected int getLayout() {
+        return R.layout.addeqipmentgrant_fragment;
+    }
+
+    @Override
+    protected void initViews() {
+        FunctionActivity.setTitle(getString(R.string.addequipmentgrant));
+        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);
+        et_linecode_smts = root.findViewById(R.id.et_linecode_smts);
+        et_linecode_smts.setThreshold(1);
+        iocout_smts = root.findViewById(R.id.iocout_smts);
+        et_linecode_smts.setThreshold(1);
+        tv_pr_code = root.findViewById(R.id.tv_pr_code);
+        tv_pr_detail = root.findViewById(R.id.tv_pr_detail);
+        tv_save = root.findViewById(R.id.tv_save);
+        rg_change = root.findViewById(R.id.rg_change);
+        rb_equipment = root.findViewById(R.id.rb_equipment);
+        rb_fixture = root.findViewById(R.id.rb_fixture);
+        rb_ingredients = root.findViewById(R.id.rb_ingredients);
+        tv_dc_emcode = root.findViewById(R.id.tv_dc_emcode);
+        iv_dc_emcode = root.findViewById(R.id.iv_dc_emcode);
+        tv_dc_emname = root.findViewById(R.id.tv_dc_emname);
+        work_code_code = root.findViewById(R.id.work_code_code);
+        masterSpinner = (Spinner) root.findViewById(R.id.sp_login);
+        shaopwork_id = root.findViewById(R.id.shaopwork_id);
+        tv_dc_emcode_delete = root.findViewById(R.id.tv_dc_emcode_delete);
+        tv_grantcode = root.findViewById(R.id.tv_grantcode);
+        tv_prompt = root.findViewById(R.id.tv_prompt);
+        tv_confirm_receipt = root.findViewById(R.id.tv_confirm_receipt);
+
+
+    }
+
+    @Override
+    protected void initEvents() {
+        et_linecode_smts.requestFocus();
+        mFilterStorageInBeans = Collections.synchronizedList(new ArrayList<>());
+
+        Bundle arguments = getArguments();
+        if (arguments != null){
+            dc_code = arguments.getString("dc_code");
+            dc_status = arguments.getString("dc_status");
+            if (!StringUtil.isEmpty(dc_status)){
+                if (!dc_status.equals("在录入")){
+                    tv_save.setEnabled(false);
+                    tv_confirm_receipt.setEnabled(false);
+                    //扫码框
+                    storage_recharge_collect_et.setEnabled(false);
+                    storage_recharge_collect_et.setFocusable(false);
+                    storage_recharge_collect_et.setKeyListener(null);//重点
+                    //工单ID
+                    et_linecode_smts.setEnabled(false);
+                    et_linecode_smts.setFocusable(false);
+                    et_linecode_smts.setKeyListener(null);//重点
+                    // 人员编号
+                    tv_dc_emcode.setEnabled(false);
+                    tv_dc_emcode.setFocusable(false);
+                    tv_dc_emcode.setKeyListener(null);//重点
+
+                }
+            }
+        }
+
+
+        tv_grantcode.setText(dc_code);
+        getDatalistCodes("",work_code_code.getText().toString().trim());
+
+    }
+
+    @Override
+    protected void initDatas() {
+        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 % 2 == 0) {
+                            return ContextCompat.getColor(mActivity, R.color.blue_50);
+                        }
+                        return TableConfig.INVALID_COLOR;
+                    }
+                });
+
+
+
+        va_vendnameColumn = new Column<String>("设备编号", "MBR_BARCODE");
+        va_vendnameColumn.setFixed(true);
+        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_DELETEColumn = new Column<String>("操作", "MBR_DELETE");
+        va_DELETEColumn.setOnColumnItemClickListener(this);
+        mScanImageView.setOnClickListener(this);
+        shaopwork_id.setOnClickListener(this);
+        masterSpinner.setOnItemSelectedListener(this);
+        /**----------------------------------扫码框------------------------------**/
+        storage_recharge_collect_et.setOnEditorActionListener(new TextView.OnEditorActionListener() {
+            @Override
+            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
+                if (actionId == EditorInfo.IME_ACTION_DONE
+                        || actionId == EditorInfo.IME_ACTION_SEND
+                        || (event != null && event.getAction() == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
+                    getsaVeData();
+                    return true;
+                }
+                return false;
+            }
+        });
+        linecodeBeanList = new ArrayList<>();
+
+
+        /**----------------------------------工单ID------------------------------**/
+        ipAndlinecodePortAdapter=new IpAndlinecodePortAdapter(linecodeBeanList);
+        et_linecode_smts.setOnEditorActionListener(new TextView.OnEditorActionListener() {
+            @Override
+            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
+                if (actionId == EditorInfo.IME_ACTION_DONE
+                        || actionId == EditorInfo.IME_ACTION_SEND
+                        || (event != null && event.getAction() == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
+                    String va_code = et_linecode_smts.getText().toString().trim();
+                    getfuzzySearchData(va_code,"");
+                    return true;
+                }
+                return false;
+            }
+        });
+
+        et_linecode_smts.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 (s == null || s.length() == 0) {
+                    iocout_smts.setVisibility(View.GONE);
+                } else {
+                    iocout_smts.setVisibility(View.VISIBLE);
+                }
+            }
+        });
+
+
+        iocout_smts.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                et_linecode_smts.setText("");
+                et_linecode_smts.requestFocus();
+            }
+        });
+
+        rg_change.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
+            @SuppressLint("NonConstantResourceId")
+            @Override
+            public void onCheckedChanged(RadioGroup radioGroup, int checkid) {
+                switch (checkid){
+                    case R.id.rb_equipment:
+                        rb_changetext = "设备";
+                        getDatalistCodes("",work_code_code.getText().toString().trim());
+                        break;
+                    case R.id.rb_fixture:
+                        rb_changetext = "夹具";
+                        getDatalistCodes("",work_code_code.getText().toString().trim());
+                        break;
+                    case R.id.rb_ingredients:
+                        rb_changetext = "辅料";
+                        getDatalistCodes("",work_code_code.getText().toString().trim());
+                        break;
+
+
+                }
+            }
+        });
+
+        tv_save.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+
+
+//                getDatalistCodes(ce_resources.getText().toString().trim(),work_code_code.getText().toString().trim());
+                getNewCommitData();
+
+            }
+        });
+        tv_confirm_receipt.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                getOKTconfirmReceipt();
+            }
+        });
+        stringList = new ArrayList<>();
+        setstring = new HashSet<>();
+        //人员编号
+        tv_dc_emcode.setOnEditorActionListener(new TextView.OnEditorActionListener() {
+            @Override
+            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
+                if (actionId == EditorInfo.IME_ACTION_DONE
+                        || actionId == EditorInfo.IME_ACTION_SEND
+                        || (event != null && event.getAction() == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
+                    String dc_emcode = tv_dc_emcode.getText().toString().trim();
+                    getNewdc_emcodeData(dc_emcode);
+                    return true;
+                }
+                return false;
+            }
+        });
+
+        tv_dc_emcode.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 (s == null || s.length() == 0) {
+                    tv_dc_emcode_delete.setVisibility(View.GONE);
+                } else {
+                    tv_dc_emcode_delete.setVisibility(View.VISIBLE);
+                }
+            }
+        });
+
+        tv_dc_emcode_delete.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                tv_dc_emcode.setText("");
+                tv_dc_emcode.requestFocus();
+
+            }
+        });
+
+        iv_dc_emcode.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                tv_dc_emcode.requestFocus();
+                if (CameraUtil.hasCamera()) {
+                    if (root.findFocus() != null) {
+                        mFocusId = root.findFocus().getId();
+                        Intent intent = new Intent();
+                        intent.setClass(mActivity, CaptureActivity.class);
+                        startActivityForResult(intent, SCAN_BARCODE_CODESD);
+                        SharedPreUtil.saveString(mActivity, Constants.STORAGEERECHADD, "NO");
+                    } else {
+                        CommonUtil.toastNoRepeat(mActivity, "请选择您要操作的输入框");
+                    }
+                } else {
+                    CommonUtil.toastNoRepeat(mActivity, getString(R.string.no_camera_detected));
+                }
+            }
+        });
+
+        masterFuncList = new ArrayList<String>();
+        getworkshopData();
+//        ceshiData();
+    }
+
+    String inputString ="" ;
+    public void getNewdc_emcodeData(String input){
+
+        if (input.isEmpty()){
+            CommonUtil.toastNoRepeat(mActivity, "请输入人员编号");
+            return;
+        }
+        list = new ArrayList<>();
+        list.clear();
+        String[] split = input.split(",");
+
+        for (String value : split) {
+            User user=new User();
+            if (!value.isEmpty()) {
+                user.setName(value + ",");
+                list.add(user);
+            }
+
+        }
+
+        for (int i = 0; i < list.size(); i++)  //外循环是循环的次数
+        {
+            for (int j = list.size() - 1; j > i; j--)  //内循环是 外循环一次比较的次数
+            {
+                if (list.get(i).getName().equals(list.get(j).getName()))
+                {
+                    list.remove(j);
+                }
+
+            }
+        }
+
+        for (int s = 0; s < list.size(); s++) {
+            inputString+= list.get(s).getName();
+        }
+        progressDialog.show();
+        VollyRequest.getInstance().stringRequest(new HttpParams.Builder()
+                .url(GloableParams.ASTATIONTHE_SELECT_GETEMNAME)
+                .method(Request.Method.GET)
+                .addParam("em_code",inputString)
+                .build(), new HttpCallback() {
+            @Override
+            public void onSuccess(int flag, Object o) throws Exception {//DeviceChange!Use
+                progressDialog.dismiss();
+                String result = o.toString();
+                JSONObject resultObject = JSON.parseObject(result);
+                JSONObject dataObject = resultObject.getJSONObject("items");
+                String de_name = FastjsonUtil.getText(dataObject, "em_name");
+                tv_dc_emname.setText(de_name);
+                tv_dc_emcode.setText(inputString+"");
+                tv_dc_emcode.setSelection(tv_dc_emcode.getText().toString().length());
+                inputString="";
+            }
+
+            @Override
+            public void onFail(int flag, String failStr) throws Exception {
+                progressDialog.dismiss();
+                inputString="";
+                CommonUtil.toastNoRepeat(mActivity, failStr);
+                for (int s = 0; s < list.size(); s++) {
+                    if (failStr.contains(list.get(s).getName().replace(",",""))){
+                        list.remove(s);
+                    }
+                }
+                for (int s = 0; s < list.size(); s++) {
+                    inputString+= list.get(s).getName();
+                }
+                tv_dc_emcode.setText(inputString+"");
+                tv_dc_emcode.setSelection(tv_dc_emcode.getText().toString().length());
+                inputString="";
+            }
+        });
+    }
+
+
+    public static List<String> removeDuplicate(List<String> list)
+
+    {
+        Set set = new LinkedHashSet<String>();
+        set.addAll(list);
+        list.clear();
+        list.addAll(set);
+        return list;
+    }
+
+    /**
+     * 得到去除重复后的集合
+     * @param list
+     * @return
+     */
+    private static List<User> getRemoveList(List<User> list){
+        Set set = new HashSet();
+        List<User> newList = new ArrayList<>();
+        for (Iterator iter = list.iterator(); iter.hasNext();){
+            User object = (User) iter.next();
+            if(set.add(object))
+                newList.add(object);
+        }
+        return newList;
+    }
+    //工单ID
+    public void getfuzzySearchData(String inoutNo,String stop){
+        progressDialog.show();
+        VollyRequest.getInstance().stringRequest(new HttpParams.Builder()
+                .url(GloableParams.ADDRESS_SMT_FUZZY_SEARCH)
+                .method(Request.Method.GET)
+                .addParam("inoutNo", 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();
+                    org.json.JSONObject resultObject = new org.json.JSONObject(s);
+                    org.json.JSONArray dataArray = resultObject.optJSONArray("data");
+                    JSONArray dataArrayone = FastjsonUtil.getJSONArray(o.toString(),"data");
+                    if (dataArrayone == null|| dataArrayone.size() == 0){
+                        CommonUtil.toastNoRepeat(mActivity,"未搜索到匹配数据");
+                    }
+                    for(Object index:dataArrayone){
+                        JSONObject data = (JSONObject) index;
+                        LinecodeBean bean = new LinecodeBean();
+                        bean.setMA_CODE(data.getString("MA_CODE"));
+                        bean.setPR_CODE(data.getString("PR_CODE"));
+                        bean.setPR_DETAIL(data.getString("PR_DETAIL"));
+                        bean.setMA_WCCODE(data.getString("MA_WCCODE"));
+                        tv_pr_code.setText(""+data.getString("PR_CODE"));
+                        tv_pr_detail.setText("产品名称  "+data.getString("PR_DETAIL"));
+                        work_code_code.setText(""+data.getString("MA_CODE"));
+                        linecodeBeanList.add(bean);
+                        CommonUtil.setSpinnerItemSelectedByValue(masterSpinner, data.getString("MA_WCCODE"));
+                    }
+                    ipAndlinecodePortAdapter.setmList(linecodeBeanList);
+                    ipAndlinecodePortAdapter.notifyDataSetChanged();
+                    if (!stop.equals("stop")){
+                        getDatalistCodes("",work_code_code.getText().toString().trim());
+                    }
+
+                } catch (JSONException e) {
+                    e.printStackTrace();
+                }
+            }
+
+            @Override
+            public void onFail(int flag, String failStr) throws Exception {
+                progressDialog.dismiss();
+                CommonUtil.toastNoRepeat(mActivity, failStr);
+
+            }
+        });
+    }
+
+    public void getworkshopData(){
+        VollyRequest.getInstance().stringRequest(new HttpParams.Builder()
+                .url(GloableParams.ASTATIONTHE_SELECT_GETWORKCENTER)
+                .method(Request.Method.GET)
+                .build(), new HttpCallback() {
+            @Override
+            public void onSuccess(int flag, Object o) throws Exception {
+                progressDialog.dismiss();
+
+                try {
+                    masterFuncList.clear();
+                    JSONArray dataArrayone = FastjsonUtil.getJSONArray(o.toString(),"items");
+                    if (dataArrayone == null|| dataArrayone.size() == 0){
+                        CommonUtil.toastNoRepeat(mActivity,"未搜索到匹配数据");
+                    }
+                    for(Object index:dataArrayone){
+                        JSONObject data = (JSONObject) index;
+                        masterFuncList.add(data.getString("WC_NAME"));
+                    }
+
+                    adapter = new ArrayAdapter(mActivity, R.layout.item_spinner, R.id.text_spinner, masterFuncList);
+                    masterSpinner.setAdapter(adapter);
+
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+
+            @Override
+            public void onFail(int flag, String failStr) throws Exception {
+                progressDialog.dismiss();
+                CommonUtil.toastNoRepeat(mActivity, failStr);
+
+            }
+        });
+    }
+
+    @Override
+    public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
+        //获得master的name
+        maFunName = masterFuncList.get(position);
+        LogUtil.i("maname",maFunName);
+    }
+
+    @Override
+    public void onNothingSelected(AdapterView<?> parent) {
+
+    }
+
+
+    private void getDatalistCodes(String decode,String macode){
+        if (rb_equipment.isChecked()){
+            rb_changetext="设备";
+        }
+        progressDialog.show();
+        VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
+                .url(GloableParams.ASTATIONTHE_SELECT_GRANt)
+                .method(Request.Method.GET)
+                .tag(TAG + "getindatalist")
+                .flag(0)
+                .addParam("macode", macode)
+                .addParam("dc_code", tv_grantcode.getText().toString().trim())
+                .addParam("type", rb_changetext)
+                .build(), new HttpCallback() {
+            @Override
+            public void onSuccess(int flag, Object o) throws Exception {
+                progressDialog.dismiss();
+                try {
+                    mFilterStorageInBeans.clear();
+                    String result = o.toString();
+                    JSONObject resultObject = JSON.parseObject(result);
+                    JSONArray dataArray = resultObject.getJSONArray("success");
+                    List<MakerecordBean> list=new ArrayList<>();
+                    list.clear();
+                    if (dataArray != null && dataArray.size() > 0) {
+                        for (int i = 0; i < dataArray.size(); i++) {
+                            JSONObject dataObject = dataArray.getJSONObject(i);
+                            if (dataObject != null) {
+                                MakerecordBean jltStorageInBean = new MakerecordBean();
+                                jltStorageInBean.setMBR_ID(FastjsonUtil.getText(dataObject, "MBR_ID"));
+                                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_SOURCECODE(FastjsonUtil.getText(dataObject, "MBR_SOURCECODE"));
+                                jltStorageInBean.setMBR_TYPE(FastjsonUtil.getText(dataObject, "MBR_TYPE"));
+                                if (!StringUtil.isEmpty(FastjsonUtil.getText(dataObject, "MBR_INDATE"))){
+                                    String mbr_indate = timetodate(FastjsonUtil.getText(dataObject, "MBR_INDATE"));
+                                    jltStorageInBean.setMBR_INDATE(mbr_indate);
+                                }else {
+                                    jltStorageInBean.setMBR_INDATE("");
+                                }
+                                if (!StringUtil.isEmpty(FastjsonUtil.getText(dataObject, "MBR_MAKECODE"))){
+                                    getfuzzySearchData(FastjsonUtil.getText(dataObject, "MBR_MAKECODE"),"stop");
+                                }
+
+                                jltStorageInBean.setPR_DETAIL(FastjsonUtil.getText(dataObject, "PR_DETAIL"));
+                                jltStorageInBean.setMBR_INMAN(FastjsonUtil.getText(dataObject, "MBR_INMAN"));
+                                jltStorageInBean.setMBR_DELETE("删除");
+                                list.add(jltStorageInBean);
+                            }
+                        }
+                    }
+
+                    mFilterStorageInBeans = list;//PI_INOUTNO
+                    setFilterTableData(mFilterStorageInBeans);
+                    progressDialog.dismiss();
+
+                } catch (Exception e) {
+                    e.printStackTrace();
+                    progressDialog.dismiss();
+                }
+
+            }
+
+            @Override
+            public void onFail(int flag, String failStr) throws Exception {
+                progressDialog.dismiss();
+                CommonUtil.toastNoRepeat(mActivity, failStr);
+
+                setFilterTableData(mFilterStorageInBeans);
+                progressDialog.dismiss();
+            }
+        });
+    }
+
+    public static String timetodate(String time) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTimeInMillis(Long.valueOf(time));
+        SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//这里的格式可换"yyyy年-MM月dd日-HH时mm分ss秒"等等格式
+
+        String date = sf.format(calendar.getTime());
+        return date;
+
+    }
+    public void geDeleteData(String mbr_id){
+        VollyRequest.getInstance().stringRequest(new HttpParams.Builder()
+                .url(GloableParams.ASTATIONTHE_SELECT_DELETEMAKERECORD)
+                .method(Request.Method.GET)
+                .addParam("mbr_id", mbr_id)
+                .build(), new HttpCallback() {
+            @Override
+            public void onSuccess(int flag, Object o) throws Exception {
+                progressDialog.dismiss();
+                CommonUtil.toastNoRepeat(mActivity, "删除成功");
+                getDatalistCodes("",work_code_code.getText().toString().trim());
+            }
+
+            @Override
+            public void onFail(int flag, String failStr) throws Exception {
+                progressDialog.dismiss();
+                CommonUtil.toastNoRepeat(mActivity, failStr);
+
+            }
+        });
+    }
+
+    public void getsaVeData(){
+        if (rb_equipment.isChecked()){
+            rb_changetext="设备";
+        }
+        if (rb_fixture.isChecked()){
+            rb_changetext="夹具";
+        }
+        if (rb_ingredients.isChecked()){
+            rb_changetext="辅料";
+        }
+        String tv_grantcodetrim = tv_grantcode.getText().toString().trim();
+        if (tv_grantcodetrim.isEmpty()){
+            CommonUtil.toastNoRepeat(mActivity, "单据编号为空");
+            return;
+        }
+
+        String ce_work_codetrim = work_code_code.getText().toString().trim();
+        if (ce_work_codetrim.isEmpty()){
+            CommonUtil.toastNoRepeat(mActivity, "请选择工单号");
+            return;
+        }
+        JSONArray jsonArray = new JSONArray();
+        JSONObject object_1 = new JSONObject();
+        object_1.put("MBR_MAKECODE", ce_work_codetrim);//工单号
+        object_1.put("MBR_TYPE", rb_changetext);//设备\夹具\辅料
+        object_1.put("MBR_PRODCODE", tv_pr_code.getText());//产品编号
+        object_1.put("MBR_INMAN", tv_dc_emname.getText());//人员名称
+        object_1.put("MBR_BARCODE", storage_recharge_collect_et.getText().toString().trim());
+        object_1.put("MBR_DCCODE", tv_grantcode.getText().toString().trim());
+        object_1.put("MBR_WCCODE", maFunName);
+        jsonArray.add(object_1);
+        String substring = jsonArray.toString().substring(0, jsonArray.toString().length() - 1);//去除尾部
+        String substring1 = substring.substring(1, substring.length());//去除首部
+        Log.e("jsonArray===",substring1);
+
+
+        progressDialog.show();
+        VollyRequest.getInstance().stringRequest(new HttpParams.Builder()
+                .url(GloableParams.ASTATIONTHE_SELECT_SAVEMAKERECORD)//ASTATIONTHE_COMMIT_MAINITEM
+                .method(Request.Method.GET)
+                .addParam("datainto", substring1)
+                .build(), new HttpCallback() {
+            @Override
+            public void onSuccess(int flag, Object o) throws Exception {
+                progressDialog.dismiss();
+                getDatalistCodes("",work_code_code.getText().toString().trim());
+                CommonUtil.toastNoRepeat(mActivity, "保存成功");
+                storage_recharge_collect_et.setText("");
+            }
+
+            @Override
+            public void onFail(int flag, String failStr) throws Exception {
+                progressDialog.dismiss();
+                CommonUtil.toastNoRepeat(mActivity, failStr);
+                storage_recharge_collect_et.setText("");
+
+            }
+        });
+    }
+
+
+
+
+    public void getNewCommitData(){
+        progressDialog.show();
+        VollyRequest.getInstance().stringRequest(new HttpParams.Builder()
+                .url(GloableParams.ASTATIONTHE_COMMIT_MAINITEM)
+                .method(Request.Method.GET)
+                .addParam("caller","DeviceChange!Release")
+                .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("提交成功");
+                String result = o.toString();
+                JSONObject resultObject = JSON.parseObject(result);
+                JSONObject dataObject = resultObject.getJSONObject("items");
+                String de_name = FastjsonUtil.getText(dataObject, "dc_code");
+                tv_grantcode.setText(de_name);
+            }
+
+            @Override
+            public void onFail(int flag, String failStr) throws Exception {
+                progressDialog.dismiss();
+                tv_prompt.setVisibility(View.VISIBLE);
+                tv_prompt.setTextColor(Color.RED);
+                tv_prompt.setText(failStr);
+//                CommonUtil.toastNoRepeat(mActivity, failStr);
+
+            }
+        });
+    }
+
+    //确认领用
+    public void getOKTconfirmReceipt(){
+        progressDialog.show();
+        VollyRequest.getInstance().stringRequest(new HttpParams.Builder()
+                .url(GloableParams.ASTATIONTHE_SELECT_CONFIRMUSE)
+                .method(Request.Method.GET)
+                .addParam("caller","DeviceChange!Release")
+                .addParam("dc_code",tv_grantcode.getText().toString().trim())
+                .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("领用成功");
+                String result = o.toString();
+                JSONObject resultObject = JSON.parseObject(result);
+                JSONObject dataObject = resultObject.getJSONObject("items");
+                String de_name = FastjsonUtil.getText(dataObject, "dc_code");
+                tv_grantcode.setText(de_name);
+            }
+
+            @Override
+            public void onFail(int flag, String failStr) throws Exception {
+                progressDialog.dismiss();
+                tv_prompt.setVisibility(View.VISIBLE);
+                tv_prompt.setTextColor(Color.RED);
+                tv_prompt.setText(failStr);
+//                CommonUtil.toastNoRepeat(mActivity, failStr);
+
+            }
+        });
+    }
+
+
+
+
+    private void setFilterTableData(List<MakerecordBean> filterTableData) {
+        mTableData = new TableData<MakerecordBean>("收料单列表", filterTableData,
+                va_vendnameColumn,va_vendcodeColumn,va_codeColumn,va_inmancolumn,va_classColumn,va_DELETEColumn);
+        mSmartTable.setTableData(mTableData);
+//        mSmartTable.requestLayout();
+        mSmartTable.postDelayed(new Runnable() {
+            @Override
+            public void run() {
+                mSmartTable.postInvalidate();
+            }
+        }, 100);
+
+    }
+
+
+    private class IpAndlinecodePortAdapter extends BaseQuickAdapter<LinecodeBean, BaseViewHolder> {
+        private List<LinecodeBean> mmmmList;
+
+        public List<LinecodeBean> getmList() {
+            return mmmmList;
+        }
+
+        public void setmList(List<LinecodeBean> mList) {
+            this.mmmmList = mList;
+        }
+        public LinecodeBean getBeanByPositon(int position){
+            return mmmmList.get(position);
+        }
+
+        private IpAndlinecodePortAdapter(@Nullable List<LinecodeBean> data) {
+            super(R.layout.fuzzy_ipandport_item, data);
+            this.mmmmList = data;
+        }
+        @Override
+        protected void convert(BaseViewHolder helper, LinecodeBean item) {
+            helper.setText(R.id.macode_ip__Tv,item.getMA_CODE()+"-"+item.getPR_CODE()+"-"+item.getPR_DETAIL());
+            LinearLayout line_true = helper.itemView.findViewById(R.id.line_true);
+            if (item.getChecked()) {
+                line_true.setSelected(true);
+            } else {
+                line_true.setSelected(false);
+            }
+        }
+    }
+
+    private class IpAndResourcesPortAdapter extends BaseQuickAdapter<ResourcesBean, BaseViewHolder> {
+        private List<ResourcesBean> mmmmList;
+
+        public List<ResourcesBean> getmList() {
+            return mmmmList;
+        }
+
+        public void setmList(List<ResourcesBean> mList) {
+            this.mmmmList = mList;
+        }
+        public ResourcesBean getBeanByPositon(int position){
+            return mmmmList.get(position);
+        }
+
+        private IpAndResourcesPortAdapter(@Nullable List<ResourcesBean> data) {
+            super(R.layout.fuzzy_ipandport_item, data);
+            this.mmmmList = data;
+        }
+        @Override
+        protected void convert(BaseViewHolder helper, ResourcesBean item) {
+            helper.setText(R.id.macode_ip__Tv,item.getSC_CODE());
+            LinearLayout line_true = helper.itemView.findViewById(R.id.line_true);
+            if (item.getChecked()) {
+                line_true.setSelected(true);
+            } else {
+                line_true.setSelected(false);
+            }
+        }
+    }
+
+
+
+
+
+
+    @Override
+    public boolean onKeyDown(int keyCode, KeyEvent event) {
+        return false;
+    }
+
+    @Override
+    public boolean onFragmentBackPressed() {
+        return false;
+    }
+    @Override
+    public void onHiddenChanged(boolean hidden) {
+        super.onHiddenChanged(hidden);
+        if (hidden) {
+            ((FunctionActivity) getActivity()).setMoreBtnVisible(false);
+            ((FunctionActivity) getActivity()).setListIconIvVisible(false);
+        } else {
+            FunctionActivity.setTitle(getString(R.string.addequipmentgrant));
+            ((FunctionActivity) getActivity()).setMoreBtnVisible(true);
+            ((FunctionActivity) getActivity()).setListIconIvVisible(false);
+        }
+    }
+
+    @Override
+    public void onClick(Column<String> column, String value, String s, int position) {
+        String dc_id = mFilterStorageInBeans.get(position).getMBR_ID();
+        geDeleteData(dc_id);
+    }
+
+    @Override
+    public void onDestroyView() {
+        super.onDestroyView();
+        ((FunctionActivity) getActivity()).setMoreBtnVisible(false);
+        ((FunctionActivity) getActivity()).setListIconIvVisible(false);
+        CommonUtil.closeKeybord(storage_recharge_collect_et, mActivity);
+        ((TextView) (getActivity().findViewById(R.id.tv_actionbar_withback))).setText(getString(R.string.addequipmentgrant));
+    }
+
+    @Override
+    public void onClick(View v) {
+        switch (v.getId()) {
+            case R.id.storage_recharge_scan_iv:
+                storage_recharge_collect_et.requestFocus();
+                if (CameraUtil.hasCamera()) {
+                    if (root.findFocus() != null) {
+                        mFocusId = root.findFocus().getId();
+                        Intent intent = new Intent();
+                        intent.setClass(mActivity, CaptureActivity.class);
+                        startActivityForResult(intent, SCAN_BARCODE_CODE);
+                    } else {
+                        CommonUtil.toastNoRepeat(mActivity, "请选择您要操作的输入框");
+                    }
+                } else {
+                    CommonUtil.toastNoRepeat(mActivity, getString(R.string.no_camera_detected));
+                }
+                break;
+            case R.id.shaopwork_id:
+                et_linecode_smts.requestFocus();
+                if (CameraUtil.hasCamera()) {
+                    if (root.findFocus() != null) {
+                        mFocusId = root.findFocus().getId();
+                        Intent intent = new Intent();
+                        intent.setClass(mActivity, CaptureActivity.class);
+                        startActivityForResult(intent, SCAN_ID_BARCODE_CODE);
+                    } else {
+                        CommonUtil.toastNoRepeat(mActivity, "请选择您要操作的输入框");
+                    }
+                } else {
+                    CommonUtil.toastNoRepeat(mActivity, getString(R.string.no_camera_detected));
+                }
+                break;
+        }
+    }
+
+    @Override
+    public void onActivityResult(int requestCode, int resultCode, Intent data) {
+        super.onActivityResult(requestCode, resultCode, data);
+        if (resultCode != Activity.RESULT_OK) {
+            return;
+        }
+
+        if (requestCode == SCAN_BARCODE_CODE && data != null) {
+            if (data.getExtras() != null) {
+                String result = data.getExtras().getString(CodeUtils.RESULT_STRING);
+                if (mFocusId == R.id.storage_recharge_collect_et) {
+                    storage_recharge_collect_et.setText(result);
+                    storage_recharge_collect_et.setSelection(result.length());
+                    getsaVeData();
+                }
+            }
+        }
+        if (requestCode == SCAN_ID_BARCODE_CODE && data != null) {
+            if (data.getExtras() != null) {
+                String result = data.getExtras().getString(CodeUtils.RESULT_STRING);
+                if (mFocusId == R.id.et_linecode_smts) {
+                    et_linecode_smts.setText(result);
+                    et_linecode_smts.setSelection(result.length());
+                    getfuzzySearchData(result,"");
+                }
+            }
+        }
+        if (requestCode == SCAN_BARCODE_CODESD && data != null) {
+            if (data.getExtras() != null) {
+                String result = data.getExtras().getString(com.uas.rd_equipment.camera.CodeUtils.RESULT_STRING);
+                if (mFocusId == R.id.tv_dc_emcode) {
+//                    tv_dc_emcode.setText(result);
+
+                    getNewdc_emcodeData(result);
+                }
+            }
+        }
+    }
+
+    @Override
+    public void onDestroy() {
+        super.onDestroy();;
+    }
+}

+ 411 - 0
app/src/main/java/com/uas/rd_equipment/fragment/DeviceProvisioningListFragment.java

@@ -0,0 +1,411 @@
+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.v4.app.Fragment;
+import android.support.v4.content.ContextCompat;
+import android.view.KeyEvent;
+import android.view.View;
+import android.view.WindowManager;
+import android.view.inputmethod.EditorInfo;
+import android.widget.Button;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.PopupWindow;
+import android.widget.TextView;
+
+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.scwang.smartrefresh.layout.api.RefreshLayout;
+import com.scwang.smartrefresh.layout.listener.OnLoadMoreListener;
+import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
+import com.uas.rd_equipment.R;
+import com.uas.rd_equipment.activity.FunctionActivity;
+import com.uas.rd_equipment.bean.MessageOutboundEvents;
+import com.uas.rd_equipment.bean.OutboundListBean;
+import com.uas.rd_equipment.camera.CaptureActivity;
+import com.uas.rd_equipment.global.GloableParams;
+import com.uas.rd_equipment.tools.SharedPreUtil;
+import com.uas.rd_equipment.util.CameraUtil;
+import com.uas.rd_equipment.util.CommonUtil;
+import com.uas.rd_equipment.util.Constants;
+import com.uas.rd_equipment.util.FastjsonUtil;
+import com.uas.rd_equipment.util.FragmentUtils;
+import com.uas.rd_equipment.util.HttpCallback;
+import com.uas.rd_equipment.util.HttpParams;
+import com.uas.rd_equipment.util.VolleyRequest;
+import com.uas.rd_equipment.view.ClearableEditText;
+import com.uuzuche.lib_zxing.activity.CodeUtils;
+
+import org.greenrobot.eventbus.EventBus;
+import org.greenrobot.eventbus.Subscribe;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * Created by cjh on 2022-10-15
+ */
+public class DeviceProvisioningListFragment extends BaseFragment implements OnColumnItemClickListener<String>, View.OnClickListener {
+
+    private ClearableEditText storage_recharge_collect_et;
+    private PopupWindow mMenuPopupWindow;
+    private Fragment mFragment;
+    private RefreshLayout mRefreshLayout;
+    private SmartTable mSmartTable;
+    private Column<String> va_classColumn,va_codeColumn,va_statusColumn,va_vendnameColumn,va_vendcodeColumn;
+    private TableData<OutboundListBean> mTableData;
+    private int mPageIndex = 1, mPageSize = 20;
+    private List<OutboundListBean> mFilterStorageInBeans;
+    private ImageView mScanImageView;
+    private Button mMenuButton;
+    private static final int SCAN_BARCODE_CODE = 111;
+    private int mFocusId;
+    private Button bt_add;
+
+    @Override
+    protected int getLayout() {
+        return R.layout.maintenance_managementlsit_fragment;
+    }
+
+    @Override
+    protected void initViews() {
+        FunctionActivity.setTitle(getString(R.string.grant_list));
+        ((FunctionActivity) getActivity()).setMoreBtnVisible(true);
+        ((FunctionActivity) getActivity()).setListIconIvVisible(false);
+        storage_recharge_collect_et = mActivity.findViewById(R.id.storage_recharge_collect_et);
+        mRefreshLayout = mActivity.findViewById(R.id.pda_wms_in_filter_list_srl);
+        mSmartTable = mActivity.findViewById(R.id.jlt_storage_in_filter_list_st);
+        mScanImageView = (ImageView) mActivity.findViewById(R.id.storage_recharge_scan_iv);
+        mMenuButton = (Button) mActivity.findViewById(R.id.btn_actionbar_more);
+
+    }
+
+    @Override
+    protected void initEvents() {
+
+        storage_recharge_collect_et.requestFocus();
+        storage_recharge_collect_et.setOnEditorActionListener(new TextView.OnEditorActionListener() {
+            @Override
+            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
+                if (actionId == EditorInfo.IME_ACTION_DONE
+                        || actionId == EditorInfo.IME_ACTION_SEND
+                        || (event != null && event.getAction() == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
+                    String va_code = storage_recharge_collect_et.getText().toString().trim();
+                    getDatalistCodes(va_code);
+                    return true;
+                }
+                return false;
+            }
+        });
+        mFilterStorageInBeans = Collections.synchronizedList(new ArrayList<>());
+
+        initPopupWindow();
+        getDatalistCodes(storage_recharge_collect_et.getText().toString().trim());
+    }
+
+    @Override
+    protected void initDatas() {
+        if (!EventBus.getDefault().isRegistered(this)) {
+            EventBus.getDefault().register(this);
+        }
+        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 % 2 == 0) {
+                            return ContextCompat.getColor(mActivity, R.color.blue_50);
+                        }
+                        return TableConfig.INVALID_COLOR;
+                    }
+                });
+
+
+
+        va_classColumn = new Column<String>("单据编号", "DC_CODE");
+        va_classColumn.setFixed(true);
+        va_codeColumn = new Column<String>("日期", "DC_INDATE");
+        va_statusColumn = new Column<String>("状态", "DC_STATUS");
+        va_vendnameColumn = new Column<String>("设备编号", "DC_DEVCODE");
+        va_vendcodeColumn = new Column<String>("名称", "DC_DEVNAME");
+        va_vendcodeColumn = new Column<String>("线别", "DC_LINECODE");
+
+        va_classColumn.setOnColumnItemClickListener(this);
+        va_codeColumn.setOnColumnItemClickListener(this);
+        va_statusColumn.setOnColumnItemClickListener(this);
+        va_vendnameColumn.setOnColumnItemClickListener(this);
+        va_vendcodeColumn.setOnColumnItemClickListener(this);
+        mScanImageView.setOnClickListener(this);
+        mMenuButton.setOnClickListener(this);
+
+        mRefreshLayout.setOnRefreshListener(new OnRefreshListener() {
+            @Override
+            public void onRefresh(RefreshLayout refreshLayout) {
+                mPageIndex = 1;
+                getDatalistCodes("");
+            }
+        });
+
+        mRefreshLayout.setOnLoadMoreListener(new OnLoadMoreListener() {
+            @Override
+            public void onLoadMore(RefreshLayout refreshLayout) {
+                mPageIndex++;
+                getDatalistCodes("");
+            }
+        });
+
+//        ceshiData();
+    }
+    private void getDatalistCodes(String pi_inoutno){
+        String em_name = SharedPreUtil.getString(mActivity, Constants.FLAG.CACHE_USER_EMNAME, null);
+        String em_code = SharedPreUtil.getString(mActivity, Constants.FLAG.CACHE_USER_EMCODE, null);
+        VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
+                .url(GloableParams.ASTATIONTHE_SELECT_FUZZSERACHLINELIST)
+                .method(Request.Method.GET)
+                .tag(TAG + "getindatalist")
+                .flag(0)
+                .addParam("em_code",em_code)
+                .addParam("em_name",em_name)
+                .addParam("code",pi_inoutno)
+                .addParam("caller","DeviceChange!Release")
+                .addParam("page",mPageIndex+"")
+                .addParam("pageSize",mPageSize+"")
+                .build(), new HttpCallback() {
+            @Override
+            public void onSuccess(int flag, Object o) throws Exception {
+                progressDialog.dismiss();
+                try {
+                    mFilterStorageInBeans.clear();
+                    String result = o.toString();
+                    JSONObject resultObject = JSON.parseObject(result);
+                    JSONArray dataArray = resultObject.getJSONArray("items");
+                    List<OutboundListBean> list=new ArrayList<>();
+                    list.clear();
+                    if (dataArray != null && dataArray.size() > 0) {
+                        for (int i = 0; i < dataArray.size(); i++) {
+                            JSONObject dataObject = dataArray.getJSONObject(i);
+                            if (dataObject != null) {
+                                OutboundListBean jltStorageInBean = new OutboundListBean();
+                                jltStorageInBean.setDC_ID(FastjsonUtil.getText(dataObject, "DC_ID"));
+                                jltStorageInBean.setDC_CODE(FastjsonUtil.getText(dataObject, "DC_CODE"));
+                                jltStorageInBean.setDC_DEVCODE(FastjsonUtil.getText(dataObject, "DC_DEVCODE"));
+                                jltStorageInBean.setDC_DEVNAME(FastjsonUtil.getText(dataObject, "DC_DEVNAME"));
+                                jltStorageInBean.setDC_INDATE(FastjsonUtil.getText(dataObject, "DC_INDATE"));
+                                jltStorageInBean.setDC_LINECODE(FastjsonUtil.getText(dataObject, "DC_LINECODE"));
+                                jltStorageInBean.setDC_STATUS(FastjsonUtil.getText(dataObject, "DC_STATUS"));;
+                                list.add(jltStorageInBean);
+                            }
+                        }
+                    }
+                    mFilterStorageInBeans = list;//PI_INOUTNO
+                    setFilterTableData(mFilterStorageInBeans);
+                    progressDialog.dismiss();
+                    mRefreshLayout.finishRefresh(0);
+                    mRefreshLayout.finishLoadMore(0);
+
+                } catch (Exception e) {
+                    e.printStackTrace();
+                    progressDialog.dismiss();
+                    mRefreshLayout.finishRefresh(0);
+                    mRefreshLayout.finishLoadMore(0);
+                }
+
+            }
+
+            @Override
+            public void onFail(int flag, String failStr) throws Exception {
+                progressDialog.dismiss();
+                mRefreshLayout.finishRefresh(0);
+                mRefreshLayout.finishLoadMore(0);
+                if (mPageIndex > 1) {
+                    mPageIndex--;
+                } else {
+                    setFilterTableData(new ArrayList<>());
+                }
+                CommonUtil.toastNoRepeat(mActivity, failStr);
+
+                setFilterTableData(mFilterStorageInBeans);
+                progressDialog.dismiss();
+            }
+        });
+    }
+
+
+    private void setFilterTableData(List<OutboundListBean> filterTableData) {
+        mTableData = new TableData<OutboundListBean>("收料单列表", filterTableData,
+                va_classColumn,va_codeColumn,va_statusColumn,va_vendnameColumn,va_vendcodeColumn);
+        mSmartTable.setTableData(mTableData);
+//        mSmartTable.requestLayout();
+        mSmartTable.postDelayed(new Runnable() {
+            @Override
+            public void run() {
+                mSmartTable.postInvalidate();
+            }
+        }, 100);
+
+    }
+    private void initPopupWindow() {
+        View view = View.inflate(getActivity(), R.layout.pop_outboundlist_out_menu, null);
+        bt_add = (Button) view.findViewById(R.id.bt_add);
+        mFragment = new AddEquipmentGrantFragment();
+
+        bt_add.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                closeMenuPopupWindow();
+                FragmentUtils.switchFragment(DeviceProvisioningListFragment.this, mFragment);
+            }
+        });
+
+
+
+        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);
+        }
+    }
+//    @Subscribe
+//    public void onMessageEvent(MessageOutboundEvents event) {
+//        getDatalistCodes(storage_recharge_collect_et.getText().toString().trim());
+//    }
+
+
+
+    @Override
+    public boolean onKeyDown(int keyCode, KeyEvent event) {
+        return false;
+    }
+
+    @Override
+    public boolean onFragmentBackPressed() {
+        return false;
+    }
+    @Override
+    public void onHiddenChanged(boolean hidden) {
+        super.onHiddenChanged(hidden);
+        if (hidden) {
+            ((FunctionActivity) getActivity()).setMoreBtnVisible(false);
+            ((FunctionActivity) getActivity()).setListIconIvVisible(false);
+        } else {
+            FunctionActivity.setTitle(getString(R.string.grant_list));
+            ((FunctionActivity) getActivity()).setMoreBtnVisible(true);
+            ((FunctionActivity) getActivity()).setListIconIvVisible(false);
+        }
+    }
+
+    @Override
+    public void onClick(Column<String> column, String value, String s, int position) {
+        String dc_code = mFilterStorageInBeans.get(position).getDC_CODE();
+        String dc_id = mFilterStorageInBeans.get(position).getDC_ID();
+        String dc_devcode = mFilterStorageInBeans.get(position).getDC_DEVCODE();
+        String dc_status = mFilterStorageInBeans.get(position).getDC_STATUS();
+        AddEquipmentGrantFragment outboundListAdd_fragment = new AddEquipmentGrantFragment();
+        Bundle bundle = new Bundle();
+        bundle.putString("dc_code", dc_code);
+        bundle.putString("dc_id", dc_id);
+        bundle.putString("dc_devcode", dc_devcode);
+        bundle.putString("dc_status", dc_status);
+        outboundListAdd_fragment.setArguments(bundle);
+        FragmentUtils.switchFragment(DeviceProvisioningListFragment.this, outboundListAdd_fragment);
+    }
+
+    @Override
+    public void onDestroyView() {
+        super.onDestroyView();
+        ((FunctionActivity) getActivity()).setMoreBtnVisible(false);
+        ((FunctionActivity) getActivity()).setListIconIvVisible(false);
+        CommonUtil.closeKeybord(storage_recharge_collect_et, mActivity);
+        ((TextView) (getActivity().findViewById(R.id.tv_actionbar_withback))).setText(getString(R.string.grant_list));
+    }
+
+    @Subscribe
+    public void onMessageEvent(MessageOutboundEvents event) {
+        getDatalistCodes(storage_recharge_collect_et.getText().toString().trim());
+    }
+    @Override
+    public void onClick(View v) {
+        switch (v.getId()) {
+            case R.id.storage_recharge_scan_iv:
+                if (CameraUtil.hasCamera()) {
+                    if (root.findFocus() != null) {
+                        mFocusId = root.findFocus().getId();
+                        Intent intent = new Intent();
+                        intent.setClass(mActivity, CaptureActivity.class);
+                        startActivityForResult(intent, SCAN_BARCODE_CODE);
+                    } else {
+                        CommonUtil.toastNoRepeat(mActivity, "请选择您要操作的输入框");
+                    }
+                } else {
+                    CommonUtil.toastNoRepeat(mActivity, getString(R.string.no_camera_detected));
+                }
+                break;
+            case R.id.btn_actionbar_more:
+                CommonUtil.setBackgroundAlpha(getActivity(), 0.5f);
+                mMenuPopupWindow.showAsDropDown(mMenuButton);
+                break;
+        }
+    }
+
+    @Override
+    public void onActivityResult(int requestCode, int resultCode, Intent data) {
+        super.onActivityResult(requestCode, resultCode, data);
+        if (resultCode != Activity.RESULT_OK) {
+            return;
+        }
+
+        if (requestCode == SCAN_BARCODE_CODE && data != null) {
+            if (data.getExtras() != null) {
+                String result = data.getExtras().getString(CodeUtils.RESULT_STRING);
+                if (mFocusId == R.id.storage_recharge_collect_et) {
+                    storage_recharge_collect_et.setText(result);
+                    storage_recharge_collect_et.setSelection(result.length());
+
+                    getDatalistCodes(result);
+                }
+            }
+        }
+    }
+
+    @Override
+    public void onDestroy() {
+        super.onDestroy();
+        // 注销
+        EventBus.getDefault().unregister(this);
+    }
+}

+ 7 - 0
app/src/main/java/com/uas/rd_equipment/fragment/ProduceMassageBindingFragment.java

@@ -555,6 +555,10 @@ public class ProduceMassageBindingFragment extends BaseFragment implements OnCol
     }
     //工单ID
     public void getfuzzySearchData(String inoutNo){
+        if (inoutNo.isEmpty()){
+            CommonUtil.toastNoRepeat(mActivity, "请输入工单ID");
+            return;
+        }
         progressDialog.show();
         VollyRequest.getInstance().stringRequest(new HttpParams.Builder()
                 .url(GloableParams.ADDRESS_SMT_FUZZY_SEARCH)
@@ -567,6 +571,8 @@ public class ProduceMassageBindingFragment extends BaseFragment implements OnCol
                 String s = o.toString();
                 List<String> mAutoStrings = new ArrayList<String>();
                 try {
+                    tv_dc_emcode.requestFocus();
+                    tv_dc_emcode.setSelection(tv_dc_emcode.getText().length());
                     mAutoStrings.clear();
                     linecodeBeanList.clear();
                     org.json.JSONObject resultObject = new org.json.JSONObject(s);
@@ -590,6 +596,7 @@ public class ProduceMassageBindingFragment extends BaseFragment implements OnCol
                     }
                     ipAndlinecodePortAdapter.setmList(linecodeBeanList);
                     ipAndlinecodePortAdapter.notifyDataSetChanged();
+
                     getDatalistCodes(ce_resources.getText().toString().trim(),work_code_code.getText().toString().trim());
                 } catch (JSONException e) {
                     e.printStackTrace();

+ 1 - 1
app/src/main/java/com/uas/rd_equipment/fragment/RequisitionTransferFragment.java

@@ -378,7 +378,7 @@ public class RequisitionTransferFragment extends BaseFragment{
                 String result = o.toString();
                 JSONObject resultObject = JSON.parseObject(result);
                 JSONObject dataObject = resultObject.getJSONObject("items");
-                String de_name = FastjsonUtil.getText(dataObject, "EM_NAME");
+                String de_name = FastjsonUtil.getText(dataObject, "em_name");
                 tv_dc_emname.setText(de_name);
             }
 

+ 17 - 6
app/src/main/java/com/uas/rd_equipment/fragment/StorageRechargeListFragment.java

@@ -598,7 +598,6 @@ public class StorageRechargeListFragment extends BaseFragment implements OnColum
 
 
 
-
     public class SelectAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
 
         private ArrayList<MaintainitemBean> mList = new ArrayList<>();
@@ -658,19 +657,28 @@ public class StorageRechargeListFragment extends BaseFragment implements OnColum
             mIsSelectable = selectable;
         }
 
-
         //绑定界面,设置监听
         @Override
         public void onBindViewHolder(final RecyclerView.@NotNull ViewHolder holder, @SuppressLint("RecyclerView") int i) {
-
             //设置条目状态
             ((ListItemViewHolder) holder).mainTitle.setText("项目:"+mList.get(i).getMi_item());
             ((ListItemViewHolder) holder).tv_mi_desc.setText("标准:"+mList.get(i).getMI_DESC());
             if (StringUtil.isEmpty(mList.get(i).getDI_REMARK())){
                 ((ListItemViewHolder) holder).tv_remark.setText("");
             }else {
+//                double vDI_REMARK = Double.parseDouble(mList.get(i).getDI_REMARK());
+                ((ListItemViewHolder) holder).tv_remark.setVisibility(View.VISIBLE);
                 ((ListItemViewHolder) holder).tv_remark.setText("点检值:"+mList.get(i).getDI_REMARK());
             }
+            if (!StringUtil.isEmpty(mList.get(i).getMI_MAXVALUE())){
+                ((ListItemViewHolder) holder).tv_max.setVisibility(View.VISIBLE);
+                ((ListItemViewHolder) holder).tv_max.setText("最大值:"+mList.get(i).getMI_MAXVALUE());
+            }
+            if (!StringUtil.isEmpty(mList.get(i).getMI_MINVALUE())){
+                ((ListItemViewHolder) holder).tv_min.setVisibility(View.VISIBLE);
+                ((ListItemViewHolder) holder).tv_min.setText("最小值:"+mList.get(i).getMI_MINVALUE());
+            }
+
             ((ListItemViewHolder) holder).checkBox.setChecked(isItemChecked(i));
 
             //checkBox的监听
@@ -730,6 +738,8 @@ public class StorageRechargeListFragment extends BaseFragment implements OnColum
             TextView tv_mi_desc;
             TextView tv_remark;
             ImageView iv_change;
+            TextView tv_max;
+            TextView tv_min;
             ListItemViewHolder(View view) {
                 super(view);
                 this.mainTitle = (TextView) view.findViewById(R.id.text);
@@ -737,6 +747,8 @@ public class StorageRechargeListFragment extends BaseFragment implements OnColum
                 this.checkBox = (CheckBox) view.findViewById(R.id.select_checkbox);
                 this.tv_remark = (TextView) view.findViewById(R.id.tv_remark);
                 this.iv_change = (ImageView) view.findViewById(R.id.iv_change);
+                this.tv_max = (TextView) view.findViewById(R.id.tv_max);
+                this.tv_min = (TextView) view.findViewById(R.id.tv_min);
 
             }
         }
@@ -771,8 +783,7 @@ public class StorageRechargeListFragment extends BaseFragment implements OnColum
             @Override
             public void onClick(View v) {
                 if (edit_et.getText().toString().trim().isEmpty()){
-                    CommonUtil.toastNoRepeat(mActivity,"请输入数量");
-                    return;
+                    edit_et.setText("0");
                 }
                 String trim = edit_et.getText().toString().trim();
                 MaintainitemBean maintainitemBean = mList.get(i);
@@ -790,7 +801,7 @@ public class StorageRechargeListFragment extends BaseFragment implements OnColum
                             double int_remark = Double.parseDouble(trim);
                             double int_maxvalue = Double.parseDouble(maintainitemBean.getMI_MAXVALUE());
                             double int_minvalue = Double.parseDouble(maintainitemBean.getMI_MINVALUE());
-                            if (int_remark>=int_maxvalue && int_remark<=int_minvalue){
+                            if (int_remark>=int_minvalue && int_remark<=int_maxvalue){
                                 mList.get(i).setDI_REMARK(edit_et.getText().toString().trim());
                                 myAdapter.setItemChecked(i, true);
                                 myAdapter.notifyItemChanged(i);

+ 9 - 0
app/src/main/java/com/uas/rd_equipment/global/GloableParams.java

@@ -337,6 +337,8 @@ public class GloableParams {
     public static String ASTATIONTHE_SELECT_SAVEMAKERECORD;
     public static String ASTATIONTHE_SELECT_DEVICEINFOPUSH;
     public static String ASTATIONTHE_SELECT_GETWORKCENTER;
+    public static String ASTATIONTHE_SELECT_GRANt;
+    public static String ASTATIONTHE_SELECT_CONFIRMUSE;
 
     /**
      * 新版设备管理
@@ -371,6 +373,8 @@ public class GloableParams {
     public static String ADDRESSTAIL_GET_SAVEMAKERECORD="/oa/device/saveMakerecord.action";
     public static String ADDRESSTAIL_GET_DEVICEINFOPUSH="/oa/device/deviceInfoPush.action";
     public static String ADDRESSTAIL_GET_GETWORKCENTER="/oa/device/getWorkCenter.action";
+    public static String ADDRESSTAIL_GET_GRANt="/oa/device/getMakerecordByDC.action";
+    public static String ADDRESSTAIL_GET_CONFIRMUSE="/oa/device/confirmUse.action";
 
     /**
      * 高登
@@ -981,6 +985,7 @@ public class GloableParams {
     public static final String TEXT_REQUISITION_TRANSFER = "领用转移";
     public static final String PRODUCTION_INFORMATION_UNIT = "生产信息绑定";
     public static final String PRODUCTION_REMOULD_UNIT = "设备改造";
+    public static final String PRODUCTION_REMOULD_GRAN = "物料发放";
     public static final String GRIDNAME_SETTING = "设置";
 //    public static final String QUERYSTATIONINFORMATION = "过站信息";
     public static String[] homeMenuNames = {
@@ -991,6 +996,7 @@ public class GloableParams {
             TEXT_REQUISITION_TRANSFER,
             PRODUCTION_INFORMATION_UNIT,
             PRODUCTION_REMOULD_UNIT,
+//            PRODUCTION_REMOULD_GRAN,
             GRIDNAME_SETTING
     };
     public static int[] homeMenuIcons = {
@@ -1001,6 +1007,7 @@ public class GloableParams {
             R.drawable.pause,
             R.drawable.information,
             R.drawable.remould,
+//            R.drawable.iv_grant,
             R.drawable.mainmenu_usersetting
     };
 
@@ -1514,5 +1521,7 @@ public class GloableParams {
         GloableParams.ASTATIONTHE_SELECT_SAVEMAKERECORD = uriHead + GloableParams.ADDRESSTAIL_GET_SAVEMAKERECORD;
         GloableParams.ASTATIONTHE_SELECT_DEVICEINFOPUSH = uriHead + GloableParams.ADDRESSTAIL_GET_DEVICEINFOPUSH;
         GloableParams.ASTATIONTHE_SELECT_GETWORKCENTER = uriHead + GloableParams.ADDRESSTAIL_GET_GETWORKCENTER;
+        GloableParams.ASTATIONTHE_SELECT_GRANt = uriHead + GloableParams.ADDRESSTAIL_GET_GRANt;
+        GloableParams.ASTATIONTHE_SELECT_CONFIRMUSE = uriHead + GloableParams.ADDRESSTAIL_GET_CONFIRMUSE;
     }
 }

TEMPAT SAMPAH
app/src/main/res/drawable/iv_grant.png


+ 419 - 0
app/src/main/res/layout/addeqipmentgrant_fragment.xml

@@ -0,0 +1,419 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:orientation="vertical">
+
+    <TableLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:stretchColumns="1">
+        <TableRow>
+
+            <TextView
+                android:layout_marginLeft="@dimen/dp_10"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="扫码框"
+                android:layout_gravity="center"
+                android:textColor="@color/black">
+            </TextView>
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginRight="16dp"
+                android:layout_marginLeft="16dp"
+                android:layout_marginTop="5dp">
+                <FrameLayout
+                    android:layout_width="0dp"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1">
+
+                    <AutoCompleteTextView
+                        android:id="@+id/storage_recharge_collect_et"
+                        style="@style/EditTextLineStyle"
+                        android:layout_height="30dp"
+                        android:hint="" />
+
+                    <ImageView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center|right"
+                        android:layout_marginRight="13dp"
+                        android:src="@drawable/wrong"
+                        android:visibility="gone" />
+                </FrameLayout>
+
+                <ImageView
+                    android:id="@+id/storage_recharge_scan_iv"
+                    android:layout_width="30dp"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center"
+                    android:layout_marginLeft="5dp"
+                    android:layout_marginRight="@dimen/dp_10"
+                    android:clickable="false"
+                    android:src="@drawable/ic_edittext_scan" />
+            </LinearLayout>
+
+
+
+
+        </TableRow>
+        <LinearLayout
+            android:orientation="horizontal"
+            android:layout_width="match_parent"
+            android:layout_weight="1"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="@dimen/dp_10"
+            android:layout_gravity="center">
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="单据编号  "
+                android:gravity="center"
+                android:layout_gravity="center"
+                android:textColor="@color/black">
+            </TextView>
+            <TextView
+                android:id="@+id/tv_grantcode"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text=""
+                android:gravity="center"
+                android:layout_gravity="center"
+                android:textColor="@color/black">
+            </TextView>
+
+        </LinearLayout>
+        <TableRow
+            android:layout_marginTop="5dp">
+
+            <TextView
+                android:layout_marginLeft="@dimen/dp_10"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="工单ID"
+                android:layout_gravity="center"
+                android:textColor="@color/black">
+            </TextView>
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/textsize_16"
+                android:layout_marginRight="@dimen/textsize_16"
+                >
+
+                <FrameLayout
+                    android:layout_width="0dp"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1">
+
+                    <AutoCompleteTextView
+                        android:id="@+id/et_linecode_smts"
+                        style="@style/EditTextLineStyle"
+                        android:layout_height="30dp"
+                        android:hint="请输入工单ID" />
+
+                    <ImageView
+                        android:id="@+id/iocout_smts"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center|right"
+                        android:layout_marginRight="13dp"
+                        android:src="@drawable/wrong"
+                        android:visibility="gone" />
+                </FrameLayout>
+                <ImageView
+                    android:id="@+id/shaopwork_id"
+                    android:layout_width="30dp"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center"
+                    android:layout_marginLeft="5dp"
+                    android:layout_marginRight="@dimen/dp_10"
+                    android:clickable="false"
+                    android:src="@drawable/ic_edittext_scan" />
+                <ImageView
+                    android:layout_gravity="center"
+                    android:id="@+id/iv_popuwindow"
+                    android:layout_width="30dp"
+                    android:layout_height="match_parent"
+                    android:layout_marginRight="10dp"
+                    android:layout_marginLeft="5dp"
+                    android:background="@drawable/bg_button"
+                    android:src="@drawable/search_48"
+                    android:visibility="gone"/>
+            </LinearLayout>
+
+
+
+
+        </TableRow>
+
+
+        <LinearLayout
+            android:orientation="horizontal"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content">
+            <LinearLayout
+                android:layout_gravity="bottom"
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_weight="1.5"
+                android:layout_marginLeft="@dimen/textsize_20">
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="工单号  "
+                    android:scrollbarSize="16sp"
+                    android:gravity="center"
+                    android:textSize="16sp"
+                    android:layout_gravity="center"
+                    android:textColor="@color/black">
+                </TextView>
+                <TextView
+                    android:id="@+id/work_code_code"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text=""
+                    android:scrollbarSize="16sp"
+                    android:gravity="center"
+                    android:textSize="16sp"
+                    android:layout_gravity="center"
+                    android:textColor="@color/black">
+                </TextView>
+            </LinearLayout>
+            <LinearLayout
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_weight="1">
+                <TextView
+                    android:layout_marginLeft="@dimen/dp_10"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="工段"
+                    android:textSize="16sp"
+                    android:gravity="center"
+                    android:layout_gravity="bottom"
+                    android:paddingTop="@dimen/dp_10"
+                    android:textColor="@color/black">
+                </TextView>
+                <Spinner
+                    android:id="@+id/sp_login"
+                    android:layout_marginLeft="@dimen/dp_10"
+                    android:layout_marginRight="@dimen/dp_10"
+                    style="@style/SpinnerStyle"
+                    android:layout_height="30dp"
+                    android:layout_marginTop="0dp"
+                    android:padding="0dp"
+                    android:gravity="center"
+                    android:paddingLeft="0dp"
+                    android:layout_gravity="top"
+                    android:background="@drawable/bg_spinner" />
+            </LinearLayout>
+        </LinearLayout>
+        <LinearLayout
+            android:layout_marginTop="5dp"
+            android:orientation="horizontal"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content">
+            <LinearLayout
+                android:orientation="horizontal"
+                android:layout_width="match_parent"
+                android:layout_weight="1"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/textsize_20"
+                android:layout_gravity="center">
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="产品编号  "
+                    android:gravity="center"
+                    android:layout_gravity="center"
+                    android:textColor="@color/black">
+                </TextView>
+                <TextView
+                    android:id="@+id/tv_pr_code"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text=""
+                    android:gravity="center"
+                    android:layout_gravity="center"
+                    android:textColor="@color/black">
+                </TextView>
+
+            </LinearLayout>
+
+            <TextView
+                android:id="@+id/tv_pr_detail"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:text="产品名称"
+                android:gravity="left"
+                android:layout_gravity="center"
+                android:textColor="@color/black">
+            </TextView>
+        </LinearLayout>
+        <LinearLayout
+            android:layout_marginLeft="15dp"
+            android:layout_marginTop="7dp"
+            android:orientation="horizontal"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content">
+
+
+        </LinearLayout>
+
+
+        <TableRow
+            android:layout_marginTop="5dp">
+            <TextView
+                android:layout_marginLeft="@dimen/dp_10"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="人员编号"
+                android:layout_gravity="center"
+                android:textColor="@color/black">
+            </TextView>
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginRight="16dp"
+                android:layout_marginLeft="16dp">
+                <FrameLayout
+                    android:layout_width="0dp"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1">
+
+                    <AutoCompleteTextView
+                        android:id="@+id/tv_dc_emcode"
+                        style="@style/EditTextLineStyle"
+                        android:layout_height="30dp"
+                        android:hint="请输入人员编号" />
+
+                    <ImageView
+                        android:id="@+id/tv_dc_emcode_delete"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center|right"
+                        android:layout_marginRight="13dp"
+                        android:src="@drawable/wrong"
+                        android:visibility="gone" />
+                </FrameLayout>
+                <ImageView
+                    android:id="@+id/iv_dc_emcode"
+                    android:layout_width="30dp"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center"
+                    android:layout_marginLeft="5dp"
+                    android:layout_marginRight="@dimen/dp_10"
+                    android:clickable="false"
+                    android:src="@drawable/ic_edittext_scan" />
+            </LinearLayout>
+
+
+        </TableRow>
+        <TableRow
+            android:layout_marginTop="5dp">
+            <TextView
+                android:text="人员名称"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/dp_10"
+                android:layout_gravity="center"
+                android:textColor="@color/black">
+            </TextView>
+            <TextView
+                android:id="@+id/tv_dc_emname"
+                android:text=""
+                android:layout_width="wrap_content"
+                android:layout_gravity="center|left"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/textsize_20"
+                android:textColor="@color/black">
+            </TextView>
+        </TableRow>
+
+    </TableLayout>
+    <RadioGroup
+        android:id="@+id/rg_change"
+        android:layout_gravity="center"
+        android:orientation="horizontal"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content">
+        <RadioButton
+            android:id="@+id/rb_equipment"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_margin="@dimen/dp_10"
+            android:checked="true"
+            android:text="设备">
+        </RadioButton>
+        <RadioButton
+            android:id="@+id/rb_fixture"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_margin="@dimen/dp_10"
+            android:layout_weight="1"
+            android:text="夹具">
+        </RadioButton>
+        <RadioButton
+            android:id="@+id/rb_ingredients"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_margin="@dimen/dp_10"
+            android:text="辅料">
+        </RadioButton>
+    </RadioGroup>
+
+
+    <com.bin.david.form.core.SmartTable
+        android:id="@+id/addgrant"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_weight="1" />
+    <TextView
+        android:id="@+id/tv_prompt"
+        android:text=""
+        android:layout_marginLeft="15dp"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content">
+    </TextView>
+    <LinearLayout
+        android:orientation="horizontal"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="@dimen/dp_10"
+        android:layout_marginBottom="@dimen/textsize_20">
+        <TextView
+            android:id="@+id/tv_save"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:text="保存"
+            android:layout_gravity="center"
+            android:gravity="center"
+            android:textSize="@dimen/textsize_20"
+            android:layout_marginLeft="@dimen/dp_10"
+            android:layout_marginRight="@dimen/dp_10"
+            android:background="@color/gray_light">
+        </TextView>
+        <TextView
+            android:id="@+id/tv_confirm_receipt"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:text="确认领用"
+            android:layout_gravity="center"
+            android:gravity="center"
+            android:textSize="@dimen/textsize_20"
+            android:layout_marginLeft="@dimen/dp_10"
+            android:layout_marginRight="@dimen/dp_10"
+            android:background="@color/gray_light">
+        </TextView>
+
+    </LinearLayout>
+
+
+</LinearLayout>

+ 5 - 6
app/src/main/res/layout/producemassagebinding_fragment.xml

@@ -276,16 +276,15 @@
                         android:src="@drawable/wrong"
                         android:visibility="gone" />
                 </FrameLayout>
-
                 <ImageView
                     android:id="@+id/iv_dc_emcode"
-                    android:layout_gravity="center"
                     android:layout_width="30dp"
-                    android:layout_height="match_parent"
-                    android:layout_marginRight="10dp"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center"
                     android:layout_marginLeft="5dp"
-                    android:background="@drawable/ic_edittext_scan"
-                    android:src="@drawable/search_48" />
+                    android:layout_marginRight="@dimen/dp_10"
+                    android:clickable="false"
+                    android:src="@drawable/ic_edittext_scan" />
             </LinearLayout>
 
 

+ 33 - 1
app/src/main/res/layout/recyclerview_item.xml

@@ -49,9 +49,42 @@
                 android:layout_gravity="left"
                 android:textSize="15sp"
                 android:text=""
+                android:visibility="gone"
                 android:gravity="left"
                 tools:ignore="RtlCompat">
             </TextView>
+            <LinearLayout
+                android:orientation="horizontal"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content">
+                <TextView
+                    android:id="@+id/tv_max"
+                    android:layout_marginTop="5dp"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="left"
+                    android:textSize="15sp"
+                    android:text=""
+                    android:textColor="@color/red"
+                    android:gravity="left"
+                    tools:ignore="RtlCompat"
+                    android:visibility="gone">
+                </TextView>
+                <TextView
+                    android:layout_marginLeft="@dimen/dp_10"
+                    android:id="@+id/tv_min"
+                    android:layout_marginTop="5dp"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="left"
+                    android:textSize="15sp"
+                    android:text=""
+                    android:textColor="@color/red"
+                    android:gravity="left"
+                    tools:ignore="RtlCompat"
+                    android:visibility="gone">
+                </TextView>
+            </LinearLayout>
         </LinearLayout>
         <ImageView
             android:layout_gravity="center"
@@ -59,7 +92,6 @@
             android:src="@drawable/iv_change"
             android:layout_width="30dp"
             android:layout_height="30dp">
-
         </ImageView>
 
 

+ 2 - 0
app/src/main/res/values/strings.xml

@@ -381,7 +381,9 @@
     <string name="box_num_total">箱内总数:</string>
     <string name="whcode_flag">仓库:</string>
     <string name="main_list">领用转移列表</string>
+    <string name="grant_list">物料发放列表</string>
     <string name="producemassagebinding">生产信息绑定</string>
+    <string name="addequipmentgrant">物料发放</string>
     <string name="str_collect_already">已采集</string>
     <string name="str_collect_not">未采集</string>
     <string name="str_collect_ing">采集中</string>

+ 1 - 1
pda_libs/pulltoreflashlibrary/build/intermediates/incremental/packageDebugResources/compile-file-map.properties

@@ -1,4 +1,4 @@
-#Mon Jul 03 15:49:59 CST 2023
+#Wed Jul 05 17:25:51 CST 2023
 D\:\\AndroidData\\RD-NewEquipmentManagement\\pda_libs\\pulltoreflashlibrary\\src\\main\\res\\anim\\slide_out_to_top.xml=D\:\\AndroidData\\RD-NewEquipmentManagement\\pda_libs\\pulltoreflashlibrary\\build\\intermediates\\packaged_res\\debug\\anim\\slide_out_to_top.xml
 D\:\\AndroidData\\RD-NewEquipmentManagement\\pda_libs\\pulltoreflashlibrary\\src\\main\\res\\anim\\slide_in_from_top.xml=D\:\\AndroidData\\RD-NewEquipmentManagement\\pda_libs\\pulltoreflashlibrary\\build\\intermediates\\packaged_res\\debug\\anim\\slide_in_from_top.xml
 D\:\\AndroidData\\RD-NewEquipmentManagement\\pda_libs\\pulltoreflashlibrary\\src\\main\\res\\drawable-xhdpi\\default_ptr_rotate.png=D\:\\AndroidData\\RD-NewEquipmentManagement\\pda_libs\\pulltoreflashlibrary\\build\\intermediates\\packaged_res\\debug\\drawable-xhdpi-v4\\default_ptr_rotate.png