|
@@ -185,46 +185,51 @@ class JobExecuteFragment : BaseFragment<FragmentJobExecuteBinding>() {
|
|
|
itemBinding.stepLayout.setDebouncedClickListener {
|
|
itemBinding.stepLayout.setDebouncedClickListener {
|
|
|
val workflowStep =
|
|
val workflowStep =
|
|
|
viewModel.workflowSteps.find { it.stepId == item.workflowStepId }
|
|
viewModel.workflowSteps.find { it.stepId == item.workflowStepId }
|
|
|
- if (item.stepIndex < viewModel.currentStepData?.stepIndex!!) {
|
|
|
|
|
- return@setDebouncedClickListener
|
|
|
|
|
- }
|
|
|
|
|
- if (item.stepId != viewModel.currentStepData?.stepId && workflowStep?.enableSetLocker == false && workflowStep.enableSetColocker == false) {
|
|
|
|
|
- PopTip(
|
|
|
|
|
- getString(
|
|
|
|
|
- R.string.please_done_operation,
|
|
|
|
|
- viewModel.currentStepData?.androidStepContent
|
|
|
|
|
- )
|
|
|
|
|
- )
|
|
|
|
|
- return@setDebouncedClickListener
|
|
|
|
|
- }
|
|
|
|
|
- if (workflowStep?.confirmType != 0 &&
|
|
|
|
|
- (workflowStep?.enableSetLocker == true || workflowStep?.enableSetColocker == true)
|
|
|
|
|
- ) {
|
|
|
|
|
- stepClickConfirm(adapter, item, workflowStep)
|
|
|
|
|
- } else if (workflowStep?.confirmType == 0 &&
|
|
|
|
|
- workflowStep.confirmRoleCode == null &&
|
|
|
|
|
- workflowStep.confirmUser == null
|
|
|
|
|
- ) {
|
|
|
|
|
- stepClickConfirm(adapter, item, workflowStep)
|
|
|
|
|
- } else if (workflowStep?.confirmType == 0 &&
|
|
|
|
|
- (workflowStep.confirmRoleCode != null && MainDomainData.roleKeys?.contains(
|
|
|
|
|
- workflowStep.confirmRoleCode!!
|
|
|
|
|
- ) == true) &&
|
|
|
|
|
- workflowStep.confirmUser == null
|
|
|
|
|
- ) {
|
|
|
|
|
- stepClickConfirm(adapter, item, workflowStep)
|
|
|
|
|
- } else if (workflowStep?.confirmType == 0 &&
|
|
|
|
|
- (workflowStep.confirmRoleCode != null && MainDomainData.roleKeys?.contains(
|
|
|
|
|
- workflowStep.confirmRoleCode!!
|
|
|
|
|
- ) == true) &&
|
|
|
|
|
- (workflowStep.confirmUser != null && MainDomainData.userInfo?.userId == workflowStep.confirmUser)
|
|
|
|
|
- ) {
|
|
|
|
|
- stepClickConfirm(adapter, item, workflowStep)
|
|
|
|
|
- } else {
|
|
|
|
|
- val errorTipData = viewModel.getStepErrorTip(workflowStep)
|
|
|
|
|
- PopTip.tip(errorTipData.first)
|
|
|
|
|
- errorTipData.second?.let {
|
|
|
|
|
- checkLayout(it)
|
|
|
|
|
|
|
+ viewModel.canCheckStep().observe(this@JobExecuteFragment) {
|
|
|
|
|
+ if (it) {
|
|
|
|
|
+
|
|
|
|
|
+ if (item.stepIndex < viewModel.currentStepData?.stepIndex!!) {
|
|
|
|
|
+ return@observe
|
|
|
|
|
+ }
|
|
|
|
|
+ if (item.stepId != viewModel.currentStepData?.stepId && workflowStep?.enableSetLocker == false && workflowStep.enableSetColocker == false) {
|
|
|
|
|
+ PopTip(
|
|
|
|
|
+ getString(
|
|
|
|
|
+ R.string.please_done_operation,
|
|
|
|
|
+ viewModel.currentStepData?.androidStepContent
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
|
|
+ return@observe
|
|
|
|
|
+ }
|
|
|
|
|
+ if (workflowStep?.confirmType != 0 &&
|
|
|
|
|
+ (workflowStep?.enableSetLocker == true || workflowStep?.enableSetColocker == true)
|
|
|
|
|
+ ) {
|
|
|
|
|
+ stepClickConfirm(adapter, item, workflowStep)
|
|
|
|
|
+ } else if (workflowStep?.confirmType == 0 &&
|
|
|
|
|
+ workflowStep.confirmRoleCode == null &&
|
|
|
|
|
+ workflowStep.confirmUser == null
|
|
|
|
|
+ ) {
|
|
|
|
|
+ stepClickConfirm(adapter, item, workflowStep)
|
|
|
|
|
+ } else if (workflowStep?.confirmType == 0 &&
|
|
|
|
|
+ (workflowStep.confirmRoleCode != null && MainDomainData.roleKeys?.contains(
|
|
|
|
|
+ workflowStep.confirmRoleCode!!
|
|
|
|
|
+ ) == true) &&
|
|
|
|
|
+ workflowStep.confirmUser == null
|
|
|
|
|
+ ) {
|
|
|
|
|
+ stepClickConfirm(adapter, item, workflowStep)
|
|
|
|
|
+ } else if (workflowStep?.confirmType == 0 &&
|
|
|
|
|
+ (workflowStep.confirmRoleCode != null && MainDomainData.roleKeys?.contains(
|
|
|
|
|
+ workflowStep.confirmRoleCode!!
|
|
|
|
|
+ ) == true) &&
|
|
|
|
|
+ (workflowStep.confirmUser != null && MainDomainData.userInfo?.userId == workflowStep.confirmUser)
|
|
|
|
|
+ ) {
|
|
|
|
|
+ stepClickConfirm(adapter, item, workflowStep)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ val errorTipData = viewModel.getStepErrorTip(workflowStep)
|
|
|
|
|
+ PopTip.tip(errorTipData.first)
|
|
|
|
|
+ errorTipData.second?.let {
|
|
|
|
|
+ checkLayout(it)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|