Просмотр исходного кода

项目列表分配项目人员和编辑项目信息分页查询完成

admin 3 лет назад
Родитель
Сommit
a90abc90df

+ 8 - 6
src/api/manager/contractinfo.js

@@ -43,18 +43,20 @@ export const saveUserInfoByProject = (list) => {
     })
 }
 
-export const findAllUserByCondition = (info) => {
+export const findAllUserByCondition = (info, size, current) => {
     return request({
-        url: '/api/blade-manager/contractInfo/findAllUserByCondition',
-        method: 'post',
-        data: info
+        url: `/api/blade-manager/contractInfo/findAllUserByCondition?size=${size}&current=${current}`,
+        method: 'get',
+        params: {
+            ...info,
+        }
     })
 }
 export const findUserListByCondition = (info) => {
     return request({
         url: '/api/blade-manager/contractInfo/findUserListByCondition',
-        method: 'post',
-        data: info
+        method: 'get',
+        params: info
     })
 }
 

+ 1 - 1
src/styles/xiaoyu.scss

@@ -3,7 +3,7 @@
     justify-content: flex-start;
 }
 
-.· {
+.flexEnd {
     display: flex;
     justify-content: flex-end;
 }

+ 64 - 36
src/views/manager/contractinfo/detail.vue

@@ -393,11 +393,12 @@
                 </el-select>
               </div>
             </div>
+            <!-- table表 -->
             <div>
               <el-table
                 :data="contractUserList"
                 border
-                height="500"
+                height="420"
                 style="width: 100%"
               >
                 <el-table-column
@@ -444,9 +445,22 @@
                 style='opacity: 0;position: absolute;height:1px;overflow:hidden;'
               ></el-input>
             </div>
+            <div class="martop10 flexEnd">
+              <el-pagination
+                background
+                @size-change="handleSizeChange"
+                @current-change="handleCurrentChange"
+                :current-page.sync="pageindx"
+                :page-size="pagesize"
+                layout="total, prev, pager, next"
+                :total="total"
+              >
+              </el-pagination>
+            </div>
             <div class="flex jc-al-c mg-t-20">
               <span>添加项目人员</span>
               <el-select
+                class="marleft10"
                 v-model="userId"
                 filterable
                 placeholder="请输入搜索"
@@ -473,34 +487,29 @@
           </div>
         </el-tab-pane>
       </el-tabs>
-
-      <div class="flex jc-sb">
-        <div></div>
-        <div>
-          <el-button
-            type="success"
-            size="medium"
-            :loading="btnLoad"
-            @click="saveQuit"
-          >保存并退出</el-button>
-          <el-button
-            type="info"
-            size="medium"
-            :loading="btnLoad"
-            v-if="activeType != 1"
-            @click="saveNext('p')"
-          >保存并返回上一步</el-button>
-          <el-button
-            type="info"
-            size="medium"
-            :loading="btnLoad"
-            v-if="activeType != 3"
-            @click="saveNext('n')"
-          >保存并进入下一步</el-button>
-        </div>
+      <div class="flexEnd marbottom20">
+        <el-button
+          type="success"
+          size="medium"
+          :loading="btnLoad"
+          @click="saveQuit"
+        >保存并退出</el-button>
+        <el-button
+          type="info"
+          size="medium"
+          :loading="btnLoad"
+          v-if="activeType != 1"
+          @click="saveNext('p')"
+        >保存并返回上一步</el-button>
+        <el-button
+          type="info"
+          size="medium"
+          :loading="btnLoad"
+          v-if="activeType != 3"
+          @click="saveNext('n')"
+        >保存并进入下一步</el-button>
       </div>
     </div>
-
   </basic-container>
 </template>
 
@@ -554,8 +563,12 @@ export default {
       }
       callback();
     };
-
     return {
+      //#region 
+      pageindx: 1,
+      pagesize: 10,
+      total: 0,
+      //#endregion
       activeType: '1',
       typeChang: {
         1: false,
@@ -563,7 +576,6 @@ export default {
         3: false,
       },
       btnLoad: false,
-
       pid: '',
       cid: '',
       projectInfo: {},
@@ -700,6 +712,18 @@ export default {
     })
   },
   methods: {
+    //#region //后加分页
+    handleSizeChange (val) {
+      this.pagesize = val
+      this.findAllUserByCondition()
+    },
+    handleCurrentChange (val) {
+      this.pageindx = val
+      this.findAllUserByCondition()
+    },
+    //#endregion
+
+    //#region 甘云杰
     async searchRole () {
       const { data: res } = await searchRole()
       console.log(res);
@@ -935,14 +959,17 @@ export default {
     },
 
     findAllUserByCondition () {
-
       findAllUserByCondition({
-        "cId": this.contractForm.id,
-        "pId": this.pid,
+        cId: this.contractForm.id,
+        pId: this.pid,
         // "postId": this.postId,
-        "rId": this.postId
-      }).then((res) => {
-        this.contractUserList = res.data.data;
+        rId: this.postId,
+      },
+        this.pagesize,
+        this.pageindx,
+      ).then((res) => {
+        this.contractUserList = res.data.data.records;
+        this.total = res.data.data.total
       })
     },
 
@@ -1103,7 +1130,8 @@ export default {
         });
         this.securityLevelList = res.data.data;
       })
