소스 검색

最新修改

e 4 년 전
부모
커밋
43948272e7

+ 2 - 1
.eslintrc.js

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

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

@@ -54,9 +54,7 @@
                                 type="text"
                                 size="small"
                             >时间变更</el-button>
-                            <el-popconfirm title="确定提交此信息?" @confirm="onConfirm(scope.row)">
-                                <el-button slot="reference" type="text" size="small">确认</el-button>
-                            </el-popconfirm>
+                            <el-button  type="text" size="small" @click="hanldSelect(scope.row)">确认</el-button>
                         </template>
                     </el-table-column>
                 </el-table>
@@ -173,6 +171,25 @@
                 </el-col>
             </el-row>
         </el-dialog>
+        <el-dialog title="免疫类型" :visible.sync="isSelect" width="40%">
+            <div style="padding: 20px">
+                <el-form>
+                    <el-form-item label="免疫类型">
+                        <el-radio-group v-model="vaccineStyle">
+                            <el-radio :label="1">普免</el-radio>
+                            <el-radio :label="2">防疫</el-radio>
+                        </el-radio-group>
+                    </el-form-item>
+                    <el-form-item>
+                        <el-button @click="isSelect=false">取 消</el-button>
+                        <el-button
+                                type="primary"
+                                @click="onConfirm('timeChange')"
+                        >保 存</el-button>
+                    </el-form-item>
+                </el-form>
+            </div>
+        </el-dialog>
     </div>
 </template>
 
@@ -210,6 +227,8 @@ export default {
                 remark: ""
             },
             timeForm: {},
+            isSelect: false,
+            vaccineStyle: 1,
             rules
         };
     },
