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
677c6af7
Commit
677c6af7
authored
Jul 27, 2020
by
renjintao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ai api.js
parent
912fb1d2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
84 additions
and
76 deletions
+84
-76
index.vue
pages/aps/ai/index.vue
+75
-72
api.js
pages/aps/aps/api.js
+9
-4
No files found.
pages/aps/ai/index.vue
View file @
677c6af7
...
...
@@ -34,7 +34,7 @@
<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>
...
...
@@ -52,7 +52,6 @@
</Col>
</Row>
</Modal>
</div>
</template>
<
script
>
...
...
@@ -69,21 +68,21 @@ export default {
Expand
,
Temp
,
Duration
,
CheckResult
CheckResult
,
},
data
()
{
return
{
action
:
Api
.
index
,
easySearch
:
{
keys
:
{
op
:
"notes"
,
value
:
null
}
keys
:
{
op
:
"notes"
,
value
:
null
}
,
},
result
:
{
res
:
true
,
datas
:
'{}'
datas
:
"{}"
,
},
resultModal
:
false
,
entity
:
{
setTime
:
""
setTime
:
""
,
},
editModal
:
false
,
detailModal
:
false
,
...
...
@@ -106,11 +105,11 @@ export default {
return
h
(
"Icon"
,
{
attrs
:
{
type
:
"md-more"
,
size
:
18
size
:
18
,
},
class
:
"drag"
class
:
"drag"
,
});
}
}
,
},
{
type
:
"expand"
,
...
...
@@ -118,16 +117,16 @@ export default {
render
:
(
h
,
params
)
=>
{
return
h
(
Expand
,
{
props
:
{
rowId
:
params
.
row
.
part_task_pk
}
rowId
:
params
.
row
.
part_task_pk
,
}
,
});
}
}
,
},
{
key
:
"selection"
,
type
:
"selection"
,
width
:
50
,
align
:
"center"
align
:
"center"
,
},
{
key
:
"id"
,
...
...
@@ -135,38 +134,38 @@ export default {
hide
:
true
,
align
:
"left"
,
sortable
:
true
,
width
:
50
width
:
50
,
},
{
key
:
"mesCode"
,
title
:
this
.
l
(
"mes_code"
),
align
:
"left"
,
high
:
true
,
width
:
240
width
:
240
,
},
{
key
:
"product_name"
,
title
:
this
.
l
(
"product_name"
),
align
:
"left"
,
high
:
true
high
:
true
,
},
{
key
:
"drawingnum"
,
title
:
this
.
l
(
"drawingnum"
),
align
:
"left"
,
high
:
true
high
:
true
,
},
{
key
:
"project_no"
,
title
:
this
.
l
(
"project_no"
),
align
:
"left"
,
high
:
true
high
:
true
,
},
{
key
:
"batchnum"
,
title
:
this
.
l
(
"batchnum"
),
align
:
"left"
,
high
:
true
high
:
true
,
},
{
key
:
"urgency_level"
,
...
...
@@ -174,7 +173,7 @@ export default {
align
:
"left"
,
high
:
true
,
code
:
"plan.order.urgencyLevel"
,
width
:
100
width
:
100
,
},
{
key
:
"priority"
,
...
...
@@ -184,14 +183,14 @@ export default {
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
high
:
true
,
},
{
key
:
"spare_qty"
,
...
...
@@ -199,7 +198,7 @@ export default {
align
:
"right"
,
width
:
100
,
high
:
true
,
hide
:
true
hide
:
true
,
},
{
key
:
"plan_start"
,
...
...
@@ -208,7 +207,7 @@ export default {
high
:
true
,
hide
:
true
,
resizable
:
true
,
width
:
150
width
:
150
,
},
{
key
:
"plan_finish"
,
...
...
@@ -218,7 +217,7 @@ export default {
hide
:
true
,
sortable
:
true
,
resizable
:
true
,
width
:
150
width
:
150
,
},
{
key
:
"notes"
,
...
...
@@ -226,7 +225,7 @@ export default {
align
:
"left"
,
easy
:
true
,
high
:
true
,
hide
:
true
hide
:
true
,
},
{
key
:
"demand_start"
,
...
...
@@ -234,7 +233,7 @@ export default {
align
:
"center"
,
resizable
:
true
,
width
:
150
,
type
:
"date"
type
:
"date"
,
},
{
key
:
"demand_finish"
,
...
...
@@ -243,14 +242,14 @@ export default {
high
:
true
,
resizable
:
true
,
width
:
150
,
type
:
"date"
type
:
"date"
,
},
{
key
:
"badjustflag"
,
title
:
this
.
l
(
"badjustflag"
),
align
:
"left"
,
high
:
true
,
hide
:
true
hide
:
true
,
},
{
title
:
"操作"
,
...
...
@@ -266,9 +265,9 @@ export default {
type
:
"icon"
,
title
:
"恢复工序"
,
oprate
:
"edit"
,
msg
:
"确认要恢复工序吗?"
msg
:
"确认要恢复工序吗?"
,
},
on
:
{
click
:
()
=>
this
.
refresh
(
params
.
row
.
part_task_pk
)
}
on
:
{
click
:
()
=>
this
.
refresh
(
params
.
row
.
part_task_pk
)
}
,
}),
h
(
"op"
,
{
attrs
:
{
...
...
@@ -276,13 +275,13 @@ export default {
type
:
"icon"
,
title
:
"移出排产池"
,
oprate
:
"delete"
,
msg
:
"确认要移出排产吗?"
msg
:
"确认要移出排产吗?"
,
},
on
:
{
click
:
()
=>
this
.
remove
(
params
.
row
.
part_task_pk
)
}
})
on
:
{
click
:
()
=>
this
.
remove
(
params
.
row
.
part_task_pk
)
}
,
})
,
]);
}
}
}
,
}
,
],
arrPartPkId
:
[],
//设置参数开始
...
...
@@ -290,11 +289,11 @@ export default {
opTaskPk
:
0
,
//工单ID
partTaskPk
:
0
,
//生产计划ID
taskSeq
:
""
,
//工序编号
count
:
0
//生产计划数量
count
:
0
,
//生产计划数量
},
//设置参数结束
circleModal
:
false
,
//进度条
tempStatu
:
0
//新建模型时传过来的id值
tempStatu
:
0
,
//新建模型时传过来的id值
};
},
mounted
()
{
...
...
@@ -306,14 +305,13 @@ export default {
methods
:
{
//排产池加载数据列表
loadList
()
{
Api
.
getall
().
then
(
res
=>
{
Api
.
getall
().
then
(
(
res
)
=>
{
if
(
res
.
success
)
{
this
.
list
=
res
.
result
;
}
});
},
detail
(
id
)
{
this
.
detailModal
=
true
;
this
.
curId
=
id
;
...
...
@@ -325,9 +323,9 @@ export default {
refresh
(
partPkId
)
{
//恢复工序
let
params
=
{
id
:
partPkId
id
:
partPkId
,
};
Api
.
recoveryoptasksimluate
(
params
).
then
(
r
=>
{
Api
.
recoveryoptasksimluate
(
params
).
then
(
(
r
)
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"恢复成功"
);
this
.
list
=
[];
...
...
@@ -345,10 +343,10 @@ export default {
paramsArry
.
push
(
partPkId
);
}
let
params
=
{
partPks
:
paramsArry
partPks
:
paramsArry
,
};
Api
.
beforeshiftoutapspool
(
params
)
.
then
(
res
=>
{
.
then
(
(
res
)
=>
{
if
(
res
.
success
)
{
if
(
res
.
result
)
{
this
.
checkapspool
(
params
);
...
...
@@ -361,7 +359,7 @@ export default {
this
.
$Message
.
error
(
"校验失败"
);
}
})
.
catch
(
err
=>
{
.
catch
(
(
err
)
=>
{
this
.
$Message
.
error
(
"连接错误1"
);
});
},
...
...
@@ -370,7 +368,7 @@ export default {
},
checkapspool
(
params
)
{
Api
.
shiftoutapspool
(
params
)
.
then
(
r
=>
{
.
then
(
(
r
)
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"移出排产池操作成功"
);
this
.
loadList
();
...
...
@@ -383,7 +381,7 @@ export default {
this
.
$Message
.
error
(
"移出排产池操作失败"
);
}
})
.
catch
(
err
=>
{
.
catch
(
(
err
)
=>
{
this
.
$Message
.
error
(
"连接失败2"
);
});
},
...
...
@@ -391,7 +389,7 @@ export default {
//批量选择
let
selectRows
=
a
;
this
.
arrPartPkId
=
[];
selectRows
.
forEach
(
e
=>
{
selectRows
.
forEach
(
(
e
)
=>
{
this
.
arrPartPkId
.
push
(
e
.
part_task_pk
);
});
},
...
...
@@ -418,7 +416,7 @@ export default {
this
.
list
.
splice
(
a
,
1
);
this
.
list
.
splice
(
b
,
0
,
tempArray
);
},
getUserDepart
()
{
alert
(
"5656565"
);
// Api.getUserDepart().then(res=>{
...
...
@@ -441,7 +439,7 @@ export default {
this
.
$Message
.
error
(
"请设置基准日期"
);
}
},
//确定智能排产
apsOk
()
{
this
.
circleModal
=
true
;
...
...
@@ -457,13 +455,13 @@ export default {
parmsOrderpriority
.
alls
=
arryIds
;
// alert(JSON.stringify(parmsOrderpriority));
Api
.
orderpriority
(
parmsOrderpriority
)
.
then
(
res
=>
{
.
then
(
(
res
)
=>
{
if
(
res
.
success
)
{
if
(
res
.
result
)
{
//this.$Message.success("排序成功");
//智能排产前检查
Api
.
apsdatachecked
()
.
then
(
res1
=>
{
.
then
(
(
res1
)
=>
{
if
(
res1
.
success
)
{
// this.result=res1.result;
// this.resultModal=true;
...
...
@@ -471,12 +469,12 @@ export default {
}
else
{
// this.circleModal = false;
// this.$Message.error("操作失败:数据校验");
this
.
result
=
res1
.
result
;
this
.
resultModal
=
true
;
this
.
result
=
res1
.
result
;
this
.
resultModal
=
true
;
}
})
.
catch
(
function
(
err
)
{
function
(
err
)
{
this
.
circleModal
=
false
;
this
.
$Message
.
error
(
"操作失败"
);
}.
bind
(
this
)
...
...
@@ -491,7 +489,7 @@ export default {
}
})
.
catch
(
function
(
err
)
{
function
(
err
)
{
this
.
circleModal
=
false
;
this
.
$Message
.
error
(
"操作失败"
);
}.
bind
(
this
)
...
...
@@ -500,22 +498,30 @@ export default {
checkOk
()
{
//排产计算
let
paramsTime
=
{
setTime
:
this
.
entity
.
setTime
setTime
:
this
.
entity
.
setTime
,
};
Api
.
apsprepareandcalc
(
paramsTime
)
.
then
(
res2
=>
{
.
then
(
(
res2
)
=>
{
if
(
res2
.
success
)
{
if
(
res2
.
result
.
res
)
{
this
.
$Message
.
success
(
"排产计算成功"
);
//
this.$Message.success("排产计算成功");
//智能排产操作start
//只能排产操作end
this
.
circleModal
=
false
;
this
.
$router
.
push
({
path
:
"/ai/results"
// params: { customerId: id }
Api
.
aischedule
(
paramsTime
).
then
((
res3
)
=>
{
if
(
res3
.
success
)
{
if
(
res3
.
result
.
res
)
{
this
.
$Message
.
success
(
"排产成功"
);
this
.
circleModal
=
false
;
this
.
$router
.
push
({
path
:
"/ai/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
);
...
...
@@ -526,16 +532,13 @@ export default {
}
})
.
catch
(
function
(
err
)
{
function
(
err
)
{
this
.
circleModal
=
false
;
this
.
$Message
.
error
(
"操作失败"
);
}.
bind
(
this
)
);
},
}
},
};
</
script
>
<
style
lang=
"less"
>
...
...
pages/aps/aps/api.js
View file @
677c6af7
...
...
@@ -121,16 +121,21 @@ export default {
},
//保存外协任务工期
saveoutsidetime
(
params
)
{
return
Api
.
post
(
`
${
apsUrl
}
/apspoolappservices/saveoutsidetime
`
,
params
)
return
Api
.
post
(
`
${
apsUrl
}
/apspoolappservices/saveoutsidetime`
,
params
)
},
//保存插单任务
saveinsertorder
(
params
)
{
return
Api
.
post
(
`
${
apsUrl
}
/apspoolappservices/saveinsertorder
`
,
params
)
return
Api
.
post
(
`
${
apsUrl
}
/apspoolappservices/saveinsertorder`
,
params
)
},
//取消插单任务
cancelinsertorder
(
params
)
{
return
Api
.
post
(
`
${
apsUrl
}
/apspoolappservices/cancelinsertorder
`
,
params
)
return
Api
.
post
(
`
${
apsUrl
}
/apspoolappservices/cancelinsertorder`
,
params
)
},
//修改外协工期相关end-----
//智能排产start----
aischedule
(
params
)
{
return
Api
.
post
(
`
${
apsUrl
}
/aps/aischedule`
,
params
)
},
//智能排产end----
}
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