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.
121 lines
3.9 KiB
121 lines
3.9 KiB
<!--
|
|
@ 作者: 秦东
|
|
@ 时间: 2023-06-16 11:39:20
|
|
@ 备注: 双职工
|
|
-->
|
|
<script lang='ts' setup>
|
|
import { shuangzhigong } from '@/api/hr/people/type'
|
|
import { getWorkingCouple, editDoubleWorkState } from '@/api/hr/people/index'
|
|
/**
|
|
* 引入页面
|
|
*/
|
|
import WorkingCoupleAddPage from '@/views/hr/archives/basicinformation/workingcoupleadd.vue'
|
|
import WorkingCoupleEditPage from '@/views/hr/archives/basicinformation/workingcoupleedit.vue'
|
|
|
|
|
|
const props = defineProps({
|
|
tabsid: {
|
|
type: String,
|
|
default: "1"
|
|
},
|
|
usercont: {
|
|
type: Object,
|
|
default() {
|
|
return {}
|
|
}
|
|
}
|
|
});
|
|
const addSzgBoxPage = ref(false) //新增双职工
|
|
const editSzgBoxPage = ref(false) //编辑双职工
|
|
|
|
const tableLoading = ref(false)
|
|
const shuangzhigongList = ref<shuangzhigong[]>([])
|
|
function getshuangzhigongList() {
|
|
tableLoading.value = true;
|
|
getWorkingCouple({ id: props.usercont.keystr })
|
|
.then((data) => {
|
|
shuangzhigongList.value = data.data
|
|
})
|
|
.finally(() => { tableLoading.value = false; })
|
|
}
|
|
const doubleWorkCont = ref<shuangzhigong>() //双职工内容
|
|
/**
|
|
* 监听数据
|
|
*/
|
|
watch(() => props.tabsid, () => {
|
|
if (props.tabsid == "10") {
|
|
getshuangzhigongList()
|
|
}
|
|
})
|
|
/**
|
|
* 添加数据
|
|
*/
|
|
function addSzgBox(key: string) {
|
|
addSzgBoxPage.value = true;
|
|
}
|
|
/**
|
|
* 编辑双职工
|
|
*/
|
|
function editSzgBox(cont: shuangzhigong) {
|
|
doubleWorkCont.value = cont
|
|
editSzgBoxPage.value = true
|
|
}
|
|
/**
|
|
* 删除双职工
|
|
*/
|
|
function delSzgBox(cont: shuangzhigong) {
|
|
ElMessageBox.confirm("确认删除<" + cont.name + ">此数据项?", "警告", {
|
|
confirmButtonText: "确定",
|
|
cancelButtonText: "取消",
|
|
type: "warning",
|
|
}).then(() => {
|
|
editDoubleWorkState({ id: cont.id.toString(), state: 3, isdel: 1 }).then(() => {
|
|
ElMessage.success("删除成功");
|
|
getshuangzhigongList()
|
|
});
|
|
});
|
|
}
|
|
</script>
|
|
<template>
|
|
<el-table v-loading="tableLoading" highlight-current-row :data="shuangzhigongList" border
|
|
:header-cell-style="{ background: '#F5F7FA' }">
|
|
|
|
<el-table-column label="是否双职工" prop="workingcouple" width="100" align="center" />
|
|
<el-table-column label="配偶姓名" prop="name" width="100" align="center" />
|
|
<el-table-column label="所在公司" prop="corporation" />
|
|
<el-table-column label="所在部门" prop="department" width="100" align="center" />
|
|
<el-table-column label="工段" prop="section" width="60" align="center" />
|
|
<el-table-column label="职位" prop="job" width="60" align="center" />
|
|
<el-table-column label="职等" prop="level" width="60" align="center" />
|
|
<el-table-column label="入职时间" prop="time" align="center" />
|
|
<el-table-column label="联系方式" prop="tel" align="center">
|
|
<template #default="scope">
|
|
<el-text class="mx-1">{{ scope.row.company }}</el-text>
|
|
<el-text v-if="scope.row.department" class="mx-1"> <span v-if="scope.row.company"> / </span>{{
|
|
scope.row.department }}</el-text>
|
|
<el-text v-if="scope.row.position" class="mx-1"> <span v-if="scope.row.department"> / </span>{{
|
|
scope.row.position }}</el-text>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column fixed="right" align="right" width="150">
|
|
<template #header>
|
|
<el-button type="primary" link size="small" @click.stop="addSzgBox(props.usercont.keystr)">
|
|
<i-ep-plus /> 新增
|
|
</el-button>
|
|
</template>
|
|
<template #default="scope">
|
|
<el-button type="primary" link size="small" @click.stop="editSzgBox(scope.row)">
|
|
<i-ep-edit />编辑
|
|
</el-button>
|
|
<el-button type="primary" link size="small" @click.stop="delSzgBox(scope.row)">
|
|
<i-ep-delete />删除
|
|
</el-button>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
<WorkingCoupleAddPage v-model:addisshow="addSzgBoxPage" :keyval="props.usercont.keystr"
|
|
@restdata="getshuangzhigongList" />
|
|
<WorkingCoupleEditPage v-model:editisshow="editSzgBoxPage" :keyval="props.usercont.keystr" :datacont="doubleWorkCont"
|
|
@restdata="getshuangzhigongList" />
|
|
</template>
|
|
<style lang='scss' scoped></style>
|
|
|