Forráskód Böngészése

办理员工离职

lizhenhao 2 éve
szülő
commit
8fedc5c69c

+ 32 - 0
src/api/changes/dimission/DimissionService.js

@@ -0,0 +1,32 @@
+import request from '@/utils/httpRequest'
+
+export default class DimissionService {
+  list (params) {
+    return request({
+      url: '/changes/dimission/list',
+      method: 'get',
+      params: params
+    })
+  }
+  queryById (id) {
+    return request({
+      url: '/changes/dimission/queryById',
+      method: 'get',
+      params: {id: id}
+    })
+  }
+  save (inputForm) {
+    return request({
+      url: `/changes/dimission/save`,
+      method: 'post',
+      data: inputForm
+    })
+  }
+  delete (ids) {
+    return request({
+      url: '/changes/dimission/delete',
+      method: 'delete',
+      params: {ids: ids}
+    })
+  }
+}

+ 241 - 0
src/views/modules/changes/dimission/DimissionForm.vue

@@ -0,0 +1,241 @@
+<template xmlns:v-slot="http://www.w3.org/1999/XSL/Transform">
+  <div>
+    <el-dialog
+      :title="title"
+      :close-on-click-modal="false"
+      v-dialogDrag
+      width="1000px"
+      @close="close"
+      @keyup.enter.native="doSubmit"
+      :visible.sync="visible">
+      <el-form size="middle" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="method==='view'"
+               label-width="125px" @submit.native.prevent>
+        <el-row  :gutter="15">
+          <el-col :span="12">
+            <el-form-item label="姓名" prop="rosterId"
+                          :rules="[{required: true, message: '姓名不能为空', trigger: 'blur'}]"
+            >
+              <el-select v-model="inputForm.rosterId" style="width:100%" placeholder="请选择姓名">
+                <el-option
+                  v-for="item in supervisorList"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="申请日期" prop="requestDate"
+                          :rules="[{required: true, message: '申请日期不能为空', trigger: 'blur'}]">
+              <el-date-picker
+                placement="bottom-start"
+                style="width: 100%"
+                v-model="inputForm.requestDate"
+                type="date"
+                placeholder="选择申请日期">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="离职类型" prop="type"
+                          :rules="[{required: true, message: '离职类型不能为空', trigger: 'blur'}
+                 ]">
+              <el-radio v-for="item in $dictUtils.getDictList('dimission_type')" v-model="inputForm.type"
+                        :label="item.value" :value="item.value" :key="item.value" size="mini" style="margin-right: 0px" border>
+                {{item.label}}</el-radio>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="离职原因" prop="reaTypeList"
+                          :rules="[{required: true, message: '离职原因不能为空', trigger: 'blur'}
+                 ]">
+              <el-select v-model="inputForm.reaTypeList" multiple placeholder="请选择离职原因"  style="width:100%;">
+                <el-option
+                  v-for="item in $dictUtils.getDictList('dimission_reason')"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="24">
+            <el-form-item label="原因说明" prop="reasonDesc"
+                          :rules="[
+                 ]">
+              <el-input type="textarea" style="width:100%" maxlength="1000" v-model="inputForm.reasonDesc" placeholder="请填写原因说明"     ></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="离职日期" prop="dimissionDate"
+                          :rules="[{required: true, message: '离职日期不能为空', trigger: 'blur'}
+                 ]">
+              <el-date-picker
+                placement="bottom-start"
+                style="width: 100%"
+                v-model="inputForm.dimissionDate"
+                type="date"
+                placeholder="选择离职日期">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="最后工作日期" prop="lastWorkDate"
+                          :rules="[{required: true, message: '最后工作日期不能为空', trigger: 'blur'}
+                 ]">
+              <el-date-picker
+                placement="bottom-start"
+                style="width: 100%"
+                v-model="inputForm.lastWorkDate"
+                type="date"
+                placeholder="选择最后工作日期">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="薪资结算日期" prop="payrollSettlementDate"
+                          :rules="[{required: true, message: '薪资结算日期不能为空', trigger: 'blur'}
+                 ]">
+              <el-date-picker
+                placement="bottom-start"
+                style="width: 100%"
+                v-model="inputForm.payrollSettlementDate"
+                type="date"
+                placeholder="选择薪资结算日期">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item label="备注" prop="remarks"
+                          :rules="[
+                 ]">
+              <el-input type="textarea" style="width:100%" maxlength="1000" v-model="inputForm.remarks" placeholder="请填写备注"     ></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+      <el-button size="small" @click="close()" icon="el-icon-circle-close">关闭</el-button>
+      <el-button size="small" type="primary" v-if="method != 'view'" @click="doSubmit()" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
+    </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  import DimissionService from '@/api/changes/dimission/DimissionService'
+  import RosterService from '@/api/roster/RosterService'
+  export default {
+    data () {
+      return {
+        title: '',
+        method: '',
+        visible: false,
+        loading: false,
+        inputForm: {
+          id: '',
+          remarks: '',
+          rosterId: '',
+          lastWorkDate: '',
+          dimissionDate: '',
+          reasonDesc: '',
+          type: '',
+          vettingStatus: '',
+          handoverStatus: '',
+          status: '',
+          payrollSettlementDate: '',
+          requestDate: '',
+          reaTypeList: []
+        },
+        supervisorList: []
+      }
+    },
+    dimissionService: null,
+    rosterService: null,
+    created () {
+      this.dimissionService = new DimissionService()
+      this.rosterService = new RosterService()
+    },
+    components: {
+    },
+    methods: {
+      init (method, id) {
+        this.method = method
+        this.queryAllSupervisor()
+        this.inputForm = {
+          id: '',
+          remarks: '',
+          rosterId: '',
+          lastWorkDate: '',
+          dimissionDate: '',
+          reasonDesc: '',
+          type: '',
+          vettingStatus: '',
+          handoverStatus: '',
+          status: '',
+          payrollSettlementDate: '',
+          requestDate: '',
+          reaTypeList: []
+        }
+        this.inputForm.id = id
+        if (method === 'add') {
+          this.title = `办理员工离职`
+        } else if (method === 'edit') {
+          this.title = '修改'
+        } else if (method === 'view') {
+          this.title = '离职详情'
+        }
+        this.visible = true
+        this.loading = false
+        this.$nextTick(() => {
+          this.$refs.inputForm.resetFields()
+          if (method === 'edit' || method === 'view') { // 修改或者查看
+            this.loading = true
+            this.dimissionService.queryById(this.inputForm.id).then(({data}) => {
+              this.inputForm = this.recover(this.inputForm, data)
+              this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
+              this.loading = false
+            })
+          }
+        })
+      },
+      // 表单提交
+      doSubmit () {
+        this.$refs['inputForm'].validate((valid) => {
+          if (valid) {
+            this.loading = true
+            this.checkMoment()
+            this.dimissionService.save(this.inputForm).then(({data}) => {
+              this.close()
+              this.$message.success(data)
+              this.$emit('refreshDataList')
+              this.loading = false
+            }).catch(() => {
+              this.loading = false
+            })
+          }
+        })
+      },
+      close () {
+        this.$refs.inputForm.resetFields()
+        this.visible = false
+      },
+      checkMoment () {
+        this.inputForm.lastWorkDate = this.moment(this.inputForm.lastWorkDate).format('YYYY-MM-DD HH:mm:ss')
+        this.inputForm.dimissionDate = this.moment(this.inputForm.dimissionDate).format('YYYY-MM-DD HH:mm:ss')
+        this.inputForm.payrollSettlementDate = this.moment(this.inputForm.payrollSettlementDate).format('YYYY-MM-DD HH:mm:ss')
+        this.inputForm.requestDate = this.moment(this.inputForm.requestDate).format('YYYY-MM-DD HH:mm:ss')
+      },
+      queryAllSupervisor () {
+        this.rosterService.list({
+          'current': '1',
+          'size': '-1'
+        }).then(({data}) => {
+          this.supervisorList = JSON.parse(JSON.stringify(data.records))
+        })
+      }
+    }
+  }
+</script>

