Forráskód Böngészése

Merge branch 'f-1002866',合并分支

liuyuedi 2 éve
szülő
commit
1e7ee1989e
47 módosított fájl, 1632 hozzáadás és 889 törlés
  1. 2 2
      .env.development
  2. BIN
      public/favicon.ico
  3. BIN
      public/favicon1.ico
  4. BIN
      public/static/template.xlsx
  5. 9 0
      src/api/card/index2.js
  6. 1 1
      src/api/farmer/list.js
  7. 8 2
      src/api/portal/portal.js
  8. 3 0
      src/assets/styles/index.scss
  9. 136 123
      src/assets/styles/ruoyi.scss
  10. 16 1
      src/components/DataReportLeft/index.vue
  11. 0 1
      src/layout/components/Navbar.vue
  12. 6 0
      src/layout/components/Sidebar/Logo.vue
  13. 11 1
      src/main.js
  14. 1 0
      src/permission.js
  15. 164 149
      src/router/index.js
  16. 14 0
      src/store/modules/settings.js
  17. 10 4
      src/store/modules/user.js
  18. 9 3
      src/utils/request.js
  19. 196 0
      src/utils/request2.js
  20. 3 2
      src/utils/sso.js
  21. 0 34
      src/views/dataReport/components/addedFarmers.vue
  22. 34 13
      src/views/dataReport/intakeWaterAnalysis.vue
  23. 21 4
      src/views/dataReport/saveWaterAnalysis.vue
  24. 22 3
      src/views/dataReport/waterConsumption.vue
  25. 13 1
      src/views/gisShow/components/rightEquipment.vue
  26. 1 1
      src/views/gisShow/index.vue
  27. 13 0
      src/views/home/index.vue
  28. 0 1
      src/views/infrastructure/components/recompose.vue
  29. 4 3
      src/views/infrastructure/components/setAnnualWaterRight.vue
  30. 420 0
      src/views/infrastructure/components/setAnnualWaterRightAdd.vue
  31. 16 2
      src/views/infrastructure/components/setPreferenc.vue
  32. 2 2
      src/views/infrastructure/components/waterPriceSetting.vue
  33. 34 23
      src/views/infrastructure/deviceSetup.vue
  34. 27 22
      src/views/infrastructure/waterElectricityPriceSetting.vue
  35. 16 3
      src/views/infrastructure/waterEstablishment.vue
  36. 91 203
      src/views/monitoringMamage/components/IrrigationRecord.vue
  37. 63 188
      src/views/monitoringMamage/components/realTimeMonitor.vue
  38. 33 10
      src/views/monitoringMamage/index.vue
  39. 74 35
      src/views/peasantHouseholdManage/components/addedFarmers.vue
  40. 48 24
      src/views/peasantHouseholdManage/index.vue
  41. 16 3
      src/views/waterCardManage/index.vue
  42. 29 11
      src/views/waterManage/index.vue
  43. 21 2
      src/views/waterMarket/component/waterDeal.vue
  44. 5 2
      src/views/waterMarket/index.vue
  45. 3 3
      src/views/waterSubsidy/components/newPolicy.vue
  46. 18 5
      src/views/waterSubsidy/index.vue
  47. 19 2
      vue.config.js

+ 2 - 2
.env.development

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

BIN
public/favicon.ico


BIN
public/favicon1.ico


BIN
public/static/template.xlsx


+ 9 - 0
src/api/card/index2.js

@@ -0,0 +1,9 @@
+window.a = false;
+import request from '@/utils/request2';
+// 实时监测
+export const getDataInfo = (query) => {
+  return request({
+    url: `/icsprod-api/ics/tmn/data/info/${query}`,
+    method: 'get'
+  });
+};

+ 1 - 1
src/api/farmer/list.js

