liuyg
2021-08-07 49e8a69a09a1b33545b77eb47b3a8f8d1ce0c261
src/views/trainingRegistration/index.vue
@@ -23,7 +23,7 @@
    >
      <template slot="menuLeft">
        <el-button
          style="display:none"
          style="display: none"
          type="danger"
          size="small"
          plain
@@ -38,7 +38,7 @@
          @click="revoke(row)"
          :size="size"
          :type="type"
           :disabled="row.cancel==2"
          :disabled="row.cancel == 2"
          >取消报名</el-button
        >
        <el-button
@@ -46,11 +46,11 @@
          @click="affirmApply(row)"
          :size="size"
          :type="type"
          :disabled="row.cancel==2"
          >确认报名</el-button>
          :disabled="row.cancel == 2"
          >确认报名</el-button
        >
      </template>
    </avue-crud>
  </basic-container>
</template>
@@ -80,7 +80,7 @@
        tip: false,
        searchSize: "mini",
        searchMenuSpan: 6,
        height: 693,
        height: 583,
        index: true,
        labelWidth: "120",
        menuWidth: 230,
@@ -118,20 +118,20 @@
      adddata(form).then(
        (res) => {
          this.onLoad(this.page);
          if(res.data.data==201){
          if (res.data.data == 201) {
            this.$message({
              type: "warning",
              message:"已报名,不能重复报名",
              message: "已报名,不能重复报名",
            });
          }else if(res.data.data==201){
          } else if (res.data.data == 201) {
            this.$message({
              type: "warning",
              message:"报名失败",
              message: "报名失败",
            });
          }else{
          } else {
            this.$message({
              type: "success",
              message:"报名成功",
              message: "报名成功",
            });
          }
          done();
@@ -171,54 +171,51 @@
      );
    },
    //确认报名
    affirmApply(row,done,loading){
    affirmApply(row, done, loading) {
      this.$confirm("确认报名?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          row.cancel = 3;
          update(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "确认报名成功!",
          });
          done();
        },
        (error) => {
          window.console.log(error);
          loading();
        }
      );
      })
      }).then(() => {
        row.cancel = 3;
        update(row).then(
          () => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "确认报名成功!",
            });
            done();
          },
          (error) => {
            window.console.log(error);
            loading();
          }
        );
      });
    },
    revoke(row,done,loading) {
    revoke(row, done, loading) {
      this.$confirm("确定取消报名?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
      row.cancel = 2;
      update(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "取消报名成功!",
          });
          done();
        },
        (error) => {
          window.console.log(error);
          loading();
        }
      );
      })
      }).then(() => {
        row.cancel = 2;
        update(row).then(
          () => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "取消报名成功!",
            });
            done();
          },
          (error) => {
            window.console.log(error);
            loading();
          }
        );
      });
    },
    rowDel(row) {
      this.$confirm("确定将选择数据删除?", {