Просмотр исходного кода

feat:移除行政区划关联的水权设置

zhb 8 месяцев назад
Родитель
Сommit
bf0e29a803

+ 13 - 13
src/api/waterright/index.js

@@ -1,37 +1,37 @@
-import request from '@/utils/request'
+import request from '@/utils/request';
 
 // 列表
-export const getWaterrightList = query => {
+export const getWaterrightList = (query) => {
   return request({
-    url: '/wpr/waterright/tree/list',
+    url: '/portalprod-api/system/SysCusarea/tree/v2/list',
     method: 'get',
     params: query
   });
-}
+};
 
 // 新增
-export const addWaterright = data => {
+export const addWaterright = (data) => {
   return request({
     url: '/wpr/waterright/add',
     method: 'post',
     data
-  }) 
-}
+  });
+};
 
 // 修改
-export const editWaterright = data => {
+export const editWaterright = (data) => {
   return request({
     url: '/wpr/waterright/edit',
     method: 'put',
     data
-  }) 
-}
+  });
+};
 
 // 获取上级区域水权信息
-export const getWaterrightUpareaInfo = query => {
+export const getWaterrightUpareaInfo = (query) => {
   return request({
     url: '/wpr/waterright/uparea/info',
     method: 'get',
     params: query
-  }) 
-}
+  });
+};

+ 14 - 16
src/components/DataReportLeft/index.vue

@@ -1,15 +1,15 @@
 <template>
   <div>
     <el-tree
-     :data="treeData"
-     ref="tree"
-     node-key="id"
-     :highlight-current="true"
-     :default-expanded-keys="[1]"
-     :current-node-key="currentNodekey"
-     :props="defaultProps"
-     @node-click="handleNodeClick"
-     ></el-tree>
+      :data="treeData"
+      ref="tree"
+      node-key="cusareaId"
+      :highlight-current="true"
+      :default-expanded-keys="[1]"
+      :current-node-key="currentNodekey"
+      :props="defaultProps"
+      @node-click="handleNodeClick"
+    ></el-tree>
   </div>
 </template>
 <script>
@@ -23,7 +23,7 @@ export default {
   },
   data() {
     return {
-      defaultProps:{
+      defaultProps: {
         children: 'children',
         label: 'cusareaName'
       },
@@ -31,9 +31,9 @@ export default {
     };
   },
   watch: {
-    treeData: { 
+    treeData: {
       handler(res) {
-        this.currentNodekey = res[0].id;
+        this.currentNodekey = res[0].cusareaId;
         this.$nextTick(() => {
           this.$refs.tree.setCurrentKey(this.currentNodekey);
         });
@@ -43,11 +43,9 @@ export default {
   },
   methods: {
     handleNodeClick(data) {
-      this.$emit("setCurrentData",data?.cusareaId,data)
+      this.$emit('setCurrentData', data?.cusareaId, data);
     }
   }
 };
 </script>
-<style lang="sass" scoped>
-
-</style>
+<style lang="sass" scoped></style>

+ 27 - 19
src/components/SelectTree/index.vue

@@ -1,7 +1,15 @@
 <template>
   <div>
-    <el-select class="form-input" v-model="cusareaName" filterable style="width: 100%;padding:0">
-      <el-option style="height: auto; padding:0;font-weight:normal" :value="node.cusareaName">
+    <el-select
+      class="form-input"
+      v-model="cusareaName"
+      filterable
+      style="width: 100%; padding: 0"
+    >
+      <el-option
+        style="height: auto; padding: 0; font-weight: normal"
+        :value="node.cusareaName"
+      >
         <el-tree
           :data="treeData"
           :expand-on-click-node="false"
@@ -12,7 +20,8 @@
           @check="handleClick"
           @node-click="handleNodeClick"
           :check-on-click-node="true"
-          :props="defaultProps">
+          :props="defaultProps"
+        >
         </el-tree>
       </el-option>
     </el-select>
@@ -41,8 +50,8 @@ export default {
   },
   data() {
     return {
-      defaultProps:{
-        children: 'children',
+      defaultProps: {
+        children: 'child',
         label: 'cusareaName',
         value: 'code'
       },
@@ -52,25 +61,25 @@ export default {
       cusareaName: this.checkVal,
       checkList: [],
       defaultChecked: []
-    }
+    };
   },
   watch: {
     checkVal: {
       handler(val) {
-        this.node.cusareaName = val
+        this.node.cusareaName = val;
       },
-      deep: true,
+      deep: true
     },
     checkedList: {
       handler(val) {
-        this.defaultChecked = val ? val.split(',') : []
+        this.defaultChecked = val ? val.split(',') : [];
       },
       deep: true,
       immediate: true
     },
     checkVal: {
       handler(val) {
-        this.cusareaName = val
+        this.cusareaName = val;
       }
     }
   },
@@ -78,24 +87,23 @@ export default {
     //点击节点
     handleNodeClick(data) {
       this.node = data;
-      this.$emit('handlerClick', data)
+      this.$emit('handlerClick', data);
     },
     //节点选中状态变化
     handleClick(val) {
-      this.checkList = this.$refs.treeForm.getCheckedKeys()
-      const checkNode = this.$refs.treeForm.getCheckedNodes()
-      this.cusareaName = val?.cusareaName
-      this.$emit('getCheckTree', this.checkList)
-      this.$emit('getCheckTreeNode', checkNode)
+      this.checkList = this.$refs.treeForm.getCheckedKeys();
+      const checkNode = this.$refs.treeForm.getCheckedNodes();
+      this.cusareaName = val?.cusareaName;
+      this.$emit('getCheckTree', this.checkList);
+      this.$emit('getCheckTreeNode', checkNode);
     }
   }
 };
 </script>
 <style lang="scss" scoped>
 ::v-deep .el-select-dropdown__item {
-  padding: 0 !important
+  padding: 0 !important;
 }
 .tree-container {
-
 }
-</style>
+</style>

+ 6 - 7
src/views/peasantHouseholdManage/components/addedFarmers.vue

@@ -28,13 +28,12 @@
                   :placeholder="'请选择区域'"
                   style="width: 100%"
                   :treeData="treeData"
-                  @handlerClick="handlerClick"
                   :checkVal="cusareaName"
                 ></select-tree>
               </el-col>
             </el-row>
           </el-form-item>
-          <el-col>
+          <!-- <el-col>
             <el-row class="area">
               <el-col> <label>总面积:</label>{{ areaAll }}亩 </el-col>
               <el-col> <label>总水权:</label>{{ waterRightAll }}m³ </el-col>
@@ -43,7 +42,7 @@
                 <label>剩余水权:</label>{{ residualWaterRight }}m³
               </el-col>
             </el-row>
-          </el-col>
+          </el-col> -->
         </el-col>
         <el-col :span="24">
           <el-row>
@@ -99,7 +98,7 @@
                 </el-row>
               </el-form-item>
             </el-col>
-            <el-col :span="12">
+            <!-- <el-col :span="12">
               <el-form-item label="土地面积" prop="farmerAreasize">
                 <el-row>
                   <el-col style="position: relative">
@@ -117,10 +116,10 @@
                   </el-col>
                 </el-row>
               </el-form-item>
-            </el-col>
+            </el-col> -->
           </el-row>
         </el-col>
-        <el-col :span="24">
+        <!-- <el-col :span="24">
           <el-row>
             <el-col :span="12">
               <el-form-item label="水权" prop="farmerWramount">
@@ -139,7 +138,7 @@
               </el-form-item>
             </el-col>
           </el-row>
-        </el-col>
+        </el-col> -->
       </el-row>
     </el-form>
     <div style="text-align: right">