数通智联化工云平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

138 lines
3.2 KiB

<!--
@ 作者: 袁纪菲
@ 时间: 2024-4-22
@ 备注: 人才盘点
-->
<script lang="ts" setup>
import { rencaipandian } from "@/api/hr/people/type";
import {
getTalentinventoryCont,
editTalentinventoryContState,
} from "@/api/hr/people/index";
import EditTalentinventory from "@/views/hr/archives/basicinformation/talentinventoryedit.vue";
import AddTalentinventory from "@/views/hr/archives/basicinformation/talentinventoryadd.vue";
const props = defineProps({
tabsid: {
type: String,
default: "1",
},
usercont: {
type: Object,
default() {
return {};
},
},
});
const editrcpdBoxPage = ref(false);
const addrcpdBoxPage = ref(false);
const tableLoading = ref(false);
const rcpdList = ref<rencaipandian[]>([]);
const rcpdInfo = ref<rencaipandian>();
const getrcpdList = () => {
tableLoading.value = true;
getTalentinventoryCont({ id: props.usercont.keystr })
.then((data) => {
rcpdList.value = data.data;
})
.finally(() => {
tableLoading.value = false;
});
};
/**
* 监听数据
*/
watch(
() => props.tabsid,
() => {
if (props.tabsid == "3") {
getrcpdList();
}
}
);
/**
* 添加数据
*/
const addrcpdBox = (key: string) => {
addrcpdBoxPage.value = true;
};
/**
* 编辑人才盘点
*/
const editrcpdBox = (cont: rencaipandian) => {
rcpdInfo.value = cont;
editrcpdBoxPage.value = true;
};
/**
* 删除人才盘点
*/
const delrcpdBox = (cont: rencaipandian) => {
ElMessageBox.confirm("确认删除<" + cont.id + ">此数据项?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
editTalentinventoryContState({ id: toString(), state: 3, isdel: 1 }).then(
() => {
ElMessage.success("删除成功");
getrcpdList();
}
);
});
};
</script>
<template>
<AddTalentinventory
v-model:addisshow="addrcpdBoxPage"
:keyval="props.usercont.keystr"
@restdata="getrcpdList"
/>
<EditTalentinventory
v-model:editisshow="editrcpdBoxPage"
:keyval="props.usercont.keystr"
:datacont="rcpdInfo"
@restdata="getrcpdList"
/>
<el-table
v-loading="tableLoading"
highlight-current-row
:data="rcpdList"
border
:header-cell-style="{ background: '#F5F7FA' }"
>
<el-table-column label="职业生涯规划" prop="career" />
<el-table-column label="期望从组织获得的帮助" prop="expecthelp" />
<el-table-column fixed="right" align="right" width="130">
<template #header>
<el-button
type="primary"
link
size="small"
@click.stop="addrcpdBox(props.usercont.keystr)"
>
<i-ep-plus /> 新增
</el-button>
</template>
<template #default="scope">
<el-button
type="primary"
link
size="small"
@click.stop="editrcpdBox(scope.row)"
>
<i-ep-edit />编辑
</el-button>
<el-button
type="primary"
link
size="small"
@click.stop="delrcpdBox(scope.row)"
>
<i-ep-delete />删除
</el-button>
</template>
</el-table-column>
</el-table>
</template>
<style></style>