Browse Source

投中接口对接

zhbyyy 2 years ago
parent
commit
31e44adec0

+ 4 - 4
investmentPort/investHomeGroup.html

@@ -447,7 +447,7 @@
             </div>
             <div class="content top-lb">
               <div v-for="(item,index) in titleList.slice(0,11)" :key="index" @mouseenter="yellowMouse(index)"
-                @mouseleave="yellowType=true" @click="showChartLTipDouble(item.name)"
+                @mouseleave="yellowType=true" @click="showChartLTipDouble(item.name,'right')"
                 class="topCard flex items-center justify-center flex-col  overflow-hidden pointer">
                 <div class="flex items-center justify-center shrink-0"
                   :class="(item.type==1&&item.name)?'titleBackBlue':(item.type==2&&item.name)?'titleBackYellow':''">
@@ -467,8 +467,8 @@
               <span class="text">股权类</span>
             </div>
             <div class="content top-rb">
-              <div class="topCard flex items-center justify-center flex-col  overflow-hidden"
-                @mouseenter="yellowMouse(12)">
+              <div class="topCard flex items-center justify-center flex-col  overflow-hidden pointer"
+                @mouseenter="yellowMouse(12)" @click="showChartLTipDouble(titleList[12].name,'right')">
                 <div class="flex items-center justify-center shrink-0"
                   :class="(titleList[12].type==1)?'titleBackBlue':'titleBackYellow'"><span
                     class="flex items-center justify-center"
@@ -482,7 +482,7 @@
                 <div class="flex items-center justify-center shrink-0">
                 </div>
               </div>
-              <div class="topCard flex items-center justify-center flex-col " @mouseenter="yellowMouse(14)">
+              <div class="topCard flex items-center justify-center flex-col pointer" @mouseenter="yellowMouse(14)" @click="showChartLTipDouble(titleList[14].name,'right')">
                 <div class="flex items-center justify-center shrink-0"
                   :class="(titleList[14].type==1)?'titleBackBlue':'titleBackYellow'"><span
                     class="flex items-center justify-center"

+ 54 - 36
investmentPort/js/groupData.js

