Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
pda-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
pda
pda-ui
Commits
74f05069
Commit
74f05069
authored
Feb 24, 2024
by
李驰骋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
工单状态调整
parent
ac70517b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
509 additions
and
509 deletions
+509
-509
indexApply.vue
src/views/mes/pro/workorder/indexApply.vue
+509
-509
No files found.
src/views/mes/pro/workorder/indexApply.vue
View file @
74f05069
...
@@ -18,13 +18,13 @@
...
@@ -18,13 +18,13 @@
</el-form-item>
-->
</el-form-item>
-->
<el-form-item
label=
"状态"
prop=
"status"
>
<el-form-item
label=
"状态"
prop=
"status"
>
<el-select
value=
"['','']"
<el-select
value=
"['','']"
v-model=
"queryParams.statusArr"
v-model=
"queryParams.statusArr"
clearable
clearable
placeholder=
"请选择状态"
placeholder=
"请选择状态"
multiple=
"true"
multiple=
"true"
>
>
<el-option
<el-option
v-for=
"dict in dict.type.mes_order_status"
v-for=
"dict in dict.type.mes_
work
order_status"
:key=
"dict.value"
:key=
"dict.value"
:label=
"dict.label"
:label=
"dict.label"
:value=
"dict.value"
:value=
"dict.value"
...
@@ -106,10 +106,10 @@
...
@@ -106,10 +106,10 @@
icon=
"el-icon-search"
icon=
"el-icon-search"
size=
"mini"
size=
"mini"
@
click=
"handleQuery"
@
click=
"handleQuery"
>
搜索
</el-button
>
搜索
</el-button
>
>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button
>
重置
</el-button
>
>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
...
@@ -123,7 +123,7 @@
...
@@ -123,7 +123,7 @@
size=
"mini"
size=
"mini"
@
click=
"handleAdd"
@
click=
"handleAdd"
v-hasPermi=
"['mes:pro:workorder:add']"
v-hasPermi=
"['mes:pro:workorder:add']"
>
新增
</el-button
>
新增
</el-button
>
>
</el-col>
</el-col>
<el-col
:span=
"1.5"
>
<el-col
:span=
"1.5"
>
...
@@ -135,7 +135,7 @@
...
@@ -135,7 +135,7 @@
:disabled=
"single"
:disabled=
"single"
@
click=
"handleUpdate"
@
click=
"handleUpdate"
v-hasPermi=
"['mes:pro:workorder:edit']"
v-hasPermi=
"['mes:pro:workorder:edit']"
>
修改
</el-button
>
修改
</el-button
>
>
</el-col>
</el-col>
<el-col
:span=
"1.5"
>
<el-col
:span=
"1.5"
>
...
@@ -147,7 +147,7 @@
...
@@ -147,7 +147,7 @@
:disabled=
"multiple"
:disabled=
"multiple"
@
click=
"handleDelete"
@
click=
"handleDelete"
v-hasPermi=
"['mes:pro:workorder:remove']"
v-hasPermi=
"['mes:pro:workorder:remove']"
>
删除
</el-button
>
删除
</el-button
>
>
</el-col>
</el-col>
<el-col
:span=
"1.5"
>
<el-col
:span=
"1.5"
>
...
@@ -158,7 +158,7 @@
...
@@ -158,7 +158,7 @@
size=
"mini"
size=
"mini"
@
click=
"handleExport"
@
click=
"handleExport"
v-hasPermi=
"['mes:pro:workorder:export']"
v-hasPermi=
"['mes:pro:workorder:export']"
>
导出
</el-button
>
导出
</el-button
>
>
</el-col>
</el-col>
<el-col
:span=
"1.5"
>
<el-col
:span=
"1.5"
>
...
@@ -191,7 +191,7 @@
...
@@ -191,7 +191,7 @@
size=
"mini"
size=
"mini"
@
click=
"handleImport"
@
click=
"handleImport"
v-hasPermi=
"['mes:pro:workorder:edit']"
v-hasPermi=
"['mes:pro:workorder:edit']"
>
导入工单
</el-button
>
导入工单
</el-button
>
>
</el-col>
</el-col>
<right-toolbar
<right-toolbar
...
@@ -223,7 +223,7 @@
...
@@ -223,7 +223,7 @@
:underline=
"false"
:underline=
"false"
style=
"font-size: 12px; vertical-align: baseline"
style=
"font-size: 12px; vertical-align: baseline"
@
click=
"importTemplate"
@
click=
"importTemplate"
>
下载模板
</el-link
>
下载模板
</el-link
>
>
</div>
</div>
</el-upload>
</el-upload>
...
@@ -250,7 +250,7 @@
...
@@ -250,7 +250,7 @@
type=
"text"
type=
"text"
@
click=
"handleView(scope.row)"
@
click=
"handleView(scope.row)"
v-hasPermi=
"['mes:pro:workorder:query']"
v-hasPermi=
"['mes:pro:workorder:query']"
>
{{
scope
.
row
.
workorderCode
}}
</el-button
>
{{
scope
.
row
.
workorderCode
}}
</el-button
>
>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
...
@@ -370,7 +370,7 @@
...
@@ -370,7 +370,7 @@
v
-
if
=
"scope.row.status == 'PREPARE'"
v
-
if
=
"scope.row.status == 'PREPARE'"
@
click
=
"handleUpdate(scope.row)"
@
click
=
"handleUpdate(scope.row)"
v
-
hasPermi
=
"['mes:pro:workorder:edit']"
v
-
hasPermi
=
"['mes:pro:workorder:edit']"
>
修改
<
/el-butto
n
>
修改
<
/el-butto
n
>
>
<
el
-
button
<
el
-
button
size
=
"mini"
size
=
"mini"
...
@@ -379,7 +379,7 @@
...
@@ -379,7 +379,7 @@
v
-
if
=
"scope.row.status == 'PREPARE'"
v
-
if
=
"scope.row.status == 'PREPARE'"
@
click
=
"handleDelete(scope.row)"
@
click
=
"handleDelete(scope.row)"
v
-
hasPermi
=
"['mes:pro:workorder:remove']"
v
-
hasPermi
=
"['mes:pro:workorder:remove']"
>
删除
<
/el-butto
n
>
删除
<
/el-butto
n
>
>
<!--
<
el
-
button
<!--
<
el
-
button
size
=
"mini"
size
=
"mini"
...
@@ -467,7 +467,7 @@
...
@@ -467,7 +467,7 @@
v
-
for
=
"dict in dict.type.mes_workorder_sourcetype"
v
-
for
=
"dict in dict.type.mes_workorder_sourcetype"
:
key
=
"dict.value"
:
key
=
"dict.value"
:
label
=
"dict.value"
:
label
=
"dict.value"
>
{{
dict
.
label
}}
<
/el-radi
o
>
{{
dict
.
label
}}
<
/el-radi
o
>
>
<
/el-radio-group
>
<
/el-radio-group
>
<
el
-
radio
-
group
v
-
model
=
"form.orderSource"
v
-
else
>
<
el
-
radio
-
group
v
-
model
=
"form.orderSource"
v
-
else
>
...
@@ -475,7 +475,7 @@
...
@@ -475,7 +475,7 @@
v
-
for
=
"dict in dict.type.mes_workorder_sourcetype"
v
-
for
=
"dict in dict.type.mes_workorder_sourcetype"
:
key
=
"dict.value"
:
key
=
"dict.value"
:
label
=
"dict.value"
:
label
=
"dict.value"
>
{{
dict
.
label
}}
<
/el-radi
o
>
{{
dict
.
label
}}
<
/el-radi
o
>
>
<
/el-radio-group
>
<
/el-radio-group
>
<
/el-form-item
>
<
/el-form-item
>
...
@@ -671,13 +671,13 @@
...
@@ -671,13 +671,13 @@
type
=
"primary"
type
=
"primary"
@
click
=
"cancel"
@
click
=
"cancel"
v
-
if
=
"optType == 'view' || form.status != 'PREPARE'"
v
-
if
=
"optType == 'view' || form.status != 'PREPARE'"
>
返回
<
/el-butto
n
>
返回
<
/el-butto
n
>
>
<
el
-
button
<
el
-
button
type
=
"primary"
type
=
"primary"
@
click
=
"submitForm"
@
click
=
"submitForm"
v
-
if
=
"form.status == 'PREPARE' && optType != 'view'"
v
-
if
=
"form.status == 'PREPARE' && optType != 'view'"
>
保
存
<
/el-butto
n
>
保
存
<
/el-butto
n
>
>
<
el
-
button
<
el
-
button
type
=
"success"
type
=
"success"
...
@@ -687,7 +687,7 @@
...
@@ -687,7 +687,7 @@
optType != 'view' &&
optType != 'view' &&
form.workorderId != null
form.workorderId != null
"
"
>
确
认
<
/el-butto
n
>
确
认
<
/el-butto
n
>
>
<
el
-
button
@
click
=
"cancel"
>
取
消
<
/el-button
>
<
el
-
button
@
click
=
"cancel"
>
取
消
<
/el-button
>
<
/div
>
<
/div
>
...
@@ -696,506 +696,506 @@
...
@@ -696,506 +696,506 @@
<
/template
>
<
/template
>
<
script
>
<
script
>
import
{
import
{
listWorkorder
,
listWorkorder
,
getWorkorder
,
getWorkorder
,
delWorkorder
,
delWorkorder
,
addWorkorder
,
addWorkorder
,
updateWorkorder
,
updateWorkorder
,
dofinish
,
dofinish
,
doCheckToolNum
doCheckToolNum
}
from
"@/api/mes/pro/workorder"
;
}
from
"@/api/mes/pro/workorder"
;
import
{
addProtaskList
}
from
"@/api/mes/pro/protask"
;
import
{
addProtaskList
}
from
"@/api/mes/pro/protask"
;
import
Workorderbom
from
"./bom/bom.vue"
;
import
Workorderbom
from
"./bom/bom.vue"
;
import
WorkorderItemList
from
"./items/item.vue"
;
import
WorkorderItemList
from
"./items/item.vue"
;
import
ItemSelect
from
"@/components/itemSelect/single.vue"
;
import
ItemSelect
from
"@/components/itemSelect/single.vue"
;
import
ClientSelect
from
"@/components/clientSelect/single.vue"
;
import
ClientSelect
from
"@/components/clientSelect/single.vue"
;
import
VendorSelect
from
"@/components/vendorSelect/single.vue"
;
import
VendorSelect
from
"@/components/vendorSelect/single.vue"
;
import
{
genCode
}
from
"@/api/system/autocode/rule"
;
import
{
genCode
}
from
"@/api/system/autocode/rule"
;
import
Treeselect
from
"@riophae/vue-treeselect"
;
import
Treeselect
from
"@riophae/vue-treeselect"
;
import
"@riophae/vue-treeselect/dist/vue-treeselect.css"
;
import
"@riophae/vue-treeselect/dist/vue-treeselect.css"
;
import
{
getToken
}
from
"@/utils/auth"
;
import
{
getToken
}
from
"@/utils/auth"
;
export
default
{
export
default
{
name
:
"Workorder"
,
name
:
"Workorder"
,
dicts
:
[
dicts
:
[
"mes_workorder_status"
,
"mes_workorder_status"
,
"mes_workorder_sourcetype"
,
"mes_workorder_sourcetype"
,
"mes_workorder_type"
,
"mes_workorder_type"
,
],
],
components
:
{
components
:
{
Treeselect
,
Treeselect
,
ItemSelect
,
ItemSelect
,
ClientSelect
,
ClientSelect
,
VendorSelect
,
VendorSelect
,
Workorderbom
,
Workorderbom
,
WorkorderItemList
,
WorkorderItemList
,
}
,
}
,
data
()
{
data
()
{
return
{
return
{
//自动生成编码
//自动生成编码
autoGenFlag
:
false
,
autoGenFlag
:
false
,
optType
:
undefined
,
optType
:
undefined
,
// 遮罩层
// 遮罩层
loading
:
true
,
loading
:
true
,
// 显示搜索条件
// 显示搜索条件
showSearch
:
true
,
showSearch
:
true
,
// 非单个禁用
// 非单个禁用
single
:
true
,
single
:
true
,
// 总条数
// 总条数
total
:
0
,
total
:
0
,
// 非多个禁用
// 非多个禁用
multiple
:
true
,
multiple
:
true
,
// 生产工单表格数据
// 生产工单表格数据
workorderList
:
[],
workorderList
:
[],
// 生产工单树选项
// 生产工单树选项
workorderOptions
:
[],
workorderOptions
:
[],
selectedRows
:
[],
selectedRows
:
[],
// 弹出层标题
// 弹出层标题
title
:
""
,
// 是否显示弹出层
open
:
false
,
upload
:
{
// 是否显示弹出层(用户导入)
open
:
false
,
// 弹出层标题(用户导入)
title
:
""
,
title
:
""
,
// 是否禁用上传
// 是否显示弹出层
isUploading
:
false
,
open
:
false
,
// 是否更新已经存在的用户数据
upload
:
{
updateSupport
:
0
,
// 是否显示弹出层(用户导入)
// 设置上传的请求头部
open
:
false
,
headers
:
{
Authorization
:
"Bearer "
+
getToken
()
}
,
// 弹出层标题(用户导入)
// 上传的地址
title
:
""
,
url
:
process
.
env
.
VUE_APP_BASE_API
+
"/mes/pro/workorder/importData"
,
// 是否禁用上传
isUploading
:
false
,
// 是否更新已经存在的用户数据
updateSupport
:
0
,
// 设置上传的请求头部
headers
:
{
Authorization
:
"Bearer "
+
getToken
()
}
,
// 上传的地址
url
:
process
.
env
.
VUE_APP_BASE_API
+
"/mes/pro/workorder/importData"
,
}
,
// 查询参数
queryParams
:
{
pageNum
:
1
,
pageSize
:
10
,
workorderCode
:
null
,
workorderName
:
null
,
orderSource
:
null
,
sourceCode
:
null
,
productId
:
null
,
productCode
:
null
,
productName
:
null
,
productSpc
:
null
,
routeName
:
null
,
unitOfMeasure
:
null
,
quantity
:
null
,
quantityProduced
:
null
,
quantityChanged
:
null
,
quantityScheduled
:
null
,
clientId
:
null
,
clientCode
:
null
,
clientName
:
null
,
requestDate
:
null
,
parentId
:
null
,
ancestors
:
null
,
statusArr
:
[
"PREPARE"
,
"ORCHESTRATED"
],
}
,
// 表单参数
form
:
{
}
,
// 表单校验
rules
:
{
workorderCode
:
[
{
required
:
true
,
message
:
"工单编码不能为空"
,
trigger
:
"blur"
}
,
],
workorderName
:
[
{
required
:
true
,
message
:
"工单名称不能为空"
,
trigger
:
"blur"
}
,
],
workorderType
:
[
{
required
:
true
,
message
:
"请选择生产工单类型"
,
trigger
:
"blur"
}
,
],
orderSource
:
[
{
required
:
true
,
message
:
"来源类型不能为空"
,
trigger
:
"blur"
}
,
],
productId
:
[
{
required
:
true
,
message
:
"产品不能为空"
,
trigger
:
"blur"
}
,
],
productCode
:
[
{
required
:
true
,
message
:
"产品编号不能为空"
,
trigger
:
"blur"
}
,
],
productName
:
[
{
required
:
true
,
message
:
"产品名称不能为空"
,
trigger
:
"blur"
}
,
],
quantity
:
[
{
required
:
true
,
message
:
"生产数量不能为空"
,
trigger
:
"blur"
}
,
],
requestDate
:
[
{
required
:
true
,
message
:
"需求日期不能为空"
,
trigger
:
"blur"
}
,
],
}
,
}
;
}
,
created
()
{
this
.
getList
();
}
,
methods
:
{
/** 查询生产工单列表 */
getList
()
{
this
.
loading
=
true
;
listWorkorder
(
this
.
queryParams
).
then
((
response
)
=>
{
this
.
workorderList
=
this
.
handleTree
(
response
.
rows
,
"workorderId"
,
"parentId"
);
this
.
total
=
response
.
total
;
this
.
loading
=
false
;
}
);
}
,
importTemplate
()
{
this
.
download
(
"mes/pro/workorder/importTemplate"
,
{
}
,
`work_order_template_${new Date().getTime()
}
.xlsx`
);
}
,
}
,
// 查询参数
/** 导入按钮操作 */
queryParams
:
{
handleImport
()
{
pageNum
:
1
,
this
.
upload
.
open
=
true
;
pageSize
:
10
,
workorderCode
:
null
,
workorderName
:
null
,
orderSource
:
null
,
sourceCode
:
null
,
productId
:
null
,
productCode
:
null
,
productName
:
null
,
productSpc
:
null
,
routeName
:
null
,
unitOfMeasure
:
null
,
quantity
:
null
,
quantityProduced
:
null
,
quantityChanged
:
null
,
quantityScheduled
:
null
,
clientId
:
null
,
clientCode
:
null
,
clientName
:
null
,
requestDate
:
null
,
parentId
:
null
,
ancestors
:
null
,
statusArr
:
[
"PREPARE"
,
"CONFIRMED"
],
}
,
}
,
// 表单参数
// 文件上传中处理
form
:
{
}
,
handleFileUploadProgress
(
event
,
file
,
fileList
)
{
// 表单校验
this
.
upload
.
isUploading
=
true
;
rules
:
{
workorderCode
:
[
{
required
:
true
,
message
:
"工单编码不能为空"
,
trigger
:
"blur"
}
,
],
workorderName
:
[
{
required
:
true
,
message
:
"工单名称不能为空"
,
trigger
:
"blur"
}
,
],
workorderType
:
[
{
required
:
true
,
message
:
"请选择生产工单类型"
,
trigger
:
"blur"
}
,
],
orderSource
:
[
{
required
:
true
,
message
:
"来源类型不能为空"
,
trigger
:
"blur"
}
,
],
productId
:
[
{
required
:
true
,
message
:
"产品不能为空"
,
trigger
:
"blur"
}
,
],
productCode
:
[
{
required
:
true
,
message
:
"产品编号不能为空"
,
trigger
:
"blur"
}
,
],
productName
:
[
{
required
:
true
,
message
:
"产品名称不能为空"
,
trigger
:
"blur"
}
,
],
quantity
:
[
{
required
:
true
,
message
:
"生产数量不能为空"
,
trigger
:
"blur"
}
,
],
requestDate
:
[
{
required
:
true
,
message
:
"需求日期不能为空"
,
trigger
:
"blur"
}
,
],
}
,
}
,
}
;
// 文件上传成功处理
}
,
handleFileSuccess
(
response
,
file
,
fileList
)
{
created
()
{
this
.
upload
.
open
=
false
;
this
.
getList
();
this
.
upload
.
isUploading
=
false
;
}
,
this
.
$refs
.
upload
.
clearFiles
();
methods
:
{
this
.
$alert
(
/** 查询生产工单列表 */
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>"
+
getList
()
{
this
.
loading
=
true
;
listWorkorder
(
this
.
queryParams
).
then
((
response
)
=>
{
this
.
workorderList
=
this
.
handleTree
(
response
.
rows
,
"workorderId"
,
"parentId"
);
this
.
total
=
response
.
total
;
this
.
loading
=
false
;
}
);
}
,
importTemplate
()
{
this
.
download
(
"mes/pro/workorder/importTemplate"
,
{
}
,
`work_order_template_${new Date().getTime()
}
.xlsx`
);
}
,
/** 导入按钮操作 */
handleImport
()
{
this
.
upload
.
open
=
true
;
}
,
// 文件上传中处理
handleFileUploadProgress
(
event
,
file
,
fileList
)
{
this
.
upload
.
isUploading
=
true
;
}
,
// 文件上传成功处理
handleFileSuccess
(
response
,
file
,
fileList
)
{
this
.
upload
.
open
=
false
;
this
.
upload
.
isUploading
=
false
;
this
.
$refs
.
upload
.
clearFiles
();
this
.
$alert
(
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>"
+
response
.
msg
+
response
.
msg
+
"</div>"
,
"</div>"
,
"导入结果"
,
"导入结果"
,
{
dangerouslyUseHTMLString
:
true
}
{
dangerouslyUseHTMLString
:
true
}
);
this
.
getList
();
}
,
// 提交上传文件
submitFileForm
()
{
this
.
$refs
.
upload
.
submit
();
}
,
/** 转换生产工单数据结构 */
normalizer
(
node
)
{
if
(
node
.
children
&&
!
node
.
children
.
length
)
{
delete
node
.
children
;
}
return
{
id
:
node
.
workorderId
,
label
:
node
.
workorderName
,
children
:
node
.
children
,
}
;
}
,
/** 查询生产工单下拉树结构 */
getTreeselect
()
{
listWorkorder
().
then
((
response
)
=>
{
this
.
workorderOptions
=
[];
const
data
=
{
workorderId
:
0
,
workorderName
:
"顶级节点"
,
children
:
[],
}
;
data
.
children
=
this
.
handleTree
(
response
.
data
,
"workorderId"
,
"parentId"
);
);
this
.
workorderOptions
.
push
(
data
);
this
.
getList
();
}
);
}
,
}
,
// 提交上传文件
// 取消按钮
submitFileForm
()
{
cancel
()
{
this
.
$refs
.
upload
.
submit
();
this
.
open
=
false
;
}
,
this
.
reset
();
/** 转换生产工单数据结构 */
}
,
normalizer
(
node
)
{
// 表单重置
if
(
node
.
children
&&
!
node
.
children
.
length
)
{
reset
()
{
delete
node
.
children
;
this
.
form
=
{
}
workorderId
:
null
,
return
{
workorderCode
:
null
,
id
:
node
.
workorderId
,
workorderName
:
null
,
label
:
node
.
workorderName
,
workorderType
:
"SELF"
,
children
:
node
.
children
,
orderSource
:
null
,
}
;
sourceCode
:
null
,
}
,
productId
:
null
,
/** 查询生产工单下拉树结构 */
productCode
:
null
,
getTreeselect
()
{
productName
:
null
,
listWorkorder
().
then
((
response
)
=>
{
productSpc
:
null
,
this
.
workorderOptions
=
[];
routeName
:
null
,
const
data
=
{
unitOfMeasure
:
null
,
workorderId
:
0
,
quantity
:
null
,
workorderName
:
"顶级节点"
,
quantityProduced
:
null
,
children
:
[],
quantityChanged
:
null
,
}
;
quantityScheduled
:
null
,
data
.
children
=
this
.
handleTree
(
clientId
:
null
,
response
.
data
,
clientCode
:
null
,
"workorderId"
,
clientName
:
null
,
"parentId"
vendorId
:
null
,
);
vendorCode
:
null
,
this
.
workorderOptions
.
push
(
data
);
vendorName
:
null
,
}
);
requestDate
:
null
,
}
,
parentId
:
null
,
// 取消按钮
status
:
"PREPARE"
,
cancel
()
{
remark
:
null
,
this
.
open
=
false
;
createBy
:
null
,
this
.
reset
();
createTime
:
null
,
}
,
updateBy
:
null
,
// 表单重置
updateTime
:
null
,
reset
()
{
}
;
this
.
form
=
{
this
.
autoGenFlag
=
false
;
workorderId
:
null
,
this
.
resetForm
(
"form"
);
workorderCode
:
null
,
}
,
workorderName
:
null
,
/** 搜索按钮操作 */
workorderType
:
"SELF"
,
handleQuery
()
{
orderSource
:
null
,
this
.
getList
();
sourceCode
:
null
,
}
,
productId
:
null
,
/** 重置按钮操作 */
productCode
:
null
,
resetQuery
()
{
productName
:
null
,
this
.
resetForm
(
"queryForm"
);
productSpc
:
null
,
this
.
handleQuery
();
routeName
:
null
,
}
,
unitOfMeasure
:
null
,
//从BOM行中直接新增
quantity
:
null
,
handleSubAdd
(
row
)
{
quantityProduced
:
null
,
this
.
open
=
false
;
quantityChanged
:
null
,
this
.
reset
();
quantityScheduled
:
null
,
this
.
getTreeselect
();
clientId
:
null
,
if
(
row
!=
null
&&
row
.
workorderId
)
{
clientCode
:
null
,
this
.
form
=
row
;
clientName
:
null
,
this
.
form
.
parentId
=
row
.
workorderId
;
vendorId
:
null
,
this
.
form
.
workorderId
=
null
;
vendorCode
:
null
,
this
.
form
.
workorderCode
=
null
;
vendorName
:
null
,
}
else
{
requestDate
:
null
,
this
.
form
.
parentId
=
0
;
parentId
:
null
,
}
status
:
"PREPARE"
,
this
.
open
=
true
;
remark
:
null
,
this
.
title
=
"添加生产工单"
;
createBy
:
null
,
this
.
optType
=
"add"
;
createTime
:
null
,
}
,
updateBy
:
null
,
/** 新增按钮操作 */
updateTime
:
null
,
handleAdd
(
row
)
{
}
;
this
.
getTreeselect
();
this
.
autoGenFlag
=
false
;
// 跳转到申请单界
this
.
resetForm
(
"form"
);
this
.
$router
.
push
(
"/mes/pro/workorder/apply"
);
}
,
return
;
/** 搜索按钮操作 */
// this.reset();
handleQuery
()
{
// this.getTreeselect();
this
.
getList
();
// if (row != null && row.workorderId)
{
}
,
// this.form.parentId = row.workorderId;
/** 重置按钮操作 */
// this.form.orderSource = row.orderSource;
resetQuery
()
{
// this.form.sourceCode = row.sourceCode;
this
.
resetForm
(
"queryForm"
);
// this.form.clientId = row.clientId;
this
.
handleQuery
();
// this.form.clientCode = row.clientCode;
}
,
// this.form.clientName = row.clientName;
//从BOM行中直接新增
//
}
else
{
handleSubAdd
(
row
)
{
// this.form.parentId = 0;
this
.
open
=
false
;
//
}
this
.
reset
();
// this.open = true;
this
.
getTreeselect
();
// this.title = "添加生产工单";
if
(
row
!=
null
&&
row
.
workorderId
)
{
// this.optType="add";
this
.
form
=
row
;
}
,
this
.
form
.
parentId
=
row
.
workorderId
;
// 查询明细按钮操作
this
.
form
.
workorderId
=
null
;
handleView
(
row
)
{
this
.
form
.
workorderCode
=
null
;
this
.
reset
();
}
else
{
this
.
getTreeselect
();
this
.
form
.
parentId
=
0
;
const
workorderId
=
row
.
workorderId
||
this
.
ids
;
}
this
.
$router
.
push
(
"/mes/pro/workorder/info?workorderId="
+
workorderId
);
this
.
open
=
true
;
this
.
title
=
"添加生产工单"
;
this
.
optType
=
"add"
;
}
,
/** 新增按钮操作 */
handleAdd
(
row
)
{
this
.
getTreeselect
();
// 跳转到申请单界
this
.
$router
.
push
(
"/mes/pro/workorder/apply"
);
return
;
// this.reset();
// this.getTreeselect();
// if (row != null && row.workorderId)
{
// this.form.parentId = row.workorderId;
// this.form.orderSource = row.orderSource;
// this.form.sourceCode = row.sourceCode;
// this.form.clientId = row.clientId;
// this.form.clientCode = row.clientCode;
// this.form.clientName = row.clientName;
//
}
else
{
// this.form.parentId = 0;
//
}
// this.open = true;
// this.title = "添加生产工单";
// this.optType="add";
}
,
// 查询明细按钮操作
handleView
(
row
)
{
this
.
reset
();
this
.
getTreeselect
();
const
workorderId
=
row
.
workorderId
||
this
.
ids
;
this
.
$router
.
push
(
"/mes/pro/workorder/info?workorderId="
+
workorderId
);
// this.reset();
// this.reset();
// this.getTreeselect();
// this.getTreeselect();
// const workorderId = row.workorderId || this.ids;
// const workorderId = row.workorderId || this.ids;
// getWorkorder(workorderId).then(response =>
{
// getWorkorder(workorderId).then(response =>
{
// this.form = response.data;
// this.form = response.data;
// this.open = true;
// this.open = true;
// this.title = "查看工单信息";
// this.title = "查看工单信息";
// this.optType = "view";
// this.optType = "view";
//
}
);
//
}
);
}
,
}
,
handleSelectionChange
(
val
)
{
handleSelectionChange
(
val
)
{
this
.
selectedRows
=
val
;
this
.
selectedRows
=
val
;
}
,
}
,
/** 修改按钮操作 */
/** 修改按钮操作 */
handleUpdate
(
row
)
{
handleUpdate
(
row
)
{
this
.
reset
();
this
.
reset
();
const
workorderId
=
row
.
workorderId
||
this
.
ids
;
const
workorderId
=
row
.
workorderId
||
this
.
ids
;
this
.
$router
.
push
(
"/mes/pro/workorder/edit?workorderId="
+
workorderId
);
this
.
$router
.
push
(
"/mes/pro/workorder/edit?workorderId="
+
workorderId
);
// this.reset();
// this.reset();
// this.getTreeselect();
// this.getTreeselect();
// if (row != null)
{
// if (row != null)
{
// this.form.parentId = row.workorderId;
// this.form.parentId = row.workorderId;
//
}
//
}
// getWorkorder(row.workorderId).then(response =>
{
// getWorkorder(row.workorderId).then(response =>
{
// this.form = response.data;
// this.form = response.data;
// this.open = true;
// this.open = true;
// this.title = "修改生产工单";
// this.title = "修改生产工单";
// this.optType="edit";
// this.optType="edit";
//
}
);
//
}
);
}
,
}
,
/** 提交按钮 */
/** 提交按钮 */
submitForm
()
{
submitForm
()
{
this
.
$refs
[
"form"
].
validate
((
valid
)
=>
{
this
.
$refs
[
"form"
].
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
valid
)
{
if
(
this
.
form
.
workorderId
!=
null
)
{
if
(
this
.
form
.
workorderId
!=
null
)
{
updateWorkorder
(
this
.
form
).
then
((
response
)
=>
{
updateWorkorder
(
this
.
form
).
then
((
response
)
=>
{
this
.
$modal
.
msgSuccess
(
"修改成功"
);
this
.
$modal
.
msgSuccess
(
"修改成功"
);
//this.open = false;
//this.open = false;
this
.
$refs
[
"bomlist"
].
getList
();
this
.
$refs
[
"bomlist"
].
getList
();
this
.
getList
();
this
.
getList
();
}
);
}
);
}
else
{
}
else
{
addWorkorder
(
this
.
form
).
then
((
response
)
=>
{
addWorkorder
(
this
.
form
).
then
((
response
)
=>
{
this
.
$modal
.
msgSuccess
(
"新增成功"
);
this
.
$modal
.
msgSuccess
(
"新增成功"
);
//this.open = false;
//this.open = false;
this
.
form
.
workorderId
=
response
.
data
;
this
.
form
.
workorderId
=
response
.
data
;
this
.
getList
();
this
.
getList
();
}
);
}
);
}
}
}
}
}
);
}
,
/** 删除按钮操作 */
handleDelete
(
row
)
{
this
.
$modal
.
confirm
(
'是否确认删除生产工单编号为"'
+
row
.
workorderId
+
'"的数据项?'
)
.
then
(
function
()
{
return
delWorkorder
(
row
.
workorderId
);
}
)
.
then
(()
=>
{
this
.
getList
();
this
.
$modal
.
msgSuccess
(
"删除成功"
);
}
)
.
catch
(()
=>
{
}
);
}
,
/** 生产任务单操作 */
handleDofinish
()
{
this
.
$modal
.
confirm
(
"是否生成选中的任务单?"
)
.
then
(()
=>
{
const
ids
=
this
.
selectedRows
.
map
((
v
)
=>
v
.
workorderId
);
console
.
log
(
"00000"
,
ids
);
return
addProtaskList
(
ids
);
}
)
.
then
(()
=>
{
this
.
getList
();
this
.
$modal
.
msgSuccess
(
"生成成功"
);
}
)
.
catch
(()
=>
{
}
);
}
,
handleToolNumCheck
(){
this
.
$modal
.
confirm
(
"是否检查刀具模版齐套?"
)
.
then
(()
=>
{
const
ids
=
this
.
selectedRows
.
map
((
v
)
=>
v
.
workorderId
);
return
doCheckToolNum
(
ids
);
}
)
.
then
(()
=>
{
this
.
getList
();
this
.
$modal
.
msgSuccess
(
"已齐套"
);
}
)
.
catch
(()
=>
{
}
);
}
,
handleSelectProduct
()
{
this
.
$refs
.
itemSelect
.
showFlag
=
true
;
}
,
handleSelectClient
()
{
this
.
$refs
.
clientSelect
.
showFlag
=
true
;
}
,
/** 导出按钮操作 */
handleExport
()
{
this
.
download
(
"mes/pro/workorder/export"
,
{
...
this
.
queryParams
,
}
,
`workorder_${new Date().getTime()
}
.xlsx`
);
}
,
handleConfirm
()
{
let
that
=
this
;
this
.
$modal
.
confirm
(
"是确认完成工单编制?【确认后将不能更改】"
)
.
then
(
function
()
{
that
.
form
.
status
=
"CONFIRMED"
;
that
.
submitForm
();
}
);
}
);
}
,
/** 删除按钮操作 */
handleDelete
(
row
)
{
this
.
$modal
.
confirm
(
'是否确认删除生产工单编号为"'
+
row
.
workorderId
+
'"的数据项?'
)
.
then
(
function
()
{
return
delWorkorder
(
row
.
workorderId
);
}
)
.
then
(()
=>
{
this
.
getList
();
this
.
$modal
.
msgSuccess
(
"删除成功"
);
}
)
.
catch
(()
=>
{
}
);
}
,
/** 生产任务单操作 */
handleDofinish
()
{
this
.
$modal
.
confirm
(
"是否生成选中的任务单?"
)
.
then
(()
=>
{
const
ids
=
this
.
selectedRows
.
map
((
v
)
=>
v
.
workorderId
);
console
.
log
(
"00000"
,
ids
);
return
addProtaskList
(
ids
);
}
)
.
then
(()
=>
{
this
.
getList
();
this
.
$modal
.
msgSuccess
(
"生成成功"
);
}
)
.
catch
(()
=>
{
}
);
}
,
handleToolNumCheck
(){
this
.
$modal
.
confirm
(
"是否检查刀具模版齐套?"
)
.
then
(()
=>
{
const
ids
=
this
.
selectedRows
.
map
((
v
)
=>
v
.
workorderId
);
return
doCheckToolNum
(
ids
);
}
)
.
then
(()
=>
{
this
.
getList
();
this
.
$modal
.
msgSuccess
(
"已齐套"
);
}
)
.
catch
(()
=>
{
}
);
}
,
handleSelectProduct
()
{
this
.
$refs
.
itemSelect
.
showFlag
=
true
;
}
,
handleSelectClient
()
{
this
.
$refs
.
clientSelect
.
showFlag
=
true
;
}
,
/** 导出按钮操作 */
handleExport
()
{
this
.
download
(
"mes/pro/workorder/export"
,
{
...
this
.
queryParams
,
}
,
`workorder_${new Date().getTime()
}
.xlsx`
);
}
,
handleConfirm
()
{
let
that
=
this
;
this
.
$modal
.
confirm
(
"是确认完成工单编制?【确认后将不能更改】"
)
.
then
(
function
()
{
that
.
form
.
status
=
"CONFIRMED"
;
that
.
submitForm
();
}
);
}
,
handleFinish
(
row
)
{
const
workorderIds
=
row
.
workorderId
||
this
.
ids
;
this
.
$modal
.
confirm
(
"确认完成工单?一旦完成,此工单将无法继续报工"
)
.
then
(
function
()
{
return
dofinish
(
workorderIds
);
//完成工单
}
)
.
then
(()
=>
{
this
.
getList
();
this
.
$modal
.
msgSuccess
(
"更改成功"
);
}
)
.
catch
(()
=>
{
}
);
}
,
// //物料选择弹出框
// onItemSelected(obj)
{
// if(obj != undefined && obj != null)
{
// this.form.productId = obj.itemId;
// this.form.productCode = obj.itemCode;
// this.form.productName = obj.itemName;
// this.form.productSpc = obj.specification;
// this.form.unitOfMeasure = obj.unitOfMeasure;
//
}
//
}
,
//客户选择弹出框
onClientSelected
(
obj
)
{
if
(
obj
!=
undefined
&&
obj
!=
null
)
{
this
.
form
.
clientId
=
obj
.
clientId
;
this
.
form
.
clientCode
=
obj
.
clientCode
;
this
.
form
.
clientName
=
obj
.
clientName
;
}
}
,
//供应商选择
handleSelectVendor
()
{
this
.
$refs
.
vendorSelect
.
showFlag
=
true
;
}
,
//供应商选择弹出框
onVendorSelected
(
obj
)
{
debugger
;
if
(
obj
!=
undefined
&&
obj
!=
null
)
{
this
.
form
.
vendorId
=
obj
.
vendorId
;
this
.
form
.
vendorCode
=
obj
.
vendorCode
;
this
.
form
.
vendorName
=
obj
.
vendorName
;
}
}
,
/** 完成任务单操作 */
confirmWorkorder
(
row
)
{
this
.
$modal
.
confirm
(
'是否将工单编号"'
+
row
.
workorderCode
+
'"的草稿数据项改为已确认?'
)
.
then
(
function
()
{
return
confirmedWorkorder
(
row
.
workorderId
);
}
)
.
then
(()
=>
{
this
.
getList
();
this
.
$modal
.
msgSuccess
(
"已确认成功"
);
}
)
.
catch
(()
=>
{
}
);
}
,
//自动生成编码
handleAutoGenChange
(
autoGenFlag
)
{
if
(
autoGenFlag
)
{
genCode
(
"WORKORDER_CODE"
).
then
((
response
)
=>
{
this
.
form
.
workorderCode
=
response
;
}
);
}
else
{
this
.
form
.
workorderCode
=
null
;
}
}
,
}
,
}
,
handleFinish
(
row
)
{
}
;
const
workorderIds
=
row
.
workorderId
||
this
.
ids
;
this
.
$modal
.
confirm
(
"确认完成工单?一旦完成,此工单将无法继续报工"
)
.
then
(
function
()
{
return
dofinish
(
workorderIds
);
//完成工单
}
)
.
then
(()
=>
{
this
.
getList
();
this
.
$modal
.
msgSuccess
(
"更改成功"
);
}
)
.
catch
(()
=>
{
}
);
}
,
// //物料选择弹出框
// onItemSelected(obj)
{
// if(obj != undefined && obj != null)
{
// this.form.productId = obj.itemId;
// this.form.productCode = obj.itemCode;
// this.form.productName = obj.itemName;
// this.form.productSpc = obj.specification;
// this.form.unitOfMeasure = obj.unitOfMeasure;
//
}
//
}
,
//客户选择弹出框
onClientSelected
(
obj
)
{
if
(
obj
!=
undefined
&&
obj
!=
null
)
{
this
.
form
.
clientId
=
obj
.
clientId
;
this
.
form
.
clientCode
=
obj
.
clientCode
;
this
.
form
.
clientName
=
obj
.
clientName
;
}
}
,
//供应商选择
handleSelectVendor
()
{
this
.
$refs
.
vendorSelect
.
showFlag
=
true
;
}
,
//供应商选择弹出框
onVendorSelected
(
obj
)
{
debugger
;
if
(
obj
!=
undefined
&&
obj
!=
null
)
{
this
.
form
.
vendorId
=
obj
.
vendorId
;
this
.
form
.
vendorCode
=
obj
.
vendorCode
;
this
.
form
.
vendorName
=
obj
.
vendorName
;
}
}
,
/** 完成任务单操作 */
confirmWorkorder
(
row
)
{
this
.
$modal
.
confirm
(
'是否将工单编号"'
+
row
.
workorderCode
+
'"的草稿数据项改为已确认?'
)
.
then
(
function
()
{
return
confirmedWorkorder
(
row
.
workorderId
);
}
)
.
then
(()
=>
{
this
.
getList
();
this
.
$modal
.
msgSuccess
(
"已确认成功"
);
}
)
.
catch
(()
=>
{
}
);
}
,
//自动生成编码
handleAutoGenChange
(
autoGenFlag
)
{
if
(
autoGenFlag
)
{
genCode
(
"WORKORDER_CODE"
).
then
((
response
)
=>
{
this
.
form
.
workorderCode
=
response
;
}
);
}
else
{
this
.
form
.
workorderCode
=
null
;
}
}
,
}
,
}
;
<
/script
>
<
/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