@@ -61,7 +61,7 @@ export const importExcel = (data) => {
 // 查询
 export const getAreaInfo = (query) => {
   return request({
-    url: ' /wpr/waterright/area/info',
+    url: '/wpr/waterright/area/info',
     method: 'get',
     params: query
   });

+ 8 - 2
src/api/portal/portal.js

@@ -5,8 +5,8 @@ const baseURL = process.env.VUE_APP_BASE_API;
 
 // 获取portal配置
 export async function getSsoInfo() {
-  let res = await axios({ method: 'get', url: baseURL + '/portal/cfg/cfg' });
-  let cfg =
+  const res = await axios({ method: 'get', url: baseURL + '/portal/cfg/cfg' });
+  const cfg =
     res.status === 200 &&
     res.data &&
     res.data.code === '000000' &&
@@ -21,3 +21,9 @@ export function fetchSSOConfigInfo() {
     method: 'get'
   });
 }
+export function getPortalImg() {
+  return request({
+    url: '/portalprod-api/system/theme/info',
+    method: 'get'
+  });
+}

+ 3 - 0
src/assets/styles/index.scss

@@ -18,6 +18,9 @@ body {
   font-family: SourceHanSansCnRegular, SimSun, '宋体';
 }
 
+.el-select-dropdown__empty{
+  display: none !important;
+}
 label {
   font-weight: 700;
 }

+ 136 - 123
src/assets/styles/ruoyi.scss

@@ -1,129 +1,141 @@
- /**
+/**
  * 通用css样式布局处理
  * Copyright (c) 2019 杨晓辉
  */
 
- /** 基础通用 **/
+/** 基础通用 **/
 .pt5 {
-	padding-top: 5px;
+  padding-top: 5px;
 }
 .pr5 {
-	padding-right: 5px;
+  padding-right: 5px;
 }
 .pb5 {
-	padding-bottom: 5px;
+  padding-bottom: 5px;
 }
 .mt5 {
-	margin-top: 5px;
+  margin-top: 5px;
 }
 .mr5 {
-	margin-right: 5px;
+  margin-right: 5px;
 }
 .mb5 {
-	margin-bottom: 5px;
+  margin-bottom: 5px;
 }
 .mb8 {
-	margin-bottom: 8px;
+  margin-bottom: 8px;
 }
 .ml5 {
-	margin-left: 5px;
+  margin-left: 5px;
 }
 .mt10 {
-	margin-top: 10px;
+  margin-top: 10px;
 }
 .mr10 {
-	margin-right: 10px;
+  margin-right: 10px;
 }
 .mb10 {
-	margin-bottom: 10px;
+  margin-bottom: 10px;
 }
 .ml10 {
-	margin-left: 10px;
+  margin-left: 10px;
 }
 .mt20 {
-	margin-top: 20px;
+  margin-top: 20px;
 }
 .mr20 {
-	margin-right: 20px;
+  margin-right: 20px;
 }
 .mb20 {
-	margin-bottom: 20px;
+  margin-bottom: 20px;
 }
 .ml20 {
-	margin-left: 20px;
+  margin-left: 20px;
 }
 
-.h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 {
-	font-family: inherit;
-	font-weight: 500;
-	line-height: 1.1;
-	color: inherit;
+.h1,
+.h2,
+.h3,
+.h4,
+.h5,
+.h6,
+h1,
+h2,
+h3,
+h4,
+h5,
+h6 {
+  font-family: inherit;
+  font-weight: 500;
+  line-height: 1.1;
+  color: inherit;
 }
 
-.el-message-box__status + .el-message-box__message{
-    word-break: break-word;
+.el-message-box__status + .el-message-box__message {
+  word-break: break-word;
 }
 
 .el-dialog:not(.is-fullscreen) {
-	margin-top: 6vh !important;
+  margin-top: 6vh !important;
 }
 
 .el-dialog__wrapper.scrollbar .el-dialog .el-dialog__body {
-    overflow: auto;
-	overflow-x: hidden;
-	max-height: 70vh;
-	padding: 10px 20px 0;
+  overflow: auto;
+  overflow-x: hidden;
+  max-height: 70vh;
+  padding: 10px 20px 0;
 }
 
 .el-table {
-	.el-table__header-wrapper, .el-table__fixed-header-wrapper {
-		th {
-			word-break: break-word;
-			background-color: #f8f8f9;
-			color: #515a6e;
-			height: 40px;
-			font-size: 13px;
-		}
-	}
-	.el-table__body-wrapper {
-		.el-button [class*="el-icon-"] + span {
-			margin-left: 1px;
-		}
-	}
+  .el-table__header-wrapper,
+  .el-table__fixed-header-wrapper {
+    th {
+      word-break: break-word;
+      background-color: #f8f8f9;
+      color: #515a6e;
+      height: 40px;
+      font-size: 13px;
+    }
+  }
+  .el-table__body-wrapper {
+    .el-button [class*='el-icon-'] + span {
+      margin-left: 1px;
+    }
+  }
 }
 
 /** 表单布局 **/
 .form-header {
-    font-size:15px;
-	color:#6379bb;
-	border-bottom:1px solid #ddd;
-	margin:8px 10px 25px 10px;
-	padding-bottom:5px
+  font-size: 15px;
+  color: #6379bb;
+  border-bottom: 1px solid #ddd;
+  margin: 8px 10px 25px 10px;
+  padding-bottom: 5px;
 }
 
 /** 表格布局 **/
 .pagination-container {
-	position: relative;
-	height: 25px;
-	margin-bottom: 10px;
-	margin-top: 15px;
-	padding: 10px 20px !important;
+  position: relative;
+  height: 25px;
+  margin-bottom: 10px;
+  margin-top: 15px;
+  padding: 10px 20px !important;
 }
 
 /* tree border */
 .tree-border {
-    margin-top: 5px;
-    border: 1px solid #e5e6e7;
-    background: #FFFFFF none;
-    border-radius:4px;
+  margin-top: 5px;
+  border: 1px solid #e5e6e7;
+  background: #ffffff none;
+  border-radius: 4px;
 }
 
 .pagination-container .el-pagination {
-	right: 0;
-	position: absolute;
+  right: 0;
+  position: absolute;
 }
 
-@media ( max-width : 768px) {
+@media (max-width: 768px) {
   .pagination-container .el-pagination > .el-pagination__jump {
     display: none !important;
   }
@@ -133,145 +145,146 @@
 }
 
 .el-table .fixed-width .el-button--mini {
-	padding-left: 0;
-	padding-right: 0;
-	width: inherit;
+  padding-left: 0;
+  padding-right: 0;
+  width: inherit;
 }
 
 /** 表格更多操作下拉样式 */
-.el-table .el-dropdown-link,.el-table .el-dropdown-selfdefine {
-	cursor: pointer;
-	margin-left: 5px;
+.el-table .el-dropdown-link,
+.el-table .el-dropdown-selfdefine {
+  cursor: pointer;
+  margin-left: 5px;
 }
 
-.el-table .el-dropdown, .el-icon-arrow-down {
-	font-size: 12px;
+.el-table .el-dropdown,
+.el-icon-arrow-down {
+  font-size: 12px;
 }
 
 .el-tree-node__content > .el-checkbox {
-	margin-right: 8px;
+  margin-right: 8px;
 }
 
 .list-group-striped > .list-group-item {
-	border-left: 0;
-	border-right: 0;
-	border-radius: 0;
-	padding-left: 0;
-	padding-right: 0;
+  border-left: 0;
+  border-right: 0;
+  border-radius: 0;
+  padding-left: 0;
+  padding-right: 0;
 }
 
 .list-group {
-	padding-left: 0px;
-	list-style: none;
+  padding-left: 0px;
+  list-style: none;
 }
 
 .list-group-item {
-	border-bottom: 1px solid #e7eaec;
-	border-top: 1px solid #e7eaec;
-	margin-bottom: -1px;
-	padding: 11px 0px;
-	font-size: 13px;
+  border-bottom: 1px solid #e7eaec;
+  border-top: 1px solid #e7eaec;
+  margin-bottom: -1px;
+  padding: 11px 0px;
+  font-size: 13px;
 }
 
 .pull-right {
-	float: right !important;
+  float: right !important;
 }
 
 .el-card__header {
-	padding: 14px 15px 7px;
-	min-height: 40px;
+  padding: 14px 15px 7px;
+  min-height: 40px;
 }
 
 .el-card__body {
-	padding: 15px 20px 20px 20px;
+  padding: 15px 20px 20px 20px;
 }
 
 .card-box {
-	padding-right: 15px;
-	padding-left: 15px;
-	margin-bottom: 10px;
+  padding-right: 15px;
+  padding-left: 15px;
+  margin-bottom: 10px;
 }
 
 /* button color */
 .el-button--cyan.is-active,
 .el-button--cyan:active {
-  background: #20B2AA;
-  border-color: #20B2AA;
-  color: #FFFFFF;
+  background: #20b2aa;
+  border-color: #20b2aa;
+  color: #ffffff;
 }
 
 .el-button--cyan:focus,
 .el-button--cyan:hover {
-  background: #48D1CC;
-  border-color: #48D1CC;
-  color: #FFFFFF;
+  background: #48d1cc;
+  border-color: #48d1cc;
+  color: #ffffff;
 }
 
 .el-button--cyan {
-  background-color: #20B2AA;
-  border-color: #20B2AA;
-  color: #FFFFFF;
+  background-color: #20b2aa;
+  border-color: #20b2aa;
+  color: #ffffff;
 }
 
 /* text color */
 .text-navy {
-	color: #1ab394;
+  color: #1ab394;
 }
 
 .text-primary {
-	color: inherit;
+  color: inherit;
 }
 
 .text-success {
-	color: #1c84c6;
+  color: #1c84c6;
 }
 
 .text-info {
-	color: #23c6c8;
+  color: #23c6c8;
 }
 
 .text-warning {
-	color: #f8ac59;
+  color: #f8ac59;
 }
 
 .text-danger {
-	color: #ed5565;
+  color: #ed5565;
 }
 
 .text-muted {
-	color: #888888;
+  color: #888888;
 }
 
 /* image */
 .img-circle {
-	border-radius: 50%;
+  border-radius: 50%;
 }
 
 .img-lg {
-	width: 120px;
-	height: 120px;
+  width: 120px;
+  height: 120px;
 }
 
 .avatar-upload-preview {
-	position: relative;
-	top: 50%;
-	left: 50%;
-	transform: translate(-50%, -50%);
-	width: 200px;
-	height: 200px;
-	border-radius: 50%;
-	box-shadow: 0 0 4px #ccc;
-	overflow: hidden;
+  position: relative;
+  top: 50%;
+  left: 50%;
+  transform: translate(-50%, -50%);
+  width: 200px;
+  height: 200px;
+  box-shadow: 0 0 4px #ccc;
+  overflow: hidden;
 }
 
 /* 拖拽列样式 */
-.sortable-ghost{
-	opacity: .8;
-	color: #fff!important;
-	background: #42b983!important;
+.sortable-ghost {
+  opacity: 0.8;
+  color: #fff !important;
+  background: #42b983 !important;
 }
 
 .top-right-btn {
-	position: relative;
-	float: right;
+  position: relative;
+  float: right;
 }

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

@@ -2,8 +2,11 @@
   <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>
@@ -24,11 +27,23 @@ export default {
         children: 'children',
         label: 'cusareaName'
       },
+      currentNodekey: ''
     };
   },
+  watch: {
+    treeData: { 
+      handler(res) {
+        this.currentNodekey = res[0].id;
+        this.$nextTick(() => {
+          this.$refs.tree.setCurrentKey(this.currentNodekey);
+        });
+      },
+      deep: true
+    }
+  },
   methods: {
     handleNodeClick(data) {
-      this.$emit("setCurrentData",data?.cusareaId)
+      this.$emit("setCurrentData",data?.cusareaId,data)
     }
   }
 };

+ 0 - 1
src/layout/components/Navbar.vue

@@ -177,7 +177,6 @@ export default {
           width: 32px;
           height: 32px;
           margin-right: 10px;
-          border-radius: 50%;
         }
 
         .user-name {

+ 6 - 0
src/layout/components/Sidebar/Logo.vue

@@ -51,6 +51,7 @@
 <script>
 import logoImg from '@/assets/images/logo.png';
 import variables from '@/assets/styles/variables.scss';
+import { mapState } from 'vuex';
 
 export default {
   name: 'SidebarLogo',
@@ -61,6 +62,11 @@ export default {
     }
   },
   computed: {
+    ...mapState({
+      logo: function (state) {
+        return this.formatImg(state.settings.logo) || logoImg;
+      }
+    }),
     variables() {
       return variables;
     },

+ 11 - 1
src/main.js

@@ -1,7 +1,7 @@
 import Vue from 'vue';
 
 import Cookies from 'store';
-
+import { startsWith } from 'lodash-es';
 import Element from 'element-ui';
 import './assets/styles/element-variables.scss';
 import 'fontawesome-free-6.2.1/css/all.min.css';
@@ -49,7 +49,17 @@ import VueMeta from 'vue-meta';
 import DictData from '@/components/DictData';
 
 import VueAMap from 'vue-amap';
+function formatImg(url) {
+  const prefix = process.env.VUE_APP_BASE_API;
+
+  if (!url) {
+    return '-';
+  }
+
+  return startsWith(url, 'http') ? url : prefix + url;
+}
 
+Vue.filter('formatImg', formatImg);
 // 全局方法挂载
 Vue.prototype.getDataByDatatypeCode = getDataByDatatypeCode;
 Vue.prototype.getConfigKey = getConfigKey;

+ 1 - 0
src/permission.js

@@ -31,6 +31,7 @@ router.beforeEach(async (to, from, next) => {
   }
   refreshTitle();
   if (token) {
+    store.dispatch('settings/getPortalSystemInfo');
     to.meta.title && store.dispatch('settings/setTitle', to.meta.title);
     /* has token*/
     if (to.path === '/login') {

+ 164 - 149
src/router/index.js

@@ -49,155 +49,170 @@ export const constantRoutes = [
       }
     ]
   },
-  {
-    path: '/waterCardManageDataDetail',
-    component: () => import('@/views/waterCardManage/dataDetail'),
-    hidden: true
-  },
-  {
-    path: '/',
-    component: Layout,
-    redirect: '/home',
-    children: [
-      {
-        path: 'home',
-        name: 'home',
-        meta: { title: '首页',icon:'peoples' },
-        component: () => import('@/views/home')
-      }
-    ]
-  },{
-    path: '/gisShow',
-    component: Layout,
-    redirect: '/gisShow',
-    children: [
-      {
-        path: 'gisShow',
-        name: 'gisShow',
-        meta: { title: 'GIS 展示',icon:'shopping' },
-        component: () => import('@/views/gisShow')
-      }
-    ]
-  },
-  {
-    path: '/monitoringMamage',
-    component: Layout,
-    redirect: '/monitoringMamage',
-    children: [
-      {
-        path: 'monitoringMamage',
-        name: 'monitoringMamage',
-        meta: { title: '监测管理',icon:'shopping' },
-        component: () => import('@/views/monitoringMamage')
-      }
-    ]
-  },{
-    path: '/peasantHouseholdManage',
-    component: Layout,
-    redirect: '/peasantHouseholdManage',
-    children: [
-      {
-        path: 'peasantHouseholdManage',
-        name: 'peasantHouseholdManage',
-        meta: { title: '农户管理',icon:'peoples' },
-        component: () => import('@/views/peasantHouseholdManage')
-      }
-    ]
-  },{
-    path: '/waterCardManage',
-    component: Layout,
-    redirect: '/waterCardManage',
-    children: [
-      {
-        path: 'waterCardManage',
-        name: 'waterCardManage',
-        meta: { title: '水卡管理',icon:'shopping' },
-        component: () => import('@/views/waterCardManage')
-      }
-    ]
-  },{
-    path: '/infrastructure',
-    component: Layout,
-    redirect: '/waterEstablishment',
-    meta: { title: '基础设施', icon: 'peoples' },
-    children: [
-      {
-        path: 'waterEstablishment',
-        name: 'waterEstablishment',
-        meta: { title: '水权设置',icon:'shopping' },
-        component: () => import('@/views/infrastructure/waterEstablishment')
-      },{
-        path: 'waterElectricityPriceSetting',
-        name: 'waterElectricityPriceSetting',
-        meta: { title: '水电价设置',icon:'shopping' },
-        component: () => import('@/views/infrastructure/waterElectricityPriceSetting')
-      },{
-        path: 'deviceSetup',
-        name: 'deviceSetup',
-        meta: { title: '设备管理',icon:'shopping' },
-        component: () => import('@/views/infrastructure/deviceSetup')
-      }
-    ]
-  },{
-    path: '/dataReport',
-    component: Layout,
-    redirect: '/intakeWaterAnalysis',
-    meta: { title: '数据报表', icon: 'peoples' },
-    children: [
-      {
-        path: 'intakeWaterAnalysis',
-        name: 'intakeWaterAnalysis',
-        meta: { title: '用水统计(组织)',icon:'shopping' },
-        component: () => import('@/views/dataReport/intakeWaterAnalysis')
-      },{
-        path: 'saveWaterAnalysis',
-        name: 'saveWaterAnalysis',
-        meta: { title: '节水分析(农户)',icon:'shopping' },
-        component: () => import('@/views/dataReport/saveWaterAnalysis')
-      },{
-        path: 'waterConsumption',
-        name: 'waterConsumption',
-        meta: { title: '取水分析(机井)',icon:'shopping' },
-        component: () => import('@/views/dataReport/waterConsumption')
-      },
-    ]
-  },{
-    path: '/waterSubsidy',
-    component: Layout,
-    redirect: '/waterSubsidy',
-    children: [
-      {
-        path: 'waterSubsidy',
-        name: 'waterSubsidy',
-        meta: { title: '节水政策补贴',icon:'shopping' },
-        component: () => import('@/views/waterSubsidy')
-      }
-    ]
-  },{
-    path: '/waterMarket',
-    component: Layout,
-    redirect: '/waterMarket',
-    children: [
-      {
-        path: 'waterMarket',
-        name: 'waterMarket',
-        meta: { title: '水权交易',icon:'shopping' },
-        component: () => import('@/views/waterMarket')
-      }
-    ]
-  },{
-    path: '/waterManage',
-    component: Layout,
-    redirect: '/waterManage',
-    children: [
-      {
-        path: 'waterManage',
-        name: 'waterManage',
-        meta: { title: '用水协会管理',icon:'shopping' },
-        component: () => import('@/views/waterManage')
-      }
-    ]
-  },
+
+  // {
+  //   path: '/waterCardManageDataDetail',
+  //   component: () => import('@/views/waterCardManage/dataDetail'),
+  //   hidden: true
+  // },
+  // {
+  //   path: '/',
+  //   component: Layout,
+  //   redirect: '/home',
+  //   children: [
+  //     {
+  //       path: 'home',
+  //       name: 'home',
+  //       meta: { title: '首页', icon: 'peoples' },
+  //       component: () => import('@/views/home')
+  //     }
+  //   ]
+  // },
+  // {
+  //   path: '/gisShow',
+  //   component: Layout,
+  //   redirect: '/gisShow',
+  //   children: [
+  //     {
+  //       path: 'gisShow',
+  //       name: 'gisShow',
+  //       meta: { title: 'GIS 展示', icon: 'shopping' },
+  //       component: () => import('@/views/gisShow')
+  //     }
+  //   ]
+  // },
+  // {
+  //   path: '/monitoringMamage',
+  //   component: Layout,
+  //   redirect: '/monitoringMamage',
+  //   children: [
+  //     {
+  //       path: 'monitoringMamage',
+  //       name: 'monitoringMamage',
+  //       meta: { title: '监测管理', icon: 'shopping' },
+  //       component: () => import('@/views/monitoringMamage')
+  //     }
+  //   ]
+  // },
+  // {
+  //   path: '/peasantHouseholdManage',
+  //   component: Layout,
+  //   redirect: '/peasantHouseholdManage',
+  //   children: [
+  //     {
+  //       path: 'peasantHouseholdManage',
+  //       name: 'peasantHouseholdManage',
+  //       meta: { title: '农户管理', icon: 'peoples' },
+  //       component: () => import('@/views/peasantHouseholdManage')
+  //     }
+  //   ]
+  // },
+  // {
+  //   path: '/waterCardManage',
+  //   component: Layout,
+  //   redirect: '/waterCardManage',
+  //   children: [
+  //     {
+  //       path: 'waterCardManage',
+  //       name: 'waterCardManage',
+  //       meta: { title: '水卡管理', icon: 'shopping' },
+  //       component: () => import('@/views/waterCardManage')
+  //     }
+  //   ]
+  // },
+  // {
+  //   path: '/infrastructure',
+  //   component: Layout,
+  //   redirect: '/waterEstablishment',
+  //   meta: { title: '基础设施', icon: 'peoples' },
+  //   children: [
+  //     {
+  //       path: 'waterEstablishment',
+  //       name: 'waterEstablishment',
+  //       meta: { title: '水权设置', icon: 'shopping' },
+  //       component: () => import('@/views/infrastructure/waterEstablishment')
+  //     },
+  //     {
+  //       path: 'waterElectricityPriceSetting',
+  //       name: 'waterElectricityPriceSetting',
+  //       meta: { title: '水电价设置', icon: 'shopping' },
+  //       component: () =>
+  //         import('@/views/infrastructure/waterElectricityPriceSetting')
+  //     },
+  //     {
+  //       path: 'deviceSetup',
+  //       name: 'deviceSetup',
+  //       meta: { title: '设备管理', icon: 'shopping' },
+  //       component: () => import('@/views/infrastructure/deviceSetup')
+  //     }
+  //   ]
+  // },
+  // {
+  //   path: '/dataReport',
+  //   component: Layout,
+  //   redirect: '/intakeWaterAnalysis',
+  //   meta: { title: '数据报表', icon: 'peoples' },
+  //   children: [
+  //     {
+  //       path: 'intakeWaterAnalysis',
+  //       name: 'intakeWaterAnalysis',
+  //       meta: { title: '用水统计(组织)', icon: 'shopping' },
+  //       component: () => import('@/views/dataReport/intakeWaterAnalysis')
+  //     },
+  //     {
+  //       path: 'saveWaterAnalysis',
+  //       name: 'saveWaterAnalysis',
+  //       meta: { title: '节水分析(农户)', icon: 'shopping' },
+  //       component: () => import('@/views/dataReport/saveWaterAnalysis')
+  //     },
+  //     {
+  //       path: 'waterConsumption',
+  //       name: 'waterConsumption',
+  //       meta: { title: '取水分析(机井)', icon: 'shopping' },
+  //       component: () => import('@/views/dataReport/waterConsumption')
+  //     }
+  //   ]
+  // },
+  // {
+  //   path: '/waterSubsidy',
+  //   component: Layout,
+  //   redirect: '/waterSubsidy',
+  //   children: [
+  //     {
+  //       path: 'waterSubsidy',
+  //       name: 'waterSubsidy',
+  //       meta: { title: '节水政策补贴', icon: 'shopping' },
+  //       component: () => import('@/views/waterSubsidy')
+  //     }
+  //   ]
+  // },
+  // {
+  //   path: '/waterMarket',
+  //   component: Layout,
+  //   redirect: '/waterMarket',
+  //   children: [
+  //     {
+  //       path: 'waterMarket',
+  //       name: 'waterMarket',
+  //       meta: { title: '水权交易', icon: 'shopping' },
+  //       component: () => import('@/views/waterMarket')
+  //     }
+  //   ]
+  // },
+  // {
+  //   path: '/waterManage',
+  //   component: Layout,
+  //   redirect: '/waterManage',
+  //   children: [
+  //     {
+  //       path: 'waterManage',
+  //       name: 'waterManage',
+  //       meta: { title: '用水协会管理', icon: 'shopping' },
+  //       component: () => import('@/views/waterManage')
+  //     }
+  //   ]
+  // },
+
   {
     path: '/login',
     component: () => import('@/views/login'),

+ 14 - 0
src/store/modules/settings.js

@@ -1,4 +1,5 @@
 import defaultSettings from '@/settings';
+import { getPortalImg } from '@/api/portal/portal';
 
 const {
   sideTheme,
@@ -14,6 +15,7 @@ const storageSetting = JSON.parse(localStorage.getItem('layout-setting')) || '';
 const state = {
   title: '',
   theme: storageSetting.theme || '#14A478',
+  logo: '',
   sideTheme: storageSetting.sideTheme || sideTheme,
   showSettings: showSettings,
   topNav: storageSetting.topNav === undefined ? topNav : storageSetting.topNav,
@@ -48,6 +50,18 @@ const actions = {
   // 设置网页标题
   setTitle({ commit }, title) {
     state.title = title;
+  },
+  getPortalSystemInfo(context) {
+    const { commit, state } = context;
+    if (state.logo) {
+      return Promise.resolve(state.logo);
+    }
+
+    return getPortalImg().then((res) => {
+      commit('CHANGE_SETTING', { key: 'logo', value: res.data.logoUrl });
+
+      return res.data;
+    });
   }
 };
 

+ 10 - 4
src/store/modules/user.js

@@ -63,10 +63,16 @@ const user = {
         getInfo()
           .then((res) => {
             const user = res.user;
-            const avatar =
-              user.userAvatar == '' || user.userAvatar == null
-                ? require('@/assets/images/profile.jpg')
-                : process.env.VUE_APP_BASE_API + user.userAvatar;
+            let avatar = '';
+            if (user.userAvatar != null && user.userAvatar !== '') {
+              if (String(user.userAvatar).startsWith('http')) {
+                avatar = user.userAvatar;
+              } else {
+                avatar = process.env.VUE_APP_BASE_API + user.userAvatar;
+              }
+            } else {
+              avatar = require('@/assets/images/profile.jpg');
+            }
             if (res.roles && res.roles.length > 0) {
               // 验证返回的roles是否是一个非空数组
               commit('SET_ROLES', res.roles);

+ 9 - 3
src/utils/request.js

@@ -6,7 +6,7 @@ import errorCode from '@/utils/errorCode';
 import { tansParams, blobValidate } from '@/utils/ruoyi';
 import cache from '@/plugins/cache';
 import { saveAs } from 'file-saver';
-
+const whitePrefixUrlList = ['/iot', '/portalprod-api'];
 let downloadLoadingInstance;
 // 是否显示重新登录
 export const isRelogin = { show: false };
@@ -23,6 +23,12 @@ const service = axios.create({
 // request拦截器
 service.interceptors.request.use(
   (config) => {
+    const isHideBaseUrl =
+      whitePrefixUrlList.findIndex((item) => config.url.includes(item)) > -1;
+
+    if (isHideBaseUrl) {
+      config.baseURL = '';
+    }
     if (config.url.includes('/iot')) {
       config.baseURL = '';
     }
@@ -165,10 +171,10 @@ export function download(url, params, filename, config) {
     .post(url, params, {
       transformRequest: [
         (params) => {
-          return tansParams(params);
+          return JSON.stringify(params);
         }
       ],
-      headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
+      // headers: { 'Content-Type': 'multipart/form-data' },
       responseType: 'blob',
       ...config
     })

+ 196 - 0
src/utils/request2.js

@@ -0,0 +1,196 @@
+import axios from 'axios';
+import { Notification, MessageBox, Message, Loading } from 'element-ui';
+import store from '@/store';
+import { getToken } from '@/utils/auth';
+import errorCode from '@/utils/errorCode';
+import { tansParams, blobValidate } from '@/utils/ruoyi';
+import cache from '@/plugins/cache';
+import { saveAs } from 'file-saver';
+
+let downloadLoadingInstance;
+// 是否显示重新登录
+export const isRelogin = { show: false };
+console.log(process.env.VUE_APP_BASE_API, 'process.env.VUE_APP_BASE_API');
+axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8';
+// 创建axios实例
+const service = axios.create({
+  // axios中请求配置有baseURL选项,表示请求URL公共部分
+  baseURL: '',
+  // 超时
+  timeout: 30000
+});
+
+// request拦截器
+service.interceptors.request.use(
+  (config) => {
+    if (config.url.includes('/iot')) {
+      config.baseURL = '';
+    }
+
+    // 是否需要设置 token
+    const isToken = (config.headers || {}).isToken === false;
+    // 是否需要防止数据重复提交
+    const isRepeatSubmit = (config.headers || {}).repeatSubmit === false;
+    if (getToken() && !isToken) {
+      config.headers['Authorization'] = 'Bearer ' + getToken(); // 让每个请求携带自定义token 请根据实际情况自行修改
+    }
+    // get请求映射params参数
+    if (config.method === 'get' && config.params) {
+      let url = config.url + '?' + tansParams(config.params);
+      url = url.slice(0, -1);
+      config.params = {};
+      config.url = url;
+    }
+    if (
+      !isRepeatSubmit &&
+      (config.method === 'post' || config.method === 'put')
+    ) {
+      const requestObj = {
+        url: config.url,
+        data:
+          typeof config.data === 'object'
+            ? JSON.stringify(config.data)
+            : config.data,
+        time: new Date().getTime()
+      };
+      const sessionObj = cache.session.getJSON('sessionObj');
+      if (
+        sessionObj === undefined ||
+        sessionObj === null ||
+        sessionObj === ''
+      ) {
+        cache.session.setJSON('sessionObj', requestObj);
+      } else {
+        const s_url = sessionObj.url; // 请求地址
+        const s_data = sessionObj.data; // 请求数据
+        const s_time = sessionObj.time; // 请求时间
+        const interval = 1000; // 间隔时间(ms),小于此时间视为重复提交
+        if (
+          s_data === requestObj.data &&
+          requestObj.time - s_time < interval &&
+          s_url === requestObj.url
+        ) {
+          const message = '数据正在处理,请勿重复提交';
+          console.warn(`[${s_url}]: ` + message);
+          return Promise.reject(new Error(message));
+        } else {
+          cache.session.setJSON('sessionObj', requestObj);
+        }
+      }
+    }
+    return config;
+  },
+  (error) => {
+    console.log(error);
+    Promise.reject(error);
+  }
+);
+
+// 响应拦截器
+service.interceptors.response.use(
+  (res) => {
+    // 未设置状态码则默认成功状态
+    const code = res.data.code;
+    // 获取错误信息
+    const msg = errorCode[code] || res.data.msg || errorCode['default'];
+    // 二进制数据则直接返回
+    if (
+      res.request.responseType === 'blob' ||
+      res.request.responseType === 'arraybuffer'
+    ) {
+      return res.data;
+    }
+    // if (code === '200001' || code === '300002') {
+    if (code === '300002') {
+      if (!isRelogin.show) {
+        isRelogin.show = true;
+        MessageBox.confirm(
+          '登录状态已过期,您可以继续留在该页面,或者重新登录',
+          '系统提示',
+          {
+            confirmButtonText: '重新登录',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }
+        )
+          .then(() => {
+            isRelogin.show = false;
+            store.dispatch('LogOut').then(() => {
+              location.reload();
+            });
+          })
+          .catch(() => {
+            isRelogin.show = false;
+          });
+      }
+      return Promise.reject(
+        new Error('无效的会话,或者会话已过期,请重新登录。')
+      );
+    } else if (code === '500') {
+      Message({ message: msg, type: 'error' });
+      return Promise.reject(new Error(msg));
+    } else if (code === '601') {
+      Message({ message: msg, type: 'warning' });
+      return Promise.reject(new Error('error'));
+    } else if (code !== '000000') {
+      Notification.error({ title: msg });
+      return Promise.reject(new Error('error'));
+    } else {
+      return res.data;
+    }
+  },
+  (error) => {
+    console.log('err' + error);
+    let { message } = error;
+    if (message == 'Network Error') {
+      message = '后端接口连接异常';
+    } else if (message.includes('timeout')) {
+      message = '系统接口请求超时';
+    } else if (message.includes('Request failed with status code')) {
+      message = '系统接口' + message.substr(message.length - 3) + '异常';
+    }
+    Message({ message: message, type: 'error', duration: 5 * 1000 });
+    return Promise.reject(error);
+  }
+);
+
+// 通用下载方法
+export function download(url, params, filename, config) {
+  downloadLoadingInstance = Loading.service({
+    text: '正在下载数据,请稍候',
+    spinner: 'el-icon-loading',
+    background: 'rgba(0, 0, 0, 0.7)'
+  });
+  return service
+    .post(url, params, {
+      transformRequest: [
+        (params) => {
+          return tansParams(params);
+        }
+      ],
+      headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
+      responseType: 'blob',
+      ...config
+    })
+    .then(async (data) => {
+      const isBlob = blobValidate(data);
+      if (isBlob) {
+        const blob = new Blob([data]);
+        saveAs(blob, filename);
+      } else {
+        const resText = await data.text();
+        const rspObj = JSON.parse(resText);
+        const errMsg =
+          errorCode[rspObj.code] || rspObj.msg || errorCode['default'];
+        Message.error(errMsg);
+      }
+      downloadLoadingInstance.close();
+    })
+    .catch((r) => {
+      console.error(r);
+      Message.error('下载文件出现错误,请联系管理员!');
+      downloadLoadingInstance.close();
+    });
+}
+
+export default service;

+ 3 - 2
src/utils/sso.js

@@ -3,7 +3,8 @@ import {
   getSSOConfig,
   setPlatformToken,
   setSysMenuConfigID,
-  refreshTitle
+  refreshTitle,
+  setSysTitle
 } from '@/utils/auth';
 import { defaults, omit } from 'lodash-es';
 const baseURL = process.env.VUE_APP_BASE_API;
@@ -148,7 +149,7 @@ export function getResdirectAppUrl(ssoToken) {
 
 export function parseSSoToken(store, next, to, router, subName) {
   updateSSOConfig();
-  const { token, siblingToken, subid } = to.query;
+  const { token, siblingToken, subid, subName } = to.query;
 
   if (subid) {
     setSysMenuConfigID(subid);

+ 0 - 34
src/views/dataReport/components/addedFarmers.vue

@@ -236,9 +236,6 @@ export default {
         if (val) {
           assign(this.baseForm, this.data);
           if (!this.hasFetched) {
-            this.getProductList();
-            this.getSyinfoList();
-            this.getProcessList();
             this.hasFetched = true;
           }
         }
@@ -253,38 +250,7 @@ export default {
       }
     }
   },
-  created() {},
-  mounted() {},
   methods: {
-    getProductList() {
-    },
-    getSyinfoList() {
-    },
-    getProcessList() {
-    },
-    goProductsPage() {
-      this.handleClose();
-      this.$router.push({
-        path: '/Products',
-        query: {}
-      });
-    },
-    goSourceInfoPage() {
-      this.handleClose();
-      this.$router.push({
-        path: '/sourceInfo',
-        query: {
-          type: 'add'
-        }
-      });
-    },
-    goProcessPage() {
-      this.handleClose();
-      this.$router.push({
-        path: '/basicsettings/process',
-        query: {}
-      });
-    },
     resetForm(formName) {
       this.$refs[formName].resetFields();
       this.resetFormData();

+ 34 - 13
src/views/dataReport/intakeWaterAnalysis.vue

@@ -57,12 +57,17 @@ import DataReportLeft from '@/components/DataReportLeft/index.vue';
 import { assign, omit } from 'lodash-es';
 
 export default {
-  name: 'waterManage',
+  name:"waterManage",
   components: { BTable, DataReportLeft },
+  mounted() { 
+    this.setYear()
+  },
   data() {
+    let date = new Date()
+    let currentYear = date.getFullYear()
     return {
-      activeName: 'first',
-      currentYear: '',
+      activeName:'first',
+      currentYear,
       loading: false,
       associationManageShow: false,
       treeData: [],
@@ -89,7 +94,7 @@ export default {
           align: 'center'
         },
         {
-          label: '面积',
+          label: '面积(亩)',
           prop: 'waterrightAreasize',
           customRender: '',
           align: 'center'
@@ -120,7 +125,6 @@ export default {
       this.$refs.tableRef.refresh(true);
     },
     async loadData(parameter) {
-      this.setYear();
       if (!this.currentClickId) {
         const treeList = this.$store.state.tree.treeList;
         let res = [];
@@ -130,9 +134,22 @@ export default {
           res = await getTree();
           this.$store.dispatch('tree/setTree', res);
         }
-        this.treeData = res?.data;
-        this.currentClick = res?.data[0];
-        this.currentClickId = this.currentClick?.cusareaId;
+        this.treeData = res?.data
+        let tflag = true
+        this.treeData.forEach(t => {
+          if (t?.cusareaName == '全部') {
+            tflag = false
+          }
+        })
+        if (tflag) {
+          this.treeData.unshift({
+            id: '',
+            cusareaId: '',
+            cusareaName: '全部'
+          })
+        }
+        this.currentClick = res?.data[0]
+        this.currentClickId = this.currentClick?.cusareaId
       }
       const params = {
         areaId: this.currentClickId,
@@ -142,19 +159,23 @@ export default {
       return getAreaList(payload);
     },
     downloadHandler() {
+      const params = {
+        areaId: this.currentClickId,
+        year: this.currentYear
+      }
       this.download(
         'wpr/stat/area/export',
         {
-          ...this.queryParams
+          ...params
         },
         `FmsCrop_${new Date().getTime()}.xlsx`
       );
     },
     setYear() {
-      this.options = [];
-      let date = new Date();
-      let currentYear = date.getFullYear();
-      this.currentYear = currentYear;
+      this.options = []
+      let date = new Date()
+      let currentYear = date.getFullYear()
+      this.currentYear = currentYear
       for (let i = 0; i < 5; i++) {
         this.options.push({
           label: currentYear - i,

+ 21 - 4
src/views/dataReport/saveWaterAnalysis.vue

@@ -14,7 +14,7 @@
               </el-option>
             </el-select>
             <el-input style="width: 250px;margin-right: 16px;"
-              placeholder="请输入农户编号/姓名/电话"
+              placeholder="请输入姓名/电话"
               v-model="keyword"
             />
             <el-button type="primary" size="small" @click="handleSearch">查询</el-button>
@@ -45,10 +45,15 @@ import { assign, omit } from 'lodash-es';
 export default {
   name: "waterManage",
   components: { BTable, DataReportLeft },
+  mounted() { 
+    this.setYear()
+  },
   data() {
+    let date = new Date()
+    let currentYear = date.getFullYear()
     return {
       activeName: 'first',
-      currentYear: '',
+      currentYear,
       keyword: '',
       loading: false,
       associationManageShow: false,
@@ -111,7 +116,6 @@ export default {
       this.$refs.tableRef.refresh(true);
     },
     async loadData(parameter) {
-      this.setYear()
       if (!this.currentClickId) {
         const treeList = this.$store.state.tree.treeList
         let res = []
@@ -122,6 +126,19 @@ export default {
           this.$store.dispatch('tree/setTree', res)
         }
         this.treeData = res?.data
+        let tflag = true
+        this.treeData.forEach(t => {
+          if (t?.cusareaName == '全部') {
+            tflag = false
+          }
+        })
+        if (tflag) {
+          this.treeData.unshift({
+            id: '',
+            cusareaId: '',
+            cusareaName: '全部'
+          })
+        }
         this.currentClick = res?.data[0]
         this.currentClickId = this.currentClick?.cusareaId
       }
@@ -135,7 +152,7 @@ export default {
     },
     setYear() {
       this.options = []
-      let date = new Date
+      let date = new Date()
       let currentYear = date.getFullYear()
       this.currentYear = currentYear
       for (let i = 0; i < 5; i++) {

+ 22 - 3
src/views/dataReport/waterConsumption.vue

@@ -98,10 +98,17 @@ export default {
       this.$refs.tableRef.refresh(true);
     },
     downloadHandler() {
+      const [startTime, endTime] = this.dateValue ??= []
+      const params = {
+        areaId: this.currentClickId,
+        startTime,
+        endTime,
+        keyword: this.keyword
+      }
       this.download(
         'wpr/stat/water/export',
         {
-          ...this.queryParams
+          ...params
         },
         `FmsCrop_${new Date().getTime()}.xlsx`
       );
@@ -117,8 +124,20 @@ export default {
           this.$store.dispatch('tree/setTree', res)
         }
         this.treeData = res?.data
-        this.currentClick = res?.data[0]
-        this.currentClickId = this.currentClick?.cusareaId
+        let tflag = true
+        this.treeData.forEach(t => {
+          if (t?.cusareaName == '全部') {
+            tflag = false
+          }
+        })
+        if (tflag) {
+          this.treeData.unshift({
+            id:'',
+            cusareaId: '',
+            cusareaName: '全部'
+          })
+        }
+        this.currentClickId = this.treeData[0]?.cusareaId
       }
       
       const [startTime, endTime] = this.dateValue ??= []

+ 13 - 1
src/views/gisShow/components/rightEquipment.vue

@@ -183,6 +183,18 @@ export default {
         })
       }
     },
+    changeStatus(flag) {
+      switch (flag) { 
+        case 'I':
+          return '在线'
+        case 'W':
+          return '运行'
+        case 'E':
+          return '故障'
+        case 'O':
+          return '离线'
+      }
+     },
     async getBaseInfo() { 
       const response = await getBaseInfo({
         tmnId: this.tmnId
@@ -194,7 +206,7 @@ export default {
       this.cusareaName = value?.cusareaName;
       this.waterAddress = value?.waterAddress;
       this.tmnstatusRunstatusContent = value?.tmnstatusRunstatusContent;
-      this.tmnstatusRunstatus = value?.tmnstatusRunstatus;
+      this.tmnstatusRunstatus = this.changeStatus(value?.tmnstatusRunstatus);
       this.list = [{
         label: '设备名称:',
         text: this.tmnName || '-'

+ 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 || 116.397428, res?.data[0]?.tmnLatitude || 39.90923]
+      this.center = [res?.data[0]?.tmnLongitude || 113.61, res?.data[0]?.tmnLatitude || 33.44]
     },
     searchMap() {
       let that = this;

+ 13 - 0
src/views/home/index.vue

@@ -224,6 +224,19 @@ export default {
         this.$store.dispatch('tree/setTree', res)
       }
       this.treeData = res?.data
+      let tflag = true
+      this.treeData.forEach(t => {
+        if (t?.cusareaName == '全部') {
+          tflag = false
+        }
+      })
+      if (tflag) {
+        this.treeData.unshift({
+          id: '',
+          cusareaId: '',
+          cusareaName: '全部'
+        })
+      }
       this.cusareaName ||= this.treeData[0].cusareaName
       this.areaId = this.treeData[0].cusareaId
       this.getHomeListHandler()

+ 0 - 1
src/views/infrastructure/components/recompose.vue

@@ -176,7 +176,6 @@ export default {
     },
     editRow:{
       handler(val) {
-        console.log(val, 'valvalvalvlavlas')
         const { cusareaParentid } = val
         this.cusareaParentid = cusareaParentid
         this.visible && this.getWaterrightUpareaList(val)

+ 4 - 3
src/views/infrastructure/components/setAnnualWaterRight.vue

@@ -271,7 +271,8 @@ export default {
       if (this.constantWaterPrice == 1) { 
         for (let i = 0; i < this.baseForm.waterPriceSteps.length; i++) {
           const waterPriceItem = this.baseForm.waterPriceSteps[i]
-          if (waterPriceItem?.pricestepUsagemin != ''  && waterPriceItem?.pricestepUsagemax != '' && +waterPriceItem?.pricestepUsagemax < +waterPriceItem?.pricestepUsagemin) {
+          const waterMax = waterPriceItem?.pricestepUsagemax == null ? 9999999 : +waterPriceItem?.pricestepUsagemax
+          if (waterPriceItem?.pricestepUsagemin != '' && waterPriceItem?.pricestepUsagemax != '' && waterMax < +waterPriceItem?.pricestepUsagemin) {
             Message({
               type: 'warning',
               message: `水价第${i+1}阶梯的最大量不能小于最小量`
@@ -291,7 +292,8 @@ export default {
       if (this.ladderLikeWaterPrice == 1) {
         for (let i = 0; i < this.baseForm.elecPriceSteps.length; i++) {
           const elePriceItem = this.baseForm.elecPriceSteps[i]
-          if (elePriceItem?.pricestepUsagemin != '' && elePriceItem?.pricestepUsagemax != '' && +elePriceItem?.pricestepUsagemax < +elePriceItem?.pricestepUsagemin) {
+          const eleMax = elePriceItem?.pricestepUsagemax == null ? 9999999 : +elePriceItem?.pricestepUsagemax
+          if (elePriceItem?.pricestepUsagemin != '' && elePriceItem?.pricestepUsagemax != '' && eleMax < +elePriceItem?.pricestepUsagemin) {
             Message({
               type: 'warning',
               message: `电价第${i + 1}阶梯的最大量不能小于最小量`
@@ -334,7 +336,6 @@ export default {
     },
 
     submitForm(formName) {
-      console.log(this.priceconfigElectricityunitprice,'priceconfigElectricityunitpricepriceconfigElectricityunitprice')
       this.$refs[formName].validate((valid) => {
         valid && this.editPriceHandler()
       })

+ 420 - 0
src/views/infrastructure/components/setAnnualWaterRightAdd.vue

@@ -0,0 +1,420 @@
+<template>
+  <el-dialog
+    title="新增"
+    :visible.sync="dialogVisible"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    @close="handleClose"
+    width="660px"
+  >
+  <el-tooltip
+    class="item_tooltip" 
+    effect="dark"
+    content="操作提示:设置每亩农田同水量的水价信息和用电量的电价信息"
+    placement="right"
+  >
+    <i class="el-alert__icon el-icon-info"></i>
+  </el-tooltip>
+    <el-form
+      ref="baseForm"
+      class="base-form"
+      label-position="right"
+      label-width="100px"
+      :model="baseForm"
+      size="small"
+    >
+    <el-row>
+      <el-col :span="24">
+        <el-form-item label="所属区域">
+          <el-row>
+            <el-col :span="24">
+              <select-tree 
+                :placeholder="'行政区域(全国)'" 
+                style="width:100%"
+                :treeData="treeData"
+                @handlerClick="handlerClick"
+                :checkVal="baseForm.cusareaName"
+              ></select-tree>
+            </el-col>
+          </el-row>
+        </el-form-item>
+      </el-col>
+    </el-row>
+    <el-row>
+      <h3>水价</h3>
+      <el-col :span="24">
+        <el-form-item label="水价计费方式">
+          <el-row>
+            <el-col :span="18">
+              <el-radio v-model="constantWaterPrice" label="0">恒定水价</el-radio>
+              <el-radio v-model="constantWaterPrice" label="1">阶梯水价</el-radio>
+            </el-col>
+          </el-row>
+        </el-form-item>
+        <el-form-item label="水价" 
+          v-if="constantWaterPrice == 0" 
+          prop="priceconfigWaterunitprice"
+          :rules="[{ required: true, message: '请选择您的恒定水价', trigger: 'blur' }]"
+        >
+          <el-row>
+            <el-col :span="18">
+              <el-input
+                style="width: 50%"
+                type="number"
+                v-model="baseForm.priceconfigWaterunitprice"
+              />
+              <span style="display:inline-block;margin-left:5px">元/吨</span>
+            </el-col>
+          </el-row>
+        </el-form-item>
+        <ladderLikeWaterPrice
+          v-else
+          :type="'water'"
+          @changeList="changeList"
+          :list="baseForm.waterPriceSteps || []"
+        />
+      </el-col>
+    </el-row>
+    <el-row>
+      <h3>电价</h3>
+      <el-col :span="24">
+        <el-form-item label="电价计费方式">
+          <el-row>
+            <el-col :span="18">
+              <el-radio v-model="ladderLikeWaterPrice" label="0">恒定电价</el-radio>
+              <el-radio v-model="ladderLikeWaterPrice" label="1">阶梯电价</el-radio>
+            </el-col>
+          </el-row>
+        </el-form-item>
+        <el-form-item
+          label="电价"
+          v-if="ladderLikeWaterPrice == 0"
+          :rules="[{ required: true, message: '请选择您的恒定电价', trigger: 'blur' }]"
+          prop="priceconfigElectricityunitprice"
+        >
+          <el-row>
+            <el-col :span="18">
+              <el-input 
+                style="width: 50%" 
+                type="number"
+                v-model="baseForm.priceconfigElectricityunitprice"
+              />
+              <span style="display:inline-block;margin-left:5px">元/度</span>
+            </el-col>
+          </el-row>
+        </el-form-item>
+        <ladderLikeWaterPrice 
+          v-else
+          :type="'electricity'"
+          @changeList="changeList"
+          :list="baseForm.elecPriceSteps || []"
+        />
+      </el-col>
+    </el-row>
+    </el-form>
+
+    <div style="text-align: right;margin-top: 20px;">
+      <el-button type="info" plain @click="resetForm('baseForm')"
+        >取消</el-button
+      >
+      <el-button
+        type="primary"
+        style="margin-left:16px;"
+        @click="submitForm('baseForm')"
+        :disabled="dialogSubmitLoading"
+        :loading="dialogSubmitLoading"
+        >确定</el-button
+      >
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import SelectTree from '@/components/SelectTree';
+import { getTree } from '@/api/tree.js'
+import { assign } from 'lodash-es';
+import { Message  } from 'element-ui'
+import ladderLikeWaterPrice from './ladderLikeWaterPrice.vue'
+import { addPrice } from '@/api/price/index.js'
+export default {
+  name: 'setAnnualWaterRightAdd',
+  props: {
+    data: {
+      default() {
+        return {};
+      }
+    },
+    visible: {
+      type: Boolean,
+      default: false
+    },
+  },
+  components: {
+    ladderLikeWaterPrice,
+    SelectTree
+  },
+  data() {
+    return {
+      treeData: [],
+      areaId: '',
+      dialogSubmitLoading: false,
+      constantWaterPrice: '1',
+      ladderLikeWaterPrice: '1',
+      dialogVisible: false,
+      priceconfigElectricityunitprice: '',
+      priceconfigWaterunitprice: '',
+      baseForm: {
+        cusareaName: '',
+        priceconfigElectricityunitprice: '',
+        priceconfigWaterunitprice: '',
+        elecPriceSteps: [{
+          pricestepUsagemin: '0',
+          pricestepUsagemax: '',
+          pricestepUnitprice: '',
+        }, {
+          pricestepUsagemin: '',
+          pricestepUsagemax: '',
+          pricestepUnitprice: '',
+        }],
+        waterPriceSteps: [{
+          pricestepUsagemin: '0',
+          pricestepUsagemax: '',
+          pricestepUnitprice: '',
+        }, {
+          pricestepUsagemin: '',
+          pricestepUsagemax: '',
+          pricestepUnitprice: '',
+        }]
+      },
+      hasFetched: false,
+      rules1: {
+        priceconfigWaterunitprice: [
+          { required: true, message: '输入您的恒定水价', trigger: 'blur' }
+        ],
+      },
+      rules2: {
+        priceconfigElectricityunitprice: [
+          { required: true, message: '输入您的恒定电价', trigger: 'blur' }
+        ]
+      },
+      rules3: {
+        priceconfigWaterunitprice: [
+          { required: true, message: '输入您的恒定水价', trigger: 'blur' }
+        ],
+        priceconfigElectricityunitprice: [
+          { required: true, message: '输入您的恒定电价', trigger: 'blur' }
+        ]
+      },
+      rules4: {
+        stockAmount: [
+          { required: true, message: '请选择负责人', trigger: 'blur' }
+        ],
+        sourceinfoId: [
+          { required: true, message: '请选择管辖范围', trigger: 'blur' }
+        ],
+        productName: [
+          { required: true, message: '请输入协会名称', trigger: 'blur' }
+        ],
+        supplierId: [
+          { required: false, message: '请输入协会介绍', trigger: 'blur' }
+        ],
+        goodsSpecValue: [
+          { required: true, message: '请选择规格', trigger: 'blur' }
+        ]
+      }
+    };
+  },
+  watch: {
+    visible(val) {
+      if (val !== this.dialogVisible) {
+        this.dialogVisible = val;
+        if (val) {
+          assign(this.baseForm, this.data);
+          if (!this.hasFetched) {
+            this.hasFetched = true;
+          }
+        }
+      }
+    },
+    data: {
+      deep: true,
+      handler(val) {
+        assign(this.baseForm, val);
+      }
+    },
+  },
+  mounted() { 
+    this.getWaterrightList()
+  },
+  methods: {
+    handlerClick(value) {
+      this.areaId = value?.cusareaId
+    },
+    async getWaterrightList() {
+      if (!this.areaId) {
+        const res = await getTree()
+        this.treeData = res?.data
+        this.areaId = this.treeData[0].cusareaId
+      }
+    },
+    changeList(list,type,row, index) {
+      if (type === 'water') {
+        if (this.baseForm.waterPriceSteps[index + 1]) {
+          const params = this.baseForm.waterPriceSteps[index + 1]
+          params.pricestepUsagemin = row
+          this.$set(this.baseForm.waterPriceSteps, index + 1, params)
+         }
+      } else { 
+        if (this.baseForm.elecPriceSteps[index + 1]) {
+          const params = this.baseForm.elecPriceSteps[index + 1]
+          params.pricestepUsagemin = row
+          this.$set(this.baseForm.elecPriceSteps, index + 1, params)
+         }
+      }
+     },
+    async editPriceHandler() {
+      const { priceconfigId } = this.baseForm
+      if (this.constantWaterPrice == 1) { 
+        for (let i = 0; i < this.baseForm.waterPriceSteps.length; i++) {
+          const waterPriceItem = this.baseForm.waterPriceSteps[i]
+          if (waterPriceItem?.pricestepUsagemin != ''  && waterPriceItem?.pricestepUsagemax != '' && +waterPriceItem?.pricestepUsagemax < +waterPriceItem?.pricestepUsagemin) {
+            Message({
+              type: 'warning',
+              message: `水价第${i+1}阶梯的最大量不能小于最小量`
+            })
+            return
+          }
+          if (!waterPriceItem?.pricestepUnitprice) {
+            Message({
+              type: 'warning',
+              message: '请正确输入您的水价信息'
+            })
+            return
+          }
+          waterPriceItem.pricestepNum = i
+        }
+      }
+      if (this.ladderLikeWaterPrice == 1) {
+        for (let i = 0; i < this.baseForm.elecPriceSteps.length; i++) {
+          const elePriceItem = this.baseForm.elecPriceSteps[i]
+          if (elePriceItem?.pricestepUsagemin != '' && elePriceItem?.pricestepUsagemax != '' && +elePriceItem?.pricestepUsagemax < +elePriceItem?.pricestepUsagemin) {
+            Message({
+              type: 'warning',
+              message: `电价第${i + 1}阶梯的最大量不能小于最小量`
+            })
+            return
+          }
+          if (!elePriceItem?.pricestepUnitprice) {
+            Message({
+              type: 'warning',
+              message: '请正确输入您的电价信息'
+            })
+            return
+          }
+          elePriceItem.pricestepNum = i
+        }
+      }
+      
+      const params = {
+        areaId:this.areaId,
+        priceconfigId,
+        priceconfigWaterchargingtype: this.constantWaterPrice,
+        priceconfigElectricityunitprice:  this.ladderLikeWaterPrice == 0 ? this.baseForm.priceconfigElectricityunitprice: '0',
+        priceconfigElectricitychargingtype: this.ladderLikeWaterPrice,
+        priceconfigWaterunitprice: this.constantWaterPrice == 0 ? this.baseForm.priceconfigWaterunitprice :'0',
+        waterPriceSteps: this.constantWaterPrice == 1 ? this.baseForm.waterPriceSteps : [],
+        elePriceSteps: this.ladderLikeWaterPrice == 1 ? this.baseForm.elecPriceSteps : [],
+      }
+      await addPrice(
+        params
+      )
+      this.handleClose()
+    },
+    resetForm(formName) {
+      this.$refs[formName].resetFields();
+      this.resetFormData();
+      this.dialogVisible = false;
+    },
+    resetFormData() {
+      this.baseForm =  {
+        cusareaName: '',
+        priceconfigElectricityunitprice: '',
+        priceconfigWaterunitprice: '',
+        elecPriceSteps: [{
+          pricestepUsagemin: '0',
+          pricestepUsagemax: '',
+          pricestepUnitprice: '',
+        }, {
+          pricestepUsagemin: '',
+          pricestepUsagemax: '',
+          pricestepUnitprice: '',
+        }],
+        waterPriceSteps: [{
+          pricestepUsagemin: '0',
+          pricestepUsagemax: '',
+          pricestepUnitprice: '',
+        }, {
+          pricestepUsagemin: '',
+          pricestepUsagemax: '',
+          pricestepUnitprice: '',
+        }]
+      }
+    },
+
+    submitForm(formName) {
+      this.$refs[formName].validate((valid) => {
+        valid && this.editPriceHandler()
+      })
+    },
+    handleClose() {
+      this.$emit('update:visible', false);
+      this.$emit('clearEdit')
+      this.resetForm('baseForm');
+    },
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+::v-deep .el-form-item__label{
+  text-align: right !important;
+}
+
+.item_tooltip{
+  position: absolute;
+  top: 25px;
+  left: 70px;
+  color: #00000066;
+}
+h3{
+  color: #303133;
+  font-family: Source Han Sans CN VF;
+  font-size: 14px;
+  font-style: normal;
+  font-weight: 700;
+  line-height: 24px;
+}
+.base-form {
+  max-height: 70vh;
+  overflow-y: auto;
+  overflow-x: hidden;
+  padding: 0 20px;
+}
+</style>
+<style lang="css" scoped>
+::v-deep .el-dialog__header {
+  border-bottom: 1px solid #ebeef5;
+}
+</style>
+<style>
+.el-tooltip__popper.is-dark {
+	background: rgba(0,0,0,0.5);
+}
+
+.el-tooltip__popper[x-placement^=right] .popper__arrow{
+  border-right-color:#888;
+}
+.el-tooltip__popper[x-placement^=right] .popper__arrow::after{
+  border-right-color:#888;
+}
+</style>

+ 16 - 2
src/views/infrastructure/components/setPreferenc.vue

@@ -24,8 +24,22 @@
           <el-row>
             <el-col :span="12">
               <el-form-item label="计算模式:" prop="tmnconfigMeteredmodel">
-                <el-input placeholder="请输入" v-model="baseForm.tmnconfigMeteredmodel">
-                </el-input>
+                <!-- <el-input placeholder="请输入" v-model="baseForm.tmnconfigMeteredmodel"> -->
+                <!-- </el-input> -->
+                <el-select  v-model="baseForm.tmnconfigMeteredmodel" style="width:100%">
+                  <el-option
+                    label="水电双计"
+                    value="0"
+                  ></el-option>
+                  <el-option
+                    label="只计水"
+                    value="1"
+                  ></el-option>
+                  <el-option
+                    label="只计电"
+                    value="2"
+                  ></el-option>
+                </el-select>
               </el-form-item>
             </el-col>
             <el-col :span="12">

+ 2 - 2
src/views/infrastructure/components/waterPriceSetting.vue

@@ -117,8 +117,8 @@ export default {
       this.currentYear = currentYear
       for (let i = 0; i < 5; i++) {
         this.options.push({
-          label: currentYear - i,
-          value: currentYear - i
+          label: currentYear + i,
+          value: currentYear + i
         })
       }
     },

+ 34 - 23
src/views/infrastructure/deviceSetup.vue

@@ -118,27 +118,25 @@ export default {
   components: { BTable, DataReportLeft, setPreferencs },
   data() {
     return {
-      tmnstatusRunstatus: 'I',
+      tmnstatusRunstatus:'',
       treeData: [],
       waterKeyword: '',
-      tmnstatusList: [
-        {
-          label: '空闲中',
-          value: 'I'
-        },
-        {
-          label: '工作中',
-          value: 'W'
-        },
-        {
-          label: '故障',
-          value: 'E'
-        },
-        {
-          label: '离线',
-          value: 'O'
-        }
-      ],
+      tmnstatusList: [{
+        label: '全部',
+        value: ''
+      },{
+        label: '空闲中',
+        value: 'I'
+      }, {
+        label: '工作中',
+        value: 'W'
+      }, {
+        label: '故障',
+        value: 'E'
+      }, {
+        label: '离线',
+        value: 'O'
+        }],
       tmnId: '',
       loading: false,
       associationManageShow: false,
@@ -222,10 +220,23 @@ export default {
           res = await getTree();
           this.$store.dispatch('tree/setTree', res);
         }
-        this.treeData = res?.data;
-        this.currentClick = res?.data[0];
-        this.currentClickId = this.currentClick?.cusareaId;
-        this.areaId = this.currentClickId;
+        this.treeData = res?.data
+        let tflag = true
+        this.treeData.forEach(t => {
+          if (t?.cusareaName == '全部') {
+            tflag = false
+          }
+        })
+        if (tflag) {
+          this.treeData.unshift({
+            id: '',
+            cusareaId: '',
+            cusareaName: '全部'
+          })
+        }
+        this.currentClick = res?.data[0]
+        this.currentClickId = this.currentClick?.cusareaId
+        this.areaId = this.currentClickId
       }
       const params = {
         areaId: this.areaId,

+ 27 - 22
src/views/infrastructure/waterElectricityPriceSetting.vue

@@ -29,7 +29,7 @@
               >查询</el-button
             >
           </div>
-          <!-- <div class="top-left">
+          <div class="top-left">
             <el-button
               type="primary"
               size="small"
@@ -38,7 +38,7 @@
 
               >新增
               </el-button
-          ></div> -->
+          ></div>
         </el-col>
         <el-col :span="24" class="elrow-main__col-bottom">
           <b-table
@@ -74,12 +74,8 @@
             </template>
             <template #priceYield="scope">
               <span v-if="scope.row.priceconfigWaterchargingtype == 1">
-                <div
-                  v-for="(item, index) in scope.row.waterPriceSteps"
-                  :key="index"
-                  class="pricestepNum"
-                >
-                  {{ item.pricestepUsagemin + ' - ' + item.pricestepUsagemax }}
+                <div v-for="(item, index) in scope.row.waterPriceSteps" :key="index" class="pricestepNum">
+                  {{ item.pricestepUsagemin + ' - ' + changeNum(item.pricestepUsagemax) }}
                 </div>
               </span>
               <span v-else>
@@ -129,12 +125,8 @@
             </template>
             <template #elecPriceSteps="scope">
               <span v-if="scope.row.priceconfigElectricitychargingtype == 1">
-                <div
-                  v-for="(item, index) in scope.row.elecPriceSteps"
-                  :key="index"
-                  class="pricestepNum"
-                >
-                  {{ item.pricestepUsagemin + ' - ' + item.pricestepUsagemax }}
+                <div v-for="(item, index) in scope.row.elecPriceSteps" :key="index" class="pricestepNum">
+                  {{ item.pricestepUsagemin + ' - ' + changeNum(item.pricestepUsagemax) }}
                 </div>
               </span>
               <span v-else>
@@ -186,6 +178,10 @@
       :editRow="editRow"
       @clearEdit="handlerClearEdit"
     />
+    <set-annual-water-right-add
+      :visible.sync="addAssociationManageShow"
+      @clearEdit="handlerClearEdit"
+    />
   </el-row>
 </template>
 
@@ -193,15 +189,16 @@
 import { Message } from 'element-ui';
 import SelectTree from '@/components/SelectTree';
 import BTable from '@/components/Table/index.vue';
-import { Waterchargingtype, Electricitychargingtype } from './status';
-import setAnnualWaterRight from './components/setAnnualWaterRight.vue';
-import { getPriceList, deletePrice } from '@/api/price/index.js';
-import { getTree } from '@/api/tree.js';
+import { Waterchargingtype, Electricitychargingtype } from './status'
+import setAnnualWaterRight from './components/setAnnualWaterRight.vue'
+import setAnnualWaterRightAdd from './components/setAnnualWaterRightAdd.vue'
+import { getPriceList, deletePrice } from '@/api/price/index.js'
+import { getTree } from '@/api/tree.js'
 import { assign, omit } from 'lodash-es';
 
 export default {
   name: 'waterElectricityPriceSetting',
-  components: { BTable, setAnnualWaterRight, SelectTree },
+  components: { BTable, setAnnualWaterRight, SelectTree, setAnnualWaterRightAdd },
   data() {
     return {
       form: {
@@ -210,6 +207,7 @@ export default {
       areaId: '',
       loading: false,
       associationManageShow: false,
+      addAssociationManageShow: false,
       priceConfigVal: '',
       priceconfigWaterchargingtype: '',
       priceconfigElectricitychargingtype: '',
@@ -312,6 +310,12 @@ export default {
     this.getWaterrightList();
   },
   methods: {
+    changeNum(num) {
+      return num == null ? '∞' : num
+     },
+    addAssociation() { 
+      this.addAssociationManageShow = true
+    },
     editAssociation(row) {
       this.editRow = row;
       this.associationManageShow = true;
@@ -321,10 +325,11 @@ export default {
         const res = await getTree();
         this.treeData = res?.data;
         this.treeData.unshift({
+          id: '',
           cusareaId: '',
-          cusareaName: '行政区域(全国)'
-        });
-        this.areaId = this.treeData[0].cusareaId;
+          cusareaName: '全部'
+        })
+        this.areaId = this.treeData[0].cusareaId
       }
     },
     handlerClick(value) {

+ 16 - 3
src/views/infrastructure/waterEstablishment.vue

@@ -169,9 +169,22 @@ export default {
           res = await getTree();
           this.$store.dispatch('tree/setTree', res);
         }
-        this.treeData = res?.data;
-        this.cusareaName ||= this.treeData[0].cusareaName;
-        this.areaId = this.treeData[0].cusareaId;
+        this.treeData = res?.data
+        let tflag = true
+        this.treeData.forEach(t => {
+          if (t?.cusareaName == '全部') {
+            tflag = false
+          }
+        })
+        if (tflag) {
+          this.treeData.unshift({
+            id: '',
+            cusareaId: '',
+            cusareaName: '全部'
+          })
+        }
+        this.cusareaName ||= this.treeData[0].cusareaName
+        this.areaId = this.treeData[0].cusareaId
       }
       const params = {
         areaId: this.areaId,

+ 91 - 203
src/views/monitoringMamage/components/IrrigationRecord.vue

@@ -1,271 +1,154 @@
 <template>
-  <el-dialog
-    title="灌溉记录"
-    :visible.sync="dialogVisible"
-    :close-on-click-modal="false"
-    :close-on-press-escape="false"
-    @close="handleClose"
-    width="1200px"
-  >
-  <div style="margin-bottom: 20px">
-    <span>农户姓名:</span>
-    <el-input
-      v-model="form.tarcecodeapplyno"
-      style="width: 250px;margin:0 15px;"
-      placeholder="请i输入农户编号/姓名/电话"
-      @keyup.enter.native="handleSearch"
-      clearable
-    />
-    <span>时间:</span>
-    <el-input
-      v-model="form.tarcecodeapplyno"
-      style="width: 250px;margin:0 15px;"
-      placeholder="请i输入农户编号/姓名/电话"
-      @keyup.enter.native="handleSearch"
-      clearable
-    />
-    <el-button
-      type="primary"
-      size="small"
-      @click="handleSearch"
-      >查询</el-button
-    >
-  </div>
-  <b-table
-    ref="tableRef"
-    :args="{ 'highlight-current-row': true }"
-    :data="loadData"
-    :columns="columns"
-  >
-    <template #styleImg="scope">
-      <el-image
-        :src="scope.row.imgPreview"
-        :preview-src-list="[scope.row.imgPreview]"
-        slot="error"
-        class="image-slot"
-        style="width: 100px; height: 50px"
-      >
-        <div slot="error" class="image-slot"></div>
-      </el-image>
-    </template>
-    <template #number="scope">
-      <div>1</div>
-      <div>2</div>
-      {{ scope.row.finishGoodName&&scope.row.finishgoodNo?scope.row.finishGoodName + '-' + scope.row.finishgoodNo:'' }}
-    </template>
-    <template #codeNo="scope">           
-      <el-link
-        type="primary"
-        :underline="false"
-        @click="goDetail(scope.row)"
-        >{{ scope.row.traceCodeApplyConcat }}</el-link
-      >
-    </template>
-    <template #status="scope">
-      <span style="display:flex;align-items:center;justify-content:center">
-        <span class="status"></span>
-        {{ scope.row.name }}
-      </span>
-    </template>
-    <template #useNumber="scope">
-      {{ scope.row.useNumber + '/' + scope.row.totalNumber }}
-    </template>
-    <template #finishGoodName="scope">
-      {{ scope.row.finishGoodName&&scope.row.finishgoodNo?scope.row.finishGoodName + '-' + scope.row.finishgoodNo:'' }}
-    </template>
-  </b-table>
+  <el-dialog title="灌溉记录" :visible.sync="dialogVisible" :close-on-click-modal="false" :close-on-press-escape="false"
+    @close="handleClose" width="1400px">
+    <div style="margin-bottom: 20px">
+      <el-date-picker v-model="dateValue" clearable type="daterange" value-format="yyyy-MM-dd HH:mm:ss"
+        :default-time="['00:00:00', '23:59:59']" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
+      </el-date-picker>
+      <el-button type="primary" size="small" style="margin-left: 16px;" @click="handleSearch">查询</el-button>
+    </div>
+    <b-table ref="tableRef" :args="{ 'highlight-current-row': true }" :data="loadData" :columns="columns" showIndex>
+      <template #cardusercdBillingtype="scope">
+        <span style="display:flex;align-items:center;justify-content:center">
+          {{ changeDict(scope.row.cardusercdBillingtype) }}
+        </span>
+      </template>
+    </b-table>
   </el-dialog>
 </template>
 
 <script>
+import { getCardusercdList } from '@/api/card/index.js'
 import { assign, omit } from 'lodash-es';
 import LeftImg from '../assets/img.svg'
 import BTable from '@/components/Table'
 export default {
   name: 'IrrigationRecord',
   props: {
-    data: {
-      default() {
-        return {};
-      }
-    },
     visible: {
       type: Boolean,
       default: false
+    },
+    irrigationDetail: {
+      type: Object,
+      default: () => { }
     }
   },
   data() {
     return {
       LeftImg: LeftImg,
+      dateValue: '',
       columns: [
         {
-          label: '行政区',
-          prop: 'person',
+          label: '水源编号',
+          prop: 'waterNum',
           customRender: '',
-          align: 'center'
+          align: 'center',
         },
         {
-          label: '农户',
-          prop: 'area',
+          label: '水源名称',
+          prop: 'waterName',
           customRender: '',
           align: 'center'
         },
         {
-          label: '手机号',
-          prop: 'name',
+          label: '本次耗水量(m³)',
+          prop: 'cardusercdWaternum',
           customRender: '',
           align: 'center'
         },
         {
-          label: '计量模式',
-          prop: 'phone',
-          customRender: 'number',
-          align: 'center'
-        },{
-          label: '总金额',
-          prop: 'phone',
+          label: '本次用电量(度)',
+          prop: 'cardusercdElectricnum',
           customRender: '',
           align: 'center'
-        },{
-          label: '用水量',
-          prop: 'phone',
-          customRender: '',
-          align: 'center'
-        },{
-          label: '用水金额',
-          prop: 'phone',
+        },
+        {
+          label: '开始时间',
+          prop: 'cardusercdStarttime',
           customRender: '',
           align: 'center'
-        },{
-          label: '用电量',
-          prop: 'phone',
+        },
+        {
+          label: '结束时间',
+          prop: 'cardusercdEndtime',
           customRender: '',
           align: 'center'
-        },{
-          label: '用电金额',
-          prop: 'phone',
+        },
+        {
+          label: '使用时长',
+          prop: 'cardusercdDuration',
           customRender: '',
           align: 'center'
-        },{
-          label: '开泵时间',
-          prop: 'phone',
-          customRender: '',
+        },
+        {
+          label: '计费方式',
+          prop: 'cardusercdBillingtype',
+          customRender: 'cardusercdBillingtype',
           align: 'center'
-        },{
-          label: '关泵时间',
-          prop: 'phone',
+        },
+        {
+          label: '计费标准',
+          prop: 'cardusercdPriceinfo',
           customRender: '',
           align: 'center'
-        },{
-          label: '灌溉时长',
-          prop: 'phone',
+        },
+        {
+          label: '扣除金额',
+          prop: 'cardusercdUsemoney',
           customRender: '',
           align: 'center'
         }
       ],
-      form: {
-        productName: ''
-      },
       dialogVisible: false,
-      baseForm: {
-        productName: '',
-        stockAmount: '',
-        goodsSpecValue: '',
-        supplierId: '',
-      },
-      hasFetched: false,
-      rules: {
-        stockAmount: [
-          { required: true, message: '请选择负责人', trigger: 'blur' }
-        ],
-        sourceinfoId: [
-          { required: true, message: '请选择管辖范围', trigger: 'blur' }
-        ],
-        productName: [
-          { required: true, message: '请输入协会名称', trigger: 'blur' }
-        ],
-        supplierId: [
-          { required: false, message: '请输入协会介绍', trigger: 'blur' }
-        ],
-        goodsSpecValue: [
-          { required: true, message: '请选择规格', trigger: 'blur' }
-        ]
-      }
     };
   },
-  components:{
+  components: {
     BTable
   },
   watch: {
     visible(val) {
       if (val !== this.dialogVisible) {
         this.dialogVisible = val;
-        if (val) {
-          assign(this.baseForm, this.data);
-          if (!this.hasFetched) {
-            this.hasFetched = true;
-          }
-        }
       }
     },
-    data: {
-      deep: true,
+    irrigationDetail: {
       handler(val) {
-        assign(this.baseForm, val);
-      }
+        const tmnId = val?.tmnId
+        this.tmnId = tmnId
+        this.handleSearch()
+      },
+      deep: true
     }
   },
   methods: {
+    changeDict(flag) {
+      switch (flag) {
+        case '0':
+          return '水电双计'
+        case '1':
+          return '只计水'
+        case '2':
+          return '只计电'
+       }
+     },
     loadData(parameter) {
-      const queryform = this.form;
-      const payload = omit(assign({}, parameter, queryform, {orderByColumn:'tarcecodeapplyCreateddate',isAsc:'desc'}), []);
+      const payload = omit(assign({}, parameter), []);
       return this.getTableData(payload);
     },
-    handleSearch() { },
-    getTableData(payload) {
-      return Promise.resolve({
-        data: [{
-            person:"王大虎",
-            area: '2016-05-02',
-            name: '王小虎',
-            phone: 1588888888,
-            address: '上海市普陀区金沙<br>江路 1518 弄'
-          }, {
-            person:"王大虎",
-            area: '2016-05-04',
-            name: '王小虎',
-            phone: 1588888888,
-            address: '上海市普陀区金沙江路 1517 弄'
-          }, {
-            person:"王大虎",
-            area: '2016-05-01',
-            name: '王小虎',
-            phone: 1588888888,
-            address: '上海市普陀区金沙江路 1519 弄'
-          }, {
-            person:"王大虎",
-            area: '2016-05-03',
-            name: '王小虎',
-            phone: 1588888888,
-            address: '上海市普陀区金沙江路 1516 弄'
-          }]
-      })
+    handleSearch() {
+      this.$refs.tableRef && this.$refs.tableRef.refresh(true);
     },
-    resetForm(formName) {
-      this.dialogVisible = false;
-    },
-    resetFormData() {
-      this.baseForm = {};
-    },
-    submitForm(formName) {
-      this.$refs[formName].validate((valid) => {
-        console.log(valid)
+    getTableData() {
+      const [startTime, endTime] = this.dateValue
+      return getCardusercdList({
+        tmdId: this.tmnId,
+        startTime,
+        endTime
       })
     },
-
     handleClose() {
       this.$emit('update:visible', false);
-      this.resetForm('baseForm');
     },
   }
 };
@@ -275,25 +158,30 @@ export default {
 .input-number {
   width: 100%;
 }
-h3{
+
+h3 {
   height: 14px;
   color: #333333;
   font-size: 14px;
   font-weight: 700;
-  margin:0 0 20px 0;
+  margin: 0 0 20px 0;
 }
-.right_content{
+
+.right_content {
   margin-bottom: 10px;
-  label{
+
+  label {
     color: #999;
     font-size: 14px;
     font-weight: 400;
   }
-  span{
+
+  span {
     color: #333333;
     font-size: 14px;
   }
 }
+
 .base-form {
   max-height: 70vh;
   overflow-y: auto;

+ 63 - 188
src/views/monitoringMamage/components/realTimeMonitor.vue

@@ -1,13 +1,13 @@
 <template>
   <el-dialog
-    title="实时测"
+    title="实时测"
     :visible.sync="dialogVisible"
     :close-on-click-modal="false"
     :close-on-press-escape="false"
     @close="handleClose"
     width="1200px"
   >
-  <h3>淮河社区居民委员会机井(6544425)</h3>
+  <h3>{{ realDtaile.waterName }}</h3>
   <el-row style="margin-bottom: 20px;">
     <el-col :span="6">
       <el-image :src="LeftImg"/>
@@ -16,16 +16,16 @@
       <el-row class="right_content">
         <el-col :span="6">
           <label>设备状态:</label>
-          <span>在线</span>
+          <span>{{ realDtaile.tmnstatusRunstatusContent || '-' }}</span>
         </el-col>
         <el-col :span="12">
           <label>水泵:</label>
-          <span></span>
+          <span>{{ tmnstatusRunstatus }}</span>
         </el-col>
       </el-row>
       <div class="right_content">
         <label>详细地址:</label>
-        <span>河南省/郑州市/二七区/淮河路街道/淮河社区居民委员会</span>
+        <span>{{ realDtaile.waterAddress  || '-' }}</span>
       </div>
       <el-row class="right_content">
         <el-col :span="6">
@@ -34,12 +34,12 @@
         </el-col>
         <el-col :span="12">
           <label>水泵功率:</label>
-          <span>3W</span>
+          <span>-</span>
         </el-col>
       </el-row>
       <div class="right_content" style="margin:0">
         <label>灌溉面积:</label>
-        <span>125亩</span>
+        <span>-</span>
       </div>
     </el-col>
   </el-row>
@@ -50,40 +50,10 @@
     :data="loadData"
     :columns="columns"
     isShowIndex
-    :showPagination="false"
   >
-    <template #styleImg="scope">
-      <el-image
-        :src="scope.row.imgPreview"
-        :preview-src-list="[scope.row.imgPreview]"
-        slot="error"
-        class="image-slot"
-        style="width: 100px; height: 50px"
-      >
-        <div slot="error" class="image-slot"></div>
-      </el-image>
-    </template>
-    <template #codeNo="scope">           
-      <el-link
-        type="primary"
-        :underline="false"
-        @click="goDetail(scope.row)"
-        >{{ scope.row.traceCodeApplyConcat }}</el-link
-      >
+     <template #pump_status="scope">           
+      {{ scope.row.pump_status == 0 ? '关': '开' }}
     </template>
-    <template #status="scope">
-      <span style="display:flex;align-items:center;justify-content:center">
-        <span class="status"></span>
-        {{ scope.row.name }}
-      </span>
-    </template>
-    <template #useNumber="scope">
-      {{ scope.row.useNumber + '/' + scope.row.totalNumber }}
-    </template>
-    <template #finishGoodName="scope">
-      {{ scope.row.finishGoodName&&scope.row.finishgoodNo?scope.row.finishGoodName + '-' + scope.row.finishgoodNo:'' }}
-    </template>
-
     <template #operate="scope">
       <el-link
         size="small"
@@ -103,45 +73,35 @@
       >
     </template>
   </b-table>
-
-    <div style="text-align: right;margin-top:20px">
-      <el-button type="info" plain @click="resetForm('baseForm')"
-        >取消</el-button
-      >
-      <el-button
-        type="primary"
-        style="margin-left:16px;"
-        @click="submitForm('baseForm')"
-        :disabled="dialogSubmitLoading"
-        :loading="dialogSubmitLoading"
-        >确定</el-button
-      >
-    </div>
+  <div style="text-align: right;margin-top:20px">
+   
+  </div>
   </el-dialog>
 </template>
 
 <script>
+import dayjs from 'dayjs'
 import { assign, omit } from 'lodash-es';
-import { UPLOAD_TYPE_MAP } from '@/utils/constants';
 import LeftImg from '../assets/img.svg'
 import BTable from '@/components/Table'
+import { getDataInfo } from '@/api/card/index2.js'
 export default {
   name: 'realTimeMonitor',
   props: {
-    data: {
-      default() {
-        return {};
-      }
-    },
     visible: {
       type: Boolean,
       default: false
+    },
+    realDtaile: {
+      type: Object,
+      default: () => { }
     }
   },
   data() {
     return {
       LeftImg: LeftImg,
-      imageUploadType: UPLOAD_TYPE_MAP.FARMING_RECORD,
+      query: '',
+      tmnstatusRunstatus: '关',
       columns: [
         {
           label: '农户姓名',
@@ -151,39 +111,39 @@ export default {
         },
         {
           label: '手机号',
-          prop: 'area',
+          prop: 'phone',
           customRender: '',
           align: 'center'
         },
         {
           label: '瞬时流量( m³/s)',
-          prop: 'name',
+          prop: 'cur_flow',
           customRender: '',
           align: 'center'
         },
         {
           label: '累计流量(m³)',
-          prop: 'phone',
+          prop: 'sum_water',
           customRender: '',
           align: 'center'
         },{
           label: '电压(v)',
-          prop: 'phone',
+          prop: 'voltage',
           customRender: '',
           align: 'center'
         },{
           label: '水位(m)',
-          prop: 'phone',
+          prop: 'liu_deep',
           customRender: '',
           align: 'center'
         },{
           label: '状态',
-          prop: 'phone',
-          customRender: '',
+          prop: 'pump_status',
+          customRender: 'pump_status',
           align: 'center'
         },{
           label: '上传时间',
-          prop: 'phone',
+          prop: 'timer',
           customRender: '',
           align: 'center'
         }
@@ -200,28 +160,6 @@ export default {
         supplierId: '',
         imageArr2: []
       },
-      productList: [],
-      syinfoList: [],
-      processList: [],
-      hasFetched: false,
-      landList: [], //基地列表
-      rules: {
-        stockAmount: [
-          { required: true, message: '请选择负责人', trigger: 'blur' }
-        ],
-        sourceinfoId: [
-          { required: true, message: '请选择管辖范围', trigger: 'blur' }
-        ],
-        productName: [
-          { required: true, message: '请输入协会名称', trigger: 'blur' }
-        ],
-        supplierId: [
-          { required: false, message: '请输入协会介绍', trigger: 'blur' }
-        ],
-        goodsSpecValue: [
-          { required: true, message: '请选择规格', trigger: 'blur' }
-        ]
-      }
     };
   },
   components:{
@@ -231,118 +169,55 @@ export default {
     visible(val) {
       if (val !== this.dialogVisible) {
         this.dialogVisible = val;
-        if (val) {
-          assign(this.baseForm, this.data);
-          if (!this.hasFetched) {
-            this.getProductList();
-            this.getSyinfoList();
-            this.getProcessList();
-            this.hasFetched = true;
-          }
-        }
       }
     },
-    data: {
-      deep: true,
+    realDtaile: {
       handler(val) {
-        // console.log(val)
-        assign(this.baseForm, val);
-        // console.log(this.baseForm)
-      }
+        this.query = val?.tmnId
+        this.handleSearch()
+      },
+      deep: true
     }
   },
-  created() {},
-  mounted() {},
   methods: {
-    loadData(parameter) {
-      const queryform = this.form;
-      const payload = omit(assign({}, parameter, queryform, {orderByColumn:'tarcecodeapplyCreateddate',isAsc:'desc'}), []);
-      return this.getTableData(payload);
-    },
-    getTableData(payload) {
-      return Promise.resolve({
-        data: [{
-            person:"王大虎",
-            area: '2016-05-02',
-            name: '王小虎',
-            phone: 1588888888,
-            address: '上海市普陀区金沙江路 1518 弄'
-          }, {
-            person:"王大虎",
-            area: '2016-05-04',
-            name: '王小虎',
-            phone: 1588888888,
-            address: '上海市普陀区金沙江路 1517 弄'
-          }, {
-            person:"王大虎",
-            area: '2016-05-01',
-            name: '王小虎',
-            phone: 1588888888,
-            address: '上海市普陀区金沙江路 1519 弄'
-          }, {
-            person:"王大虎",
-            area: '2016-05-03',
-            name: '王小虎',
-            phone: 1588888888,
-            address: '上海市普陀区金沙江路 1516 弄'
-          }]
-      })
-    },
-    getProductList() {
-    },
-    getSyinfoList() {
-    },
-    getProcessList() {
-    },
-    goProductsPage() {
-      this.handleClose();
-      this.$router.push({
-        path: '/Products',
-        query: {}
-      });
-    },
-    goSourceInfoPage() {
-      this.handleClose();
-      this.$router.push({
-        path: '/sourceInfo',
-        query: {
-          type: 'add'
-        }
-      });
-    },
-    goProcessPage() {
-      this.handleClose();
-      this.$router.push({
-        path: '/basicsettings/process',
-        query: {}
-      });
-    },
     resetForm(formName) {
       this.dialogVisible = false;
     },
-    resetFormData() {
-      this.baseForm = {};
+    loadData(parameter) {
+      const payload = omit(assign({}, parameter), []);
+      return this.getTableData(payload);
     },
-    submitForm(formName) {
-      this.$refs[formName].validate((valid) => {
-        console.log(valid)
-      })
+    handleSearch() {
+      this.$refs.tableRef && this.$refs.tableRef.refresh(true);
     },
-
-    handleClose() {
-      this.$emit('update:visible', false);
-      this.resetForm('baseForm');
+   async getTableData() {
+     const res = await getDataInfo(this.query)
+     const resData = res?.data
+     const list = resData?.valve
+     const list2 = resData?.nowData
+     const resList = {}
+     resList.person = '-'
+     resList.phone = '-'
+     resList.voltage = '-'
+     resList.timer = dayjs().format('YYYY-MM-DD')
+     resList.pump_status = list?.pump_status?.value
+     this.tmnstatusRunstatus = resList.pump_status == 0 ? '关':'开'
+     resList.sum_ele = list?.sum_ele?.value
+     resList.sum_water = list?.sum_water?.value
+     resList.cur_flow = list2?.cur_flow?.value
+     resList.line_press = list2?.line_press?.value
+     resList.liu_deep = list2?.liu_deep?.value
+     const params = {
+       data: [resList],
+       total: 1
+     }
+     return new Promise((resolve, reject) => { 
+      resolve(params)
+     })
     },
-    handleSuccess() {
-      this.resetForm('baseForm');
+    handleClose() {
       this.$emit('update:visible', false);
-      this.$emit('success');
     },
-    handleKeyUp(target, key) {
-      target[key] = target[key].match(/\d+(\.\d{0,2})?/)
-        ? target[key].match(/\d+(\.\d{0,2})?/)[0]
-        : '';
-    }
   }
 };
 </script>

+ 33 - 10
src/views/monitoringMamage/index.vue

@@ -194,8 +194,14 @@
         </el-col>
       </el-card>
     </el-col>
-    <real-time-monitor :visible.sync="realTimeShow" />
-    <irrigation-record :visible.sync="irrigationShow" />
+    <real-time-monitor
+      :visible.sync="realTimeShow"
+      :realDtaile="realDtaile"
+    />
+    <irrigation-record 
+      :visible.sync="irrigationShow"
+      :irrigationDetail="irrigationDetail"
+    />
   </el-row>
 </template>
 
@@ -220,7 +226,9 @@ export default {
   },
   data() {
     return {
-      dateValue: '',
+      irrigationDetail: {},
+      realDtaile: {},
+      dateValue:'',
       form: {
         productName: ''
       },
@@ -349,16 +357,18 @@ export default {
     //   const data = res?.data
     //   this.treeData = data
     // },
-    irrigationShowHistory() {
-      this.irrigationShow = true;
+    irrigationShowHistory(row) {
+      this.irrigationShow = true
+      this.irrigationDetail = row
     },
 
     setCurrentData(areaId) {
       this.areaId = areaId;
       this.$refs.tableRef.refresh(false);
     },
-    realTime() {
-      this.realTimeShow = true;
+    realTime(row) {
+      this.realTimeShow = true
+      this.realDtaile = row
     },
     async loadData(parameter) {
       if (!this.areaId) {
@@ -370,9 +380,22 @@ export default {
           res = await getTree();
           this.$store.dispatch('tree/setTree', res);
         }
-        this.treeData = res?.data;
-        this.cusareaName ||= this.treeData[0].cusareaName;
-        this.areaId = this.treeData[0].cusareaId;
+        this.treeData = res?.data
+        let tflag = true
+        this.treeData.forEach(t => {
+          if (t?.cusareaName == '全部') {
+            tflag = false
+          }
+        })
+        if (tflag) {
+          this.treeData.unshift({
+            id: '',
+            cusareaId: '',
+            cusareaName: '全部'
+          })
+        }
+        this.cusareaName ||= this.treeData[0].cusareaName
+        this.areaId = this.treeData[0].cusareaId
       }
       const params = {
         areaId: this.areaId,

+ 74 - 35
src/views/peasantHouseholdManage/components/addedFarmers.vue

@@ -102,6 +102,27 @@
                 </el-row>
               </el-form-item>
             </el-col>
+              <el-col :span="12">
+                <el-form-item label="土地面积" prop="farmerAreasize">
+                  <el-row>
+                    <el-col style="position:relative">
+                      <el-input
+                        v-model="baseForm.farmerAreasize"
+                        type="number"
+                        filterable
+                        style="width: 90%"
+                        placeholder="请输入土地面积"
+                      >
+                      </el-input>
+                      <span style="position:absolute;margin-left:10px">亩</span>
+                    </el-col>
+                  </el-row>
+                </el-form-item>
+              </el-col>
+          </el-row>
+        </el-col>
+        <el-col :span="24">
+          <el-row>
             <el-col :span="12">
               <el-form-item label="水权" prop="farmerWramount">
                 <el-row>
@@ -120,27 +141,6 @@
             </el-col>
           </el-row>
         </el-col>
-        <el-col :span="24">
-          <el-row>
-            <el-col :span="12">
-              <el-form-item label="土地面积" prop="farmerAreasize">
-                <el-row>
-                  <el-col style="position:relative">
-                    <el-input
-                      v-model="baseForm.farmerAreasize"
-                      type="number"
-                      filterable
-                      style="width: 90%"
-                      placeholder="请输入土地面积"
-                    >
-                    </el-input>
-                    <span style="position:absolute;margin-left:10px">亩</span>
-                  </el-col>
-                </el-row>
-              </el-form-item>
-            </el-col>
-          </el-row>
-        </el-col>
       </el-row>
     </el-form>
     <div style="text-align: right">
@@ -160,8 +160,8 @@
 </template>
 
 <script>
+import { Message } from 'element-ui'
 import { isValidIDCard, checkPhone } from '@/utils/index.js'
-import { assign } from 'lodash-es';
 import SelectTree from '@/components/SelectTree';
 import { addFarmer,editFarmer, getAreaInfo } from '@/api/farmer/list.js'
 
@@ -202,7 +202,9 @@ export default {
       areaAll: '0',
       waterRightAll: '0',
       yieldPer: '0',
-      residualWaterRight:'0',
+      residualWaterRight: '0',
+      areasizeResidue: '0',
+      currentItem: {},
       rules: {
         areaId: [
           { required: true, message: '请选择所属区域', trigger: 'blur' }
@@ -239,21 +241,33 @@ export default {
           {
             required: true, validator: (rule, value, callback) => {
               if (!value) { callback(new Error('请输入土地面积')); return }
-              if (isNaN(value)) callback(new Error('请正确输入您的土地面积'))
-              else if (value > this.areaAll) {
-                callback(new Error('输入的土地面积不能大于总面积'))
+              if (+value < 0) {  callback(new Error('土地面积不能为负数')); return }
+              if (isNaN(value)) { callback(new Error('请正确输入您的土地面积')); return }
+              if (this.isEdit) {
+                if (+value > (+this.areasizeResidue) + (+this.editFarmerData.farmerAreasize)) {
+                  callback(new Error('输入的土地面积不能大于总面积'))
+                  return
+                } else {
+                  callback()
+                }
               } else {
-                callback()
+                if (+value > +this.areasizeResidue) {
+                  callback(new Error('输入的水权不能大于剩余面积'))
+                  return
+                } else {
+                  callback()
+                }
               }
             }, trigger: 'blur' }
         ],
         farmerWramount: [
           {
             required: true, validator: (rule, value, callback) => {
-              if (!value) { callback(new Error('请输入水权')); return }
+              if (value == 0) { callback(new Error('请输入水权')); return }
+              if (+value < 0) { callback(new Error('水权不能为负数')); return }
               if (isNaN(value)) { callback(new Error('请正确输入您的水权')); return }
               if (this.isEdit) {
-                if (+value > (+this.residualWaterRight) + (+this.editFarmerData.farmerWrbalance)) {
+                if (+value > (+this.residualWaterRight) + (+this.editFarmerData.farmerWramount)) {
                   callback(new Error('输入的水权不能大于剩余水权'))
                   return
                 } else { 
@@ -278,20 +292,29 @@ export default {
         this.dialogVisible = val;
       }
       if (!val) {
-        this.$refs.baseForm.clearValidate()
-        this.baseForm = {}
+        this.$refs.baseForm?.clearValidate()
+        this.baseForm = { areaId:'' }
+        this.$emit('closeHandler')
         this.cusareaName = ''
         this.clearItem()
       }
     },
+    'baseForm.farmerAreasize': {
+      handler(val) {
+        if (this.yieldPer > 0) { 
+          this.baseForm.farmerWramount = Number(this.yieldPer) * val
+        }
+      },
+      deep: true,
+      immediate: true
+    },
     editFarmerData: {
       handler(val) {
-        if (this.isEdit) { 
+        if (this.isEdit && val?.areaId) { 
           this.baseForm = { ...val }
           this.handlerClick(val)
-          this.cusareaName = val?.cusareaName || ''
         } else {
-          this.baseForm = {}
+          this.baseForm = { areaId: '' }
           this.cusareaName =  ''
         }
       },
@@ -303,6 +326,12 @@ export default {
       },
       deep: true,
       immediate: true
+    },
+    'baseForm.areaId': {
+      handler(val) {
+        val && this.$refs.baseForm?.clearValidate('areaId')
+      },
+      deep: true
     }
   },
   methods: {
@@ -314,6 +343,7 @@ export default {
       this.yieldPer = value ? value?.waterrightAmount == 0 ? 0 : (value?.waterrightAreasize) / (value?.waterrightAmount) : 0
       this.yieldPer = (+this.yieldPer).toFixed(2)
       this.residualWaterRight = value?.amountResidue ?? 0
+      this.areasizeResidue = value?.areasizeResidue ?? 0
       this.residualWaterRight = (+this.residualWaterRight).toFixed(2)
     },
     clearItem() { 
@@ -330,14 +360,23 @@ export default {
         waterrightYear: new Date().getFullYear(),
         areaId: item.areaId
       })
+      this.currentItem = item
       const value = res?.data
-      this.baseForm.areaId = value?.areaId
+      this.cusareaName = item?.cusareaName
+      const areaId = item?.areaId || ''
+      this.baseForm.areaId = areaId
+      this.$set(this.baseForm,'areaId', areaId)
       this.setItem(value)
     },
     resetForm() {
       this.dialogVisible = false;
+      this.cusareaName = ''
     },
     async handlerAddFarmer() {
+      if (this.currentItem?.children?.length > 0) {
+        Message.warning('请选择最小行政区块')
+        return
+       }
       if(!this.isEdit){
         const res = await addFarmer(this.baseForm)
         if(res?.code === "000000") {

+ 48 - 24
src/views/peasantHouseholdManage/index.vue

@@ -127,22 +127,23 @@
         </el-col>
       </el-card>
     </el-col>
-    <added-farmers
-      :visible.sync="associationManageShow"
-      :treeData="treeDatas"
-      :editFarmerData="editFarmerData"
-      :isEdit="isEdit"
-      :currentClickId="currentClickId"
-      @refresh="handleSearch"
-    />
-    <farmer-management
-      :visible.sync="farmerManageShow"
-      :detailsData="detailsData"
-    />
-    <irrigation-record
-      :visible.sync="irrigationShow"
-      :irrigationDetail="irrigationDetail"
-    />
+  <added-farmers
+    :visible.sync="associationManageShow"
+    :treeData="treeDatas"
+    :editFarmerData="editFarmerData"
+    :isEdit="isEdit"
+    :currentClickId="currentClickId"
+    @refresh="handleSearch"
+    @closeHandler="closeHandler"
+  />
+  <farmer-management 
+    :visible.sync="farmerManageShow"
+    :detailsData="detailsData"
+  />
+  <irrigation-record
+    :visible.sync="irrigationShow"
+    :irrigationDetail="irrigationDetail"
+  />
   </el-row>
 </template>
 
@@ -178,6 +179,7 @@ export default {
       headers: {
         Authorization: 'Bearer ' + getToken()
       },
+      currentData: {},
       visibles: false,
       farmerName: '',
       detailsData: {},
@@ -204,9 +206,9 @@ export default {
         {
           label: '农户身份证',
           prop: 'farmerIdcard',
+          width: 200,
           customRender: '',
           align: 'center',
-          width: 160
         },
         {
           label: '联系电话',
@@ -242,6 +244,9 @@ export default {
     };
   },
   methods: {
+    closeHandler() {
+      this.editFarmerData = {}
+    },
     handleAvatarSuccess(res, file) {
       if (res.code !== '000000') {
         Message.error(res?.msg);
@@ -253,7 +258,11 @@ export default {
     handleUploadError() {
       Message.error('图片插入失败');
     },
-    beforeAvatarUpload(file) {
+    beforeAvatarUpload() {
+      if (this.currentData?.children?.length > 0) { 
+        Message.warning('请选择最小行政区块')
+        return false
+      }
       this.requestData = {
         areaId: this.currentClickId
       };
@@ -300,10 +309,24 @@ export default {
           res = await getTree();
           this.$store.dispatch('tree/setTree', res);
         }
-        this.treeData = res?.data;
-        this.currentClick = res?.data[0];
-        this.currentClickId = this.currentClick?.cusareaId;
-        this.getWaterrighTreetList(this.currentClickId);
+        this.treeData = res?.data
+        let tflag = true
+        this.treeData.forEach(t => {
+          if (t?.cusareaName == '全部') {
+            tflag = false
+          }
+        })
+        if (tflag) {
+          this.treeData.unshift({
+            id: '',
+            cusareaId: '',
+            cusareaName: '全部'
+          })
+        }
+        this.currentClick = res?.data[0]
+        this.currentClickId = this.currentClick?.cusareaId
+        this.currentData = this.currentClick
+        this.getWaterrighTreetList(this.currentClickId)
       }
       const params = {
         farmerName: this.farmerName,
@@ -312,8 +335,9 @@ export default {
       const payload = omit(assign({}, parameter, params), []);
       return getFarmerList(payload);
     },
-    setCurrentData(areaId) {
-      this.currentClickId = areaId;
+    setCurrentData(areaId, data) {
+      this.currentData = data
+      this.currentClickId = areaId
       this.$refs.tableRef.refresh(false);
     },
     irrigationShowHistory(row) {

+ 16 - 3
src/views/waterCardManage/index.vue

@@ -350,9 +350,22 @@ export default {
           res = await getTree();
           this.$store.dispatch('tree/setTree', res);
         }
-        this.treeData = res?.data;
-        this.currentClick = res?.data[0];
-        this.currentClickId = this.currentClick?.cusareaId;
+        this.treeData = res?.data
+        let tflag = true
+        this.treeData.forEach(t => {
+          if (t?.cusareaName == '全部') {
+            tflag = false
+          }
+        })
+        if (tflag) {
+          this.treeData.unshift({
+            id: '',
+            cusareaId: '',
+            cusareaName: '全部'
+          })
+        }
+        this.currentClick = res?.data[0]
+        this.currentClickId = this.currentClick?.cusareaId
       }
       this.searchHandler(this.farmerName, this.currentClickId);
       return this.getTableData(parameter, this.currentClickId);

+ 29 - 11
src/views/waterManage/index.vue

@@ -64,14 +64,14 @@
         </el-col>
       </el-card>
     </el-col>
-    <association-manage
-      :visible.sync="associationManageShow"
-      :treeData="treeData"
-      :userList="userList"
-      @getList="handleSearch"
-      :typeAssoc="typeAssoc"
-      :editRow="editRow"
-    />
+  <association-manage
+    :visible.sync="associationManageShow"
+    :treeData="treeData2"
+    :userList="userList"
+    @getList="handleSearch"
+    :typeAssoc="typeAssoc"
+    :editRow="editRow"
+  />
   </el-row>
 </template>
 
@@ -84,6 +84,7 @@ import SelectTree from '@/components/SelectTree';
 import { getTree } from '@/api/tree.js';
 import { Message } from 'element-ui';
 import { assign, omit } from 'lodash-es';
+import { deepClone } from '@/utils/index.js'
 
 export default {
   name: 'waterManage',
@@ -95,6 +96,7 @@ export default {
       },
       userList: [],
       treeData: [],
+      treeData2: [],
       loading: false,
       cusareaName: '',
       associationManageShow: false,
@@ -172,9 +174,25 @@ export default {
           res = await getTree();
           this.$store.dispatch('tree/setTree', res);
         }
-        this.treeData = res?.data;
-        this.cusareaName ||= this.treeData[0].cusareaName;
-        this.areaId = this.treeData[0].cusareaId;
+        this.treeData = res?.data
+        this.treeData2 = []
+        this.treeData2 = deepClone(res?.data)
+        this.treeData2 = this.treeData2.filter(t => t?.cusareaName != '全部')
+        let tflag = true
+        this.treeData.forEach(t => { 
+          if (t?.cusareaName == '全部') { 
+            tflag = false
+          }
+        })
+        if (tflag) { 
+          this.treeData.unshift({
+            id: '',
+            cusareaId: '',
+            cusareaName: '全部'
+          })
+        }
+        this.cusareaName ||= this.treeData[0].cusareaName
+        this.areaId = this.treeData[0].cusareaId
       }
       const params = {
         assocName: this.assocName,

+ 21 - 2
src/views/waterMarket/component/waterDeal.vue

@@ -172,10 +172,27 @@ export default {
       },
       rules: {
         trxrcdSellerid: [
-          { required: true, message: '请选择您的卖方用水户', trigger: 'change' }
+          {
+            required: true, validator: (rule, value, callback) => {
+              if (!value) callback(new Error('请选择您的卖方用水户'))
+              if (value === this.baseForm?.trxrcdBuyerid) {
+                callback(new Error('卖方和买方不能是同一个用户'))
+                return
+              } else { 
+                callback()
+              }
+           }, trigger: 'change' }
         ],
         trxrcdBuyerid: [
-          { required: true, message: '请选择您的买方用水户', trigger: 'change' }
+          { required: true, validator: (rule, value, callback) => {
+              if (!value) callback(new Error('请选择您的买方用水户'))
+            if (value === this.baseForm?.trxrcdSellerid) {
+              callback(new Error('卖方和买方不能是同一个用户'))
+              return
+            } else { 
+              callback()
+            }
+            },  trigger: 'change' }
         ],
         trxrcdPrice: [
           { required: true, validator: (rule, value, callback) => {
@@ -192,6 +209,8 @@ export default {
               if (!value) callback(new Error('请输入您的交易价格'));
               if (value <= 0) {
                 callback(new Error('请正确输入您的交易价格'));
+              } else if (value > this.sellerRow.farmerWrbalance) { 
+                callback(new Error('交易水量不能大于可用水权'));
               } else {
                 callback()
               }

+ 5 - 2
src/views/waterMarket/index.vue

@@ -145,8 +145,10 @@ export default {
   },
   methods: {
     async getFarmerListHandler() {
-      const res = await getFarmerList();
-      this.farmerList = res.data;
+      const res = await getFarmerList({
+        pageSize: 99999
+      })
+      this.farmerList = res.data
     },
     changeRoleType(type) {
       this.placeholder = type == 1 ? '请输入卖方姓名' : '请输入买方姓名';
@@ -181,6 +183,7 @@ export default {
     },
     handleSearch() {
       this.$refs.tableRef.refresh(true);
+      this.getFarmerListHandler()
     },
     goDetail(row) {
       this.$refs.sourceCodeDetail.open(row.tarcecodeapplyBatchno);

+ 3 - 3
src/views/waterSubsidy/components/newPolicy.vue

@@ -16,6 +16,7 @@
       :model="baseForm"
       :rules="rules"
       size="small"
+      style="height:600px;"
     >
       <el-row>
         <el-form-item label="标题:" prop="subsidypolicyTitle">
@@ -38,7 +39,7 @@
              name="file"
              :headers="headers"
              :before-upload="beforeAvatarUpload">
-             <img v-if="baseForm.src" :src="baseForm.src" class="avatar">
+             <img v-if="baseForm.src" :src="baseForm.src | formatImg" class="avatar">
              <i v-else class="el-icon-plus avatar-uploader-icon"></i>
            </el-upload>
            <span style="color:#F56C6C">仅支持上传jpg/jpeg/png且大小不超过5M的图片</span>
@@ -47,7 +48,7 @@
       <el-row style="height: 200px;">
         <el-form-item label="内容:" prop="subsidypolicyContent">
           <Editor
-            style="height: 150px"
+            style="height: 300px"
             v-model="baseForm.subsidypolicyContent"
             :mode="mode"
             @onCreated="onCreated"
@@ -166,7 +167,6 @@ export default {
       deep: true
     },
     'baseForm.src'(val) {
-      console.log(val, 'valvalvlalvalslsdkal12312')
       if(val) this.$refs.baseForm.clearValidate(['src'])
     },
     'baseForm.subsidypolicyContent'(val) {

+ 18 - 5
src/views/waterSubsidy/index.vue

@@ -40,7 +40,7 @@
           >
             <template #styleImg="scope">
               <el-image
-                :src="dialogImageUrl + scope.row.previews || ''"
+                :src="scope.row.previews | formatImg"
                 :preview-src-list="[dialogImageUrl + scope.row.previews || '']"
                 slot="error"
                 class="image-slot"
@@ -172,9 +172,22 @@ export default {
           res = await getTree();
           this.$store.dispatch('tree/setTree', res);
         }
-        this.treeData = res?.data;
-        this.cusareaName ||= this.treeData[0].cusareaName;
-        this.areaId = this.treeData[0].cusareaId;
+        this.treeData = res?.data
+        let tflag = true
+        this.treeData.forEach(t => {
+          if (t?.cusareaName == '全部') {
+            tflag = false
+          }
+        })
+        if (tflag) {
+          this.treeData.unshift({
+            id: '',
+            cusareaId: '',
+            cusareaName: '全部'
+          })
+        }
+        this.cusareaName ||= this.treeData[0].cusareaName
+        this.areaId = this.treeData[0].cusareaId
       }
       const params = {
         areaIds: this.areaId,
@@ -199,7 +212,7 @@ export default {
       this.policyType = 'edit';
       const params = {
         subsidypolicyTitle: row?.subsidypolicyTitle,
-        src: this.dialogImageUrl + row?.previews,
+        src: row?.previews,
         subsidypolicyContent: row?.subsidypolicyContent,
         subsidypolicyId: row?.subsidypolicyId,
         resIds: row?.resIds

+ 19 - 2
vue.config.js

@@ -39,7 +39,16 @@ module.exports = {
     proxy: {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       ['/iotprod-api']: {
-        target: `http://192.168.1.57:8027`,
+        // target: `http://192.168.1.57:8027`,
+        target: `http://192.168.1.221:7000`,
+        changeOrigin: true,
+        pathRewrite: {
+          ['^' + process.env.VUE_APP_BASE_API]: ''
+        }
+      },
+      ['/icsprod-api']: {
+        // target: `http://192.168.1.57:8027`,
+        target: `http://192.168.1.221:7000`,
         changeOrigin: true,
         pathRewrite: {
           ['^' + process.env.VUE_APP_BASE_API]: ''
@@ -48,12 +57,20 @@ module.exports = {
       [process.env.VUE_APP_BASE_API]: {
         // target: `http://192.168.1.57:8027`,
         // target: `http://192.168.95:8021`,
-        // target: `http://114.55.0.7:7000`,
         target: `http://192.168.1.221:7000`,
         changeOrigin: true,
         pathRewrite: {
           // ['^' + process.env.VUE_APP_BASE_API]: ''
         }
+      },
+      ['/portalprod-api']: {
+        // target: `http://192.168.1.95:7000`,
+        target: `http://192.168.1.221:7000`,
+        // target: `http://114.55.0.7:7000`,
+        changeOrigin: true,
+        pathRewrite: {
+          // ['^' + process.env.VUE_APP_BASE_API]: ''
+        }
       }
     },
     disableHostCheck: true