batch.js
1.08 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
'use strict';
var $ = require('jquery');
var common = require('../common/common');
function batchExport(el, type) {
var loadModal = null;
return {
params: {
type: type,
__type: "batch-import"
},
onStart: function (params) {
console.log("params", params);
loadModal = common.dialog.load();
},
onComplete: function (response) {
console.log("response",response);
if (loadModal) {
loadModal.close();
}
if (response.code == 200 && response.data.failFileReason.length == 0) {
common.util.__tip(response.message, 'success');
return;
}
if (response.data && response.data.failFileReason.length) {
$("#message").html(response.data.failFileReason.join('/n'));
return false;
}
common.util.__tip(response.message, 'warning');
}
}
}
common.edit.ajaxfileupload('#productModelTry', batchExport('#productModelTry', 'productModelTry'));