浏览代码

安装增加费

zhongzewei 7 年之前
父节点
当前提交
70bfd783c2

+ 1 - 1
modules/ration_repository/models/schemas.js

@@ -172,7 +172,7 @@ let coeListModel = db.model("std_ration_lib_coe_list",coeListSchema, "std_ration
 let rationRepository = db.model("std_ration_lib_map", RepositoryMapSchema, "std_ration_lib_map");
 let rationChapterTreeModel = db.model("std_ration_lib_ration_chapter_trees", rationChapterTreeSchema, "std_ration_lib_ration_chapter_trees");
 let rationItemModel = db.model("std_ration_lib_ration_items",rationItemSchema, "std_ration_lib_ration_items");
-let installSectionModel = db.model("std_ration_lib_installationSection", installSectionSchema, "std_ration_lib_installationSection")
+let installSectionModel = db.model("std_ration_lib_installationSection", installSectionSchema, "std_ration_lib_installationSection");
 let installFeeItemModel = db.model("std_ration_lib_installation", installFeeItemSchema, "std_ration_lib_installation");
 //补充定额
 let compleRationModel = db.model('complementary_ration_items', compleRationSchema, 'complementary_ration_items');

+ 1 - 1
web/maintain/ration_repository/anzhuang.html

@@ -17,7 +17,7 @@
     <div class="header">
         <nav class="navbar navbar-toggleable-lg navbar-light bg-faded p-0 ">
             <span class="header-logo px-2">Smartcost</span>
-            <div class="navbar-text" id="rationname"><a href="main.html">定额库</a><i class="fa fa-angle-right fa-fw"></i>XXX定额库</div>
+            <div class="navbar-text" id="rationname"><a href="main">定额库</a><i class="fa fa-angle-right fa-fw"></i>XXX定额库</div>
         </nav>
         <nav class="navbar navbar-toggleable-lg justify-content-between navbar-light p-0">
               <ul class="nav nav-tabs" role="tablist">

+ 22 - 12
web/maintain/ration_repository/js/installation.js

@@ -64,9 +64,9 @@ let feeItemObj = {
         combo.items(comboItems).editable = false;
         sheet.getRange(-1, col, -1, 1).cellType(combo);
     },
-    updateCurrentData: function (sheet, currentData, cache) {
+    getCurrentData: function (sheet, cache) {
         let acRow = sheet.getActiveRowIndex();
-        currentData = this.isDef(cache[acRow]) ? cache[acRow] : null;
+        return this.isDef(cache[acRow]) ? cache[acRow] : null;
     },
     buildSheet: function () {
         let me = this, se = sectionObj, fr = feeRuleObj, bs = batchSectionObj;
@@ -114,17 +114,18 @@ let feeItemObj = {
         let me = this, se = sectionObj, fr = feeRuleObj;
         sheetCommonObj.cleanSheet(se.sheet, se.setting, -1);
         sheetCommonObj.cleanSheet(fr.sheet, fr.setting, -1);
-        me.workBook.focus(true);
         if(!me.isDef(feeItem)){
+            me.workBook.focus(true);
             me.currentFeeItem = null;
             return;
         }
         fr.addObj = null;
         fr.updateObj = null;
         me.currentFeeItem = feeItem;
-        se.cache = feeItem.section;
+        se.cache = me.currentFeeItem.section;
         sheetCommonObj.showData(se.sheet, se.setting, se.cache);
         se.initSelection(se.cache[0]);
+        me.workBook.focus(true);
 
     },
     onSelectionChanged: function (sender, info) {
@@ -148,7 +149,7 @@ let feeItemObj = {
         }
     },
     onEditEnded: function (sender, args) {
-        let me = feeItemObj;
+        let me = feeItemObj, se = sectionObj;
         let v = me.isDef(args.editingText) ? args.editingText.toString().trim() : '';
         let feeItem = me.cache[args.row];
         let updateObj = {updateType: '', updateData: {}};
@@ -181,12 +182,14 @@ let feeItemObj = {
             updateObj.updateData.section = [];
             me.cache.push(updateObj.updateData);
             me.currentFeeItem = updateObj.updateData;
+            se.cache = me.currentFeeItem.section;
         }
+        sheetCommonObj.showData(me.sheet, me.setting, me.cache);
         //ajax
         me.updateFeeItem([updateObj]);
     },
     onClipboardPasted: function (sender, info) {
-        let me = feeItemObj;
+        let me = feeItemObj, se = sectionObj;
         let postData = [];
         let items = sheetCommonObj.analyzePasteData(me.setting, info);
         for(let i = 0, len = items.length; i < len; i++){
@@ -213,7 +216,8 @@ let feeItemObj = {
             }
         }
         //update currentFeeItem
-        me.updateCurrentData(me.sheet, me.currentFeeItem, me.cache);
+        me.currentFeeItem = me.getCurrentData(me.sheet, me.cache);
+        se.cache = me.currentFeeItem.section;
         sheetCommonObj.showData(me.sheet, me.setting, me.cache);
         if(postData.length > 0){
             //ajax then refresh
@@ -246,7 +250,8 @@ let feeItemObj = {
                 }
             }
             //update currentFeeItem
-            me.updateCurrentData(me.sheet, me.currentFeeItem, me.cache);
+            me.currentFeeItem = me.getCurrentData(me.sheet, me.cache);
+            se.cache = me.currentFeeItem.section;
             if(fiPostData.length > 0){
                 me.updateFeeItem(fiPostData, function () {
                     sheetCommonObj.showData(me.sheet, me.setting, me.cache);
@@ -423,7 +428,7 @@ let sectionObj = {
         }
     },
     onEditEnded: function (sender, args) {
-        let me = sectionObj, fi = feeItemObj;
+        let me = sectionObj, fi = feeItemObj, fr = feeRuleObj;
         let v = me.isDef(args.editingText) ? args.editingText.toString().trim() : '';
         let section = me.cache[args.row];
         let updateObj = {updateType: '', updateData: {}};
@@ -455,7 +460,9 @@ let sectionObj = {
             updateObj.updateData.feeRule = [];
             me.cache.push(updateObj.updateData);
             me.currentSection = updateObj.updateData;
+            fr.cache = me.currentSection.feeRule;
         }
+        sheetCommonObj.showData(me.sheet, me.setting, me.cache);
         me.updateSection([updateObj]);
         fi.updateFeeItem([{updateType: fi.updateType.update, updateData: {ID: fi.currentFeeItem.ID, $addToSet: {section: {ID: updateObj.updateData.ID}}}}]);
     },
@@ -466,7 +473,7 @@ let sectionObj = {
         }
     },
     onClipboardPasted: function (sender, info) {
-        let me = sectionObj, fi = feeItemObj;
+        let me = sectionObj, fi = feeItemObj, fr = feeRuleObj;
         let sePostData = [], fiPostData = [];
         let items = sheetCommonObj.analyzePasteData(me.setting, info);
         for(let i = 0, len = items.length; i < len; i++){
@@ -488,7 +495,8 @@ let sectionObj = {
             }
         }
         //update currentSection
-        fi.updateCurrentData(me.sheet, me.currentSection, me.cache);
+        me.currentSection = fi.getCurrentData(me.sheet, me.cache);
+        fr.cache = me.currentSection.feeRule;
         sheetCommonObj.showData(me.sheet, me.setting, me.cache);
         if(sePostData.length > 0){
             me.updateSection(sePostData);
@@ -520,7 +528,8 @@ let sectionObj = {
                 }
             }
             //update currentSection
-            fi.updateCurrentData(me.sheet, me.currentSection, me.cache);
+            me.currentSection = fi.getCurrentData(me.sheet, me.cache);
+            fr.cache = me.currentSection.feeRule;
             if(sePostData.length > 0){
                 me.updateSection(sePostData, function () {
                     sheetCommonObj.showData(me.sheet, me.setting, me.cache);
@@ -890,6 +899,7 @@ let feeRuleObj = {
                 updateObj.updateType = se.updateType.update;
                 updateObj.updateData.ID = se.currentSection.ID;
                 updateObj.updateData.feeRule = me.cache;
+                sheetCommonObj.showData(me.sheet, me.setting, me.cache);
                 se.updateSection([{updateType: se.updateType.update, updateData: se.currentSection}]);
                 me.addObj = null;
             }

+ 1 - 0
web/maintain/ration_repository/js/ration.js

@@ -590,6 +590,7 @@ let rationOprObj = {
                         rationGLJOprObj.getGljItems(cacheSection[row]);
                         rationCoeOprObj.getCoeItems(cacheSection[row]);
                         rationAssistOprObj.getAssItems(cacheSection[row]);
+                        rationInstObj.getInstItems(cacheSection[row]);
                     }
                     else {
                         rationGLJOprObj.currentRationItem = null;