Commit 79787453 authored by 周远喜's avatar 周远喜

参数调整修改。

parent bed1428e
<template>
<div style="padding: 0;" class="excute">
<DataGrid
style="margin-top:2px; margin-bottom: -20px;"
style="margin-top:2px; margin-bottom: -5px;"
:columns="columns"
ref="grid"
:easy="false"
......@@ -9,8 +9,8 @@
:set="false"
:border="false"
:data="data1"
:page="false"
:height="gridHeight"
:page="false"
:size="size"
></DataGrid>
<Modal v-model="editModal" title="编辑" footer-hide width="800">
......@@ -60,7 +60,7 @@ export default {
insertlModal: false,
rowIndex: null,
curId: 0,
gridHeight: 50,
gridHeight: 150,
size: "small",
columns: [
{ title: " ", width: 130 },
......
......@@ -28,13 +28,17 @@
<Icon type="md-git-compare" />
</a>
<DropdownMenu slot="list" style="text-align: center;">
<DropdownItem v-for="li in items" :key="li.value" v-dragging="{ item: li, list: items}">
<DropdownItem
v-for="li in items"
:key="li.value"
v-dragging="{ item: li, list: items}"
>
<a href="#">
<Icon type="md-apps" />
</a>
<span>{{li.name}}</span>
</DropdownItem>
</DropdownMenu>
</DropdownItem>
</DropdownMenu>
</Dropdown>
</div>
<div class="slider">
......@@ -111,7 +115,7 @@
<span slot="close"></span>
</i-switch>
</FormItem>
<FormItem :label="l('discrete_percent')" prop="discrete_percent">
<FormItem :label="l('discrete_percent')" prop="discrete_percent">
<Slider
v-model="entity.discrete_percent"
:step="1"
......@@ -126,10 +130,10 @@
:disabled="count==0"
:min="1"
:max="count==0?1:count"
@on-change="setDiscrete"
@on-change="setDiscrete"
></InputNumber>
<!-- <span>{{count}}</span> -->
</FormItem>
</FormItem>
</div>
</Col>
</Row>
......@@ -145,7 +149,12 @@ import Api from "./api";
export default {
data() {
return {
items:[{name:"是否多台",value:"multiple"},{name:"转序规则",value:"planState"},{name:"加班策略",value:"over"},{name:"是否离散",value:"dis"}],
items: [
{ name: "是否多台", value: "multiple" },
{ name: "转序规则", value: "planState" },
{ name: "加班策略", value: "over" },
{ name: "是否离散", value: "dis" }
],
entity: {
partTaskPk: 0,
opTaskPk: 0,
......@@ -158,10 +167,10 @@ export default {
overTime: "不加班", //"六日加班", 不加班 加班
efficiencyValue: 11, // 效率系数, 必须大于 0
shopId: -1,
dis:false,
isDiscrete: "否",//是否离散 是否
dis: false,
isDiscrete: "否", //是否离散 是否
discrete: 1, //离散数值 必须大于 1
discrete_percent:0,
discrete_percent: 0,
multiple: false,
multipleEquip: "否", //"是否多台安排设备", 否 是
multipleCount: 1, //多台数量
......@@ -235,12 +244,12 @@ export default {
this.apsGet(); //获取参数级别和转序等的关系
},
mounted() {
this.$dragging.$on('dragged', ({ value }) => {
localStorage.setItem("apsitems",JSON.stringify(value.list));
})
var items=localStorage.getItem("apsitems");
if(items){
this.items=JSON.parse(items);
this.$dragging.$on("dragged", ({ value }) => {
localStorage.setItem("apsitems", JSON.stringify(value.list));
});
var items = localStorage.getItem("apsitems");
if (items) {
this.items = JSON.parse(items);
}
},
methods: {
......@@ -264,13 +273,13 @@ export default {
});
},
setParameter(v) {
this.entity.multiple=false;
this.entity.planState=false;
this.entity.over=false;
this.entity.dis=false;
for(var i=0;i<v;i++){
this.entity[this.items[i].value]=true;
}
this.entity.multiple = false;
this.entity.planState = false;
this.entity.over = false;
this.entity.dis = false;
for (var i = 0; i < v; i++) {
this.entity[this.items[i].value] = true;
}
},
handleSubmit() {
this.$refs.form.validate(valid => {
......@@ -284,10 +293,10 @@ export default {
this.entity.flog = 1;
return;
}
if(this.entity.multipleEquipPks){
if (this.entity.multipleEquipPks) {
this.entity.multipleEquipIds = this.entity.multipleEquipPks.join();
}
//
//
this.entity.planMethod = !this.entity.planState ? "重叠" : "平行";
this.entity.overTime = !this.entity.over ? "不加班" : "加班";
this.entity.isDiscrete = this.entity.dis ? "是" : "否";
......@@ -314,13 +323,14 @@ export default {
let vkey = "mes_op_task_plan_simulate" + "." + key;
return this.$t(vkey) || key;
},
setPercent(v){
this.entity.discrete=Math.round(((this.count-1)*v-this.count)/100);
setPercent(v) {
this.entity.discrete = Math.round(
((this.count - 1) * v - this.count) / 100
);
},
setDiscrete(v){
this.entity.discrete_percent=(
(100 * this.count - 100 * this.entity.discrete) / (this.count - 1)
);
setDiscrete(v) {
this.entity.discrete_percent =
(100 * this.count - 100 * this.entity.discrete) / (this.count - 1);
}
},
computed: {
......@@ -346,37 +356,38 @@ export default {
},
opTaskPk(v, n) {
this.entity.opTaskPk = v;
if(v>0){
console.log("detail",this.row);
let entity={
if (v > 0) {
console.log("detail", this.row);
let entity = {
partTaskPk: this.row.part_task_pk,
opTaskPk: this.row.op_task_pk,
taskSeq: this.row.task_seq,
flog: 0, //参数应用范围
calId: parseInt(this.row.cal_id),
planState: this.row.plan_method=="平行",
planState: this.row.plan_method == "平行",
planMethod: this.row.plan_method, // 平行 重叠
over: this.row.over_time=="加班",
over: this.row.over_time == "加班",
overTime: this.row.over_time, //"六日加班", 不加班 加班
efficiencyValue:this.row.efficiency_value|1, // 效率系数, 必须大于 0
efficiencyValue: this.row.efficiency_value | 1, // 效率系数, 必须大于 0
shopId: -1,
isDiscrete: this.row.isdiscrete=="是",
discrete: this.row.discrete_value|1, //离散数值 必须大于 1
multiple: this.row.multi_machine=="是",
multipleEquip: this.row.multi_machine|"否", //"是否多台安排设备", 否 是
dis: this.row.isdiscrete == "是",
isDiscrete: this.row.isdiscrete ? "是" : "否", //是否离散 是否
discrete: this.row.discrete_value | 1, //离散数值 必须大于 1
multiple: this.row.multi_machine == "是",
multipleEquip: this.row.multi_machine | "否", //"是否多台安排设备", 否 是
multipleCount: 1, //多台数量
multipleEquipPks: [],
multipleEquipIds: "", //"设备id", 用英文逗号分隔
}
this.entity=entity
console.warn("detail",this.entity,this.row);
multipleEquipIds: "" //"设备id", 用英文逗号分隔
};
this.entity = entity;
console.warn("detail", this.entity, this.row);
}
this.entity.taskSeq = this.taskSeq;
},
count(v, n) {
this.entity.discrete = 1;
},
}
}
};
</script>
......
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