Change department to position
This commit is contained in:
@@ -61,7 +61,7 @@ function EmployeeSerialsPage() {
|
||||
}
|
||||
};
|
||||
|
||||
const handleGenerate = async (values: { companyName: string; department: string; employeeName: string; quantity: number }) => {
|
||||
const handleGenerate = async (values: { companyName: string; position: string; employeeName: string; quantity: number }) => {
|
||||
setGenerateLoading(true);
|
||||
try {
|
||||
const result = await employeeSerialApi.generate(values);
|
||||
@@ -110,18 +110,23 @@ function EmployeeSerialsPage() {
|
||||
setSelectedSerial(serial);
|
||||
editForm.setFieldsValue({
|
||||
companyName: serial.companyName,
|
||||
department: serial.department,
|
||||
position: serial.position, // 映射 position 到 position
|
||||
employeeName: serial.employeeName,
|
||||
isActive: serial.isActive,
|
||||
});
|
||||
setEditModalVisible(true);
|
||||
};
|
||||
|
||||
const handleUpdate = async (values: { companyName?: string; department?: string; employeeName?: string; isActive?: boolean }) => {
|
||||
const handleUpdate = async (values: { companyName?: string; position?: string; employeeName?: string; isActive?: boolean }) => {
|
||||
if (!selectedSerial) return;
|
||||
setEditLoading(true);
|
||||
try {
|
||||
await employeeSerialApi.update(selectedSerial.serialNumber, values);
|
||||
await employeeSerialApi.update(selectedSerial.serialNumber, {
|
||||
companyName: values.companyName,
|
||||
position: values.position, // 映射 position 到 position
|
||||
employeeName: values.employeeName,
|
||||
isActive: values.isActive,
|
||||
});
|
||||
message.success('更新成功');
|
||||
setEditModalVisible(false);
|
||||
loadSerials();
|
||||
@@ -205,9 +210,9 @@ function EmployeeSerialsPage() {
|
||||
key: 'companyName',
|
||||
},
|
||||
{
|
||||
title: '部门',
|
||||
dataIndex: 'department',
|
||||
key: 'department',
|
||||
title: '职位',
|
||||
dataIndex: 'position',
|
||||
key: 'position',
|
||||
},
|
||||
{
|
||||
title: '员工姓名',
|
||||
@@ -288,7 +293,7 @@ function EmployeeSerialsPage() {
|
||||
extra={
|
||||
<Space>
|
||||
<Input.Search
|
||||
placeholder="搜索序列号/企业/部门/员工"
|
||||
placeholder="搜索序列号/企业/职位/员工"
|
||||
allowClear
|
||||
style={{ width: 250 }}
|
||||
onSearch={handleSearch}
|
||||
@@ -350,11 +355,11 @@ function EmployeeSerialsPage() {
|
||||
<Input placeholder="请输入企业名称" />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name="department"
|
||||
label="部门"
|
||||
rules={[{ required: true, message: '请输入部门' }]}
|
||||
name="position"
|
||||
label="职位"
|
||||
rules={[{ required: true, message: '请输入职位' }]}
|
||||
>
|
||||
<Input placeholder="请输入部门" />
|
||||
<Input placeholder="请输入职位" />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name="employeeName"
|
||||
@@ -436,10 +441,10 @@ function EmployeeSerialsPage() {
|
||||
<Input placeholder="请输入企业名称" />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name="department"
|
||||
label="部门"
|
||||
name="position"
|
||||
label="职位"
|
||||
>
|
||||
<Input placeholder="请输入部门" />
|
||||
<Input placeholder="请输入职位" />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name="employeeName"
|
||||
@@ -479,7 +484,7 @@ function EmployeeSerialsPage() {
|
||||
<Space direction="vertical" style={{ width: '100%' }} size="middle">
|
||||
<div>
|
||||
<p><strong>企业名称:</strong> {generatedData.serials?.[0]?.companyName}</p>
|
||||
<p><strong>部门:</strong> {generatedData.serials?.[0]?.department}</p>
|
||||
<p><strong>职位:</strong> {generatedData.serials?.[0]?.position}</p>
|
||||
<p><strong>员工姓名:</strong> {generatedData.serials?.[0]?.employeeName}</p>
|
||||
<p><strong>生成数量:</strong> {generatedData.serials?.length || 0}</p>
|
||||
</div>
|
||||
@@ -521,7 +526,7 @@ function EmployeeSerialsPage() {
|
||||
{selectedSerial?.serialNumber}
|
||||
</p>
|
||||
<p style={{ marginTop: '8px', fontSize: '12px', color: '#999' }}>
|
||||
{selectedSerial?.companyName} - {selectedSerial?.department} - {selectedSerial?.employeeName}
|
||||
{selectedSerial?.companyName} - {selectedSerial?.position} - {selectedSerial?.employeeName}
|
||||
</p>
|
||||
</>
|
||||
)}
|
||||
|
||||
@@ -149,7 +149,7 @@ function PublicQueryPage() {
|
||||
{serialType === 'employee' && (result as EmployeeSerialResult).department && (
|
||||
<>
|
||||
<div className="detail-item">
|
||||
<span className="label">部门</span>
|
||||
<span className="label">职位</span>
|
||||
<span className="value">{(result as EmployeeSerialResult).department}</span>
|
||||
</div>
|
||||
<div className="detail-item">
|
||||
|
||||
@@ -221,7 +221,7 @@ export const dashboardApi = {
|
||||
export const employeeSerialApi = {
|
||||
generate: async (data: {
|
||||
companyName: string;
|
||||
department: string;
|
||||
position: string;
|
||||
employeeName: string;
|
||||
quantity: number;
|
||||
serialPrefix?: string;
|
||||
@@ -290,7 +290,7 @@ export const employeeSerialApi = {
|
||||
|
||||
update: async (serialNumber: string, data: {
|
||||
companyName?: string;
|
||||
department?: string;
|
||||
position?: string;
|
||||
employeeName?: string;
|
||||
isActive?: boolean;
|
||||
}) => {
|
||||
|
||||
@@ -94,7 +94,7 @@ export interface CompanyFilter {
|
||||
export interface EmployeeSerial {
|
||||
serialNumber: string;
|
||||
companyName: string;
|
||||
department: string;
|
||||
position: string;
|
||||
employeeName: string;
|
||||
isActive: boolean;
|
||||
createdAt: string;
|
||||
|
||||
Reference in New Issue
Block a user