Merge branch 'dev' into test

This commit is contained in:
sophie committed 2026-05-19 13:38:48 +08:00
commit c8571b35a2
9 files changed
+404 -45

No files matched your search

+116 -4
View File
@@ -380,14 +380,86 @@ def _convert_excel_to_xlsx(content: bytes, ext: str) -> bytes:
stderr = process.stderr.decode('utf-8', errors='ignore').strip()
errors.append(f"{cmd}: {stderr or f'code={process.returncode}'}")
if _convert_excel_via_windows_office(input_path, output_path):
with open(output_path, 'rb') as f:
return f.read()
errors.append("windows-office: failed to convert xls via WPS/MS Excel")
joined = "; ".join(errors) if errors else "no converter attempted"
raise RuntimeError(f"failed to convert xls to xlsx: {joined}")
def _load_excel_workbook(content: bytes, ext: str):
def _convert_excel_via_windows_office(input_path: str, output_path: str) -> bool:
"""
在 Windows 环境下使用 WPS/MS Excel 将 `.xls` 转为 `.xlsx`。
LibreOffice 不存在时,给在线预览提供兜底转换能力。
"""
if os.name != 'nt':
return False
try:
import pythoncom
import win32com.client
except ImportError:
current_app.logger.warning("pywin32 not installed, cannot fallback to WPS/MS Excel for xls preview.")
return False
app = None
workbook = None
pythoncom.CoInitialize()
try:
try:
app = win32com.client.Dispatch("KET.Application")
except Exception:
app = win32com.client.Dispatch("Excel.Application")
app.Visible = False
app.DisplayAlerts = False
workbook = app.Workbooks.Open(os.path.abspath(input_path))
workbook.SaveAs(os.path.abspath(output_path), FileFormat=51) # 51 = xlOpenXMLWorkbook (.xlsx)
workbook.Close(False)
workbook = None
app.Quit()
app = None
return os.path.exists(output_path)
except Exception as exc:
current_app.logger.warning("WPS/MS Excel conversion failed for xls preview: %s", exc)
return False
finally:
try:
if workbook is not None:
workbook.Close(False)
except Exception:
pass
try:
if app is not None:
app.Quit()
except Exception:
pass
try:
pythoncom.CoUninitialize()
except Exception:
pass
def _detect_excel_format(content: bytes, ext: str) -> str:
"""
根据文件头兜底判断 Excel 实际格式,避免只依赖 URL/文件名扩展名。
- OLE 复合文档头: 老式 `.xls`
- ZIP 头: `.xlsx`
"""
normalized_ext = (ext or '').strip().lower()
head = content[:8] if content else b''
if head.startswith(b'PK\x03\x04'):
return 'xlsx'
if head.startswith(b'\xD0\xCF\x11\xE0'):
return 'xls'
return normalized_ext
def _load_excel_workbook(content: bytes, ext: str):
normalized_ext = _detect_excel_format(content, ext)
if normalized_ext == 'xls':
content = _convert_excel_to_xlsx(content, normalized_ext)
content = _convert_excel_to_xlsx(content, 'xls')
return load_workbook(filename=io.BytesIO(content), data_only=True, read_only=True)
@@ -414,6 +486,29 @@ def get_oa_employees():
return jsonify({'error': str(e)}), 500
@chat_bp.route('/oa/resolve-names', methods=['GET'])
@require_agent_permission
def resolve_oa_names():
dept_ids = request.args.get('department_ids', '').strip()
sub_ids = request.args.get('subcompany_ids', '').strip()
result = {}
try:
from app.services.oa_sqlserver import OASQLServerService
if dept_ids:
for did in dept_ids.split(','):
did = did.strip()
if did:
result[f'dept_{did}'] = OASQLServerService.get_department_name(did)
if sub_ids:
for sid in sub_ids.split(','):
sid = sid.strip()
if sid:
result[f'sub_{sid}'] = OASQLServerService.get_subcompany_name(sid)
except Exception as e:
current_app.logger.error(f"[OA-ResolveNames] Query failed: {e}")
return jsonify(result)
@chat_bp.route('/sessions', methods=['GET'])
@require_agent_permission
def get_chat_sessions():
@@ -830,8 +925,25 @@ def preview_excel():
try:
wb = _load_excel_workbook(content, ext)
except Exception as e:
current_app.logger.warning("[excel-preview] parse workbook failed: %s", e)
return jsonify({'error': 'failed to parse excel file'}), 422
detected_ext = _detect_excel_format(content or b'', ext)
current_app.logger.warning(
"[excel-preview] parse workbook failed ext=%s detected_ext=%s size=%s name=%s url=%s err=%r",
ext,
detected_ext,
len(content or b''),
name,
file_url,
e,
)
payload = {'error': 'failed to parse excel file'}
if current_app.config.get('DEBUG') or os.getenv('ENV_NAME', 'dev').strip().lower() == 'dev':
payload.update({
'detail': str(e),
'ext': ext,
'detected_ext': detected_ext,
'size': len(content or b''),
})
return jsonify(payload), 422
if not wb.sheetnames:
return jsonify({'error': 'workbook has no sheets'}), 422
+6
View File
@@ -1576,11 +1576,17 @@ def submit_leave_workflow():
form_data = {
'applicantName': _clean_str(data.get('applicantName')) or _clean_str(getattr(user, 'real_name', None)) or _clean_str(getattr(user, 'username', None)),
'employeeId': _clean_str(data.get('employeeId')) or _clean_str(getattr(user, 'employee_id', None)) or _clean_str(getattr(user, 'username', None)),
'applicantJobTitle': _clean_str(data.get('applicantJobTitle')),
'applicantDepartmentId': _clean_str(data.get('applicantDepartmentId')),
'applicantSubCompanyId1': _clean_str(data.get('applicantSubCompanyId1')),
'applyTime': _clean_str(data.get('applyTime')),
'fillerName': _clean_str(data.get('fillerName')) or _clean_str(getattr(user, 'real_name', None)) or _clean_str(getattr(user, 'username', None)),
'agentUid': _clean_str(data.get('agentUid')),
'agentEmployeeId': _clean_str(data.get('agentEmployeeId')),
'agentName': _clean_str(data.get('agentName')),
'agentJobTitle': _clean_str(data.get('agentJobTitle')),
'agentDepartmentId': _clean_str(data.get('agentDepartmentId')),
'agentSubCompanyId1': _clean_str(data.get('agentSubCompanyId1')),
'leaveType': _clean_str(data.get('leaveType')),
'startTime': _clean_str(data.get('startTime')),
'endTime': _clean_str(data.get('endTime')),
+52
View File
@@ -166,8 +166,22 @@ class OALeaveWorkflowService:
'employee_id': matched['employeeId'],
'user_id': matched['uid'],
'name': matched['name'],
'jobtitle': matched.get('jobtitle', ''),
'jobtitleName': matched.get('jobtitleName', ''),
'departmentid': matched.get('departmentid', ''),
'departmentName': matched.get('departmentName', ''),
'subcompanyid1': matched.get('subcompanyid1', ''),
'subcompanyName': matched.get('subcompanyName', ''),
}
@staticmethod
def _pick_browser_field_value(*values: Any) -> str:
for value in values:
text = ('' if value is None else str(value)).strip()
if text:
return text
return ''
@classmethod
def _build_get_template_body(cls, workflow_id: str, oa_user_id: str) -> ET.Element:
root = ET.Element(f'{{{SERVICE_NS}}}getCreateWorkflowRequestInfo')
@@ -301,6 +315,44 @@ class OALeaveWorkflowService:
cls._set_field(request_info, 'sqrgh', value=applicant['employee_id'])
cls._set_field(request_info, 'tdrxm', value=filler['user_id'], show_value=filler['name'])
cls._set_field(request_info, 'sqrxm', value=applicant['user_id'], show_value=applicant['name'])
filler_jobtitle = cls._pick_browser_field_value(filler.get('jobtitle'), form_data.get('fillerJobTitle'))
filler_jobtitle_name = cls._pick_browser_field_value(filler.get('jobtitleName'))
filler_department = cls._pick_browser_field_value(filler.get('departmentid'), form_data.get('fillerDepartmentId'))
filler_department_name = cls._pick_browser_field_value(filler.get('departmentName'))
filler_subcompany = cls._pick_browser_field_value(filler.get('subcompanyid1'), form_data.get('fillerSubCompanyId1'))
filler_subcompany_name = cls._pick_browser_field_value(filler.get('subcompanyName'))
applicant_jobtitle = cls._pick_browser_field_value(applicant.get('jobtitle'), form_data.get('applicantJobTitle'))
applicant_jobtitle_name = cls._pick_browser_field_value(applicant.get('jobtitleName'))
applicant_department = cls._pick_browser_field_value(applicant.get('departmentid'), form_data.get('applicantDepartmentId'))
applicant_department_name = cls._pick_browser_field_value(applicant.get('departmentName'))
applicant_subcompany = cls._pick_browser_field_value(applicant.get('subcompanyid1'), form_data.get('applicantSubCompanyId1'))
applicant_subcompany_name = cls._pick_browser_field_value(applicant.get('subcompanyName'))
try:
from app.services.oa_sqlserver import OASQLServerService
if filler_jobtitle and not filler_jobtitle_name:
filler_jobtitle_name = OASQLServerService.get_jobtitle_name(filler_jobtitle)
if filler_department and not filler_department_name:
filler_department_name = OASQLServerService.get_department_name(filler_department)
if filler_subcompany and not filler_subcompany_name:
filler_subcompany_name = OASQLServerService.get_subcompany_name(filler_subcompany)
if applicant_jobtitle and not applicant_jobtitle_name:
applicant_jobtitle_name = OASQLServerService.get_jobtitle_name(applicant_jobtitle)
if applicant_department and not applicant_department_name:
applicant_department_name = OASQLServerService.get_department_name(applicant_department)
if applicant_subcompany and not applicant_subcompany_name:
applicant_subcompany_name = OASQLServerService.get_subcompany_name(applicant_subcompany)
except Exception:
pass
cls._set_field(request_info, 'tdrzw', value=filler_jobtitle, show_value=filler_jobtitle_name or filler_jobtitle or '暂无')
cls._set_field(request_info, 'tdrbm', value=filler_department, show_value=filler_department_name or filler_department or '暂无')
cls._set_field(request_info, 'tdrgs', value=filler_subcompany, show_value=filler_subcompany_name or filler_subcompany or '暂无')
cls._set_field(request_info, 'sqrzw', value=applicant_jobtitle, show_value=applicant_jobtitle_name or applicant_jobtitle or '暂无')
cls._set_field(request_info, 'sqrbm', value=applicant_department, show_value=applicant_department_name or applicant_department or '暂无')
cls._set_field(request_info, 'sqrgs', value=applicant_subcompany, show_value=applicant_subcompany_name or applicant_subcompany or '暂无')
cls._set_field(request_info, 'dlrgh', value=agent['employee_id'])
cls._set_field(request_info, 'dlrxm', value=agent['user_id'], show_value=agent['name'])
cls._set_field(request_info, 'dlrlogid', value=agent['user_id'], show_value=agent['user_id'])
+92 -13
View File
@@ -62,10 +62,16 @@ class OASQLServerService:
# Fetch page
# Compatible with older SQL Server versions (2008/2012)
query_sql = """
SELECT id, workcode, lastname
SELECT v.id, v.workcode, v.lastname, v.jobtitle, v.departmentid, v.subcompanyid1,
d.departmentname, s.subcompanyname, j.jobtitlename
FROM (
SELECT id, workcode, lastname, ROW_NUMBER() OVER(ORDER BY id) as rn
FROM userInfo_view
SELECT v.id, v.workcode, v.lastname, v.jobtitle, v.departmentid, v.subcompanyid1,
d.departmentname, s.subcompanyname, j.jobtitlename,
ROW_NUMBER() OVER(ORDER BY v.id) as rn
FROM userInfo_view v
LEFT JOIN HrmDepartment d ON v.departmentid = d.id
LEFT JOIN HrmSubCompany s ON v.subcompanyid1 = s.id
LEFT JOIN HrmJobTitles j ON v.jobtitle = j.id
WHERE 1=1
"""
if keyword:
@@ -82,9 +88,15 @@ class OASQLServerService:
items = []
for row in cursor.fetchall():
items.append({
"uid": str(row.id),
"employeeId": str(row.workcode),
"name": str(row.lastname)
"uid": str(row.id) if row.id is not None else "",
"employeeId": str(row.workcode) if row.workcode is not None else "",
"name": str(row.lastname) if row.lastname is not None else "",
"jobtitle": str(row.jobtitle) if row.jobtitle is not None else "",
"departmentid": str(row.departmentid) if row.departmentid is not None else "",
"subcompanyid1": str(row.subcompanyid1) if row.subcompanyid1 is not None else "",
"departmentName": str(row.departmentname).strip() if row.departmentname else "",
"subcompanyName": str(row.subcompanyname).strip() if row.subcompanyname else "",
"jobtitleName": str(row.jobtitlename).strip() if row.jobtitlename else "",
})
return {
@@ -110,10 +122,14 @@ class OASQLServerService:
raise RuntimeError("缺少姓名或工号,无法查询 OA 用户")
query_sql = """
SELECT TOP 1 id, workcode, lastname
FROM userInfo_view
WHERE workcode = ? AND lastname = ?
ORDER BY id
SELECT TOP 1 v.id, v.workcode, v.lastname, v.jobtitle, v.departmentid, v.subcompanyid1,
d.departmentname, s.subcompanyname, j.jobtitlename
FROM userInfo_view v
LEFT JOIN HrmDepartment d ON v.departmentid = d.id
LEFT JOIN HrmSubCompany s ON v.subcompanyid1 = s.id
LEFT JOIN HrmJobTitles j ON v.jobtitle = j.id
WHERE v.workcode = ? AND v.lastname = ?
ORDER BY v.id
"""
cursor.execute(query_sql, [normalized_employee_id, normalized_name])
row = cursor.fetchone()
@@ -121,12 +137,75 @@ class OASQLServerService:
return None
return {
"uid": str(row.id),
"employeeId": str(row.workcode),
"name": str(row.lastname),
"uid": str(row.id) if row.id is not None else "",
"employeeId": str(row.workcode) if row.workcode is not None else "",
"name": str(row.lastname) if row.lastname is not None else "",
"jobtitle": str(row.jobtitle) if row.jobtitle is not None else "",
"departmentid": str(row.departmentid) if row.departmentid is not None else "",
"subcompanyid1": str(row.subcompanyid1) if row.subcompanyid1 is not None else "",
"departmentName": str(row.departmentname).strip() if row.departmentname else "",
"subcompanyName": str(row.subcompanyname).strip() if row.subcompanyname else "",
"jobtitleName": str(row.jobtitlename).strip() if row.jobtitlename else "",
}
finally:
try:
cursor.close()
finally:
connection.close()
@classmethod
def get_department_name(cls, department_id: str) -> str:
if not department_id or not department_id.strip():
return ""
connection = cls._connect()
cursor = connection.cursor()
try:
cursor.execute(
"SELECT TOP 1 departmentname FROM HrmDepartment WHERE id = ?",
[department_id.strip()],
)
row = cursor.fetchone()
return str(row.departmentname).strip() if row and row.departmentname else ""
finally:
try:
cursor.close()
finally:
connection.close()
@classmethod
def get_subcompany_name(cls, subcompany_id: str) -> str:
if not subcompany_id or not subcompany_id.strip():
return ""
connection = cls._connect()
cursor = connection.cursor()
try:
cursor.execute(
"SELECT TOP 1 subcompanyname FROM HrmSubCompany WHERE id = ?",
[subcompany_id.strip()],
)
row = cursor.fetchone()
return str(row.subcompanyname).strip() if row and row.subcompanyname else ""
finally:
try:
cursor.close()
finally:
connection.close()
@classmethod
def get_jobtitle_name(cls, jobtitle_id: str) -> str:
if not jobtitle_id or not jobtitle_id.strip():
return ""
connection = cls._connect()
cursor = connection.cursor()
try:
cursor.execute(
"SELECT TOP 1 jobtitlename FROM HrmJobTitles WHERE id = ?",
[jobtitle_id.strip()],
)
row = cursor.fetchone()
return str(row.jobtitlename).strip() if row and row.jobtitlename else ""
finally:
try:
cursor.close()
finally:
connection.close()
+19 -16
View File
@@ -35,29 +35,32 @@
\| d072003 | int | - | 已休育儿假时数 |
\| d072004 | int | - | 未休育儿假时数 |
# OA数据对接AI知识库-请假流程相关视图
- DB:192.168.100.225:1433
- UserName:AI_Knowledge_Base_OA
- Password:hoo-thai@123_AI_OA
- UserName:AI\_Knowledge\_Base\_OA
- Password:hoo-thai\@123\_AI\_OA
- 默认数据库:ecology
## 用途:流程当前节点视图
- 视图:v_workflow_requestbase
| 字段名称 | 字段类型 | 字符长度 | 字段说明 |
| --- | --- | --- | --- |
| requestid | int | int | 流程ID |
| status | varchar | varchar(500) | 流程状态 |
| workflowid | int | int | 流程类型ID |
| nodename | varchar | varchar(1000) | 当前节点名称 |
- 视图:v\_workflow\_requestbase
| 字段名称 | 字段类型 | 字符长度 | 字段说明 |
| ---------- | ------- | ------------- | ------ |
| requestid | int | int | 流程ID |
| status | varchar | varchar(500) | 流程状态 |
| workflowid | int | int | 流程类型ID |
| nodename | varchar | varchar(1000) | 当前节点名称 |
## 用途:员工信息视图
- 视图:userInfo_view
| 字段名称 | 字段类型 | 字符长度 | 字段说明 |
| --- | --- | --- | --- |
| workcode | varchar | varchar(1000) | 员工工号 |
| lastname | varchar | varchar(1000) | 员工姓名 |
| id | int | int | 员工ID |
- 视图:userInfo\_view
| 字段名称 | 字段类型 | 字符长度 | 字段说明 |
| ----------------- | ------- | ------------- | ------ |
| workcode | varchar | varchar(1000) | 员工工号 |
| lastname | varchar | varchar(1000) | 员工姓名 |
| id | int | int | 员工ID |
| **jobtitle** | int | int | 岗位ID |
| **departmentid** | int | int | 所属部门ID |
| **subcompanyid1** | int | int | 所属分部ID |
+2 -6
View File
@@ -10,12 +10,8 @@
<meta name="apple-mobile-web-app-title" content="AI工作台" />
<link rel="manifest" href="/manifest.webmanifest" />
<title>AI工作台</title>
<<<<<<< HEAD
<script type="module" crossorigin src="/assets/index-CSfNFoqX.js"></script>
=======
<script type="module" crossorigin src="/assets/index-B0LSqDmY.js"></script>
>>>>>>> dev
<link rel="stylesheet" crossorigin href="/assets/index-XvG2TD5m.css">
<script type="module" crossorigin src="/assets/index-CsJr350M.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-Bir-WxSG.css">
</head>
<body>
<div id="app"></div>␍
+33 -4
View File
@@ -10,6 +10,7 @@
*/
import { computed, ref, watch } from 'vue';
import { marked } from 'marked';
import * as XLSX from 'xlsx';
import VueOfficeDocx from '@vue-office/docx';
import VueOfficeExcel from '@vue-office/excel';
import '@vue-office/docx/lib/index.css';
@@ -296,16 +297,44 @@ const loadContent = async () => {
agent_id: String(props.agentId),
url: props.file.url,
name: props.file.name || '',
limit: '100',
});
const res = await fetch(`/api/chat/preview-excel?${params.toString()}`, {
const res = await fetch(`/api/chat/preview-file-raw?${params.toString()}`, {
headers: props.authHeaders || {},
});
const data = await res.json().catch(() => ({}));
if (!res.ok) {
const data = await res.json().catch(() => ({}));
throw new Error(data?.error || `HTTP ${res.status}`);
}
excelPreview.value = data as ExcelPreviewData;
const buffer = await res.arrayBuffer();
const workbook = XLSX.read(buffer, { type: 'array' });
if (!workbook.SheetNames.length) {
throw new Error('workbook has no sheets');
}
const sheetName = workbook.SheetNames[0] || 'Sheet1';
const worksheet = workbook.Sheets[sheetName];
if (!worksheet) {
throw new Error(`worksheet not found: ${sheetName}`);
}
const matrix = XLSX.utils.sheet_to_json<(string | number | boolean)[]>(worksheet, {
header: 1,
raw: false,
defval: '',
});
const limit = 100;
const rows = matrix.slice(0, limit).map((row) => row.map((cell) => cell ?? ''));
const maxCols = rows.reduce((max, row) => Math.max(max, row.length), 0);
const normalizedRows = rows.map((row) =>
row.length < maxCols ? [...row, ...Array(maxCols - row.length).fill('')] : row
);
excelPreview.value = {
sheet_name: sheetName,
sheets: workbook.SheetNames,
columns: Array.from({ length: maxCols }, (_, i) => `COL_${i + 1}`),
rows: normalizedRows,
limit,
truncated: matrix.length > limit,
};
resolvedMode.value = 'sheet';
} catch (e: any) {
error.value = e?.message || 'Failed to preview excel';
+2 -2
View File
@@ -1000,8 +1000,8 @@ const messages = {
},
landing: {
hero: {
prefix: '和信',
highlight: '紧密 AI智能体 应用平台',
prefix: '和信精密',
highlight: 'AI智能体 应用平台',
subtitle: 'AI的世界,期望让你开心工作,快乐生活。'
},
agent: {
+82
View File
@@ -674,11 +674,29 @@ interface LeaveRequestFormData {
applicantName: string;
employeeId: string;
applicantUid: string;
applicantJobTitle?: string;
applicantJobTitleName?: string;
applicantDepartmentId?: string;
applicantSubCompanyId1?: string;
applicantDepartmentName?: string;
applicantSubCompanyName?: string;
applyTime: string;
fillerName: string;
fillerJobTitle?: string;
fillerJobTitleName?: string;
fillerDepartmentId?: string;
fillerSubCompanyId1?: string;
fillerDepartmentName?: string;
fillerSubCompanyName?: string;
agentUid: string;
agentEmployeeId: string;
agentName: string;
agentJobTitle?: string;
agentJobTitleName?: string;
agentDepartmentId?: string;
agentSubCompanyId1?: string;
agentDepartmentName?: string;
agentSubCompanyName?: string;
leaveType: string;
startTime: string;
endTime: string;
@@ -714,6 +732,12 @@ interface LeaveAgentOption {
uid: string;
employeeId: string;
name: string;
jobtitle?: string;
jobtitleName?: string;
departmentid?: string;
subcompanyid1?: string;
departmentName?: string;
subcompanyName?: string;
}
let leaveFlowCounter = 0;
@@ -939,6 +963,34 @@ const startLocalLeaveFlow = async (content: string) => {
};
messages.value.push(formMsg);
try {
const keyword = payload.form.applicantName || payload.form.employeeId;
if (keyword) {
const res = await fetch(`/api/chat/oa/employees?keyword=${encodeURIComponent(keyword)}&page=1&page_size=1&agent_id=${agentId}`, { headers: getAuthHeaders() });
if (res.ok) {
const data = await res.json();
const match = (data.items || []).find((item: LeaveAgentOption) => item.employeeId === payload.form.employeeId);
if (match) {
payload.form.fillerJobTitle = match.jobtitle || '';
payload.form.fillerJobTitleName = match.jobtitleName || '';
payload.form.fillerDepartmentId = match.departmentid || '';
payload.form.fillerSubCompanyId1 = match.subcompanyid1 || '';
payload.form.fillerDepartmentName = match.departmentName || '';
payload.form.fillerSubCompanyName = match.subcompanyName || '';
payload.form.applicantUid = match.uid || '';
payload.form.applicantJobTitle = match.jobtitle || '';
payload.form.applicantJobTitleName = match.jobtitleName || '';
payload.form.applicantDepartmentId = match.departmentid || '';
payload.form.applicantSubCompanyId1 = match.subcompanyid1 || '';
payload.form.applicantDepartmentName = match.departmentName || '';
payload.form.applicantSubCompanyName = match.subcompanyName || '';
}
}
}
} catch (e) {
console.error('Failed to prefill OA user info', e);
}
await saveLocalMessageToBackend(formMsg, content);
// 发送完成后刷新历史记录,确保新会话出现
@@ -1036,10 +1088,22 @@ const selectLeaveAgent = (option: LeaveAgentOption) => {
payload.form.agentUid = option.uid;
payload.form.agentEmployeeId = option.employeeId;
payload.form.agentName = option.name;
payload.form.agentJobTitle = option.jobtitle;
payload.form.agentJobTitleName = option.jobtitleName;
payload.form.agentDepartmentId = option.departmentid;
payload.form.agentSubCompanyId1 = option.subcompanyid1;
payload.form.agentDepartmentName = option.departmentName;
payload.form.agentSubCompanyName = option.subcompanyName;
} else {
payload.form.applicantUid = option.uid;
payload.form.employeeId = option.employeeId;
payload.form.applicantName = option.name;
payload.form.applicantJobTitle = option.jobtitle;
payload.form.applicantJobTitleName = option.jobtitleName;
payload.form.applicantDepartmentId = option.departmentid;
payload.form.applicantSubCompanyId1 = option.subcompanyid1;
payload.form.applicantDepartmentName = option.departmentName;
payload.form.applicantSubCompanyName = option.subcompanyName;
}
closeLeaveAgentDialog();
@@ -1884,11 +1948,29 @@ const showChatRating = ref(false);
<div v-else-if="msg.type === 'leave-confirmation' && getLeaveConfirmationPayload(msg)" class="space-y-4">
<div class="text-sm font-medium text-slate-700 dark:text-slate-200">{{ msg.content }}</div>
<div class="rounded-2xl border border-slate-200 bg-slate-50/90 p-4 dark:border-slate-700 dark:bg-slate-800/60">
<div class="mb-3 text-xs font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500">填单人信息</div>
<div class="grid gap-3 text-sm md:grid-cols-2">
<div><span class="text-slate-500 dark:text-slate-400">填单人:</span>{{ getLeaveConfirmationPayload(msg)!.form.fillerName || '暂无数据' }}</div>
<div><span class="text-slate-500 dark:text-slate-400">创建时间:</span>{{ getLeaveConfirmationPayload(msg)!.form.applyTime.replace('T', ' ') }}</div>
<div v-if="getLeaveConfirmationPayload(msg)!.form.fillerJobTitleName || getLeaveConfirmationPayload(msg)!.form.fillerJobTitle"><span class="text-slate-500 dark:text-slate-400">填单人职务:</span>{{ getLeaveConfirmationPayload(msg)!.form.fillerJobTitleName || getLeaveConfirmationPayload(msg)!.form.fillerJobTitle }}</div>
<div v-if="getLeaveConfirmationPayload(msg)!.form.fillerDepartmentName || getLeaveConfirmationPayload(msg)!.form.fillerDepartmentId"><span class="text-slate-500 dark:text-slate-400">填单人部门:</span>{{ getLeaveConfirmationPayload(msg)!.form.fillerDepartmentName || getLeaveConfirmationPayload(msg)!.form.fillerDepartmentId }}</div>
<div v-if="getLeaveConfirmationPayload(msg)!.form.fillerSubCompanyName || getLeaveConfirmationPayload(msg)!.form.fillerSubCompanyId1"><span class="text-slate-500 dark:text-slate-400">填单人公司:</span>{{ getLeaveConfirmationPayload(msg)!.form.fillerSubCompanyName || getLeaveConfirmationPayload(msg)!.form.fillerSubCompanyId1 }}</div>
</div>
<div class="my-3 border-t border-slate-200 dark:border-slate-700"></div>
<div class="mb-3 text-xs font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500">申请人信息</div>
<div class="grid gap-3 text-sm md:grid-cols-2">
<div><span class="text-slate-500 dark:text-slate-400">请假人:</span>{{ getLeaveConfirmationPayload(msg)!.form.applicantName }}({{ getLeaveConfirmationPayload(msg)!.form.employeeId }})</div>
<div v-if="getLeaveConfirmationPayload(msg)!.form.applicantJobTitleName || getLeaveConfirmationPayload(msg)!.form.applicantJobTitle"><span class="text-slate-500 dark:text-slate-400">申请人职务:</span>{{ getLeaveConfirmationPayload(msg)!.form.applicantJobTitleName || getLeaveConfirmationPayload(msg)!.form.applicantJobTitle }}</div>
<div v-if="getLeaveConfirmationPayload(msg)!.form.applicantDepartmentName || getLeaveConfirmationPayload(msg)!.form.applicantDepartmentId"><span class="text-slate-500 dark:text-slate-400">申请人部门:</span>{{ getLeaveConfirmationPayload(msg)!.form.applicantDepartmentName || getLeaveConfirmationPayload(msg)!.form.applicantDepartmentId }}</div>
<div v-if="getLeaveConfirmationPayload(msg)!.form.applicantSubCompanyName || getLeaveConfirmationPayload(msg)!.form.applicantSubCompanyId1"><span class="text-slate-500 dark:text-slate-400">申请人公司:</span>{{ getLeaveConfirmationPayload(msg)!.form.applicantSubCompanyName || getLeaveConfirmationPayload(msg)!.form.applicantSubCompanyId1 }}</div>
</div>
<div class="my-3 border-t border-slate-200 dark:border-slate-700"></div>
<div class="mb-3 text-xs font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500">请假信息</div>
<div class="grid gap-3 text-sm md:grid-cols-2">
<div><span class="text-slate-500 dark:text-slate-400">代理人:</span>{{ getLeaveAgentDisplayValue(getLeaveConfirmationPayload(msg)!.form) || '未选择' }}</div>
<div v-if="getLeaveConfirmationPayload(msg)!.form.agentJobTitleName || getLeaveConfirmationPayload(msg)!.form.agentJobTitle"><span class="text-slate-500 dark:text-slate-400">代理人职务:</span>{{ getLeaveConfirmationPayload(msg)!.form.agentJobTitleName || getLeaveConfirmationPayload(msg)!.form.agentJobTitle }}</div>
<div v-if="getLeaveConfirmationPayload(msg)!.form.agentDepartmentName || getLeaveConfirmationPayload(msg)!.form.agentDepartmentId"><span class="text-slate-500 dark:text-slate-400">代理人部门:</span>{{ getLeaveConfirmationPayload(msg)!.form.agentDepartmentName || getLeaveConfirmationPayload(msg)!.form.agentDepartmentId }}</div>
<div v-if="getLeaveConfirmationPayload(msg)!.form.agentSubCompanyName || getLeaveConfirmationPayload(msg)!.form.agentSubCompanyId1"><span class="text-slate-500 dark:text-slate-400">代理人公司:</span>{{ getLeaveConfirmationPayload(msg)!.form.agentSubCompanyName || getLeaveConfirmationPayload(msg)!.form.agentSubCompanyId1 }}</div>
<div><span class="text-slate-500 dark:text-slate-400">假别:</span>{{ getLeaveTypeLabel(getLeaveConfirmationPayload(msg)!.form.leaveType) }}</div>
<div><span class="text-slate-500 dark:text-slate-400">时长:</span>{{ formatDurationLabel(getLeaveConfirmationPayload(msg)!.form.durationHours) }}</div>
<div><span class="text-slate-500 dark:text-slate-400">开始时间:</span>{{ getLeaveConfirmationPayload(msg)!.form.startTime.replace('T', ' ') }}</div>