15179599649
2024-01-23 ac42a5bd5995a48746b3104626be7d1f4e928231
'防止重复提交'
6 files modified
45 ■■■■ changed files
src/router/page/index.js 27 ●●●● patch | view | raw | blame | history
src/views/Addmessage/index.vue 11 ●●●● patch | view | raw | blame | history
src/views/toAppraising/toAppraisingone.vue 1 ●●●● patch | view | raw | blame | history
src/views/toAppraising/toAppraisingthree.vue 1 ●●●● patch | view | raw | blame | history
src/views/toAppraising/toAppraisingtwo.vue 3 ●●●●● patch | view | raw | blame | history
src/views/toexamine/index.vue 2 ●●● patch | view | raw | blame | history
src/router/page/index.js
@@ -59,7 +59,7 @@
  {
    path: "/Appraising",
    component: () => import("../../views/Appraising/index.vue"),
    meta: { title: '求卓越,争创优' }
    meta: { title: '求卓越,争创优', allowBack: false }
  },
  // 去评优
  {
@@ -73,12 +73,12 @@
    component: () => import("../../views/toAppraising/toAppraisingfirst.vue"),
    meta: { title: '中图铜镜' }
  },
    //第一次评优,部门级评优
    {
      path: '/toAppraisingone',
      component: () => import("../../views/toAppraising/toAppraisingone.vue"),
      meta: { title: '中图铜镜' }
    },
  //第一次评优,部门级评优
  {
    path: '/toAppraisingone',
    component: () => import("../../views/toAppraising/toAppraisingone.vue"),
    meta: { title: '中图铜镜' }
  },
  //部门评优
  {
    path: '/toAppraisingtwo',
@@ -93,10 +93,23 @@
];
const router = new VueRouter({
  base: process.env.BASE_URL,
  routes,
  mode: 'history',
});
router.beforeEach((to, from, next) => {
  // 判断当前跳转到的页面是否为禁止返回的页面
  if (to.path === '/Appraising' || to.path === '/examine' || to.path === '/message') {
    // 清除浏览器历史记录,防止返回上一个页面
    window.history.pushState(null, null, document.URL);
    window.addEventListener('popstate', function () {
      history.go(1);
    });
  }
  next();
});
export default router;
src/views/Addmessage/index.vue
@@ -27,8 +27,13 @@
    </div>
    <div class="bottom">
      <div class="button">
        <van-button type="primary" @click="submit(2)" v-show="!this.shownim">匿名留言</van-button>
        <van-button type="primary" @click="submit(1)">实名留言</van-button>
        <van-button
          type="primary"
          @click="submit(2)"
          v-show="!this.shownim"
          :disabled="disabledsubmit"
        >匿名留言</van-button>
        <van-button type="primary" @click="submit(1)" :disabled="disabledsubmit">实名留言</van-button>
      </div>
    </div>
  </div>
@@ -41,6 +46,7 @@
    return {
      messagecom: "",
      fileindex: null,
      disabledsubmit: false,
      FileList: [],
      submitlist: [],
      shownim: false
@@ -104,6 +110,7 @@
          toData.userName = "匿名用户";
        }
        leaveWords(toData).then(res => {
          this.disabledsubmit = true;
          setTimeout(() => {
            this.$router.push("/");
          }, 1000);
src/views/toAppraising/toAppraisingone.vue
@@ -153,6 +153,7 @@
          })
        });
        saveBatch(submitData).then(res => {
          this.disabledsubmit=true;
          setTimeout(() => {
            this.$router.push({
              path: "/Appraising",
src/views/toAppraising/toAppraisingthree.vue
@@ -158,6 +158,7 @@
          })
        });
        saveBatchCandidateResult(submitData).then(res => {
          this.disabledsubmit=true;
          setTimeout(() => {
            this.$router.push({
              path: "/Appraising",
src/views/toAppraising/toAppraisingtwo.vue
@@ -47,6 +47,7 @@
          block
          @click="SubmitTo()"
          v-show="this.poepleinfo.isVote==false"
          :disabled="disabledsubmit"
        >提交</van-button>
      </div>
    </div>
@@ -65,6 +66,7 @@
  data() {
    return {
      remark: "",
      disabledsubmit: false,
      checked: {},
      deptData: [],
      infoData: JSON.parse(this.$route.query.info),
@@ -100,6 +102,7 @@
          remark: this.remark
        });
        saveBatchCandidateResult(submitData).then(res => {
          this.disabledsubmit = true;
          setTimeout(() => {
            this.$router.push({
              path: "/Appraising"
src/views/toexamine/index.vue
@@ -106,8 +106,8 @@
        if (Data.scoreVal == "") {
          this.$toast.fail("请输入评分");
        } else {
          this.disabledsubmit = true;
          assessmentScore(Data).then(res => {
            this.disabledsubmit = true;
            setTimeout(() => {
              this.$router.push("/examine");
            }, 1000);