sangwenwei преди 1 година
родител
ревизия
ed65a84ccb

+ 6 - 0
src/api/sys/userService.js

@@ -133,6 +133,12 @@ export default {
 			method: "get",
 		});
 	},
+	isKjsz:function() {
+		return request({
+			url: prefix + "/sys/user/isKjsz",
+			method: "get",
+		});
+	},
 
 	queryDetailList(ids) {
 		return request({

+ 70 - 24
src/views/cw/reimbursementApproval/info/InfoList.vue

@@ -272,7 +272,8 @@
           orders: []
         },
         loading: false,
-        isAdmin: false
+        isAdmin: false,
+		  isKjsz:false
       }
     },
     reimbursementApprovalService: null,
@@ -308,7 +309,7 @@
       },
       user () {
         this.create = this.$store.state.user.id
-        console.log('createId', this.create)
+        console.log('createId', this.$store.state.user)
         return this.$store.state.user
       }
     },
@@ -330,33 +331,65 @@
           this.isAdmin = data
         })
       },
+		//查询当前用户是否是会计所长
+		checkIsKjsz(){
+      	userService.isKjsz().then((data)=>{
+      		this.isKjsz = data
+			console.log('this.isKjsz',this.isKjsz)
+		})
+		},
       viewContract (id) {
         this.$refs.contractNameForm.init('view', id)
       },
       // 新增
       add () {
-        // 读取流程表单
-        let tabTitle = `发起流程【会计-报销审批】`
-        let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [会计-报销审批]`
-        taskService.getTaskDef({ procDefId: this.processDefinitionId,
-          status: 'startAndHold'}).then((data) => {
-            this.$router.push({
-              path: '/flowable/task/TaskForm',
-              query: {
-                ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title'),
-                procDefId: this.processDefinitionId,
-                procDefKey: this.procDefKey,
-                status: 'startAndHold',
-                title: tabTitle,
-                formType: data.formType,
-                formUrl: data.formUrl,
-                formTitle: processTitle,
-                businessId: 'false',
-                isShow: false,
-                routePath: '/cw/reimbursementApproval/info/InfoList'
-              }
-            })
-          })
+		  // 读取流程表单
+		  let tabTitle = `发起流程【会计-报销审批】`
+		  let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [会计-报销审批]`
+      	//当前用户是否是会计所长
+		  if (this.isKjsz){
+			  taskService.getTaskDef({ procDefId: this.processDefinitionIdSzbx,
+				  status: 'startAndHold'}).then((data) => {
+				  this.$router.push({
+					  path: '/flowable/task/TaskForm',
+					  query: {
+						  ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title'),
+						  procDefId: this.processDefinitionIdSzbx,
+						  procDefKey: this.procDefKeySzbx,
+						  status: 'startAndHold',
+						  title: tabTitle,
+						  formType: data.formType,
+						  formUrl: data.formUrl,
+						  formTitle: processTitle,
+						  businessId: 'false',
+						  isShow: false,
+						  routePath: '/cw/reimbursementApproval/info/InfoList'
+					  }
+				  })
+			  })
+		  }else {
+			  taskService.getTaskDef({ procDefId: this.processDefinitionId,
+				  status: 'startAndHold'}).then((data) => {
+				  this.$router.push({
+					  path: '/flowable/task/TaskForm',
+					  query: {
+						  ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title'),
+						  procDefId: this.processDefinitionId,
+						  procDefKey: this.procDefKey,
+						  status: 'startAndHold',
+						  title: tabTitle,
+						  formType: data.formType,
+						  formUrl: data.formUrl,
+						  formTitle: processTitle,
+						  businessId: 'false',
+						  isShow: false,
+						  routePath: '/cw/reimbursementApproval/info/InfoList'
+					  }
+				  })
+			  })
+		  }
+
+
       },
       // 修改
       edit (row) {
@@ -438,6 +471,7 @@
           this.loading = false
         })
         this.checkIsAdmin()
+	  	this.checkIsKjsz()
         processService.getByName('会计-报销审批').then((data) => {
           if (!this.commonJS.isEmpty(data.id)) {
             this.processDefinitionId = data.id
@@ -450,6 +484,15 @@
 				  this.procDefKeyInvoice = data.key
 			  }
 		  })
