Browse Source

修改保留3位小数

zhangdan 4 years ago
parent
commit
9168c01159

+ 2 - 2
src/views/cleanManage/cleanDetail.vue

@@ -143,7 +143,7 @@ export default {
               const _item = res.data.list[i]
               _item.no = no + i + 1
               if (_item.cleanWeight != null || 0) {
-                _item.cleanWeight = (_item.cleanWeight / 1000).toFixed(2)
+                _item.cleanWeight = (_item.cleanWeight / 1000).toFixed(3)
               }
             }
             this.totalNum = res.data.count
@@ -206,7 +206,7 @@ export default {
       getCleanDetailsTotal(params).then(res => {
         if (res.status == 200) {
           if (res.data != 0 || null) {
-            this.cleanWeightTotal = (res.data.cleanWeight / 1000).toFixed(2)
+            this.cleanWeightTotal = (res.data.cleanWeight / 1000).toFixed(3)
           }
         } else {
           this.cleanWeightTotal = 0

+ 2 - 2
src/views/cleanManage/cleanDetailModal.vue

@@ -1,7 +1,7 @@
 <template>
   <a-modal title="清运详情" :footer="null" v-model="isShow" @cancel="cancel" centered>
     <a-spin :spinning="loading">
-      <div class="detail-item" v-for="item in itemData" :key="item.index"><span>{{ item.rubbishType }}:</span>{{ (item.cleanWeight/1000).toFixed(2) }} kg</div>
+      <div class="detail-item" v-for="item in itemData" :key="item.index"><span>{{ item.rubbishTypeDictValue }}:</span>{{ (item.cleanWeight/1000).toFixed(3) }} kg</div>
       <a-empty v-if="itemData.length == 0" style="text-align: center;" />
     </a-spin>
   </a-modal>
@@ -41,6 +41,7 @@ export default {
       getCleanDetails({ deviceNo: this.deviceNo, cleanDate: this.cleanTime }).then(res => {
         if (res.status == 200) {
           this.itemData = res.data || []
+          console.log(this.itemData)
         }
         this.loading = false
       })
@@ -53,7 +54,6 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
-        this.itemData = []
       } else {
         this.getDetailInfo()
       }

+ 1 - 1
src/views/cleanManage/netWorkCleanModal.vue

@@ -68,7 +68,7 @@ export default {
               const _item = res.data.list[i]
               _item.no = no + i + 1
               if (_item.cleanWeight != null || 0) {
-                _item.cleanWeight = (_item.cleanWeight / 1000).toFixed(2)
+                _item.cleanWeight = (_item.cleanWeight / 1000).toFixed(3)
               }
             }
             return res.data

+ 2 - 2
src/views/cleanManage/netWorkCleanRecord.vue

@@ -123,7 +123,7 @@ export default {
               const _item = res.data.list[i]
               _item.no = no + i + 1
               if (_item.cleanWeight != null || 0) {
-                _item.cleanWeight = (_item.cleanWeight / 1000).toFixed(2)
+                _item.cleanWeight = (_item.cleanWeight / 1000).toFixed(3)
               }
             }
             this.totalNum = res.data.count
@@ -177,7 +177,7 @@ export default {
       getCleanStationTotal(params).then(res => {
         if (res.status == 200) {
           if (res.data != 0 || null) {
-            this.cleanWeightTotal = (res.data.cleanWeight / 1000).toFixed(2)
+            this.cleanWeightTotal = (res.data.cleanWeight / 1000).toFixed(3)
           }
         } else {
           this.cleanWeightTotal = 0

+ 16 - 16
src/views/cleanManage/notCleanNetwork.vue

@@ -105,35 +105,35 @@
       </template>
       <!-- 废旧衣物 -->
       <template slot="clothes" slot-scope="text,record">
-        <span :style="{ color: record.maxVal==record.clothes ? 'red' : '' }">{{ record.clothes ? (record.clothes/1000).toFixed(2) : '0.00' }}</span>
+        <span :style="{ color: record.maxVal==record.clothes ? 'red' : '' }">{{ record.clothes ? (record.clothes/1000).toFixed(3) : '0.00' }}</span>
       </template>
       <!-- 废旧纸张 -->
       <template slot="paper" slot-scope="text,record">
-        <span :style="{ color: record.maxVal==record.paper ? 'red' : '' }">{{ record.paper ? (record.paper/1000).toFixed(2) : '0.00' }}</span>
+        <span :style="{ color: record.maxVal==record.paper ? 'red' : '' }">{{ record.paper ? (record.paper/1000).toFixed(3) : '0.00' }}</span>
       </template>
       <!-- 废旧塑料 -->
       <template slot="plastic" slot-scope="text,record">
-        <span :style="{ color: record.maxVal==record.plastic ? 'red' : '' }">{{ record.plastic ? (record.plastic/1000).toFixed(2) : '0.00' }}</span>
+        <span :style="{ color: record.maxVal==record.plastic ? 'red' : '' }">{{ record.plastic ? (record.plastic/1000).toFixed(3) : '0.000' }}</span>
       </template>
       <!-- 废旧金属 -->
       <template slot="metal" slot-scope="text,record">
-        <span :style="{ color: record.maxVal==record.metal ? 'red' : '' }">{{ record.metal ? (record.metal/1000).toFixed(2) : '0.00' }}</span>
+        <span :style="{ color: record.maxVal==record.metal ? 'red' : '' }">{{ record.metal ? (record.metal/1000).toFixed(3) : '0.000' }}</span>
       </template>
       <!-- 废旧金属/塑料 -->
       <template slot="plaMet" slot-scope="text,record">
-        <span :style="{ color: record.maxVal==record.plaMet ? 'red' : '' }">{{ record.plaMet ? (record.plaMet/1000).toFixed(2) : '0.00' }}</span>
+        <span :style="{ color: record.maxVal==record.plaMet ? 'red' : '' }">{{ record.plaMet ? (record.plaMet/1000).toFixed(3) : '0.000' }}</span>
       </template>
       <!-- 废旧玻璃 -->
       <template slot="glass" slot-scope="text,record">
-        <span :style="{ color: record.maxVal==record.glass ? 'red' : '' }">{{ record.glass ? (record.glass/1000).toFixed(2) : '0.00' }}</span>
+        <span :style="{ color: record.maxVal==record.glass ? 'red' : '' }">{{ record.glass ? (record.glass/1000).toFixed(3) : '0.000' }}</span>
       </template>
       <!-- 可回收物 -->
       <template slot="recycling" slot-scope="text,record">
-        <span :style="{ color: record.maxVal==record.recycling ? 'red' : '' }">{{ record.recycling ? (record.recycling/1000).toFixed(2) : '0.00' }}</span>
+        <span :style="{ color: record.maxVal==record.recycling ? 'red' : '' }">{{ record.recycling ? (record.recycling/1000).toFixed(3) : '0.000' }}</span>
       </template>
       <!-- 可回收物小计 -->
       <template slot="totalWeight" slot-scope="text,record">
-        <span >{{ record.totalWeight ? (record.totalWeight/1000).toFixed(2) : '0.00' }}</span>
+        <span >{{ record.totalWeight ? (record.totalWeight/1000).toFixed(3) : '0.000' }}</span>
       </template>
       <!-- 操作 -->
       <span slot="action" slot-scope="text,record">
@@ -357,14 +357,14 @@ export default {
       getCleanStationSum(params).then(res => {
         if (res.status == 200) {
           if (res.data) {
-            this.recyclableWasteTotal = res.data.totalWeight ? (res.data.totalWeight / 1000).toFixed(2) : '0.00'
-            this.wastePaper = res.data.paper ? (res.data.paper / 1000).toFixed(2) : '0.00'
-            this.wasteClothes = res.data.clothes ? (res.data.clothes / 1000).toFixed(2) : '0.00'
-            this.wasteMetal = res.data.metal ? (res.data.metal / 1000).toFixed(2) : '0.00'
-            this.wastePlastics = res.data.plastic ? (res.data.plastic / 1000).toFixed(2) : '0.00'
-            this.wasteMetalPlastic = res.data.plaMet ? (res.data.plaMet / 1000).toFixed(2) : '0.00'
-            this.wasteGlass = res.data.glass ? (res.data.glass / 1000).toFixed(2) : '0.00'
-            this.recyclable = res.data.recycling ? (res.data.recycling / 1000).toFixed(2) : '0.00'
+            this.recyclableWasteTotal = res.data.totalWeight ? (res.data.totalWeight / 1000).toFixed(3) : '0.000'
+            this.wastePaper = res.data.paper ? (res.data.paper / 1000).toFixed(3) : '0.000'
+            this.wasteClothes = res.data.clothes ? (res.data.clothes / 1000).toFixed(3) : '0.000'
+            this.wasteMetal = res.data.metal ? (res.data.metal / 1000).toFixed(3) : '0.000'
+            this.wastePlastics = res.data.plastic ? (res.data.plastic / 1000).toFixed(3) : '0.000'
+            this.wasteMetalPlastic = res.data.plaMet ? (res.data.plaMet / 1000).toFixed(3) : '0.000'
+            this.wasteGlass = res.data.glass ? (res.data.glass / 1000).toFixed(3) : '0.000'
+            this.recyclable = res.data.recycling ? (res.data.recycling / 1000).toFixed(3) : '0.000'
           } else {
             this.recyclableWasteTotal = 0
             this.wasteClothes = 0

+ 5 - 5
src/views/cleanManage/statisticalReport.vue

@@ -193,7 +193,7 @@ export default {
         list.map(item => {
           temp.push({
             name: item.rubbishTypeDictValue,
-            value: Number(item.cleanWeight / 1000).toFixed(2)
+            value: Number(item.cleanWeight / 1000).toFixed(3)
           })
         })
       }
@@ -207,7 +207,7 @@ export default {
         list.map(item => {
           temp.push({
             name: item.operatorName,
-            value: Number(item.cleanWeight / 1000).toFixed(2)
+            value: Number(item.cleanWeight / 1000).toFixed(3)
           })
         })
       }
@@ -437,12 +437,12 @@ export default {
           const a = res.data.cleanReportData
           const b = res.data.deliveryReportData
           for (const key in a) {
-            const val = Number(a[key] / 1000).toFixed(2)
+            const val = Number(a[key] / 1000).toFixed(3)
             this.clearnChartData[0].data.push(val)
           }
           for (const key in b) {
             this.XdaysData.push(key)
-            const val = Number(b[key] / 1000).toFixed(2)
+            const val = Number(b[key] / 1000).toFixed(3)
             this.clearnChartData[1].data.push(val)
           }
           this.isNoData = false
@@ -482,7 +482,7 @@ export default {
         for (const key in data) {
           const leve2 = data[key]
           const row = leve2[item.code]
-          const val = row ? Number(row.cleanWeight / 1000).toFixed(2) : 0
+          const val = row ? Number(row.cleanWeight / 1000).toFixed(3) : 0
           ret.push(val)
         }
         item.data = ret