import { _ as j } from "./basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js";
import "./basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js";
import { s as k, __tla as __tla_0 } from "./schemas-DF6duLaU.js";
import { z as C, A as M } from "./template-rpthWlT9.js";
import { B as I } from "./BasicForm-dL_oCSPM.js";
import { u as P } from "./useForm-CKmgcynv.js";
import { d as V, V as D, u as N, r as c, c as S, o as z, w as r, j as p, H as E, B as G, p as H, A as O, l as a, __tla as __tla_1 } from "./index-9PRMimni.js";
import { u as T } from "./useModal-CO65vga3.js";
import { __tla as __tla_2 } from "./schemas-DzvLPsci.js";
import "./isEmpty-BUg1OsQj.js";
import "./illnessInjury-CN3bQPcI.js";
import "./index-kKnqLkWM.js";
import "./Render.vue_vue_type_script_lang-DKUYY0Zw.js";
import "./SingleImageUpload-CNx4b9eC.js";
import "./ImageUpload.vue_vue_type_style_index_0_scoped_cb086928_lang-D-28kXvw.js";
import "./componentSetting-DVhNDBTO.js";
import "./ImageUpload-DUsnro3W.js";
import "./vuedraggable.umd-Co2xEC3p.js";
import "./BasicUpload.vue_vue_type_style_index_0_scoped_a4d0e930_lang-DxRbtP01.js";
import "./tabsView-BXskTdVh.js";
import "./BasicForm.vue_vue_type_style_index_0_scoped_b9e995ec_lang-CEvcLwxD.js";
import "./propTypes-CebMRUpe.js";
import "./BasicSelect-C_uwzMkE.js";
import "./BasicSelect.vue_vue_type_style_index_0_scoped_772d51cc_lang-Brp6PjEU.js";
import "./dictionary-BRse4lkf.js";
import "./index-DkvzUEqh.js";
import "./AutoComplete-Dv1Bqed4.js";
import "./TreeSelect-BZh2DeCh.js";
import "./usePageCache-DluHn7Yy.js";
let he;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_2;
        } catch  {}
    })()
]).then(async ()=>{
    he = V({
        __name: "ExamineAndApproveForm",
        emits: [
            "success"
        ],
        setup ($, { expose: d, emit: f }) {
            const { t: o } = D(), t = N(), _ = c(), n = c(0), i = c(""), l = f, { examineAndApproveSchema: v } = k(), [g, { getFieldsValue: m }] = P({
                gridProps: {
                    cols: 13
                },
                schemas: v,
                labelPlacement: "left",
                showActionButtonGroup: !1,
                showAdvancedButton: !1
            }), [A, { openModal: h, closeModal: s }] = T({
                title: o("interview.examineAndApprove"),
                width: 500
            });
            function w(e, u) {
                n.value = e, i.value = u, h();
            }
            function R() {
                m().trainingResult == "1" ? x() : y();
            }
            async function x() {
                try {
                    const e = await C({
                        comment: m().remark,
                        busId: n.value,
                        moduleCode: i.value
                    });
                    e.data.code === 200 ? (t.success(o("jobPlan.viewDetails.btnApprove")), s(), l("success")) : t.error(e.data.msg);
                } catch  {
                    s();
                }
            }
            async function y() {
                try {
                    const e = await M({
                        comment: m().remark,
                        busId: n.value,
                        moduleCode: i.value
                    });
                    if (e.data.code === 200) {
                        t.success(o("jobPlan.viewDetails.btnReturn")), l("success");
                        return;
                    } else t.error(e.data.msg);
                    s();
                } catch  {
                    s();
                }
            }
            return d({
                handleOpenModal: w
            }), (e, u)=>{
                const B = G, b = E, F = j;
                return z(), S(F, {
                    ref_key: "modalRef",
                    ref: _,
                    onRegister: a(A)
                }, {
                    default: r(()=>[
                            p(a(I), {
                                onRegister: a(g)
                            }, null, 8, [
                                "onRegister"
                            ])
                        ]),
                    action: r(()=>[
                            p(b, {
                                class: "flex-1",
                                justify: "center"
                            }, {
                                default: r(()=>[
                                        p(B, {
                                            type: "primary",
                                            onClick: R
                                        }, {
                                            default: r(()=>[
                                                    H(O(a(o)("interview.confirm")), 1)
                                                ]),
                                            _: 1
                                        })
                                    ]),
                                _: 1
                            })
                        ]),
                    _: 1
                }, 8, [
                    "onRegister"
                ]);
            };
        }
    });
});
export { he as default, __tla };
