Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
monorepo
/
venus
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
1
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit cb4805c3
authored
May 11, 2026
by
岑成威
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat(venus-usedcar-quality): 检测评分跳转调整
1 parent
37b58bf2
Pipeline
#207
for
cb4805c3
failed
in 0 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
22 deletions
apps/web/venus-usedcar-quality/src/api/modules/inspect-report/record.ts
apps/web/venus-usedcar-quality/src/views/car-detail/composables/useInspectModules.ts
apps/web/venus-usedcar-quality/src/views/car-detail/composables/useInspectSubmit.ts
apps/web/venus-usedcar-quality/src/api/modules/inspect-report/record.ts
View file @
cb4805c
...
@@ -51,12 +51,56 @@ export interface CompleteInspectionParams {
...
@@ -51,12 +51,56 @@ export interface CompleteInspectionParams {
taskId
:
number
|
string
;
taskId
:
number
|
string
;
}
}
/** `completeInspection` 成功时 `data`:有未完成项时带
首项节点信息(多为大项 rootNodeId)
*/
/** `completeInspection` 成功时 `data`:有未完成项时带
分级节点信息
*/
export
interface
CompleteInspectionResultData
{
export
interface
CompleteInspectionResultData
{
firstUncompletedLv1NodeId
?:
null
|
number
|
string
;
firstUncompletedLv1NodeName
?:
null
|
string
;
firstUncompletedLv2NodeId
?:
null
|
number
|
string
;
firstUncompletedLv2NodeName
?:
null
|
string
;
firstUncompletedLv3NodeId
?:
null
|
number
|
string
;
firstUncompletedLv3NodeName
?:
null
|
string
;
/** 旧版接口字段,兼容 */
firstUncompletedNodeId
?:
null
|
number
|
string
;
firstUncompletedNodeId
?:
null
|
number
|
string
;
firstUncompletedNodeName
?:
null
|
string
;
firstUncompletedNodeName
?:
null
|
string
;
}
}
function
isNonemptyCompleteInspectionNodeId
(
id
:
unknown
):
id
is
number
|
string
{
if
(
id
===
undefined
||
id
===
null
)
return
false
;
if
(
typeof
id
===
"string"
&&
id
.
trim
()
===
""
)
return
false
;
return
true
;
}
/** 提交评分返回里是否仍有未完成项(存在可用于跳转的节点 id) */
export
function
hasCompleteInspectionUncompletedHint
(
data
:
CompleteInspectionResultData
|
undefined
):
boolean
{
return
getCompleteInspectionUncompletedNavigateTarget
(
data
)
!==
null
;
}
/**
* 未完成项:优先按二级节点跳转;无二级 id 时回退一级或旧字段。
* 提示文案优先三级名称(最细),其次二级、一级。
*/
export
function
getCompleteInspectionUncompletedNavigateTarget
(
data
:
CompleteInspectionResultData
|
undefined
):
{
nodeId
:
number
|
string
;
toastName
:
string
|
undefined
}
|
null
{
if
(
!
data
)
return
null
;
let
nodeId
:
number
|
string
|
null
=
null
;
if
(
isNonemptyCompleteInspectionNodeId
(
data
.
firstUncompletedLv2NodeId
))
{
nodeId
=
data
.
firstUncompletedLv2NodeId
;
}
else
if
(
isNonemptyCompleteInspectionNodeId
(
data
.
firstUncompletedLv1NodeId
))
{
nodeId
=
data
.
firstUncompletedLv1NodeId
;
}
else
if
(
isNonemptyCompleteInspectionNodeId
(
data
.
firstUncompletedNodeId
))
{
nodeId
=
data
.
firstUncompletedNodeId
;
}
if
(
nodeId
===
null
)
return
null
;
const
toastName
=
(
data
.
firstUncompletedLv3NodeName
&&
String
(
data
.
firstUncompletedLv3NodeName
))
||
(
data
.
firstUncompletedLv2NodeName
&&
String
(
data
.
firstUncompletedLv2NodeName
))
||
(
data
.
firstUncompletedLv1NodeName
&&
String
(
data
.
firstUncompletedLv1NodeName
))
||
(
data
.
firstUncompletedNodeName
&&
String
(
data
.
firstUncompletedNodeName
))
||
undefined
;
return
{
nodeId
,
toastName
};
}
/**
/**
* 完成检测(提交检测评分)
* 完成检测(提交检测评分)
*/
*/
...
...
apps/web/venus-usedcar-quality/src/views/car-detail/composables/useInspectModules.ts
View file @
cb4805c
import
type
{
BigModule
,
SubTab
}
from
"@/types/views/car-detail"
;
import
type
{
BigModule
,
SubTab
}
from
"@/types/views/car-detail"
;
import
type
{
import
type
{
InspectionNode
,
InspectionResultVO
,
InspectionTemplateDefaultData
}
from
"@api"
;
CompleteInspectionResultData
,
InspectionNode
,
InspectionResultVO
,
InspectionTemplateDefaultData
,
}
from
"@api"
;
import
type
{
RouteLocationNormalizedLoaded
}
from
"vue-router"
;
import
type
{
RouteLocationNormalizedLoaded
}
from
"vue-router"
;
...
@@ -64,15 +59,6 @@ function secondaryProgressOrFallback(module: BigModule): { done: number; total:
...
@@ -64,15 +59,6 @@ function secondaryProgressOrFallback(module: BigModule): { done: number; total:
};
};
}
}
/** 提交评分返回里是否仍有未完成项(`firstUncompletedNodeId` 有有效值) */
export
function
hasCompleteInspectionUncompletedHint
(
data
:
CompleteInspectionResultData
|
undefined
):
boolean
{
if
(
!
data
)
return
false
;
const
id
=
data
.
firstUncompletedNodeId
;
if
(
id
===
undefined
||
id
===
null
)
return
false
;
if
(
typeof
id
===
"string"
&&
id
.
trim
()
===
""
)
return
false
;
return
true
;
}
export
function
useInspectModules
(
route
:
RouteLocationNormalizedLoaded
)
{
export
function
useInspectModules
(
route
:
RouteLocationNormalizedLoaded
)
{
const
taskId
=
ref
<
number
|
string
>
(
""
);
const
taskId
=
ref
<
number
|
string
>
(
""
);
const
bigModules
=
ref
<
BigModule
[]
>
([]);
const
bigModules
=
ref
<
BigModule
[]
>
([]);
...
...
apps/web/venus-usedcar-quality/src/views/car-detail/composables/useInspectSubmit.ts
View file @
cb4805c
...
@@ -11,16 +11,15 @@ import { useRouter } from "vue-router";
...
@@ -11,16 +11,15 @@ import { useRouter } from "vue-router";
import
customizeForm
from
"@/components/CustomizeForm/Index.vue"
;
import
customizeForm
from
"@/components/CustomizeForm/Index.vue"
;
import
{
import
{
completeInspection
,
completeInspection
,
getCompleteInspectionUncompletedNavigateTarget
,
hasCompleteInspectionUncompletedHint
,
saveInspectionRecord
,
saveInspectionRecord
,
}
from
"@api"
;
}
from
"@api"
;
import
{
isRequestFailureAlreadyHandled
}
from
"@utils/request"
;
import
{
isRequestFailureAlreadyHandled
}
from
"@utils/request"
;
import
{
showToast
}
from
"vant"
;
import
{
showToast
}
from
"vant"
;
import
ScoreForm
from
"../components/ScoreForm.vue"
;
import
ScoreForm
from
"../components/ScoreForm.vue"
;
import
{
import
{
SCORE_BIG_KEY
}
from
"./useInspectModules"
;
hasCompleteInspectionUncompletedHint
,
SCORE_BIG_KEY
,
}
from
"./useInspectModules"
;
/** 底部操作区:仅当前点击的按钮显示 loading */
/** 底部操作区:仅当前点击的按钮显示 loading */
type
FooterLoadingKey
=
"idle"
|
"prev"
|
"next"
|
"score"
;
type
FooterLoadingKey
=
"idle"
|
"prev"
|
"next"
|
"score"
;
...
@@ -213,8 +212,9 @@ export function useInspectSubmit(
...
@@ -213,8 +212,9 @@ export function useInspectSubmit(
inspectionScoreFormRef
.
value
.
getCompleteInspectionPayload
(
modules
.
taskId
.
value
)
inspectionScoreFormRef
.
value
.
getCompleteInspectionPayload
(
modules
.
taskId
.
value
)
);
);
if
(
result
&&
hasCompleteInspectionUncompletedHint
(
result
))
{
if
(
result
&&
hasCompleteInspectionUncompletedHint
(
result
))
{
const
name
=
result
.
firstUncompletedNodeName
;
const
target
=
getCompleteInspectionUncompletedNavigateTarget
(
result
);
const
nid
=
result
.
firstUncompletedNodeId
;
const
name
=
target
?.
toastName
;
const
nid
=
target
?.
nodeId
;
showToast
(
showToast
(
name
?
`检测未完成,请先完成「
${
name
}
」`
:
"检测未完成,请先完成未填项"
name
?
`检测未完成,请先完成「
${
name
}
」`
:
"检测未完成,请先完成未填项"
);
);
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment