Kaynağa Gözat

fix: bug修改

allen 2 yıl önce
ebeveyn
işleme
cd72be25b2

+ 2 - 2
.env.development

@@ -5,13 +5,13 @@ VUE_APP_TITLE = 水价改革管理系统
 ENV = 'development'
 ENV = 'development'
 
 
 # 开发环境 API BASEURL
 # 开发环境 API BASEURL
-VUE_APP_BASE_API = '/fmsdev-api'
+VUE_APP_BASE_API = 
 
 
 # 路由懒加载
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true
 VUE_CLI_BABEL_TRANSPILE_MODULES = true
 
 
 #
 #
-VUE_APP_BASE_RESOURCE_PREFIX = /fmsdev-api
+VUE_APP_BASE_RESOURCE_PREFIX = 
 
 
 SYS_ID = TODO
 SYS_ID = TODO
 
 

+ 3 - 5
src/components/SelectTree/index.vue

@@ -1,6 +1,6 @@
 <template>
 <template>
   <div>
   <div>
-    <el-select class="form-input" v-model="node.cusareaName" filterable style="width: 100%;padding:0">
+    <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-option style="height: auto; padding:0;font-weight:normal" :value="node.cusareaName">
         <el-tree
         <el-tree
           :data="treeData"
           :data="treeData"
@@ -49,6 +49,7 @@ export default {
       node: {
       node: {
         cusareaName: this.checkVal
         cusareaName: this.checkVal
       },
       },
+      cusareaName: this.checkVal,
       checkList: [],
       checkList: [],
       defaultChecked: []
       defaultChecked: []
     }
     }
@@ -78,10 +79,7 @@ export default {
     handleClick(val) {
     handleClick(val) {
       this.checkList = this.$refs.treeForm.getCheckedKeys()
       this.checkList = this.$refs.treeForm.getCheckedKeys()
       const checkNode = this.$refs.treeForm.getCheckedNodes()
       const checkNode = this.$refs.treeForm.getCheckedNodes()
-      this.node.cusareaName = val?.cusareaName
-      if (!this.checkList.length) {
-        this.node.cusareaName = ''
-      }
+      this.cusareaName = val?.cusareaName
       this.$emit('getCheckTree', this.checkList)
       this.$emit('getCheckTree', this.checkList)
       this.$emit('getCheckTreeNode', checkNode)
       this.$emit('getCheckTreeNode', checkNode)
     }
     }

+ 3 - 7
src/layout/components/Navbar.vue

@@ -9,10 +9,6 @@
 
 
     <div class="right-menu">
     <div class="right-menu">
       <!--导航栏快捷键信息-->
       <!--导航栏快捷键信息-->
-      <div class="right-menu-item hover-effect" style="margin-right: 20px">
-        <message-button />
-      </div>
-
       <el-dropdown
       <el-dropdown
         class="avatar-container right-menu-item hover-effect"
         class="avatar-container right-menu-item hover-effect"
         trigger="click"
         trigger="click"
@@ -23,10 +19,10 @@
           <!-- <i class="el-icon-caret-bottom" /> -->
           <!-- <i class="el-icon-caret-bottom" /> -->
         </div>
         </div>
         <el-dropdown-menu slot="dropdown">
         <el-dropdown-menu slot="dropdown">
-          <router-link to="/user/profile">
+          <!-- <router-link to="/user/profile">
             <el-dropdown-item>个人中心</el-dropdown-item>
             <el-dropdown-item>个人中心</el-dropdown-item>
-          </router-link>
-          <el-dropdown-item divided @click.native="logout">
+          </router-link> -->
+          <el-dropdown-item @click.native="logout">
             <span>退出登录</span>
             <span>退出登录</span>
           </el-dropdown-item>
           </el-dropdown-item>
         </el-dropdown-menu>
         </el-dropdown-menu>

+ 1 - 0
src/views/dataReport/saveWaterAnalysis.vue

@@ -134,6 +134,7 @@ export default {
       return getFarmerList(payload);
       return getFarmerList(payload);
     },
     },
     setYear() {
     setYear() {
+      this.options = []
       let date = new Date
       let date = new Date
       let currentYear = date.getFullYear()
       let currentYear = date.getFullYear()
       this.currentYear = currentYear
       this.currentYear = currentYear

+ 1 - 1
src/views/gisShow/components/echartsGradient.vue

@@ -106,7 +106,7 @@ export default {
           }
           }
         ],
         ],
         yAxis: [{
         yAxis: [{
-          name: '用水单位: ',
+          name: '用水单位: ',
           nameTextStyle: {color: '#333'},
           nameTextStyle: {color: '#333'},
           type: "value",
           type: "value",
           min:0,
           min:0,

+ 1 - 0
src/views/gisShow/components/mapContainer.vue

@@ -78,6 +78,7 @@ import runing from '../assets/runing.svg'
             size: new AMap.Size(130, 130), //图片大小
             size: new AMap.Size(130, 130), //图片大小
             imageSize: new AMap.Size(50, 50), //图片拉伸设置
             imageSize: new AMap.Size(50, 50), //图片拉伸设置
           });
           });
