zoukankan      html  css  js  c++  java
  • this.$confirm的用法

    当当进行一些操作时,有时需要弹出一些确定信息,一般有两种形式:提示框和确认框

    //  提交保存信息
            Save(){
              this.$confirm('完成信息核对, 确认提交?', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
              }).then(() => {
                let declareFormData1 = this.$refs.declareForm.getFormData()
                let declareFormData2 = this.$refs.declareForm2.getFormData()
                let fileUploadData = this.$refs.fileUpload.getUploadFileInf()
                let param = Object.assign({},declareFormData1,declareFormData2,fileUploadData)
                param.stateFlag='1'
                
                  addAllInfo(param).then(res => {
                    let workflowParams = {
                      programId: this.$route.query.programId,
                      reviewUserId: sessionStorage.getItem('id'),
                      programStage: '101',
                      workflowStage: '1',
                      workflowStatus: '主管部门审核'
                    }
                    insertWorkFlow(workflowParams).then(res => {
                      if (res.data.status) {
                        this.$message({
                          message: '申报信息表、申报书提交成功',
                          type: 'success',
                          duration: 3000
                        })
                        this.active=8
                      }else {
                        this.$message({
                          message: '申报信息表、申报书提交失败',
                          type: 'error',
                          duration: 2000
                        })
                      }
                    })
                  })
                  this.$message({
                    message: '必填项未填写完整',
                    type: 'error'
                  })
                
              }).catch(() => {
              })
            },
    

    当我们点击保存执行Save函数的时候,会出现如下的确认框

  • 相关阅读:
    Windows Server 2012 两台服务器文件同步
    Linux下非root用户运行Tomcat
    Linux离线安装mysql 5.6详细步骤
    spring再学习之整合JDBC
    spring再学习之AOP实操
    spring再学习之AOP准备
    spring再学习之注解
    spring再学习之配置详解
    spring再学习之基本概念
    spring再学习之简单测试
  • 原文地址:https://www.cnblogs.com/axingya/p/13741443.html
Copyright © 2011-2022 走看看