2025-09-22 09:01:41 +08:00
|
|
|
<template>
|
|
|
|
|
<div>
|
|
|
|
|
<div class="titleBox">
|
2025-09-22 14:21:17 +08:00
|
|
|
<page-title title="从业人员管理" />
|
2025-09-22 09:01:41 +08:00
|
|
|
<el-button type="primary" @click="addEdit('add', row)">新增</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 搜索 -->
|
|
|
|
|
<div ref="searchBox">
|
|
|
|
|
<Search :searchArr="searchConfiger" @submit="onSearch"></Search>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 表格 -->
|
|
|
|
|
<div class="tabBox">
|
|
|
|
|
<MyTable :tableData="pageData.tableData" :tableColumn="pageData.tableColumn" :tableHeight="pageData.tableHeight"
|
|
|
|
|
:key="pageData.keyCount" :tableConfiger="pageData.tableConfiger" :controlsWidth="pageData.controlsWidth">
|
2025-09-23 18:03:42 +08:00
|
|
|
<template #sflz="{ row }">
|
2025-09-26 16:08:38 +08:00
|
|
|
<span>{{ row.sflz == 1 ? '离职' : '在职' }}</span>
|
2025-09-25 11:59:44 +08:00
|
|
|
</template>
|
|
|
|
|
<template #gw="{ row }">
|
2025-09-26 16:08:38 +08:00
|
|
|
<DictTag :value="row.gw" :tag="false" :options="D_BAXX_GWLX" />
|
2025-09-22 09:01:41 +08:00
|
|
|
</template>
|
|
|
|
|
<!-- 操作 -->
|
|
|
|
|
<template #controls="{ row }">
|
|
|
|
|
<el-link type="primary" @click="addEdit('edit', row)">编辑</el-link>
|
|
|
|
|
<el-link type="danger" @click="handleDelete([row.id])">删除</el-link>
|
|
|
|
|
<el-link type="warning" @click="addEdit('view', row)">详情</el-link>
|
2025-09-23 18:03:42 +08:00
|
|
|
<el-link v-if="!row.sflz || row.sflz === 0" type="primary" @click="handleResignation(row)">离职</el-link>
|
2025-09-22 09:01:41 +08:00
|
|
|
</template>
|
|
|
|
|
</MyTable>
|
|
|
|
|
<Pages @changeNo="changeNo" @changeSize="changeSize" :tableHeight="pageData.tableHeight" :pageConfiger="{
|
|
|
|
|
...pageData.pageConfiger,
|
|
|
|
|
total: pageData.total
|
|
|
|
|
}"></Pages>
|
|
|
|
|
</div>
|
|
|
|
|
<add-practitioner-dialog v-model="isVisible" ref="addPractitionerRef" @refresh="getList" />
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup>
|
2025-09-23 18:03:42 +08:00
|
|
|
import { onMounted, reactive, ref, getCurrentInstance } from "vue";
|
2025-09-22 09:01:41 +08:00
|
|
|
import MyTable from '@/components/aboutTable/MyTable.vue';
|
|
|
|
|
import Pages from '@/components/aboutTable/Pages.vue';
|
|
|
|
|
import Search from '@/components/aboutTable/Search.vue';
|
2025-09-22 14:21:17 +08:00
|
|
|
import PageTitle from "@/components/aboutTable/PageTitle.vue";
|
2025-09-22 09:01:41 +08:00
|
|
|
import { qcckGet, qcckPost, qcckDelete } from "@/api/qcckApi.js";
|
2025-09-22 14:21:17 +08:00
|
|
|
import AddPractitionerDialog from "./components/addPractitionerDialog.vue";
|
2025-09-22 09:01:41 +08:00
|
|
|
|
2025-09-23 18:03:42 +08:00
|
|
|
const { proxy } = getCurrentInstance();
|
2025-09-25 11:59:44 +08:00
|
|
|
const { D_BZ_SF, D_BAXX_GWLX } = proxy.$dict("D_BZ_SF", "D_BAXX_GWLX");
|
2025-09-22 09:01:41 +08:00
|
|
|
const addPractitionerRef = ref(null);
|
|
|
|
|
const queryFrom = ref({});
|
|
|
|
|
const isVisible = ref(false);
|
|
|
|
|
const searchBox = ref(null);
|
|
|
|
|
const searchConfiger = ref([
|
|
|
|
|
{
|
|
|
|
|
label: "人员姓名",
|
|
|
|
|
prop: "xm",
|
|
|
|
|
placeholder: "请输入人员姓名",
|
|
|
|
|
showType: "input"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "证件号码",
|
|
|
|
|
prop: "sfzh",
|
|
|
|
|
placeholder: "请输入证件号码",
|
|
|
|
|
showType: "input"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "联系电话",
|
|
|
|
|
prop: "lxdh",
|
|
|
|
|
placeholder: "请输入联系电话",
|
|
|
|
|
showType: "input"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "是否在职",
|
2025-09-23 18:03:42 +08:00
|
|
|
prop: "sflz",
|
2025-09-22 09:01:41 +08:00
|
|
|
placeholder: "请选择是否在职",
|
2025-09-23 18:03:42 +08:00
|
|
|
showType: "select",
|
|
|
|
|
options: D_BZ_SF
|
2025-09-22 09:01:41 +08:00
|
|
|
}
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
const pageData = reactive({
|
2025-09-25 16:28:13 +08:00
|
|
|
tableData: [],
|
2025-09-22 09:01:41 +08:00
|
|
|
keyCount: 0,
|
|
|
|
|
tableConfiger: {
|
|
|
|
|
rowHieght: 61,
|
|
|
|
|
showSelectType: "null",
|
|
|
|
|
loading: false
|
|
|
|
|
},
|
|
|
|
|
total: 0,
|
|
|
|
|
pageConfiger: {
|
2025-09-25 13:50:12 +08:00
|
|
|
pageSize: 20,
|
2025-09-22 09:01:41 +08:00
|
|
|
pageCurrent: 1
|
|
|
|
|
},
|
|
|
|
|
controlsWidth: 180,
|
|
|
|
|
tableColumn: [
|
|
|
|
|
{ label: "姓名", prop: "xm" },
|
|
|
|
|
{ label: "证件号码", prop: "sfzh" },
|
|
|
|
|
{ label: "联系方式", prop: "lxdh" },
|
2025-09-25 11:59:44 +08:00
|
|
|
{ label: "岗位", prop: "gw", showSolt: true },
|
2025-09-22 09:01:41 +08:00
|
|
|
{ label: "入职时间", prop: "rzsj" },
|
2025-09-23 18:03:42 +08:00
|
|
|
{ label: "外派单位", prop: "wpdw", },
|
|
|
|
|
{ label: "是否在职", prop: "sflz", showSolt: true },
|
2025-09-22 09:01:41 +08:00
|
|
|
]
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 表格高度计算
|
|
|
|
|
const tabHeightFn = () => {
|
|
|
|
|
pageData.tableHeight =
|
|
|
|
|
window.innerHeight - searchBox.value.offsetHeight - 250;
|
|
|
|
|
window.onresize = function () {
|
|
|
|
|
tabHeightFn();
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const addEdit = (type, row) => {
|
|
|
|
|
addPractitionerRef.value.open(row, type);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const onSearch = (value) => {
|
|
|
|
|
queryFrom.value = value
|
|
|
|
|
pageData.pageConfiger.pageCurrent = 1;
|
|
|
|
|
getList();
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-23 18:03:42 +08:00
|
|
|
// 离职
|
|
|
|
|
const handleResignation = async ({ xm = '', id = "" }) => {
|
|
|
|
|
await proxy.$modal.confirm(`是否确认处理${xm}离职吗?`)
|
|
|
|
|
|
|
|
|
|
try {
|
2025-09-26 12:56:52 +08:00
|
|
|
await qcckPost({ id, sflz: 1 }, "/bagl/mosty-base/baxx/cyry/szlzzt")
|
2025-09-23 18:03:42 +08:00
|
|
|
proxy.$modal.msgSuccess("离职成功");
|
|
|
|
|
await getList();
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.log(error)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 删除
|
|
|
|
|
const handleDelete = async (ids) => {
|
|
|
|
|
await proxy.$modal.confirm("是否确认删除该从业人员?")
|
|
|
|
|
|
|
|
|
|
try {
|
2025-09-26 12:56:52 +08:00
|
|
|
await qcckPost({ idList: ids }, "/bagl/mosty-base/baxx/cyry/remove")
|
2025-09-23 18:03:42 +08:00
|
|
|
proxy.$modal.msgSuccess("删除成功");
|
|
|
|
|
getList();
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.log(error)
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2025-09-22 09:01:41 +08:00
|
|
|
const getList = async () => {
|
2025-09-26 16:08:38 +08:00
|
|
|
pageData.tableConfiger.loading = true;
|
|
|
|
|
let params = { ...pageData.pageConfiger, ...queryFrom.value }
|
|
|
|
|
const res = await qcckPost(params, `/mosty-base/baxx/cyry/page`)
|
|
|
|
|
pageData.tableData = res.records || []
|
|
|
|
|
pageData.total = res.total;
|
|
|
|
|
pageData.tableConfiger.loading = false;
|
2025-09-22 09:01:41 +08:00
|
|
|
}
|
|
|
|
|
|
2025-09-25 13:50:12 +08:00
|
|
|
const changeNo = (val) => {
|
|
|
|
|
pageData.pageConfiger.pageNum = val;
|
|
|
|
|
getList();
|
|
|
|
|
};
|
|
|
|
|
const changeSize = (val) => {
|
|
|
|
|
pageData.pageConfiger.pageSize = val;
|
|
|
|
|
getList();
|
|
|
|
|
};
|
|
|
|
|
|
2025-09-22 09:01:41 +08:00
|
|
|
onMounted(() => {
|
|
|
|
|
tabHeightFn();
|
|
|
|
|
getList();
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
|
|
|
|
|
</style>
|