spring
8 天以前 a4f4241f24d171c49b52f81eae364bf79a7d7005
src/views/personnelManagement/employeeRecord/index.vue
@@ -14,6 +14,12 @@
        <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" />
        <!-- <span style="margin-left: 10px" class="search_title">状态:</span>
        <el-select v-model="searchForm.staffState" clearable placeholder="请选择状态" style="width: 140px">
          <el-option label="离职" :value="0" />
          <el-option label="在职" :value="1" />
          <el-option label="试用" :value="2" />
        </el-select> -->
        <el-button type="primary" @click="handleQuery" style="margin-left: 10px"
        >搜索</el-button
        >
@@ -38,6 +44,8 @@
      ></PIMTable>
    </div>
    <form-dia ref="formDia" @close="handleQuery"></form-dia>
    <regularize-dia ref="regularizeDiaRef" @success="getList" />
    <transfer-dia ref="transferDiaRef" @success="getList" />
  </div>
</template>
@@ -45,6 +53,8 @@
import { Search } from "@element-plus/icons-vue";
import {onMounted, ref} from "vue";
import FormDia from "@/views/personnelManagement/employeeRecord/components/formDia.vue";
import RegularizeDia from "@/views/personnelManagement/employeeRecord/components/regularizeDia.vue";
import TransferDia from "@/views/personnelManagement/employeeRecord/components/transferDia.vue";
import {ElMessageBox} from "element-plus";
import {staffOnJobListPage} from "@/api/personnelManagement/employeeRecord.js";
import dayjs from "dayjs";
@@ -52,12 +62,10 @@
const data = reactive({
  searchForm: {
    staffName: "",
    entryDate: [
      dayjs().format("YYYY-MM-DD"),
      dayjs().add(1, "day").format("YYYY-MM-DD"),
    ], // 录入日期
    entryDateStart: dayjs().format("YYYY-MM-DD"),
    entryDateEnd: dayjs().add(1, "day").format("YYYY-MM-DD"),
    staffState: 1,
    entryDate: undefined, // 录入日期
    entryDateStart: undefined,
    entryDateEnd: undefined,
  },
});
const { searchForm } = toRefs(data);
@@ -71,6 +79,8 @@
        return "离职";
      } else if (params == 1) {
        return "在职";
      } else if (params == 2) {
        return "试用";
      } else {
        return null;
      }
@@ -80,6 +90,8 @@
        return "danger";
      } else if (params == 1) {
        return "primary";
      } else if (params == 2) {
        return "warning";
      } else {
        return null;
      }
@@ -98,7 +110,7 @@
    prop: "sex",
  },
  {
    label: "籍贯",
    label: "户籍住址",
    prop: "nativePlace",
  },
  {
@@ -106,7 +118,7 @@
    prop: "postJob",
  },
  {
    label: "家庭住址",
    label: "现住址",
    prop: "adress",
    width:200
  },
@@ -118,11 +130,6 @@
    label: "专业",
    prop: "profession",
    width:100
  },
  {
    label: "身份证号",
    prop: "identityCard",
    width:200
  },
  {
    label: "年龄",
@@ -143,10 +150,10 @@
    prop: "emergencyContactPhone",
    width:150
  },
  {
    label: "合同年限",
    prop: "contractTerm",
  },
  // {
  //   label: "合同年限",
  //   prop: "contractTerm",
  // },
  // {
  //   label: "合同开始日期",
  //   prop: "contractStartTime",
@@ -162,12 +169,27 @@
    label: "操作",
    align: "center",
    fixed: 'right',
    width: 150,
    operation: [
      {
        name: "详情",
        type: "text",
        clickFun: (row) => {
          openForm("edit", row);
        },
      },
      {
        name: "转正",
        type: "text",
        clickFun: (row) => {
          openRegularizeDialog(row);
        },
      },
      {
        name: "调岗",
        type: "text",
        clickFun: (row) => {
          openTransferDialog(row);
        },
      },
    ],
@@ -182,6 +204,8 @@
  total: 0
});
const formDia = ref()
const regularizeDiaRef = ref()
const transferDiaRef = ref()
const { proxy } = getCurrentInstance()
const changeDaterange = (value) => {
@@ -208,7 +232,7 @@
  tableLoading.value = true;
  const params = { ...searchForm.value, ...page };
  params.entryDate = undefined
  staffOnJobListPage({...params, staffState: 1}).then(res => {
  staffOnJobListPage({...params}).then(res => {
    tableLoading.value = false;
    tableData.value = res.data.records
    page.total = res.data.total;
@@ -227,6 +251,12 @@
    formDia.value?.openDialog(type, row)
  })
};
const openRegularizeDialog = (row) => {
  regularizeDiaRef.value?.openDialog(row)
}
const openTransferDialog = (row) => {
  transferDiaRef.value?.openDialog(row)
}
// 导出
const handleOut = () => {
  ElMessageBox.confirm("选中的内容将被导出,是否确认导出?", "导出", {
@@ -235,7 +265,7 @@
    type: "warning",
  })
      .then(() => {
        proxy.download("/staff/staffOnJob/export", {staffState: 1}, "在职员工台账.xlsx");
        proxy.download("/staff/staffOnJob/export", { ...searchForm.value }, "员工台账.xlsx");
      })
      .catch(() => {
        proxy.$modal.msg("已取消");