+
           var marker = new AMap.Marker({
           var marker = new AMap.Marker({
             position: new AMap.LngLat(lng, lat), //定义图标的位置
             position: new AMap.LngLat(lng, lat), //定义图标的位置
             offset: new AMap.Pixel(0, 0), //设置图标偏移量
             offset: new AMap.Pixel(0, 0), //设置图标偏移量

+ 1 - 1
src/views/gisShow/index.vue

@@ -94,7 +94,7 @@ export default {
         tmnstatusRunstatus: this.tmnstatusRunstatus
         tmnstatusRunstatus: this.tmnstatusRunstatus
       })
       })
       this.positions = res?.data
       this.positions = res?.data
-      this.center = [res?.data[0]?.tmnLongitude, res?.data[0]?.tmnLatitude]
+      this.center = [res?.data[0]?.tmnLongitude || 116.397428, res?.data[0]?.tmnLatitude || 39.90923]
     },
     },
     searchMap() {
     searchMap() {
       let that = this;
       let that = this;

+ 7 - 1
src/views/home/assets/home.scss

@@ -13,7 +13,7 @@
   .pie-right{
   .pie-right{
     position: absolute;
     position: absolute;
     top: 33%;
     top: 33%;
-    left: 60%;
+    left: 58%;
     .pie-item{
     .pie-item{
       margin: 15px 0;
       margin: 15px 0;
       color: #333;
       color: #333;
@@ -35,6 +35,12 @@
         }
         }
       }
       }
     }
     }
