fix:日志mlog中添加操作项

This commit is contained in:
shijing 2025-03-20 16:09:35 +08:00
parent ca1e8c9cb0
commit 95b3ecad9a
5 changed files with 86 additions and 16 deletions

View File

@ -17,7 +17,7 @@
style="padding: 0 10px" style="padding: 0 10px"
> >
<el-row> <el-row>
<el-col :md="12" :sm="12" :xs="24" v-if="mlogtype!=='rework'"> <!-- <el-col :md="12" :sm="12" :xs="24" v-if="mgroupMtype==20">
<el-form-item label="生产类型" prop="mtype"> <el-form-item label="生产类型" prop="mtype">
<el-select <el-select
v-model="form.mtype" v-model="form.mtype"
@ -34,8 +34,8 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col> -->
<el-col :md="12" :sm="12" :xs="24" v-if="form.mtype == 20"> <el-col :md="12" :sm="12" :xs="24" v-if="mgroupMtype == 20">
<el-form-item <el-form-item
label="外协单位" label="外协单位"
prop="supplier" prop="supplier"
@ -233,7 +233,7 @@
<script> <script>
const defaultForm = { const defaultForm = {
mtype: "", mtype: 10,
supplier:'', supplier:'',
route: "", route: "",
equipment: "", equipment: "",
@ -265,6 +265,10 @@ export default {
type: String, type: String,
default: "", default: "",
}, },
mgroupMtype: {
type: String,
default: "",
}
}, },
computed: { computed: {
title() { title() {

View File

@ -160,6 +160,7 @@
:mgroup="mgroupId" :mgroup="mgroupId"
:dept="deptId" :dept="deptId"
:mgroupName = "mgroupName" :mgroupName = "mgroupName"
:mgroupMtype="mgroupMtype"
@success="handleSaveSuccess" @success="handleSaveSuccess"
@closed="dialog.save = false" @closed="dialog.save = false"
> >
@ -211,6 +212,7 @@ export default {
deptId: null, deptId: null,
processId: "", processId: "",
processCate: "", processCate: "",
mgroupMtype: "",
}; };
}, },
watch: { watch: {
@ -239,10 +241,11 @@ export default {
} }
that.deptId = res.belong_dept; that.deptId = res.belong_dept;
that.processId = res.process; that.processId = res.process;
that.mgroupMtype = res.mtype;
that.processCate = res.process_cate; that.processCate = res.process_cate;
that.params.mgroup = res.id; that.params.mgroup = res.id;
that.apiObj = that.$API.wpm.mlog.list; that.apiObj = that.$API.wpm.mlog.list;
that.$refs.table.refresh(); // that.$refs.table.refresh();
}); });
}, },
getRemaTime(row){ getRemaTime(row){

View File

@ -14,6 +14,7 @@
v-if="values == '日志'&&componentsShow" v-if="values == '日志'&&componentsShow"
:mgroupName="mgroupName" :mgroupName="mgroupName"
:mgroupId="mgroupId" :mgroupId="mgroupId"
:mgroupMtype = "mgroupMtype"
:mgroupcode="mgroup_code" :mgroupcode="mgroup_code"
:processId="processId" :processId="processId"
:deptId = "mgroupDept" :deptId = "mgroupDept"
@ -84,6 +85,7 @@ export default {
selectedIndex:0, selectedIndex:0,
mgroup_code:'', mgroup_code:'',
mgroupDept:'', mgroupDept:'',
mgroupMtype:'',
processtype:'', processtype:'',
processId:'', processId:'',
componentsShow:false, componentsShow:false,
@ -122,6 +124,7 @@ export default {
that.mgroupName = res[0].name; that.mgroupName = res[0].name;
that.mgroupId = res[0].id; that.mgroupId = res[0].id;
that.processId = res[0].process; that.processId = res[0].process;
that.mgroupMtype = res[0].mtype;
that.processtype = res[0].process_type; that.processtype = res[0].process_type;
that.mgroupDept = res[0].belong_dept; that.mgroupDept = res[0].belong_dept;
that.componentsShow = true; that.componentsShow = true;

View File

@ -17,7 +17,7 @@
style="padding: 0 10px" style="padding: 0 10px"
> >
<el-row> <el-row>
<el-col :md="12" :sm="24"> <!-- <el-col :md="12" :sm="24">
<el-form-item label="生产类型" prop="mtype"> <el-form-item label="生产类型" prop="mtype">
<el-select <el-select
v-model="form.mtype" v-model="form.mtype"
@ -34,12 +34,11 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col> -->
<el-col :md="12" :sm="24" v-if="form.mtype == 20"> <el-col :md="12" :sm="24" v-if="mgroupMtype == 20">
<el-form-item <el-form-item
label="外协单位" label="外协单位"
prop="supplier" prop="supplier"
v-if="form.mtype == 20"
> >
<el-select <el-select
v-model="form.supplier" v-model="form.supplier"
@ -142,7 +141,62 @@
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24" v-if="mgroupName=='黑化'||mgroupName=='退火'"> <el-col :md="12" :sm="12" :xs="24" v-for="item in testitems" :key="item.id">
<el-form-item :label="item.name">
<el-input-number
v-if="item.field_type=='input-number'"
v-model="item.value"
:min="0"
class="width-100"
controls-position="right"
>
</el-input-number>
<el-input-number
v-if="item.field_type=='input-int'"
v-model="item.value"
:min="0"
class="width-100"
controls-position="right"
>
</el-input-number>
<el-input
v-if="item.field_type=='input-text'"
v-model="item.value"
class="width-100"
>
</el-input>
<el-select
v-if="item.field_type=='select-text'"
v-model="item.value"
clearable
class="width-100"
>
<el-option
v-for="item0 in item.choices"
:key="item0"
:label="item0"
:value="item0"
>
</el-option>
</el-select>
<el-select
v-if="item.field_type=='selects-text'"
v-model="item.value"
clearable
multiple
class="width-100"
>
<el-option
v-for="item1 in item.choices"
:key="item1"
:label="item1"
:value="item1"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<!-- <el-col :md="12" :sm="24" v-if="mgroupName=='黑化'||mgroupName=='退火'">
<el-form-item label="保温时间" required> <el-form-item label="保温时间" required>
<el-input-number <el-input-number
v-model="form.reminder_interval_list[0]" v-model="form.reminder_interval_list[0]"
@ -159,7 +213,7 @@
controls-position="right" controls-position="right"
/>(min) />(min)
</el-form-item> </el-form-item>
</el-col> </el-col> -->
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="操作人"> <el-form-item label="操作人">
<ehsSelect <ehsSelect
@ -184,7 +238,6 @@
</sc-upload-file> </sc-upload-file>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="备注"> <el-form-item label="备注">
<el-input <el-input
@ -237,6 +290,10 @@ export default {
type: String, type: String,
default: "", default: "",
}, },
mgroupMtype:{
type: String,
default: "",
}
}, },
computed: { computed: {
title() { title() {
@ -256,6 +313,7 @@ export default {
}, },
test_file:'', test_file:'',
fileList:[], fileList:[],
testitems:[],
// //
form: Object.assign({}, defaultForm), form: Object.assign({}, defaultForm),
// //
@ -308,6 +366,7 @@ export default {
// this.getUser(); // this.getUser();
this.getSupplier(); this.getSupplier();
this.getEquipment(); this.getEquipment();
this.gettestitem();
}, },
methods: { methods: {

View File

@ -154,6 +154,7 @@
:process="processId" :process="processId"
:mgroup="mgroupId" :mgroup="mgroupId"
:dept="deptId" :dept="deptId"
:mgroupMtype="mgroupMtype"
:mgroupName = "mgroupName" :mgroupName = "mgroupName"
@success="handleSaveSuccess" @success="handleSaveSuccess"
@closed="dialog.save = false" @closed="dialog.save = false"
@ -195,6 +196,10 @@ export default {
type: String, type: String,
default: "", default: "",
}, },
mgroupMtype:{
type: String,
default: "",
}
}, },
name: "mlog", name: "mlog",
components: { components: {
@ -228,12 +233,8 @@ export default {
let times = 0; let times = 0;
let nowTime = new Date().getTime(); let nowTime = new Date().getTime();
let startTiem = new Date(row.work_start_time).getTime(); let startTiem = new Date(row.work_start_time).getTime();
console.log('nowTime',nowTime)
console.log('startTiem',startTiem)
let remaTime = nowTime - startTiem; let remaTime = nowTime - startTiem;
console.log('remaTime',remaTime)
let temp = Math.floor(remaTime/1000*60); let temp = Math.floor(remaTime/1000*60);
console.log('temp',temp)
if(remaTime>0&&row.reminder_interval_list[0]){ if(remaTime>0&&row.reminder_interval_list[0]){
if(temp<row.reminder_interval_list[0]){ if(temp<row.reminder_interval_list[0]){
times = row.reminder_interval_list[0]-temp; times = row.reminder_interval_list[0]-temp;