| | |
| | | const { $index, id, deptId } = row |
| | | const params = $props.params.data |
| | | const info = params.candidateNum.find(item => item.deptId === deptId) |
| | | const index = info.users.find(item => item.id === id) |
| | | const index = info.users.findIndex(item => item.id === id) |
| | | info.users.splice(index, 1) |
| | | if (info.val > info.users.length) { |
| | | info.val = info.users.length |
| | | } |
| | | update(params).then( |
| | | () => { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '操作成功!', |
| | | }); |
| | | initData() |
| | | $emit('refreshTable', '') |
| | | }, |
| | | error => { |
| | | ElMessage({ |
| | | type: 'error', |
| | | message: error, |
| | | }); |
| | | } |
| | | ); |
| | | // if (info.val === 0) { |
| | | |
| | | // } |
| | | // if (info.val > info.users.length) { |
| | | // info.val = info.users.length |
| | | // } |
| | | // update(params).then( |
| | | // () => { |
| | | // ElMessage({ |
| | | // type: 'success', |
| | | // message: '操作成功!', |
| | | // }); |
| | | // initData() |
| | | // $emit('refreshTable', '') |
| | | // }, |
| | | // error => { |
| | | // ElMessage({ |
| | | // type: 'error', |
| | | // message: error, |
| | | // }); |
| | | // } |
| | | // ); |
| | | } |
| | | |
| | | watch(() => $props.params.visible, (val) => { |