import { ad as P, hc as T, V as d, bk as y, gD as C, d as q, e as x, r as E, a as B, Z as I, gW as f, gX as b, c as M, o as F, w as m, j as c, W as V, l as r, X as W, __tla as __tla_0 } from "./index-9PRMimni.js";
import { B as Y } from "./BasicForm-dL_oCSPM.js";
import { u as j } from "./useForm-CKmgcynv.js";
import { B as A } from "./Table-0PViRYCf.js";
import { _ as X } from "./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";
import { r as $ } from "./dictUtils-D8jA3mBt.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 "./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 "./basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js";
import "./basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js";
import "./useModal-CO65vga3.js";
import "./useTimeout-BxFilWvD.js";
import "./Flex-CTSf12gq.js";
let xe;
let __tla = Promise.all([
    (()=>{
        try {
            return __tla_0;
        } catch  {}
    })()
]).then(async ()=>{
    function O(s) {
        return P.Get("/purchase/order/receipt/page", {
            params: s
        });
    }
    let R, e, U, Z, z, o, H;
    R = y();
    ({ t: e } = d());
    U = await T();
    Z = (s)=>({
            schemas: [
                {
                    field: "shipId",
                    component: "NSelect",
                    label: e("GRNList.vessel"),
                    componentProps: {
                        placeholder: e("GRNList.vessel"),
                        options: U,
                        filterable: !0,
                        "label-field": R.getLocale === "en" ? "shipNameEn" : "shipName",
                        "value-field": "id"
                    }
                },
                {
                    field: "receiptNo",
                    component: "NInput",
                    label: e("GRNList.GRNNo"),
                    componentProps: {
                        placeholder: e("GRNList.GRNNo")
                    }
                },
                {
                    field: "reqNo",
                    component: "NInput",
                    label: e("GRNList.requisitionNo"),
                    componentProps: {
                        placeholder: e("GRNList.requisitionNo")
                    }
                },
                {
                    field: "orderNo",
                    component: "NInput",
                    label: e("GRNList.poNo"),
                    componentProps: {
                        placeholder: e("GRNList.poNo")
                    }
                },
                {
                    field: "submitStatus",
                    component: "NSelect",
                    label: e("GRNList.status"),
                    componentProps: {
                        placeholder: e("GRNList.status"),
                        options: s.statusList,
                        "label-field": R.getLocale === "en" ? "labelEn" : "label"
                    }
                },
                {
                    field: "applyDate",
                    component: "NDatePicker",
                    label: e("GRNList.receivedDate"),
                    componentProps: {
                        placeholder: e("GRNList.applicationDateFrom"),
                        type: "daterange",
                        valueFormat: "yyyy-MM-dd"
                    }
                }
            ]
        });
    z = y();
    ({ t: o } = d());
    H = (s)=>({
            columns: [
                {
                    title: "No.",
                    key: "",
                    width: 60,
                    render (i, n) {
                        return n + 1;
                    }
                },
                {
                    title: o("GRNList.vessel"),
                    key: z.getLocale === "en" ? "shipNameEn" : "shipName",
                    width: 180
                },
                {
                    title: o("GRNList.requisitionNo"),
                    key: "reqNo",
                    width: 180
                },
                {
                    title: o("GRNList.poNo"),
                    key: "orderNo",
                    width: 180
                },
                {
                    title: o("GRNList.GRNNo"),
                    key: "receiptNo",
                    width: 180
                },
                {
                    title: o("GRNList.vendor"),
                    key: "vendorName",
                    width: 180
                },
                {
                    title: o("GRNList.receivedDate"),
                    key: "receiveDate",
                    width: 180
                },
                {
                    title: o("GRNList.receivedPort"),
                    key: "receivePort",
                    width: 180
                },
                {
                    title: o("GRNList.status"),
                    key: "submitStatus",
                    width: 180,
                    render: (i)=>$(s.statusList, i.submitStatus)
                },
                {
                    title: o("GRNList.createdBy"),
                    key: "createName",
                    width: 180
                },
                {
                    title: o("GRNList.createdDate"),
                    key: "createTime",
                    width: 180,
                    render (i) {
                        return i?.createTime ? C(i.createTime).format("YYYY-MM-DD") : "";
                    }
                }
            ]
        });
    xe = q({
        __name: "index",
        setup (s) {
            const l = x(), { t: i } = d(), n = [
                {
                    label: "新建",
                    labelEn: "New",
                    value: 0
                },
                {
                    label: "未提交",
                    labelEn: "UnSubmitted",
                    value: 1
                },
                {
                    label: "已提交",
                    labelEn: "Done",
                    value: 2
                }
            ], { schemas: _ } = Z({
                statusList: n
            }), { columns: L } = H({
                statusList: n
            }), u = E(), G = B({
                width: 100,
                title: i("common.optionsText"),
                key: "action",
                fixed: "right",
                align: "center",
                render (t) {
                    return I(X, {
                        style: "text",
                        actions: [
                            {
                                label: i("common.optionsEditText"),
                                labelShow: !1,
                                icon: f(b.edit),
                                onClick: ()=>v(t),
                                ifShow: [
                                    0,
                                    1
                                ].includes(t.submitStatus)
                            },
                            {
                                label: i("common.optionsViewText"),
                                labelShow: !1,
                                icon: f(b.view, "blue"),
                                onClick: ()=>D(t)
                            }
                        ]
                    });
                }
            }), [w, { getFieldsValue: g }] = j({
                gridProps: {
                    cols: 6
                },
                schemas: _
            });
            async function k(t, a) {
                return a.applyDate && a.applyDate.length !== 0 && (a.applyDate = a.applyDate.join(",")), await O({
                    ...t,
                    ...a
                });
            }
            function v(t) {
                l.push({
                    name: "Add_PMS_GoodsReceDetails",
                    query: {
                        id: t.id
                    }
                });
            }
            function D(t) {
                l.push({
                    name: "Add_PMS_GoodsReceDetails",
                    query: {
                        id: t.id,
                        type: "view"
                    }
                });
            }
            function N() {
                u.value?.restReload();
            }
            return (t, a)=>{
                const h = V, S = W;
                return F(), M(S, null, {
                    default: m(()=>[
                            c(h, {
                                bordered: !1,
                                class: "proCard"
                            }, {
                                default: m(()=>[
                                        c(r(Y), {
                                            onRegister: r(w),
                                            onSubmit: N,
                                            onReset: N
                                        }, null, 8, [
                                            "onRegister"
                                        ])
                                    ]),
                                _: 1
                            }),
                            c(h, {
                                bordered: !1,
                                class: "proCard mt-2"
                            }, {
                                default: m(()=>[
                                        c(r(A), {
                                            ref_key: "basicTableRef",
                                            ref: u,
                                            columns: r(L),
                                            request: (p)=>k(p, r(g)()),
                                            "row-key": (p)=>p.id,
                                            autoScrollX: !0,
                                            actionColumn: r(G),
                                            "virtual-scroll": ""
                                        }, null, 8, [
                                            "columns",
                                            "request",
                                            "row-key",
                                            "actionColumn"
                                        ])
                                    ]),
                                _: 1
                            })
                        ]),
                    _: 1
                });
            };
        }
    });
});
export { xe as default, __tla };
