jiangping
2025-06-09 663dbe4ddca1fa409e6acbc1f77d924c161b0c39
company/src/components/enterprise/addEmployeeWithDu.vue
@@ -14,7 +14,7 @@
                <el-form-item label="身份证号" required>
                    <el-input v-model="item.idCard" maxlength="18" placeholder="请输入"></el-input>
                </el-form-item>
              <el-form-item label="派遣单位" >
              <el-form-item label="派遣单位" v-if="hasDispatchUnit !== 1">
                <el-select v-model="item.duId" @change="selectChange(index)" placeholder="请选择" clearable>
                  <el-option
                      v-for="item in dispatching"
@@ -57,6 +57,8 @@
      tempIndex: -1,
      dispatching: [],
      solutionId: null,
      companyId: null,
      hasDispatchUnit: null,
      list: [
        {
          memberName: '',
@@ -79,7 +81,9 @@
      this.visible = true
      this.tempIndex = tempIndex
      this.solutionId = obj.solutionId
      this.dispatching=[]
      this.companyId = obj.companyId
      this.hasDispatchUnit = obj.hasDispatchUnit
      this.dispatching = []
      this.list = [
        {
          memberName: '',
@@ -94,7 +98,14 @@
      ]
      this.arr = obj.arr
      this.price = obj.price
      this.getFindListByDTO()
      if (obj.hasDispatchUnit === 1) {
        this.getFindListByDTO()
      } else {
        worktype({ id: obj.solutionId, queryType: 0 })
          .then(res => {
            this.list[0].options = res
          })
      }
    },
    getFindListByDTO () {
      findListByDTO({
@@ -120,7 +131,7 @@
        })
    },
    selectChangeWT (index) {
      this.list[index].workTypeName =null
      this.list[index].workTypeName = null
      this.list[index].options.forEach(item => {
        if (item.id === this.list[index].worktypeId) {
          this.list[index].workTypeName = item.name
@@ -128,17 +139,31 @@
      })
    },
    add () {
      this.list.push({
        memberName: '',
        idCard: '',
        workTypeName: '',
        worktypeId: '',
        duName: '',
        duId: '',
        options: [],
        fee: '',
        id: this.tempIndex - 1
      })
      if (!this.companyId) {
        this.list.push({
          memberName: '',
          idCard: '',
          workTypeName: '',
          worktypeId: '',
          duName: '',
          duId: '',
          options: [],
          fee: '',
          id: this.tempIndex - 1
        })
      } else {
        this.list.push({
          memberName: '',
          idCard: '',
          workTypeName: '',
          worktypeId: '',
          duName: '',
          duId: '',
          options: JSON.parse(JSON.stringify(this.list[0].options)),
          fee: '',
          id: this.tempIndex - 1
        })
      }
    },
    dele (index) {
      this.list.splice(index, 1)
@@ -167,6 +192,13 @@
          this.$message.warning(`第${i + 1}项员工身份证不合法`)
          return
        }
        const s=parseInt(this.list[i].idCard.substring(16,17))
        // const s = parseInt(this.list[i].idCard.slice(16, 1))
        if (s % 2 === 0) {
          this.list[i].sex = 1
        } else {
          this.list[i].sex = 0
        }
      }
      // 判断详情列表数据身份证是否有重复
      let next = true
@@ -181,6 +213,7 @@
        this.list.forEach(item => {
          item.fee = this.price
        })
        console.log(this.list)
        this.$emit('result', this.list)
        this.visible = false
      } else {