function initVue() {
    window.vue = new Vue({
        el: "#vue",
        data: {
            // 开关
            profile: "",
            showqel: false,
            showcydata: true,

            // 组件数据
            item: {}
        },
        methods: {
            loadData: function () {
                var sn = urlQuery("sn");
                var body = { SerialNum: sn };
                ajaxPost('/api/dianziDataQueryNew/dianziDataQuery', body, (r) => {
                    if (!r.status) return toast(r.msg);
                    if (!r.data.length) return toast("NOT FOUND");
                    console.log(r.data[0]);
                    this.item = r.data[0];

                    var doprint = urlQuery("doprint");
                    switch (doprint) {
                        case "true":
                        case "yes":
                        case "1":
                            window.lang.loadStrings(() => {
                                window.print();
                            });
                            break;
                    }
                }, (e) => {
                    if (e.message) toast(e.message);
                });
            },
        }
    });
    vue.loadData();
    if (window.lang) {
        window.lang.loadStrings(() => {
            vue.$forceUpdate();
        });
    }
}

window.addEventListener("load", () => {
    initVue();
});