xuqiaoying 3 éve
szülő
commit
bb6fed7c26

+ 2 - 1
src/apis/apply.js

@@ -38,7 +38,8 @@ export default {
   //新增用户预约考试
 	addApply(data) {
 		return request({
-			url: '/apply',
+			// url: '/apply',
+			url: '/apply/save',
 			method: 'post',
 			data: data
 		})

+ 2 - 2
src/axios.js

@@ -4,10 +4,10 @@ import { Message } from 'element-ui'
 // export const BASE_URL = 'https://api.xyyxt.net'   //release
 // export const BASE_URL = 'http://42.192.164.187:19005'    //test
 // export const BASE_URL = 'https://test.xyyxt.net'   //预发布
-// export const BASE_URL = 'http://192.168.1.7:5055'    //dev
+export const BASE_URL = 'http://192.168.1.7:5055'    //dev
 // export const BASE_URL = 'http://120.79.166.78:19012'    //测试-外网
 // export const BASE_URL = 'http://42.192.164.187:19005'    //test
-export const BASE_URL = 'http://192.168.1.222:5055'    //测试
+// export const BASE_URL = 'http://192.168.1.222:5055'    //测试
 export const tenantId = '867735392558919680'
 
 

+ 181 - 31
src/pages/person-center/my-classhour/appointment-add/index.vue

@@ -61,6 +61,52 @@
             </el-select>
             <span v-if="addressId && !activeList.length">该考试地点暂无考试时间,建议重新选择考试地点</span>
           </el-form-item>
+
+          <el-form-item v-if="reportStatus == 1" label="考试疫情防控承诺书:" label-width="165px">
+            <div class="commitment">
+              本人参加“住房和城乡建设领域施工现场专业人员岗位”考试,愿意遵守疫情防控各项管理的相关要求,秉承对自己、对他人负责的原则,承担疫情防控社会责任,郑重作出以下承诺:<br/>
+              一、充分理解并遵守考试期间考点各项防疫安全的要求。<br/>
+              二、在考试前14天内,没有到过国内疫情中风险、高风险地区,未出境,不存在自境外回国情形。<br/>
+              三、在考试前14天内,每日自觉监测体温,体温均未出现高于37.3度的情形,无发热和呼吸道门诊就诊史。<br/>
+              四、在考试前14天内,未和新冠肺炎病例或疑似病例密切接触或间接接触,没有发烧、干咳、乏力、咳痰、气短、肌肉痛或关节痛、咽喉痛、头痛、寒颤、恶心或呕吐、鼻塞、腹泻、咳血、结膜充血等疑似新冠肺炎症状。<br/>
+              五、如出现与前述第二、三、四项任何一项不符的情形之一的,本人将及时在考前向相关管理机构报告,自觉配合采取隔离或其他防疫措施,并根据情况,自愿放弃参加考试。<br/>
+              六、考试当日自行做好防护工作,佩戴防护口罩。提前抵达考点,配合查验健康码、测量体温等。<br/>
+              七、考试期间,将严格遵守应考人员考场守则及疫情防控相关管理要求,完成考试后立即离场,不扎堆,不聚集。<br/>
+              八、本人承诺遵守《应考人员安全承诺书》中所有承诺内容,若因有瞒报、谎报造成新冠肺炎疫情传播的,一经查实,由本人承担相应的法律和经济责任。
+            </div>
+          </el-form-item>
+          <el-form-item v-if="reportStatus == 1" label="签名板:">
+            <div class="dis_stys">
+              <span style="color: #999999">请在下方签名区进行签名</span>
+              <el-button
+                type="primary"
+                size="mini"
+                @click="retDraw"
+                mode=""
+                >清空</el-button
+              >
+            </div>
+            <div class="handCenter">
+              <vue-esign
+                ref="esign"
+                :width="600"
+                :height="300"
+                :isCrop="false"
+                :lineWidth="5"
+                :lineColor="'#333'"
+              />
+              <!-- <div
+                v-else
+                style="width: 100%; height: 100%; position: relative"
+              >
+                <img
+                  style="width: 100%; height: 100%"
+                  :src="$tools.splitImgHost(infoForm[item.fieldKey])"
+                  mode=""
+                />
+              </div> -->
+            </div>
+          </el-form-item>
         </div>
 
         <div class="appointment-content__footer">
@@ -121,6 +167,11 @@ export default {
       dataId: "",
       orderGoodsId: "",
       addressName: "",
+      uploading: false,
+      commitment_electr_signature: '',
+      siteId: '', // 考场id
+      reportStatus: 0, // 是否线上签署疫情防控承诺书, 1是,0否
+      baseAddress: '', // 签名转成base64
     };
   },
   mounted() {
@@ -129,6 +180,7 @@ export default {
     this.applyStatus = this.$route.query.applyStatus;
     this.dataId = this.$route.query.dataId;
     this.orderGoodsId = this.$route.query.orderGoodsId;
+    this.reportStatus = this.$route.query.reportStatus
 
     this.getApplysubscribeApplySite();
   },
@@ -149,6 +201,9 @@ export default {
         (item) => item.id == this.addressId
       );
       this.addressName = this.listData[index].siteAddress;
+
+      this.siteId = this.listData[index].siteId
+      console.log('siteId: ', this.siteId, index)
       this.listData[index].examUserApplySiteTime.forEach((item) => {
         item.examApplySiteTimeTwoVo.forEach((items) => {
           arrays.push({
@@ -206,54 +261,137 @@ export default {
         });
     },
 
-    sureOppoint() {
+    async sureOppoint() {
+      if (this.uploading) {
+        return
+      }
+      this.uploading = true
+
       var self = this;
       if (self.addressId) {
         if (this.timeIndex !== "") {
-          var copyData = JSON.parse(JSON.stringify(self.activeList));
-          const index = copyData.findIndex(
-            (item, index) => this.timeIndex == index
-          );
-          var data = {
-            applyId: self.applyId,
-            goodsId: self.goodsId,
-            studentType: self.applyStatus,
-            applySiteAddress: self.addressName,
-            applySiteExamTime: copyData[index].examTime,
-            applySiteStartTime: copyData[index].startTimeC,
-            applySiteEndTime: copyData[index].endTimeC,
-            orderGoodsId: self.orderGoodsId,
-          };
-          if (self.dataId == 1) {
-            this.updateApplyData(data);
-            this.$router.push({
-              path: "/person-center/my-classhour/appointment-add-kp",
-              query: {
-                applyId: self.applyId,
-                applyStatus: self.applyStatus,
-                goodsId: self.goodsId,
-                orderGoodsId: self.orderGoodsId,
-              },
-            });
-          }
-          if (self.dataId == 2) {
-            self.$request.addApply(data).then((res) => {
-              this.showDetailModal = true;
-            });
+          if (this.reportStatus == 1) {
+            await this.subCanvas()
+            if (!this.commitment_electr_signature) {
+              this.$message.warning('请签名')
+              return
+            } else {
+              this.submits()
+            }
+          } else {
+            this.submits()
           }
+          
         } else {
           this.$message({
             type: "warning",
             message: "请选择考试时间",
           });
+          this.uploading = false
         }
       } else {
         this.$message({
           type: "warning",
           message: "请选择考试地点",
         });
+        this.uploading = false
       }
     },
+    submits() {
+      var copyData = JSON.parse(JSON.stringify(this.activeList));
+      const index = copyData.findIndex(
+        (item, index) => this.timeIndex == index
+      );
+      var data = {
+        applyId: this.applyId,
+        goodsId: this.goodsId,
+        studentType: this.applyStatus,
+        applySiteAddress: this.addressName,
+        applySiteExamTime: copyData[index].examTime,
+        applySiteStartTime: copyData[index].startTimeC,
+        applySiteEndTime: copyData[index].endTimeC,
+        orderGoodsId: this.orderGoodsId,
+        siteId: this.siteId, // 考场id
+      };
+      if (this.reportStatus == 1) {
+        data.signImageStr = this.commitment_electr_signature
+      }
+      console.log('---data', data)
+      // return
+      if (this.dataId == 1) {
+        this.updateApplyData(data);
+        this.$router.push({
+          path: "/person-center/my-classhour/appointment-add-kp",
+          query: {
+            applyId: this.applyId,
+            applyStatus: this.applyStatus,
+            goodsId: this.goodsId,
+            orderGoodsId: this.orderGoodsId,
+          },
+        });
+      }
+      if (this.dataId == 2) {
+        this.$request.addApply(data).then((res) => {
+          console.log('sfhsdfu成功')
+          this.showDetailModal = true;
+        });
+      }
+    },
+    retDraw() {
+      this.commitment_electr_signature = ''
+      // this.$set(this.infoForm, "commitment_electr_signature", "");
+      this.$nextTick(() => {
+        this.$refs.esign.reset()
+      })
+    },
+    subCanvas() {
+      return new Promise((resolve, reject) => {
+        if (this.commitment_electr_signature) {
+          resolve();
+          return;
+        }
+        console.log('this.$refs', this.$refs)
+        this.$refs.esign
+          .generate() // 使用生成器调用把签字的图片转换成为base64图片格式
+          .then(async (res) => {
+            // let url = await this.$upload.upload(
+            //   this.convertBase64UrlToBlob(res),
+            //   0
+            // );
+            console.log('base64:', res)
+            this.commitment_electr_signature = res
+            // this.$set(this.infoForm, "commitment_electr_signature", url);
+            resolve();
+          })
+          .catch((err) => {
+            console.log(err, "err");
+            // 画布没有签字时会执行这里提示一下
+            this.uploading = false
+            // this.$message({
+            //   type: "warning",
+            //   message: "请签名后再生成签字图片",
+            // });
+            resolve();
+          });
+      });
+    },
+    convertBase64UrlToBlob(urlData) {
+      console.log('dsfsdg', urlData)
+      var localData = urlData; //dataUrl为base64位
+      let base = atob(localData.substring(localData.indexOf(",") + 1)); // base是将base64编码解码,去掉data:image/png;base64部分
+      console.log('base', base)
+      let length = base.length;
+      let url = new Uint8Array(length);
+      while (length--) {
+        url[length] = base.charCodeAt(length);
+      }
+      let file = new File([url], "a.jpg", {
+        type: "image/jpg",
+      });
+      console.log('file',file)
+      //最后将file,通过ajax请求做为参数传给服务器就可以了
+      return file;
+    },
   },
 };
 </script>
@@ -437,5 +575,17 @@ export default {
       }
     }
   }
+  .commitment {
+    width: 100%;
+    height: 300px;
+    overflow-y: auto;
+    border: 1px solid #ddd;
+  }
+  .handCenter {
+    width: 600px;
+    height: 300px;
+    background-color: #DCDFE6;
+    border: 1px solid #DCDFE6;
+  }
 }
 </style>

+ 5 - 0
src/pages/person-center/my-classhour/appointment/index.vue

@@ -85,6 +85,7 @@ export default {
       listData: [],
       goodsIdBK: null,
       applyId: "",
+      reportStatus: 0, // 是否线上签署疫情防控承诺书, 1是,0否
     };
   },
   mounted() {
@@ -102,11 +103,14 @@ export default {
         orderGoodsId: this.orderGoodsId,
         applyId: this.applyId,
       };
+      // /apply/subscribe
       this.$request.getApplysubscribe(data).then((res) => {
         if (res.data.applyStatus) {
           res.data.applyStatus = res.data.applyStatus.split(",");
         }
         this.listData = res.data;
+        this.reportStatus = res.data.reportStatus
+        console.log('reportStatus', this.reportStatus)
       });
     },
     cancel() {
@@ -139,6 +143,7 @@ export default {
                 goodsId: this.goodsId,
                 dataId: res.data,
                 orderGoodsId: this.orderGoodsId,
+                reportStatus: this.reportStatus,
               },
             });
           }

