Browse Source

发票流程审核

sangwenwei 1 year ago
parent
commit
42a63313bc

+ 20 - 11
src/views/cw/invoice/InvoiceFormTask.vue

@@ -1004,15 +1004,15 @@
 		async agreeForm(callback) {
 			console.log('进入方法')
 			this.loading = true
-			await financeInvoiceService.queryById(this.inputForm.id).then((data) => {
-				if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
-					this.loading = false
-					this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
-					throw new Error()
-				} else {
-					this.doSubmit('agree', callback)
-				}
-			})
+				await financeInvoiceService.queryById(this.inputForm.id).then((data) => {
+					 if (data.status !== '2' ) { // status的值不等于“审核中”,就弹出提示
+						this.loading = false
+						this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+						throw new Error()
+					} else {
+						this.doSubmit('agree', callback)
+					}
+				})
 		},
 		reapplyForm(callback) {
 			this.loading = true
@@ -1066,7 +1066,15 @@
 				this.inputForm.status = '2'
 			} else if (status === 'agree') {
 				// 审核同意
-				this.inputForm.status = '5'
+				if (this.commonJS.isEmpty(this.inputForm.programId)){
+					if (this.$store.state.user.office.name==='总经办'){
+						this.inputForm.status= '5'
+					}else {
+						this.inputForm.status= '2'
+					}
+				}else {
+					this.inputForm.status = '5'
+				}
 			} else if (status === 'reapply') {
 				this.inputForm.status = '2'
 			}
@@ -1172,7 +1180,8 @@
 							this.inputForm.title = `${this.$store.state.user.name} 发起了 ${data.no} [财务-发票申请]`
 						}
 						this.inputForm.id = data.businessId
-						callback(data.businessTable, data.businessId, this.inputForm)
+						console.log('data22', data)
+						callback(data.businessTable, data.businessId, this.inputForm,data.recordType)
 						this.loading = false
 					}).catch(() => {
 						this.loading = false

+ 6 - 2
src/views/cw/invoice/InvoiceList.vue

@@ -289,6 +289,7 @@
               <el-button v-if="hasPermission('cw_finance:invoice:edit')&&scope.row.createBy.id === $store.state.user.id&&(scope.row.status === '1'||scope.row.status === '3')" text type="primary"  @click="del(scope.row.id)">删除</el-button>
 <!--              审核  发票申请-->
               <el-button v-if="scope.row.status==='2' && checkIsAudit(scope.row)" text type="primary"  @click="examine(scope.row)">审核</el-button>
+              <el-button v-if="scope.row.status==='5' && $store.state.user.officeId==='1602911350533177346'" text type="primary"  @click="examine(scope.row)">审核</el-button>
 <!--              被驳回后当前申请人重新调整  发票申请-->
               <el-button v-if="scope.row.createBy.id === $store.state.user.id&&scope.row.status === '4'" text type="primary"  @click="adjust(scope.row)">驳回调整</el-button>
 <!--              审核  发票作废-->
@@ -634,7 +635,7 @@
             this.$router.push({
               path: '/flowable/task/TaskForm',
               query: {
-                ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title'),
+                ...pick(data,  'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title'),
                 procDefId: this.processDefinitionId,
                 procDefKey: this.procDefKey,
                 title: title,
@@ -959,7 +960,10 @@
           }
         }
         return false
-      }
+      },
+
+
+
     }
   }
 </script>

+ 19 - 10
src/views/flowable/task/TaskForm.vue

