|
@@ -80,22 +80,22 @@
|
|
|
<!-- 查询 -->
|
|
|
<div class="form_item">
|
|
|
<el-form :inline="true" size="mini">
|
|
|
- <el-form-item label="母猪存栏:">
|
|
|
+ <el-form-item label="母猪存栏:" style="width: 270px">
|
|
|
<el-input style="width: 50px;" v-model="searchForm.pigAllMin"></el-input>
|
|
|
至
|
|
|
<el-input style="width: 50px;" v-model="searchForm.pigAllMax"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="母猪新增:">
|
|
|
+ <el-form-item label="母猪新增:" style="width: 270px">
|
|
|
<el-input style="width: 50px;" v-model="searchForm.pigAddMin"></el-input>
|
|
|
至
|
|
|
<el-input style="width: 50px;" v-model="searchForm.pigAddMax"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="耳标离线:">
|
|
|
+ <el-form-item label="耳标离线:" style="width: 270px">
|
|
|
<el-input style="width: 50px;" v-model="searchForm.eartagMin"></el-input>
|
|
|
至
|
|
|
<el-input style="width: 50px;" v-model="searchForm.eartagMax"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="能繁母猪:">
|
|
|
+ <el-form-item label="能繁母猪:" style="width: 270px">
|
|
|
<el-input style="width: 50px;" v-model="searchForm.bearPigMin"></el-input>
|
|
|
至
|
|
|
<el-input style="width: 50px;" v-model="searchForm.bearPigMax"></el-input>
|
|
@@ -117,68 +117,105 @@
|
|
|
default-expand-all
|
|
|
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
|
|
style="width: 100%;"
|
|
|
- @row-click="rowClick">
|
|
|
+ @selection-change="selectFarm"
|
|
|
+ ref="table">
|
|
|
+ <el-table-column
|
|
|
+ type="selection"
|
|
|
+ width="55">
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
label="牧场名"
|
|
|
- prop="name">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span style="cursor: pointer;" @click="onSelect(scope.row)">{{scope.row.name}}</span>
|
|
|
- </template>
|
|
|
+ prop="farmName">
|
|
|
</el-table-column>
|
|
|
<el-table-column label="母猪存栏">
|
|
|
<el-table-column
|
|
|
- label="存栏量">
|
|
|
+ label="存栏量"
|
|
|
+ prop="sowLivestock">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- label="省排名">
|
|
|
+ label="省排名"
|
|
|
+ prop="sowLivestockRank">
|
|
|
</el-table-column>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="eartagNew"
|
|
|
label="母猪存栏月增长">
|
|
|
<el-table-column
|
|
|
- label="存栏月环比增长量">
|
|
|
+ label="存栏月环比增长量"
|
|
|
+ prop="sowLivestockInc">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- label="省排名">
|
|
|
+ label="省排名"
|
|
|
+ prop="sowLivestockIncRank">
|
|
|
</el-table-column>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="eartagNew"
|
|
|
label="MSY">
|
|
|
<el-table-column
|
|
|
- label="MSY">
|
|
|
+ label="MSY"
|
|
|
+ prop="sowMsy">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- label="省排名">
|
|
|
+ label="省排名"
|
|
|
+ prop="sowMsyRank">
|
|
|
</el-table-column>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="eartagOffone"
|
|
|
+ prop="outStockCount"
|
|
|
label="今年累计出栏量">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="sowStock"
|
|
|
+ prop="outStockExpected"
|
|
|
label="预计年出栏量">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="stock1"
|
|
|
+ prop="ainOutStock"
|
|
|
label="目标年出栏量">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="stock2"
|
|
|
+ prop="finishPercent"
|
|
|
label="目标完成度">
|
|
|
</el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="操作"
|
|
|
+ width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button @click="handleEdit(scope.row)" type="text" size="small">编辑</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
|
<table-footer
|
|
|
:totals="totalPages"
|
|
|
:size="pageSize"
|
|
|
@sizeChange="sizeChange"
|
|
|
- @pageChange="pageChange"></table-footer>
|
|
|
+ @pageChange="pageChange">
|
|
|
+ </table-footer>
|
|
|
+ <!-- 对比框 -->
|
|
|
+ <div v-show="constrastShow" class="constrast_box">
|
|
|
+ <el-card style="height: 100%">
|
|
|
+ <div class="card_title">
|
|
|
+ <span>对比框({{constrastNum}}/8)</span>
|
|
|
+ <i class="el-icon-circle-close card_icon" @click="closeConstrast"></i>
|
|
|
+ </div>
|
|
|
+ <!-- 被选中的牧场 -->
|
|
|
+ <div class="card_body">
|
|
|
+ <ul class="card_ul">
|
|
|
+ <li
|
|
|
+ v-for="item in cardFarms"
|
|
|
+ :key="item.id">
|
|
|
+ {{ item.farmName }}
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ <div class="card_footer">
|
|
|
+ <el-button plain size="small" @click="handleClear">清 空</el-button>
|
|
|
+ <el-button type="primary" size="small" @click="handleConstrast">对 比</el-button>
|
|
|
+ </div>
|
|
|
+ </el-card>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <el-button @click="toCollectDay">每日汇总</el-button>
|
|
|
+ <update ref="update" @refreshData="init"></update>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -187,7 +224,8 @@ import lineChart from './charts/lineChart.vue'
|
|
|
import hisChart from './charts/hisChart.vue'
|
|
|
import areaZz from '../../components/areaZz.vue'
|
|
|
import TableFooter from "../../components/TableFooter"
|
|
|
-import {mapState, mapMutations} from 'vuex';
|
|
|
+import update from './update.vue'
|
|
|
+import { mapState, mapMutations } from 'vuex';
|
|
|
export default {
|
|
|
name: "collectData",
|
|
|
data () {
|
|
@@ -241,7 +279,10 @@ export default {
|
|
|
],
|
|
|
totalPages: 0,
|
|
|
pageNum: 1,
|
|
|
- pageSize: 20
|
|
|
+ pageSize: 20,
|
|
|
+ constrastNum: 0, // 对比框中的牧场数量
|
|
|
+ constrastShow: false, // 对比框是否显示
|
|
|
+ cardFarms: []
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -251,7 +292,8 @@ export default {
|
|
|
lineChart,
|
|
|
hisChart,
|
|
|
areaZz,
|
|
|
- TableFooter
|
|
|
+ TableFooter,
|
|
|
+ update
|
|
|
},
|
|
|
methods: {
|
|
|
...mapMutations(['updateSelected']),
|
|
@@ -326,24 +368,57 @@ export default {
|
|
|
init () {
|
|
|
this.$http({
|
|
|
url: this.$http.adornUrl(`http://192.168.1.171:8210/management/sowranktable/list`),
|
|
|
- method: 'post',
|
|
|
+ method: 'get',
|
|
|
data: this.$http.adornData({
|
|
|
'page': this.pageNum,
|
|
|
'limit': this.pageSize
|
|
|
})
|
|
|
- }).then(res => {
|
|
|
- // if(data.code === 0) {
|
|
|
- console.log(res);
|
|
|
- // this.tableData = data.
|
|
|
- // } else {
|
|
|
- // this.hisList = [];
|
|
|
- // }
|
|
|
+ }).then(({data}) => {
|
|
|
+ if(data.code === 0) {
|
|
|
+ this.tableData = data.page.list
|
|
|
+ } else {
|
|
|
+ this.hisList = [];
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
- // 点击表格的某一行
|
|
|
- rowClick (row) {
|
|
|
- console.log(row);
|
|
|
- console.log('点击了某一行');
|
|
|
+ // // 点击表格的某一行
|
|
|
+ // rowClick (row) {
|
|
|
+ // console.log(row);
|
|
|
+ // console.log('点击了某一行');
|
|
|
+ // },
|
|
|
+ // 牧场对比
|
|
|
+ selectFarm (val) {
|
|
|
+ this.constrastShow = true
|
|
|
+ this.constrastNum = val.length
|
|
|
+ this.cardFarms = val
|
|
|
+ if (this.constrastNum === 0) {
|
|
|
+ this.constrastShow = false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 关闭对比框
|
|
|
+ closeConstrast () {
|
|
|
+ this.constrastShow = false
|
|
|
+ },
|
|
|
+ // 清空牧场对比
|
|
|
+ handleClear () {
|
|
|
+ console.log('清空--------------------');
|
|
|
+ this.cardFarms = []
|
|
|
+ this.$refs.table.clearSelection()
|
|
|
+ },
|
|
|
+ // 进入 对比页面
|
|
|
+ handleConstrast () {
|
|
|
+ this.$router.push({
|
|
|
+ name: 'collectFarm',
|
|
|
+ params: {
|
|
|
+ row: this.cardFarms
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 表格 - 编辑 - 更新数据
|
|
|
+ handleEdit (row) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.update.init(row)
|
|
|
+ })
|
|
|
},
|
|
|
// 省市县
|
|
|
getCityCode (val) {
|
|
@@ -396,7 +471,7 @@ export default {
|
|
|
mounted() {
|
|
|
this.initEchart();
|
|
|
this.initCom();
|
|
|
- // this.init()
|
|
|
+ this.init()
|
|
|
},
|
|
|
}
|
|
|
</script>
|
|
@@ -429,7 +504,6 @@ export default {
|
|
|
margin: 10px;
|
|
|
margin-top: 20px;
|
|
|
border: 1px solid #ddd;
|
|
|
- height: 305px;
|
|
|
background-color: #fff;
|
|
|
}
|
|
|
|
|
@@ -487,6 +561,56 @@ export default {
|
|
|
box-sizing: border-box;
|
|
|
margin-top: 15px;
|
|
|
padding-right: 10px;
|
|
|
+ position: relative;
|
|
|
/*padding: 10px;*/
|
|
|
}
|
|
|
+
|
|
|
+/** 对比框 */
|
|
|
+.constrast_box {
|
|
|
+ width: 220px;
|
|
|
+ height: 340px;
|
|
|
+ position: absolute;
|
|
|
+ right: 50px;
|
|
|
+ top: 10%;
|
|
|
+ background-color: #fff;
|
|
|
+}
|
|
|
+/* 去除 el-card 自带的 padding */
|
|
|
+/deep/ .el-card__body {
|
|
|
+ padding: 0;
|
|
|
+}
|
|
|
+/* 对比框的 title */
|
|
|
+.card_title {
|
|
|
+ font-weight: 700;
|
|
|
+ font-size: 17px;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ justify-content: space-between;
|
|
|
+ background-color: #eee;
|
|
|
+ padding: 15px 20px;
|
|
|
+ border-bottom: 1px solid #ddd;
|
|
|
+}
|
|
|
+.card_icon {
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
+/* 对比框的 body */
|
|
|
+.card_body {
|
|
|
+ border-bottom: 1px solid #ddd;
|
|
|
+ height: 200px;
|
|
|
+}
|
|
|
+.card_ul {
|
|
|
+ text-decoration: none;
|
|
|
+ list-style: none;
|
|
|
+ padding-left: 30px;
|
|
|
+}
|
|
|
+.card_ul li {
|
|
|
+ margin-top: 5px;
|
|
|
+ font-size: 14px;
|
|
|
+}
|
|
|
+/* 对比框的底部按钮 */
|
|
|
+.card_footer {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ justify-content: space-around;
|
|
|
+ padding: 15px 20px;
|
|
|
+}
|
|
|
</style>
|