Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
Vue-Dashboard
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
高源
Vue-Dashboard
Commits
a92c4ba3
Commit
a92c4ba3
authored
Jun 18, 2025
by
Neo Turing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update Lac module components
parent
dcb685b2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
40 additions
and
41 deletions
+40
-41
TestPlanDetailSelector.vue
src/views/Lac/codes/TestPlanDetailSelector.vue
+1
-1
applicationInformation.vue
src/views/Lac/codes/applicationInformation.vue
+24
-25
comparisonTest.vue
src/views/Lac/codes/comparisonTest.vue
+3
-3
fieldReviewExecution.vue
src/views/Lac/codes/fieldReviewExecution.vue
+1
-1
fieldReviewPlanning.vue
src/views/Lac/codes/fieldReviewPlanning.vue
+2
-2
fileReview.vue
src/views/Lac/codes/fileReview.vue
+0
-0
mainSupplier.vue
src/views/Lac/codes/mainSupplier.vue
+0
-0
index.vue
src/views/Lac/index.vue
+9
-9
No files found.
src/views/Lac/codes/TestPlanDetailSelector.vue
View file @
a92c4ba3
...
@@ -108,7 +108,7 @@ async function fetchTestDetails() {
...
@@ -108,7 +108,7 @@ async function fetchTestDetails() {
}
}
}
catch
(
error
)
{
}
catch
(
error
)
{
message
.
error
(
'获取测试详情失败'
);
message
.
error
(
'获取测试详情失败'
);
console
.
error
(
error
);
//
console.error(error);
}
finally
{
}
finally
{
loading
.
value
=
false
;
loading
.
value
=
false
;
}
}
...
...
src/views/Lac/codes/applicationInformation.vue
View file @
a92c4ba3
...
@@ -76,11 +76,11 @@ const createDateComputed = (getter: () => string | null, setter: (val: string |
...
@@ -76,11 +76,11 @@ const createDateComputed = (getter: () => string | null, setter: (val: string |
const
formattedDate
=
dateVal
.
toISOString
();
const
formattedDate
=
dateVal
.
toISOString
();
setter
(
formattedDate
);
setter
(
formattedDate
);
}
else
{
}
else
{
console
.
warn
(
'无效的日期值:'
,
val
);
//
console.warn('无效的日期值:', val);
setter
(
null
);
setter
(
null
);
}
}
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
error
(
'日期处理错误:'
,
err
);
//
console.error('日期处理错误:', err);
setter
(
null
);
setter
(
null
);
}
}
}
}
...
@@ -127,15 +127,15 @@ const hasDataChanged = (): { changed: boolean; changedFields: Partial<ItemProps>
...
@@ -127,15 +127,15 @@ const hasDataChanged = (): { changed: boolean; changedFields: Partial<ItemProps>
const
fetchDetail
=
async
(
kvid
:
string
)
=>
{
const
fetchDetail
=
async
(
kvid
:
string
)
=>
{
if
(
!
kvid
)
return
;
if
(
!
kvid
)
return
;
console
.
log
(
`准备获取详情数据,Kvid:
${
kvid
}
,当前loadedKvid:
${
detailedData
.
Kvid
}
`
);
//
console.log(`准备获取详情数据,Kvid: ${kvid},当前loadedKvid: ${detailedData.Kvid}`);
if
(
kvid
===
detailedData
.
Kvid
&&
Object
.
keys
(
detailedData
).
length
>
0
)
{
if
(
kvid
===
detailedData
.
Kvid
&&
Object
.
keys
(
detailedData
).
length
>
0
)
{
console
.
log
(
'跳过重复请求,使用已缓存的数据'
);
//
console.log('跳过重复请求,使用已缓存的数据');
return
;
return
;
}
}
loading
.
value
=
true
;
loading
.
value
=
true
;
try
{
try
{
console
.
log
(
'开始获取详情数据,Kvid:'
,
kvid
);
//
console.log('开始获取详情数据,Kvid:', kvid);
// 调用接口获取详情数据
// 调用接口获取详情数据
const
response
=
await
axios
.
get
(
`/Restful/Kivii.Lims.Entities.Report/Read.json?Kvid=
${
kvid
}
`
);
const
response
=
await
axios
.
get
(
`/Restful/Kivii.Lims.Entities.Report/Read.json?Kvid=
${
kvid
}
`
);
...
@@ -144,14 +144,14 @@ const fetchDetail = async (kvid: string) => {
...
@@ -144,14 +144,14 @@ const fetchDetail = async (kvid: string) => {
Object
.
assign
(
detailedData
,
response
.
data
.
Result
||
{});
Object
.
assign
(
detailedData
,
response
.
data
.
Result
||
{});
// 同时更新原始数据副本
// 同时更新原始数据副本
originalData
.
value
=
JSON
.
parse
(
JSON
.
stringify
(
response
.
data
.
Result
||
{}));
originalData
.
value
=
JSON
.
parse
(
JSON
.
stringify
(
response
.
data
.
Result
||
{}));
console
.
log
(
'获取到详情数据:'
,
response
.
data
.
Result
);
//
console.log('获取到详情数据:', response.data.Result);
message
.
success
(
'详情数据加载成功'
);
message
.
success
(
'详情数据加载成功'
);
}
else
{
}
else
{
message
.
error
(
'获取详情数据失败'
);
message
.
error
(
'获取详情数据失败'
);
}
}
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
'获取详情数据失败:'
,
error
);
//
console.error('获取详情数据失败:', error);
message
.
error
(
'获取详情数据失败,请稍后重试'
);
message
.
error
(
'获取详情数据失败,请稍后重试'
);
}
finally
{
}
finally
{
loading
.
value
=
false
;
loading
.
value
=
false
;
...
@@ -181,15 +181,14 @@ watch(
...
@@ -181,15 +181,14 @@ watch(
// 组件加载时初始化
// 组件加载时初始化
onMounted
(()
=>
{
onMounted
(()
=>
{
console
.
log
(
'applicationInformation组件已挂载'
);
// console.log('applicationInformation组件已挂载');
// 确保detailedData对象已正确初始化
// 确保detailedData对象已正确初始化
if
(
Object
.
keys
(
detailedData
).
length
===
0
)
{
if
(
Object
.
keys
(
detailedData
).
length
===
0
)
{
Object
.
assign
(
detailedData
,
{});
Object
.
assign
(
detailedData
,
{});
}
}
// 如果已有选择的实验室名称,确保它被设置
// 如果已有选择的实验室名称,确保它被设置
if
(
detailedData
.
SampleName
)
{
if
(
detailedData
.
SampleName
)
{
console
.
log
(
'已有实验室名称:'
,
detailedData
.
SampleName
);
//
console.log('已有实验室名称:', detailedData.SampleName);
}
}
});
});
...
@@ -197,7 +196,7 @@ onMounted(() => {
...
@@ -197,7 +196,7 @@ onMounted(() => {
const
createEntity
=
async
()
=>
{
const
createEntity
=
async
()
=>
{
// 验证:Kvid不存在时才创建
// 验证:Kvid不存在时才创建
if
(
detailedData
.
Kvid
)
{
if
(
detailedData
.
Kvid
)
{
console
.
log
(
'实体已存在,无需创建'
);
//
console.log('实体已存在,无需创建');
return
{
success
:
true
,
data
:
detailedData
};
return
{
success
:
true
,
data
:
detailedData
};
}
}
...
@@ -248,7 +247,7 @@ const createEntity = async () => {
...
@@ -248,7 +247,7 @@ const createEntity = async () => {
const
requestData
=
{
Item
};
const
requestData
=
{
Item
};
console
.
log
(
'创建实体请求数据:'
,
requestData
);
//
console.log('创建实体请求数据:', requestData);
// 调用创建接口
// 调用创建接口
const
response
=
await
axios
.
post
(
'/Restful/Kivii.Lims.Entities.Report/Create.json'
,
requestData
);
const
response
=
await
axios
.
post
(
'/Restful/Kivii.Lims.Entities.Report/Create.json'
,
requestData
);
...
@@ -259,18 +258,18 @@ const createEntity = async () => {
...
@@ -259,18 +258,18 @@ const createEntity = async () => {
Object
.
assign
(
detailedData
,
response
.
data
.
Results
[
0
]);
Object
.
assign
(
detailedData
,
response
.
data
.
Results
[
0
]);
}
}
console
.
log
(
'实体创建成功:'
,
response
.
data
);
//
console.log('实体创建成功:', response.data);
message
.
success
(
'实体创建成功'
);
message
.
success
(
'实体创建成功'
);
return
{
success
:
true
,
data
:
response
.
data
};
return
{
success
:
true
,
data
:
response
.
data
};
}
}
// 处理错误情况
// 处理错误情况
console
.
error
(
'创建失败:'
,
response
.
data
);
//
console.error('创建失败:', response.data);
message
.
error
(
response
.
data
?.
Message
||
'创建失败,请重试'
);
message
.
error
(
response
.
data
?.
Message
||
'创建失败,请重试'
);
return
{
success
:
false
,
error
:
response
.
data
?.
Message
||
'创建失败'
};
return
{
success
:
false
,
error
:
response
.
data
?.
Message
||
'创建失败'
};
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
'创建实体失败:'
,
error
);
//
console.error('创建实体失败:', error);
message
.
error
(
'系统错误,请稍后重试'
);
message
.
error
(
'系统错误,请稍后重试'
);
return
{
success
:
false
,
error
:
'系统错误'
};
return
{
success
:
false
,
error
:
'系统错误'
};
}
finally
{
}
finally
{
...
@@ -282,7 +281,7 @@ const createEntity = async () => {
...
@@ -282,7 +281,7 @@ const createEntity = async () => {
const
updateEntity
=
async
(
changedFields
:
Partial
<
ItemProps
>
=
{})
=>
{
const
updateEntity
=
async
(
changedFields
:
Partial
<
ItemProps
>
=
{})
=>
{
// 验证:Kvid存在时才更新
// 验证:Kvid存在时才更新
if
(
!
detailedData
.
Kvid
)
{
if
(
!
detailedData
.
Kvid
)
{
console
.
log
(
'实体不存在,无法更新'
);
//
console.log('实体不存在,无法更新');
message
.
error
(
'实体不存在,请先创建'
);
message
.
error
(
'实体不存在,请先创建'
);
return
{
success
:
false
,
error
:
'实体不存在'
};
return
{
success
:
false
,
error
:
'实体不存在'
};
}
}
...
@@ -298,7 +297,7 @@ const updateEntity = async (changedFields: Partial<ItemProps> = {}) => {
...
@@ -298,7 +297,7 @@ const updateEntity = async (changedFields: Partial<ItemProps> = {}) => {
}
}
};
};
console
.
log
(
'更新实体请求数据:'
,
requestData
);
//
console.log('更新实体请求数据:', requestData);
// 调用更新接口
// 调用更新接口
const
response
=
await
axios
.
post
(
'/Restful/Kivii.Lims.Entities.Report/Update.json'
,
requestData
);
const
response
=
await
axios
.
post
(
'/Restful/Kivii.Lims.Entities.Report/Update.json'
,
requestData
);
...
@@ -310,18 +309,18 @@ const updateEntity = async (changedFields: Partial<ItemProps> = {}) => {
...
@@ -310,18 +309,18 @@ const updateEntity = async (changedFields: Partial<ItemProps> = {}) => {
Object
.
assign
(
detailedData
,
response
.
data
.
Results
[
0
]);
Object
.
assign
(
detailedData
,
response
.
data
.
Results
[
0
]);
}
}
console
.
log
(
'实体更新成功:'
,
response
.
data
);
//
console.log('实体更新成功:', response.data);
message
.
success
(
'实体更新成功'
);
message
.
success
(
'实体更新成功'
);
return
{
success
:
true
,
data
:
response
.
data
};
return
{
success
:
true
,
data
:
response
.
data
};
}
}
// 处理错误情况
// 处理错误情况
console
.
error
(
'更新失败:'
,
response
.
data
);
//
console.error('更新失败:', response.data);
message
.
error
(
response
.
data
?.
Message
||
'更新失败,请重试'
);
message
.
error
(
response
.
data
?.
Message
||
'更新失败,请重试'
);
return
{
success
:
false
,
error
:
response
.
data
?.
Message
||
'更新失败'
};
return
{
success
:
false
,
error
:
response
.
data
?.
Message
||
'更新失败'
};
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
'更新实体失败:'
,
error
);
//
console.error('更新实体失败:', error);
message
.
error
(
'系统错误,请稍后重试'
);
message
.
error
(
'系统错误,请稍后重试'
);
return
{
success
:
false
,
error
:
'系统错误'
};
return
{
success
:
false
,
error
:
'系统错误'
};
}
finally
{
}
finally
{
...
@@ -331,10 +330,10 @@ const updateEntity = async (changedFields: Partial<ItemProps> = {}) => {
...
@@ -331,10 +330,10 @@ const updateEntity = async (changedFields: Partial<ItemProps> = {}) => {
// 智能验证和保存方法(统一入口)
// 智能验证和保存方法(统一入口)
const
validateAndSave
=
async
()
=>
{
const
validateAndSave
=
async
()
=>
{
console
.
log
(
'开始验证和保存数据...'
);
//
console.log('开始验证和保存数据...');
// 1. 验证必填字段
// 1. 验证必填字段
console
.
log
(
'验证实验室名称:'
,
detailedData
.
SampleName
);
//
console.log('验证实验室名称:', detailedData.SampleName);
if
(
!
detailedData
.
SampleName
)
{
if
(
!
detailedData
.
SampleName
)
{
message
.
error
(
'请输入实验室名称'
);
message
.
error
(
'请输入实验室名称'
);
return
false
;
return
false
;
...
@@ -345,7 +344,7 @@ const validateAndSave = async () => {
...
@@ -345,7 +344,7 @@ const validateAndSave = async () => {
if
(
!
hasKvid
)
{
if
(
!
hasKvid
)
{
// 没有Kvid,需要创建
// 没有Kvid,需要创建
console
.
log
(
'检测到无Kvid,执行创建操作'
);
//
console.log('检测到无Kvid,执行创建操作');
const
result
=
await
createEntity
();
const
result
=
await
createEntity
();
if
(
result
.
success
)
{
if
(
result
.
success
)
{
// 创建成功后更新原始数据副本
// 创建成功后更新原始数据副本
...
@@ -358,12 +357,12 @@ const validateAndSave = async () => {
...
@@ -358,12 +357,12 @@ const validateAndSave = async () => {
if
(
!
changed
)
{
if
(
!
changed
)
{
// 没有变化,直接返回成功
// 没有变化,直接返回成功
console
.
log
(
'数据没有变化,无需更新'
);
//
console.log('数据没有变化,无需更新');
message
.
success
(
'数据已是最新,无需保存'
);
message
.
success
(
'数据已是最新,无需保存'
);
return
true
;
return
true
;
}
else
{
}
else
{
// 有变化,需要更新
// 有变化,需要更新
console
.
log
(
'检测到数据变化,执行更新操作,变更字段:'
,
changedFields
);
//
console.log('检测到数据变化,执行更新操作,变更字段:', changedFields);
const
result
=
await
updateEntity
(
changedFields
);
const
result
=
await
updateEntity
(
changedFields
);
if
(
result
.
success
)
{
if
(
result
.
success
)
{
// 更新成功后更新原始数据副本
// 更新成功后更新原始数据副本
...
...
src/views/Lac/codes/comparisonTest.vue
View file @
a92c4ba3
...
@@ -75,7 +75,7 @@ async function fetchTestPlanOptions() {
...
@@ -75,7 +75,7 @@ async function fetchTestPlanOptions() {
// 调用标准实体查询接口
// 调用标准实体查询接口
const
response
=
await
axios
.
post
(
'/Restful/Kivii.Standards.Entities.Standard/Query.json?Type=比对测试'
);
const
response
=
await
axios
.
post
(
'/Restful/Kivii.Standards.Entities.Standard/Query.json?Type=比对测试'
);
console
.
log
(
'测试方案响应数据:'
,
response
.
data
);
//
console.log('测试方案响应数据:', response.data);
// 添加数据存在性检查
// 添加数据存在性检查
if
(
response
.
data
&&
response
.
data
.
Results
)
{
if
(
response
.
data
&&
response
.
data
.
Results
)
{
...
@@ -85,12 +85,12 @@ async function fetchTestPlanOptions() {
...
@@ -85,12 +85,12 @@ async function fetchTestPlanOptions() {
value
:
item
.
Kvid
value
:
item
.
Kvid
}));
}));
}
else
{
}
else
{
console
.
error
(
'无效的数据格式:'
,
response
.
data
);
//
console.error('无效的数据格式:', response.data);
message
.
error
(
'数据格式不正确'
);
message
.
error
(
'数据格式不正确'
);
}
}
}
catch
(
error
)
{
}
catch
(
error
)
{
message
.
error
(
'获取测试方案失败'
);
message
.
error
(
'获取测试方案失败'
);
console
.
error
(
'获取测试方案失败:'
,
error
);
//
console.error('获取测试方案失败:', error);
}
finally
{
}
finally
{
loading
.
value
=
false
;
loading
.
value
=
false
;
}
}
...
...
src/views/Lac/codes/fieldReviewExecution.vue
View file @
a92c4ba3
...
@@ -271,7 +271,7 @@ async function fetchAuditItems() {
...
@@ -271,7 +271,7 @@ async function fetchAuditItems() {
message
.
success
(
'审核项目加载成功'
);
message
.
success
(
'审核项目加载成功'
);
}
catch
(
error
)
{
}
catch
(
error
)
{
message
.
error
(
'获取审核项目失败'
);
message
.
error
(
'获取审核项目失败'
);
console
.
error
(
'获取审核项目失败:'
,
error
);
//
console.error('获取审核项目失败:', error);
}
finally
{
}
finally
{
loading
.
value
=
false
;
loading
.
value
=
false
;
}
}
...
...
src/views/Lac/codes/fieldReviewPlanning.vue
View file @
a92c4ba3
...
@@ -232,7 +232,7 @@ async function fetchAuditSchemes() {
...
@@ -232,7 +232,7 @@ async function fetchAuditSchemes() {
message
.
success
(
'审核方案加载成功'
);
message
.
success
(
'审核方案加载成功'
);
}
catch
(
error
)
{
}
catch
(
error
)
{
message
.
error
(
'获取审核方案失败'
);
message
.
error
(
'获取审核方案失败'
);
console
.
error
(
'获取审核方案失败:'
,
error
);
//
console.error('获取审核方案失败:', error);
}
finally
{
}
finally
{
schemesLoading
.
value
=
false
;
schemesLoading
.
value
=
false
;
}
}
...
@@ -288,7 +288,7 @@ async function fetchAuditTeam() {
...
@@ -288,7 +288,7 @@ async function fetchAuditTeam() {
message
.
success
(
'审核团队加载成功'
);
message
.
success
(
'审核团队加载成功'
);
}
catch
(
error
)
{
}
catch
(
error
)
{
message
.
error
(
'获取审核团队失败'
);
message
.
error
(
'获取审核团队失败'
);
console
.
error
(
'获取审核团队失败:'
,
error
);
//
console.error('获取审核团队失败:', error);
}
finally
{
}
finally
{
teamLoading
.
value
=
false
;
teamLoading
.
value
=
false
;
}
}
...
...
src/views/Lac/codes/fileReview.vue
View file @
a92c4ba3
This diff is collapsed.
Click to expand it.
src/views/Lac/codes/mainSupplier.vue
View file @
a92c4ba3
This diff is collapsed.
Click to expand it.
src/views/Lac/index.vue
View file @
a92c4ba3
...
@@ -104,12 +104,12 @@ const getProgressByStatus = (status: string) => {
...
@@ -104,12 +104,12 @@ const getProgressByStatus = (status: string) => {
const
getActionsByStatus
=
(
status
:
string
)
=>
{
const
getActionsByStatus
=
(
status
:
string
)
=>
{
const
actionsMap
:
{
[
key
:
string
]:
string
[]
}
=
{
const
actionsMap
:
{
[
key
:
string
]:
string
[]
}
=
{
草稿
:
[
'查看详情'
,
'提交申请'
,
'删除'
],
草稿
:
[
'查看详情'
,
'提交申请'
,
'删除'
],
待审核
:
[
'查看详情'
,
'开始审核'
],
待审核
:
[
'查看详情'
],
文件审核
:
[
'查看详情'
,
'文件评审'
],
文件审核
:
[
'查看详情'
],
现场评审
:
[
'查看详情'
,
'现场评审'
],
现场评审
:
[
'查看详情'
],
比对测试
:
[
'查看详情'
,
'测试管理'
],
比对测试
:
[
'查看详情'
],
认证签发
:
[
'查看详情'
,
'签发证书'
],
认证签发
:
[
'查看详情'
],
认证完成
:
[
'查看详情'
,
'下载证书'
]
认证完成
:
[
'查看详情'
]
};
};
return
actionsMap
[
status
]
||
[
'查看详情'
];
return
actionsMap
[
status
]
||
[
'查看详情'
];
};
};
...
@@ -164,7 +164,7 @@ const fetchData = async () => {
...
@@ -164,7 +164,7 @@ const fetchData = async () => {
const
data
=
response
.
data
;
const
data
=
response
.
data
;
if
(
!
data
)
{
if
(
!
data
)
{
console
.
error
(
'获取数据失败: 无响应数据'
);
//
console.error('获取数据失败: 无响应数据');
message
.
error
(
'获取数据失败,请稍后重试'
);
message
.
error
(
'获取数据失败,请稍后重试'
);
return
;
return
;
}
}
...
@@ -192,7 +192,7 @@ const fetchData = async () => {
...
@@ -192,7 +192,7 @@ const fetchData = async () => {
message
.
error
(
'获取数据失败:响应格式错误'
);
message
.
error
(
'获取数据失败:响应格式错误'
);
}
}
}
catch
(
error
:
any
)
{
}
catch
(
error
:
any
)
{
console
.
error
(
'获取数据失败:'
,
error
);
//
console.error('获取数据失败:', error);
message
.
error
(
'获取数据失败,请稍后重试'
);
message
.
error
(
'获取数据失败,请稍后重试'
);
}
finally
{
}
finally
{
loading
.
value
=
false
;
loading
.
value
=
false
;
...
@@ -281,7 +281,7 @@ onMounted(() => {
...
@@ -281,7 +281,7 @@ onMounted(() => {
// 处理关闭并刷新数据
// 处理关闭并刷新数据
const
handleCloseAndRefresh
=
()
=>
{
const
handleCloseAndRefresh
=
()
=>
{
console
.
log
(
'关闭mainSupplier组件并刷新数据'
);
//
console.log('关闭mainSupplier组件并刷新数据');
showMainSupplier
.
value
=
false
;
showMainSupplier
.
value
=
false
;
currentItem
.
value
=
{};
// 清空当前Item
currentItem
.
value
=
{};
// 清空当前Item
fetchData
();
fetchData
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment