Ver código fonte

1. 导入Excel后,清楚上一次选择数据
2. 新建标段,新建后应关闭新建窗口

MaiXinRong 6 anos atrás
pai
commit
78c4ad5ab0

+ 4 - 1
app/public/js/ledger.js

@@ -1242,7 +1242,6 @@ $(document).ready(function() {
         }$('#upload-ledger-sheets').hide();
         try {
             xlsxUtils.import(this.files[0], (excelData) => {
-                console.log(excelData);
                 if (excelData.SheetNames.length > 0) {
                     const html = [];
                     html.push('<label for="exampleFormControlFile1">勾选要导入的工作簿</label>');
@@ -1284,5 +1283,9 @@ $(document).ready(function() {
             });
         }
     });
+    $('#upload-ledger').bind('hidden.bs.modal', function () {
+        $('#upload-ledger-file').val('');
+        $('#upload-ledger-sheets').html('');
+    });
 });
 

+ 5 - 3
app/public/js/tender_list.js

@@ -154,9 +154,10 @@ function getCategoryHtml() {
         html.push('<div class="form-group" cate-id="' + cate.id + '">');
         html.push('<lable>', cate.name, '</lable>');
         html.push('<div>');
-        for (const v of cate.value) {
+        for (const iV in cate.value) {
+            const v = cate.value[iV];
             html.push('<div class="form-check-inline">');
-            html.push('<input class="form-check-input" type="radio"', 'value="' , v.id,  '">');
+            html.push('<input class="form-check-input" type="radio"', 'name="' + cate.name + '" ', 'value="' , v.id, (iV == 0 ? '" checked="' : ''),  '">');
             html.push('<label class="form-check-label">', v.value, '</label>');
             html.push('</div>');
         }
@@ -303,7 +304,6 @@ $(document).ready(() => {
     $('.modal-body', '#add-bd').append(getCategoryHtml());
     // 初始化标段树结构
     initTenderTree();
-    console.log(tenderTree);
     $('.c-body').html(getTenderTreeHtml());
     bindTenderUrl();
     // 分类
@@ -358,6 +358,8 @@ $(document).ready(() => {
             initTenderTree();
             $('.c-body').html(getTenderTreeHtml());
             bindTenderUrl();
+            $('#add-bd').modal('hide');
+            $('[name=name]', '#add-bd').val('');
         });
     });
 });

+ 2 - 1
app/view/tender/manage_modal.ejs

@@ -154,4 +154,5 @@
                 <button type="button" class="btn btn-primary">确定添加</button>
             </div>
         </div>
-    </div>
+    </div>
+</div>

+ 1 - 1
test/app/lib/analysis_excel.test.js

@@ -72,7 +72,7 @@ describe('test/app/lib/analysis_excel.test.js', () => {
         assert(gcl.quantity === 92954.75);
     });
     it('analysis Excel Test Data', function* () {
-        const excelFile = app.baseDir  + '/app/public/files/template/ledger/Book1.xls';
+        const excelFile = app.baseDir  + '/app/public/files/template/ledger/导入分项清单Excel格式.xls';
         const wb = Xlsx.readFile(excelFile);
         const name = wb.SheetNames[0];
         const sheetData = {