فهرست منبع

feat: 接口的对接

allen 2 سال پیش
والد
کامیت
208c97f0c5
3فایلهای تغییر یافته به همراه87 افزوده شده و 60 حذف شده
  1. 3 3
      .env.production
  2. 28 24
      src/views/infrastructure/components/recompose.vue
  3. 56 33
      src/views/infrastructure/waterEstablishment.vue

+ 3 - 3
.env.production

@@ -17,10 +17,10 @@ VUE_APP_SSO_ENABLED = FALSE
 
 VUE_APP_SYS_APP_MENUCFGID = 80e51453-7062-31ae-b673-00f24b0d7bed
 
-VUE_APP_SYS_BASE_URL= /water
+VUE_APP_SYS_BASE_URL= /wpr
 
-VUE_APP_ROUTER_BASE_URL= water
+VUE_APP_ROUTER_BASE_URL= wpr
 
-VUE_APP_PUBLIC_PATH= /water/
+VUE_APP_PUBLIC_PATH= /wpr/
 
 VUE_APP_THIRD_BASE_URL=

+ 28 - 24
src/views/infrastructure/components/recompose.vue

@@ -5,7 +5,7 @@
     :close-on-click-modal="false"
     :close-on-press-escape="false"
     @close="handleClose"
-    width="950px"
+    width="700px"
   >
     <el-form
       ref="baseForm"
@@ -17,24 +17,23 @@
       size="small"
     >
       <el-row>
-        <el-form-item label="电表品牌型号:" prop="productName">
-          <el-select
+        <el-form-item label="年度:">
+          <el-input
             placeholder="请输入"
             disabled
             style="width:250px;"
-            v-model="textarea">
-          </el-select>
+            v-model="editRow.waterrightYear"
+          />
         </el-form-item>
       </el-row>
       <el-row>
-        <el-form-item label="区域:" prop="productName">
-          <el-select
+        <el-form-item label="区域:">
+          <el-input
             placeholder="请输入"
             disabled
             style="width:250px;"
-            v-model="textarea">
-          </el-select>
-          
+            v-model="editRow.cusareaName">
+          </el-input>
         </el-form-item>
       </el-row>
       <el-row>
@@ -98,6 +97,8 @@
 
 <script>
 import { assign } from 'lodash-es';
