import { _ as M } from "./basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js";
import "./basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js";
import { B as w } from "./BasicForm-dL_oCSPM.js";
import { u as K } from "./useForm-CKmgcynv.js";
import { V as d, d as Z, r as i, ay as L, ac as z, c as U, o as $, l as a, w as f, j as u, ds as j, cZ as G, __tla as __tla_0 } from "./index-9PRMimni.js";
import { r as H, __tla as __tla_1 } from "./helper-CNwA55dE.js";
import { c as J } from "./columns-Cv1qVJFZ.js";
import { _ as Q } from "./TableSelect.vue_vue_type_script_setup_true_lang-BAU5mgvB.js";
import "./Table.vue_vue_type_style_index_0_scoped_7b9e6ece_lang-BoW2DV_e.js";
import "./print-CT_2hrjP.js";
import { u as W } from "./useModal-CO65vga3.js";
import "./vuedraggable.umd-Co2xEC3p.js";
import { g as X } from "./goodsReceiptNoteDetail-DWFnSNrx.js";
import { s as Y } from "./VoyagePlanOffice-CE0uFEw0.js";
let Pe;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })(),
    (()=>{
        try {
            return __tla_1;
        } catch  {}
    })()
]).then(async ()=>{
    const { t: e } = d();
    function ee() {
        return {
            formSchemas: [
                {
                    field: "legId",
                    component: "NInput",
                    label: e("pms.VoyagePlanOfficeDetail.legId"),
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        placeholder: e("common.inputText"),
                        disabled: !0
                    }
                },
                {
                    field: "callPurpose",
                    component: "BasicSelect",
                    label: e("pms.VoyagePlanOfficeDetail.callPurpose"),
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        block: !0,
                        cacheKey: "voyage_callPurpose"
                    },
                    rules: [
                        {
                            required: !0,
                            message: e("common.RequireTips")
                        }
                    ]
                },
                {
                    field: "port",
                    label: e("pms.VoyagePlanOfficeDetail.port"),
                    slot: "receivePortSlot",
                    componentProps: {
                        placeholder: e("requisitionOrder.detailsTab.expectedPlace")
                    }
                },
                {
                    field: "arrivalCondition",
                    component: "BasicSelect",
                    label: e("pms.VoyagePlanOfficeDetail.arrivalCondition"),
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        block: !0,
                        cacheKey: "voyage_arrivalCondition"
                    },
                    rules: [
                        {
                            required: !0,
                            message: e("common.RequireTips")
                        }
                    ]
                },
                {
                    field: "eta",
                    component: "NDatePicker",
                    label: e("pms.VoyagePlanOfficeDetail.ETA"),
                    componentProps: {
                        placeholder: e("pms.VoyagePlanOfficeDetail.ETA"),
                        type: "datetime"
                    }
                },
                {
                    field: "etb",
                    component: "NDatePicker",
                    label: e("pms.VoyagePlanOfficeDetail.ETB"),
                    componentProps: {
                        placeholder: e("pms.VoyagePlanOfficeDetail.ETB"),
                        type: "datetime"
                    }
                },
                {
                    field: "etc",
                    component: "NDatePicker",
                    label: e("pms.VoyagePlanOfficeDetail.ETC"),
                    componentProps: {
                        placeholder: e("pms.VoyagePlanOfficeDetail.ETC"),
                        type: "datetime"
                    }
                },
                {
                    field: "timeZone",
                    component: "BasicSelect",
                    label: e("pms.VoyagePlanOfficeDetail.timeZone"),
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        block: !0,
                        cacheKey: "voyage_timezone"
                    },
                    rules: [
                        {
                            required: !0,
                            message: e("common.RequireTips")
                        }
                    ]
                },
                {
                    field: "ata",
                    component: "NDatePicker",
                    label: e("pms.VoyagePlanOfficeDetail.ATA"),
                    componentProps: {
                        placeholder: e("pms.VoyagePlanOfficeDetail.ATA"),
                        type: "datetime"
                    }
                },
                {
                    field: "atb",
                    component: "NDatePicker",
                    label: e("pms.VoyagePlanOfficeDetail.ATB"),
                    componentProps: {
                        placeholder: e("pms.VoyagePlanOfficeDetail.ATB"),
                        type: "datetime"
                    }
                },
                {
                    field: "etd",
                    component: "NDatePicker",
                    label: e("pms.VoyagePlanOfficeDetail.ETD"),
                    componentProps: {
                        placeholder: e("pms.VoyagePlanOfficeDetail.ETD"),
                        type: "datetime"
                    }
                },
                {
                    field: "timeZoneCurrent",
                    component: "BasicSelect",
                    label: e("pms.VoyagePlanOfficeDetail.timeZone"),
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        block: !0,
                        cacheKey: "voyage_timezone"
                    },
                    rules: [
                        {
                            required: !0,
                            message: e("common.RequireTips")
                        }
                    ]
                },
                {
                    field: "portAgent",
                    component: "NInput",
                    label: e("pms.VoyagePlanOfficeDetail.portAgent"),
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        placeholder: e("common.inputText")
                    }
                },
                {
                    field: "portAgentCompany",
                    component: "NInput",
                    label: e("pms.VoyagePlanOfficeDetail.portAgentCompany"),
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        placeholder: e("common.inputText")
                    }
                },
                {
                    field: "portAgentTelephone",
                    component: "NInput",
                    label: e("pms.VoyagePlanOfficeDetail.portAgentTelephone"),
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        placeholder: e("common.inputText")
                    }
                },
                {
                    field: "portAgentEmail",
                    component: "NInput",
                    label: e("pms.VoyagePlanOfficeDetail.portAgentEmail"),
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        placeholder: e("common.inputText")
                    }
                },
                {
                    field: "remarks",
                    component: "NInput",
                    label: e("pms.VoyagePlanOfficeDetail.remarks"),
                    giProps: {
                        span: 4
                    },
                    componentProps: {
                        type: "textarea",
                        placeholder: e("common.inputText")
                    }
                }
            ]
        };
    }
    Pe = Z({
        __name: "portCallDetailModal",
        props: {
            voyagePlanId: {
                default: null,
                type: Number
            }
        },
        emits: [
            "refreshList"
        ],
        setup (p, { expose: P, emit: g }) {
            const y = p, { t } = d(), b = G(), n = i({}), D = i({}), s = i(), { formSchemas: h } = ee(), [T, V, v] = K({
                gridProps: {
                    cols: 4
                },
                layout: "horizontal",
                schemas: h,
                showActionButtonGroup: !1,
                validateOnMount: !1
            }), { getFieldsValue: O, setFieldsValue: _, validate: x } = V;
            function A(o) {
                D.value = o;
            }
            function C(o) {
                return X({
                    ...o,
                    ...a(n)
                });
            }
            const [k, { openModal: B, closeModal: N, setProps: S, setSubLoading: I }] = W({
                title: t("pms.VoyagePlanOfficeDetail.portCalls"),
                subBtuText: t("common.okText"),
                cancelText: t("common.cancelText"),
                width: 1e3
            }), R = g;
            async function F(o) {
                s.value = o || {}, B();
            }
            async function q() {
                x().then(async ()=>{
                    const o = O();
                    o.voyagePlanId = y.voyagePlanId, o.id = s.value?.id || null, await Y(o), b.success(t("common.saveSuccessText")), N(), R("refreshList");
                }).finally(()=>{
                    I(!1);
                });
            }
            return L(()=>s.value, (o)=>{
                z(()=>{
                    _(o);
                });
            }), P({
                showModal: F,
                setProps: S
            }), (o, c)=>{
                const E = M;
                return $(), U(E, {
                    ref: "modalRef",
                    onRegister: a(k),
                    class: "basicModal basicFormModal",
                    onOnOk: q
                }, {
                    default: f(()=>[
                            u(a(w), {
                                ref: "formRef",
                                onRegister: a(T)
                            }, {
                                receivePortSlot: f(({ model: m, field: r })=>[
                                        u(a(Q), {
                                            class: "w-full",
                                            labelField: "port",
                                            valueField: "id",
                                            value: m[r],
                                            "onUpdate:value": (l)=>m[r] = l,
                                            formValues: a(n),
                                            "onUpdate:formValues": c[0] || (c[0] = (l)=>j(n) ? n.value = l : null),
                                            onChange: A,
                                            onClear: ()=>a(v).setFieldsValue({
                                                    [r]: void 0
                                                }),
                                            multiple: !1,
                                            formProps: a(H),
                                            selectTitle: a(t)("common.selectPort"),
                                            tableProps: {
                                                rowKey: (l)=>l.id,
                                                request: C,
                                                columns: a(J)(),
                                                pagination: {
                                                    simple: !0
                                                }
                                            }
                                        }, null, 8, [
                                            "value",
                                            "onUpdate:value",
                                            "formValues",
                                            "onClear",
                                            "formProps",
                                            "selectTitle",
                                            "tableProps"
                                        ])
                                    ]),
                                _: 1
                            }, 8, [
                                "onRegister"
                            ])
                        ]),
                    _: 1
                }, 8, [
                    "onRegister"
                ]);
            };
        }
    });
});
export { Pe as _, __tla };
