luoyb
2021-02-04 49e0f2751e7950085cc6e13fbbf8817c187ca459
src/views/user/Informationinput.vue
@@ -4,46 +4,46 @@
      <el-aside width="200px">
        <el-timeline>
          <el-timeline-item @click.native="isShow(showArr[0].show, 0)">
            <span :class="thisShowIndex==0?'selectedTimeline':''">基本信息</span>
            <span :class="thisShowIndex===0?'selectedTimeline':''">基本信息</span>
          </el-timeline-item>
          <el-timeline-item @click.native="isShow(showArr[1].show, 1)">
            <span :class="thisShowIndex==1?'selectedTimeline':''">工作经历</span>
            <span :class="thisShowIndex===1?'selectedTimeline':''">工作经历</span>
          </el-timeline-item>
          <el-timeline-item @click.native="isShow(showArr[2].show, 2)">
            <span :class="thisShowIndex==2?'selectedTimeline':''">体检信息</span>
            <span :class="thisShowIndex===2?'selectedTimeline':''">体检信息</span>
          </el-timeline-item>
          <el-timeline-item @click.native="isShow(showArr[3].show, 3)">
            <span :class="thisShowIndex==3?'selectedTimeline':''">合同信息</span>
            <span :class="thisShowIndex===3?'selectedTimeline':''">合同信息</span>
          </el-timeline-item>
          <el-timeline-item @click.native="isShow(showArr[4].show, 4)">
            <span :class="thisShowIndex==4?'selectedTimeline':''">考勤情况</span>
            <span :class="thisShowIndex===4?'selectedTimeline':''">考勤情况</span>
          </el-timeline-item>
          <el-timeline-item @click.native="isShow(showArr[5].show, 5)">
            <span :class="thisShowIndex==5?'selectedTimeline':''">请假记录</span>
            <span :class="thisShowIndex===5?'selectedTimeline':''">请假记录</span>
          </el-timeline-item>
          <el-timeline-item @click.native="isShow(showArr[6].show, 6)">
            <span :class="thisShowIndex==6?'selectedTimeline':''">辞职申请</span>
            <span :class="thisShowIndex===6?'selectedTimeline':''">辞职申请</span>
          </el-timeline-item>
          <el-timeline-item @click.native="isShow(showArr[7].show, 7)">
            <span :class="thisShowIndex==7?'selectedTimeline':''">失业金领取</span>
            <span :class="thisShowIndex===7?'selectedTimeline':''">失业金领取</span>
          </el-timeline-item>
          <el-timeline-item @click.native="isShow(showArr[8].show, 8)">
            <span :class="thisShowIndex==8?'selectedTimeline':''">社保申请</span>
            <span :class="thisShowIndex===8?'selectedTimeline':''">社保申请</span>
          </el-timeline-item>
          <el-timeline-item @click.native="isShow(showArr[9].show, 9)">
            <span :class="thisShowIndex==9?'selectedTimeline':''">意外险案件</span>
            <span :class="thisShowIndex===9?'selectedTimeline':''">意外险案件</span>
          </el-timeline-item>
          <el-timeline-item @click.native="isShow(showArr[10].show, 10)">
            <span :class="thisShowIndex==10?'selectedTimeline':''">工伤案件</span>
            <span :class="thisShowIndex===10?'selectedTimeline':''">工伤案件</span>
          </el-timeline-item>
          <el-timeline-item @click.native="isShow(showArr[11].show, 11)">
            <span :class="thisShowIndex==11?'selectedTimeline':''">劳资案件</span>
            <span :class="thisShowIndex===11?'selectedTimeline':''">劳资案件</span>
          </el-timeline-item>
          <el-timeline-item @click.native="isShow(showArr[12].show, 12)">
            <span :class="thisShowIndex==12?'selectedTimeline':''">不良记录</span>
            <span :class="thisShowIndex===12?'selectedTimeline':''">不良记录</span>
          </el-timeline-item>
          <el-timeline-item @click.native="isShow(showArr[13].show, 13)">
            <span :class="thisShowIndex==13?'selectedTimeline':''">备注信息</span>
            <span :class="thisShowIndex===13?'selectedTimeline':''">备注信息</span>
          </el-timeline-item>
        </el-timeline>
      </el-aside>
