linan 4 vuotta sitten
vanhempi
commit
9cad9c64e9

+ 6 - 2
src/api/cultivateSeed.js

@@ -1,6 +1,10 @@
 import { ajax } from "../sdk/ajax";
 
+// 育种管理
+/* 等级评定  GradeAssess*/
+export const reqGradeAssessList = (data) => ajax("post", "/farm-huyang/rank/list", data)
 
-/* 登录 */
-export const reqLogin = (data) => ajax("post", "/core/auth/login", data)
+
+/* 系谱信息 ClanInfo */
+export const reqClanInfo = (data) => ajax("post", "/farm-huyang/sheep/genealogy", data)
 

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

@@ -197,6 +197,7 @@ export default {
             .col1 {
                 margin-right: 5px;
                 background-color: #545c64;
+                border-radius: 15px;
                 // background-image: linear-gradient(to bottom, rgb(85, 70, 148) , rgb(41, 33, 85), rgb(41, 33, 85));
             }
             .col2 {

+ 97 - 117
src/views/cultivateSeed/gradeAssess.vue

@@ -1,64 +1,49 @@
 <template>
-    <div class="gradeAssess">
+    <div class="GradeAssess">
         <h2 style="margin-bottom: 20px;padding-bottom:7px;border-bottom:2px solid #ddd">等级评定</h2>
         <header id="header">
-            <el-row type="flex">
+            <el-row type="flex" :gutter="20">
                 <el-col :span="4">
-                    <el-select v-model="value" placeholder="请选择">
-                        <el-option label="1区" value="11"></el-option>
-                        <el-option label="2区" value="22"></el-option>
-                    </el-select>
+                    <el-input v-model="search" placeholder="请输入"></el-input>
                 </el-col>
                 <el-col :span="4">
-                    <el-select v-model="value" placeholder="请选择">
-                        <el-option label="1舍" value="13"></el-option>
-                        <el-option label="2舍" value="24"></el-option>
-                    </el-select>
-                </el-col>
-                <el-col :span="4">
-                    <el-select v-model="value" placeholder="请选择">
-                        <el-option label="可用" value="15"></el-option>
-                        <el-option label="可用" value="26"></el-option>
-                    </el-select>
-                </el-col>
-                <el-col :span="4">
-                    <el-button type="primary">查找</el-button>
-                </el-col>
-                <el-col :span="4">
-                    <el-button type="primary">新增</el-button>
+                    <el-button type="primary" @click="getGradeAssessList">查找</el-button>
                 </el-col>
             </el-row>
         </header>
         <section>
             <article class="table">
-                <el-table
-                    :data="tableData"
-                    tooltip-effect="dark"
-                    style="width: 100%"
-                    @selection-change="handleSelectionChange"
-                >
-                    <el-table-column type="selection" width="55"></el-table-column>
-                    <el-table-column prop="a" label="屠宰批次"></el-table-column>
-                    <el-table-column prop="b" label="产品名称"></el-table-column>
-                    <el-table-column prop="c" label="排酸时间"></el-table-column>
-                    <el-table-column prop="d" label="排酸前重量"></el-table-column>
-                    <el-table-column prop="e" label="排酸后重量"></el-table-column>
-                    <el-table-column prop="f" label="排酸损耗"></el-table-column>
-                    <el-table-column prop="g" label="负责人员"></el-table-column>
-                    <!-- <el-table-column label="操作" width="150">
-                        <template slot-scope="scope">
-                            <el-button @click="edit(scope.row)" type="text" size="small">编辑</el-button>
-                            <el-popconfirm title="是否删除此设备的信息?" @onConfirm="del(scope.row)">
-                                <el-button slot="reference" type="text" size="small">删除</el-button>
-                            </el-popconfirm>
+                <el-table :data="tableData" tooltip-effect="dark" style="width: 100%">
+                    <el-table-column prop="id" label="羊只编号"></el-table-column>
+                    <el-table-column prop="gender" label="性别">
+                        <template v-slot="scope">
+                            <span v-if="scope.row['source'] == 0">母</span>
+                            <span v-if="scope.row['source'] == 1">公</span>
+                        </template>
+                    </el-table-column>
+                    <el-table-column prop="patternArea" label="花纹面积"></el-table-column>
+                    <el-table-column prop="hairLength" label="毛长"></el-table-column>
+                    <el-table-column prop="hairWidth" label="毛宽"></el-table-column>
+                    <el-table-column label="明显程度">
+                        <template v-slot="scope">
+                            <span v-if="scope.row['ifObviously'] == 0">不明显</span>
+                            <span v-if="scope.row['ifObviously'] == 1">明显</span>
                         </template>
-                    </el-table-column> -->
+                    </el-table-column>
+                    <el-table-column label="等级评级">
+                        <template v-slot="scope">
+                            <div v-for="item in $store.state['seedSheedLevel']" :key="item.value">
+                                <el-tag v-if="item.value == scope.row['level']">{{ item.label }}</el-tag>
+                            </div>
+                        </template>
+                    </el-table-column>
+                    <el-table-column label="操作" width="150">
+                        <template v-slot="scope">
+                            <el-button @click="goVirtualMating(scope.row)" type="text" size="small">虚拟配种</el-button>
+                            <el-button @click="goClan(scope.row)" type="text" size="small">查看系谱</el-button>
+                        </template>
+                    </el-table-column>
                 </el-table>
-                <div style="margin-top: 20px">
-                    <el-button @click="toggleSelection([tableData[1], tableData[2]])">切换第二、第三行的选中状态</el-button>
-                    <el-button @click="toggleSelection()">取消选择</el-button>
-                    <el-button @click="inStore">入待宰栏</el-button>
-                </div>
 
                 <el-row type="flex" justify="end">
                     <el-col :span="8" class="pagination">
@@ -66,7 +51,7 @@
                             @current-change="pageChange"
                             background
                             layout="prev, pager, next"
-                            :page-count="10"
+                            :page-count="Number(totalPages)"
                         ></el-pagination>
                     </el-col>
                 </el-row>
@@ -76,87 +61,82 @@
 </template>
 
 <script>
+import { reqGradeAssessList } from "@/api/cultivateSeed.js";
 
-const pageSize = 10
-const tableData = [
-                {
-                    a: "15463",
-                    b: "胴体",
-                    c: "2020-07-14",
-                    d: "49kg",
-                    e: "48kg",
-                    f: "1.6%",
-                    g: "张小刚",
-                },
-                {
-                    a: "15463",
-                    b: "带骨羊前腿",
-                    c: "2020-07-14",
-                    d: "49kg",
-                    e: "48kg",
-                    f: "1.6%",
-                    g: "张小刚",
-                },
-                {
-                    a: "15463",
-                    b: "羔羊肉卷",
-                    c: "2020-07-14",
-                    d: "49kg",
-                    e: "48kg",
-                    f: "1.6%",
-                    g: "张小刚",
-                },
-                {
-                    a: "15463",
-                    b: "胴体",
-                    c: "2020-07-14",
-                    d: "49kg",
-                    e: "48kg",
-                    f: "1.6%",
-                    g: "张小刚",
-                },
-                {
-                    a: "15463",
-                    b: "羔羊肉卷",
-                    c: "2020-07-14",
-                    d: "49kg",
-                    e: "48kg",
-                    f: "1.6%",
-                    g: "张小刚",
-                },
-                
-                
-            ]
+const pageSize = 10;
+const rules = {};
 
 export default {
+    name: "GradeAssess",
     data() {
+        let _this = this;
         return {
-            value: "",
-            multipleSelection: [],
-            page: 1,
-            tableData
+            search: "",
+            pageNum: 1,
+            tableData: [],
+            totalPages: 0,
+            formData: {
+                saleNo: "20200814001",
+                saleTime: this.$moment().format("YYYY-MM-DD HH:mm:ss"),
+                saleBatch: "12380",
+                number: 4,
+                weight: 204.8,
+                price: 65,
+                opeUser: null,
+                buyer: "乔一飞",
+                sum: 0.0,
+                remark: "备注"
+            },
+            rules
         };
     },
-    created() {},
+    created() {
+        // 调拨转舍列表
+        this.getGradeAssessList();
+    },
+    watch: {
+        "formData.weight"(v, ov) {
+            this.formData.sum = (v * this.formData.price).toFixed(2);
+        },
+        "formData.price"(v, ov) {
+            this.formData.sum = (this.formData.weight * v).toFixed(2);
+        }
+    },
     methods: {
-        toggleSelection(rows) {
-            if (rows) {
-                rows.forEach(row => {
-                    this.$refs.multipleTable.toggleRowSelection(row);
+        // 调拨转舍列表
+        getGradeAssessList() {
+            reqGradeAssessList({
+                searchStr: this.search,
+                pageSize,
+                pageNum: this.pageNum
+            })
+                .then(res => {
+                    this.tableData = res.content;
+                    this.totalPages = res.totalPages;
+                })
+                .catch(err => {
+                    console.log(err);
                 });
-            } else {
-                this.$refs.multipleTable.clearSelection();
-            }
         },
-        // 入待宰栏
-        inStore() {},
-        handleSelectionChange(val) {
-            this.multipleSelection = val;
+        goVirtualMating(row) {
+            console.log(row)
+            this.$router.push({
+                path: "virtualMating",
+                query: row
+            })
+        },
+        goClan(row) {
+            console.log(row)
+            this.$router.push({
+                path: "clan",
+                query: row
+            })
         },
-        edit(row) {},
-        del(row) {},
         pageChange(p) {
             console.log(p);
+            this.pageNum = p;
+            // 调拨转舍列表
+            this.getGradeAssessList();
         }
     }
 };

+ 316 - 3
src/views/cultivateSeed/sub/clan.vue

@@ -1,9 +1,322 @@
 <template>
-    <div>
-        <el-page-header @back="$router.go(-1)">
+    <div class="clan">
+        <el-page-header @back="$router.go(-1)" style="margin-bottom: 15px;">
             <template v-slot:content>
                 <h4>系谱管理</h4>
             </template>
         </el-page-header>
+        <!-- rowspan="2"    -->
+        <section class="section">
+            <div class="container">
+                <div class="left">
+                    <table cellspacing="0">
+                        <thead>
+                            <th colspan="4">基 本 情 况</th>
+                        </thead>
+                        <tr>
+                            <td class="title">品 种</td>
+                            <td>{{ self.variety }}</td>
+                            <td class="title">耳 标 编 号</td>
+                            <td>{{ self.id }}</td>
+                        </tr>
+                        <tr>
+                            <td class="title">性 别</td>
+                            <td>{{ self.gender==0?'母':'公' }}</td>
+                            <td class="title">出 生 日 期</td>
+                            <td>{{ self.birthday.substr(0,10) }}</td>
+                        </tr>
+                        <tr>
+                            <td class="title">同 胞 数</td>
+                            <td>{{ self.brotherNum }}</td>
+                            <td class="title">出 生 体 重</td>
+                            <td>{{ self.birthWeight }}kg</td>
+                        </tr>
+                        <tr>
+                            <td class="title">6月龄体重</td>
+                            <td>{{ self.sixWeight }}kg</td>
+                            <td class="title">12月龄体重</td>
+                            <td>{{ self.twelveWeight }}kg</td>
+                        </tr>
+                        <tr>
+                            <td class="title">级 别</td>
+                            <td>
+                                <div
+                                    v-for="item in $store.state['seedSheedLevel']"
+                                    :key="item.value"
+                                >
+                                    <span v-if="item.value == self.level">{{ item.label }}</span>
+                                </div>
+                            </td>
+                            <td class="title">胎 次</td>
+                            <td>{{ self.parity }}</td>
+                        </tr>
+                    </table>
+                </div>
+                <div class="right">
+                    <article class="l">
+                        <span class="title">系谱</span>
+                        <span class="line"></span>
+                    </article>
+                    <article class="m">
+                        <p>
+                            <span class="title">父</span>
+                            <span class="content">{{ father.id }}</span>
+                        </p>
+                        <p>
+                            <span class="title">母</span>
+                            <span class="content">{{ mother.id }}</span>
+                        </p>
+                    </article>
+                    <article class="m">
+                        <div>
+                            <p>
+                                <span class="title">父父</span>
+                                <span class="content">{{ fatherFather.id }}</span>
+                            </p>
+                            <p>
+                                <span class="title">父母</span>
+                                <span class="content">{{ fatherMother.id }}</span>
+                            </p>
+                        </div>
+                        <div>
+                            <p>
+                                <span class="title">母父</span>
+                                <span class="content">{{ motherFather.id }}</span>
+                            </p>
+                            <p>
+                                <span class="title">母母</span>
+                                <span class="content">{{ motherMother.id }}</span>
+                            </p>
+                        </div>
+                    </article>
+                </div>
+            </div>
+            <table cellspacing="0">
+                <tr>
+                    <td rowspan="2" class="title">代别</td>
+                    <td rowspan="2" class="title">个体编码</td>
+                    <td rowspan="2" class="title">产自单(多)羔羊</td>
+                    <td colspan="2" class="title">体高</td>
+                    <td colspan="3" class="title">体重</td>
+                    <td rowspan="2" class="title">12月龄剪毛重</td>
+                    <td rowspan="2" class="title">繁殖成绩</td>
+                </tr>
+                <tr>
+                    <td class="title">12月龄</td>
+                    <td class="title">24月龄</td>
+                    <td class="title">6月龄</td>
+                    <td class="title">12月龄</td>
+                    <td class="title" style="border-right: 1px solid #ccc;">24月龄</td>
+                </tr>
+                <tr >
+                    <td class="title">父</td>
+                    <td>{{ father.id }}</td>
+                    <td>{{ father.brotherNum>1?'是':'否' }}</td>
+                    <td>{{ father.twelveHeight }}</td>
+                    <td>{{ father.twFourHeight }}</td>
+                    <td>{{ father.sixWeight }}</td>
+                    <td>{{ father.twelveWeight }}</td>
+                    <td>{{ father.twFourWeight }}</td>
+                    <td>{{ father.twelveHair }}</td>
+                    <td>{{ father.deliverRank }}</td>
+                </tr>
+                <tr>
+                    <td class="title">母</td>
+                    <td>{{ mother.id }}</td>
+                    <td>{{ mother.brotherNum>1?'是':'否' }}</td>
+                    <td>{{ mother.twelveHeight }}</td>
+                    <td>{{ mother.twFourHeight }}</td>
+                    <td>{{ mother.sixWeight }}</td>
+                    <td>{{ mother.twelveWeight }}</td>
+                    <td>{{ mother.twFourWeight }}</td>
+                    <td>{{ mother.twelveHair }}</td>
+                    <td>{{ mother.deliverRank }}</td>
+                </tr>
+                <tr>
+                    <td class="title">父父</td>
+                    <td>{{ fatherFather.id }}</td>
+                    <td>{{ fatherFather.brotherNum>1?'是':'否' }}</td>
+                    <td>{{ fatherFather.twelveHeight }}</td>
+                    <td>{{ fatherFather.twFourHeight }}</td>
+                    <td>{{ fatherFather.sixWeight }}</td>
+                    <td>{{ fatherFather.twelveWeight }}</td>
+                    <td>{{ fatherFather.twFourWeight }}</td>
+                    <td>{{ fatherFather.twelveHair }}</td>
+                    <td>{{ fatherFather.deliverRank }}</td>
+                </tr>
+                <tr>
+                    <td class="title">父母</td>
+                    <td>{{ fatherMother.id }}</td>
+                    <td>{{ fatherMother.brotherNum>1?'是':'否' }}</td>
+                    <td>{{ fatherMother.twelveHeight }}</td>
+                    <td>{{ fatherMother.twFourHeight }}</td>
+                    <td>{{ fatherMother.sixWeight }}</td>
+                    <td>{{ fatherMother.twelveWeight }}</td>
+                    <td>{{ fatherMother.twFourWeight }}</td>
+                    <td>{{ fatherMother.twelveHair }}</td>
+                    <td>{{ fatherMother.deliverRank }}</td>
+                </tr>
+                <tr>
+                    <td class="title">母父</td>
+                    <td>{{ motherFather.id }}</td>
+                    <td>{{ motherFather.brotherNum>1?'是':'否' }}</td>
+                    <td>{{ motherFather.twelveHeight }}</td>
+                    <td>{{ motherFather.twFourHeight }}</td>
+                    <td>{{ motherFather.sixWeight }}</td>
+                    <td>{{ motherFather.twelveWeight }}</td>
+                    <td>{{ motherFather.twFourWeight }}</td>
+                    <td>{{ motherFather.twelveHair }}</td>
+                    <td>{{ motherFather.deliverRank }}</td>
+                </tr>
+                <tr>
+                    <td class="title">母母</td>
+                    <td>{{ motherMother.id }}</td>
+                    <td>{{ motherMother.brotherNum>1?'是':'否' }}</td>
+                    <td>{{ motherMother.twelveHeight }}</td>
+                    <td>{{ motherMother.twFourHeight }}</td>
+                    <td>{{ motherMother.sixWeight }}</td>
+                    <td>{{ motherMother.twelveWeight }}</td>
+                    <td>{{ motherMother.twFourWeight }}</td>
+                    <td>{{ motherMother.twelveHair }}</td>
+                    <td>{{ motherMother.deliverRank }}</td>
+                </tr>
+            </table>
+        </section>
     </div>
-</template>
+</template>
+
+<script>
+import { reqClanInfo } from "@/api/cultivateSeed.js";
+
+export default {
+    name: "clan",
+    data() {
+        return {
+            self: {
+                birthday:'' // 防报错
+            },
+            father: {},
+            fatherFather: {},
+            fatherMother: {},
+            mother: {},
+            motherFather: {},
+            motherMother: {}
+        };
+    },
+    created() {
+        // 系谱信息
+        this.getClanInfo();
+    },
+    methods: {
+        // 系谱信息
+        getClanInfo() {
+            reqClanInfo({
+                id: this.$route.query.id
+            })
+                .then(res => {
+                    // this.CF = res;
+                    console.log(res);
+                    this.self = res.self;
+                    this.father = res.father;
+                    this.fatherFather = res.fatherFather;
+                    this.fatherMother = res.fatherMother;
+                    this.mother = res.mother;
+                    this.motherFather = res.motherFather;
+                    this.motherMother = res.motherMother;
+                })
+                .catch(err => {
+                    console.log(err);
+                });
+        }
+    }
+};
+</script>
+
+<style lang="scss" scoped>
+$border: 1px solid #ccc;
+
+.clan {
+    .section {
+        width: 92%;
+        .container {
+            display: flex;
+
+            .left {
+                width: 55%;
+            }
+            .right {
+                flex-grow: 1;
+                border: $border;
+                border-left: none;
+                display: flex;
+                color: #777;
+                article {
+                    width: 33%;
+                    height: 100%;
+                    display: flex;
+                    flex-direction: column;
+                    justify-content: center;
+                    align-items: center;
+                }
+                .title {
+                    font-weight: 600;
+                    color: #555;
+                    font-size: 15px;
+                }
+                .l {
+                    display: flex;
+                    flex-direction: row;
+                    .line {
+                        display: inline-block;
+                        width: 50%;
+                        border-bottom: 1px solid #000;
+                        transform: translateY(0.5px);
+                        margin-left: 5px;
+                    }
+                }
+                .m {
+                    p {
+                        margin: 35px;
+                        .content {
+                            width: 100px;
+                            display: inline-block;
+                            margin-left: 10px;
+                            border-bottom: 1px solid #444;
+                            text-align: center;
+                        }
+                    }
+                }
+            }
+        }
+    }
+}
+
+table {
+    border: $border;
+    width: 100%;
+    thead {
+        th {
+            height: 60px;
+            font-size: 20px;
+            color: #555;
+        }
+    }
+    tr {
+        height: 56px;
+        td {
+            border-top: $border;
+            border-right: $border;
+            text-align: center;
+            color: #777;
+        }
+        td:last-of-type {
+            border-right: none;
+        }
+        .title {
+            font-weight: 600;
+            color: #555;
+            font-size: 15px;
+        }
+    }
+}
+</style>

+ 6 - 1
src/views/cultivateSeed/sub/virtualMating.vue

@@ -1,8 +1,13 @@
 <template>
     <!-- 静态  虚拟配种  virtualMating-->
     <div class="virtualMating">
+        <el-page-header @back="$router.go(-1)" style="margin-bottom: 15px;">
+            <template v-slot:content>
+                <h4>虚拟配种</h4>
+            </template>
+        </el-page-header>
+
         <header id="header">
-            虚拟配种
             <el-row type="flex">
                 <el-col :span="4">
                     <el-select v-model="value" placeholder="请选择">

+ 7 - 0
src/views/production/earTag.vue

@@ -24,6 +24,13 @@
                     <el-table-column prop="id" label="序号"></el-table-column>
                     <el-table-column prop="earTag" label="耳标编码"></el-table-column>
                     <el-table-column prop="sheepId" label="羊只编码"></el-table-column>
+                    <el-table-column label="羊只类型">
+                        <template v-slot="scope">
+                            <div v-for="item in $store.state['sheepType']" :key="item.value">
+                                <span v-if="item.value == scope.row['sheepType']">{{ item.label }}</span>
+                            </div>
+                        </template>
+                    </el-table-column>
                     <el-table-column label="上标时间">
                         <template v-slot="scope">
                             <span>{{ scope.row['bindTime'].substr(0,10) }}</span>

+ 8 - 0
src/views/sell/sellLog.vue

@@ -153,9 +153,17 @@ export default {
     },
     watch: {
         'formData.weight'(v, ov) {
+            if(Number(v).toString() == 'NaN') {
+                this.$message.error('请输入数字')
+                return
+            }
             this.formData.sum = (v * this.formData.price).toFixed(2)
         },
         'formData.price'(v, ov) {
+            if(Number(v).toString() == 'NaN') {
+                this.$message.error('请输入数字')
+                return
+            }
             this.formData.sum = (this.formData.weight * v).toFixed(2)
         }
     },