Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mes-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周远喜
mes-ui
Commits
fb26967f
Commit
fb26967f
authored
Nov 17, 2020
by
renjintao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ai aistep3 aistep4 aistep5
parent
8fd9c1b6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
947 additions
and
40 deletions
+947
-40
index.vue
pages/aps/ai/index.vue
+11
-23
indexOld.vue
pages/aps/ai/indexOld.vue
+621
-0
api.js
pages/aps/aps/api.js
+17
-2
datasShow.vue
pages/aps/results/datasShow.vue
+94
-14
index.vue
pages/aps/results/index.vue
+1
-1
indexData.vue
pages/aps/results/indexData.vue
+203
-0
No files found.
pages/aps/ai/index.vue
View file @
fb26967f
...
@@ -6,19 +6,19 @@
...
@@ -6,19 +6,19 @@
<Search
/>
<Search
/>
</
template
>
</
template
>
<
template
slot=
"buttons"
>
<
template
slot=
"buttons"
>
应用规则:
<!--
应用规则:
<Select
v-model=
"rulesAi"
multiple
style=
"width:280px;"
class=
"tl"
>
<Select
v-model=
"rulesAi"
multiple
style=
"width:280px;"
class=
"tl"
>
<Option
v-for=
"item in rulesAiList"
:value=
"item.value"
:key=
"item.value"
>
{{
item
.
label
}}
</Option>
<Option
v-for=
"item in rulesAiList"
:value=
"item.value"
:key=
"item.value"
>
{{
item
.
label
}}
</Option>
</Select>
</Select>
-->
<DatePicker
type=
"date"
placeholder=
"设置基准日期"
style=
"width: 150px;"
v-model=
"entity.setTime"
@
on-change=
"getTime"
></DatePicker>
<DatePicker
type=
"date"
placeholder=
"设置基准日期"
style=
"width: 150px;"
v-model=
"entity.setTime"
@
on-change=
"getTime"
></DatePicker>
<Button
type=
"primary"
@
click=
"openApsModal"
>
智能
排产
</Button>
<Button
type=
"primary"
@
click=
"openApsModal"
>
APS
排产
</Button>
</
template
>
</
template
>
<
template
slot=
"batch"
>
<
template
slot=
"batch"
>
<Button
type=
"primary"
class=
"mr10 ml10"
@
click=
"removeOk"
>
移出排产
</Button>
<Button
type=
"primary"
class=
"mr10 ml10"
@
click=
"removeOk"
>
移出排产
</Button>
</
template
>
</
template
>
</DataGrid>
</DataGrid>
<Modal
v-model=
"apsModal"
title=
"确定
智能
排产"
@
on-ok=
"apsOk"
@
on-cancel=
"cancel"
>
<Modal
v-model=
"apsModal"
title=
"确定
APS
排产"
@
on-ok=
"apsOk"
@
on-cancel=
"cancel"
>
<p>
确定进行
智能
排产?
</p>
<p>
确定进行
APS
排产?
</p>
</Modal>
</Modal>
<Modal
v-model=
"resultModal"
title=
"数据检查"
width=
"1500"
@
on-ok=
"cancel"
@
on-cancel=
"cancel"
>
<Modal
v-model=
"resultModal"
title=
"数据检查"
width=
"1500"
@
on-ok=
"cancel"
@
on-cancel=
"cancel"
>
...
@@ -505,30 +505,18 @@ export default {
...
@@ -505,30 +505,18 @@ export default {
//排产计算
//排产计算
let
paramsTime
=
{
let
paramsTime
=
{
setTime
:
this
.
entity
.
setTime
,
setTime
:
this
.
entity
.
setTime
,
rules
:
JSON
.
stringify
(
this
.
rulesAi
).
replace
(
'['
,
''
).
replace
(
']'
,
''
).
replace
(
/
\"
/g
,
''
)
//
rules: JSON.stringify(this.rulesAi).replace('[', '').replace(']', '').replace(/\"/g, '')
};
};
Api
.
apsprepareandcalc
(
paramsTime
)
Api
.
apsprepareandcalc
(
paramsTime
)
.
then
((
res2
)
=>
{
.
then
((
res2
)
=>
{
if
(
res2
.
success
)
{
if
(
res2
.
success
)
{
if
(
res2
.
result
.
res
)
{
if
(
res2
.
result
.
res
)
{
// this.$Message.success("排产计算成功");
this
.
$Message
.
success
(
"排产计算成功"
);
//智能排产操作start
this
.
circleModal
=
false
;
Api
.
aischedule
(
paramsTime
).
then
((
res3
)
=>
{
this
.
$router
.
push
({
if
(
res3
.
success
)
{
path
:
"/aps/results/indexData"
if
(
res3
.
result
.
res
)
{
// params: { customerId: id }
this
.
$Message
.
success
(
"排产成功"
);
this
.
circleModal
=
false
;
this
.
$router
.
push
({
path
:
"/aps/results"
,
// params: { customerId: id }
});
}
else
{
this
.
circleModal
=
false
;
this
.
$Message
.
error
(
res3
.
result
.
msg
);
}
}
});
});
//智能排产操作end
}
else
{
}
else
{
this
.
circleModal
=
false
;
this
.
circleModal
=
false
;
this
.
$Message
.
error
(
res2
.
result
.
msg
);
this
.
$Message
.
error
(
res2
.
result
.
msg
);
...
...
pages/aps/ai/indexOld.vue
0 → 100644
View file @
fb26967f
<
template
>
<div>
<DataGrid
:columns=
"columns"
ref=
"grid"
:draggable=
"true"
:data=
"list"
:high=
"false"
@
on-drag-drop=
"onDragDrop"
:page=
"false"
@
on-selection-change=
"onSelect"
:batch=
"true"
:border=
"true"
:easy=
"false"
>
<template
slot=
"searchBack"
></
template
>
<
template
slot=
"searchForm"
>
<Search
/>
</
template
>
<
template
slot=
"buttons"
>
应用规则:
<Select
v-model=
"rulesAi"
multiple
style=
"width:280px;"
class=
"tl"
>
<Option
v-for=
"item in rulesAiList"
:value=
"item.value"
:key=
"item.value"
>
{{
item
.
label
}}
</Option>
</Select>
<DatePicker
type=
"date"
placeholder=
"设置基准日期"
style=
"width: 150px;"
v-model=
"entity.setTime"
@
on-change=
"getTime"
></DatePicker>
<Button
type=
"primary"
@
click=
"openApsModal"
>
智能排产
</Button>
</
template
>
<
template
slot=
"batch"
>
<Button
type=
"primary"
class=
"mr10 ml10"
@
click=
"removeOk"
>
移出排产
</Button>
</
template
>
</DataGrid>
<Modal
v-model=
"apsModal"
title=
"确定智能排产"
@
on-ok=
"apsOk"
@
on-cancel=
"cancel"
>
<p>
确定进行智能排产?
</p>
</Modal>
<Modal
v-model=
"resultModal"
title=
"数据检查"
width=
"1500"
@
on-ok=
"cancel"
@
on-cancel=
"cancel"
>
<CheckResult
:data=
"result"
></CheckResult>
</Modal>
<Modal
v-model=
"apsCheckModal"
title=
"确定智能排产"
@
on-ok=
"apsCheckOk"
@
on-cancel=
"cancel"
>
<p>
已有排产方案,是否移出排产池?
</p>
</Modal>
<Modal
v-model=
"circleModal"
title
footer-hide
:mask-closable=
"false"
>
<div
slot=
"close"
></div>
<Row>
<Col
class=
"demo-spin-col"
span=
"24"
>
<Spin
fix
>
<Icon
type=
"ios-loading"
size=
"36"
class=
"demo-spin-icon-load"
></Icon>
<div>
智能排产进行中......
</div>
</Spin>
</Col>
</Row>
</Modal>
</div>
</template>
<
script
>
var
myDate
=
new
Date
();
var
nowDate
=
myDate
.
getFullYear
()
+
"-"
+
(
myDate
.
getMonth
()
+
1
)
+
"-"
+
myDate
.
getDate
();
import
Api
from
"../aps/api"
;
import
Add
from
"./options"
;
import
Temp
from
"./temp"
;
import
Duration
from
"./duration"
;
import
Expand
from
"./components/excute"
;
import
CheckResult
from
"./components/check"
;
export
default
{
name
:
"indexData"
,
components
:
{
Add
,
Expand
,
Temp
,
Duration
,
CheckResult
,
},
data
()
{
return
{
action
:
Api
.
index
,
easySearch
:
{
keys
:
{
op
:
"notes"
,
value
:
null
},
},
result
:
{
res
:
true
,
datas
:
"{}"
,
},
resultModal
:
false
,
entity
:
{
setTime
:
this
.
getFormatDate
(
nowDate
),
rules
:
''
,
},
editModal
:
false
,
detailModal
:
false
,
deletelModal
:
false
,
apsModal
:
false
,
apsCheckModal
:
false
,
tempParams
:
null
,
insertTItle1
:
"插单"
,
rowIndex1
:
null
,
list
:
[],
curId
:
0
,
columns
:
[{
key
:
"move"
,
title
:
" "
,
hide
:
false
,
align
:
"center"
,
width
:
30
,
render
:
(
h
,
params
)
=>
{
return
h
(
"Icon"
,
{
attrs
:
{
type
:
"md-more"
,
size
:
18
,
},
class
:
"drag"
,
});
},
},
{
type
:
"expand"
,
width
:
50
,
render
:
(
h
,
params
)
=>
{
return
h
(
Expand
,
{
props
:
{
rowId
:
params
.
row
.
part_task_pk
,
},
});
},
},
{
key
:
"selection"
,
type
:
"selection"
,
width
:
50
,
align
:
"center"
,
},
{
key
:
"id"
,
title
:
this
.
l
(
"id"
),
hide
:
true
,
align
:
"left"
,
sortable
:
true
,
width
:
50
,
},
{
key
:
"mesCode"
,
title
:
this
.
l
(
"mes_code"
),
align
:
"left"
,
high
:
true
,
width
:
240
,
},
{
key
:
"product_name"
,
title
:
this
.
l
(
"product_name"
),
align
:
"left"
,
high
:
true
,
},
{
key
:
"drawingnum"
,
title
:
this
.
l
(
"drawingnum"
),
align
:
"left"
,
high
:
true
,
},
{
key
:
"project_no"
,
title
:
this
.
l
(
"project_no"
),
align
:
"left"
,
high
:
true
,
},
{
key
:
"batchnum"
,
title
:
this
.
l
(
"batchnum"
),
align
:
"left"
,
high
:
true
,
},
{
key
:
"urgency_level"
,
title
:
this
.
l
(
"urgency_level"
),
align
:
"left"
,
high
:
true
,
code
:
"plan.order.urgencyLevel"
,
width
:
100
,
},
{
key
:
"priority"
,
title
:
this
.
l
(
"priority"
),
align
:
"left"
,
high
:
true
,
hide
:
true
,
render
:
(
h
,
params
)
=>
{
return
h
(
"span"
,
{},
params
.
index
+
1
);
},
},
{
key
:
"plan_qty"
,
title
:
this
.
l
(
"plan_qty"
),
align
:
"right"
,
width
:
100
,
high
:
true
,
},
{
key
:
"spare_qty"
,
title
:
this
.
l
(
"spare_qty"
),
align
:
"right"
,
width
:
100
,
high
:
true
,
hide
:
true
,
},
{
key
:
"plan_start"
,
title
:
this
.
l
(
"plan_start"
),
align
:
"center"
,
high
:
true
,
hide
:
true
,
resizable
:
true
,
width
:
150
,
},
{
key
:
"plan_finish"
,
title
:
this
.
l
(
"plan_finish"
),
align
:
"center"
,
high
:
true
,
hide
:
true
,
sortable
:
true
,
resizable
:
true
,
width
:
150
,
},
{
key
:
"notes"
,
title
:
this
.
l
(
"notes"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
hide
:
true
,
},
{
key
:
"demand_start"
,
title
:
this
.
l
(
"demand_start"
),
align
:
"center"
,
resizable
:
true
,
width
:
150
,
type
:
"date"
,
},
{
key
:
"demand_finish"
,
title
:
this
.
l
(
"demand_finish"
),
align
:
"center"
,
high
:
true
,
resizable
:
true
,
width
:
150
,
type
:
"date"
,
},
{
key
:
"badjustflag"
,
title
:
this
.
l
(
"badjustflag"
),
align
:
"left"
,
high
:
true
,
hide
:
true
,
},
{
title
:
"操作"
,
key
:
"action"
,
width
:
140
,
align
:
"center"
,
// fixed:"right",
render
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
{
class
:
"action"
},
[
h
(
"op"
,
{
attrs
:
{
icon
:
"md-refresh"
,
type
:
"icon"
,
title
:
"恢复工序"
,
oprate
:
"edit"
,
msg
:
"确认要恢复工序吗?"
,
},
on
:
{
click
:
()
=>
this
.
refresh
(
params
.
row
.
part_task_pk
)
},
}),
h
(
"op"
,
{
attrs
:
{
icon
:
"ios-trash"
,
type
:
"icon"
,
title
:
"移出排产池"
,
oprate
:
"delete"
,
msg
:
"确认要移出排产吗?"
,
},
on
:
{
click
:
()
=>
this
.
remove
(
params
.
row
.
part_task_pk
)
},
}),
]);
},
},
],
arrPartPkId
:
[],
//设置参数开始
setParams
:
{
opTaskPk
:
0
,
//工单ID
partTaskPk
:
0
,
//生产计划ID
taskSeq
:
""
,
//工序编号
count
:
0
,
//生产计划数量
},
//设置参数结束
circleModal
:
false
,
//进度条
tempStatu
:
0
,
//新建模型时传过来的id值
rulesAi
:
[
'1'
,
'2'
,
'3'
,
'4'
],
rulesAiList
:
[{
value
:
'1'
,
label
:
'转序'
},
{
value
:
'2'
,
label
:
'多台'
},
{
value
:
'3'
,
label
:
'加班'
},
{
value
:
'4'
,
label
:
'公休'
}]
};
},
mounted
()
{
this
.
loadList
();
},
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
},
methods
:
{
//排产池加载数据列表
loadList
()
{
Api
.
getall
().
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
list
=
res
.
result
;
}
});
},
detail
(
id
)
{
this
.
detailModal
=
true
;
this
.
curId
=
id
;
},
edit
(
id
)
{
this
.
editModal
=
true
;
this
.
curId
=
id
;
},
refresh
(
partPkId
)
{
//恢复工序
let
params
=
{
id
:
partPkId
,
};
Api
.
recoveryoptasksimluate
(
params
).
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"恢复成功"
);
this
.
list
=
[];
this
.
loadList
();
}
});
},
remove
(
partPkId
)
{
//移出排产池
this
.
tempParams
=
null
;
let
paramsArry
=
[];
if
(
partPkId
.
constructor
==
Array
)
{
paramsArry
=
partPkId
;
}
else
{
paramsArry
.
push
(
partPkId
);
}
let
params
=
{
partPks
:
paramsArry
,
};
Api
.
beforeshiftoutapspool
(
params
)
.
then
((
res
)
=>
{
if
(
res
.
success
)
{
if
(
res
.
result
)
{
this
.
checkapspool
(
params
);
}
else
{
this
.
tempParams
=
null
;
this
.
tempParams
=
params
;
this
.
apsCheckModal
=
true
;
}
}
else
{
this
.
$Message
.
error
(
"校验失败"
);
}
})
.
catch
((
err
)
=>
{
this
.
$Message
.
error
(
"连接错误1"
);
});
},
apsCheckOk
()
{
this
.
checkapspool
(
this
.
tempParams
);
},
checkapspool
(
params
)
{
Api
.
shiftoutapspool
(
params
)
.
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"移出排产池操作成功"
);
this
.
loadList
();
//移出排产后将aps对应的store数量去掉
this
.
$store
.
commit
(
"setCountAps"
,
this
.
$store
.
state
.
countAps
-
params
.
partPks
.
length
);
}
else
{
this
.
$Message
.
error
(
"移出排产池操作失败"
);
}
})
.
catch
((
err
)
=>
{
this
.
$Message
.
error
(
"连接失败2"
);
});
},
onSelect
(
a
,
b
)
{
//批量选择
let
selectRows
=
a
;
this
.
arrPartPkId
=
[];
selectRows
.
forEach
((
e
)
=>
{
this
.
arrPartPkId
.
push
(
e
.
part_task_pk
);
});
},
removeOk
()
{
//批量选择移出排产池
this
.
remove
(
this
.
arrPartPkId
);
},
removeCancel
()
{
this
.
deletelModal
=
false
;
},
cancel
()
{
this
.
curId
=
0
;
this
.
detailModal
=
false
;
this
.
editModal
=
false
;
this
.
deletedlModal
=
false
;
this
.
apsModal
=
false
;
this
.
apsCheckModal
=
false
;
this
.
resultModal
=
false
;
},
onDragDrop
(
a
,
b
)
{
//拖拽排序
//this.list.splice(b, 1, ...this.list.splice(a, 1, this.list[b]));
let
tempArray
=
this
.
list
[
a
];
this
.
list
.
splice
(
a
,
1
);
this
.
list
.
splice
(
b
,
0
,
tempArray
);
},
l
(
key
)
{
let
vkey
=
"mes_part_task_plan_simulate"
+
"."
+
key
;
return
this
.
$t
(
vkey
)
||
key
;
},
getTime
(
value
)
{
this
.
entity
.
getTime
=
value
;
},
openApsModal
()
{
if
(
this
.
entity
.
setTime
!=
""
)
{
this
.
apsModal
=
true
;
}
else
{
this
.
$Message
.
error
(
"请设置基准日期"
);
}
},
//确定智能排产
apsOk
()
{
this
.
circleModal
=
true
;
//智能排产前订单优先级功能
let
parmsOrderpriority
=
{
alls
:
[]
};
let
arryIds
=
[];
this
.
list
.
forEach
((
e
,
index
)
=>
{
let
objIds
=
{};
objIds
.
orderId
=
e
.
part_task_pk
;
objIds
.
priority
=
index
+
1
;
arryIds
.
push
(
objIds
);
});
parmsOrderpriority
.
alls
=
arryIds
;
Api
.
orderpriority
(
parmsOrderpriority
)
.
then
((
res
)
=>
{
if
(
res
.
success
)
{
if
(
res
.
result
)
{
//this.$Message.success("排序成功");
//智能排产前检查
Api
.
apsdatachecked
()
.
then
((
res1
)
=>
{
if
(
res1
.
success
)
{
this
.
checkOk
();
}
else
{
// this.circleModal = false;
// this.$Message.error("操作失败:数据校验");
this
.
result
=
res1
.
result
;
this
.
resultModal
=
true
;
}
})
.
catch
(
function
(
err
)
{
this
.
circleModal
=
false
;
this
.
$Message
.
error
(
"操作失败"
);
}.
bind
(
this
)
);
}
else
{
this
.
circleModal
=
false
;
this
.
$Message
.
error
(
"排序失败,请重新智能排产操作"
);
}
}
else
{
this
.
circleModal
=
false
;
this
.
$Message
.
error
(
"操作失败:排序"
);
}
})
.
catch
(
function
(
err
)
{
this
.
circleModal
=
false
;
this
.
$Message
.
error
(
"操作失败"
);
}.
bind
(
this
)
);
},
checkOk
()
{
//排产计算
let
paramsTime
=
{
setTime
:
this
.
entity
.
setTime
,
rules
:
JSON
.
stringify
(
this
.
rulesAi
).
replace
(
'['
,
''
).
replace
(
']'
,
''
).
replace
(
/
\"
/g
,
''
)
};
Api
.
apsprepareandcalc
(
paramsTime
)
.
then
((
res2
)
=>
{
if
(
res2
.
success
)
{
if
(
res2
.
result
.
res
)
{
// this.$Message.success("排产计算成功");
//智能排产操作start
Api
.
aischedule
(
paramsTime
).
then
((
res3
)
=>
{
if
(
res3
.
success
)
{
if
(
res3
.
result
.
res
)
{
this
.
$Message
.
success
(
"排产成功"
);
this
.
circleModal
=
false
;
this
.
$router
.
push
({
path
:
"/aps/results"
,
// params: { customerId: id }
});
}
else
{
this
.
circleModal
=
false
;
this
.
$Message
.
error
(
res3
.
result
.
msg
);
}
}
});
//智能排产操作end
}
else
{
this
.
circleModal
=
false
;
this
.
$Message
.
error
(
res2
.
result
.
msg
);
}
}
else
{
this
.
circleModal
=
false
;
this
.
$Message
.
error
(
"操作失败:排产计算"
);
}
})
.
catch
(
function
(
err
)
{
this
.
circleModal
=
false
;
this
.
$Message
.
error
(
"操作失败"
);
}.
bind
(
this
)
);
},
getFormatDate
(
dates
)
{
const
d
=
new
Date
(
dates
);
const
resDate
=
d
.
getFullYear
()
+
"-"
+
this
.
p
(
d
.
getMonth
()
+
1
)
+
"-"
+
this
.
p
(
d
.
getDate
())
+
" 00:00:01"
;
return
resDate
;
},
p
(
s
)
{
return
s
<
10
?
"0"
+
s
:
s
;
}
},
};
</
script
>
<
style
lang=
"less"
>
.drag {
cursor: move;
}
.demo-spin-icon-load {
animation: ani-demo-spin 1s linear infinite;
}
@keyframes ani-demo-spin {
from {
transform: rotate(0deg);
}
50% {
transform: rotate(180deg);
}
to {
transform: rotate(360deg);
}
}
.demo-spin-col {
height: 100px;
position: relative;
border: 0px solid #eee;
}
.vertical-center-modal {
display: flex;
align-items: center;
justify-content: center;
.ivu-modal {
top: 0;
}
}
.tempModal {
.ivu-modal-body {
padding: 16px;
font-size: 14px;
line-height: 1.5;
padding-top: 2px;
padding-bottom: 0px;
}
.ivu-modal-footer {
border-top: none;
padding: 12px 18px 12px 18px;
text-align: right;
}
}
</
style
>
pages/aps/aps/api.js
View file @
fb26967f
...
@@ -139,12 +139,27 @@ export default {
...
@@ -139,12 +139,27 @@ export default {
},
},
//智能排产end----
//智能排产end----
//多级连排
//多级连排
start
createorderproductrelation
()
{
createorderproductrelation
()
{
return
Api
.
post
(
`
${
apsUrl
}
/apspoolappservices/createorderproductrelation`
)
return
Api
.
post
(
`
${
apsUrl
}
/apspoolappservices/createorderproductrelation`
)
},
},
apsdatascheduledlevel
(
params
)
{
apsdatascheduledlevel
(
params
)
{
return
Api
.
post
(
`
${
apsUrl
}
/apspoolappservices/aps_data_scheduled_level`
,
params
)
return
Api
.
post
(
`
${
apsUrl
}
/apspoolappservices/aps_data_scheduled_level`
,
params
)
},
},
//多级连排end
//智能排产数据包start
//数据包生成
aistep3
(
params
)
{
return
Api
.
post
(
`
${
apsUrl
}
/aps/aistep3`
,
params
)
},
//Python计算结果
aistep4
()
{
return
Api
.
post
(
`
${
apsUrl
}
/aps/aistep4`
)
},
//保存到规则表
aistep5
()
{
return
Api
.
post
(
`
${
apsUrl
}
/aps/aistep5`
)
},
//智能排产数据包end
}
}
pages/aps/results/datasShow.vue
View file @
fb26967f
<
template
>
<
template
>
<div>
<div>
<div>
应用规则:
<Select
v-model=
"rulesAi"
multiple
style=
"width: 280px"
class=
"tl"
>
<Option
v-for=
"item in rulesAiList"
:value=
"item.value"
:key=
"item.value"
>
{{
item
.
label
}}
</Option
>
</Select>
</div>
<div>
数据包结果集:
<dl
v-html=
"step3Info"
style=
"margin-left: 40px"
></dl>
</div>
<div
v-if=
"step4Statu"
>
Python计算结果:
<dl
v-html=
"step4Info"
style=
"margin-left: 40px"
></dl>
</div>
<FooterToolbar
class=
"ftball"
>
<FooterToolbar
class=
"ftball"
>
<Button
type=
"primary
"
>
下一步
</Button>
<Button
type=
"primary"
@
click=
"loadStep4
"
>
下一步
</Button>
<Button
>
取消
</Button>
<Button
@
click=
"cancel"
>
取消
</Button>
</FooterToolbar>
</FooterToolbar>
</div>
</div>
</
template
>
</
template
>
...
@@ -11,32 +30,93 @@
...
@@ -11,32 +30,93 @@
</
style
>
</
style
>
<
script
>
<
script
>
import
Api
from
"./api"
;
import
Api
from
".
./aps
/api"
;
export
default
{
export
default
{
name
:
"datasShow"
,
name
:
"datasShow"
,
components
:
{
components
:
{},
},
props
:
{
props
:
{
id
:
String
,
id
:
String
,
time
:
String
,
},
},
data
()
{
data
()
{
return
{
return
{
rulesAi
:
[
"1"
,
"2"
,
"3"
,
"4"
],
rulesAiList
:
[
{
value
:
"1"
,
label
:
"转序"
,
},
{
value
:
"2"
,
label
:
"多台"
,
},
{
value
:
"3"
,
label
:
"加班"
,
},
{
value
:
"4"
,
label
:
"公休"
,
},
],
step3Info
:
""
,
step4Info
:
""
,
step4Statu
:
false
,
step5Statu
:
false
,
};
};
},
},
created
()
{
created
()
{},
mounted
()
{
if
(
this
.
time
!=
""
)
{
this
.
loadStep3
(
this
.
time
);
}
},
},
methods
:
{
methods
:
{
loadStep3
(
val
)
{
let
paramsTime
=
{
rules
:
JSON
.
stringify
(
this
.
rulesAi
).
replace
(
'['
,
''
).
replace
(
']'
,
''
).
replace
(
/
\"
/g
,
''
),
};
Api
.
aistep3
(
paramsTime
).
then
((
res
)
=>
{
if
(
res
.
success
&&
res
.
result
!=
""
)
{
this
.
step3Info
=
res
.
result
;
}
});
},
loadStep4
()
{
if
(
!
this
.
step4Statu
&&
!
this
.
step5Statu
)
{
this
.
step4Statu
=
true
;
Api
.
aistep4
().
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
step4Info
=
res
.
result
;
}
});
}
else
if
(
this
.
step4Statu
&&
!
this
.
step5Statu
)
{
this
.
step4Statu
=
true
;
this
.
step5Statu
=
true
;
Api
.
aistep5
().
then
((
res1
)
=>
{
if
(
res1
.
success
)
{
this
.
$Message
.
success
(
"成功保存到规则表"
);
setTimeout
(
this
.
$router
.
push
({
path
:
"/aps/ai"
}),
2000
)
}
});
}
},
cancel
()
{
this
.
$emit
(
'close'
)
}
},
},
watch
:
{
watch
:
{
id
(
v
)
{
time
(
v
)
{
if
(
v
!=
''
)
{
if
(
v
!=
""
)
{
this
.
loadStep3
(
v
);
}
}
},
},
},
},
};
};
</
script
>
</
script
>
pages/aps/results/index.vue
View file @
fb26967f
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
<a
href=
"#"
@
click=
"comeBlck"
class=
"black"
>
APS排产
</a>
<a
href=
"#"
@
click=
"comeBlck"
class=
"black"
>
APS排产
</a>
</Col>
</Col>
<Col
span=
"10"
style=
"text-align: right;"
>
<Col
span=
"10"
style=
"text-align: right;"
>
<a
href=
"#"
@
click=
"datasShow"
>
数据包
</a>
<a
href=
"#"
@
click=
"datasShow"
v-if=
"false"
>
数据包
</a>
<a
href=
"#"
@
click=
"gantChart"
v-if=
"gant"
>
甘特图
</a>
<a
href=
"#"
@
click=
"gantChart"
v-if=
"gant"
>
甘特图
</a>
</Col>
</Col>
</Row>
</Row>
...
...
pages/aps/results/indexData.vue
0 → 100644
View file @
fb26967f
<
style
lang=
"less"
>
@import "./results.less";
</
style
>
<
template
>
<div
class=
"results"
>
<Layout>
<Sider
hide-trigger
width=
"300"
>
<h4>
排产方案列表
</h4>
<div
class=
"btn"
>
<a
href=
"#"
@
click=
"clear"
>
<Icon
type=
"ios-trash"
/>
<span>
清空列表
</span>
</a>
</div>
<div
class=
"left-body"
v-for=
"(li,index) in list"
:key=
"index"
:class=
"isactive == index ? 'addclass' : '' "
>
<Checkbox
v-model=
"li.checked"
class=
"i-checkbox"
@
on-change=
"changeCheck(li,index)"
></Checkbox>
<div
class=
"title-t"
@
click=
"listData(li,index)"
>
排产方案:
{{
li
.
schedule_Id
}}
</div>
<div
class=
"fa"
>
排产时间:
{{
li
.
plan_Date
}}
</div>
<div
class=
"fa"
>
<span>
{{
li
.
iNSERTFLAG
}}
/
</span>
<span>
参数级别:
{{
li
.
routing_schema
}}
/
</span>
<span>
参数应用:
{{
li
.
routing_version
}}
</span>
</div>
</div>
</Sider>
<Content>
<Row
class=
"i-row"
>
<Col
span=
"2"
v-if=
"blacks"
>
<h4
:text=
"title"
>
{{
title
}}
</h4>
</Col>
<Col
span=
"10"
>
<a
href=
"#"
@
click=
"comeBlck"
class=
"black"
>
智能排产
</a>
</Col>
<Col
span=
"10"
style=
"text-align: right;"
v-if=
"gant"
>
<a
href=
"#"
@
click=
"datasShow"
>
数据包
</a>
<a
href=
"#"
@
click=
"gantChart"
>
甘特图
</a>
</Col>
</Row>
<component
:is=
"detail"
:eid=
"id"
:schemas=
"schemas"
@
ok-claer=
"clearS"
/>
</Content>
</Layout>
<div
class=
"footer"
v-if=
"showFooter"
>
<span>
已选:
{{
schemas
.
length
}}
项
</span>
<Button
type=
"primary"
@
click=
"submit"
>
方案对比
</Button>
<Button
type=
"default"
@
click=
"cancel"
>
取消
</Button>
</div>
<Modal
v-model=
"modal1Gant"
fullscreen
:title=
"modalTitle"
footer-hide
>
<!--
<Gantt
:id=
"id"
/>
-->
<gantt
:is=
"gantt"
:id=
"id"
:time=
"time"
@
close=
"closemodal"
/>
</Modal>
</div>
</
template
>
<
script
>
import
Api
from
"./api"
;
// import Gantt from "./gantt";
export
default
{
// components: {
// Gantt
// },
data
()
{
return
{
curId
:
null
,
detail
:
null
,
isactive
:
null
,
list
:
[],
name
:
"name1"
,
id
:
null
,
contrastList
:
[],
title
:
""
,
modal1Gant
:
false
,
showFooter
:
false
,
total
:
0
,
blacks
:
false
,
gant
:
false
,
gantt
:
null
,
curPage
:
null
,
modalTitle
:
'甘特图'
,
time
:
''
,
};
},
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
},
created
()
{
this
.
orderlist
();
},
methods
:
{
clickTab
(
name
)
{},
orderlist
()
{
Api
.
getall
()
.
then
(
r
=>
{
if
(
r
.
result
)
{
this
.
list
=
r
.
result
;
this
.
list
.
map
(
u
=>
{
u
.
checked
=
false
;
});
}
})
.
catch
(
error
=>
{
this
.
$Message
.
error
(
"请求失败"
);
});
},
listData
(
row
,
index
)
{
this
.
blacks
=
true
;
this
.
gant
=
true
;
this
.
detail
=
()
=>
import
(
"./result"
);
this
.
isactive
=
index
;
this
.
id
=
row
.
schedule_Id
;
this
.
time
=
row
.
plan_Date
;
this
.
title
=
"排产方案结果"
;
},
clear
()
{
if
(
this
.
list
.
length
>
0
)
{
this
.
$Modal
.
confirm
({
title
:
"清空列表"
,
content
:
"您确定要清空列表吗"
,
onOk
:
()
=>
{
Api
.
clearall
().
then
(
r
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"清空列表成功"
);
this
.
orderlist
();
this
.
id
=
0
;
this
.
listData
();
}
});
},
onCancel
:
()
=>
{
this
.
$Message
.
info
(
"已取消"
);
}
});
}
},
clearS
()
{
this
.
id
=
0
;
Api
.
clearall
().
then
(
r
=>
{
if
(
r
.
success
)
{
this
.
orderlist
();
this
.
id
=
0
;
this
.
listData
();
}
});
},
// 返回
comeBlck
()
{
this
.
$router
.
push
({
path
:
"/aps/ai"
});
},
parameter
()
{
Api
.
processschemedispatch
({
id
:
this
.
id
}).
then
(
r
=>
{
if
(
r
.
result
)
{
this
.
$Message
.
success
(
r
.
result
.
retmsg
);
this
.
orderlist
();
}
else
{
this
.
$Message
.
success
(
"下发失败"
);
}
});
},
//甘特图
gantChart
()
{
this
.
modal1Gant
=
true
;
this
.
modalTitle
=
'甘特图'
;
this
.
gantt
=
()
=>
import
(
"./gantt"
);
},
datasShow
()
{
this
.
modal1Gant
=
true
;
this
.
modalTitle
=
'生成数据包'
;
this
.
gantt
=
()
=>
import
(
"./datasShow"
);
},
changeCheck
(
item
,
i
)
{
this
.
$set
(
this
.
list
,
i
,
item
);
if
(
this
.
title
!=
"排产方案对比"
)
{
this
.
showFooter
=
true
;
}
},
submit
()
{
this
.
detail
=
()
=>
import
(
"./compare"
);
this
.
title
=
"排产方案对比"
;
this
.
showFooter
=
false
;
},
cancel
()
{
this
.
showFooter
=
false
;
},
closemodal
(){
this
.
modal1Gant
=
false
this
.
time
=
''
}
},
computed
:
{
schemas
()
{
return
this
.
list
.
filter
(
u
=>
{
return
u
.
checked
==
true
;
});
}
}
};
</
script
>
\ No newline at end of file
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