1
0
mirror of https://github.com/FatttSnake/Pinnacle-OA.git synced 2026-04-05 15:01:23 +08:00

1. Added the dynamic time effect of creating a time item in the Add transaction page

2. When inserting a new transaction or approving a new transaction, the transactions are arranged in reverse chronological order according to the creation time and approval time. The newly added transaction and the newly approved transaction appear at the top
3. You can obtain the current time when approving. You can see the approval time on the approved page
This commit is contained in:
assina045
2023-05-16 20:20:13 +08:00
parent 0c7dc7957f
commit f03a9b9f00
6 changed files with 60 additions and 35 deletions

View File

@@ -34,6 +34,7 @@ public class AffairController {
public ResponseResult select_NotApproved() {
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));
}
@@ -41,7 +42,8 @@ public class AffairController {
@GetMapping("/Approved")
public ResponseResult select_Approved() {
LambdaQueryWrapper<Affair> wrapper2 = new LambdaQueryWrapper<>();
wrapper2.ne(Affair::getStatus, 0);
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));
}

View File

@@ -84,6 +84,7 @@ public class Affair implements Serializable {
* 审核时间
*/
@TableField("inspect_time")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",timezone = "UTC")
private LocalDateTime inspectTime;
/**

View File

@@ -27,7 +27,7 @@ public interface AffairMapper extends BaseMapper<Affair> {
//根据id撤回新建的事务在新建事务时会再进行一次确定
// (是否撤回,当用户撤回新建的事务时根据新建的事务的id删除该条事务在数据库中的信息)
@Update("update t_affair set status=1 where id=#{id}")
@Update("update t_affair set status=1,inspect_time=#{inspectTime} where id=#{id}")
int updateAffairs_Yes(Affair affair);
//管理员权限--->修改事务的状态(AffairsStatus)--->达到审批的效果
//同意

View File

@@ -35,7 +35,7 @@
</el-col>
</el-form-item>
<el-form-item v-model="form.createTime" label="发送日期:">
<el-form-item v-model="form.createTime" label="创建时间:">
<el-col :span="5">
<el-date-picker
v-model="form.createTime"
@@ -74,8 +74,8 @@ export default {
status: '',
applicantId: '',
inspectorId: '',
createTime: '',
inspectTime: '',
createTime: new Date(),
inspectTime: new Date(),
priority: '',
modifyTime: '',
originId: '',
@@ -165,7 +165,15 @@ export default {
this.$nextTick(() => {
this.$refs.ruleForm.resetFields()
})
},
alarm() {
setInterval(() => {
this.form.createTime = new Date()
}, 500)
}
},
created() {
this.alarm()
}
}
</script>

View File

@@ -138,15 +138,15 @@ export default {
id: '',
title: '',
content: '',
type_id: '',
typeId: '',
status: '',
applicant_id: '',
inspector_id: '',
create_time: '',
inspect_time: '',
applicantId: '',
inspectorId: '',
createTime: new Date(),
inspectTime: new Date(),
priority: '',
modify_time: '',
origin_id: '',
modifyTime: '',
originId: '',
old: '',
deleted: '',
version: ''
@@ -168,15 +168,15 @@ export default {
id: '',
title: '',
content: '',
type_id: '',
typeId: '',
status: '',
applicant_id: '',
inspector_id: '',
create_time: '',
inspect_time: '',
applicantId: '',
inspectorId: '',
createTime: new Date(),
inspectTime: new Date(),
priority: '',
modify_time: '',
origin_id: '',
modifyTime: '',
originId: '',
old: '',
deleted: '',
version: ''

View File

@@ -124,6 +124,7 @@
<script>
import request from '@/services'
import 'element-plus/theme-chalk/index.css'
import _ from 'lodash'
export default {
data() {
@@ -133,15 +134,15 @@ export default {
id: '',
title: '',
content: '',
type_id: '',
typeId: '',
status: '',
applicant_id: '',
inspector_id: '',
create_time: '',
inspect_time: '',
applicantId: '',
inspectorId: '',
createTime: new Date(),
inspectTime: new Date(),
priority: '',
modify_time: '',
origin_id: '',
modifyTime: '',
originId: '',
old: '',
deleted: '',
version: ''
@@ -163,15 +164,15 @@ export default {
id: '',
title: '',
content: '',
type_id: '',
typeId: '',
status: '',
applicant_id: '',
inspector_id: '',
create_time: '',
inspect_time: '',
applicantId: '',
inspectorId: '',
createTime: new Date(),
inspectTime: '',
priority: '',
modify_time: '',
origin_id: '',
modifyTime: '',
originId: '',
old: '',
deleted: '',
version: ''
@@ -182,6 +183,7 @@ export default {
methods: {
handleYes(row) {
console.log(row)
row.inspectTime = new Date()
request
.put('http://localhost:8621/affair/yes', row)
.then((response) => {
@@ -225,13 +227,25 @@ export default {
format(time) {
return new Date(time).toLocaleString()
}, // 时间格式转换
getDate() {
let newTime = ''
const date = new Date()
const yy = date.getUTCFullYear()
const mm = _.padStart((date.getUTCMonth() + 1).toString(), 2, '0')
const dd = _.padStart(date.getUTCDate().toString(), 2, '0')
const hh = _.padStart(date.getUTCHours().toString(), 2, '0')
const mf = _.padStart(date.getUTCMinutes().toString(), 2, '0')
const ss = _.padStart(date.getUTCSeconds().toString(), 2, '0')
newTime = yy + '-' + mm + '-' + dd + ' ' + hh + ':' + mf + ':' + ss
return newTime
}, // 获取当前时间与格式转换
dialogTure(data) {
this.dialogVisible = true
this.dialogData = data
},
}, // 弹出框显示
dialogFalse() {
this.dialogVisible = false
}
} // 关闭弹出框
},
created() {
this.getApproed()