人员管理模块优化

This commit is contained in:
BianLzhaoMin 2025-12-26 10:36:01 +08:00
parent e49f216474
commit ed7d25f1c0
2 changed files with 29 additions and 5 deletions

View File

@ -9,7 +9,7 @@ export const buildFormColumns = (
) => [ ) => [
{ {
type: 'input', type: 'input',
prop: 'personName', prop: 'name',
placeholder: '请输入姓名', placeholder: '请输入姓名',
}, },
{ {

View File

@ -17,8 +17,8 @@
<el-switch <el-switch
active-value="1" active-value="1"
inactive-value="0" inactive-value="0"
v-model="row.longTermSecondment" :model-value="getLongTermSecondmentValue(row)"
@change="onHandleLongTermSecondmentChange(row)" @change="onHandleLongTermSecondmentChange($event, row)"
/> />
</template> </template>
</ComTable> </ComTable>
@ -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) => { const onHandleLongTermSecondmentChange = (value, row) => {
console.log(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()
}
})
} }
</script> </script>