From ed7d25f1c0f0dae88570f5662931c4720361570d Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Fri, 26 Dec 2025 10:36:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E5=91=98=E7=AE=A1=E7=90=86=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/personManage/Person/config.js | 2 +- src/views/personManage/Person/index.vue | 32 +++++++++++++++++++++---- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/src/views/personManage/Person/config.js b/src/views/personManage/Person/config.js index 8be1227..8d557f4 100644 --- a/src/views/personManage/Person/config.js +++ b/src/views/personManage/Person/config.js @@ -9,7 +9,7 @@ export const buildFormColumns = ( ) => [ { type: 'input', - prop: 'personName', + prop: 'name', placeholder: '请输入姓名', }, { diff --git a/src/views/personManage/Person/index.vue b/src/views/personManage/Person/index.vue index 791fb49..1d083e1 100644 --- a/src/views/personManage/Person/index.vue +++ b/src/views/personManage/Person/index.vue @@ -17,8 +17,8 @@ @@ -207,8 +207,32 @@ const onCloseDialogOuter = (visible) => { } } +// 获取 longTermSecondment 的值,统一转换为字符串格式 +const getLongTermSecondmentValue = (row) => { + const value = row.longTermSecondment + if (value === null || value === undefined) { + return '0' + } + // 如果是数字,转换为字符串;如果已经是字符串,直接返回 + return String(value) +} + // 是否长期借调 -const onHandleLongTermSecondmentChange = (row) => { - console.log(row) +const onHandleLongTermSecondmentChange = (value, row) => { + // 更新 row 数据,保持与 switch 组件的值同步 + row.longTermSecondment = value + + // 组装参数:将字符串转换为数字('1' -> 1, '0' -> 0) + const params = { + id: row.id, + longTermSecondment: value === '1' ? 1 : 0, + } + + updatePersonAPI(params).then((res) => { + if (res.code === 200) { + proxy.$modal.msgSuccess('更新成功') + comTableRef.value?.refresh() + } + }) }