瀏覽代碼

24日bug修复

zhbyyy 2 年之前
父節點
當前提交
4677b826e6
共有 2 個文件被更改,包括 86 次插入49 次删除
  1. 2 2
      investmentPort/investHome.html
  2. 84 47
      investmentPort/js/investHomeGroup.js

+ 2 - 2
investmentPort/investHome.html

@@ -626,9 +626,9 @@
             </div>
           </div>
           <!-- 悬浮窗 -->
-          <div class="flotage absolute" :style="{left:(yellowPosition + 'px')}" v-if="yellowCount % 2 ==0">
+          <!-- <div class="flotage absolute" :style="{left:(yellowPosition + 'px')}" v-if="yellowCount % 2 ==0">
             <span>项目金额:{{numFormat(right2[yellowCount][1])}}</span>
-          </div>
+          </div> -->
         </div>
         <div class="right-c">
           <div class="centerBack center-l ">

+ 84 - 47
investmentPort/js/investHomeGroup.js

@@ -113,6 +113,19 @@ let app = new Vue({
     this.countYear()
   },
   methods: {
+    // 解决乘法失去精度
+    numMulti (num1, num2) {
+      var baseNum = 0;
+      try {
+        baseNum += num1.toString().split(".")[1].length;
+      } catch (e) {
+      }
+      try {
+        baseNum += num2.toString().split(".")[1].length;
+      } catch (e) {
+      }
+      return Number(num1.toString().replace(".", "")) * Number(num2.toString().replace(".", "")) / Math.pow(10, baseNum);
+    },
     // 获取地址栏参数
     getUrlParams (id) {
       let url = window.location.href
@@ -897,7 +910,7 @@ let app = new Vue({
               that.config6.data[index][0] = item.mdnb_unitcompany
               that.config6.data[index][1] = item.mdnb_project_name
               that.config6.data[index][2] = item.mdnb_implement_org
-              that.config6.data[index][3] = item.mdnb_percentagetolerance
+              that.config6.data[index][3] = that.numMulti(item.mdnb_percentagetolerance, 100) + '%'
               that.config6.data[index][4] = that.numFormat(item.mdnb_investment_money / 10000)
             })
           } else if (this.projectNum == 314) {
@@ -933,6 +946,14 @@ let app = new Vue({
         })
       });
     },
