sangwenwei 1 vuosi sitten
vanhempi
commit
552a592ba3
2 muutettua tiedostoa jossa 317 lisäystä ja 1 poistoa
  1. 306 0
      src/views/flowable/task/TodoDia.vue
  2. 11 1
      src/views/flowable/task/TodoList.vue

+ 306 - 0
src/views/flowable/task/TodoDia.vue

@@ -0,0 +1,306 @@
+<template>
+	<div>
+		<el-dialog
+			:title="title"
+			:close-on-click-modal="false"
+			dialogDrag
+			width="300px"
+			append-to-body
+			height="auto"
+			@close="close"
+			@keyup.enter.native="getWorkClient"
+			v-model="visibleChoose">
+			<template #footer>
+				<el-button size="primary" type="primary" v-if="method != 'view'" @click="todo('1')"
+						   icon="el-icon-circle-check" 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>
+			</template>
+		</el-dialog>
+		<TaskForm ref="taskForm"></TaskForm>
+	</div>
+</template>
+
+<script>
+	import ZsReimbursementService from '@/api/zs/reimbursement/ReimbursementService'
+	import CwReimbursementApprovalService from '@/api/cw/reimbursementApproval/ReimbursementApprovalService'
+	import ZxReimbursementService from '@/api/consultancy/reimbursement/ReimbursementService'
+	import XmReimbursementService from '@/api/ccpm/reimbursement/ReimbursementService'
+	import CommonApi from '@/api/cw/common/CommonApi'
+	import taskService from "@/api/flowable/taskService";
+	// import pick from "lodash.pick";
+
+	export default {
+		data() {
+			return {
+				title: '',
+				method: '',
+				visibleChoose: false,
+				loading: false,
+				tablePage: {
+					total: 0,
+					currentPage: 1,
+					pageSize: 10,
+					orders: []
+				},
+				dataList: [],
+				inputForm: {
+					type: ''
+				},
+				procId: '',
+				pre: '',
+				id: '',
+				taskFormData: [],
+				auditForm: {
+					message: "",
+					type: "",
+					status: "",
+					userIds: null,
+					assignee: null,
+				},
+			}
+		},
+		ZsReimbursementService: null,
+		CwReimbursementApprovalService: null,
+		ZxReimbursementService: null,
+		XmReimbursementService: null,
+		commonApi: null,
+		created() {
+			this.zsReimbursementService = new ZsReimbursementService()
+			this.cwReimbursementApprovalService = new CwReimbursementApprovalService()
+			this.zxReimbursementService = new ZxReimbursementService()
+			this.xmReimbursementService = new XmReimbursementService()
+			this.commonApi = new CommonApi()
+		},
+		components: {
+			//以注册未使用过
+			/*      SelectUserTree,
+				  InputNumber*/
+		},
+		methods: {
+			init(info) {
+				this.inputForm = {
+					type: ''
+				}
+				this.title = '批量审核'
+				this.visibleChoose = true
+				this.dataList = info
+				this.loading = false
+			},
+			// 表单提交
+			async todo(type) {
+				this.loading = true
+				//同意
+				if (type === '1') {
+					for (let i = 0; i < this.dataList.length; i++) {
+						//根据流程名称获取租户
+						let dataInfo = this.dataList[i]
+						this.id = ''
+						this.procId = dataInfo.task.processInstanceId
+						this.inputForm.type = '2'
+						await taskService
+							.getTaskDef({
+								taskId: dataInfo.task.id,
+								taskName: dataInfo.task.name,
+								taskDefKey: dataInfo.task.taskDefinitionKey,
+								procInsId: dataInfo.task.processInstanceId,
+								procDefId: dataInfo.task.processDefinitionId,
+								procDefKey: dataInfo.task.processDefKey,
+								status: dataInfo.status,
+							})
+							.then(async (data) => {
+								this.id = data.businessId
+								this.auditForm.status = 'agree'
+								data = {...data, agree: true}
+								await taskService
+									.audit({
+										taskId: dataInfo.task.id,
+										taskDefKey: dataInfo.task.taskDefinitionKey,
+										procInsId: dataInfo.task.processInstanceId,
+										procDefId: dataInfo.task.processDefinitionId,
+										vars: data,
+										comment: this.auditForm,
+										assignee: this.auditForm.assignee,
+										recordType: ''
+									})
+									.then(async (data) => {
+										this.$message.success("提交成功");
+										this.pre = dataInfo.processDefinitionName.substring(0, dataInfo.processDefinitionName.lastIndexOf("-"))
+										if (this.commonJS.isNotEmpty(dataInfo.task.name)) {
+											if (dataInfo.task.name === '所长报销审核人') {
+												this.inputForm.type = '5'
+											}
+											if (dataInfo.task.name === '所长审批') {
+												this.inputForm.type = '5'
+											}
+											if (dataInfo.task.name === '总经办人员审批') {
+												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)
+												}
+											})
+
+										} 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 {
+					for (let i = 0; i < this.dataList.length; i++) {
+						//根据流程名称获取租户
+						let dataInfo = this.dataList[i]
+						this.id = ''
+						await taskService
+							.getTaskDef({
+								taskId: dataInfo.task.id,
+								taskName: dataInfo.task.name,
+								taskDefKey: dataInfo.task.taskDefinitionKey,
+								procInsId: dataInfo.task.processInstanceId,
+								procDefId: dataInfo.task.processDefinitionId,
+								procDefKey: dataInfo.task.processDefKey,
+								status: dataInfo.status,
+							})
+							.then(async (data) => {
+								this.id = data.businessId
+								this.auditForm.status = 'reject'
+								data = {...data, agree: false}
+								await taskService
+									.audit({
+										taskId: dataInfo.task.id,
+										taskDefKey: dataInfo.task.taskDefinitionKey,
+										procInsId: dataInfo.task.processInstanceId,
+										procDefId: dataInfo.task.processDefinitionId,
+										vars: data,
+										comment: this.auditForm,
+										assignee: this.auditForm.assignee,
+										recordType: ''
+									})
+									.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)
+												}
+											})
+
+										} 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)
+												}
+											})
+										}
+										this.$message.success("提交成功");
+									})
+
+							})
+
+					}
+				}
+				this.close()
+				this.$emit('refreshDataList')
+			},
+			close() {
+				// this.$refs.searchForm.resetFields()
+				this.visibleChoose = false
+			},
+		}
+	}
+</script>
+<style scoped>
+	/deep/ .el-dialog__body {
+		padding-top: 0;
+	}
+
+	/deep/ .el-form-item--mini.el-form-item, .el-form-item--small.el-form-item {
+		margin-bottom: 0px;
+	}
+</style>

