mirror of
https://github.com/FatttSnake/Pinnacle-OA.git
synced 2026-04-06 07:21:24 +08:00
modify AffairController
This commit is contained in:
@@ -39,6 +39,16 @@ public class AffairController {
|
|||||||
return ResponseResult.build(ResponseCode.DATABASE_SAVE_OK, "success", affairService.save(affair));
|
return ResponseResult.build(ResponseCode.DATABASE_SAVE_OK, "success", affairService.save(affair));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/add/getUser")
|
||||||
|
public ResponseResult getUser() {
|
||||||
|
List<User> userList = (List<User>)userController.getAllUser().getData();
|
||||||
|
return ResponseResult.build(ResponseCode.DATABASE_SELECT_OK,"success",userList);
|
||||||
|
}//获取数据库中所有用户
|
||||||
|
|
||||||
|
@GetMapping("/add/getCurrentUser")
|
||||||
|
public ResponseResult getCurrentUser() {
|
||||||
|
return ResponseResult.build(ResponseCode.DATABASE_SELECT_OK,"success",WebUtil.getLoginUser().getUser());
|
||||||
|
}//获取当前用户
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,16 +6,16 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<!-- <el-form-item label="申请者:">-->
|
<el-form-item label="申请者:">
|
||||||
<!-- <el-col :span="3">-->
|
<el-col :span="3">
|
||||||
<!-- <el-input-->
|
<el-input
|
||||||
<!-- v-model="form.applicantId"-->
|
v-model="form.applicantId"
|
||||||
<!-- class="shortInput"-->
|
class="shortInput"
|
||||||
<!-- disabled-->
|
disabled
|
||||||
<!-- :placeholder="currentUser.username"-->
|
:placeholder="currentUser.username"
|
||||||
<!-- />-->
|
/>
|
||||||
<!-- </el-col>-->
|
</el-col>
|
||||||
<!-- </el-form-item>-->
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="审批者:">
|
<el-form-item label="审批者:">
|
||||||
<el-col :span="4">
|
<el-col :span="4">
|
||||||
@@ -109,22 +109,6 @@ export default {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// created: {
|
|
||||||
// // request(form) {
|
|
||||||
// // post("localhost:8686/addAffairs",
|
|
||||||
// // {
|
|
||||||
// // affairsName: form.affairsName,
|
|
||||||
// // Applicants: form.Applicants,
|
|
||||||
// // Approver: form.Approver,
|
|
||||||
// // affairsType: form.affairsType,
|
|
||||||
// // Date: form.Date,
|
|
||||||
// // Time: form.Time,
|
|
||||||
// // affairsContent: form.affairsContent
|
|
||||||
// // },
|
|
||||||
// // )
|
|
||||||
// // get("localhost:8686/addAffairs")
|
|
||||||
// // }
|
|
||||||
// },
|
|
||||||
methods: {
|
methods: {
|
||||||
onSubmit: function (form) {
|
onSubmit: function (form) {
|
||||||
this.form.applicantId = this.currentUser.id
|
this.form.applicantId = this.currentUser.id
|
||||||
@@ -205,23 +189,22 @@ export default {
|
|||||||
.catch((reportError) => {
|
.catch((reportError) => {
|
||||||
console.log(reportError)
|
console.log(reportError)
|
||||||
}) // 数据库中获取用户
|
}) // 数据库中获取用户
|
||||||
|
},
|
||||||
|
getCurrentUser() {
|
||||||
|
request
|
||||||
|
.get('http://localhost:8621/affair/add/getCurrentUser')
|
||||||
|
.then((response) => {
|
||||||
|
this.currentUser = response.data.data
|
||||||
|
})
|
||||||
|
.catch((reportError) => {
|
||||||
|
console.log(reportError)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
// ,
|
|
||||||
// getCurrentUser() {
|
|
||||||
// request
|
|
||||||
// .get('http://localhost:8621/affair/add/getCurrentUser')
|
|
||||||
// .then((response) => {
|
|
||||||
// this.currentUser = response.data.data
|
|
||||||
// })
|
|
||||||
// .catch((reportError) => {
|
|
||||||
// console.log(reportError)
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.alarm()
|
this.alarm()
|
||||||
this.getUser()
|
this.getUser()
|
||||||
// this.getCurrentUser()
|
this.getCurrentUser()
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.$nextTick(function () {
|
this.$nextTick(function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user