|
@@ -7,14 +7,17 @@
|
|
|
leave-active-class="animate__animated animate__fadeOutLeft"
|
|
|
>
|
|
|
<div class="energy_box" v-show="show">
|
|
|
- <div class="box_title">数据统计</div>
|
|
|
+ <div class="box_title">
|
|
|
+ 数据统计
|
|
|
+ <span style="float: right; cursor: pointer" @click="openScreen"><FormOutlined style="font-size: 16px; color: #f1f1f1" /></span>
|
|
|
+ </div>
|
|
|
<div class="chart_vessel_grid">
|
|
|
<template v-if="farmId == 26">
|
|
|
<div class="total_box">
|
|
|
<div class="total_img pro_img1"></div>
|
|
|
<div class="total_number">
|
|
|
- <div class="number_title">出栏成活率</div>
|
|
|
- <div class="number_int"><count-to :startVal="0" :decimals="2" :end-val="sjtj?.CLCH"></count-to>%</div>
|
|
|
+ <div class="number_title">今日淘汰数(只)</div>
|
|
|
+ <div class="number_int"><count-to :startVal="0" :end-val="sjtj?.SWPIG"></count-to></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="total_box">
|
|
@@ -40,34 +43,34 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
- <div class="total_box">
|
|
|
- <div class="total_img pro_img1"></div>
|
|
|
+ <div v-for="(item, i) in infoList" :key="item.name" class="total_box">
|
|
|
+ <div :class="['total_img', 'pro_img' + (i+1)]"></div>
|
|
|
<div class="total_number">
|
|
|
- <div class="number_title">保育成活率</div>
|
|
|
- <div class="number_int"><count-to :startVal="0" :decimals="2" :end-val="info.bychl"></count-to>%</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="total_box">
|
|
|
- <div class="total_img pro_img2"></div>
|
|
|
- <div class="total_number">
|
|
|
- <div class="number_title">育肥成活率</div>
|
|
|
- <div class="number_int"><count-to :startVal="0" :decimals="2" :end-val="info.yfchl"></count-to>%</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="total_box">
|
|
|
- <div class="total_img pro_img3"></div>
|
|
|
- <div class="total_number">
|
|
|
- <div class="number_title">每日喂料量(只)</div>
|
|
|
- <div class="number_int"><count-to :startVal="0" :decimals="2" :end-val="info.mrwll"></count-to>kg</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="total_box">
|
|
|
- <div class="total_img pro_img4"></div>
|
|
|
- <div class="total_number">
|
|
|
- <div class="number_title">日增重(只)</div>
|
|
|
- <div class="number_int"><count-to :startVal="0" :decimals="2" :end-val="info.rzz"></count-to>kg</div>
|
|
|
+ <div class="number_title">{{item.name}}</div>
|
|
|
+ <div class="number_int"><count-to :startVal="0" :decimals="2" :end-val="item.value"></count-to>{{item.unit}}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+<!-- <div class="total_box">-->
|
|
|
+<!-- <div class="total_img pro_img2"></div>-->
|
|
|
+<!-- <div class="total_number">-->
|
|
|
+<!-- <div class="number_title">育肥成活率</div>-->
|
|
|
+<!-- <div class="number_int"><count-to :startVal="0" :decimals="2" :end-val="info.yfchl"></count-to>%</div>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- <div class="total_box">-->
|
|
|
+<!-- <div class="total_img pro_img3"></div>-->
|
|
|
+<!-- <div class="total_number">-->
|
|
|
+<!-- <div class="number_title">每日喂料量(只)</div>-->
|
|
|
+<!-- <div class="number_int"><count-to :startVal="0" :decimals="2" :end-val="info.mrwll"></count-to>kg</div>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- <div class="total_box">-->
|
|
|
+<!-- <div class="total_img pro_img4"></div>-->
|
|
|
+<!-- <div class="total_number">-->
|
|
|
+<!-- <div class="number_title">日增重(只)</div>-->
|
|
|
+<!-- <div class="number_int"><count-to :startVal="0" :decimals="2" :end-val="info.rzz"></count-to>kg</div>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- </div>-->
|
|
|
</template>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -81,12 +84,12 @@
|
|
|
<div class="box_title">牧场存栏</div>
|
|
|
<div class="chart_vessel">
|
|
|
<template v-if="farmId == 26">
|
|
|
- <chart-pie v-if="mcList.length > 0" :id="1" :list="mcList">
|
|
|
+ <chart-pie v-if="mcList.length > 0" :id="1" :val="mcMaxVal" :list="mcList">
|
|
|
<!-- <div v-else style="line-height: 150px; text-align: center; color: #fff;">暂无数据</div>-->
|
|
|
</chart-pie>
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
- <chart-pie :id="0" v-if="stockList.length > 0" :list="stockList"></chart-pie>
|
|
|
+ <chart-pie :id="0" v-if="stockList.length > 0" :val="stockMaxVal" :list="stockList"></chart-pie>
|
|
|
<div v-else style="line-height: 150px; text-align: center; color: #fff;">暂无数据</div>
|
|
|
</template>
|
|
|
<!-- <chart-stock :id="0" :list="stockList"></chart-stock>-->
|
|
@@ -203,7 +206,11 @@
|
|
|
<div class="energy_box" v-show="show">
|
|
|
<div class="box_title">销售分析</div>
|
|
|
<div class="chart_vessel">
|
|
|
- <div class="chart_select">
|
|
|
+ <div class="chart_select" v-if="farmId == 26">
|
|
|
+ <div :class="['default_box', active === 1 ? 'active_box' : '']">月</div>
|
|
|
+ <div :class="['default_box', active === 2 ? 'active_box' : '']">7日</div>
|
|
|
+ </div>
|
|
|
+ <div class="chart_select" v-else>
|
|
|
<div :class="['default_box', active === 1 ? 'active_box' : '']">月</div>
|
|
|
<div :class="['default_box', active === 2 ? 'active_box' : '']">年</div>
|
|
|
</div>
|
|
@@ -337,9 +344,63 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</transition>
|
|
|
+ <a-modal v-model:visible="showScreen" width="800px" title="大屏展示" @ok="handleOk">
|
|
|
+ <a-checkbox-group v-model:value="screenList" style="width: 100%">
|
|
|
+ <a-row>
|
|
|
+ <a-col :span="8">
|
|
|
+ <a-checkbox value="1" :disabled="(screenList.length < 4) || screenList.includes('1') === true ? false : true">产房成活率: {{info.cfchl}}%</a-checkbox>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="8">
|
|
|
+ <a-checkbox value="2" :disabled="screenList.length < 4 || screenList.includes('2') === true ? false : true">保育成活率: {{info.bychl}}%</a-checkbox>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="8">
|
|
|
+ <a-checkbox value="3" :disabled="screenList.length < 4 || screenList.includes('3') === true ? false : true">育肥成活率: {{info.yfchl}}%</a-checkbox>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="8">
|
|
|
+ <a-checkbox value="4" :disabled="screenList.length < 4 || screenList.includes('4') === true ? false : true">肥猪成活率: {{info.fzchl}}%</a-checkbox>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="8">
|
|
|
+ <a-checkbox value="5" :disabled="screenList.length < 4 || screenList.includes('5') === true ? false : true">每日喂料量(只): {{info.mrwll}}kg</a-checkbox>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="8">
|
|
|
+ <a-checkbox value="6" :disabled="screenList.length < 4 || screenList.includes('6') === true ? false : true">日增重(只): {{info.rzz}}kg</a-checkbox>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="8">
|
|
|
+ <a-checkbox value="7" :disabled="screenList.length < 4 || screenList.includes('7') === true ? false : true">7日断配率: {{info.qrdpl}}%</a-checkbox>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="8">
|
|
|
+ <a-checkbox value="8" :disabled="screenList.length < 4 || screenList.includes('8') === true ? false : true">配种分娩率: {{info.pzfml}}%</a-checkbox>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="8">
|
|
|
+ <a-checkbox value="9" :disabled="screenList.length < 4 || screenList.includes('9') === true ? false : true">平均窝产仔数(只): {{info.pjwczs}}</a-checkbox>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="8">
|
|
|
+ <a-checkbox value="10" :disabled="screenList.length < 4 || screenList.includes('10') === true ? false : true">平均窝产活仔数(只): {{info.pjwchzs}}</a-checkbox>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="8">
|
|
|
+ <a-checkbox value="11" :disabled="screenList.length < 4 || screenList.includes('11') === true ? false : true">平均窝产正常仔数(只): {{info.pjwczczs}}</a-checkbox>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="8">
|
|
|
+ <a-checkbox value="12" :disabled="screenList.length < 4 || screenList.includes('12') === true ? false : true">平均窝断奶重: {{info.pjwdnz}}</a-checkbox>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="8">
|
|
|
+ <a-checkbox value="13" :disabled="screenList.length < 4 || screenList.includes('13') === true ? false : true">窝断奶仔猪数: {{info.wdnzzs}}</a-checkbox>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="8">
|
|
|
+ <a-checkbox value="14" :disabled="screenList.length < 4 || screenList.includes('14') === true ? false : true">非生产天数: {{info.fccts}}</a-checkbox>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="8">
|
|
|
+ <a-checkbox value="15" :disabled="screenList.length < 4 || screenList.includes('15') === true ? false : true">年产窝数: {{info.scws}}</a-checkbox>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="8">
|
|
|
+ <a-checkbox value="16" :disabled="screenList.length < 4 || screenList.includes('16') === true ? false : true">psy: {{info.psy}}</a-checkbox>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </a-checkbox-group>
|
|
|
+ </a-modal>
|
|
|
</template>
|
|
|
<script setup>
|
|
|
- import { CloseCircleOutlined } from "@ant-design/icons-vue";
|
|
|
+ import { CloseCircleOutlined, FormOutlined } from "@ant-design/icons-vue";
|
|
|
import { ref, onMounted, watch, getCurrentInstance, onBeforeUnmount } from 'vue';
|
|
|
import { onBeforeRouteLeave } from 'vue-router';
|
|
|
import {
|
|
@@ -351,7 +412,7 @@
|
|
|
getFarm,
|
|
|
getDisplayType,
|
|
|
getProWarn,
|
|
|
- getHengLuPro, getHengLuInPig, getHengLuMonthPig
|
|
|
+ getHengLuPro, getHengLuInPig, getHengLuMonthPig, getHengLuSale, getProInfoList, addScreenProd
|
|
|
} from "../../utils/api";
|
|
|
import { MonthDate } from "../../utils";
|
|
|
import { CountTo } from 'vue3-count-to';
|
|
@@ -362,6 +423,7 @@
|
|
|
import ChartCl from "./charts/ChartCl.vue";
|
|
|
import XTabs from '../../components/XTabs.vue';
|
|
|
import XTable from '../../components/table/XTable.vue'
|
|
|
+ import { message } from "ant-design-vue";
|
|
|
|
|
|
|
|
|
const { proxy } = getCurrentInstance()
|
|
@@ -370,21 +432,53 @@
|
|
|
|
|
|
// 数据统计
|
|
|
const info = ref({
|
|
|
- bychl: 0,
|
|
|
- mrwll: 0,
|
|
|
- rzz: 0,
|
|
|
- yfchl: 0
|
|
|
+ cfchl: '',
|
|
|
+ bychl: '',
|
|
|
+ fzchl: '',
|
|
|
+ qrdpl: '',
|
|
|
+ pzfml: '',
|
|
|
+ pjwczs: '',
|
|
|
+ pjwchzs: '',
|
|
|
+ pjwczczs: '',
|
|
|
+ pjwdnz: '',
|
|
|
+ wdnzzs: '',
|
|
|
+ fccts: '',
|
|
|
+ scws: '',
|
|
|
+ psy: '',
|
|
|
+ yfchl: '',
|
|
|
+ mrwll: '',
|
|
|
+ rzz: '',
|
|
|
});
|
|
|
|
|
|
+ const infoList = ref([]);
|
|
|
+
|
|
|
const initInfo = () => {
|
|
|
getProList({}).then(res => {
|
|
|
if(res.code === 10000) {
|
|
|
info.value = {
|
|
|
+ cfchl: res.data.cfchl,
|
|
|
bychl: res.data.bychl,
|
|
|
+ fzchl: res.data.fzchl,
|
|
|
+ qrdpl: res.data.qrdpl,
|
|
|
+ pzfml: res.data.pzfml,
|
|
|
+ pjwczs: res.data.pjwczs,
|
|
|
+ pjwchzs: res.data.pjwchzs,
|
|
|
+ pjwczczs: res.data.pjwczczs,
|
|
|
+ pjwdnz: res.data.pjwdnz,
|
|
|
+ wdnzzs: res.data.wdnzzs,
|
|
|
+ fccts: res.data.fccts,
|
|
|
+ scws: res.data.scws,
|
|
|
+ psy: res.data.psy,
|
|
|
+ yfchl: res.data.yfchl,
|
|
|
mrwll: res.data.mrwll,
|
|
|
rzz: res.data.rzz,
|
|
|
- yfchl: res.data.yfchl
|
|
|
}
|
|
|
+ screenList.value = res.data.other1 ? res.data.other1.split(','): []
|
|
|
+ }
|
|
|
+ })
|
|
|
+ getProInfoList({}).then(res => {
|
|
|
+ if(res.code === 10000) {
|
|
|
+ infoList.value = res.data
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -417,6 +511,7 @@
|
|
|
])
|
|
|
const lineList = ref([]);
|
|
|
|
|
|
+ const stockMaxVal = ref(0)
|
|
|
const initStock = async () => {
|
|
|
let params = {
|
|
|
eventType: 3
|
|
@@ -430,6 +525,7 @@
|
|
|
stockList.value[3].value = res.data.prodStock.mzcl;
|
|
|
stockList.value[4].value = res.data.prodStock.gzcl;
|
|
|
stockList.value[5].value = res.data.prodStock.hbzcl;
|
|
|
+ stockMaxVal.value = res.data.prodStock.zcl;
|
|
|
lineList.value = res.data.prodStocks;
|
|
|
}
|
|
|
})
|
|
@@ -443,23 +539,18 @@
|
|
|
list: []
|
|
|
});
|
|
|
const initSale = async () => {
|
|
|
- let params2 = {
|
|
|
- eventType: 4
|
|
|
- }
|
|
|
- let result = await getDisplayType(params2);
|
|
|
- let params = {
|
|
|
- type: active.value,
|
|
|
- displayType: result.data.displayType
|
|
|
- }
|
|
|
- getSale(params).then(res => {
|
|
|
- if(res.code === 10000) {
|
|
|
+ if(farmId.value == 26) {
|
|
|
+ let params = {
|
|
|
+ type: active.value,
|
|
|
+ }
|
|
|
+ getHengLuSale(params).then(res => {
|
|
|
let arr = [];
|
|
|
res.data.forEach(item => {
|
|
|
let time = '';
|
|
|
if(active.value === 1) {
|
|
|
time = proxy.$moment(item.creatTime).format('YYYY-MM')
|
|
|
} else {
|
|
|
- time = proxy.$moment(item.creatTime).format('YYYY')
|
|
|
+ time = proxy.$moment(item.creatTime).format('MM-DD')
|
|
|
}
|
|
|
arr.push({
|
|
|
time: time,
|
|
@@ -467,8 +558,36 @@
|
|
|
});
|
|
|
})
|
|
|
saleData.value.list = arr;
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ let params2 = {
|
|
|
+ eventType: 4
|
|
|
}
|
|
|
- })
|
|
|
+ let result = await getDisplayType(params2);
|
|
|
+ let params = {
|
|
|
+ type: active.value,
|
|
|
+ displayType: result.data.displayType
|
|
|
+ }
|
|
|
+ getSale(params).then(res => {
|
|
|
+ if(res.code === 10000) {
|
|
|
+ let arr = [];
|
|
|
+ res.data.forEach(item => {
|
|
|
+ let time = '';
|
|
|
+ if(active.value === 1) {
|
|
|
+ time = proxy.$moment(item.creatTime).format('YYYY-MM')
|
|
|
+ } else {
|
|
|
+ time = proxy.$moment(item.creatTime).format('YYYY')
|
|
|
+ }
|
|
|
+ arr.push({
|
|
|
+ time: time,
|
|
|
+ value: item.saleQuantity
|
|
|
+ });
|
|
|
+ })
|
|
|
+ saleData.value.list = arr;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
watch(active, () => {
|
|
|
initSale()
|
|
@@ -624,6 +743,7 @@
|
|
|
])
|
|
|
const clList = ref([])
|
|
|
const clData = ref({})
|
|
|
+ const mcMaxVal = ref(0)
|
|
|
const initHengLu = () => {
|
|
|
getHengLuPro({}).then(res => {
|
|
|
if(res.code === 10000) {
|
|
@@ -633,6 +753,7 @@
|
|
|
mcList.value[1].value = res.data.MCCL.dong2;
|
|
|
mcList.value[2].value = res.data.MCCL.dong3;
|
|
|
mcList.value[3].value = res.data.MCCL.dong4;
|
|
|
+ mcMaxVal.value = res.data.MCCL.zcl;
|
|
|
clList.value = res.data.CLBD;
|
|
|
}
|
|
|
})
|
|
@@ -801,11 +922,39 @@
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+ const showScreen = ref(false)
|
|
|
+ const screenList = ref([])
|
|
|
+ const openScreen = () => {
|
|
|
+ showScreen.value = true
|
|
|
+ }
|
|
|
+
|
|
|
+ const handleOk = () => {
|
|
|
+ if(screenList.value.length < 4) {
|
|
|
+ message.error('请选择4个展示!')
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let str = screenList.value.join(',');
|
|
|
+ addScreenProd({other1: str}).then(res => {
|
|
|
+ if(res.code === 10000) {
|
|
|
+ message.success(res.message);
|
|
|
+ showScreen.value = false;
|
|
|
+ initInfo()
|
|
|
+ } else {
|
|
|
+ message.error(res.message);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
onMounted( async () => {
|
|
|
show.value = true;
|
|
|
- initHengLu()
|
|
|
+ if(farmId.value == 26) {
|
|
|
+ initHengLu()
|
|
|
+ } else {
|
|
|
+ await initStock()
|
|
|
+ }
|
|
|
+
|
|
|
+ // initHengLu()
|
|
|
initFarm()
|
|
|
- await initStock()
|
|
|
await initCost()
|
|
|
initSale()
|
|
|
initPro()
|