Parcourir la source

fix: bug修改

allen il y a 2 ans
Parent
commit
cd72be25b2

+ 2 - 2
.env.development

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

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

@@ -1,6 +1,6 @@
 <template>
   <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-tree
           :data="treeData"
@@ -49,6 +49,7 @@ export default {
       node: {
         cusareaName: this.checkVal
       },
+      cusareaName: this.checkVal,
       checkList: [],
       defaultChecked: []
     }
@@ -78,10 +79,7 @@ export default {
     handleClick(val) {
       this.checkList = this.$refs.treeForm.getCheckedKeys()
       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('getCheckTreeNode', checkNode)
     }

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

@@ -9,10 +9,6 @@
 
     <div class="right-menu">
       <!--导航栏快捷键信息-->
-      <div class="right-menu-item hover-effect" style="margin-right: 20px">
-        <message-button />
-      </div>
-
       <el-dropdown
         class="avatar-container right-menu-item hover-effect"
         trigger="click"
@@ -23,10 +19,10 @@
           <!-- <i class="el-icon-caret-bottom" /> -->
         </div>
         <el-dropdown-menu slot="dropdown">
-          <router-link to="/user/profile">
+          <!-- <router-link to="/user/profile">
             <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>
           </el-dropdown-item>
         </el-dropdown-menu>

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

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

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

@@ -106,7 +106,7 @@ export default {
           }
         ],
         yAxis: [{
-          name: '用水单位: ',
+          name: '用水单位: ',
           nameTextStyle: {color: '#333'},
           type: "value",
           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), //图片大小
             imageSize: new AMap.Size(50, 50), //图片拉伸设置
           });
+
           var marker = new AMap.Marker({
             position: new AMap.LngLat(lng, lat), //定义图标的位置
             offset: new AMap.Pixel(0, 0), //设置图标偏移量

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

@@ -94,7 +94,7 @@ export default {
         tmnstatusRunstatus: this.tmnstatusRunstatus
       })
       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() {
       let that = this;

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

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

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

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

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

@@ -138,7 +138,11 @@ export default {
               show: false
             },
             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'} }
             ]
           }

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

@@ -69,9 +69,21 @@
                 <span>剩余水量:</span>
                 <span>{{ waterBalance || 0 }} m³</span>
               </div>
-              <div class="pie-item">
+              <div class="pie-item last-year">
                 <span>去年同期节水:</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 class="pie-item">
                 <span>节水率:</span>
@@ -112,7 +124,7 @@ export default {
   components:{
     echartsPieVue,
     echartsGradient,
-    SelectTree
+    SelectTree,
   },
   data() {
     return {
@@ -158,7 +170,7 @@ export default {
       waterrightYear: '2023',
       list: [[{
         imageSrc: electricity,
-        title: '水数目(口)',
+        title: '水数目(口)',
         number: 551
       },{
         imageSrc: numberWells,
@@ -246,7 +258,7 @@ export default {
       this.byMonthList = this.requestData.byMonthList
       this.list = [[{
         imageSrc: numberWells,
-        title: '水数目(口)',
+        title: '水数目(口)',
         number: this.waterNumTotal || 0
       }, {
         imageSrc: electricity,
@@ -254,7 +266,7 @@ export default {
         number: this.elecNumTotal || 0
       }, {
         imageSrc: waterYield,
-        title: '使用水量()',
+        title: '使用水量()',
         number: this.useWaterNumTotal || 0
       }, {
         imageSrc: moneyIcon,
@@ -274,7 +286,7 @@ export default {
         number: this.areaSize || 0
       }, {
         imageSrc: water,
-        title: '亩均用水量()',
+        title: '亩均用水量()',
         number: this.useWaterPerMu || 0
       }, {
         imageSrc: moneyIcon,

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

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

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

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

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

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

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

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

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

@@ -193,6 +193,7 @@ export default {
   },
   data() {
     return {
+      treeDataArr: [],
       dialogSubmitLoading: false,
       dialogVisible: false,
       baseForm: { ...this.editFarmerData },
@@ -276,21 +277,27 @@ export default {
       handler(val) {
         this.baseForm = {...val }
         this.cusareaName = val.cusareaName
+        this.setItem(this.treeDataArr)
       },
       deep: true
     },
     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: {
+    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) {
       return list.find(item => item.areaId === areaId)
     },
@@ -338,6 +345,10 @@ export default {
 .input-number {
   width: 100%;
 }
+.el-col-5{
+  width:auto;
+  min-width: 20%;
+}
 .area{
   margin:0 0 20px 20px;
   label{

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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