소스 검색

案情详细添加上一个和下一个功能,修改到导航栏样式

SanHQin 1 년 전
부모
커밋
df69ca4e7c
2개의 변경된 파일164개의 추가작업 그리고 23개의 파일을 삭제
  1. 5 0
      src/components/pages/disAdmin/score.vue
  2. 159 23
      src/components/pages/race/eventCenter/anliDetail.vue

+ 5 - 0
src/components/pages/disAdmin/score.vue

@@ -509,6 +509,7 @@ export default {
     search() {
       this.page = 1;
       this.getAnliList(this.reCid);
+
     },
     goTo(path) {
       this.$router.push(path);
@@ -613,6 +614,7 @@ export default {
       this.ajax
         .get(this.$store.state.api + "selectPointAll", params)
         .then((res) => {
+
           this.total = res.data[0].length > 0 ? res.data[0].length : 0;
           var scoreList = res.data[0];
           for (var i = 0; i < scoreList.length; i++) {
@@ -627,6 +629,8 @@ export default {
             }
           }
           scoreList.sort((item1, item2) => item2.sum - item1.sum);
+					
+					sessionStorage.setItem("allScoreList",JSON.stringify(scoreList.map(i=>i.id)))
           const start = (this.page - 1) * 10;
           const end = start + 10;
           let pageData = scoreList.slice(start, end);
@@ -677,6 +681,7 @@ export default {
             p[j].sum = isScore == 0 ? 0 : (sum / isScore).toFixed(2);
           }
           this.tableData = p;
+					console.log(this.tableData);
           this.$forceUpdate();
         })
         .catch((err) => {

+ 159 - 23
src/components/pages/race/eventCenter/anliDetail.vue

@@ -85,7 +85,26 @@
             <div v-if="anliBox[0].info && anliBox[0].info.typeOtherName != ''">
               课时:{{ anliBox[0].info.typeOtherName }}小时
             </div>
-          </div>
+          </div>.
+					<el-button
+					@click="upperOne()"
+					style="
+							margin:5px 10px;
+              background: rgb(34, 90, 199);
+              color: #fff;
+							position: absolute;
+              right: 300px;
+            ">上一个</el-button>
+
+						<el-button
+						@click="nextOne()"
+						style="
+							margin:5px 10px;
+              background: rgb(34, 90, 199);
+              color: #fff;
+							position: absolute;
+              right: 200px;
+            ">下一个</el-button>
           <el-button
             @click="
               goTo(
@@ -113,21 +132,61 @@
         </div>
       </div>
       <div class="navBox" :class="{ isNavBox: isNavTop >= 300 }" :style="{ margin: psDialog ? '0 50px' : '0 auto'}">
-        <div class="navTop" @click="isShow = 0">
-          <div class="navImg" style="width: 24px">
-            <img src="../../../../assets/icon/anliDetail/proOver.png" alt="" />
-          </div>
-          <div>项目基础信息</div>
-        </div>
-        <div class="navTop" @click="isShow = 1">
-          <div class="navImg">
-            <img
-              src="../../../../assets/icon/anliDetail/proOverTwo.png"
-              alt=""
-            />
-          </div>
-          <div>平台案例填写</div>
-        </div>
+				<div class=navBoxHeader :style="{justifyContent: psDialog ? 'flex-start' : 'center'}">
+					<div class="navTop" @click="isShow = 0">
+        	  <div class="navImg" style="width: 24px">
+        	    <img src="../../../../assets/icon/anliDetail/proOver.png" alt="" />
+        	  </div>
+        	  <div>项目基础信息</div>
+        	</div>
+        	<div class="navTop" @click="isShow = 1">
+        	  <div class="navImg">
+        	    <img
+        	      src="../../../../assets/icon/anliDetail/proOverTwo.png"
+        	      alt=""
+        	    />
+        	  </div>
+        	  <div>平台案例填写</div>
+        	</div>
+				</div>
+				<div class=navBoxBtn v-if="psDialog && isNavTop >= 300">
+
+					<el-button
+					@click="upperOne()"
+					style="
+							margin:5px 10px;
+              background: rgb(34, 90, 199);
+              color: #fff;
+            ">上一个</el-button>
+
+						<el-button
+						@click="nextOne()"
+						style="
+							margin:5px 10px;
+              background: rgb(34, 90, 199);
+              color: #fff;
+            ">下一个</el-button>
+
+					<el-button
+            @click="
+              goTo(
+                '/score1?userid=' +
+                  userid +
+                  '&oid=' +
+                  oid +
+                  '&org=' +
+                  org +
+                  '&type=' +
+                  tType
+              )
+            "
+            style="
+							margin:5px 30px;
+              background: rgb(34, 90, 199);
+              color: #fff;
+            ">返回</el-button>
+						
+				</div>
       </div>
 
       <div
@@ -2813,11 +2872,70 @@ export default {
           console.error(err);
         });
     },
+		async nextOne(){
+			if(this.tType == 1 || await this.addScore()){
+				const allScoreList = JSON.parse(sessionStorage.getItem("allScoreList"))
+				if(!allScoreList.length>0)return this.$message.info("没有了")
+				let nowIndex = allScoreList.findIndex(i=>i===this.aid);
+				if(nowIndex===-1)return this.$message.info("没有了")
+				if(nowIndex == allScoreList.length-1)return this.$message.info("这是最后一个了")
+				let nextIndex = nowIndex + 1;
+				// this.$router.replace(`anliDetail?aid=${allScoreList[nextIndex]}&userid=${this.userid}&oid=${this.oid}&org=${this.org}&tType=${this.tType}`);
+  		 	// /**  兼容性好*/
+  			this.aid = allScoreList[nextIndex];
+				this.$nextTick(()=>{
+					this.selectAnLi();
+					this.scoreDetail[0].scoreAll = {
+              first: "",
+              second: "",
+              third: "",
+              content: "",
+            };
+            this.scoreDetail[0].sumScore = 0;
+					if (this.tType == 2 || this.tType == 0) {
+   				  this.psDialog = true;
+   				  this.getScore(this.aid);
+   				}
+				})
+			}
+
+		},
+		async upperOne(){
+			if(this.tType == 1 || await this.addScore()){
+				const allScoreList = JSON.parse(sessionStorage.getItem("allScoreList"))
+				if(!allScoreList.length>0)return this.$message.info("没有了")
+				let nowIndex = allScoreList.findIndex(i=>i===this.aid);
+				if(nowIndex===-1)return this.$message.info("没有了")
+				if(nowIndex == 0)return this.$message.info("没有上一个了")
+				let nextIndex = nowIndex - 1;
+				// this.$router.replace(`anliDetail?aid=${allScoreList[nextIndex]}&userid=${this.userid}&oid=${this.oid}&org=${this.org}&tType=${this.tType}`);
+  		 	// /**  兼容性好*/
+  			this.aid = allScoreList[nextIndex];
+				
+				this.$nextTick(()=>{
+					this.selectAnLi();
+					this.scoreDetail[0].scoreAll = {
+              first: "",
+              second: "",
+              third: "",
+              content: "",
+            };
+            this.scoreDetail[0].sumScore = 0;
+					if (this.tType == 2 || this.tType == 0) {
+   				  this.psDialog = true;
+   				  this.getScore(this.aid);
+   				}
+				})
+				
+				
+			}
+		},
     addScore() {
-      if (this.scoreDetail[0].scoreAll.first == "") {
-        this.$message.error("请将信息填写完整");
-        return;
-      }
+			return new Promise((resolve,reject)=>{
+				if (this.scoreDetail[0].scoreAll.first == "") {
+      	  this.$message.error("请将信息填写完整");
+      	  return reject(false);
+      	}
       //  else if (this.scoreDetail[0].scoreAll.second == "") {
       //   this.$message.error("请将信息填写完整");
       //   return;
@@ -2855,11 +2973,15 @@ export default {
             },
           ];
           this.getScore(this.aid);
+					resolve(true)
           // this.dialogVisibleScore = false;
         })
         .catch((err) => {
+					
           console.error(err);
+					reject(false)
         });
+			})
     },
     selectAnLi() {
       let params = {
@@ -4038,7 +4160,7 @@ export default {
     this.selectAnLi();
   },
   mounted() {
-    if (this.tType == 2) {
+    if (this.tType == 2 || this.tType == 0) {
       this.psDialog = true;
       this.getScore(this.aid);
     }
@@ -4186,13 +4308,27 @@ body {
   flex-direction: row;
   flex-wrap: nowrap;
   align-items: center;
-  justify-content: flex-start;
+  justify-content: space-between;
   background: #fff;
   width: 60%;
   margin: 0 auto;
   height: 50px;
   border-radius: 5px;
 }
+.navBoxHeader{
+	display:flex;
+	align-items: center;
+	justify-content:center;
+	height: 100%;
+	flex:1;
+}
+.navBoxBtn{
+	display:flex;
+	flex:1;
+	height:100%;
+	justify-content:center;
+	align-item:center;
+}
 .isNavBox {
   position: fixed;
   left: 50%;
@@ -4203,7 +4339,7 @@ body {
   width: 100%;
   border-radius: 0 !important;
   z-index: 999;
-  justify-content: center;
+  /* justify-content: center; */
 }
 .isNavBox > div > div:nth-child(2):hover,
 .navBox > div > div:nth-child(2):hover {