| | |
| | | </span> |
| | | <el-select v-model="content.users" value-key="id" multiple |
| | | :placeholder="params.type ? '请选择评定人' : '请输入候选人'"> |
| | | <div class="allSelected"> |
| | | <el-checkbox @change="handleEmployeeChange($event, content)">全选</el-checkbox> |
| | | </div> |
| | | <el-option v-for="employee in content.employees" :key="employee.id" :label="employee.name" |
| | | :value="employee"></el-option> |
| | | </el-select> |
| | |
| | | methods: { |
| | | submitOrEdit() { |
| | | const { candidateNum } = this.addForm |
| | | const isExist = candidateNum.find(item => item.val === void 0 || item.val === 0) |
| | | const isExist = candidateNum.find(item => item.val === void 0 || item.val === 0 || item.users.length === 0) |
| | | if (isExist) { |
| | | this.$message.warning(`${isExist.deptName}候选人人数不可为空或者0`) |
| | | } else { |
| | |
| | | deptId: dept.id, |
| | | deptName: dept.title, |
| | | users: [], |
| | | employees: records, |
| | | employees: records |
| | | }); |
| | | this.setDefaultValue(this.depts); |
| | | }); |
| | |
| | | }) |
| | | this.selectGroup = newParams |
| | | }, |
| | | handleEmployeeChange(val, content) { |
| | | if (val) { |
| | | content.employees.forEach(item => { |
| | | content.users.push({ |
| | | id: item.id, |
| | | name: item.name |
| | | }) |
| | | }) |
| | | } else { |
| | | content.users = [] |
| | | } |
| | | } |
| | | }, |
| | | }; |
| | | </script> |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | .allSelected { |
| | | padding: 0 20px; |
| | | border-bottom: 1px solid #dcdcdc; |
| | | } |
| | | </style> |