Ver Fonte

2022-01-25

East há 3 anos atrás
pai
commit
761cfbd6c4

+ 3 - 2
src/components/table-cpn/TableCpn.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2022-01-06 16:46:18
- * @LastEditTime: 2022-01-19 16:29:32
+ * @LastEditTime: 2022-01-25 11:03:34
  * @LastEditors: Please set LastEditors
  * @Description: 再封一次
  * @FilePath: \goldenPig\src\components\table-cpn\TableCpn.vue
@@ -130,7 +130,8 @@ export default {
   },
   watch: {
     searchForm: {
-      handler() {
+      handler(newVal) {
+        console.log(newVal);
         this.init();
       },
       deep: true,

+ 16 - 11
src/views/basic-data/house-admin/HouseAdmin.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2022-01-08 10:36:43
- * @LastEditTime: 2022-01-19 16:29:18
+ * @LastEditTime: 2022-01-25 11:07:21
  * @LastEditors: Please set LastEditors
  * @Description: 基础资料 - 栋舍管理
  * @FilePath: \goldenPig\src\views\basic-data\house-admin\HouseAdmin.vue
@@ -73,7 +73,7 @@
 <script>
 // 搜索
 import SearchCpn from "@/components/search-cpn";
-import { formItemProp } from "./config/search.config";
+import { formItemProp1, formItemProp2 } from "./config/search.config";
 
 // 表格
 import TableCpn from "@/components/table-cpn";
@@ -150,16 +150,20 @@ export default {
       this.searchForm2.farmId = this.farmList[0]?.id;
       this.searchForm.farmId = this.farmList[0]?.id;
       this.modalForm2.farmId = this.farmList[0]?.id;
+      this.searchConfig = {
+        formItemProp: formItemProp1,
+        searchForm: { ...this.searchForm1 },
+      };
+    } else {
+      this.searchForm2.farmId = this.farmId;
+      this.searchForm.farmId = this.farmId;
+      this.modalForm2.farmId = this.farmId;
+      this.searchConfig = {
+        formItemProp: formItemProp2,
+        searchForm: { ...this.searchForm1 },
+      };
     }
-    // } else {
-    //   this.searchForm2.farmId = parseInt(this.form.farm);
-    //   this.searchForm.farmId = parseInt(this.form.farm);
-    //   this.modalForm2.farmId = parseInt(this.form.farm);
-    // }
-    this.searchConfig = {
-      formItemProp,
-      searchForm: { ...this.searchForm1 },
-    };
+
     this.tableConfig = {
       propList,
       permission: "archivesAdmin",
@@ -193,6 +197,7 @@ export default {
           // 确定默认选中牧场
           this.searchForm2.farmId = newVal;
           this.searchForm.farmId = newVal;
+          console.log(this.searchForm.farmId);
           this.modalForm2.farmId = newVal;
         }
       },

+ 11 - 2
src/views/basic-data/house-admin/config/search.config.js

@@ -1,12 +1,12 @@
 /*
  * @Author: your name
  * @Date: 2022-01-06 14:44:20
- * @LastEditTime: 2022-01-19 09:26:14
+ * @LastEditTime: 2022-01-25 10:59:21
  * @LastEditors: Please set LastEditors
  * @Description: 养殖企业 - 搜索配置
  * @FilePath: \goldenPig\src\views\summary-data\individual-data\search.config.js
  */
-export const formItemProp = [
+export const formItemProp1 = [
   {
     label: '牧场名称:',
     type: 'custom',
@@ -21,3 +21,12 @@ export const formItemProp = [
     placeholder: '请输入栋/楼/单元名称'
   }
 ]
+
+export const formItemProp2 = [
+  {
+    label: '栋舍名称:',
+    type: 'input',
+    field: 'pigpenName',
+    placeholder: '请输入栋/楼/单元名称'
+  }
+]