+    // 排序方法
+    compare (property) {
+      return function (a, b) {
+        var value1 = a[property];
+        var value2 = b[property];
+        return value1 - value2;  //降序只需要  return value2- value1
+      }
+    },
     // 左边穿透一级
     leftPenetrateOne (mdnb_textfield11, mdnb_textfield13, mdnb_textfield16, mdnb_textfield23, typeNum, type, param, typeCTwo, paramCTwo) {
       this.boardType = 'left'
@@ -951,6 +972,8 @@ let app = new Vue({
           pageSize: 1000
         }
         post('/ierp/kapi/v2/mdnb/mdnb_xmkb/mdnb_manager_preinvest/yjct', value).then(res => {
+          res.data.rows[0].mdnb_entryentity12.sort(that.compare('mdnb_integerfield19'))
+          console.log(res.data.rows[0].mdnb_entryentity12,'????????')
           if (res.data.rows.length > 0) {
             if (typeNum == 2) {
               common4 = []
@@ -1182,25 +1205,26 @@ let app = new Vue({
                 common3.push(that.yuanChange(item.cyplanamount))
               }
               if (param == 'cyplancount') {
-                common3.push(that.yuanChange(item.cyplanamount))
+
+                common3.push(item.cyplancount)
               }
               if (param == 'szplanamount') {
                 common3.push(that.yuanChange(item.szplanamount))
               }
               if (param == 'szplancount') {
-                common3.push(that.yuanChange(item.szplancount))
+                common3.push(item.szplancount)
               }
               if (param == 'investamount') {
                 common3.push(that.yuanChange(item.investamount))
               }
               if (param == 'projectcount') {
-                common3.push(that.yuanChange(item.projectcount))
+                common3.push(item.projectcount)
               }
               if (param == 'gdzcamount') {
-                common3.push(that.yuanChange(item.projectcount))
+                common3.push(that.yuanChange(item.gdzcamount))
               }
               if (param == 'gqtzamount') {
-                common3.push(that.yuanChange(item.projectcount))
+                common3.push(that.yuanChange(item.gqtzamount))
               }
               if (param == 'ceiamount') {
                 common3.push(that.yuanChange(item.ceiamount))
@@ -1240,7 +1264,7 @@ let app = new Vue({
                   common4.push(item.renewcount)
                   common5.push(that.yuanChange(item.renewamount))
                 })
-              } else if (param == '太原市') {
+              } else {
                 res.data.investmentMap.forEach((item, index) => {
                   common4.push(item.value2)
                   common5.push(that.yuanChange(item.amount))
@@ -1266,7 +1290,7 @@ let app = new Vue({
       });
     },
     // 中间穿透二级
-    centerPenetrateTwo (type, param, orgNum, portType) {
+    centerPenetrateTwo (type, param, orgNum, portType,proName) {
       this.boardType = 'center'
       let that = this
       return new Promise((resolve, err) => {
@@ -1488,7 +1512,7 @@ let app = new Vue({
             mock: this.mockData,
             presetYear: this.year - 1,
             type: 'investmentMap',
-            param: '太原市',
+            param: proName,
             orgNum
           }
           get('/ierp/kapi/v2/mdnb/mdnb_xmkb/presetdata/MainPageMonthReportProject', value).then(res => {
@@ -1538,28 +1562,32 @@ let app = new Vue({
       return a ? a.number.slice(0, 4) : ''
     },
     // 找项目编码
-    findProjectCode (a, b, type) {
-      console.log(a, b, type, this.originalConfig6)
+    findProjectCode (a, b, type, e) {
+      console.log(a, b, type, this.originalConfig6, e.rowIndex)
       if (type == 'center') {
-        let c = this.originalConfig6.find(item => {
-          return item.orgName == a && item.projectname == b
-        })
-        return c.projectno
+        return this.originalConfig6[e.rowIndex].projectno
+        // let c = this.originalConfig6.find(item => {
+        //   return item.orgName == a && item.projectname == b
+        // })
+        // return c.projectno
       } else if (type == 'right') {
-        let c = this.originalConfig6.find(item => {
-          return item.mdnb_unitcompany == a && item.mdnb_project_name == b
-        })
-        return c.mdnb_projectnumber
+        return this.originalConfig6[e.rowIndex].mdnb_projectnumber
+        // let c = this.originalConfig6.find(item => {
+        //   return item.mdnb_unitcompany == a && item.mdnb_project_name == b
+        // })
+        // return c.mdnb_projectnumber
       } else if (type == 'left') {
-        let c = this.originalConfig6.find(item => {
-          return item.mdnb_textfield7 == a && item.mdnb_textfield6 == b
-        })
-        return c.mdnb_textfield14
+        return this.originalConfig6[e.rowIndex].mdnb_textfield14
+        // let c = this.originalConfig6.find(item => {
+        //   return item.mdnb_textfield7 == a && item.mdnb_textfield6 == b
+        // })
+        // return c.mdnb_textfield14
       } else if (type == 'center2') {
-        let c = this.centerOriginalConfig6.find(item => {
-          return item.orgName == a && item.projectname == b
-        })
-        return c.projectno
+        return this.centerOriginalConfig6[e.rowIndex].projectno
+        // let c = this.centerOriginalConfig6.find(item => {
+        //   return item.orgName == a && item.projectname == b
+        // })
+        // return c.projectno
       }
     },
     // 去项目看板
@@ -1568,7 +1596,8 @@ let app = new Vue({
       if (f) {
         this.boardType = f
       }
-      this.boardUrl = `http://${this.goUrl}/ierp/accessTokenLogin.do?access_token=${this.access_token}&redirect=http://${this.goUrl}/ierp/index.html?formId=mdnb_threetoproject&prj=${this.findProjectCode(e.row[0], e.row[1], this.boardType)}`
+      // this.boardUrl = `http://${this.goUrl}/ierp/accessTokenLogin.do?access_token=${this.access_token}&redirect=http://${this.goUrl}/ierp/index.html?formId=mdnb_threetoproject&prj=${this.findProjectCode(e.row[0], e.row[1], this.boardType)}`
+      this.boardUrl = `http://${this.goUrl}/ierp/accessTokenLogin.do?access_token=${this.access_token}&redirect=http://${this.goUrl}/ierp/index.html?formId=mdnb_threetoproject&prj=${this.findProjectCode(e.row[0], e.row[1], this.boardType, e)}`
       // this.findProjectCode(e.row[0],e.row[2])
       // 当前页面打开
       // window.location.href = `http://192.168.2.111:8080/ierp/accessTokenLogin.do?access_token=${this.access_token}&redirect=http://192.168.2.111:8080/ierp/index.html?formId=mdnb_threetoproject&prj=PL_ZZGY_0_2023_000036`
@@ -1662,7 +1691,7 @@ let app = new Vue({
             type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
           },
           formatter: data => {
-            return `${data[0].name}</br>${data[0].seriesName}:${that.numFormat(data[0].value - 1)}亿`
+            return `${data[0].name}</br>${data[0].seriesName}:${that.numFormat(data[0].value - 1)}${(this.titleName == '项目数量' || this.titleName == '项目总数') ? "个" : "亿"}`
           },
           textStyle: {
             color: '#FFF',     // 文字的颜色
@@ -1698,7 +1727,7 @@ let app = new Vue({
           type: 'log',
           min: 1,
           logBase: 2,
-          name: '亿',
+          name: (this.titleName == '项目数量' || this.titleName == '项目总数') ? '个' : '亿',
           nameTextStyle: {//y轴上方单位的颜色
             color: '#fff',
             fontSize: '20',
@@ -1738,7 +1767,7 @@ let app = new Vue({
         },
         series: [
           {
-            name: "总额度",
+            name: (this.titleName == '项目数量' || this.titleName == '项目总数') ? '总数量' : "总额度",
             type: "bar",
             data: common3,
             showBackground: false,
@@ -1764,7 +1793,7 @@ let app = new Vue({
         ],
         legend: {
           // data: ["2022年额度", "2023年额度"],
-          data: ["总额度"],
+          data: (this.titleName == '项目数量' || this.titleName == '项目总数') ? ["总数量"] : ["总额度"],
           textStyle: {
             // 图列内容样式
             color: "#fff", // 字体颜色
@@ -1797,6 +1826,7 @@ let app = new Vue({
       that.myChartTip1.setOption(option);
     },
     initChartLTip2 (location, mdnb_textfield11, mdnb_textfield13, mdnb_textfield16, mdnb_textfield23, type, param, typeCTwo, paramCTwo, portType) {
+      let param2 = param
       this.myChartTip2 = echarts.init(document.getElementById("echartSingleTip2"));
       let option = {
         grid: {
@@ -1846,6 +1876,7 @@ let app = new Vue({
           },
         },
         yAxis: {
+          minInterval: 1,
           name: this.changeLine ? '个' : '亿',
           nameTextStyle: {//y轴上方单位的颜色
             color: '#fff',
@@ -1934,7 +1965,7 @@ let app = new Vue({
           } else if (location == 'left') {
             that.leftPenetrateTwo(mdnb_textfield11, mdnb_textfield13, mdnb_textfield16, mdnb_textfield23, param.name, that.projectNum)
           } else if (location == 'center') {
-            that.centerPenetrateTwo(typeCTwo, paramCTwo, that.findCode(param.name), portType)
+            that.centerPenetrateTwo(typeCTwo, paramCTwo, that.findCode(param.name),portType,param2)
           }
         } else {
           that.projectListTipShow = true
@@ -1943,6 +1974,7 @@ let app = new Vue({
       that.myChartTip2.setOption(option);
     },
     initChartLTip3 (location, mdnb_textfield11, mdnb_textfield13, mdnb_textfield16, mdnb_textfield23, type, param, typeCTwo, paramCTwo, portType) {
+      let param2 = param
       this.myChartTip3 = echarts.init(document.getElementById("echartSingleTip3"));
       common5 = common5.map((item) => Number(item) + 1)
       let option = {
@@ -2080,7 +2112,7 @@ let app = new Vue({
           } else if (location == 'left') {
             that.leftPenetrateTwo(mdnb_textfield11, mdnb_textfield13, mdnb_textfield16, mdnb_textfield23, param.name, that.projectNum)
           } else if (location == 'center') {
-            that.centerPenetrateTwo(typeCTwo, paramCTwo, that.findCode(param.name), portType)
+            that.centerPenetrateTwo(typeCTwo, paramCTwo, that.findCode(param.name), portType,param2)
           }
         } else {
           that.projectListTipShow = true
@@ -2304,6 +2336,7 @@ let app = new Vue({
       this.left11Chart.setOption(option)
     },
     initChartL1 () {
+      let that = this
       this.left9Chart = echarts.init(this.$refs['echartL1'])
       option = {
         series: [
@@ -2409,6 +2442,9 @@ let app = new Vue({
                 textStyle: {
                   color: "#fff", // x轴文字颜色
                 },
+                formatter: data => {
+                  return `${that.numMulti(data.value, 100).toFixed(2)}%`
+                },
               },
             },
           },
@@ -4086,6 +4122,7 @@ let app = new Vue({
       // })
     },
     initChartL10 () {
+      let that = this
       this.left7Chart = echarts.init(document.getElementById("echartL10"));
       let option = {
         title: {
@@ -4184,7 +4221,7 @@ let app = new Vue({
             type: 'scatter',
             symbol: 'circle',//'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow'
             symbolSize: function (data) {
-              return Math.sqrt(Math.sqrt(data[2])) * 5;
+              return that.numMulti(Math.sqrt(Math.sqrt(data[2])), 5);
             },
             // label: {
             //   emphasis: {
@@ -4207,7 +4244,7 @@ let app = new Vue({
             type: 'scatter',
             symbol: 'circle',//'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow'
             symbolSize: function (data) {
-              return Math.sqrt(Math.sqrt(data[2])) * 5;
+              return that.numMulti(Math.sqrt(Math.sqrt(data[2])), 5);
             },
             // label: {
             //   emphasis: {
@@ -4227,7 +4264,6 @@ let app = new Vue({
           },
         ]
       }
-      let that = this
       that.left7Chart.on('click', function (param) {
         that.showChartLTipDouble(param.name, 'left', '项目阶段分析', '固定资产', param.name, param.seriesName, '', '', '', '', '', 216)
       })
@@ -4238,6 +4274,7 @@ let app = new Vue({
       })
     },
     initChartL11 () {
+      let that = this
       this.left8Chart = echarts.init(document.getElementById("echartL11"));
       let option = {
         title: {
@@ -4331,11 +4368,11 @@ let app = new Vue({
         },
         series: [
           {
-            name: '',
+            name: '特别监管',
             type: 'scatter',
             symbol: 'circle',
             symbolSize: function (data) {
-              return Math.sqrt(Math.sqrt(data[2])) * 5;
+              return that.numMulti(Math.sqrt(Math.sqrt(data[2])), 5);
             },
             // label: {
             //   emphasis: {
@@ -4354,11 +4391,11 @@ let app = new Vue({
             data: left14[0]
           },
           {
-            name: '',
+            name: '备案',
             type: 'scatter',
             symbol: 'circle',
             symbolSize: function (data) {
-              return Math.sqrt(Math.sqrt(data[2])) * 5;
+              return that.numMulti(Math.sqrt(Math.sqrt(data[2])), 5);
             },
             // label: {
             //   emphasis: {
@@ -4378,9 +4415,8 @@ let app = new Vue({
           },
         ]
       }
-      let that = this
       that.left8Chart.on('click', function (param) {
-        that.showChartLTipDouble(param.name, 'left', '项目阶段分析', '股权类进度分布', param.name, param.seriesName, '', '', '', '', '', 216)
+        that.showChartLTipDouble(param.name, 'left', '项目阶段分析', '股权类', param.name, param.seriesName, '', '', '', '', '', 216)
       })
       that.left8Chart.setOption(option)
       tools.loopShowTooltip(that.left8Chart, option, {
@@ -4708,7 +4744,8 @@ let app = new Vue({
                 },
               ],
             });
-            res.yAxis.push(((data[i].value / sumValue) * 100).toFixed(2) + "%");
+            // res.yAxis.push(((data[i].value / sumValue) * 100).toFixed(2) + "%");
+            res.yAxis.push(that.numMulti(data[i].value / sumValue, 100).toFixed(2) + "%");
           }
           return res;
         }
@@ -6336,7 +6373,7 @@ let app = new Vue({
             itemStyle: itemStyle,
             data: right5[0],
             symbolSize: function (data) {
-              return Math.sqrt(Math.sqrt(Math.abs(data[2]))) * 40;
+              return that.numMulti(Math.sqrt(Math.sqrt(data[2])), 40);
             },
           },
           {
@@ -6345,7 +6382,7 @@ let app = new Vue({
             itemStyle: itemStyle,
             data: right5[1],
             symbolSize: function (data) {
-              return Math.sqrt(Math.sqrt(Math.abs(data[2]))) * 40;
+              return that.numMulti(Math.sqrt(Math.sqrt(data[2])), 40);
             },
           },
           {
@@ -6354,7 +6391,7 @@ let app = new Vue({
             itemStyle: itemStyle,
             data: right5[2],
             symbolSize: function (data) {
-              return Math.sqrt(Math.sqrt(Math.abs(data[2]))) * 40;
+              return that.numMulti(Math.sqrt(Math.sqrt(data[2])), 40);
             },
           }
         ]