浏览代码

2022-01-17

East 3 年之前
父节点
当前提交
f6d2ee8fd3

+ 1 - 1
src/components/modal-cpn/ModalCpn.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2022-01-08 16:02:11
- * @LastEditTime: 2022-01-12 15:51:42
+ * @LastEditTime: 2022-01-17 14:39:15
  * @LastEditors: Please set LastEditors
  * @Description: 新增 or 编辑表单
  * @FilePath: \goldenPig\src\components\form-cpn\FormCpn.vue

+ 2 - 1
src/components/search-cpn/SearchCpn.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2022-01-06 13:53:10
- * @LastEditTime: 2022-01-11 09:04:54
+ * @LastEditTime: 2022-01-17 14:40:37
  * @LastEditors: Please set LastEditors
  * @Description: 搜索组件
  * @FilePath: \goldenPig\src\components\search-cpn\SearchCpn.vue
@@ -123,6 +123,7 @@ export default {
           this.btnsBottom = true;
         }
         this.form = { ...this.searchForm };
+        console.log(this.form);
       },
       deep: true,
       immediate: true,

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

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2022-01-06 16:46:18
- * @LastEditTime: 2022-01-12 15:59:48
+ * @LastEditTime: 2022-01-17 14:34:54
  * @LastEditors: Please set LastEditors
  * @Description: 再封一次
  * @FilePath: \goldenPig\src\components\table-cpn\TableCpn.vue
@@ -151,7 +151,7 @@ export default {
           ...this.searchForm,
         })
         .then((res) => {
-          if (res.code === 10000) {
+          if (res?.code === 10000) {
             this.dataList = res.data.records;
             this.total = res.data.total;
           } else {

+ 14 - 19
src/views/basic-data/archives-admin/ArchivesAdmin.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2022-01-08 10:36:06
- * @LastEditTime: 2022-01-11 16:55:49
+ * @LastEditTime: 2022-01-17 14:42:20
  * @LastEditors: Please set LastEditors
  * @Description: 基础资料 - 档案管理
  * @FilePath: \goldenPig\src\views\basic-data\archives-admin\ArchivesAdmin.vue
@@ -19,7 +19,6 @@
           :options="options"
           v-model="searchForm2.location"
           :props="{ checkStrictly: true }"
-          @change="getlocation"
           :placeholder="scope.item.placeholder"
           style="width: 100%"
           clearable
@@ -91,8 +90,8 @@ export default {
       // 搜索
       searchConfig: {},
       searchForm1: {
-        farmName: "",
-        type: "",
+        farmName: undefined,
+        type: undefined,
       },
       searchForm2: {
         location: [],
@@ -106,8 +105,8 @@ export default {
       // 新增 or 编辑
       modalConfig: {},
       modalForm1: {
-        farmName: "",
-        type: "",
+        farmName: undefined,
+        type: undefined,
       },
       location: [],
       modalForm2: {
@@ -142,17 +141,13 @@ export default {
     handleSearchEvent(params) {
       this.searchForm = {
         ...params,
-        ...this.searchForm2,
+        location: this.searchForm2.location.join(","),
       };
     },
     // 清空数据
     handleClearEvent() {
       this.searchForm2.location = [];
     },
-    // 地点
-    getlocation(val) {
-      console.log(val);
-    },
     // 模态框的 位置
     submitLocation(val) {
       this.modalForm2.location = val.join();
@@ -170,14 +165,14 @@ export default {
     },
   },
   watch: {
-    "searchForm2.location": {
-      handler(newVal) {
-        if (typeof newVal === "object") {
-          this.searchForm2.location = newVal.join();
-        }
-      },
-      deep: true,
-    },
+    // "searchForm2.location": {
+    //   handler(newVal) {
+    //     if (typeof newVal === "object") {
+    //       this.searchForm2.location = newVal.join();
+    //     }
+    //   },
+    //   deep: true,
+    // },
   },
 };
 </script>

+ 5 - 2
src/views/basic-data/archives-admin/config/modal.config.js

@@ -12,13 +12,15 @@ export const modalItemProp = [
     type: 'input',
     field: 'farmName',
     placeholder: '请输入名称',
+    rules: [{ required: true, message: '名称不能为空', trigger: 'blur' }]
   },
   {
     label: '位置:',
     type: 'custom',
     field: 'location',
     slotName: 'location',
-    placeholder: '请选择位置'
+    placeholder: '请选择位置',
+    rules: [{ required: true, message: '位置不能为空', trigger: 'change'}]
   },
   {
     label: '企业类型:',
@@ -38,6 +40,7 @@ export const modalItemProp = [
         label: '检疫机构',
         value: 3
       }
-    ]
+    ],
+    rules: [{ required: true, message: '企业类型不能为空', trigger: 'change'}]
   },
 ]

+ 1 - 1
src/views/basic-data/house-admin/config/modal.config.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2022-01-08 16:08:30
- * @LastEditTime: 2022-01-12 15:51:16
+ * @LastEditTime: 2022-01-17 14:32:15
  * @LastEditors: Please set LastEditors
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  * @FilePath: \goldenPig\src\views\basic-data\archives-admin\config\modal.config.js