sangwenwei пре 1 година
родитељ
комит
87769ff139
1 измењених фајлова са 151 додато и 104 уклоњено
  1. 151 104
      src/views/flowable/task/TodoDia.vue

+ 151 - 104
src/views/flowable/task/TodoDia.vue

@@ -10,13 +10,16 @@
 			@close="close"
 			@keyup.enter.native="getWorkClient"
 			v-model="visibleChoose">
+			<el-icon style="color: #E6A23C;size:20px"><Warning /></el-icon>是否进行批量审核
 			<template #footer>
-				<el-button size="primary" type="primary" v-if="method != 'view'" @click="todo('1')"
-						   icon="el-icon-circle-check" v-noMoreClick>同意
+				<div class="dialog-footer">
+				<el-button  @click="todo('1')"
+						   v-noMoreClick>同意
 				</el-button>
-				<el-button size="primary" type="warning" v-if="method != 'view'" @click="todo('0')"
-						   icon="el-icon-circle-check" v-noMoreClick>驳回
+				<el-button size="primary" type="paimary"  @click="todo('0')"
+						   v-noMoreClick>驳回
 				</el-button>
+				</div>
 			</template>
 		</el-dialog>
 		<TaskForm ref="taskForm"></TaskForm>
@@ -30,6 +33,7 @@
 	import XmReimbursementService from '@/api/ccpm/reimbursement/ReimbursementService'
 	import CommonApi from '@/api/cw/common/CommonApi'
 	import taskService from "@/api/flowable/taskService";
+	import PgReimbursementService from '@/api/sys/ReimbursementService'
 	// import pick from "lodash.pick";
 
 	export default {
@@ -60,6 +64,10 @@
 					userIds: null,
 					assignee: null,
 				},
+				bxList:['咨询-所长报销-电子发票','咨询-所长报销','咨询-总经办报销','咨询-报销审批-电子发票','咨询-报销审批','项目-总经办报销','中审-总经办报销',
+				'评估-总经办报销','会计-总经办报销','项目-报销审批-电子发票','项目-报销审批','评估-所长报销-电子发票','评估-所长报销','中审-所长报销-电子发票',
+				'中审-所长报销','会计-所长报销','会计-所长报销-电子发票','中审-报销审批-电子发票','评估-报销审批-电子发票','会计-报销审批-电子发票','中审-报销审批',
+				'评估-报销审批','会计-报销审批']
 			}
 		},
 		ZsReimbursementService: null,
@@ -67,11 +75,13 @@
 		ZxReimbursementService: null,
 		XmReimbursementService: null,
 		commonApi: null,
