Sfoglia il codice sorgente

前端 小程序sdy

zhongtianhaoyuan 3 anni fa
parent
commit
71ff08c984
1 ha cambiato i file con 36 aggiunte e 13 eliminazioni
  1. 36 13
      pages/task/audit/Issueandreceipt_task_approval.vue

+ 36 - 13
pages/task/audit/Issueandreceipt_task_approval.vue

@@ -307,6 +307,7 @@
 						type: '等外'
 					}
 				],
+				count:0,
 			}
 		},
 		// onReady() {
@@ -321,6 +322,7 @@
 		onLoad(options) {
 			this.id = options.id
 			this.everyCheck = uni.getStorageSync("everyTask")
+			this.count=0
 			this.getList()
 		},
 		computed: {
@@ -419,7 +421,7 @@
 			},
 			rejectSubmit() {
 				// (1出库2入库3移库4退库并出库)
-				if (!this.rejectInfo) {
+				if (!this.auditMind) {
 					this.$api.msg('驳回原因不能为空!')
 				} else {
 					this.show = false
@@ -470,7 +472,6 @@
 				uni.getStorage({
 					key: 'pcUserInfo',
 					success(e) {
-						debugger
 						list.compId = e.data.compId //这就是你想要取的token
 						uni.showLoading({
 							title: "审核中"
@@ -486,17 +487,27 @@
 									}).then(res => {
 										if (res.data.code == 200) {
 											that.$api.msg('审核成功!')
+											that.count++
+											if (that.everyCheck) {
+												helper.setAudit(that.list)
+											} 
 										} else {
 											that.$api.msg('审核失败!')
 										}
-										setTimeout(function() {
-											if (that.everyCheck) {
-												helper.setAudit(that.list)
-											} else {
-												uni.navigateBack()
+										if(list.taskTypeKey == '3' || list.taskTypeKey == '4'){
+											if(that.count == 2){
+												setTimeout(function() {
+													uni.hideLoading()
+													uni.navigateBack()
+												}, 1000);
 											}
+										}else{
+											setTimeout(function() {
 											uni.hideLoading()
+											uni.navigateBack()
 										}, 1000);
+										}
+										
 									}).catch(res => {
 										uni.hideLoading()
 										if (res.message) {
@@ -513,7 +524,6 @@
 											})
 										}
 									})
-
 								} else {
 									that.$api.msg('审核失败!')
 								}
@@ -550,20 +560,33 @@
 						this.$api.doRequest('post', '/workflow/api/handle', {
 							taskId: list.taskId,
 							approved: false,
-							auditMind: this.rejectInfo,
+							auditMind: this.auditMind,
 							needReapply: true
 						}).then(res => {
 							if (res.data.code == 200) {
 								this.$api.msg('驳回成功!')
-								setTimeout(function() {
+									this.count++
 									if (this.everyCheck) {
 										helper.setAudit(this.list)
-									} else {
+									} 
+									uni.hideLoading()
+									if(list.taskTypeKey == '3' || list.taskTypeKey == '4'){
+										if(this.count == 2){
+											setTimeout(function() {
+												uni.hideLoading()
+												uni.navigateBack()
+											}, 1000);
+										}
+									}else{
+										setTimeout(function() {
+										uni.hideLoading()
 										uni.navigateBack()
+									   }, 1000);
 									}
-									uni.hideLoading()
-								}, 1000);
+							}else{
+								this.$api.msg('驳回失败!')
 							}
+							
 						})
 					}
 				})