From b7754a0723ec899af5afc99a6be90c4a6d1dea4e Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期一, 06 七月 2026 14:19:36 +0800
Subject: [PATCH] 户籍地址、现住址残余展示删除
---
src/views/personnelManagement/dimission/components/formDia.vue | 467 ++++-----
src/views/officeProcessAutomation/HrManage/resign-apply/components/formDia.vue | 467 ++++-----
src/views/officeProcessAutomation/HrManage/resign-apply/index.vue | 364 +++---
src/views/officeProcessAutomation/HrManage/staff-contract/index.vue | 520 +++++-----
src/views/personnelManagement/contractManagement/index.vue | 582 ++++++------
src/views/personnelManagement/dimission/index.vue | 399 ++++----
6 files changed, 1,401 insertions(+), 1,398 deletions(-)
diff --git a/src/views/officeProcessAutomation/HrManage/resign-apply/components/formDia.vue b/src/views/officeProcessAutomation/HrManage/resign-apply/components/formDia.vue
index 86c59ce..20c1794 100644
--- a/src/views/officeProcessAutomation/HrManage/resign-apply/components/formDia.vue
+++ b/src/views/officeProcessAutomation/HrManage/resign-apply/components/formDia.vue
@@ -1,29 +1,31 @@
<template>
<div>
- <el-dialog
- v-model="dialogFormVisible"
- :title="operationType === 'add' ? '鏂板绂昏亴' : '缂栬緫绂昏亴'"
- width="70%"
- @close="closeDia"
- >
+ <el-dialog v-model="dialogFormVisible"
+ :title="operationType === 'add' ? '鏂板绂昏亴' : '缂栬緫绂昏亴'"
+ width="70%"
+ @close="closeDia">
<!-- 鍛樺伐淇℃伅灞曠ず鍖哄煙 -->
<div class="info-section">
<div class="info-title">鍛樺伐淇℃伅</div>
- <el-form :model="form" label-width="200px" label-position="left" :rules="rules" ref="formRef" style="margin-top: 20px">
+ <el-form :model="form"
+ label-width="200px"
+ label-position="left"
+ :rules="rules"
+ ref="formRef"
+ style="margin-top: 20px">
<el-row :gutter="30">
<el-col :span="12">
- <el-form-item label="濮撳悕锛�" prop="staffOnJobId">
+ <el-form-item label="濮撳悕锛�"
+ prop="staffOnJobId">
<el-select v-model="form.staffOnJobId"
placeholder="璇烽�夋嫨浜哄憳"
style="width: 100%"
:disabled="operationType === 'edit'"
@change="handleSelect">
- <el-option
- v-for="item in personList"
- :key="item.id"
- :label="item.staffName"
- :value="item.id"
- />
+ <el-option v-for="item in personList"
+ :key="item.id"
+ :label="item.staffName"
+ :value="item.id" />
</el-select>
</el-form-item>
</el-col>
@@ -39,21 +41,11 @@
{{ currentStaffRecord.sex || '-' }}
</el-form-item>
</el-col>
- <el-col :span="12">
- <el-form-item label="鎴风睄浣忓潃锛�">
- {{ currentStaffRecord.nativePlace || '-' }}
- </el-form-item>
- </el-col>
</el-row>
<el-row :gutter="30">
<el-col :span="12">
<el-form-item label="宀椾綅锛�">
{{ currentStaffRecord.postName || '-' }}
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="鐜颁綇鍧�锛�">
- {{ currentStaffRecord.adress || '-' }}
</el-form-item>
</el-col>
</el-row>
@@ -97,74 +89,74 @@
</el-row>
<el-row :gutter="30">
<el-col :span="12">
- <el-form-item label="绂昏亴鏃ユ湡锛�" prop="leaveDate">
- <el-date-picker
- v-model="form.leaveDate"
- type="date"
- :disabled="operationType === 'edit'"
- :disabled-date="disabledFutureDate"
- placeholder="璇烽�夋嫨绂昏亴鏃ユ湡"
- value-format="YYYY-MM-DD"
- format="YYYY-MM-DD"
- style="width: 100%"
- />
+ <el-form-item label="绂昏亴鏃ユ湡锛�"
+ prop="leaveDate">
+ <el-date-picker v-model="form.leaveDate"
+ type="date"
+ :disabled="operationType === 'edit'"
+ :disabled-date="disabledFutureDate"
+ placeholder="璇烽�夋嫨绂昏亴鏃ユ湡"
+ value-format="YYYY-MM-DD"
+ format="YYYY-MM-DD"
+ style="width: 100%" />
</el-form-item>
</el-col>
<el-col :span="12">
- <el-form-item label="绂昏亴鍘熷洜锛�" prop="reason">
- <el-select v-model="form.reason" placeholder="璇烽�夋嫨绂昏亴鍘熷洜" style="width: 100%" @change="handleSelectDimissionReason">
- <el-option
- v-for="(item, index) in dimissionReasonOptions"
- :key="index"
- :label="item.label"
- :value="item.value"
- />
+ <el-form-item label="绂昏亴鍘熷洜锛�"
+ prop="reason">
+ <el-select v-model="form.reason"
+ placeholder="璇烽�夋嫨绂昏亴鍘熷洜"
+ style="width: 100%"
+ @change="handleSelectDimissionReason">
+ <el-option v-for="(item, index) in dimissionReasonOptions"
+ :key="index"
+ :label="item.label"
+ :value="item.value" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="30">
<el-col :span="12">
- <el-form-item label="澶囨敞锛�" prop="remark" v-if="form.reason === 'other'">
- <el-input
- v-model="form.remark"
- type="textarea"
- :rows="3"
- placeholder="澶囨敞"
- maxlength="500"
- show-word-limit
- />
+ <el-form-item label="澶囨敞锛�"
+ prop="remark"
+ v-if="form.reason === 'other'">
+ <el-input v-model="form.remark"
+ type="textarea"
+ :rows="3"
+ placeholder="澶囨敞"
+ maxlength="500"
+ show-word-limit />
</el-form-item>
</el-col>
</el-row>
</el-form>
-
-<!-- <el-row :gutter="30">-->
-<!-- <el-col :span="12">-->
-<!-- <div class="info-item">-->
-<!-- <span class="info-label">绂昏亴鍘熷洜锛�</span>-->
-<!-- <el-select v-model="form.reason" placeholder="璇烽�夋嫨浜哄憳" style="width: 100%" @change="handleSelect">-->
-<!-- <el-option-->
-<!-- v-for="(item, index) in dimissionReasonOptions"-->
-<!-- :key="index"-->
-<!-- :label="item.label"-->
-<!-- :value="item.value"-->
-<!-- />-->
-<!-- </el-select>-->
-<!-- </div>-->
-<!-- </el-col>-->
-<!-- <el-col :span="12">-->
-<!-- <div class="info-item">-->
-<!-- <span class="info-label">鍛樺伐缂栧彿锛�</span>-->
-<!-- <span class="info-value">{{ form.staffNo || '-' }}</span>-->
-<!-- </div>-->
-<!-- </el-col>-->
-<!-- </el-row>-->
+ <!-- <el-row :gutter="30">-->
+ <!-- <el-col :span="12">-->
+ <!-- <div class="info-item">-->
+ <!-- <span class="info-label">绂昏亴鍘熷洜锛�</span>-->
+ <!-- <el-select v-model="form.reason" placeholder="璇烽�夋嫨浜哄憳" style="width: 100%" @change="handleSelect">-->
+ <!-- <el-option-->
+ <!-- v-for="(item, index) in dimissionReasonOptions"-->
+ <!-- :key="index"-->
+ <!-- :label="item.label"-->
+ <!-- :value="item.value"-->
+ <!-- />-->
+ <!-- </el-select>-->
+ <!-- </div>-->
+ <!-- </el-col>-->
+ <!-- <el-col :span="12">-->
+ <!-- <div class="info-item">-->
+ <!-- <span class="info-label">鍛樺伐缂栧彿锛�</span>-->
+ <!-- <span class="info-value">{{ form.staffNo || '-' }}</span>-->
+ <!-- </div>-->
+ <!-- </el-col>-->
+ <!-- </el-row>-->
</div>
-
<template #footer>
<div class="dialog-footer">
- <el-button type="primary" @click="submitForm">纭</el-button>
+ <el-button type="primary"
+ @click="submitForm">纭</el-button>
<el-button @click="closeDia">鍙栨秷</el-button>
</div>
</template>
@@ -173,175 +165,180 @@
</template>
<script setup>
-import {ref, reactive, toRefs, getCurrentInstance} from "vue";
-import {staffOnJobListPage} from "@/api/personnelManagement/staffOnJob.js";
-import {createStaffLeave, updateStaffLeave} from "@/api/personnelManagement/staffLeave.js";
-const { proxy } = getCurrentInstance()
-const emit = defineEmits(['close'])
+ import { ref, reactive, toRefs, getCurrentInstance } from "vue";
+ import { staffOnJobListPage } from "@/api/personnelManagement/staffOnJob.js";
+ import {
+ createStaffLeave,
+ updateStaffLeave,
+ } from "@/api/personnelManagement/staffLeave.js";
+ const { proxy } = getCurrentInstance();
+ const emit = defineEmits(["close"]);
-const dialogFormVisible = ref(false);
-const operationType = ref('')
-const getTodayDate = () => {
- const now = new Date();
- const year = now.getFullYear();
- const month = `${now.getMonth() + 1}`.padStart(2, '0');
- const day = `${now.getDate()}`.padStart(2, '0');
- return `${year}-${month}-${day}`;
-};
-
-const disabledFutureDate = (time) => {
- const todayEnd = new Date();
- todayEnd.setHours(23, 59, 59, 999);
- return time.getTime() > todayEnd.getTime();
-};
-const data = reactive({
- form: {
- staffOnJobId: undefined,
- leaveDate: "",
- reason: "",
- remark: "",
- },
- rules: {
- staffName: [{ required: true, message: "璇烽�夋嫨浜哄憳" }],
- leaveDate: [{ required: true, message: "璇烽�夋嫨绂昏亴鏃ユ湡", trigger: "change" }],
- reason: [{ required: true, message: "璇烽�夋嫨绂昏亴鍘熷洜"}],
- },
- dimissionReasonOptions: [
- {label: '钖祫寰呴亣', value: 'salary'},
- {label: '鑱屼笟鍙戝睍', value: 'career_development'},
- {label: '宸ヤ綔鐜', value: 'work_environment'},
- {label: '涓汉鍘熷洜', value: 'personal_reason'},
- {label: '鍏朵粬', value: 'other'},
- ],
- currentStaffRecord: {},
-});
-const { form, rules, dimissionReasonOptions, currentStaffRecord } = toRefs(data);
-
-// 鎵撳紑寮规
-const openDialog = (type, row) => {
- operationType.value = type;
- dialogFormVisible.value = true;
- if (operationType.value === 'edit') {
- currentStaffRecord.value = row
- form.value.staffOnJobId = row.staffOnJobId
- form.value.leaveDate = row.leaveDate
- form.value.reason = row.reason
- form.value.remark = row.remark
- personList.value = [
- {
- staffName: row.staffName,
- id: row.staffOnJobId,
- }
- ]
- } else {
- form.value.leaveDate = getTodayDate()
- getList()
- }
-}
-
-const handleSelectDimissionReason = (val) => {
- if (val === 'other') {
- form.value.remark = ''
- }
-}
-// 鎻愪氦浜у搧琛ㄥ崟
-const submitForm = () => {
- form.value.staffState = 0
- if (form.value.reason !== 'other') {
- form.value.remark = ''
- }
- proxy.$refs["formRef"].validate(valid => {
- if (valid) {
- if (operationType.value === "add") {
- createStaffLeave(form.value).then(res => {
- proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
- closeDia();
- })
- } else {
- updateStaffLeave(currentStaffRecord.value.id, form.value).then(res => {
- proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
- closeDia();
- })
- }
- }
- })
-
-}
-// 鍏抽棴寮规
-const closeDia = () => {
- // 琛ㄥ崟宸叉敞閲婏紝鎵嬪姩閲嶇疆琛ㄥ崟鏁版嵁
- form.value = {
- staffOnJobId: undefined,
- leaveDate: "",
- reason: "",
- remark: "",
+ const dialogFormVisible = ref(false);
+ const operationType = ref("");
+ const getTodayDate = () => {
+ const now = new Date();
+ const year = now.getFullYear();
+ const month = `${now.getMonth() + 1}`.padStart(2, "0");
+ const day = `${now.getDate()}`.padStart(2, "0");
+ return `${year}-${month}-${day}`;
};
- dialogFormVisible.value = false;
- emit('close')
-};
-const personList = ref([]);
+ const disabledFutureDate = time => {
+ const todayEnd = new Date();
+ todayEnd.setHours(23, 59, 59, 999);
+ return time.getTime() > todayEnd.getTime();
+ };
+ const data = reactive({
+ form: {
+ staffOnJobId: undefined,
+ leaveDate: "",
+ reason: "",
+ remark: "",
+ },
+ rules: {
+ staffName: [{ required: true, message: "璇烽�夋嫨浜哄憳" }],
+ leaveDate: [
+ { required: true, message: "璇烽�夋嫨绂昏亴鏃ユ湡", trigger: "change" },
+ ],
+ reason: [{ required: true, message: "璇烽�夋嫨绂昏亴鍘熷洜" }],
+ },
+ dimissionReasonOptions: [
+ { label: "钖祫寰呴亣", value: "salary" },
+ { label: "鑱屼笟鍙戝睍", value: "career_development" },
+ { label: "宸ヤ綔鐜", value: "work_environment" },
+ { label: "涓汉鍘熷洜", value: "personal_reason" },
+ { label: "鍏朵粬", value: "other" },
+ ],
+ currentStaffRecord: {},
+ });
+ const { form, rules, dimissionReasonOptions, currentStaffRecord } =
+ toRefs(data);
-/**
- * 鑾峰彇褰撳墠鍦ㄨ亴浜哄憳鍒楄〃
- */
-const getList = () => {
- staffOnJobListPage({
- current: -1,
- size: -1,
- staffState: 1
- }).then(res => {
- personList.value = res.data.records || []
- })
-};
+ // 鎵撳紑寮规
+ const openDialog = (type, row) => {
+ operationType.value = type;
+ dialogFormVisible.value = true;
+ if (operationType.value === "edit") {
+ currentStaffRecord.value = row;
+ form.value.staffOnJobId = row.staffOnJobId;
+ form.value.leaveDate = row.leaveDate;
+ form.value.reason = row.reason;
+ form.value.remark = row.remark;
+ personList.value = [
+ {
+ staffName: row.staffName,
+ id: row.staffOnJobId,
+ },
+ ];
+ } else {
+ form.value.leaveDate = getTodayDate();
+ getList();
+ }
+ };
-const handleSelect = (val) => {
- let obj = personList.value.find(item => item.id === val)
- currentStaffRecord.value = {}
- if (obj) {
- // 淇濈暀绂昏亴鏃ユ湡鍜岀鑱屽師鍥狅紝鍙洿鏂板憳宸ヤ俊鎭�
- currentStaffRecord.value = obj
- }
-}
-defineExpose({
- openDialog,
-});
+ const handleSelectDimissionReason = val => {
+ if (val === "other") {
+ form.value.remark = "";
+ }
+ };
+ // 鎻愪氦浜у搧琛ㄥ崟
+ const submitForm = () => {
+ form.value.staffState = 0;
+ if (form.value.reason !== "other") {
+ form.value.remark = "";
+ }
+ proxy.$refs["formRef"].validate(valid => {
+ if (valid) {
+ if (operationType.value === "add") {
+ createStaffLeave(form.value).then(res => {
+ proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
+ closeDia();
+ });
+ } else {
+ updateStaffLeave(currentStaffRecord.value.id, form.value).then(res => {
+ proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
+ closeDia();
+ });
+ }
+ }
+ });
+ };
+ // 鍏抽棴寮规
+ const closeDia = () => {
+ // 琛ㄥ崟宸叉敞閲婏紝鎵嬪姩閲嶇疆琛ㄥ崟鏁版嵁
+ form.value = {
+ staffOnJobId: undefined,
+ leaveDate: "",
+ reason: "",
+ remark: "",
+ };
+ dialogFormVisible.value = false;
+ emit("close");
+ };
+
+ const personList = ref([]);
+
+ /**
+ * 鑾峰彇褰撳墠鍦ㄨ亴浜哄憳鍒楄〃
+ */
+ const getList = () => {
+ staffOnJobListPage({
+ current: -1,
+ size: -1,
+ staffState: 1,
+ }).then(res => {
+ personList.value = res.data.records || [];
+ });
+ };
+
+ const handleSelect = val => {
+ let obj = personList.value.find(item => item.id === val);
+ currentStaffRecord.value = {};
+ if (obj) {
+ // 淇濈暀绂昏亴鏃ユ湡鍜岀鑱屽師鍥狅紝鍙洿鏂板憳宸ヤ俊鎭�
+ currentStaffRecord.value = obj;
+ }
+ };
+ defineExpose({
+ openDialog,
+ });
</script>
<style scoped>
-.info-section {
- background: #f5f7fa;
- padding: 20px;
- border-radius: 8px;
- margin-bottom: 20px;
-}
+ .info-section {
+ background: #f5f7fa;
+ padding: 20px;
+ border-radius: 8px;
+ margin-bottom: 20px;
+ }
-.info-title {
- font-size: 16px;
- font-weight: 600;
- color: #303133;
- margin-bottom: 20px;
- padding-bottom: 10px;
- border-bottom: 1px solid #e4e7ed;
-}
+ .info-title {
+ font-size: 16px;
+ font-weight: 600;
+ color: #303133;
+ margin-bottom: 20px;
+ padding-bottom: 10px;
+ border-bottom: 1px solid #e4e7ed;
+ }
-.info-item {
- display: flex;
- align-items: center;
- margin-bottom: 16px;
- min-height: 32px;
-}
+ .info-item {
+ display: flex;
+ align-items: center;
+ margin-bottom: 16px;
+ min-height: 32px;
+ }
-.info-label {
- min-width: 140px;
- color: #606266;
- font-size: 14px;
- font-weight: 500;
-}
+ .info-label {
+ min-width: 140px;
+ color: #606266;
+ font-size: 14px;
+ font-weight: 500;
+ }
-.info-value {
- flex: 1;
- color: #303133;
- font-size: 14px;
-}
+ .info-value {
+ flex: 1;
+ color: #303133;
+ font-size: 14px;
+ }
</style>
diff --git a/src/views/officeProcessAutomation/HrManage/resign-apply/index.vue b/src/views/officeProcessAutomation/HrManage/resign-apply/index.vue
index 2b20970..8d96dd9 100644
--- a/src/views/officeProcessAutomation/HrManage/resign-apply/index.vue
+++ b/src/views/officeProcessAutomation/HrManage/resign-apply/index.vue
@@ -4,216 +4,206 @@
<div class="search_form mb20">
<div>
<span class="search_title">濮撳悕锛�</span>
- <el-input
- v-model="searchForm.staffName"
- style="width: 240px"
- placeholder="璇疯緭鍏ュ鍚嶆悳绱�"
- @change="handleQuery"
- clearable
- :prefix-icon="Search"
- />
- <el-button type="primary" @click="handleQuery" style="margin-left: 10px"
- >鎼滅储</el-button
- >
+ <el-input v-model="searchForm.staffName"
+ style="width: 240px"
+ placeholder="璇疯緭鍏ュ鍚嶆悳绱�"
+ @change="handleQuery"
+ clearable
+ :prefix-icon="Search" />
+ <el-button type="primary"
+ @click="handleQuery"
+ style="margin-left: 10px">鎼滅储</el-button>
</div>
<div>
- <el-button type="primary" @click="openForm('add')">鏂板绂昏亴</el-button>
+ <el-button type="primary"
+ @click="openForm('add')">鏂板绂昏亴</el-button>
<el-button @click="handleOut">瀵煎嚭</el-button>
</div>
</div>
<div class="table_list">
- <PIMTable
- rowKey="id"
- :column="tableColumn"
- :tableData="tableData"
- :page="page"
- :isSelection="true"
- @selection-change="handleSelectionChange"
- :tableLoading="tableLoading"
- @pagination="pagination"
- :total="page.total"
- ></PIMTable>
+ <PIMTable rowKey="id"
+ :column="tableColumn"
+ :tableData="tableData"
+ :page="page"
+ :isSelection="true"
+ @selection-change="handleSelectionChange"
+ :tableLoading="tableLoading"
+ @pagination="pagination"
+ :total="page.total"></PIMTable>
</div>
- <form-dia ref="formDia" @close="handleQuery"></form-dia>
+ <form-dia ref="formDia"
+ @close="handleQuery"></form-dia>
</div>
</template>
<script setup>
-import { Search } from "@element-plus/icons-vue";
-import {onMounted, ref} from "vue";
-import FormDia from "@/views/personnelManagement/dimission/components/formDia.vue";
-import { findStaffLeaveListPage } from "@/api/personnelManagement/staffLeave.js";
-import {ElMessageBox} from "element-plus";
+ import { Search } from "@element-plus/icons-vue";
+ import { onMounted, ref } from "vue";
+ import FormDia from "@/views/personnelManagement/dimission/components/formDia.vue";
+ import { findStaffLeaveListPage } from "@/api/personnelManagement/staffLeave.js";
+ import { ElMessageBox } from "element-plus";
-const data = reactive({
- searchForm: {
- staffName: "",
- },
-});
-const { searchForm } = toRefs(data);
-const tableColumn = ref([
- {
- label: "鐘舵��",
- prop: "staffState",
- dataType: "tag",
- formatData: (params) => {
- if (params == 0) {
- return "绂昏亴";
- } else if (params == 1) {
- return "鍦ㄨ亴";
- } else {
- return null;
- }
+ const data = reactive({
+ searchForm: {
+ staffName: "",
},
- formatType: (params) => {
- if (params == 0) {
- return "danger";
- } else if (params == 1) {
- return "primary";
- } else {
- return null;
- }
- },
- },
- {
- label: "绂昏亴鏃ユ湡",
- prop: "leaveDate",
- },
- {
- label: "鍛樺伐缂栧彿",
- prop: "staffNo",
- },
- {
- label: "濮撳悕",
- prop: "staffName",
- },
- {
- label: "鎬у埆",
- prop: "sex",
- },
- {
- label: "鎴风睄浣忓潃",
- prop: "nativePlace",
- },
- {
- label: "閮ㄩ棬",
- prop: "deptName",
- },
- {
- label: "宀椾綅",
- prop: "postName",
- },
- {
- label: "鐜颁綇鍧�",
- prop: "adress",
- width:200
- },
- {
- label: "绗竴瀛﹀巻",
- prop: "firstStudy",
- },
- {
- label: "涓撲笟",
- prop: "profession",
- width:100
- },
- {
- label: "骞撮緞",
- prop: "age",
- },
- {
- label: "鑱旂郴鐢佃瘽",
- prop: "phone",
- width:150
- },
- {
- label: "绱ф�ヨ仈绯讳汉",
- prop: "emergencyContact",
- width: 120
- },
- {
- label: "绱ф�ヨ仈绯讳汉鐢佃瘽",
- prop: "emergencyContactPhone",
- width:150
- },
- {
- dataType: "action",
- label: "鎿嶄綔",
- align: "center",
- fixed: 'right',
- operation: [
- {
- name: "缂栬緫",
- type: "text",
- clickFun: (row) => {
- openForm("edit", row);
- },
+ });
+ const { searchForm } = toRefs(data);
+ const tableColumn = ref([
+ {
+ label: "鐘舵��",
+ prop: "staffState",
+ dataType: "tag",
+ formatData: params => {
+ if (params == 0) {
+ return "绂昏亴";
+ } else if (params == 1) {
+ return "鍦ㄨ亴";
+ } else {
+ return null;
+ }
},
- ],
- },
-]);
-const tableData = ref([]);
-const selectedRows = ref([]);
-const tableLoading = ref(false);
-const page = reactive({
- current: 1,
- size: 100,
- total: 0,
-});
-const formDia = ref()
-const { proxy } = getCurrentInstance()
+ formatType: params => {
+ if (params == 0) {
+ return "danger";
+ } else if (params == 1) {
+ return "primary";
+ } else {
+ return null;
+ }
+ },
+ },
+ {
+ label: "绂昏亴鏃ユ湡",
+ prop: "leaveDate",
+ },
+ {
+ label: "鍛樺伐缂栧彿",
+ prop: "staffNo",
+ },
+ {
+ label: "濮撳悕",
+ prop: "staffName",
+ },
+ {
+ label: "鎬у埆",
+ prop: "sex",
+ },
+ {
+ label: "閮ㄩ棬",
+ prop: "deptName",
+ },
+ {
+ label: "宀椾綅",
+ prop: "postName",
+ },
+ {
+ label: "绗竴瀛﹀巻",
+ prop: "firstStudy",
+ },
+ {
+ label: "涓撲笟",
+ prop: "profession",
+ width: 100,
+ },
+ {
+ label: "骞撮緞",
+ prop: "age",
+ },
+ {
+ label: "鑱旂郴鐢佃瘽",
+ prop: "phone",
+ width: 150,
+ },
+ {
+ label: "绱ф�ヨ仈绯讳汉",
+ prop: "emergencyContact",
+ width: 120,
+ },
+ {
+ label: "绱ф�ヨ仈绯讳汉鐢佃瘽",
+ prop: "emergencyContactPhone",
+ width: 150,
+ },
+ {
+ dataType: "action",
+ label: "鎿嶄綔",
+ align: "center",
+ fixed: "right",
+ operation: [
+ {
+ name: "缂栬緫",
+ type: "text",
+ clickFun: row => {
+ openForm("edit", row);
+ },
+ },
+ ],
+ },
+ ]);
+ const tableData = ref([]);
+ const selectedRows = ref([]);
+ const tableLoading = ref(false);
+ const page = reactive({
+ current: 1,
+ size: 100,
+ total: 0,
+ });
+ const formDia = ref();
+ const { proxy } = getCurrentInstance();
+ // 鏌ヨ鍒楄〃
+ /** 鎼滅储鎸夐挳鎿嶄綔 */
+ const handleQuery = () => {
+ page.current = 1;
+ getList();
+ };
+ const pagination = obj => {
+ page.current = obj.page;
+ page.size = obj.limit;
+ getList();
+ };
+ const getList = () => {
+ tableLoading.value = true;
+ findStaffLeaveListPage({ ...page, ...searchForm.value })
+ .then(res => {
+ tableLoading.value = false;
+ tableData.value = res.data.records;
+ page.total = res.data.total;
+ })
+ .catch(err => {
+ tableLoading.value = false;
+ });
+ };
+ // 琛ㄦ牸閫夋嫨鏁版嵁
+ const handleSelectionChange = selection => {
+ selectedRows.value = selection;
+ };
-// 鏌ヨ鍒楄〃
-/** 鎼滅储鎸夐挳鎿嶄綔 */
-const handleQuery = () => {
- page.current = 1;
- getList();
-};
-const pagination = (obj) => {
- page.current = obj.page;
- page.size = obj.limit;
- getList();
-};
-const getList = () => {
- tableLoading.value = true;
- findStaffLeaveListPage({...page, ...searchForm.value}).then(res => {
- tableLoading.value = false;
- tableData.value = res.data.records
- page.total = res.data.total;
- }).catch(err => {
- tableLoading.value = false;
- })
-};
-// 琛ㄦ牸閫夋嫨鏁版嵁
-const handleSelectionChange = (selection) => {
- selectedRows.value = selection;
-};
+ // 鎵撳紑寮规
+ const openForm = (type, row) => {
+ nextTick(() => {
+ formDia.value?.openDialog(type, row);
+ });
+ };
-// 鎵撳紑寮规
-const openForm = (type, row) => {
- nextTick(() => {
- formDia.value?.openDialog(type, row)
- })
-};
-
-// 瀵煎嚭
-const handleOut = () => {
- ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
- confirmButtonText: "纭",
- cancelButtonText: "鍙栨秷",
- type: "warning",
- })
+ // 瀵煎嚭
+ const handleOut = () => {
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
.then(() => {
proxy.download("/staff/staffLeave/export", {}, "浜哄憳绂昏亴.xlsx");
})
.catch(() => {
proxy.$modal.msg("宸插彇娑�");
});
-};
-onMounted(() => {
- getList();
-});
+ };
+ onMounted(() => {
+ getList();
+ });
</script>
<style scoped></style>
diff --git a/src/views/officeProcessAutomation/HrManage/staff-contract/index.vue b/src/views/officeProcessAutomation/HrManage/staff-contract/index.vue
index 8186bdd..91b48be 100644
--- a/src/views/officeProcessAutomation/HrManage/staff-contract/index.vue
+++ b/src/views/officeProcessAutomation/HrManage/staff-contract/index.vue
@@ -4,43 +4,57 @@
<div class="search_form mb20">
<div>
<span class="search_title">濮撳悕锛�</span>
- <el-input v-model="searchForm.staffName" style="width: 240px" placeholder="璇疯緭鍏ュ鍚嶆悳绱�" @change="handleQuery"
- clearable :prefix-icon="Search" />
- <span style="margin-left: 10px" class="search_title">鍚堝悓缁撴潫鏃ユ湡锛�</span>
- <el-date-picker v-model="searchForm.entryDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD" type="daterange"
- placeholder="璇烽�夋嫨" clearable @change="changeDaterange" />
- <el-button type="primary" @click="handleQuery" style="margin-left: 10px">鎼滅储</el-button>
+ <el-input v-model="searchForm.staffName"
+ style="width: 240px"
+ placeholder="璇疯緭鍏ュ鍚嶆悳绱�"
+ @change="handleQuery"
+ clearable
+ :prefix-icon="Search" />
+ <span style="margin-left: 10px"
+ class="search_title">鍚堝悓缁撴潫鏃ユ湡锛�</span>
+ <el-date-picker v-model="searchForm.entryDate"
+ value-format="YYYY-MM-DD"
+ format="YYYY-MM-DD"
+ type="daterange"
+ placeholder="璇烽�夋嫨"
+ clearable
+ @change="changeDaterange" />
+ <el-button type="primary"
+ @click="handleQuery"
+ style="margin-left: 10px">鎼滅储</el-button>
</div>
<div>
<el-button @click="handleOut">瀵煎嚭</el-button>
</div>
</div>
<div class="table_list">
- <PIMTable rowKey="id" :column="tableColumn" :tableData="tableData" :page="page" :isSelection="true"
- @selection-change="handleSelectionChange" :tableLoading="tableLoading" @pagination="pagination"
- :total="page.total"></PIMTable>
+ <PIMTable rowKey="id"
+ :column="tableColumn"
+ :tableData="tableData"
+ :page="page"
+ :isSelection="true"
+ @selection-change="handleSelectionChange"
+ :tableLoading="tableLoading"
+ @pagination="pagination"
+ :total="page.total"></PIMTable>
</div>
- <form-dia ref="formDia" @close="handleQuery"></form-dia>
-
+ <form-dia ref="formDia"
+ @close="handleQuery"></form-dia>
<!-- 鍚堝悓瀵煎叆瀵硅瘽妗� -->
- <el-dialog
- :title="upload.title"
- v-model="upload.open"
- width="400px"
- append-to-body
- >
- <el-upload
- ref="uploadRef"
- :limit="1"
- accept=".xlsx, .xls"
- :headers="upload.headers"
- :action="upload.url + '?updateSupport=' + upload.updateSupport"
- :disabled="upload.isUploading"
- :on-progress="handleFileUploadProgress"
- :on-success="handleFileSuccess"
- :auto-upload="false"
- drag
- >
+ <el-dialog :title="upload.title"
+ v-model="upload.open"
+ width="400px"
+ append-to-body>
+ <el-upload ref="uploadRef"
+ :limit="1"
+ accept=".xlsx, .xls"
+ :headers="upload.headers"
+ :action="upload.url + '?updateSupport=' + upload.updateSupport"
+ :disabled="upload.isUploading"
+ :on-progress="handleFileUploadProgress"
+ :on-success="handleFileSuccess"
+ :auto-upload="false"
+ drag>
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
<div class="el-upload__text">灏嗘枃浠舵嫋鍒版澶勶紝鎴�<em>鐐瑰嚮涓婁紶</em></div>
<template #tip>
@@ -51,7 +65,8 @@
</el-upload>
<template #footer>
<div class="dialog-footer">
- <el-button type="primary" @click="submitFileForm">纭� 瀹�</el-button>
+ <el-button type="primary"
+ @click="submitFileForm">纭� 瀹�</el-button>
<el-button @click="upload.open = false">鍙� 娑�</el-button>
</div>
</template>
@@ -61,235 +76,232 @@
</template>
<script setup>
-import { Search } from "@element-plus/icons-vue";
-import { onMounted, ref } from "vue";
-import FormDia from "@/views/personnelManagement/contractManagement/components/formDia.vue";
-import { ElMessageBox } from "element-plus";
-import { staffOnJobListPage } from "@/api/personnelManagement/staffOnJob.js";
-import dayjs from "dayjs";
-import { getToken } from "@/utils/auth.js";
-import FilesDia from "./filesDia.vue";
-const data = reactive({
- searchForm: {
- staffName: "",
- entryDate: null, // 褰曞叆鏃ユ湡
- entryDateStart: undefined,
- entryDateEnd: undefined,
- },
-});
-const { searchForm } = toRefs(data);
-const tableColumn = ref([
- {
- label: "鐘舵��",
- prop: "staffState",
- dataType: "tag",
- formatData: (params) => {
- if (params == 0) {
- return "绂昏亴";
- } else if (params == 1) {
- return "鍦ㄨ亴";
- } else {
- return null;
- }
+ import { Search } from "@element-plus/icons-vue";
+ import { onMounted, ref } from "vue";
+ import FormDia from "@/views/personnelManagement/contractManagement/components/formDia.vue";
+ import { ElMessageBox } from "element-plus";
+ import { staffOnJobListPage } from "@/api/personnelManagement/staffOnJob.js";
+ import dayjs from "dayjs";
+ import { getToken } from "@/utils/auth.js";
+ import FilesDia from "./filesDia.vue";
+ const data = reactive({
+ searchForm: {
+ staffName: "",
+ entryDate: null, // 褰曞叆鏃ユ湡
+ entryDateStart: undefined,
+ entryDateEnd: undefined,
},
- formatType: (params) => {
- if (params == 0) {
- return "danger";
- } else if (params == 1) {
- return "primary";
- } else {
- return null;
- }
+ });
+ const { searchForm } = toRefs(data);
+ const tableColumn = ref([
+ {
+ label: "鐘舵��",
+ prop: "staffState",
+ dataType: "tag",
+ formatData: params => {
+ if (params == 0) {
+ return "绂昏亴";
+ } else if (params == 1) {
+ return "鍦ㄨ亴";
+ } else {
+ return null;
+ }
+ },
+ formatType: params => {
+ if (params == 0) {
+ return "danger";
+ } else if (params == 1) {
+ return "primary";
+ } else {
+ return null;
+ }
+ },
},
- },
- {
- label: "鍛樺伐缂栧彿",
- prop: "staffNo",
- },
- {
- label: "濮撳悕",
- prop: "staffName",
- },
- {
- label: "鎬у埆",
- prop: "sex",
- },
- {
- label: "鎴风睄浣忓潃",
- prop: "nativePlace",
- },
- {
- label: "宀椾綅",
- prop: "postName",
- },
- {
- label: "鐜颁綇鍧�",
- prop: "adress",
- width: 200
- },
- {
- label: "绗竴瀛﹀巻",
- prop: "firstStudy",
- },
- {
- label: "涓撲笟",
- prop: "profession",
- width: 100
- },
- {
- label: "骞撮緞",
- prop: "age",
- },
- {
- label: "鑱旂郴鐢佃瘽",
- prop: "phone",
- width: 150
- },
- {
- label: "绱ф�ヨ仈绯讳汉",
- prop: "emergencyContact",
- width: 120
- },
- {
- label: "绱ф�ヨ仈绯讳汉鐢佃瘽",
- prop: "emergencyContactPhone",
- width: 150
- },
- {
- label: "鍚堝悓缁撴潫鏃ユ湡",
- prop: "contractExpireTime",
- width: 120
- },
- {
- dataType: "action",
- label: "鎿嶄綔",
- align: "center",
- fixed: 'right',
- width: 120,
- operation: [
- {
- name: "璇︽儏",
- type: "text",
- clickFun: (row) => {
- openForm("edit", row);
+ {
+ label: "鍛樺伐缂栧彿",
+ prop: "staffNo",
+ },
+ {
+ label: "濮撳悕",
+ prop: "staffName",
+ },
+ {
+ label: "鎬у埆",
+ prop: "sex",
+ },
+ {
+ label: "宀椾綅",
+ prop: "postName",
+ },
+ {
+ label: "绗竴瀛﹀巻",
+ prop: "firstStudy",
+ },
+ {
+ label: "涓撲笟",
+ prop: "profession",
+ width: 100,
+ },
+ {
+ label: "骞撮緞",
+ prop: "age",
+ },
+ {
+ label: "鑱旂郴鐢佃瘽",
+ prop: "phone",
+ width: 150,
+ },
+ {
+ label: "绱ф�ヨ仈绯讳汉",
+ prop: "emergencyContact",
+ width: 120,
+ },
+ {
+ label: "绱ф�ヨ仈绯讳汉鐢佃瘽",
+ prop: "emergencyContactPhone",
+ width: 150,
+ },
+ {
+ label: "鍚堝悓缁撴潫鏃ユ湡",
+ prop: "contractExpireTime",
+ width: 120,
+ },
+ {
+ dataType: "action",
+ label: "鎿嶄綔",
+ align: "center",
+ fixed: "right",
+ width: 120,
+ operation: [
+ {
+ name: "璇︽儏",
+ type: "text",
+ clickFun: row => {
+ openForm("edit", row);
+ },
},
- }
- ],
- },
-]);
-const filesDia = ref()
-const tableData = ref([]);
-const selectedRows = ref([]);
-const tableLoading = ref(false);
-const page = reactive({
- current: 1,
- size: 100,
- total: 0,
-});
-const formDia = ref()
-const { proxy } = getCurrentInstance()
+ ],
+ },
+ ]);
+ const filesDia = ref();
+ const tableData = ref([]);
+ const selectedRows = ref([]);
+ const tableLoading = ref(false);
+ const page = reactive({
+ current: 1,
+ size: 100,
+ total: 0,
+ });
+ const formDia = ref();
+ const { proxy } = getCurrentInstance();
-const changeDaterange = (value) => {
- searchForm.value.entryDateStart = undefined;
- searchForm.value.entryDateEnd = undefined;
- if (value) {
- searchForm.value.entryDateStart = dayjs(value[0]).format("YYYY-MM-DD");
- searchForm.value.entryDateEnd = dayjs(value[1]).format("YYYY-MM-DD");
- }
- getList();
-};
-// 鎵撳紑闄勪欢寮规
-const openFilesFormDia = (row) => {
- nextTick(() => {
- filesDia.value?.openDialog( row,'鍚堝悓')
- })
-};
-// 鏌ヨ鍒楄〃
-/** 鎼滅储鎸夐挳鎿嶄綔 */
-const handleQuery = () => {
- page.current = 1;
- getList();
-};
-const pagination = (obj) => {
- page.current = obj.page;
- page.size = obj.limit;
- getList();
-};
-const getList = () => {
- tableLoading.value = true;
- const params = { ...searchForm.value, ...page };
- params.entryDate = undefined
- params.staffState = 1
- staffOnJobListPage(params).then(res => {
- tableLoading.value = false;
- tableData.value = res.data.records
- page.total = res.data.total;
- }).catch(err => {
- tableLoading.value = false;
- })
-};
-// 琛ㄦ牸閫夋嫨鏁版嵁
-const handleSelectionChange = (selection) => {
- selectedRows.value = selection;
-};
-
-// 鎵撳紑寮规
-const openForm = (type, row) => {
- nextTick(() => {
- formDia.value?.openDialog(type, row)
- })
-};
-// 瀵煎嚭
-const handleOut = () => {
- ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
- confirmButtonText: "纭",
- cancelButtonText: "鍙栨秷",
- type: "warning",
- })
- .then(() => {
- proxy.download("/staff/staffOnJob/export", {staffState: 1}, "鍚堝悓绠$悊.xlsx");
- })
- .catch(() => {
- proxy.$modal.msg("宸插彇娑�");
+ const changeDaterange = value => {
+ searchForm.value.entryDateStart = undefined;
+ searchForm.value.entryDateEnd = undefined;
+ if (value) {
+ searchForm.value.entryDateStart = dayjs(value[0]).format("YYYY-MM-DD");
+ searchForm.value.entryDateEnd = dayjs(value[1]).format("YYYY-MM-DD");
+ }
+ getList();
+ };
+ // 鎵撳紑闄勪欢寮规
+ const openFilesFormDia = row => {
+ nextTick(() => {
+ filesDia.value?.openDialog(row, "鍚堝悓");
});
-};
-const upload = reactive({
- // 鏄惁鏄剧ず寮瑰嚭灞傦紙鍚堝悓瀵煎叆锛�
- open: false,
- // 寮瑰嚭灞傛爣棰橈紙鍚堝悓瀵煎叆锛�
- title: "",
- // 鏄惁绂佺敤涓婁紶
- isUploading: false,
- // 鏄惁鏇存柊宸茬粡瀛樺湪鐨勭敤鎴锋暟鎹�
- updateSupport: 1,
- // 璁剧疆涓婁紶鐨勮姹傚ご閮�
- headers: { Authorization: "Bearer " + getToken() },
- // 涓婁紶鐨勫湴鍧�
- url: import.meta.env.VITE_APP_BASE_API + "/staff/staffOnJob/import",
-});
-/** 瀵煎叆鎸夐挳鎿嶄綔 */
-function handleImport() {
- upload.title = "鍚堝悓瀵煎叆";
- upload.open = true;
-}
-/** 鎻愪氦涓婁紶鏂囦欢 */
-function submitFileForm() {
- proxy.$refs["uploadRef"].submit();
-}
-/**鏂囦欢涓婁紶涓鐞� */
-const handleFileUploadProgress = (event, file, fileList) => {
- upload.isUploading = true;
-};
-/** 鏂囦欢涓婁紶鎴愬姛澶勭悊 */
-const handleFileSuccess = (response, file, fileList) => {
- upload.open = false;
- upload.isUploading = false;
- proxy.$refs["uploadRef"].handleRemove(file);
- getList();
-};
-onMounted(() => {
- getList();
-});
+ };
+ // 鏌ヨ鍒楄〃
+ /** 鎼滅储鎸夐挳鎿嶄綔 */
+ const handleQuery = () => {
+ page.current = 1;
+ getList();
+ };
+ const pagination = obj => {
+ page.current = obj.page;
+ page.size = obj.limit;
+ getList();
+ };
+ const getList = () => {
+ tableLoading.value = true;
+ const params = { ...searchForm.value, ...page };
+ params.entryDate = undefined;
+ params.staffState = 1;
+ staffOnJobListPage(params)
+ .then(res => {
+ tableLoading.value = false;
+ tableData.value = res.data.records;
+ page.total = res.data.total;
+ })
+ .catch(err => {
+ tableLoading.value = false;
+ });
+ };
+ // 琛ㄦ牸閫夋嫨鏁版嵁
+ const handleSelectionChange = selection => {
+ selectedRows.value = selection;
+ };
+
+ // 鎵撳紑寮规
+ const openForm = (type, row) => {
+ nextTick(() => {
+ formDia.value?.openDialog(type, row);
+ });
+ };
+ // 瀵煎嚭
+ const handleOut = () => {
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ proxy.download(
+ "/staff/staffOnJob/export",
+ { staffState: 1 },
+ "鍚堝悓绠$悊.xlsx"
+ );
+ })
+ .catch(() => {
+ proxy.$modal.msg("宸插彇娑�");
+ });
+ };
+ const upload = reactive({
+ // 鏄惁鏄剧ず寮瑰嚭灞傦紙鍚堝悓瀵煎叆锛�
+ open: false,
+ // 寮瑰嚭灞傛爣棰橈紙鍚堝悓瀵煎叆锛�
+ title: "",
+ // 鏄惁绂佺敤涓婁紶
+ isUploading: false,
+ // 鏄惁鏇存柊宸茬粡瀛樺湪鐨勭敤鎴锋暟鎹�
+ updateSupport: 1,
+ // 璁剧疆涓婁紶鐨勮姹傚ご閮�
+ headers: { Authorization: "Bearer " + getToken() },
+ // 涓婁紶鐨勫湴鍧�
+ url: import.meta.env.VITE_APP_BASE_API + "/staff/staffOnJob/import",
+ });
+ /** 瀵煎叆鎸夐挳鎿嶄綔 */
+ function handleImport() {
+ upload.title = "鍚堝悓瀵煎叆";
+ upload.open = true;
+ }
+ /** 鎻愪氦涓婁紶鏂囦欢 */
+ function submitFileForm() {
+ proxy.$refs["uploadRef"].submit();
+ }
+ /**鏂囦欢涓婁紶涓鐞� */
+ const handleFileUploadProgress = (event, file, fileList) => {
+ upload.isUploading = true;
+ };
+ /** 鏂囦欢涓婁紶鎴愬姛澶勭悊 */
+ const handleFileSuccess = (response, file, fileList) => {
+ upload.open = false;
+ upload.isUploading = false;
+ proxy.$refs["uploadRef"].handleRemove(file);
+ getList();
+ };
+ onMounted(() => {
+ getList();
+ });
</script>
<style scoped></style>
diff --git a/src/views/personnelManagement/contractManagement/index.vue b/src/views/personnelManagement/contractManagement/index.vue
index ae0087e..bde498a 100644
--- a/src/views/personnelManagement/contractManagement/index.vue
+++ b/src/views/personnelManagement/contractManagement/index.vue
@@ -3,52 +3,64 @@
<div class="search_form mb20">
<div>
<span class="search_title">濮撳悕锛�</span>
- <el-input v-model="searchForm.staffName" style="width: 240px" placeholder="璇疯緭鍏ュ鍚嶆悳绱�" @change="handleQuery"
- clearable :prefix-icon="Search" />
- <span style="margin-left: 10px" class="search_title">鍚堝悓缁撴潫鏃ユ湡锛�</span>
- <el-date-picker v-model="searchForm.entryDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD" type="daterange"
- placeholder="璇烽�夋嫨" clearable @change="changeDaterange" />
- <el-button type="primary" @click="handleQuery" style="margin-left: 10px">鎼滅储</el-button>
+ <el-input v-model="searchForm.staffName"
+ style="width: 240px"
+ placeholder="璇疯緭鍏ュ鍚嶆悳绱�"
+ @change="handleQuery"
+ clearable
+ :prefix-icon="Search" />
+ <span style="margin-left: 10px"
+ class="search_title">鍚堝悓缁撴潫鏃ユ湡锛�</span>
+ <el-date-picker v-model="searchForm.entryDate"
+ value-format="YYYY-MM-DD"
+ format="YYYY-MM-DD"
+ type="daterange"
+ placeholder="璇烽�夋嫨"
+ clearable
+ @change="changeDaterange" />
+ <el-button type="primary"
+ @click="handleQuery"
+ style="margin-left: 10px">鎼滅储</el-button>
</div>
<div>
<!-- <el-button type="primary" @click="openForm('add')">鏂板鍏ヨ亴</el-button>-->
-<!-- <el-button type="info" @click="handleImport">瀵煎叆</el-button>-->
+ <!-- <el-button type="info" @click="handleImport">瀵煎叆</el-button>-->
<el-button @click="handleOut">瀵煎嚭</el-button>
<!-- <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>-->
</div>
</div>
<div class="table_list">
- <PIMTable rowKey="id" :column="tableColumn" :tableData="tableData" :page="page" :isSelection="true"
- @selection-change="handleSelectionChange" :tableLoading="tableLoading" @pagination="pagination"
- :total="page.total"></PIMTable>
+ <PIMTable rowKey="id"
+ :column="tableColumn"
+ :tableData="tableData"
+ :page="page"
+ :isSelection="true"
+ @selection-change="handleSelectionChange"
+ :tableLoading="tableLoading"
+ @pagination="pagination"
+ :total="page.total"></PIMTable>
</div>
- <form-dia ref="formDia" @close="handleQuery"></form-dia>
- <renew-contract
- v-if="isShowRenewContractModal"
- v-model:visible="isShowRenewContractModal"
- :id="id"
- @completed="handleQuery"
- />
-
+ <form-dia ref="formDia"
+ @close="handleQuery"></form-dia>
+ <renew-contract v-if="isShowRenewContractModal"
+ v-model:visible="isShowRenewContractModal"
+ :id="id"
+ @completed="handleQuery" />
<!-- 鍚堝悓瀵煎叆瀵硅瘽妗� -->
- <el-dialog
- :title="upload.title"
- v-model="upload.open"
- width="400px"
- append-to-body
- >
- <el-upload
- ref="uploadRef"
- :limit="1"
- accept=".xlsx, .xls"
- :headers="upload.headers"
- :action="upload.url + '?updateSupport=' + upload.updateSupport"
- :disabled="upload.isUploading"
- :on-progress="handleFileUploadProgress"
- :on-success="handleFileSuccess"
- :auto-upload="false"
- drag
- >
+ <el-dialog :title="upload.title"
+ v-model="upload.open"
+ width="400px"
+ append-to-body>
+ <el-upload ref="uploadRef"
+ :limit="1"
+ accept=".xlsx, .xls"
+ :headers="upload.headers"
+ :action="upload.url + '?updateSupport=' + upload.updateSupport"
+ :disabled="upload.isUploading"
+ :on-progress="handleFileUploadProgress"
+ :on-success="handleFileSuccess"
+ :auto-upload="false"
+ drag>
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
<div class="el-upload__text">灏嗘枃浠舵嫋鍒版澶勶紝鎴�<em>鐐瑰嚮涓婁紶</em></div>
<template #tip>
@@ -66,7 +78,8 @@
</el-upload>
<template #footer>
<div class="dialog-footer">
- <el-button type="primary" @click="submitFileForm">纭� 瀹�</el-button>
+ <el-button type="primary"
+ @click="submitFileForm">纭� 瀹�</el-button>
<el-button @click="upload.open = false">鍙� 娑�</el-button>
</div>
</template>
@@ -76,258 +89,259 @@
</template>
<script setup>
-import { Search } from "@element-plus/icons-vue";
-import { onMounted, ref, defineAsyncComponent } from "vue";
-import FormDia from "@/views/personnelManagement/contractManagement/components/formDia.vue";
-const RenewContract = defineAsyncComponent(() => import("@/views/personnelManagement/employeeRecord/components/RenewContract.vue"));
-import { ElMessageBox } from "element-plus";
-import { staffOnJobListPage } from "@/api/personnelManagement/staffOnJob.js";
-import dayjs from "dayjs";
-import { getToken } from "@/utils/auth.js";
-import FilesDia from "./filesDia.vue";
-const data = reactive({
- searchForm: {
- staffName: "",
- entryDate: null, // 褰曞叆鏃ユ湡
- entryDateStart: undefined,
- entryDateEnd: undefined,
- },
-});
-const { searchForm } = toRefs(data);
-const tableColumn = ref([
- {
- label: "鐘舵��",
- prop: "staffState",
- dataType: "tag",
- formatData: (params) => {
- if (params == 0) {
- return "绂昏亴";
- } else if (params == 1) {
- return "鍦ㄨ亴";
- } else {
- return null;
- }
+ import { Search } from "@element-plus/icons-vue";
+ import { onMounted, ref, defineAsyncComponent } from "vue";
+ import FormDia from "@/views/personnelManagement/contractManagement/components/formDia.vue";
+ const RenewContract = defineAsyncComponent(() =>
+ import(
+ "@/views/personnelManagement/employeeRecord/components/RenewContract.vue"
+ )
+ );
+ import { ElMessageBox } from "element-plus";
+ import { staffOnJobListPage } from "@/api/personnelManagement/staffOnJob.js";
+ import dayjs from "dayjs";
+ import { getToken } from "@/utils/auth.js";
+ import FilesDia from "./filesDia.vue";
+ const data = reactive({
+ searchForm: {
+ staffName: "",
+ entryDate: null, // 褰曞叆鏃ユ湡
+ entryDateStart: undefined,
+ entryDateEnd: undefined,
},
- formatType: (params) => {
- if (params == 0) {
- return "danger";
- } else if (params == 1) {
- return "primary";
- } else {
- return null;
- }
- },
- },
- {
- label: "鍛樺伐缂栧彿",
- prop: "staffNo",
- },
- {
- label: "濮撳悕",
- prop: "staffName",
- },
- {
- label: "鎬у埆",
- prop: "sex",
- },
- {
- label: "鎴风睄浣忓潃",
- prop: "nativePlace",
- },
- {
- label: "宀椾綅",
- prop: "postName",
- },
- {
- label: "鐜颁綇鍧�",
- prop: "adress",
- width: 200
- },
- {
- label: "绗竴瀛﹀巻",
- prop: "firstStudy",
- },
- {
- label: "涓撲笟",
- prop: "profession",
- width: 100
- },
- {
- label: "骞撮緞",
- prop: "age",
- },
- {
- label: "鑱旂郴鐢佃瘽",
- prop: "phone",
- width: 150
- },
- {
- label: "绱ф�ヨ仈绯讳汉",
- prop: "emergencyContact",
- width: 120
- },
- {
- label: "绱ф�ヨ仈绯讳汉鐢佃瘽",
- prop: "emergencyContactPhone",
- width: 150
- },
- // {
- // label: "鍚堝悓骞撮檺",
- // prop: "contractTerm",
- // },
- // {
- // label: "鍚堝悓寮�濮嬫棩鏈�",
- // prop: "contractStartTime",
- // width: 120
- // },
- {
- label: "鍚堝悓缁撴潫鏃ユ湡",
- prop: "contractExpireTime",
- width: 120
- },
- {
- dataType: "action",
- label: "鎿嶄綔",
- align: "center",
- fixed: 'right',
- width: 160,
- operation: [
- {
- name: "璇︽儏",
- type: "text",
- clickFun: (row) => {
- openForm("edit", row);
- },
+ });
+ const { searchForm } = toRefs(data);
+ const tableColumn = ref([
+ {
+ label: "鐘舵��",
+ prop: "staffState",
+ dataType: "tag",
+ formatData: params => {
+ if (params == 0) {
+ return "绂昏亴";
+ } else if (params == 1) {
+ return "鍦ㄨ亴";
+ } else {
+ return null;
+ }
},
- {
- name: "缁鍚堝悓",
- type: "text",
- showHide: row => row.staffState === 1,
- clickFun: (row) => {
- isShowRenewContractModal.value = true;
- id.value = row.id;
+ formatType: params => {
+ if (params == 0) {
+ return "danger";
+ } else if (params == 1) {
+ return "primary";
+ } else {
+ return null;
+ }
+ },
+ },
+ {
+ label: "鍛樺伐缂栧彿",
+ prop: "staffNo",
+ },
+ {
+ label: "濮撳悕",
+ prop: "staffName",
+ },
+ {
+ label: "鎬у埆",
+ prop: "sex",
+ },
+ {
+ label: "宀椾綅",
+ prop: "postName",
+ },
+ {
+ label: "绗竴瀛﹀巻",
+ prop: "firstStudy",
+ },
+ {
+ label: "涓撲笟",
+ prop: "profession",
+ width: 100,
+ },
+ {
+ label: "骞撮緞",
+ prop: "age",
+ },
+ {
+ label: "鑱旂郴鐢佃瘽",
+ prop: "phone",
+ width: 150,
+ },
+ {
+ label: "绱ф�ヨ仈绯讳汉",
+ prop: "emergencyContact",
+ width: 120,
+ },
+ {
+ label: "绱ф�ヨ仈绯讳汉鐢佃瘽",
+ prop: "emergencyContactPhone",
+ width: 150,
+ },
+ // {
+ // label: "鍚堝悓骞撮檺",
+ // prop: "contractTerm",
+ // },
+ // {
+ // label: "鍚堝悓寮�濮嬫棩鏈�",
+ // prop: "contractStartTime",
+ // width: 120
+ // },
+ {
+ label: "鍚堝悓缁撴潫鏃ユ湡",
+ prop: "contractExpireTime",
+ width: 120,
+ },
+ {
+ dataType: "action",
+ label: "鎿嶄綔",
+ align: "center",
+ fixed: "right",
+ width: 160,
+ operation: [
+ {
+ name: "璇︽儏",
+ type: "text",
+ clickFun: row => {
+ openForm("edit", row);
+ },
},
- }
- ],
- },
-]);
-const filesDia = ref()
-const isShowRenewContractModal = ref(false);
-const id = ref(0);
-const tableData = ref([]);
-const selectedRows = ref([]);
-const tableLoading = ref(false);
-const page = reactive({
- current: 1,
- size: 100,
- total: 0,
-});
-const formDia = ref()
-const { proxy } = getCurrentInstance()
+ {
+ name: "缁鍚堝悓",
+ type: "text",
+ showHide: row => row.staffState === 1,
+ clickFun: row => {
+ isShowRenewContractModal.value = true;
+ id.value = row.id;
+ },
+ },
+ ],
+ },
+ ]);
+ const filesDia = ref();
+ const isShowRenewContractModal = ref(false);
+ const id = ref(0);
+ const tableData = ref([]);
+ const selectedRows = ref([]);
+ const tableLoading = ref(false);
+ const page = reactive({
+ current: 1,
+ size: 100,
+ total: 0,
+ });
+ const formDia = ref();
+ const { proxy } = getCurrentInstance();
-const changeDaterange = (value) => {
- searchForm.value.entryDateStart = undefined;
- searchForm.value.entryDateEnd = undefined;
- if (value) {
- searchForm.value.entryDateStart = dayjs(value[0]).format("YYYY-MM-DD");
- searchForm.value.entryDateEnd = dayjs(value[1]).format("YYYY-MM-DD");
- }
- getList();
-};
-// 鎵撳紑闄勪欢寮规
-const openFilesFormDia = (row) => {
- console.log(row)
- nextTick(() => {
- filesDia.value?.openDialog( row,'鍚堝悓')
- })
-};
-// 鏌ヨ鍒楄〃
-/** 鎼滅储鎸夐挳鎿嶄綔 */
-const handleQuery = () => {
- page.current = 1;
- getList();
-};
-const pagination = (obj) => {
- page.current = obj.page;
- page.size = obj.limit;
- getList();
-};
-const getList = () => {
- tableLoading.value = true;
- const params = { ...searchForm.value, ...page };
- params.entryDate = undefined
- params.staffState = 1
- staffOnJobListPage(params).then(res => {
- tableLoading.value = false;
- tableData.value = res.data.records
- page.total = res.data.total;
- }).catch(err => {
- tableLoading.value = false;
- })
-};
-// 琛ㄦ牸閫夋嫨鏁版嵁
-const handleSelectionChange = (selection) => {
- selectedRows.value = selection;
-};
-
-// 鎵撳紑寮规
-const openForm = (type, row) => {
- nextTick(() => {
- formDia.value?.openDialog(type, row)
- })
-};
-// 瀵煎嚭
-const handleOut = () => {
- ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
- confirmButtonText: "纭",
- cancelButtonText: "鍙栨秷",
- type: "warning",
- })
- .then(() => {
- proxy.download("/staff/staffOnJob/export", {staffState: 1}, "鍚堝悓绠$悊.xlsx");
- })
- .catch(() => {
- proxy.$modal.msg("宸插彇娑�");
+ const changeDaterange = value => {
+ searchForm.value.entryDateStart = undefined;
+ searchForm.value.entryDateEnd = undefined;
+ if (value) {
+ searchForm.value.entryDateStart = dayjs(value[0]).format("YYYY-MM-DD");
+ searchForm.value.entryDateEnd = dayjs(value[1]).format("YYYY-MM-DD");
+ }
+ getList();
+ };
+ // 鎵撳紑闄勪欢寮规
+ const openFilesFormDia = row => {
+ console.log(row);
+ nextTick(() => {
+ filesDia.value?.openDialog(row, "鍚堝悓");
});
-};
-const upload = reactive({
- // 鏄惁鏄剧ず寮瑰嚭灞傦紙鍚堝悓瀵煎叆锛�
- open: false,
- // 寮瑰嚭灞傛爣棰橈紙鍚堝悓瀵煎叆锛�
- title: "",
- // 鏄惁绂佺敤涓婁紶
- isUploading: false,
- // 鏄惁鏇存柊宸茬粡瀛樺湪鐨勭敤鎴锋暟鎹�
- updateSupport: 1,
- // 璁剧疆涓婁紶鐨勮姹傚ご閮�
- headers: { Authorization: "Bearer " + getToken() },
- // 涓婁紶鐨勫湴鍧�
- url: import.meta.env.VITE_APP_BASE_API + "/staff/staffOnJob/import",
-});
-/** 瀵煎叆鎸夐挳鎿嶄綔 */
-function handleImport() {
- upload.title = "鍚堝悓瀵煎叆";
- upload.open = true;
-}
-/** 鎻愪氦涓婁紶鏂囦欢 */
-function submitFileForm() {
- console.log(upload.url + '?updateSupport=' + upload.updateSupport)
- proxy.$refs["uploadRef"].submit();
-}
-/**鏂囦欢涓婁紶涓鐞� */
-const handleFileUploadProgress = (event, file, fileList) => {
- upload.isUploading = true;
-};
-/** 鏂囦欢涓婁紶鎴愬姛澶勭悊 */
-const handleFileSuccess = (response, file, fileList) => {
- upload.open = false;
- upload.isUploading = false;
- proxy.$refs["uploadRef"].handleRemove(file);
- getList();
-};
-onMounted(() => {
- getList();
-});
+ };
+ // 鏌ヨ鍒楄〃
+ /** 鎼滅储鎸夐挳鎿嶄綔 */
+ const handleQuery = () => {
+ page.current = 1;
+ getList();
+ };
+ const pagination = obj => {
+ page.current = obj.page;
+ page.size = obj.limit;
+ getList();
+ };
+ const getList = () => {
+ tableLoading.value = true;
+ const params = { ...searchForm.value, ...page };
+ params.entryDate = undefined;
+ params.staffState = 1;
+ staffOnJobListPage(params)
+ .then(res => {
+ tableLoading.value = false;
+ tableData.value = res.data.records;
+ page.total = res.data.total;
+ })
+ .catch(err => {
+ tableLoading.value = false;
+ });
+ };
+ // 琛ㄦ牸閫夋嫨鏁版嵁
+ const handleSelectionChange = selection => {
+ selectedRows.value = selection;
+ };
+
+ // 鎵撳紑寮规
+ const openForm = (type, row) => {
+ nextTick(() => {
+ formDia.value?.openDialog(type, row);
+ });
+ };
+ // 瀵煎嚭
+ const handleOut = () => {
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ proxy.download(
+ "/staff/staffOnJob/export",
+ { staffState: 1 },
+ "鍚堝悓绠$悊.xlsx"
+ );
+ })
+ .catch(() => {
+ proxy.$modal.msg("宸插彇娑�");
+ });
+ };
+ const upload = reactive({
+ // 鏄惁鏄剧ず寮瑰嚭灞傦紙鍚堝悓瀵煎叆锛�
+ open: false,
+ // 寮瑰嚭灞傛爣棰橈紙鍚堝悓瀵煎叆锛�
+ title: "",
+ // 鏄惁绂佺敤涓婁紶
+ isUploading: false,
+ // 鏄惁鏇存柊宸茬粡瀛樺湪鐨勭敤鎴锋暟鎹�
+ updateSupport: 1,
+ // 璁剧疆涓婁紶鐨勮姹傚ご閮�
+ headers: { Authorization: "Bearer " + getToken() },
+ // 涓婁紶鐨勫湴鍧�
+ url: import.meta.env.VITE_APP_BASE_API + "/staff/staffOnJob/import",
+ });
+ /** 瀵煎叆鎸夐挳鎿嶄綔 */
+ function handleImport() {
+ upload.title = "鍚堝悓瀵煎叆";
+ upload.open = true;
+ }
+ /** 鎻愪氦涓婁紶鏂囦欢 */
+ function submitFileForm() {
+ console.log(upload.url + "?updateSupport=" + upload.updateSupport);
+ proxy.$refs["uploadRef"].submit();
+ }
+ /**鏂囦欢涓婁紶涓鐞� */
+ const handleFileUploadProgress = (event, file, fileList) => {
+ upload.isUploading = true;
+ };
+ /** 鏂囦欢涓婁紶鎴愬姛澶勭悊 */
+ const handleFileSuccess = (response, file, fileList) => {
+ upload.open = false;
+ upload.isUploading = false;
+ proxy.$refs["uploadRef"].handleRemove(file);
+ getList();
+ };
+ onMounted(() => {
+ getList();
+ });
</script>
<style scoped></style>
diff --git a/src/views/personnelManagement/dimission/components/formDia.vue b/src/views/personnelManagement/dimission/components/formDia.vue
index 86c59ce..20c1794 100644
--- a/src/views/personnelManagement/dimission/components/formDia.vue
+++ b/src/views/personnelManagement/dimission/components/formDia.vue
@@ -1,29 +1,31 @@
<template>
<div>
- <el-dialog
- v-model="dialogFormVisible"
- :title="operationType === 'add' ? '鏂板绂昏亴' : '缂栬緫绂昏亴'"
- width="70%"
- @close="closeDia"
- >
+ <el-dialog v-model="dialogFormVisible"
+ :title="operationType === 'add' ? '鏂板绂昏亴' : '缂栬緫绂昏亴'"
+ width="70%"
+ @close="closeDia">
<!-- 鍛樺伐淇℃伅灞曠ず鍖哄煙 -->
<div class="info-section">
<div class="info-title">鍛樺伐淇℃伅</div>
- <el-form :model="form" label-width="200px" label-position="left" :rules="rules" ref="formRef" style="margin-top: 20px">
+ <el-form :model="form"
+ label-width="200px"
+ label-position="left"
+ :rules="rules"
+ ref="formRef"
+ style="margin-top: 20px">
<el-row :gutter="30">
<el-col :span="12">
- <el-form-item label="濮撳悕锛�" prop="staffOnJobId">
+ <el-form-item label="濮撳悕锛�"
+ prop="staffOnJobId">
<el-select v-model="form.staffOnJobId"
placeholder="璇烽�夋嫨浜哄憳"
style="width: 100%"
:disabled="operationType === 'edit'"
@change="handleSelect">
- <el-option
- v-for="item in personList"
- :key="item.id"
- :label="item.staffName"
- :value="item.id"
- />
+ <el-option v-for="item in personList"
+ :key="item.id"
+ :label="item.staffName"
+ :value="item.id" />
</el-select>
</el-form-item>
</el-col>
@@ -39,21 +41,11 @@
{{ currentStaffRecord.sex || '-' }}
</el-form-item>
</el-col>
- <el-col :span="12">
- <el-form-item label="鎴风睄浣忓潃锛�">
- {{ currentStaffRecord.nativePlace || '-' }}
- </el-form-item>
- </el-col>
</el-row>
<el-row :gutter="30">
<el-col :span="12">
<el-form-item label="宀椾綅锛�">
{{ currentStaffRecord.postName || '-' }}
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="鐜颁綇鍧�锛�">
- {{ currentStaffRecord.adress || '-' }}
</el-form-item>
</el-col>
</el-row>
@@ -97,74 +89,74 @@
</el-row>
<el-row :gutter="30">
<el-col :span="12">
- <el-form-item label="绂昏亴鏃ユ湡锛�" prop="leaveDate">
- <el-date-picker
- v-model="form.leaveDate"
- type="date"
- :disabled="operationType === 'edit'"
- :disabled-date="disabledFutureDate"
- placeholder="璇烽�夋嫨绂昏亴鏃ユ湡"
- value-format="YYYY-MM-DD"
- format="YYYY-MM-DD"
- style="width: 100%"
- />
+ <el-form-item label="绂昏亴鏃ユ湡锛�"
+ prop="leaveDate">
+ <el-date-picker v-model="form.leaveDate"
+ type="date"
+ :disabled="operationType === 'edit'"
+ :disabled-date="disabledFutureDate"
+ placeholder="璇烽�夋嫨绂昏亴鏃ユ湡"
+ value-format="YYYY-MM-DD"
+ format="YYYY-MM-DD"
+ style="width: 100%" />
</el-form-item>
</el-col>
<el-col :span="12">
- <el-form-item label="绂昏亴鍘熷洜锛�" prop="reason">
- <el-select v-model="form.reason" placeholder="璇烽�夋嫨绂昏亴鍘熷洜" style="width: 100%" @change="handleSelectDimissionReason">
- <el-option
- v-for="(item, index) in dimissionReasonOptions"
- :key="index"
- :label="item.label"
- :value="item.value"
- />
+ <el-form-item label="绂昏亴鍘熷洜锛�"
+ prop="reason">
+ <el-select v-model="form.reason"
+ placeholder="璇烽�夋嫨绂昏亴鍘熷洜"
+ style="width: 100%"
+ @change="handleSelectDimissionReason">
+ <el-option v-for="(item, index) in dimissionReasonOptions"
+ :key="index"
+ :label="item.label"
+ :value="item.value" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="30">
<el-col :span="12">
- <el-form-item label="澶囨敞锛�" prop="remark" v-if="form.reason === 'other'">
- <el-input
- v-model="form.remark"
- type="textarea"
- :rows="3"
- placeholder="澶囨敞"
- maxlength="500"
- show-word-limit
- />
+ <el-form-item label="澶囨敞锛�"
+ prop="remark"
+ v-if="form.reason === 'other'">
+ <el-input v-model="form.remark"
+ type="textarea"
+ :rows="3"
+ placeholder="澶囨敞"
+ maxlength="500"
+ show-word-limit />
</el-form-item>
</el-col>
</el-row>
</el-form>
-
-<!-- <el-row :gutter="30">-->
-<!-- <el-col :span="12">-->
-<!-- <div class="info-item">-->
-<!-- <span class="info-label">绂昏亴鍘熷洜锛�</span>-->
-<!-- <el-select v-model="form.reason" placeholder="璇烽�夋嫨浜哄憳" style="width: 100%" @change="handleSelect">-->
-<!-- <el-option-->
-<!-- v-for="(item, index) in dimissionReasonOptions"-->
-<!-- :key="index"-->
-<!-- :label="item.label"-->
-<!-- :value="item.value"-->
-<!-- />-->
-<!-- </el-select>-->
-<!-- </div>-->
-<!-- </el-col>-->
-<!-- <el-col :span="12">-->
-<!-- <div class="info-item">-->
-<!-- <span class="info-label">鍛樺伐缂栧彿锛�</span>-->
-<!-- <span class="info-value">{{ form.staffNo || '-' }}</span>-->
-<!-- </div>-->
-<!-- </el-col>-->
-<!-- </el-row>-->
+ <!-- <el-row :gutter="30">-->
+ <!-- <el-col :span="12">-->
+ <!-- <div class="info-item">-->
+ <!-- <span class="info-label">绂昏亴鍘熷洜锛�</span>-->
+ <!-- <el-select v-model="form.reason" placeholder="璇烽�夋嫨浜哄憳" style="width: 100%" @change="handleSelect">-->
+ <!-- <el-option-->
+ <!-- v-for="(item, index) in dimissionReasonOptions"-->
+ <!-- :key="index"-->
+ <!-- :label="item.label"-->
+ <!-- :value="item.value"-->
+ <!-- />-->
+ <!-- </el-select>-->
+ <!-- </div>-->
+ <!-- </el-col>-->
+ <!-- <el-col :span="12">-->
+ <!-- <div class="info-item">-->
+ <!-- <span class="info-label">鍛樺伐缂栧彿锛�</span>-->
+ <!-- <span class="info-value">{{ form.staffNo || '-' }}</span>-->
+ <!-- </div>-->
+ <!-- </el-col>-->
+ <!-- </el-row>-->
</div>
-
<template #footer>
<div class="dialog-footer">
- <el-button type="primary" @click="submitForm">纭</el-button>
+ <el-button type="primary"
+ @click="submitForm">纭</el-button>
<el-button @click="closeDia">鍙栨秷</el-button>
</div>
</template>
@@ -173,175 +165,180 @@
</template>
<script setup>
-import {ref, reactive, toRefs, getCurrentInstance} from "vue";
-import {staffOnJobListPage} from "@/api/personnelManagement/staffOnJob.js";
-import {createStaffLeave, updateStaffLeave} from "@/api/personnelManagement/staffLeave.js";
-const { proxy } = getCurrentInstance()
-const emit = defineEmits(['close'])
+ import { ref, reactive, toRefs, getCurrentInstance } from "vue";
+ import { staffOnJobListPage } from "@/api/personnelManagement/staffOnJob.js";
+ import {
+ createStaffLeave,
+ updateStaffLeave,
+ } from "@/api/personnelManagement/staffLeave.js";
+ const { proxy } = getCurrentInstance();
+ const emit = defineEmits(["close"]);
-const dialogFormVisible = ref(false);
-const operationType = ref('')
-const getTodayDate = () => {
- const now = new Date();
- const year = now.getFullYear();
- const month = `${now.getMonth() + 1}`.padStart(2, '0');
- const day = `${now.getDate()}`.padStart(2, '0');
- return `${year}-${month}-${day}`;
-};
-
-const disabledFutureDate = (time) => {
- const todayEnd = new Date();
- todayEnd.setHours(23, 59, 59, 999);
- return time.getTime() > todayEnd.getTime();
-};
-const data = reactive({
- form: {
- staffOnJobId: undefined,
- leaveDate: "",
- reason: "",
- remark: "",
- },
- rules: {
- staffName: [{ required: true, message: "璇烽�夋嫨浜哄憳" }],
- leaveDate: [{ required: true, message: "璇烽�夋嫨绂昏亴鏃ユ湡", trigger: "change" }],
- reason: [{ required: true, message: "璇烽�夋嫨绂昏亴鍘熷洜"}],
- },
- dimissionReasonOptions: [
- {label: '钖祫寰呴亣', value: 'salary'},
- {label: '鑱屼笟鍙戝睍', value: 'career_development'},
- {label: '宸ヤ綔鐜', value: 'work_environment'},
- {label: '涓汉鍘熷洜', value: 'personal_reason'},
- {label: '鍏朵粬', value: 'other'},
- ],
- currentStaffRecord: {},
-});
-const { form, rules, dimissionReasonOptions, currentStaffRecord } = toRefs(data);
-
-// 鎵撳紑寮规
-const openDialog = (type, row) => {
- operationType.value = type;
- dialogFormVisible.value = true;
- if (operationType.value === 'edit') {
- currentStaffRecord.value = row
- form.value.staffOnJobId = row.staffOnJobId
- form.value.leaveDate = row.leaveDate
- form.value.reason = row.reason
- form.value.remark = row.remark
- personList.value = [
- {
- staffName: row.staffName,
- id: row.staffOnJobId,
- }
- ]
- } else {
- form.value.leaveDate = getTodayDate()
- getList()
- }
-}
-
-const handleSelectDimissionReason = (val) => {
- if (val === 'other') {
- form.value.remark = ''
- }
-}
-// 鎻愪氦浜у搧琛ㄥ崟
-const submitForm = () => {
- form.value.staffState = 0
- if (form.value.reason !== 'other') {
- form.value.remark = ''
- }
- proxy.$refs["formRef"].validate(valid => {
- if (valid) {
- if (operationType.value === "add") {
- createStaffLeave(form.value).then(res => {
- proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
- closeDia();
- })
- } else {
- updateStaffLeave(currentStaffRecord.value.id, form.value).then(res => {
- proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
- closeDia();
- })
- }
- }
- })
-
-}
-// 鍏抽棴寮规
-const closeDia = () => {
- // 琛ㄥ崟宸叉敞閲婏紝鎵嬪姩閲嶇疆琛ㄥ崟鏁版嵁
- form.value = {
- staffOnJobId: undefined,
- leaveDate: "",
- reason: "",
- remark: "",
+ const dialogFormVisible = ref(false);
+ const operationType = ref("");
+ const getTodayDate = () => {
+ const now = new Date();
+ const year = now.getFullYear();
+ const month = `${now.getMonth() + 1}`.padStart(2, "0");
+ const day = `${now.getDate()}`.padStart(2, "0");
+ return `${year}-${month}-${day}`;
};
- dialogFormVisible.value = false;
- emit('close')
-};
-const personList = ref([]);
+ const disabledFutureDate = time => {
+ const todayEnd = new Date();
+ todayEnd.setHours(23, 59, 59, 999);
+ return time.getTime() > todayEnd.getTime();
+ };
+ const data = reactive({
+ form: {
+ staffOnJobId: undefined,
+ leaveDate: "",
+ reason: "",
+ remark: "",
+ },
+ rules: {
+ staffName: [{ required: true, message: "璇烽�夋嫨浜哄憳" }],
+ leaveDate: [
+ { required: true, message: "璇烽�夋嫨绂昏亴鏃ユ湡", trigger: "change" },
+ ],
+ reason: [{ required: true, message: "璇烽�夋嫨绂昏亴鍘熷洜" }],
+ },
+ dimissionReasonOptions: [
+ { label: "钖祫寰呴亣", value: "salary" },
+ { label: "鑱屼笟鍙戝睍", value: "career_development" },
+ { label: "宸ヤ綔鐜", value: "work_environment" },
+ { label: "涓汉鍘熷洜", value: "personal_reason" },
+ { label: "鍏朵粬", value: "other" },
+ ],
+ currentStaffRecord: {},
+ });
+ const { form, rules, dimissionReasonOptions, currentStaffRecord } =
+ toRefs(data);
-/**
- * 鑾峰彇褰撳墠鍦ㄨ亴浜哄憳鍒楄〃
- */
-const getList = () => {
- staffOnJobListPage({
- current: -1,
- size: -1,
- staffState: 1
- }).then(res => {
- personList.value = res.data.records || []
- })
-};
+ // 鎵撳紑寮规
+ const openDialog = (type, row) => {
+ operationType.value = type;
+ dialogFormVisible.value = true;
+ if (operationType.value === "edit") {
+ currentStaffRecord.value = row;
+ form.value.staffOnJobId = row.staffOnJobId;
+ form.value.leaveDate = row.leaveDate;
+ form.value.reason = row.reason;
+ form.value.remark = row.remark;
+ personList.value = [
+ {
+ staffName: row.staffName,
+ id: row.staffOnJobId,
+ },
+ ];
+ } else {
+ form.value.leaveDate = getTodayDate();
+ getList();
+ }
+ };
-const handleSelect = (val) => {
- let obj = personList.value.find(item => item.id === val)
- currentStaffRecord.value = {}
- if (obj) {
- // 淇濈暀绂昏亴鏃ユ湡鍜岀鑱屽師鍥狅紝鍙洿鏂板憳宸ヤ俊鎭�
- currentStaffRecord.value = obj
- }
-}
-defineExpose({
- openDialog,
-});
+ const handleSelectDimissionReason = val => {
+ if (val === "other") {
+ form.value.remark = "";
+ }
+ };
+ // 鎻愪氦浜у搧琛ㄥ崟
+ const submitForm = () => {
+ form.value.staffState = 0;
+ if (form.value.reason !== "other") {
+ form.value.remark = "";
+ }
+ proxy.$refs["formRef"].validate(valid => {
+ if (valid) {
+ if (operationType.value === "add") {
+ createStaffLeave(form.value).then(res => {
+ proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
+ closeDia();
+ });
+ } else {
+ updateStaffLeave(currentStaffRecord.value.id, form.value).then(res => {
+ proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
+ closeDia();
+ });
+ }
+ }
+ });
+ };
+ // 鍏抽棴寮规
+ const closeDia = () => {
+ // 琛ㄥ崟宸叉敞閲婏紝鎵嬪姩閲嶇疆琛ㄥ崟鏁版嵁
+ form.value = {
+ staffOnJobId: undefined,
+ leaveDate: "",
+ reason: "",
+ remark: "",
+ };
+ dialogFormVisible.value = false;
+ emit("close");
+ };
+
+ const personList = ref([]);
+
+ /**
+ * 鑾峰彇褰撳墠鍦ㄨ亴浜哄憳鍒楄〃
+ */
+ const getList = () => {
+ staffOnJobListPage({
+ current: -1,
+ size: -1,
+ staffState: 1,
+ }).then(res => {
+ personList.value = res.data.records || [];
+ });
+ };
+
+ const handleSelect = val => {
+ let obj = personList.value.find(item => item.id === val);
+ currentStaffRecord.value = {};
+ if (obj) {
+ // 淇濈暀绂昏亴鏃ユ湡鍜岀鑱屽師鍥狅紝鍙洿鏂板憳宸ヤ俊鎭�
+ currentStaffRecord.value = obj;
+ }
+ };
+ defineExpose({
+ openDialog,
+ });
</script>
<style scoped>
-.info-section {
- background: #f5f7fa;
- padding: 20px;
- border-radius: 8px;
- margin-bottom: 20px;
-}
+ .info-section {
+ background: #f5f7fa;
+ padding: 20px;
+ border-radius: 8px;
+ margin-bottom: 20px;
+ }
-.info-title {
- font-size: 16px;
- font-weight: 600;
- color: #303133;
- margin-bottom: 20px;
- padding-bottom: 10px;
- border-bottom: 1px solid #e4e7ed;
-}
+ .info-title {
+ font-size: 16px;
+ font-weight: 600;
+ color: #303133;
+ margin-bottom: 20px;
+ padding-bottom: 10px;
+ border-bottom: 1px solid #e4e7ed;
+ }
-.info-item {
- display: flex;
- align-items: center;
- margin-bottom: 16px;
- min-height: 32px;
-}
+ .info-item {
+ display: flex;
+ align-items: center;
+ margin-bottom: 16px;
+ min-height: 32px;
+ }
-.info-label {
- min-width: 140px;
- color: #606266;
- font-size: 14px;
- font-weight: 500;
-}
+ .info-label {
+ min-width: 140px;
+ color: #606266;
+ font-size: 14px;
+ font-weight: 500;
+ }
-.info-value {
- flex: 1;
- color: #303133;
- font-size: 14px;
-}
+ .info-value {
+ flex: 1;
+ color: #303133;
+ font-size: 14px;
+ }
</style>
diff --git a/src/views/personnelManagement/dimission/index.vue b/src/views/personnelManagement/dimission/index.vue
index c2b8c3e..4a37ae3 100644
--- a/src/views/personnelManagement/dimission/index.vue
+++ b/src/views/personnelManagement/dimission/index.vue
@@ -3,216 +3,209 @@
<div class="search_form mb20">
<div>
<span class="search_title">濮撳悕锛�</span>
- <el-input
- v-model="searchForm.staffName"
- style="width: 240px"
- placeholder="璇疯緭鍏ュ鍚嶆悳绱�"
- @change="handleQuery"
- clearable
- :prefix-icon="Search"
- />
- <el-button type="primary" @click="handleQuery" style="margin-left: 10px"
- >鎼滅储</el-button
- >
+ <el-input v-model="searchForm.staffName"
+ style="width: 240px"
+ placeholder="璇疯緭鍏ュ鍚嶆悳绱�"
+ @change="handleQuery"
+ clearable
+ :prefix-icon="Search" />
+ <el-button type="primary"
+ @click="handleQuery"
+ style="margin-left: 10px">鎼滅储</el-button>
</div>
<div>
- <el-button type="primary" @click="openForm('add')">鏂板绂昏亴</el-button>
+ <el-button type="primary"
+ @click="openForm('add')">鏂板绂昏亴</el-button>
<el-button @click="handleOut">瀵煎嚭</el-button>
<!-- <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button> -->
</div>
</div>
<div class="table_list">
- <PIMTable
- rowKey="id"
- :column="tableColumn"
- :tableData="tableData"
- :page="page"
- :isSelection="true"
- @selection-change="handleSelectionChange"
- :tableLoading="tableLoading"
- @pagination="pagination"
- :total="page.total"
- ></PIMTable>
+ <PIMTable rowKey="id"
+ :column="tableColumn"
+ :tableData="tableData"
+ :page="page"
+ :isSelection="true"
+ @selection-change="handleSelectionChange"
+ :tableLoading="tableLoading"
+ @pagination="pagination"
+ :total="page.total"></PIMTable>
</div>
- <form-dia ref="formDia" @close="handleQuery"></form-dia>
+ <form-dia ref="formDia"
+ @close="handleQuery"></form-dia>
</div>
</template>
<script setup>
-import { Search } from "@element-plus/icons-vue";
-import {onMounted, ref} from "vue";
-import FormDia from "@/views/personnelManagement/dimission/components/formDia.vue";
-import {findStaffLeaveListPage, batchDeleteStaffLeaves} from "@/api/personnelManagement/staffLeave.js";
-import {ElMessageBox} from "element-plus";
+ import { Search } from "@element-plus/icons-vue";
+ import { onMounted, ref } from "vue";
+ import FormDia from "@/views/personnelManagement/dimission/components/formDia.vue";
+ import {
+ findStaffLeaveListPage,
+ batchDeleteStaffLeaves,
+ } from "@/api/personnelManagement/staffLeave.js";
+ import { ElMessageBox } from "element-plus";
-const data = reactive({
- searchForm: {
- staffName: "",
- },
-});
-const { searchForm } = toRefs(data);
-const tableColumn = ref([
- {
- label: "鐘舵��",
- prop: "staffState",
- dataType: "tag",
- formatData: (params) => {
- if (params == 0) {
- return "绂昏亴";
- } else if (params == 1) {
- return "鍦ㄨ亴";
- } else {
- return null;
- }
+ const data = reactive({
+ searchForm: {
+ staffName: "",
},
- formatType: (params) => {
- if (params == 0) {
- return "danger";
- } else if (params == 1) {
- return "primary";
- } else {
- return null;
- }
- },
- },
- {
- label: "绂昏亴鏃ユ湡",
- prop: "leaveDate",
- },
- {
- label: "鍛樺伐缂栧彿",
- prop: "staffNo",
- },
- {
- label: "濮撳悕",
- prop: "staffName",
- },
- {
- label: "鎬у埆",
- prop: "sex",
- },
- {
- label: "鎴风睄浣忓潃",
- prop: "nativePlace",
- },
- {
- label: "閮ㄩ棬",
- prop: "deptName",
- },
- {
- label: "宀椾綅",
- prop: "postName",
- },
- {
- label: "鐜颁綇鍧�",
- prop: "adress",
- width:200
- },
- {
- label: "绗竴瀛﹀巻",
- prop: "firstStudy",
- },
- {
- label: "涓撲笟",
- prop: "profession",
- width:100
- },
- {
- label: "骞撮緞",
- prop: "age",
- },
- {
- label: "鑱旂郴鐢佃瘽",
- prop: "phone",
- width:150
- },
- {
- label: "绱ф�ヨ仈绯讳汉",
- prop: "emergencyContact",
- width: 120
- },
- {
- label: "绱ф�ヨ仈绯讳汉鐢佃瘽",
- prop: "emergencyContactPhone",
- width:150
- },
- {
- dataType: "action",
- label: "鎿嶄綔",
- align: "center",
- fixed: 'right',
- operation: [
- {
- name: "缂栬緫",
- type: "text",
- clickFun: (row) => {
- openForm("edit", row);
- },
+ });
+ const { searchForm } = toRefs(data);
+ const tableColumn = ref([
+ {
+ label: "鐘舵��",
+ prop: "staffState",
+ dataType: "tag",
+ formatData: params => {
+ if (params == 0) {
+ return "绂昏亴";
+ } else if (params == 1) {
+ return "鍦ㄨ亴";
+ } else {
+ return null;
+ }
},
- ],
- },
-]);
-const tableData = ref([]);
-const selectedRows = ref([]);
-const tableLoading = ref(false);
-const page = reactive({
- current: 1,
- size: 100,
- total: 0,
-});
-const formDia = ref()
-const { proxy } = getCurrentInstance()
+ formatType: params => {
+ if (params == 0) {
+ return "danger";
+ } else if (params == 1) {
+ return "primary";
+ } else {
+ return null;
+ }
+ },
+ },
+ {
+ label: "绂昏亴鏃ユ湡",
+ prop: "leaveDate",
+ },
+ {
+ label: "鍛樺伐缂栧彿",
+ prop: "staffNo",
+ },
+ {
+ label: "濮撳悕",
+ prop: "staffName",
+ },
+ {
+ label: "鎬у埆",
+ prop: "sex",
+ },
+ {
+ label: "閮ㄩ棬",
+ prop: "deptName",
+ },
+ {
+ label: "宀椾綅",
+ prop: "postName",
+ },
+ {
+ label: "绗竴瀛﹀巻",
+ prop: "firstStudy",
+ },
+ {
+ label: "涓撲笟",
+ prop: "profession",
+ width: 100,
+ },
+ {
+ label: "骞撮緞",
+ prop: "age",
+ },
+ {
+ label: "鑱旂郴鐢佃瘽",
+ prop: "phone",
+ width: 150,
+ },
+ {
+ label: "绱ф�ヨ仈绯讳汉",
+ prop: "emergencyContact",
+ width: 120,
+ },
+ {
+ label: "绱ф�ヨ仈绯讳汉鐢佃瘽",
+ prop: "emergencyContactPhone",
+ width: 150,
+ },
+ {
+ dataType: "action",
+ label: "鎿嶄綔",
+ align: "center",
+ fixed: "right",
+ operation: [
+ {
+ name: "缂栬緫",
+ type: "text",
+ clickFun: row => {
+ openForm("edit", row);
+ },
+ },
+ ],
+ },
+ ]);
+ const tableData = ref([]);
+ const selectedRows = ref([]);
+ const tableLoading = ref(false);
+ const page = reactive({
+ current: 1,
+ size: 100,
+ total: 0,
+ });
+ const formDia = ref();
+ const { proxy } = getCurrentInstance();
+ // 鏌ヨ鍒楄〃
+ /** 鎼滅储鎸夐挳鎿嶄綔 */
+ const handleQuery = () => {
+ page.current = 1;
+ getList();
+ };
+ const pagination = obj => {
+ page.current = obj.page;
+ page.size = obj.limit;
+ getList();
+ };
+ const getList = () => {
+ tableLoading.value = true;
+ findStaffLeaveListPage({ ...page, ...searchForm.value })
+ .then(res => {
+ tableLoading.value = false;
+ tableData.value = res.data.records;
+ page.total = res.data.total;
+ })
+ .catch(err => {
+ tableLoading.value = false;
+ });
+ };
+ // 琛ㄦ牸閫夋嫨鏁版嵁
+ const handleSelectionChange = selection => {
+ selectedRows.value = selection;
+ };
-// 鏌ヨ鍒楄〃
-/** 鎼滅储鎸夐挳鎿嶄綔 */
-const handleQuery = () => {
- page.current = 1;
- getList();
-};
-const pagination = (obj) => {
- page.current = obj.page;
- page.size = obj.limit;
- getList();
-};
-const getList = () => {
- tableLoading.value = true;
- findStaffLeaveListPage({...page, ...searchForm.value}).then(res => {
- tableLoading.value = false;
- tableData.value = res.data.records
- page.total = res.data.total;
- }).catch(err => {
- tableLoading.value = false;
- })
-};
-// 琛ㄦ牸閫夋嫨鏁版嵁
-const handleSelectionChange = (selection) => {
- selectedRows.value = selection;
-};
+ // 鎵撳紑寮规
+ const openForm = (type, row) => {
+ nextTick(() => {
+ formDia.value?.openDialog(type, row);
+ });
+ };
-// 鎵撳紑寮规
-const openForm = (type, row) => {
- nextTick(() => {
- formDia.value?.openDialog(type, row)
- })
-};
-
-// 鍒犻櫎
-const handleDelete = () => {
- let ids = [];
- if (selectedRows.value.length > 0) {
- ids = selectedRows.value.map((item) => item.id);
- } else {
- proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
- return;
- }
- ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "瀵煎嚭", {
- confirmButtonText: "纭",
- cancelButtonText: "鍙栨秷",
- type: "warning",
- })
+ // 鍒犻櫎
+ const handleDelete = () => {
+ let ids = [];
+ if (selectedRows.value.length > 0) {
+ ids = selectedRows.value.map(item => item.id);
+ } else {
+ proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
+ return;
+ }
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "瀵煎嚭", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
.then(() => {
- batchDeleteStaffLeaves(ids).then((res) => {
+ batchDeleteStaffLeaves(ids).then(res => {
proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
getList();
});
@@ -220,24 +213,24 @@
.catch(() => {
proxy.$modal.msg("宸插彇娑�");
});
-};
-// 瀵煎嚭
-const handleOut = () => {
- ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
- confirmButtonText: "纭",
- cancelButtonText: "鍙栨秷",
- type: "warning",
- })
+ };
+ // 瀵煎嚭
+ const handleOut = () => {
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
.then(() => {
proxy.download("/staff/staffLeave/export", {}, "浜哄憳绂昏亴.xlsx");
})
.catch(() => {
proxy.$modal.msg("宸插彇娑�");
});
-};
-onMounted(() => {
- getList();
-});
+ };
+ onMounted(() => {
+ getList();
+ });
</script>
<style scoped></style>
--
Gitblit v1.9.3