+ 11 - 1
src/views/flowable/task/TodoList.vue

@@ -52,6 +52,9 @@
 				print
 				custom
 			>
+				<template #buttons>
+					<el-button v-if="hasPermission('approval:info:edit')"  type="primary" icon="el-icon-plus" @click="approval()" :disabled="$refs.todoTable && $refs.todoTable.getCheckboxRecords().length === 0">批量审核(所长,总经办报销)</el-button>
+				</template>
 				<template #tools>
 					<vxe-button
 						type="text"
@@ -177,6 +180,7 @@
 			ref="userSelect2"
 			@doSubmit="selectUser">
 		</user-select2>
+		<TodoDia ref="todoDia" @refreshDataList="refreshList"></TodoDia>
 	</div>
 </template>
 
@@ -186,6 +190,7 @@ import pick from "lodash.pick";
 import UserSelect from "@/components/userSelect/UserSelectDialog";
 import taskService from "@/api/flowable/taskService";
 import UserSelect2 from '@/components/userSelect2/UserSelectDialog';
+import TodoDia from "./TodoDia";
 export default {
 	data() {
 		return {
@@ -227,7 +232,8 @@ export default {
 	},
 	components: {
 		UserSelect,
-		UserSelect2
+		UserSelect2,
+		TodoDia
 		// FlowChart
 	},
 	watch: {
@@ -383,6 +389,10 @@ export default {
 		selectUser(user){
 			console.log(user[0].name)
 			this.searchForm.assigneeId=user[0].name
+		},
+		approval(){
+			let info=this.$refs.todoTable.getCheckboxRecords()
+			this.$refs.todoDia.init(info)
 		}
 
 	},