Commit 3ff578c0 authored by 周远喜's avatar 周远喜

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

parents 49155177 6f24cdd2
...@@ -689,6 +689,8 @@ export default { ...@@ -689,6 +689,8 @@ export default {
}); });
e[elem.key] = codeInfo.substr(0, codeInfo.length - 1); e[elem.key] = codeInfo.substr(0, codeInfo.length - 1);
} }
} else {
e[elem.key] = ''
} }
}); });
//导出数据增加对应的物料管理信息 code: 1【rootCategoryId 大类】 2【categoryId 大类】 3【codeRuleId 编码名称】 //导出数据增加对应的物料管理信息 code: 1【rootCategoryId 大类】 2【categoryId 大类】 3【codeRuleId 编码名称】
......
<template> <template>
<div class="ib" @click="showLife"> <div class="ib" @click="showLife">
<div class="ib" v-if="!isMore"> <div class="ib" v-if="!isMore">
<span v-if="type == 'text'" :style="style">{{ name }}</span> <span v-if="type == 'text'" :style="style">{{ name }}</span>
<Tag v-if="type == 'tag'" :color="tagcolor">{{ name }}</Tag> <Tag v-if="type == 'tag'" :color="tagcolor">{{ name }}</Tag>
<Badge v-if="type == 'dot'" :color="tagcolor" :text="name" /> <Badge v-if="type == 'dot'" :color="tagcolor" :text="name" />
<Icon <Icon v-if="type == 'icon'" :type="item.icon" :color="tagcolor" :title="name" :size="size" />
v-if="type == 'icon'"
:type="item.icon"
:color="tagcolor"
:title="name"
:size="size"
/>
</div> </div>
<div class="ib" v-else v-for="(li, i) in items" :key="i"> <div class="ib" v-else v-for="(li, i) in items" :key="i">
<span v-if="type == 'text'" :style="li.style">{{ li.name }}</span> <span v-if="type == 'text'" :style="li.style">{{ li.name }}</span>
<Tag v-if="type == 'tag'" :color="li.tagcolor">{{ li.name }}</Tag> <Tag v-if="type == 'tag'" :color="li.tagcolor">{{ li.name }}</Tag>
<Badge v-if="type == 'dot'" :color="li.tagcolor" :text="li.name" />&nbsp; <Badge v-if="type == 'dot'" :color="li.tagcolor" :text="li.name" />&nbsp;
</div> </div>
<Modal <Modal v-model="modal" title="生命周期" width="1200" footer-hide :mask-closable="false">
v-model="modal" <component :is="detail" :code="code" :value="value" :mode="mode" />
title="生命周期"
width="1200"
footer-hide
:mask-closable="false"
>
<component :is="detail" :code="code" :value="value" :mode="mode" />
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: "state", name: "state",
data() { data() {
return { return {
mode: "0", mode: "0",
name: "", name: "",
isMore: false, isMore: false,
modal: false, modal: false,
item: {}, item: {},
items: [], items: [],
data: [], data: [],
detail: null, detail: null,
}; };
},
props: {
default: {
type: String,
default: "",
}, },
type: { props: {
type: String, default: {
default: "text", type: String,
validator: function (value) { default: "",
return ["text", "tag", "dot", "icon"].indexOf(value) != -1; },
}, type: {
type: String,
default: "text",
validator: function (value) {
return ["text", "tag", "dot", "icon"].indexOf(value) != -1;
},
},
code: {
type: String,
required: true,
},
value: {
type: [String, Number],
required: false,
},
color: {
type: Boolean,
default: true,
},
size: {
type: Number,
default: 24,
},
icon: {
type: Boolean,
default: false,
},
img: {
type: Boolean,
default: false,
},
}, },
code: { created() {
type: String, this.data = this.$store.getters.dictionaryByKey(this.code) || [];
required: true,
}, },
value: { methods: {
type: [String, Number], setName(v) {
required: false, if ((v + "").indexOf(",") == -1) {
var item;
this.data.map((u) => {
if (u.code == v) {
item = u;
}
});
if (item) {
this.name = item.name;
this.item = item;
} else {
if (v == "undefined" || v == '' || v == null || v == 'null') {
this.name = " ";
} else {
this.name = this.value;
}
}
} else {
this.isMore = true;
var items = [];
var ul = (v + "").split(",");
this.data.map((u) => {
if (ul.indexOf(u.code) > -1) {
u.tagcolor = u.color | "default";
u.style = {
color: u.color | "inherit"
};
items.push(u);
}
});
this.items = items;
}
},
showLife() {
this.modal = true;
this.detail = () => import("./life");
},
}, },
color: { computed: {
type: Boolean, tagcolor() {
default: true, if (
this.color &&
this.item &&
this.item.color != "" &&
this.item.color != null
) {
return this.item.color;
}
return "default";
},
style() {
if (!this.color) {
return {};
}
return {
color: this.item && this.item.color != "" && this.item.color != null ?
this.item.color : "inherit",
};
},
}, },
size: { watch: {
type: Number, value(v) {
default: 24, this.setName(v);
// this.$forceUpdate()
},
data(v) {
if (v.length > 0) {
this.setName(this.value);
this.$forceUpdate();
}
},
}, },
icon: {
type: Boolean,
default: false,
},
img: {
type: Boolean,
default: false,
},
},
created() {
this.data = this.$store.getters.dictionaryByKey(this.code) || [];
},
methods: {
setName(v) {
if ((v + "").indexOf(",") == -1) {
var item;
this.data.map((u) => {
if (u.code == v) {
item = u;
}
});
if (item) {
this.name = item.name;
this.item = item;
} else {
if (this.value == "undefined") {
this.name = " ";
} else {
this.name = this.value;
}
}
} else {
this.isMore = true;
var items = [];
var ul = (v + "").split(",");
this.data.map((u) => {
if (ul.indexOf(u.code) > -1) {
u.tagcolor = u.color | "default";
u.style = { color: u.color | "inherit" };
items.push(u);
}
});
this.items = items;
}
},
showLife() {
this.modal = true;
this.detail = () => import("./life");
},
},
computed: {
tagcolor() {
if (
this.color &&
this.item &&
this.item.color != "" &&
this.item.color != null
) {
return this.item.color;
}
return "default";
},
style() {
if (!this.color) {
return {};
}
return {
color:
this.item && this.item.color != "" && this.item.color != null
? this.item.color
: "inherit",
};
},
},
watch: {
value(v) {
this.setName(v);
// this.$forceUpdate()
},
data(v) {
if (v.length > 0) {
this.setName(this.value);
this.$forceUpdate();
}
},
},
}; };
</script> </script>
\ No newline at end of file
...@@ -138,4 +138,13 @@ export default { ...@@ -138,4 +138,13 @@ export default {
return Api.post(`${apsUrl}/aps/aischedule`, params) return Api.post(`${apsUrl}/aps/aischedule`, params)
}, },
//智能排产end---- //智能排产end----
//多级连排
createorderproductrelation() {
return Api.post(`${apsUrl}/apspoolappservices/createorderproductrelation`)
},
apsdatascheduledlevel(params) {
return Api.post(`${apsUrl}/apspoolappservices/aps_data_scheduled_level`, params)
},
} }
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
</a> </a>
<Button type="primary" @click="goResults" style="background:#515A6E;border:solid 1px #515A6E">历史方案</Button> <Button type="primary" @click="goResults" style="background:#515A6E;border:solid 1px #515A6E">历史方案</Button>
<Button type="primary" @click="openApsModal">APS排产</Button> <Button type="primary" @click="openApsModal">APS排产</Button>
<Button type="primary" @click="openApsMutiModal">多级连排</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>
...@@ -40,9 +41,12 @@ ...@@ -40,9 +41,12 @@
<Modal v-model="addModal" title="工序参数设置" footer-hide width="1000"> <Modal v-model="addModal" title="工序参数设置" footer-hide width="1000">
<Add @on-close="cancel" @on-parameter-ok="addOk" :opTaskPk="setParams.opTaskPk" :partTaskPk="setParams.partTaskPk" :taskSeq="setParams.taskSeq" :count="setParams.count" /> <Add @on-close="cancel" @on-parameter-ok="addOk" :opTaskPk="setParams.opTaskPk" :partTaskPk="setParams.partTaskPk" :taskSeq="setParams.taskSeq" :count="setParams.count" />
</Modal> </Modal>
<Modal v-model="apsModal" title="确定APS排产" @on-ok="apsOk" @on-cancel="cancel"> <Modal v-model="apsModal" title="确定APS排产" @on-ok="apsOk(1)" @on-cancel="cancel">
<p>确定进行APS排产?</p> <p>确定进行APS排产?</p>
</Modal> </Modal>
<Modal v-model="apsMutiModal" title="确定多级连排" @on-ok="apsMutiOk" @on-cancel="cancel">
<p>确定进行多级连排?</p>
</Modal>
<!-- <Modal v-model="resultModal" title="数据检查" width="1500" @on-ok="checkOk" @on-cancel="cancel"> <!-- <Modal v-model="resultModal" title="数据检查" width="1500" @on-ok="checkOk" @on-cancel="cancel">
<CheckResult :data="result"></CheckResult> <CheckResult :data="result"></CheckResult>
</Modal> --> </Modal> -->
...@@ -109,6 +113,7 @@ export default { ...@@ -109,6 +113,7 @@ export default {
detailModal: false, detailModal: false,
deletelModal: false, deletelModal: false,
apsModal: false, apsModal: false,
apsMutiModal: false,
addModalTemp: false, addModalTemp: false,
modalDuration: false, modalDuration: false,
insertlModal1: false, insertlModal1: false,
...@@ -367,7 +372,7 @@ export default { ...@@ -367,7 +372,7 @@ export default {
circleModal: false, //进度条 circleModal: false, //进度条
listTemp: [], //自定义模板排序下拉框列表 listTemp: [], //自定义模板排序下拉框列表
tempValue: null, tempValue: null,
tempStatu: 0 //新建模型时传过来的id值 tempStatu: 0, //新建模型时传过来的id值
}; };
}, },
mounted() { mounted() {
...@@ -503,6 +508,7 @@ export default { ...@@ -503,6 +508,7 @@ export default {
this.apsModal = false; this.apsModal = false;
this.apsCheckModal = false; this.apsCheckModal = false;
this.resultModal = false; this.resultModal = false;
this.apsMutiModal = false;
}, },
onDragDrop(a, b) { onDragDrop(a, b) {
//拖拽排序 //拖拽排序
...@@ -536,6 +542,17 @@ export default { ...@@ -536,6 +542,17 @@ export default {
this.$Message.error("请设置基准日期"); this.$Message.error("请设置基准日期");
} }
}, },
openApsMutiModal() {
if (this.list.length == 1) {
this.$Message.error("单个订单不能进行多级连排")
return false
}
if (this.entity.setTime != "") {
this.apsMutiModal = true;
} else {
this.$Message.error("请设置基准日期");
}
},
//查看历史方案 //查看历史方案
goResults() { goResults() {
this.$router.push({ this.$router.push({
...@@ -544,7 +561,7 @@ export default { ...@@ -544,7 +561,7 @@ export default {
}); });
}, },
//确定aps排产 //确定aps排产
apsOk() { apsOk(type) {
this.circleModal = true; this.circleModal = true;
//APS排产前订单优先级功能 //APS排产前订单优先级功能
let parmsOrderpriority = { let parmsOrderpriority = {
...@@ -569,7 +586,11 @@ export default { ...@@ -569,7 +586,11 @@ export default {
if (res1.success) { if (res1.success) {
// this.result=res1.result; // this.result=res1.result;
// this.resultModal=true; // this.resultModal=true;
this.checkOk(); if (type == 1) {
this.checkOk();
} else if (type == 2) {
this.checkMutiOk()
}
} else { } else {
// this.circleModal = false; // this.circleModal = false;
// this.$Message.error("操作失败:数据校验"); // this.$Message.error("操作失败:数据校验");
...@@ -630,6 +651,47 @@ export default { ...@@ -630,6 +651,47 @@ export default {
}.bind(this) }.bind(this)
); );
}, },
//多级连排
apsMutiOk() {
Api.createorderproductrelation().then(res => {
if (res.success && res.result) {
this.apsOk(2)
} else {
this.$Message.error("订单没有bom关系")
}
})
},
checkMutiOk() {
//排产计算
let paramsTime = {
DtTime: this.entity.setTime
};
Api.apsdatascheduledlevel(paramsTime)
.then(res2 => {
if (res2.success) {
if (res2.result.res) {
this.$Message.success("排产计算成功");
this.circleModal = false;
this.$router.push({
path: "/aps/results"
// params: { customerId: id }
});
} 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)
);
},
//打开设置参数 //打开设置参数
openAddModel(type, row) { openAddModel(type, row) {
if (type == 2) { if (type == 2) {
......
...@@ -18,7 +18,8 @@ ...@@ -18,7 +18,8 @@
<!-- <Icon type="ios-time" /> --> <!-- <Icon type="ios-time" /> -->
<div class="gs_bo01"> <div class="gs_bo01">
<span class="shi">总工时</span> <span class="shi">总工时</span>
<span class="number">{{ allHours }}</span> <span class="number" style="display: inline;">{{ allHours }}</span><span style="display: inline;"> 工时</span>
</div> </div>
</div> </div>
<Divider type="vertical" class="line_slit" /> <Divider type="vertical" class="line_slit" />
...@@ -27,7 +28,7 @@ ...@@ -27,7 +28,7 @@
<img src="@/assets/imgicon/execute/time02.png" alt /> <img src="@/assets/imgicon/execute/time02.png" alt />
<div class="gs_bo01"> <div class="gs_bo01">
<span class="shi">待分配</span> <span class="shi">待分配</span>
<span class="number">{{ waitHours }}</span> <span class="number" style="display: inline;">{{ waitHours }}</span><span style="display: inline;"> 工时</span>
</div> </div>
</div> </div>
</div> </div>
......
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