+		PgReimbursementService:null,
 		created() {
 			this.zsReimbursementService = new ZsReimbursementService()
 			this.cwReimbursementApprovalService = new CwReimbursementApprovalService()
 			this.zxReimbursementService = new ZxReimbursementService()
 			this.xmReimbursementService = new XmReimbursementService()
+			this.pgReimbursementService = new PgReimbursementService()
 			this.commonApi = new CommonApi()
 		},
 		components: {
@@ -98,6 +108,7 @@
 						//根据流程名称获取租户
 						let dataInfo = this.dataList[i]
 						this.id = ''
+						let total=this.dataList.length
 						this.procId = dataInfo.task.processInstanceId
 						this.inputForm.type = '2'
 						await taskService
@@ -126,7 +137,11 @@
 										recordType: ''
 									})
 									.then(async (data) => {
-										this.$message.success("提交成功");
+										console.log('total',total)
+										if ((i+1) === total){
+											this.$message.success("提交成功");
+										}
+										console.log('list',this.bxList)
 										this.pre = dataInfo.processDefinitionName.substring(0, dataInfo.processDefinitionName.lastIndexOf("-"))
 										if (this.commonJS.isNotEmpty(dataInfo.task.name)) {
 											if (dataInfo.task.name === '所长报销审核人') {
@@ -139,57 +154,72 @@
 												this.inputForm.type = '5'
 											}
 										}
-										if (this.pre === '中审') {
-											await this.zsReimbursementService.findById(this.id).then(async (data) => {
-												if (data.type !== '2') {
-													this.$message.error('数据已发生改变或不存在,请刷新数据')
-												} else {
-													let param = {type: this.inputForm.type, id: data.id}
-													await this.zsReimbursementService.updateStatusById(param).then(() => {
-														// callback()
-													})
-													// this.reimbursementService.updateStatusById(this.inputForm)
-												}
-											})
-										} else if (this.pre === '会计') {
-											await this.cwReimbursementApprovalService.findById(this.id).then(async (data) => {
-												if (data.type !== '2') {
-													this.$message.error('数据已发生改变或不存在,请刷新数据')
-												} else {
-													let param = {type: this.inputForm.type, id: data.id}
-													await this.cwReimbursementApprovalService.updateStatusById(param).then(() => {
-														this.loading = false
-														// callback()
-													})
-													// this.reimbursementService.updateStatusById(this.inputForm)
-												}
-											})
-										} else if (this.pre === '咨询') {
-											await this.zxReimbursementService.findById(this.id).then(async (data) => {
-												if (data.type !== '2') {
-													this.$message.error('数据已发生改变或不存在,请刷新数据')
-												} else {
-													let param = {type: this.inputForm.type, id: data.id}
-													await this.zxReimbursementService.updateStatusById(param).then(() => {
-														// callback()
-													})
-													// this.reimbursementService.updateStatusById(this.inputForm)
-												}
-											})
+										if (this.bxList.includes(dataInfo.processDefinitionName)){
+											if (this.pre === '中审') {
+												await this.zsReimbursementService.findById(this.id).then(async (data) => {
+													if (data.type !== '2') {
+														this.$message.error('数据已发生改变或不存在,请刷新数据')
+													} else {
+														let param = {type: this.inputForm.type, id: data.id}
+														await this.zsReimbursementService.updateStatusById(param).then(() => {
+															// callback()
+														})
+														// this.reimbursementService.updateStatusById(this.inputForm)
+													}
+												})
+											} else if (this.pre === '会计') {
+												await this.cwReimbursementApprovalService.findById(this.id).then(async (data) => {
+													if (data.type !== '2') {
+														this.$message.error('数据已发生改变或不存在,请刷新数据')
+													} else {
+														let param = {type: this.inputForm.type, id: data.id}
+														await this.cwReimbursementApprovalService.updateStatusById(param).then(() => {
+															this.loading = false
+															// callback()
+														})
+														// this.reimbursementService.updateStatusById(this.inputForm)
+													}
+												})
+											} else if (this.pre === '咨询') {
+												await this.zxReimbursementService.findById(this.id).then(async (data) => {
+													if (data.type !== '2') {
+														this.$message.error('数据已发生改变或不存在,请刷新数据')
+													} else {
+														let param = {type: this.inputForm.type, id: data.id}
+														await this.zxReimbursementService.updateStatusById(param).then(() => {
+															// callback()
+														})
+														// this.reimbursementService.updateStatusById(this.inputForm)
+													}
+												})
 
-										} else if (this.pre === '项目') {
-											await this.xmReimbursementService.findById(this.id).then(async (data) => {
-												if (data.type !== '2') {
-													this.$message.error('数据已发生改变或不存在,请刷新数据')
-												} else {
-													let param = {type: this.inputForm.type, id: data.id}
-													await this.xmReimbursementService.updateStatusById(param).then(() => {
-														// callback()
-													})
-													// this.reimbursementService.updateStatusById(this.inputForm)
-												}
-											})
+											} else if (this.pre === '项目') {
+												await this.xmReimbursementService.findById(this.id).then(async (data) => {
+													if (data.type !== '2') {
+														this.$message.error('数据已发生改变或不存在,请刷新数据')
+													} else {
+														let param = {type: this.inputForm.type, id: data.id}
+														await this.xmReimbursementService.updateStatusById(param).then(() => {
+															// callback()
+														})
+														// this.reimbursementService.updateStatusById(this.inputForm)
+													}
+												})
+											}else if (this.pre === '评估'){
+												await this.pgReimbursementService.findById(this.inputForm.id).then(async (data)=>{
+													if (data.type !== '2') {
+														this.$message.error('数据已发生改变或不存在,请刷新数据')
+													} else {
+														let param = {type: this.inputForm.type, id: data.id}
+														await this.pgReimbursementService.updateStatusById(param).then(() => {
+															// callback()
+														})
+														// this.reimbursementService.updateStatusById(this.inputForm)
+													}
+												})
+											}
 										}
+
 									})
 							});
 
@@ -199,6 +229,7 @@
 						//根据流程名称获取租户
 						let dataInfo = this.dataList[i]
 						this.id = ''
