Ver código fonte

Merge branch 'master' of http://git.zthymaoyi.com/gdc/yiliangyiyun-app

ccjgmwz 3 anos atrás
pai
commit
2e8b44dc15

+ 132 - 75
pages/task/audit/acquisition_settlement_approval.vue

@@ -146,7 +146,8 @@
 							<image :src="src" style="width: 100rpx;height: 100rpx;border-radius: 500%;"></image>
 						</view>
 						<view class="item2">
-							<view class="name">{{item.operatorMajorRoleName}}</view>
+							<view class="name">{{item.operatorName ? item.operatorName:item.operatorMajorRoleName}}
+							</view>
 							<view class="status">{{item.approved ? "已审核":"待决策人审核"}}</view>
 						</view>
 					</view>
@@ -255,13 +256,13 @@
 			},
 			getList() {
 				uni.showLoading({
-							title: "加载中...",
-							mask: true
-						})
+					title: "加载中...",
+					mask: true
+				})
 				this.$api.doRequest('get', '/paymentManagement/selectPaymentManagement', {
 					currentPage: 1,
 					pageSize: 10,
-					searchType: '1',//searchType:1待审核
+					searchType: '1', //searchType:1待审核
 					warehouseName: this.vesselId,
 					managementType: 1
 				}).then(res1 => {
@@ -278,7 +279,7 @@
 				// 			title: "加载中...",
 				// 			mask: true
 				// 		})
-						
+
 				// 	}
 				// })
 				this.$api.doRequest('post', '/paymentManagement/exportPhone', {
@@ -324,31 +325,67 @@
 				this.title = '驳回原因(驳回)'
 			},
 			//驳回
-			rejectSubmit() {
-				if (!this.auditMind) {
-					this.$api.msg('驳回原因不能为空!')
-				} else {
-					var that = this
-					that.show = false
-					if (this.List.length > 0) {
+			// rejectSubmit() {
+			// 	if (!this.auditMind) {
+			// 		this.$api.msg('驳回原因不能为空!')
+			// 	} else {
+			// 		var that = this
+			// 		that.show = false
+			// 		if (this.List.length > 0) {
+			// 			uni.showModal({
+			// 				content: "确定驳回付款申请?",
+			// 				showCancel: true,
+			// 				confirmText: '确定',
+			// 				success: function(res) {
+			// 					if (res.confirm) {
+			// 						that.audit(that.List[0], 0, false, '', '')
+			// 					}
+			// 				}
+			// 			})
+			// 		}
+			// 	}
+			// },
+			//审核确定
+			passSubmit() {
+				var that = this
+				that.show = false
+				if (this.title == '驳回原因(驳回)') {
+					// this.rejectSubmit()
+					if (!that.auditMind) {
+						this.$api.msg('驳回原因不能为空!')
+					} else {
 						uni.showModal({
 							content: "确定驳回付款申请?",
 							showCancel: true,
 							confirmText: '确定',
 							success: function(res) {
 								if (res.confirm) {
-									that.audit(that.List[0], 0, false, '', '')
+									uni.showLoading({
+										title: "审核中...",
+										mask: true
+									})
+									var count = 0
+									for (let num = 0; num < that.List.length; num++) {
+										that.$api.doRequest('post', '/workflow/api/handle', {
+											taskId: that.List[num].taskId,
+											approved: false,
+											auditMind: that.auditMind ? that.auditMind : "",
+											needReapply: true
+										}).then(res => {
+											count++
+											if (count == that.List.length) {
+												uni.hideLoading()
+												that.$api.msg('审核成功!')
+												setTimeout(function() {
+													uni.navigateBack();
+												}, 2000);
+											}
+										})
+									}
 								}
 							}
 						})
 					}
-				}
-			},
-			//通過
-			passSubmit() {
-				var that = this
-				if (this.title == '驳回原因(驳回)') {
-					this.rejectSubmit()
 				} else {
 					var that = this
 					this.show = false
@@ -358,65 +395,85 @@
 						confirmText: '确定',
 						success: function(res) {
 							if (res.confirm) {
-								that.audit(that.List, 0, true)
+								uni.showLoading({
+									title: "审核中...",
+									mask: true
+								})
+								for (let num = 0; num < that.List.length; num++) {
+									var tmp = 0
+									that.$api.doRequest('post', '/workflow/api/handle', {
+										taskId: that.List[num].taskId,
+										approved: true,
+										auditMind: that.auditMind ? that.auditMind : "",
+										needReapply: false
+									}).then(res => {
+										tmp++
+										if (tmp == that.List.length) {
+											uni.hideLoading()
+											that.$api.msg('审核成功!')
+											setTimeout(function() {
+												uni.navigateBack();
+											}, 2000);
+										}
+									})
+								}
 							}
 						}
 					})
 				}
 			},
-			audit(list, index, status, status2, reason) {
-				uni.showLoading({
-					title: "审核中"
-				})
-				if (this.List.length > 0) {
-					if (status == true && list.status == "已驳回") {
-						this.$api.doRequest('get', '/paymentManagement/api/openAuditFlow', {
-							compId: "2710b21efc1e4393930c5dc800010dc4",
-							id: list.id
-						}).then(res => {
-							if (res.data.code == 200) {
-								this.audit(this.List[index + 1], index + 1, status, status2, reason)
-							}
-						})
-					} else {
-						for (var i = 0; i < this.List.length; i++) {
-							this.$api.doRequest('post', '/workflow/api/handle', {
-								taskId: this.List[i].taskId,
-								approved: status,
-								auditMind: this.auditMind ? this.auditMind : "",
-								needReapply: status2 ? true : false
-							}).then(res => {
-								debugger
-								if (res.data.code == 200) {
-									uni.hideLoading()
-									// this.audit(this.List[index + 1], index + 1, status, status2, reason)
-									this.$api.msg('通过成功')
-								}else{
-									uni.hideLoading()
-									this.$api.msg('审核失败')
-								}
-							})
-						}
-
-					}
-				} else {
-					if (status == true) {
-						this.$api.msg('通过成功')
-					} else if (status == false) {
-						this.$api.msg('驳回成功')
-					}
-					let that = this
-					setTimeout(function() {
-
-						if (that.everyCheck) {
-							helper.setAudit(that.list)
-						} else {
-							uni.navigateBack()
-						}
-						uni.hideLoading()
-					}, 1000);
-				}
-			},
+			// audit(list, index, status, status2, reason) {
+			// 	uni.showLoading({
+			// 		title: "审核中"
+			// 	})
+			// 	if (this.List.length > 0) {
+			// 		if (status == true && list.status == "已驳回") {
+			// 			this.$api.doRequest('get', '/paymentManagement/api/openAuditFlow', {
+			// 				compId: "2710b21efc1e4393930c5dc800010dc4",
+			// 				id: list.id
+			// 			}).then(res => {
+			// 				if (res.data.code == 200) {
+			// 					this.audit(this.List[index + 1], index + 1, status, status2, reason)
+			// 				}
+			// 			})
+			// 		} else {
+			// 			for (var i = 0; i < this.List.length; i++) {
+			// 				this.$api.doRequest('post', '/workflow/api/handle', {
+			// 					taskId: this.List[i].taskId,
+			// 					approved: status,
+			// 					auditMind: this.auditMind ? this.auditMind : "",
+			// 					needReapply: status2 ? true : false
+			// 				}).then(res => {
+			// 					if (res.data.code == 200) {
+			// 						uni.hideLoading()
+			// 						// this.audit(this.List[index + 1], index + 1, status, status2, reason)
+			// 						this.$api.msg('通过成功')
+			// 					}else{
+			// 						uni.hideLoading()
+			// 						this.$api.msg('审核失败')
+			// 					}
+			// 				})
+			// 			}
+
+			// 		}
+			// 	} else {
+			// 		if (status == true) {
+			// 			this.$api.msg('通过成功')
+			// 		} else if (status == false) {
+			// 			this.$api.msg('驳回成功')
+			// 		}
+			// 		let that = this
+			// 		setTimeout(function() {
+
+			// 			if (that.everyCheck) {
+			// 				helper.setAudit(that.list)
+			// 			} else {
+			// 				uni.navigateBack()
+			// 			}
+			// 			uni.hideLoading()
+			// 		}, 1000);
+			// 	}
+			// },
 		}
 	}
 </script>

+ 1 - 1
pages/task/audit/salecontract.vue

@@ -307,7 +307,7 @@
 			},
 			reject() {
 				this.show = true
-				this.title = '驳回原因'
+				this.title = '驳回原因(驳回)'
 			},
 			//通过
 			passSubmit() {