import { d as me, r, e as ye, f as be, V as ge, a as N, a4 as _e, aw as ve, d9 as he, c as d, o as p, w as o, j as s, W as Ie, i as c, ds as Re, l as e, aE as h, aF as q, H as we, aI as Ce, p as b, A as f, B as ke, D as C, t as De, _ as xe, k as qe, X as Me, cZ as Te, c_ as Ae, gR as Be, gS as Se, gT as Ee, __tla as __tla_0 } from "./index-9PRMimni.js";
import { _ as je } from "./basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js";
import "./basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js";
import { T as Ve } from "./tabsView-BuQA2jOW.js";
import { B as Pe, C as Le, D as ze, E as Ne, w as $e, F as Fe } from "./template-rpthWlT9.js";
import { B as He } from "./Table-0PViRYCf.js";
import { _ as Oe, __tla as __tla_1 } from "./index.vue_vue_type_script_setup_true_lang-C4FmXXX1.js";
import { _ as Ue } from "./index.vue_vue_type_script_setup_true_lang-B9JIR-4v.js";
import { _ as We, __tla as __tla_2 } from "./index.vue_vue_type_script_setup_true_lang-9kVx75x9.js";
import { _ as Ge } from "./index.vue_vue_type_script_setup_true_lang-C0Gzwue0.js";
import { _ as Ke, __tla as __tla_3 } from "./historyModal.vue_vue_type_script_setup_true_lang-9ean571k.js";
import { u as $ } from "./useModal-CO65vga3.js";
import "./vuedraggable.umd-Co2xEC3p.js";
import "./element-resize-detector-D6t9qRKJ.js";
import "./Render.vue_vue_type_script_lang-DKUYY0Zw.js";
import "./index-kKnqLkWM.js";
import "./Table.vue_vue_type_style_index_0_scoped_7b9e6ece_lang-BoW2DV_e.js";
import "./componentMap-CElCaWis.js";
import "./propTypes-CebMRUpe.js";
import "./format-DgF6KtHk.js";
import "./omit-B2_8Y6O_.js";
import "./_flatRest-DBrd2CHT.js";
import "./flatten-DeoUZLdb.js";
import "./print-CT_2hrjP.js";
import "./componentSetting-DVhNDBTO.js";
import "./useTimeout-BxFilWvD.js";
import "./usePageCache-DluHn7Yy.js";
import "./tabsView-BXskTdVh.js";
import "./Flex-CTSf12gq.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 "./ImageUpload-DUsnro3W.js";
import "./BasicUpload.vue_vue_type_style_index_0_scoped_a4d0e930_lang-DxRbtP01.js";
import "./BasicForm.vue_vue_type_style_index_0_scoped_b9e995ec_lang-CEvcLwxD.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 "./helper-Czt-QYps.js";
import "./memoize-C3Z21RQJ.js";
import { __tla as __tla_4 } from "./schemas-C0ECnkWr.js";
import "./planner-BebmniHR.js";
import { __tla as __tla_5 } from "./modalSchemas-dKMYM0AT.js";
import { __tla as __tla_6 } from "./modalSchemas-D9c32bW5.js";
import { __tla as __tla_7 } from "./modalSchemas-JSdK1AGK.js";
import { __tla as __tla_8 } from "./modalSchemas-DzYfMuRt.js";
import "./useForm-CKmgcynv.js";
import "./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";
import { __tla as __tla_9 } from "./index.vue_vue_type_style_index_0_scoped_b974e5ec_lang-_0QwzFKM.js";
import "./jobOrder-CGbsc7bp.js";
import "./has-CjqcrIOV.js";
import { __tla as __tla_10 } from "./index-8tHZJCCW.js";
import "./TimelineItem-Bkds7ZW8.js";
import "./schemas-BmKi-UM9.js";
import "./props-CLtNejQT.js";
let ei;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_2;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_3;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_4;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_5;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_6;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_7;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_8;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_9;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_10;
        } catch  {}
    })()
]).then(async ()=>{
    ei = me({
        __name: "index",
        setup (Qe) {
            const g = r(), j = r(), M = r(), T = r(), k = ye(), _ = be(), F = Ae(), { t: a } = ge(), I = Te(), m = r(!1), V = r();
            let R = N({
                operationMemo: ""
            });
            const [H] = $({
                title: a("hsqe.deficiency.historicalRecords"),
                closable: !1,
                maskClosable: !0,
                width: 680,
                subBtuText: a("common.okText"),
                cancelText: a("common.cancelText")
            }), O = _e(()=>[
                    {
                        label: a("hsqe.auditInspection.vesselInspection.shipVisitReport.deficiencyReport.tabBasicInfo"),
                        value: "basicInfo",
                        compPage: "basicInfo"
                    },
                    {
                        label: a("hsqe.auditInspection.vesselInspection.shipVisitReport.deficiencyReport.tabCauseAnalysis"),
                        value: "causeAnalysis",
                        compPage: "causeAnalysis"
                    },
                    {
                        label: a("hsqe.auditInspection.vesselInspection.shipVisitReport.deficiencyReport.tabAction"),
                        value: "action",
                        compPage: "action"
                    },
                    {
                        label: a("hsqe.auditInspection.vesselInspection.shipVisitReport.deficiencyReport.rabAttachments"),
                        value: "attachments",
                        compPage: "attachments"
                    }
                ]), A = N({
                tabsList: O.value,
                collapsed: !1,
                activeKey: "basicInfo"
            }), U = [
                {
                    title: "Reviewed By",
                    key: "username"
                },
                {
                    title: "Reviewed Date",
                    key: "operateTime"
                },
                {
                    title: "Status",
                    key: "displayStatus"
                },
                {
                    title: "Review Comments",
                    key: "comment"
                }
            ], [W, { openModal: G, closeModal: K, setSubLoading: B }] = $({
                title: a("hsqe.deficiency.captainReject"),
                closable: !1,
                maskClosable: !0,
                width: 680,
                subBtuText: a("common.okText"),
                cancelText: a("common.cancelText")
            }), Q = {
                operationMemo: {
                    required: !0,
                    message: a("hsqe.planner.modal.reasonHint"),
                    trigger: "blur"
                }
            }, X = r(), n = r(), Z = r(), J = r("basicInfo"), v = r("basicInfo"), P = r(), y = r({});
            async function Y() {
                n.value = await Pe({
                    deficiencyId: _.query.id
                }), Z.value = _.query.isEdit, _.query.type == "view" ? m.value = !0 : m.value = !1, T.value.initData();
            }
            function ee(i) {
                v.value = i.value, J.value = i.compPage || "basicInfo";
            }
            function te(i) {
                y.value = i;
            }
            function ie() {
                sessionStorage.setItem("deficiencyTab", "deficiency"), k.back();
            }
            async function oe() {
                if (v.value == "action") {
                    const i = await M.value.getData(y.value.reportId);
                    if (i.correctActionReview == "yes" || i.correctActionReview == "no") {
                        await S(!1);
                        let t = await g.value.getData(!1);
                        [
                            "pscReport",
                            "fscReport"
                        ].includes(t.reportType) ? await ae(i) : await D(i);
                    } else I.warning(a("hsqe.deficiency.verifiedInfo"));
                } else I.warning(a("hsqe.deficiency.actionTip"));
            }
            async function D(i) {
                await Le({
                    id: _.query.id,
                    operation: i.correctActionReview == "yes" ? "superintendent_close" : "superintendent_reject",
                    comment: i.correctActionComment
                }), k.push({
                    path: "/hsqe/auditInspection/reportLis"
                }), x();
            }
            async function ae(i) {
                i.correctActionReview == "yes" ? F.warning({
                    title: a("hsqe.nc.tip"),
                    content: a("hsqe.nc.content"),
                    positiveText: a("hsqe.nc.yes"),
                    negativeText: a("hsqe.nc.no"),
                    draggable: !0,
                    onPositiveClick: async ()=>{
                        await D(i);
                        let t = await ze(_.query.id);
                        k.push({
                            name: "Add_HSQE_AuditInspection_ReportList_Nc_DeficiencyReport",
                            query: {
                                id: String(t),
                                isEdit: "1"
                            }
                        });
                    },
                    onNegativeClick: async ()=>{
                        await D(i);
                    }
                }) : i.correctActionReview == "no" && D(i);
            }
            async function se() {
                let i = await g.value.getData(!1);
                await Be({
                    shipId: i.shipId,
                    busId: i.id,
                    moduleCode: "deficiencyModuleCode",
                    subModuleCode: i.subModuleCode,
                    comment: R.operationMemo
                }), x();
            }
            async function ne() {
                V.value.validate(async (i)=>{
                    if (i) B(!1);
                    else try {
                        let t = await g.value.getData(!1);
                        await Se({
                            shipId: t.shipId,
                            busId: t.id,
                            moduleCode: "deficiencyModuleCode",
                            subModuleCode: t.subModuleCode,
                            comment: R.operationMemo
                        }), B(!1), K(), x();
                    } catch  {
                        B(!1);
                    }
                });
            }
            const ce = async ()=>{
                const i = await Ne({
                    busId: _.query.id,
                    moduleCode: "approveDeficiency"
                });
                return {
                    list: i,
                    total: i.length
                };
            };
            async function re() {
                let i = await g.value.getData(!1);
                console.error(i, "basicInfo"), P.value?.showModal(i);
            }
            function x() {
                I.success(a("hsqe.deficiency.operationSuccessful")), k.go(-1);
            }
            async function S(i) {
                let t = {};
                if (t.basicDto = await g.value.getData(y.value.status === "new"), t.photoDtoList = T.value.getData(y.value.reportId), t.actionDto = await M.value.getData(i, y.value.reportId), t.causeDtoList = j.value.getData(i, y.value.reportId), y.value.status === "new") t.basicDto && (await $e(t.basicDto), I.success(a("common.saveSuccessText")));
                else if (t.causeDtoList && t.actionDto) {
                    let l = await Fe(t);
                    i ? (await Ee({
                        shipId: l.shipId,
                        busId: l.id,
                        subModuleCode: l.subModuleCode,
                        moduleCode: "deficiencyModuleCode"
                    }), x()) : I.success(a("hsqe.deficiency.operationSuccessful"));
                }
            }
            return ve(()=>{
                Y();
            }), (i, t)=>{
                const l = ke, u = Ce, E = we, le = Ie, L = je, ue = qe, de = xe, pe = De, fe = Me, z = he("debounce");
                return p(), d(fe, null, {
                    default: o(()=>[
                            s(le, {
                                bordered: !1,
                                class: "py-3 proCard",
                                size: "small",
                                segmented: {
                                    content: !0
                                },
                                "content-style": "padding: 20px 15px 0 15px;"
                            }, {
                                header: o(()=>[
                                        c("div", null, [
                                            s(E, {
                                                justify: "space-between"
                                            }, {
                                                default: o(()=>[
                                                        s(E, {
                                                            align: "center"
                                                        }, {
                                                            default: o(()=>[
                                                                    s(u, {
                                                                        trigger: "hover"
                                                                    }, {
                                                                        trigger: o(()=>[
                                                                                s(l, {
                                                                                    border: !1,
                                                                                    type: "text",
                                                                                    class: "size-8",
                                                                                    onClick: ie
                                                                                }, {
                                                                                    icon: o(()=>t[2] || (t[2] = [
                                                                                            c("i", {
                                                                                                class: "iconfont icon-a-shangyibu2 text-[16px]"
                                                                                            }, null, -1)
                                                                                        ])),
                                                                                    _: 1
                                                                                })
                                                                            ]),
                                                                        default: o(()=>[
                                                                                b(" " + f(e(a)("hsqe.noticeCircular.back")), 1)
                                                                            ]),
                                                                        _: 1
                                                                    }),
                                                                    s(u, {
                                                                        trigger: "click"
                                                                    }, {
                                                                        trigger: o(()=>[
                                                                                c("span", null, f(e(a)("hsqe.rightShip.findingsReport")), 1)
                                                                            ]),
                                                                        _: 1
                                                                    })
                                                                ]),
                                                            _: 1
                                                        }),
                                                        s(E, {
                                                            justify: "end"
                                                        }, {
                                                            default: o(()=>[
                                                                    !e(m) && e(n)?.hasBasicInfoEdit == "1" ? (p(), d(u, {
                                                                        key: 0,
                                                                        trigger: "hover"
                                                                    }, {
                                                                        trigger: o(()=>[
                                                                                h((p(), d(l, {
                                                                                    type: "primary",
                                                                                    strong: "",
                                                                                    secondary: "",
                                                                                    bordered: "",
                                                                                    class: "size-8"
                                                                                }, {
                                                                                    icon: o(()=>t[3] || (t[3] = [
                                                                                            c("i", {
                                                                                                class: "iconfont icon-Save text-[16px]"
                                                                                            }, null, -1)
                                                                                        ])),
                                                                                    _: 1
                                                                                })), [
                                                                                    [
                                                                                        z,
                                                                                        ()=>S(!1),
                                                                                        "1000"
                                                                                    ]
                                                                                ])
                                                                            ]),
                                                                        default: o(()=>[
                                                                                b(" " + f(e(a)("hsqe.deficiency.deficiencySave")), 1)
                                                                            ]),
                                                                        _: 1
                                                                    })) : C("", !0),
                                                                    e(n)?.hasDeficiencyCommit == "1" && !e(m) ? (p(), d(u, {
                                                                        key: 1,
                                                                        trigger: "hover"
                                                                    }, {
                                                                        trigger: o(()=>[
                                                                                h((p(), d(l, {
                                                                                    type: "primary",
                                                                                    strong: "",
                                                                                    secondary: "",
                                                                                    bordered: "",
                                                                                    class: "size-8"
                                                                                }, {
                                                                                    icon: o(()=>t[4] || (t[4] = [
                                                                                            c("i", {
                                                                                                class: "iconfont icon-Submit text-[16px]"
                                                                                            }, null, -1)
                                                                                        ])),
                                                                                    _: 1
                                                                                })), [
                                                                                    [
                                                                                        z,
                                                                                        ()=>S(!0),
                                                                                        "1000"
                                                                                    ]
                                                                                ])
                                                                            ]),
                                                                        default: o(()=>[
                                                                                b(" " + f(e(a)("hsqe.deficiency.deficiencyCommit")), 1)
                                                                            ]),
                                                                        _: 1
                                                                    })) : C("", !0),
                                                                    e(n)?.hasOfficerCommit == "1" && !e(m) ? (p(), d(u, {
                                                                        key: 2,
                                                                        trigger: "hover"
                                                                    }, {
                                                                        trigger: o(()=>[
                                                                                s(l, {
                                                                                    type: "primary",
                                                                                    strong: "",
                                                                                    secondary: "",
                                                                                    bordered: "",
                                                                                    class: "size-8",
                                                                                    onClick: oe
                                                                                }, {
                                                                                    icon: o(()=>t[5] || (t[5] = [
                                                                                            c("i", {
                                                                                                class: "iconfont icon-Submit text-[16px]"
                                                                                            }, null, -1)
                                                                                        ])),
                                                                                    _: 1
                                                                                })
                                                                            ]),
                                                                        default: o(()=>[
                                                                                b(" " + f(e(a)("hsqe.deficiency.officerCommit")), 1)
                                                                            ]),
                                                                        _: 1
                                                                    })) : C("", !0),
                                                                    e(n)?.hasCaptainPass == "1" && !e(m) ? (p(), d(u, {
                                                                        key: 3,
                                                                        trigger: "hover"
                                                                    }, {
                                                                        trigger: o(()=>[
                                                                                s(l, {
                                                                                    type: "primary",
                                                                                    strong: "",
                                                                                    secondary: "",
                                                                                    bordered: "",
                                                                                    class: "size-8",
                                                                                    onClick: se
                                                                                }, {
                                                                                    icon: o(()=>t[6] || (t[6] = [
                                                                                            c("i", {
                                                                                                class: "iconfont icon-Approve text-[16px]"
                                                                                            }, null, -1)
                                                                                        ])),
                                                                                    _: 1
                                                                                })
                                                                            ]),
                                                                        default: o(()=>[
                                                                                b(" " + f(e(a)("hsqe.deficiency.captainPass")), 1)
                                                                            ]),
                                                                        _: 1
                                                                    })) : C("", !0),
                                                                    e(n)?.hasCaptainReject == "1" && !e(m) ? (p(), d(u, {
                                                                        key: 4,
                                                                        trigger: "hover"
                                                                    }, {
                                                                        trigger: o(()=>[
                                                                                s(l, {
                                                                                    type: "primary",
                                                                                    strong: "",
                                                                                    secondary: "",
                                                                                    bordered: "",
                                                                                    class: "size-8",
                                                                                    onClick: e(G)
                                                                                }, {
                                                                                    icon: o(()=>t[7] || (t[7] = [
                                                                                            c("i", {
                                                                                                class: "iconfont icon-Returned text-[16px]"
                                                                                            }, null, -1)
                                                                                        ])),
                                                                                    _: 1
                                                                                }, 8, [
                                                                                    "onClick"
                                                                                ])
                                                                            ]),
                                                                        default: o(()=>[
                                                                                b(" " + f(e(a)("hsqe.deficiency.captainReject")), 1)
                                                                            ]),
                                                                        _: 1
                                                                    })) : C("", !0),
                                                                    s(u, {
                                                                        trigger: "hover"
                                                                    }, {
                                                                        trigger: o(()=>[
                                                                                s(l, {
                                                                                    type: "primary",
                                                                                    strong: "",
                                                                                    secondary: "",
                                                                                    bordered: "",
                                                                                    class: "size-8",
                                                                                    onClick: re
                                                                                }, {
                                                                                    icon: o(()=>t[8] || (t[8] = [
                                                                                            c("i", {
                                                                                                class: "iconfont icon-Log text-[16px]"
                                                                                            }, null, -1)
                                                                                        ])),
                                                                                    _: 1
                                                                                })
                                                                            ]),
                                                                        default: o(()=>[
                                                                                b(" " + f(e(a)("hsqe.deficiency.historicalRecords")), 1)
                                                                            ]),
                                                                        _: 1
                                                                    })
                                                                ]),
                                                            _: 1
                                                        })
                                                    ]),
                                                _: 1
                                            })
                                        ])
                                    ]),
                                default: o(()=>[
                                        s(Ve, {
                                            modelValue: e(A),
                                            "onUpdate:modelValue": t[0] || (t[0] = (w)=>Re(A) ? A.value = w : null),
                                            onChangeTab: ee
                                        }, null, 8, [
                                            "modelValue"
                                        ]),
                                        c("div", null, [
                                            h(c("div", null, [
                                                s(Oe, {
                                                    ref_key: "basicInfoRef",
                                                    ref: g,
                                                    basicInfoEdit: e(n)?.hasBasicInfoEditFlag ?? !1,
                                                    btnsDisabled: e(n),
                                                    onGetBaseInfo: te
                                                }, null, 8, [
                                                    "basicInfoEdit",
                                                    "btnsDisabled"
                                                ])
                                            ], 512), [
                                                [
                                                    q,
                                                    e(v) === "basicInfo"
                                                ]
                                            ]),
                                            h(c("div", null, [
                                                s(Ue, {
                                                    ref_key: "causeAnalysisRef",
                                                    ref: j,
                                                    basicInfoEdit: e(n)?.hasBasicInfoEditFlag ?? !1,
                                                    btnsDisabled: e(n)
                                                }, null, 8, [
                                                    "basicInfoEdit",
                                                    "btnsDisabled"
                                                ])
                                            ], 512), [
                                                [
                                                    q,
                                                    e(v) === "causeAnalysis"
                                                ]
                                            ]),
                                            h(c("div", null, [
                                                s(We, {
                                                    ref_key: "actionRef",
                                                    ref: M,
                                                    basicInfoEdit: e(n)?.hasBasicInfoEditFlag ?? !1,
                                                    btnsDisabled: e(n)
                                                }, null, 8, [
                                                    "basicInfoEdit",
                                                    "btnsDisabled"
                                                ])
                                            ], 512), [
                                                [
                                                    q,
                                                    e(v) === "action"
                                                ]
                                            ]),
                                            h(c("div", null, [
                                                s(Ge, {
                                                    ref_key: "attachmentsRef",
                                                    ref: T,
                                                    basicInfoEdit: e(n)?.hasBasicInfoEditFlag ?? !1,
                                                    btnsDisabled: e(n)
                                                }, null, 8, [
                                                    "basicInfoEdit",
                                                    "btnsDisabled"
                                                ])
                                            ], 512), [
                                                [
                                                    q,
                                                    e(v) === "attachments"
                                                ]
                                            ])
                                        ])
                                    ]),
                                _: 1
                            }),
                            s(L, {
                                onRegister: e(H),
                                ref: "modalRef"
                            }, {
                                default: o(()=>[
                                        s(e(He), {
                                            columns: U,
                                            request: ()=>ce(),
                                            "row-key": (w)=>w.id,
                                            ref_key: "basicTableRef",
                                            ref: X
                                        }, null, 8, [
                                            "request",
                                            "row-key"
                                        ])
                                    ]),
                                _: 1
                            }, 8, [
                                "onRegister"
                            ]),
                            s(L, {
                                onRegister: e(W),
                                ref: "rejectModalRef",
                                onOnOk: ne
                            }, {
                                default: o(()=>[
                                        s(pe, {
                                            model: e(R),
                                            rules: Q,
                                            ref_key: "formRef",
                                            ref: V
                                        }, {
                                            default: o(()=>[
                                                    s(de, {
                                                        label: e(a)("hsqe.planner.modal.reason"),
                                                        path: "operationMemo"
                                                    }, {
                                                        default: o(()=>[
                                                                s(ue, {
                                                                    type: "textarea",
                                                                    value: e(R).operationMemo,
                                                                    "onUpdate:value": t[1] || (t[1] = (w)=>e(R).operationMemo = w),
                                                                    class: "h-[80px]"
                                                                }, null, 8, [
                                                                    "value"
                                                                ])
                                                            ]),
                                                        _: 1
                                                    }, 8, [
                                                        "label"
                                                    ])
                                                ]),
                                            _: 1
                                        }, 8, [
                                            "model"
                                        ])
                                    ]),
                                _: 1
                            }, 8, [
                                "onRegister"
                            ]),
                            s(Ke, {
                                ref_key: "historyModalRef",
                                ref: P
                            }, null, 512)
                        ]),
                    _: 1
                });
            };
        }
    });
});
export { ei as default, __tla };
