Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
NLT-e-cigarette
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
张伯涛
NLT-e-cigarette
Commits
0280b26d
Commit
0280b26d
authored
Jun 15, 2022
by
zhangyichen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
物料档案提交
parent
d5cd9062
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
5 deletions
+51
-5
request.js
src/utils/request.js
+1
-1
MaterialFile.vue
src/views/productionInfo/MaterialFile.vue
+50
-4
No files found.
src/utils/request.js
View file @
0280b26d
...
@@ -114,7 +114,7 @@ service.interceptors.response.use(res => {
...
@@ -114,7 +114,7 @@ service.interceptors.response.use(res => {
type
:
'error'
,
type
:
'error'
,
duration
:
5
*
1000
duration
:
5
*
1000
})
})
return
Promise
.
reject
(
'error'
)
return
Promise
.
reject
(
res
.
data
)
}
else
if
(
code
!==
'E004'
)
{
}
else
if
(
code
!==
'E004'
)
{
if
(
res
.
config
.
url
.
indexOf
(
'downLoadSignaturesSample'
)
>
-
1
||
res
.
config
.
url
.
indexOf
(
'downLoadSignatures'
)
>
-
1
)
{
if
(
res
.
config
.
url
.
indexOf
(
'downLoadSignaturesSample'
)
>
-
1
||
res
.
config
.
url
.
indexOf
(
'downLoadSignatures'
)
>
-
1
)
{
return
res
return
res
...
...
src/views/productionInfo/MaterialFile.vue
View file @
0280b26d
...
@@ -201,7 +201,7 @@
...
@@ -201,7 +201,7 @@
</el-row>
</el-row>
<el-row
class=
"rowMini"
v-for=
"(item1, index1) in item.nltMaterialEditRules"
:key=
"index1"
>
<el-row
class=
"rowMini"
v-for=
"(item1, index1) in item.nltMaterialEditRules"
:key=
"index1"
>
<el-col
:span=
"13"
>
<el-col
:span=
"13"
>
<el-form-item
label=
"规则设置"
:prop=
"'nltMaterialEditList.' + index + '.nltMaterialEditRules.' + index1 + '.ruleByte'"
:rules=
"[{ required: true, validator:
ruleByteRule
, trigger: 'blur' }]"
>
<el-form-item
label=
"规则设置"
:prop=
"'nltMaterialEditList.' + index + '.nltMaterialEditRules.' + index1 + '.ruleByte'"
:rules=
"[{ required: true, validator:
(rule, value, callback) => {ruleByteRule(rule, value, callback, item, index1)}
, trigger: 'blur' }]"
>
<el-input
:maxlength=
"2"
v-model
.
trim=
"item1.ruleByte"
/>
<el-input
:maxlength=
"2"
v-model
.
trim=
"item1.ruleByte"
/>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
...
@@ -422,7 +422,6 @@ export default {
...
@@ -422,7 +422,6 @@ export default {
item
.
nltMaterialEditRules
=
[{
ruleByte
:
''
,
rules
:
''
}]
item
.
nltMaterialEditRules
=
[{
ruleByte
:
''
,
rules
:
''
}]
}
}
})
})
console
.
log
(
this
.
form
)
})
})
},
},
// 状态修改方法
// 状态修改方法
...
@@ -522,6 +521,46 @@ export default {
...
@@ -522,6 +521,46 @@ export default {
this
.
open
=
false
this
.
open
=
false
this
.
getMatTable
()
this
.
getMatTable
()
}
}
}).
catch
(
err
=>
{
if
(
err
.
code
===
10001
)
{
const
EditList
=
[]
let
ruleList
=
[]
this
.
form
.
nltMaterialEditList
.
forEach
((
item
,
index
)
=>
{
item
.
ruleFlag
=
false
ruleList
=
[]
item
.
nltMaterialEditRules
.
forEach
((
item1
,
index1
)
=>
{
ruleList
.
push
({
ruleByte
:
item1
.
ruleByte
,
rules
:
item1
.
rules
})
})
ruleList
.
sort
(
this
.
compare
(
'ruleByte'
))
EditList
.
push
(
ruleList
)
})
const
resEditList
=
[]
let
resRuleList
=
[]
err
.
data
.
forEach
((
item
,
index
)
=>
{
item
.
ruleFlag
=
false
resRuleList
=
[]
item
.
nltMaterialEditRules
.
forEach
((
item1
,
index1
)
=>
{
resRuleList
.
push
({
ruleByte
:
item1
.
ruleByte
,
rules
:
item1
.
rules
})
})
resRuleList
.
sort
(
this
.
compare
(
'ruleByte'
))
resEditList
.
push
(
resRuleList
)
})
this
.
$forceUpdate
()
for
(
let
x
=
0
;
x
<
EditList
.
length
;
x
++
)
{
for
(
let
y
=
0
;
y
<
resEditList
.
length
;
y
++
)
{
if
(
JSON
.
stringify
(
EditList
[
x
])
===
JSON
.
stringify
(
resEditList
[
y
]))
{
this
.
form
.
nltMaterialEditList
[
x
].
ruleFlag
=
true
this
.
$forceUpdate
()
}
}
}
}
})
})
}
else
{
}
else
{
this
.
$message
.
error
(
'该规则已使用'
)
this
.
$message
.
error
(
'该规则已使用'
)
...
@@ -576,13 +615,20 @@ export default {
...
@@ -576,13 +615,20 @@ export default {
}
}
}
}
},
},
ruleByteRule
(
rule
,
value
,
callback
)
{
ruleByteRule
(
rule
,
value
,
callback
,
data
,
index
)
{
if
(
!
value
)
{
if
(
!
value
)
{
callback
(
new
Error
(
'请输入正整数'
))
callback
(
new
Error
(
'请输入正整数'
))
}
else
{
}
else
{
const
reg
=
/^
([
1-9
]\d
*|
[
0
]{1,1})
$/
const
reg
=
/^
([
1-9
]\d
*|
[
0
]{1,1})
$/
if
(
reg
.
test
(
value
))
{
if
(
reg
.
test
(
value
))
{
callback
();
for
(
let
i
=
0
;
data
.
nltMaterialEditRules
.
length
>
i
;
i
++
)
{
if
(
i
!==
index
)
{
if
(
data
.
nltMaterialEditRules
[
i
].
ruleByte
===
value
)
{
callback
(
new
Error
(
'规则位数不能相同'
))
}
}
}
callback
()
}
else
{
}
else
{
return
callback
(
new
Error
(
'请输入正整数'
))
return
callback
(
new
Error
(
'请输入正整数'
))
}
}
...
...
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