product.productBatch.Import.js
1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
webpackJsonp([143],[
/* 0 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
var $ = __webpack_require__(1), common = __webpack_require__(2);
var importConfig = { "bizType" : "productBatch" };
$('input[type="file"]').after('<div class="file-name btn btn-default">请选择文件</div>');
var loadModal = null;
//导入
function batchImport(el, type) {
return {
params: {
type: type,
__type: "batch-import"
},
onStart: function(params) {
console.log("params",params);
loadModal = common.dialog.load();
},
onComplete: function(response) {
if (loadModal) {
loadModal.close();
}
console.log("批量接口返回数据",response);
var msg = response.message;
if (response.code == 200) {
common.util.__tip(msg, 'success');
$("#message").html("");
} else if (msg) {
$("#message").html(msg);
common.util.__tip("导入失败", 'warning');
} else {
common.util.__tip("导入失败", 'warning');
}
}
}
}
common.edit.ajaxfileupload('#importProductBatch', batchImport('#sort-file', importConfig.bizType));
/***/ }
]);