|
@@ -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>
|