Browse Source

完成首页接口

hzj18279462576@163.com 1 year ago
parent
commit
d691363f14
3 changed files with 397 additions and 734 deletions
  1. 321 710
      src/views/homePage/homePage.vue
  2. 69 22
      src/views/project/project.vue
  3. 7 2
      src/views/system/system.vue

File diff suppressed because it is too large
+ 321 - 710
src/views/homePage/homePage.vue


+ 69 - 22
src/views/project/project.vue

@@ -32,6 +32,7 @@
             :props="searchOrganizeProp"
             :props="searchOrganizeProp"
             @change="getUser1"
             @change="getUser1"
             clearable
             clearable
+            v-model="organize"
           >
           >
             <template #default="{ node, data }">
             <template #default="{ node, data }">
               <span>{{ data.userName }}</span>
               <span>{{ data.userName }}</span>
@@ -46,6 +47,7 @@
             :props="searchOrganizeProp"
             :props="searchOrganizeProp"
             @change="getUser2"
             @change="getUser2"
             clearable
             clearable
+            v-model="coOrganize"
           >
           >
             <template #default="{ node, data }">
             <template #default="{ node, data }">
               <span>{{ data.userName }}</span>
               <span>{{ data.userName }}</span>
@@ -293,14 +295,14 @@
             class="search"
             class="search"
             @click="addProjectbtn"
             @click="addProjectbtn"
             v-if="
             v-if="
-              (activeName == 5 || activeName == 6) &&
+              (activeName == 5) &&
               btnFlag('project-chuangjianxiangmu')
               btnFlag('project-chuangjianxiangmu')
             "
             "
             >创建项目</el-button
             >创建项目</el-button
           >
           >
           <el-button
           <el-button
             v-if="
             v-if="
-              (activeName == 5 || activeName == 6) &&
+              (activeName == 3 || activeName == 5 || activeName == 6) &&
               btnFlag('project-yijiancuiban')
               btnFlag('project-yijiancuiban')
             "
             "
             type="primary"
             type="primary"
@@ -378,7 +380,7 @@
               >
               >
               <el-dropdown
               <el-dropdown
                 placement="bottom-start"
                 placement="bottom-start"
-                v-if="activeName == 5 || activeName == 6"
+                v-if="activeName == 3 || activeName == 5 || activeName == 6"
               >
               >
                 <el-button
                 <el-button
                   @click.stop=""
                   @click.stop=""
@@ -391,20 +393,19 @@
                     <!-- <el-dropdown-item>复制</el-dropdown-item> -->
                     <!-- <el-dropdown-item>复制</el-dropdown-item> -->
                     <el-dropdown-item
                     <el-dropdown-item
                       @click.stop="editProject(i)"
                       @click.stop="editProject(i)"
-                      v-if="activeName == 5 && btnFlag('project-xiugaixiangmu')"
+                      v-if="(activeName == 3 || activeName == 5) && btnFlag('project-xiugaixiangmu')"
                       >编辑</el-dropdown-item
                       >编辑</el-dropdown-item
                     >
                     >
                     <el-dropdown-item
                     <el-dropdown-item
                       @click.stop="delProject(i)"
                       @click.stop="delProject(i)"
                       v-if="
                       v-if="
-                        activeName == 5 && btnFlag('project-shanchuxiangmu')
+                        (activeName == 3 || activeName == 5) && btnFlag('project-shanchuxiangmu')
                       "
                       "
                       >删除</el-dropdown-item
                       >删除</el-dropdown-item
                     >
                     >
                     <el-dropdown-item
                     <el-dropdown-item
                       v-if="
                       v-if="
-                        activeName == 6 &&
-                        isScorer(i) &&
+                        ((activeName == 3 && i.scorerFlag==1) ||(activeName == 6 && i.scorerFlag==1)) &&
                         btnFlag('project-pingfen')
                         btnFlag('project-pingfen')
                       "
                       "
                       @click.stop="scoreProject(i)"
                       @click.stop="scoreProject(i)"
@@ -445,7 +446,7 @@
               />
               />
               <img
               <img
                 v-if="
                 v-if="
-                  (activeName == 5 || activeName == 6) &&
+                  (activeName == 3 || activeName == 5 || activeName == 6) &&
                   btnFlag('project-cuiban')
                   btnFlag('project-cuiban')
                 "
                 "
                 title="催办"
                 title="催办"
@@ -902,7 +903,7 @@
               label="评价标准"
               label="评价标准"
               width="170"
               width="170"
             />
             />
