zhangdan 4 سال پیش
والد
کامیت
4ff3d2bcd5
1فایلهای تغییر یافته به همراه29 افزوده شده و 8 حذف شده
  1. 29 8
      src/views/cleanManage/notCleanNetwork.vue

+ 29 - 8
src/views/cleanManage/notCleanNetwork.vue

@@ -92,31 +92,31 @@
       </template>
       <!-- 废旧衣物 -->
       <template slot="clothes" slot-scope="text,record">
-        <span :style="{ color: record.maxVal==record.clothes ? 'red' : '' }">{{ record.clothes || 0 }}</span>
+        <span :style="{ color: record.maxVal==record.clothes ? 'red' : '' }">{{ (record.clothes/1000).toFixed(2) || 0 }}</span>
       </template>
       <!-- 废旧纸张 -->
       <template slot="paper" slot-scope="text,record">
-        <span :style="{ color: record.maxVal==record.paper ? 'red' : '' }">{{ record.paper || 0 }}</span>
+        <span :style="{ color: record.maxVal==record.paper ? 'red' : '' }">{{ (record.paper/1000).toFixed(2) || 0 }}</span>
       </template>
       <!-- 废旧塑料 -->
       <template slot="plastic" slot-scope="text,record">
-        <span :style="{ color: record.maxVal==record.plastic ? 'red' : '' }">{{ record.plastic || 0 }}</span>
+        <span :style="{ color: record.maxVal==record.plastic ? 'red' : '' }">{{ (record.plastic/1000).toFixed(2) || 0 }}</span>
       </template>
       <!-- 废旧金属 -->
       <template slot="metal" slot-scope="text,record">
-        <span :style="{ color: record.maxVal==record.metal ? 'red' : '' }">{{ record.metal || 0 }}</span>
+        <span :style="{ color: record.maxVal==record.metal ? 'red' : '' }">{{ (record.metal/1000).toFixed(2) || 0 }}</span>
       </template>
       <!-- 废旧金属/塑料 -->
       <template slot="metPla" slot-scope="text,record">
-        <span :style="{ color: record.maxVal==record.metPla ? 'red' : '' }">{{ record.metPla || 0 }}</span>
+        <span :style="{ color: record.maxVal==record.metPla ? 'red' : '' }">{{ (record.metPla/1000).toFixed(2) || 0 }}</span>
       </template>
       <!-- 废旧玻璃 -->
       <template slot="glass" slot-scope="text,record">
-        <span :style="{ color: record.maxVal==record.glass ? 'red' : '' }">{{ record.glass || 0 }}</span>
+        <span :style="{ color: record.maxVal==record.glass ? 'red' : '' }">{{ (record.glass/1000).toFixed(2) || 0 }}</span>
       </template>
       <!-- 可回收物 -->
       <template slot="recycling" slot-scope="text,record">
-        <span :style="{ color: record.maxVal==record.recycling ? 'red' : '' }">{{ record.recycling || 0 }}</span>
+        <span :style="{ color: record.maxVal==record.recycling ? 'red' : '' }">{{ record.recycling/1000 || 0 }}</span>
       </template>
       <!-- 操作 -->
       <span slot="action" slot-scope="text,record">
@@ -185,7 +185,7 @@ export default {
             { title: '可回收物', scopedSlots: { customRender: 'recycling' }, width: 100, align: 'center' }
           ]
         },
-        { title: '可回收垃圾小计(kg)', dataIndex: 'totalWeight', width: 100, align: 'center' },
+        { title: '可回收垃圾小计(kg)', dataIndex: 'totalWeight', width: 100, align: 'center',customRender: (text) => { return (text/1000).toFixed(2) || 0 } },
         { title: '最后清运时间', dataIndex: 'lastCleanDate', width: 100, align: 'center', customRender: (text) => { return text || '--' } },
         { title: '操作', dataIndex: 'action', width: 100, align: 'center', scopedSlots: { customRender: 'action' } }
       ],
@@ -223,6 +223,7 @@ export default {
               // })
             }
             return res.data
+			this.getTotal()
           }
         })
       }
@@ -306,6 +307,26 @@ export default {
         }
       })
     },
+	// 总计
+	getTotal(){
+		const params=this.queryParam
+		if (this.time && this.time.length) {
+			params.beginDate = moment(this.time[0]).format('YYYY-MM-DD')
+			params.endDate = moment(this.time[1]).format('YYYY-MM-DD')
+		} else {
+			params.beginDate = null
+			params.endDate = null
+		}
+		// getCleanStationTotal(params).then(res => {
+		//   if (res.status == 200) {
+		//     if (res.data != 0 || null) {
+		//       this.cleanWeightTotal = (res.data / 1000).toFixed(2)
+		//     }
+		//   } else {
+		//     this.cleanWeightTotal = 0
+		//   }
+		// })
+	},
     // 重置
     reset () {
       this.queryParam.srcDeviceCode = undefined