|
@@ -255,19 +255,23 @@ const handleStore = async () => {
|
|
|
const results = [] // 只提交勾选的数据
|
|
|
if (originData.value && Array.isArray(originData.value) && originData.value.length > 0) {
|
|
|
for (let i = 0; i < originData.value.length; i++) {
|
|
|
- const talent = originData.value[i]
|
|
|
- if (!talent.data.name_zh || talent.data.name_zh.trim() === '') {
|
|
|
- return message.warning(`第${i + 1}个人才中的中文姓名未填写,请完善后再进行保存`)
|
|
|
- }
|
|
|
-
|
|
|
- // 处理mobile字段,如果是数组则转换为字符串
|
|
|
- if (Array.isArray(talent.data.mobile)) {
|
|
|
- talent.data.mobile = talent.data.mobile.filter(i => Boolean(i)).map(j => String(j).replace(/,|,/g, '')).join(',');
|
|
|
+ // 只校验勾选的数据
|
|
|
+ if (tagList.value[i].checked) {
|
|
|
+ const talent = originData.value[i]
|
|
|
+ if (!talent.data.name_zh || talent.data.name_zh.trim() === '') {
|
|
|
+ return message.warning(`第${i + 1}个人才中的中文姓名未填写,请完善后再进行保存`)
|
|
|
+ }
|
|
|
+
|
|
|
+ // 处理mobile字段,如果是数组则转换为字符串
|
|
|
+ if (Array.isArray(talent.data.mobile)) {
|
|
|
+ talent.data.mobile = talent.data.mobile.filter(i => Boolean(i)).map(j => String(j).replace(/,|,/g, '')).join(',');
|
|
|
+ }
|
|
|
+ results.push(talent) //
|
|
|
}
|
|
|
- if (tagList.value[i].checked) results.push(talent) // 只提交勾选的数据
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ if (!results?.length) return message.warning(`未选择人才,请选择要入库的人才!`)
|
|
|
await message.confirm('是否对当前选中的人才进行入库?')
|
|
|
|
|
|
const loading = ElLoading.service({
|