@{
    ViewData["Title"] = "自动对账面板";
    Layout = "~/Pages/Shared/_MainLayout.cshtml";
}

@section css{
    <link href="@Url.Content("~/css/vue/v-cloak.css")" rel="stylesheet" />
    <link href="@Url.Content("~/css/vue/element-ui-2.15.6.css")" rel="stylesheet" />
    <link href="@Url.Content("~/css/component/el-form-control.css")" rel="stylesheet" />
    <link href="@Url.Content("~/css/component/el-form-filter.css")" rel="stylesheet" />
    <link href="@Url.Content("~/css/component/el-table-control.css")" rel="stylesheet" />
    <link href="@Url.Content("~/css/component/el-table-query.css")" rel="stylesheet" />
    <link href="@Url.Content("~/css/component/el-dialog-form.css")" rel="stylesheet" />
}

@section scripts{
    <script src="@Url.Content("~/js/vue/vue-2.6.14.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/js/vue/element-ui-2.15.6.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/js/vue/vue-resource.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/js/component/js.prototype.ex.js")" type="text/javascript"></script>
    <script type="text/x-template" id="elTableQuery">
        @Html.PartialAsync("~/Areas/Component/Views/Table/Query.cshtml").Result
    </script>
    <script type="text/x-template" id="elDialogForm">
        @Html.PartialAsync("~/Areas/Component/Views/Dialog/Form.cshtml").Result
    </script>
    <script>
        $(document).ready(function () {
            new Vue({
                el: '#app',
                data: {
                    //编码
                    code: getUrlParam("code"),
                    //加载
                    loading: false
                },
                methods: {
                    //显示弹窗
                    onShowDialog: function (title, form, code) {
                        this.$refs.dialogForm.showDialog(title, form, code);
                    },
                    //关闭弹窗
                    onCloseDialog: function (title, form, code) {
                        this.$refs.dialogForm.closeDialog();
                    },
                    //查询数据
                    onSearch: function (firstPage) {
                        this.$refs.tableQuery.onSearch(false, firstPage);
                    }
                }
            })
        })
    </script>
}
<div id="app" v-cloak>
    <el-table-query v-bind:code="code" ref="tableQuery" v-on:show-dialog="onShowDialog" v-on:close-dialog="onCloseDialog"></el-table-query>
    <el-dialog-form v-bind:code="code" ref="dialogForm"></el-dialog-form>
</div>
