|
|
@@ -376,25 +376,22 @@ object BusinessManager {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 钥匙归还提示确认弹框
|
|
|
+ * 钥匙归还提示确认弹框,当前策略:作业票未完成禁止归还钥匙
|
|
|
*/
|
|
|
- private fun showKeyReturnDialog(onConfirm: () -> Unit, onCancel: () -> Unit) {
|
|
|
+ private fun showKeyReturnDialog(onConfirm: () -> Unit) {
|
|
|
val ctx = ActivityUtils.currentActivity() as BaseActivity<*>
|
|
|
val dlg = TipDialog(ctx)
|
|
|
dlg.setTip(ctx.getString(R.string.key_return_tip))
|
|
|
- // 加个选择判断,如果是直接取消弹框而不是点击“取消”,当成取消
|
|
|
+ dlg.setType(TipDialog.TYPE_CONFIRM)
|
|
|
+ // 加个选择判断,如果是直接取消弹框而不是点击“确定”,当成确定
|
|
|
var state = 0
|
|
|
dlg.setConfirmListener {
|
|
|
state = 1
|
|
|
onConfirm.invoke()
|
|
|
}
|
|
|
- dlg.setCancelListener {
|
|
|
- state = 2
|
|
|
- onCancel.invoke()
|
|
|
- }
|
|
|
dlg.setOnDismissListener {
|
|
|
if (state == 0) {
|
|
|
- onCancel.invoke()
|
|
|
+ onConfirm.invoke()
|
|
|
}
|
|
|
}
|
|
|
dlg.show()
|
|
|
@@ -1154,9 +1151,9 @@ object BusinessManager {
|
|
|
handleKeyReturn(bleDevice, workTicketGetBO)
|
|
|
}
|
|
|
} else {
|
|
|
- showKeyReturnDialog({
|
|
|
- handleKeyReturn(bleDevice, workTicketGetBO)
|
|
|
- }) {
|
|
|
+ // 当前策略:作业票未完成禁止归还钥匙
|
|
|
+ showKeyReturnDialog {
|
|
|
+// handleKeyReturn(bleDevice, workTicketGetBO)
|
|
|
sendLoadingEventMsg(null, false)
|
|
|
ToastUtils.tip(R.string.continue_the_ticket)
|
|
|
BleManager.getInstance().disconnect(bleDevice)
|