+    .last-year{
+      display: flex;
+      svg{
+        margin-left: 5px;
+      }
+    }
   }
   }
 }
 }
 .card{
 .card{

+ 1 - 1
src/views/home/components/echartsGradient.vue

@@ -133,7 +133,7 @@ export default {
           }
           }
         ],
         ],
         yAxis: [{
         yAxis: [{
-          name: '用水单位: ',
+          name: '用水单位: ',
           nameTextStyle: {color: '#333'},
           nameTextStyle: {color: '#333'},
           type: "value",
           type: "value",
           min:0,
           min:0,

+ 5 - 1
src/views/home/components/echartsPie.vue

@@ -138,7 +138,11 @@ export default {
               show: false
               show: false
             },
             },
             data: [
             data: [
-              { value: this.useWaterNumTotal, name: 'Direct',itemStyle:{color: '#1890FF'} },
+              {
+                value: this.useWaterNumTotal, name: 'Direct', itemStyle: {
+                  color: this.useWaterNumTotal != 0 ? '#1890FF':'#D9D9D9'
+                }
+              },
               { value: this.waterNum, name: 'Direct2',itemStyle:{color: '#D9D9D9'} }
               { value: this.waterNum, name: 'Direct2',itemStyle:{color: '#D9D9D9'} }
             ]
             ]
           }
           }

+ 18 - 6
src/views/home/index.vue

@@ -69,9 +69,21 @@
                 <span>剩余水量:</span>
                 <span>剩余水量:</span>
                 <span>{{ waterBalance || 0 }} m³</span>
                 <span>{{ waterBalance || 0 }} m³</span>
               </div>
               </div>
-              <div class="pie-item">
+              <div class="pie-item last-year">
                 <span>去年同期节水:</span>
                 <span>去年同期节水:</span>
                 <span>{{ waterSave || 0 }} m³</span>
                 <span>{{ waterSave || 0 }} m³</span>
+                <svg
+                  xmlns="http://www.w3.org/2000/svg"
+                  width="16"
+                  height="16"
+                  viewBox="0 0 16 16"
+                  fill="none"
+                >
+                  <path
+                    d="M6.66797 9.33335V3.16668C6.66797 2.79668 6.96931 2.50002 7.34131 2.50002H8.66131C8.74941 2.49914 8.83682 2.51573 8.91848 2.54884C9.00013 2.58195 9.07441 2.63091 9.13703 2.69291C9.19964 2.7549 9.24934 2.82869 9.28326 2.91001C9.31718 2.99133 9.33464 3.07857 9.33464 3.16668V9.33335H10.662C11.4 9.33335 11.6433 9.81068 11.202 10.4L8.80131 13.6C8.35597 14.1934 7.64331 14.1894 7.20131 13.6L4.80131 10.4C4.35597 9.80668 4.60131 9.33335 5.34064 9.33335H6.66797Z"
+                    fill="#14A478"
+                  />
+                </svg>
               </div>
               </div>
               <div class="pie-item">
               <div class="pie-item">
                 <span>节水率:</span>
                 <span>节水率:</span>
@@ -112,7 +124,7 @@ export default {
   components:{
   components:{
     echartsPieVue,
     echartsPieVue,
     echartsGradient,
     echartsGradient,
-    SelectTree
+    SelectTree,
   },
   },
   data() {
   data() {
     return {
     return {
@@ -158,7 +170,7 @@ export default {
       waterrightYear: '2023',
       waterrightYear: '2023',
       list: [[{
       list: [[{
         imageSrc: electricity,
         imageSrc: electricity,
-        title: '水数目(口)',
+        title: '水数目(口)',
         number: 551
         number: 551
       },{
       },{
         imageSrc: numberWells,
         imageSrc: numberWells,
@@ -246,7 +258,7 @@ export default {
       this.byMonthList = this.requestData.byMonthList
       this.byMonthList = this.requestData.byMonthList
       this.list = [[{
       this.list = [[{
         imageSrc: numberWells,
         imageSrc: numberWells,
-        title: '水数目(口)',
+        title: '水数目(口)',
         number: this.waterNumTotal || 0
         number: this.waterNumTotal || 0
       }, {
       }, {
         imageSrc: electricity,
         imageSrc: electricity,
@@ -254,7 +266,7 @@ export default {
         number: this.elecNumTotal || 0
         number: this.elecNumTotal || 0
       }, {
       }, {
         imageSrc: waterYield,
         imageSrc: waterYield,
-        title: '使用水量()',
+        title: '使用水量()',
         number: this.useWaterNumTotal || 0
         number: this.useWaterNumTotal || 0
       }, {
       }, {
         imageSrc: moneyIcon,
         imageSrc: moneyIcon,
@@ -274,7 +286,7 @@ export default {
         number: this.areaSize || 0
         number: this.areaSize || 0
       }, {
       }, {
         imageSrc: water,
         imageSrc: water,
-        title: '亩均用水量()',
+        title: '亩均用水量()',
         number: this.useWaterPerMu || 0
         number: this.useWaterPerMu || 0
       }, {
       }, {
         imageSrc: moneyIcon,
         imageSrc: moneyIcon,

+ 15 - 4
src/views/infrastructure/components/recompose.vue

@@ -46,6 +46,7 @@
           <el-input
           <el-input
             placeholder="请输入"
             placeholder="请输入"
             type="number"
             type="number"
+            @input="areasizeResidueHandler"
             :max="Number(infoData.areasizeResidue || 0)"
             :max="Number(infoData.areasizeResidue || 0)"
             v-model="baseForm.area"
             v-model="baseForm.area"
             style="width:250px;"
             style="width:250px;"
@@ -60,6 +61,7 @@
             type="number"
             type="number"
             placeholder="请输入"
             placeholder="请输入"
             style="width:250px;"
             style="width:250px;"
+            @input="waterrightAmountHandler"
             :max="Number(infoData.waterrightAmount || 0)"
             :max="Number(infoData.waterrightAmount || 0)"
             v-model="baseForm.ratedWater">
             v-model="baseForm.ratedWater">
           </el-input>
           </el-input>
@@ -134,8 +136,9 @@ export default {
       hasFetched: false,
       hasFetched: false,
       rules: {
       rules: {
         area: [
         area: [
-          { required: true, validator: (rule, value, callback) => {
-              if (!value) { callback(new Error('请输入面积')); return }
+          {
+            required: true, validator: (rule, value, callback) => {
+              if (!+value) { callback(new Error('请输入面积')); return }
               if (isNaN(value)) callback(new Error('请正确输入您的面积'))
               if (isNaN(value)) callback(new Error('请正确输入您的面积'))
               else if (value > this.infoData.areasizeResidue) {
               else if (value > this.infoData.areasizeResidue) {
                 callback(new Error('输入的面积不能大于总面积'))
                 callback(new Error('输入的面积不能大于总面积'))
@@ -146,7 +149,7 @@ export default {
         ],
         ],
         ratedWater: [
         ratedWater: [
           { required: true, validator: (rule, value, callback) => {
           { required: true, validator: (rule, value, callback) => {
-            if (!value) {  callback(new Error('请输入额定水权'));  return}
+            if (!+value) {  callback(new Error('请输入额定水权'));  return}
             if(isNaN(value)) callback(new Error('请正确输入您的额定水权'))
             if(isNaN(value)) callback(new Error('请正确输入您的额定水权'))
             else if (value > this.infoData.waterrightAmount) {
             else if (value > this.infoData.waterrightAmount) {
               callback(new Error('输入的额定水权不能大于总额定水权'))
               callback(new Error('输入的额定水权不能大于总额定水权'))
@@ -180,13 +183,21 @@ export default {
       handler(val) { 
       handler(val) { 
         const { area, ratedWater } = val
         const { area, ratedWater } = val
         if (area && ratedWater) {
         if (area && ratedWater) {
-          this.averageWater =  (+ratedWater / +area).toFixed(2)
+          this.averageWater = !+area ? 0 : (+ratedWater / +area).toFixed(2)
+        } else { 
+          this.averageWater = 0
         }
         }
       },
       },
       deep: true
       deep: true
      }
      }
   },
   },
   methods: {
   methods: {
+    areasizeResidueHandler(v) {
+      this.baseForm.area = v.replace(/^(\d*\.?\d{0,2}).*/, '$1');
+    },
+    waterrightAmountHandler(v) {
+      this.baseForm.ratedWater = v.replace(/^(\d*\.?\d{0,2}).*/, '$1');
+    },
     async getWaterrightUpareaList(row) {
     async getWaterrightUpareaList(row) {
       const { waterrightId } = row
       const { waterrightId } = row
       const res = await getWaterrightUpareaInfo({
       const res = await getWaterrightUpareaInfo({

+ 4 - 1
src/views/infrastructure/waterElectricityPriceSetting.vue

@@ -315,6 +315,9 @@ export default {
     handleSearch() {
     handleSearch() {
       this.$refs.tableRef.refresh(true);
       this.$refs.tableRef.refresh(true);
     },
     },
+    handlerChange() {
+      this.$refs.tableRef.refresh(false);
+    },
     goDetail(row) {
     goDetail(row) {
       this.$refs.sourceCodeDetail.open(row.tarcecodeapplyBatchno)
       this.$refs.sourceCodeDetail.open(row.tarcecodeapplyBatchno)
     },
     },
@@ -327,7 +330,7 @@ export default {
           priceconfigIds: priceconfigId
           priceconfigIds: priceconfigId
         }).then(() => {
         }).then(() => {
           Message({ message: "删除成功", type: 'success' });
           Message({ message: "删除成功", type: 'success' });
-          this.handleSearch()
+          this.handlerChange()
         })
         })
       })
       })
     }
     }

+ 5 - 2
src/views/infrastructure/waterEstablishment.vue

@@ -19,7 +19,7 @@
                 :value="item.value">
                 :value="item.value">
               </el-option>
               </el-option>
             </el-select>
             </el-select>
-            <select-tree 
+            <select-tree
               :placeholder="'年份'" 
               :placeholder="'年份'" 
               style="width:100%"
               style="width:100%"
               :treeData="treeData"
               :treeData="treeData"
@@ -100,7 +100,7 @@
       :visible.sync="recomposeShow"
       :visible.sync="recomposeShow"
       :editRow="editRow"
       :editRow="editRow"
       @resetEdit="resetEdit"
       @resetEdit="resetEdit"
-      @refresh="handleSearch"
+      @refresh="handlerChange"
     />
     />
     <water-price-setting :visible.sync="waterprice" @refresh="handleSearch"/>
     <water-price-setting :visible.sync="waterprice" @refresh="handleSearch"/>
   </el-row>
   </el-row>
@@ -217,6 +217,9 @@ export default {
     handleSearch() { 
     handleSearch() { 
       this.$refs.tableRef.refresh(true);
       this.$refs.tableRef.refresh(true);
     },
     },
+    handlerChange() {
+      this.$refs.tableRef.refresh(false);
+    },
     setAnnualWaterRight() {
     setAnnualWaterRight() {
       this.waterprice = true
       this.waterprice = true
     },
     },

+ 1 - 1
src/views/peasantHouseholdManage/components/IrrigationRecord.vue

@@ -79,7 +79,7 @@ export default {
           align: 'center'
           align: 'center'
         },
         },
         {
         {
-          label: '本次用水量(°)',
+          label: '本次用水量()',
           prop: 'cardusercdWaternum',
           prop: 'cardusercdWaternum',
           customRender: '',
           customRender: '',
           align: 'center'
           align: 'center'

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

@@ -193,6 +193,7 @@ export default {
   },
   },
   data() {
   data() {
     return {
     return {
+      treeDataArr: [],
       dialogSubmitLoading: false,
       dialogSubmitLoading: false,
       dialogVisible: false,
       dialogVisible: false,
       baseForm: { ...this.editFarmerData },
       baseForm: { ...this.editFarmerData },
@@ -276,21 +277,27 @@ export default {
       handler(val) {
       handler(val) {
         this.baseForm = {...val }
         this.baseForm = {...val }
         this.cusareaName = val.cusareaName
         this.cusareaName = val.cusareaName
+        this.setItem(this.treeDataArr)
       },
       },
       deep: true
       deep: true
     },
     },
     treeData: {
     treeData: {
-      handler(val) { 
-        const value = this.findItemByAreaId(this.currentClickId, val)
-        this.areaAll = value?.waterrightAreasize
-        this.waterRightAll = value?.waterrightAmount
-        this.yieldPer = value?.waterrightAmount == 0 ? 0 : (value?.waterrightAreasize) / (value?.waterrightAmount)
-        this.residualWaterRight = value?.amountResidue ?? 0
+      handler(val) {
+        this.treeDataArr = val ?? [];
+        this.setItem(val)
       },
       },
-      deep: true
+      deep: true,
+      immediate: true
     }
     }
   },
   },
   methods: {
   methods: {
+    setItem(val) { 
+      const value = this.findItemByAreaId(this.currentClickId, val)
+      this.areaAll = value?.waterrightAreasize
+      this.waterRightAll = value?.waterrightAmount
+      this.yieldPer = value?.waterrightAmount == 0 ? 0 : (value?.waterrightAreasize) / (value?.waterrightAmount)
+      this.residualWaterRight = value?.amountResidue ?? 0
+    },
     findItemByAreaId(areaId,list) {
     findItemByAreaId(areaId,list) {
       return list.find(item => item.areaId === areaId)
       return list.find(item => item.areaId === areaId)
     },
     },
@@ -338,6 +345,10 @@ export default {
 .input-number {
 .input-number {
   width: 100%;
   width: 100%;
 }
 }
+.el-col-5{
+  width:auto;
+  min-width: 20%;
+}
 .area{
 .area{
   margin:0 0 20px 20px;
   margin:0 0 20px 20px;
   label{
   label{

+ 4 - 1
src/views/peasantHouseholdManage/index.vue

@@ -306,6 +306,9 @@ export default {
     handleSearch() {
     handleSearch() {
       this.$refs.tableRef.refresh(true);
       this.$refs.tableRef.refresh(true);
     },
     },
+    handlerChange() {
+      this.$refs.tableRef.refresh(false);
+    },
     deleteRow(row) {
     deleteRow(row) {
       this.$modal
       this.$modal
       .confirm(`是否确认删除农户${row.farmerName}`)
       .confirm(`是否确认删除农户${row.farmerName}`)
@@ -314,7 +317,7 @@ export default {
           farmerIds: row.farmerId
           farmerIds: row.farmerId
         }).then(() => {
         }).then(() => {
           Message({ message: "删除成功", type: 'success' });
           Message({ message: "删除成功", type: 'success' });
-          this.handleSearch()
+          this.handlerChange()
         })
         })
       })
       })
     }
     }

+ 1 - 1
src/views/waterCardManage/dataDetail.vue

@@ -132,7 +132,7 @@ export default {
           align: 'center'
           align: 'center'
         },
         },
         {
         {
-          label: '本次用水量(°)',
+          label: '本次用水量()',
           prop: 'cardusercdWaternum',
           prop: 'cardusercdWaternum',
           customRender: '',
           customRender: '',
           align: 'center'
           align: 'center'

+ 9 - 4
src/views/waterCardManage/index.vue

@@ -145,7 +145,7 @@
     <recharge-card
     <recharge-card
       :visible.sync="rechargeShow"
       :visible.sync="rechargeShow"
       :rechargeCardData="rechargeCardData"
       :rechargeCardData="rechargeCardData"
-      @refresh="handleSearch"
+      @refresh="handlerChange"
     />
     />
     <data-detail 
     <data-detail 
       v-if="detailType"
       v-if="detailType"
@@ -271,7 +271,7 @@ export default {
         cardId,
         cardId,
         cardStatus
         cardStatus
       })
       })
-      this.handleSearch()
+      this.handlerChange()
     },
     },
     // 删除
     // 删除
     deleteCardHandler(row){
     deleteCardHandler(row){
@@ -283,7 +283,7 @@ export default {
           cardIds: cardId
           cardIds: cardId
         }).then(() => {
         }).then(() => {
           Message({ message: "删除成功", type: 'success' });
           Message({ message: "删除成功", type: 'success' });
-          this.handleSearch()
+          this.handlerChange()
         })
         })
       })
       })
     },
     },
@@ -292,7 +292,9 @@ export default {
     async searchHandler(farmerName,areaId) {
     async searchHandler(farmerName,areaId) {
       const res = await getFarmerList({
       const res = await getFarmerList({
         farmerName,
         farmerName,
-        areaId
+        areaId,
+        pageNum: 1,
+        pageSize: 9999999
       })
       })
       this.userList = res.data
       this.userList = res.data
     },
     },
@@ -356,6 +358,9 @@ export default {
     handleSearch() {
     handleSearch() {
       this.$refs.tableRef.refresh(true);
       this.$refs.tableRef.refresh(true);
     },
     },
+    handlerChange() { 
+      this.$refs.tableRef.refresh(false);
+    },
     rechargeCardHandler(row) {
     rechargeCardHandler(row) {
       this.rechargeCardData = row
       this.rechargeCardData = row
       this.rechargeShow = true
       this.rechargeShow = true

+ 12 - 17
src/views/waterManage/component/associationManage.vue

@@ -173,7 +173,7 @@ export default {
       hasFetched: false,
       hasFetched: false,
       rules: {
       rules: {
          assocManageid: [
          assocManageid: [
-          { required: true, message: '请选择负责人', trigger: 'change' }
+          { required: true, message: '请选择负责人', trigger: 'blur' }
         ],
         ],
         assocName: [
         assocName: [
           { required: true, message: '请输入您的协会名称', trigger: 'blur' }
           { required: true, message: '请输入您的协会名称', trigger: 'blur' }
@@ -184,7 +184,10 @@ export default {
         areaIds: [
         areaIds: [
           {
           {
             required: true, validator: (rule, value, callback) => {
             required: true, validator: (rule, value, callback) => {
-              if (!value) { callback(new Error('请输入您的管辖范围')) }
+              if (!value) {
+                callback(new Error('请输入您的管辖范围'));
+                this.cusareaName = ''
+              }
               else { 
               else { 
                 callback()
                 callback()
               };
               };
@@ -219,7 +222,7 @@ export default {
         this.baseForm.areaIds = val.areaIds
         this.baseForm.areaIds = val.areaIds
         this.allAreaIds = val.areaIds
         this.allAreaIds = val.areaIds
         const treeNodeList = val?.cusareaNames?.split(',') || []
         const treeNodeList = val?.cusareaNames?.split(',') || []
-        this.cusareaName = treeNodeList[treeNodeList.length - 1]
+        this.cusareaName = treeNodeList[0]
         this.treeNodeList = treeNodeList
         this.treeNodeList = treeNodeList
       },
       },
       deep: true
       deep: true
@@ -228,12 +231,11 @@ export default {
       handler(val) {
       handler(val) {
         const { areaIds } = val
         const { areaIds } = val
         if (areaIds != '') {
         if (areaIds != '') {
-          this.cusareaName = ''
-          
           this.$refs?.baseForm?.clearValidate(['areaIds'])
           this.$refs?.baseForm?.clearValidate(['areaIds'])
         } else { 
         } else { 
-          this.$refs['baseForm'].validateField('areaIds')
+          this.$refs.baseForm.validateField('areaIds')
         }
         }
+        
       },
       },
       deep: true
       deep: true
     }
     }
@@ -247,19 +249,13 @@ export default {
     },
     },
     resetForm() {
     resetForm() {
       this.dialogVisible = false;
       this.dialogVisible = false;
-      this.cusareaName = ''
       this.$refs.baseForm.resetFields();
       this.$refs.baseForm.resetFields();
-    },
-    resetFormData() {
-      this.baseForm = {
-        assocName: '',
-        assocManageid: '',
-        assocRemark: '',
-        areaIds: []
-      };
+      setTimeout(() => {
+        this.$refs.baseForm.clearValidate();
+      })
     },
     },
     async addAssocHandler() {
     async addAssocHandler() {
-      if (this.editAssoc === 'add') {
+      if (this.typeAssoc === 'add') {
         const params = {
         const params = {
           ...this.baseForm
           ...this.baseForm
         }
         }
@@ -281,7 +277,6 @@ export default {
     },
     },
     handleClose() {
     handleClose() {
       this.$emit('update:visible', false);
       this.$emit('update:visible', false);
-      // this.resetFormData()
       this.resetForm('baseForm');
       this.resetForm('baseForm');
     },
     },
   }
   }

+ 4 - 1
src/views/waterManage/index.vue

@@ -162,7 +162,7 @@ export default {
             assocIds
             assocIds
           }).then(() => {
           }).then(() => {
             Message({ message: "删除成功", type: 'success' });
             Message({ message: "删除成功", type: 'success' });
-            this.handleSearch()
+            this.handlerChange()
           })
           })
       })
       })
     },
     },
@@ -193,6 +193,9 @@ export default {
     handleSearch() {
     handleSearch() {
       this.$refs.tableRef.refresh(true);
       this.$refs.tableRef.refresh(true);
     },
     },
+    handlerChange() {
+      this.$refs.tableRef.refresh(false);
+    },
     // 修改
     // 修改
     editRowHandler(row) {
     editRowHandler(row) {
       this.typeAssoc = 'edit'
       this.typeAssoc = 'edit'

+ 3 - 1
src/views/waterMarket/component/waterDeal.vue

@@ -258,7 +258,9 @@ export default {
         trxrcdPrice: 0,
         trxrcdPrice: 0,
         trxrcdNum: 0
         trxrcdNum: 0
       }
       }
-       this.$refs.baseForm.resetFields();
+      this.sellerRow = {};
+      this.buyerRow = {};
+      this.$refs.baseForm.resetFields();
     },
     },
     handleClose() {
     handleClose() {
       this.$emit('update:visible', false);
       this.$emit('update:visible', false);

+ 6 - 1
src/views/waterMarket/index.vue

@@ -10,6 +10,7 @@
             <el-select
             <el-select
               style="display:inline-block;width: 100px;margin-right: "
               style="display:inline-block;width: 100px;margin-right: "
               v-model="roleType"
               v-model="roleType"
+              @change="changeRoleType"
             >
             >
               <el-option
               <el-option
                 label="买方"
                 label="买方"
@@ -25,7 +26,7 @@
             <el-input
             <el-input
               v-model="trxrcdName"
               v-model="trxrcdName"
               style="width: 250px;margin-left: 16px"
               style="width: 250px;margin-left: 16px"
-              placeholder="请输入买方姓名"
+              :placeholder="placeholder"
               @keyup.enter.native="handleSearch"
               @keyup.enter.native="handleSearch"
               clearable
               clearable
             />
             />
@@ -105,6 +106,7 @@ export default {
   components: { BTable, WaterDeal },
   components: { BTable, WaterDeal },
   data() {
   data() {
     return {
     return {
+      placeholder: '请输入买方姓名',
       roleType: '0',
       roleType: '0',
       dateValue:"",
       dateValue:"",
       trxrcdName:'',
       trxrcdName:'',
@@ -157,6 +159,9 @@ export default {
       const res = await getFarmerList()
       const res = await getFarmerList()
       this.farmerList = res.data
       this.farmerList = res.data
     },
     },
+    changeRoleType(type) {
+      this.placeholder = type == 1 ? '请输入卖方姓名':'请输入买方姓名'
+    },
     addAssociation() {
     addAssociation() {
       this.associationManageShow = true
       this.associationManageShow = true
     },
     },

+ 15 - 6
src/views/waterSubsidy/components/newPolicy.vue

@@ -160,6 +160,7 @@ export default {
     },
     },
     editRow: {
     editRow: {
       handler(val) {
       handler(val) {
+        console.log(val,'valvlalvalvallva')
         this.baseForm = { ...this.editRow }
         this.baseForm = { ...this.editRow }
       },
       },
       deep: true
       deep: true
@@ -167,11 +168,11 @@ export default {
     baseForm: {
     baseForm: {
       handler(val) {
       handler(val) {
         const { src, subsidypolicyContent } = val
         const { src, subsidypolicyContent } = val
-        if (src) this.$refs['baseForm'].clearValidate(['src'])
+        if (src) this.$refs.baseForm.clearValidate(['src'])
         if (!checkEmpty(subsidypolicyContent)) {
         if (!checkEmpty(subsidypolicyContent)) {
-          this.$refs['baseForm'].clearValidate(['subsidypolicyContent'])
+          this.$refs.baseForm.clearValidate(['subsidypolicyContent'])
         } else { 
         } else { 
-          this.$refs['baseForm'].validateField('subsidypolicyContent')
+          this.$refs.baseForm.validateField('subsidypolicyContent')
         }
         }
       },
       },
       deep: true
       deep: true
@@ -189,7 +190,12 @@ export default {
       Message.error("图片插入失败");
       Message.error("图片插入失败");
     },
     },
     beforeAvatarUpload(file) {
     beforeAvatarUpload(file) {
-      const isJPG = file.type === 'image/jpeg';
+      const fileName = file.name;
+      const fileType = fileName.substring(fileName.lastIndexOf('.'));
+      const isOKType =
+        fileType === '.jpg' ||
+        fileType === '.png' ||
+        fileType === '.jpeg';
       const isLt2M = file.size / 1024 / 1024 < 2;
       const isLt2M = file.size / 1024 / 1024 < 2;
       if (!isLt2M) {
       if (!isLt2M) {
         Message({
         Message({
@@ -197,11 +203,14 @@ export default {
           message: '上传头像图片大小不能超过 2MB!'
           message: '上传头像图片大小不能超过 2MB!'
         })
         })
       }
       }
-      return isJPG && isLt2M;
+      return isOKType && isLt2M;
     },
     },
     resetForm() {
     resetForm() {
       this.dialogVisible = false;
       this.dialogVisible = false;
       this.resetFormData()
       this.resetFormData()
+      setTimeout(() => {
+        this.$refs.baseForm.clearValidate();
+      })
     },
     },
     
     
     resetFormData() {
     resetFormData() {
@@ -223,7 +232,7 @@ export default {
       } else { 
       } else { 
         const params = {
         const params = {
           areaIds: this.areaId,
           areaIds: this.areaId,
-          resIds: this.resId,
+          resIds: this.editRow.resIds,
           subsidypolicyContent: this.baseForm.subsidypolicyContent,
           subsidypolicyContent: this.baseForm.subsidypolicyContent,
           subsidypolicyTitle: this.baseForm.subsidypolicyTitle,
           subsidypolicyTitle: this.baseForm.subsidypolicyTitle,
           subsidypolicyId: this.baseForm.subsidypolicyId
           subsidypolicyId: this.baseForm.subsidypolicyId

+ 6 - 2
src/views/waterSubsidy/index.vue

@@ -188,6 +188,9 @@ export default {
     handleSearch() {
     handleSearch() {
       this.$refs.tableRef.refresh(true);
       this.$refs.tableRef.refresh(true);
     },
     },
+    handlerChange() {
+      this.$refs.tableRef.refresh(false);
+    },
     goDetail(row) {
     goDetail(row) {
       this.$refs.sourceCodeDetail.open(row.tarcecodeapplyBatchno)
       this.$refs.sourceCodeDetail.open(row.tarcecodeapplyBatchno)
     },
     },
@@ -197,7 +200,8 @@ export default {
         subsidypolicyTitle: row?.subsidypolicyTitle,
         subsidypolicyTitle: row?.subsidypolicyTitle,
         src: this.dialogImageUrl + row?.previews,
         src: this.dialogImageUrl + row?.previews,
         subsidypolicyContent: row?.subsidypolicyContent,
         subsidypolicyContent: row?.subsidypolicyContent,
-        subsidypolicyId: row?.subsidypolicyId
+        subsidypolicyId: row?.subsidypolicyId,
+        resIds: row?.resIds
       }
       }
       this.editRow = params
       this.editRow = params
       this.showPolicy = true
       this.showPolicy = true
@@ -211,7 +215,7 @@ export default {
           subsidypolicyIds: subsidypolicyId
           subsidypolicyIds: subsidypolicyId
         }).then(() => {
         }).then(() => {
           Message({ message: "删除成功", type: 'success' });
           Message({ message: "删除成功", type: 'success' });
-          this.handleSearch()
+          this.handlerChange()
         })
         })
       })
       })
     }
     }