mirror of
https://github.com/FatttSnake/Pinnacle-OA.git
synced 2026-04-04 22:41:24 +08:00
add personAffairs model and solve warning
This commit is contained in:
@@ -27,64 +27,70 @@ import java.util.List;
|
||||
public class AffairController {
|
||||
@Autowired
|
||||
IAffairService affairService;
|
||||
// IUserService userService;
|
||||
// 不用userService的方法了,userController中已经写好了直接拿来用
|
||||
// IUserService userService;
|
||||
// 不用userService的方法了,userController中已经写好了直接拿来用
|
||||
@Autowired
|
||||
UserController userController;
|
||||
UserController userController;
|
||||
|
||||
|
||||
@PostMapping("/add")
|
||||
public ResponseResult addAffair(@RequestBody Affair affair) {
|
||||
public ResponseResult<Boolean> addAffair(@RequestBody Affair affair) {
|
||||
return ResponseResult.build(ResponseCode.DATABASE_SAVE_OK, "success", affairService.save(affair));
|
||||
}
|
||||
|
||||
@GetMapping("/add/getUser")
|
||||
public ResponseResult getUser() {
|
||||
@GetMapping("/add/get_user")
|
||||
public ResponseResult<List<User>> getUser() {
|
||||
List<User> userList = userController.getAllUser().getData();
|
||||
return ResponseResult.build(ResponseCode.DATABASE_SELECT_OK,"success",userList);
|
||||
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());
|
||||
@GetMapping("/add/get_current_user")
|
||||
public ResponseResult<User> getCurrentUser() {
|
||||
return ResponseResult.build(ResponseCode.DATABASE_SELECT_OK, "success", WebUtil.getLoginUser().getUser());
|
||||
}//获取当前用户
|
||||
|
||||
|
||||
|
||||
|
||||
@GetMapping("/NotApproved")
|
||||
public ResponseResult select_NotApproved() {
|
||||
@GetMapping("/personal_affairs")
|
||||
public ResponseResult<List<Affair>> getPersonalAffairs() {
|
||||
LambdaQueryWrapper<Affair> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(Affair::getStatus, 0).eq(Affair::getInspectorId,WebUtil.getLoginUser().getUser().getId());
|
||||
wrapper.eq(Affair::getApplicantId, WebUtil.getLoginUser().getUser().getId());
|
||||
wrapper.orderByDesc(Affair::getCreateTime);
|
||||
return ResponseResult.build(ResponseCode.DATABASE_SELECT_OK, "success", affairService.list(wrapper));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/Approved")
|
||||
public ResponseResult select_Approved() {
|
||||
@GetMapping("/not_approved")
|
||||
public ResponseResult<List<Affair>> selectNotApproved() {
|
||||
LambdaQueryWrapper<Affair> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(Affair::getStatus, 0).eq(Affair::getInspectorId, WebUtil.getLoginUser().getUser().getId());
|
||||
wrapper.orderByDesc(Affair::getCreateTime);
|
||||
return ResponseResult.build(ResponseCode.DATABASE_SELECT_OK, "success", affairService.list(wrapper));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/approved")
|
||||
public ResponseResult<List<Affair>> selectApproved() {
|
||||
LambdaQueryWrapper<Affair> wrapper2 = new LambdaQueryWrapper<>();
|
||||
wrapper2.ne(Affair::getStatus, 0).eq(Affair::getInspectorId,WebUtil.getLoginUser().getUser().getId());
|
||||
wrapper2.ne(Affair::getStatus, 0).eq(Affair::getInspectorId, WebUtil.getLoginUser().getUser().getId());
|
||||
wrapper2.orderByDesc(Affair::getInspectTime);
|
||||
return ResponseResult.build(ResponseCode.DATABASE_SELECT_OK, "success", affairService.list(wrapper2));
|
||||
}
|
||||
|
||||
@PutMapping("/yes")
|
||||
public ResponseResult updateAffair_yes(@RequestBody Affair affair) {
|
||||
public ResponseResult updateAffairYes(@RequestBody Affair affair) {
|
||||
System.out.println(affair);
|
||||
return ResponseResult.build(ResponseCode.DATABASE_UPDATE_OK, "success", affairService.updateAffair_Yes(affair));
|
||||
return ResponseResult.build(ResponseCode.DATABASE_UPDATE_OK, "success", affairService.updateAffairYes(affair));
|
||||
//审批同意
|
||||
}
|
||||
|
||||
@PutMapping("/no")
|
||||
public ResponseResult updateAffair_No(@RequestBody Affair affair) {
|
||||
return ResponseResult.build(ResponseCode.DATABASE_UPDATE_OK, "success", affairService.updateAffair_No(affair));
|
||||
public ResponseResult updateAffairNo(@RequestBody Affair affair) {
|
||||
return ResponseResult.build(ResponseCode.DATABASE_UPDATE_OK, "success", affairService.updateAffairNo(affair));
|
||||
//审批驳回
|
||||
}
|
||||
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseResult deleteAffair_Approved(@PathVariable Long id) {
|
||||
public ResponseResult deleteAffairApproved(@PathVariable Long id) {
|
||||
System.out.println("affair");
|
||||
return ResponseResult.build(ResponseCode.DATABASE_DELETE_OK, "success", affairService.removeById(id));
|
||||
//删除已审批事务
|
||||
|
||||
@@ -28,22 +28,21 @@ public interface AffairMapper extends BaseMapper<Affair> {
|
||||
// (是否撤回,当用户撤回新建的事务时,根据新建的事务的id,删除该条事务在数据库中的信息)
|
||||
|
||||
@Update("update t_affair set status=1,inspect_time=#{inspectTime} where id=#{id}")
|
||||
int updateAffairs_Yes(Affair affair);
|
||||
int updateAffairsYes(Affair affair);
|
||||
//管理员权限--->修改事务的状态(AffairsStatus)--->达到审批的效果
|
||||
//同意
|
||||
|
||||
@Update("update t_affair set Status=2 where id=#{id}" )
|
||||
int updateAffairs_NO(Affair affair);
|
||||
int updateAffairsNO(Affair affair);
|
||||
//不同意
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Select("SELECT t_affair.applicant_id,t_affair.inspector_id,t_user.id,t_user.username from t_affair,t_user ")
|
||||
@ResultType(Affair.class)
|
||||
List<Affair> selectAffairs_NotApproved();
|
||||
//
|
||||
// @Select("SELECT t_affair.applicant_id,t_affair.inspector_id,t_user.id,t_user.username from t_affair,t_user ")
|
||||
// @ResultType(Affair.class)
|
||||
// List<Affair> selectAffairs_NotApproved();
|
||||
|
||||
}
|
||||
|
||||
@@ -13,10 +13,10 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
*/
|
||||
public interface IAffairService extends IService<Affair> {
|
||||
|
||||
int insertAffair(Affair affair);
|
||||
int updateAffair_Yes(Affair affair);
|
||||
int updateAffair_No(Affair affair);
|
||||
// int insertAffair(Affair affair);
|
||||
int updateAffairYes(Affair affair);
|
||||
int updateAffairNo(Affair affair);
|
||||
|
||||
|
||||
int deleteAffair_ApprovedByID(Affair affair);
|
||||
// int deleteAffair_ApprovedByID(Affair affair);
|
||||
}
|
||||
|
||||
@@ -21,23 +21,15 @@ public class AffairServiceImpl extends ServiceImpl<AffairMapper, Affair> impleme
|
||||
@Autowired
|
||||
private AffairMapper affairMapper;
|
||||
|
||||
@Override
|
||||
public int insertAffair(Affair affair) {
|
||||
return affairMapper.insertAffair(affair);
|
||||
|
||||
public int updateAffairYes(Affair affair) {
|
||||
return affairMapper.updateAffairsYes(affair);
|
||||
}
|
||||
|
||||
public int updateAffair_Yes(Affair affair) {
|
||||
return affairMapper.updateAffairs_Yes(affair);
|
||||
public int updateAffairNo(Affair affair) {
|
||||
return affairMapper.updateAffairsNO(affair);
|
||||
}
|
||||
|
||||
public int updateAffair_No(Affair affair) {
|
||||
return affairMapper.updateAffairs_NO(affair);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteAffair_ApprovedByID(Affair affair) {
|
||||
return affairMapper.deleteAffairs(affair);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="申请者:">
|
||||
<el-col :span="3">
|
||||
<el-col :span="4">
|
||||
<el-input
|
||||
v-model="form.applicantId"
|
||||
class="shortInput"
|
||||
class="LongInput"
|
||||
disabled
|
||||
:placeholder="currentUser.username"
|
||||
/>
|
||||
@@ -121,7 +121,7 @@ export default {
|
||||
!_.isEmpty(form.inspectorId)
|
||||
) {
|
||||
request
|
||||
.post('http://localhost:8621/affair/add', form)
|
||||
.post('/affair/add', form)
|
||||
.then((response) => {
|
||||
console.log(response.data)
|
||||
this.resetForm()
|
||||
@@ -130,7 +130,8 @@ export default {
|
||||
this.resetForm()
|
||||
console.log(reportError)
|
||||
})
|
||||
this.$router.go()
|
||||
this.resetForm()
|
||||
// this.$router.go()
|
||||
} else {
|
||||
if (_.isEmpty(form.title)) {
|
||||
ElMessage({
|
||||
@@ -182,7 +183,7 @@ export default {
|
||||
}, // 动态时钟
|
||||
getUser() {
|
||||
request
|
||||
.get('http://localhost:8621/affair/add/getUser')
|
||||
.get('/affair/add/get_user')
|
||||
.then((response) => {
|
||||
this.users = response.data.data
|
||||
})
|
||||
@@ -192,13 +193,13 @@ export default {
|
||||
},
|
||||
getCurrentUser() {
|
||||
request
|
||||
.get('http://localhost:8621/affair/add/getCurrentUser')
|
||||
.get('/affair/add/get_current_user')
|
||||
.then((response) => {
|
||||
this.currentUser = response.data.data
|
||||
})
|
||||
.catch((reportError) => {
|
||||
console.log(reportError)
|
||||
})
|
||||
}) // 获取当前用户
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -219,9 +220,9 @@ export default {
|
||||
width: 99%;
|
||||
}
|
||||
|
||||
.shortInput {
|
||||
width: 150px;
|
||||
}
|
||||
/*.shortInput {*/
|
||||
/* width: 200px;*/
|
||||
/*}*/
|
||||
|
||||
.textarea {
|
||||
height: 70%;
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<el-row :span="24">
|
||||
<el-col :span="18">
|
||||
<div class="mt-4">
|
||||
<el-input v-model="input3" placeholder="查询事务" class="input-with-select">
|
||||
<el-input placeholder="查询事务" class="input-with-select">
|
||||
<template #prepend>
|
||||
<el-select v-model="select" placeholder="查询方式">
|
||||
<el-select placeholder="查询方式">
|
||||
<el-option label="事务编号" value="1" />
|
||||
<el-option label="事务名称" value="2" />
|
||||
<el-option label="日期" value="3" />
|
||||
@@ -43,19 +43,7 @@
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="申请者" prop="applicantId">
|
||||
<template #default="scope">
|
||||
{{
|
||||
scope.row.applicantId === 1
|
||||
? 'ggb'
|
||||
: scope.row.applicantId === 1652714496280469506
|
||||
? 'cyb'
|
||||
: scope.row.applicantId === 1654151146072145921
|
||||
? 'syf'
|
||||
: scope.row.applicantId === 1654151877520973826
|
||||
? 'gzw'
|
||||
: 'yrm'
|
||||
}}
|
||||
</template>
|
||||
<el-text v-for="(user, index) in users" :key="index" :content="user.username" />
|
||||
</el-table-column>
|
||||
<el-table-column label="提交日期" prop="createTime">
|
||||
<template #default="scope">
|
||||
@@ -117,7 +105,6 @@
|
||||
style="color: #888888"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
v-model:current-page="currentPage3"
|
||||
:page-size="100"
|
||||
layout="prev, pager, next, jumper"
|
||||
:total="1000"
|
||||
@@ -181,6 +168,18 @@ export default {
|
||||
deleted: '',
|
||||
version: ''
|
||||
}
|
||||
],
|
||||
users: [
|
||||
{
|
||||
id: '',
|
||||
username: ''
|
||||
}
|
||||
],
|
||||
currentUser: [
|
||||
{
|
||||
id: '',
|
||||
username: ''
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
@@ -188,10 +187,10 @@ export default {
|
||||
handleYes(row) {
|
||||
console.log(row)
|
||||
request
|
||||
.put('http://localhost:8621/affair/yes', row)
|
||||
.put('/affair/yes', row)
|
||||
.then((response) => {
|
||||
console.log(response.data)
|
||||
this.getApproed()
|
||||
this.getApproved()
|
||||
})
|
||||
.catch((reportError) => {
|
||||
console.log(reportError)
|
||||
@@ -200,10 +199,10 @@ export default {
|
||||
handleNo(row) {
|
||||
console.log(row)
|
||||
request
|
||||
.put('http://localhost:8621/affair/no', row)
|
||||
.put('/affair/no', row)
|
||||
.then((response) => {
|
||||
console.log(response.data)
|
||||
this.getApproed()
|
||||
this.getApproved()
|
||||
})
|
||||
.catch((reportError) => {
|
||||
console.log(reportError)
|
||||
@@ -212,25 +211,34 @@ export default {
|
||||
handleDelete(row) {
|
||||
console.log(row.id)
|
||||
request
|
||||
.delete('http://localhost:8621/affair/' + row.id)
|
||||
.delete('/affair/' + row.id)
|
||||
.then((response) => {
|
||||
console.log(response.data)
|
||||
this.getApproed()
|
||||
this.getApproved()
|
||||
})
|
||||
.catch((reportError) => {
|
||||
console.log(reportError)
|
||||
})
|
||||
},
|
||||
|
||||
getUser() {
|
||||
request
|
||||
.get('/affair/add/get_user')
|
||||
.then((response) => {
|
||||
this.users = response.data.data
|
||||
})
|
||||
.catch((reportError) => {
|
||||
console.log(reportError)
|
||||
}) // 数据库中获取用户
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
console.log(`每页 ${val} 条`)
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
console.log(`当前页: ${val}`)
|
||||
},
|
||||
getApproed() {
|
||||
getApproved() {
|
||||
request
|
||||
.get('http://localhost:8621/affair/Approved')
|
||||
.get('/affair/approved')
|
||||
.then((response) => {
|
||||
this.tableData = response.data.data
|
||||
console.log(this.tableData)
|
||||
@@ -251,8 +259,9 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getApproed()
|
||||
this.getApproved()
|
||||
this.dialogFalse()
|
||||
this.getUser()
|
||||
console.log(this.tableData)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<el-row :span="24">
|
||||
<el-col :span="18">
|
||||
<div class="mt-4">
|
||||
<el-input v-model="input3" placeholder="查询事务" class="input-with-select">
|
||||
<el-input placeholder="查询事务" class="input-with-select">
|
||||
<template #prepend>
|
||||
<el-select v-model="select" placeholder="查询方式">
|
||||
<el-select placeholder="查询方式">
|
||||
<el-option label="事务编号" value="1" />
|
||||
<el-option label="事务名称" value="2" />
|
||||
<el-option label="日期" value="3" />
|
||||
@@ -111,7 +111,6 @@
|
||||
style="color: #888888"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
v-model:current-page="currentPage3"
|
||||
:page-size="100"
|
||||
layout="prev, pager, next, jumper"
|
||||
:total="1000"
|
||||
@@ -124,7 +123,6 @@
|
||||
<script>
|
||||
import request from '@/services'
|
||||
import 'element-plus/theme-chalk/index.css'
|
||||
import _ from 'lodash'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@@ -185,10 +183,10 @@ export default {
|
||||
console.log(row)
|
||||
row.inspectTime = new Date()
|
||||
request
|
||||
.put('http://localhost:8621/affair/yes', row)
|
||||
.put('/affair/yes', row)
|
||||
.then((response) => {
|
||||
console.log(response.data)
|
||||
this.getApproed()
|
||||
this.getApproved()
|
||||
})
|
||||
.catch((reportError) => {
|
||||
console.log(reportError)
|
||||
@@ -197,10 +195,10 @@ export default {
|
||||
handleNo(row) {
|
||||
console.log(row)
|
||||
request
|
||||
.put('http://localhost:8621/affair/no', row)
|
||||
.put('/affair/no', row)
|
||||
.then((response) => {
|
||||
console.log(response.data)
|
||||
this.getApproed()
|
||||
this.getApproved()
|
||||
})
|
||||
.catch((reportError) => {
|
||||
console.log(reportError)
|
||||
@@ -213,9 +211,9 @@ export default {
|
||||
handleCurrentChange(val) {
|
||||
console.log(`当前页: ${val}`)
|
||||
}, // 标签页
|
||||
getApproed() {
|
||||
getApproved() {
|
||||
request
|
||||
.get('http://localhost:8621/affair/NotApproved')
|
||||
.get('/affair/not_approved')
|
||||
.then((response) => {
|
||||
this.tableData = response.data.data
|
||||
console.log(this.tableData)
|
||||
@@ -227,6 +225,7 @@ export default {
|
||||
format(time) {
|
||||
return new Date(time).toLocaleString()
|
||||
}, // 时间格式转换
|
||||
/*
|
||||
getDate() {
|
||||
let newTime = ''
|
||||
const date = new Date()
|
||||
@@ -239,6 +238,7 @@ export default {
|
||||
newTime = yy + '-' + mm + '-' + dd + ' ' + hh + ':' + mf + ':' + ss
|
||||
return newTime
|
||||
}, // 获取当前时间与格式转换
|
||||
*/
|
||||
dialogTure(data) {
|
||||
this.dialogVisible = true
|
||||
this.dialogData = data
|
||||
@@ -248,7 +248,7 @@ export default {
|
||||
} // 关闭弹出框
|
||||
},
|
||||
created() {
|
||||
this.getApproed()
|
||||
this.getApproved()
|
||||
this.dialogFalse()
|
||||
console.log(this.tableData)
|
||||
} // 获取事务信息
|
||||
|
||||
235
ui/src/components/personalAffairs.vue
Normal file
235
ui/src/components/personalAffairs.vue
Normal file
@@ -0,0 +1,235 @@
|
||||
<template>
|
||||
<el-row :span="24">
|
||||
<el-col :span="18">
|
||||
<div class="mt-4">
|
||||
<el-input placeholder="查询事务" class="input-with-select">
|
||||
<template #prepend>
|
||||
<el-select placeholder="查询方式">
|
||||
<el-option label="事务编号" value="1" />
|
||||
<el-option label="事务名称" value="2" />
|
||||
<el-option label="日期" value="3" />
|
||||
</el-select>
|
||||
</template>
|
||||
<template #append>
|
||||
<el-button>查询</el-button>
|
||||
</template>
|
||||
</el-input>
|
||||
</div>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="4">
|
||||
<el-button type="warning" round>待审批</el-button>
|
||||
<el-button type="success" round>已审批</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table :data="tableData" style="width: 100%">
|
||||
<el-table-column label="事务编号" prop="id" />
|
||||
|
||||
<el-table-column label="事务名称" prop="title" />
|
||||
|
||||
<el-table-column label="事务类型" prop="typeId">
|
||||
<template #default="scope">
|
||||
{{
|
||||
scope.row.typeId === 1
|
||||
? '事假'
|
||||
: scope.row.typeId === 2
|
||||
? '病假'
|
||||
: scope.row.typeId === 3
|
||||
? '财务报销'
|
||||
: '调休'
|
||||
}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="申请者" prop="applicantId">
|
||||
<template #default="scope">
|
||||
{{
|
||||
scope.row.applicantId === 1
|
||||
? 'ggb'
|
||||
: scope.row.applicantId === 1652714496280469506
|
||||
? 'cyb'
|
||||
: scope.row.applicantId === 1654151146072145921
|
||||
? 'syf'
|
||||
: scope.row.applicantId === 1654151877520973826
|
||||
? 'gzw'
|
||||
: 'yrm'
|
||||
}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="提交日期" prop="createTime">
|
||||
<template #default="scope">
|
||||
{{ format(scope.row.createTime) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="审批日期" prop="inspectTime">
|
||||
<template #default="scope">
|
||||
{{ format(scope.row.inspectTime) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" key="slot" width="180" prop="content">
|
||||
<template #default="scope">
|
||||
<el-button size="small" type="text" @click="dialogTure(scope.row)"
|
||||
>具体内容
|
||||
</el-button>
|
||||
<el-button size="small" type="danger" @click="handleDelete(scope.row)">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="审批结果" width="90" prop="status">
|
||||
<template #default="scope">
|
||||
{{ scope.row.status === 1 ? '同意' : '驳回' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<el-dialog title="详细内容" v-model="dialogVisible" width="50%" :data="dialogData" center>
|
||||
<el-row>
|
||||
<el-col :span="3"></el-col>
|
||||
<el-col :span="4">事务标题:</el-col>
|
||||
<el-col :span="17">{{ dialogData.title }}</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="3"></el-col>
|
||||
<el-col :span="4">具体内容:</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="7"></el-col>
|
||||
<el-col :span="17">{{ dialogData.content }}</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="11"></el-col>
|
||||
<el-col :span="2">
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogFalse">返 回</el-button>
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
|
||||
<el-divider :data="labelData">
|
||||
<div class="block">
|
||||
<el-pagination
|
||||
style="color: #888888"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:page-size="100"
|
||||
layout="prev, pager, next, jumper"
|
||||
:total="1000"
|
||||
>
|
||||
</el-pagination>
|
||||
</div>
|
||||
</el-divider>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import request from '@/services'
|
||||
import 'element-plus/theme-chalk/index.css'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tableData: [
|
||||
{
|
||||
id: '',
|
||||
title: '',
|
||||
content: '',
|
||||
typeId: '',
|
||||
status: '',
|
||||
applicantId: '',
|
||||
inspectorId: '',
|
||||
createTime: new Date(),
|
||||
inspectTime: new Date(),
|
||||
priority: '',
|
||||
modifyTime: '',
|
||||
originId: '',
|
||||
old: '',
|
||||
deleted: '',
|
||||
version: ''
|
||||
}
|
||||
],
|
||||
// }],
|
||||
|
||||
labelData: [
|
||||
{
|
||||
currentPage1: 5,
|
||||
currentPage2: 5,
|
||||
currentPage3: 5,
|
||||
currentPage4: 4
|
||||
}
|
||||
],
|
||||
dialogVisible: false,
|
||||
dialogData: [
|
||||
{
|
||||
id: '',
|
||||
title: '',
|
||||
content: '',
|
||||
typeId: '',
|
||||
status: '',
|
||||
applicantId: '',
|
||||
inspectorId: '',
|
||||
createTime: new Date(),
|
||||
inspectTime: new Date(),
|
||||
priority: '',
|
||||
modifyTime: '',
|
||||
originId: '',
|
||||
old: '',
|
||||
deleted: '',
|
||||
version: ''
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleDelete(row) {
|
||||
console.log(row.id)
|
||||
request
|
||||
.delete('/affair/' + row.id)
|
||||
.then((response) => {
|
||||
console.log(response.data)
|
||||
this.getApproed()
|
||||
})
|
||||
.catch((reportError) => {
|
||||
console.log(reportError)
|
||||
})
|
||||
},
|
||||
|
||||
handleSizeChange(val) {
|
||||
console.log(`每页 ${val} 条`)
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
console.log(`当前页: ${val}`)
|
||||
},
|
||||
getApproed() {
|
||||
request
|
||||
.get('/affair/personal_affairs')
|
||||
.then((response) => {
|
||||
this.tableData = response.data.data
|
||||
console.log(this.tableData)
|
||||
})
|
||||
.catch((reportError) => {
|
||||
console.log(reportError)
|
||||
})
|
||||
},
|
||||
format(time) {
|
||||
return new Date(time).toLocaleString()
|
||||
}, // 时间格式转换
|
||||
dialogTure(data) {
|
||||
this.dialogVisible = true
|
||||
this.dialogData = data
|
||||
},
|
||||
dialogFalse() {
|
||||
this.dialogVisible = false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getApproed()
|
||||
this.dialogFalse()
|
||||
console.log(this.tableData)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style></style>
|
||||
9
ui/src/pages/affair/PersonalAffairsView.vue
Normal file
9
ui/src/pages/affair/PersonalAffairsView.vue
Normal file
@@ -0,0 +1,9 @@
|
||||
<template><personal-affairs></personal-affairs></template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'PersonalAffairsView'
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
@@ -3,16 +3,6 @@ const affairRouter = {
|
||||
name: 'affair',
|
||||
redirect: 'manage',
|
||||
children: [
|
||||
{
|
||||
path: 'manage',
|
||||
name: 'affairManage',
|
||||
component: async () => await import('@/pages/affair/Affair.vue'),
|
||||
meta: {
|
||||
title: '事务管理',
|
||||
requiresScrollbar: true,
|
||||
requiresPadding: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'add',
|
||||
component: async () => await import('@/pages/affair/AffairAdd.vue'),
|
||||
@@ -23,12 +13,32 @@ const affairRouter = {
|
||||
requiresPadding: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'personalAffairs',
|
||||
component: async () => await import('@/pages/affair/PersonalAffairsView.vue'),
|
||||
name: 'PersonalAffairs',
|
||||
meta: {
|
||||
title: '我的事务',
|
||||
requiresScrollbar: true,
|
||||
requiresPadding: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'manage',
|
||||
name: 'affairManage',
|
||||
component: async () => await import('@/pages/affair/Affair.vue'),
|
||||
meta: {
|
||||
title: '事务审批',
|
||||
requiresScrollbar: true,
|
||||
requiresPadding: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'approved',
|
||||
component: async () => await import('@/pages/affair/AffairApproved.vue'),
|
||||
name: 'affairApproved',
|
||||
meta: {
|
||||
title: '已审批事务',
|
||||
title: '审批记录',
|
||||
requiresScrollbar: true,
|
||||
requiresPadding: true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user