import { B as C } from "./Table-0PViRYCf.js";
import { V as h, Z as l, aA as v, cb as M, k as A, d as S, a as N, f as $, r as g, aw as B, h as P, o as E, j as i, l as o, ao as O, w as m, t as Y, ds as L, _ as Z, W as j, cZ as F, __tla as __tla_0 } from "./index-9PRMimni.js";
import { m as W, n as z, am as G } from "./template-rpthWlT9.js";
import "./Table.vue_vue_type_style_index_0_scoped_7b9e6ece_lang-BoW2DV_e.js";
import "./vuedraggable.umd-Co2xEC3p.js";
import "./Render.vue_vue_type_script_lang-DKUYY0Zw.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 "./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 "./componentSetting-DVhNDBTO.js";
import "./useTimeout-BxFilWvD.js";
import "./usePageCache-DluHn7Yy.js";
import "./tabsView-BXskTdVh.js";
import "./Flex-CTSf12gq.js";
import "./index-kKnqLkWM.js";
let Re;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })()
]).then(async ()=>{
    let u, H, J;
    ({ t: u } = h());
    H = await W();
    J = [
        {
            title: u("hsqe.auditInspection.vesselInspection.shipVisitReport.deficiencyReport.action.actionType"),
            key: "correctActionType",
            render: (e)=>l(v, {
                    style: {
                        width: "150px"
                    },
                    value: e.actionType,
                    onUpdateValue: (n)=>e.correctActionType = n,
                    options: H
                })
        },
        {
            title: u("hsqe.auditInspection.vesselInspection.shipVisitReport.deficiencyReport.action.extensionRectifiedDate"),
            key: "extensionRectifiedDate",
            render: (e)=>l(M, {
                    onUpdateValue: (n)=>e.rectifyTime = n
                })
        },
        {
            title: u("hsqe.auditInspection.vesselInspection.shipVisitReport.deficiencyReport.action.description"),
            key: "correctActionDescription",
            render: (e)=>l(A, {
                    type: "textarea",
                    value: e.correctActionDescription,
                    onUpdateValue: (n)=>e.correctActionDescription = n
                })
        },
        {
            title: u("hsqe.auditInspection.vesselInspection.shipVisitReport.deficiencyReport.action.verifiedClosedON"),
            key: "correctActionReview",
            render: (e)=>l(v, {
                    style: {
                        width: "150px"
                    },
                    value: e.correctActionReview,
                    onUpdateValue: (n)=>e.correctActionReview = n,
                    options: [
                        {
                            label: "YES",
                            value: "YES"
                        },
                        {
                            label: "NO",
                            value: "NO"
                        }
                    ]
                })
        },
        {
            title: u("hsqe.auditInspection.vesselInspection.shipVisitReport.deficiencyReport.action.comments"),
            key: "correctActionComment",
            render: (e)=>l(A, {
                    type: "textarea",
                    value: e.correctActionComment,
                    onUpdateValue: (n)=>e.correctActionComment = n
                })
        }
    ];
    Re = S({
        __name: "index",
        emits: [
            "getData"
        ],
        setup (e, { expose: n, emit: I }) {
            const s = N({
                preventActionMethod: void 0,
                preventActionDescription: ""
            }), R = $(), T = F(), { t: d } = h(), _ = g(), D = g(), V = I;
            async function x() {
                D.value = await z();
            }
            V("getData", (f)=>f);
            function b() {
                return {
                    list: [
                        {}
                    ]
                };
            }
            function k() {
                return {
                    ..._.value.getDataSource()
                };
            }
            async function q() {
                const t = {
                    ...(_.value?.getDataSource())[0],
                    ...s,
                    reportId: R.query.reportId,
                    deficiencyId: R.query.id
                };
                if (t.rectifyTime) {
                    let r = new Date(t.rectifyTime), c = r.getMonth() + 1;
                    c = c < 10 ? `0${c}` : c;
                    let a = r.getDate();
                    a = a < 10 ? `0${a}` : a, t.rectifyTime = r.getFullYear() + "-" + c + "-" + a + "T00:00:00";
                }
                console.log(t), await G(t) && T.success(d("common.saveSuccessText"));
            }
            return B(()=>{
                x();
            }), n({
                getData: k,
                submit: q
            }), (f, t)=>{
                const y = O, r = v, c = Z, a = A, w = Y, U = j;
                return E(), P("div", null, [
                    i(y, {
                        title: o(d)("hsqe.auditInspection.vesselInspection.shipVisitReport.deficiencyReport.action.correctiveAction")
                    }, null, 8, [
                        "title"
                    ]),
                    i(o(C), {
                        ref_key: "tableRef",
                        ref: _,
                        columns: o(J),
                        request: b,
                        pagination: !1,
                        showTableSetting: !1
                    }, null, 8, [
                        "columns"
                    ]),
                    i(y, {
                        class: "mt-3",
                        title: o(d)("hsqe.auditInspection.vesselInspection.shipVisitReport.deficiencyReport.action.preventiveAction")
                    }, null, 8, [
                        "title"
                    ]),
                    i(U, {
                        bordered: "",
                        class: "mt-3 py-3 proCard"
                    }, {
                        default: m(()=>[
                                i(w, {
                                    modelValue: o(s),
                                    "onUpdate:modelValue": t[2] || (t[2] = (p)=>L(s) ? s.value = p : null)
                                }, {
                                    default: m(()=>[
                                            i(c, null, {
                                                default: m(()=>[
                                                        i(r, {
                                                            class: "!w-[200px]",
                                                            value: o(s).preventActionMethod,
                                                            "onUpdate:value": t[0] || (t[0] = (p)=>o(s).preventActionMethod = p),
                                                            options: o(D)
                                                        }, null, 8, [
                                                            "value",
                                                            "options"
                                                        ])
                                                    ]),
                                                _: 1
                                            }),
                                            i(c, null, {
                                                default: m(()=>[
                                                        i(a, {
                                                            type: "textarea",
                                                            value: o(s).preventActionDescription,
                                                            "onUpdate:value": t[1] || (t[1] = (p)=>o(s).preventActionDescription = p)
                                                        }, null, 8, [
                                                            "value"
                                                        ])
                                                    ]),
                                                _: 1
                                            })
                                        ]),
                                    _: 1
                                }, 8, [
                                    "modelValue"
                                ])
                            ]),
                        _: 1
                    })
                ]);
            };
        }
    });
});
export { Re as default, __tla };
