/**
 * 导入询价物料弹框JS
 * Created by likui on 2020/2/14.
 */
'use strict';
var el = {
    excelFile: '#excelFile',
    form: '#upload',
    tempId: '#tempId',
    dataSource: '#dataSource'
};

$(function () {
    // 初始化文件上传控件
    $(el.excelFile).filebox({
        buttonText: popupi18n.xzwj,
        buttonAlign: 'right',
        accept: '.xlsx',
        multiple: false,
        prompt: '',
        width: 400
    });
});

// 提交数据
function dataImp() {
    //var tempId = $(el.tempId).val();
    var loading = topWin.layer.msg(tipsi18n.sjdrz, {icon: 16});
    $(el.form).form({
        url: g.ctx + 'pc/order/basicPlan/rest/uploadData',
        async: false,
        success: function (data) {
            debugger;
            var datas = $.parseJSON(data);
            //closeLayer();
            parent.updateDate(datas.data);
        }
    });
    $(el.form).submit();
}

//关闭窗口
function closeLayer() {
    //获取窗口索引
    var index = parent.layer.getFrameIndex(window.name);
    parent.layer.close(index);
}


//执行查询接口
function parentDataQuery() {
    //执行查询接口
    parent.parent.dataQuery();
}
