Browse Source

饲喂过程

epans 1 year ago
parent
commit
d9b25ec252
5 changed files with 272 additions and 192 deletions
  1. 3 2
      src/api/common.js
  2. 2 3
      src/main.js
  3. 4 3
      src/utils/request.js
  4. 137 124
      src/views/dataStatistics/FeedProcess.vue
  5. 126 60
      src/views/formulaPlan/FeedPlan.vue

+ 3 - 2
src/api/common.js

@@ -1,6 +1,7 @@
-import request from '@/utils/request'
- 
 
+
+
+import request from '@/utils/request'
  
 
 export function ajaxDataPost(url,data) {

+ 2 - 3
src/main.js

@@ -14,10 +14,9 @@ import axios from 'axios'
    //  axios.defaults.baseURL = 'http://192.168.1.96.8090'
  
 axios.defaults.baseURL = 'http://192.168.1.70:8087' //测试线
-  
- 
- 
+
  
+  
 //2、通过axios请求拦截器添加token 
 axios.interceptors.request.use(
   // config就是请求的对象

+ 4 - 3
src/utils/request.js

@@ -6,12 +6,13 @@ import { MessageBox, Message } from 'element-ui'
 // import store from '@/store'
 // import { getToken } from '@/utils/auth'
 
+
+axios.defaults.baseURL = 'http://192.168.1.70:8087' 
 // create an axios instance
 const service = axios.create({
   //baseURL: process.env.VUE_APP_BASE_API, // 根目录路径
- // baseURL: 'http://192.168.1.77:8092',
- 
-  baseURL: 'http://192.168.1.70:8087',
+  // baseURL: 'http://192.168.1.77:8092',
+  // baseURL: 'http://192.168.1.70:8087',
   
   //baseURL: 'http://192.168.1.96.8090',
   withCredentials: true, // send cookies when cross-domain requests

+ 137 - 124
src/views/dataStatistics/FeedProcess.vue

@@ -9,32 +9,35 @@
 
         <el-row :gutter="20">
             <el-col :span="24">
+              <el-date-picker v-model="searchData.date"  type="date"  placeholder="选择日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd"  :clearable="false" style="width: 180px;"  class="g-mr20  g-mb20" />
+ 
 
-              <el-select v-model="searchData.calf_category_id" filterable placeholder="饲喂计划" class="g-mr20  g-mb20" style="width: 180px;" clearable>
-                <el-option v-for="item in calfTypeList" :key="item.id" :label="item.name" :value="item.id" />
+              <el-select v-model="searchData.feed_plan_id" filterable placeholder="饲喂计划" class="g-mr20" style="width: 180px;" clearable>
+                <el-option v-for="item in feedPlanList" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
-              <el-select v-model="searchData.status" filterable placeholder="班次" class="g-mr20" style="width: 180px;" clearable>
-                <el-option v-for="item in statusList" :key="item.id" :label="item.value" :value="item.id" />
+              <el-select v-model="searchData.class_number" filterable placeholder="班次" class="g-mr20  g-mb20" style="width: 180px;" clearable>
+                <el-option v-for="item in classList" :key="item.value" :label="item.label" :value="item.value" />
               </el-select>
-              <el-select v-model="searchData.status" filterable placeholder="饲喂车" class="g-mr20" style="width: 180px;" clearable>
-                <el-option v-for="item in statusList" :key="item.id" :label="item.value" :value="item.id" />
+              <el-select v-model="searchData.feed_vehicle_id" filterable placeholder="饲喂车" class="g-mr20" style="width: 180px;" clearable  @change="change_car">
+                <el-option v-for="item in feedCarList" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
-              <el-input v-model="searchData.name" placeholder="饲喂车编号"  style="width: 180px;" disabled />
+              <span>饲喂车编号:</span>
+              <el-input v-model="searchData.carNum" placeholder=""  style="width: 180px;" disabled />
             </el-col>
         </el-row>
         <el-row :gutter="20">
             <el-col :span="24">
  
-                <el-input v-model="searchData.name" placeholder="栏舍名称"  style="width: 220px;" class="g-mr20  g-mb20" clearable />
-                <el-input v-model="searchData.name" placeholder="栏舍组名称"  style="width: 220px;" class="g-mr20 " clearable />
+                <el-input v-model="searchData.barn_name" placeholder="栏舍名称"  style="width: 220px;" class="g-mr20  g-mb20" clearable />
+                <el-input v-model="searchData.barn_group_name" placeholder="栏舍组名称"  style="width: 220px;" class="g-mr20 " clearable />
 
-                <el-input-number v-model="searchData.min_daily_age" style="width:120px;" :controls="false" placeholder="准确率" />
+                <el-input-number v-model="searchData.min_accurate_ratio" style="width:120px;" :controls="false" placeholder="准确率" />
                 <span style="margin:0px 8px;">至</span>
-                <el-input-number v-model="searchData.max_daily_age" style="width:120px;" class="g-mr20" :controls="false" placeholder="准确率" />
+                <el-input-number v-model="searchData.max_accurate_ratio" style="width:120px;" class="g-mr20" :controls="false" placeholder="准确率" />
 
-                <el-input-number v-model="searchData.min_daily_age" style="width:120px;" :controls="false" placeholder="温差" />
+                <el-input-number v-model="searchData.min_temp" style="width:120px;" :controls="false" placeholder="温差" />
                 <span style="margin:0px 8px;">至</span>
-                <el-input-number v-model="searchData.max_daily_age" style="width:120px;" class="g-mr20" :controls="false" placeholder="温差" />
+                <el-input-number v-model="searchData.max_temp" style="width:120px;" class="g-mr20" :controls="false" placeholder="温差" />
 
                 <el-button type="primary"   @click="form_search">搜索</el-button>
                 <el-button type="primary"   @click="form_clear">重置</el-button>
@@ -47,61 +50,77 @@
  
       <!-- 表格 -->
       <el-table   key="0"  :data="tableList"  v-loading="tableLoading" 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.name }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="犊牛数量" min-width="150px" align="center">
-          <template slot-scope="scope">
-            <span>{{ scope.row.number }}</span>
-          </template>
-        </el-table-column>
-         
- 
-        <!-- <el-table-column  label="状态"  min-width="100px" align="center">
-          <template slot-scope="scope">
-            <el-switch v-model="scope.row.mg_state" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0"   />
-          </template>
-        </el-table-column> -->
-
-        <el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width" fixed="right">
-          <template slot-scope="scope">
-             <!-- 修改按钮 -->
-             <el-button type="primary" size="mini" icon="el-icon-edit" @click="form_edit(scope.row)">修改</el-button>
-             <!-- 删除按钮 -->
-             <el-button type="danger" size="mini" icon="el-icon-delete" @click="form_delete(scope.row)">删除</el-button>
-          </template>
-        </el-table-column>
+                <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="120px" align="center" show-overflow-tooltip>
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.barn_name  }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="栏舍组名称" min-width="120px" align="center" show-overflow-tooltip>
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.barn_group_name  }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="开始日龄" min-width="120px" align="center" show-overflow-tooltip>
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.start_age  }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="结束日龄" min-width="120px" align="center" show-overflow-tooltip>
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.end_age  }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="计划量(kg)" min-width="120px" align="center" show-overflow-tooltip>
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.plan_feed_number  }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="实际量(kg)" min-width="120px" align="center" show-overflow-tooltip>
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.reality_feed_number  }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="误差量(kg)" min-width="120px" align="center" show-overflow-tooltip>
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.error_number  }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="准确率" min-width="120px" align="center" show-overflow-tooltip>
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.accurate_ratio  }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="计划温度°C" min-width="120px" align="center" show-overflow-tooltip>
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.plan_temp  }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="温差°C" min-width="120px" align="center" show-overflow-tooltip>
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.reality_temp - scope.row.plan_temp  }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="过程时间" min-width="120px" align="center" show-overflow-tooltip>
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.process_time  }}</span>
+                  </template>
+                </el-table-column>
+
       </el-table>
 
-      <!-- 分页区域 -->
-      <el-pagination  @size-change="change_size_page"  @current-change="change_current_page"  :current-page="searchData.page" :page-sizes="[1,5,10,20,30,50]"  :page-size="searchData.page_size" layout="total, prev, pager, next" :total="searchData.total"/>
-    </el-card>
+      <!-- 图表 -->
+      <div id="chartLine"  style="width: 100%;height:400px;"></div>
 
+   
+    </el-card>
 
-    <!-- 弹窗 新增or修改 -->
-    <el-dialog  :title="addFormTxt[addFormStatus]" :visible.sync="addFormShow" @close="add_dialog_close" width="50%">
-      <div class="">
-        <el-form  ref="addFormRef"  :rules="addFormRules"  :model="addForm"  label-position="right" label-width="100px"  style="width:50%;margin:0 auto 50px">
-            <el-form-item label="类型名称:" prop="name">
-                <el-input   v-model="addForm.name"  ></el-input>  
-            </el-form-item>
-           
-            
-        </el-form>
-        <div slot="footer" class="dialog-footer">
-          <el-button type="primary" @click="addFormStatus==='create'?add_dialog_save():edit_dialog_save()">确认</el-button>
-          <el-button @click="addFormShow = false">关闭</el-button>
-        </div>
-      </div>
-    </el-dialog>
 