@@ -218,6 +237,19 @@ export default {
         this.getImmunePlanList();
     },
     methods: {
+        hanldSelect(row) {
+            this.isSelect = true;
+            this.formData.id = row.id;
+            this.formData.target = row.target;
+            this.formData.batchNo = row.batchNo;
+            this.formData.performTime = row.performTime;
+            this.formData.number = row.number;
+            this.formData.medicine = row.medicine;
+            this.formData.medicineName = row.medicineName;
+            this.formData.method = row.method;
+            this.formData.opeUser = row.opeUser;
+            this.formData.remark = row.remark;
+        },
         submitForm(formName) {
             this.$refs[formName].validate(valid => {
                 if (valid) {
@@ -316,17 +348,31 @@ export default {
             // 有id是update 没id是add
             delete this.formData.id;
         },
-        onConfirm(row) {
-            console.log(row);
-            reqConfirm(row)
+        onConfirm() {
+            this.isSelect = false;
+            this.formData.vaccineStyle = this.vaccineStyle;
+            reqConfirm(this.formData)
                 .then(res => {
                     // 免疫程序列表
                     if (res.code == "success") {
                         this.$message.success(res.msg);
+                        this.getImmunePlanList();
                     }
                     if (res.errCode == "delete failed") {
                         this.$message.error(res.errMsg);
                     }
+                    this.formData = {
+                        target: null,
+                        batchNo: "",
+                        performTime: '',
+                        number: "",
+                        medicineId: null,
+                        method: "",
+                        opeUser: null,
+                        remark: ""
+                    };
+                    this.formData.vaccineStyle = '';
+                    this.vaccineStyle = 1;
                 })
                 .catch(err => {
                     console.log(err);

+ 22 - 3
src/views/antiepidemic/immuneProce.vue

@@ -137,7 +137,7 @@
                         </el-form-item>
 
                         <el-form-item>
-                            <el-button @click="isShow=false">取 消</el-button>
+                            <el-button @click="cancel">取 消</el-button>
                             <el-button type="primary" @click="submitForm('addImmuneProce')">保 存</el-button>
                         </el-form-item>
                     </el-form>
@@ -169,7 +169,7 @@ export default {
             target: this.$store.state["sheepType"][0].value,  // 按钮绑定的
             sheepTypeArr: [this.$store.state["sheepType"][1].value],
             formData: {
-                vaccineStyle: null,
+                vaccineStyle: 1,
                 target: null,
                 vaccineName: "",
                 disease: "",
@@ -204,7 +204,7 @@ export default {
                                 this.$message.error(res.errMsg);
                             } else {
                                 this.$message.success("成功!");
-                                this.formData = {}
+                                this.reset();
                                 this.isShow = false
                             }
                             // this.isShow = false
@@ -284,6 +284,25 @@ export default {
             this.pageNum = p;
             // 免疫程序列表
             this.getImmuneProceList();
+        },
+        // 取消
+        cancel() {
+            this.isShow = false;
+            this.reset();
+        },
+        // 重置
+        reset() {
+            this.formData = {
+                vaccineStyle: 1,
+                target: null,
+                vaccineName: "",
+                disease: "",
+                vaccineTime: "",
+                vaccineDosage: "",
+                unit: "",
+                bodyPart: "",
+                remark: ""
+            };
         }
     }
 };

+ 22 - 1
src/views/breed/collectSeedLog.vue

@@ -149,7 +149,7 @@
                             </el-select>
                         </el-form-item>
                         <el-form-item>
-                            <el-button @click="isShow=false">取 消</el-button>
+                            <el-button @click="cancel">取 消</el-button>
                             <el-button type="primary" @click="submitForm('addSemen')">保 存</el-button>
                         </el-form-item>
                     </el-form>
@@ -300,6 +300,27 @@ export default {
             this.pageNum = p;
             // 采精记录列表
             this.getSemenList();
+        },
+        // 取消
+        cancel() {
+            this.isShow = false;
+            this.reset();
+        },
+        // 重置
+        reset() {
+            this.formData = {
+                sheepId: "",
+                level: null,
+                opeTime: this.$moment().format('YYYY-MM-DD HH:mm:ss'),
+                yield: "",
+                density: null,
+                vigour: "",
+                color: null,
+                times: "",
+                total: "",
+                opeUser: null,
+                id: ''
+            };
         }
     }
 };

+ 16 - 1
src/views/breed/commoditySheepFile.vue

@@ -145,7 +145,7 @@
                         </el-form-item>
 
                         <el-form-item>
-                            <el-button @click="isShow = false">取 消</el-button>
+                            <el-button @click="cancel">取 消</el-button>
                             <el-button
                                 type="primary"
                                 @click="submitForm('addCommoditySheepFile')"
@@ -267,6 +267,21 @@ export default {
             // 商品羊档案列表
             this.getCommoditySheepFileList();
         },
+        // 取消
+        cancel() {
+            this.isShow = false;
+            this.reset();
+        },
+        // 重置
+        reset() {
+            this.formData = {
+                id: "",
+                motherId: "",
+                birthWeight: "",
+                birthday: this.$moment().format("YYYY-MM-DD HH:mm:ss"),
+                status: null,
+            };
+        }
     },
 };
 </script>

+ 17 - 1
src/views/breed/matingLog.vue

@@ -132,7 +132,7 @@
                         </el-form-item>
 
                         <el-form-item>
-                            <el-button @click="isShow=false">取 消</el-button>
+                            <el-button @click="cancel">取 消</el-button>
                             <el-button type="primary" @click="submitForm('addMating')">保 存</el-button>
                         </el-form-item>
                     </el-form>
@@ -262,6 +262,22 @@ export default {
             this.pageNum = p;
             // 配种记录列表
             this.getMatingList();
+        },
+        // 取消
+        cancel() {
+            this.isShow = false;
+            this.reset();
+        },
+        // 重置
+        reset() {
+            this.formData = {
+                femaleSheepId: "",
+                femaleLevel: null,
+                maleSheepId: "",
+                maleLevel: null,
+                opeTime: this.$moment().format("YYYY-MM-DD HH:mm:ss"),
+                opeUser: null
+            };
         }
     }
 };

+ 17 - 1
src/views/breed/matingSuccLog.vue

@@ -129,7 +129,7 @@
                         </el-form-item>
 
                         <el-form-item>
-                            <el-button @click="isShow=false">取 消</el-button>
+                            <el-button @click="cancel">取 消</el-button>
                             <el-button type="primary" @click="submitForm('addmatingS')">保 存</el-button>
                         </el-form-item>
                     </el-form>
@@ -257,6 +257,22 @@ export default {
             this.pageNum = p;
             // 查情记录列表
             this.getmatingSList();
+        },
+        // 取消
+        cancel() {
+            this.isShow = false;
+            this.reset();
+        },
+        // 重置
+        reset() {
+            this.formData = {
+                sheepId: "",
+                level: null,
+                opeTime: this.$moment().format("YYYY-MM-DD HH:mm:ss"),
+                ifEstrus: null,
+                opeUser: null,
+                id: null
+            };
         }
     }
 };

+ 18 - 1
src/views/breed/offFieldLog.vue

@@ -117,7 +117,7 @@
                         </el-form-item>
 
                         <el-form-item>
-                            <el-button @click="isShow=false">取 消</el-button>
+                            <el-button @click="cancel">取 消</el-button>
                             <el-button type="primary" @click="submitForm('addOffField')">保 存</el-button>
                         </el-form-item>
                     </el-form>
@@ -244,6 +244,23 @@ export default {
             this.pageNum = p;
             // 离场记录 列表
             this.getOffFieldList();
+        },
+        // 取消
+        cancel() {
+            this.isShow = false;
+            this.reset();
+        },
+        // 重置
+        reset() {
+            this.formData = {
+                sheepId: "",
+                opeTime: this.$moment().format("YYYY-MM-DD HH:mm:ss"),
+                ageOfDay: '',
+                weight: null,
+                cause: null,
+                opeUser: null,
+                remark: ""
+            };
         }
     }
 };