-    }
+    },
+    //#endregion
 
   }
 };

+ 55 - 25
src/views/manager/projectinfo/detail.vue

@@ -239,6 +239,7 @@
             <div class="flex jc-al-c mg-b-10">
               <span>维护人员角色</span>
               <avue-input-tree
+                class="marleft10"
                 :check-strictly="true"
                 v-model="rId"
                 placeholder="请选择"
@@ -255,7 +256,7 @@
               <el-table
                 :data="contractUserList"
                 border
-                height="500"
+                max-height="440"
                 style="width: 100%"
               >
                 <el-table-column
@@ -287,9 +288,22 @@
                 </el-table-column>
               </el-table>
             </div>
+            <div class="martop10 flexEnd">
+              <el-pagination
+                background
+                @size-change="handleSizeChange"
+                @current-change="handleCurrentChange"
+                :current-page.sync="pageindx"
+                :page-size="pagesize"
+                layout="total, prev, pager, next"
+                :total="total"
+              >
+              </el-pagination>
+            </div>
             <div class="flex jc-al-c mg-t-20">
               <span>添加系统内部人员</span>
               <el-select
+                class="marleft10"
                 v-model="userId"
                 filterable
                 placeholder="请输入搜索"
@@ -303,6 +317,7 @@
               </el-select>
               <el-button
                 type="success"
+                class="marleft10"
                 @click="addUserToProject"
               >添加</el-button>
               <el-button type="primary">创建新用户</el-button>
@@ -316,30 +331,27 @@
         </el-tab-pane>
       </el-tabs>
 
-      <div class="flex jc-sb">
-        <div></div>
-        <div>
-          <el-button
-            type="success"
-            size="medium"
-            :loading="btnLoad"
-            @click="saveQuit"
-          >保存并退出</el-button>
-          <el-button
-            type="info"
-            size="medium"
-            :loading="btnLoad"
-            v-if="activeType != 1"
-            @click="saveNext('p')"
-          >保存并返回上一步</el-button>
-          <el-button
-            type="info"
-            size="medium"
-            :loading="btnLoad"
-            v-if="activeType != 3"
-            @click="saveNext('n')"
-          >保存并进入下一步</el-button>
-        </div>
+      <div class="flexEnd">
+        <el-button
+          type="success"
+          size="medium"
+          :loading="btnLoad"
+          @click="saveQuit"
+        >保存并退出</el-button>
+        <el-button
+          type="info"
+          size="medium"
+          :loading="btnLoad"
+          v-if="activeType != 1"
+          @click="saveNext('p')"
+        >保存并返回上一步</el-button>
+        <el-button
+          type="info"
+          size="medium"
+          :loading="btnLoad"
+          v-if="activeType != 3"
+          @click="saveNext('n')"
+        >保存并进入下一步</el-button>
       </div>
     </div>
   </basic-container>
@@ -411,6 +423,11 @@ export default {
     };
 
     return {
+      //#region 
+      pageindx: 1,
+      pagesize: 10,
+      total: 0,
+      //#endregion
       activeType: '1',
       typeChang: {
         1: false,
@@ -503,6 +520,16 @@ export default {
     })
   },
   methods: {
+    //#region //后加分页
+    handleSizeChange (val) {
+      this.pagesize = val
+      this.getUserByCondition();
+    },
+    handleCurrentChange (val) {
+      this.pageindx = val
+      this.getUserByCondition();
+    },
+    //#endregion
     init () {
       this.getHighwayGradeList();
       this.id = this.$route.query.id;
@@ -694,8 +721,11 @@ export default {
         pId: this.projectForm.id,
         postId: '',
         rId: this.rId,
+        size: this.pagesize,
+        current: this.pageindx
       }).then((res) => {
         this.contractUserList = res.data.data.records;
+        this.total = res.data.data.total
       })
     },
 

+ 10 - 8
src/views/system/user.vue

@@ -1001,28 +1001,30 @@ export default {
       }
     },
     addfangfa () {//添加时确定添加按钮方法处理
-      // this.fromss.projectAndUserList
-      const tag = true
+      let tag = true
       if (!this.fromss.projectId) {
         this.$message({
           type: "error",
           message: "请选择参与项目!"
         })
-        return tag = false
+        tag = false
+        return
       }
       if (!this.fromss.contractId) {
         this.$message({
           type: "error",
           message: "请选择合同段!"
         })
-        return tag = false
+        tag = false
+        return
       }
       if (!this.fromss.roleIds) {
         this.$message({
           type: "error",
           message: "请选择用户类型!"
         })
-        return tag = false
+        tag = false
+        return
       }
       let tas = {
         projectName: '',
@@ -1071,7 +1073,7 @@ export default {
         this.removeUsersByIds(this.fromss.projectAndUserList[key].id)
       }
     },
-    beforeClose (done, type) {//弹框关闭事件
+    beforeClose (done) {//弹框关闭事件
       this.fromss = {
         userId: '',//
         projectAndUserList: [],
@@ -1177,7 +1179,7 @@ export default {
           message: "操作成功!"
         });
         done();
-      }, error => {
+      }, () => {
         loading();
       });
     },
@@ -1193,7 +1195,7 @@ export default {
           message: "操作成功!"
         });
         done();
-      }, error => {
+      }, () => {
         loading();
       });
     },