|
|
@@ -22,6 +22,7 @@ import android.view.View;
|
|
|
import android.view.Window;
|
|
|
import android.view.inputmethod.EditorInfo;
|
|
|
import android.widget.AdapterView;
|
|
|
+import android.widget.ArrayAdapter;
|
|
|
import android.widget.Button;
|
|
|
import android.widget.CheckBox;
|
|
|
import android.widget.CompoundButton;
|
|
|
@@ -31,6 +32,7 @@ import android.widget.ImageView;
|
|
|
import android.widget.LinearLayout;
|
|
|
import android.widget.PopupWindow;
|
|
|
import android.widget.SimpleAdapter;
|
|
|
+import android.widget.Spinner;
|
|
|
import android.widget.TextView;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
@@ -1234,6 +1236,7 @@ public class ProcessManagementActivity extends BaseActivity implements AdapterVi
|
|
|
dia.setContentView(R.layout.dialog_custom);
|
|
|
CheckBox check_alldelete = dia.findViewById(R.id.check_alldelete);
|
|
|
TextView tv_warning = dia.findViewById(R.id.tv_warning);
|
|
|
+ Button bt_only_current_work_order = dia.findViewById(R.id.bt_only_current_work_order);
|
|
|
LinearLayout lineone = dia.findViewById(R.id.lineone);
|
|
|
LinearLayout linetwo = dia.findViewById(R.id.linetwo);
|
|
|
TextView tv_info = dia.findViewById(R.id.tv_info);
|
|
|
@@ -1253,6 +1256,13 @@ public class ProcessManagementActivity extends BaseActivity implements AdapterVi
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
+ bt_only_current_work_order.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ dia.dismiss();
|
|
|
+ initCurrentDialog();
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
dia.setCanceledOnTouchOutside(true);
|
|
|
btn_confirm.setOnClickListener(new View.OnClickListener() {
|
|
|
@@ -1319,6 +1329,98 @@ public class ProcessManagementActivity extends BaseActivity implements AdapterVi
|
|
|
|
|
|
}
|
|
|
|
|
|
+ private String selctStr;
|
|
|
+ //仅删除当前工单
|
|
|
+ private void initCurrentDialog() {
|
|
|
+ Dialog dia = new Dialog(ProcessManagementActivity.this);
|
|
|
+ dia.setContentView(R.layout.dialog_only_work_order);
|
|
|
+
|
|
|
+ Spinner sp_reason = dia.findViewById(R.id.sp_reason);
|
|
|
+ ClearableEditText cet_notes = dia.findViewById(R.id.cet_notes);
|
|
|
+ Button btn_cancel = dia.findViewById(R.id.btn_cancel);//取消
|
|
|
+ Button btn_confirm = dia.findViewById(R.id.btn_confirm);//确定
|
|
|
+ dia.show();
|
|
|
+ dia.setCanceledOnTouchOutside(true);
|
|
|
+
|
|
|
+ ArrayList<String> arrayList = new ArrayList<>();
|
|
|
+ arrayList.add("欠料");
|
|
|
+ arrayList.add("换线");
|
|
|
+ arrayList.add("设备异常");
|
|
|
+ arrayList.add("人员变动");
|
|
|
+ arrayList.add("品质异常");
|
|
|
+ arrayList.add("其它");
|
|
|
+ ArrayAdapter reasonAdapter = new ArrayAdapter<String>(ProcessManagementActivity.this, android.R.layout.simple_spinner_item, arrayList);
|
|
|
+ reasonAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
|
|
+ sp_reason.setAdapter(reasonAdapter);
|
|
|
+ sp_reason.setSelection(0);
|
|
|
+ selctStr = "欠料";
|
|
|
+
|
|
|
+ sp_reason.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
|
|
+ @Override
|
|
|
+ public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {
|
|
|
+ selctStr = arrayList.get(pos); //取出选中的值
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onNothingSelected(AdapterView<?> parent) {
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ btn_confirm.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ String ma_code = mCurDoc.getText().toString().trim();
|
|
|
+ String sc_code = ct_indexgangwei.getText().toString().trim();
|
|
|
+ String type = selctStr;
|
|
|
+ String remark = cet_notes.getText().toString().trim();
|
|
|
+ getCurrentDeltes(ma_code, sc_code, type, remark);
|
|
|
+ dia.dismiss();
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ btn_cancel.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ dia.dismiss();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ private void getCurrentDeltes(String ma_code, String sc_code, String type, String remark) {
|
|
|
+ progressDialog.show();
|
|
|
+ VolleyRequest.getInstance().stringRequest(mStringRequest,
|
|
|
+ new HttpParams.Builder()
|
|
|
+ .url(GloableParams.ADDRESS_PDA_STOPMA)
|
|
|
+ .method(Request.Method.POST)
|
|
|
+ .tag("stopMa")
|
|
|
+ .flag(0)
|
|
|
+ .addParam("ma_code", ma_code)
|
|
|
+ .addParam("sc_code", sc_code)
|
|
|
+ .addParam("type", type)
|
|
|
+ .addParam("remark", remark)
|
|
|
+ .build(), new HttpCallback() {
|
|
|
+ @Override
|
|
|
+ public void onSuccess(int flag, Object o) throws Exception {
|
|
|
+ Boolean isSuccess = FastjsonUtil.getBoolean(o.toString(), "success");
|
|
|
+ if (isSuccess) {
|
|
|
+ CommonUtil.toastNoRepeat(ProcessManagementActivity.this, "解绑成功!");
|
|
|
+ JSONObject dataObject = FastjsonUtil.getJSONObject(o.toString(), "data");
|
|
|
+ Intent intent = new Intent(ProcessManagementActivity.this, ProcessManagementActivity.class);
|
|
|
+ intent.putExtra(Constants.FLAG.SC_CODE, sc_code);
|
|
|
+ startActivity(intent);
|
|
|
+ } else {
|
|
|
+ CommonUtil.toastNoRepeat(ProcessManagementActivity.this, "解绑失败!");
|
|
|
+ }
|
|
|
+ progressDialog.dismiss();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onFail(int flag, String failStr) throws Exception {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ CommonUtil.toastNoRepeat(ProcessManagementActivity.this, failStr);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
//全部删除
|
|
|
public void getalldeltes(String workOrder){
|