浏览代码

导入清单后真删除
补充定额库删除bug

zhongzewei 6 年之前
父节点
当前提交
1e4aef9c72

+ 4 - 4
modules/complementary_ration_lib/models/sectionTreeModel.js

@@ -122,10 +122,10 @@ class SectionTreeDao {
                     await compleRationSectionTreeModel.create(updateObj.updateData);
                 }
                 else if(updateObj.updateType === 'update'){
-                    await compleRationSectionTreeModel.update({userId: userID, rationRepId: updateObj.updateData.rationRepId, ID: updateObj.updateData.ID}, updateObj.updateData);
-                    if(updateObj.updateData.deleteInfo){
-                        await compleRationModel.update({userId: userID, sectionId: updateObj.updateData.ID},
-                            {$set: {deleteInfo: {deleted: true, deleteBy: userID, deleteDateTime: Date.now()}}}, {multi: true});
+                    if(!updateObj.updateData.deleteInfo){
+                        await compleRationSectionTreeModel.update({userId: userID, ID: updateObj.updateData.ID}, updateObj.updateData);
+                    } else {
+                        await compleRationSectionTreeModel.remove({userId: userID, ID: updateObj.updateData.ID});
                     }
                 }
             }

+ 20 - 0
web/building_saas/complementary_ration_lib/html/dinge.html

@@ -573,6 +573,26 @@
         </div>
     </div>
 </div>
+<div class="modal fade" id="delRationAlert" data-backdrop="static" style="display: none;" aria-hidden="true">
+    <input type="hidden"  value="123">
+    <div class="modal-dialog" role="document">
+        <div class="modal-content">
+            <div class="modal-header">
+                <h5 class="modal-title">警告</h5>
+                <button type="button"  class="close" data-dismiss="modal" aria-label="Close">
+                    <span aria-hidden="true">×</span>
+                </button>
+            </div>
+            <div class="modal-body">
+                <h5 class="text-danger">是否删除当前节点及其子项?</h5>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-danger" id="delRationConfirm">确认</button>
+                <button type="button" class="btn btn-secondary"  data-dismiss="modal">取消</button>
+            </div>
+        </div>
+    </div>
+</div>
 <!-- JS. -->
 <script src = "/lib/spreadjs/sheets/gc.spread.sheets.all.11.1.2.min.js"></script>
 <script>GC.Spread.Sheets.LicenseKey =  '<%- LicenseKey %>';</script>

+ 2 - 2
web/building_saas/complementary_ration_lib/html/gongliao.html

@@ -48,9 +48,9 @@
                 <!--  <li class="nav-item">
                       <a class="nav-link px-3" id="fuzhu" href="<%= redirectCoe %>">子目换算</a>
                   </li>-->
-                  <li class="nav-item">
+                  <!--<li class="nav-item">
                       <a class="nav-link px-3" id="anzhuang" href="<%= redirectInstallation %>">安装增加费</a>
-                  </li>
+                  </li>-->
               </ul>
         </nav>
     </div>

+ 1 - 1
web/building_saas/complementary_ration_lib/js/global.js

