岗位管理
parent
37bdf6d40c
commit
03bf2153a1
|
@ -220,11 +220,70 @@ export default {
|
||||||
/** 查询岗位列表 */
|
/** 查询岗位列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listPost(this.queryParams).then(response => {
|
let response = {
|
||||||
this.postList = response.data.rows;
|
"code": 200,
|
||||||
this.total = response.data.total;
|
"msg": "查询成功",
|
||||||
this.loading = false;
|
"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() {
|
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,
|
||||||
this.form = response.data;
|
"msg": "操作成功",
|
||||||
this.open = true;
|
"data": {
|
||||||
this.title = "修改岗位";
|
"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 () {
|
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`)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue