e 4 gadi atpakaļ
vecāks
revīzija
d2fe5a86c1

+ 2 - 1
.eslintrc.js

@@ -5,7 +5,7 @@ module.exports = {
   },
   extends: ['plugin:vue/essential'],
   rules: {
-    'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
+    'no-console': process.env.NODE_ENV === 'production',
     'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
   },
   parserOptions: {
@@ -16,3 +16,4 @@ module.exports = {
     'AMapUI': false
   }
 }
+

+ 8 - 8
src/views/Home/Home.vue

@@ -53,7 +53,7 @@
                         text-color="#fff"
                         active-text-color="#ffd04b"
                     >
-                        <div v-for="(item, index1) in menu " :key="index1">
+                        <div v-for="(item, index1) in menuData " :key="index1">
                             <el-submenu
                                 v-if="item.children && item.children.length > 0"
                                 :index="`${index1}`"
@@ -96,16 +96,16 @@
 </template>
 
 <script>
-// import { menuData } from "./mencCofig.js";
+import { menuData } from "./mencCofig.js";
 import { mapState } from 'vuex';
 
 export default {
     data() {
         return {
             // 菜单配置
-            menuData: [],
+            menuData: menuData,
             menuCollapse: false, //是否水平折叠收起菜单
-            defaultUnfoldedMenu: '', // 默认展开第一项
+            defaultUnfoldedMenu: [menuData[0], 1], // 默认展开第一项
         };
     },
     created() {
@@ -117,12 +117,12 @@ export default {
     },
     computed: {
       ...mapState(['typeCode']),
-      menu() {
-        return this.menuData
-      }
+      // menu() {
+      //   return this.menuData
+      // }
     },
     mounted() {
-        this.init();
+        // this.init();
         // 获取员工列表 给后面下拉选择器使用
         this.$store.dispatch('getWorkerList')
         // 获取栋舍列表 给后面下拉选择器使用

+ 140 - 140
src/views/Home/mencCofig.js

@@ -1,222 +1,222 @@
 
 export const menuData = [
     {
-        optionName: "档案信息",
+        menuName: "档案信息",
         iconClassName: "el-icon-files",
         disabled: false, // 是否禁用
-        childList: [
-            {
-                optionName: '企业信息',
-                routerName: "firmInfo"
-            },
-            {
-                optionName: '牧场信息',
-                routerName: "pastureInfo"
+        children: [
+            // {
+            //     menuName: '企业信息',
+            //     url: "firmInfo"
+            // },
+            {
+                menuName: '牧场信息',
+                url: "pastureInfo"
             },
             {
-                optionName: '栋舍信息',
-                routerName: "areaInfo"
+                menuName: '栋舍信息',
+                url: "areaInfo"
             },
             {
-                optionName: '员工信息',
-                routerName: "workerInfo"
+                menuName: '员工信息',
+                url: "workerInfo"
             }
         ]
     },
     {
-        optionName: "繁殖管理",
+        menuName: "繁殖管理",
         iconClassName: "el-icon-magic-stick",
         disabled: false, // 是否禁用
-        childList: [
+        children: [
             {
-                optionName: '种羊档案',
-                routerName: "seedSheepFile"
+                menuName: '种羊档案',
+                url: "seedSheepFile"
             },
             {
-                optionName: '商品羊档案',
-                routerName: "commoditySheepFile"
+                menuName: '商品羊档案',
+                url: "commoditySheepFile"
             },
             {
-                optionName: '采精记录',
-                routerName: "collectSeedLog"
+                menuName: '采精记录',
+                url: "collectSeedLog"
             },
             {
-                optionName: '查情记录',
-                routerName: "matingSuccLog"
+                menuName: '查情记录',
+                url: "matingSuccLog"
             },
             {
-                optionName: '配种记录',
-                routerName: "matingLog"
+                menuName: '配种记录',
+                url: "matingLog"
             },
             {
-                optionName: '妊检记录',
-                routerName: "pregnancyTestLog"
+                menuName: '妊检记录',
+                url: "pregnancyTestLog"
             },
             {
-                optionName: '分娩记录',
-                routerName: "parturitionLog"
+                menuName: '分娩记录',
+                url: "parturitionLog"
             },
             {
-                optionName: '断奶记录',
-                routerName: "weaningLog"
+                menuName: '断奶记录',
+                url: "weaningLog"
             },
             {
-                optionName: '离场记录',
-                routerName: "offFieldLog"
+                menuName: '离场记录',
+                url: "offFieldLog"
             },
             {
-                optionName: '转舍记录',
-                routerName: "shiftFieldLog"
+                menuName: '转舍记录',
+                url: "shiftFieldLog"
             }
         ]
     },
     {
-        optionName: "防疫管理",
+        menuName: "防疫管理",
         iconClassName: "el-icon-s-flag",
         disabled: false,
-        childList: [
+        children: [
             {
-                optionName: '免疫程序',
-                routerName: "immuneProce"
+                menuName: '免疫程序',
+                url: "immuneProce"
             },
             {
-                optionName: '免疫计划',
-                routerName: "immunePlan"
+                menuName: '免疫计划',
+                url: "immunePlan"
             },
             {
-                optionName: '免疫记录',
-                routerName: "immuneLog"
+                menuName: '免疫记录',
+                url: "immuneLog"
             },
             {
-                optionName: '疾病登记',
-                routerName: "illnessLog"
+                menuName: '疾病登记',
+                url: "illnessLog"
             }
         ]
     },
 
     {
-        optionName: "生产管理",
+        menuName: "生产管理",
         iconClassName: "el-icon-first-aid-kit",
         disabled: false,
-        childList: [
-            {
-                optionName: '批次管理',
-                routerName: "batch"
-            },
-            {
-                optionName: '生产预警',
-                routerName: "productionWarn"
-            },
-            {
-                optionName: '调拨转舍',
-                routerName: "shiftField"
-            },
+        children: [
             {
-                optionName: '死淘管理',
-                routerName: "dieWeedOut"
+                menuName: '批次管理',
+                url: "batch"
             },
             {
-                optionName: '耳标管理',
-                routerName: "earTag"
-            },
-            {
-                optionName: '检测报告',
-                routerName: "examiningReport"
-            }
-           
-        ]
-    },
-    {
-        optionName: "无害化管理",
-        iconClassName: "el-icon-set-up",
-        disabled: false,
-        childList: [
-            {
-                optionName: '无害化确认',
-                routerName: "harmlessConfirm"
+                menuName: '生产预警',
+                url: "productionWarn"
             },
             {
-                optionName: '智能提醒',
-                routerName: "intelligentHint"
-            }
-        ]
-    },
-    {
-        optionName: "物料管理",
-        iconClassName: "el-icon-news",
-        disabled: false,
-        childList: [
-            {
-                optionName: '基础信息',
-                routerName: "basicsInfo"
+                menuName: '调拨转舍',
+                url: "shiftField"
             },
             {
-                optionName: '物料入库',
-                routerName: "materialInStore"
+                menuName: '死淘管理',
+                url: "dieWeedOut"
             },
             {
-                optionName: '物料出库',
-                routerName: "materialOutStore"
+                menuName: '耳标管理',
+                url: "earTag"
             },
             {
-                optionName: '库存盘点',
-                routerName: "storeList"
+                menuName: '检测报告',
+                url: "examiningReport"
             }
+
         ]
     },
+    // {
+    //     menuName: "无害化管理",
+    //     iconClassName: "el-icon-set-up",
+    //     disabled: false,
+    //     children: [
+    //         {
+    //             menuName: '无害化确认',
+    //             url: "harmlessConfirm"
+    //         },
+    //         {
+    //             menuName: '智能提醒',
+    //             url: "intelligentHint"
+    //         }
+    //     ]
+    // },
+    // {
+    //     menuName: "物料管理",
+    //     iconClassName: "el-icon-news",
+    //     disabled: false,
+    //     children: [
+    //         {
+    //             menuName: '基础信息',
+    //             url: "basicsInfo"
+    //         },
+    //         {
+    //             menuName: '物料入库',
+    //             url: "materialInStore"
+    //         },
+    //         {
+    //             menuName: '物料出库',
+    //             url: "materialOutStore"
+    //         },
+    //         {
+    //             menuName: '库存盘点',
+    //             url: "storeList"
+    //         }
+    //     ]
+    // },
     {
-        optionName: "育种管理",
+        menuName: "育种管理",
         iconClassName: "el-icon-bank-card",
         disabled: false,
-        childList: [
-            {
-                optionName: '等级评定',
-                routerName: "gradeAssess"
-            }
-        ]
-    },
-    {
-        optionName: "设备管理",
-        iconClassName: "el-icon-setting",
-        disabled: false,
-        childList: [
-            {
-                optionName: '环境检测',
-                routerName: "environmentMonitoring"
-            },
-            {
-                optionName: '视频监控',
-                routerName: "video"
-            },
+        children: [
             {
-                optionName: '设备故障',
-                routerName: "deviceFault"
+                menuName: '等级评定',
+                url: "gradeAssess"
             }
         ]
     },
+    // {
+    //     menuName: "设备管理",
+    //     iconClassName: "el-icon-setting",
+    //     disabled: false,
+    //     children: [
+    //         {
+    //             menuName: '环境检测',
+    //             url: "environmentMonitoring"
+    //         },
+    //         {
+    //             menuName: '视频监控',
+    //             url: "video"
+    //         },
+    //         {
+    //             menuName: '设备故障',
+    //             url: "deviceFault"
+    //         }
+    //     ]
+    // },
     {
-        optionName: "销售管理",
+        menuName: "销售管理",
         iconClassName: "el-icon-sell",
         disabled: false,
-        childList: [
+        children: [
             {
-                optionName: '销售记录',
-                routerName: "sellLog"
+                menuName: '销售记录',
+                url: "sellLog"
             }
         ]
     },
     {
-        optionName: "统计分析",
+        menuName: "统计分析",
         iconClassName: "el-icon-monitor",
         disabled: false,
-        childList: [
+        children: [
             {
-                optionName: '存栏统计',
-                routerName: "existSstatistic"
+                menuName: '存栏统计',
+                url: "existSstatistic"
             },
             {
-                optionName: '生产数据',
-                routerName: "productData"
+                menuName: '生产数据',
+                url: "productData"
             }
         ]
     }
@@ -233,13 +233,13 @@ const menuData描述 = [
     {
         oneMenuName: "导航一", // 一级菜单名
         iconClassName: "aaa", // element-ui图标名
-        childList: [ // 分组的
+        children: [ // 分组的
             {
                 groupName: '组名一',
                 list: [
                     {
-                        optionName: '选项1',
-                        routerName: "home"
+                        menuName: '选项1',
+                        url: "home"
                     },
                     {}
                 ],
@@ -248,8 +248,8 @@ const menuData描述 = [
                 groupName: '组名二',
                 list: [
                     {
-                        optionName: '选项1',
-                        routerName: "home"
+                        menuName: '选项1',
+                        url: "home"
                     },
                     {}
                 ],
@@ -261,10 +261,10 @@ const menuData描述 = [
         oneMenuName: "导航二",
         iconClassName: "el-icon-menu",
         disabled: false, // 是否禁用
-        childList: [ // 不分组的
+        children: [ // 不分组的
             {
-                optionName: '选项1',
-                routerName: "home"
+                menuName: '选项1',
+                url: "home"
             },
             {}
         ]
@@ -273,7 +273,7 @@ const menuData描述 = [
     {
         oneMenuName: "导航三",
         iconClassName: "el-icon-document",
-        routerName: "home",
+        url: "home",
         disabled: false
     },
 

+ 12 - 12
src/views/Login/Login.vue

@@ -72,18 +72,18 @@ export default {
                     console.log("登录失败", err);
                     this.$message.error("登录失败:" + err);
                 });
-            this.$axios.post(`http://121.37.169.186:8081/my/login?accountName=${this.form.userName}&password=${this.form.userPwd}`)
-            .then(res => {
-                loading.close();
-                if(res.data.code === 10000) {
-                    // localStorage.setItem("token", res.data.token);
-                    // localStorage.setItem("token", res.token);
-                    localStorage.setItem('accountName', res.data.accountName);
-                    this.$router.replace ("/home/dashboard");
-                } else {
-                    this.$message.error(res.data.message);
-                }
-            })
+            // this.$axios.post(`http://121.37.169.186:8081/my/login?accountName=${this.form.userName}&password=${this.form.userPwd}`)
+            // .then(res => {
+            //     loading.close();
+            //     if(res.data.code === 10000) {
+            //         // localStorage.setItem("token", res.data.token);
+            //         // localStorage.setItem("token", res.token);
+            //         localStorage.setItem('accountName', res.data.accountName);
+            //         // this.$router.replace ("/home/dashboard");
+            //     } else {
+            //         this.$message.error(res.data.message);
+            //     }
+            // })
         },
         handleSet: function() {
             if (!this.orgSelected) {

+ 8 - 6
src/views/antiepidemic/immunePlan.vue

@@ -54,7 +54,7 @@
                                 type="text"
                                 size="small"
                             >时间变更</el-button>
-                            <el-popconfirm title="确定提交此信息?" @onConfirm="onConfirm(scope.row)">
+                            <el-popconfirm title="确定提交此信息?" @confirm="onConfirm(scope.row)">
                                 <el-button slot="reference" type="text" size="small">确认</el-button>
                             </el-popconfirm>
                         </template>
@@ -202,7 +202,7 @@ export default {
             formData: {
                 target: null,
                 batchNo: "",
-                performTime: this.$moment().format("YYYY-MM-DD HH:mm:ss"),
+                performTime: '',
                 number: "",
                 medicineId: null,
                 method: "",
@@ -260,6 +260,7 @@ export default {
         submitFormTimeChange(formName) {
             this.$refs[formName].validate(valid => {
                 if (valid) {
+                    this.timeForm.targetDate = this.formData.performTime;
                     reqAdjustImmunePlan(this.timeForm)
                         .then(res => {
                             // 免疫程序列表
@@ -270,7 +271,8 @@ export default {
                             } else {
                                 this.$message.success("时间变更成功!");
                             }
-                            // this.isShow = false
+                            this.isShowTime = false;
+                            this.formData = {};
                         })
                         .catch(err => {
                             console.log(err);
@@ -315,7 +317,7 @@ export default {
             delete this.formData.id;
         },
         onConfirm(row) {
-            console.log(row)
+            console.log(row);
             reqConfirm(row)
                 .then(res => {
                     // 免疫程序列表
@@ -333,7 +335,7 @@ export default {
         },
         onTimeChange(row) {
             this.timeForm.id = row.id;
-            this.timeForm.targetDate = row.performTime;
+            this.formData.performTime = row.performTime;
             this.isShowTime = true;
         },
         edit(row) {
@@ -363,4 +365,4 @@ export default {
         margin-top: 20px;
     }
 }
-</style>
+</style>

+ 27 - 7
src/views/breed/collectSeedLog.vue

@@ -62,7 +62,7 @@
                     </el-table-column>
                     <el-table-column label="操作" width="150">
                         <template v-slot="scope">
-                            <el-button @click="edit(scope.row)" type="text" size="small">编辑</el-button>
+                            <el-button @click="edit(scope.row, true)" 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>
@@ -188,8 +188,10 @@ export default {
                 color: null,
                 times: "",
                 total: "",
-                opeUser: null
+                opeUser: null,
+                id: ''
             },
+            showType: false,
             rules
         };
     },
@@ -209,6 +211,7 @@ export default {
                             if (res.errCode) {
                                 this.$message.error(res.errMsg);
                             } else {
+                                console.log(1110);
                                 this.$message.success("成功!");
                                 this.formData = {
                                     sheepId: "",
@@ -220,10 +223,12 @@ export default {
                                     color: null,
                                     times: "",
                                     total: "",
-                                    opeUser: null
+                                    opeUser: null,
+                                    id: '',
                                 }
                             }
-                            // this.isShow = false
+                            this.showType = false;
+                            this.isShow = false
                         })
                         .catch(err => {
                             console.log(err);
@@ -254,9 +259,24 @@ export default {
             // 有id是update 没id是add
             delete this.formData.id;
         },
-        edit(row) {
-            this.formData = row;
+        edit(row, bool) {
+            this.showType = bool;
+            console.log(row);
+            // this.formData
+            this.formData.sheepId = row.sheepId;
+            this.formData.level = row.level;
+            this.formData.opeTime = row.opeTime;
+            this.formData.opeUser = row.opeUser;
+            this.formData.density = row.density;
+            this.formData.times = row.times;
+            this.formData.total = row.total;
+            this.formData.vigour = row.vigour;
+            this.formData.yield = row.yield;
             this.isShow = true;
+            if(this.showType) {
+                this.formData.id = row.id;
+            }
+
         },
         del(row) {
             reqDelSemen(row.id)
@@ -294,4 +314,4 @@ export default {
         margin-top: 20px;
     }
 }
-</style>
+</style>

+ 19 - 5
src/views/breed/matingLog.vue

@@ -56,7 +56,7 @@
                     </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-button @click="edit(scope.row, true)" 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>
@@ -189,7 +189,13 @@ export default {
                                 this.$message.error(res.errMsg);
                             } else {
                                 this.$message.success("成功");
-                                this.formData = {}
+                                this.formData.femaleSheepId = '';
+                                this.formData.femaleLevel = '';
+                                this.formData.maleLevel = '';
+                                this.formData.maleSheepId = '';
+                                this.formData.opeUser = '';
+                                this.formData.opeTime = '';
+                                this.formData.id = '';
                                 this.isShow = false
                             }
                             // this.isShow = false
@@ -223,8 +229,16 @@ export default {
             // 有id是update 没id是add
             delete this.formData.id;
         },
-        edit(row) {
-            this.formData = row;
+        edit(row, bool) {
+            this.formData.femaleSheepId = row.femaleSheepId;
+            this.formData.femaleLevel = row.femaleLevel;
+            this.formData.maleLevel = row.maleLevel;
+            this.formData.maleSheepId = row.maleSheepId;
+            this.formData.opeUser = row.opeUser;
+            this.formData.opeTime = row.opeTime;
+            if(bool) {
+                this.formData.id = row.id;
+            }
             this.isShow = true;
         },
         del(row) {
@@ -262,4 +276,4 @@ export default {
         margin-top: 20px;
     }
 }
-</style>
+</style>

+ 19 - 5
src/views/breed/matingSuccLog.vue

@@ -58,7 +58,7 @@
                     </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-button @click="edit(scope.row, true)" 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>
@@ -164,7 +164,9 @@ export default {
                 opeTime: this.$moment().format("YYYY-MM-DD HH:mm:ss"),
                 ifEstrus: null,
                 opeUser: null,
+                id: null
             },
+            showType: false,
             rules
         };
     },
@@ -185,7 +187,12 @@ export default {
                                 this.$message.error(res.errMsg);
                             } else {
                                 this.$message.success("成功");
-                                this.formData = {}
+                                this.formData.sheepId = '';
+                                this.formData.level = '';
+                                this.formData.opeTime = '';
+                                this.formData.ifEstrus = '';
+                                this.formData.opeUser = '';
+                                this.formData.id = '';
                                 this.isShow = false
                             }
                         })
@@ -218,8 +225,15 @@ export default {
             // 有id是update 没id是add
             delete this.formData.id;
         },
-        edit(row) {
-            this.formData = row;
+        edit(row, bool) {
+            this.formData.sheepId = row.sheepId;
+            this.formData.level = row.level;
+            this.formData.opeTime = row.opeTime;
+            this.formData.ifEstrus = row.ifEstrus;
+            this.formData.opeUser = row.opeUser;
+            if(bool) {
+                this.formData.id = row.id;
+            }
             this.isShow = true;
         },
         del(row) {
@@ -257,4 +271,4 @@ export default {
         margin-top: 20px;
     }
 }
-</style>
+</style>

+ 21 - 5
src/views/breed/offFieldLog.vue

@@ -48,7 +48,7 @@
                     <el-table-column prop="remark" 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-button @click="edit(scope.row, true)" 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>
@@ -171,7 +171,14 @@ export default {
                             // 离场记录 列表
                             this.getOffFieldList();
                             this.$message.success("成功!");
-                            this.formData = {}
+                            this.formData.ageOfDay = '';
+                            this.formData.cause = '';
+                            this.formData.opeTime = '';
+                            this.formData.opeUser = '';
+                            this.formData.remark = '';
+                            this.formData.sheepId = '';
+                            this.formData.weight = '';
+                            this.formData.id = '';
                             this.isShow = false
                         })
                         .catch(err => {
@@ -203,8 +210,17 @@ export default {
             // 有id是update 没id是add
             delete this.formData.id;
         },
-        edit(row) {
-            this.formData = row;
+        edit(row, bool) {
+            this.formData.ageOfDay = row.ageOfDay;
+            this.formData.cause = row.cause;
+            this.formData.opeTime = row.opeTime;
+            this.formData.opeUser = row.opeUser;
+            this.formData.remark = row.remark;
+            this.formData.sheepId = row.sheepId;
+            this.formData.weight = row.weight;
+            if(bool) {
+                this.formData.id = row.id;
+            }
             this.isShow = true;
         },
         del(row) {
@@ -242,4 +258,4 @@ export default {
         margin-top: 20px;
     }
 }
-</style>
+</style>

+ 15 - 4
src/views/breed/parturitionLog.vue

@@ -82,7 +82,7 @@
                     <el-table-column label="操作" width="150">
                         <template slot-scope="scope">
                             <el-button
-                                @click="edit(scope.row)"
+                                @click="edit(scope.row, true)"
                                 type="text"
                                 size="small"
                                 >编辑</el-button
@@ -313,8 +313,19 @@ export default {
             // 有id是update 没id是add
             delete this.formData.id;
         },
-        edit(row) {
-            this.formData = row;
+        edit(row, bool) {
+            this.formData.averageWeight = row.averageWeight;
+            this.formData.deadNum = row.deadNum;
+            this.formData.healthyNum = row.healthyNum;
+            this.formData.mummyNum = row.mummyNum;
+            this.formData.number = row.number;
+            this.formData.opeTime = row.opeTime;
+            this.formData.opeUser = row.opeUser;
+            this.formData.sheepId = row.sheepId;
+            this.formData.weakNum = row.weakNum;
+            if(bool) {
+                this.formData.id = row.id;
+            }
             this.isShow = true;
         },
         del(row) {
@@ -352,4 +363,4 @@ export default {
         margin-top: 20px;
     }
 }
-</style>
+</style>

+ 15 - 6
src/views/breed/pregnancyTestLog.vue

@@ -91,7 +91,7 @@
                     <el-table-column label="操作" width="150">
                         <template slot-scope="scope">
                             <el-button
-                                @click="edit(scope.row)"
+                                @click="edit(scope.row, true)"
                                 type="text"
                                 size="small"
                                 >编辑</el-button
@@ -273,8 +273,7 @@ export default {
                                 this.$message.error(res.errMsg);
                             } else {
                                 this.$message.success("成功");
-                                this.formData = {};
-                                this.isShow = {
+                                this.formData = {
                                     sheepId: "",
                                     opeTime: this.$moment().format(
                                         "YYYY-MM-DD HH:mm:ss"
@@ -291,6 +290,7 @@ export default {
                             console.log(err);
                             this.$message.error(err);
                         });
+                    this.isShow = false;
                 } else {
                     return false;
                 }
@@ -316,8 +316,17 @@ export default {
             // 有id是update 没id是add
             delete this.formData.id;
         },
-        edit(row) {
-            this.formData = row;
+        edit(row, bool) {
+            this.formData.number = row.number;
+            this.formData.opeTime = row.opeTime;
+            this.formData.opeUser = row.opeUser;
+            this.formData.position = row.position;
+            this.formData.remark = row.remark;
+            this.formData.sheepId = row.sheepId;
+            this.formData.status = row.status;
+            if(bool) {
+                this.formData.id = row.id;
+            }
             this.isShow = true;
         },
         del(row) {
@@ -355,4 +364,4 @@ export default {
         margin-top: 20px;
     }
 }
-</style>
+</style>

+ 15 - 4
src/views/breed/shiftFieldLog.vue

@@ -102,7 +102,7 @@
                     <el-table-column label="操作" width="150">
                         <template slot-scope="scope">
                             <el-button
-                                @click="edit(scope.row)"
+                                @click="edit(scope.row, true)"
                                 type="text"
                                 size="small"
                                 >编辑</el-button
@@ -329,8 +329,19 @@ export default {
             // 有id是update 没id是add
             delete this.formData.id;
         },
-        edit(row) {
-            this.formData = row;
+        edit(row, bool) {
+            this.formData.fromBuilding = row.fromBuilding;
+            this.formData.fromEnclosure = row.fromEnclosure;
+            this.formData.opeTime = row.opeTime;
+            this.formData.opeUser = row.opeUser;
+            this.formData.remark = row.remark;
+            this.formData.sheepId = row.sheepId;
+            this.formData.toBuilding = row.toBuilding;
+            this.formData.toEnclosure = row.toEnclosure;
+            this.formData.weight = row.weight;
+            if(bool) {
+                this.formData.id = row.id;
+            }
             this.isShow = true;
         },
         del(row) {
@@ -368,4 +379,4 @@ export default {
         margin-top: 20px;
     }
 }
-</style>
+</style>

+ 12 - 4
src/views/breed/weaningLog.vue

@@ -70,7 +70,7 @@
                     <el-table-column label="操作" width="150">
                         <template slot-scope="scope">
                             <el-button
-                                @click="edit(scope.row)"
+                                @click="edit(scope.row, true)"
                                 type="text"
                                 size="small"
                                 >编辑</el-button
@@ -262,8 +262,16 @@ export default {
             // 有id是update 没id是add
             delete this.formData.id;
         },
-        edit(row) {
-            this.formData = row;
+        edit(row, bool) {
+            this.formData.cost = row.cost;
+            this.formData.number = row.number;
+            this.formData.opeTime = row.opeTime;
+            this.formData.opeUser = row.opeUser;
+            this.formData.sheepId = row.sheepId;
+            this.formData.weight = row.weight;
+            if(bool) {
+                this.formData.id = row.id;
+            }
             this.isShow = true;
         },
         del(row) {
@@ -302,4 +310,4 @@ export default {
         margin-top: 20px;
     }
 }
-</style>
+</style>

+ 13 - 5
src/views/fileInfo/areaInfo.vue

@@ -34,7 +34,7 @@
                     </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-button @click="edit(scope.row, true)" 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>
@@ -133,7 +133,10 @@ export default {
                                 this.$message.error(res.errMsg);
                             } else {
                                 this.$message.success("成功");
-                                this.formData = {}
+                                this.formData.capacity = '';
+                                this.formData.manager = '';
+                                this.formData.name = '';
+                                this.formData.id = '';
                                 this.isShow = false;
                             }
                         })
@@ -168,8 +171,13 @@ export default {
             // 有id是update 没id是add
             delete this.formData.id;
         },
-        edit(row) {
-            this.formData = row;
+        edit(row, bool) {
+            this.formData.capacity = row.capacity;
+            this.formData.manager = row.manager;
+            this.formData.name = row.name;
+            if(bool) {
+                this.formData.id = row.id;
+            }
             this.isShow = true;
         },
         del(row) {
@@ -208,4 +216,4 @@ export default {
         margin-top: 20px;
     }
 }
-</style>
+</style>

+ 15 - 4
src/views/fileInfo/workerInfo.vue

@@ -86,7 +86,7 @@
                     <el-table-column label="操作" width="150">
                         <template v-slot="scope">
                             <el-button
-                                @click="edit(scope.row)"
+                                @click="edit(scope.row,true)"
                                 type="text"
                                 size="small"
                                 >编辑</el-button
@@ -273,8 +273,19 @@ export default {
             // 有id是update 没id是add
             delete this.formData.id;
         },
-        edit(row) {
-            this.formData = row;
+        edit(row, bool) {
+            this.formData.age = row.age;
+            this.formData.birthPlace = row.birthPlace;
+            this.formData.duty = row.duty;
+            this.formData.farmName = row.farmName;
+            this.formData.gender = row.gender;
+            this.formData.name = row.name;
+            this.formData.phone = row.phone;
+            this.formData.position = row.position;
+            this.formData.status = row.status;
+            if(bool) {
+                this.formData.id = row.id;
+            }
             this.isShow = true;
         },
         del(row) {
@@ -313,4 +324,4 @@ export default {
         margin-top: 20px;
     }
 }
-</style>
+</style>