岗位管理

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() { getList() {
this.loading = true; 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.postList = response.data.rows;
this.total = response.data.total; this.total = response.data.total;
this.loading = false; this.loading = false;
});
}, },
// //
cancel() { cancel() {
@ -268,29 +327,37 @@ export default {
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const postId = row.postId || this.ids let response = {
getPost(postId).then(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.form = response.data;
this.open = true; this.open = true;
this.title = "修改岗位"; this.title = "修改岗位";
});
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function () { submitForm: function () {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
if (this.form.postId != undefined) { if (this.form.postId != undefined) {
updatePost(this.form).then(response => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList();
});
} else { } else {
addPost(this.form).then(response => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList();
});
} }
} }
}); });
@ -298,19 +365,13 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const postIds = row.postId || this.ids; const postIds = row.postId || this.ids;
this.$modal.confirm('是否确认删除岗位编号为"' + postIds + '"的数据项?').then(function () { this.$modal.confirm('是否确认删除岗位编号为"' + postIds + '"的数据项?').then(() => {
return delPost(postIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}).catch(() => {
}); });
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download('system/post/export', { this.$modal.msgSuccess("导入成功");
...this.queryParams
}, `post_${new Date().getTime()}.xlsx`)
} }
} }
}; };