Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
template_vue
Project
Project
Details
Activity
Releases
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
胡宝山
template_vue
Commits
bad1e7cb
Commit
bad1e7cb
authored
Sep 21, 2023
by
shifangwuji
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
first
parent
a7a34648
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
73 additions
and
52 deletions
+73
-52
index.vue
src/views/production/gfual/index.vue
+73
-52
No files found.
src/views/production/gfual/index.vue
View file @
bad1e7cb
...
@@ -88,18 +88,18 @@
...
@@ -88,18 +88,18 @@
</el-col>
</el-col>
</el-row>
</el-row>
<!-- 提取
jb
type、jbrank 和 jbLot -->
<!-- 提取
p
type、jbrank 和 jbLot -->
<el-row
:gutter=
"0"
style=
"display: flex; width: 81%;"
>
<el-row
:gutter=
"0"
style=
"display: flex; width: 81%;"
>
<el-col
:span=
"8"
>
<el-col
:span=
"8"
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<el-form-item
label=
"jbtype:"
prop=
"
jb
type"
>
<el-form-item
label=
"jbtype:"
prop=
"
p
type"
>
<template
v-if=
"form.
jbtype && form.jb
type.length > 21"
>
<template
v-if=
"form.
ptype && form.p
type.length > 21"
>
<el-tooltip
:content=
"form.
jb
type"
effect=
"dark"
>
<el-tooltip
:content=
"form.
p
type"
effect=
"dark"
>
<el-input
v-model=
"form.
jbtype"
placeholder=
"jb
type"
:disabled=
"true"
style=
"width: 100%;"
/>
<el-input
v-model=
"form.
ptype"
placeholder=
"p
type"
:disabled=
"true"
style=
"width: 100%;"
/>
</el-tooltip>
</el-tooltip>
</
template
>
</
template
>
<
template
v-else
>
<
template
v-else
>
<el-input
v-model=
"form.
jbtype"
placeholder=
"jb
type"
:disabled=
"true"
style=
"width: 100%;"
/>
<el-input
v-model=
"form.
ptype"
placeholder=
"p
type"
:disabled=
"true"
style=
"width: 100%;"
/>
</
template
>
</
template
>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
...
@@ -281,7 +281,7 @@ export default {
...
@@ -281,7 +281,7 @@ export default {
gx
:
''
,
gx
:
''
,
machine
:
''
,
machine
:
''
,
jbcode
:
''
,
jbcode
:
''
,
jb
type
:
''
,
p
type
:
''
,
jbrank
:
''
,
jbrank
:
''
,
jbLot
:
''
,
jbLot
:
''
,
jlcod
:
''
,
jlcod
:
''
,
...
@@ -314,7 +314,7 @@ export default {
...
@@ -314,7 +314,7 @@ export default {
handler
(
newJbcode
)
{
handler
(
newJbcode
)
{
// 当 jbcode 字段发生变化时,解析它并更新相关字段的值
// 当 jbcode 字段发生变化时,解析它并更新相关字段的值
const
parts
=
newJbcode
.
split
(
','
)
const
parts
=
newJbcode
.
split
(
','
)
this
.
form
.
jb
type
=
parts
[
0
]
||
''
this
.
form
.
p
type
=
parts
[
0
]
||
''
this
.
form
.
jbrank
=
parts
[
1
]
||
''
this
.
form
.
jbrank
=
parts
[
1
]
||
''
this
.
form
.
jbLot
=
parts
[
2
]
||
''
this
.
form
.
jbLot
=
parts
[
2
]
||
''
},
},
...
@@ -326,31 +326,10 @@ export default {
...
@@ -326,31 +326,10 @@ export default {
const
parts
=
newJlcod
.
split
(
','
)
const
parts
=
newJlcod
.
split
(
','
)
this
.
form
.
jltype
=
parts
[
0
]
||
''
this
.
form
.
jltype
=
parts
[
0
]
||
''
this
.
form
.
jllot
=
parts
[
1
]
||
''
this
.
form
.
jllot
=
parts
[
1
]
||
''
this
.
form
.
jlbzq
=
parts
[
2
]
||
''
// 获取 jlbzqPart
const
jlbzqPart
=
parts
[
2
]
||
''
// 检查 jlbzqPart 是否有数据
if
(
jlbzqPart
.
trim
()
!==
''
)
{
// 验证并格式化 jlbzq
const
jlbzqRegex
=
/^
\d{4}
-
\d{2}
-
\d{2}
$/
// 正则表达式用于验证 'yyyy-mm-dd' 格式
if
(
jlbzqRegex
.
test
(
jlbzqPart
))
{
this
.
form
.
jlbzq
=
jlbzqPart
}
else
{
// 如果不符合规范,可以设置一个默认值或者给出错误提示
this
.
form
.
jlbzq
=
''
// 或者设置一个默认值
// 或者显示错误提示
MessageBox
.
alert
(
'jlcod 中的 jlbzq 不符合规范,请输入有效的日期格式(yyyy-mm-dd)'
,
'错误'
,
{
confirmButtonText
:
'确定'
,
type
:
'error'
})
}
}
},
},
immediate
:
true
// 立即执行一次以处理初始值
immediate
:
true
// 立即执行一次以处理初始值
}
}
},
},
mounted
()
{
mounted
()
{
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
...
@@ -426,7 +405,7 @@ export default {
...
@@ -426,7 +405,7 @@ export default {
})
})
}
}
}
else
if
(
response
.
code
===
400
)
{
}
else
{
console
.
log
(
'Setting lockUserEnabled to true'
);
console
.
log
(
'Setting lockUserEnabled to true'
);
// 查询失败时,将所有输入框锁定并显示错误提示
// 查询失败时,将所有输入框锁定并显示错误提示
this
.
jbcodeEnabled
=
false
;
this
.
jbcodeEnabled
=
false
;
...
@@ -544,40 +523,82 @@ export default {
...
@@ -544,40 +523,82 @@ export default {
}).
then
(()
=>
{
}).
then
(()
=>
{
this
.
$refs
.
form
.
validate
((
valid
)
=>
{
this
.
$refs
.
form
.
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
valid
)
{
addApplication
(
this
.
form
).
then
(
res
=>
{
// 验证通过,继续处理 jlbzq 字段
console
.
log
(
'res'
,
res
)
const
jlcodParts
=
this
.
form
.
jlcod
.
split
(
','
)
if
(
res
.
code
===
200
)
{
const
jlbzqPart
=
jlcodParts
[
2
]
||
''
if
(
res
.
data
!==
null
)
{
if
(
res
.
data
.
ptype
===
'1'
)
{
if
(
jlbzqPart
.
trim
()
!==
''
)
{
this
.
$message
({
const
jlbzqRegex
=
/^
\d{4}
-
\d{2}
-
\d{2}
$/
// 正则表达式用于验证 'yyyy-mm-dd' 格式
showClose
:
true
,
if
(
jlbzqRegex
.
test
(
jlbzqPart
))
{
message
:
'保存成功'
,
// jlbzq 格式正确,可以继续保存操作
type
:
'success'
,
addApplication
(
this
.
form
).
then
(
res
=>
{
duration
:
5000
console
.
log
(
'res'
,
res
)
})
if
(
res
.
code
===
200
)
{
}
else
if
(
res
.
data
.
ptype
===
'2'
)
{
if
(
res
.
data
!==
null
)
{
this
.
$message
({
showClose
:
true
,
message
:
'保存成功'
,
type
:
'success'
,
duration
:
5000
})
}
this
.
resetForm
()
}
else
if
(
res
.
code
===
null
)
{
this
.
$message
({
this
.
$message
({
showClose
:
true
,
showClose
:
true
,
message
:
'保存成功'
,
message
:
res
.
message
,
type
:
'
success
'
,
type
:
'
error
'
,
duration
:
5
000
duration
:
10
000
})
})
}
}
}
}
)
this
.
resetFrom
()
}
else
{
}
else
if
(
res
.
code
===
null
)
{
// jlbzq 格式不正确,显示错误提示
this
.
$message
({
this
.
$message
({
showClose
:
true
,
showClose
:
true
,
message
:
res
.
message
,
message
:
'jlcod 中的 jlbzq 不符合规范,请输入有效的日期格式(yyyy-mm-dd)'
,
type
:
'error'
,
type
:
'error'
,
duration
:
10
000
duration
:
5
000
})
})
}
}
})
}
else
{
// jlbzqPart 为空,可以继续保存操作
addApplication
(
this
.
form
).
then
(
res
=>
{
console
.
log
(
'res'
,
res
)
if
(
res
.
code
===
200
)
{
if
(
res
.
data
!==
null
)
{
if
(
res
.
data
.
ptype
===
'1'
)
{
this
.
$message
({
showClose
:
true
,
message
:
'保存成功'
,
type
:
'success'
,
duration
:
5000
})
}
else
if
(
res
.
data
.
ptype
===
'2'
)
{
this
.
$message
({
showClose
:
true
,
message
:
'保存成功'
,
type
:
'success'
,
duration
:
5000
})
}
}
this
.
resetForm
()
}
else
if
(
res
.
code
===
null
)
{
this
.
$message
({
showClose
:
true
,
message
:
res
.
message
,
type
:
'error'
,
duration
:
10000
})
}
})
}
}
}
})
})
})
})
},
},
// 调数据字典查询
// 调数据字典查询
getDict
()
{
getDict
()
{
const
obj
=
{
const
obj
=
{
...
...
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