GuLiMmo
2023-12-21 709cac10fe255036f786e2fa76a0290343deb6b6
src/views/evaluate/components/addCandidate.vue
@@ -146,27 +146,30 @@
    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) => {