|
@@ -39,7 +39,7 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import tree from "@/views/treeAndTable/components/tree";
|
|
import tree from "@/views/treeAndTable/components/tree";
|
|
-import { getJob } from "@/api/treeAndTable.js";
|
|
|
|
|
|
+import { getJob, postJob, deleteJob } from "@/api/treeAndTable.js";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "tree_table",
|
|
name: "tree_table",
|
|
@@ -71,7 +71,18 @@ export default {
|
|
},
|
|
},
|
|
// 岗位标签页的删除按钮
|
|
// 岗位标签页的删除按钮
|
|
// eslint-disable-next-line no-unused-vars
|
|
// eslint-disable-next-line no-unused-vars
|
|
- deleteJob: function (id) {},
|
|
|
|
|
|
+ deleteJob: function (id) {
|
|
|
|
+ deleteJob(id).then((res) => {
|
|
|
|
+ console.log(res);
|
|
|
|
+ if (res.status == 204) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: "删除岗位成功",
|
|
|
|
+ type: "warning",
|
|
|
|
+ });
|
|
|
|
+ this.tabClick({ name: "job" });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
// tabs点击的时候获取当前标签页下的所有信息
|
|
// tabs点击的时候获取当前标签页下的所有信息
|
|
tabClick: function (tabNode) {
|
|
tabClick: function (tabNode) {
|
|
if (tabNode.name == "job") {
|
|
if (tabNode.name == "job") {
|
|
@@ -88,6 +99,23 @@ export default {
|
|
this.dialog.name = "";
|
|
this.dialog.name = "";
|
|
this.dialog.visible = false;
|
|
this.dialog.visible = false;
|
|
},
|
|
},
|
|
|
|
+ dataFormSubmitHandle: function () {
|
|
|
|
+ if (this.dialog.type == 2) {
|
|
|
|
+ postJob({
|
|
|
|
+ dept_id: this.dept_id,
|
|
|
|
+ name: this.dialog.name,
|
|
|
|
+ }).then((res) => {
|
|
|
|
+ this.dialog.visible = false;
|
|
|
|
+ if (res.data.msg == "success") {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: "新增岗位成功",
|
|
|
|
+ type: "success",
|
|
|
|
+ });
|
|
|
|
+ this.tabClick({ name: "job" });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|