Преглед изворни кода

修改上传清单方案,修复导入bug

laiguoran пре 2 година
родитељ
комит
fe48ab5095
1 измењених фајлова са 15 додато и 15 уклоњено
  1. 15 15
      app/public/js/material_checklist.js

+ 15 - 15
app/public/js/material_checklist.js

@@ -1347,22 +1347,22 @@ $(document).ready(() => {
                 const select = _.find(materialChecklistData, { b_code: t.b_code, name: t.name, unit: t.unit, unit_price: t.unit_price ? parseFloat(t.unit_price) : null });
                 console.log(select, datas, mbList);
                 if (select) {
-                    await postData(window.location.pathname + '/save', {type: 'adds', checklist: { id: select.id, had_bills: 1 }, postData: {xmjs: datas, mbIds: mbList, export: true}}, function (result) {
-                        // materialListData = result;
-                        select.had_bills = 1;
-                        gclList = result;
-                        stopProgress($('#list-progress'));
-                        if (i+1 === tree.length) {
-                            toastr.success('导入成功');
-                            setTimeout(function () { $('#okedit').modal('hide') }, 2000);
-                            showSjsData();
-                        }
+                    const result = await postDataAsync(window.location.pathname + '/save', {type: 'adds', checklist: { id: select.id, had_bills: 1 }, postData: {xmjs: datas, mbIds: mbList, export: true}});
+                    // materialListData = result;
+                    select.had_bills = 1;
+                    gclList = result;
+                    stopProgress($('#list-progress'));
+                    if (i+1 === tree.length) {
+                        toastr.success('导入成功');
+                        setTimeout(function () { $('#okedit').modal('hide') }, 2000);
+                        showSjsData();
+                    }
 
-                    }, function () {
-                        stop = true;
-                        clearInterval(interval);
-                        setTimeout(function () { $('#okedit').modal('hide') }, 1000);
-                    });
+                    // }, function () {
+                    //     stop = true;
+                    //     clearInterval(interval);
+                    //     setTimeout(function () { $('#okedit').modal('hide') }, 1000);
+                    // });
                 } else {
                     stopProgress($('#list-progress'));
                 }