Przeglądaj źródła

update deliveryRoom

linan 5 lat temu
rodzic
commit
6a62a4918f

+ 4 - 3
src/api/deliveryRoomManagement.js

@@ -1,6 +1,7 @@
-import { ajaxTest } from "../sdk/ajax";
+import { ajaxTest, ajax } from "../sdk/ajax";
 // 以后根地址统一 删掉这句就行
-let ajax = ajaxTest
 
 /* 个体数据 */
-export const reqDeliveryRoomInfo = (data) => ajax("get", "/api/statistic", data)
+export const reqDeliveryRoomInfo = (data) => ajaxTest("get", "/api/statistic", data)
+
+export const reqUpload = (data) => ajax("get", "/publics/proxy/piggy", data)

BIN
src/assets/deliveryRoom_2.jpg


BIN
src/assets/deliveryRoom_4.jpg


BIN
src/assets/img/1.jpg


BIN
src/assets/img/2.jpg


BIN
src/assets/img/3.jpg


BIN
src/assets/img/4.jpg


BIN
src/assets/img/5.jpg


BIN
src/assets/img/a1.jpg


BIN
src/assets/img/a2.jpg


BIN
src/assets/img/a3.jpg


BIN
src/assets/img/a4.jpg


BIN
src/assets/img/a5.jpg


+ 1 - 0
src/views/Home/Home.vue

@@ -285,6 +285,7 @@ export default {
                     position: fixed;
                     .item {
                         margin-right: 8px;
+                        cursor: pointer;
                     }
                 }
                 .warp {

+ 56 - 92
src/views/Home/mencCofig.js

@@ -57,52 +57,21 @@ export const menuData = [
     },
 
     {
-        optionName: "群体管理",
+        optionName: "消息通知",
         iconClassName: "el-icon-s-flag",
         index: '21',
         disabled: false,
         childList: [
             {
-                optionName: '群体档案',
+                optionName: '设备故障',
                 index: '21-1',
-                routerName: "GroupRecord"
+                routerName: ""
             },
             {
-                optionName: '健康分析',
+                optionName: '生产预警',
                 index: '21-2',
-                routerName: "aa"
+                routerName: ""
             },
-            {
-                optionName: '转群记录',
-                index: '21-3',
-                routerName: "aa"
-            },
-            {
-                optionName: '群体盘点',
-                index: '21-4',
-                routerName: "aa"
-            }
-        ]
-    },
-    // 无子菜单的
-    {
-        optionName: "个体管理",
-        iconClassName: "el-icon-message",
-        index: '3',
-        disabled: false,
-        childList: [
-            {
-                optionName: '种猪档案',
-                index: '3-1',
-                routerName: "aa"
-            },
-            {
-                optionName: '个体追踪',
-                index: '3-2',
-                routerName: "UnityTrace"
-            }
-
-
         ]
     },
     {
@@ -114,97 +83,92 @@ export const menuData = [
             {
                 optionName: '设备配置',
                 index: '4-1',
-                routerName: "aa"
+                routerName: ""
             },
             {
                 optionName: '软件设置',
                 index: '4-2',
-                routerName: "aa"
+                routerName: ""
             },
             {
                 optionName: '角色设置',
                 index: '4-3',
-                routerName: "aa"
+                routerName: ""
             },
             {
                 optionName: '权限管理',
                 index: '4-4',
-                routerName: "aa"
+                routerName: ""
             }
         ]
     },
     {
-        optionName: "系统设置",
+        optionName: "档案信息",
         iconClassName: "el-icon-monitor",
         index: '5',
         disabled: false, // 是否禁用
         childList: [
             {
-                optionName: '群体广播',
+                optionName: '牧场信息',
                 index: '5-1',
-                routerName: "aa"
+                routerName: ""
             },
             {
-                optionName: '设备配置',
+                optionName: '猪舍信息',
                 index: '5-2',
-                routerName: "aa"
+                routerName: ""
             },
             {
-                optionName: '系统参数',
+                optionName: '种猪信息',
                 index: '5-3',
-                routerName: "aa"
+                routerName: ""
             },
             {
-                optionName: '角色配置',
+                optionName: '员工信息',
                 index: '5-4',
-                routerName: "aa"
-            },
-            {
-                optionName: '权限分配',
-                index: '5-5',
-                routerName: "aa"
+                routerName: ""
             }
         ]
     },
-    {
-        optionName: "开发用模板",
-        iconClassName: "el-icon-menu",
-        index: '100',
-        disabled: false, // 是否禁用
-        childList: [
-            {
-                optionName: '模板 1',
-                index: '100-1',
-                routerName: "aa"
-            },
-            {
-                optionName: '普通表格',
-                index: '100-2',
-                routerName: "ab"
-            },
-            {
-                optionName: '模板 3',
-                index: '100-3',
-                routerName: "ac"
-            },
-            {
-                optionName: '模板 4',
-                index: '100-4',
-                routerName: "ad"
-            },
-            {
-                optionName: '模板 5',
-                index: '100-5',
-                routerName: "ee"
-            },
-            {
-                optionName: '模板 6',
-                index: '100-6',
-                routerName: "af"
-            }
+    // {
+    //     optionName: "开发用模板",
+    //     iconClassName: "el-icon-menu",
+    //     index: '100',
+    //     disabled: false, // 是否禁用
+    //     childList: [
+    //         {
+    //             optionName: '模板 1',
+    //             index: '100-1',
+    //             routerName: "aa"
+    //         },
+    //         {
+    //             optionName: '普通表格',
+    //             index: '100-2',
+    //             routerName: "ab"
+    //         },
+    //         {
+    //             optionName: '模板 3',
+    //             index: '100-3',
+    //             routerName: "ac"
+    //         },
+    //         {
+    //             optionName: '模板 4',
+    //             index: '100-4',
+    //             routerName: "ad"
+    //         },
+    //         {
+    //             optionName: '模板 5',
+    //             index: '100-5',
+    //             routerName: "ee"
+    //         },
+    //         {
+    //             optionName: '模板 6',
+    //             index: '100-6',
+    //             routerName: "af"
+    //         }
 
-        ]
-    },
+    //     ]
+    // },
 
 ]
 

