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
feb0769e
Commit
feb0769e
authored
May 28, 2022
by
11528
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
不良定义页面
parent
29ede11a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
138 additions
and
15 deletions
+138
-15
badDefinition.js
src/api/badDefinition.js
+12
-0
badDefinition.vue
src/views/productionInfo/badDefinition.vue
+126
-15
No files found.
src/api/badDefinition.js
View file @
feb0769e
...
...
@@ -47,3 +47,15 @@ export function updateStatus(data) {
}
})
}
// 新增不良定义
export
function
addBad
(
data
)
{
data
=
Qs
.
stringify
(
data
)
return
request
({
url
:
'/nltdisadvantage/add'
,
method
:
'post'
,
data
,
headers
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
}
})
}
src/views/productionInfo/badDefinition.vue
View file @
feb0769e
...
...
@@ -153,7 +153,7 @@
/>
</el-col>
</el-row>
<el-dialog
:close-on-click-modal=
"false"
class=
"badDialog"
:title=
"title
"
:visible
.
sync=
"openBad"
width=
"60%"
append-to-body
>
<el-dialog
:close-on-click-modal=
"false"
class=
"badDialog"
title=
"新增不良
"
:visible
.
sync=
"openBad"
width=
"60%"
append-to-body
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"150px"
>
<el-row>
<el-col
:span=
"12"
>
...
...
@@ -207,14 +207,87 @@
</el-row>
<el-row>
<el-col
:span=
"24"
>
<el-form-item
class=
"labelHeight"
label=
"具体解释"
prop=
"specificExplanation"
>
<el-form-item
class=
"labelHeight"
prop=
"specificExplanation"
>
<div
slot=
"label"
class=
"labelClass"
>
<div
class=
"labelName"
>
具体解释
</div>
<div
class=
"labelName"
>
Specific Explanation
</div>
</div>
<el-col
v-for=
"(item, index) in form.specificExplanation"
:key=
"item.specificExplanation"
:span=
"18"
style=
"width: 70%"
>
<el-input
v-model=
"item.specificExplanation"
placeholder=
""
style=
"width: 70%"
/>
<el-link
v-if=
"form.specificExplanation.length > 1"
style=
"width: 20%"
@
click
.
prevent=
"removeDomain(item,index)"
>
删除
</el-link>
</el-col>
<el-col
:span=
"6"
>
<el-link
type=
"primary"
@
click=
"addDomain"
>
增加一行
</el-link>
</el-col>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"cancel"
>
取消
</el-button>
<el-button
class=
"redBtn"
type=
"danger"
@
click=
"submitForm"
>
确定
</el-button>
</div>
</el-dialog>
<el-dialog
:close-on-click-modal=
"false"
class=
"badDialog"
title=
"修改"
:visible
.
sync=
"openBadOne"
width=
"60%"
append-to-body
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"150px"
>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
class=
"labelHeight"
label=
"不良编号"
prop=
"rejectCode"
>
<div
slot=
"label"
class=
"labelClassRequired"
>
<div
class=
"labelName"
>
不良编号
</div>
<div
class=
"labelName"
>
Reject Code
</div>
</div>
<el-input
v-model=
"form.rejectCode"
placeholder=
"请输入不良编号"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
class=
"labelHeight"
label=
"工站"
prop=
"Position"
>
<div
slot=
"label"
class=
"labelClass"
>
<div
class=
"labelName"
>
工站
</div>
<div
class=
"labelName"
>
Position
</div>
</div>
<el-select
v-model=
"form.positionName"
placeholder=
"请选择"
>
<el-option
v-for=
"dict in positionOption"
:key=
"dict.businessId"
:label=
"dict.staName"
:value=
"dict.businessId"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
class=
"labelHeight"
label=
"不良描述"
prop=
"phone"
>
<div
slot=
"label"
class=
"labelClass"
>
<div
class=
"labelName"
>
不良描述
</div>
<div
class=
"labelName"
>
Reject Description
</div>
</div>
<el-input
v-model=
"form.rejectDescription"
placeholder=
"请输入"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
class=
"labelHeight"
label=
"状态"
prop=
"email"
>
<div
slot=
"label"
class=
"labelClass"
>
<div
class=
"labelName"
>
状态
</div>
<div
class=
"labelName"
>
Status
</div>
</div>
<el-radio-group
v-model=
"form.flag"
>
<el-radio
label=
"0"
>
停用
</el-radio>
<el-radio
label=
"1"
>
启用
</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"24"
>
<el-form-item
class=
"labelHeight"
prop=
"specificExplanation"
>
<div
slot=
"label"
class=
"labelClass"
>
<div
class=
"labelName"
>
具体解释
</div>
<div
class=
"labelName"
>
Specific Explanation
</div>
</div>
<el-input
v-model=
"form.specificExplanation"
placeholder=
""
style=
"width: 70%"
/>
<el-link
type=
"primary"
style=
"width: 20%"
@
click=
"addDomain"
>
增加一行
</el-link>
<el-link
@
click
.
prevent=
"removeDomain(domain)"
>
删除
</el-link>
</el-form-item>
</el-col>
</el-row>
...
...
@@ -224,12 +297,13 @@
<el-button
class=
"redBtn"
type=
"danger"
@
click=
"submitForm"
>
确定
</el-button>
</div>
</el-dialog>
</div>
</div>
</template>
<
script
>
import
{
listBad
,
listPost
,
deleteLogical
,
updateStatus
}
from
'@/api/badDefinition'
import
{
listBad
,
listPost
,
deleteLogical
,
updateStatus
,
addBad
}
from
'@/api/badDefinition'
export
default
{
name
:
'BadDefinition'
,
...
...
@@ -250,12 +324,16 @@ export default {
position
:
undefined
},
openBad
:
false
,
openBadOne
:
false
,
form
:
{
explanationId
:
''
,
rejectCode
:
''
,
position
:
''
,
rejectDescription
:
''
,
flag
:
''
,
specificExplanation
:
''
,
specificExplanation
:
[
{
specificExplanation
:
''
}
],
positionName
:
''
},
// 表单校验
...
...
@@ -304,7 +382,10 @@ export default {
flag
:
undefined
,
createBy
:
undefined
,
updateBy
:
undefined
,
remark
:
undefined
remark
:
undefined
,
specificExplanation
:
[
{
specificExplanation
:
''
}
]
}
this
.
resetForm
(
'form'
)
},
...
...
@@ -345,7 +426,7 @@ export default {
/** 修改按钮操作 */
handleUpdate
(
row
)
{
this
.
reset
()
this
.
openBad
=
true
this
.
openBad
One
=
true
this
.
form
=
JSON
.
parse
(
JSON
.
stringify
(
row
))
this
.
positionSelect
()
this
.
title
=
'修改'
...
...
@@ -354,6 +435,7 @@ export default {
/** 取消按钮操作 */
cancel
()
{
this
.
openBad
=
false
this
.
openBadOne
=
false
this
.
reset
()
},
/** 新增修改页面工站下拉框 */
...
...
@@ -381,18 +463,47 @@ export default {
row
.
flag
=
row
.
flag
===
'0'
?
'1'
:
'0'
})
},
/** 对话框保存按钮 **/
submitForm
()
{
this
.
$refs
[
'form'
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
this
.
form
.
businessId
!==
undefined
)
{
updateStatus
(
this
.
form
).
then
(
response
=>
{
if
(
response
.
code
===
200
)
{
this
.
$message
({
message
:
'修改成功'
,
type
:
'success'
})
this
.
openBadOne
=
false
this
.
getList
()
}
})
}
else
{
addBad
(
this
.
form
).
then
(
response
=>
{
if
(
response
.
code
===
200
)
{
this
.
$message
({
message
:
'新增成功'
,
type
:
'success'
})
this
.
open
=
false
this
.
getList
()
}
})
}
}
})
},
addDomain
()
{
this
.
dynamicValidateForm
.
domains
.
push
({
value
:
''
,
key
:
Date
.
now
()
this
.
form
.
specificExplanation
.
push
({
specificExplanation
:
''
})
},
/** 新增弹窗的删除按钮 */
removeDomain
(
item
)
{
var
index
=
this
.
dynamicValidateForm
.
domains
.
indexOf
(
item
)
if
(
index
!==
-
1
)
{
this
.
dynamicValidateForm
.
domains
.
splice
(
index
,
1
)
removeDomain
(
item
,
index
)
{
if
(
this
.
form
.
specificExplanation
.
length
<=
1
)
{
return
false
}
this
.
form
.
specificExplanation
.
splice
(
index
,
1
)
}
}
}
...
...
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