const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DsD3K2iD.js","assets/Table-0PViRYCf.js","assets/index-9PRMimni.js","assets/index-CZ_CrH4_.css","assets/Table.vue_vue_type_style_index_0_scoped_7b9e6ece_lang-BoW2DV_e.js","assets/vuedraggable.umd-Co2xEC3p.js","assets/Render.vue_vue_type_script_lang-DKUYY0Zw.js","assets/componentMap-CElCaWis.js","assets/propTypes-CebMRUpe.js","assets/format-DgF6KtHk.js","assets/omit-B2_8Y6O_.js","assets/_flatRest-DBrd2CHT.js","assets/flatten-DeoUZLdb.js","assets/Table-Dcnz4X4a.css","assets/print-CT_2hrjP.js","assets/basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js","assets/basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js","assets/basicModal-DbyYhys_.css","assets/useModal-CO65vga3.js","assets/componentSetting-DVhNDBTO.js","assets/useTimeout-BxFilWvD.js","assets/usePageCache-DluHn7Yy.js","assets/tabsView-BXskTdVh.js","assets/Flex-CTSf12gq.js","assets/template-rpthWlT9.js","assets/index-kKnqLkWM.js","assets/index-B5YEBEit.js","assets/index-w8AeHQ0l.js","assets/TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js","assets/Modal.vue_vue_type_script_setup_true_lang-CYV2iErC.js","assets/BasicForm-dL_oCSPM.js","assets/SingleImageUpload-CNx4b9eC.js","assets/ImageUpload.vue_vue_type_style_index_0_scoped_cb086928_lang-D-28kXvw.js","assets/ImageUpload-2O79x_Q-.css","assets/ImageUpload-DUsnro3W.js","assets/BasicUpload.vue_vue_type_style_index_0_scoped_a4d0e930_lang-DxRbtP01.js","assets/BasicUpload-q2aOClOy.css","assets/BasicForm.vue_vue_type_style_index_0_scoped_b9e995ec_lang-CEvcLwxD.js","assets/BasicForm-foIylFd_.css","assets/BasicSelect-C_uwzMkE.js","assets/BasicSelect.vue_vue_type_style_index_0_scoped_772d51cc_lang-Brp6PjEU.js","assets/BasicSelect-DteQK1Vf.css","assets/dictionary-BRse4lkf.js","assets/index-DkvzUEqh.js","assets/AutoComplete-Dv1Bqed4.js","assets/TreeSelect-BZh2DeCh.js","assets/useForm-CKmgcynv.js","assets/modalSchemas-JSdK1AGK.js","assets/helper-Czt-QYps.js","assets/memoize-C3Z21RQJ.js"])))=>i.map(i=>d[i]);
import { d as Y, V as ee, f as te, e as oe, bk as ae, r as l, a as ne, a4 as k, ec as T, aw as ie, c as A, o as y, w as f, j as s, W as se, D as R, ds as q, l as t, ca as ce, H as re, h as N, F as P, gE as le, i as ue, A as me, X as pe, br as w, aj as de, cZ as fe, c_ as ve, __tla as __tla_0 } from "./index-9PRMimni.js";
import { T as _e } from "./tabsView-BuQA2jOW.js";
import { _ as ye } from "./rejectModal.vue_vue_type_script_setup_true_lang-Dp2G1yaW.js";
import { _ as be, __tla as __tla_1 } from "./Modal.vue_vue_type_script_setup_true_lang-Ub1dgidI.js";
import { u as he, N as ge, z as ke, s as M } from "./template-rpthWlT9.js";
import "./vuedraggable.umd-Co2xEC3p.js";
import "./element-resize-detector-D6t9qRKJ.js";
import "./Render.vue_vue_type_script_lang-DKUYY0Zw.js";
import "./basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js";
import "./basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js";
import "./BasicForm-dL_oCSPM.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 "./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 "./index-kKnqLkWM.js";
import "./AutoComplete-Dv1Bqed4.js";
import "./TreeSelect-BZh2DeCh.js";
import "./useForm-CKmgcynv.js";
import "./usePageCache-DluHn7Yy.js";
import "./useModal-CO65vga3.js";
import { __tla as __tla_2 } from "./index.vue_vue_type_style_index_0_scoped_b974e5ec_lang-_0QwzFKM.js";
import "./jobOrder-CGbsc7bp.js";
import "./has-CjqcrIOV.js";
import "./Table.vue_vue_type_style_index_0_scoped_7b9e6ece_lang-BoW2DV_e.js";
import "./componentMap-CElCaWis.js";
import "./format-DgF6KtHk.js";
import "./omit-B2_8Y6O_.js";
import "./_flatRest-DBrd2CHT.js";
import "./flatten-DeoUZLdb.js";
import "./print-CT_2hrjP.js";
import { __tla as __tla_3 } from "./index-8tHZJCCW.js";
import "./TimelineItem-Bkds7ZW8.js";
import "./Flex-CTSf12gq.js";
import "./schemas-BmKi-UM9.js";
import "./props-CLtNejQT.js";
let dt;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_2;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_3;
        } catch  {}
    })()
]).then(async ()=>{
    dt = Y({
        __name: "addManagementDetail",
        setup (Te) {
            const { t: o } = ee(), v = fe(), _ = te(), V = oe(), O = ae(), j = ve(), I = l(), C = l(), D = l(), K = l(), n = l(), u = l(), m = l(), p = l(), B = l([
                {
                    value: "feedbacks",
                    label: o("hsqe.management.feedbacks")
                },
                {
                    value: "deficiencies",
                    label: o("hsqe.management.deficiencies")
                }
            ]), c = ne({
                tabsList: [],
                activeKey: ""
            }), L = {
                basicTab: T(()=>w(()=>import("./index-DsD3K2iD.js").then(async (m)=>{
                            await m.__tla;
                            return m;
                        }), __vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]))),
                feedbacks: T(()=>w(()=>import("./index-B5YEBEit.js"), __vite__mapDeps([26,2,3]))),
                deficiencies: T(()=>w(()=>import("./index-w8AeHQ0l.js").then(async (m)=>{
                            await m.__tla;
                            return m;
                        }), __vite__mapDeps([27,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,25,44,45,46,47,24,48,49])))
            }, S = k(()=>L[c.activeKey] || L.basicTab), b = k(()=>_.query.type == "view" || u.value && n.value?.updateEnable !== 1), F = k(()=>_.query.type == "view" && n.value?.approveShow == 1 && n.value?.approveStatus != 5);
            async function x(a) {
                p.value = !0;
                try {
                    const e = await M({
                        templateCode: "seniorVisit",
                        uuid: u.value
                    });
                    if (!e) {
                        p.value = !1, v.error("No data found");
                        return;
                    }
                    if (n.value = e || {}, a) {
                        p.value = !1;
                        return;
                    }
                    const i = n.value?.checkTeb || {}, r = [];
                    for(const d in i)r.push({
                        label: i[d]?.[0]?.[O.getLocale === "en" ? "inspectionTypeEn" : "inspectionTypeZh"],
                        value: d
                    });
                    c.tabsList = [
                        ...r,
                        ...B.value
                    ], c.activeKey = c.activeKey || c.tabsList[0]?.value, I.value?.onElementResize?.(), p.value = !1;
                } catch  {
                    p.value = !1;
                }
            }
            function H(a) {
                const e = a?.checkTeb || {}, i = c.tabsList.filter((r)=>r.dynamic);
                for (const r of i)for (const d of e[r.value] || [])if (!d.inspectionResult) return v.error(o("hsqe.auditInspection.qualitySafetyInspection.submitTips") + r.label), !1;
                return !0;
            }
            async function E(a) {
                const e = de(n.value);
                if (a === "submit" && !H(e)) return Promise.reject();
                delete e.inputDone, delete e.updateEnable, delete e.submitEnable, delete e.approveStatus, delete e.reportNum, delete e.create_time, delete e.is_deleted, delete e.deficiencyList, m.value = !0;
                try {
                    await he({
                        ...e,
                        template_code: "seniorVisit"
                    }), a !== "submit" && (v.success(o("common.saveSuccessText")), m.value = !1, await x(!0));
                } catch  {
                    m.value = !1;
                }
            }
            async function W() {
                await E("submit");
                try {
                    m.value = !0, await ge({
                        shipId: n.value?.shipId,
                        busId: u.value,
                        moduleCode: "seniorVisit"
                    }), v.success(o("common.submitSuccessText")), h(), m.value = !1;
                } catch  {
                    m.value = !1;
                }
            }
            async function $() {
                await ke({
                    comment: "pass",
                    busId: u.value,
                    moduleCode: "seniorVisit"
                }), v.success(o("common.submitApproveText")), h();
            }
            async function z() {
                D.value?.showModal();
            }
            function Q() {
                h();
            }
            function U() {
                C.value?.showModal(u.value, "seniorVisit");
            }
            async function Z() {
                const a = await M({
                    templateCode: "seniorVisit",
                    uuid: u.value
                });
                n.value && (n.value.deficiencyList = a?.deficiencyList);
            }
            function h() {
                V.push({
                    name: _.query.sourcePath || "HSQE_AuditInspection_ReportList"
                });
            }
            function X() {
                const a = ()=>{
                    V.push({
                        name: "Add_HSQE_AuditInspection_ReportList_VesselInspection_AddManagement",
                        query: {
                            ..._.query,
                            uuid: u.value
                        }
                    });
                };
                if (b.value) {
                    a();
                    return;
                }
                j.info({
                    title: o("hsqe.auditInspection.back.title"),
                    content: o("hsqe.auditInspection.back.cont"),
                    positiveText: o("common.okText"),
                    negativeText: o("common.cancelText"),
                    onPositiveClick: async ()=>{
                        a();
                    }
                });
            }
            async function G() {
                u.value = _.query.uuid || void 0, await x();
            }
            return ie(()=>{
                G();
            }), (a, e)=>{
                const i = le, r = re, d = se, J = pe;
                return y(), A(J, {
                    loading: t(p)
                }, {
                    default: f(()=>[
                            s(d, {
                                bordered: !1,
                                segmented: {
                                    content: !0
                                },
                                class: "ui-card"
                            }, {
                                header: f(()=>[
                                        s(r, {
                                            align: "center"
                                        }, {
                                            default: f(()=>[
                                                    s(i, {
                                                        tooltip: t(o)("common.backToList"),
                                                        secondary: !1,
                                                        type: "text",
                                                        iconName: "back",
                                                        onClick: X
                                                    }, null, 8, [
                                                        "tooltip"
                                                    ]),
                                                    ue("h1", null, me(t(o)("hsqe.management.visitReport")), 1)
                                                ]),
                                            _: 1
                                        })
                                    ]),
                                "header-extra": f(()=>[
                                        s(r, {
                                            align: "center"
                                        }, {
                                            default: f(()=>[
                                                    t(b) ? R("", !0) : (y(), N(P, {
                                                        key: 0
                                                    }, [
                                                        s(i, {
                                                            key: "save",
                                                            tooltip: t(o)("common.saveText"),
                                                            loading: t(m),
                                                            iconName: "save",
                                                            onClick: E
                                                        }, null, 8, [
                                                            "tooltip",
                                                            "loading"
                                                        ]),
                                                        s(i, {
                                                            key: "submit",
                                                            tooltip: t(o)("common.optionsSubmitText"),
                                                            loading: t(m),
                                                            iconName: "submit",
                                                            onClick: W
                                                        }, null, 8, [
                                                            "tooltip",
                                                            "loading"
                                                        ])
                                                    ], 64)),
                                                    t(F) ? (y(), N(P, {
                                                        key: 1
                                                    }, [
                                                        s(i, {
                                                            key: "approve",
                                                            tooltip: t(o)("common.optionsApproveText"),
                                                            iconName: "approve",
                                                            onClick: $
                                                        }, null, 8, [
                                                            "tooltip"
                                                        ]),
                                                        s(i, {
                                                            key: "returned",
                                                            tooltip: t(o)("common.optionsReturnText"),
                                                            iconName: "returned",
                                                            onClick: z
                                                        }, null, 8, [
                                                            "tooltip"
                                                        ])
                                                    ], 64)) : R("", !0),
                                                    s(i, {
                                                        key: "log",
                                                        tooltip: t(o)("common.reviewHistory"),
                                                        iconName: "log",
                                                        onClick: U
                                                    }, null, 8, [
                                                        "tooltip"
                                                    ])
                                                ]),
                                            _: 1
                                        })
                                    ]),
                                default: f(()=>[
                                        s(_e, {
                                            modelValue: t(c),
                                            "onUpdate:modelValue": e[0] || (e[0] = (g)=>q(c) ? c.value = g : null),
                                            ref_key: "tabsViewRef",
                                            ref: I,
                                            class: "mb-2"
                                        }, null, 8, [
                                            "modelValue"
                                        ]),
                                        t(S) ? (y(), A(ce(t(S)), {
                                            dataInfo: t(n),
                                            "onUpdate:dataInfo": e[1] || (e[1] = (g)=>q(n) ? n.value = g : null),
                                            ref_key: "componentRef",
                                            ref: K,
                                            key: t(c).activeKey,
                                            currentTab: t(c).activeKey,
                                            readOnly: t(b),
                                            onRefreshDeficiency: Z
                                        }, null, 40, [
                                            "dataInfo",
                                            "currentTab",
                                            "readOnly"
                                        ])) : R("", !0)
                                    ]),
                                _: 1
                            }),
                            s(be, {
                                ref_key: "modalRef",
                                ref: C
                            }, null, 512),
                            s(ye, {
                                ref_key: "rejectModalRef",
                                ref: D,
                                onSuccess: Q
                            }, null, 512)
                        ]),
                    _: 1
                }, 8, [
                    "loading"
                ]);
            };
        }
    });
});
export { dt as default, __tla };
