From a3edd332f6d43bf2f512ebf1730eefe665efab8c Mon Sep 17 00:00:00 2001 From: "wangxiahui@91isoft.com" <140316hui> Date: Wed, 15 Sep 2021 16:46:27 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=AF=84=E4=BC=B0=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E6=A0=87=E5=87=86=20=E6=8F=90=E4=BA=A4=E9=87=8D?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/creatProcess/xmpg/step1-1.vue | 79 +++++++++--------- .../pages/creatProcess/xmpg/step1.vue | 80 ++++++++++--------- 2 files changed, 84 insertions(+), 75 deletions(-) diff --git a/src/pages/processCenter/pages/creatProcess/xmpg/step1-1.vue b/src/pages/processCenter/pages/creatProcess/xmpg/step1-1.vue index 03a84bfed..572a56578 100644 --- a/src/pages/processCenter/pages/creatProcess/xmpg/step1-1.vue +++ b/src/pages/processCenter/pages/creatProcess/xmpg/step1-1.vue @@ -401,6 +401,8 @@ export default { }, data() { return { + //用来判断提交事件条件是否满足 + satisfyFlag: true, active: "1", standModel: false, sarAccessListDatas: [], @@ -701,50 +703,53 @@ export default { //提交事件 handleSubmit() { if (this.dataList.length < 1) { + this.satisfyFlag = false this.$message.warning("请添加产品线信息"); } this.dataList.forEach(item => { if (item.distributePerson === "" || item.distributePerson === null || item.distributePerson === undefined) { + this.satisfyFlag = false this.$message.warning("请选择分发责任人"); - } else { - var json = Object.assign(this.listForm, this.roleForm); - this.isSubmit = true - this.$refs["listForm"].validate((valid) => { - if (valid) { - this.$refs["roleForm"].validate((valid) => { - if (valid) { - this.$http.get("lawss/activiti/startProcess", { type: "5" }, { - _this: this - }, res => { - if (res.ok) { - this.$http.post("lawss/activiti/completeTask", { - taskIds: res.data, - userId: this.$store.getters.userInfo.userId, - json: JSON.stringify(json) - }, { - _this: this - }, res => { - if (res.success) { - this.$message.success(res.message); - this.$router.push("/processCenter"); - } - this.isSubmit = false - }); - } - }); - } else { - this.isSubmit = false - return this.$message.warning("请完善人员信息"); - } - }); - } else { - this.isSubmit = false - return this.$message.warning("请完善基础信息"); - } - }); } }); - + if(this.satisfyFlag){ + this.isSubmit = true; + this.listForm.commentText = this.commentText; + var json = Object.assign(this.listForm, this.roleForm); + this.$refs["listForm"].validate((valid) => { + if (valid) { + this.$refs["roleForm"].validate((valid) => { + if (valid) { + this.$http.get("lawss/activiti/startProcess", { type: "5" }, { + _this: this + }, res => { + if (res.ok) { + this.$http.post("lawss/activiti/completeTask", { + taskIds: res.data, + userId: this.$store.getters.userInfo.userId, + json: JSON.stringify(json) + }, { + _this: this + }, res => { + if (res.success) { + this.$message.success(res.message); + this.$router.push("/processCenter"); + } + this.isSubmit = false; + }); + } + }); + } else { + this.isSubmit = false; + return this.$message.warning("请完善人员信息"); + } + }); + } else { + this.isSubmit = false; + return this.$message.warning("请完善基础信息"); + } + }); + } }, //选择拆分标准取消事件 closeDrawer() { diff --git a/src/pages/processCenter/pages/creatProcess/xmpg/step1.vue b/src/pages/processCenter/pages/creatProcess/xmpg/step1.vue index e51aa3b71..61a3c3345 100644 --- a/src/pages/processCenter/pages/creatProcess/xmpg/step1.vue +++ b/src/pages/processCenter/pages/creatProcess/xmpg/step1.vue @@ -389,6 +389,8 @@ export default { }, data() { return { + //用来判断提交事件条件是否满足 + satisfyFlag: true, active: "1", standModel: false, sarAccessListDatas: [], @@ -674,51 +676,53 @@ export default { //提交事件 handleSubmit() { if (this.dataList.length < 1) { + this.satisfyFlag = false this.$message.warning("请添加产品线信息"); } this.dataList.forEach(item => { if (item.distributePerson === "" || item.distributePerson === null || item.distributePerson === undefined) { + this.satisfyFlag = false this.$message.warning("请选择分发责任人"); - } else { - this.isSubmit = true; - this.listForm.commentText = this.commentText; - var json = Object.assign(this.listForm, this.roleForm); - this.$refs["listForm"].validate((valid) => { - if (valid) { - this.$refs["roleForm"].validate((valid) => { - if (valid) { - this.$http.get("lawss/activiti/startProcess", { type: "5" }, { - _this: this - }, res => { - if (res.ok) { - this.$http.post("lawss/activiti/completeTask", { - taskIds: res.data, - userId: this.$store.getters.userInfo.userId, - json: JSON.stringify(json) - }, { - _this: this - }, res => { - if (res.success) { - this.$message.success(res.message); - this.$router.push("/processCenter"); - } - this.isSubmit = false; - }); - } - }); - } else { - this.isSubmit = false; - return this.$message.warning("请完善人员信息"); - } - }); - } else { - this.isSubmit = false; - return this.$message.warning("请完善基础信息"); - } - }); } }); - + if(this.satisfyFlag){ + this.isSubmit = true; + this.listForm.commentText = this.commentText; + var json = Object.assign(this.listForm, this.roleForm); + this.$refs["listForm"].validate((valid) => { + if (valid) { + this.$refs["roleForm"].validate((valid) => { + if (valid) { + this.$http.get("lawss/activiti/startProcess", { type: "5" }, { + _this: this + }, res => { + if (res.ok) { + this.$http.post("lawss/activiti/completeTask", { + taskIds: res.data, + userId: this.$store.getters.userInfo.userId, + json: JSON.stringify(json) + }, { + _this: this + }, res => { + if (res.success) { + this.$message.success(res.message); + this.$router.push("/processCenter"); + } + this.isSubmit = false; + }); + } + }); + } else { + this.isSubmit = false; + return this.$message.warning("请完善人员信息"); + } + }); + } else { + this.isSubmit = false; + return this.$message.warning("请完善基础信息"); + } + }); + } }, //选择拆分标准取消事件 closeDrawer() {