import { V as y, bk as R, d as L, e as P, bl as v, a as A, Z as u, fc as M, cZ as O, c as w, o as k, w as n, j as l, W as $, l as a, H as q, D as W, aI as X, p as Z, A as j, B as z, i as H, X as G, __tla as __tla_0 } from "./index-9PRMimni.js";
import { B as J } from "./BasicForm-dL_oCSPM.js";
import { u as K } from "./useForm-CKmgcynv.js";
import { v as Q, m as U, d as Y, I as tt, _ as et, g as ot, __tla as __tla_1 } from "./index.vue_vue_type_script_setup_true_lang-DCz4Tw2M.js";
import { B as nt } from "./Table-0PViRYCf.js";
import { _ as at } from "./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.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 "./usePageCache-DluHn7Yy.js";
import "./basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js";
import "./basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js";
import "./requisitionOrder-D0IG9N7e.js";
import "./useModal-CO65vga3.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 "./useTimeout-BxFilWvD.js";
import "./Flex-CTSf12gq.js";
let Zt;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })()
]).then(async ()=>{
    let C, r, it, D, e, lt;
    C = R();
    ({ t: r } = y());
    it = ()=>[
            {
                field: "shipId",
                component: "NSelect",
                label: r("victualing.vessel"),
                componentProps: {
                    style: {
                        width: "100%"
                    },
                    placeholder: r("victualing.vessel"),
                    labelField: C.getLocale === "en" ? "labelEn" : "label",
                    options: Q
                }
            },
            {
                field: "year",
                component: "NDatePicker",
                label: r("victualing.year"),
                componentProps: {
                    type: "year",
                    placeholder: r("victualing.year"),
                    valueFormat: "yyyy"
                }
            },
            {
                field: "month",
                component: "NSelect",
                label: r("victualing.month"),
                componentProps: {
                    labelField: C.getLocale === "en" ? "labelEn" : "label",
                    placeholder: r("victualing.month"),
                    options: U
                }
            }
        ];
    D = R();
    ({ t: e } = y());
    lt = ()=>[
            {
                title: e("common.management.Num"),
                key: "num",
                width: 60,
                render: (i, o)=>o + 1
            },
            {
                title: e("victualing.vessel"),
                key: "shipId",
                width: 160,
                render: (i)=>D.getLocale === "en" ? i.shipNameEn : i.shipName
            },
            {
                title: e("victualing.month"),
                key: "month",
                width: 90
            },
            {
                title: e("victualing.startDate"),
                key: "startDate",
                width: 120
            },
            {
                title: e("victualing.endDate"),
                key: "endDate",
                width: 120
            },
            {
                title: e("victualing.balanceLastMonth"),
                key: "balanceFromLastMonth",
                width: 140
            },
            {
                title: e("victualing.purchased"),
                key: "purchased",
                width: 140
            },
            {
                title: e("victualing.consumed"),
                key: "consumed",
                width: 140
            },
            {
                title: e("victualing.victualingTTL"),
                key: "cashBalanceEom",
                width: 140
            },
            {
                title: e("victualing.status"),
                key: "status",
                width: 120,
                render: (i)=>D.getLocale === "en" ? i.statusNameEn : i.statusName
            },
            {
                title: e("victualing.createBy"),
                key: "createBy",
                width: 120
            },
            {
                title: e("victualing.createDate"),
                key: "createTime",
                width: 120
            }
        ];
    Zt = L({
        __name: "index",
        setup (i) {
            const { t: o } = y(), S = P(), x = O(), p = v("tableRef"), B = v("monthlyVictualingRef"), T = A({
                width: 160,
                title: o("common.optionsText"),
                key: "action",
                fixed: "right",
                align: "center",
                render (t) {
                    return u(at, {
                        style: "text",
                        actions: [
                            {
                                label: o("common.optionsViewText"),
                                labelShow: !1,
                                icon: u(M, {
                                    class: "text-[#2180F1] text-[14px]"
                                }),
                                onClick: b.bind(null, {
                                    type: "view",
                                    record: t
                                })
                            },
                            {
                                label: o("common.optionsEditText"),
                                labelShow: !1,
                                ifShow: t.status !== "Accounts Closed" && !0,
                                icon: u("i", {
                                    class: "iconfont icon-a-Frame28"
                                }),
                                onClick: b.bind(null, {
                                    type: "edit",
                                    record: t
                                })
                            },
                            {
                                label: o("common.delText"),
                                labelShow: !1,
                                ifShow: t.status !== "Accounts Closed" && t.canDelete === !0 && !0,
                                icon: u("i", {
                                    class: "iconfont icon-Delete red"
                                }),
                                onPositiveClick: E.bind(null, t),
                                isConfirm: !0,
                                confirmContent: o("common.delPop.contRole")
                            }
                        ]
                    });
                }
            }), [N, { getFieldsValue: F }] = K({
                gridProps: {
                    cols: 6
                },
                schemas: it(),
                showAdvancedButton: !1
            });
            function V() {
                B.value?.handleOpenModal();
            }
            function b({ type: t, record: s }) {
                const { id: c, shipId: h, year: _, month: f, startDate: g, endDate: m } = s;
                S.push({
                    name: "victualingDetail",
                    query: {
                        id: c,
                        shipId: h,
                        year: _,
                        month: f,
                        startDate: g,
                        endDate: m,
                        type: t
                    }
                });
            }
            function E({ id: t }) {
                Y(t).then(()=>{
                    x.success(o("common.optionsDelSuccessText")), p.value?.restReload();
                });
            }
            async function I(t, s) {
                try {
                    return await ot({
                        ...s,
                        ...t
                    });
                } catch  {
                    return {
                        list: [],
                        total: 0
                    };
                }
            }
            function d() {
                p.value?.restReload();
            }
            return (t, s)=>{
                const c = $, h = z, _ = X, f = q, g = G;
                return k(), w(g, null, {
                    default: n(()=>[
                            l(c, {
                                bordered: !1,
                                class: "proCard"
                            }, {
                                default: n(()=>[
                                        l(a(J), {
                                            onRegister: a(N),
                                            onSubmit: d,
                                            onReset: d
                                        }, null, 8, [
                                            "onRegister"
                                        ])
                                    ]),
                                _: 1
                            }),
                            l(c, {
                                bordered: !1,
                                class: "proCard mt-2"
                            }, {
                                default: n(()=>[
                                        l(a(nt), {
                                            ref_key: "tableRef",
                                            ref: p,
                                            columns: a(lt)(),
                                            request: (m)=>I(m, a(F)()),
                                            "row-key": (m)=>m.id,
                                            autoScrollX: !0,
                                            actionColumn: a(T),
                                            "virtual-scroll": ""
                                        }, {
                                            toolbar: n(()=>[
                                                    l(f, null, {
                                                        default: n(()=>[
                                                                a(tt) ? W("", !0) : (k(), w(_, {
                                                                    key: 0,
                                                                    trigger: "hover"
                                                                }, {
                                                                    trigger: n(()=>[
                                                                            l(h, {
                                                                                type: "primary",
                                                                                strong: "",
                                                                                bordered: "",
                                                                                secondary: "",
                                                                                class: "size-7",
                                                                                onClick: V
                                                                            }, {
                                                                                icon: n(()=>s[0] || (s[0] = [
                                                                                        H("i", {
                                                                                            class: "iconfont icon-ADD"
                                                                                        }, null, -1)
                                                                                    ])),
                                                                                _: 1
                                                                            })
                                                                        ]),
                                                                    default: n(()=>[
                                                                            Z(" " + j(a(o)("shipCashAccount.addBtn")), 1)
                                                                        ]),
                                                                    _: 1
                                                                }))
                                                            ]),
                                                        _: 1
                                                    })
                                                ]),
                                            _: 1
                                        }, 8, [
                                            "columns",
                                            "request",
                                            "row-key",
                                            "actionColumn"
                                        ]),
                                        l(et, {
                                            ref: "monthlyVictualingRef",
                                            onRefresh: d
                                        }, null, 512)
                                    ]),
                                _: 1
                            })
                        ]),
                    _: 1
                });
            };
        }
    });
});
export { Zt as default, __tla };
