فهرست منبع

add getPagingCondition

zhongzewei 6 سال پیش
والد
کامیت
9cb691c847
2فایلهای تغییر یافته به همراه59 افزوده شده و 0 حذف شده
  1. 16 0
      web/building_saas/main/js/models/ration_glj.js
  2. 43 0
      web/building_saas/main/js/views/glj_view.js

+ 16 - 0
web/building_saas/main/js/models/ration_glj.js

@@ -497,6 +497,22 @@ let ration_glj = {
             }
             }
            return node
            return node
         };
         };
+        ration_glj.prototype.getGLJDataPaging = function (postData, cb) {
+            let property = projectObj.project.projectInfo.property;
+            let engineerID = property.engineering_id;
+            CommonAjax.post(`/rationGlj/getGLJDataPaging/${engineerID}`, postData, function (data) {
+                if(data.datas.priceProperties && data.datas.priceProperties.length > 0){
+                    let tem = _.find(data.datas.priceProperties,{region:property.region,taxModel:parseInt(property.taxType)});
+                    if(tem){
+                        let dataCode = tem.price.dataCode;
+                        for(let glj of data.datas.stdGLJ){
+                            if(glj.priceProperty && gljUtil.isDef(glj.priceProperty[dataCode])) glj.basePrice = glj.priceProperty[dataCode];
+                        }
+                    }
+                };
+                cb(data);
+            });
+        };
         ration_glj.prototype.getGLJData = function (cb) {
         ration_glj.prototype.getGLJData = function (cb) {
             let property = projectObj.project.projectInfo.property;
             let property = projectObj.project.projectInfo.property;
             let engineerID = property.engineering_id;
             let engineerID = property.engineering_id;

+ 43 - 0
web/building_saas/main/js/views/glj_view.js

@@ -64,6 +64,7 @@ var gljOprObj = {
         },
         },
         callback: {
         callback: {
             onClick: function (event, treeId, treeNode) {
             onClick: function (event, treeId, treeNode) {
+                debugger;
                 if (treeId == 'gljTree') {
                 if (treeId == 'gljTree') {
                     let me = gljOprObj, gljTypeId = treeNode.ID;
                     let me = gljOprObj, gljTypeId = treeNode.ID;
                     if (treeNode.ID) {
                     if (treeNode.ID) {
@@ -978,6 +979,47 @@ var gljOprObj = {
         sheetCommonObj.showData(this.gljLibSheet, this.gljLibSheetSetting, this.gljLibSheetData, gljOprObj.distTypeTree);
         sheetCommonObj.showData(this.gljLibSheet, this.gljLibSheetSetting, this.gljLibSheetData, gljOprObj.distTypeTree);
         this.gljLibSheet.setRowCount(this.gljLibSheetData.length);
         this.gljLibSheet.setRowCount(this.gljLibSheetData.length);
     },
     },
+    // 获取分页查询所需要的条件数据
+    // @param {Boolean}init 是否是初始化
+    getPagingCondition: function (init) {
+        const type = {
+            stdGLJ: 1,
+            complementaryGLJs: 2
+        };
+        // 初始化情况下的条件
+        let condition = {
+            // 初始化树结构
+            initTree: true,
+            // 所在部分(标准、补充)
+            type: type.std,
+            // 替换数据
+            replace: {},
+            // 所在分类节点
+            withinClass: [],
+            // 搜索文本
+            search: '',
+        };
+        if (init) {
+            return condition;
+        }
+        condition.initTree = false;
+        // 标准、补充的选择
+        let radioType = $("input[name='glj']:checked").val();
+        condition.type = type[radioType];
+        // 选中的分类
+        let selNode = this.treeObj.getNodeByParam('ID', this.gljCurTypeId);
+        // 不为最顶层节点时,才赋值给withinClass
+        if (selNode.ParentID !== -1) {
+            condition.withinClass = this.parentNodeIds['_pNodeId_' + this.gljCurTypeId];
+        }
+        // 搜索文本
+        let searchStr = $('#gljSearchKeyword').val().trim();
+        if(searchStr){
+            condition.search = searchStr;
+        }
+        return condition;
+
+    },
     filterLibGLJSheetData: function () {
     filterLibGLJSheetData: function () {
         let me = this;
         let me = this;
         let val = $("input[name='glj']:checked").val();
         let val = $("input[name='glj']:checked").val();
@@ -1516,6 +1558,7 @@ $(function () {
         }else if($('#actionType').val() =='addMix'){//添加组成物
         }else if($('#actionType').val() =='addMix'){//添加组成物
             gljOprObj.GLJSelection = [];
             gljOprObj.GLJSelection = [];
             projectGljObject.filterLibGLJForMixRatio();
             projectGljObject.filterLibGLJForMixRatio();
+
             /*selections = projectGljObject.mixRatioData;  添加组成物的时候先不选中
             /*selections = projectGljObject.mixRatioData;  添加组成物的时候先不选中
             gljOprObj.GLJSelection = [];
             gljOprObj.GLJSelection = [];
             for(let s of selections){
             for(let s of selections){