+ 204 - 0
src/views/modules/changes/dimission/DimissionList.vue

@@ -0,0 +1,204 @@
+<template>
+  <div class="page">
+    <el-form size="small" :inline="true" class="query-form" ref="searchForm" :model="searchForm" @keyup.enter.native="refreshList()" @submit.native.prevent>
+      <!-- 搜索框-->
+      <el-form-item prop="rosterBaseDTO.name">
+        <el-input size="small" v-model="searchForm.rosterBaseDTO.name" placeholder="姓名" clearable></el-input>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" @click="refreshList()" size="small" icon="el-icon-search">查询</el-button>
+        <el-button @click="resetSearch()" size="small" icon="el-icon-refresh-right">重置</el-button>
+      </el-form-item>
+    </el-form>
+    <div class="bg-white top">
+      <vxe-toolbar :refresh="{query: refreshList}" custom>
+        <template #buttons>
+          <el-button v-if="hasPermission('changes:dimission:add')" type="primary" size="small" icon="el-icon-plus" @click="add()">办理员工离职</el-button>
+          <el-button v-if="hasPermission('changes:dimission:del')" type="danger"   size="small" icon="el-icon-delete" @click="del()" :disabled="$refs.dimissionTable && $refs.dimissionTable.getCheckboxRecords().length === 0" plain>删除</el-button>
+        </template>
+      </vxe-toolbar>
+      <div style="height: calc(100% - 140px);">
+        <vxe-table
+          border="inner"
+          auto-resize
+          resizable
+          height="auto"
+          :loading="loading"
+          size="small"
+          ref="dimissionTable"
+          show-header-overflow
+          show-overflow
+          highlight-hover-row
+          :menu-config="{}"
+          :print-config="{}"
+          :export-config="{}"
+          @sort-change="sortChangeHandle"
+          :sort-config="{remote:true}"
+          :data="dataList"
+          :import-config="{}"
+          :checkbox-config="{}">
+          <vxe-column type="seq" width="40"></vxe-column>
+          <vxe-column type="checkbox"  width="40px"></vxe-column>
+          <vxe-column width="200" title="姓名" field="rosterBaseDTO.name">
+            <template slot-scope="scope">
+              <el-link  type="primary" :underline="false" v-if="hasPermission('changes:dimission:view')"  @click="view(scope.row.id)">{{scope.row.rosterBaseDTO.name !== undefined?scope.row.rosterBaseDTO.name:'--'}}</el-link>
+              <span v-else>{{scope.row.rosterBaseDTO.name !== undefined?scope.row.rosterBaseDTO.name:'--'}}</span>
+            </template>
+          </vxe-column>
+
+          <vxe-column width="200" title="工号" field="rosterBaseDTO.jobNo"></vxe-column>
+          <vxe-column width="200" title="部门" field="soName"></vxe-column>
+          <vxe-column width="200" title="职位" field="jpName"></vxe-column>
+          <vxe-column width="200" title="手机号" field="rosterBaseDTO.mobile"></vxe-column>
+          <vxe-column width="200" title="入职日期" field="rosterBaseDTO.onboardingDate"></vxe-column>
+          <vxe-column width="200" title="最后工作日" field="lastWorkDate"></vxe-column>
+          <vxe-column width="200" title="离职日期" field="dimissionDate"></vxe-column>
+          <vxe-column width="200" title="离职原因" field="changesDimissionReaDTOList">
+            <template slot-scope="scope">
+              {{getDimissionReaList(scope.row.changesDimissionReaDTOList)}}
+            </template>
+          </vxe-column>
+          <vxe-column width="200" title="原因说明" field="reasonDesc"></vxe-column>
+          <vxe-column width="200" title="离职类型" field="type">
+            <template slot-scope="scope">
+              {{$dictUtils.getDictLabel('dimission_type', scope.row.type, '-')}}
+            </template>
+          </vxe-column>
+          <vxe-column width="200" title="备注" field="remarks"></vxe-column>
+
+          <vxe-column title="操作" width="200px" fixed="right" align="center">
+            <template  slot-scope="scope">
+              <el-button v-if="hasPermission('changes:dimission:view')" type="text" icon="el-icon-view" size="small" @click="view(scope.row.id)">查看</el-button>
+              <el-button v-if="hasPermission('changes:dimission:edit')" type="text" icon="el-icon-edit" size="small" @click="edit(scope.row.id)">修改</el-button>
+              <el-button v-if="hasPermission('changes:dimission:del')" type="text"  icon="el-icon-delete" size="small" @click="del(scope.row.id)">删除</el-button>
+            </template>
+          </vxe-column>
+        </vxe-table>
+        <vxe-pager
+          background
+          size="small"
+          :current-page="tablePage.currentPage"
+          :page-size="tablePage.pageSize"
+          :total="tablePage.total"
+          :page-sizes="[10, 20, 100, 1000, {label: '全量数据', value: 1000000}]"
+          :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
+          @page-change="currentChangeHandle">
+        </vxe-pager>
+      </div>
+    </div>
+    <!-- 弹窗, 新增 / 修改 -->
+    <component is="DimissionForm"  ref="dimissionForm" @refreshDataList="refreshList"></component>
+  </div>
+</template>
+
+<script>
+  import DimissionService from '@/api/changes/dimission/DimissionService'
+  import DimissionForm from './DimissionForm'
+  export default {
+    data () {
+      return {
+        searchForm: {
+          rosterBaseDTO: {
+            name: ''
+          }
+        },
+        dataList: [],
+        tablePage: {
+          total: 0,
+          currentPag1e: 1,
+          pageSize: 10,
+          orders: []
+        },
+        loading: false
+      }
+    },
+    dimissionService: null,
+    created () {
+      this.dimissionService = new DimissionService()
+    },
+    components: {
+      DimissionForm
+    },
+    activated () {
+      this.refreshList()
+    },
+    methods: {
+      // 获取数据列表
+      refreshList () {
+        this.loading = true
+        this.dimissionService.list({
+          'current': this.tablePage.currentPage,
+          'size': this.tablePage.pageSize,
+          'orders': this.tablePage.orders,
+          ...this.searchForm
+        }).then(({data}) => {
+          this.dataList = data.records
+          this.tablePage.total = data.total
+          this.loading = false
+        })
+      },
+      // 当前页
+      currentChangeHandle ({ currentPage, pageSize }) {
+        this.tablePage.currentPage = currentPage
+        this.tablePage.pageSize = pageSize
+        this.refreshList()
+      },
+      // 排序
+      sortChangeHandle (column) {
+        this.tablePage.orders = []
+        if (column.order != null) {
+          this.tablePage.orders.push({column: this.$utils.toLine(column.property), asc: column.order === 'asc'})
+        }
+        this.refreshList()
+      },
+      // 新增
+      add () {
+        this.$refs.dimissionForm.init('add', '')
+      },
+      // 修改
+      edit (id) {
+        id = id || this.$refs.dimissionTable.getCheckboxRecords().map(item => {
+          return item.id
+        })[0]
+        this.$refs.dimissionForm.init('edit', id)
+      },
+      // 查看
+      view (id) {
+        this.$refs.dimissionForm.init('view', id)
+      },
+      // 删除
+      del (id) {
+        let ids = id || this.$refs.dimissionTable.getCheckboxRecords().map(item => {
+          return item.id
+        }).join(',')
+        this.$confirm(`确定删除所选项吗?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          this.loading = true
+          this.dimissionService.delete(ids).then(({data}) => {
+            this.$message.success(data)
+            this.refreshList()
+            this.loading = false
+          })
+        })
+      },
+      resetSearch () {
+        this.$refs.searchForm.resetFields()
+        this.refreshList()
+      },
+      // 把字符串集合用‘,’拼接
+      getDimissionReaList (list) {
+        let str = ''
+        list.forEach(item => {
+          str += this.$dictUtils.getDictLabel('dimission_reason', item.dimissionReason) + ','
+        })
+        if (str.length > 0) {
+          str = str.substr(0, str.length - 1)
+        }
+        return str
+      }
+    }
+  }
+</script>

+ 1 - 0
src/views/modules/sys/project/AssessList.vue

@@ -7,6 +7,7 @@
          </el-form-item>
         <el-form-item prop="year">
           <el-date-picker
+            placement="bottom-start"
             v-model="searchForm.year"
             type="year"
             value-format="yyyy"

+ 1 - 0
src/views/modules/sys/project/ConsultationList.vue

@@ -8,6 +8,7 @@
          </el-form-item>
         <el-form-item prop="year">
           <el-date-picker
+            placement="bottom-start"
             v-model="searchForm.year"
             type="year"
             value-format="yyyy"