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