+ 16 - 1
src/pages/person-center/my-examination/index.vue

@@ -86,9 +86,10 @@
                         >{{ item.categoryName }}专业</span
                       >
                     </div>
+                    <!-- fromPlat:1云学堂 2智慧考场 -->
                     <div class="desc-list__item">
                       考试地点:<span class="note">{{
-                        item.applySiteAddress
+                        item.fromPlat == 2 ? (item.roomAddress || '') : (item.applySiteAddress || '')
                       }}</span>
                     </div>
                     <div class="desc-list__item">
@@ -119,6 +120,16 @@
                         {{ item.applySiteEndTrainTime }}</span
                       >
                     </div>
+                    <div class="desc-list__item">
+                      准考证号:<span class="note">{{ item.examineeCode || ''}}</span>
+                    </div>
+                    <div class="desc-list__item">
+                      座位号:<span class="note">{{ item.seatNumber || '' }}</span>
+                    </div>
+                    <!-- applyReportStatus是否显示签署承诺书 1是,0否 -->
+                    <div v-if="item.applyReportStatus == 1" class="desc-list__item">
+                      疫情防控承诺书:<span class="note unSign">{{ item.reportStatus == 1 ? '已签署' : item.reportStatus == 0 ? '未签署' : '' }}</span>
+                    </div>
                   </div>
                 </div>
               </div>
@@ -681,6 +692,10 @@ export default {
                     color: #ff3b30;
                   }
                 }
+                .unSign {
+                  text-decoration: underline;
+                  cursor: pointer;
+                }
               }
             }
           }