예제 #1
0
  /** * 控制显示 */
  private void controlEd() {
    SystemConfig.setOperate(checkTask);

    // 根据任务状态是否显示抽屉
    if (checkStatue == null || TextUtils.isEmpty(checkStatue)) {
      if (gDrawer.getVisibility() == View.VISIBLE) {
        gDrawer.setVisibility(View.GONE);
      }
      TopManager.getInstance().getImbtnTongBu().setVisibility(View.GONE);
    } else if ("4".equals(checkStatue)) {
      if (gDrawer.getVisibility() == View.VISIBLE) {
        gDrawer.setVisibility(View.GONE);
      }
      TopManager.getInstance().getImbtnTongBu().setVisibility(View.GONE);
    } else if ("1".equals(checkStatue)) {
      if (gDrawer.getVisibility() == View.GONE) {
        gDrawer.setVisibility(View.VISIBLE);
      }

      // 任务已经受理才显示同步和提交按钮
      if (checkTask != null && 1 == checkTask.getIsaccept()) {
        TopManager.getInstance().getImbtnTongBu().setVisibility(View.VISIBLE);
      } else {
        TopManager.getInstance().getImbtnTongBu().setVisibility(View.GONE);
      }
    } else if ("2".equals(checkStatue)) {
      if (gDrawer.getVisibility() == View.VISIBLE) {
        gDrawer.setVisibility(View.GONE);
      }
      TopManager.getInstance().getImbtnTongBu().setVisibility(View.VISIBLE);
    } else {
      if (gDrawer.getVisibility() == View.VISIBLE) {
        gDrawer.setVisibility(View.GONE);
      }
      TopManager.getInstance().getImbtnTongBu().setVisibility(View.GONE);
    }
    // 判断是否接受按钮
    if (checkTask != null && 1 == checkTask.getIsaccept()) {
      SystemConfig.isOperate = true;
      drawerUtils.setAcceptBtn(false);
    }
    // 判断是否为改派申请
    if (checkTask != null && "apply".equals(checkTask.getApplycannelstatus())) {
      drawerUtils.setGaiPaiBtn(false);
      SystemConfig.isOperate = false;
    }
    // 同步和撤销按钮控制
    if ("synchroApply".equals(checkTask.getSynchrostatus())) {
      // 显示同步撤回按钮
      isTongBuCancel = true;
      TopManager.getInstance().TongBuSurveryContinue(false);
      TopManager.getInstance().getImbtnTongBu().setEnabled(true);
      SystemConfig.isOperate = false;
    } else {
      TopManager.getInstance().TongBuSurveryContinue(true);
      TopManager.getInstance().getImbtnTongBu().setEnabled(true);
      isTongBuCancel = false;
    }
  }
예제 #2
0
  @Override
  protected void setListener() {
    contactRL.setOnClickListener(this);
    rlOrderTime.setOnClickListener(this);
    caseinfoRl.setOnClickListener(this);
    taskinfoRl.setOnClickListener(this);
    rlBaoDan.setOnClickListener(this);
    rlHistory.setOnClickListener(this);
    messagesQuery.setOnClickListener(this);
    edOrderTime.setOnTouchListener(this);
    edOrderTime.addTextChangedListener(this);
    messagesEditxiepei.setOnClickListener(this);
    drawerUtils.setAcceptOnClick(
        new IBtnAccept() {
          @Override
          public void onClick() {
            /** 接受任务,接受任务时间插入查勘详细表 */
            promptManager.showDialog(
                context,
                "是否接受此任务?",
                R.string.yes,
                R.string.no,
                new ShowDialogPositiveButton() {
                  @Override
                  public void setPositiveButton() {
                    // 确定
                    if (!SystemConfig.isUserExperience) {
                      // 判断是否有联系过客户
                      boolean isContact = UtilIsNotNull.isNotNullContact(DataConfig.tblTaskQuery);
                      if (isContact) {
                        arrivedService(registNo);
                      } else {
                        Toast.showToast(context, "请先与客户取得联系!");
                      }
                    }
                  }

                  @Override
                  public void setNegativeButton() {
                    // 取消
                  }
                });
          }
        });
    drawerUtils.setGaiPaiOnClick(
        new IBtnGaiPai() {
          @Override
          public void onClick() {
            promptManager.showSingnRadio(
                context,
                new ShowDialogGaiPai() {
                  @Override
                  public void setPositiveButton(String reason) {
                    final String str = reason;
                    if (!TextUtils.isEmpty(str)) {
                      List<CertainLossTask> clts = CertainLossTaskAccess.getByRegistNo(registNo);
                      if (clts != null && clts.size() >= 1) {
                        promptManager.showDialog(
                            context,
                            "是否关联定损任务",
                            R.string.yes,
                            R.string.no,
                            new ShowDialogPositiveButton() {
                              @Override
                              public void setPositiveButton() {
                                if (!SystemConfig.isUserExperience) {
                                  // for update by haoyun
                                  // 20130401
                                  // begin
                                  if (SystemConfig.loginResponse.getDutyFlag().equals("on")) {
                                    sendForService("1", str);
                                  } else {
                                    handler.sendEmptyMessage(ConstantValue.PROGRESS_CLOSE);
                                    Message message = Message.obtain();
                                    message.obj = "下班状态不可以改派任务!";
                                    message.what = ConstantValue.ERROE;
                                    handler.sendMessage(message);
                                  }
                                }
                              }

                              @Override
                              public void setNegativeButton() {
                                if (!SystemConfig.isUserExperience) {
                                  if (SystemConfig.loginResponse.getDutyFlag().equals("on")) {
                                    sendForService("0", str);
                                  } else {
                                    handler.sendEmptyMessage(ConstantValue.PROGRESS_CLOSE);
                                    Message message = Message.obtain();
                                    message.obj = "下班状态不可以改派任务!";
                                    message.what = ConstantValue.ERROE;
                                    handler.sendMessage(message);
                                  }
                                }
                              }
                            });
                      } else {
                        sendForService("0", reason);
                      }
                    } else {
                      Toast.showToast(context, "请输入改派原因");
                    }
                  }

                  @Override
                  public void setNegativeButton() {}
                });
          }
        });
  }