fix:生产设备以mgroup筛选,添加设备工作进度条

This commit is contained in:
shijing 2024-09-05 14:04:58 +08:00
parent baaa9f9e2e
commit 04fd2c4899
3 changed files with 69 additions and 12 deletions

View File

@ -449,7 +449,7 @@ export default {
}, },
getEquipment() { getEquipment() {
let that = this; 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; that.options = res;
}); });
}, },

View File

@ -72,7 +72,7 @@
<el-option <el-option
v-for="item in routeOptions" v-for="item in routeOptions"
:key="item.id" :key="item.id"
:label="item.process_name" :label="item.routepack_name"
:value="item.id" :value="item.id"
> >
<span <span
@ -206,7 +206,7 @@ const defaultForm = {
equipment: "", equipment: "",
handle_user: null, handle_user: null,
work_start_time: "", work_start_time: "",
work_end_time:'', work_end_time:null,
note:'', note:'',
reminder_interval_list: [0,0], reminder_interval_list: [0,0],
}; };
@ -312,11 +312,9 @@ export default {
}); });
}, },
getEquipment() { getEquipment() {
this.$API.em.equipment.list this.$API.em.equipment.list.req({ page: 0, type: 10,mgroup:that.mgroup}).then((res) => {
.req({ page: 0, type: 10,belong_dept:this.dept }) this.options = res;
.then((res) => { });
this.options = res;
});
}, },
getSupplier() { getSupplier() {
let that = this; let that = this;
@ -369,6 +367,8 @@ export default {
that.$emit("success"); that.$emit("success");
that.visible = false; that.visible = false;
that.$message.success("操作成功"); that.$message.success("操作成功");
}).catch(()=>{
that.isSaveing = false;
}); });
} else { } else {
let obj = {}; let obj = {};
@ -383,6 +383,8 @@ export default {
that.$emit("success"); that.$emit("success");
that.visible = false; that.visible = false;
that.$message.success("操作成功"); that.$message.success("操作成功");
}).catch(()=>{
that.isSaveing = false;
}); });
} }
} }

View File

@ -54,6 +54,11 @@
prop="equipment_name" prop="equipment_name"
min-width="150" min-width="150"
></el-table-column> ></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 <el-table-column
label="部门/工段" label="部门/工段"
prop="belong_dept_name" prop="belong_dept_name"
@ -86,7 +91,7 @@
width="150" width="150"
> >
<template #default="scope"> <template #default="scope">
<el-button <!-- <el-button
link link
size="small" size="small"
v-auth="'mlog.update'" v-auth="'mlog.update'"
@ -94,7 +99,7 @@
type="primary" type="primary"
@click.stop="table_edit(scope.row)" @click.stop="table_edit(scope.row)"
>编辑</el-button >编辑</el-button
> > -->
<el-button <el-button
link link
size="small" size="small"
@ -255,6 +260,54 @@ 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) { selectionChange(selection) {
this.selection = selection; this.selection = selection;
@ -272,4 +325,6 @@ export default {
}, },
}; };
</script> </script>
<style scoped></style> <style scoped>
</style>