k94314517
2024-11-29 d1c205d29b5eacf1de22a7af29329ca370d1c2d3
company/src/components/enterprise/reinsurance.vue
@@ -102,7 +102,9 @@
                <el-button type="danger" @click="deleItem">删除</el-button>
            </div>
            <div class="btns_item" v-if="activeName !== '1'">
                <el-button type="primary" @click="sele">选取派遣单位</el-button>
<!--                <el-button type="primary" @click="sele">选取派遣单位</el-button>-->
                <el-button type="primary" @click="sele(1)" v-if="item && item.hasDispatchUnit !== 1">选取派遣单位</el-button>
                <el-button type="primary" @click="sele(2)" v-if="item && item.hasDispatchUnit === 1">选取工种</el-button>
            </div>
        </div>
        <el-table
@@ -144,6 +146,7 @@
                </template>
            </el-table-column>
            <el-table-column
                v-if="item && item.hasDispatchUnit !== 1"
                :key="Math.random()"
                prop="duName"
                label="派遣单位">
@@ -205,14 +208,15 @@
                </template>
            </el-table-column>
            <el-table-column
                    :key="Math.random()"
                    prop="duName"
                    label="派遣单位">
                v-if="item && item.hasDispatchUnit !== 1"
                :key="Math.random()"
                prop="duName"
                label="派遣单位">
            </el-table-column>
            <el-table-column
                    :key="Math.random()"
                    prop="workTypeName"
                    label="所属工种">
                :key="Math.random()"
                prop="workTypeName"
                label="所属工种">
            </el-table-column>
            <el-table-column
                :key="Math.random()"
@@ -346,7 +350,7 @@
        types: [0]
      }).then(res => {
        res.forEach(item => {
          item.fee = ''
          item.fee = item.fee
          item.idCard = item.memberIdcardNo
          item.workTypeName = ''
          item.worktypeId = ''
@@ -409,7 +413,7 @@
      columns.forEach((column, index) => {
        if (index === 0) {
          sums[index] = '总价'
        } else if (index === 7) {
        } else if (this.item && this.item.hasDispatchUnit === 1 && index === 6) {
          let total = 0
          if (this.activeName === '0') {
            this.form.addDetailList.forEach(item => {
@@ -421,14 +425,26 @@
            this.form.delDetailList.forEach(item => {
              total += item.fee
            })
            // if (total < 0) {
            sums[index] = (total||0).toFixed(2)
            // } else {
            //     sums[index] = '-' + total
            // }
            return
          }
          sums[index] = ''
        } else if (this.item && this.item.hasDispatchUnit === 0 && index === 7) {
            let total = 0
            if (this.activeName === '0') {
                this.form.addDetailList.forEach(item => {
                    total += item.fee
                })
                sums[index] = total.toFixed(2)
                return
            } else {
                this.form.delDetailList.forEach(item => {
                    total += item.fee
                })
                sums[index] = (total||0).toFixed(2)
                return
            }
            sums[index] = ''
        }
      })
      return sums
@@ -441,7 +457,7 @@
      if (this.activeName === '0') {
        this.seleData.forEach(item => {
          this.form.addDetailList.forEach((row, index) => {
            if (item === row.name) {
            if (item === row.idCard) {
              this.form.addDetailList.splice(index, 1)
            }
          })
@@ -449,7 +465,7 @@
      } else {
        this.seleData.forEach(item => {
          this.form.delDetailList.forEach((row, index) => {
            if (item === row.name) {
            if (item === row.idCard) {
              this.form.delDetailList.splice(index, 1)
            }
          })
@@ -522,9 +538,9 @@
        return
      }
      if (this.activeName === '0') {
        this.$refs.addEmployee.open('添加加保员工', { arr: this.form.addDetailList, solutionId: this.item.newVersionSolutionId, price: this.price })
        this.$refs.addEmployee.open('添加加保员工', { arr: this.form.addDetailList, solutionId: this.item.newVersionSolutionId, price: this.price, companyId: this.item.hasDispatchUnit === 1 ? '1' : '' })
      } else {
        this.$refs.addEmployee.open('添加减保员工', { arr: this.form.delDetailList, solutionId: this.item.newVersionSolutionId, price: this.reducePrice })
        this.$refs.addEmployee.open('添加减保员工', { arr: this.form.delDetailList, solutionId: this.item.newVersionSolutionId, price: this.reducePrice, companyId: this.item.hasDispatchUnit === 1 ? '1' : '' })
      }
    },
    uploadUser () {
@@ -533,9 +549,9 @@
        return
      }
      if (this.activeName === '0') {
        this.$refs.importEmployees.open('加保员工名单', { arr: this.form.addDetailList, type: 1, price: this.price, solutionId: this.item.newVersionSolutionId })
        this.$refs.importEmployees.open('加保员工名单', { arr: this.form.addDetailList, type: 1, price: this.price, solutionId: this.item.newVersionSolutionId, hasDispatchUnit: this.item.hasDispatchUnit })
      } else {
        this.$refs.importEmployees.open('减保员工名单', { arr: this.form.delDetailList, type: 0, price: this.reducePrice, solutionId: this.item.newVersionSolutionId, insuranceApplyId: this.form.id })
        this.$refs.importEmployees.open('减保员工名单', { arr: this.form.delDetailList, type: 0, price: this.reducePrice, solutionId: this.item.newVersionSolutionId, insuranceApplyId: this.form.id, hasDispatchUnit: this.item.hasDispatchUnit })
      }
    },
    // 切换方案
@@ -560,7 +576,7 @@
      this.seleData.forEach(item => {
        if (this.activeName === '0') {
          this.form.addDetailList.forEach(row => {
            if (item === row.name) {
            if (item === row.idCard) {
              row.workTypeName = obj.workTypeName
              row.worktypeId = obj.worktypeId
              row.duName = obj.duName
@@ -569,7 +585,7 @@
          })
        } else {
          this.form.delDetailList.forEach(row => {
            if (item === row.name) {
            if (item === row.idCard) {
              row.workTypeName = obj.workTypeName
              row.worktypeId = obj.worktypeId
              row.duName = obj.duName
@@ -582,7 +598,7 @@
      this.$refs.multipleTable.clearSelection()
    },
    // 选择员工
    sele () {
    sele (type) {
      if (!this.form.solutionId) {
        this.$message.warning('请选择保险方案')
        return
@@ -591,7 +607,7 @@
        this.$message.warning('请选择员工')
        return
      }
      this.$refs.confirmJobType.open('确认工种', { solutionId: this.newVersionSolutionId })
      this.$refs.confirmJobType.open('确认工种', { solutionId: this.newVersionSolutionId, type })
    },
    // 查询全部方案
    getCompany () {
@@ -626,7 +642,7 @@
      return sexAndAge.age
    },
    handleSelectionChange (e) {
      this.seleData = e.map(item => item.name)
      this.seleData = e.map(item => item.memberIdcardNo)
    },
    getValue (list) {
      console.log(list)