+import { getWaterrightUpareaInfo } from '@/api/waterright/index.js'
+
 export default {
   name: 'recompose',
   props: {
@@ -109,22 +110,17 @@ export default {
     visible: {
       type: Boolean,
       default: false
+    },
+    editRow: {
+      type: Object,
+      default:() => {}
     }
   },
   data() {
     return {
       dialogSubmitLoading: false,
       dialogVisible: false,
-      baseForm: {
-        productValue: '',
-        productName: '',
-        stockAmount: '',
-        goodsUnit: '',
-        goodsSpecValue: '',
-        imageArr1: [],
-        supplierId: '',
-        imageArr2: []
-      },
+      baseForm: { },
       hasFetched: false,
       rules: {
         stockAmount: [
@@ -157,14 +153,21 @@ export default {
         }
       }
     },
-    data: {
-      deep: true,
+    editRow:{
       handler(val) {
-        assign(this.baseForm, val);
-      }
+        this.visible && this.getWaterrightUpareaList(val)
+      },
+      deep: true
     }
   },
   methods: {
+    async getWaterrightUpareaList(row) {
+      const { waterrightId } = row
+      console.log(waterrightId,'waterrightIdwaterrightId')
+      await getWaterrightUpareaInfo({
+        waterrightId
+      })
+    },
     resetForm(formName) {
       this.dialogVisible = false;
     },
@@ -176,6 +179,7 @@ export default {
 
     handleClose() {
       this.$emit('update:visible', false);
+      this.$emit('resetEdit');
       this.resetForm('baseForm');
     },
   }

+ 56 - 33
src/views/infrastructure/waterEstablishment.vue

@@ -30,7 +30,7 @@
               style="margin-left: 16px;"
               type="primary"
               size="small"
-              @click="handleSearch"
+              @click="getWaterrightList"
               >查询</el-button
             >
           </div>
@@ -45,7 +45,7 @@
         </el-col>
         <el-col :span="24" class="elrow-main__col-bottom">
           <!--  -->
-          <b-table
+          <!-- <b-table
             ref="tableRef"
             :args="{ 'highlight-current-row': true }"
             :data="tableData"
@@ -60,19 +60,51 @@
                 >修改</el-link
               >
             </template>
-          </b-table>
+          </b-table> -->
+          <el-table
+          ref="tableRef"
+          :args="{ 'highlight-current-row': true }"
+          :data="tableData"
+          row-key="id"
+          :columns="columns"
+          isShowIndex
+          :tree-props="{children: 'children',hasChildren: 'hasChildren'}"
+          :header-row-style="{ background: '#E5EEED' }"
+          :header-cell-style="{ background: '#E5EEED' }"
+        >
+          <el-table-column
+            v-for="item in columns"
+            :key="item.id"
+            :prop="item.prop"
+            :label="item.label"
+          >
+          </el-table-column>
+          <el-table-column label="操作">
+            <template slot-scope="scope">
+              <el-link
+                size="small"
+                :underline="false"
+                type="primary"
+                style="margin-right: 10px"
+                @click="handlerRecompose(scope.row)"
+                >修改</el-link
+              >
+            </template>
+            
+        </el-table-column>
+        </el-table>
         </el-col>
       </el-card>
     </el-col>
     <set-annual-water-right :visible.sync="associationManageShow"/>
-    <recompose :visible.sync="recomposeShow"/>
-    <water-price-setting :visible.sync="waterprice" @refresh="handleSearch"/>
+    <recompose :visible.sync="recomposeShow" :editRow="editRow" @resetEdit="resetEdit"/>
+    <water-price-setting :visible.sync="waterprice" @refresh="getWaterrightList"/>
   </el-row>
 </template>
 
 <script>
 import { getTree } from '@/api/tree.js'
-import { getWaterrightList,addWaterright,editWaterright,getWaterrightUpareaInfo } from '@/api/waterright/index.js'
+import { getWaterrightList,editWaterright,getWaterrightUpareaInfo } from '@/api/waterright/index.js'
 import SelectTree from '@/components/SelectTree';
 import BTable from '@/components/Table/index.vue';
 import setAnnualWaterRight from './components/setAnnualWaterRight.vue'
@@ -90,10 +122,6 @@ export default {
       },
       options:[
         {
-          value: '',
-          label: '全部'
-        },
-        {
           value: '2023',
           label: '2023'
         }, {
@@ -116,19 +144,14 @@ export default {
       associationManageShow: false,
       waterprice: false,
       cusareaName:'',
-      waterrightYear: '',
+      waterrightYear: '2023',
       areaId:'',
+      editRow: {},
       columns: [
         {
-          label: '年度',
-          prop: 'waterrightYear',
-          customRender: '',
-          align: 'center'
-        },
-        {
           label: '行政区',
           prop: 'cusareaName',
-          customRender: '',
+          customRender: 'cusareaName',
           align: 'center'
         },
         {
@@ -147,31 +170,33 @@ export default {
           prop: 'phone',
           customRender: 'Permuarea',
           align: 'center'
-        },{
-          label: '操作',
-          customRender: 'operate',
-          width: 200,
-          align: 'center'
         }
       ],
+      tableData: []
     };
   },
- 
+  mounted() {
+    this.getWaterrightList()
+  },
   methods: {
-    async tableData() {
+    resetEdit() {
+      this.editRow = {}
+    },
+    async getWaterrightList() {
       if(!this.areaId) {
         const res = await getTree()
         this.treeData = res?.data
         this.cusareaName ||= this.treeData[0].cusareaName
         this.areaId = this.treeData[0].cusareaId
       }
-      return this.getWaterrightListHandler()
+      this.getWaterrightListHandler()
     },
-    getWaterrightListHandler() {
-      return getWaterrightList({
+    async getWaterrightListHandler() {
+      const res = await getWaterrightList({
         areaId: this.areaId,
         waterrightYear: this.waterrightYear
       })
+      this.tableData = res?.data
     },
     handlerClick(value) {
       this.areaId = value?.cusareaId
@@ -187,11 +212,9 @@ export default {
     getTableData(payload) {
       return {}
     },
-    handleSearch() {
-      this.$refs.tableRef.refresh(true);
-      
-    },
-    handlerRecompose() {
+    handlerRecompose(row) {
+      console.log(row,'rowrworowo')
+      this.editRow = row
       this.recomposeShow = true
     }
   }