fix:生产设备以mgroup筛选,添加设备工作进度条
This commit is contained in:
parent
baaa9f9e2e
commit
04fd2c4899
|
@ -449,7 +449,7 @@ export default {
|
|||
},
|
||||
getEquipment() {
|
||||
let that = this;
|
||||
that.$API.em.equipment.list.req({ page: 0, type: 10,belong_dept:that.deptId }).then((res) => {
|
||||
that.$API.em.equipment.list.req({ page: 0, type: 10,mgroup:that.mgroup }).then((res) => {
|
||||
that.options = res;
|
||||
});
|
||||
},
|
||||
|
|
|
@ -72,7 +72,7 @@
|
|||
<el-option
|
||||
v-for="item in routeOptions"
|
||||
:key="item.id"
|
||||
:label="item.process_name"
|
||||
:label="item.routepack_name"
|
||||
:value="item.id"
|
||||
>
|
||||
<span
|
||||
|
@ -206,7 +206,7 @@ const defaultForm = {
|
|||
equipment: "",
|
||||
handle_user: null,
|
||||
work_start_time: "",
|
||||
work_end_time:'',
|
||||
work_end_time:null,
|
||||
note:'',
|
||||
reminder_interval_list: [0,0],
|
||||
};
|
||||
|
@ -312,11 +312,9 @@ export default {
|
|||
});
|
||||
},
|
||||
getEquipment() {
|
||||
this.$API.em.equipment.list
|
||||
.req({ page: 0, type: 10,belong_dept:this.dept })
|
||||
.then((res) => {
|
||||
this.options = res;
|
||||
});
|
||||
this.$API.em.equipment.list.req({ page: 0, type: 10,mgroup:that.mgroup}).then((res) => {
|
||||
this.options = res;
|
||||
});
|
||||
},
|
||||
getSupplier() {
|
||||
let that = this;
|
||||
|
@ -369,6 +367,8 @@ export default {
|
|||
that.$emit("success");
|
||||
that.visible = false;
|
||||
that.$message.success("操作成功");
|
||||
}).catch(()=>{
|
||||
that.isSaveing = false;
|
||||
});
|
||||
} else {
|
||||
let obj = {};
|
||||
|
@ -383,6 +383,8 @@ export default {
|
|||
that.$emit("success");
|
||||
that.visible = false;
|
||||
that.$message.success("操作成功");
|
||||
}).catch(()=>{
|
||||
that.isSaveing = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,6 +54,11 @@
|
|||
prop="equipment_name"
|
||||
min-width="150"
|
||||
></el-table-column>
|
||||
<el-table-column label="进度" prop="belong_dept_name" v-if="mgroupName=='黑化'||mgroupName=='退火'">
|
||||
<template #default="scope">
|
||||
<el-progress id="progressbwlq" :percentage="customMethod(scope.row,1)" :stroke-width="20" :color="customMethod(scope.row,2)" :text-inside="true"><span>{{customMethod(scope.row,3)}}</span></el-progress>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="部门/工段"
|
||||
prop="belong_dept_name"
|
||||
|
@ -86,7 +91,7 @@
|
|||
width="150"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
<!-- <el-button
|
||||
link
|
||||
size="small"
|
||||
v-auth="'mlog.update'"
|
||||
|
@ -94,7 +99,7 @@
|
|||
type="primary"
|
||||
@click.stop="table_edit(scope.row)"
|
||||
>编辑</el-button
|
||||
>
|
||||
> -->
|
||||
<el-button
|
||||
link
|
||||
size="small"
|
||||
|
@ -254,7 +259,55 @@ export default {
|
|||
});
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
customMethod(row,index){
|
||||
let color = '',context = '';
|
||||
let percent = 0;
|
||||
if(row.reminder_interval_list.length>0){
|
||||
let data = new Date();
|
||||
//当前时间
|
||||
let currentTime = data.getTime();
|
||||
//开始时间
|
||||
let startTime = new Date(row.work_start_time).getTime();
|
||||
let endTime = new Date(row.work_end_time).getTime();
|
||||
//已开始工作的时长
|
||||
let times = (currentTime-startTime)/1000/60;
|
||||
let sum = row.reminder_interval_list[0]+row.reminder_interval_list[1];
|
||||
if(currentTime>endTime){
|
||||
percent = 100;
|
||||
color = row.mstate_json[1].color;
|
||||
context = '已完成';
|
||||
}else{
|
||||
if(times>0){
|
||||
percent = Math.round((times/sum)*100);
|
||||
}else{
|
||||
percent = 0;
|
||||
}
|
||||
if(times>0){
|
||||
if(times>row.reminder_interval_list[0]){//冷却中
|
||||
color = row.mstate_json[1].color;
|
||||
context = row.mstate_json[1].name;
|
||||
}else if(times>row.reminder_interval_list[1]){//已完成
|
||||
color = row.mstate_json[1].color;
|
||||
context = '已完成';
|
||||
}else{//保温中
|
||||
color = row.mstate_json[0].color;
|
||||
context = row.mstate_json[0].name;
|
||||
}
|
||||
}else{
|
||||
color = "#ffffff";
|
||||
}
|
||||
}
|
||||
if(index==1){
|
||||
return percent
|
||||
}else if(index==2){
|
||||
return color
|
||||
}else{
|
||||
return context
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
//表格选择后回调事件
|
||||
selectionChange(selection) {
|
||||
this.selection = selection;
|
||||
|
@ -272,4 +325,6 @@ export default {
|
|||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped></style>
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
|
Loading…
Reference in New Issue