goods.basegoods.brandClassic.js 1.42 KB
webpackJsonp([31],[
/* 0 */
/***/ function(module, exports, __webpack_require__) {

	'use strict';
	var $ = __webpack_require__(1),
	    common = __webpack_require__(2);

	$('input[type="file"]').after('<div class="file-name btn btn-default">请选择文件</div>');

	var loadModal = null;

	function batchExport(el, type) {

	    return {
	        params: {
	            type: type,
	            __type: "batch-import"
	        },
	        onStart: function(params) {
	            console.log("params",params);
	            loadModal = common.dialog.load();
	            $("#message").html('');
	        },
	        onComplete: function(response) {
	            console.log("批量接口返回数据",response);
	            $("#message").html('');
	            if (response.code == 200&&response.data.taskId) {
	                __ajaxExeclById(response.data.taskId);
	                // common.util.__tip(response.message, 'success');
	                return;
	            }
	            if (loadModal) {
	                loadModal.close();
	            }
	            if(response.data&&response.data.failFileReason.length){
	                $("#message").html(response.data.failFileReason.join('<br/>'));
	                return false;
	            }
	            common.util.__tip(response.message, 'success');
	        }
	    }
	}
	/*展示平台*/
	common.edit.ajaxfileupload('#brandClassic', batchExport('#sort-file', 'brandClassic'));

/***/ }
]);