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 { ...@@ -88,7 +88,7 @@ export default {
methods: { methods: {
handler() { handler() {
if (this.disable == 0) { 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({ this.$Modal.confirm({
title: this.title, title: this.title,
content: "<p>" + this.msg + "</p>", content: "<p>" + this.msg + "</p>",
......
...@@ -6,10 +6,10 @@ ...@@ -6,10 +6,10 @@
<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">智能排产</Button>
</template> </template>
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<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="确定进行智能排产" @on-ok="apsOk" @on-cancel="cancel">
<p>确定进行智能排产?</p> <p>确定进行智能排产?</p>
</Modal> </Modal>
...@@ -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"
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);
......
<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>
...@@ -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
} }
<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 @@ ...@@ -19,7 +19,7 @@
:class="isactive == index ? 'addclass' : '' " :class="isactive == index ? 'addclass' : '' "
> >
<Checkbox v-model="li.checked" class="i-checkbox" @on-change="changeCheck(li,index)"></Checkbox> <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">排产时间:{{li.plan_Date}}</div>
<div class="fa"> <div class="fa">
<span>{{li.iNSERTFLAG}} /</span> <span>{{li.iNSERTFLAG}} /</span>
...@@ -34,10 +34,11 @@ ...@@ -34,10 +34,11 @@
<h4 :text="title">{{title}}</h4> <h4 :text="title">{{title}}</h4>
</Col> </Col>
<Col span="10"> <Col span="10">
<a href="#" @click="comeBlck" class="black">APS排产</a> <a href="#" @click="comeBlck" class="black">{{apsTitle}}</a>
</Col> </Col>
<Col span="10" style="text-align: right;" v-if="gant"> <Col span="10" style="text-align: right;" >
<a href="#" @click="gantChart" class="gant">甘特图</a> <a href="#" @click="datasShow" v-if="apsTitle=='智能排产'">数据包</a>
<a href="#" @click="gantChart" v-if="gant">甘特图</a>
</Col> </Col>
</Row> </Row>
...@@ -49,9 +50,9 @@ ...@@ -49,9 +50,9 @@
<Button type="primary" @click="submit">方案对比</Button>&nbsp; <Button type="primary" @click="submit">方案对比</Button>&nbsp;
<Button type="default" @click="cancel">取消</Button> <Button type="default" @click="cancel">取消</Button>
</div> </div>
<Modal v-model="modal1Gant" fullscreen title="甘特图" footer-hide> <Modal v-model="modal1Gant" fullscreen :title="modalTitle" footer-hide>
<!-- <Gantt :id="id" /> --> <!-- <Gantt :id="id" /> -->
<gantt :is="gantt" :id="id" /> <gantt :is="gantt" :id="id" :time="time" @close="closemodal" />
</Modal> </Modal>
</div> </div>
</template> </template>
...@@ -78,13 +79,30 @@ export default { ...@@ -78,13 +79,30 @@ export default {
blacks: false, blacks: false,
gant: false, gant: false,
gantt: null, gantt: null,
curPage: null curPage: null,
modalTitle:'甘特图',
time:'',
apsTitle:'',
}; };
}, },
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
created() { 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(); this.orderlist();
}, },
methods: { methods: {
...@@ -103,12 +121,13 @@ export default { ...@@ -103,12 +121,13 @@ export default {
this.$Message.error("请求失败"); this.$Message.error("请求失败");
}); });
}, },
listData(id, index) { listData(row, index) {
this.blacks = true; this.blacks = true;
this.gant = true; this.gant = true;
this.detail = () => import("./result"); this.detail = () => import("./result");
this.isactive = index; this.isactive = index;
this.id = id; this.id = row.schedule_Id;
this.time=row.plan_Date;
this.title = "排产方案结果"; this.title = "排产方案结果";
}, },
clear() { clear() {
...@@ -144,7 +163,14 @@ export default { ...@@ -144,7 +163,14 @@ export default {
}, },
// 返回 // 返回
comeBlck() { 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() { parameter() {
Api.processschemedispatch({ Api.processschemedispatch({
...@@ -161,7 +187,13 @@ export default { ...@@ -161,7 +187,13 @@ export default {
//甘特图 //甘特图
gantChart() { gantChart() {
this.modal1Gant = true; this.modal1Gant = true;
this.modalTitle='甘特图';
this.gantt = () => import("./gantt"); this.gantt = () => import("./gantt");
},
datasShow() {
this.modal1Gant = true;
this.modalTitle='生成数据包';
this.gantt = () => import("./datasShow");
}, },
changeCheck(item, i) { changeCheck(item, i) {
this.$set(this.list, i, item); this.$set(this.list, i, item);
...@@ -176,6 +208,10 @@ export default { ...@@ -176,6 +208,10 @@ export default {
}, },
cancel() { cancel() {
this.showFooter = false; this.showFooter = false;
},
closemodal(){
this.modal1Gant=false
this.time=''
} }
}, },
computed: { 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 @@ ...@@ -2,14 +2,13 @@
<div class="router-main flex fc-m fa-m pr"> <div class="router-main flex fc-m fa-m pr">
<ul class="pa navMenu"> <ul class="pa navMenu">
<li <li
class="navMenuLi flex fc-m fa-m pr" class="navMenuLi flex fc-m fa-m pr cursor"
v-for="(item, index) in menus" v-for="(item, indx) in menus"
:key="index" :key="indx"
@mouseenter="navClick(item,index)" @mouseenter="navClick(item, indx)"
> >
<Icon :type="item.icons" class="f16" />{{ item.name }} <Icon :type="item.icons" class="f16" />{{ item.name }}
</li> </li>
</ul> </ul>
<div class="bdImg pr" @click="pageClick"> <div class="bdImg pr" @click="pageClick">
<div <div
...@@ -32,16 +31,89 @@ ...@@ -32,16 +31,89 @@
</li> </li>
</ul> </ul>
</div> </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>
</div> </div>
</template> </template>
<script> <script>
import { isInteger } from "lodash"; import { has, hasIn, isInteger } from "lodash";
import viewerVue from "../test/viewer.vue"; import viewerVue from "../test/viewer.vue";
export default { export default {
data() { data() {
return { 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: [], menus: [],
list: [], list: [],
arrList: [], arrList: [],
...@@ -56,37 +128,57 @@ export default { ...@@ -56,37 +128,57 @@ export default {
}, },
mounted() { mounted() {
this.load(); this.load();
// this.lineClick();
}, },
methods: { methods: {
load() { load() {
this.$api.get(`${systemUrl}/menu/getusermenu?id=mes_roter`).then((r) => { this.$api.get(`${systemUrl}/menu/getusermenu?id=mes_roter`).then((r) => {
if (r.result) { if (r.result) {
let arr = r.result[0].children.map((l) => { 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 + ")"); l.style = eval("(" + l.description + ")");
} }
return l; return l;
}); });
this.arrList = arr; this.arrList = arr;
this.arrList.map(v=>{ this.arrList.map((v) => {
if(v.name=='项目管理'){ if (v.name == "项目管理") {
this.menus[0]=v; this.menus[0] = v;
this.menus[0].icons='ios-list-box-outline'; this.menus[0].icons = "ios-list-box-outline";
}else if(v.name=='文档管理'){ } else if (v.name == "文档管理") {
this.menus[1]=v; this.menus[1] = v;
this.menus[1].icons='md-document'; this.menus[1].icons = "md-document";
}else if(v.name=='大屏展示'){ } else if (v.name == "大屏展示") {
this.menus[2]=v; this.menus[2] = v;
this.menus[2].icons='ios-stats'; 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.menu = false;
this.oneShow = 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) { clickLi(v) {
if (v) { if (v) {
...@@ -104,20 +196,37 @@ export default { ...@@ -104,20 +196,37 @@ export default {
this.menuPos = { left, top }; this.menuPos = { left, top };
} }
}, },
navClick(v,index) { navClick(v, index) {
if (v.children && v.children.length > 0) { if (v.children && v.children.length > 0) {
var { left, top } = v.style; var { left, top } = v.style;
this.list = v.children; this.list = v.children;
this.menuPos = { left, top }; this.menuPos = { left, top };
this.menu = true; this.menu = true;
}else{ } else {
this.menu = false; this.menu = false;
} }
}, },
leavePosition() { leavePosition() {
this.oneShow = false; this.oneShow = false;
this.menu = 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> </script>
...@@ -130,7 +239,6 @@ export default { ...@@ -130,7 +239,6 @@ export default {
top: 90px; top: 90px;
left: 95px; left: 95px;
.navMenuLi { .navMenuLi {
cursor: pointer;
width: 185px; width: 185px;
height: 99px; height: 99px;
color: #ffffff; color: #ffffff;
...@@ -165,7 +273,46 @@ export default { ...@@ -165,7 +273,46 @@ export default {
.bdImg { .bdImg {
height: 822px; height: 822px;
width: 1700px; 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 { .menu {
width: 100px; 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