zhongzewei 6 rokov pred
rodič
commit
34255bae28

+ 6 - 0
web/maintain/billsGuidance_lib/js/billsGuidance.js

@@ -518,6 +518,7 @@ const billsGuidance = (function () {
                     }
                     this._fixedTipElement = div;
                 }
+                $(this._fixedTipElement).width('');
                 $(this._fixedTipElement).html(text);
                 if (!this._toolTipElement) {
                     let div = $('#autoTip')[0];
@@ -534,6 +535,7 @@ const billsGuidance = (function () {
                         document.body.insertBefore(div, null);
                     }
                     this._toolTipElement = div;
+                    $(this._toolTipElement).width('');
                     //实时读取位置信息
                     if(hitinfo.sheet && hitinfo.sheet.getParent().qo){
                         setting.pos = SheetDataHelper.getObjPos(hitinfo.sheet.getParent().qo);
@@ -543,6 +545,10 @@ const billsGuidance = (function () {
                     if($(hitinfo.sheet.getParent().qo).attr('id') === 'rationSpread'){
                         let divWidth = $(this._fixedTipElement).width(),
                             divHeight = $(this._fixedTipElement).height();
+                        if(divWidth > 600){
+                            divWidth = 590;
+                            $(this._toolTipElement).width(divWidth);
+                        }
                         $(this._toolTipElement).css("top", setting.pos.y  + hitinfo.y - divHeight).css("left", setting.pos.x - divWidth);
                     }
                     else{

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

@@ -476,8 +476,8 @@
                         </div>
                     </div>
                     <div class="modal-footer">
-                        <button type="button"  class="btn btn-secondary" data-dismiss="modal">取消</button>
                         <a href="javascript:void(0);" id="gljSelY" class="btn btn-primary">确定</a>
+                        <button type="button"  class="btn btn-secondary" data-dismiss="modal">取消</button>
                     </div>
                 </div>
             </div>

+ 36 - 7
web/maintain/ration_repository/js/ration.js

@@ -69,12 +69,9 @@ let rationOprObj = {
     onSelectionChanged: function (sender, info) {
         if(info.oldSelections.length === 0 && info.newSelections.length > 0 || info.oldSelections[0].row !== info.newSelections[0].row){
             let row = info.newSelections[0].row;
-            let me = rationOprObj,
-                sheetGLJ = rationGLJOprObj.sheet, settingGLJ = rationGLJOprObj.setting,
-                sheetCoe = rationCoeOprObj.sheet, settingCoe = rationCoeOprObj.setting,
-                sheetAss = rationAssistOprObj.sheet, settingAss = rationAssistOprObj.setting,
-                sheetInst = rationInstObj.sheet, settingInst = rationInstObj.setting;
-            sheetCommonObj.cleanSheet(sheetGLJ, settingGLJ, -1);
+            let me = rationOprObj;
+            me.rationSelInit(row);
+          /*  sheetCommonObj.cleanSheet(sheetGLJ, settingGLJ, -1);
             sheetCommonObj.cleanSheet(sheetCoe, settingCoe, -1);
             sheetCommonObj.cleanSheet(sheetAss, settingAss, -1);
             sheetCommonObj.cleanSheet(sheetInst, settingInst, -1);
@@ -94,8 +91,36 @@ let rationOprObj = {
             else {
                 rationGLJOprObj.currentRationItem = null;
             }
-            me.workBook.focus(true);
+            me.workBook.focus(true);*/
+        }
+    },
+    rationSelInit: function (row) {
+        let me = rationOprObj,
+            sheetGLJ = rationGLJOprObj.sheet, settingGLJ = rationGLJOprObj.setting,
+            sheetCoe = rationCoeOprObj.sheet, settingCoe = rationCoeOprObj.setting,
+            sheetAss = rationAssistOprObj.sheet, settingAss = rationAssistOprObj.setting,
+            sheetInst = rationInstObj.sheet, settingInst = rationInstObj.setting;
+        sheetCommonObj.cleanSheet(sheetGLJ, settingGLJ, -1);
+        sheetCommonObj.cleanSheet(sheetCoe, settingCoe, -1);
+        sheetCommonObj.cleanSheet(sheetAss, settingAss, -1);
+        sheetCommonObj.cleanSheet(sheetInst, settingInst, -1);
+        let cacheSection = me.getCache();
+        if (cacheSection && row < cacheSection.length) {
+            rationGLJOprObj.getGljItems(cacheSection[row], function () {
+                me.workBook.focus(true);
+            });
+            rationCoeOprObj.getCoeItems(cacheSection[row], function () {
+                me.workBook.focus(true);
+            });
+            rationAssistOprObj.getAssItems(cacheSection[row]);
+            rationInstObj.getInstItems(cacheSection[row], function () {
+                me.workBook.focus(true);
+            });
+        }
+        else {
+            rationGLJOprObj.currentRationItem = null;
         }
+        me.workBook.focus(true);
     },
 
     isInt: function (num) {
@@ -574,6 +599,10 @@ let rationOprObj = {
                         else if (a.code < b.code) rst = -1;
                         return rst;
                     });
+                    //add
+                    let curRow = me.workBook.getActiveSheet().getActiveRowIndex();
+                    me.rationSelInit(curRow);
+                    //add
                     //jobContent
                     if(jobContentOprObj ){
                         jobContentOprObj.currentRationItems = cacheSection;

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

@@ -302,6 +302,7 @@ var rationGLJOprObj = {
                     if(typeof target.row !== 'undefined'){
                         //控制按钮是否可用
                         sheet.setActiveCell(target.row, target.col);
+                        console.log(me.currentRationItem);
                         if(me.currentRationItem){
                             rationGlj =  me.cache['_GLJ_' + me.currentRationItem.ID];
                             if(!rationGlj ||target.row >= rationGlj.length){//右键定位在有数据的行,删除键才显示可用