@@ -420,11 +420,17 @@
          <el-table-column prop="remarkDate" label="备注日期" width="180" />
          <el-table-column prop="remarkContent" label="备注信息" width="400" />
        </el-table>
        <pagination
          v-show="total>0"
          :total="total"
          :page.sync="pagination.num"
          :limit.sync="pagination.size"
          @pagination="search"
        />
        <el-col :span="24">
          <div style="margin: 0px auto; width: 250px;margin-top: 20px;">
            <el-button class="nomalBtn">取消</el-button>
            <el-button class="nomalBtn">暂存</el-button>
            <el-button class="commonBtn">提交</el-button>
            <el-button class="nomalBtn" @click="deleteFrom()">取消</el-button>
            <el-button class="commonBtn" @click="submitTo()">提交</el-button>
          </div>
        </el-col>
      </el-main>
@@ -445,7 +451,7 @@
                <el-option label="女" value="2" />
              </el-select>
            </el-form-item>
            <el-form-item label="员工类型">
            <el-form-item label="员工类型" prop="empType">
              <el-select v-model="empBaseInfoForm.empType" placeholder="请选择员工类型">
                <el-option label="正式工" value="1" />
                <el-option label="临时工" value="2" />
@@ -1909,11 +1915,21 @@
import { toCardGetUserInfo } from '@/utils/myUtil'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import Pagination from '@/components/Pagination'
export default {
  components: { Treeselect },
  components: { Treeselect, Pagination },
  data() {
    return {
      total: 0, // 总数量
      queryParams: {}, // 查询参数
      sort: {}, // 排序
      pagination: { // 分页参数
        size: 20,
        num: 1
      },
      tableUrl: '',
      tableDataName: '',
      rules: {
        empNumb: [{ required: true, message: '请输入员工编号', trigger: 'blur' },
          { min: 2, max: 50, message: '长度在 2 到 50 个字符', trigger: 'blur' }],
@@ -2501,20 +2517,29 @@
  },
  mounted() {
    this.initDept()
    this.selectBadRecord()
    this.selectEmpBase()
    this.selectWorkExperience()
    this.selectPhysicalExam()
    this.selectContractInfo()
    this.selectDimissionAttend()
    this.selectLeaveInfo()
    this.selectResign()
    this.selectUnemployment()
    this.selectAccidentCases()
    this.selectLaborTrouble()
    this.selectRemarkInfo()
    this.thisShowIndex = 1
    this.isShow(false, 0)
  },
  methods: {
    // 翻页插件翻页方法
    search() {
      this.fetch({
        ...this.queryParams,
        ...this.sort
      })
    },
    // 公用查询
    fetch(params = {}) {
      params.pageSize = this.pagination.size
      params.pageNum = this.pagination.num
      this.$get(this.tableUrl, {
        ...params
      }).then((r) => {
        const data = r.data.data
        this.total = data.total
        this[this.tableDataName] = data.rows
      })
    },
    dialogIsShow() {
      this.isAdd = true
      this.dialogshowArr[this.thisShowIndex].show = !this.dialogshowArr[this.thisShowIndex]
@@ -2531,6 +2556,92 @@
        this.showArr[this.thisShowIndex].show = false
      }
      this.thisShowIndex = index
      switch (this.thisShowIndex) {
        case 0:
          this.tableUrl = 'hr/empBaseInfo/list'
          this.tableDataName = 'basicInformationData'
          this.queryParams.delFlag = 2
          this.search()
          break
        case 1:
          this.tableUrl = 'hr/empWorkExperience/list'
          this.tableDataName = 'workExperienceData'
          this.queryParams.delFlag = 2
          this.search()
          break
        case 2:
          this.tableUrl = 'hr/empPhysicalExam/list'
          this.tableDataName = 'physicalExamData'
          this.queryParams.delFlag = 2
          this.search()
          break
        case 3:
          this.tableUrl = 'hr/empContractInfo/list'
          this.tableDataName = 'contractInfoData'
          this.queryParams.delFlag = 2
          this.search()
          break
        case 4:
          this.tableUrl = 'hr/empDimissionAttend/list'
          this.tableDataName = 'dimissionAttendData'
          this.queryParams.delFlag = 2
          this.search()
          break
        case 5:
          this.tableUrl = 'hr/empLeaveInfo/list'
          this.tableDataName = 'leaveInfoData'
          this.queryParams.delFlag = 2
          this.search()
          break
        case 6:
          this.tableUrl = 'hr/empResign/list'
          this.tableDataName = 'resignData'
          this.queryParams.delFlag = 2
          this.search()
          break
        case 7:
          this.tableUrl = 'hr/empUnemployment/list'
          this.tableDataName = 'unemploymentData'
          this.queryParams.delFlag = 2
          this.search()
          break
        case 8:
          this.tableUrl = 'hr/empInsurance/list'
          this.tableDataName = 'insuranceData'
          this.queryParams.delFlag = 2
          this.search()
          break
        case 9:
          this.tableUrl = 'hr/empAccidentCases/list'
          this.tableDataName = 'accidentCasesData'
          this.queryParams.delFlag = 2
          this.search()
          break
        case 10:
          this.tableUrl = 'hr/empOccupational/list'
          this.tableDataName = 'occupationalData'
          this.queryParams.delFlag = 2
          this.search()
          break
        case 11:
          this.tableUrl = 'hr/empLaborTrouble/list'
          this.tableDataName = 'laborTroubleData'
          this.queryParams.delFlag = 2
          this.search()
          break
        case 12:
          this.tableUrl = 'hr/empBadRecord/list'
          this.tableDataName = 'badRecordData'
          this.queryParams.delFlag = 2
          this.search()
          break
        case 13:
          this.tableUrl = 'hr/empRemarkInfo/list'
          this.tableDataName = 'remarkInfoData'
          this.queryParams.delFlag = 2
          this.search()
          break
      }
    },
    initDept() {
      this.$get('system/dept').then((r) => {
@@ -2548,9 +2659,10 @@
      this.$refs.deptTree.setCheckedKeys([])
    },
    butDelete() {
      let selected
      switch (this.thisShowIndex) {
        case 0:
          var selected = this.$refs.empBaseInfoTable.selection
          selected = this.$refs.empBaseInfoTable.selection
          if (selected.length > 0) {
            const delIds = []
            selected.forEach((j) => {
@@ -2566,8 +2678,7 @@
          }
          break
        case 1:
          // eslint-disable-next-line no-redeclare
          var selected = this.$refs.workExperienceTable.selection
          selected = this.$refs.workExperienceTable.selection
          if (selected.length > 0) {
            const delIds = []
            selected.forEach((j) => {
@@ -2583,8 +2694,7 @@
          }
          break
        case 2:
          // eslint-disable-next-line no-redeclare
          var selected = this.$refs.physicalExamTable.selection
          selected = this.$refs.physicalExamTable.selection
          if (selected.length > 0) {
            const delIds = []
            selected.forEach((j) => {
@@ -2600,8 +2710,7 @@
          }
          break
        case 3:
          // eslint-disable-next-line no-redeclare
          var selected = this.$refs.contractInfoTable.selection
          selected = this.$refs.contractInfoTable.selection
          if (selected.length > 0) {
            const delIds = []
            selected.forEach((j) => {
@@ -2617,8 +2726,7 @@
          }
          break
        case 4:
          // eslint-disable-next-line no-redeclare
          var selected = this.$refs.dimissionAttendTable.selection
          selected = this.$refs.dimissionAttendTable.selection
          if (selected.length > 0) {
            const delIds = []
            selected.forEach((j) => {
@@ -2634,8 +2742,7 @@
          }
          break
        case 5:
          // eslint-disable-next-line no-redeclare
          var selected = this.$refs.leaveInfoTable.selection
          selected = this.$refs.leaveInfoTable.selection
          if (selected.length > 0) {
            const delIds = []
            selected.forEach((j) => {
@@ -2651,8 +2758,7 @@
          }
          break
        case 6:
          // eslint-disable-next-line no-redeclare
          var selected = this.$refs.resignTable.selection
          selected = this.$refs.resignTable.selection
          if (selected.length > 0) {
            const delIds = []
            selected.forEach((j) => {
@@ -2668,8 +2774,7 @@
          }
          break
        case 7:
          // eslint-disable-next-line no-redeclare
          var selected = this.$refs.unemploymentTable.selection
          selected = this.$refs.unemploymentTable.selection
          if (selected.length > 0) {
            const delIds = []
            selected.forEach((j) => {
@@ -2685,8 +2790,7 @@
          }
          break
        case 8:
          // eslint-disable-next-line no-redeclare
          var selected = this.$refs.insuranceTable.selection
          selected = this.$refs.insuranceTable.selection
          if (selected.length > 0) {
            const delIds = []
            selected.forEach((j) => {
@@ -2702,8 +2806,7 @@
          }
          break
        case 9:
          // eslint-disable-next-line no-redeclare
          var selected = this.$refs.accidentCasesTable.selection
          selected = this.$refs.accidentCasesTable.selection
          if (selected.length > 0) {
            const delIds = []
            selected.forEach((j) => {
@@ -2719,8 +2822,7 @@
          }
          break
        case 10:
          // eslint-disable-next-line no-redeclare
          var selected = this.$refs.occupationalTable.selection
          selected = this.$refs.occupationalTable.selection
          if (selected.length > 0) {
            const delIds = []
            selected.forEach((j) => {
@@ -2736,8 +2838,7 @@
          }
          break
        case 11:
          // eslint-disable-next-line no-redeclare
          var selected = this.$refs.occupationalTable.selection
          selected = this.$refs.occupationalTable.selection
          if (selected.length > 0) {
            const delIds = []
            selected.forEach((j) => {
@@ -2753,8 +2854,7 @@
          }
          break
        case 12:
          // eslint-disable-next-line no-redeclare
          var selected = this.$refs.badRecordTable.selection
          selected = this.$refs.badRecordTable.selection
          if (selected.length > 0) {
            const badIds = []
            selected.forEach((j) => {
@@ -2770,8 +2870,7 @@
          }
          break
        case 13:
          // eslint-disable-next-line no-redeclare
          var selected = this.$refs.remarkInfoTable.selection
          selected = this.$refs.remarkInfoTable.selection
          if (selected.length > 0) {
            const badIds = []
            selected.forEach((j) => {
@@ -2788,8 +2887,242 @@
          break
      }
    },
    deleteFrom() {
      this.butDelete()
    },
    submitTo() {
      let selected
      switch (this.thisShowIndex) {
        case 0:
          selected = this.$refs.empBaseInfoTable.selection
          if (selected.length > 0) {
            const delIds = []
            selected.forEach((j) => {
              delIds.push(j.empId)
            })
            this.$delete(`hr/empBaseInfo/toNormal/` + delIds).then(() => {
              this.$message({
                message: this.$t('tips.submitSuccess'),
                type: 'success'
              })
              this.selectEmpBase()
            })
          }
          break
        case 1:
          selected = this.$refs.workExperienceTable.selection
          if (selected.length > 0) {
            const delIds = []
            selected.forEach((j) => {
              delIds.push(j.workExperienceId)
            })
            this.$delete(`hr/empWorkExperience/toNormal/` + delIds).then(() => {
              this.$message({
                message: this.$t('tips.submitSuccess'),
                type: 'success'
              })
              this.selectWorkExperience()
            })
          }
          break
        case 2:
          selected = this.$refs.physicalExamTable.selection
          if (selected.length > 0) {
            const delIds = []
            selected.forEach((j) => {
              delIds.push(j.physicalExamId)
            })
            this.$delete(`hr/empPhysicalExam/toNormal/` + delIds).then(() => {
              this.$message({
                message: this.$t('tips.submitSuccess'),
                type: 'success'
              })
              this.selectPhysicalExam()
            })
          }
          break
        case 3:
          selected = this.$refs.contractInfoTable.selection
          if (selected.length > 0) {
            const delIds = []
            selected.forEach((j) => {
              delIds.push(j.contractId)
            })
            this.$delete(`hr/empContractInfo/toNormal/` + delIds).then(() => {
              this.$message({
                message: this.$t('tips.submitSuccess'),
                type: 'success'
              })
              this.selectContractInfo()
            })
          }
          break
        case 4:
          selected = this.$refs.dimissionAttendTable.selection
          if (selected.length > 0) {
            const delIds = []
            selected.forEach((j) => {
              delIds.push(j.dimissionAttendId)
            })
            this.$delete(`hr/empDimissionAttend/toNormal/` + delIds).then(() => {
              this.$message({
                message: this.$t('tips.submitSuccess'),
                type: 'success'
              })
              this.selectDimissionAttend()
            })
          }
          break
        case 5:
          selected = this.$refs.leaveInfoTable.selection
          if (selected.length > 0) {
            const delIds = []
            selected.forEach((j) => {
              delIds.push(j.leaveId)
            })
            this.$delete(`hr/empLeaveInfo/toNormal/` + delIds).then(() => {
              this.$message({
                message: this.$t('tips.submitSuccess'),
                type: 'success'
              })
              this.selectLeaveInfo()
            })
          }
          break
        case 6:
          selected = this.$refs.resignTable.selection
          if (selected.length > 0) {
            const delIds = []
            selected.forEach((j) => {
              delIds.push(j.resignId)
            })
            this.$delete(`hr/empResign/toNormal/` + delIds).then(() => {
              this.$message({
                message: this.$t('tips.submitSuccess'),
                type: 'success'
              })
              this.selectResign()
            })
          }
          break
        case 7:
          selected = this.$refs.unemploymentTable.selection
          if (selected.length > 0) {
            const delIds = []
            selected.forEach((j) => {
              delIds.push(j.unemploymentId)
            })
            this.$delete(`hr/empUnemployment/toNormal/` + delIds).then(() => {
              this.$message({
                message: this.$t('tips.submitSuccess'),
                type: 'success'
              })
              this.selectUnemployment()
            })
          }
          break
        case 8:
          selected = this.$refs.insuranceTable.selection
          if (selected.length > 0) {
            const delIds = []
            selected.forEach((j) => {
              delIds.push(j.insuranceId)
            })
            this.$delete(`hr/empInsurance/toNormal/` + delIds).then(() => {
              this.$message({
                message: this.$t('tips.submitSuccess'),
                type: 'success'
              })
              this.selectInsurance()
            })
          }
          break
        case 9:
          selected = this.$refs.accidentCasesTable.selection
          if (selected.length > 0) {
            const delIds = []
            selected.forEach((j) => {
              delIds.push(j.accidentId)
            })
            this.$delete(`hr/empAccidentCases/toNormal/` + delIds).then(() => {
              this.$message({
                message: this.$t('tips.submitSuccess'),
                type: 'success'
              })
              this.selectAccidentCases()
            })
          }
          break
        case 10:
          selected = this.$refs.occupationalTable.selection
          if (selected.length > 0) {
            const delIds = []
            selected.forEach((j) => {
              delIds.push(j.occupationalId)
            })
            this.$delete(`hr/empOccupational/toNormal/` + delIds).then(() => {
              this.$message({
                message: this.$t('tips.submitSuccess'),
                type: 'success'
              })
              this.selectOccupational()
            })
          }
          break
        case 11:
          selected = this.$refs.occupationalTable.selection
          if (selected.length > 0) {
            const delIds = []
            selected.forEach((j) => {
              delIds.push(j.arbitrationId)
            })
            this.$delete(`hr/empLaborTrouble/toNormal/` + delIds).then(() => {
              this.$message({
                message: this.$t('tips.submitSuccess'),
                type: 'success'
              })
              this.selectLaborTrouble()
            })
          }
          break
        case 12:
          selected = this.$refs.badRecordTable.selection
          if (selected.length > 0) {
            const badIds = []
            selected.forEach((j) => {
              badIds.push(j.badId)
            })
            this.$delete(`hr/empBadRecord/toNormal/` + badIds).then(() => {
              this.$message({
                message: this.$t('tips.submitSuccess'),
                type: 'success'
              })
              this.selectBadRecord()
            })
          }
          break
        case 13:
          selected = this.$refs.remarkInfoTable.selection
          if (selected.length > 0) {
            const badIds = []
            selected.forEach((j) => {
              badIds.push(j.remarkId)
            })
            this.$delete(`hr/empRemarkInfo/toNormal/` + badIds).then(() => {
              this.$message({
                message: this.$t('tips.submitSuccess'),
                type: 'success'
              })
              this.selectBadRecord()
            })
          }
          break
      }
    },
    selectEmpBase() {
      this.$get('hr/empBaseInfo/list')
      this.queryParams.delFlag = '2'
      // eslint-disable-next-line no-undef
      this.$get('hr/empBaseInfo/list', this.queryParams)
        .then((r) => {
          this.basicInformationData = r.data.data.rows
        })