mirror of
https://github.com/FatttSnake/Pinnacle-OA.git
synced 2026-04-05 23:11:24 +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:
@@ -34,6 +34,7 @@ public class AffairController {
|
|||||||
public ResponseResult select_NotApproved() {
|
public ResponseResult select_NotApproved() {
|
||||||
LambdaQueryWrapper<Affair> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<Affair> wrapper = new LambdaQueryWrapper<>();
|
||||||
wrapper.eq(Affair::getStatus, 0).eq(Affair::getInspectorId,WebUtil.getLoginUser().getUser().getId());
|
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));
|
return ResponseResult.build(ResponseCode.DATABASE_SELECT_OK, "success", affairService.list(wrapper));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,7 +42,8 @@ public class AffairController {
|
|||||||
@GetMapping("/Approved")
|
@GetMapping("/Approved")
|
||||||
public ResponseResult select_Approved() {
|
public ResponseResult select_Approved() {
|
||||||
LambdaQueryWrapper<Affair> wrapper2 = new LambdaQueryWrapper<>();
|
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));
|
return ResponseResult.build(ResponseCode.DATABASE_SELECT_OK, "success", affairService.list(wrapper2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ public class Affair implements Serializable {
|
|||||||
* 审核时间
|
* 审核时间
|
||||||
*/
|
*/
|
||||||
@TableField("inspect_time")
|
@TableField("inspect_time")
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",timezone = "UTC")
|
||||||
private LocalDateTime inspectTime;
|
private LocalDateTime inspectTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ public interface AffairMapper extends BaseMapper<Affair> {
|
|||||||
//根据id,撤回新建的事务,在新建事务时,会再进行一次确定
|
//根据id,撤回新建的事务,在新建事务时,会再进行一次确定
|
||||||
// (是否撤回,当用户撤回新建的事务时,根据新建的事务的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);
|
int updateAffairs_Yes(Affair affair);
|
||||||
//管理员权限--->修改事务的状态(AffairsStatus)--->达到审批的效果
|
//管理员权限--->修改事务的状态(AffairsStatus)--->达到审批的效果
|
||||||
//同意
|
//同意
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item v-model="form.createTime" label="发送日期:">
|
<el-form-item v-model="form.createTime" label="创建时间:">
|
||||||
<el-col :span="5">
|
<el-col :span="5">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="form.createTime"
|
v-model="form.createTime"
|
||||||
@@ -74,8 +74,8 @@ export default {
|
|||||||
status: '',
|
status: '',
|
||||||
applicantId: '',
|
applicantId: '',
|
||||||
inspectorId: '',
|
inspectorId: '',
|
||||||
createTime: '',
|
createTime: new Date(),
|
||||||
inspectTime: '',
|
inspectTime: new Date(),
|
||||||
priority: '',
|
priority: '',
|
||||||
modifyTime: '',
|
modifyTime: '',
|
||||||
originId: '',
|
originId: '',
|
||||||
@@ -165,7 +165,15 @@ export default {
|
|||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.ruleForm.resetFields()
|
this.$refs.ruleForm.resetFields()
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
alarm() {
|
||||||
|
setInterval(() => {
|
||||||
|
this.form.createTime = new Date()
|
||||||
|
}, 500)
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.alarm()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -138,15 +138,15 @@ export default {
|
|||||||
id: '',
|
id: '',
|
||||||
title: '',
|
title: '',
|
||||||
content: '',
|
content: '',
|
||||||
type_id: '',
|
typeId: '',
|
||||||
status: '',
|
status: '',
|
||||||
applicant_id: '',
|
applicantId: '',
|
||||||
inspector_id: '',
|
inspectorId: '',
|
||||||
create_time: '',
|
createTime: new Date(),
|
||||||
inspect_time: '',
|
inspectTime: new Date(),
|
||||||
priority: '',
|
priority: '',
|
||||||
modify_time: '',
|
modifyTime: '',
|
||||||
origin_id: '',
|
originId: '',
|
||||||
old: '',
|
old: '',
|
||||||
deleted: '',
|
deleted: '',
|
||||||
version: ''
|
version: ''
|
||||||
@@ -168,15 +168,15 @@ export default {
|
|||||||
id: '',
|
id: '',
|
||||||
title: '',
|
title: '',
|
||||||
content: '',
|
content: '',
|
||||||
type_id: '',
|
typeId: '',
|
||||||
status: '',
|
status: '',
|
||||||
applicant_id: '',
|
applicantId: '',
|
||||||
inspector_id: '',
|
inspectorId: '',
|
||||||
create_time: '',
|
createTime: new Date(),
|
||||||
inspect_time: '',
|
inspectTime: new Date(),
|
||||||
priority: '',
|
priority: '',
|
||||||
modify_time: '',
|
modifyTime: '',
|
||||||
origin_id: '',
|
originId: '',
|
||||||
old: '',
|
old: '',
|
||||||
deleted: '',
|
deleted: '',
|
||||||
version: ''
|
version: ''
|
||||||
|
|||||||
@@ -124,6 +124,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import request from '@/services'
|
import request from '@/services'
|
||||||
import 'element-plus/theme-chalk/index.css'
|
import 'element-plus/theme-chalk/index.css'
|
||||||
|
import _ from 'lodash'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
@@ -133,15 +134,15 @@ export default {
|
|||||||
id: '',
|
id: '',
|
||||||
title: '',
|
title: '',
|
||||||
content: '',
|
content: '',
|
||||||
type_id: '',
|
typeId: '',
|
||||||
status: '',
|
status: '',
|
||||||
applicant_id: '',
|
applicantId: '',
|
||||||
inspector_id: '',
|
inspectorId: '',
|
||||||
create_time: '',
|
createTime: new Date(),
|
||||||
inspect_time: '',
|
inspectTime: new Date(),
|
||||||
priority: '',
|
priority: '',
|
||||||
modify_time: '',
|
modifyTime: '',
|
||||||
origin_id: '',
|
originId: '',
|
||||||
old: '',
|
old: '',
|
||||||
deleted: '',
|
deleted: '',
|
||||||
version: ''
|
version: ''
|
||||||
@@ -163,15 +164,15 @@ export default {
|
|||||||
id: '',
|
id: '',
|
||||||
title: '',
|
title: '',
|
||||||
content: '',
|
content: '',
|
||||||
type_id: '',
|
typeId: '',
|
||||||
status: '',
|
status: '',
|
||||||
applicant_id: '',
|
applicantId: '',
|
||||||
inspector_id: '',
|
inspectorId: '',
|
||||||
create_time: '',
|
createTime: new Date(),
|
||||||
inspect_time: '',
|
inspectTime: '',
|
||||||
priority: '',
|
priority: '',
|
||||||
modify_time: '',
|
modifyTime: '',
|
||||||
origin_id: '',
|
originId: '',
|
||||||
old: '',
|
old: '',
|
||||||
deleted: '',
|
deleted: '',
|
||||||
version: ''
|
version: ''
|
||||||
@@ -182,6 +183,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
handleYes(row) {
|
handleYes(row) {
|
||||||
console.log(row)
|
console.log(row)
|
||||||
|
row.inspectTime = new Date()
|
||||||
request
|
request
|
||||||
.put('http://localhost:8621/affair/yes', row)
|
.put('http://localhost:8621/affair/yes', row)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
@@ -225,13 +227,25 @@ export default {
|
|||||||
format(time) {
|
format(time) {
|
||||||
return new Date(time).toLocaleString()
|
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) {
|
dialogTure(data) {
|
||||||
this.dialogVisible = true
|
this.dialogVisible = true
|
||||||
this.dialogData = data
|
this.dialogData = data
|
||||||
},
|
}, // 弹出框显示
|
||||||
dialogFalse() {
|
dialogFalse() {
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
}
|
} // 关闭弹出框
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getApproed()
|
this.getApproed()
|
||||||
|
|||||||
Reference in New Issue
Block a user