Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
weiqiao-vue
Overview
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
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
金民
weiqiao-vue
Commits
945455de
Commit
945455de
authored
Mar 16, 2026
by
齐伟伦
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
质检方案上增加个产品分类字段,来料质检单上的产品和该方案上的产品对比进行自动匹配。
parent
bb29051d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
103 additions
and
2 deletions
+103
-2
xjrsoft-vue3/src/views/zlgl/cprkzjd/components/Form.vue
+0
-2
xjrsoft-vue3/src/views/zlgl/llzjd/components/Form.vue
+47
-0
xjrsoft-vue3/src/views/zlgl/zhijianfangan/components/config.ts
+56
-0
No files found.
xjrsoft-vue3/src/views/zlgl/cprkzjd/components/Form.vue
View file @
945455de
...
@@ -287,4 +287,3 @@
...
@@ -287,4 +287,3 @@
});
});
</
script
>
</
script
>
\ No newline at end of file
xjrsoft-vue3/src/views/zlgl/llzjd/components/Form.vue
View file @
945455de
...
@@ -77,6 +77,53 @@
...
@@ -77,6 +77,53 @@
},
},
);
);
watch
(
()
=>
formModel
.
value
.
cp
,
async
(
newCpflId
,
oldCpflId
)
=>
{
if
(
newCpflId
&&
newCpflId
!==
oldCpflId
)
{
await
handleCpflChange
(
newCpflId
);
}
},
);
// 产品名称变化:根据产品分类ID查询对应的质检方案
async
function
handleCpflChange
(
cpflId
:
string
)
{
try
{
const
response
=
await
axios
.
get
(
import
.
meta
.
env
.
VITE_GLOB_API_URL
+
'/magic-api/zlgl/zjjcsj/getZjfaByCpfl'
,
{
params
:
{
id
:
cpflId
},
},
);
const
zjfaData
=
(
response
as
any
)?.
data
?.
data
;
console
.
log
(
zjfaData
);
// return;
if
(
zjfaData
)
{
// 回填质检方案字段
formModel
.
value
.
zjfa
=
zjfaData
[
0
].
mc
;
// 手动触发一次质检方案变化的处理,带出质检明细
// 由于watch是异步的,直接赋值会触发上面的zjfa监听
// 但为了确保立即执行,可以手动调用
await
handleZjfaChange
(
zjfaData
[
0
].
id
);
notification
.
success
({
message
:
'已自动匹配质检方案'
});
}
else
{
// 如果没有找到对应的质检方案,清空质检方案和相关明细
formModel
.
value
.
zjfa
=
''
;
formModel
.
value
.
mesQualityInspectionDetailList
=
[];
notification
.
info
({
message
:
'该产品分类未配置质检方案'
});
}
}
catch
(
error
)
{
formModel
.
value
.
zjfa
=
''
;
formModel
.
value
.
mesQualityInspectionDetailList
=
[];
console
.
error
(
'获取产品对应的质检方案失败:'
,
error
);
notification
.
error
({
message
:
'获取质检方案失败'
});
}
}
// 质检方案变化:根据方案id从接口获取明细,并整体替换当前明细列表
// 质检方案变化:根据方案id从接口获取明细,并整体替换当前明细列表
let
zjfaReqSeq
=
0
;
let
zjfaReqSeq
=
0
;
async
function
handleZjfaChange
(
zjfaId
:
string
)
{
async
function
handleZjfaChange
(
zjfaId
:
string
)
{
...
...
xjrsoft-vue3/src/views/zlgl/zhijianfangan/components/config.ts
View file @
945455de
...
@@ -415,6 +415,62 @@ export const formProps: FormProps = {
...
@@ -415,6 +415,62 @@ export const formProps: FormProps = {
style
:
{
width
:
'100%'
},
style
:
{
width
:
'100%'
},
},
},
},
},
{
key
:
'2c05765e50b44fa8be4aec443066f781'
,
field
:
'cpfl'
,
label
:
'产品分类'
,
type
:
'cascader'
,
component
:
'ApiCascader'
,
colProps
:
{
span
:
24
},
componentProps
:
{
width
:
'100%'
,
span
:
7
,
placeholder
:
'请选择产品类别'
,
showFormat
:
'all'
,
separator
:
'/'
,
selectedConfig
:
'any'
,
disabled
:
false
,
allowClear
:
false
,
showLabel
:
true
,
apiConfig
:
{
path
:
'/jcxx/cplx/getAllCPLXTree_zujian'
,
method
:
'GET'
,
apiId
:
'copy1770283483454d34933'
,
apiParams
:
[
{
key
:
'1'
,
title
:
'Query Params'
,
tableInfo
:
[
{
name
:
'code'
,
value
:
null
,
description
:
null
,
required
:
false
,
dataType
:
'String'
,
type
:
null
,
defaultValue
:
null
,
validateType
:
null
,
error
:
null
,
expression
:
null
,
children
:
null
,
bindType
:
''
,
},
],
},
{
key
:
'2'
,
title
:
'Header'
,
tableInfo
:
[]
},
{
key
:
'3'
,
title
:
'Body'
},
],
script
:
'var sql = ""
\
r
\
n + "select id,"
\
r
\
n + " pid as
\'
parentId
\'
, "
\
r
\
n + " id as
\'
value
\'
, "
\
r
\
n + " cm as
\'
label
\'
"
\
r
\
n + "from mes_base_cplx "
\
r
\
n + "where delete_mark = 0 "
\
r
\
n + "order by pid, id";
\
r
\
nvar list = db.select(sql);
\
r
\
n
\
r
\
nif (list == null || list.size() == 0) {
\
r
\
n return [];
\
r
\
n}
\
r
\
nvar map = new HashMap();
\
r
\
nvar idx = 0;
\
r
\
nwhile (idx < list.size()) {
\
r
\
n var itemNode = list.get(idx);
\
r
\
n itemNode.children = [];
\
r
\
n map.put(itemNode.id, itemNode);
\
r
\
n idx = idx + 1;
\
r
\
n}
\
r
\
nvar dataList = [];
\
r
\
nidx = 0;
\
r
\
nwhile (idx < list.size()) {
\
r
\
n var itemNode = list.get(idx);
\
r
\
n if (itemNode.parentId == null || itemNode.parentId ==
\'
0
\'
|| itemNode.parentId ==
\'\'
) {
\
r
\
n dataList.add(itemNode);
\
r
\
n } else {
\
r
\
n var pid = null;
\
r
\
n if (itemNode.parentId.contains(",")){
\
r
\
n var arr = itemNode.parentId.split(",");
\
r
\
n pid=arr[arr.length-1]
\
r
\
n }else{
\
r
\
n pid=itemNode.parentId;
\
r
\
n }
\
r
\
n var parentNode = map.get(pid);
\
r
\
n if (parentNode != null) {
\
r
\
n parentNode.children.add(itemNode);
\
r
\
n } else {
\
r
\
n dataList.add(itemNode);
\
r
\
n }
\
r
\
n }
\
r
\
n idx = idx + 1;
\
r
\
n}
\
r
\
nreturn dataList
\
r
\
n'
,
},
required
:
false
,
rules
:
[],
events
:
{},
isShow
:
true
,
tooltipConfig
:
{
visible
:
false
,
title
:
'提示文本'
},
style
:
{
width
:
'100%'
},
},
},
],
],
},
},
{
{
...
...
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