Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mes-ui
Project
Project
Details
Activity
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
mes
mes-ui
Commits
68a58609
Commit
68a58609
authored
Jul 17, 2025
by
沈翠玲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
缺陷分类和 缺陷代码,生产追溯
parent
87991eb0
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
1584 additions
and
4 deletions
+1584
-4
defectClass.js
src/api/mes/md/defectClass.js
+37
-0
defectNormal.js
src/api/mes/md/defectNormal.js
+37
-0
productSee.js
src/api/mes/proTable/productSee.js
+10
-0
main.js
src/main.js
+2
-1
request.js
src/utils/request.js
+24
-1
index.vue
src/views/mes/md/defectClass/index.vue
+379
-0
index.vue
src/views/mes/md/defectNormal/index.vue
+433
-0
index.vue
src/views/mes/pro/feedback/index.vue
+4
-2
index.vue
src/views/mes/proTable/productSee/index.vue
+422
-0
line.vue
src/views/mes/proTable/productSee/line.vue
+236
-0
No files found.
src/api/mes/md/defectClass.js
0 → 100644
View file @
68a58609
import
request
from
'@/utils/request'
// 查询【请填写功能名称】列表
export
function
listdefectClass
(
query
)
{
return
request
({
url
:
'/qms/defectClass/list'
,
method
:
'get'
,
params
:
query
})
}
// 新增【请填写功能名称】
export
function
adddefectClass
(
data
)
{
return
request
({
url
:
'/qms/defectClass/add'
,
method
:
'post'
,
data
:
data
})
}
// 修改【请填写功能名称】
export
function
updatedefectClass
(
data
)
{
return
request
({
url
:
'/qms/defectClass/update'
,
method
:
'post'
,
data
:
data
})
}
// 删除【请填写功能名称】
export
function
deldefectClass
(
defectClassId
)
{
return
request
({
url
:
'/qms/defectClass/delete/'
+
defectClassId
,
method
:
'post'
})
}
src/api/mes/md/defectNormal.js
0 → 100644
View file @
68a58609
import
request
from
'@/utils/request'
// 查询【请填写功能名称】列表
export
function
listdefect
(
query
)
{
return
request
({
url
:
'/qms/defect/list'
,
method
:
'get'
,
params
:
query
})
}
// 新增【请填写功能名称】
export
function
adddefect
(
data
)
{
return
request
({
url
:
'/qms/defect/add'
,
method
:
'post'
,
data
:
data
})
}
// 修改【请填写功能名称】
export
function
updatedefect
(
data
)
{
return
request
({
url
:
'/qms/defect/update'
,
method
:
'post'
,
data
:
data
})
}
// 删除【请填写功能名称】
export
function
deldefect
(
defectId
)
{
return
request
({
url
:
'/qms/defect/delete/'
+
defectId
,
method
:
'post'
})
}
src/api/mes/proTable/productSee.js
0 → 100644
View file @
68a58609
import
request
from
'@/utils/request'
//
export
function
getplbl
(
query
)
{
return
request
({
url
:
"/report/pro/tracedback/plbl"
,
method
:
"get"
,
params
:
query
,
});
}
\ No newline at end of file
src/main.js
View file @
68a58609
...
...
@@ -16,7 +16,7 @@ import store from './store'
import
router
from
'./router'
import
directive
from
'./directive'
// directive
import
plugins
from
'./plugins'
// plugins
import
{
download
,
download1
}
from
'@/utils/request'
import
{
download
,
download1
,
download2
}
from
'@/utils/request'
import
'./assets/icons'
// icon
import
'./permission'
// permission control
...
...
@@ -65,6 +65,7 @@ Vue.prototype.selectDictLabel = selectDictLabel
Vue
.
prototype
.
selectDictLabels
=
selectDictLabels
Vue
.
prototype
.
download
=
download
Vue
.
prototype
.
download1
=
download1
Vue
.
prototype
.
download2
=
download2
Vue
.
prototype
.
handleTree
=
handleTree
Vue
.
prototype
.
formatMoney
=
formatMoney
...
...
src/utils/request.js
View file @
68a58609
...
...
@@ -226,5 +226,28 @@ export function download1(url, params, filename) {
downloadLoadingInstance
.
close
();
})
}
export
function
download2
(
url
,
params
,
filename
)
{
downloadLoadingInstance
=
Loading
.
service
({
text
:
"正在下载数据,请稍候"
,
spinner
:
"el-icon-loading"
,
background
:
"rgba(0, 0, 0, 0.7)"
,
})
return
service
.
get
(
url
,
params
,
{
// transformRequest: [(params) => { return tansParams(params) }],
headers
:
{
'Content-Type'
:
'application/json;charset=utf-8'
},
responseType
:
'blob'
}).
then
(
async
(
data
)
=>
{
const
isLogin
=
await
blobValidate
(
data
);
if
(
isLogin
)
{
const
blob
=
new
Blob
([
data
])
saveAs
(
blob
,
filename
)
}
else
{
const
resText
=
await
data
.
text
();
const
rspObj
=
JSON
.
parse
(
resText
);
const
errMsg
=
errorCode
[
rspObj
.
code
]
||
rspObj
.
msg
||
errorCode
[
'default'
]
Message
.
error
(
errMsg
);
}
downloadLoadingInstance
.
close
();
}).
catch
((
r
)
=>
{
console
.
error
(
r
)
Message
.
error
(
'下载文件出现错误,请联系管理员!'
)
downloadLoadingInstance
.
close
();
})
}
export
default
service
src/views/mes/md/defectClass/index.vue
0 → 100644
View file @
68a58609
<
template
>
<div
class=
"app-container"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"100px"
>
<el-form-item
label=
"缺陷分类代码"
prop=
"defectClassCode"
>
<el-input
v-model=
"queryParams.defectClassCode"
placeholder=
"请输入缺陷分类编码"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"缺陷分类名称"
prop=
"defectClassDesc"
>
<el-input
v-model=
"queryParams.defectClassDesc"
placeholder=
"请输入缺陷分类描述"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"删除标识"
prop=
"isDelete"
>
<el-select
v-model=
"queryParams.isDelete"
placeholder=
"删除标识"
clearable
style=
"width: 240px"
>
<el-option
label=
"是"
:value=
"true"
/>
<el-option
label=
"否"
:value=
"false"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button>
</el-form-item>
</el-form>
<el-row
:gutter=
"10"
class=
"mb8"
>
<el-col
:span=
"1.5"
>
<el-button
type=
"primary"
plain
icon=
"el-icon-plus"
size=
"mini"
@
click=
"handleAdd"
v-hasPermi=
"['md:defectClass:add']"
>
新增
</el-button>
</el-col>
<!--
<el-col
:span=
"1.5"
>
<el-button
type=
"success"
plain
icon=
"el-icon-edit"
size=
"mini"
:disabled=
"single"
@
click=
"handleUpdate"
v-hasPermi=
"['md:defectClass:edit']"
>
修改
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"danger"
plain
icon=
"el-icon-delete"
size=
"mini"
:disabled=
"multiple"
@
click=
"handleDelete"
v-hasPermi=
"['md:defectClass:remove']"
>
删除
</el-button>
</el-col>
-->
<el-col
:span=
"1.5"
>
<el-button
type=
"info"
plain
icon=
"el-icon-upload2"
size=
"mini"
v-hasPermi=
"['md:defectClass:import']"
@
click=
"handleImport"
>
导入
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"warning"
plain
icon=
"el-icon-download"
size=
"mini"
@
click=
"handleExport"
v-hasPermi=
"['md:defectClass:export']"
>
导出
</el-button>
</el-col>
<right-toolbar
:showSearch
.
sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
</el-row>
<el-table
v-loading=
"loading"
:data=
"defectClassList"
@
selection-change=
"handleSelectionChange"
>
<!--
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
-->
<el-table-column
label=
"缺陷分类代码"
align=
"center"
prop=
"defectClassCode"
/>
<el-table-column
label=
"缺陷分类名称"
align=
"center"
prop=
"defectClassDesc"
/>
<el-table-column
label=
"删除标识"
align=
"center"
prop=
"isDelete"
>
<template
slot-scope=
"scope"
>
{{
scope
.
row
.
isDelete
?
'是'
:
'否'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
align=
"center"
defectClass-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-edit"
@
click=
"handleUpdate(scope.row)"
v-hasPermi=
"['md:defectClass:edit']"
>
修改
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
v-hasPermi=
"['md:defectClass:remove']"
>
删除
</el-button>
</
template
>
</el-table-column>
</el-table>
<pagination
v-show=
"total>0"
:total=
"total"
:page
.
sync=
"queryParams.pageNum"
:limit
.
sync=
"queryParams.pageSize"
@
pagination=
"getList"
/>
<!-- 添加或修改缺陷分类对话框 -->
<el-dialog
:title=
"title"
:visible
.
sync=
"open"
width=
"500px"
append-to-body
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"120px"
>
<el-form-item
label=
"缺陷分类代码"
prop=
"defectClassCode"
>
<el-input
v-model=
"form.defectClassCode"
placeholder=
"请输入缺陷分类代码"
/>
</el-form-item>
<el-form-item
label=
"缺陷分类名称"
prop=
"defectClassDesc"
>
<el-input
v-model=
"form.defectClassDesc"
placeholder=
"请输入缺陷分类名称"
/>
</el-form-item>
<el-form-item
label=
"删除标识"
prop=
"isDelete"
>
<el-radio-group
v-model=
"form.isDelete"
>
<el-radio
:label=
"true"
>
是
</el-radio>
<el-radio
:label=
"false"
>
否
</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</div>
</el-dialog>
<el-dialog
:title=
"upload.title"
:visible
.
sync=
"upload.open"
width=
"400px"
append-to-body
>
<el-upload
ref=
"upload"
:limit=
"1"
accept=
".xlsx, .xls"
:headers=
"upload.headers"
:action=
"upload.url + '?updateSupport=' + upload.updateSupport"
:disabled=
"upload.isUploading"
:on-progress=
"handleFileUploadProgress"
:on-success=
"handleFileSuccess"
:auto-upload=
"false"
drag
>
<i
class=
"el-icon-upload"
></i>
<div
class=
"el-upload__text"
>
将文件拖到此处,或
<em>
点击上传
</em></div>
<div
class=
"el-upload__tip text-center"
slot=
"tip"
>
<div
class=
"el-upload__tip"
slot=
"tip"
>
<!-- <el-checkbox v-model="upload.updateSupport" />
是否更新已经存在的物料产品数据 -->
<!-- 物料编码重复则覆盖 -->
</div>
<span>
仅允许导入xls、xlsx格式文件。
</span>
<el-link
type=
"primary"
:underline=
"false"
style=
"font-size: 12px; vertical-align: baseline"
@
click=
"importTemplate"
>
下载模板
</el-link>
</div>
</el-upload>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"submitFileForm"
>
确 定
</el-button>
<el-button
@
click=
"upload.open = false"
>
取 消
</el-button>
</div>
</el-dialog>
</div>
</template>
<
script
>
import
{
listdefectClass
,
deldefectClass
,
adddefectClass
,
updatedefectClass
}
from
"@/api/mes/md/defectClass"
;
import
{
getToken
}
from
"@/utils/auth"
;
export
default
{
name
:
"defectClass"
,
data
()
{
return
{
// 遮罩层
loading
:
true
,
// 选中数组
ids
:
[],
// 非单个禁用
single
:
true
,
// 非多个禁用
multiple
:
true
,
// 显示搜索条件
showSearch
:
true
,
// 总条数
total
:
0
,
// 缺陷分类表格数据
defectClassList
:
[],
upload
:
{
// 是否显示弹出层(用户导入)
open
:
false
,
// 弹出层标题(用户导入)
title
:
""
,
// 是否禁用上传
isUploading
:
false
,
// 是否更新已经存在的用户数据
// updateSupport: false,
updateSupport
:
true
,
// 设置上传的请求头部
headers
:
{
Authorization
:
"Bearer "
+
getToken
()
},
// 上传的地址
url
:
process
.
env
.
VUE_APP_BASE_API
+
"/qms/defectClass/importData"
,
},
// 弹出层标题
title
:
""
,
// 是否显示弹出层
open
:
false
,
// 查询参数
queryParams
:
{
pageNum
:
1
,
pageSize
:
10
,
defectClassCode
:
null
,
defectClassDesc
:
null
,
parentId
:
null
,
defectClassType
:
null
,
defectClassTypeDesc
:
null
,
defectClassKind
:
null
,
isDelete
:
false
},
// 表单参数
form
:
{},
// 表单校验
rules
:
{
}
};
},
created
()
{
this
.
getList
();
},
methods
:
{
handleImport
()
{
this
.
upload
.
title
=
"导入"
;
this
.
upload
.
open
=
true
;
},
/** 查询缺陷分类列表 */
getList
()
{
this
.
loading
=
true
;
const
param
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
queryParams
))
if
(
!
param
.
defectClassCode
){
delete
param
.
defectClassCode
}
if
(
!
param
.
defectClassDesc
){
delete
param
.
defectClassDesc
}
if
(
!
param
.
isDelete
){
delete
param
.
isDelete
}
listdefectClass
(
param
).
then
(
response
=>
{
this
.
defectClassList
=
response
.
rows
;
this
.
total
=
response
.
total
;
this
.
loading
=
false
;
});
},
// 取消按钮
cancel
()
{
this
.
open
=
false
;
this
.
reset
();
},
// 表单重置
reset
()
{
this
.
form
=
{
defectClassId
:
null
,
defectClassCode
:
null
,
defectClassDesc
:
null
,
parentId
:
null
,
defectClassType
:
null
,
defectClassTypeDesc
:
null
,
defectClassKind
:
null
,
createBy
:
null
,
createTime
:
null
,
updateBy
:
null
,
updateTime
:
null
,
isDelete
:
null
};
this
.
resetForm
(
"form"
);
},
/** 搜索按钮操作 */
handleQuery
()
{
this
.
queryParams
.
pageNum
=
1
;
this
.
getList
();
},
/** 重置按钮操作 */
resetQuery
()
{
this
.
resetForm
(
"queryForm"
);
this
.
handleQuery
();
},
// 多选框选中数据
handleSelectionChange
(
selection
)
{
this
.
ids
=
selection
.
map
(
item
=>
item
.
defectClassId
)
this
.
single
=
selection
.
length
!==
1
this
.
multiple
=
!
selection
.
length
},
/** 新增按钮操作 */
handleAdd
()
{
this
.
reset
();
this
.
open
=
true
;
this
.
title
=
"添加缺陷分类"
;
},
/** 修改按钮操作 */
handleUpdate
(
row
)
{
this
.
reset
();
this
.
form
=
row
this
.
open
=
true
;
this
.
title
=
"修改缺陷分类"
;
},
/** 下载模板操作 */
importTemplate
()
{
this
.
download
(
"qms/defectClass/importTemplate"
,
{},
`md_item_
${
new
Date
().
getTime
()}
.xlsx`
);
},
// 文件上传中处理
handleFileUploadProgress
(
event
,
file
,
fileList
)
{
this
.
upload
.
isUploading
=
true
;
},
// 文件上传成功处理
handleFileSuccess
(
response
,
file
,
fileList
)
{
this
.
upload
.
open
=
false
;
this
.
upload
.
isUploading
=
false
;
this
.
$refs
.
upload
.
clearFiles
();
const
msg
=
response
.
msg
?
response
.
msg
:
"导入失败"
;
this
.
$alert
(
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>"
+
msg
+
"</div>"
,
"导入结果"
,
{
dangerouslyUseHTMLString
:
true
}
);
this
.
getList
();
},
// 提交上传文件
submitFileForm
()
{
this
.
$refs
.
upload
.
submit
();
},
/** 提交按钮 */
submitForm
()
{
this
.
$refs
[
"form"
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
this
.
form
.
defectClassId
!=
null
)
{
updatedefectClass
(
this
.
form
).
then
(
response
=>
{
this
.
$modal
.
msgSuccess
(
"修改成功"
);
this
.
open
=
false
;
this
.
getList
();
});
}
else
{
adddefectClass
(
this
.
form
).
then
(
response
=>
{
this
.
$modal
.
msgSuccess
(
"新增成功"
);
this
.
open
=
false
;
this
.
getList
();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete
(
row
)
{
const
defectClassIds
=
row
.
defectClassId
||
this
.
ids
;
this
.
$modal
.
confirm
(
'是否确认删除缺陷分类代码为"'
+
row
.
defectClassCode
+
'"的数据项?'
).
then
(
function
()
{
return
deldefectClass
(
defectClassIds
);
}).
then
(()
=>
{
this
.
getList
();
this
.
$modal
.
msgSuccess
(
"删除成功"
);
}).
catch
(()
=>
{});
},
/** 导出按钮操作 */
handleExport
()
{
const
param
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
queryParams
))
if
(
!
param
.
defectClassCode
){
delete
param
.
defectClassCode
}
if
(
!
param
.
defectClassDesc
){
delete
param
.
defectClassDesc
}
if
(
!
param
.
isDelete
){
delete
param
.
isDelete
}
this
.
download1
(
'qms/defectClass/export'
,
{
...
param
},
`defectClass_
${
new
Date
().
getTime
()}
.xlsx`
)
}
}
};
</
script
>
\ No newline at end of file
src/views/mes/md/defectNormal/index.vue
0 → 100644
View file @
68a58609
<
template
>
<div
class=
"app-container"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"100px"
>
<el-form-item
label=
"缺陷代码"
prop=
"defectCode"
>
<el-input
v-model=
"queryParams.defectCode"
placeholder=
"请输入缺陷代码"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"问题描述"
prop=
"defectDesc"
>
<el-input
v-model=
"queryParams.defectDesc"
placeholder=
"请输入问题描述"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"删除标识"
prop=
"isDelete"
>
<el-select
v-model=
"queryParams.isDelete"
placeholder=
"删除标识"
clearable
style=
"width: 240px"
>
<el-option
label=
"是"
:value=
"true"
/>
<el-option
label=
"否"
:value=
"false"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button>
</el-form-item>
</el-form>
<el-row
:gutter=
"10"
class=
"mb8"
>
<el-col
:span=
"1.5"
>
<el-button
type=
"primary"
plain
icon=
"el-icon-plus"
size=
"mini"
@
click=
"handleAdd"
v-hasPermi=
"['md:defect:add']"
>
新增
</el-button>
</el-col>
<!--
<el-col
:span=
"1.5"
>
<el-button
type=
"success"
plain
icon=
"el-icon-edit"
size=
"mini"
:disabled=
"single"
@
click=
"handleUpdate"
v-hasPermi=
"['md:defect:edit']"
>
修改
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"danger"
plain
icon=
"el-icon-delete"
size=
"mini"
:disabled=
"multiple"
@
click=
"handleDelete"
v-hasPermi=
"['md:defect:remove']"
>
删除
</el-button>
</el-col>
-->
<el-col
:span=
"1.5"
>
<el-button
type=
"info"
plain
icon=
"el-icon-upload2"
size=
"mini"
v-hasPermi=
"['md:defect:import']"
@
click=
"handleImport"
>
导入
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"warning"
plain
icon=
"el-icon-download"
size=
"mini"
@
click=
"handleExport"
v-hasPermi=
"['md:defect:export']"
>
导出
</el-button>
</el-col>
<right-toolbar
:showSearch
.
sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
</el-row>
<el-table
v-loading=
"loading"
:data=
"defectList"
@
selection-change=
"handleSelectionChange"
>
<!--
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
-->
<el-table-column
label=
"缺陷代码"
align=
"center"
prop=
"defectCode"
/>
<el-table-column
label=
"问题描述"
align=
"center"
prop=
"defectDesc"
/>
<el-table-column
label=
"缺陷分类代码"
align=
"center"
prop=
"defectClassCode"
/>
<el-table-column
label=
"缺陷分类名称"
align=
"center"
prop=
"defectClassDesc"
/>
<el-table-column
label=
"删除标识"
align=
"center"
prop=
"isDelete"
>
<template
slot-scope=
"scope"
>
{{
scope
.
row
.
isDelete
?
'是'
:
'否'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-edit"
@
click=
"handleUpdate(scope.row)"
v-hasPermi=
"['md:defect:edit']"
>
修改
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
v-hasPermi=
"['md:defect:remove']"
>
删除
</el-button>
</
template
>
</el-table-column>
</el-table>
<pagination
v-show=
"total>0"
:total=
"total"
:page
.
sync=
"queryParams.pageNum"
:limit
.
sync=
"queryParams.pageSize"
@
pagination=
"getList"
/>
<!-- 添加或修改缺陷分类对话框 -->
<el-dialog
:title=
"title"
:visible
.
sync=
"open"
width=
"500px"
append-to-body
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"120px"
>
<el-form-item
label=
"缺陷代码"
prop=
"defectCode"
>
<el-input
v-model=
"form.defectCode"
placeholder=
"请输入缺陷代码"
/>
</el-form-item>
<el-form-item
label=
"问题描述"
prop=
"defectDesc"
>
<el-input
v-model=
"form.defectDesc"
placeholder=
"请输入问题描述"
/>
</el-form-item>
<el-form-item
label=
"缺陷分类代码"
prop=
"defectClassCode"
>
<el-select
filterable
v-model=
"form.defectClassCode"
placeholder=
"请选择缺陷分类代码"
clearable
@
change=
"changeDefect('defectClassCode')"
>
<el-option
v-for=
"dict in defectClassList"
:key=
"dict.defectClassId"
:label=
"dict.defectClassCode"
:value=
"dict.defectClassCode"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"缺陷分类名称"
prop=
"defectClassDesc"
>
<el-select
filterable
v-model=
"form.defectClassDesc"
placeholder=
"请选择缺陷分类名称"
clearable
@
change=
"changeDefect('defectClassDesc')"
>
<el-option
v-for=
"dict in defectClassList"
:key=
"dict.defectClassId"
:label=
"dict.defectClassDesc"
:value=
"dict.defectClassDesc"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"删除标识"
prop=
"isDelete"
>
<el-radio-group
v-model=
"form.isDelete"
>
<el-radio
:label=
"true"
:disabled=
"title === '添加缺陷代码'"
>
是
</el-radio>
<el-radio
:label=
"false"
>
否
</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</div>
</el-dialog>
<el-dialog
:title=
"upload.title"
:visible
.
sync=
"upload.open"
width=
"400px"
append-to-body
>
<el-upload
ref=
"upload"
:limit=
"1"
accept=
".xlsx, .xls"
:headers=
"upload.headers"
:action=
"upload.url + '?updateSupport=' + upload.updateSupport"
:disabled=
"upload.isUploading"
:on-progress=
"handleFileUploadProgress"
:on-success=
"handleFileSuccess"
:auto-upload=
"false"
drag
>
<i
class=
"el-icon-upload"
></i>
<div
class=
"el-upload__text"
>
将文件拖到此处,或
<em>
点击上传
</em></div>
<div
class=
"el-upload__tip text-center"
slot=
"tip"
>
<div
class=
"el-upload__tip"
slot=
"tip"
>
<!-- <el-checkbox v-model="upload.updateSupport" />
是否更新已经存在的物料产品数据 -->
<!-- 物料编码重复则覆盖 -->
</div>
<span>
仅允许导入xls、xlsx格式文件。
</span>
<el-link
type=
"primary"
:underline=
"false"
style=
"font-size: 12px; vertical-align: baseline"
@
click=
"importTemplate"
>
下载模板
</el-link>
</div>
</el-upload>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"submitFileForm"
>
确 定
</el-button>
<el-button
@
click=
"upload.open = false"
>
取 消
</el-button>
</div>
</el-dialog>
</div>
</template>
<
script
>
import
{
listdefect
,
deldefect
,
adddefect
,
updatedefect
}
from
"@/api/mes/md/defectNormal"
;
import
{
getToken
}
from
"@/utils/auth"
;
import
{
listdefectClass
}
from
"@/api/mes/md/defectClass"
;
export
default
{
name
:
"defect"
,
data
()
{
return
{
// 遮罩层
loading
:
true
,
// 选中数组
ids
:
[],
// 非单个禁用
single
:
true
,
// 非多个禁用
multiple
:
true
,
// 显示搜索条件
showSearch
:
true
,
// 总条数
total
:
0
,
// 缺陷分类表格数据
defectList
:
[],
upload
:
{
// 是否显示弹出层(用户导入)
open
:
false
,
// 弹出层标题(用户导入)
title
:
""
,
// 是否禁用上传
isUploading
:
false
,
// 是否更新已经存在的用户数据
// updateSupport: false,
updateSupport
:
true
,
// 设置上传的请求头部
headers
:
{
Authorization
:
"Bearer "
+
getToken
()
},
// 上传的地址
url
:
process
.
env
.
VUE_APP_BASE_API
+
"/qms/defect/importData"
,
},
// 弹出层标题
title
:
""
,
// 是否显示弹出层
open
:
false
,
// 查询参数
queryParams
:
{
pageNum
:
1
,
pageSize
:
10
,
defectCode
:
null
,
defectDesc
:
null
,
parentId
:
null
,
defectClassType
:
null
,
defectClassTypeDesc
:
null
,
defectClassKind
:
null
,
isDelete
:
null
},
// 表单参数
form
:
{},
defectClassList
:
[],
// 表单校验
rules
:
{
}
};
},
created
()
{
this
.
getOps
()
this
.
getList
();
},
methods
:
{
changeDefect
(
type
){
const
item
=
this
.
defectClassList
.
find
(
v
=>
v
[
type
]
===
this
.
form
[
type
])
if
(
!
item
)
return
this
.
form
.
defectClassId
=
item
.
defectClassId
if
(
type
===
'defectClassCode'
)
{
this
.
form
.
defectClassDesc
=
item
.
defectClassDesc
}
else
{
this
.
form
.
defectClassCode
=
item
.
defectClassCode
}
},
getOps
()
{
listdefectClass
({
isDelete
:
false
,
pageNum
:
1
,
pageSize
:
9999999
}).
then
(
response
=>
{
this
.
defectClassList
=
response
.
rows
;
})
},
handleImport
()
{
this
.
upload
.
title
=
"导入"
;
this
.
upload
.
open
=
true
;
},
/** 查询缺陷分类列表 */
getList
()
{
this
.
loading
=
true
;
const
param
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
queryParams
))
if
(
!
param
.
defectCode
){
delete
param
.
defectCode
}
if
(
!
param
.
defectDesc
){
delete
param
.
defectDesc
}
if
(
!
param
.
isDelete
){
delete
param
.
isDelete
}
listdefect
(
param
).
then
(
response
=>
{
this
.
defectList
=
response
.
rows
;
this
.
total
=
response
.
total
;
this
.
loading
=
false
;
});
},
// 取消按钮
cancel
()
{
this
.
open
=
false
;
this
.
reset
();
},
// 表单重置
reset
()
{
this
.
form
=
{
"apiType"
:
null
,
"createBy"
:
null
,
"createTime"
:
null
,
"defectClassCode"
:
null
,
"defectClassDesc"
:
null
,
"defectClassId"
:
null
,
"defectCode"
:
null
,
"defectDesc"
:
null
,
"defectGrade"
:
null
,
"defectId"
:
null
,
"filter"
:
null
,
"isDelete"
:
false
};
this
.
resetForm
(
"form"
);
},
/** 搜索按钮操作 */
handleQuery
()
{
this
.
queryParams
.
pageNum
=
1
;
this
.
getList
();
},
/** 重置按钮操作 */
resetQuery
()
{
this
.
resetForm
(
"queryForm"
);
this
.
handleQuery
();
},
// 多选框选中数据
handleSelectionChange
(
selection
)
{
this
.
ids
=
selection
.
map
(
item
=>
item
.
defectId
)
this
.
single
=
selection
.
length
!==
1
this
.
multiple
=
!
selection
.
length
},
/** 新增按钮操作 */
handleAdd
()
{
this
.
reset
();
this
.
open
=
true
;
this
.
title
=
"添加缺陷代码"
;
},
/** 修改按钮操作 */
handleUpdate
(
row
)
{
this
.
reset
();
this
.
form
=
row
this
.
open
=
true
;
this
.
title
=
"修改缺陷代码"
;
},
/** 下载模板操作 */
importTemplate
()
{
this
.
download
(
"qms/defect/importTemplate"
,
{},
`md_item_
${
new
Date
().
getTime
()}
.xlsx`
);
},
// 文件上传中处理
handleFileUploadProgress
(
event
,
file
,
fileList
)
{
this
.
upload
.
isUploading
=
true
;
},
// 文件上传成功处理
handleFileSuccess
(
response
,
file
,
fileList
)
{
this
.
upload
.
open
=
false
;
this
.
upload
.
isUploading
=
false
;
this
.
$refs
.
upload
.
clearFiles
();
const
msg
=
response
.
msg
?
response
.
msg
:
"导入失败"
;
this
.
$alert
(
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>"
+
msg
+
"</div>"
,
"导入结果"
,
{
dangerouslyUseHTMLString
:
true
}
);
this
.
getList
();
},
// 提交上传文件
submitFileForm
()
{
this
.
$refs
.
upload
.
submit
();
},
/** 提交按钮 */
submitForm
()
{
this
.
$refs
[
"form"
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
this
.
form
.
defectId
!=
null
)
{
updatedefect
(
this
.
form
).
then
(
response
=>
{
this
.
$modal
.
msgSuccess
(
"修改成功"
);
this
.
open
=
false
;
this
.
getList
();
});
}
else
{
adddefect
(
this
.
form
).
then
(
response
=>
{
this
.
$modal
.
msgSuccess
(
"新增成功"
);
this
.
open
=
false
;
this
.
getList
();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete
(
row
)
{
const
defectIds
=
row
.
defectId
||
this
.
ids
;
this
.
$modal
.
confirm
(
'是否确认删除缺陷代码为"'
+
row
.
defectCode
+
'"的数据项?'
).
then
(
function
()
{
return
deldefect
(
defectIds
);
}).
then
(()
=>
{
this
.
getList
();
this
.
$modal
.
msgSuccess
(
"删除成功"
);
}).
catch
(()
=>
{});
},
/** 导出按钮操作 */
handleExport
()
{
const
param
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
queryParams
))
if
(
!
param
.
defectCode
){
delete
param
.
defectCode
}
if
(
!
param
.
defectDesc
){
delete
param
.
defectDesc
}
if
(
!
param
.
isDelete
){
delete
param
.
isDelete
}
this
.
download1
(
'qms/defect/export'
,
{
...
param
},
`defect_
${
new
Date
().
getTime
()}
.xlsx`
)
}
}
};
</
script
>
\ No newline at end of file
src/views/mes/pro/feedback/index.vue
View file @
68a58609
...
...
@@ -620,12 +620,14 @@ export default {
workunitName
=
workunit
.
data
.
workunitName
;
detail
.
push
({
"barcode"
:
row
.
workorderCode
,
showText
:
'编排单号:'
+
row
.
arrangeCode
+
'
\
n报工次数:'
+
operNo
+
'
\
n数量:'
+
row
.
quantityQualify
+
'
\
n工单号:'
+
row
.
workorderCode
+
'
\
n下道工序机台:'
+
workunitName
,
showText
:
'编排单号:'
+
row
.
arrangeCode
+
'
\
n报工次数:'
+
operNo
+
'
\
n数量:'
+
row
.
quantityQualify
+
'
\
n工单号:'
+
row
.
workorderCode
+
'
\
n下道工序机台:'
+
workunitName
+
'
\
n缺陷问题:'
+
(
row
.
defectCodes
||
''
),
"gp"
:
1
}
)
detail
.
push
({
"barcode"
:
row
.
workorderCode
,
showText
:
'编排单号:'
+
row
.
arrangeCode
+
'
\
n报工次数:'
+
operNo
+
'
\
n数量:'
+
row
.
quantityQualify
+
'
\
n工单号:'
+
row
.
workorderCode
+
'
\
n下道工序机台:'
+
workunitName
,
showText
:
'编排单号:'
+
row
.
arrangeCode
+
'
\
n报工次数:'
+
operNo
+
'
\
n数量:'
+
row
.
quantityQualify
+
'
\
n工单号:'
+
row
.
workorderCode
+
'
\
n下道工序机台:'
+
workunitName
+
'
\
n缺陷问题:'
+
row
.
defectCodes
||
''
,
"gp"
:
1
}
)
postPrintPdf
(
...
...
src/views/mes/proTable/productSee/index.vue
0 → 100644
View file @
68a58609
<
template
>
<div
class=
"app-container"
>
<el-form
:model=
"queryParams"
@
submit
.
native
.
prevent
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"100px"
>
<el-form-item
label=
"销售订单"
prop=
"salesVoucher"
>
<el-input
v-model=
"queryParams.salesVoucher"
placeholder=
"请输入销售订单"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"订单项次"
prop=
"salesVoucherItem"
>
<el-input
v-model=
"queryParams.salesVoucherItem"
placeholder=
"请输入订单项次"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"工单号"
prop=
"workorderCodes"
>
<el-input
v-model=
"queryParams.workorderCodes"
placeholder=
"请输入工单号"
type=
"textarea"
:rows=
"2"
resize=
"none"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"编排单号"
prop=
"arrangeCodes"
>
<el-input
v-model=
"queryParams.arrangeCodes"
placeholder=
"请输入编排单号"
type=
"textarea"
:rows=
"2"
resize=
"none"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"条码"
prop=
"barcode"
>
<el-input
v-model=
"queryParams.barcode"
placeholder=
"请输入条码"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"时间"
>
<el-date-picker
v-model=
"daterangePurchaseDate"
value-format=
"yyyy-MM-dd"
type=
"daterange"
range-separator=
"-"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
></el-date-picker>
</el-form-item>
<el-form-item
label=
"是否入库"
prop=
"warehouse"
>
<el-select
v-model=
"queryParams.warehouse"
style=
"width:220px;"
placeholder=
"请选择是否入库"
clearable
>
<el-option
label=
"是"
value=
"2"
/>
<el-option
label=
"否"
value=
"1"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button>
</el-form-item>
</el-form>
<el-row
:gutter=
"10"
class=
"mb8"
>
<el-col
:span=
"1.5"
>
<el-button
type=
"warning"
plain
icon=
"el-icon-download"
size=
"mini"
@
click=
"handleExport"
v-hasPermi=
"['mes:wm:issueheader:export']"
>
导出
</el-button>
</el-col>
<right-toolbar
:showSearch
.
sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
</el-row>
<el-table
v-loading=
"loading"
:data=
"tbodys"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
label=
"销售订单"
align=
"center"
width=
"150px"
prop=
"salesVoucher"
>
<template
slot-scope=
"scope"
>
<el-button
type=
"text"
@
click=
"handleView(scope.row)"
>
{{
scope
.
row
.
salesVoucher
}}
</el-button>
</
template
>
</el-table-column>
<el-table-column
label=
"订单项次"
align=
"center"
prop=
"salesVoucherItem"
/>
<el-table-column
label=
"编排单号"
align=
"center"
prop=
"arrangeCode"
/>
<el-table-column
label=
"工单号"
align=
"center"
prop=
"workorderCode"
/>
<el-table-column
label=
"条码"
align=
"center"
prop=
"barcode"
/>
<el-table-column
label=
"入库时间"
align=
"center"
prop=
"warehouseTime"
/>
<el-table-column
label=
"产品编码"
align=
"center"
prop=
"productCode"
/>
<el-table-column
label=
"产品名称"
align=
"center"
prop=
"productName"
/>
<el-table-column
label=
"数量"
align=
"center"
prop=
"quantity"
/>
<el-table-column
label=
"装箱码"
align=
"center"
prop=
"boxCode"
/>
<el-table-column
label=
"SIZE明细"
align=
"center"
prop=
"boxCode"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"text"
@
click=
"handleViewSIZE(scope.row)"
>
SIZE明细
</el-button>
</
template
>
</el-table-column>
</el-table>
<pagination
v-show=
"total>0"
:total=
"total"
:page
.
sync=
"queryParams.pageNum"
:limit
.
sync=
"queryParams.pageSize"
@
pagination=
"getList"
/>
<!-- 添加或修改生产领料单头对话框 -->
<el-dialog
:title=
"title"
:visible
.
sync=
"openSIZE"
width=
"960px"
append-to-body
>
<el-card
shadow=
"always"
class=
"box-card"
>
<Issueline
ref=
"line"
:sizeItems=
"sizeItems"
></Issueline>
</el-card>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</div>
</el-dialog>
<el-dialog
:title=
"title"
:visible
.
sync=
"open"
width=
"960px"
append-to-body
>
<el-form
ref=
"form"
:model=
"form"
label-width=
"100px"
>
<el-row>
<el-col
:span=
"8"
>
<el-form-item
label=
"工作中心"
prop=
"workstation_name"
>
<el-input
v-model=
"form.workstation_name"
placeholder=
""
disabled
/>
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
"工作单元"
prop=
"workunit_name"
>
<el-input
v-model=
"form.workunit_name"
placeholder=
""
disabled
/>
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
"报工人员"
prop=
"create_by"
>
<el-input
v-model=
"form.create_by"
placeholder=
""
disabled
/>
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
"标准工时"
prop=
"std_working_time"
>
<el-input
v-model=
"form.std_working_time"
placeholder=
""
disabled
/>
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
"实际工时"
prop=
"machine_time"
>
<el-input
v-model=
"form.machine_time"
placeholder=
""
disabled
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"报工时间"
prop=
"create_time"
>
<el-date-picker
clearable
v-model=
"form.create_time"
disabled
type=
"date"
value-format=
"yyyy-MM-dd"
placeholder=
""
>
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</div>
</el-dialog>
</div>
</template>
<
script
>
import
{
getplbl
}
from
"@/api/mes/proTable/productSee"
;
import
{
getTreeList
}
from
"@/api/mes/wm/warehouse"
import
dayjs
from
'dayjs'
import
Issueline
from
"./line.vue"
;
export
default
{
name
:
"Issueheader"
,
dicts
:
[
'mes_order_status'
],
components
:
{
Issueline
},
data
()
{
return
{
warehouseInfo
:[],
warehouseOptions
:[],
warehouseProps
:{
multiple
:
false
,
value
:
'pId'
,
label
:
'pName'
,
},
// 遮罩层
loading
:
true
,
// 选中数组
ids
:
[],
// 非单个禁用
single
:
true
,
// 非多个禁用
multiple
:
true
,
// 显示搜索条件
showSearch
:
true
,
// 总条数
total
:
0
,
// 生产领料单头表格数据
tbodys
:
[],
daterangePurchaseDate
:
[
dayjs
().
subtract
(
7
,
'day'
).
format
(
'YYYY-MM-DD'
),
dayjs
().
format
(
'YYYY-MM-DD'
)],
// 弹出层标题
title
:
""
,
// 是否显示弹出层
open
:
false
,
openSIZE
:
false
,
// 查询参数
queryParams
:
{
pageNum
:
1
,
pageSize
:
10
,
warehouse
:
null
,
issueCode
:
null
,
issueName
:
null
,
workstationId
:
null
,
workstationCode
:
null
,
workorderId
:
null
,
workorderCode
:
null
,
taskId
:
null
,
taskCode
:
null
,
locationId
:
null
,
locationCode
:
null
,
locationName
:
null
,
areaId
:
null
,
areaCode
:
null
,
areaName
:
null
,
issueDate
:
null
,
salesVoucher
:
null
,
workorderCodes
:
null
,
arrangeCodes
:
null
,
salesVoucherItem
:
null
,
barcode
:
null
},
sizeItems
:
[],
// 表单参数
form
:
{
feedback
:
{},
sizeItems
:
[]
}
};
},
created
()
{
this
.
getList
();
this
.
getWarehouseList
();
},
methods
:
{
/** 查询生产领料单头列表 */
getList
()
{
this
.
loading
=
true
;
this
.
queryParams
.
params
=
{};
if
(
null
!=
this
.
daterangePurchaseDate
&&
''
!=
this
.
daterangePurchaseDate
)
{
this
.
queryParams
.
params
[
"beginPurchaseDate"
]
=
this
.
daterangePurchaseDate
[
0
];
this
.
queryParams
.
params
[
"endPurchaseDate"
]
=
this
.
daterangePurchaseDate
[
1
];
}
const
params
=
{
...
this
.
queryParams
,
workorderCodes
:
this
.
queryParams
.
workorderCodes
?
this
.
queryParams
.
workorderCodes
.
split
(
/
[\n
,;,、;。
]
/
).
filter
(
item
=>
item
)
:
null
,
arrangeCodes
:
this
.
queryParams
.
arrangeCodes
?
this
.
queryParams
.
arrangeCodes
.
split
(
/
[\n
,;,、;。
]
/
).
filter
(
item
=>
item
)
:
null
,
}
getplbl
(
params
).
then
(
response
=>
{
this
.
tbodys
=
response
.
rows
;
this
.
total
=
response
.
total
;
this
.
loading
=
false
;
});
},
getWarehouseList
(){
getTreeList
().
then
(
response
=>
{
if
(
response
.
data
){
this
.
warehouseOptions
=
response
.
data
.
filter
((
el
)
=>
{
return
el
.
warehouseCode
.
indexOf
(
'VIR'
)
==
-
1
;
});;
}
this
.
warehouseOptions
.
map
(
w
=>
{
w
.
children
.
map
(
l
=>
{
let
lstr
=
JSON
.
stringify
(
l
.
children
).
replace
(
/locationId/g
,
'lId'
).
replace
(
/areaId/g
,
'pId'
).
replace
(
/areaName/g
,
'pName'
);
l
.
children
=
JSON
.
parse
(
lstr
);
});
let
wstr
=
JSON
.
stringify
(
w
.
children
).
replace
(
/warehouseId/g
,
'wId'
).
replace
(
/locationId/g
,
'pId'
).
replace
(
/locationName/g
,
'pName'
);
w
.
children
=
JSON
.
parse
(
wstr
);
});
let
ostr
=
JSON
.
stringify
(
this
.
warehouseOptions
).
replace
(
/warehouseId/g
,
'pId'
).
replace
(
/warehouseName/g
,
'pName'
);
this
.
warehouseOptions
=
JSON
.
parse
(
ostr
);
});
},
// 取消按钮
cancel
()
{
this
.
open
=
false
;
this
.
openSIZE
=
false
this
.
reset
();
},
// 表单重置
reset
()
{
this
.
form
=
{
issueId
:
null
,
issueCode
:
null
,
issueName
:
null
,
workstationId
:
null
,
workstationCode
:
null
,
workstationName
:
null
,
workorderId
:
null
,
workorderCode
:
null
,
workorderName
:
null
,
clientId
:
null
,
clientCode
:
null
,
clientName
:
null
,
taskId
:
null
,
taskCode
:
null
,
warehouseId
:
null
,
warehouseCode
:
null
,
warehouseName
:
null
,
locationId
:
null
,
locationCode
:
null
,
locationName
:
null
,
areaId
:
null
,
areaCode
:
null
,
areaName
:
null
,
issueDate
:
new
Date
(),
remark
:
null
,
attr1
:
null
,
attr2
:
null
,
attr3
:
null
,
attr4
:
null
,
createBy
:
null
,
createTime
:
null
,
updateBy
:
null
,
updateTime
:
null
,
salesVoucher
:
null
,
workorderCodes
:
null
,
arrangeCodes
:
null
,
salesVoucherItem
:
null
,
barcode
:
null
,
feedback
:
{
workstation_name
:
''
,
workunit_name
:
''
,
create_by
:
''
,
std_working_time
:
''
,
machine_time
:
''
,
create_time
:
''
},
sizeItems
:
[]
};
},
/** 搜索按钮操作 */
handleQuery
()
{
this
.
queryParams
.
pageNum
=
1
;
this
.
getList
();
},
/** 重置按钮操作 */
resetQuery
()
{
this
.
daterangePurchaseDate
=
[];
this
.
resetForm
(
"queryForm"
);
this
.
handleQuery
();
},
// 多选框选中数据
handleSelectionChange
(
selection
)
{
this
.
ids
=
selection
.
map
(
item
=>
item
.
recordId
)
this
.
single
=
selection
.
length
!==
1
this
.
multiple
=
!
selection
.
length
},
// 查询明细按钮操作
handleViewSIZE
(
row
){
if
(
!
row
.
sizeItems
)
{
this
.
sizeItems
=
[]
}
else
{
this
.
sizeItems
=
row
.
sizeItems
}
this
.
openSIZE
=
true
;
this
.
title
=
"查看SIZE明细"
;
},
handleView
(
row
){
if
(
!
row
.
feedback
)
{
this
.
form
=
{
workstation_name
:
''
,
workunit_name
:
''
,
create_by
:
''
,
std_working_time
:
''
,
machine_time
:
''
,
create_time
:
''
}
}
else
{
this
.
form
=
row
.
feedback
}
this
.
open
=
true
;
this
.
title
=
"查看"
;
},
/** 导出按钮操作 */
handleExport
()
{
let
params
=
{}
if
(
this
.
ids
&&
this
.
ids
.
length
>
0
)
{
params
[
'recordIds'
]
=
this
.
ids
.
join
(
','
)
}
else
{
this
.
queryParams
.
params
=
{};
if
(
null
!=
this
.
daterangePurchaseDate
&&
''
!=
this
.
daterangePurchaseDate
)
{
this
.
queryParams
.
params
[
"beginPurchaseDate"
]
=
this
.
daterangePurchaseDate
[
0
];
this
.
queryParams
.
params
[
"endPurchaseDate"
]
=
this
.
daterangePurchaseDate
[
1
];
}
params
=
{
...
this
.
queryParams
,
workorderCodes
:
this
.
queryParams
.
workorderCodes
?
this
.
queryParams
.
workorderCodes
.
split
(
/
[\n
,;,、;。
]
/
).
filter
(
item
=>
item
)
:
null
,
arrangeCodes
:
this
.
queryParams
.
arrangeCodes
?
this
.
queryParams
.
arrangeCodes
.
split
(
/
[\n
,;,、;。
]
/
).
filter
(
item
=>
item
)
:
null
,
}
}
this
.
download2
(
'report/pro/tracedback/export'
,
{
params
:
params
},
`tracedback_
${
new
Date
().
getTime
()}
.xlsx`
)
}
}
};
</
script
>
\ No newline at end of file
src/views/mes/proTable/productSee/line.vue
0 → 100644
View file @
68a58609
<
template
>
<div
class=
"app-container"
>
<el-table
:data=
"sizeItems"
>
<el-table-column
label=
"SIZE码"
width=
"120px"
align=
"center"
prop=
"workorderSoSizeItemId"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"指令数"
align=
"center"
prop=
"quantity"
/>
<el-table-column
label=
"LOSS数"
align=
"center"
prop=
"lossNum"
/>
<el-table-column
label=
"样品数"
align=
"center"
prop=
"samples"
/>
</el-table>
</div>
</
template
>
<
script
>
import
{
getIssueline
,
delIssueline
,
addIssueline
,
updateIssueline
}
from
"@/api/mes/wm/issueline"
;
export
default
{
name
:
"Issueline"
,
props
:{
sizeItems
:
null
},
data
()
{
return
{
// 遮罩层
loading
:
true
,
// 选中数组
ids
:
[],
// 非单个禁用
single
:
true
,
// 非多个禁用
multiple
:
true
,
// 显示搜索条件
showSearch
:
true
,
// 总条数
total
:
0
,
// 生产领料单行表格数据
issuelineList
:
[],
// 弹出层标题
title
:
""
,
// 是否显示弹出层
open
:
false
,
// 查询参数
queryParams
:
{
pageNum
:
1
,
pageSize
:
10
,
issueId
:
this
.
issueId
,
itemId
:
null
,
itemCode
:
null
,
itemName
:
null
,
specification
:
null
,
unitOfMeasure
:
null
,
quantityIssued
:
null
,
batchCode
:
null
,
warehouseId
:
null
,
warehouseCode
:
null
,
warehouseName
:
null
,
locationId
:
null
,
locationCode
:
null
,
locationName
:
null
,
areaId
:
null
,
areaCode
:
null
,
areaName
:
null
,
},
// 表单参数
form
:
{},
// 表单校验
rules
:
{
itemId
:
[
{
required
:
true
,
message
:
"产品物料不能为空"
,
trigger
:
"blur"
}
],
quantityIssued
:
[
{
required
:
true
,
message
:
"领料数量不能为空"
,
trigger
:
"blur"
}
],
}
};
},
watch
:{
sizeItems
()
{
console
.
log
(
'this.sizeItems'
,
this
.
sizeItems
)
}
},
created
()
{
},
methods
:
{
// 取消按钮
cancel
()
{
this
.
open
=
false
;
this
.
reset
();
},
// 表单重置
reset
()
{
this
.
form
=
{
lineId
:
null
,
issueId
:
this
.
issueId
,
itemId
:
null
,
itemCode
:
null
,
itemName
:
null
,
specification
:
null
,
unitOfMeasure
:
null
,
quantityIssued
:
null
,
batchCode
:
null
,
warehouseId
:
null
,
warehouseCode
:
null
,
warehouseName
:
null
,
locationId
:
null
,
locationCode
:
null
,
locationName
:
null
,
areaId
:
null
,
areaCode
:
null
,
areaName
:
null
,
remark
:
null
,
attr1
:
null
,
attr2
:
null
,
attr3
:
null
,
attr4
:
null
,
createBy
:
null
,
createTime
:
null
,
updateBy
:
null
,
updateTime
:
null
};
this
.
resetForm
(
"form"
);
},
/** 搜索按钮操作 */
handleQuery
()
{
this
.
queryParams
.
pageNum
=
1
;
this
.
getList
();
},
/** 重置按钮操作 */
resetQuery
()
{
this
.
resetForm
(
"queryForm"
);
this
.
handleQuery
();
},
// 多选框选中数据
handleSelectionChange
(
selection
)
{
this
.
ids
=
selection
.
map
(
item
=>
item
.
lineId
)
this
.
single
=
selection
.
length
!==
1
this
.
multiple
=
!
selection
.
length
},
getSummaries
(
param
){
const
{
columns
,
data
}
=
param
const
sums
=
[]
columns
.
forEach
((
column
,
index
)
=>
{
if
(
index
===
1
)
{
sums
[
index
]
=
'总数量'
}
else
if
(
column
.
label
===
'领料数量'
)
{
const
temp
=
data
.
reduce
((
prev
,
curr
)
=>
{
return
prev
+
Number
(
curr
.
quantityIssued
);
},
0
)
sums
[
index
]
=
Number
.
isInteger
(
temp
)
?
temp
:
temp
.
toFixed
(
3
);
}
else
{
sums
[
index
]
=
''
}
})
return
sums
},
/** 新增按钮操作 */
handleAdd
()
{
this
.
reset
();
this
.
open
=
true
;
this
.
title
=
"添加生产领料单行"
;
},
/** 修改按钮操作 */
handleUpdate
(
row
)
{
this
.
reset
();
const
lineId
=
row
.
lineId
||
this
.
ids
getIssueline
(
lineId
).
then
(
response
=>
{
debugger
;
this
.
form
=
response
.
data
;
this
.
open
=
true
;
this
.
title
=
"修改生产领料单行"
;
});
},
/** 提交按钮 */
submitForm
()
{
this
.
$refs
[
"form"
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
this
.
form
.
lineId
!=
null
)
{
updateIssueline
(
this
.
form
).
then
(
response
=>
{
this
.
$modal
.
msgSuccess
(
"修改成功"
);
this
.
open
=
false
;
this
.
getList
();
});
}
else
{
addIssueline
(
this
.
form
).
then
(
response
=>
{
this
.
$modal
.
msgSuccess
(
"新增成功"
);
this
.
open
=
false
;
this
.
getList
();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete
(
row
)
{
const
lineIds
=
row
.
lineId
||
this
.
ids
;
this
.
$modal
.
confirm
(
'是否确认删除生产领料单行编号为"'
+
lineIds
+
'"的数据项?'
).
then
(
function
()
{
return
delIssueline
(
lineIds
);
}).
then
(()
=>
{
this
.
getList
();
this
.
$modal
.
msgSuccess
(
"删除成功"
);
}).
catch
(()
=>
{});
},
handleSelectStock
(){
this
.
$refs
.
stockSelect
.
showFlag
=
true
;
this
.
$refs
.
stockSelect
.
getList
();
},
//物料选择弹出框
onStockSelected
(
obj
){
if
(
obj
!=
undefined
&&
obj
!=
null
){
this
.
form
.
materialStockId
=
obj
.
materialStockId
;
this
.
form
.
itemId
=
obj
.
itemId
;
this
.
form
.
itemCode
=
obj
.
itemCode
;
this
.
form
.
itemName
=
obj
.
itemName
;
this
.
form
.
specification
=
obj
.
specification
;
this
.
form
.
unitOfMeasure
=
obj
.
unitOfMeasure
;
this
.
form
.
batchCode
=
obj
.
batchCode
;
this
.
form
.
warehouseId
=
obj
.
warehouseId
;
this
.
form
.
warehouseCode
=
obj
.
warehouseCode
;
this
.
form
.
warehouseName
=
obj
.
warehouseName
;
this
.
form
.
locationId
=
obj
.
locationId
;
this
.
form
.
locationCode
=
obj
.
locationCode
;
this
.
form
.
locationName
=
obj
.
locationName
;
this
.
form
.
areaId
=
obj
.
areaId
;
this
.
form
.
areaCode
=
obj
.
areaCode
;
this
.
form
.
areaName
=
obj
.
areaName
;
this
.
form
.
quantityIssued
=
obj
.
quantityOnhand
;
this
.
form
.
quantityMax
=
obj
.
quantityOnhand
;
}
},
/** 导出按钮操作 */
handleExport
()
{
this
.
download
(
'wm/issueline/export'
,
{
...
this
.
queryParams
},
`issueline_
${
new
Date
().
getTime
()}
.xlsx`
)
}
}
};
</
script
>
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