|
@@ -0,0 +1,122 @@
|
|
|
+<template>
|
|
|
+ <div class="SeedPig">
|
|
|
+ <h2 style="margin-bottom: 20px;padding-bottom:7px;border-bottom:2px solid #ddd">种猪列表</h2>
|
|
|
+ <header id="header">
|
|
|
+ <!-- <el-row type="flex" :gutter="20">
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-input v-model="search" placeholder="请输入"></el-input>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-button type="primary" @click="getSeedPigList">查找</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row> -->
|
|
|
+ </header>
|
|
|
+ <section>
|
|
|
+ <article class="table">
|
|
|
+ <el-table :data="tableData" tooltip-effect="dark" style="width: 100%">
|
|
|
+ <el-table-column prop="earTagNo" label="耳标号"></el-table-column>
|
|
|
+ <el-table-column label="出生时间">
|
|
|
+ <template v-slot="scope">
|
|
|
+ <span>{{ scope.row['created'].substr(0,10) }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="dayOfAge" label="日龄(天)"></el-table-column>
|
|
|
+ <el-table-column prop="category" label="品种"></el-table-column>
|
|
|
+ <el-table-column prop="mark" label="标记"></el-table-column>
|
|
|
+ <el-table-column label="操作" width="150">
|
|
|
+ <!-- <template v-slot="scope">
|
|
|
+ <el-popconfirm title="是否删除此设备的信息?" @onConfirm="del(scope.row)">
|
|
|
+ <el-button slot="reference" type="text" size="small">删除</el-button>
|
|
|
+ </el-popconfirm>
|
|
|
+ </template> -->
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <el-row type="flex" justify="end">
|
|
|
+ <el-col :span="8" class="pagination">
|
|
|
+ <el-pagination
|
|
|
+ @current-change="pageChange"
|
|
|
+ background
|
|
|
+ layout="prev, pager, next"
|
|
|
+ :page-count="Number(totalPages)"
|
|
|
+ ></el-pagination>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </article>
|
|
|
+ </section>
|
|
|
+
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { reqSeedPigList } from "@/api/fileInfo.js";
|
|
|
+
|
|
|
+const pageSize = 10;
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: "SeedPig",
|
|
|
+ data() {
|
|
|
+ let _this = this;
|
|
|
+ return {
|
|
|
+ pageNum: 1,
|
|
|
+ tableData: [],
|
|
|
+ totalPages: 0
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ // 设备故障列表
|
|
|
+ this.getSeedPigList();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 设备故障列表
|
|
|
+ getSeedPigList() {
|
|
|
+ reqSeedPigList({
|
|
|
+ pageSize,
|
|
|
+ pageNum: this.pageNum
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ this.tableData = res.content;
|
|
|
+ this.totalPages = res.totalPages;
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.log(err);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // del(row) {
|
|
|
+ // console.log(row);
|
|
|
+ // reqDelSeedPig(row.id)
|
|
|
+ // .then(res => {
|
|
|
+ // // 设备故障列表
|
|
|
+ // this.getSeedPigList();
|
|
|
+ // if (res.code == "success") {
|
|
|
+ // this.$message.success(res.msg);
|
|
|
+ // }
|
|
|
+ // if (res.errCode == "delete failed") {
|
|
|
+ // this.$message.error(res.errMsg);
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // .catch(err => {
|
|
|
+ // console.log(err);
|
|
|
+ // this.$message.error("删除失败!");
|
|
|
+ // });
|
|
|
+ // },
|
|
|
+ pageChange(p) {
|
|
|
+ console.log(p);
|
|
|
+ this.pageNum = p;
|
|
|
+ // 设备故障列表
|
|
|
+ this.getSeedPigList();
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+#header {
|
|
|
+ margin-bottom: 15px;
|
|
|
+}
|
|
|
+.table {
|
|
|
+ .pagination {
|
|
|
+ margin-top: 20px;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|