+
+		  processService.getByName('会计-所长报销').then((data) => {
+		  	console.log('data',data)
+			  if (!this.commonJS.isEmpty(data.id)) {
+				  this.processDefinitionIdSzbx = data.id
+				  this.procDefKeySzbx = data.key
+			  }
+		  })
+
       },
       // 删除
       del (id) {
@@ -483,6 +526,9 @@
 					this.procDefId = this.processDefinitionId
 				}
 			}
+			if (this.isKjsz){
+				this.procDefId = this.processDefinitionIdSzbx
+			}
           taskService.getTaskDef({
             procInsId: row.procInsId,
 			  procDefId: this.procDefId

+ 22 - 4
src/views/cw/reimbursementApproval/info/ReimbursementForm.vue

@@ -801,6 +801,7 @@
   // import MaterialManagementService from '@/api/materialManagement/MaterialManagementService'
   // import MaterialManagementDialog from '../../../materialManagement/file/MaterialManagementDialog'
   import ProjectListForm from './ProgramForm'
+  import userService from '@/api/sys/UserService'
   export default {
     props: {
       businessId: {
@@ -920,7 +921,8 @@
         },
         keyWatch: '',
         amountKey: '',
-		  invoiceReimbursementKey: ''
+		  invoiceReimbursementKey: '',
+		  isKjsz:false
       }
     },
 	  provide() {
@@ -1087,6 +1089,9 @@
             this.$refs.invoiceReimbursementUpLoadComponent.newUpload(method, [], 'reimbursement')
 			  this.$refs.uploadComponent.newUpload(method, [], 'reimbursement')
           }
+			userService.isKjsz().then((data)=>{
+				this.isKjsz = data
+			})
 
         })
       },
@@ -1464,6 +1469,14 @@
 				  describe = `[会计-报销审批-电子发票]`
 			  }
 		  }
+		  if (this.isKjsz){
+			   await processService.getByName('会计-所长报销').then((data) => {
+				  if (!this.commonJS.isEmpty(data.id)) {
+					  this.inputForm.procDefId = data.id
+					  this.inputForm.procDefKey = data.key
+				  }
+			  })
+		  }
         this.$refs['inputForm'].validate(async (valid) => {
           if (valid) {
             this.loading = true
@@ -1577,10 +1590,15 @@
 				  this.inputForm.files = this.$refs.uploadComponent.getDataList()
                 this.commonApi.getTaskNameByProcInsId(this.inputForm.procInsId).then((data) => {
                   if (this.commonJS.isNotEmpty(data)) {
-                    if (data === '公司领导审批') {
-                      this.inputForm.type = '5'
-                    }
+						  if (data === '所长报销审核人') {
+							  this.inputForm.type = '5'
+						  }
+						  if (data === '公司领导审批') {
+							  this.inputForm.type = '5'
+						  }
+
                   }
+					console.log('this.inputForm',this.inputForm)
                   this.reimbursementApprovalService.save(this.inputForm).then((data) => {
                     callback(data.businessTable, data.businessId, this.inputForm)
                     this.loading = false

+ 3 - 2
src/views/flowable/task/TaskForm.vue

@@ -739,7 +739,7 @@ export default {
 		// Process_1702005929963 完善个人信息
 		// Process_1702369424692 会计-报告号申请
 		// Process_1670486210440 会计-报告号复核
-
+		// Process_1704851888818 会计-所长报销
 		// 驳回
 		reject(vars) {
 			if (this.procDefId.includes('Process_1667978088459') ||
@@ -799,7 +799,8 @@ export default {
 				this.procDefId.includes('Process_1701829547129') ||
 				this.procDefId.includes('Process_1702005929963') ||
 				this.procDefId.includes('Process_1702369424692') ||
-				this.procDefId.includes('Process_1670486210440')
+				this.procDefId.includes('Process_1670486210440') ||
+				this.procDefId.includes('Process_1704851888818')
 			) {
 				console.log('进入新版驳回')
 				this.$confirm(`确定驳回流程吗?`, '提示', {