@@ -12,7 +12,7 @@ function autoFlashHeight(){
     $(".main-data-top").height($(window).height()-headerHeight-toolsBar-bottomContentHeight-2);
     $(".main-data-top-fluid").height($(window).height()-headerHeight-bottomContentHeight-2);
     $(".main-data").height($(window).height()-headerHeight);
-    $(".main-side .tab-content").height($(window).height()-headerHeight-38);
+    $(".main-side .tab-content").height($(window).height()-headerHeight-29);
     $('#partialBody').height($(window).height()-headerHeight-toolsBar - 60);
     let partialWidth = $('#tablePartial').width();
     $('#tablePartial').find('th:eq(0)').width(partialWidth * 0.06);

+ 15 - 16
web/building_saas/complementary_ration_lib/js/ration.js

@@ -267,15 +267,14 @@ let rationOprObj = {
                         callback: function(){},
                         items: {
                             "delete": {name: "删除", disabled: delDis, icon: "fa-remove", callback: function (key, opt) {
-
                                 let removeInfo = `确定要删除定额 “${ration.code}” 及其下的所有数据吗?`;
                                 $('#delRationAlert').find('.modal-body h5').text(removeInfo);
                                 $('#delRationAlert').modal('show');
+                                $('#delRationConfirm').unbind('click');
                                 $('#delRationConfirm').bind('click', function () {
                                     me.rationsCodes.splice(me.rationsCodes.indexOf(ration.code.toString()), 1);
                                     me.mixDel = 1;
                                     me.mixUpdateRequest([], [], [ration.ID]);
-                                    $('#delRationConfirm').unbind('click');
                                     $('#delRationAlert').modal('hide');
                                 });
                             }}
@@ -471,12 +470,12 @@ let rationOprObj = {
                 if(rObj.code && rObj.code.toString().trim().length > 0){
                     if(me.rationsCodes.indexOf(rObj.code.toString()) === -1){
                         //jobContent
-                        if(jobContentOprObj && jobContentOprObj.currentSituation === jobContentOprObj.situations.ALL){
+                       /* if(jobContentOprObj && jobContentOprObj.currentSituation === jobContentOprObj.situations.ALL){
                             rObj.jobContent = jobContentOprObj.currentJobContent ? jobContentOprObj.currentJobContent : '';
                         }
                         if(annotationOprObj && annotationOprObj.currentSituation === annotationOprObj.situations.ALL){
                             rObj.annotation = annotationOprObj.currentAnnotation ? annotationOprObj.currentAnnotation : '';
-                        }
+                        }*/
                         me.setInitPrc(rObj);
                         if (rObj.code && rObj.code !== '') {
                             rObj.code = rObj.code.toUpperCase();
@@ -534,12 +533,12 @@ let rationOprObj = {
                 if(!cacheSection[rowIdx] && info.cellRange.col === 0 ){
                     if(me.rationsCodes.indexOf(items[i].code.toString()) === -1){
                         //jobConten
-                        if(jobContentOprObj && jobContentOprObj.currentSituation === jobContentOprObj.situations.ALL){
+                        /*if(jobContentOprObj && jobContentOprObj.currentSituation === jobContentOprObj.situations.ALL){
                             items[i].jobContent = jobContentOprObj.currentJobContent ? jobContentOprObj.currentJobContent : '';
                         }
                         if(annotationOprObj && annotationOprObj.currentSituation === annotationOprObj.situations.ALL){
                             items[i].annotation = annotationOprObj.currentAnnotation ? annotationOprObj.currentAnnotation : '';
-                        }
+                        }*/
                         me.setInitPrc(items[i]);
                         addArr.push(items[i]);
                         me.rationsCodes.push(items[i].code.toString());
@@ -582,12 +581,12 @@ let rationOprObj = {
                     //是否含有已存在的编号
                     if(me.rationsCodes.indexOf(items[i].code.toString()) === -1){
                         //jobConten
-                        if(jobContentOprObj && jobContentOprObj.currentSituation === jobContentOprObj.situations.ALL){
+                       /* if(jobContentOprObj && jobContentOprObj.currentSituation === jobContentOprObj.situations.ALL){
                             items[i].jobContent = jobContentOprObj.currentJobContent ? jobContentOprObj.currentJobContent : '';
                         }
                         if(annotationOprObj && annotationOprObj.currentSituation === annotationOprObj.situations.ALL){
                             items[i].annotation = annotationOprObj.currentAnnotation ? annotationOprObj.currentAnnotation : '';
-                        }
+                        }*/
                         me.setInitPrc(items[i]);
                         addArr.push(items[i]);
                     }
@@ -647,7 +646,7 @@ let rationOprObj = {
             me.rationSelInit(curRow);
             //add
             //jobContent
-            if(jobContentOprObj ){
+            /*if(jobContentOprObj ){
                 jobContentOprObj.currentRationItems = cacheSection;
                 jobContentOprObj.setRadiosDisabled(cacheSection.length > 0 ? false : true, jobContentOprObj.radios);
                 if(cacheSection.length === 0){
@@ -667,7 +666,7 @@ let rationOprObj = {
                 if(annotationOprObj.currentSituation === annotationOprObj.situations.PARTIAL){
                     annotationOprObj.buildTablePartial(annotationOprObj.fzTablePartial, annotationOprObj.getGroup(cacheSection));
                 }
-            }
+            }*/
             me.showRationItems(me.currentSectionId);
             me.mixUpdate = 0;
             me.mixDel = 0;
@@ -684,10 +683,10 @@ let rationOprObj = {
             me.currentSectionId = sectionID;
             if (me.currentRations["_SEC_ID_" + sectionID]) {
                 //jobContent--
-                jobContentOprObj.currentRationItems = me.currentRations["_SEC_ID_" + sectionID];
-                jobContentOprObj.rationJobContentOpr(me.currentRations["_SEC_ID_" + sectionID]);
+               /* jobContentOprObj.currentRationItems = me.currentRations["_SEC_ID_" + sectionID];
+                jobContentOprObj.rationJobContentOpr(me.currentRations["_SEC_ID_" + sectionID]);*/
                 //annotation
-                annotationOprObj.rationAnnotationOpr(me.currentRations["_SEC_ID_" + sectionID]);
+                //annotationOprObj.rationAnnotationOpr(me.currentRations["_SEC_ID_" + sectionID]);
                 me.showRationItems(sectionID);
                 sectionTreeObj.removeBtn.removeClass('disabled');
                 if(callback){
@@ -698,10 +697,10 @@ let rationOprObj = {
                     me.currentRations["_SEC_ID_" + sectionID] = rstData;
                     me.sortByCode(me.currentRations["_SEC_ID_" + sectionID]);
                     //job--
-                    jobContentOprObj.currentRationItems = me.currentRations["_SEC_ID_" + sectionID];
-                    jobContentOprObj.rationJobContentOpr(me.currentRations["_SEC_ID_" + sectionID]);
+                    /*jobContentOprObj.currentRationItems = me.currentRations["_SEC_ID_" + sectionID];
+                    jobContentOprObj.rationJobContentOpr(me.currentRations["_SEC_ID_" + sectionID]);*/
                     //annotation
-                    annotationOprObj.rationAnnotationOpr(me.currentRations["_SEC_ID_" + sectionID]);
+                    //annotationOprObj.rationAnnotationOpr(me.currentRations["_SEC_ID_" + sectionID]);
                     me.showRationItems(sectionID);
                     sectionTreeObj.removeBtn.removeClass('disabled');
                     if(callback) {

+ 1 - 1
web/building_saas/complementary_ration_lib/js/section_tree.js

@@ -274,7 +274,7 @@ let sectionTreeObj = {
             me.setColor(me.cache);
             me.sheet.setFormatter(-1, 0, '@');
             me.initSelection(me.tree.selected);
-            explanatoryOprObj.bindEvents($('#explanationShow'), $('#ruleTextShow'));
+            //explanatoryOprObj.bindEvents($('#explanationShow'), $('#ruleTextShow'));
         };
         let errFunc = function () {