Browse Source

修复合同计价

Shannon_mu 2 years ago
parent
commit
8d903b83d2

+ 9 - 3
operationSupport/src/views/businessManagement/contractManagement/stepPage/stepTwo.vue

@@ -130,12 +130,18 @@ export default {
             }
             this.$parent.tegyArr.map((item) => {
                 if (item.id == id) {
-                    item.monthlyRent = this.$parent.tableArr[index].buildingArea * item.chargePrice;
+                    console.log(item);
+                    if (item.chargeMode == 2) {
+                        item.monthlyRent = (this.$parent.tableArr[index].buildingArea * item.chargePrice).toFixed(2);
+                        this.$parent.idsObj[index].monthlyRent = (this.$parent.tableArr[index].buildingArea * item.chargePrice).toFixed(2);
+                    } else {
+                        item.monthlyRent = item.chargePrice;
+                        this.$parent.idsObj[index].monthlyRent = item.chargePrice;
+                    }
+
                     this.$parent.idsObj[index].thisArr = [item];
                     this.$parent.idsObj[index].chargePrice = item.chargePrice;
                     this.$parent.idsObj[index].cycle = item.chargeCycle;
-                    this.$parent.idsObj[index].monthlyRent =
-                        this.$parent.tableArr[index].buildingArea * (this.$parent.tableArr[index].chargeMode == 2 ? item.chargePrice : 1);
                     this.$parent.idsObj[index].increasingPercentage = item.increasingPercentage;
                     this.$parent.idsObj[index].increasingYear = item.increasingYear;
                 }

+ 7 - 1
operationSupport/src/views/newWorkBench/components/houseClick.vue

@@ -54,7 +54,7 @@ export default {
         filterMoney(val) {
             let num = Number(val);
             if (num == 0) {
-                return val;
+                return val + '元';
             } else if (num > 1 && num < 10000) {
                 return val + '元';
             } else if (num > 10000 && num < 100000000) {
@@ -157,6 +157,12 @@ export default {
             .listInformation_text {
                 line-height: rem(23);
                 opacity: 0.5;
+                 > div:first-child {
+                    width: rem(300);
+                    overflow: hidden;
+                    white-space: nowrap;
+                    text-overflow: ellipsis;
+                }
             }
             .listInformation_operation {
                 display: flex;

+ 2 - 2
operationSupport/src/views/newWorkBench/components/indexOptionChart.js

@@ -62,9 +62,9 @@ export const ringType = (color = [], data = [], title = {}, legendFcuntion = {})
         data.map((item) => {
             if (item.name == v) {
                 if (legendFcuntion.type == '%') {
-                    val = `{a|${v}} · · · · · · {b|${parseInt((item.value / legendFcuntion.total).toFixed(2) * 100) || 0}%}`;
+                    val = `{a|${v}}{b|${parseInt((item.value / legendFcuntion.total).toFixed(2) * 100) || 0}%}`;
                 } else {
-                    val = `{a|${v}} · · · · · · {b|${item.value}}`;
+                    val = `{a|${v}}{b|${item.value}}`;
                 }
             }
         });

+ 30 - 9
operationSupport/src/views/newWorkBench/components/map.vue

@@ -24,7 +24,8 @@ export default {
             loadding: true,
             mixins_query: {
                 communityId: ''
-            }
+            },
+            centet: []
         };
     },
     mounted() {},
@@ -44,17 +45,21 @@ export default {
         }
     },
     watch: {
-        //全局社区接口调用
-        'mixins_query.communityId'(val) {
-            this.map.clearMap();
+        homeCommunityAll(val) {
+            if (!!val) {
+                this.mixins_query.communityId = val;
+                this.map.clearMap();
+            }
             this.mapMak();
         }
     },
+
     methods: {
         init() {
             this.map = new AMap.Map('mapInit', {
                 resizeEnable: true, //是否监控地图容器尺寸变化
-                zoom: 8, //初始化地图层级
+                center: this.centet,
+                zoom: 16, //初始化地图层级
                 mapStyle: 'amap://styles/darkblue',
                 defaultCursor: 'pointer'
             });
@@ -91,6 +96,9 @@ export default {
                 offset: new AMap.Pixel(-15, 50),
                 content: `${item.communityName}`
             });
+            if (this.poisArrays.length < 2) {
+                this.map.setFitView();
+            }
         },
         //搜索区域
         districtMask(val) {
@@ -142,6 +150,15 @@ export default {
                     this.poisArray = data;
                 }
             });
+        },
+        getLoc(resolve) {
+            this.$http.get('/sc-user-center/user/findUserArea').then(({ data, status, msg }) => {
+                if (status == 0) {
+                    this.centet[0] = data.lng;
+                    this.centet[1] = data.lat;
+                    resolve && resolve(true);
+                }
+            });
         }
     },
     destroyed() {
@@ -150,11 +167,15 @@ export default {
     created() {
         this.getPoin();
         new Promise((resolve) => {
-            if (!!AMap) {
-                resolve(true);
-            }
+            this.getLoc(resolve);
         }).then(() => {
-            this.init();
+            new Promise((resolve) => {
+                if (!!AMap) {
+                    resolve(true);
+                }
+            }).then(() => {
+                this.init();
+            });
         });
     }
 };

+ 159 - 172
operationSupport/src/views/newWorkBench/components/workbenchMent/proportionIncomeMode.vue

@@ -1,190 +1,174 @@
 <template>
-  <div class="modelBlock">
-    <template v-if="permissionFiltering">
-      <div class="model-title">
-        <div class="model-title-text">收入方式占比</div>
-        <div class="model-title-right">
-          <el-date-picker
-            value-format="yyyy-MM"
-            v-model="date"
-            type="month"
-            placeholder="选择月"
-            class="saveColumn-select"
-            @change="changeTime"
-            :clearable="false"
-          >
-          </el-date-picker>
-          <el-select
-            v-model="mixins_query.chargeType"
-            placeholder="所有费用"
-            clearable
-            class="saveColumn-select"
-            @change="getData"
-          >
-            <el-option
-              v-for="(item, index) in amountType"
-              :label="item.name"
-              :value="item.value"
-              :key="index"
-            ></el-option>
-          </el-select>
-        </div>
-      </div>
-      <div class="model-content">
-        <zz-echart
-          :option="clientOptions"
-          class="chart"
-        ></zz-echart>
-        <div class="totals">
-          <span
-            style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis"
-            :title="unitConvert(total).num + unitConvert(total).unit"
-          >{{ unitConvert(total).num }}{{ unitConvert(total).unit }}</span>
-          <span
-            class="numbers"
-            style="white-space: nowrap"
-          >总收入</span>
-        </div>
-      </div>
-    </template>
-    <no-permission
-      v-else
-      tipsText="收入方式占比"
-    ></no-permission>
-  </div>
+    <div class="modelBlock">
+        <template v-if="permissionFiltering">
+            <div class="model-title">
+                <div class="model-title-text">收入方式占比</div>
+                <div class="model-title-right">
+                    <el-date-picker
+                        value-format="yyyy-MM"
+                        v-model="date"
+                        type="month"
+                        placeholder="选择月"
+                        class="saveColumn-select"
+                        @change="changeTime"
+                        :clearable="false"
+                    >
+                    </el-date-picker>
+                    <el-select
+                        v-model="mixins_query.chargeType"
+                        placeholder="所有费用"
+                        clearable
+                        class="saveColumn-select"
+                        @change="getData"
+                    >
+                        <el-option v-for="(item, index) in amountType" :label="item.name" :value="item.value" :key="index"></el-option>
+                    </el-select>
+                </div>
+            </div>
+            <div class="model-content">
+                <zz-echart :option="clientOptions" class="chart"></zz-echart>
+                <div class="totals">
+                    <span style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis">{{ total }}</span>
+                    <span class="numbers" style="white-space: nowrap">总收入</span>
+                </div>
+            </div>
+        </template>
+        <no-permission v-else tipsText="收入方式占比"></no-permission>
+    </div>
 </template>
 <script>
 import { GradualChange, ringType } from '../indexOptionChart';
 import permissionComponent from '../permissionComponent';
 const colors = [
-  GradualChange('#22D8FF', '#00B2FF'),
-  GradualChange('#F0646C', '#F4994E'),
-  GradualChange('#5EEDCC ', '#24C3F1'),
-  GradualChange('#7178FF', '#D2A4FF'),
-  GradualChange('#884DD2', '#DF63CC')
+    GradualChange('#22D8FF', '#00B2FF'),
+    GradualChange('#F0646C', '#F4994E'),
+    GradualChange('#5EEDCC ', '#24C3F1'),
+    GradualChange('#7178FF', '#D2A4FF'),
+    GradualChange('#884DD2', '#DF63CC')
 ];
 export default {
-  mixins: [permissionComponent],
-  data () {
-    return {
-      defaultModel: {
-        permissUrl: '14',
-        titleName: '收费管理'
-      },
-      mixins_query: {
-        communityId: '',
-        date: '',
-        chargeType: ''
-      },
-      date: '',
-      total: 0,
-      clientOptions: ringType(
-        colors,
-        [
-          { value: 0, name: '微信' },
-          { value: 0, name: '支付宝' },
-          { value: 0, name: '现金' },
-          { value: 0, name: '预存' },
-          { value: 0, name: '其他' }
-        ],
-        {},
-        { type: 'number', total: 0 }
-      ),
-      amountType: [
-        {
-          value: 1,
-          name: '物业费'
-        },
-        {
-          value: 2,
-          name: '水费'
+    mixins: [permissionComponent],
+    data() {
+        return {
+            defaultModel: {
+                permissUrl: '14',
+                titleName: '收费管理'
+            },
+            mixins_query: {
+                communityId: '',
+                date: '',
+                chargeType: ''
+            },
+            date: '',
+            total: 0,
+            clientOptions: ringType(
+                colors,
+                [
+                    { value: 0, name: '微信' },
+                    { value: 0, name: '支付宝' },
+                    { value: 0, name: '现金' },
+                    { value: 0, name: '预存' },
+                    { value: 0, name: '其他' }
+                ],
+                {},
+                { type: 'number', total: 0 }
+            ),
+            amountType: [
+                {
+                    value: 1,
+                    name: '物业费'
+                },
+                {
+                    value: 2,
+                    name: '水费'
+                },
+                {
+                    value: 3,
+                    name: '电费'
+                },
+                {
+                    value: 4,
+                    name: '车位费'
+                },
+                {
+                    value: 6,
+                    name: '卫生费'
+                },
+                {
+                    value: 7,
+                    name: '其他费用'
+                }
+            ]
+        };
+    },
+    methods: {
+        getData() {
+            this.$http.get('/sc-community/statisticIncomeMethod', this.mixins_query).then(({ data, msg, status }) => {
+                if (status == 0 && !!data.datas) {
+                    this.clientOptions = ringType(colors, this.eachartObj(data), {}, { type: 'number', total: this.total });
+                }
+            });
         },
-        {
-          value: 3,
-          name: '电费'
+        changeTime(v) {
+            this.mixins_query.date = v + '-01';
+            this.getData();
         },
-        {
-          value: 4,
-          name: '车位费'
+        unitConvert(num) {
+            var moneyUnits = ['元', '万元', '亿元', '万亿'];
+            var dividend = 10000;
+            var curentNum = num;
+            //转换数字
+            var curentUnit = moneyUnits[0];
+            //转换单位
+            for (var i = 0; i < 4; i++) {
+                curentUnit = moneyUnits[i];
+                if (this.strNumSize(curentNum) < 5) {
+                    break;
+                }
+                curentNum = curentNum / dividend;
+            }
+            var m = { num: '', unit: '' };
+            m.num = curentNum.toFixed(2);
+            m.unit = curentUnit;
+            return m;
         },
-        {
-          value: 6,
-          name: '卫生费'
+        strNumSize(tempNum) {
+            var stringNum = tempNum.toString();
+            var index = stringNum.indexOf('.');
+            var newNum = stringNum;
+            if (index != -1) {
+                newNum = stringNum.substring(0, index);
+            }
+            return newNum.length;
         },
-        {
-          value: 7,
-          name: '其他费用'
-        }
-      ]
-    };
-  },
-  methods: {
-    getData () {
-      this.$http.get('/sc-community/statisticIncomeMethod', this.mixins_query).then(({ data, msg, status }) => {
-        if (status == 0 && !!data.datas) {
-          this.clientOptions = ringType(colors, this.eachartObj(data), {}, { type: 'number', total: this.total });
-        }
-      });
-    },
-    changeTime (v) {
-      this.mixins_query.date = v + '-01';
-      this.getData();
-    },
-    unitConvert (num) {
-      var moneyUnits = ['元', '万元', '亿元', '万亿'];
-      var dividend = 10000;
-      var curentNum = num;
-      //转换数字
-      var curentUnit = moneyUnits[0];
-      //转换单位
-      for (var i = 0; i < 4; i++) {
-        curentUnit = moneyUnits[i];
-        if (this.strNumSize(curentNum) < 5) {
-          break;
+        eachartObj(data) {
+            this.total = data.total || 0;
+            let typeName = {
+                1: '微信在线',
+                2: '支付宝',
+                3: '现金',
+                4: '预存',
+                5: '其他',
+                6: '刷卡',
+                7: '微信扫码'
+            };
+            let newData = [];
+            for (let a in data.datas) {
+                newData.push({
+                    value: data.datas[a],
+                    name: typeName[a]
+                });
+                this.total = this.total + data.datas[a];
+            }
+            debugger;
+            return newData;
         }
-        curentNum = curentNum / dividend;
-      }
-      var m = { num: '', unit: '' };
-      m.num = curentNum.toFixed(2);
-      m.unit = curentUnit;
-      return m;
     },
-    strNumSize (tempNum) {
-      var stringNum = tempNum.toString();
-      var index = stringNum.indexOf('.');
-      var newNum = stringNum;
-      if (index != -1) {
-        newNum = stringNum.substring(0, index);
-      }
-      return newNum.length;
-    },
-    eachartObj (data) {
-      this.total = data.total || 0;
-      let typeName = {
-        1: '微信在线',
-        2: '支付宝',
-        3: '现金',
-        4: '预存',
-        5: '其他',
-        6: '刷卡',
-        7: '微信扫码'
-      };
-      let newData = [];
-      for (let a in data.datas) {
-        newData.push({
-          value: this.unitConvert(data.datas[a]).num,
-          name: typeName[a]
-        });
-        this.total = this.total + data.datas[a];
-      }
-      return newData;
+    created() {
+        this.mixins_query.date = this.$moment().format('YYYY-MM') + '-01';
+        this.date = this.$moment().format('YYYY-MM');
+        this.getData();
     }
-  },
-  created () {
-    this.mixins_query.date = this.$moment().format('YYYY-MM') + '-01';
-    this.date = this.$moment().format('YYYY-MM');
-    this.getData();
-  }
 };
 </script>
 <style lang="scss" scoped>
@@ -198,4 +182,7 @@ export default {
         }
     }
 }
+.modelBlock .model-content .totals{
+  min-width: rem(120);
+}
 </style>

+ 5 - 7
operationSupport/src/views/newWorkBench/index.vue

@@ -7,13 +7,7 @@
         element-loading-background="rgba(0, 0, 0, 1)"
     >
         <div class="communityAll">
-            <el-select
-                v-model="communityId"
-                placeholder="所有社区"
-                clearable
-                class="saveColumn-select"
-                @change="$store.commit('setHomeCommunityAll', communityId)"
-            >
+            <el-select v-model="communityId" placeholder="所有社区" clearable class="saveColumn-select" @change="toggleCom">
                 <el-option v-for="(item, index) in communityList" :label="item.communityName" :value="item.id" :key="index"></el-option>
             </el-select>
         </div>
@@ -63,8 +57,12 @@ export default {
                 if (status == 0) {
                     this.communityList = data;
                     this.$store.commit('setAreaSelect', data);
+                    this.$store.commit('setHomeCommunityAll', '');
                 }
             });
+        },
+        toggleCom(va) {
+            this.$store.commit('setHomeCommunityAll', va);
         }
     },
     watch: {