@@ -483,8 +483,8 @@ export default {
 			if (this.formType === "2") {
 				// 外置表单
 				this.$refs.form.startForm(
-					(businessTable, businessId, inputForm) => {
-						vars = { ...vars, ...inputForm }
+					(businessTable, businessId, inputForm,recordType) => {
+						vars = { ...vars, ...inputForm ,recordType}
 						if (inputForm.procDefId) {
 							this.procDefId = inputForm.procDefId
 						}
@@ -497,6 +497,11 @@ export default {
 						if (inputForm.formTitle) {
 							this.formTitle = inputForm.formTitle
 						}
+						console.log('recordType', recordType)
+						if (recordType) {
+							this.recordType = recordType
+						}
+						console.log('this.recordType', this.recordType)
 						let assignee = this.auditForm.assignee
 						if (!this.commonJS.isEmpty(inputForm.assignee)) {
 							assignee = inputForm.assignee
@@ -510,6 +515,7 @@ export default {
 								...vars,
 								title: this.title,
 								assignee: assignee,
+								recordType: this.recordType
 							})
 							.then((data) => {
 								this.$message.success("启动成功");
@@ -575,8 +581,8 @@ export default {
 						taskName: ''
 					}
 				}
-				this.$refs.form.reapplyForm((businessTable, businessId, inputForm) => {
-					vars = {...vars, ...inputForm}
+				this.$refs.form.reapplyForm((businessTable, businessId, inputForm,recordType) => {
+					vars = {...vars, ...inputForm,recordType}
 					if (inputForm.procDefId) {
 						param.procDefId = inputForm.procDefId
 					}
@@ -584,6 +590,9 @@ export default {
 					if (!this.commonJS.isEmpty(inputForm.assignee)) {
 						assignee = inputForm.assignee
 					}
+					console.log('recordType', recordType)
+					this.recordType=recordType
+					console.log('this.recordType', this.recordType)
 					taskService.audit({
 						taskId: this.taskId,
 						taskDefKey: this.taskDefKey,
@@ -591,7 +600,8 @@ export default {
 						procDefId: this.procDefId,
 						vars: vars,
 						comment: this.auditForm,
-						assignee: assignee
+						assignee: assignee,
+						recordType: this.recordType
 					}).then((data) => {
 						this.$message.success('提交成功')
 						this.changeBusiness()
@@ -657,7 +667,6 @@ export default {
 		// Process_1669700915383 合同登记纸质归档
 		// Process_1669271524486 报销审批
 		// Process_1669275081328 发票申请
-		// Process_1693819615497 发票申请(旧)
 		// Process_1669275380218 发票作废
 		// Process_1672738002595 发起通知
 		// Process_1662628133027 评估-合同登记新建
@@ -696,7 +705,6 @@ export default {
 				this.procDefId.includes('Process_1669700915383') ||
 				this.procDefId.includes('Process_1669271524486') ||
 				this.procDefId.includes('Process_1669275081328') ||
-				this.procDefId.includes('Process_1693819615497') ||
 				this.procDefId.includes('Process_1669275380218') ||
 				this.procDefId.includes('Process_1672738002595') ||
 				this.procDefId.includes('Process_1662628133027') ||
@@ -991,13 +999,13 @@ export default {
 				}
 				// eslint-disable-next-line no-unused-vars
 				this.$refs.form.agreeForm(
-					(businessTable, businessId, inputForm) => {
+					(businessTable, businessId, inputForm,recordType) => {
 						if (this.commonJS.isNotEmpty(inputForm)) {
 							if (this.commonJS.isNotEmpty(inputForm.assignee)) {
 								this.auditForm.assignee = inputForm.assignee
 							}
 						}
-						vars = { ...vars, ...inputForm }
+						vars = { ...vars, ...inputForm,recordType }
 						taskService
 							.audit({
 								taskId: this.taskId,
@@ -1007,6 +1015,7 @@ export default {
 								vars: vars,
 								comment: this.auditForm,
 								assignee: this.auditForm.assignee,
+								recordType:recordType
 							})
 							.then((data) => {
 								this.$message.success("提交成功");
@@ -1093,7 +1102,7 @@ export default {
 				case "_flow_start": // 自动流程
 					this.start(vars);
 					break;
-				case "_flow_save": // 保存草稿
+				case "_flow_save": // 草稿
 					this.save();
 					break;
 				case "_flow_agree": // 同意