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
f2ff72cf
Commit
f2ff72cf
authored
Jan 25, 2024
by
赵汉亭
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
任务单2
parent
8faa183f
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
441 additions
and
371 deletions
+441
-371
single.vue
src/components/workunitSelect/single.vue
+152
-151
prototypeMakeApply.vue
src/views/mes/pro/prototypeMake/prototypeMakeApply.vue
+2
-2
prototypeMakeInfo.vue
src/views/mes/pro/prototypeMake/prototypeMakeInfo.vue
+2
-2
ganttedit.vue
src/views/mes/pro/schedule/ganttedit.vue
+4
-4
ganttx.vue
src/views/mes/pro/schedule/ganttx.vue
+219
-171
index.vue
src/views/mes/pro/schedule/index.vue
+62
-41
No files found.
src/components/workunitSelect/single.vue
View file @
f2ff72cf
<
template
>
<el-dialog
title=
"工作单元选择"
<el-dialog
title=
"工作单元选择"
v-if=
"showFlag"
:visible
.
sync=
"showFlag"
:modal=
false
:modal=
"false"
width=
"80%"
center
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<el-form-item
label=
"工作单元编码"
prop=
"workunitCode"
>
<el-input
v-model=
"queryParams.workunitCode"
...
...
@@ -32,167 +40,160 @@
/>
</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-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-table
v-loading=
"loading"
:data=
"workorderList"
@
current-change=
"handleCurrent"
@
row-dblclick=
"handleRowDbClick"
>
<el-table-column
width=
"55"
align=
"center"
>
<template
v-slot=
"scope"
>
<el-radio
v-model=
"selectedWorkorderId"
:label=
"scope.row.workorderId"
@
change=
"handleRowChange(scope.row)"
>
{{
""
}}
</el-radio>
</
template
>
</el-table-column>
<el-table-column
label=
"工单编码"
width=
"180"
prop=
"workorderCode"
>
</el-table-column>
<el-table-column
label=
"工单名称"
width=
"200"
align=
"center"
prop=
"workorderName"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"工单来源"
align=
"center"
prop=
"orderSource"
>
<
template
slot-scope=
"scope"
>
<dict-tag
:options=
"dict.type.mes_workorder_sourcetype"
:value=
"scope.row.orderSource"
/>
</
template
>
</el-table-column>
<el-table-column
label=
"订单编号"
width=
"140"
align=
"center"
prop=
"sourceCode"
/>
<el-table-column
label=
"产品编号"
width=
"120"
align=
"center"
prop=
"productCode"
/>
<el-table-column
label=
"产品名称"
width=
"200"
align=
"center"
prop=
"productName"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"规格型号"
align=
"center"
prop=
"productSpc"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"单位"
align=
"center"
prop=
"unitOfMeasure"
/>
<el-table-column
label=
"工单数量"
align=
"center"
prop=
"quantity"
/>
<el-table-column
label=
"客户编码"
align=
"center"
prop=
"clientCode"
/>
<el-table-column
label=
"客户名称"
align=
"center"
prop=
"clientName"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"需求日期"
align=
"center"
prop=
"requestDate"
width=
"180"
>
<
template
slot-scope=
"scope"
>
<span>
{{
parseTime
(
scope
.
row
.
requestDate
,
'{y
}
-{m
}
-{d
}
'
)
}}
<
/span
>
<el-table
v-loading=
"loading"
:data=
"workunitList"
@
current-change=
"handleCurrent"
@
row-dblclick=
"handleRowDbClick"
>
<el-table-column
width=
"55"
align=
"center"
>
<template
v-slot=
"scope"
>
<el-radio
v-model=
"selectedWorkunitId"
:label=
"scope.row.workunitId"
@
change=
"handleRowChange(scope.row)"
>
{{
""
}}
</el-radio
>
</
template
>
</el-table-column>
<el-table-column
label=
"工作站名称"
width=
"180"
prop=
"workunitCode"
/>
<el-table-column
label=
"工作单元编码"
width=
"200"
align=
"center"
prop=
"workunitName"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"工作单元名称"
align=
"center"
prop=
"orderSource"
/>
</el-table>
<pagination
v
-
show
=
"total
>
0"
v-show=
"total
>
0"
:total=
"total"
:page
.
sync=
"queryParams.pageNum"
:limit
.
sync=
"queryParams.pageSize"
@
pagination=
"getList"
/>
<div
slot=
"footer"
class=
"dialog-footer"
>
<
el
-
button
type
=
"primary"
@
click
=
"confirmSelect"
>
确
定
<
/el-button
>
<
el
-
button
@
click
=
"showFlag=
false"
>
取
消
<
/el-button
>
<el-button
type=
"primary"
@
click=
"confirmSelect"
>
确 定
</el-button>
<el-button
@
click=
"showFlag =
false"
>
取 消
</el-button>
</div>
</el-dialog>
</template>
<
script
>
import
{
listWorkorder
}
from
"@/api/mes/pro/workunit"
;
export
default
{
name
:
'WorkOrderSelectSingle'
,
components
:
{
}
,
dicts
:
[
'mes_order_status'
,
'mes_workorder_sourcetype'
],
props
:{
workunit
:
{
type
:
Object
,
default
:
function
(){
return
{
'workorderType'
:
'SELF'
}
}}
//外部传入的工单过滤信息
}
,
data
()
{
return
{
showFlag
:
false
,
// 遮罩层
loading
:
true
,
// 选中数组
selectedWorkorderId
:
undefined
,
selectedRows
:
[],
// 非单个禁用
single
:
true
,
// 非多个禁用
multiple
:
true
,
// 显示搜索条件
showSearch
:
true
,
// 总条数
total
:
0
,
// 生产工单表格数据
workorderList
:
[],
// 弹出层标题
title
:
""
,
// 是否显示弹出层
open
:
false
,
// 查询参数
queryParams
:
{
workorderCode
:
null
,
workorderName
:
null
,
workorderType
:
this
.
workunit
.
workunitType
,
orderSource
:
null
,
sourceCode
:
null
,
productId
:
null
,
productCode
:
null
,
productName
:
null
,
productSpc
:
null
,
unitOfMeasure
:
null
,
quantity
:
null
,
quantityProduced
:
null
,
quantityChanged
:
null
,
quantityScheduled
:
null
,
clientId
:
null
,
clientCode
:
null
,
clientName
:
null
,
requestDate
:
null
,
parentId
:
null
,
ancestors
:
null
,
status
:
'CONFIRMED'
,
}
,
}
}
,
created
()
{
this
.
getList
();
}
,
methods
:{
/** 查询生产工单列表 */
getList
()
{
this
.
loading
=
true
;
listWorkorder
(
this
.
queryParams
).
then
(
response
=>
{
this
.
workorderList
=
response
.
rows
;
this
.
loading
=
false
;
}
);
}
,
/** 搜索按钮操作 */
handleQuery
()
{
this
.
getList
();
}
,
/** 重置按钮操作 */
resetQuery
()
{
this
.
resetForm
(
"queryForm"
);
this
.
handleQuery
();
}
,
handleCurrent
(
row
){
if
(
row
){
this
.
selectedRows
=
row
;
}
}
,
// 单选选中数据
handleRowChange
(
row
)
{
if
(
row
){
this
.
selectedRows
=
row
;
}
}
,
//双击选中
handleRowDbClick
(
row
){
if
(
row
){
this
.
selectedRows
=
row
;
this
.
$emit
(
'onSelected'
,
this
.
selectedRows
);
this
.
showFlag
=
false
;
}
}
,
//确定选中
confirmSelect
(){
if
(
this
.
selectedWorkorderId
==
null
||
this
.
selectedWorkorderId
==
0
){
this
.
$notify
({
title
:
'提示'
,
type
:
'warning'
,
message
:
'请至少选择一条数据!'
}
);
return
;
}
this
.
$emit
(
'onSelected'
,
this
.
selectedRows
);
this
.
showFlag
=
false
;
}
}
}
<
/script>
\ No newline at end of file
import
{
listWorkunit
}
from
"@/api/mes/md/workunit"
;
export
default
{
name
:
"WorkunitSelectSingle"
,
components
:
{},
dicts
:
[],
props
:
{
workstationName
:
{
type
:
String
,
default
:
""
,
},
workunitId
:
{
type
:
Number
|
undefined
,
default
:
undefined
,
},
//外部传入的工单过滤信息
},
data
()
{
return
{
showFlag
:
false
,
// 遮罩层
loading
:
true
,
// 选中数组
selectedWorkunitId
:
undefined
,
selectedRows
:
[],
// 非单个禁用
single
:
true
,
// 非多个禁用
multiple
:
true
,
// 显示搜索条件
showSearch
:
true
,
// 总条数
total
:
0
,
// 生产工单表格数据
workunitList
:
[],
// 弹出层标题
title
:
""
,
// 是否显示弹出层
open
:
false
,
// 查询参数
queryParams
:
{
workunitCode
:
null
,
workunitName
:
null
,
workstationId
:
null
,
workstationName
:
this
.
workstationName
,
workunitId
:
null
,
enableFlag
:
"Y"
,
},
};
},
created
()
{
this
.
getList
();
this
.
queryParams
.
workstationName
=
this
.
workstationName
;
},
methods
:
{
/** 查询生产工单列表 */
getList
()
{
this
.
loading
=
true
;
listWorkunit
(
this
.
queryParams
).
then
((
response
)
=>
{
this
.
workunitList
=
response
.
rows
;
this
.
loading
=
false
;
});
},
/** 搜索按钮操作 */
handleQuery
()
{
this
.
getList
();
},
/** 重置按钮操作 */
resetQuery
()
{
this
.
resetForm
(
"queryForm"
);
this
.
handleQuery
();
},
handleCurrent
(
row
)
{
if
(
row
)
{
this
.
selectedRows
=
row
;
}
},
// 单选选中数据
handleRowChange
(
row
)
{
if
(
row
)
{
this
.
selectedRows
=
row
;
}
},
//双击选中
handleRowDbClick
(
row
)
{
if
(
row
)
{
this
.
selectedRows
=
row
;
this
.
$emit
(
"onSelected"
,
this
.
selectedRows
);
this
.
showFlag
=
false
;
}
},
//确定选中
confirmSelect
()
{
if
(
this
.
selectedWorkunitId
==
null
||
this
.
selectedWorkunitId
==
0
)
{
this
.
$notify
({
title
:
"提示"
,
type
:
"warning"
,
message
:
"请至少选择一条数据!"
,
});
return
;
}
this
.
$emit
(
"onSelected"
,
this
.
selectedRows
);
this
.
showFlag
=
false
;
},
},
};
</
script
>
src/views/mes/pro/prototypeMake/prototypeMakeApply.vue
View file @
f2ff72cf
...
...
@@ -47,7 +47,7 @@
</el-form>
<el-row
:gutter=
"10"
class=
"mb8"
>
<el-col
:span=
"1.5"
>
<
!--
<
el-col
:span=
"1.5"
>
<el-button
type=
"primary"
plain
...
...
@@ -57,7 +57,7 @@
v-hasPermi=
"['mes:pro:prototypeMake:add']"
>
新增
</el-button
>
</el-col>
</el-col>
-->
<el-col
:span=
"1.5"
>
<el-button
type=
"success"
...
...
src/views/mes/pro/prototypeMake/prototypeMakeInfo.vue
View file @
f2ff72cf
...
...
@@ -133,7 +133,7 @@
></el-input>
</el-form-item>
</el-col>
<el-col
:md=
"8"
:xs=
"12"
>
<
!-- <
el-col :md="8" :xs="12">
<el-form-item label="NG原因" prop="ngReason">
<el-input
v-model="form.ngReason"
...
...
@@ -141,7 +141,7 @@
disabled
></el-input>
</el-form-item>
</el-col>
</el-col>
-->
<el-col
:md=
"8"
:xs=
"12"
>
<el-form-item
label=
"计划完成日期"
prop=
"plannedFinishDate"
>
<el-date-picker
...
...
src/views/mes/pro/schedule/ganttedit.vue
View file @
f2ff72cf
...
...
@@ -59,10 +59,10 @@ export default {
workorderName
:
null
,
orderSource
:
null
,
sourceCode
:
null
,
product
Id
:
null
,
product
Code
:
null
,
product
Name
:
null
,
productSpc
:
null
,
item
Id
:
null
,
item
Code
:
null
,
item
Name
:
null
,
specification
:
null
,
unitOfMeasure
:
null
,
quantity
:
null
,
quantityProduced
:
null
,
...
...
src/views/mes/pro/schedule/ganttx.vue
View file @
f2ff72cf
...
...
@@ -3,43 +3,42 @@
</
template
>
<
script
>
import
{
gantt
}
from
'dhtmlx-gantt'
;
import
{
gantt
}
from
"dhtmlx-gantt"
;
export
default
{
name
:
'GanttChar'
,
name
:
"GanttChar"
,
data
()
{
return
{
newObj
:
{}
}
newObj
:
{}
,
}
;
},
props
:
{
tasks
:
{
type
:
Object
,
default
()
{
return
{
data
:
[],
links
:
[]}
}
default
()
{
return
{
data
:
[],
links
:
[]
};
}
,
},
optType
:
{
type
:
String
,
default
()
{
return
'view'
}
default
()
{
return
"view"
;
}
,
},
ids
:
{
type
:
Array
,
default
()
{
return
[]
}
}
default
()
{
return
[]
;
}
,
}
,
},
created
()
{
},
created
()
{},
mounted
:
function
()
{
// 初始化甘特图配置
this
.
initConfig
();
gantt
.
plugins
({
marker
:
true
marker
:
true
,
});
// 甘特图初始化和导入数据
gantt
.
init
(
this
.
$refs
.
gantt
);
...
...
@@ -48,9 +47,7 @@ export default {
methods
:
{
// 初始化甘特图数据
initData
()
{
},
initData
()
{},
reload
()
{
gantt
.
clearAll
();
this
.
addTodayLine
();
...
...
@@ -65,94 +62,129 @@ export default {
start_date
:
today
,
css
:
"today"
,
text
:
"今天"
,
title
:
"今天: "
+
date_to_str
(
today
)
title
:
"今天: "
+
date_to_str
(
today
)
,
});
},
// 初始化甘特图配置
initConfig
()
{
// 1 基础配置
// 1.1 甘特图是否只读
if
(
this
.
optType
==
'view'
)
{
if
(
this
.
optType
==
"view"
)
{
gantt
.
config
.
readonly
=
true
;
}
else
{
}
else
{
gantt
.
config
.
readonly
=
false
;
}
// 1.2 表格列设置
gantt
.
config
.
duration_unit
=
"hour"
;
gantt
.
config
.
duration_step
=
8
;
gantt
.
config
.
grid_width
=
520
;
gantt
.
config
.
duration_unit
=
"hour"
;
gantt
.
config
.
duration_step
=
8
;
gantt
.
config
.
grid_width
=
520
;
gantt
.
config
.
columns
=
[
{
name
:
"text"
,
label
:
"任务名"
,
tree
:
true
,
width
:
'200'
},
{
name
:
"workstation"
,
label
:
"工作站"
,
align
:
"center"
,
width
:
'*'
},
{
name
:
"process"
,
label
:
"工序"
,
align
:
"center"
,
width
:
'*'
},
{
name
:
"start_date"
,
label
:
"开始时间"
,
align
:
"center"
,
width
:
'*'
},
{
name
:
"end_date"
,
label
:
"结束时间"
,
align
:
"center"
,
width
:
'*'
},
{
name
:
"text"
,
label
:
"任务名"
,
tree
:
true
,
width
:
"200"
},
{
name
:
"workstation"
,
label
:
"工作站"
,
align
:
"center"
,
width
:
"*"
},
{
name
:
"process"
,
label
:
"工序"
,
align
:
"center"
,
width
:
"*"
},
{
name
:
"start_date"
,
label
:
"开始时间"
,
align
:
"center"
,
width
:
"*"
},
{
name
:
"end_date"
,
label
:
"结束时间"
,
align
:
"center"
,
width
:
"*"
},
];
// 1.3 设置中文
gantt
.
i18n
.
setLocale
(
"cn"
);
// 1.4 鼠标悬浮框
gantt
.
plugins
({
tooltip
:
true
});
// 启用tooltip悬浮框
gantt
.
templates
.
tooltip_text
=
function
(
start
,
end
,
task
)
{
if
(
task
.
type
==
'project'
){
return
"<b style='text-align:left;'>生产工单:</b> "
+
task
.
text
+
" <span style='text-align:left;'>"
+
" 完成比例:"
+
Math
.
round
(
task
.
progress
*
100
)
+
"% </span>"
;
}
else
{
return
"<b style='text-align:left;'>生产任务:</b> "
+
task
.
process
+
" "
+
task
.
text
+
" <span style='text-align:left;'>"
+
" 完成比例:"
+
Math
.
round
(
task
.
progress
*
100
)
+
"% </span>"
;
gantt
.
plugins
({
tooltip
:
true
});
// 启用tooltip悬浮框
gantt
.
templates
.
tooltip_text
=
function
(
start
,
end
,
task
)
{
if
(
task
.
type
==
"project"
)
{
return
(
"<b style='text-align:left;'>生产任务:</b> "
+
task
.
text
+
" <span style='text-align:left;'>"
+
" 完成比例:"
+
Math
.
round
(
task
.
progress
*
100
)
+
"% </span>"
);
}
else
{
return
(
"<b style='text-align:left;'>生产任务:</b> "
+
task
.
process
+
" "
+
task
.
text
+
" <span style='text-align:left;'>"
+
" 完成比例:"
+
Math
.
round
(
task
.
progress
*
100
)
+
"% </span>"
);
}
};
// 1.5 初始化的时候就展开树结构
gantt
.
config
.
open_tree_initially
=
true
;
// 1.6 显示到任务上的文本
gantt
.
templates
.
task_text
=
function
(
start
,
end
,
task
)
{
if
(
task
.
type
==
'project'
){
return
"<b style='text-align:left;'>生产工单:</b> "
+
task
.
text
+
" <span style='text-align:left;'>"
+
" 完成比例:"
+
Math
.
round
(
task
.
progress
*
100
)
+
"% </span>"
;
}
else
{
return
"<b style='text-align:left;'>生产任务:</b> "
+
task
.
process
+
" "
+
task
.
text
+
" <span style='text-align:left;'>"
+
" 完成比例:"
+
Math
.
round
(
task
.
progress
*
100
)
+
"% </span>"
;
if
(
task
.
type
==
"project"
)
{
return
(
"<b style='text-align:left;'>生产工单:</b> "
+
task
.
text
+
" <span style='text-align:left;'>"
+
" 完成比例:"
+
Math
.
round
(
task
.
progress
*
100
)
+
"% </span>"
);
}
else
{
return
(
"<b style='text-align:left;'>生产任务:</b> "
+
task
.
process
+
" "
+
task
.
text
+
" <span style='text-align:left;'>"
+
" 完成比例:"
+
Math
.
round
(
task
.
progress
*
100
)
+
"% </span>"
);
}
};
// 1.7 显示单元格
gantt
.
config
.
show_task_cells
=
true
;
// 2 时间配置
// 2.1 时间坐标轴单位 minute/hour/day/week/quarter/month/year
// gantt.config.scale_unit = "hour";
// gantt.config.scale_unit = "hour";
// 2.2 日期格式
// gantt.config.date_scale = "%H";
// gantt.config.date_scale = "%H";
// 2.3 时间坐标为月份的时候 先显示年份再月份
// gantt.config.subscales = [{unit: "month", step: 1, date: "%Y,%F"}];
// gantt.config.subscales = [{unit: "month", step: 1, date: "%Y,%F"}];
var
weekScaleTemplate
=
function
(
date
)
{
var
dateToStr
=
gantt
.
date
.
date_to_str
(
"%M %d"
);
var
endDate
=
gantt
.
date
.
add
(
gantt
.
date
.
add
(
date
,
1
,
"week"
),
-
1
,
"day"
);
var
endDate
=
gantt
.
date
.
add
(
gantt
.
date
.
add
(
date
,
1
,
"week"
),
-
1
,
"day"
);
return
dateToStr
(
date
)
+
" - "
+
dateToStr
(
endDate
);
};
var
dayTemplate
=
function
(
date
)
{
var
dayTemplate
=
function
(
date
)
{
var
dateToStr
=
gantt
.
date
.
date_to_str
(
"%M %d"
);
var
weekDay
=
gantt
.
date
.
date_to_str
(
"%D"
);
return
dateToStr
(
date
);
+
"("
+
weekDay
(
date
)
+
")"
;
return
dateToStr
(
date
);
+
"("
+
weekDay
(
date
)
+
")"
;
};
var
daysStyle
=
function
(
date
)
{
// you can use gantt.isWorkTime(date)
// when gantt.config.work_time config is enabled
// In this sample it's not so we just check week days
var
daysStyle
=
function
(
date
)
{
// you can use gantt.isWorkTime(date)
// when gantt.config.work_time config is enabled
// In this sample it's not so we just check week days
if
(
date
.
getDay
()
===
0
||
date
.
getDay
()
===
6
){
return
"weekend"
;
}
return
""
;
};
if
(
date
.
getDay
()
===
0
||
date
.
getDay
()
===
6
)
{
return
"weekend"
;
}
return
""
;
};
gantt
.
config
.
scales
=
[
{
unit
:
"week"
,
step
:
1
,
format
:
weekScaleTemplate
},
{
unit
:
"day"
,
step
:
1
,
format
:
dayTemplate
,
css
:
daysStyle
},
{
unit
:
"hour"
,
step
:
8
,
format
:
"%H:%i"
},
//这里的step要根据当前的班次设置来。如果是三班倒则是8,如果是两班倒则是12。
];
gantt
.
config
.
scales
=
[
{
unit
:
"week"
,
step
:
1
,
format
:
weekScaleTemplate
},
{
unit
:
"day"
,
step
:
1
,
format
:
dayTemplate
,
css
:
daysStyle
},
{
unit
:
"hour"
,
step
:
8
,
format
:
"%H:%i"
},
//这里的step要根据当前的班次设置来。如果是三班倒则是8,如果是两班倒则是12。
]
gantt
.
config
.
scale_height
=
50
;
// 2.4 定义从后端获取或发送到后端的日期数据解析格式
...
...
@@ -178,118 +210,134 @@ export default {
let
t
=
this
.
$props
.
tasks
;
let
c
=
this
.
$props
.
ids
;
gantt
.
attachEvent
(
"onAfterTaskUpdate"
,
function
(
id
,
obj
)
{
gantt
.
attachEvent
(
"onAfterTaskUpdate"
,
function
(
id
,
obj
)
{
debugger
;
let
tt
=
t
.
data
.
filter
(
item
=>
item
.
id
==
id
);
tt
=
obj
;
c
.
push
(
id
);
let
tt
=
t
.
data
.
filter
(
(
item
)
=>
item
.
id
==
id
);
tt
=
obj
;
c
.
push
(
id
);
});
}
}
}
},
},
};
</
script
>
<
style
>
@import
"~dhtmlx-gantt/codebase/dhtmlxgantt.css"
;
/* 任务名前的logo */
.gantt_tree_icon.gantt_file
,
.gantt_tree_icon.gantt_folder_open
,
.gantt_tree_icon.gantt_folder_closed
{
width
:
10px
;
background-image
:
none
;}
/* 任务线 */
.gantt_task_line
{
height
:
16px
!important
;
line-height
:
16px
!important
;
margin-top
:
8px
;
border
:
none
!important
;
border-radius
:
8px
;
}
.gantt_task_line.gantt_milestone
{
border-radius
:
0
;}
/* 里程碑 */
.gantt_task_line.gantt_milestone
{
width
:
12px
!important
;
height
:
16px
!important
;
border
:
none
!important
;
background-color
:
inherit
!important
;
background-size
:
cover
;
}
/* 里程碑icon */
.gantt_task_line.gantt_milestone
.gantt_task_content
{
width
:
12px
;
height
:
16px
;
margin-left
:
40px
;
transform
:
rotate
(
0deg
)
!important
;
background-image
:
url('../../../../assets/logo/logo.png')
!important
;
}
/* 左侧悬浮单元格背景色 */
.gantt_grid_data
.gantt_row.odd
:hover
,
.gantt_grid_data
.gantt_row
:hover
{
background-color
:
#f3f1fe
!important
;}
/* 选中一行背景色 */
.gantt_grid_data
.gantt_row.gantt_selected
,
.gantt_grid_data
.gantt_row.odd.gantt_selected
,
.gantt_task_row.gantt_selected
{
background-color
:
#f3f1fe
!important
;}
/* 选中一行每个单元格右border颜色 */
.gantt_task_row.gantt_selected
.gantt_task_cell
{
border-right-color
:
#f3f1fe
!important
;}
/* 标记线 */
.gantt_marker
{
background-color
:
#f4ae05
;
opacity
:
.8
;}
@import
"~dhtmlx-gantt/codebase/dhtmlxgantt.css"
;
/* 任务名前的logo */
.gantt_tree_icon.gantt_file
,
.gantt_tree_icon.gantt_folder_open
,
.gantt_tree_icon.gantt_folder_closed
{
width
:
10px
;
background-image
:
none
;
}
/* 任务线 */
.gantt_task_line
{
height
:
16px
!important
;
line-height
:
16px
!important
;
margin-top
:
8px
;
border
:
none
!important
;
border-radius
:
8px
;
}
.gantt_task_line.gantt_milestone
{
border-radius
:
0
;
}
/* 里程碑 */
.gantt_task_line.gantt_milestone
{
width
:
12px
!important
;
height
:
16px
!important
;
border
:
none
!important
;
background-color
:
inherit
!important
;
background-size
:
cover
;
}
/* 里程碑icon */
.gantt_task_line.gantt_milestone
.gantt_task_content
{
width
:
12px
;
height
:
16px
;
margin-left
:
40px
;
transform
:
rotate
(
0deg
)
!important
;
background-image
:
url("../../../../assets/logo/logo.png")
!important
;
}
/* 左侧悬浮单元格背景色 */
.gantt_grid_data
.gantt_row.odd
:hover
,
.gantt_grid_data
.gantt_row
:hover
{
background-color
:
#f3f1fe
!important
;
}
/* 选中一行背景色 */
.gantt_grid_data
.gantt_row.gantt_selected
,
.gantt_grid_data
.gantt_row.odd.gantt_selected
,
.gantt_task_row.gantt_selected
{
background-color
:
#f3f1fe
!important
;
}
/* 选中一行每个单元格右border颜色 */
.gantt_task_row.gantt_selected
.gantt_task_cell
{
border-right-color
:
#f3f1fe
!important
;
}
/*滚动条整体样式
*/
.gantt-wrapper
::-webkit-scrollba
r
{
width
:
14px
;
/*宽分别对应竖滚动条的尺寸*/
height
:
6px
;
/*高分别对应横滚动条的尺寸*/
}
/* 标记线
*/
.gantt_marke
r
{
background-color
:
#f4ae05
;
opacity
:
0.8
;
}
/*滚动条里面轨道*/
.gantt-wrapper
::-webkit-scrollbar-track
{
background-color
:
rgba
(
0
,
0
,
0
,
.2
);
border-radius
:
5px
;
}
/*滚动条里面拖动条*/
.gantt-wrapper
::-webkit-scrollbar-thumb
{
background-color
:
rgba
(
0
,
0
,
0
,
.3
);
border-radius
:
5px
;
}
.gantt-wrapper
::-webkit-scrollbar-thumb:hover
{
background-color
:
rgba
(
0
,
0
,
0
,
.5
);
border-radius
:
5px
;
}
/*滚动条整体样式*/
.gantt-wrapper
::-webkit-scrollbar
{
width
:
14px
;
/*宽分别对应竖滚动条的尺寸*/
height
:
6px
;
/*高分别对应横滚动条的尺寸*/
}
/* 展开收起背景图片
*/
.gantt_tree_icon.gantt_close
,
.gantt_tree_icon.gantt_open
{
background-image
:
none
!important
;
position
:
relative
;
}
/* 收起小三角
*/
.gantt_tree_icon.gantt_close
::after
{
position
:
absolute
;
content
:
''
;
top
:
14px
;
left
:
10px
;
border-right
:
6px
solid
transparent
;
border-left
:
6px
solid
transparent
;
border-top
:
6px
solid
#999999
;
/*滚动条里面轨道
*/
.gantt-wrapper
::-webkit-scrollbar-track
{
background-color
:
rgba
(
0
,
0
,
0
,
0.2
)
;
border-radius
:
5px
;
}
/*滚动条里面拖动条
*/
.gantt-wrapper
::-webkit-scrollbar-thumb
{
background-color
:
rgba
(
0
,
0
,
0
,
0.3
)
;
border-radius
:
5px
;
}
.gantt-wrapper
::-webkit-scrollbar-thumb:hover
{
background-color
:
rgba
(
0
,
0
,
0
,
0.5
)
;
border-radius
:
5px
;
}
}
/* 展开小三角 */
.gantt_tree_icon.gantt_open
::after
{
position
:
absolute
;
content
:
''
;
top
:
12px
;
left
:
12px
;
border-bottom
:
6px
solid
transparent
;
border-top
:
6px
solid
transparent
;
border-left
:
6px
solid
#999999
;
}
/* 下方滚动条宽度 */
.gantt_layout_cell
.gantt_hor_scroll
{
width
:
calc
(
100%
-
199px
)
!important
;
left
:
199px
;
}
/* 展开收起背景图片 */
.gantt_tree_icon.gantt_close
,
.gantt_tree_icon.gantt_open
{
background-image
:
none
!important
;
position
:
relative
;
}
/* 收起小三角 */
.gantt_tree_icon.gantt_close
::after
{
position
:
absolute
;
content
:
""
;
top
:
14px
;
left
:
10px
;
border-right
:
6px
solid
transparent
;
border-left
:
6px
solid
transparent
;
border-top
:
6px
solid
#999999
;
}
/* 展开小三角 */
.gantt_tree_icon.gantt_open
::after
{
position
:
absolute
;
content
:
""
;
top
:
12px
;
left
:
12px
;
border-bottom
:
6px
solid
transparent
;
border-top
:
6px
solid
transparent
;
border-left
:
6px
solid
#999999
;
}
/* 下方滚动条宽度 */
.gantt_layout_cell
.gantt_hor_scroll
{
width
:
calc
(
100%
-
199px
)
!important
;
left
:
199px
;
}
.scaleStyle
{
height
:
20px
;
}
/* 周末背景颜色 */
.weekend
{
background
:
rgb
(
189
,
185
,
186
)
!important
;
width
:
30s
}
</
style
>
\ No newline at end of file
.scaleStyle
{
height
:
20px
;
}
/* 周末背景颜色 */
.weekend
{
background
:
rgb
(
189
,
185
,
186
)
!important
;
width
:
30s
;
}
</
style
>
src/views/mes/pro/schedule/index.vue
View file @
f2ff72cf
...
...
@@ -287,68 +287,74 @@
>
<
el
-
form
ref
=
"form"
:
model
=
"form"
label
-
width
=
"80px"
>
<
el
-
row
>
<
el
-
col
:
lg
=
"
6
"
:
md
=
"8"
:
sm
=
"12"
:
xs
=
"12"
>
<
el
-
col
:
lg
=
"
8
"
:
md
=
"8"
:
sm
=
"12"
:
xs
=
"12"
>
<
el
-
form
-
item
label
=
"编号"
prop
=
"taskCode"
>
<
el
-
input
v
-
model
=
"form.taskCode"
readonly
=
"readonly"
/>
<
el
-
input
v
-
model
=
"form.taskCode"
readonly
=
"readonly"
disabled
/>
<
/el-form-item
>
<
/el-col
>
<
el
-
col
:
lg
=
"
6
"
:
md
=
"8"
:
sm
=
"12"
:
xs
=
"12"
>
<
el
-
col
:
lg
=
"
8
"
:
md
=
"8"
:
sm
=
"12"
:
xs
=
"12"
>
<
el
-
form
-
item
label
=
"名称"
prop
=
"taskName"
>
<
el
-
input
v
-
model
=
"form.taskName"
readonly
=
"readonly"
/>
<
el
-
input
v
-
model
=
"form.taskName"
readonly
=
"readonly"
disabled
/>
<
/el-form-item
>
<
/el-col
>
<
el
-
col
:
lg
=
"
6
"
:
md
=
"8"
:
sm
=
"12"
:
xs
=
"12"
>
<
el
-
col
:
lg
=
"
8
"
:
md
=
"8"
:
sm
=
"12"
:
xs
=
"12"
>
<
el
-
form
-
item
label
=
"产品名称"
prop
=
"itemName"
>
<
el
-
input
v
-
model
=
"form.itemName"
readonly
=
"readonly"
/>
<
el
-
input
v
-
model
=
"form.itemName"
readonly
=
"readonly"
disabled
/>
<
/el-form-item
>
<
/el-col
>
<
el
-
col
:
lg
=
"6"
:
md
=
"8"
:
sm
=
"12"
:
xs
=
"12"
>
<
/el-row
>
<
el
-
row
>
<
el
-
col
:
lg
=
"8"
:
md
=
"8"
:
sm
=
"12"
:
xs
=
"12"
>
<
el
-
form
-
item
label
=
"工序名称"
prop
=
"processName"
>
<
el
-
input
v
-
model
=
"form.processName"
readonly
=
"readonly"
/>
<
el
-
input
v
-
model
=
"form.processName"
readonly
=
"readonly"
disabled
/>
<
/el-form-item
>
<
/el-col
>
<
el
-
col
:
lg
=
"
6
"
:
md
=
"8"
:
sm
=
"12"
:
xs
=
"12"
>
<
el
-
col
:
lg
=
"
8
"
:
md
=
"8"
:
sm
=
"12"
:
xs
=
"12"
>
<
el
-
form
-
item
label
=
"工作站"
prop
=
"workstationName"
>
<
el
-
input
v
-
model
=
"form.workstationName"
readonly
=
"readonly"
/>
<
el
-
input
v
-
model
=
"form.workstationName"
readonly
=
"readonly"
disabled
/>
<
/el-form-item
>
<
/el-col
>
<
el
-
col
:
lg
=
"6"
:
md
=
"8"
:
sm
=
"12"
:
xs
=
"12"
>
<
el
-
form
-
item
label
=
"工作单元"
prop
=
"workunitId"
>
<
el
-
input
v
-
model
=
"form.workunitName"
/>
<
el
-
col
:
lg
=
"8"
:
md
=
"8"
:
sm
=
"12"
:
xs
=
"12"
>
<
el
-
form
-
item
label
=
"工作单元"
prop
=
"workunitId"
required
:
true
>
<
el
-
input
v
-
model
=
"form.workunitName"
>
<
el
-
button
slot
=
"append"
icon
=
"el-icon-search"
@
click
=
"$refs['WorkunitSelect'].showFlag = true"
><
/el-button
>
<
/el-input
>
<
WorkuintSelect
ref
=
"WorkunitSelect"
:
workstationName
=
"form.workstationName"
@
onSelected
=
"onWorkunitSelect"
/>
<
/el-form-item
>
<
/el-col
>
<
el
-
col
:
lg
=
"6"
:
md
=
"8"
:
sm
=
"12"
:
xs
=
"12"
>
<
el
-
form
-
item
label
=
"排产数量"
prop
=
"quantity"
>
<
el
-
input
v
-
model
=
"form.quantity"
readonly
=
"readonly"
/>
<
/el-row
>
<
el
-
row
>
<
el
-
col
:
lg
=
"8"
:
md
=
"8"
:
sm
=
"12"
:
xs
=
"12"
>
<
el
-
form
-
item
label
=
"排产数量"
prop
=
"quantity"
required
:
true
>
<
el
-
input
-
number
:
step
=
"1"
:
min
=
"0"
v
-
model
=
"form.quantity"
placeholder
=
"请输入排产数量"
/>
<
/el-form-item
>
<
/el-col
>
<
el
-
col
:
lg
=
"
6
"
:
md
=
"8"
:
sm
=
"12"
:
xs
=
"12"
>
<
el
-
form
-
item
label
=
"开始
生产时间"
prop
=
"startTime"
>
<
el
-
col
:
lg
=
"
8
"
:
md
=
"8"
:
sm
=
"12"
:
xs
=
"12"
>
<
el
-
form
-
item
label
=
"开始
时间"
prop
=
"startTime"
required
:
true
>
<
el
-
date
-
picker
v
-
model
=
"form.startTime"
type
=
"date"
value
-
format
=
"yyyy-MM-dd
:hh-mm-
ss"
type
=
"date
time
"
value
-
format
=
"yyyy-MM-dd
hh:mm:
ss"
placeholder
=
"请选择开始时间"
>
<
/el-date-picker
>
<
/el-form-item
>
<
/el-col
>
<
el
-
col
:
lg
=
"6"
:
md
=
"8"
:
sm
=
"12"
:
xs
=
"12"
>
<
el
-
form
-
item
label
=
"生产时长"
prop
=
"duration"
>
<
el
-
input
v
-
model
=
"form.duration"
/>
<
/el-form-item
>
<
/el-col
>
<
el
-
col
:
lg
=
"6"
:
md
=
"8"
:
sm
=
"12"
:
xs
=
"12"
>
<
el
-
form
-
item
label
=
"需求日期"
prop
=
"requestDate"
>
<
el
-
date
-
picker
v
-
model
=
"form.requestDate"
type
=
"date"
value
-
format
=
"yyyy-MM-dd"
placeholder
=
"请选择需求日期"
>
<
/el-date-picker
>
<
el
-
col
:
lg
=
"8"
:
md
=
"8"
:
sm
=
"12"
:
xs
=
"12"
>
<
el
-
form
-
item
label
=
"生产时长"
prop
=
"duration"
required
:
true
>
<
el
-
input
-
number
:
step
=
"1"
:
min
=
"0"
v
-
model
=
"form.duration"
placeholder
=
"请输入生产时长"
/>
<
/el-form-item
>
<
/el-col
>
<
/el-row
>
<
el
-
row
>
<
el
-
col
:
span
=
"24"
>
<
el
-
form
-
item
label
=
"备注"
prop
=
"remark"
>
<
el
-
input
...
...
@@ -360,21 +366,21 @@
<
/el-col
>
<
/el-row
>
<
/el-form
>
<
el
-
steps
<
!--
<
el
-
steps
:
active
=
"activeProcess"
v
-
if
=
"form.taskId != null"
align
-
center
simple
>
<
el
-
step
>
-->
<!--
<
el
-
step
v
-
for
=
"(item, index) in processOptions"
:
title
=
"item.itemName"
:
key
=
"item.itemId"
@
click
.
native
=
"handleStepClick(index)"
>
<
/el-step
>
<
/el-steps
>
<
template
v
-
if
=
"activeProcess == index && form.taskId != null"
>
<
/el-steps>
--
>
<
!--
<
template
v
-
if
=
"activeProcess == index && form.taskId != null"
>
<
el
-
card
v
-
for
=
"(item, index) in processOptions"
:
key
=
"index"
>
<
ProTask
:
workorderId
=
"form.taskId"
...
...
@@ -384,7 +390,7 @@
:
optType
=
"optType"
><
/ProTask
>
<
/el-card
>
<
/template
>
<
/template>
--
>
<
div
slot
=
"footer"
class
=
"dialog-footer"
>
<
el
-
button
type
=
"primary"
...
...
@@ -432,8 +438,10 @@ import {
addProtaskList
,
}
from
"@/api/mes/pro/protask"
;
import
{
listProductprocess
}
from
"@/api/mes/pro/routeprocess"
;
import
WorkuintSelect
from
"@/components/workunitSelect/single.vue"
;
import
ProTask
from
"./proTask.vue"
;
import
GanttChar
from
"./ganttx.vue"
;
import
{
listWorkunit
}
from
"@/api/mes/md/workunit"
;
import
Treeselect
from
"@riophae/vue-treeselect"
;
import
"@riophae/vue-treeselect/dist/vue-treeselect.css"
;
...
...
@@ -444,6 +452,7 @@ export default {
Treeselect
,
ProTask
,
GanttChar
,
WorkuintSelect
,
}
,
data
()
{
return
{
...
...
@@ -554,10 +563,22 @@ export default {
this
.
$refs
.
ganttChar
.
reload
();
}
);
}
,
// 获取工作单元
onWorkunitSelect
(
row
)
{
console
.
log
(
45456
,
row
);
if
(
row
!=
undefined
&&
row
!=
null
)
{
this
.
form
.
workunitId
=
row
.
workunitId
;
this
.
form
.
workunitName
=
row
.
workunitName
;
console
.
log
(
111111
,
this
.
form
)
}
}
,
//获取当前产品对应的生产工序
getProcess
()
{
listProductprocess
(
this
.
form
.
product
Id
).
then
((
response
)
=>
{
listProductprocess
(
this
.
form
.
item
Id
).
then
((
response
)
=>
{
this
.
processOptions
=
response
.
data
;
}
);
}
,
...
...
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