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