+ 77 - 28
src/views/deliveryRoomManagement/DeliveryRoom.vue

@@ -3,24 +3,61 @@
         <section class="section">
             <ul class="ul">
 
-                <li @click="toDetail" class="li" v-for="(item, index) in list" :key="index">
+                <li @click="toDetail(item.type)" class="li" v-for="(item, index) in list" :key="index">
                     <h5>产房00{{ index+1 }}</h5>
                     <img class="img" :src="typeImgUrl[item.type - 1]" />
-                    <div class="info" v-if="item.type != 1">
+                    <p v-if="item.type == 1" class="info fontC">空床时间{{ 4 }}天</p>
+                    <div class="info" v-if="item.type == 2">
                         <p class="p">
                             <span class="title">母猪耳标:</span>
-                            <span class="content">16545</span>
+                            <span class="content">{{ item.id }}</span>
                         </p>
                         <p class="p">
                             <span class="title">入床时间:</span>
-                            <span class="content">2020-04-15</span>
+                            <span class="content">2020-07-25</span>
                         </p>
                         <p class="p">
                             <span class="title">预计产仔:</span>
-                            <span class="content">2020-04-15</span>
+                            <span class="content">2020-08-1</span>
+                        </p>
+                    </div>
+                    <div class="info" v-else-if="item.type == 3">
+                        <p class="p">
+                            <span class="title">母猪耳标:</span>
+                            <span class="content">{{ item.id }}</span>
+                        </p>
+                       <p class="p">
+                            <span class="title">产子时间:</span>
+                            <span class="content">2020-07-20</span>
+                        </p>
+                        <p class="p">
+                            <span class="title">仔猪日龄:</span>
+                            <span class="content">10天</span>
+                            
+                        </p>
+                        <p class="p">
+                            <span class="title">产仔数:</span>
+                            <span class="content">9</span>
+                        </p>
+                    </div>
+                    <div class="info" v-else-if="item.type == 4">
+                        <p class="p">
+                            <span class="title">母猪耳标:</span>
+                            <span class="content">{{ item.id }}</span>
+                        </p>
+                        <p class="p">
+                            <span class="title">断奶时间:</span>
+                            <span class="content">2020-07-20</span>
+                        </p>
+                        <p class="p">
+                            <span class="title">断奶活仔数:</span>
+                            <span class="content">8</span>
+                        </p>
+                        <p class="p">
+                            <span class="title">断奶活仔率:</span>
+                            <span class="content">98%</span>
                         </p>
                     </div>
