Administrator
2021-08-13 a4a5a2594b7f262efca1713eb24ade353f4ee054
批量报名修改
2 files modified
137 ■■■■ changed files
src/api/securityGuard/securityGuard.js 7 ●●●● patch | view | raw | blame | history
src/views/companyApply/index.vue 130 ●●●● patch | view | raw | blame | history
src/api/securityGuard/securityGuard.js
@@ -43,11 +43,14 @@
}
export const addBatchApply = (row) => {
export const addBatchApply = (ids, deptId) => {
    return request({
        url: '/api/apply/batchApply',
        method: 'post',
        data: row
        params: {
            ids,
            deptId
        }
    })
}
src/views/companyApply/index.vue
@@ -560,40 +560,108 @@
    //批量报名
    handleBatchApply() {
      this.dialogBatchFormVisible = true;
      // this.dialogBatchFormVisible = true;
      if (this.questionBankSelectionList.length === 0) {
          this.$confirm("确定全部人员报名?", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning",
          }).then(() => {
            var userIds = "";
            addBatchApply(userIds,this.userInfo.dept_id).then(
              (res) => {
                this.questionBankOnLoad(this.questionBankPage);
                if (res.data.data == 201) {
                  this.$message({
                    type: "warning",
                    message: "已报名,不能重复报名",
                  });
                } else if (res.data.data == 201) {
                  this.$message({
                    type: "warning",
                    message: "报名失败",
                  });
                } else {
                  this.$message({
                    type: "success",
                    message: "报名成功",
                  });
                  this.$refs.formBatchApply.resetFields();
                  this.dialogBatchFormVisible = false;
                }
              },
              (error) => {
                window.console.log(error);
              }
            );
        })
      }else{
        this.$confirm("确定选择人员报名?", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning",
          }).then(() => {
            addBatchApply(this.ids,this.userInfo.dept_id).then(
              (res) => {
                this.questionBankOnLoad(this.questionBankPage);
                if (res.data.data == 201) {
                  this.$message({
                    type: "warning",
                    message: "已报名,不能重复报名",
                  });
                } else if (res.data.data == 201) {
                  this.$message({
                    type: "warning",
                    message: "报名失败",
                  });
                } else {
                  this.$message({
                    type: "success",
                    message: "报名成功",
                  });
                  this.$refs.formBatchApply.resetFields();
                  this.dialogBatchFormVisible = false;
                }
              },
              (error) => {
                window.console.log(error);
              }
            );
        })
      }
    },
    //批量报名提交
    submitBatchApply(){
        addBatchApply({
          userIds: this.BatchApply.userId.join(","),
        }).then(
          (res) => {
            this.questionBankOnLoad(this.questionBankPage);
            if (res.data.data == 201) {
              this.$message({
                type: "warning",
                message: "已报名,不能重复报名",
              });
            } else if (res.data.data == 201) {
              this.$message({
                type: "warning",
                message: "报名失败",
              });
            } else {
              this.$message({
                type: "success",
                message: "报名成功",
              });
              this.$refs.formBatchApply.resetFields();
              this.dialogBatchFormVisible = false;
            }
          },
          (error) => {
            window.console.log(error);
          }
        );
    },
    // submitBatchApply(){
    //     addBatchApply({
    //       userIds: this.BatchApply.userId.join(","),
    //     }).then(
    //       (res) => {
    //         this.questionBankOnLoad(this.questionBankPage);
    //         if (res.data.data == 201) {
    //           this.$message({
    //             type: "warning",
    //             message: "已报名,不能重复报名",
    //           });
    //         } else if (res.data.data == 201) {
    //           this.$message({
    //             type: "warning",
    //             message: "报名失败",
    //           });
    //         } else {
    //           this.$message({
    //             type: "success",
    //             message: "报名成功",
    //           });
    //           this.$refs.formBatchApply.resetFields();
    //           this.dialogBatchFormVisible = false;
    //         }
    //       },
    //       (error) => {
    //         window.console.log(error);
    //       }
    //     );
    // },
    //关闭窗口清除数据
    closeDialog(){