mirror of
https://github.com/FatttSnake/Pinnacle-OA.git
synced 2026-04-05 23:11:24 +08:00
1. Optimized the problem of vertical display of data in the content button of the transaction management page and the approved transaction page. Now the transaction title and transaction content can be displayed normally
2. The approver drop-down box in the transaction add page can dynamically obtain the user id and username from the database and provide the username to the user for selection 3. The approver drop-down box has added a search function, a scroll bar, and a limit on the height of the drop-down box 4. You can obtain the id and username of the current user from the applicant input box, and display the username of the current user in the input box. The user has no grant to modify the contents of the input box
This commit is contained in:
@@ -2,13 +2,18 @@ package com.cfive.pinnacle.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.cfive.pinnacle.entity.Affair;
|
||||
import com.cfive.pinnacle.entity.Attendance;
|
||||
import com.cfive.pinnacle.entity.User;
|
||||
import com.cfive.pinnacle.entity.common.ResponseCode;
|
||||
import com.cfive.pinnacle.entity.common.ResponseResult;
|
||||
import com.cfive.pinnacle.service.IAffairService;
|
||||
import com.cfive.pinnacle.service.IUserService;
|
||||
import com.cfive.pinnacle.utils.WebUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 事务 前端控制器
|
||||
@@ -23,6 +28,10 @@ import org.springframework.web.bind.annotation.*;
|
||||
public class AffairController {
|
||||
@Autowired
|
||||
IAffairService affairService;
|
||||
// IUserService userService;
|
||||
// 不用userService的方法了,userController中已经写好了直接拿来用
|
||||
@Autowired
|
||||
UserController userController;
|
||||
|
||||
|
||||
@PostMapping("/add")
|
||||
@@ -30,6 +39,10 @@ public class AffairController {
|
||||
return ResponseResult.build(ResponseCode.DATABASE_SAVE_OK, "success", affairService.save(affair));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@GetMapping("/NotApproved")
|
||||
public ResponseResult select_NotApproved() {
|
||||
LambdaQueryWrapper<Affair> wrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
@@ -40,7 +40,9 @@ public interface AffairMapper extends BaseMapper<Affair> {
|
||||
|
||||
|
||||
|
||||
@Select("SELECT * from t_affair where status=0 ")
|
||||
|
||||
|
||||
@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();
|
||||
|
||||
|
||||
@@ -8,18 +8,30 @@
|
||||
|
||||
<el-form-item label="申请者:">
|
||||
<el-col :span="3">
|
||||
<el-input v-model="form.applicantId" class="shortInput" />
|
||||
<el-input
|
||||
v-model="form.applicantId"
|
||||
class="shortInput"
|
||||
disabled
|
||||
:placeholder="currentUser.username"
|
||||
/>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="审批者:">
|
||||
<el-col :span="4">
|
||||
<el-select v-model="form.inspectorId" placeholder="请选择审批者">
|
||||
<el-option value="1" label="ggb" />
|
||||
<el-option value="1652714496280469506" label="cyb" />
|
||||
<el-option value="1654151146072145921" label="syf" />
|
||||
<el-option value="1654151877520973826" label="gzw" />
|
||||
<el-option value="1654151930402746370" label="yrm" />
|
||||
<el-select
|
||||
v-model="form.inspectorId"
|
||||
placeholder="请选择审批者"
|
||||
filterable
|
||||
ref="fieldSelect"
|
||||
popper-class="roleSelect"
|
||||
>
|
||||
<el-option
|
||||
v-for="user in users"
|
||||
:label="user.username"
|
||||
:value="user.id"
|
||||
:key="user.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
@@ -82,7 +94,19 @@ export default {
|
||||
old: '',
|
||||
deleted: '',
|
||||
version: ''
|
||||
}
|
||||
},
|
||||
users: [
|
||||
{
|
||||
id: '',
|
||||
username: ''
|
||||
}
|
||||
],
|
||||
currentUser: [
|
||||
{
|
||||
id: '',
|
||||
username: ''
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
// created: {
|
||||
@@ -103,6 +127,7 @@ export default {
|
||||
// },
|
||||
methods: {
|
||||
onSubmit: function (form) {
|
||||
this.form.applicantId = this.currentUser.id
|
||||
console.log(form)
|
||||
if (
|
||||
!_.isEmpty(form.title) &&
|
||||
@@ -153,27 +178,54 @@ export default {
|
||||
type: 'error'
|
||||
})
|
||||
}
|
||||
if (_.isEmpty(form.createTime)) {
|
||||
ElMessage({
|
||||
message: '错误!发送时间不能为空!',
|
||||
type: 'error'
|
||||
})
|
||||
}
|
||||
// if (_.isEmpty(form.createTime)) {
|
||||
// ElMessage({
|
||||
// message: '错误!发送时间不能为空!',
|
||||
// type: 'error'
|
||||
// })
|
||||
// }
|
||||
}
|
||||
},
|
||||
}, // 表单提交及验证
|
||||
resetForm() {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.ruleForm.resetFields()
|
||||
})
|
||||
},
|
||||
}, // 重置页面
|
||||
alarm() {
|
||||
setInterval(() => {
|
||||
this.form.createTime = new Date()
|
||||
}, 500)
|
||||
}, // 动态时钟
|
||||
getUser() {
|
||||
request
|
||||
.get('http://localhost:8621/affair/add/getUser')
|
||||
.then((response) => {
|
||||
this.users = 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() {
|
||||
this.alarm()
|
||||
this.getUser()
|
||||
this.getCurrentUser()
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(function () {
|
||||
this.$refs.fieldSelect.$refs.scrollbar.$el.classList.add('scroll-opacity')
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -191,4 +243,7 @@ export default {
|
||||
height: 70%;
|
||||
width: 70%;
|
||||
}
|
||||
.roleSelect {
|
||||
height: 100px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
<el-row>
|
||||
<el-col :span="3"></el-col>
|
||||
<el-col :span="4">事务标题:</el-col>
|
||||
<el-col :span="1">{{ dialogData.title }}</el-col>
|
||||
<el-col :span="17">{{ dialogData.title }}</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="3"></el-col>
|
||||
@@ -93,7 +93,7 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="7"></el-col>
|
||||
<el-col :span="1">{{ dialogData.content }}</el-col>
|
||||
<el-col :span="17">{{ dialogData.content }}</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="11"></el-col>
|
||||
|
||||
Reference in New Issue
Block a user