import { V as b, bk as E, d as W, e as q, bl as A, a as z, Z as h, fc as X, r as Z, cZ as j, c as k, o as S, w as s, j as i, W as H, l as c, H as G, D as J, aI as K, p as v, A as x, B as Q, i as D, X as U, __tla as __tla_0 } from "./index-9PRMimni.js";
import { B as Y } from "./BasicForm-dL_oCSPM.js";
import { u as tt } from "./useForm-CKmgcynv.js";
import { v as et, m as ot, d as nt, I as at, _ as st, g as it, e as ct, __tla as __tla_1 } from "./index.vue_vue_type_script_setup_true_lang-Ctr3dzVL.js";
import { B as lt } from "./Table-0PViRYCf.js";
import { _ as rt } from "./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";
import { p as pt } from "./pick-Cg3anC-c.js";
import { h as mt } from "./head-aneRfQQJ.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 Yt;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })()
]).then(async ()=>{
    let R, r, ut, B, n, ht;
    R = E();
    ({ t: r } = b());
    ut = ()=>[
            {
                field: "shipId",
                component: "NSelect",
                label: r("shipCashAccount.vessel"),
                componentProps: {
                    placeholder: r("shipCashAccount.vessel"),
                    labelField: R.getLocale === "en" ? "labelEn" : "label",
                    options: et
                }
            },
            {
                field: "year",
                component: "NDatePicker",
                label: r("shipCashAccount.year"),
                componentProps: {
                    type: "year",
                    placeholder: r("shipCashAccount.year"),
                    valueFormat: "yyyy"
                }
            },
            {
                field: "month",
                component: "NSelect",
                label: r("shipCashAccount.month"),
                componentProps: {
                    labelField: R.getLocale === "en" ? "labelEn" : "label",
                    placeholder: r("shipCashAccount.month"),
                    options: ot
                }
            }
        ];
    B = E();
    ({ t: n } = b());
    ht = ()=>[
            {
                type: "selection",
                width: 40
            },
            {
                title: n("common.management.Num"),
                key: "num",
                width: 60,
                render: (l, a)=>a + 1
            },
            {
                title: n("shipCashAccount.vessel"),
                key: "shipId",
                width: 160,
                render: (l)=>B.getLocale === "en" ? l.shipNameEn : l.shipName
            },
            {
                title: n("shipCashAccount.month"),
                key: "month",
                width: 90
            },
            {
                title: n("shipCashAccount.startDate"),
                key: "startDate",
                width: 120
            },
            {
                title: n("shipCashAccount.endDate"),
                key: "endDate",
                width: 120
            },
            {
                title: n("shipCashAccount.balanceLastMonth"),
                key: "balanceFromLastMonth",
                width: 200
            },
            {
                title: n("shipCashAccount.income"),
                key: "income",
                width: 100
            },
            {
                title: n("shipCashAccount.payout"),
                key: "payout",
                width: 100
            },
            {
                title: n("shipCashAccount.payoutPendingApproval"),
                key: "payoutPendingApproval",
                width: 100
            },
            {
                title: n("shipCashAccount.cashEndOfMonth"),
                key: "cashBalanceEom",
                width: 240
            },
            {
                title: n("shipCashAccount.status"),
                key: "status",
                width: 120,
                render: (l)=>B.getLocale === "en" ? l.statusNameEn : l.statusName
            },
            {
                title: n("shipCashAccount.createBy"),
                key: "createBy",
                width: 120
            },
            {
                title: n("shipCashAccount.createDate"),
                key: "createTime",
                width: 120
            }
        ];
    Yt = W({
        __name: "index",
        setup (l) {
            const { t: a } = b(), g = j(), N = q(), d = A("tableRef"), T = A("monthlyShipCashAccountRef"), F = z({
                width: 120,
                title: a("common.optionsText"),
                key: "action",
                fixed: "right",
                align: "center",
                render (t) {
                    return h(rt, {
                        style: "text",
                        actions: [
                            {
                                label: a("common.optionsViewText"),
                                labelShow: !1,
                                icon: h(X, {
                                    class: "text-[#2180F1] text-[14px]"
                                }),
                                onClick: w.bind(null, {
                                    type: "view",
                                    record: t
                                })
                            },
                            {
                                label: a("common.optionsEditText"),
                                labelShow: !1,
                                ifShow: t.status !== "Submitted" && !0,
                                icon: h("i", {
                                    class: "iconfont icon-a-Frame28"
                                }),
                                onClick: w.bind(null, {
                                    type: "edit",
                                    record: t
                                })
                            },
                            {
                                label: a("common.delText"),
                                labelShow: !1,
                                ifShow: t.status !== "Submitted" && t.canDelete === !0 && !0,
                                icon: h("i", {
                                    class: "iconfont icon-Delete red"
                                }),
                                onPositiveClick: $.bind(null, t),
                                isConfirm: !0,
                                confirmContent: a("common.delPop.contRole")
                            }
                        ]
                    });
                }
            }), [I, { getFieldsValue: P }] = tt({
                gridProps: {
                    cols: 6
                },
                schemas: ut(),
                showAdvancedButton: !1
            });
            async function L(t, e) {
                try {
                    return await it({
                        ...e,
                        ...t
                    });
                } catch  {
                    return {
                        list: [],
                        total: 0
                    };
                }
            }
            function f() {
                d.value?.restReload();
            }
            const y = Z([]);
            function O(t, e) {
                y.value = e;
            }
            function V() {
                if (y.value.length !== 1) {
                    g.warning(a("shipCashAccount.exportWarningText"));
                    return;
                }
                const t = pt(mt(y.value), [
                    "shipId",
                    "year",
                    "month"
                ]);
                ct({
                    ...t
                }).then((e)=>{
                    const o = document.createElement("a");
                    o.href = e, o.download = e.substring(e.lastIndexOf("/") + 1), o.style.display = "none", document.body.appendChild(o), o.click(), document.body.removeChild(o);
                });
            }
            function M() {
                T.value?.handleOpenModal();
            }
            function w({ type: t, record: e }) {
                const { id: o, shipId: m, year: u, month: _, startDate: C, endDate: p } = e;
                N.push({
                    name: "shipCashAccountDetail",
                    query: {
                        id: o,
                        shipId: m,
                        year: u,
                        month: _,
                        startDate: C,
                        endDate: p,
                        type: t
                    }
                });
            }
            function $({ id: t }) {
                nt(t).then(()=>{
                    g.success(a("common.optionsDelSuccessText")), d.value?.restReload();
                });
            }
            return (t, e)=>{
                const o = H, m = Q, u = K, _ = G, C = U;
                return S(), k(C, null, {
                    default: s(()=>[
                            i(o, {
                                bordered: !1,
                                class: "proCard"
                            }, {
                                default: s(()=>[
                                        i(c(Y), {
                                            onRegister: c(I),
                                            onSubmit: f,
                                            onReset: f
                                        }, null, 8, [
                                            "onRegister"
                                        ])
                                    ]),
                                _: 1
                            }),
                            i(o, {
                                bordered: !1,
                                class: "proCard mt-2"
                            }, {
                                default: s(()=>[
                                        i(c(lt), {
                                            ref_key: "tableRef",
                                            ref: d,
                                            columns: c(ht)(),
                                            request: (p)=>L(p, c(P)()),
                                            "row-key": (p)=>p.id,
                                            autoScrollX: !0,
                                            actionColumn: c(F),
                                            onCheckedRowChange: O,
                                            "virtual-scroll": ""
                                        }, {
                                            toolbar: s(()=>[
                                                    i(_, null, {
                                                        default: s(()=>[
                                                                i(u, {
                                                                    trigger: "hover"
                                                                }, {
                                                                    trigger: s(()=>[
                                                                            i(m, {
                                                                                type: "primary",
                                                                                strong: "",
                                                                                bordered: "",
                                                                                secondary: "",
                                                                                class: "size-7",
                                                                                onClick: V
                                                                            }, {
                                                                                icon: s(()=>e[0] || (e[0] = [
                                                                                        D("i", {
                                                                                            class: "iconfont icon-Export"
                                                                                        }, null, -1)
                                                                                    ])),
                                                                                _: 1
                                                                            })
                                                                        ]),
                                                                    default: s(()=>[
                                                                            v(" " + x(c(a)("shipCashAccount.exportBtn")), 1)
                                                                        ]),
                                                                    _: 1
                                                                }),
                                                                c(at) ? J("", !0) : (S(), k(u, {
                                                                    key: 0,
                                                                    trigger: "hover"
                                                                }, {
                                                                    trigger: s(()=>[
                                                                            i(m, {
                                                                                type: "primary",
                                                                                strong: "",
                                                                                bordered: "",
                                                                                secondary: "",
                                                                                class: "size-7",
                                                                                onClick: M
                                                                            }, {
                                                                                icon: s(()=>e[1] || (e[1] = [
                                                                                        D("i", {
                                                                                            class: "iconfont icon-ADD"
                                                                                        }, null, -1)
                                                                                    ])),
                                                                                _: 1
                                                                            })
                                                                        ]),
                                                                    default: s(()=>[
                                                                            v(" " + x(c(a)("shipCashAccount.addBtn")), 1)
                                                                        ]),
                                                                    _: 1
                                                                }))
                                                            ]),
                                                        _: 1
                                                    })
                                                ]),
                                            _: 1
                                        }, 8, [
                                            "columns",
                                            "request",
                                            "row-key",
                                            "actionColumn"
                                        ]),
                                        i(st, {
                                            ref: "monthlyShipCashAccountRef",
                                            onRefresh: f
                                        }, null, 512)
                                    ]),
                                _: 1
                            })
                        ]),
                    _: 1
                });
            };
        }
    });
});
export { Yt as default, __tla };