-            <el-table-column align="center" prop="weight" label="权重" />
+            <el-table-column align="center" prop="weight" label="权重(%)" />
             <el-table-column
             <el-table-column
               align="center"
               align="center"
               prop="headerName"
               prop="headerName"
@@ -915,18 +916,18 @@
               label="评分上限"
               label="评分上限"
             />
             />
             <el-table-column align="center" prop="sysScore" label="系统" />
             <el-table-column align="center" prop="sysScore" label="系统" />
-            <el-table-column align="center" label="操作" width="220">
+            <el-table-column align="center" label="操作" width="240">
               <template #default="scope">
               <template #default="scope">
                 <div class="options">
                 <div class="options">
                   <div
                   <div
                     class="edit"
                     class="edit"
-                    v-if="activeName == 5 && btnFlag('project-xiugairenwu')"
+                    v-if="(activeName == 3 || activeName == 5) && btnFlag('project-xiugairenwu')"
                     @click="editTask(scope.row)"
                     @click="editTask(scope.row)"
                   >
                   >
                     编辑
                     编辑
                   </div>
                   </div>
                   <el-popconfirm
                   <el-popconfirm
-                    v-if="activeName == 5 && btnFlag('project-shanchurenwu')"
+                    v-if="(activeName == 3 || activeName == 5) && btnFlag('project-shanchurenwu')"
                     width="200"
                     width="200"
                     confirm-button-text="确认"
                     confirm-button-text="确认"
                     cancel-button-text="取消"
                     cancel-button-text="取消"
@@ -950,12 +951,12 @@
                     @confirm="urgeTask(scope.row)"
                     @confirm="urgeTask(scope.row)"
                     @cancel="cancelEvent"
                     @cancel="cancelEvent"
                     v-if="
                     v-if="
-                      (activeName == 5 || activeName == 6) &&
+                      (activeName == 3 || activeName == 5 || activeName == 6) &&
                       btnFlag('project-cuibanrenwu')
                       btnFlag('project-cuibanrenwu')
                     "
                     "
                   >
                   >
                     <template #reference>
                     <template #reference>
-                      <div class="look">催办</div>
+                      <div class="del">催办</div>
                     </template>
                     </template>
                   </el-popconfirm>
                   </el-popconfirm>
                   <div
                   <div
@@ -976,12 +977,13 @@
           <el-button
           <el-button
             type="primary"
             type="primary"
             class="search"
             class="search"
+            style="margin-right:20px"
             @click="addTaskbtn"
             @click="addTaskbtn"
-            v-if="activeName == 5"
+            v-if="activeName == 3 || activeName == 5"
             >添加任务</el-button
             >添加任务</el-button
           >
           >
           <el-button
           <el-button
-            v-if="activeName == 6 && isScorer()"
+            v-if="(activeName == 3 && cardInfo.scorerFlag==1) || (activeName == 6 && cardInfo.scorerFlag==1)"
             type="primary"
             type="primary"
             class="search"
             class="search"
             @click="scoreProjects"
             @click="scoreProjects"
@@ -1101,6 +1103,7 @@
         <el-form-item label="权重(%)" prop="weight">
         <el-form-item label="权重(%)" prop="weight">
           <el-input v-model="taskRuleForm.weight" placeholder="请输入权重" />
           <el-input v-model="taskRuleForm.weight" placeholder="请输入权重" />
         </el-form-item>
         </el-form-item>
+        <div style="color: brown;font-size: 12px;margin-left: 100px;transform: translateY(-13px);">注:权重请输入0-100范围</div>
         <el-form-item label="提醒时间" prop="remindTime">
         <el-form-item label="提醒时间" prop="remindTime">
           <el-date-picker
           <el-date-picker
             v-model="taskRuleForm.remindTime"
             v-model="taskRuleForm.remindTime"
@@ -1331,9 +1334,11 @@ const searchInput = reactive({
   finishTime: null, // 完成时间
   finishTime: null, // 完成时间
   scoreState: null, // 是否已评分:1已评分,0未评分,null全部
   scoreState: null, // 是否已评分:1已评分,0未评分,null全部
   collect: null, //    是否已关注,1收藏,0未收藏,null全部
   collect: null, //    是否已关注,1收藏,0未收藏,null全部
-  hasTask: null, //       是否有任务:1有任务,0没有任务,null全部
+  hasTask: null, //    是否有任务:1有任务,0没有任务,null全部
   isScore: null, //    是否我评分,1是我,0不是我,null全部
   isScore: null, //    是否我评分,1是我,0不是我,null全部
 }); // 搜索按钮数据
 }); // 搜索按钮数据
