|
|
@@ -8,6 +8,9 @@ import android.widget.Button; |
|
|
|
import android.widget.TextView;
|
|
|
|
import android.widget.LinearLayout;
|
|
|
|
import android.widget.ImageView;
|
|
|
|
import android.widget.EditText;
|
|
|
|
import android.app.AlertDialog;
|
|
|
|
import android.content.DialogInterface;
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
@@ -86,7 +89,7 @@ public class ReleaseVehicleDetailActivity extends AppActivity implements TitleBa |
|
|
|
params.put("loginSource", Constants.LOGIN_SOURCE);
|
|
|
|
params.put("orderNo", orderNo);
|
|
|
|
params.put("staffId", MyShared.getInstance().get(MyShared.STAFFID, "") + "");
|
|
|
|
|
|
|
|
|
|
|
|
LogUtils.i("解除车牌占用详情", "请求参数: " + JSONObject.toJSONString(params));
|
|
|
|
|
|
|
|
MyRetrofit.newInstanceGZ(this, true, IFCode.IFCODE_RELEASE_VEHICLE_DETAIL, params, new MyRetrofit.ReturnResult() {
|
|
|
@@ -738,16 +741,14 @@ public class ReleaseVehicleDetailActivity extends AppActivity implements TitleBa |
|
|
|
* 通过按钮点击
|
|
|
|
*/
|
|
|
|
private void onApproveClick(View view) {
|
|
|
|
// TODO: 实现通过逻辑
|
|
|
|
toast("通过功能待实现");
|
|
|
|
showAuditConfirmDialog(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 不通过按钮点击
|
|
|
|
*/
|
|
|
|
private void onRejectClick(View view) {
|
|
|
|
// TODO: 实现不通过逻辑
|
|
|
|
toast("不通过功能待实现");
|
|
|
|
showAuditConfirmDialog(false);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
@@ -757,6 +758,101 @@ public class ReleaseVehicleDetailActivity extends AppActivity implements TitleBa |
|
|
|
finish();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 显示审核确认弹窗
|
|
|
|
* @param isApprove true-通过,false-不通过
|
|
|
|
*/
|
|
|
|
private void showAuditConfirmDialog(boolean isApprove) {
|
|
|
|
View dialogView = getLayoutInflater().inflate(R.layout.dialog_audit_confirm, null);
|
|
|
|
|
|
|
|
TextView tvTitle = dialogView.findViewById(R.id.tv_dialog_title);
|
|
|
|
TextView tvMessage = dialogView.findViewById(R.id.tv_dialog_message);
|
|
|
|
LinearLayout llReasonInput = dialogView.findViewById(R.id.ll_reason_input);
|
|
|
|
EditText etReason = dialogView.findViewById(R.id.et_reason);
|
|
|
|
Button btnConfirm = dialogView.findViewById(R.id.btn_confirm);
|
|
|
|
Button btnCancel = dialogView.findViewById(R.id.btn_cancel);
|
|
|
|
|
|
|
|
if (isApprove) {
|
|
|
|
tvTitle.setText("审核通过确认");
|
|
|
|
tvMessage.setText("确认该订单通过审核?");
|
|
|
|
llReasonInput.setVisibility(View.GONE);
|
|
|
|
} else {
|
|
|
|
tvTitle.setText("审核不通过确认");
|
|
|
|
tvMessage.setText("确认该订单不通过审核?");
|
|
|
|
llReasonInput.setVisibility(View.VISIBLE);
|
|
|
|
}
|
|
|
|
|
|
|
|
AlertDialog dialog = new AlertDialog.Builder(this)
|
|
|
|
.setView(dialogView)
|
|
|
|
.setCancelable(false)
|
|
|
|
.create();
|
|
|
|
|
|
|
|
btnConfirm.setOnClickListener(v -> {
|
|
|
|
if (isApprove) {
|
|
|
|
submitAuditReview(true, "");
|
|
|
|
} else {
|
|
|
|
String reason = etReason.getText().toString().trim();
|
|
|
|
if (reason.isEmpty()) {
|
|
|
|
toast("请输入不通过的原因");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
submitAuditReview(false, reason);
|
|
|
|
}
|
|
|
|
dialog.dismiss();
|
|
|
|
});
|
|
|
|
|
|
|
|
btnCancel.setOnClickListener(v -> dialog.dismiss());
|
|
|
|
|
|
|
|
dialog.show();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 提交审核结果
|
|
|
|
* @param auditStatus true-通过,false-不通过
|
|
|
|
* @param reason 不通过原因(通过时为空)
|
|
|
|
*/
|
|
|
|
private void submitAuditReview(boolean auditStatus, String reason) {
|
|
|
|
showDialog("提交审核中...");
|
|
|
|
|
|
|
|
HashMap<String, Object> params = new HashMap<>();
|
|
|
|
params.put("accessToken", MyShared.getInstance().get("ACCESS_TOKEN", "") + "");
|
|
|
|
params.put("loginSource", Constants.LOGIN_SOURCE);
|
|
|
|
params.put("staffId", MyShared.getInstance().get(MyShared.STAFFID, "") + "");
|
|
|
|
params.put("orderNo", orderNo);
|
|
|
|
params.put("auditStatus", auditStatus);
|
|
|
|
params.put("reason", reason);
|
|
|
|
|
|
|
|
LogUtils.i("AuditReview", "提交审核参数: " + JSON.toJSONString(params));
|
|
|
|
|
|
|
|
MyRetrofit.newInstanceGZ(this, true, IFCode.IFCODE_ASS_ORDER_REVIEW, params, new MyRetrofit.ReturnResult() {
|
|
|
|
@Override
|
|
|
|
public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) {
|
|
|
|
hideDialog();
|
|
|
|
LogUtils.i("AuditReview", "审核结果: " + JSON.toJSONString(resultBean));
|
|
|
|
|
|
|
|
if (resultBean.getCode() == 0) {
|
|
|
|
String message = auditStatus ? "审核通过成功" : "审核不通过成功";
|
|
|
|
toast(message);
|
|
|
|
|
|
|
|
// 延迟关闭页面
|
|
|
|
postDelayed(() -> {
|
|
|
|
setResult(RESULT_OK);
|
|
|
|
finish();
|
|
|
|
}, 1500);
|
|
|
|
} else {
|
|
|
|
toast(resultBean.getMessage() != null ? resultBean.getMessage() : "审核失败");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onError() {
|
|
|
|
hideDialog();
|
|
|
|
LogUtils.e("AuditReview", "审核失败: ");
|
|
|
|
toast("审核失败");
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 详情数据类
|
|
|
|
*/
|