From cec90cabf08a88af47cbdf0c40e18f7fdb71e7cf Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Wed, 24 Aug 2022 14:18:38 +0800
Subject: [PATCH] 优化数据显示,超过10000保留两位
---
src/views/wel/index.vue | 14 +++++++-------
src/views/farmplant/process.vue | 4 ++--
src/views/land/cs.vue | 2 +-
src/views/farmplant/farmproductstock.vue | 2 +-
src/views/stock/stockmanage.vue | 9 ++++++---
5 files changed, 17 insertions(+), 14 deletions(-)
diff --git a/src/views/farmplant/farmproductstock.vue b/src/views/farmplant/farmproductstock.vue
index de4c496..cb7ffa6 100644
--- a/src/views/farmplant/farmproductstock.vue
+++ b/src/views/farmplant/farmproductstock.vue
@@ -40,7 +40,7 @@
<div class="cai">{{ item.strainName }}</div>
<div class="area">
库存量:
- <span>{{ item.weight }}</span>公斤
+ <span>{{ item.weight>10000?(item.weight/10000).toFixed(2)+"万":item.weight }}</span>公斤
</div>
<div class="btn">
<el-button
diff --git a/src/views/farmplant/process.vue b/src/views/farmplant/process.vue
index 10a53ba..892c734 100644
--- a/src/views/farmplant/process.vue
+++ b/src/views/farmplant/process.vue
@@ -28,7 +28,7 @@
<div class="cai">{{ item.processName }}</div>
<div class="area">
库存量:
- <span>{{ item.productInventoryNum }}</span>公斤
+ <span>{{ item.productInventoryNum>10000?(item.productInventoryNum/10000).toFixed(2)+"万":item.productInventoryNum }}</span>公斤
</div>
<div class="area">
原材料:
@@ -985,7 +985,7 @@
.farm {
width: 168px;
- height: 240px;
+ height: 300px;
/*height: 315px;*/
background-color: #f7f9fb;
border-radius: 5px;
diff --git a/src/views/land/cs.vue b/src/views/land/cs.vue
index 002b6cf..8027a65 100644
--- a/src/views/land/cs.vue
+++ b/src/views/land/cs.vue
@@ -80,7 +80,7 @@
<div class="text">
<div class="land-name">{{ item.landName }}</div>
<div class="land-area">
- <div class="box">{{ item.landArea }} {{ item.dica }}</div>
+ <div class="box">{{ item.landArea>10000?(item.landArea/10000).toFixed(2)+"万":item.landArea}} {{ item.dica }}</div>
</div>
</div>
</div>
diff --git a/src/views/stock/stockmanage.vue b/src/views/stock/stockmanage.vue
index beccc58..1e65c20 100644
--- a/src/views/stock/stockmanage.vue
+++ b/src/views/stock/stockmanage.vue
@@ -76,8 +76,8 @@
</div>
<div class="right">
<div class="spec">
- <span class="num">{{ item.amount }}</span
- >{{ item.dic2 }}<span class="num1"> (共{{ item.cnum }}{{ item.dic1 }})</span>
+ <span class="num">{{ item.amount>10000?(item.amount/10000).toFixed(2)+"万":item.amount }}</span
+ >{{ item.dic2 }}<span class="num1"> (共{{ item.cnum>10000?(item.cnum/10000).toFixed(2)+"万":item.cnum }}{{ item.dic1 }})</span>
</div>
<div class="btn">
<div class="in" @click="modifiedGrades(item)">
@@ -1199,7 +1199,10 @@
font-size: 26px;
color: #5abf78;
float: left;
- width: 220px;
+ // width: 220px;
+ width: 250px;
+ margin-left: -115px;
+ margin-right: 45px;
.num {
font-size: 29px;
diff --git a/src/views/wel/index.vue b/src/views/wel/index.vue
index 062e3a8..c56ecd2 100644
--- a/src/views/wel/index.vue
+++ b/src/views/wel/index.vue
@@ -37,13 +37,13 @@
<div class="land-statis">
<div class="land-title">地块总面积</div>
<div class="land-num">
- <span>{{ landInfo.zarea }}</span> 亩
+ <span>{{ landInfo.zarea>10000?(landInfo.zarea/10000).toFixed(2)+"万":landInfo.zarea }}</span> 亩
</div>
</div>
<div class="land-statis">
<div class="land-title">当前种养面积</div>
<div class="land-num">
- <span>{{ landInfo.sarea }}</span> 亩
+ <span>{{ landInfo.sarea>10000?(landInfo.sarea/10000).toFixed(2)+"万":landInfo.sarea }}</span> 亩
</div>
</div>
<div class="land-statis">
@@ -69,7 +69,7 @@
<div class="cai">{{ item.strainName }}</div>
<div class="area">
种植面积:
- <span>{{ item.area }}</span>亩
+ <span>{{ item.area>10000?(item.area/10000).toFixed(2)+"万":item.area }}</span>亩
</div>
<div class="btn">
<el-button plain size="small" @click="recovery(item)">
@@ -161,7 +161,7 @@
<div class="detail-title">{{ item.name}}</div>
<div class="detail-number">
剩余库存
- <span>{{ item.val}}</span>公斤
+ <span>{{ item.val>10000?(item.val/10000).toFixed(2)+"万":item.val}}</span>公斤
</div>
</div>
</div>
@@ -344,8 +344,8 @@
params['tenantId'] = this.userInfo.tenant_id
params['farmId'] = this.farm.id
getStrainCount(1, 10, Object.assign(params)).then((res) => {
- const data = res.data.data
- this.farmPlanList = data.records
+ const data = res.data.data.records
+ this.farmPlanList = data
})
},
//采收
@@ -544,7 +544,7 @@
.land-statis {
width: 33%;
- margin: 3% 8%;
+ margin: 3% 3%;
.land-num {
margin-top: 20px;
--
Gitblit v1.9.3