import { r as u, V as A, bk as G, Z as q, ae as Se, d as qe, f as xe, e as Re, u as Ce, co as Ie, a as ke, gW as I, gX as k, gJ as Te, aw as we, d9 as Ne, c as g, o as y, w as o, j as d, W as Pe, l as n, ds as U, H as De, D as P, aI as Ae, p as T, A as w, aE as $, B as Be, ca as D, i as z, X as Le, c_ as Ve, v as Ee, __tla as __tla_0 } from "./index-9PRMimni.js";
import { B as Oe } from "./BasicForm-dL_oCSPM.js";
import { _ as He } from "./TableSelect.vue_vue_type_script_setup_true_lang-BAU5mgvB.js";
import { B as Me } from "./Table-0PViRYCf.js";
import { _ as Ue } from "./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";
import { O as $e, s as W, u as ze, c as We, N as Qe } from "./template-rpthWlT9.js";
import { g as Ge } from "./planner-BebmniHR.js";
import { _ as Xe, __tla as __tla_1 } from "./Modal.vue_vue_type_script_setup_true_lang-BQUHQGiu.js";
import { f as je } from "./hook-C9rOLWu_.js";
import { _ as Je } from "./index.vue_vue_type_script_setup_true_lang-BUzew2LL.js";
import { u as Ke } from "./useForm-CKmgcynv.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 "./index-kKnqLkWM.js";
import "./AutoComplete-Dv1Bqed4.js";
import "./TreeSelect-BZh2DeCh.js";
import "./props-CLtNejQT.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 "./basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js";
import "./basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js";
import "./useModal-CO65vga3.js";
import "./useTimeout-BxFilWvD.js";
import "./usePageCache-DluHn7Yy.js";
import "./Flex-CTSf12gq.js";
let Wt;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })()
]).then(async ()=>{
    const Ze = G(), { t: s } = A(), Ye = await $e();
    function et() {
        const p = u(!1);
        return {
            addSchemas: [
                {
                    field: "reportNum",
                    label: s("hsqe.auditInspection.vesselInspection.reportNum"),
                    component: "NInput",
                    componentProps: ()=>({
                            disabled: !0
                        })
                },
                {
                    field: "shipId",
                    component: "NSelect",
                    label: s("hsqe.auditInspection.vesselInspection.formVessel"),
                    componentProps: {
                        disabled: p,
                        placeholder: s("hsqe.auditInspection.vesselInspection.formVesselHint"),
                        options: Ye,
                        "value-field": "id",
                        "label-field": Ze.getLocale === "en" ? "shipNameEn" : "shipName"
                    },
                    rules: [
                        {
                            required: !0,
                            validator: (a, t)=>t != null && t !== "",
                            message: s("common.chooseText") + " " + s("hsqe.auditInspection.vesselInspection.formVessel"),
                            trigger: [
                                "blur",
                                "change"
                            ]
                        }
                    ]
                },
                {
                    field: "inspectionId",
                    label: s("hsqe.cdi.inspectionId"),
                    component: "NInput",
                    componentProps: {
                        disabled: p
                    },
                    rules: [
                        {
                            required: !0,
                            validator: (a, t)=>t != null && t !== "",
                            message: s("common.inputText") + " " + s("hsqe.cdi.inspectionId"),
                            trigger: [
                                "blur",
                                "change"
                            ]
                        }
                    ]
                },
                {
                    field: "port",
                    label: s("hsqe.management.port"),
                    slot: "visitPlace",
                    rules: [
                        {
                            required: !0,
                            validator: (a, t)=>t != null && t !== "",
                            message: s("common.chooseText") + " " + s("hsqe.management.port"),
                            trigger: [
                                "blur"
                            ]
                        }
                    ]
                },
                {
                    field: "dateOfInspection",
                    label: s("hsqe.cdi.dateOfInspection"),
                    component: "NDatePicker",
                    componentProps: {
                        type: "date",
                        valueFormat: "yyyy-MM-dd",
                        disabled: p
                    },
                    rules: [
                        {
                            required: !0,
                            validator: (a, t)=>t != null && t !== "",
                            message: s("common.chooseText") + " " + s("hsqe.cdi.dateOfInspection"),
                            trigger: [
                                "blur",
                                "change"
                            ]
                        }
                    ]
                },
                {
                    field: "inspectorName",
                    label: s("hsqe.rs.inspectorName"),
                    component: "NInput",
                    componentProps: {
                        disabled: p
                    },
                    rules: [
                        {
                            required: !0,
                            validator: (a, t)=>t != null && t !== "",
                            message: s("common.inputText") + " " + s("hsqe.rs.inspectorName"),
                            trigger: [
                                "blur",
                                "change"
                            ]
                        }
                    ]
                },
                {
                    field: "raisedOn",
                    label: s("hsqe.cdi.raisedOn"),
                    component: "NDatePicker",
                    componentProps: {
                        type: "date",
                        valueFormat: "yyyy-MM-dd",
                        disabled: p
                    },
                    rules: [
                        {
                            required: !0,
                            validator: (a, t)=>t != null && t !== "",
                            message: s("common.chooseText") + " " + s("hsqe.cdi.raisedOn"),
                            trigger: [
                                "blur",
                                "change"
                            ]
                        }
                    ]
                },
                {
                    field: "rightShipReport",
                    label: s("hsqe.rs.rightShipReport"),
                    slot: "rightShipReport"
                },
                {
                    field: "rightShipReportName",
                    hidden: !0
                },
                {
                    field: "rightShipFindingsReportName",
                    hidden: !0
                }
            ],
            methods: {
                setReadOnly: (a)=>{
                    p.value = a;
                }
            }
        };
    }
    const Q = G(), { t: c } = A();
    function tt() {
        const p = [
            {
                key: "new",
                value: c("hsqe.rs.deficiencyStatus.new"),
                color: {
                    color: "#F0FFFB",
                    textColor: "#00C1A8",
                    borderColor: "#F0FFFB"
                }
            },
            {
                key: "un_rectified",
                value: c("hsqe.rs.deficiencyStatus.unrectified"),
                color: {
                    color: "#FFF0F0",
                    textColor: "#C10003",
                    borderColor: "#FFF0F0"
                }
            },
            {
                key: "pending_master_reviewed",
                value: c("hsqe.rs.deficiencyStatus.reviewed"),
                color: {
                    color: "#FFFCF0",
                    textColor: "#C18400",
                    borderColor: "#FFFCF0"
                }
            },
            {
                key: "un_verified",
                value: c("hsqe.rs.deficiencyStatus.unverified"),
                color: {
                    color: "#FFF0F0",
                    textColor: "#C10003",
                    borderColor: "#FFF0F0"
                }
            },
            {
                key: "closed",
                value: c("hsqe.rs.deficiencyStatus.closed"),
                color: {
                    color: "#F2F0FF",
                    textColor: "#BA4E9A",
                    borderColor: "#F2F0FF"
                }
            },
            {
                key: "master_return",
                value: c("hsqe.rs.deficiencyStatus.masterReturn"),
                color: {
                    color: "#F0FFFB",
                    textColor: "#00C1A8",
                    borderColor: "#F0FFFB"
                }
            },
            {
                key: "superintendent_return",
                value: c("hsqe.rs.deficiencyStatus.superintendentReturn"),
                color: {
                    color: "#F0F5FF",
                    textColor: "#0067C1",
                    borderColor: "#F0F5FF"
                }
            }
        ];
        return {
            columns: [
                {
                    title: c("hsqe.planner.no"),
                    key: "no"
                },
                {
                    title: c("hsqe.auditInspection.vesselInspection.deficiency.description"),
                    key: "desc"
                },
                {
                    title: c("hsqe.psc.actionCode"),
                    key: "observation"
                },
                {
                    title: c("hsqe.auditInspection.vesselInspection.deficiency.dateRectify"),
                    key: "dueDate",
                    render: (r)=>je(new Date(r.dueDate))
                },
                {
                    title: c("hsqe.auditInspection.vesselInspection.deficiency.pic"),
                    key: "owner",
                    render (r) {
                        return q("span", {}, {
                            default: ()=>Q.getLocale === "en" ? r.vesselPositionNameEn : r.vesselPositionName
                        });
                    }
                },
                {
                    title: c("hsqe.auditInspection.vesselInspection.deficiency.confirmation"),
                    key: "confirmation",
                    render (r) {
                        return q("span", {}, {
                            default: ()=>Q.getLocale === "en" ? r.officePositionNameEn : r.officePositionName
                        });
                    }
                },
                {
                    title: c("hsqe.cdi.status"),
                    key: "status",
                    render (r) {
                        return q(Se, {
                            bordered: !1,
                            color: p.find((a)=>a.key === r.status)?.color
                        }, {
                            default: ()=>p.find((a)=>a.key === r.status)?.value
                        });
                    }
                }
            ]
        };
    }
    let ot;
    ot = qe({
        __name: "addSire",
        setup (p) {
            const _ = xe(), r = Re(), a = Ce(), t = Ve(), X = Ie({
                storage: localStorage
            }), { t: i } = A(), { addSchemas: j, methods: J } = et(), { setReadOnly: K } = J, { columns: Z } = tt(), Y = ke({
                width: 180,
                title: i("common.optionsText"),
                key: "action",
                fixed: "right",
                align: "center",
                render (e) {
                    return q(Ue, {
                        style: "text",
                        actions: [
                            {
                                label: i("common.optionsViewText"),
                                labelShow: !1,
                                icon: q("i", {
                                    class: "iconfont icon-View text-[#3F7AE9] text-[20px]"
                                }),
                                onClick: ()=>{
                                    r.push({
                                        name: "Add_HSQE_AuditInspection_ReportList_VesselInspection_DeficiencyReport",
                                        query: {
                                            id: e.id,
                                            type: "view"
                                        }
                                    });
                                }
                            },
                            {
                                label: i("common.exportText"),
                                labelShow: !1,
                                icon: I(k.export, "text-[20px]"),
                                onClick: ()=>{
                                    ce(e);
                                }
                            }
                        ]
                    });
                }
            }), [ee, { submit: te, getFieldsValue: oe, setFieldsValue: ne }] = Ke({
                schemas: j,
                labelWidth: "auto",
                layout: "horizontal",
                collapsed: !0,
                gridProps: {
                    cols: 4,
                    xGap: 15
                },
                showActionButtonGroup: !1
            }), se = {
                gridProps: {
                    cols: "2"
                },
                labelWidth: 80,
                submitButtonText: i("common.searchText"),
                showAdvancedButton: !1,
                schemas: [
                    {
                        field: "namePrefix",
                        component: "NInput",
                        label: i("hsqe.planner.modal.planPort")
                    }
                ]
            }, ie = [
                {
                    title: i("hsqe.planner.modal.port"),
                    key: "port"
                },
                {
                    title: i("hsqe.planner.modal.country"),
                    key: "country"
                }
            ], v = u(!1), h = u(), re = u(X.get(Te, "")), B = u(), F = u(), L = u(!1), V = u(), x = u({}), R = u([]), ae = u([]), le = u(0);
            async function E() {
                const e = await W({
                    templateCode: "sireReport",
                    uuid: h.value
                });
                F.value = e, ne(e), de(e), ue(e), _.query.type == "view" && (v.value = !0), K(v.value), O();
            }
            function ce(e) {
                const { href: l } = r.resolve({
                    name: "Add_HSQE_AuditInspection_ReportList_exportDeficiencyPdf",
                    query: {
                        uuid: _.query.uuid,
                        id: e.id,
                        name: "SIRE"
                    }
                });
                window.open(l, "_blank");
            }
            async function de(e) {
                e.approveStatus == 1 || e.approveStatus == 2 || e.approveStatus == 4 ? L.value = !0 : L.value = !1;
            }
            function ue(e) {
                R.value = [
                    {
                        id: "rightShipReport",
                        name: e?.reportUrlName || "",
                        url: e?.reportUrl || "",
                        status: _.query.type == "view" ? void 0 : "finished"
                    }
                ], e.rightShipFindingsReport && (ae.value = [
                    {
                        id: "rightShipFindingsReport",
                        name: e.rightShipFindingsReportName_FileName || "",
                        url: e.rightShipFindingsReport || "",
                        status: _.query.type == "view" ? void 0 : "finished"
                    }
                ]);
            }
            function pe(e) {
                return Ge({
                    ...e,
                    ...n(x)
                });
            }
            async function me() {
                const e = await W({
                    templateCode: "sireReport",
                    uuid: h.value
                });
                return le.value = e.deficiencyList?.length || 0, {
                    list: e.deficiencyList || [],
                    total: e.deficiencyList.length || 0
                };
            }
            function O() {
                V.value.reload();
            }
            function fe() {
                if (!F.value) {
                    a.warning(i("hsqe.sire.cantAddHint"));
                    return;
                }
                B.value?.showModal(F.value, _.query.uuid || h.value);
            }
            async function he() {
                if (!await te()) return !1;
                const l = oe(), m = {
                    template_code: "sireReport",
                    uuid: "",
                    reportBy: re.value,
                    ...l
                };
                h.value ? (m.uuid = h.value, await ze(m), a.success(i("common.saveSuccessText"))) : (h.value = await We(m), a.success(i("common.saveSuccessText"))), E();
            }
            async function ge() {
                await Qe({
                    shipId: F.value.shipId,
                    busId: h.value,
                    moduleCode: "sireReport"
                }), a.success(i("common.submitSuccessText")), r.push({
                    name: "HSQE_AuditInspection_ReportList",
                    query: {
                        asyncComponent: "cdi"
                    }
                });
            }
            function ye() {
                if (v.value) {
                    r.push({
                        name: "HSQE_AuditInspection_ReportList",
                        query: {
                            asyncComponent: "sire"
                        }
                    });
                    return;
                }
                t.info({
                    title: i("hsqe.auditInspection.back.title"),
                    content: i("hsqe.auditInspection.back.cont"),
                    positiveText: i("common.okText"),
                    negativeText: i("common.cancelText"),
                    onPositiveClick: async ()=>{
                        r.push({
                            name: "HSQE_AuditInspection_ReportList",
                            query: {
                                asyncComponent: "sire"
                            }
                        });
                    }
                });
            }
            function _e(e, l, m) {
                l[m] = e?.originalFileName, l.reportUrl = e?.url;
            }
            return we(async ()=>{
                h.value = _.query.uuid || null, h.value && !F.value && E();
            }), (e, l)=>{
                const m = Be, C = Ae, N = De, ve = He, be = Oe, H = Pe, Fe = Le, M = Ne("debounce");
                return y(), g(Fe, null, {
                    default: o(()=>[
                            d(H, {
                                bordered: !1,
                                class: "py-3 proCard",
                                size: "small",
                                segmented: {
                                    content: !0
                                },
                                "content-style": "padding: 20px 15px 0 15px;"
                            }, {
                                header: o(()=>[
                                        d(N, {
                                            align: "center"
                                        }, {
                                            default: o(()=>[
                                                    d(C, {
                                                        trigger: "hover"
                                                    }, {
                                                        trigger: o(()=>[
                                                                d(m, {
                                                                    type: "text",
                                                                    class: "size-8",
                                                                    onClick: ye
                                                                }, {
                                                                    icon: o(()=>[
                                                                            (y(), g(D(n(I)(n(k).back, "text-[16px]"))))
                                                                        ]),
                                                                    _: 1
                                                                })
                                                            ]),
                                                        default: o(()=>[
                                                                T(" " + w(n(i)("common.backToList")), 1)
                                                            ]),
                                                        _: 1
                                                    }),
                                                    z("h1", null, w(n(i)("hsqe.basic.basicTitle")), 1)
                                                ]),
                                            _: 1
                                        })
                                    ]),
                                "header-extra": o(()=>[
                                        d(N, {
                                            align: "center"
                                        }, {
                                            default: o(()=>[
                                                    n(v) ? P("", !0) : (y(), g(C, {
                                                        key: 0,
                                                        trigger: "hover"
                                                    }, {
                                                        trigger: o(()=>[
                                                                $((y(), g(m, {
                                                                    type: "primary",
                                                                    strong: "",
                                                                    bordered: "",
                                                                    secondary: "",
                                                                    class: "size-7"
                                                                }, {
                                                                    icon: o(()=>[
                                                                            (y(), g(D(n(I)(n(k).save))))
                                                                        ]),
                                                                    _: 1
                                                                })), [
                                                                    [
                                                                        M,
                                                                        ()=>he(),
                                                                        "1000"
                                                                    ]
                                                                ])
                                                            ]),
                                                        default: o(()=>[
                                                                T(" " + w(n(i)("common.saveText")), 1)
                                                            ]),
                                                        _: 1
                                                    })),
                                                    n(v) ? P("", !0) : (y(), g(C, {
                                                        key: 1,
                                                        trigger: "hover"
                                                    }, {
                                                        trigger: o(()=>[
                                                                $((y(), g(m, {
                                                                    type: "primary",
                                                                    strong: "",
                                                                    bordered: "",
                                                                    secondary: "",
                                                                    class: "size-7"
                                                                }, {
                                                                    icon: o(()=>[
                                                                            (y(), g(D(n(I)(n(k).send))))
                                                                        ]),
                                                                    _: 1
                                                                })), [
                                                                    [
                                                                        M,
                                                                        ()=>ge(),
                                                                        "1000"
                                                                    ]
                                                                ])
                                                            ]),
                                                        default: o(()=>[
                                                                T(" " + w(n(i)("common.sendText")), 1)
                                                            ]),
                                                        _: 1
                                                    }))
                                                ]),
                                            _: 1
                                        })
                                    ]),
                                default: o(()=>[
                                        d(be, {
                                            onRegister: n(ee)
                                        }, {
                                            visitPlace: o(({ model: b, field: S })=>[
                                                    d(ve, {
                                                        ref: "portTableSelectRef",
                                                        labelField: "port",
                                                        valueField: "id",
                                                        value: b[S],
                                                        "onUpdate:value": (f)=>b[S] = f,
                                                        formValues: n(x),
                                                        "onUpdate:formValues": l[0] || (l[0] = (f)=>U(x) ? x.value = f : null),
                                                        multiple: !1,
                                                        formProps: se,
                                                        disabled: n(v),
                                                        class: "w-full",
                                                        selectTitle: n(i)("hsqe.planner.modal.selectPort"),
                                                        tableProps: {
                                                            rowKey: (f)=>f.id,
                                                            request: pe,
                                                            columns: ie,
                                                            pagination: {
                                                                simple: !0
                                                            }
                                                        }
                                                    }, null, 8, [
                                                        "value",
                                                        "onUpdate:value",
                                                        "formValues",
                                                        "disabled",
                                                        "selectTitle",
                                                        "tableProps"
                                                    ])
                                                ]),
                                            rightShipReport: o(({ model: b, field: S })=>[
                                                    d(Je, {
                                                        "file-list": n(R),
                                                        "onUpdate:fileList": l[1] || (l[1] = (f)=>U(R) ? R.value = f : null),
                                                        disabled: n(v),
                                                        onFinish: (f)=>_e(f, b, S),
                                                        onRemove: (f)=>b[S] = null
                                                    }, null, 8, [
                                                        "file-list",
                                                        "disabled",
                                                        "onFinish",
                                                        "onRemove"
                                                    ])
                                                ]),
                                            _: 1
                                        }, 8, [
                                            "onRegister"
                                        ])
                                    ]),
                                _: 1
                            }),
                            d(H, {
                                bordered: !1,
                                class: "mt-3 py-3 proCard",
                                size: "small",
                                segmented: {
                                    content: !0
                                },
                                "content-style": "padding: 20px 15px 0 15px;"
                            }, {
                                default: o(()=>[
                                        d(n(Me), {
                                            ref_key: "basicTableRef",
                                            ref: V,
                                            columns: n(Z),
                                            request: me,
                                            immediate: !1,
                                            "row-key": (b)=>b.id,
                                            actionColumn: n(Y),
                                            autoScrollX: !0,
                                            "virtual-scroll": "",
                                            pagination: !1
                                        }, {
                                            tableTitle: o(()=>[
                                                    d(N, null, {
                                                        default: o(()=>[
                                                                n(v) ? P("", !0) : (y(), g(C, {
                                                                    key: 0,
                                                                    trigger: "hover"
                                                                }, {
                                                                    trigger: o(()=>[
                                                                            d(m, {
                                                                                type: "primary",
                                                                                strong: "",
                                                                                bordered: "",
                                                                                secondary: "",
                                                                                class: "size-7",
                                                                                onClick: fe
                                                                            }, {
                                                                                icon: o(()=>l[2] || (l[2] = [
                                                                                        z("i", {
                                                                                            class: "iconfont icon-ADD"
                                                                                        }, null, -1)
                                                                                    ])),
                                                                                _: 1
                                                                            })
                                                                        ]),
                                                                    default: o(()=>[
                                                                            l[3] || (l[3] = T(" ADD "))
                                                                        ]),
                                                                    _: 1
                                                                }))
                                                            ]),
                                                        _: 1
                                                    })
                                                ]),
                                            _: 1
                                        }, 8, [
                                            "columns",
                                            "row-key",
                                            "actionColumn"
                                        ])
                                    ]),
                                _: 1
                            }),
                            d(Xe, {
                                ref_key: "modalRef",
                                ref: B,
                                onSuccess: O
                            }, null, 512)
                        ]),
                    _: 1
                });
            };
        }
    });
    Wt = Ee(ot, [
        [
            "__scopeId",
            "data-v-cd87f610"
        ]
    ]);
});
export { Wt as default, __tla };
