import { a0 as v, _ as N, a1 as f, a2 as F } from "./template-rpthWlT9.js";
import { V as L, bk as y, r as d, a4 as D, Z as g, gD as i, b as S, __tla as __tla_0 } from "./index-9PRMimni.js";
import { i as P } from "./isEmpty-BUg1OsQj.js";
let x, O, A, _, j, p;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })()
]).then(async ()=>{
    let t, e, W, b, k, I, E, T;
    t = y();
    ({ t: e } = L());
    W = S();
    b = await N();
    k = await F();
    I = await f("crew_handover_status");
    E = await f("crew_plan_shifts_type");
    p = await v();
    T = W.getUserInfo.nickname;
    A = function() {
        return {
            handoverSchemas: [
                {
                    field: "vesselId",
                    component: "NSelect",
                    label: e("crew.crewList.vesselName"),
                    labelWidth: 100,
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        placeholder: e("crew.crewList.vesselName"),
                        options: p,
                        labelField: t.getLocale === "en" ? "shipNameEn" : "shipName",
                        valueField: "id",
                        filterable: !0,
                        clearable: !0
                    }
                },
                {
                    field: "crewName",
                    component: "NInput",
                    label: e("crew.crewList.crewName"),
                    labelWidth: 100,
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        placeholder: e("crew.crewList.crewName")
                    }
                },
                {
                    field: "rankId",
                    component: "NSelect",
                    label: e("crew.crewList.rank"),
                    labelWidth: 70,
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        options: b,
                        placeholder: e("crew.crewList.rank"),
                        valueField: "id",
                        labelField: t.getLocale === "en" ? "shortNameEn" : "name"
                    }
                },
                {
                    field: "status",
                    component: "NSelect",
                    label: e("crew.crewList.status"),
                    labelWidth: 70,
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        placeholder: e("crew.crewList.status"),
                        options: I,
                        labelField: t.getLocale === "en" ? "labelEn" : "label",
                        valueField: "value"
                    }
                },
                {
                    field: "handoverDate",
                    component: "NDatePicker",
                    label: e("crew.crewList.handoverDate"),
                    labelWidth: 120,
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        type: "daterange",
                        valueFormat: "yyyy-MM-dd",
                        placeholder: e("crew.crewList.handoverDate")
                    }
                }
            ]
        };
    };
    _ = function() {
        const a = d(!0), l = d(0);
        return {
            addPlanSchemas: [
                {
                    field: "vesselId",
                    component: "NSelect",
                    label: e("crew.crewList.vesselName"),
                    labelWidth: 100,
                    giProps: {
                        span: 3
                    },
                    componentProps: {
                        disabled: a,
                        placeholder: e("crew.crewList.vesselName"),
                        options: p,
                        labelField: t.getLocale === "en" ? "shipNameEn" : "shipName",
                        valueField: "id",
                        filterable: !0,
                        clearable: !0
                    }
                },
                {
                    field: "shiftsTypeId",
                    component: "BasicSelect",
                    label: e("crew.crewList.allocationType"),
                    labelWidth: 100,
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        options: E.map((o)=>({
                                ...o,
                                value: +o.value
                            })),
                        placeholder: e("crew.crewList.allocationType"),
                        disabled: !0,
                        class: "w-full"
                    },
                    defaultValue: l
                },
                {
                    field: "dispatcher",
                    component: "NInput",
                    label: e("crew.crewList.dispatcher"),
                    labelWidth: 100,
                    giProps: {
                        span: 3
                    },
                    componentProps: {
                        disabled: a,
                        placeholder: e("crew.crewList.dispatcher")
                    },
                    defaultValue: T
                },
                {
                    field: "changeDate",
                    component: "NDatePicker",
                    label: e("crew.crewList.allocationDate"),
                    labelWidth: 100,
                    giProps: {
                        span: 3
                    },
                    componentProps: {
                        disabled: a,
                        type: "date",
                        valueFormat: "yyyy-MM-dd",
                        placeholder: e("crew.crewList.allocationDate")
                    }
                },
                {
                    field: "remark",
                    component: "NInput",
                    label: e("crew.crewList.remarks"),
                    labelWidth: 100,
                    giProps: {
                        span: 12
                    },
                    componentProps: {
                        disabled: a,
                        placeholder: e("crew.crewList.remarks")
                    }
                }
            ],
            setType: (o)=>{
                a.value = o;
            },
            setAllocation: (o)=>{
                l.value = o;
            }
        };
    };
    O = function() {
        const a = d(!0);
        return {
            addHandoverSchemas: [
                {
                    field: "vesselId",
                    component: "NSelect",
                    label: e("crew.crewList.vesselName"),
                    labelWidth: 100,
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        disabled: !0,
                        placeholder: e("crew.crewList.vesselName"),
                        options: p,
                        labelField: t.getLocale === "en" ? "shipNameEn" : "shipName",
                        valueField: "id",
                        filterable: !0,
                        clearable: !0
                    }
                },
                {
                    field: "voyageNumber",
                    component: "NInput",
                    label: e("crew.crewList.voyageNo"),
                    labelWidth: 100,
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        disabled: a,
                        placeholder: e("crew.crewList.voyageNo")
                    }
                },
                {
                    field: t.getLocale === "en" ? "seafarerNameEnOff" : "seafarerNameOff",
                    component: "NInput",
                    label: e("crew.crewList.handover"),
                    labelWidth: 100,
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        class: "w-full",
                        disabled: !0,
                        placeholder: e("crew.crewList.handover")
                    }
                },
                {
                    field: "dutyId",
                    component: "NSelect",
                    label: e("crew.crewList.rank"),
                    labelWidth: 70,
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        disabled: !0,
                        options: b,
                        placeholder: e("crew.crewList.rank"),
                        valueField: "id",
                        labelField: t.getLocale === "en" ? "shortNameEn" : "name"
                    }
                },
                {
                    field: "seafarerNameOn",
                    component: "NInput",
                    label: e("crew.crewList.takeover"),
                    labelWidth: 100,
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        disabled: a,
                        placeholder: e("crew.crewList.takeover")
                    }
                },
                {
                    field: "handoverDate",
                    component: "NDatePicker",
                    label: e("crew.crewList.handoverDate"),
                    labelWidth: 100,
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        disabled: a,
                        type: "date",
                        valueFormat: "yyyy-MM-dd",
                        placeholder: e("crew.crewList.handoverDate")
                    }
                },
                {
                    field: "handoverTime",
                    component: "NTimePicker",
                    label: e("crew.crewList.handoverTime"),
                    labelWidth: 100,
                    hidden: !0,
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        disabled: a,
                        placeholder: e("crew.crewList.handoverTime")
                    }
                },
                {
                    field: "handoverPort",
                    component: "NInput",
                    label: e("crew.crewList.handoverPort"),
                    labelWidth: 100,
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        disabled: !0,
                        placeholder: e("crew.crewList.handoverPort")
                    }
                },
                {
                    field: "supervisor",
                    component: "NInput",
                    label: e("crew.crewList.supervisor"),
                    labelWidth: 100,
                    giProps: {
                        span: 1
                    },
                    componentProps: {
                        disabled: a,
                        placeholder: e("crew.crewList.supervisor")
                    }
                },
                {
                    field: "remarks",
                    component: "NInput",
                    label: e("crew.crewList.remarks"),
                    labelWidth: 100,
                    giProps: {
                        span: 3
                    },
                    componentProps: {
                        disabled: a,
                        placeholder: e("crew.crewList.remarks")
                    }
                }
            ],
            addFileSchemas: [
                {
                    field: "addressUrl",
                    slot: "fileSlot",
                    defaultValue: "",
                    labelWidth: 200,
                    giProps: {
                        span: 3
                    }
                }
            ],
            setType: (s)=>{
                a.value = s;
            }
        };
    };
    x = (a = !1, l = !1, n)=>{
        const r = d(a), s = (m)=>r.value = m;
        return {
            contractSchemas: D(()=>[
                    {
                        field: "id",
                        hidden: !0
                    },
                    {
                        field: "contractNo",
                        component: "NInput",
                        label: e("crew.contractForm.contractNo"),
                        labelWidth: 100,
                        giProps: {
                            span: 1
                        },
                        componentProps: {
                            disabled: r.value,
                            placeholder: e("crew.contractForm.contractNo")
                        }
                    },
                    {
                        field: "contractDate",
                        component: "NDatePicker",
                        label: e("crew.contractForm.contractDate"),
                        labelWidth: 100,
                        giProps: {
                            span: 1
                        },
                        componentProps: {
                            disabled: r.value,
                            type: "date",
                            valueFormat: "yyyy-MM-dd",
                            placeholder: e("crew.contractForm.contractDate")
                        }
                    },
                    {
                        field: "companyName",
                        component: "NInput",
                        label: e("crew.contractForm.companyName"),
                        labelWidth: 100,
                        giProps: {
                            span: 1
                        },
                        hidden: ()=>t.getLocale === "en",
                        componentProps: {
                            placeholder: e("crew.contractForm.companyName"),
                            disabled: !0
                        },
                        defaultValue: "洲际船务集团"
                    },
                    {
                        field: "companyNameEn",
                        component: "NInput",
                        label: e("crew.contractForm.companyName"),
                        labelWidth: 100,
                        giProps: {
                            span: 1
                        },
                        hidden: ()=>t.getLocale !== "en",
                        componentProps: {
                            placeholder: e("crew.contractForm.companyName"),
                            disabled: !0
                        },
                        defaultValue: "Seacon Shipping Group Holdings Limited"
                    },
                    {
                        field: "contractPeriod",
                        component: "NInputNumber",
                        label: e("crew.contractForm.contractPeriod"),
                        labelWidth: 100,
                        giProps: {
                            span: 1
                        },
                        componentProps: {
                            showButton: !1,
                            placeholder: e("crew.contractForm.contractPeriod"),
                            min: 1,
                            disabled: r.value
                        },
                        componentSlots: {
                            suffix: ()=>g("span", "±")
                        },
                        rules: [
                            {
                                type: "number",
                                required: !0,
                                message: `${e("common.inputText")} ${e("crew.contractForm.contractPeriod")}`,
                                trigger: [
                                    "change",
                                    "blur"
                                ]
                            }
                        ]
                    },
                    {
                        field: "periodFloat",
                        component: "NInputNumber",
                        label: "",
                        labelWidth: 100,
                        giProps: {
                            span: 1
                        },
                        componentSlots: {
                            suffix: ()=>g("span", e("crew.month"))
                        },
                        componentProps: {
                            showButton: !1,
                            placeholder: e("crew.contractForm.contractPeriod"),
                            disabled: r.value
                        },
                        rules: [
                            {
                                type: "number",
                                required: !0,
                                message: `${e("common.inputText")} ${e("crew.contractForm.contractPeriod")}`,
                                trigger: [
                                    "change",
                                    "blur"
                                ]
                            }
                        ]
                    },
                    {
                        field: "rankId",
                        component: "NSelect",
                        label: e("crew.contractForm.rank"),
                        labelWidth: 100,
                        giProps: {
                            span: 1
                        },
                        componentProps: {
                            placeholder: e("crew.contractForm.rank"),
                            options: b,
                            valueField: "id",
                            labelField: t.getLocale === "en" ? "shortNameEn" : "name",
                            disabled: !0
                        }
                    },
                    {
                        field: "vesselId",
                        component: "NSelect",
                        label: e("crew.contractForm.vesselName"),
                        labelWidth: 100,
                        giProps: {
                            span: 1
                        },
                        componentProps: {
                            options: p,
                            placeholder: e("crew.contractForm.vesselName"),
                            disabled: !0,
                            labelField: t.getLocale === "en" ? "shipNameEn" : "shipName",
                            valueField: "id"
                        }
                    },
                    {
                        field: "contractSignOnDate",
                        component: "NDatePicker",
                        label: e("crew.contractForm.fromDate"),
                        labelWidth: 100,
                        giProps: {
                            span: 1
                        },
                        componentProps: {
                            type: "date",
                            valueFormat: "yyyy-MM-dd",
                            placeholder: e("crew.contractForm.fromDate"),
                            disabled: r.value
                        },
                        rules: [
                            {
                                required: !0,
                                trigger: [
                                    "blur",
                                    "change"
                                ],
                                validator: (m, c)=>{
                                    const { getFieldsValue: u } = n.value, { contractSignOffDate: h } = u();
                                    if (P(c)) return Promise.reject(new Error(`${e("common.chooseText")} ${e("crew.contractForm.fromDate")}`));
                                    if (i(c).isAfter(i(h))) {
                                        const w = t.locale === "en" ? `${e("crew.contractForm.fromDate")} must not be later than ${e("crew.contractForm.dueDate")}` : `${e("crew.contractForm.fromDate")}不能晚于${e("crew.contractForm.dueDate")}`;
                                        return Promise.reject(new Error(w));
                                    }
                                    return Promise.resolve();
                                }
                            }
                        ]
                    },
                    {
                        field: "contractSignOffDate",
                        component: "NDatePicker",
                        label: e("crew.contractForm.dueDate"),
                        labelWidth: 100,
                        giProps: {
                            span: 1
                        },
                        componentProps: {
                            type: "date",
                            valueFormat: "yyyy-MM-dd",
                            placeholder: e("crew.contractForm.dueDate"),
                            disabled: r.value
                        },
                        rules: [
                            {
                                required: !0,
                                trigger: [
                                    "blur",
                                    "change"
                                ],
                                validator: (m, c)=>{
                                    const { getFieldsValue: u } = n.value, { contractSignOnDate: h } = u();
                                    if (P(c)) return Promise.reject(new Error(`${e("common.chooseText")} ${e("crew.contractForm.dueDate")}`));
                                    if (i(c).isBefore(i(h))) {
                                        const w = t.locale === "en" ? `${e("crew.contractForm.fromDate")} must not be earlier than ${e("crew.contractForm.dueDate")}` : `${e("crew.contractForm.fromDate")}不能早于${e("crew.contractForm.dueDate")}`;
                                        return Promise.reject(new Error(w));
                                    }
                                    return Promise.resolve();
                                }
                            }
                        ]
                    },
                    {
                        field: "handover",
                        hidden: !0
                    },
                    {
                        field: "handoverName",
                        component: "NInput",
                        label: e("crew.contractForm.handover"),
                        labelWidth: 100,
                        giProps: {
                            span: 1
                        },
                        componentProps: {
                            placeholder: e("crew.contractForm.handover"),
                            disabled: !0
                        }
                    },
                    {
                        field: "manningAgent",
                        component: "NSelect",
                        label: e("crew.contractForm.manningAgent"),
                        labelWidth: 100,
                        giProps: {
                            span: 1
                        },
                        componentProps: {
                            disabled: !0,
                            placeholder: e("crew.contractForm.manningAgent"),
                            options: k,
                            labelField: t.getLocale === "en" ? "labelEn" : "label"
                        }
                    }
                ]),
            methods: {
                updateIsView: s
            }
        };
    };
    j = [
        {
            field: "fileDtoList",
            label: e("noticeCircular.general.Attachment"),
            slot: "attachment"
        }
    ];
});
export { x as a, O as b, A as c, _ as g, j as s, p as v, __tla };
