zhangwencui
19 小时以前 b7754a0723ec899af5afc99a6be90c4a6d1dea4e
src/views/officeProcessAutomation/HrManage/staff-contract/index.vue
@@ -4,33 +4,48 @@
    <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"
      <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"
    <el-dialog :title="upload.title"
      v-model="upload.open"
      width="400px"
      append-to-body
    >
      <el-upload
        ref="uploadRef"
               append-to-body>
      <el-upload ref="uploadRef"
        :limit="1"
        accept=".xlsx, .xls"
        :headers="upload.headers"
@@ -39,8 +54,7 @@
        :on-progress="handleFileUploadProgress"
        :on-success="handleFileSuccess"
        :auto-upload="false"
        drag
      >
                 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>
@@ -83,7 +98,7 @@
    label: "状态",
    prop: "staffState",
    dataType: "tag",
    formatData: (params) => {
      formatData: params => {
      if (params == 0) {
        return "离职";
      } else if (params == 1) {
@@ -92,7 +107,7 @@
        return null;
      }
    },
    formatType: (params) => {
      formatType: params => {
      if (params == 0) {
        return "danger";
      } else if (params == 1) {
@@ -115,17 +130,8 @@
    prop: "sex",
  },
  {
    label: "户籍住址",
    prop: "nativePlace",
  },
  {
    label: "岗位",
    prop: "postName",
  },
  {
    label: "现住址",
    prop: "adress",
    width: 200
  },
  {
    label: "第一学历",
@@ -134,7 +140,7 @@
  {
    label: "专业",
    prop: "profession",
    width: 100
      width: 100,
  },
  {
    label: "年龄",
@@ -143,41 +149,41 @@
  {
    label: "联系电话",
    prop: "phone",
    width: 150
      width: 150,
  },
  {
    label: "紧急联系人",
    prop: "emergencyContact",
    width: 120
      width: 120,
  },
  {
    label: "紧急联系人电话",
    prop: "emergencyContactPhone",
    width: 150
      width: 150,
  },
  {
    label: "合同结束日期",
    prop: "contractExpireTime",
    width: 120
      width: 120,
  },
  {
    dataType: "action",
    label: "操作",
    align: "center",
    fixed: 'right',
      fixed: "right",
    width: 120,
    operation: [
      {
        name: "详情",
        type: "text",
        clickFun: (row) => {
          clickFun: row => {
          openForm("edit", row);
        },
      }
        },
    ],
  },
]);
const filesDia = ref()
  const filesDia = ref();
const tableData = ref([]);
const selectedRows = ref([]);
const tableLoading = ref(false);
@@ -186,10 +192,10 @@
  size: 100,
  total: 0,
});
const formDia = ref()
const { proxy } = getCurrentInstance()
  const formDia = ref();
  const { proxy } = getCurrentInstance();
const changeDaterange = (value) => {
  const changeDaterange = value => {
  searchForm.value.entryDateStart = undefined;
  searchForm.value.entryDateEnd = undefined;
  if (value) {
@@ -199,10 +205,10 @@
  getList();
};
// 打开附件弹框
const openFilesFormDia = (row) => {
  const openFilesFormDia = row => {
  nextTick(() => {
    filesDia.value?.openDialog( row,'合同')
  })
      filesDia.value?.openDialog(row, "合同");
    });
};
// 查询列表
/** 搜索按钮操作 */
@@ -210,7 +216,7 @@
  page.current = 1;
  getList();
};
const pagination = (obj) => {
  const pagination = obj => {
  page.current = obj.page;
  page.size = obj.limit;
  getList();
@@ -218,26 +224,28 @@
const getList = () => {
  tableLoading.value = true;
  const params = { ...searchForm.value, ...page };
  params.entryDate = undefined
  params.staffState = 1
  staffOnJobListPage(params).then(res => {
    params.entryDate = undefined;
    params.staffState = 1;
    staffOnJobListPage(params)
      .then(res => {
    tableLoading.value = false;
    tableData.value = res.data.records
        tableData.value = res.data.records;
    page.total = res.data.total;
  }).catch(err => {
    tableLoading.value = false;
  })
      .catch(err => {
        tableLoading.value = false;
      });
};
// 表格选择数据
const handleSelectionChange = (selection) => {
  const handleSelectionChange = selection => {
  selectedRows.value = selection;
};
// 打开弹框
const openForm = (type, row) => {
  nextTick(() => {
    formDia.value?.openDialog(type, row)
  })
      formDia.value?.openDialog(type, row);
    });
};
// 导出
const handleOut = () => {
@@ -247,7 +255,11 @@
    type: "warning",
  })
    .then(() => {
      proxy.download("/staff/staffOnJob/export", {staffState: 1}, "合同管理.xlsx");
        proxy.download(
          "/staff/staffOnJob/export",
          { staffState: 1 },
          "合同管理.xlsx"
        );
    })
    .catch(() => {
      proxy.$modal.msg("已取消");