-                    <p v-else class="info fontC">空床时间{{ 4 }}天</p>
                 </li>
 
             </ul>
@@ -30,7 +67,7 @@
                         @current-change="pageChange"
                         background
                         layout="prev, pager, next"
-                        :page-count="5"
+                        :page-count="1"
                     ></el-pagination>
                 </el-col>
             </el-row>
@@ -52,34 +89,32 @@ const pageSize = 10;
 
 let list = [
     {
-        type: 1
-    },
-    {
-        type: 2
+        type: 1,
+        id: 16532
     },
     {
-        type: 3
+        type: 4,
+        id: 16546
     },
     {
-        type: 4
+        type: 3,
+        id: 16548
     },
     {
-        type: 1
+        type: 4,
+        id: 16566
     },
     {
-        type: 3
+        type: 2,
+        id: 16596
     },
     {
-        type: 3
+        type: 3,
+        id: 16540
     },
     {
-        type: 4
-    },
-    {
-        type: 2
-    },
-    {
-        type: 1
+        type: 3,
+        id: 16551
     }
 ];
 
@@ -102,8 +137,12 @@ export default {
     },
     methods: {
         
-        toDetail() {
-            this.$router.push({path: "Detail"})
+        toDetail(type) {
+            if(type == 1) {
+                this.$message.warning("产床为空!")
+                return
+            }
+            this.$router.push({path: "Detail",query: {type}})
         },
         pageChange(p) {
             console.log(p);
@@ -117,17 +156,23 @@ export default {
 <style lang="scss" scoped>
 .deliveryRoom {
     .section {
+        background-color: #eee;
         .ul {
             display: flex;
             flex-direction: row;
             flex-wrap: wrap;
             
             .li {
+                background-color: #fff;
+                border: 2px solid #fff;
+                padding: 5px;
+                margin: 6px;
                 display: flex;
                 flex-direction: column;
-                width: 310px;
-                height: 600px;
-                margin: 10px;
+                width: 200px;
+                height: 420px;
+                
+                
                 h5 {
                     text-align: center;
                     font-size: 30px;
@@ -145,6 +190,7 @@ export default {
                     justify-content: space-around;
                     .p {
                         .title {
+                            font-size: 14px;
                             font-weight: 600;
                             color: rgb(136, 127, 127);
                         }
@@ -161,6 +207,9 @@ export default {
                     font-weight: 600;
                 }
             }
+            .li:hover{
+                border: 2px solid #32ADF4;
+            }
         }
     }
 }

+ 99 - 18
src/views/deliveryRoomManagement/detail/Detail.vue

@@ -18,10 +18,27 @@
 
         <section class="section">
             <article class="left">
-                <div class="contianer">
-                    <el-carousel height="300px" indicator-position="none" :interval="3000">
-                        <el-carousel-item v-for="item in images" :key="item">
-                            <img @click="toSowDetail" :src="'http://119.3.84.55:31288/' + item" />
+
+                <div v-if="roomType == 3" class="contianer">
+                    <el-carousel height="300px" indicator-position="none" :interval="300000">
+                        <el-carousel-item v-for="(item, index) in number.a" :key="item + index">
+                            <img
+                                class="img001"
+                                @click="toSowDetail(index)"
+                                :src="item"
+                            />
+                        </el-carousel-item>
+                    </el-carousel>
+                </div>
+
+                <div v-else class="contianer">
+                    <el-carousel height="300px" indicator-position="none" :interval="300000">
+                        <el-carousel-item v-for="(item, index) in number.a" :key="item + index">
+                            <img
+                                class="img001"
+                                @click="toSowDetail(index)"
+                                :src="item"
+                            />
                         </el-carousel-item>
                     </el-carousel>
                 </div>
@@ -31,12 +48,12 @@
                 <ul class="ul">
                     <li class="li">
                         <span class="title">产仔数:</span>
-                        <span class="content" style="font-size: 26px">9只</span>
+                        <span class="content" style="font-size: 26px">{{12}}只</span>
                     </li>
                     <li class="li">
                         <span class="title">活仔数:</span>
                         <!-- 小于等于八只的标红 -->
-                        <span class="content" style="font-size: 26px">9只</span>
+                        <span class="content" style="font-size: 26px">{{12}}只</span>
                     </li>
                     <li class="li">
                         <span class="title">存活率:</span>
@@ -44,8 +61,8 @@
                         <span class="content" style="font-size: 26px">100%</span>
                     </li>
                     <li class="li">
-                        <span class="title">猪日龄:</span>
-                        <span class="content" style="font-size: 26px">12天</span>
+                        <span class="title">猪日龄:</span>
+                        <span class="content" style="font-size: 26px">{{7}}天</span>
                     </li>
                     <li class="li">
                         <span class="title">产床状态:</span>
@@ -53,11 +70,11 @@
                     </li>
                     <li class="li">
                         <span class="title">出生日期:</span>
-                        <span class="content">2020-04-25</span>
+                        <span class="content">2020-07-23</span>
                     </li>
                     <li class="li">
                         <span class="title">预计断奶剩余天数:</span>
-                        <span class="content">16天</span>
+                        <span class="content">19天</span>
                     </li>
                 </ul>
             </article>
@@ -71,6 +88,13 @@
                 <chart-b :dataArr="daysD" :timeArr="daysT"></chart-b>
             </div>
         </footer>
+<!-- :title="'共有 '+number.count[index] + ' 头小猪'" -->
+        <el-dialog :visible.sync="show" center>
+            <template slot="title">
+                <span style="color: #444">共有 <span style="font-size: 25px; font-weight:600">{{number.count[index]}}</span> 头小猪</span>
+            </template>
+            <img style="width: 100%" :src="number.a1[index]" alt="">
+        </el-dialog>
     </div>
 </template>
 
@@ -78,7 +102,35 @@
 import chart_a from "./charts/chart_a";
 import chart_b from "./charts/chart_b";
 
-import { reqDeliveryRoomInfo } from "@/api/deliveryRoomManagement.js";
+import a1 from "../../../assets/img/1.jpg";
+import a2 from "../../../assets/img/2.jpg";
+import a3 from "../../../assets/img/3.jpg";
+import a4 from "../../../assets/img/4.jpg";
+import a5 from "../../../assets/img/5.jpg";
+
+import aa1 from "../../../assets/img/a1.jpg";
+import aa2 from "../../../assets/img/a2.jpg";
+import aa3 from "../../../assets/img/a3.jpg";
+import aa4 from "../../../assets/img/a4.jpg";
+import aa5 from "../../../assets/img/a5.jpg";
+
+
+import b1 from "../../../assets/img/1.jpg";
+import b2 from "../../../assets/img/2.jpg";
+import b3 from "../../../assets/img/3.jpg";
+import b4 from "../../../assets/img/4.jpg";
+import b5 from "../../../assets/img/5.jpg";
+
+import ba1 from "../../../assets/img/a1.jpg";
+import ba2 from "../../../assets/img/a2.jpg";
+import ba3 from "../../../assets/img/a3.jpg";
+import ba4 from "../../../assets/img/a4.jpg";
+import ba5 from "../../../assets/img/a5.jpg";
+
+import {
+    reqDeliveryRoomInfo,
+    reqUpload
+} from "@/api/deliveryRoomManagement.js";
 
 // 时间选择器配置
 const pickerOptions = {
@@ -126,10 +178,26 @@ export default {
             hoursD: [],
             hoursT: [],
             daysD: [],
-            daysT: []
+            daysT: [],
+            value: {},
+            number: {
+                a: [a1, a2, a3, a4, a5],
+                a1: [aa1, aa2, aa3, aa4, aa5],
+                count: [13, 10, 13, 14, 13]
+            },
+            numberB: {
+                a: [b1, b2, b3, b4, b5],
+                a1: [ba1, ba2, ba3, ba4, ba5],
+                count: [13, 10, 13, 14, 13]
+            },
+            index: 0,
+            show: false,
+            roomType: -1
         };
     },
     created() {
+        console.log(this.$route.query.type)
+        this.roomType = this.$route.query.type
         this.getDeliveryRoomInfo({ bedNo: "10086-1" });
     },
     methods: {
@@ -138,11 +206,16 @@ export default {
             reqDeliveryRoomInfo(data)
                 .then(res => {
                     this.images = res.value.images;
-                    res.value.thours.forEach(item => {
+                    this.value = res.value;
+                    this.hoursD = [];
+                    this.hoursT = [];
+                    this.daysD = [];
+                    this.daysT = [];
+                    res.value.thours.reverse().forEach(item => {
                         this.hoursD.push(item.temperature.toFixed(2));
-                        this.hoursT.push(item.timestamp.substr(0, 14));
+                        this.hoursT.push(item.timestamp.substr(0, 14) + "时");
                     });
-                    res.value.tdays.forEach(item => {
+                    res.value.tdays.reverse().forEach(item => {
                         this.daysD.push(item.temperature.toFixed(2));
                         this.daysT.push(item.timestamp.substr(0, 10));
                     });
@@ -153,12 +226,20 @@ export default {
         },
         pickerChange(value) {
             console.log(value);
+            this.getDeliveryRoomInfo({ bedNo: "10086-1", date: value });
             // this.date = Math.floor(new Date(value[0]).getTime() / 1000)
             // this.getReportList()
         },
-        toSowDetail() {
-            console.log(555);
-            this.$message.warning("母猪详细信息正在开发中!!");
+        toSowDetail(index) {
+            console.log(index)
+            this.index = index
+            this.show = true
+            // console.log(data.path[0].currentSrc);
+            // console.log(data.path[0]);
+            // console.log(data.path);
+            // reqUpload({imageUrl: data.path[0].currentSrc}).then(res => {
+            //     console.log(res)
+            // })
         },
         goBack() {
             this.$router.go(-1);

+ 5 - 5
src/views/index/Index.vue

@@ -20,19 +20,19 @@
                 </li>
                 <li class="li">
                     <span class="title">均产仔数</span>
-                    <span class="content">9</span>
+                    <span class="content">11</span>
                 </li>
                 <li class="li">
                     <span class="title">均断奶活仔数</span>
-                    <span class="content">21</span>
+                    <span class="content">10</span>
                 </li>
                 <li class="li">
                     <span class="title">均断奶天数</span>
-                    <span class="content">14</span>
+                    <span class="content">21</span>
                 </li>
                 <li class="li">
-                    <span class="title">均断奶存活率</span>
-                    <span class="content">99%</span>
+                    <span class="title">均断奶存活率</span>
+                    <span class="content">97%</span>
                 </li>
             </ul>
         </section>

+ 3 - 3
src/views/statisticAnalysis/PSY.vue

@@ -3,7 +3,7 @@
         <h5 class="h5">PSY分析:</h5>
         <header class="header">
             <article class="card">
-                <h5 class="title">PSA</h5>
+                <h5 class="title">PSY</h5>
                 <span class="value">19.8</span>
                 <div class="describe">
                     <div class="up">
@@ -20,7 +20,7 @@
             </article>
 
             <article class="card">
-                <h5 class="title">LSY非生产天数</h5>
+                <h5 class="title">非生产天数</h5>
                 <span class="value">12</span>
                 <div class="describe">
                     <div class="up">
@@ -38,7 +38,7 @@
 
             <article class="card">
                 <h5 class="title">平均胎次</h5>
-                <span class="value">2.3</span>
+                <span class="value">2.1</span>
                 <div class="describe">
                     <div class="up">
                         <span>年同比</span>