Просмотр исходного кода

Merge branch 'feature-dgy-导入改为队列操作' into feature-dgy-后台测试

DuGuYang 2 лет назад
Родитель
Сommit
5b9912cacc
1 измененных файлов с 33 добавлено и 0 удалено
  1. 33 0
      wwwroot/layuiadmin/modules_main/PreAmountRecord_Admin.js

+ 33 - 0
wwwroot/layuiadmin/modules_main/PreAmountRecord_Admin.js

@@ -17,6 +17,39 @@ function ConfirmImport() {
     });
 }
 
+function CheckImport(table, key, loadindex, index) {
+    $.ajax({
+        url: "/Admin/PreAmountRecord/CheckImportV2?r=" + Math.random(1),
+        data: "key=" + key,
+        dataType: "json",
+        success: function (data) {
+            if (data.status == 1) {
+                layer.msg("成功操作" + data.data + "条", {
+                    time: 2000
+                }, function () {
+                    layer.close(index); //关闭弹层
+                    layer.close(loadindex);
+                    table.reload('LAY-list-manage'); //数据刷新
+                });
+            } else if (data.status == 2) {
+                layer.close(index); //关闭弹层
+                layer.close(loadindex);
+                var content = '';
+                for (var i = 0; i < data.errList.length; i++) {
+                    content += data.errList[i] + '<br/>'
+                }
+                layer.alert(content);
+            } else {
+                layer.msg(data.data, {
+                    time: 1000
+                }, function () {
+                    CheckImport(table, key, loadindex, index);
+                });
+            }
+        }
+    });
+}
+
 var excel;
 layui.config({
     base: '/layuiadmin/' //静态资源所在路径