+const organize=ref()// 主办单位绑定的值
+const coOrganize=ref()// 协办单位绑定的值
 const searchOrganizeProp = {
 const searchOrganizeProp = {
   children: "userList",
   children: "userList",
   label: "userName",
   label: "userName",
@@ -1513,6 +1518,7 @@ const cardInfo = reactive({
   leaderName: "", // 分管领导
   leaderName: "", // 分管领导
   scorerName: "", // 评分人
   scorerName: "", // 评分人
   scorer: "", // 评分人对应id
   scorer: "", // 评分人对应id
+  scorerFlag:'',// 分管领导是否有资格评分
 });
 });
 
 
 // 更新进度 (00000000000000000000000000000000000000000000000000000)
 // 更新进度 (00000000000000000000000000000000000000000000000000000)
@@ -1542,10 +1548,15 @@ const handleClick = (val) => {
   searchInput.projectFrom= null // 项目来源
   searchInput.projectFrom= null // 项目来源
   searchInput.projectLevel= null // 项目等级
   searchInput.projectLevel= null // 项目等级
   searchInput.state= null //
   searchInput.state= null //
+
   searchInput.organize= null // 主办单位
   searchInput.organize= null // 主办单位
+  organize.value=null
   searchInput.sposonerName= null // 主办人
   searchInput.sposonerName= null // 主办人
+
   searchInput.coOrganize= null // 协办单位
   searchInput.coOrganize= null // 协办单位
+  coOrganize.value=null
   searchInput.coSposonerName= null // 协办人
   searchInput.coSposonerName= null // 协办人
+
   searchInput.createTime= null // 创建时间
   searchInput.createTime= null // 创建时间
   searchInput.periodTime= null // 周期时间
   searchInput.periodTime= null // 周期时间
   searchInput.finishTime= null // 完成时间
   searchInput.finishTime= null // 完成时间
@@ -1619,6 +1630,23 @@ const getList = async () => {
   });
   });
   console.log(res, "项目分页数据");
   console.log(res, "项目分页数据");
   if (res.data.code == 200) {
   if (res.data.code == 200) {
+    let userId = sessionStorage.getItem("id");
+    if(activeName.value==3){
+      res.data.data.project.rows.forEach(item=>{
+        item.scorerFlag=1
+      })
+    }else if(activeName.value==6){
+      res.data.data.project.rows.forEach(item=>{
+        let flag = item.scorer.split(",").some((i) => {
+          return userId == i;
+        });
+        if(flag){
+          item.scorerFlag=1
+        }else{
+          item.scorerFlag=0
+        }
+      })
+    }
     tableData.list = res.data.data.project.rows;
     tableData.list = res.data.data.project.rows;
     cardInfo.progress = res.data.data.config[2].configValue * 100;
     cardInfo.progress = res.data.data.config[2].configValue * 100;
     total.value = res.data.data.project.total;
     total.value = res.data.data.project.total;
@@ -1885,6 +1913,7 @@ const projectCard = async (row) => {
   cardInfo.endTime = row.endTime;
   cardInfo.endTime = row.endTime;
   cardInfo.leaderName = row.leaderName;
   cardInfo.leaderName = row.leaderName;
   cardInfo.scorer = row.scorer;
   cardInfo.scorer = row.scorer;
+  cardInfo.scorerFlag = row.scorerFlag;
   cardInfo.scorerName = row.scorerName;
   cardInfo.scorerName = row.scorerName;
   taskRuleForm.projectId = row.id;
   taskRuleForm.projectId = row.id;
   console.log(row.coSposonerName, row.coSposoner);
   console.log(row.coSposonerName, row.coSposoner);
@@ -2049,6 +2078,23 @@ const projectScroll = async (event) => {
         });
         });
         console.log(res, "项目分页数据");
         console.log(res, "项目分页数据");
         if (res.data.code == 200) {
         if (res.data.code == 200) {
+          let userId = sessionStorage.getItem("id");
+          if(activeName.value==3){
+            res.data.data.project.rows.forEach(item=>{
+              i.scorerFlag=1
+            })
+          }else if(activeName.value==6){
+            res.data.data.project.rows.forEach(item=>{
+              let flag = item.scorer.split(",").some((i) => {
+                return userId == i;
+              });
+              if(flag){
+                item.scorerFlag=1
+              }else{
+                item.scorerFlag=0
+              }
+            })
+          }
           tableData.list = [...tableData.list, ...res.data.data.project.rows];
           tableData.list = [...tableData.list, ...res.data.data.project.rows];
           // total.value = res.data.data.project.total;
           // total.value = res.data.data.project.total;
           // totalPage.value = res.data.data.project.totalPage;
           // totalPage.value = res.data.data.project.totalPage;
@@ -2836,7 +2882,7 @@ const scoreProjects=()=>{
 }
 }
 // 判断当前分管领导是否在评分人中
 // 判断当前分管领导是否在评分人中
 const isScorer = (row) => {
 const isScorer = (row) => {
-  // console.log(row);
+  console.log(row.scorer);
   if (row) {
   if (row) {
     let userId = sessionStorage.getItem("id");
     let userId = sessionStorage.getItem("id");
     let flag = row.scorer.split(",").some((i) => {
     let flag = row.scorer.split(",").some((i) => {
@@ -3069,7 +3115,7 @@ const handleCurrentChange = (value) => {
 onBeforeMount(() => {
 onBeforeMount(() => {
   api.value = store.state.user.api;
   api.value = store.state.user.api;
   userId.value = sessionStorage.getItem("id");
   userId.value = sessionStorage.getItem("id");
-  projectScroll();
+  // projectScroll();
   departmentList();
   departmentList();
   // userList();
   // userList();
   users();
   users();
@@ -3500,6 +3546,7 @@ onMounted(() => {
 
 
       .el-table--fit {
       .el-table--fit {
         // height: 400px;
         // height: 400px;
+        margin-bottom: 25px;
         .el-table__header-wrapper {
         .el-table__header-wrapper {
           background-color: #000;
           background-color: #000;
           font-size: 14px;
           font-size: 14px;
@@ -3535,11 +3582,11 @@ onMounted(() => {
 
 
         .options {
         .options {
           display: flex;
           display: flex;
-          justify-content: center;
+          justify-content: space-around;
           align-items: center;
           align-items: center;
 
 
           .edit {
           .edit {
-            margin-right: 15px;
+            // margin-right: 15px;
             color: rgba(30, 125, 251, 1);
             color: rgba(30, 125, 251, 1);
             cursor: pointer;
             cursor: pointer;
           }
           }
@@ -3550,7 +3597,7 @@ onMounted(() => {
           }
           }
 
 
           .del {
           .del {
-            margin-right: 15px;
+            // margin-right: 15px;
             color: rgba(212, 48, 48, 1);
             color: rgba(212, 48, 48, 1);
             cursor: pointer;
             cursor: pointer;
           }
           }

+ 7 - 2
src/views/system/system.vue

@@ -42,7 +42,11 @@
         >
         >
           <!-- <el-table-column type="selection" width="55" /> -->
           <!-- <el-table-column type="selection" width="55" /> -->
           <el-table-column align="center" prop="configKey" label="维度名称" />
           <el-table-column align="center" prop="configKey" label="维度名称" />
-          <el-table-column align="center" prop="configValue" label="维度权重" />
+          <el-table-column align="center" prop="configValue" label="维度权重(%)">
+            <template #default="scope">
+              {{ scope.row.configValue }}
+            </template>
+          </el-table-column>
           <!-- <el-table-column align="center" prop="createBy" label="创建人" /> -->
           <!-- <el-table-column align="center" prop="createBy" label="创建人" /> -->
           <el-table-column align="center" label="操作" width="220">
           <el-table-column align="center" label="操作" width="220">
             <template #default="scope">
             <template #default="scope">
@@ -111,7 +115,7 @@
             <!-- <span class="resetPassword"
             <!-- <span class="resetPassword"
               >注:建设单位时用户名可填写单位名称</span
               >注:建设单位时用户名可填写单位名称</span
             > -->
             > -->
-            <el-form-item label="权重" prop="configValue">
+            <el-form-item label="权重(%)" prop="configValue">
               <el-input
               <el-input
                 v-model="accountRuleForm.configValue"
                 v-model="accountRuleForm.configValue"
                 placeholder="请输入权重"
                 placeholder="请输入权重"
@@ -119,6 +123,7 @@
                 style="width: 220px"
                 style="width: 220px"
               />
               />
             </el-form-item>
             </el-form-item>
+            <div style="color: brown;font-size: 12px;margin-left: 120px;transform: translateY(-8px);">注:权重请输入0-100范围</div>
             <el-form-item label="是否属于进度" prop="isSpeed">
             <el-form-item label="是否属于进度" prop="isSpeed">
               <el-radio-group disabled v-model="accountRuleForm.isSpeed">
               <el-radio-group disabled v-model="accountRuleForm.isSpeed">
                 <el-radio :value="0" size="large">质量</el-radio>
                 <el-radio :value="0" size="large">质量</el-radio>