licp
2024-09-10 cb57bc6b4abf45dbb0605c94359c63e3b31b4b87
src/components/do/b1-report-preparation/order.vue
@@ -159,36 +159,49 @@
            cancelButtonText: "不生成",
            type: "success",
            distinguishCancelAndClose: true,
          }).then(() => {
            this.$axios.post(this.$api.insReport.isReport, {
              id:row.id,
              state:1
            }).then(res => {
              if (res.code === 201) {
                return
              }
              this.$message.success("已生成")
              this.refreshTable()
            }).catch(err => {
              console.log(err)
            })
          }).catch((e) => {
            console.log(e)
            if(e=='cancel'){
            beforeClose: (action, instance, done) => {
            if (action === 'confirm') {
              instance.confirmButtonLoading = true;
              this.$axios.post(this.$api.insReport.isReport, {
                id:row.id,
                state:1
              }).then(res => {
                instance.confirmButtonLoading = false;
                if (res.code === 201) {
                  return
                }
                this.$message.success("已生成")
                this.refreshTable()
                done();
              }).catch(err => {
                console.log(err)
                instance.confirmButtonLoading = false;
              })
            } else if(action === 'cancel'){
              instance.cancelButtonLoading = true;
              this.$axios.post(this.$api.insReport.isReport, {
                id:row.id,
                state:0
              }).then(res => {
                instance.cancelButtonLoading = false;
                if (res.code === 201) {
                  return
                }
                this.refreshTable()
                done();
                this.$message.success("已取消生成")
              }).catch(err => {
                instance.cancelButtonLoading = false;
                console.log(err)
              })
            }else{
              done();
            }
          }
          }).then(() => {
          }).catch((e) => {
            console.log(e)
          })
    }
  }