Browse Source

修改出入库任务

wangchao 3 years ago
parent
commit
cfc433cb9c
1 changed files with 53 additions and 43 deletions
  1. 53 43
      pages/task/audit/Issueandreceipt_task_approval.vue

+ 53 - 43
pages/task/audit/Issueandreceipt_task_approval.vue

@@ -374,7 +374,7 @@
 				this.title = '审核意见(通过)'
 			},
 			reject() {
-				
+
 				this.show1 = true
 				this.title = '驳回原因(驳回)'
 			},
@@ -466,34 +466,58 @@
 				}
 			},
 			requestadd(list, status) {
+				let that = this
+				uni.getStorage({
+					key: 'pcUserInfo',
+					success(e) {
+						debugger
+						list.compId = e.data.compId //这就是你想要取的token
+						uni.showLoading({
+							title: "审核中"
+						})
+						that.$api.doRequest('post', '/inOutWarehouseTask/api/checkOrUpdateInOutTask', list).then(
+							res => {
+								if (res.data.code == 200) {
+									that.$api.doRequest('post', '/workflow/api/handle', {
+										taskId: list.taskId,
+										approved: true,
+										auditMind: that.auditMind,
+										needReapply: false
+									}).then(res => {
+										if (res.data.code == 200) {
+											that.$api.msg('审核成功!')
+										} else {
+											that.$api.msg('审核失败!')
+										}
+										setTimeout(function() {
+											if (that.everyCheck) {
+												helper.setAudit(that.list)
+											} else {
+												uni.navigateBack()
+											}
+											uni.hideLoading()
+										}, 1000);
+									}).catch(res => {
+										uni.hideLoading()
+										if (res.message) {
+											uni.showToast({
+												title: res.message,
+												icon: 'none',
+												duration: 2000
+											})
+										} else {
+											uni.showToast({
+												title: "系统异常,请联系管理员",
+												icon: 'none',
+												duration: 2000
+											})
+										}
+									})
 
-				list.compId = sessionStorage.getItem('ws-pf_compId')
-				// list.publisher = this.userInfo.userName
-				uni.showLoading({
-					title: "审核中"
-				})
-				this.$api.doRequest('post', '/inOutWarehouseTask/api/checkOrUpdateInOutTask', list).then(res => {
-					if (res.data.code == 200) {
-						this.$api.doRequest('post', '/workflow/api/handle', {
-							taskId: list.taskId,
-							approved: true,
-							auditMind: this.auditMind,
-							needReapply: false
-						}).then(res => {
-							if (res.data.code == 200) {
-								this.$api.msg('审核成功!')
-							} else {
-								this.$api.msg('审核失败!')
-							}
-							setTimeout(function() {
-								if (this.everyCheck) {
-									helper.setAudit(this.list)
 								} else {
-									uni.navigateBack()
+									that.$api.msg('审核失败!')
 								}
-								uni.hideLoading()
-							}, 1000);
-						}).catch(res => {
+							}).catch(res => {
 							uni.hideLoading()
 							if (res.message) {
 								uni.showToast({
@@ -510,25 +534,10 @@
 							}
 						})
 
-					} else {
-						this.$api.msg('审核失败!')
-					}
-				}).catch(res => {
-					uni.hideLoading()
-					if (res.message) {
-						uni.showToast({
-							title: res.message,
-							icon: 'none',
-							duration: 2000
-						})
-					} else {
-						uni.showToast({
-							title: "系统异常,请联系管理员",
-							icon: 'none',
-							duration: 2000
-						})
 					}
 				})
+				// list.publisher = this.userInfo.userName
+
 			},
 			requestaudit(list, status) {
 				uni.showLoading({
@@ -950,6 +959,7 @@
 		right: 0;
 		color: #22C572;
 	}
+
 	.u-textarea-style {
 		margin: 20rpx;
 		background: #F9F9FA;