allen 2 лет назад
Родитель
Сommit
ef8ee9f9af

+ 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
 

+ 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;
 }

+ 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)
     }
   }
 };

+ 162 - 149
src/router/index.js

@@ -49,155 +49,168 @@ 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'),

+ 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();

+ 4 - 2
src/views/peasantHouseholdManage/components/addedFarmers.vue

@@ -280,13 +280,14 @@ export default {
       if (!val) {
         this.$refs.baseForm.clearValidate()
         this.baseForm = {}
+        this.$emit('closeHandler')
         this.cusareaName = ''
         this.clearItem()
       }
     },
     editFarmerData: {
       handler(val) {
-        if (this.isEdit) { 
+        if (this.isEdit && val?.areaId) { 
           this.baseForm = { ...val }
           this.handlerClick(val)
           this.cusareaName = val?.cusareaName || ''
@@ -331,7 +332,7 @@ export default {
         areaId: item.areaId
       })
       const value = res?.data
-      this.baseForm.areaId = value?.areaId
+      this.baseForm.areaId = item?.areaId
       this.setItem(value)
     },
     resetForm() {
@@ -355,6 +356,7 @@ export default {
       }
     },
     submitForm(formName) {
+      console.log(this.baseForm,'ajshdjaksdhajksdhj')
       this.$refs[formName].validate((valid) => {
         valid && this.handlerAddFarmer()
       })

+ 13 - 2
src/views/peasantHouseholdManage/index.vue

@@ -122,6 +122,7 @@
     :isEdit="isEdit"
     :currentClickId="currentClickId"
     @refresh="handleSearch"
+    @closeHandler="closeHandler"
   />
   <farmer-management 
     :visible.sync="farmerManageShow"
@@ -156,6 +157,7 @@ export default {
       headers: {
         Authorization: "Bearer " + getToken()
       },
+      currentData: {},
       visibles: false,
       farmerName: '',
       detailsData: {},
@@ -217,6 +219,9 @@ export default {
     };
   },
   methods: {
+    closeHandler() {
+      this.editFarmerData = {}
+    },
     handleAvatarSuccess(res, file) {
       if (res.code !== '000000') {
         Message.error(res?.msg)
@@ -228,7 +233,11 @@ export default {
     handleUploadError() {
       Message.error("图片插入失败");
     },
-    beforeAvatarUpload(file) {
+    beforeAvatarUpload() {
+      if (this.currentData?.children?.length > 0) { 
+        Message.warning('请选择最小行政区块')
+        return false
+      }
       this.requestData = {
         areaId: this.currentClickId
       }
@@ -275,6 +284,7 @@ export default {
         this.treeData = res?.data
         this.currentClick = res?.data[0]
         this.currentClickId = this.currentClick?.cusareaId
+        this.currentData = this.currentClick
         this.getWaterrighTreetList(this.currentClickId)
       }
       const params = {
@@ -284,7 +294,8 @@ export default {
       const payload = omit(assign({}, parameter, params), []);
       return getFarmerList(payload)
     },
-    setCurrentData(areaId) {
+    setCurrentData(areaId, data) {
+      this.currentData = data
       this.currentClickId = areaId
       this.$refs.tableRef.refresh(false);
     },

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

@@ -172,10 +172,23 @@ 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
+              }
+           }, 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
+              }
+            },  trigger: 'change' }
         ],
         trxrcdPrice: [
           { required: true, validator: (rule, value, callback) => {

+ 3 - 3
vue.config.js

@@ -46,12 +46,12 @@ module.exports = {
         }
       },
       [process.env.VUE_APP_BASE_API]: {
-        target: `http://192.168.1.57:8027`,
+        // target: `http://192.168.1.57:8027`,
         // target: `http://192.168.95:8021`,
-        // target: `http://114.55.0.7:7000/`,
+        target: `http://114.55.0.7:7000/`,
         changeOrigin: true,
         pathRewrite: {
-          ['^' + process.env.VUE_APP_BASE_API]: ''
+          // ['^' + process.env.VUE_APP_BASE_API]: ''
         }
       }
     },