Commit 1ef71837 authored by 仇晓婷's avatar 仇晓婷

Merge branch 'master' of http://git.mes123.com/zhouyx/mes-ui

parents 1545607a ca60ff1c
{
"vue3snippets.enable-compile-vue-file-on-did-save-code": false
}
\ No newline at end of file
......@@ -88,7 +88,7 @@ export default {
methods: {
handler() {
if (this.disable == 0) {
if (this.oprate == "delete" || this.oprate == "remove"||this.msg.length>0) {
if (this.oprate == "delete" || this.oprate == "remove"||this.msg!='确认要删除吗?') {
this.$Modal.confirm({
title: this.title,
content: "<p>" + this.msg + "</p>",
......
......@@ -6,10 +6,10 @@
<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>
</Select> -->
<DatePicker type="date" placeholder="设置基准日期" style="width: 150px;" v-model="entity.setTime" @on-change="getTime"></DatePicker>
<Button type="primary" @click="openApsModal">智能排产</Button>
</template>
......@@ -17,7 +17,7 @@
<Button type="primary" class="mr10 ml10" @click="removeOk">移出排产</Button>
</template>
</DataGrid>
<Modal v-model="apsModal" title="确定智能排产" @on-ok="apsOk" @on-cancel="cancel">
<Modal v-model="apsModal" title="确定进行智能排产" @on-ok="apsOk" @on-cancel="cancel">
<p>确定进行智能排产?</p>
</Modal>
......@@ -505,30 +505,18 @@ export default {
//排产计算
let paramsTime = {
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)
.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);
}
}
this.$Message.success("排产计算成功");
this.circleModal = false;
this.$router.push({
path: "/aps/results"
// params: { customerId: id }
});
//智能排产操作end
} else {
this.circleModal = false;
this.$Message.error(res2.result.msg);
......
This diff is collapsed.
......@@ -139,12 +139,27 @@ export default {
},
//智能排产end----
//多级连排
//多级连排start
createorderproductrelation() {
return Api.post(`${apsUrl}/apspoolappservices/createorderproductrelation`)
},
apsdatascheduledlevel(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
}
<template>
<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">
<Button type="primary" @click="loadStep4">下一步</Button>
<Button @click="cancel">取消</Button>
</FooterToolbar>
</div>
</template>
<style>
</style>
<script>
import Api from "../aps/api";
export default {
name: "datasShow",
components: {},
props: {
id: String,
time: String,
},
data() {
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() {},
mounted() {
if (this.time != "") {
this.loadStep3(this.time);
}
},
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("成功保存到规则表");
this.$router.push({ path: "/aps/ai" });
}
});
}
},
cancel()
{
this.$emit('close')
}
},
watch: {
time(v) {
if (v != "") {
this.loadStep3(v);
}
},
},
};
</script>
......@@ -19,7 +19,7 @@
: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.schedule_Id,index)">排产方案:{{li.schedule_Id}}</div>
<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>
......@@ -34,10 +34,11 @@
<h4 :text="title">{{title}}</h4>
</Col>
<Col span="10">
<a href="#" @click="comeBlck" class="black">APS排产</a>
<a href="#" @click="comeBlck" class="black">{{apsTitle}}</a>
</Col>
<Col span="10" style="text-align: right;" v-if="gant">
<a href="#" @click="gantChart" class="gant">甘特图</a>
<Col span="10" style="text-align: right;" >
<a href="#" @click="datasShow" v-if="apsTitle=='智能排产'">数据包</a>
<a href="#" @click="gantChart" v-if="gant">甘特图</a>
</Col>
</Row>
......@@ -49,9 +50,9 @@
<Button type="primary" @click="submit">方案对比</Button>&nbsp;
<Button type="default" @click="cancel">取消</Button>
</div>
<Modal v-model="modal1Gant" fullscreen title="甘特图" footer-hide>
<Modal v-model="modal1Gant" fullscreen :title="modalTitle" footer-hide>
<!-- <Gantt :id="id" /> -->
<gantt :is="gantt" :id="id" />
<gantt :is="gantt" :id="id" :time="time" @close="closemodal" />
</Modal>
</div>
</template>
......@@ -78,13 +79,30 @@ export default {
blacks: false,
gant: false,
gantt: null,
curPage: null
curPage: null,
modalTitle:'甘特图',
time:'',
apsTitle:'',
};
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
created() {
let apsCount=this.$store.state.countAps
let aiCount=this.$store.state.countAi
if(apsCount>0&&aiCount==0)
{
this.apsTitle="APS排产"
}
else if(apsCount==0&&aiCount>0)
{
this.apsTitle="智能排产"
}
else
{
this.apsTitle=""
}
this.orderlist();
},
methods: {
......@@ -103,12 +121,13 @@ export default {
this.$Message.error("请求失败");
});
},
listData(id, index) {
listData(row, index) {
this.blacks = true;
this.gant = true;
this.detail = () => import("./result");
this.isactive = index;
this.id = id;
this.id = row.schedule_Id;
this.time=row.plan_Date;
this.title = "排产方案结果";
},
clear() {
......@@ -144,7 +163,14 @@ export default {
},
// 返回
comeBlck() {
this.$router.push({ path: "/aps/aps" });
if(this.apsTitle=="APS排产")
{
this.$router.push({ path: "/aps/aps" });
}
else
{
this.$router.push({ path: "/aps/ai" });
}
},
parameter() {
Api.processschemedispatch({
......@@ -161,7 +187,13 @@ export default {
//甘特图
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);
......@@ -176,6 +208,10 @@ export default {
},
cancel() {
this.showFooter = false;
},
closemodal(){
this.modal1Gant=false
this.time=''
}
},
computed: {
......
<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.schedule_Id,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">APS排产</a>
</Col>
<Col span="10" style="text-align: right;">
<a href="#" @click="datasShow" v-if="false">数据包</a>
<a href="#" @click="gantChart" v-if="gant">甘特图</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>&nbsp;&nbsp;&nbsp;
<Button type="primary" @click="submit">方案对比</Button>&nbsp;
<Button type="default" @click="cancel">取消</Button>
</div>
<Modal v-model="modal1Gant" fullscreen :title="modalTitle" footer-hide>
<!-- <Gantt :id="id" /> -->
<gantt :is="gantt" :id="id" />
</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:'甘特图'
};
},
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(id, index) {
this.blacks = true;
this.gant = true;
this.detail = () => import("./result");
this.isactive = index;
this.id = id;
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/aps" });
},
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;
}
},
computed: {
schemas() {
return this.list.filter(u => {
return u.checked == true;
});
}
}
};
</script>
\ No newline at end of file
......@@ -2,14 +2,13 @@
<div class="router-main flex fc-m fa-m pr">
<ul class="pa navMenu">
<li
class="navMenuLi flex fc-m fa-m pr"
v-for="(item, index) in menus"
:key="index"
@mouseenter="navClick(item,index)"
class="navMenuLi flex fc-m fa-m pr cursor"
v-for="(item, indx) in menus"
:key="indx"
@mouseenter="navClick(item, indx)"
>
<Icon :type="item.icons" class="f16" />{{ item.name }}
</li>
</ul>
<div class="bdImg pr" @click="pageClick">
<div
......@@ -32,16 +31,89 @@
</li>
</ul>
</div>
<!-- @click="removeLine(s)" -->
<div
v-for="(line, s) in lines"
class="pa line"
:style="lineStyles(line, s)"
:key="'s' + s"
:title="line.start.join() + ':' + line.end.join()"
>
<div class="lineMarker pa"></div>
</div>
</div>
</div>
</template>
<script>
import { isInteger } from "lodash";
import { has, hasIn, isInteger } from "lodash";
import viewerVue from "../test/viewer.vue";
export default {
data() {
return {
lines: [
{
start: [879, 214],
end: [922,188],
},
{
start: [387, 277],
end: [420, 298],
},
{
start: [505 ,351],
end: [539, 372],
},
{
start: [507 ,445],
end: [547, 423],
},
{
start: [639, 370],
end: [678 ,345],
},
{
start: [670, 400],
end: [762 ,403],
},
{
start: [637, 424],
end: [740, 483],
},
{
start: [874 ,474],
end: [837, 496],
},
{
start: [1050 ,187],
end: [1081, 205],
},
{
start: [1253, 251],
end: [1293 ,226],
},
{
start: [1312, 371],
end: [1341, 390],
},
{
start: [185 ,648],
end: [241 ,617],
},
{
start: [375 ,541],
end: [432 ,509],
},
{
start: [873 ,568],
end: [934 ,600],
},
],
// start: 0,
// dotA: [],
// dotB: [],
// dots: [],
menus: [],
list: [],
arrList: [],
......@@ -56,37 +128,57 @@ export default {
},
mounted() {
this.load();
// this.lineClick();
},
methods: {
load() {
this.$api.get(`${systemUrl}/menu/getusermenu?id=mes_roter`).then((r) => {
if (r.result) {
let arr = r.result[0].children.map((l) => {
if ( !this.$u.isNull(l.description) && l.description.indexOf("{") > -1 ) {
if (
!this.$u.isNull(l.description) &&
l.description.indexOf("{") > -1
) {
l.style = eval("(" + l.description + ")");
}
return l;
});
this.arrList = arr;
this.arrList.map(v=>{
if(v.name=='项目管理'){
this.menus[0]=v;
this.menus[0].icons='ios-list-box-outline';
}else if(v.name=='文档管理'){
this.menus[1]=v;
this.menus[1].icons='md-document';
}else if(v.name=='大屏展示'){
this.menus[2]=v;
this.menus[2].icons='ios-stats';
this.arrList.map((v) => {
if (v.name == "项目管理") {
this.menus[0] = v;
this.menus[0].icons = "ios-list-box-outline";
} else if (v.name == "文档管理") {
this.menus[1] = v;
this.menus[1].icons = "md-document";
} else if (v.name == "大屏展示") {
this.menus[2] = v;
this.menus[2].icons = "ios-stats";
}
})
console.log(this.menus)
});
}
});
},
pageClick() {
pageClick(event) {
// console.log("event", event);
// console.log(event.layerX, event.layerY);
this.menu = false;
this.oneShow = false;
// this.dots.push({
// left: event.layerX + "px",
// top: event.layerY + "px",
// });
// if (this.start === 0) {
// this.dotA = [event.layerX, event.layerY];
// this.start = 1;
// } else {
// this.dotB = [event.layerX, event.layerY];
// this.start = 0;
// this.lines.push({
// start: this.dotA,
// end: this.dotB,
// });
// }
},
clickLi(v) {
if (v) {
......@@ -104,20 +196,37 @@ export default {
this.menuPos = { left, top };
}
},
navClick(v,index) {
navClick(v, index) {
if (v.children && v.children.length > 0) {
var { left, top } = v.style;
this.list = v.children;
this.menuPos = { left, top };
this.menuPos = { left, top };
this.menu = true;
}else{
this.menu = false;
} else {
this.menu = false;
}
},
leavePosition() {
this.oneShow = false;
this.menu = false;
},
removeLine(s){
this.lines.splice(s,1);
},
lineStyles(line, s) {
let w = line.end[0] - line.start[0];
let h = line.end[1] - line.start[1];
let l = Math.sqrt(Math.pow(w, 2) + Math.pow(h, 2));
let sinA =
Math.atan2(line.end[1] - line.start[1], line.end[0] - line.start[0]) /
0.017453292;
return {
width: l + "px",
transform: "rotate(" + sinA + "deg)",
top: line.start[1] + "px",
left: line.start[0] + "px",
};
},
},
};
</script>
......@@ -130,7 +239,6 @@ export default {
top: 90px;
left: 95px;
.navMenuLi {
cursor: pointer;
width: 185px;
height: 99px;
color: #ffffff;
......@@ -165,7 +273,46 @@ export default {
.bdImg {
height: 822px;
width: 1700px;
background: url("../../assets/images/home/router/routerMain.png") no-repeat;
background: url("../../assets/images/home/router/welcome.png") no-repeat;
.line {
height: 2px;
// top: 50px;
// left: 50px;
// width: 200px;
background: linear-gradient(to right, #a7c4d8, #24bddd);
transform-origin: left;
.lineMarker {
display: inline-block;
width: 7px;
height: 7px;
left: 0;
top: 0;
transform: rotate(50deg) translateY(-4px);
animation: myfirst 1s infinite;
background: url("../../assets/images/home/router/linemarker.png")
no-repeat;
}
@keyframes myfirst {
from {
left: 0%;
}
to {
left: 85%;
}
}
// }
}
.line:hover{
border: 1px dotted red;
height: 6px;
cursor:pointer;
}
.dot {
width: 8px;
height: 8px;
background: red;
border-radius: 50%;
}
}
.menu {
width: 100px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment