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
1c9faebf
Commit
1c9faebf
authored
Jun 07, 2022
by
11528
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
不良定义和生产模型
parent
1585c671
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
836 additions
and
101 deletions
+836
-101
badDefinition.js
src/api/badDefinition.js
+24
-1
ModelDetails.vue
src/views/productionInfo/ModelDetails.vue
+383
-0
ProductionModel.vue
src/views/productionInfo/ProductionModel.vue
+271
-4
badDefinition.vue
src/views/productionInfo/badDefinition.vue
+158
-96
No files found.
src/api/badDefinition.js
View file @
1c9faebf
...
...
@@ -70,9 +70,32 @@ export function addBad(data) {
// 导出不良定义
export
function
exportBad
(
query
)
{
return
request
({
url
:
'/nltdisadvantage/export'
,
url
:
'/nltdisadvantage/export
DisAvd
'
,
method
:
'get'
,
params
:
query
,
responseType
:
'blob'
})
}
// 不良定义excel导入
export
function
importDisAvd
(
data
)
{
return
request
({
url
:
'/nltdisadvantage/importDisAvd'
,
method
:
'post'
,
headers
:
{
'Content-Type'
:
'multipart/form-data'
},
transformRequest
:
[(
data
)
=>
{
return
data
}],
data
})
}
// 下载不良导入模板
export
function
exportDisAvdTemplate
(
params
)
{
return
request
({
url
:
'/nltdisadvantage/exportDisAvdTemplate'
,
method
:
'get'
,
responseType
:
'blob'
,
params
})
}
src/views/productionInfo/ModelDetails.vue
0 → 100644
View file @
1c9faebf
<
template
>
<div
class=
"model_details"
>
<div
class=
"detailsSearch"
style=
"border-bottom: 14px solid #f4f4f4"
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
style=
"padding: 0 0 0 20px"
class=
"formClass"
:inline=
"true"
label-width=
"auto"
>
<el-form-item
class=
"labelHeight"
label=
"模型类型"
prop=
"modelType"
>
<div
slot=
"label"
class=
"labelClassRequired"
>
<div
class=
"labelName"
>
模型类型
</div>
<div
class=
"labelName"
>
Model
</div>
</div>
<el-select
v-model=
"form.modelType"
placeholder=
"请选择"
style=
"width: 100%"
>
<el-option
v-for=
"dict in modelOption"
:key=
"dict.dictValue"
:label=
"dict.dictLabel"
:value=
"dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item
class=
"labelHeight"
label=
"成品料号"
prop=
"partNo"
style=
"margin-left: 20px"
>
<div
slot=
"label"
class=
"labelClassRequired"
>
<div
class=
"labelName"
>
成品料号
</div>
<div
class=
"labelName"
>
Part No.
</div>
</div>
{{
form
.
partNo
}}
<el-link
type=
"primary"
>
选择
</el-link>
</el-form-item>
<el-form-item
style=
"float: right"
>
<el-button
class=
"canleBtn"
@
click=
"cancelPosition"
>
取 消 Cancel
</el-button>
<el-button
class=
"redBtn"
type=
"danger"
@
click=
"submitPosition"
>
确 定 Confirm
</el-button>
</el-form-item>
</el-form>
</div>
<div>
<el-row
:gutter=
"20"
>
<!--配置工站-->
<el-col
:span=
"24"
:xs=
"24"
>
<div
style=
"float: right;margin: 10px"
>
<el-button
class=
"redBtn"
type=
"danger"
size=
"small"
@
click=
"addPosition"
>
添加工站 Add Position
</el-button>
</div>
<div
class=
"mb12 font-small-bold"
style=
"margin-top: 20px;padding-left: 10px"
>
配置工站
</div>
<el-table
v-loading=
"loading"
border
style=
"padding-right: 10px;padding-left: 10px"
:data=
"positionList"
>
<el-table-column
type=
"index"
label=
"序号"
width=
"50"
/>
<el-table-column
align=
"center"
prop=
"positionNo"
:show-overflow-tooltip=
"true"
>
<template
slot=
"header"
>
<div>
工站编号
</div>
<div>
Position No.
</div>
</
template
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
positionNo
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
align=
"center"
prop=
"positionName"
:show-overflow-tooltip=
"true"
>
<
template
slot=
"header"
>
<div>
工站名称
</div>
<div>
Position Name
</div>
</
template
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
positionName
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
align=
"center"
prop=
"positionType"
:show-overflow-tooltip=
"true"
>
<
template
slot=
"header"
>
<div>
工站类型
</div>
<div>
Position Type
</div>
</
template
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
positionType
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
align=
"center"
prop=
"sort"
:show-overflow-tooltip=
"true"
>
<
template
slot=
"header"
>
<div>
排序
</div>
<div>
Sort
</div>
</
template
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
sort
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
align=
"center"
class-name=
"small-padding fixed-width"
>
<
template
slot=
"header"
>
<div>
操作
</div>
<div>
Operation
</div>
</
template
>
<
template
slot-scope=
"scope"
>
<el-link
size=
"mini"
type=
"primary"
style=
"margin-left: 10px"
@
click=
"handleUpdate(scope.row)"
>
配置物料
</el-link>
<el-link
size=
"mini"
type=
"danger"
style=
"margin-left: 10px"
@
click=
"handleDelete(scope.row)"
>
删除
</el-link>
</
template
>
</el-table-column>
</el-table>
</el-col>
</el-row>
<el-dialog
:close-on-click-modal=
"false"
class=
"modelDialog"
:title=
"title"
:visible
.
sync=
"openPosition"
width=
"70%"
append-to-body
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"150px"
:inline=
"true"
>
<el-form-item
label=
"工站名称"
prop=
"rejectCode"
>
<div
slot=
"label"
class=
"labelClass"
>
<div>
工站名称
</div>
<div>
Position Name
</div>
</div>
<el-input
v-model=
"queryParams.rejectCode"
placeholder=
"请输入不良编号"
clearable
:maxlength=
"30"
size=
"small"
style=
"width: 200px"
/>
</el-form-item>
<el-form-item>
<el-button
class=
"redBtn"
type=
"danger"
size=
"small"
@
click=
"queryPosition"
>
查询 Query
</el-button>
<el-button
class=
"resetBtn"
size=
"small"
@
click=
"resetPosition"
>
重置 Reset
</el-button>
</el-form-item>
<el-row
:gutter=
"20"
>
<!--不良定义数据-->
<el-col
:span=
"24"
:xs=
"24"
>
<el-table
v-loading=
"loading"
border
style=
"padding-right: 10px;padding-left: 10px;margin-top: 10px"
:data=
"badList"
>
<el-table-column
type=
"selection"
width=
"50"
/>
<el-table-column
type=
"index"
label=
"序号"
width=
"50"
/>
<el-table-column
align=
"center"
prop=
"rejectCode"
width=
"200"
:show-overflow-tooltip=
"true"
>
<
template
slot=
"header"
>
<div>
工站编号
</div>
<div>
Position No.
</div>
</
template
>
<
template
v-slot:default=
"scope"
>
{{
scope
.
row
.
positionNo
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
align=
"center"
prop=
"rejectDescription"
:show-overflow-tooltip=
"true"
>
<
template
slot=
"header"
>
<div>
工站名称
</div>
<div>
Position Name
</div>
</
template
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
positionName
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
align=
"center"
width=
"200"
prop=
"createDate"
:show-overflow-tooltip=
"true"
>
<
template
slot=
"header"
>
<div>
工站类型
</div>
<div>
Position Type
</div>
</
template
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
positionType
||
'-'
}}
</
template
>
</el-table-column>
</el-table>
<pagination
v-show=
"total>0"
:total=
"total"
:page
.
sync=
"queryParams.page"
:limit
.
sync=
"queryParams.rows"
@
pagination=
"getList"
/>
</el-col>
</el-row>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
class=
"canleBtn"
@
click=
"cancelPosition"
>
取 消 Cancel
</el-button>
<el-button
class=
"redBtn"
type=
"danger"
@
click=
"submitPosition"
>
确 定 Confirm
</el-button>
</div>
</el-dialog>
</div>
</div>
</template>
<
script
>
export
default
{
name
:
'ModelDetails'
,
data
()
{
return
{
loading
:
false
,
modelList
:
[],
positionList
:
[],
total
:
0
,
queryParams
:
{
page
:
1
,
rows
:
10
,
modelType
:
undefined
,
partNo
:
undefined
},
// 新增模型弹窗
openModel
:
false
,
// 添加工站弹窗
openPosition
:
false
,
title
:
''
,
form
:
{
modelType
:
''
,
partNo
:
''
},
rules
:
{
modelType
:
[
{
required
:
true
,
message
:
'请选择模型类型'
,
trigger
:
'change'
}
],
partNo
:
[
{
required
:
true
,
message
:
'请选择模型类型'
,
trigger
:
'change'
}
]
},
modelOption
:
[]
}
},
created
()
{
this
.
getList
()
},
methods
:
{
/** 列表获取 */
getList
()
{
console
.
log
(
'查询成功'
)
},
/** 查询按钮操作 */
handleQuery
()
{
this
.
queryParams
.
page
=
1
this
.
getList
()
},
resetQuery
()
{
this
.
queryParams
.
rows
=
10
this
.
queryParams
.
page
=
1
this
.
queryParams
.
modelType
=
undefined
this
.
queryParams
.
partNo
=
undefined
this
.
handleQuery
()
},
/** 表单重置操作 */
reset
()
{
this
.
form
=
{
modelType
:
undefined
,
partNo
:
undefined
}
this
.
resetForm
(
'form'
)
},
/* 新增按钮操作 */
handleAdd
()
{
this
.
reset
()
this
.
openModel
=
true
this
.
form
.
flag
=
'1'
this
.
title
=
'生产模型信息'
},
// 添加工站弹窗
addPosition
()
{
this
.
openPosition
=
true
this
.
title
=
'添加工站'
},
/* 保存按钮 */
submitForm
()
{
this
.
reset
()
this
.
openModel
=
false
},
cancel
()
{
this
.
reset
()
this
.
openModel
=
false
},
cancelPosition
()
{
this
.
$router
.
push
({
name
:
'/productionInfo/ProductionModel'
})
},
submitPosition
()
{
this
.
$router
.
push
({
name
:
'/productionInfo/ProductionModel'
})
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.model_details
{
font-size
:
18px
;
.placeholder
{
height
:
14px
;
background-color
:
#F4F4F4
}
.detailsSearch
{
.el-form-item--small
.el-form-item__label
{
line-height
:
17px
;
}
.labelClass
{
text-align
:
center
;
}
}
.formClass
{
}
.el-form-item__label-wrap
{
margin-left
:
0
!
important
;
}
}
</
style
>
<
style
lang=
"scss"
>
.model_details
{
.detailsSearch
{
.el-form-item--small
.el-form-item__label
{
line-height
:
17px
;
}
.labelHeight
{
.el-form-item__label
{
height
:
40px
;
}
}
.el-form-item--small
.el-form-item__label
{
line-height
:
17px
;
}
.labelName
{
display
:
flex
;
justify-content
:
center
;
}
.labelClass
{
position
:
relative
;
right
:
13px
;
text-align
:
center
;
}
.labelClassRequired
{
text-align
:
center
;
position
:
relative
;
bottom
:
17px
;
right
:
13px
;
}
.el-form-item__label-wrap
{
margin-left
:
0
!
important
;
}
}
.el-table
th
.cell
{
display
:
inline-block
!
important
;
}
.formClass
{
}
.el-form-item__label-wrap
{
margin-left
:
0
!
important
;
}
}
.modelDialog
{
.labelHeight
{
.el-form-item__label
{
height
:
40px
;
}
}
.el-form-item--small
.el-form-item__label
{
line-height
:
17px
;
}
.el-table
th
.cell
{
display
:
inline-block
!
important
;
}
.labelName
{
display
:
flex
;
justify-content
:
end
;
}
.labelClass
{
position
:
relative
;
right
:
13px
;
text-align
:
center
;
}
.labelClassRequired
{
text-align
:
center
;
position
:
relative
;
bottom
:
17px
;
right
:
13px
;
}
}
</
style
>
src/views/productionInfo/ProductionModel.vue
View file @
1c9faebf
<
template
>
<div>
生产模型
</div>
<div
class=
"product_model"
>
<div
class=
"modelSearch"
style=
"border-bottom: 14px solid #f4f4f4"
>
<el-form
ref=
"queryForm"
style=
"padding: 0 0 0 10px"
class=
"formClass"
:model=
"queryParams"
:inline=
"true"
label-width=
"auto"
>
<el-form-item
label=
"成品料号"
prop=
"partNo"
>
<div
slot=
"label"
class=
"labelClass"
>
<div>
成品料号
</div>
<div>
Part No.
</div>
</div>
<el-input
v-model=
"queryParams.partNo"
placeholder=
"请输入成品料号"
clearable
:maxlength=
"30"
size=
"small"
style=
"width: 200px"
/>
</el-form-item>
<el-form-item
label=
"模型类型"
prop=
"modelType"
>
<div
slot=
"label"
class=
"labelClass"
>
<div>
模型类型
</div>
<div>
Model Type
</div>
</div>
<el-input
v-model=
"queryParams.modelType"
placeholder=
"请选择模型类型"
clearable
:maxlength=
"200"
size=
"small"
style=
"width: 200px"
/>
</el-form-item>
<el-form-item>
<el-button
class=
"redBtn"
type=
"danger"
size=
"small"
@
click=
"handleQuery"
>
查询 Query
</el-button>
<el-button
class=
"resetBtn"
size=
"small"
@
click=
"resetQuery"
>
重置 Reset
</el-button>
</el-form-item>
</el-form>
</div>
<div>
<el-row
:gutter=
"20"
>
<!--生产模型数据-->
<el-col
:span=
"24"
:xs=
"24"
>
<div
style=
"float: right;margin: 10px"
>
<el-button
class=
"redBtn"
type=
"danger"
size=
"small"
@
click=
"handleAdd"
>
新增 Add
</el-button>
</div>
<el-table
v-loading=
"loading"
border
style=
"padding-right: 10px;padding-left: 10px"
:data=
"modelList"
>
<el-table-column
type=
"index"
label=
"序号"
width=
"50"
/>
<el-table-column
align=
"center"
prop=
"partNo"
width=
"200"
:show-overflow-tooltip=
"true"
>
<template
slot=
"header"
>
<div>
成品料号
</div>
<div>
Part No.
</div>
</
template
>
<
template
v-slot:default=
"scope"
>
{{
scope
.
row
.
partNo
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
align=
"center"
prop=
"modelType"
:show-overflow-tooltip=
"true"
>
<
template
slot=
"header"
>
<div>
模型类型
</div>
<div>
Model Type
</div>
</
template
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
modelType
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
align=
"center"
width=
"200"
prop=
"createTime"
:show-overflow-tooltip=
"true"
>
<
template
slot=
"header"
>
<div>
创建时间
</div>
<div>
Build Time
</div>
</
template
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
createTime
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
align=
"center"
width=
"200"
prop=
"operator"
:show-overflow-tooltip=
"true"
>
<
template
slot=
"header"
>
<div>
操作人
</div>
<div>
Operator
</div>
</
template
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
operator
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
align=
"center"
width=
"100"
prop=
"flag"
>
<
template
slot=
"header"
>
<div>
状态
</div>
<div>
State
</div>
</
template
>
<
template
slot-scope=
"scope"
>
<el-switch
v-model=
"scope.row.flag"
class=
"switchDisabledStyle"
inactive-value=
"0"
active-value=
"1"
@
click
.
native=
"handleStatusChange(scope.row)"
/>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
width=
"300"
class-name=
"small-padding fixed-width"
>
<
template
slot=
"header"
>
<div>
操作
</div>
<div>
Operation
</div>
</
template
>
<
template
slot-scope=
"scope"
>
<el-link
size=
"mini"
type=
"primary"
style=
"margin-left: 10px"
@
click=
"handleUpdate(scope.row)"
>
修改
</el-link>
<el-link
size=
"mini"
type=
"danger"
style=
"margin-left: 10px"
@
click=
"handleDelete(scope.row)"
>
复制
</el-link>
<el-link
size=
"mini"
type=
"danger"
style=
"margin-left: 10px"
@
click=
"handleDelete(scope.row)"
>
删除
</el-link>
<el-link
size=
"mini"
type=
"danger"
style=
"margin-left: 10px"
@
click=
"handleDelete(scope.row)"
>
详情
</el-link>
</
template
>
</el-table-column>
</el-table>
<pagination
v-show=
"total>0"
:total=
"total"
:page
.
sync=
"queryParams.page"
:limit
.
sync=
"queryParams.rows"
@
pagination=
"getList"
/>
</el-col>
</el-row>
</div>
</div>
</template>
<
script
>
export
default
{
name
:
'ProductionModel'
name
:
'ProductionModel'
,
data
()
{
return
{
loading
:
false
,
modelList
:
[],
total
:
0
,
queryParams
:
{
page
:
1
,
rows
:
10
,
modelType
:
undefined
,
partNo
:
undefined
},
// 新增模型弹窗
openModel
:
false
,
// 添加工站弹窗
openPosition
:
false
,
title
:
''
}
},
created
()
{
this
.
getList
()
},
methods
:
{
/** 列表获取 */
getList
()
{
console
.
log
(
'查询成功'
)
},
/** 查询按钮操作 */
handleQuery
()
{
this
.
queryParams
.
page
=
1
this
.
getList
()
},
resetQuery
()
{
this
.
queryParams
.
rows
=
10
this
.
queryParams
.
page
=
1
this
.
queryParams
.
modelType
=
undefined
this
.
queryParams
.
partNo
=
undefined
this
.
handleQuery
()
},
/* 新增按钮操作 */
handleAdd
()
{
this
.
title
=
'生产模型信息'
this
.
$router
.
push
({
name
:
'/productionInfo/ModelDetails'
})
}
}
}
</
script
>
<
style
scoped
>
<
style
lang=
"scss"
scoped
>
.product_model
{
font-size
:
18px
;
.placeholder
{
height
:
14px
;
background-color
:
#F4F4F4
}
.modelSearch
{
.el-form-item--small
.el-form-item__label
{
line-height
:
17px
;
}
.labelClass
{
text-align
:
center
;
}
}
.formClass
{
}
.el-form-item__label-wrap
{
margin-left
:
0
!
important
;
}
}
</
style
>
<
style
lang=
"scss"
>
.product_model
{
.modelSearch
{
.el-form-item--small
.el-form-item__label
{
line-height
:
17px
;
}
.labelClass
{
text-align
:
center
;
}
}
.el-table
th
.cell
{
display
:
inline-block
!
important
;
}
.formClass
{
}
.el-form-item__label-wrap
{
margin-left
:
0
!
important
;
}
}
.modelDialog
{
.labelHeight
{
.el-form-item__label
{
height
:
40px
;
}
}
.el-form-item--small
.el-form-item__label
{
line-height
:
17px
;
}
.el-table
th
.cell
{
display
:
inline-block
!
important
;
}
.labelName
{
display
:
flex
;
justify-content
:
end
;
}
.labelClass
{
position
:
relative
;
right
:
13px
;
text-align
:
center
;
}
.labelClassRequired
{
text-align
:
center
;
position
:
relative
;
bottom
:
17px
;
right
:
13px
;
}
}
</
style
>
src/views/productionInfo/badDefinition.vue
View file @
1c9faebf
...
...
@@ -14,7 +14,6 @@
:maxlength=
"30"
size=
"small"
style=
"width: 200px"
@
keyup
.
native=
"keyUp"
/>
</el-form-item>
<el-form-item
label=
"不良描述"
prop=
"rejectDescription"
>
...
...
@@ -29,7 +28,6 @@
:maxlength=
"200"
size=
"small"
style=
"width: 200px"
@
keyup
.
native=
"keyUp"
/>
</el-form-item>
<el-form-item>
...
...
@@ -76,7 +74,7 @@
<div>
Reject Code
</div>
</
template
>
<
template
v-slot:default=
"scope"
>
{{
scope
.
row
.
rejectCode
||
'-'
}}
{{
scope
.
row
.
reject
Type
||
'-'
}}
+
{{
scope
.
row
.
reject
Code
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
align=
"center"
prop=
"rejectDescription"
:show-overflow-tooltip=
"true"
>
...
...
@@ -85,7 +83,7 @@
<div>
Reject Description
</div>
</
template
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
rejectDescription
||
'-'
}}
{{
scope
.
row
.
rejectDescription
||
'-'
}}
/
{{
scope
.
row
.
specificExplanation
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
align=
"center"
width=
"200"
prop=
"createDate"
:show-overflow-tooltip=
"true"
>
...
...
@@ -155,7 +153,7 @@
/>
</el-col>
</el-row>
<el-dialog
:close-on-click-modal=
"false"
class=
"badDialog"
title=
"新增不良
"
:visible
.
sync=
"openBad"
width=
"60%"
append-to-body
>
<el-dialog
:close-on-click-modal=
"false"
class=
"badDialog"
:title=
"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"
>
...
...
@@ -164,7 +162,7 @@
<div
class=
"labelName"
>
不良类型
</div>
<div
class=
"labelName"
>
Reject Type
</div>
</div>
<el-select
v-model=
"form.rejectType"
placeholder=
"请选择"
style=
"width: 100%"
>
<el-select
v-model=
"form.rejectType"
placeholder=
"请选择"
style=
"width: 100%"
@
change=
"code"
>
<el-option
v-for=
"dict in positionOption"
:key=
"dict.dictValue"
...
...
@@ -180,7 +178,14 @@
<div
class=
"labelName"
>
不良编号
</div>
<div
class=
"labelName"
>
Reject Code
</div>
</div>
<el-input
v-model=
"form.rejectCode"
:maxlength=
"30"
placeholder=
"请输入不良编号"
@
keyup
.
native=
"keyUp"
/>
<el-row>
<el-col
:span=
"6"
style=
"margin-right: 10px"
>
<el-input
v-model=
"form.rejectTypes"
type=
"text"
/>
</el-col>
<el-col
:span=
"16"
>
<el-input
v-model=
"form.rejectCode"
:maxlength=
"30"
placeholder=
"请输入不良编号"
/>
</el-col>
</el-row>
</el-form-item>
</el-col>
</el-row>
...
...
@@ -191,7 +196,7 @@
<div
class=
"labelName"
>
不良描述
</div>
<div
class=
"labelName"
>
Reject Description
</div>
</div>
<el-input
v-model=
"form.rejectDescription"
:maxlength=
"
200"
placeholder=
"请输入"
@
keyup
.
native=
"keyUp
"
/>
<el-input
v-model=
"form.rejectDescription"
:maxlength=
"
128"
placeholder=
"请输入
"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
...
...
@@ -214,7 +219,7 @@
<div
class=
"labelName"
>
具体解释
</div>
<div
class=
"labelName"
>
Specific Explanation
</div>
</div>
<el-input
v-model=
"form.specificExplanation"
:maxlength=
"
200"
placeholder=
"请输入"
@
keyup
.
native=
"keyUp
"
/>
<el-input
v-model=
"form.specificExplanation"
:maxlength=
"
128"
placeholder=
"请输入
"
/>
<!-- <el-col v-for="(item, index) in form.specificExplanations" :key="item" :span="18" style="width: 70%">-->
<!-- <el-input v-model="item.specificExplanation" :maxlength="200" placeholder="" style="width: 80%;margin-bottom: 10px" />-->
<!-- <el-button v-if="form.specificExplanations.length > 1" style="margin-left: 5%" icon="el-icon-minus" @click.prevent="removeDomain(item,index)" />-->
...
...
@@ -231,93 +236,60 @@
<el-button
class=
"redBtn"
type=
"danger"
@
click=
"submitForm"
>
确 定 Confirm
</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" :maxlength="30" placeholder="请输入不良编号" />-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="12">-->
<!-- <el-form-item class="labelHeight" label="工站" prop="positionName">-->
<!-- <div slot="label" class="labelClassRequired">-->
<!-- <div class="labelName">工站</div>-->
<!-- <div class="labelName">Position</div>-->
<!-- </div>-->
<!-- <el-select v-model="form.positionId" placeholder="请选择">-->
<!-- <el-option-->
<!-- v-for="(dict, index) in positionOption"-->
<!-- :key="index"-->
<!-- :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="rejectDescription">-->
<!-- <div slot="label" class="labelClassRequired">-->
<!-- <div class="labelName">不良描述</div>-->
<!-- <div class="labelName">Reject Description</div>-->
<!-- </div>-->
<!-- <el-input v-model="form.rejectDescription" :maxlength="200" placeholder="请输入" />-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="12">-->
<!-- <el-form-item class="labelHeight" label="状态" prop="flag">-->
<!-- <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="1">启用</el-radio>-->
<!-- <el-radio label="0">停用</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-col v-for="(item, index) in form.specificExplanation" :key="item" :span="20" style="width: 70%">-->
<!-- <el-input v-model="item.specificExplanation" :maxlength="200" placeholder="" style="width: 80%;margin-bottom: 10px" />-->
<!-- <el-button v-if="form.specificExplanation.length > 1" style="margin-left: 5%" @click.prevent="removeUpdate(item,index)" icon="el-icon-minus" />-->
<!-- </el-col>-->
<!-- <el-col :span="4">-->
<!-- <el-button type="primary" @click="addUpdate" icon="el-icon-plus" />-->
<!-- </el-col>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- </el-form>-->
<!-- <div slot="footer" class="dialog-footer">-->
<!-- <el-button class="canleBtn" @click="cancel">取消 Cancel</el-button>-->
<!-- <el-button class="redBtn" type="danger" @click="submitForm">确定 Confirm</el-button>-->
<!-- </div>-->
<!-- </el-dialog>-->
<!-- 导入 -->
<el-dialog
:close-on-click-modal=
"false"
:title=
"upload.title"
:visible
.
sync=
"upload.uploadData"
width=
"400px"
append-to-body
>
<el-upload
accept=
".xlsx, .xls"
:disabled=
"upload.isUploading"
:on-progress=
"handleFileUploadProgress"
:on-success=
"handleSuccess"
:auto-upload=
"false"
:on-change=
"employeeUpload"
:on-remove=
"handleRemove"
:before-remove=
"beforeRemove"
:on-preview=
"handlePreview"
:file-list=
"fileList"
drag
action=
"String"
>
<i
class=
"el-icon-upload"
/>
<div
class=
"el-upload__text"
>
将文件拖到此处,或
<em>
点击上传
</em>
</div>
<div
slot=
"tip"
class=
"el-upload__tip"
>
<el-checkbox
v-model=
"upload.updateSupport"
/>
是否更新已经存在的用户数据
<el-link
type=
"info"
style=
"font-size:12px"
@
click=
"importTemplate"
>
下载模板
</el-link>
</div>
<div
slot=
"tip"
class=
"el-upload__tip"
style=
"color:red"
>
提示:仅允许导入“xls”或“xlsx”格式文件!
</div>
</el-upload>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
class=
"resetBtn"
@
click=
"upload.uploadData = false"
>
取 消 Cancel
</el-button>
<el-button
:loading=
"importLoading"
class=
"redBtn"
type=
"danger"
@
click=
"uploadBad"
>
确 定 Confirm
</el-button>
</div>
</el-dialog>
</div>
</div>
</template>
<
script
>
import
{
listBad
,
deleteLogical
,
updateStatus
,
addBad
,
updateData
,
exportBad
}
from
'@/api/badDefinition'
import
{
listBad
,
deleteLogical
,
updateStatus
,
addBad
,
updateData
,
exportBad
,
importDisAvd
,
exportDisAvdTemplate
}
from
'@/api/badDefinition'
import
{
listData
}
from
'@/api/system/dict/data'
export
default
{
name
:
'BadDefinition'
,
data
()
{
return
{
importLoading
:
false
,
// 遮罩层
loading
:
false
,
// 用户表格数据
...
...
@@ -331,20 +303,22 @@ export default {
rejectDescription
:
undefined
},
openBad
:
false
,
openBadOne
:
false
,
uploadData
:
false
,
upload
:
{
isUploading
:
false
,
uploadData
:
false
,
title
:
''
,
updateSupport
:
0
},
fileList
:
[],
form
:
{
rejectType
:
''
,
rejectCode
:
''
,
positionId
:
''
,
rejectDescription
:
''
,
flag
:
''
,
specificExplanation
:
''
// specificExplanations: [
// { specificExplanation: '' }
// ],
// positionName: '',
// specificExplanation: [],
// specificExplanation1: []
specificExplanation
:
''
,
rejectTypes
:
''
},
// 表单校验
rules
:
{
...
...
@@ -402,6 +376,12 @@ export default {
}
)
},
// 不良类型value存放
code(dict) {
console.log(dict)
this.form.rejectTypes = dict
console.log(this.form.rejectTypes)
},
/** 表单重置操作 */
reset() {
this.form = {
...
...
@@ -439,12 +419,12 @@ export default {
this.reset()
this.openBad = true
this.form.flag = '1'
this.title = '
新增不良
'
this.title = '
不良项信息
'
},
/** 删除按钮操作 */
handleDelete(row) {
const badId = row.businessId
this.$confirm('
本条数据被删除后不可再恢复,是否继续
?', '提示', {
this.$confirm('
请确认是否删除数据
?', '提示', {
confirmButtonText: '确定 Confirm',
cancelButtonText: '取消 Cancel',
cancelButtonClass: 'btn-custom-cancel',
...
...
@@ -465,7 +445,9 @@ export default {
this.reset()
this.openBad = true
this.form = JSON.parse(JSON.stringify(row))
this.form.rejectTypes = this.form.rejectType
this.title = '修改'
console.log(this.form)
// this.getChildrenDept(userId)
},
/** 取消 Cancel按钮操作 */
...
...
@@ -563,9 +545,16 @@ export default {
}
this.form.specificExplanation.splice(index, 1)
},
handleImport() {
this.upload.title = '不良导入'
this.upload.uploadData = true
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams
const queryParams = {
rejectCode: this.queryParams.rejectCode,
rejectDescription: this.queryParams.rejectDescription
}
this.$confirm('是否确认导出所有用户信息?', '警告', {
confirmButtonText: '确定 Confirm',
cancelButtonText: '取消 Cancel',
...
...
@@ -585,6 +574,79 @@ export default {
// this.download(response.msg);
})
})
},
/**
* 导入
*/
uploadBad(param) {
const formData = new FormData()
formData.append('file', this.fileList)
importDisAvd(formData).then(res => {
if (res.ok === true) {
this.$message.success(res.data)
this.uploadData = false
this.getList()
this.$refs.file.clearFiles()
} else {
this.$message.error(res.message)
}
})
},
// 导入前验证
onbeforeunload(file) {
if (!file) {
this.$message.error('请上传文件')
}
const maxFile = file.size / 1024 / 1024 < 10
const isExcel = file.name.indexOf('.xls') >= 0
if (!isExcel) {
this.$message.error('只能上传Excel文件!')
}
if (!maxFile) {
this.$message.error('上传大小不能超过10M')
}
return maxFile && isExcel
},
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true
},
// 文件上传成功处理
handleSuccess(response, file, fileList) {
this.upload.open = false
this.upload.isUploading = false
this.$refs.upload.clearFiles()
this.$alert(response.msg, '导入结果', { dangerouslyUseHTMLString: true })
this.getList()
},
employeeUpload(file, fileList) {
if (fileList.length > 1) {
fileList.splice(0, 1)
}
this.fileList = fileList[0].raw
},
handleRemove(file, fileList) {
this.fileList = []
},
beforeRemove(file, fileList) {
this.fileList = []
},
/* 上传文件所需求 */
handlePreview(file) {
},
/** 下载模板操作 */
importTemplate() {
exportDisAvdTemplate().then(response => {
const blob = new Blob([response])
const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob)// 创建下载的链接
downloadElement.href = href
downloadElement.download = '不良定义导入模板' + '.xls' // 下载后文件名
document.body.appendChild(downloadElement)
downloadElement.click()// 点击下载
document.body.removeChild(downloadElement)// 下载完成移除元素
window.URL.revokeObjectURL(href)// 释放掉blob对象
// this.download(response.msg);
})
}
}
}
...
...
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