@@ -449,24 +449,24 @@ let right3 = [
 ]
 // 中间右边
 let right4 = [
-  { name: '山西焦煤', value: 189.07, value2: 121.59 },
-  { name: '晋能控股', value: 385.25, value2: 224.89 },
-  { name: '华阳新材', value: 82.95, value2: 71.34 },
-  { name: '潞安化工', value: 106.84, value2: 59.93 },
-  { name: '华新燃气', value: 31.83, value2: 25.20 },
-  { name: '太重集团', value: 80.01, value2: 42.46 },
-  { name: '国际能源', value: 64.20, value2: 12.19 },
-  { name: '华远陆港', value: 97.57, value2: 112.67 },
-  { name: '万家寨水控', value: 46.99, value2: 50.89 },
-  { name: '文旅集团', value: 26.79, value2: 9.64 },
-  { name: '山西交控', value: 346.36, value2: 335.91 },
-  { name: '航产集团', value: 41.09, value2: 42.67 },
-  { name: '山西建投', value: 218.35, value2: 143.84 },
-  { name: '汾酒集团', value: 14.03, value2: 7.69 },
-  { name: '大地控股', value: 47.05, value2: 23.93 },
-  { name: '云时代', value: 63.45, value2: 32.60 },
-  { name: '华舰体育', value: 5.33, value2: 0.80 },
-  { name: '神农科技', value: 14.76, value2: 5.84 }
+  { name: '山西焦煤', value: 189.07, value2: 121.59, value3: 121.59, value4: 121.59, value5: 121.59 },
+  { name: '晋能控股', value: 385.25, value2: 224.89, value3: 121.59, value4: 121.59, value5: 121.59 },
+  { name: '华阳新材', value: 82.95, value2: 71.34, value3: 121.59, value4: 121.59, value5: 121.59 },
+  { name: '潞安化工', value: 106.84, value2: 59.93, value3: 121.59, value4: 121.59, value5: 121.59 },
+  { name: '华新燃气', value: 31.83, value2: 25.20, value3: 121.59, value4: 121.59, value5: 121.59 },
+  { name: '太重集团', value: 80.01, value2: 42.46, value3: 121.59, value4: 121.59, value5: 121.59 },
+  { name: '国际能源', value: 64.20, value2: 12.19, value3: 121.59, value4: 121.59, value5: 121.59 },
+  { name: '华远陆港', value: 97.57, value2: 112.67, value3: 121.59, value4: 121.59, value5: 121.59 },
+  { name: '万家寨水控', value: 46.99, value2: 50.89, value3: 121.59, value4: 121.59, value5: 121.59 },
+  { name: '文旅集团', value: 26.79, value2: 9.64, value3: 121.59, value4: 121.59, value5: 121.59 },
+  { name: '山西交控', value: 346.36, value2: 335.91, value3: 121.59, value4: 121.59, value5: 121.59 },
+  { name: '航产集团', value: 41.09, value2: 42.67, value3: 121.59, value4: 121.59, value5: 121.59 },
+  { name: '山西建投', value: 218.35, value2: 143.84, value3: 121.59, value4: 121.59, value5: 121.59 },
+  { name: '汾酒集团', value: 14.03, value2: 7.69, value3: 121.59, value4: 121.59, value5: 121.59 },
+  { name: '大地控股', value: 47.05, value2: 23.93, value3: 121.59, value4: 121.59, value5: 121.59 },
+  { name: '云时代', value: 63.45, value2: 32.60, value3: 121.59, value4: 121.59, value5: 121.59 },
+  { name: '华舰体育', value: 5.33, value2: 0.80, value3: 121.59, value4: 121.59, value5: 121.59 },
+  { name: '神农科技', value: 14.76, value2: 5.84, value3: 121.59, value4: 121.59, value5: 121.59 }
 ]
 // 左边下面
 let right5 = [
@@ -533,26 +533,44 @@ let right5 = [
 ]
 // 右边下面
 let right6 = [
-  { value: 189.07, value2: 121.59, value3: 212.6, value4: 35.8 },
-  { value: 385.25, value2: 224.89, value3: 12.6, value4: 35.8 },
-  { value: 82.95, value2: 71.34, value3: 12.6, value4: 35.8 },
-  { value: 106.84, value2: 59.93, value3: 312.6, value4: 35.8 },
-  { value: 31.83, value2: 25.20, value3: 12.6, value4: 35.8 },
-  { value: 80.01, value2: 42.46, value3: 12.6, value4: 35.8 },
-  { value: 64.20, value2: 12.19, value3: 412.6, value4: 35.8 },
-  { value: 97.57, value2: 112.67, value3: 12.6, value4: 35.8 },
-  { value: 46.99, value2: 50.89, value3: 12.6, value4: 35.8 },
-  { value: 26.79, value2: 9.64, value3: 12.6, value4: 35.8 },
-  { value: 346.36, value2: 335.91, value3: 12.6, value4: 35.8 },
-  { value: 41.09, value2: 42.67, value3: 12.6, value4: 35.8 },
-  { value: 218.35, value2: 143.84, value3: 12.6, value4: 35.8 },
-  { value: 14.03, value2: 7.69, value3: 12.6, value4: 35.8 },
-  { value: 47.05, value2: 23.93, value3: 12.6, value4: 35.8 },
-  { value: 63.45, value2: 32.60, value3: 12.6, value4: 35.8 },
-  { value: 5.33, value2: 0.80, value3: 12.6, value4: 35.8 },
-  { value: 14.76, value2: 5.84, value3: 12.6, value4: 35.8 }
+  { value: 189.07, value2: 121.59, value3: 212.6 },
+  { value: 385.25, value2: 224.89, value3: 12.6 },
+  { value: 82.95, value2: 71.34, value3: 12.6 },
+  { value: 106.84, value2: 59.93, value3: 312.6 },
+  { value: 31.83, value2: 25.20, value3: 12.6 },
+  { value: 80.01, value2: 42.46, value3: 12.6 },
+  { value: 64.20, value2: 12.19, value3: 412.6 },
+  { value: 97.57, value2: 112.67, value3: 12.6 },
+  { value: 46.99, value2: 50.89, value3: 12.6 },
+  { value: 26.79, value2: 9.64, value3: 12.6 },
+  { value: 346.36, value2: 335.91, value3: 12.6 },
+  { value: 41.09, value2: 42.67, value3: 12.6 },
+  { value: 218.35, value2: 143.84, value3: 12.6 },
+  { value: 14.03, value2: 7.69, value3: 12.6 },
+  { value: 47.05, value2: 23.93, value3: 12.6 },
+  { value: 63.45, value2: 32.60, value3: 12.6 },
+  { value: 5.33, value2: 0.80, value3: 12.6 },
+  { value: 14.76, value2: 5.84, value3: 12.6 }
 ]
 let right7 = [
+  // 安全风险/付款风险/合同风险/结算风险/进度风险/质量风险
+  [88200, 80000, 20000, 35000, 50000, 18000],
+  [88200, 80000, 20000, 35000, 50000, 18000],
+  [88200, 80000, 20000, 35000, 50000, 18000],
+  [88200, 80000, 20000, 35000, 50000, 18000],
+  [88200, 80000, 20000, 35000, 50000, 18000],
+  [88200, 80000, 20000, 35000, 50000, 18000],
+  [88200, 80000, 20000, 35000, 50000, 18000],
+  [88200, 80000, 20000, 35000, 50000, 18000],
+  [88200, 80000, 20000, 35000, 50000, 18000],
+  [88200, 80000, 20000, 35000, 50000, 18000],
+  [88200, 80000, 20000, 35000, 50000, 18000],
+  [88200, 80000, 20000, 35000, 50000, 18000],
+  [88200, 80000, 20000, 35000, 50000, 18000],
+  [88200, 80000, 20000, 35000, 50000, 18000],
+  [88200, 80000, 20000, 35000, 50000, 18000],
+  [88200, 80000, 20000, 35000, 50000, 18000],
+  [88200, 80000, 20000, 35000, 50000, 18000],
   [88200, 80000, 20000, 35000, 50000, 18000]
 ]
 let right8 = [

+ 200 - 20
investmentPort/js/investHomeGroup.js

@@ -146,11 +146,11 @@ let app = new Vue({
       this.initChinaChart()
       // this.initProjectList()
       // 大屏三
-      this.initChartR1()
-      this.initChartR2()
-      this.initChartR3()
+      // this.initChartR1()
+      // this.initChartR2()
+      // this.initChartR3()
       // this.initChartR4()
-      // this.initChartR5()
+      this.initChartR5()
       this.changeYellow()
 
     })
@@ -181,14 +181,34 @@ let app = new Vue({
       }
       post('/ierp/api/login.do', value).then(res => {
         this.access_token = res.data.access_token
-        this.getDate1()
-        this.getDate2()
-        this.getDate3()
-        this.getDate4()
-        this.getDate5()
-        this.getDate6()
+        this.getOrg()
       })
     },
+    // 获取组织架构列表
+    getOrg () {
+      return new Promise((resolve, err) => {
+        let value = {
+          access_token: this.access_token,
+        }
+        get('/ierp/kapi/v2/mdnb/mdnb_xmkb/mdnb_manager_middle/getOrgName', value).then(res => {
+          commonCompany = res.data.map(item => item.simplename)
+          // this.getDate1()
+          // this.getDate2()
+          // this.getDate3()
+          // this.getDate4()
+          // this.getDate5()
+          // this.getDate6()
+          this.getDate7()
+          this.getDate8()
+          this.getDate9()
+          this.getDate10()
+          // this.getDate11()
+          this.getDate12()
+          // this.getDate13()
+          resolve(1);
+        })
+      });
+    },
     // 获取左边企业额度分析
     getDate1 () {
       return new Promise((resolve, err) => {
@@ -369,7 +389,7 @@ let app = new Vue({
         })
       });
     },
-    // 重点项目两线指标
+    // 获取左边重点项目两线指标
     getDate6 () {
       let that = this
       return new Promise((resolve, err) => {
@@ -394,6 +414,162 @@ let app = new Vue({
         })
       });
     },
+    // 获取右边顶部条数据
+    getDate7 () {
+      return new Promise((resolve, err) => {
+        let value = {
+          access_token: this.access_token,
+          "request": {
+            isInsert: '0'
+          },
+          pageSize: 1000
+        }
+        post('/ierp/kapi/v2/mdnb/mdnb_xmkb/mdnb_manager_middle/getTabpageap', value).then(res => {
+          right1[0].number = res.data.mdnb_one_step
+          right1[2].number = res.data.mdnb_two_step
+          right1[4].number = res.data.mdnb_three_step
+          right1[6].number = res.data.mdnb_four_step
+          right1[8].number = res.data.mdnb_five_step
+          right1[10].number = res.data.mdnb_six_step
+          right1[12].number = res.data.mdnb_seven_step
+          right1[14].number = res.data.mdnb_eight_step
+          resolve(1);
+        })
+      });
+    },
+    // 获取右边中间左边的(正偏差/容差内/负偏差)
+    getDate8 () {
+      return new Promise((resolve, err) => {
+        let value = {
+          access_token: this.access_token,
+          "request": {
+            isInsert: '0'
+          },
+          pageSize: 1000
+        }
+        post('/ierp/kapi/v2/mdnb/mdnb_xmkb/mdnb_manager_middle/getInvestSunstraction', value).then(res => {
+          right3[0].value = res.data.mdnb_projectnum_z
+          right3[0].value2 = res.data.mdnb_amountall_z
+          right3[1].value = res.data.mdnb_projectnum_r
+          right3[1].value2 = res.data.mdnb_amountall_r
+          right3[2].value = res.data.mdnb_projectnum_f
+          right3[2].value2 = res.data.mdnb_amountall_f
+          resolve(1);
+        })
+      });
+    },
+    // 获取右边中间右边的(预算额/已签合同额。。。)
+    getDate9 () {
+      return new Promise((resolve, err) => {
+        let value = {
+          access_token: this.access_token,
+          "request": {
+            isInsert: '0'
+          },
+          pageSize: 1000
+        }
+        post('/ierp/kapi/v2/mdnb/mdnb_xmkb/mdnb_manager_middle/getUnitBudgetExecuteDate', value).then(res => {
+          res.data.forEach((item, index) => {
+            right4[index].value = item.mdnb_aheadmoney
+            right4[index].value2 = item.mdnb_edmoney
+            right4[index].value3 = item.mdnb_smoney
+            right4[index].value4 = item.mdnb_jmoney
+            right4[index].value5 = item.mdnb_fkmoney
+          })
+          this.initChartR1()
+          resolve(1);
+        })
+      });
+    },
+    // 进度成本偏差
+    getDate10 () {
+      return new Promise((resolve, err) => {
+        let value = {
+          access_token: this.access_token,
+          "request": {
+            isInsert: '0'
+          },
+          pageSize: 1000
+        }
+        post('/ierp/kapi/v2/mdnb/mdnb_xmkb/mdnb_manager_middle/getInvestSunstractionGas', value).then(res => {
+          res.data.forEach((item, index) => {
+            right5[0][index][1] = item.mdnb_amount_z
+            right5[1][index][1] = item.mdnb_amount_n
+            right5[2][index][1] = item.mdnb_amount_f
+          })
+          this.initChartR2()
+          resolve(1);
+        })
+      });
+    },
+    // 项目风险分析A
+    getDate11 () {
+      return new Promise((resolve, err) => {
+        let value = {
+          access_token: this.access_token,
+          "request": {
+            isInsert: '0'
+          },
+          pageSize: 1000
+        }
+        post('/ierp/kapi/v2/mdnb/mdnb_xmkb/mdnb_manager_middle/getUnitNoSolveDangerDate', value).then(res => {
+          res.data.forEach((item, index) => {
+            right6[index].value = item.mdnb_height
+            right6[index].value2 = item.mdnb_midle
+            right6[index].value3 = item.mdnb_bottom
+          })
+          this.initChartR3()
+          resolve(1);
+        })
+      });
+    },
+    // 项目风险分析B(雷达图)
+    getDate12 () {
+      return new Promise((resolve, err) => {
+        let value = {
+          access_token: this.access_token,
+          "request": {
+            isInsert: '0'
+          },
+          pageSize: 1000
+        }
+        post('/ierp/kapi/v2/mdnb/mdnb_xmkb/mdnb_manager_middle/getUnitDangerPoraitDate', value).then(res => {
+          res.data.forEach((item, index) => {
+            right7[index][0] = item.mdnb_anquan
+            right7[index][1] = item.mdnb_fukuan
+            right7[index][2] = item.mdnb_hetong
+            right7[index][3] = item.mdnb_jiesuan
+            right7[index][4] = item.mdnb_jindu
+            right7[index][5] = item.mdnb_securty
+          })
+          this.getDate11()
+          resolve(1);
+        })
+      });
+    },
+    // 右边穿透
+    rightPenetrate () {
+      return new Promise((resolve, err) => {
+        let value = {
+          access_token: this.access_token,
+          "request": {
+            isInsert: '0'
+          },
+          pageSize: 1000
+        }
+        post('/ierp/kapi/v2/mdnb/mdnb_xmkb/mdnb_manager_middle/getOneLevelData', value).then(res => {
+          res.data.forEach((item, index) => {
+            common4[index] = item.mdnb_projects
+            common5[index] = item.mdnb_amount_sl
+          })
+          setTimeout(() => {
+            this.initChartLTip2()
+            this.initChartLTip3()
+          })
+          resolve(1);
+        })
+      });
+    },
     yellowMouse (index) {
       if (index % 2 == 0) {
         this.yellowCount = index
@@ -446,10 +622,14 @@ let app = new Vue({
       return myArr
     },
     // 两个柱状图的弹窗
-    showChartLTipDouble (e) {
+    showChartLTipDouble (e, location) {
       this.titleName = e
       this.closeTap()
       this.echartDoubleTipShow = true
+      if (location == 'right') {
+        this.rightPenetrate()
+        return
+      }
       setTimeout(() => {
         this.initChartLTip2()
         this.initChartLTip3()
@@ -1882,7 +2062,7 @@ let app = new Vue({
       myChart.on('click', function (param) {
         that.titleName = param.name
         that.echartEnterpriseShow = true
-        let findData =  dataList.find(item => {
+        let findData = dataList.find(item => {
           return item.mdnb_textfield == param.name
         })
         common1[0] = findData.mdnb_amountfield18
@@ -4550,7 +4730,7 @@ let app = new Vue({
                 ]),
               },
             },
-            data: right4.map(item => item.value),
+            data: right4.map(item => item.value3),
           },
           {
             name: '结算额',
@@ -4570,7 +4750,7 @@ let app = new Vue({
                 ]),
               },
             },
-            data: right4.map(item => item.value2),
+            data: right4.map(item => item.value4),
           },
           {
             name: '付款额',
@@ -4590,7 +4770,7 @@ let app = new Vue({
                 ]),
               },
             },
-            data: right4.map(item => item.value),
+            data: right4.map(item => item.value5),
           },
         ],
       }
@@ -4809,8 +4989,8 @@ let app = new Vue({
       myChart.on('showTip', (params) => {
         this.echartR4Chart ? this.echartR4Chart.dispose() : ''
         this.echartR5Chart ? this.echartR5Chart.dispose() : ''
-        that.initChartR4()
-        that.initChartR5()
+        that.initChartR4(params.dataIndex)
+        that.initChartR5(params.dataIndex)
         // 如果是7或者15并且满足防抖则切换
         if ((params.dataIndex == 5 || params.dataIndex == 11) && that.echartR3Fd) {
           that.echartR3Fd = false
@@ -5033,7 +5213,7 @@ let app = new Vue({
         loopSeries: true,
       })
     },
-    initChartR4 () {
+    initChartR4 (indexValue) {
       this.echartR4Chart = echarts.init(this.$refs['echartR4'])
       option = {
         title: {
@@ -5094,7 +5274,7 @@ let app = new Vue({
             symbolSize: 0, // 数值点的大小
             data: [
               {
-                value: right7[0],
+                value: right7[indexValue],
                 name: '安全风险',
                 itemStyle: { //该数值区域样式设置
                   normal: {

+ 13 - 8
investmentPort/js/request.js

@@ -3,7 +3,8 @@
  * 请求拦截、相应拦截、错误统一处理
  */
 const httpRequest = axios.create({
-  baseURL: 'http://192.168.2.144:8080', // 测试环境
+  // baseURL: 'http://192.168.2.155:8080', // 李瑞投前
+  baseURL: 'http://192.168.2.109:8080', // 苏文投后
   timeout: 3 * 60 * 1000, // 3分钟等待
   withCredentials: true, // 携带cookie
 })
@@ -11,9 +12,12 @@ const httpRequest = axios.create({
 // 请求拦截器
 httpRequest.interceptors.request.use(
   function (config) {
-    if(config.data.access_token){
+    if (config.data && config.data.access_token) {
       config.headers['accessToken'] = config.data.access_token
     }
+    if (config.params && config.params.access_token) {
+      config.headers['accessToken'] = config.params.access_token
+    }
     // if (!isLocalEnv()) {
     //   if (getQueryVariable('token')) {
     //     config.headers['access_token'] = getQueryVariable('token')
@@ -51,12 +55,13 @@ httpRequest.interceptors.response.use(
     return response
   },
   function (error) {
+    console.log(error, '??????????')
     this.ELEMENT.Message.error(error.message)
     return Promise.reject(error)
   }
 )
 
-function get(url, params) {
+function get (url, params) {
   return new Promise((resolve, reject) => {
     httpRequest
       .get(url, { params: params })
@@ -69,7 +74,7 @@ function get(url, params) {
   })
 }
 // qs.stringify(data)
-function post(url, data, config) {
+function post (url, data, config) {
   return new Promise((resolve, reject) => {
     httpRequest
       .post(url, data, config)
@@ -82,7 +87,7 @@ function post(url, data, config) {
   })
 }
 
-function postFile(url, blob) {
+function postFile (url, blob) {
   return new Promise((resolve, reject) => {
     let formdata = new FormData()
     formdata.append('multipartFile', blob)
@@ -97,7 +102,7 @@ function postFile(url, blob) {
   })
 }
 
-function localEnvLogin() {
+function localEnvLogin () {
   post(
     '/apiSys/login',
     {
@@ -119,7 +124,7 @@ function localEnvLogin() {
 }
 
 // 将参数转换成功 formdata 接收格式
-function stringify(data) {
+function stringify (data) {
   let ret = ''
   for (const it in data) {
     ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
@@ -129,7 +134,7 @@ function stringify(data) {
 }
 
 // 格式化日期
-function formatDate(time) {
+function formatDate (time) {
   let date = time ? new Date(Number(time)) : new Date();
   let Y = date.getFullYear() + '-';
   let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';