|
@@ -15,7 +15,7 @@
|
|
<el-input v-model="searchData.barn_name" placeholder="饲喂栏舍" style="width: 180px;" class="g-mr20" clearable />
|
|
<el-input v-model="searchData.barn_name" placeholder="饲喂栏舍" style="width: 180px;" class="g-mr20" clearable />
|
|
<el-button type="primary" @click="form_search">搜索</el-button>
|
|
<el-button type="primary" @click="form_search">搜索</el-button>
|
|
<el-button type="primary" @click="form_clear">重置</el-button>
|
|
<el-button type="primary" @click="form_clear">重置</el-button>
|
|
- <el-button type="primary" @click="form_add">添加</el-button>
|
|
|
|
|
|
+ <el-button type="primary" @click="form_add">添加车次</el-button>
|
|
<!-- <el-button type="primary" @click="form_export">导出</el-button> -->
|
|
<!-- <el-button type="primary" @click="form_export">导出</el-button> -->
|
|
</div>
|
|
</div>
|
|
<!-- 表格 -->
|
|
<!-- 表格 -->
|
|
@@ -53,8 +53,9 @@
|
|
|
|
|
|
<el-table-column label="配方模板" min-width="150px" align="center">
|
|
<el-table-column label="配方模板" min-width="150px" align="center">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <span>{{ scope.row.formula_name }}</span>
|
|
|
|
|
|
+ <el-button type="primary" size="mini" icon="el-icon-edit" @click="form_record_see(scope.row)">{{ scope.row.formula_name }}</el-button>
|
|
</template>
|
|
</template>
|
|
|
|
+
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="饲喂时间" min-width="150px" align="center">
|
|
<el-table-column label="饲喂时间" min-width="150px" align="center">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
@@ -142,10 +143,16 @@
|
|
<el-time-picker v-model="addForm.feed_time" format='HH:mm:ss' type="time" placeholder="选择日期" style="width: 80%;" :clearable="false" />
|
|
<el-time-picker v-model="addForm.feed_time" format='HH:mm:ss' type="time" placeholder="选择日期" style="width: 80%;" :clearable="false" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="车次状态:" prop="status">
|
|
|
|
+ <el-switch v-model="addForm.status" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="2" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+
|
|
</el-row>
|
|
</el-row>
|
|
<el-row :gutter="20">
|
|
<el-row :gutter="20">
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
- <el-table ref="multipleTable1" key="0" :data="selectBarnGroupList" element-loading-text="给我一点时间" @selection-change="change_barn_group_selection" border fit >
|
|
|
|
|
|
+ <el-table ref="multipleTable1" key="0" :data="barnGroupTableList" element-loading-text="给我一点时间" highlight-current-row @selection-change="change_barn_group_selection" @current-change="change_barn_group_now" border fit >
|
|
<el-table-column type="selection" width="55"> </el-table-column>
|
|
<el-table-column type="selection" width="55"> </el-table-column>
|
|
<el-table-column label="栏舍组名称" min-width="150px" align="center">
|
|
<el-table-column label="栏舍组名称" min-width="150px" align="center">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
@@ -160,8 +167,9 @@
|
|
</el-table>
|
|
</el-table>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
- <el-table ref="multipleTable2" key="0" :data="selectBarnList" element-loading-text="给我一点时间" @selection-change="change_barn_selection" border fit >
|
|
|
|
- <el-table-column type="selection" width="55"> </el-table-column>
|
|
|
|
|
|
+ <el-table ref="multipleTable2" row-key="id" :data="barnTableList" element-loading-text="给我一点时间" @selection-change="change_barn_selection"
|
|
|
|
+ border fit >
|
|
|
|
+ <el-table-column type="selection" :reserve-selection=true width="55"> </el-table-column>
|
|
<el-table-column label="栏舍名称" min-width="150px" align="center">
|
|
<el-table-column label="栏舍名称" min-width="150px" align="center">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.name }}</span>
|
|
<span>{{ scope.row.name }}</span>
|
|
@@ -183,6 +191,88 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <el-dialog title="配方模板" :visible.sync="seeFormShow" @close="see_dialog_close" width="80%">
|
|
|
|
+ <div class="">
|
|
|
|
+ <div class="search-bx1">
|
|
|
|
+
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <el-table key="0" :data="tableList2" v-loading="tableLoading2" element-loading-text="给我一点时间" border fit>
|
|
|
|
+ <el-table-column label="阶段" width="50px" align="center">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <span>{{ scope.row.id }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="开始日龄" min-width="150px" align="center">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <span>{{ scope.row.start_daily_age }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="结束日龄" min-width="150px" align="center">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <span>{{ scope.row.end_daily_age }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="饲料类型" min-width="150px" align="center">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <span>{{ scope.row.forage_name }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="日饲喂量(kg)" min-width="150px" align="center">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <span>{{ scope.row.daily_feed_number }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="第一班占比(%)" min-width="150px" align="center">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <span>{{ scope.row.first_class_ratio }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="第二班占比(%)" min-width="150px" align="center">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <span>{{ scope.row.second_class_ratio }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="第三班占比(%)" min-width="150px" align="center">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <span>{{ scope.row.third_class_ratio }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="第四班占比(%)" min-width="150px" align="center">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <span>{{ scope.row.fourth_class_ratio }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="班次允许误差(kg)" min-width="150px" align="center">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <span>{{ scope.row.allow_class_error }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="饲喂温度℃" min-width="150px" align="center">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <span>{{ scope.row.feed_temp }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="允许温差℃" min-width="150px" align="center">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <span>{{ scope.row.allow_temp_error }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ </el-table>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
+ <el-button @click="seeFormShow = false">关闭</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -276,11 +366,28 @@ export default {
|
|
// ],
|
|
// ],
|
|
},
|
|
},
|
|
barnIds:[],
|
|
barnIds:[],
|
|
- selectBarnGroupList:[],
|
|
|
|
- selectBarnList:[],
|
|
|
|
|
|
+ barnGroupTableList:[],
|
|
|
|
+ barnTableList:[],
|
|
|
|
|
|
barnGroupIdsArr:[],
|
|
barnGroupIdsArr:[],
|
|
barnIdsArr:[],
|
|
barnIdsArr:[],
|
|
|
|
+
|
|
|
|
+ //选中的栏舍树包含所有栏舍
|
|
|
|
+ barnGroupTree:[],
|
|
|
|
+ //选中的栏舍树只包含选中栏舍
|
|
|
|
+ barnGroupTreeSelect:[],
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ tableLoading2: false,
|
|
|
|
+ //表格内容
|
|
|
|
+ tableList2:[],
|
|
|
|
+ seeFormShow:false,
|
|
|
|
+ seeFormStatus: '',
|
|
|
|
+ seeFormTxt: { edit: '修改', create: '新增' },
|
|
|
|
+ seeForm:{
|
|
|
|
+ name:'',id:''
|
|
|
|
+ },
|
|
|
|
+
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created(){
|
|
created(){
|
|
@@ -345,7 +452,7 @@ export default {
|
|
//栏舍组表格
|
|
//栏舍组表格
|
|
ajaxDataPost('/api/v1/ops/barn_group/list?page=1&page_size=1000', {name:""}).then(e => {
|
|
ajaxDataPost('/api/v1/ops/barn_group/list?page=1&page_size=1000', {name:""}).then(e => {
|
|
if(e.code === 200 ){
|
|
if(e.code === 200 ){
|
|
- me.selectBarnGroupList = e.data.list
|
|
|
|
|
|
+ me.barnGroupTableList = e.data.list
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -385,7 +492,7 @@ export default {
|
|
me.searchData.formula_name = ""
|
|
me.searchData.formula_name = ""
|
|
me.searchData.barn_name = ""
|
|
me.searchData.barn_name = ""
|
|
me.searchData.barn_group_name = ""
|
|
me.searchData.barn_group_name = ""
|
|
- me.searchData.status = undefined
|
|
|
|
|
|
+ me.searchData.status =
|
|
me.get_table_data()
|
|
me.get_table_data()
|
|
},
|
|
},
|
|
|
|
|
|
@@ -413,6 +520,37 @@ export default {
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ form_record_see(row) {
|
|
|
|
+ var me = this
|
|
|
|
+ console.log('行内容row=========', row)
|
|
|
|
+ //编辑行内容赋值
|
|
|
|
+ this.seeForm = Object.assign({}, row)
|
|
|
|
+
|
|
|
|
+ this.seeFormShow = true
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ ajaxDataGet('/api/v1/ops/formula_plan/formula/'+row.formula_id, { }).then(e => {
|
|
|
|
+ console.log("配方模板:",e)
|
|
|
|
+
|
|
|
|
+ //打印请求成功结果
|
|
|
|
+ if(e.data.list == null || e.data.list == undefined ||e.data.list.length == 0 ){
|
|
|
|
+ me.tableList2 = []
|
|
|
|
+ } else {
|
|
|
|
+ me.tableList2 = e.data.list
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ //新增关闭
|
|
|
|
+ see_dialog_close(){
|
|
|
|
+ //内容重置
|
|
|
|
+ this.seeFormShow = false
|
|
|
|
+ },
|
|
|
|
+
|
|
//新增
|
|
//新增
|
|
form_add() {
|
|
form_add() {
|
|
this.reset_form()
|
|
this.reset_form()
|
|
@@ -466,26 +604,28 @@ export default {
|
|
"feed_vehicle_id": parseFloat(me.addForm.feed_vehicle_id) ,
|
|
"feed_vehicle_id": parseFloat(me.addForm.feed_vehicle_id) ,
|
|
"feed_vehicle_name": me.addForm.feed_vehicle_name,
|
|
"feed_vehicle_name": me.addForm.feed_vehicle_name,
|
|
"status": parseFloat(me.addForm.status) ,
|
|
"status": parseFloat(me.addForm.status) ,
|
|
- "feed_time": me.addForm.feed_time,
|
|
|
|
|
|
+ "feed_time": parseTime(me.addForm.feed_time, '{h}:{i}:{s}'),
|
|
"barn_group_ids":me.barnGroupIdsArr,
|
|
"barn_group_ids":me.barnGroupIdsArr,
|
|
"barn_ids":me.barnIdsArr,
|
|
"barn_ids":me.barnIdsArr,
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ console.log('新增保存',send_data)
|
|
|
|
|
|
//关闭弹窗
|
|
//关闭弹窗
|
|
- me.addFormShow = false
|
|
|
|
|
|
+ // me.addFormShow = false
|
|
//加载 - 发送新增保存
|
|
//加载 - 发送新增保存
|
|
- ajaxDataPost(me.url_add_table, send_data).then(e => {
|
|
|
|
- console.log("新增结果:",e)
|
|
|
|
- //打印请求成功结果
|
|
|
|
- if(e.code == 200 ){
|
|
|
|
- me.$message({ type: 'success', message: '新增成功!' , duration: 2000 })
|
|
|
|
- //关闭弹窗
|
|
|
|
- me.addFormShow = false
|
|
|
|
- me.get_table_data()
|
|
|
|
- } else {
|
|
|
|
- me.$message({ type: 'error', message: '新增失败!' + e.msg, duration: 2000 })
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ // ajaxDataPost(me.url_add_table, send_data).then(e => {
|
|
|
|
+ // console.log("新增结果:",e)
|
|
|
|
+ // //打印请求成功结果
|
|
|
|
+ // if(e.code == 200 ){
|
|
|
|
+ // me.$message({ type: 'success', message: '新增成功!' , duration: 2000 })
|
|
|
|
+ // //关闭弹窗
|
|
|
|
+ // me.addFormShow = false
|
|
|
|
+ // me.get_table_data()
|
|
|
|
+ // } else {
|
|
|
|
+ // me.$message({ type: 'error', message: '新增失败!' + e.msg, duration: 2000 })
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
|
|
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -572,11 +712,13 @@ export default {
|
|
|
|
|
|
|
|
|
|
},
|
|
},
|
|
-
|
|
|
|
|
|
+ //栏舍组选择
|
|
change_barn_group_selection(val){
|
|
change_barn_group_selection(val){
|
|
- console.log(val)
|
|
|
|
|
|
+ console.log("选中的数组", val)
|
|
var me = this
|
|
var me = this
|
|
var barnGroupIdsArr = []
|
|
var barnGroupIdsArr = []
|
|
|
|
+
|
|
|
|
+
|
|
val.forEach(function (item,index) {
|
|
val.forEach(function (item,index) {
|
|
barnGroupIdsArr.push(item.id)
|
|
barnGroupIdsArr.push(item.id)
|
|
|
|
|
|
@@ -584,6 +726,9 @@ export default {
|
|
me.barnGroupIdsArr = barnGroupIdsArr
|
|
me.barnGroupIdsArr = barnGroupIdsArr
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
me.barnIds = []
|
|
me.barnIds = []
|
|
val.forEach(function (item,index) {
|
|
val.forEach(function (item,index) {
|
|
item.barns.forEach(function (v,k){
|
|
item.barns.forEach(function (v,k){
|
|
@@ -591,16 +736,40 @@ export default {
|
|
})
|
|
})
|
|
})
|
|
})
|
|
|
|
|
|
- // 栏舍数据
|
|
|
|
|
|
+ console.log("选中的栏舍组",me.barnGroupIdsArr)
|
|
|
|
+ console.log("选中的栏舍",me.barnIdsArr)
|
|
|
|
+
|
|
|
|
+ // 查询栏舍组下的所有栏舍数据
|
|
if(me.barnIds.length > 0) {
|
|
if(me.barnIds.length > 0) {
|
|
ajaxDataPost('/api/v1/ops/barn/list/ids',{ids:me.barnIds}).then(e => {
|
|
ajaxDataPost('/api/v1/ops/barn/list/ids',{ids:me.barnIds}).then(e => {
|
|
if(e.code === 200) {
|
|
if(e.code === 200) {
|
|
- me.selectBarnList = e.data.list
|
|
|
|
|
|
+ me.barnTableList = e.data.list
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // for(let i = 0; i<me.barnTableList.length;i++){
|
|
|
|
+ // for(let j = 0; i<me.barnIdsArr.length;i++){
|
|
|
|
+ // if(me.barnTableList[i].id == me.barnIdsArr[i]){
|
|
|
|
+ // me.$refs.multipleTable2.toggleRowSelection(me.barnTableList[i])
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+
|
|
|
|
+ change_barn_group_now(val) {
|
|
|
|
+ this.currentRow = val;
|
|
|
|
+ console.log("currentRow==========",this.currentRow)
|
|
|
|
+ },
|
|
|
|
+
|
|
change_barn_selection(val){
|
|
change_barn_selection(val){
|
|
var me = this
|
|
var me = this
|
|
this.selectList2 = val
|
|
this.selectList2 = val
|