Przeglądaj źródła

fiex:新增模块-审核人

Tang 3 lat temu
rodzic
commit
7959239b9e

+ 3 - 0
src/api/api.js

@@ -89,6 +89,8 @@ import adv from '../newApi/adv'//广告位管理
 import advList from '../newApi/advList'//广告位发布储存管理
 import answer from '../newApi/answer'//答疑管理
 import rolesBusin from '../newApi/rolesBusin'//角色和业务层次关联
+import reviewer from '../newApi/reviewer'//角色和业务层次关联
+
 
 
 
@@ -158,6 +160,7 @@ export default {
     ...advList,
     ...answer,
     ...rolesBusin,
+    ...reviewer,
 
     // ...login,
     // ...profession,

+ 27 - 0
src/newApi/reviewer.js

@@ -0,0 +1,27 @@
+import request from '@/utils/request' //引入axios请求及拦截器
+export default {
+    //更改审核资料模板用户ID
+    editcourseBusinessProfileTpUserIds(data) {
+        return request({
+            url: '/course/business/editProfileTpUserIds',
+            method: 'post',
+            data
+        })
+    },
+    //更改学时审核用户ID
+    editcourseBusinessPeriodUserIds(data) {
+        return request({
+            url: '/course/business/editPeriodUserIds',
+            method: 'post',
+            data
+        })
+    },
+    //业务层次获取用户列表
+    inquiresystemUserbusinessPeopleList(data) {
+        return request({
+            url: '/system/user/businessPeopleList',
+            method: 'get',
+            params: data
+        })
+    },
+}

+ 113 - 58
src/views/systemManagement/auditManagement/assignReviewers/index.vue

@@ -3,14 +3,14 @@
     <div class="floatSty">
       <div class="headsty">资料审核管理</div>
       <div class="dis_sty">
-        <div class="btnSty" @click="getInfo(1)">填写资料审核</div>
-        <div class="btnSty" @click="getInfo(2)">盖章资料审核</div>
+        <div class="btnSty" @click="getInfo(1)">资料审核</div>
+        <!-- <div class="btnSty" @click="getInfo(2)">盖章资料审核</div> -->
       </div>
     </div>
     <div class="floatSty">
       <div class="headsty">班级管理</div>
       <div class="dis_sty">
-        <div class="btnSty" @click="getInfo(3)">学时审核</div>
+        <div class="btnSty" @click="getInfo(2)">学时审核</div>
       </div>
     </div>
     <div style="clear: both"></div>
@@ -59,9 +59,7 @@
                   v-for="(items, indexs) in item.children"
                   :key="indexs"
                   style="margin-bottom: 4px; cursor: pointer"
-                  :style="
-                    activeBusList.businessId === items.id ? 'color:red;' : ''
-                  "
+                  :style="businessId === items.id ? 'color:red;' : ''"
                   @click="getapiUserList(items)"
                 >
                   {{ items.onlyName }}
@@ -72,7 +70,7 @@
               </ul>
             </div>
           </el-col>
-          <el-col :span="12" v-if="activeBusList.businessId">
+          <el-col :span="12" v-if="businessId">
             <el-select
               v-model="activeUserid"
               placeholder="请选择审核人"
@@ -101,34 +99,36 @@
                 <div style="clear: both"></div>
               </li>
             </ul>
-            <el-select
-              v-model="activeUserid"
-              placeholder="请选择复审人"
-              @change="editUserLists"
-            >
-              <el-option
-                v-for="(item, index) in options"
-                :key="index"
-                :label="item.nickName"
-                :value="item.userId"
-                :disabled="userList2.indexOf(item.userId) !== -1"
+            <div v-if="statePop === 2">
+              <el-select
+                v-model="activeUserid"
+                placeholder="请选择复审人"
+                @change="editUserLists"
               >
-              </el-option>
-            </el-select>
-            <ul style="max-height: 300px; overflow: auto">
-              <li
-                v-for="(item, index) in userList2"
-                :key="index"
-                class="userName"
-              >
-                {{ getuserName(item) }}
-                <i
-                  class="el-icon-error clearSty"
-                  @click="userList2.splice(index, 1)"
-                ></i>
-                <div style="clear: both"></div>
-              </li>
-            </ul>
+                <el-option
+                  v-for="(item, index) in options"
+                  :key="index"
+                  :label="item.nickName"
+                  :value="item.userId"
+                  :disabled="userList2.indexOf(item.userId) !== -1"
+                >
+                </el-option>
+              </el-select>
+              <ul style="max-height: 300px; overflow: auto">
+                <li
+                  v-for="(item, index) in userList2"
+                  :key="index"
+                  class="userName"
+                >
+                  {{ getuserName(item) }}
+                  <i
+                    class="el-icon-error clearSty"
+                    @click="userList2.splice(index, 1)"
+                  ></i>
+                  <div style="clear: both"></div>
+                </li>
+              </ul>
+            </div>
             <div style="text-align: center">
               <el-button size="mini" @click="submits">确定</el-button>
             </div>
@@ -152,7 +152,7 @@ export default {
       options: [], //审核人列表
       activeUserid: "", //select的v-model绑定值
       activeFist: "", //当前选中教育类型ID
-      activeBusList: {},
+      businessId: "",
       userList1: [],
       userList2: [],
     };
@@ -161,6 +161,11 @@ export default {
     this.getTypes();
   },
   methods: {
+    /**
+     *
+     * @param {Number} int
+     * @remards 点击教育类型触发
+     */
     getFist(int) {
       if (this.activeFist === int) {
         this.activeFist = "";
@@ -168,31 +173,59 @@ export default {
         this.activeFist = int;
       }
     },
+    /**
+     * 确定提交修改
+     */
     submits() {
       if (!this.userList1.length) {
         this.$message.warning("请选择指派审核人");
         return;
       }
-      if (!this.userList2.length) {
-        this.$message.warning("请选择指派复审人");
-        return;
+
+      if (this.statePop === 2) {
+        if (!this.userList2.length) {
+          this.$message.warning("请选择指派复审人");
+          return;
+        }
       }
       /**
        * 提交api
        */
-      let ays = {
-        ...this.activeBusList,
-        userList1: this.userList1,
-        userList2: this.userList2,
-      };
-
-      console.log(ays, "数据");
-      this.$message.success("指派成功");
+      if (this.statePop === 1) {
+        let ays = {
+          id: this.businessId,
+          profileTpUserIds: this.userList1.toString(),
+          // userList2: this.userList2,
+        };
+        this.$api.editcourseBusinessProfileTpUserIds(ays).then((res) => {
+          this.$message.success("指派成功");
+        });
+      }
+      if (this.statePop === 2) {
+        let ays = {
+          id: this.businessId,
+          periodUserIds: this.userList1.toString(),
+          periodConfirmUserIds: this.userList2.toString(),
+        };
+        this.$api.editcourseBusinessPeriodUserIds(ays).then((res) => {
+          this.$message.success("指派成功");
+        });
+      }
     },
+    /**
+     *
+     * @param {Number} int
+     * @remards 新增审核人
+     */
     editUserList(int) {
       this.userList1.push(int);
       this.activeUserid = "";
     },
+    /**
+     *
+     * @param {Number} int
+     * @remards 新增复审人
+     */
     editUserLists(int) {
       this.userList2.push(int);
       this.activeUserid = "";
@@ -201,16 +234,38 @@ export default {
      * 点击业务层次获取对应审核人
      */
     getapiUserList(item) {
-      this.activeBusList = {
-        educationId: item.educationId,
-        projectId: item.projectId,
-        businessId: item.id,
-      };
+      this.businessId = item.id;
       /**
        * 模拟数据
        */
       this.userList1 = [];
       this.userList2 = [];
+      this.$api
+        .inquiresystemUserbusinessPeopleList({ id: item.id })
+        .then((res) => {
+          this.options = res.rows;
+          this.$api.obtainbusiness(item.id).then((result) => {
+            if (this.statePop === 1) {
+              if (result.data.profileTpUserIds) {
+                this.userList1 = result.data.profileTpUserIds
+                  .split(",")
+                  .map(Number);
+              }
+            }
+            if (this.statePop === 2) {
+              if (result.data.periodUserIds) {
+                this.userList1 = result.data.periodUserIds
+                  .split(",")
+                  .map(Number);
+              }
+              if (result.data.periodConfirmUserIds) {
+                this.userList2 = result.data.periodConfirmUserIds
+                  .split(",")
+                  .map(Number);
+              }
+            }
+          });
+        });
     },
     /**
      * 获取教育类型及业务层次
@@ -234,9 +289,6 @@ export default {
           this.educationType = res.rows;
         });
       });
-      this.$api.obtainUserList({ status: 1 }).then((res) => {
-        this.options = res.rows;
-      });
     },
     /**
      * 获取标题
@@ -245,12 +297,9 @@ export default {
       var ast = "";
       switch (int) {
         case 1:
-          ast = "填写资料审核-指派审核人";
+          ast = "资料审核-指派审核人";
           break;
         case 2:
-          ast = "盖章资料审核-指派审核人";
-          break;
-        case 3:
           ast = "学时审核-指派审核人";
           break;
         default:
@@ -269,10 +318,16 @@ export default {
         }
       }
     },
+    /**
+     *
+     * @param {Number} int 1资料审核2学时审核
+     * 初始化窗口数据
+     */
     getInfo(int) {
       this.statePop = int;
       this.activeFist = "";
       this.activeUserid = "";
+      this.businessId = "";
       this.userList1 = [];
       this.userList2 = [];
       this.dialogVisible = true;