1
0

2 Коммиты 8e9082b724 ... 3be191ff4c

Автор SHA1 Сообщение Дата
  gjy 3be191ff4c Merge branch 'dev' of http://221.182.8.141:2300/tengmingxue/dcWaterService into dev 1 год назад
  gjy 97f885cb9d '' 1 год назад

+ 1 - 1
src/views/dataBoard/api/smartMarketing.js

@@ -2,7 +2,7 @@
  *      智慧生产
  */
 import request from '@/utils/request'
-// 用户统计
+// 用户统计 
 export function userStat(params) {
   return request({
     url: '/gis/Lscreen/GetUserCount',

+ 1 - 1
src/views/dataBoard/api/smartOperating.js

@@ -3,7 +3,7 @@
  */
 import request from '@/utils/request'
 
-// 管线材质
+// 管线材质长度统计
 export function pipeLineMaterial(params) {
   return request({
     url: '',

+ 14 - 12
src/views/dataBoard/smartMarketing/components/moneydata/hklchart.vue

@@ -6,7 +6,7 @@
 </template>
 
 <script>
-import { GetCollectionRate } from '@/api/dataBoard/misdata'
+import { repaymentStat } from '@/views/dataBoard/api/smartMarketing'
 import comMixins from '@/views/dataBoard/mixins/comMixins'
 
 export default {
@@ -40,24 +40,24 @@ export default {
      */
     GetCollectionRateList() {
       const that = this
-      GetCollectionRate({ data: { num: 24 } }).then((res) => {
-        if (res.Code == 200) {
-
+      repaymentStat({ data: { num: 24 } }).then((res) => {
+        if (res.code == 1) {
+          console.log('回款统计', res)
           let chartData = {
             dataAry: [],
             seriesAry1: [],
             seriesAry2: [],
           }
 
-          const rows = res.Result.rows
+          const rows = res.result
           if (rows.length > 0) {
             for (let i = 1; i <= 12; i++) {
               //当前年
               let currentCwrq = that.currentYear + '' + (i < 10 ? '0' + i : i)
-              let currentRow = rows.filter(item => item.
-                CWRQ == currentCwrq)
+              let currentRow = rows.filter(item => item
+                .cwrq == currentCwrq)
               if (currentRow.length > 0) {
-                chartData.seriesAry2.push((Number(currentRow[0].CollectionRate) * 100).toFixed(2))
+                chartData.seriesAry2.push((Number(currentRow[0].collectionrate) * 100).toFixed(2))
               } else {
                 chartData.seriesAry2.push(0)
               }
@@ -65,9 +65,9 @@ export default {
               //上一年
               let lastMonth = that.lastYear + '' + (i < 10 ? '0' + i : i)
               let lastRow = rows.filter(item => item.
-                CWRQ == lastMonth)
+                cwrq == lastMonth)
               if (lastRow.length > 0) {
-                chartData.seriesAry1.push((Number(lastRow[0].CollectionRate) * 100).toFixed(2))
+                chartData.seriesAry1.push((Number(lastRow[0].collectionrate) * 100).toFixed(2))
               } else {
                 chartData.seriesAry1.push(0)
               }
@@ -157,7 +157,8 @@ export default {
         series: [
           {
             name: '去年',
-            type: 'bar',
+            type: 'line',
+            smooth: true,
             data: chartData.seriesAry1,//.reverse(),
             barWidth: '30%',
             itemStyle: {
@@ -170,7 +171,8 @@ export default {
           },
           {
             name: '今年',
-            type: 'bar',
+            type: 'line',
+            smooth: true,
             data: chartData.seriesAry2,//.reverse(),
             barWidth: '30%',
             itemStyle: {

+ 16 - 12
src/views/dataBoard/smartMarketing/components/moneydata/moneytype.vue

@@ -14,6 +14,7 @@
 
 <script>
 import { CountUp } from 'countup.js'
+import { waterUseType } from '@/views/dataBoard/api/smartMarketing'
 import { GetUserSfYsxz } from '@/api/dataBoard/misdata'
 import comMixins from '@/views/dataBoard/mixins/comMixins'
 
@@ -25,7 +26,7 @@ export default {
   mixins: [comMixins],
   data() {
     return {
-      title: '上月多种分类的收费数据收入情况统计',
+      title: '分类收入情况统计',
       numList: [
         { id: '0', name: '生活用水收入', num: '0', color: 'color0' },
         { id: '1', name: '商业用水收入', num: '0', color: 'color0' },
@@ -49,18 +50,21 @@ export default {
      */
     GetUserSfYsxzList() {
       const that = this
-      GetUserSfYsxz({}).then((res) => {
+      waterUseType({}).then((res) => {
         //console.log("GetUserSfYsxz"+JSON.stringify(res))
-        if (res.Code == 200) {
-          const life = res.Result.rows.find(item => item.MC == '居民生活用水')
-          if (life) this.numList[0].num = that.accDiv(life.JE, 10000).toFixed(2)
-          const business = res.Result.rows.find(item => item.MC == '非居民生活用水')
-          if (business) this.numList[1].num = that.accDiv(business.JE, 10000).toFixed(2)
-          const special = res.Result.rows.find(item => item.MC == '特种用水')
-          if (special) this.numList[2].num = that.accDiv(special.JE, 10000).toFixed(2)
-          const other = res.Result.rows.find(item => item.MC == '其他用水')
-          if (other) this.numList[3].num = that.accDiv(other.JE, 10000).toFixed(2)
-
+        if (res.code == 1) {
+          console.log('用水分类', res.result)
+          const life = res.result.find(item => item.mc == '生活')
+          if (life) this.numList[0].num = that.accDiv(life.je, 10000).toFixed(2)
+          const business = res.result.find(item => item.mc == '非居/商业')
+          if (business) this.numList[1].num = that.accDiv(business.je, 10000).toFixed(2)
+          const special = res.result.find(item => item.mc == '特种用水')
+          if (special) this.numList[2].num = that.accDiv(special.je, 10000).toFixed(2)
+          // 过滤出所有不属于上述类别的数据并对其je属性求和
+          const other = res.result.filter(item => item.mc != '生活' && item.mc != '非居/商业' && item.mc != '特种用水').reduce((prev, next) => {
+            return { je: prev.je + next.je }
+          }, { je: 0 })
+          if (other) this.numList[3].num = that.accDiv(other.je, 10000).toFixed(2)
           this.$nextTick(() => {
             let animal = null
             that.numList.forEach((item, index) => {

+ 8 - 8
src/views/dataBoard/smartMarketing/components/moneydata/qfyhmonth.vue

@@ -6,8 +6,8 @@
 </template>
 
 <script>
-import { GetQf3Data } from '@/api/dataBoard/misdata'
 import comMixins from '@/views/dataBoard/mixins/comMixins'
+import { owing3MonthsStat } from '@/views/dataBoard/api/smartMarketing'
 
 export default {
   name: 'qfyhmonth',
@@ -35,11 +35,11 @@ export default {
      */
     GetQf3DataList() {
       const that = this
-      GetQf3Data({}).then((res) => {
+      owing3MonthsStat({}).then((res) => {
         //console.log("GetQf3Data"+JSON.stringify(res))
-        if (res.Code == 200) {
+        if (res.code == 1) {
 
-          const rows = res.Result.rows
+          const rows = res.result
           if (rows.length > 0) {
             let chartData = {
               dataAry: [],
@@ -48,10 +48,10 @@ export default {
               seriesAry2: [],
             }
             rows.forEach(item => {
-              chartData.dataAry.push(item.JDCWRQ)
-              chartData.seriesAry1.push(Number(item.QF3COUNT))
-              chartData.sumMoney += item.QF3ZJE
-              chartData.seriesAry2.push(that.accDiv(item.QF3ZJE, 10000).toFixed(2))
+              chartData.dataAry.push(item.cwrq)
+              chartData.seriesAry1.push(Number(item.qf3count))
+              chartData.sumMoney += item.qf3zje
+              chartData.seriesAry2.push(that.accDiv(item.qf3zje, 10000).toFixed(2))
             });
 
             chartData.sumMoney = that.accDiv(chartData.sumMoney, 10000).toFixed(2)

+ 6 - 6
src/views/dataBoard/smartMarketing/components/moneydata/sffschart.vue

@@ -6,7 +6,7 @@
 </template>
 
 <script>
-import { GetPlacePay } from '@/api/dataBoard/misdata'
+import { payWayStat } from '@/views/dataBoard/api/smartMarketing'
 import comMixins from '@/views/dataBoard/mixins/comMixins'
 
 export default {
@@ -32,18 +32,18 @@ export default {
      */
     GetPlacePayList() {
       const that = this
-      GetPlacePay({}).then((res) => {
+      payWayStat({}).then((res) => {
         //console.log("GetPlacePay:"+JSON.stringify(res))
-        if (res.Code == 200) {
+        if (res.code == 1) {
           let chartData = {
             xAxisAry1: [],
             seriesAry1: [],
             maxChartData: []
           }
 
-          res.Result.rows.forEach(item => {
-            chartData.xAxisAry1.push(item.QD)
-            chartData.seriesAry1.push(that.accDiv(item.JE, 10000).toFixed(2))
+          res.result.forEach(item => {
+            chartData.xAxisAry1.push(item.qd)
+            chartData.seriesAry1.push(that.accDiv(item.je, 10000).toFixed(2))
           });
 
           // chartData.seriesAry1.push(that.accDiv(res.Result.GT,10000).toFixed(2))

+ 0 - 132
src/views/dataBoard/smartMarketing/components/moneydata/sfqfdata 20221110.vue

@@ -1,132 +0,0 @@
-<template>
-  <div class="sfqfdata"  v-loading="loading" element-loading-background="rgba(0, 0, 0, 0)">
-    <div class="smallTitle">上月收费、欠费统计</div>
-    <div class="userchart" ref="chart"></div>
-  </div>
-</template>
-
-<script>
-import { GetLastSfQf } from '@/api/dataBoard/misdata'
-import comMixins from '@/views/dataBoard/mixins/comMixins'
-
-export default {
-  name: 'sfqfdata',
-  props:{
-
-  },
-  mixins: [comMixins],
-  data() {
-    return {
-      loading:true,
-    }
-  },
-  components: {
-  },
-  created(){
-    this.GetLastSfQfList()
-  },
-  mounted() {
-   
-  },
-  methods: {
-    /**
-     * @description 上月各个用水性质的收费金额
-     */
-    GetLastSfQfList(){
-      const that = this
-      GetLastSfQf({}).then((res) => {
-        //console.log("GetLastSfQf"+JSON.stringify(res))
-        if(res.Code == 200){
-          let seriesData = [
-            { value: 0, name: '欠费' },
-            { value: 0, name: '收费' },
-          ]
-          if(res.Result.total>0){
-            seriesData[0].value = that.accDiv(res.Result.rows[0].QFJE,10000).toFixed(2) 
-            seriesData[1].value = that.accDiv(res.Result.rows[0].SFJE,10000).toFixed(2) 
-          }
-          that.drawChart(seriesData)
-          that.loading = false
-        }else{
-          //console.log("GetLastSfQf:"+res.Message)
-          that.loading = false
-        }
-      }).catch((err) => {
-        //console.log("GetLastSfQf:"+err)
-        that.loading = false
-      });
-    },
-
-    /**
-     * @description 绘制图形
-     */
-    drawChart(seriesData) {
-      const that = this;
-      const chartReady = that.$echarts.init(that.$refs.chart)
-      const options = {
-        tooltip: {
-          trigger: 'item'
-        },
-        series: [
-          {
-            name: '收费、欠费统计',
-            type: 'pie',
-            // radius: '50%',
-            radius: ['40%', '64%'],
-            center: ['50%', '55%'],
-            color: ['#2BAEFD', '#BEB56A', '#02A9C2', '#1D5D8D', '#6f81da', '#00ffb4'],
-            label: {
-              formatter: '{c|{c}万元}\n{b|{b}}  ',
-              rich: {
-                b: {
-                  color: '#A4D9F9',
-                  fontSize: 14,
-                  fontWeight: 'bold',
-                  lineHeight: 33
-                },
-                c: {
-                  color: '#fff',
-                  fontSize: 16,
-                  fontFamily: "myFont"
-                }
-              }
-            },
-            data: seriesData,
-            emphasis: {
-              itemStyle: {
-                shadowBlur: 10,
-                shadowOffsetX: 0,
-                shadowColor: 'rgba(0, 0, 0, 0.5)'
-              }
-            }
-          }
-        ]
-      }
-      chartReady.setOption(options)
-
-      //自定义缩放
-      window.addEventListener("resize", () => {
-        if(chartReady){
-          chartReady.resize()
-        }
-      })
-    },
-  }
-}
-</script>
-
-<style lang='scss'>
-  .sfqfdata{
-    width: calc(100% - 16px);
-    height: calc(100% - 16px);
-    position: relative;
-    padding: 8px;
-    // border: 1px yellow solid;
-
-    .userchart{
-      width: 100%;
-      height: 100%;
-      // border: 1px red solid;
-    }
-  }
-</style>>

+ 56 - 158
src/views/dataBoard/smartMarketing/components/moneydata/sfqfdata.vue

@@ -1,58 +1,58 @@
 <template>
-  <div class="sfqfdata" v-loading="loading" element-loading-background="rgba(0, 0, 0, 0)">
+  <div class="sfqfdata"  v-loading="loading" element-loading-background="rgba(0, 0, 0, 0)">
     <div class="smallTitle">上月收费、欠费统计</div>
     <div class="userchart" ref="chart"></div>
   </div>
 </template>
 
 <script>
-import { GetLastSfQf } from '@/api/dataBoard/misdata'
+import { owingStat } from '@/views/dataBoard/api/smartMarketing'
 import comMixins from '@/views/dataBoard/mixins/comMixins'
 
 export default {
   name: 'sfqfdata',
-  props: {
+  props:{
 
   },
   mixins: [comMixins],
   data() {
     return {
-      loading: true,
+      loading:true,
     }
   },
   components: {
   },
-  created() {
+  created(){
     this.GetLastSfQfList()
   },
   mounted() {
-
+   
   },
   methods: {
     /**
      * @description 上月各个用水性质的收费金额
      */
-    GetLastSfQfList() {
+    GetLastSfQfList(){
       const that = this
-      GetLastSfQf({}).then((res) => {
-        //console.log("GetLastSfQf" + JSON.stringify(res))
-        if (res.Code == 200) {
+      owingStat({}).then((res) => {
+        //console.log("GetLastSfQf"+JSON.stringify(res))
+        if(res.code == 1){
           let seriesData = [
             { value: 0, name: '欠费' },
             { value: 0, name: '收费' },
           ]
-          if (res.Result.total > 0) {
-            seriesData[0].value = that.accDiv(res.Result.rows[0].QFJE, 10000).toFixed(2)
-            seriesData[1].value = that.accDiv(res.Result.rows[0].SFJE, 10000).toFixed(2)
+          if(res.result){
+            seriesData[0].value = that.accDiv(res.result.qfje,10000).toFixed(2) 
+            seriesData[1].value = that.accDiv(res.result.sfje,10000).toFixed(2) 
           }
           that.drawChart(seriesData)
           that.loading = false
-        } else {
-          //console.log("GetLastSfQf:" + res.Message)
+        }else{
+          //console.log("GetLastSfQf:"+res.Message)
           that.loading = false
         }
       }).catch((err) => {
-        //console.log("GetLastSfQf:" + err)
+        //console.log("GetLastSfQf:"+err)
         that.loading = false
       });
     },
@@ -63,152 +63,50 @@ export default {
     drawChart(seriesData) {
       const that = this;
       const chartReady = that.$echarts.init(that.$refs.chart)
-      let zb = that.accMul(that.accDiv(seriesData[1].value, that.accAdd(seriesData[0].value, seriesData[1].value)), 100).toFixed(0)
-
       const options = {
-        title: {
-          text: zb + "%",
-          subtext: '收费占比',
-          x: 'center',
-          y: 'center',
-          textStyle: {
-            color: "#fff",
-            fontSize: 24,
-            fontWeight: 'bold'
-          },
-          subtextStyle: {
-            color: "#fff",
-            fontSize: 14,
-            fontWeight: 'normal'
-          }
-        },
         tooltip: {
-          trigger: 'item',
-          formatter: "{a} <br/>{b} : {c} ({d}%)"
+          trigger: 'item'
         },
-        series:
-          [
-            {
-              name: '收费、欠费',
-              type: 'pie',
-              radius: ['40%', '55%'],
-              center: ['50%', '50%'],
-              data: [{
-                value: seriesData[0].value,
-                name: seriesData[0].name,
-                itemStyle: {
-                  color: new that.$echarts.graphic.LinearGradient(0, 1, 0, 0, [{
-                    offset: 0,
-                    color: '#f6e3a1'
-                  }, {
-                    offset: 1,
-                    color: '#ff4236'
-                  }])
-                },
-                label: {
-                  color: "#fff",
+        series: [
+          {
+            name: '收费、欠费统计',
+            type: 'pie',
+            // radius: '50%',
+            radius: ['40%', '64%'],
+            center: ['50%', '55%'],
+            color: ['#2BAEFD', '#BEB56A', '#02A9C2', '#1D5D8D', '#6f81da', '#00ffb4'],
+            label: {
+              formatter: '{c|{c}万元}\n{b|{b}}  ',
+              rich: {
+                b: {
+                  color: '#A4D9F9',
                   fontSize: 14,
-                  formatter: '欠费\n{a|' + seriesData[0].value + '}万元',
-                  rich: {
-                    a: {
-                      color: "#fff",
-                      fontSize: 16,
-                      lineHeight: 30
-                    },
-                  }
-                }
-              },
-              {
-                value: seriesData[1].value,
-                name: seriesData[1].name,
-                itemStyle: {
-                  color: "transparent"
+                  fontWeight: 'bold',
+                  lineHeight: 33
                 },
-                label: {
-                  show: false
+                c: {
+                  color: '#fff',
+                  fontSize: 16,
+                  fontFamily: "myFont"
                 }
               }
-              ]
             },
-            {
-              name: '收费、欠费',
-              type: 'pie',
-              radius: ['45%', '50%'],
-              center: ['50%', '50%'],
-              data: [{
-                value: seriesData[0].value,
-                name: seriesData[0].name,
-                itemStyle: {
-                  color: "transparent"
-                }
-              },
-              {
-                value: seriesData[1].value,
-                name: seriesData[1].name,
-                itemStyle: {
-                  color: new that.$echarts.graphic.LinearGradient(0, 1, 0, 0, [{
-                    offset: 0,
-                    color: '#348fe6'
-                  }, {
-                    offset: 1,
-                    color: '#625bef'
-                  }])
-                },
-                label: {
-                  show: true,
-                  color: "#fff",
-                  fontSize: 14,
-                  formatter: '收费\n{a|' + seriesData[1].value + '}万元',
-                  rich: {
-                    a: {
-                      color: "#fff",
-                      fontSize: 16,
-                      lineHeight: 30
-                    },
-                  }
-                }
+            data: seriesData,
+            emphasis: {
+              itemStyle: {
+                shadowBlur: 10,
+                shadowOffsetX: 0,
+                shadowColor: 'rgba(0, 0, 0, 0.5)'
               }
-              ]
             }
-            // {
-            //   name: '收费、欠费统计',
-            //   type: 'pie',
-            //   // radius: '50%',
-            //   radius: ['40%', '64%'],
-            //   center: ['50%', '55%'],
-            //   color: ['#2BAEFD', '#BEB56A', '#02A9C2', '#1D5D8D', '#6f81da', '#00ffb4'],
-            //   label: {
-            //     formatter: '{c|{c}万元}\n{b|{b}}  ',
-            //     rich: {
-            //       b: {
-            //         color: '#A4D9F9',
-            //         fontSize: 14,
-            //         fontWeight: 'bold',
-            //         lineHeight: 33
-            //       },
-            //       c: {
-            //         color: '#fff',
-            //         fontSize: 16,
-            //         fontFamily: "myFont"
-            //       }
-            //     }
-            //   },
-            //   data: seriesData,
-            //   emphasis: {
-            //     itemStyle: {
-            //       shadowBlur: 10,
-            //       shadowOffsetX: 0,
-            //       shadowColor: 'rgba(0, 0, 0, 0.5)'
-            //     }
-            //   }
-            // }
-          ]
+          }
+        ]
       }
       chartReady.setOption(options)
 
       //自定义缩放
       window.addEventListener("resize", () => {
-        if (chartReady) {
+        if(chartReady){
           chartReady.resize()
         }
       })
@@ -218,17 +116,17 @@ export default {
 </script>
 
 <style lang='scss'>
-.sfqfdata {
-  width: calc(100% - 16px);
-  height: 100%;
-  position: relative;
-  padding: 0 8px;
-  // border: 1px yellow solid;
+  .sfqfdata{
+    width: calc(100% - 16px);
+    height: calc(100% - 16px);
+    position: relative;
+    padding: 8px;
+    // border: 1px yellow solid;
 
-  .userchart {
-    width: 100%;
-    height: 100%;
-    // border: 1px red solid;
+    .userchart{
+      width: 100%;
+      height: 100%;
+      // border: 1px red solid;
+    }
   }
-}
 </style>>

+ 19 - 8
src/views/dataBoard/smartMarketing/components/userdata/userdatanum.vue

@@ -14,7 +14,7 @@
 
 <script>
 import CountUp from 'countup.js'
-import { GetUseWater } from '@/api/dataBoard/misdata'
+import { userStat } from '@/views/dataBoard/api/smartMarketing'
 
 export default {
   name: 'userdatanum',
@@ -45,14 +45,25 @@ export default {
      */
     GetUseWaterList() {
       const that = this
-      GetUseWater({}).then((res) => {
-        if (res.Code == 200) {
-          const rows = res.Result.rows
+      userStat({}).then((res) => {
+        if (res.code == 1) {
+          const rows = res.result
+          console.log('用户统计')
           if (rows.length > 0) {
-            const row = rows[0]
-            that.UserList[0].num = row["LASTYEARNUM"] + ""
-            that.UserList[1].num = row["THISYEARNUM"] + ""
-            that.UserList[2].num = row["USERNUM"] + ""
+            // 正则匹配2023开头的字符串
+            const reg2023 = /^2023/
+            const reg2022 = /^2022/
+            // 从rows数组中过滤出row.cwrq值为以2023开头的字符串的元素并求和这些元素的addnum值
+            const sum2023 = rows.filter(item => reg2023.test(item.cwrq)).reduce((prev, cur) => {
+              return prev + cur.addnum
+            }, 0)
+            const sum2022 = rows.filter(item => reg2022.test(item.cwrq)).reduce((prev, cur) => {
+              return prev + cur.addnum
+            }, 0)
+            let row = rows[0]
+            that.UserList[0].num = sum2022 + ''
+            that.UserList[1].num = sum2023 + ''
+            that.UserList[2].num = row.num + ''
 
             let animal = null
             that.UserList.forEach((item, index) => {

+ 1 - 1
src/views/dataBoard/smartMarketing/components/waterdata/typedata.vue

@@ -29,7 +29,7 @@ export default {
   },
   methods: {
     /**
-     * @description 大用户用水量统计
+     * @description 上月用水性质统计
      */
 
     GetUserYsxzList() {

+ 6 - 13
src/views/dataBoard/smartMarketing/index.vue

@@ -70,12 +70,11 @@
               <hkl-chart />
             </div>
             <div class="content_sftj">
-              <div class="chart_sfje">
+              <!-- <div class="chart_sfje">
                 <sfje-chart />
-              </div>
+              </div> -->
               <div class="chart_sffs">
                 <sffs-chart />
-
               </div>
             </div>
           </div>
@@ -308,32 +307,26 @@ export default {
 
           .chart_cbl {
             width: 100%;
-            height: 25%;
+            height: 33%;
             // border: 1px red solid;
           }
 
           .chart_hkl {
             width: 100%;
-            height: 25%;
+            height: 33%;
             // border: 1px red solid;
           }
 
           .content_sftj {
             width: 100%;
-            height: 50%;
+            height: 33%;
             display: flex;
             flex-direction: column;
             justify-content: space-between;
             // border: 1px red solid;
-
-            .chart_sfje {
-              width: 100%;
-              height: 50%;
-              // border: 1px red solid;
-            }
             .chart_sffs {
               width: 100%;
-              height: 50%;
+              height: 100%;
               // border: 1px red solid;
             }
           }