+ 20 - 1
src/views/breed/parturitionLog.vue

@@ -204,7 +204,7 @@
                         </el-form-item>
 
                         <el-form-item>
-                            <el-button @click="isShow = false">取 消</el-button>
+                            <el-button @click="cancel">取 消</el-button>
                             <el-button
                                 type="primary"
                                 @click="submitForm('addParturition')"
@@ -350,6 +350,25 @@ export default {
             // 分娩记录列表
             this.getParturitionList();
         },
+        // 取消
+        cancel() {
+            this.isShow = false;
+            this.reset();
+        },
+        // 重置
+        reset() {
+            this.formData = {
+                sheepId: "",
+                opeTime: this.$moment().format("YYYY-MM-DD HH:mm:ss"),
+                number: null,
+                averageWeight: "",
+                healthyNum: 0,
+                weakNum: 0,
+                mummyNum: 0,
+                deadNum: 0,
+                opeUser: null,
+            };
+        }
     },
 };
 </script>

+ 18 - 1
src/views/breed/pregnancyTestLog.vue

@@ -211,7 +211,7 @@
                         </el-form-item>
 
                         <el-form-item>
-                            <el-button @click="isShow = false">取 消</el-button>
+                            <el-button @click="cancel">取 消</el-button>
                             <el-button
                                 type="primary"
                                 @click="submitForm('addPregnancyTest')"
@@ -351,6 +351,23 @@ export default {
             // 妊检记录列表
             this.getPregnancyTestList();
         },
+        // 取消
+        cancel() {
+            this.isShow = false;
+            this.reset();
+        },
+        // 重置
+        reset() {
+            this.formData = {
+                sheepId: "",
+                opeTime: this.$moment().format("YYYY-MM-DD HH:mm:ss"),
+                status: null,
+                opeUser: null,
+                position: null,
+                number: "",
+                remark: "",
+            };
+        }
     },
 };
 </script>

+ 20 - 1
src/views/breed/seedSheepFile.vue

@@ -272,7 +272,7 @@
                         </el-form-item>
 
                         <el-form-item>
-                            <el-button @click="isShow = false">取 消</el-button>
+                            <el-button @click="cancel">取 消</el-button>
                             <el-button
                                 type="primary"
                                 @click="submitForm('addSeedSheepForm')"
@@ -402,6 +402,25 @@ export default {
             this.page = p;
             this.getSeedSheepList();
         },
