diff --git a/app/Http/Controllers/ReportController.php b/app/Http/Controllers/ReportController.php index 4ddfa1a..64ddff0 100644 --- a/app/Http/Controllers/ReportController.php +++ b/app/Http/Controllers/ReportController.php @@ -423,6 +423,7 @@ class ReportController extends Controller $ids = $request->post('ids'); $r1 = self::get_report($ids[0]); $r2 = self::get_report($ids[1]); + if($r1[0]['体检状态']!='报告已出' or $r2[0]['体检状态']!='报告已出') Yo::error_echo(200090); $res = self::orderReportTime([$r1[0], $r2[0]]); $r1 = [$res[0]]; $r2 = [$res[1]]; @@ -545,7 +546,7 @@ class ReportController extends Controller ]; if (count($res) != 0) { - + if($res[0]['体检状态']!='报告已出') Yo::error_echo(200090); $info = self::orderReport($res[0]); // Yo::error_exit([ // 'message' => "res", diff --git a/config/code.php b/config/code.php index 83d8895..dc60150 100644 --- a/config/code.php +++ b/config/code.php @@ -137,4 +137,5 @@ return [ 200087 => '请输入分账名称', 200088 => '分账名称长度在1-50位字符之间', 200089 => '分账类型不支持追回', + 200090 => '该报告未出', ]; diff --git a/彰武县人民医院报告对比/pages/main/choose/choose.vue b/彰武县人民医院报告对比/pages/main/choose/choose.vue index 2a0432c..238f17b 100644 --- a/彰武县人民医院报告对比/pages/main/choose/choose.vue +++ b/彰武县人民医院报告对比/pages/main/choose/choose.vue @@ -40,16 +40,16 @@ }) const choose_active = ref([]) const chooseReportClick = (key) => { - let index = choose_active.value.indexOf(key) - if (index === -1) { - if (choose_active.value.length === 2) { - uni.$lu.toast("最多选择两份报告对比") - } else { - choose_active.value.push(key) - } - } else { - choose_active.value.splice(key, 1) - } + let index = choose_active.value.indexOf(key); + if (index === -1) { // 如果当前点击的报告没有被选中 + if (choose_active.value.length === 2) { + uni.$lu.toast("最多选择两份报告对比"); + } else { + choose_active.value.push(key); // 添加到已选报告列表 + } + } else { // 当前点击的报告已经被选中了,执行删除操作 + choose_active.value.splice(index, 1); // 注意这里应该是index而不是key + } } const chooseDoneClick = () => {