+						let total=this.dataList.length
 						await taskService
 							.getTaskDef({
 								taskId: dataInfo.task.id,
@@ -227,58 +258,74 @@
 									.then(async (data) => {
 										this.pre = dataInfo.processDefinitionName.substring(0, dataInfo.processDefinitionName.lastIndexOf("-"))
 										// await setTimeout(this.updateStatusById("reject"),2000)
-										if (this.pre === '中审') {
-											this.zsReimbursementService.findById(this.id).then((data) => {
-												if (data.type !== '2') {
-													this.$message.error('数据已发生改变或不存在,请刷新数据')
-												} else {
-													let param = {type: '4', id: data.id}
-													this.zsReimbursementService.updateStatusById(param).then(() => {
-														// callback()
-													})
-													// this.reimbursementService.updateStatusById(this.inputForm)
-												}
-											})
-										} else if (this.pre === '会计') {
-											this.cwReimbursementApprovalService.findById(this.id).then((data) => {
-												if (data.type !== '2') {
-													this.$message.error('数据已发生改变或不存在,请刷新数据')
-												} else {
-													let param = {type: '4', id: data.id}
-													this.cwReimbursementApprovalService.updateStatusById(param).then(() => {
-														this.loading = false
-														// callback()
-													})
-													// this.reimbursementService.updateStatusById(this.inputForm)
-												}
-											})
-										} else if (this.pre === '咨询') {
-											this.zxReimbursementService.findById(this.id).then((data) => {
-												if (data.type !== '2') {
-													this.$message.error('数据已发生改变或不存在,请刷新数据')
-												} else {
-													let param = {type: '4', id: data.id}
-													this.zxReimbursementService.updateStatusById(param).then(() => {
-														// callback()
-													})
-													// this.reimbursementService.updateStatusById(this.inputForm)
-												}
-											})
+										if (this.bxList.includes(dataInfo.processDefinitionName)){
+											if (this.pre === '中审') {
+												this.zsReimbursementService.findById(this.id).then((data) => {
+													if (data.type !== '2') {
+														this.$message.error('数据已发生改变或不存在,请刷新数据')
+													} else {
+														let param = {type: '4', id: data.id}
+														this.zsReimbursementService.updateStatusById(param).then(() => {
+															// callback()
+														})
+														// this.reimbursementService.updateStatusById(this.inputForm)
+													}
+												})
+											} else if (this.pre === '会计') {
+												this.cwReimbursementApprovalService.findById(this.id).then((data) => {
+													if (data.type !== '2') {
+														this.$message.error('数据已发生改变或不存在,请刷新数据')
+													} else {
+														let param = {type: '4', id: data.id}
+														this.cwReimbursementApprovalService.updateStatusById(param).then(() => {
+															this.loading = false
+															// callback()
+														})
+														// this.reimbursementService.updateStatusById(this.inputForm)
+													}
+												})
+											} else if (this.pre === '咨询') {
+												this.zxReimbursementService.findById(this.id).then((data) => {
+													if (data.type !== '2') {
+														this.$message.error('数据已发生改变或不存在,请刷新数据')
+													} else {
+														let param = {type: '4', id: data.id}
+														this.zxReimbursementService.updateStatusById(param).then(() => {
+															// callback()
+														})
+														// this.reimbursementService.updateStatusById(this.inputForm)
+													}
+												})
 
-										} else if (this.pre === '项目') {
-											this.xmReimbursementService.findById(this.id).then((data) => {
-												if (data.type !== '2') {
-													this.$message.error('数据已发生改变或不存在,请刷新数据')
-												} else {
-													let param = {type: '4', id: data.id}
-													this.xmReimbursementService.updateStatusById(param).then(() => {
-														// callback()
-													})
-													// this.reimbursementService.updateStatusById(this.inputForm)
-												}
-											})
+											} else if (this.pre === '项目') {
+												this.xmReimbursementService.findById(this.id).then((data) => {
+													if (data.type !== '2') {
+														this.$message.error('数据已发生改变或不存在,请刷新数据')
+													} else {
+														let param = {type: '4', id: data.id}
+														this.xmReimbursementService.updateStatusById(param).then(() => {
+															// callback()
+														})
+														// this.reimbursementService.updateStatusById(this.inputForm)
+													}
+												})
+											}else if (this.pre === '评估'){
+												await this.pgReimbursementService.findById(this.inputForm.id).then(async (data)=>{
+													if (data.type !== '2') {
+														this.$message.error('数据已发生改变或不存在,请刷新数据')
+													} else {
+														let param = {type: this.inputForm.type, id: data.id}
+														await this.pgReimbursementService.updateStatusById(param).then(() => {
+															// callback()
+														})
+														// this.reimbursementService.updateStatusById(this.inputForm)
+													}
+												})
+											}
+										}
+										if ((i+1) === total){
+											this.$message.success("提交成功");
 										}
-										this.$message.success("提交成功");
 									})
 
 							})