+        // 取消
+        cancel() {
+            this.isShow = false;
+            this.reset();
+        },
+        // 重置
+        reset() {
+            this.formData = {
+                id: "",
+                dayOfAge: "",
+                source: 1,
+                position: "",
+                status: null,
+                cost: null,
+                weight: null,
+                feeder: null,
+                level: null,
+            };
+        }
     },
 };
 </script>

+ 21 - 2
src/views/breed/shiftFieldLog.vue

@@ -159,7 +159,7 @@
 
                         <el-form-item label="转出栋舍">
                             <el-select
-                                v-model="formData.opeUser"
+                                v-model="formData.fromBuilding"
                                 placeholder="请选择"
                             >
                                 <el-option
@@ -220,7 +220,7 @@
                         </el-form-item>
 
                         <el-form-item>
-                            <el-button @click="isShow = false">取 消</el-button>
+                            <el-button @click="cancel">取 消</el-button>
                             <el-button
                                 type="primary"
                                 @click="submitForm('addShiftField')"
@@ -366,6 +366,25 @@ export default {
             // 转舍记录 列表
             this.getShiftFieldList();
         },
+        // 取消
+        cancel() {
+            this.isShow = false;
+            this.reset();
+        },
+        // 重置
+        reset() {
+            this.formData = {
+                sheepId: "",
+                opeTime: this.$moment().format("YYYY-MM-DD HH:mm:ss"),
+                fromBuilding: null,
+                fromEnclosure: "",
+                toBuilding: null,
+                toEnclosure: "",
+                weight: "",
+                opeUser: null,
+                remark: "",
+            };
+        }
     },
 };
 </script>

+ 17 - 1
src/views/breed/weaningLog.vue

@@ -158,7 +158,7 @@
                         </el-form-item>
 
                         <el-form-item>
-                            <el-button @click="isShow = false">取 消</el-button>
+                            <el-button @click="cancel">取 消</el-button>
                             <el-button
                                 type="primary"
                                 @click="submitForm('addWeaning')"
@@ -297,6 +297,22 @@ export default {
             // 断奶信息列表
             this.getWeaningList();
         },
+        // 取消
+        cancel() {
+            this.isShow = false;
+            this.reset();
+        },
+        // 重置
+        reset() {
+            this.formData = {
+                opeTime: this.$moment().format("YYYY-MM-DD HH:mm:ss"),
+                sheepId: "",
+                number: 0,
+                weight: "",
+                cost: "",
+                opeUser: null,
+            };
+        }
     },
 };
 </script>

+ 14 - 1
src/views/fileInfo/areaInfo.vue

@@ -79,7 +79,7 @@
                         </el-form-item>
 
                         <el-form-item>
-                            <el-button @click="isShow=false">取 消</el-button>
+                            <el-button @click="cancel">取 消</el-button>
                             <el-button type="primary" @click="submitForm('addBuild')">保 存</el-button>
                         </el-form-item>
                     </el-form>
@@ -202,6 +202,19 @@ export default {
             this.pageNum = p;
             // 入库管理列表
             this.getBuildList();
+        },
+        // 取消
+        cancel(){
+            this.isShow = false;
+            this.reset();
+        },
+        //重置
+        reset() {
+            this.formData = {
+                name: "",
+                capacity: "",
+                manager: null
+            };
         }
     }
 };

+ 21 - 1
src/views/fileInfo/workerInfo.vue

@@ -162,7 +162,7 @@
                             <el-input v-model="formData.duty"></el-input>
                         </el-form-item>
                         <el-form-item>
-                            <el-button @click="isShow = false">取 消</el-button>
+                            <el-button @click="cancel">取 消</el-button>
                             <el-button
                                 type="primary"
                                 @click="submitForm('addWorker')"
@@ -311,6 +311,26 @@ export default {
             // 入库管理列表
             this.getWorkerList();
         },
+        // 取消
+        cancel() {
+            this.isShow = false;
+            this.reset();
+        },
+        // 重置
+        reset() {
+            this.formData = {
+                name: "",
+                gender: 1,
+                age: "",
+                farmName: "",
+                position: "",
+                status: 1,
+                phone: "",
+                birthPlace: "",
+                // duty: "保育一舍,保育二舍"
+                duty: "",
+            };
+        }
     },
 };
 </script>