cqp 2 месяцев назад
Родитель
Сommit
a64775b44f
2 измененных файлов с 11 добавлено и 1 удалено
  1. 10 0
      app/Service/ImportService.php
  2. 1 1
      config/excel/employee.php

+ 10 - 0
app/Service/ImportService.php

@@ -298,6 +298,7 @@ class ImportService extends Service
         $eductionIdx = array_search('education', $keys);
         $stateIdx = array_search('state', $keys);
         $manIdx = array_search('man_type', $keys);
+        $entrustIdx = array_search('entrust_type', $keys);
         $depIdx = array_search('depart_code', $keys);
 
         $code_map = $this->getEmployeeList($array, $user, $codeIdx);
@@ -312,6 +313,7 @@ class ImportService extends Service
         $e_map = array_flip(Employee::Education);
         $state_map = array_flip(Employee::State_Type);
         $man_map = array_flip(Employee::Man_Type);
+        $wt_map = array_flip(Employee::WT_Type);
 
         // 获取所有标记为 is_main 的列索引,用于一致性对比
         $mainColIndices = [];
@@ -380,6 +382,14 @@ class ImportService extends Service
                 $array[$rowIndex][$manIdx] = $man_map[$man_text];
             }
 
+            //委托类型
+            $wt_text = trim($rowValue[$entrustIdx] ?? '');
+            if (!isset($wt_map[$wt_text])) {
+                $errors[] = "第{$displayLine}行:委托方式[{$wt_text}]无效";
+            } else {
+                $array[$rowIndex][$entrustIdx] = $wt_map[$wt_text];
+            }
+
             // 4. 解析部门 (分行模式)
             if ($depIdx !== false && !empty($rowValue[$depIdx])) {
                 $mNum = trim($rowValue[$depIdx]);

+ 1 - 1
config/excel/employee.php

@@ -115,7 +115,7 @@ return [
         [
             'key' =>'entrust_type',
             'export' =>'entrust_type_title',
-            'value' => '委托类型',
+            'value' => '委托方式',
             'required' => false,
             'is_main' => true,
             'unique' => false,