岗位管理

master
dongzeliang 2024-04-12 18:58:19 +08:00
parent 37bdf6d40c
commit 03bf2153a1
1 changed files with 90 additions and 29 deletions

View File

@ -220,11 +220,70 @@ export default {
/** 查询岗位列表 */
getList() {
this.loading = true;
listPost(this.queryParams).then(response => {
let response = {
"code": 200,
"msg": "查询成功",
"data": {
"total": 4,
"rows": [
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"postId": 1,
"postCode": "ceo",
"postName": "董事长",
"postSort": 1,
"status": "0",
"flag": false,
"remark": ""
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"postId": 2,
"postCode": "se",
"postName": "项目经理",
"postSort": 2,
"status": "0",
"flag": false,
"remark": ""
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"postId": 3,
"postCode": "hr",
"postName": "人力资源",
"postSort": 3,
"status": "0",
"flag": false,
"remark": ""
},
{
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"postId": 4,
"postCode": "user",
"postName": "普通员工",
"postSort": 4,
"status": "0",
"flag": false,
"remark": ""
}
]
}
}
this.postList = response.data.rows;
this.total = response.data.total;
this.loading = false;
});
},
//
cancel() {
@ -268,29 +327,37 @@ export default {
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const postId = row.postId || this.ids
getPost(postId).then(response => {
let response = {
"code": 200,
"msg": "操作成功",
"data": {
"createBy": 1,
"createTime": "2023-09-29 11:47:27",
"updateBy": null,
"updateTime": null,
"postId": 1,
"postCode": "ceo",
"postName": "董事长",
"postSort": 1,
"status": "0",
"flag": false,
"remark": ""
}
}
this.form = response.data;
this.open = true;
this.title = "修改岗位";
});
},
/** 提交按钮 */
submitForm: function () {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.postId != undefined) {
updatePost(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addPost(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
@ -298,19 +365,13 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const postIds = row.postId || this.ids;
this.$modal.confirm('是否确认删除岗位编号为"' + postIds + '"的数据项?').then(function () {
return delPost(postIds);
}).then(() => {
this.getList();
this.$modal.confirm('是否确认删除岗位编号为"' + postIds + '"的数据项?').then(() => {
this.$modal.msgSuccess("删除成功");
}).catch(() => {
});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/post/export', {
...this.queryParams
}, `post_${new Date().getTime()}.xlsx`)
this.$modal.msgSuccess("导入成功");
}
}
};