+   
  
     
   </div>
@@ -124,13 +143,8 @@ export default {
  
 
       //接口 - 获取 - 表格
-      url_get_table:'/api/v1/ops/base_setting/calf_type/list',
-      //接口 - 新增 - 表格
-      url_add_table:'/api/v1/ops/base_setting/calf_type/add',  
-      //接口 - 修改 - 表格
-      url_edit_table:'/api/v1/ops/base_setting/calf_type/update', 
-      //接口 - 删除 - 表格
-      url_delete_table:'/api/v1/ops/base_setting/calf_type/is_show', 
+      url_get_table:'/api/v1/ops/statistics/feed_process',
+     
       
       //接口 - 下拉框 列表 
       url_get_select1:'/role/getAll',
@@ -140,7 +154,17 @@ export default {
 
       //获取 - 表格数据 - 参数
       searchData:{
-        name: "",
+        date: '',
+        feed_plan_id: undefined,
+        class_number: undefined,
+        feed_vehicle_id: undefined,
+        barn_name: "",
+        barn_group_name: "",
+        min_accurate_ratio: undefined,
+        max_accurate_ratio: undefined,
+        min_temp: undefined,
+        max_temp: undefined,
+ 
         page: 1,  //页码
         page_size: 10,   //每页数量
         total:0,  //总页数
@@ -165,30 +189,21 @@ export default {
 
 
       
-      pastureList:[
+      feedPlanList:[
     
       ],
-
+      classList:[
     
+      ],
+      feedCarList:[
+    
+    ],
+  
 
  
 
 
-      addFormShow:false,
-      addFormStatus: '',
-      addFormTxt: {  edit: '修改',  create: '新增' },
-      addForm:{
-        name:'',id:'' 
-      },
-
-      addFormRules:{
-        name: [
-          { required: true, message: '类型必填', trigger: 'blur' },
-        ],
-   
-
-      },
-
+    
      
        
     }
@@ -199,7 +214,7 @@ export default {
      
 
      //获取下拉框
-     // this.get_select_list1()
+      this.get_select_list1()
 
       //表格 - 初始化 
       this.get_table_data()
@@ -220,37 +235,54 @@ export default {
     //获取 下拉框
     get_select_list1(){
         var me = this
-        ajaxDataGet(me.url_get_select1, {"roleName": "",  "page": 1,   "page_size": 1000}).then(e => {
-          console.log("下拉框1:",e)
+        ajaxDataPost('/api/v1/ops/formula_plan/list?page=1&page_size=1000', { }).then(e => {
+          console.log("饲喂下拉框:",e)
 
           //打印请求成功结果
-          if(e.data == null || e.data == undefined ||e.data.length == 0   ){
-            me.roleList = []
+          if(e.code === 200){
+            me.feedPlanList = e.data.list
           } else {
-            me.roleList = e.data
+            me.feedPlanList = []
           }
-
-         
-  
+ 
         })
 
 
-        ajaxDataGet('/authdata/pasture', {  "page": 1,   "page_size": 1000}).then(e => {
-          console.log("牧场下拉框1:",e)
+        // 班次下拉框
+        ajaxDataGet('/api/v1/ops/calf_feed/enum/list').then(e => {
+          console.log("班次下拉框:",e)
+          if(e.code === 200){
+            me.classList = e.data.class_list
+          } else {
+            me.classList = []
+          }
+        })
 
+        ajaxDataPost('/api/v1/ops/base_setting/feed_vehicle/list?page=1&page_size=1000', { }).then(e => {
+          console.log("饲喂车下拉框:",e)
           //打印请求成功结果
-          if(e.data == null || e.data == undefined ||e.data.length == 0   ){
-            me.pastureList = []
+          if(e.code === 200){
+            me.feedCarList = e.data.list
           } else {
-            me.pastureList = e.data
+            me.feedCarList = []
           }
-  
+ 
         })
 
+     
+
+     
+
     
     },
 
-    
+    change_car(item){
+      var me = this
+      console.log(item)
+      var carNum = me.feedCarList.find(obj => obj.id == item).number
+      console.log(carNum)
+      me.searchData.carNum = carNum
+    },
     //获取 表格
     get_table_data() {
  
@@ -259,7 +291,7 @@ export default {
      me.tableLoading = true
      console.log("searchData======>", me.searchData)
 
-      var send_url = me.url_get_table + '?page=' + me.searchData.page +  '&page_size=' + me.searchData.page_size
+      var send_url = me.url_get_table + '?page=1&page_size=1000'
 
       ajaxDataPost(send_url,  me.searchData).then(e => {
         console.log("表格请求结果:",e)
@@ -296,25 +328,6 @@ export default {
       me.searchData.name = ""
       me.get_table_data()
     },
-
-    //监听 page_size 改变的事件
-    change_size_page(item){
-      console.log(item)
-     // this.searchData.page_size = item
-      //  this.getUserList()
-    },
-
-    //监听 page 改变的事件
-    change_current_page(item){
-      console.log(item)
-       this.searchData.page = item
-       this.get_table_data()
-    },
-
-    //清空弹窗表单信息
-    reset_form(){
-      this.addForm.name = ''
-    },
  
 
     

+ 126 - 60
src/views/formulaPlan/FeedPlan.vue

@@ -152,7 +152,7 @@
             </el-row>
             <el-row :gutter="20">
               <el-col :span="12">
-                <el-table ref="multipleTable1"  key="0"  :data="barnGroupTableList"  element-loading-text="给我一点时间"  highlight-current-row  @selection-change="change_barn_group_selection"   border fit >
+                <el-table ref="multipleTable1"  row-key="id"  :data="barnGroupTableList"  element-loading-text="给我一点时间"  highlight-current-row  @selection-change="change_barn_group_selection"   border fit >
                   <el-table-column   type="selection"    width="55">  </el-table-column>
                   <el-table-column label="栏舍组名称" min-width="150px" align="center">
                     <template slot-scope="scope">
@@ -161,13 +161,14 @@
                   </el-table-column>
                   <el-table-column label="犊牛数量" min-width="150px" align="center">
                     <template slot-scope="scope">
-                      <span>{{ scope.row.number }}</span>
+                      <span v-if ="scope.row.status == 4">0</span>
+                      <span v-else>1</span>
                     </template>
                   </el-table-column>
                 </el-table>
               </el-col>
               <el-col :span="12">
-                <el-table  ref="multipleTable2"  row-key="id"  :data="barnTableList"  element-loading-text="给我一点时间"  @selection-change="change_barn_selection"    
+                <el-table  ref="multipleTable2"  row-key="id"  :data="barnTableList"  element-loading-text="给我一点时间"  highlight-current-row  @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">
@@ -556,23 +557,23 @@ export default {
     //新增
     form_add() {
      
-      this.addFormStatus = 'create'
-      this.addFormShow = true
-      this.$nextTick(() => {
-        this.$refs['addFormRef'].clearValidate()
-      })
-
       
+
       this.barnGroupArr = []
       this.barnArr = []
       this.barnGroupIdsArr = []
       this.barnIdsArr = []
       this.barnTableList = []
 
- 
-      this.$refs.multipleTable1.clearSelection()
-      this.$refs.multipleTable2.clearSelection()
+      this.addFormStatus = 'create'
+      this.addFormShow = true
+      this.$nextTick(() => {
+        this.$refs['addFormRef'].clearValidate()
+        this.$refs.multipleTable1.clearSelection()
+         this.$refs.multipleTable2.clearSelection()
+      })
 
+ 
 
       this.reset_form()
        
@@ -585,6 +586,12 @@ export default {
 
     //编辑
     form_edit(row) {
+      var me = this
+
+    
+     
+
+      this.reset_form()
 
       this.barnGroupArr = []
       this.barnArr = []
@@ -593,19 +600,68 @@ export default {
       this.barnTableList = []
 
  
-      this.$refs.multipleTable1.clearSelection()
-      this.$refs.multipleTable2.clearSelection()
-      this.reset_form()
+     
+      this.$nextTick(() => {
+        this.$refs['addFormRef'].clearValidate()
+        this.$refs.multipleTable1.clearSelection()
+         this.$refs.multipleTable2.clearSelection()
+      })
+
+
+    
+
       //编辑行内容赋值
       this.addForm = Object.assign({}, row)
-      if(row.genders === 0){
-        this.addForm.genders = undefined
+
+      var feed_time = "Sat Oct 07 2023 "+row.feed_time+" GMT+0800 (中国标准时间)"
+      this.addForm.feed_time = new Date(feed_time)
+      console.log( this.addForm.feed_time)
+      var barnGroupIdsArr = row.barn_group_ids
+      var barnIdsArr = row.barn_ids
+
+      var barnTableList = []
+      me.barnGroupIdsArr = barnGroupIdsArr
+
+      me.barnGroupIdsArr = barnGroupIdsArr
+      me.barnIdsArr = barnIdsArr
+
+      
+
+       // 查询栏舍组下的所有栏舍数据
+       if(barnGroupIdsArr.length > 0) {
+          this.$nextTick(() => {
+
+            for(let i = 0; i<me.barnGroupTableList.length;i++){
+              for(let j = 0; i<barnGroupIdsArr.length;i++){
+                if(me.barnGroupTableList[i].id == barnGroupIdsArr[i]){
+                  me.$refs['multipleTable1'].toggleRowSelection(me.barnGroupTableList[i])
+                }
+              }
+            }
+        
+          })
+          
+
+          ajaxDataPost('/api/v1/ops/barn/list/ids',{ids:barnGroupIdsArr}).then(e => {
+            if(e.code === 200) {
+              me.barnTableList = e.data.list
+                for(let i = 0; i<me.barnTableList.length;i++){
+                    for(let j = 0; i< barnIdsArr.length;i++){
+                      if(me.barnTableList[i].id ==  barnIdsArr[i]){
+                        me.$refs['multipleTable2'].toggleRowSelection(me.barnTableList[i])
+                      }
+                    }
+                  }
+  
+            }
+          })
       }
+
+     
+          
       this.addFormStatus = 'edit'
       this.addFormShow = true
-      this.$nextTick(() => {
-        this.$refs['addFormRef'].clearValidate()
-      })
+     
     },
 
     //新增关闭
@@ -621,9 +677,9 @@ export default {
         //验证成功
         if (valid) {
           //发起请求
-          
+          console.log('新增保存me.addForm',me.addForm)
 
-          console.log('新增保存',send_data)
+          console.log('新增保存send_data',send_data)
 
           console.log('新增保存 barnGroupArr', me.barnGroupArr)
           console.log('新增保存 barnArr', me.barnArr)
@@ -691,31 +747,54 @@ export default {
         //验证成功
         if (valid) {
           //发起请求
-          var send_data = {
 
-              "id": me.addForm.id,
-              "barn_id": me.addForm.barn_id,
-              "calf_code": me.addForm.calf_code,
-              "calf_category_id": me.addForm.calf_category_id,
-              "birth_weight": parseFloat(me.addForm.birth_weight) ,
-              "genders": me.addForm.genders,
-              "current_weight":parseFloat(me.addForm.current_weight) ,
-              "mother_code": me.addForm.mother_code,
-              "remark": me.addForm.remark,
-              // "birth_date":parseTime(me.addForm.birth_date_format, '{y}-{m}-{d} {h}:{i}:{s}'),
-              "birth_date_format":parseTime(me.addForm.birth_date_format, '{y}-{m}-{d} {h}:{i}:{s}'),
+          var  barnGroupIdsArr = []
+          var  barnIdsArr = []
+          var barnArrTemp = []
+
+          me.barnArr.forEach(function(item){
+            me.barnGroupArr.forEach(function(items){
+              if(item.barn_group_id == items.id){
+                barnArrTemp.push(item)
+              }
+            }) 
+          })
+
+          console.log('新增保存 有组别的栏舍 barnArrTemp', barnArrTemp)
+          me.barnGroupArr.forEach(function(items){
+            barnGroupIdsArr.push(items.id)
+          }) 
+          barnArrTemp.forEach(function(items){
+            barnIdsArr.push(items.id)
+          }) 
+
+          var send_data = {
+            "id": me.addForm.id,
+            "name": me.addForm.name,
+            "class_number": parseFloat(me.addForm.class_number),
+            "formula_id":parseFloat(me.addForm.formula_id),
+            "formula_name": me.addForm.formula_name,
+            "feed_vehicle_id": parseFloat(me.addForm.feed_vehicle_id) ,
+            "feed_vehicle_name": me.addForm.feed_vehicle_name,
+            "status": parseFloat(me.addForm.status) ,
+            "feed_time": parseTime(me.addForm.feed_time, '{h}:{i}:{s}'), 
+            "barn_group_ids":barnGroupIdsArr,
+            "barn_ids":barnIdsArr,
           }
+ 
 
-          // var name = this.barnGroupList.find(obj => obj.id == me.addForm.barn_group_id).name
-          // console.log(name)
+       
+
+          console.log('编辑保存 barnGroupArr', me.barnGroupArr)
+          console.log('编辑保存 barnArr', me.barnArr)
 
            // 编辑保存
           console.log("弹窗参数:", send_data)
 
           //关闭弹窗
           // me.addFormShow = false
-         //加载 - 发送新增保存
-         ajaxDataPut(me.url_edit_table, send_data).then(e => {
+          //加载 - 发送新增保存
+            ajaxDataPut(me.url_edit_table, send_data).then(e => {
                 console.log("编辑结果:",e)
                 //打印请求成功结果
                 if(e.code == 200  ){
@@ -776,37 +855,24 @@ export default {
       console.log("选中的栏舍组数组", me.barnGroupArr)
   
     
-     
-      me.barnIdsArrAll = []
+     var barnGroupIdsArr = []
+    
       val.forEach(function (item,index) {
-        item.barns.forEach(function (v,k){
-          me.barnIdsArrAll.push(v)
-        })
+        barnGroupIdsArr.push(item.id)
+        
       })
+      me.barnGroupIdsArr = barnGroupIdsArr
 
       
-      console.log("选中的栏舍组里所有栏舍ID",me.barnIdsArrAll)
+    
       // me.$refs.multipleTable2.clearSelection()
 
       // 查询栏舍组下的所有栏舍数据
-      if(me.barnIdsArrAll.length > 0) {
-        ajaxDataPost('/api/v1/ops/barn/list/ids',{ids:me.barnIdsArrAll}).then(e => {
+      if(barnGroupIdsArr.length > 0) {
+        ajaxDataPost('/api/v1/ops/barn/list/ids',{ids:barnGroupIdsArr}).then(e => {
           if(e.code === 200) {
             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])
-            //     }
-            //   }
-            // }
-
-            
-
-
-
+ 
           }
         })
       }