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
1ab14400
Commit
1ab14400
authored
Jun 10, 2022
by
秦嘉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
物料档案实现
parent
07f04081
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
101 deletions
+35
-101
material.js
src/api/material.js
+0
-8
MaterialFile.vue
src/views/productionInfo/MaterialFile.vue
+35
-93
No files found.
src/api/material.js
View file @
1ab14400
...
...
@@ -67,14 +67,6 @@ export function listEdit(query) {
})
}
// 查询配置列表
export
function
listEditRules
(
query
)
{
return
request
({
url
:
'/nltmaterialeditrules/queryNltMaterialEditRuless'
,
method
:
'get'
,
params
:
query
})
}
// 新增配置
export
function
addEdit
(
data
)
{
...
...
src/views/productionInfo/MaterialFile.vue
View file @
1ab14400
...
...
@@ -191,7 +191,7 @@
</div>
<el-input
style=
"width: 90%"
:maxlength=
"100"
v-model
.
trim=
"item.totalDigits"
placeholder=
"请输入总位数"
/>
</el-form-item>
<el-row
class=
"rowMini"
v-for=
"(item1, index1) in item.
configuration
Rules"
>
<el-row
class=
"rowMini"
v-for=
"(item1, index1) in item.
nltMaterialEdit
Rules"
>
<el-form
ref=
"form2"
:rules=
"rules2"
:model=
"form2"
size=
"small"
label-width=
"120px"
>
<el-col
:span=
"9"
>
<el-form-item
class=
"labelHeight"
label=
"规则设置"
prop=
"ruleByte"
>
...
...
@@ -207,7 +207,7 @@
</el-form-item>
</el-col>
<el-col
:span=
"5"
>
<el-link
v-if=
"index1 === 0"
style=
"margin-top: 20px"
type=
"primary"
@
click=
"addSNRule(item, index
1
)"
>
增加一行
</el-link>
<el-link
v-if=
"index1 === 0"
style=
"margin-top: 20px"
type=
"primary"
@
click=
"addSNRule(item, index)"
>
增加一行
</el-link>
<el-link
v-if=
"index1 != 0"
style=
"margin-top: 20px"
type=
"primary"
@
click
.
prevent=
"delSNRule(item, index1)"
>
删除
</el-link>
</el-col>
</el-form>
...
...
@@ -237,7 +237,6 @@ import {
exportMater
,
getMaterial
,
listEdit
,
listEditRules
,
listMaterial
,
updateMaterial
}
from
'@/api/material'
...
...
@@ -273,13 +272,7 @@ export default {
// sn规则数据
snRulesList
:
[
{
totalDigits
:
''
,
configurationRules
:
[
{
ruleByte
:
''
,
rules
:
''
}
]
nltMaterialEditRules
:
[]
}
],
// 物料表数据
...
...
@@ -291,9 +284,16 @@ export default {
// 表单数据
form
:
{},
// 表单2数据
form1
:
{},
form1
:
{
totalDigits
:
''
,
nltMaterialEditRules
:
[
{
ruleByte
:
''
,
rules
:
''
}
]
},
// 表单3数据
form2
:
{},
form2
:
{
ruleByte
:
''
,
rules
:
''
},
// 表单校验规则1
rules
:
{},
// 表单校验规则2
...
...
@@ -388,26 +388,12 @@ export default {
// 修改按钮
handleUpdate
(
row
)
{
this
.
reset
()
this
.
snRulesList
=
[]
let
tempList
=
[]
this
.
rows
=
row
getMaterial
(
row
.
businessId
).
then
(
response
=>
{
this
.
form
=
response
.
data
this
.
open
=
true
listEdit
({
materId
:
row
.
businessId
}).
then
(
response
=>
{
tempList
=
response
.
data
tempList
.
forEach
(
item
=>
{
item
.
configurationRules
=
[{
ruleByte
:
''
,
rules
:
''
}]
this
.
SNRule
=
item
listEditRules
({
editId
:
item
.
businessId
}).
then
(
response
=>
{
item
.
configurationRules
=
response
.
data
if
(
item
.
configurationRules
.
length
===
0
)
{
item
.
configurationRules
.
push
({
ruleByte
:
''
,
rules
:
''
})
}
this
.
snRulesList
=
tempList
})
})
})
this
.
getEditList
(
row
)
console
.
log
(
this
.
snRulesList
)
})
},
// 状态修改方法
...
...
@@ -440,6 +426,17 @@ export default {
this
.
Loading
=
false
})
},
// 获取配置数据
getEditList
(
row
)
{
listEdit
({
materId
:
row
.
businessId
}).
then
(
response
=>
{
this
.
snRulesList
=
response
.
data
this
.
snRulesList
.
forEach
(
item
=>
{
if
(
item
.
nltMaterialEditRules
.
length
===
0
)
{
item
.
nltMaterialEditRules
=
[{
ruleByte
:
''
,
rules
:
''
}]
}
})
})
},
// 对话框取消按钮
cancel
()
{
this
.
open
=
false
...
...
@@ -464,86 +461,31 @@ export default {
},
// 增加SN规则方法
addSNRules
()
{
this
.
form1
=
{
materId
:
this
.
rows
.
businessId
}
addEdit
(
this
.
form1
).
then
(
response
=>
{
if
(
response
.
code
===
200
)
{
this
.
$message
({
message
:
'新增成功'
,
type
:
'success'
})
listEdit
(
this
.
form1
).
then
(
response
=>
{
let
tempList
=
response
.
data
tempList
.
forEach
(
item
=>
{
item
.
configurationRules
=
[{
ruleByte
:
''
,
rules
:
''
}]
listEditRules
({
editId
:
item
.
businessId
}).
then
(
response
=>
{
item
.
configurationRules
=
response
.
data
if
(
item
.
configurationRules
.
length
===
0
)
{
item
.
configurationRules
.
push
({
ruleByte
:
''
,
rules
:
''
})
}
this
.
snRulesList
=
tempList
})
})
})
}
})
this
.
snRulesList
.
push
(
this
.
form1
)
this
.
form1
=
{
totalDigits
:
''
,
nltMaterialEditRules
:
[
{
ruleByte
:
''
,
rules
:
''
}
]}
},
// 增加SN规则方法2
addSNRule
(
item
,
index
)
{
this
.
form2
=
{
editId
:
this
.
SNRule
.
businessId
}
addEditRules
(
this
.
form2
).
then
(
response
=>
{
this
.
$message
({
message
:
'新增成功'
,
type
:
'success'
})
listEdit
(
this
.
form1
).
then
(
response
=>
{
let
tempList
=
response
.
data
tempList
.
forEach
(
item
=>
{
item
.
configurationRules
=
[{
ruleByte
:
''
,
rules
:
''
}]
listEditRules
({
editId
:
item
.
businessId
}).
then
(
response
=>
{
item
.
configurationRules
=
response
.
data
if
(
item
.
configurationRules
.
length
===
0
)
{
item
.
configurationRules
.
push
({
ruleByte
:
''
,
rules
:
''
})
}
this
.
snRulesList
=
tempList
})
})
})
})
console
.
log
(
item
,
index
)
item
.
nltMaterialEditRules
.
push
(
this
.
form2
)
},
// 删除SN规则方法
delSNRules
(
item
,
index
)
{
this
.
$confirm
(
'该规则即将删除,是否删除'
,
'提示'
,
{
confirmButtonText
:
'确定 Confirm'
,
cancelButtonText
:
'取消 Cancel'
,
cancelButtonClass
:
'btn-custom-cancel'
,
customClass
:
'confirmBtnSure'
,
type
:
'warning'
}).
then
(()
=>
{
this
.
snRulesList
.
splice
(
index
,
1
)
})
this
.
snRulesList
.
splice
(
index
,
1
)
},
// 删除SN规则方法2
delSNRule
(
item
,
index1
)
{
console
.
log
(
index1
)
this
.
$confirm
(
'该规则即将删除,是否删除'
,
'提示'
,
{
confirmButtonText
:
'确定 Confirm'
,
cancelButtonText
:
'取消 Cancel'
,
cancelButtonClass
:
'btn-custom-cancel'
,
customClass
:
'confirmBtnSure'
,
type
:
'warning'
}).
then
(()
=>
{
item
.
configurationRules
.
splice
(
index1
,
1
)
})
item
.
nltMaterialEditRules
.
splice
(
index1
,
1
)
},
// 重置表单
reset
()
{
this
.
form
=
{
softwareVer
:
undefined
,
}
this
.
snRulesList
=
[]
this
.
resetForm
(
'form'
)
},
}
...
...
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