fix:检验调整

This commit is contained in:
shijing 2025-07-17 16:04:53 +08:00
parent 09833232bc
commit e6581158f3
5 changed files with 93 additions and 83 deletions

View File

@ -16,6 +16,7 @@
:mgroupId="mgroupId"
:deptId="mgroupDept"
:process = "mgroupProcess"
:processType = "mgroupProcessType"
:mgroup_code="mgroup_code"
:mgroupMtype = "mgroupMtype"
id="mlogs"
@ -39,11 +40,13 @@
</div>
<mtask
v-if="values == '日志'&&componentsShow"
:mgroupId="mgroupId"
:deptId = "mgroupDept"
:mgroupName="mgroupName"
:mgroupId="mgroupId"
:deptId="mgroupDept"
:process = "mgroupProcess"
:processType = "mgroupProcessType"
:mgroup_code="mgroup_code"
:mgroupMtype = "mgroupMtype"
id="mtask"
style="height: 40%;display: none;"
></mtask>
@ -54,29 +57,30 @@
:mgroupId="mgroupId"
:deptId="mgroupDept"
:process = "mgroupProcess"
:processType = "mgroupProcessType"
:mgroup_code="mgroup_code"
:mgroupMtype = "mgroupMtype"
></handover>
<!-- 库存 -->
<!-- <inm v-else-if="values == '库存'&&componentsShow"
:mgroup_code="mgroup_code"
:mgroupId="mgroupId"
:mgroupName="mgroupName"
:process = "mgroupProcess"
:deptId="mgroupDept"></inm> -->
<!-- 未完成 -->
<inmIn v-else-if="values == '未完成'&&componentsShow"
:mgroup_code="mgroup_code"
:mgroupId="mgroupId"
:mgroupName="mgroupName"
:mgroupId="mgroupId"
:deptId="mgroupDept"
:process = "mgroupProcess"
:deptId="mgroupDept"></inmIn>
:processType = "mgroupProcessType"
:mgroup_code="mgroup_code"
:mgroupMtype = "mgroupMtype"
></inmIn>
<!-- 已完成 -->
<inmOut v-else-if="values == '已完成'&&componentsShow"
:mgroup_code="mgroup_code"
:mgroupId="mgroupId"
:mgroupName="mgroupName"
:mgroupId="mgroupId"
:deptId="mgroupDept"
:process = "mgroupProcess"
:deptId="mgroupDept"></inmOut>
:processType = "mgroupProcessType"
:mgroup_code="mgroup_code"
:mgroupMtype = "mgroupMtype"
></inmOut>
</el-main>
</el-container>
</template>
@ -94,14 +98,16 @@ export default {
return {
mgroups:[],
tableHieght: 200,
selectedIndex:0,
options: ["日志", "交接记录","未完成", "已完成"],
values: "日志",
mgroupName: "",
mgroupId: "",
selectedIndex:0,
mgroup_code:'',
mgroupDept:'',
mgroupMtype:'',
mgroupProcess: '',
mgroupProcessType: '',
componentsShow:false,
mtaskVisible:false
};
@ -127,6 +133,7 @@ export default {
that.mgroups = res;
that.mgroupName = res[0].name;
that.mgroupId = res[0].id;
that.mgroupProcessType = res[0].process_type;
that.mgroupProcess = res[0].process;
that.mgroupDept = res[0].belong_dept;
that.mgroupMtype = res[0].mtype;

View File

@ -230,7 +230,7 @@
width="120"
>
<template #default="scope">
<el-link :underline="false" @click="QRCode(scope.row,'wpr')" type="primary" v-if="mgroupName=='毛坯检测'">二维码</el-link>
<el-link :underline="false" @click="QRCode(scope.row,'wpr')" type="primary" v-if="mgroupName=='毛坯检测后打码'">二维码</el-link>
<el-link :underline="false" @click="printMaterial(scope.row,'wpr')" type="primary">打印标签</el-link>
</template>
</el-table-column>

View File

@ -425,10 +425,10 @@
:batchNumber="batchNumber"
:handle_user="handle_user"
:handle_date="handle_date"
:processType="processType"
@success="handlesCheckSuccess"
@closed="scheckClose"
>
</scheck-dialog>
></scheck-dialog>
<edit-dialog
v-if="dialog.edit"
ref="editDialog"
@ -475,6 +475,10 @@ export default {
type: String,
default: "",
},
processType:{
type: String,
default: "",
}
},
components: {
editDialog,
@ -499,13 +503,7 @@ export default {
check_single: false,
},
apiObj: null,
// apiObjWm:null,
apiObjMuser:null,
// paramsWm: {
// page: 0,
// search:'',
// mgroup:''
// },
paramsIn: {
page: 0,
mlog: "",

View File

@ -25,7 +25,7 @@
</div>
</el-header>
<el-main id="mlogbwMain">
<el-button type="primary" v-if="!isSubmit&&process_type=='20'&&mode=='outs'" @click="check_start" style="position: absolute;top: 20px;left: 150px;">检验</el-button>
<el-button type="primary" v-if="!isSubmit&&processType=='20'&&mode=='outs'" @click="check_start" style="position: absolute;top: 20px;left: 150px;">检验</el-button>
<el-button type="primary" v-if="multipleSet" @click="check_set" style="position: absolute;top: 20px;left: 210px;">批量操作</el-button>
<el-input v-if="multipleSet" v-model="wprInputText" @change="wprinputChange" style="width:200px;position: absolute;top: 20px;left: 308px;"></el-input>
<sc-form-table
@ -63,11 +63,11 @@
<el-table-column label="生产设备" min-width="80px" v-if="mode == 'ins'&&route_code=='niuzhuan'">
<template #default="scope">
<el-select
v-if="scope.row.isEdit"
v-model="scope.row.equip"
placeholder="生产设备"
clearable
filterable
:disabled="!scope.row.isEdit"
style="width: 100%"
>
<el-option
@ -80,75 +80,76 @@
<span style="float:right">{{item.number}}</span>
</el-option>
</el-select>
<span v-else>{{ scope.row.equip_name }}</span>
</template>
</el-table-column>
<el-table-column label="开始时间" min-width="80px" v-if="mode == 'ins'&&route_code=='niuzhuan'">
<template #default="scope">
<el-date-picker
:disabled="!scope.row.isEdit"
v-if="scope.row.isEdit"
v-model="scope.row.work_start_time"
type="datetime"
value-format="YYYY-MM-DD HH:mm:ss"
style="width: 100%;"
popper-append-to-body
/>
<span v-else>{{ scope.row.work_start_time }}</span>
</template>
</el-table-column>
<el-table-column label="扭转时间" min-width="80px" v-if="mode == 'ins'&&route_code=='niuzhuan'">
<template #default="scope">
<el-input-number
v-if="scope.row.isEdit"
v-model="scope.row.work_time"
style="width: 100%;"
controls-position="right"
:disabled="!scope.row.isEdit"
@change="workTimeCountSun(scope.row)"
></el-input-number>
<span v-else>{{ scope.row.work_time }}</span>
</template>
</el-table-column>
<el-table-column label="结束时间" min-width="80px" v-if="mode == 'ins'&&route_code=='niuzhuan'">
<template #default="scope">
<el-date-picker
v-if="scope.row.isEdit"
v-model="scope.row.work_end_time"
type="datetime"
value-format="YYYY-MM-DD HH:mm:ss"
style="width: 100%;"
:disabled="!scope.row.isEdit"
popper-append-to-body
/>
<span v-else>{{ scope.row.work_end_time }}</span>
</template>
</el-table-column>
<el-table-column prop="note" :label="item.testitem_name" v-for="item in qct_testitems" :key="item.id" width="150px">
<template #default="scope">
<span v-if="!scope.row.isEdit||!item.canEdit">{{ scope.row[item.testitem_name] }}</span>
<el-input-number
v-if="item.testitem_field_type=='input-number'"
v-if="item.testitem_field_type=='input-number'&&scope.row.isEdit&&item.canEdit"
v-model="scope.row[item.testitem_name]"
:disabled="!scope.row.isEdit||!item.canEdit"
class="width-100"
controls-position="right"
@change="defectCountSun(scope.row)"
></el-input-number>
<el-input-number
v-if="item.testitem_field_type=='input-int'"
v-if="item.testitem_field_type=='input-int'&&scope.row.isEdit&&item.canEdit"
v-model="scope.row[item.testitem_name]"
:min="0"
:disabled="!scope.row.isEdit||!item.canEdit"
class="width-100"
controls-position="right"
@change="defectCountSun(scope.row)"
></el-input-number>
<el-input
v-if="item.testitem_field_type=='input-text'"
v-if="item.testitem_field_type=='input-text'&&scope.row.isEdit&&item.canEdit"
v-model="scope.row[item.testitem_name]"
class="width-100"
:disabled="!scope.row.isEdit||!item.canEdit"
@change="defectCountSun(scope.row)"
></el-input>
<el-select
v-if="item.testitem_field_type=='select-text'"
v-if="item.testitem_field_type=='select-text'&&scope.row.isEdit&&item.canEdit"
v-model="scope.row[item.testitem_name]"
clearable
class="width-100"
:disabled="!scope.row.isEdit||!item.canEdit"
@change="defectCountSun(scope.row)"
>
<el-option
@ -159,12 +160,11 @@
></el-option>
</el-select>
<el-select
v-if="item.testitem_field_type=='selects-text'"
v-if="item.testitem_field_type=='selects-text'&&scope.row.isEdit&&item.canEdit"
v-model="scope.row[item.testitem_name]"
clearable
multiple
class="width-100"
:disabled="!scope.row.isEdit||!item.canEdit"
@change="defectCountSun(scope.row)"
>
<el-option
@ -429,6 +429,10 @@ export default {
material_out:{
type:String,
default:"",
},
processType:{
type:String,
default:"",
}
},
// components: {
@ -467,13 +471,13 @@ export default {
setVisible:false,
multipleSet:false,
checkVisible:false,
hasWpr:false,
descriptionVisible:false,
options:[],
qct_defects:[],
qct_testitems:[],
mlogbwlist:[],
equipmentOptions:[],
process_type:"",
addTemplate:{
mlogb: "",
number: "",
@ -515,37 +519,34 @@ export default {
mounted() {
let that = this;
this.route_code = this.$route.path.split("/")[2];
if(this.route_code=='niuzhuan'){
this.getEquipment4();
}
// if(this.route_code=='niuzhuan'){
// this.getEquipment4();
// }
that.hideAdd = that.isSubmit;
if(that.mgroupName=='排一次棒'||that.mgroupName=='排板'){
// that.getNewNumber();
}
that.params.mlogb = that.addTemplate.mlogb = that.mlogb;
that.currentDate = this.$TOOL.dateFormat2(new Date());
that.currentDate = that.$TOOL.dateFormat2(new Date());
},
methods: {
open(mode = "ins",qct = '') {
let that = this;
this.mode = mode;
if(that.mode == 'ins'){//
if(that.mode == 'ins'&&that.route_code!=='niuzhuan'){//
that.getOptions();
this.qct = ""
that.qct = ""
}else{
this.qct = qct;
that.qct = qct;
}
that.$API.mtm.mgroup.item.req(that.mgroup).then((res) => {
that.process_type=res.process_type;
if(that.mode == 'outs'&&qct!==''&&qct!==null){//
that.getdefects();
}else{
that.getList();
}
})
this.visible = true;
that.visible = true;
setTimeout(() => {
this.tableHeight = document.getElementById('mlogbwMain').clientHeight-20;
that.tableHeight = document.getElementById('mlogbwMain').clientHeight-20;
},500)
},
getNewNumber(){
@ -591,7 +592,7 @@ export default {
}
console.log('num',num);
console.log('data.number:',data.number);
if(this.mgroupName=='排一次棒'){
if(that.mgroupName=='排一次棒'){
that.addTemplate.number = years+months+num;
}
if(that.mgroupName=='排板'){
@ -604,13 +605,11 @@ export default {
let index = that.mlogbwlist.indexOf(row);
let end = new Date(row.work_start_time).getTime()+time;
let end_time = that.$TOOL.dateFormat(new Date(end), 'yyyy-MM-dd hh:mm:ss');
console.log('index',index);
console.log('end_time',end_time);
that.mlogbwlist[index].work_end_time = end_time;
},
getEquipment4() {
let that = this;
that.$API.em.equipment.list.req({page:0,cate__code:"4"}).then((res) => {
that.$API.em.equipment.list.req({page:0,cate__code:"4",query:"{id,name,number}"}).then((res) => {
that.optionsEq = res;
})
},
@ -628,7 +627,7 @@ export default {
res.qct_defects.forEach((item) => {
that.addTemplate[item.defect_name] = false;
let obj = Object.assign({}, item);
obj.canEdit = that.process_type=='20'?false:true;
obj.canEdit = that.processType=='20'?false:true;
that.qct_defects.push(obj);
})
that.qct_defects_origin = that.qct_defects;
@ -636,7 +635,7 @@ export default {
res.qct_testitems.forEach((item2) => {
let obj2 = Object.assign({}, item2);
obj2.value = '';
obj2.canEdit = that.process_type=='20'?false:true;
obj2.canEdit = that.processType=='20'?false:true;
obj2.addto_wpr = item2.addto_wpr;
if(item2.testitem_field_type=='input-number'||item2.testitem_field_type=='input-int'){
@ -660,7 +659,7 @@ export default {
},
getOptions(){
let that = this;
that.$API.wpm.wpr.list.req({wm:that.wm,page:0}).then((res) => {
that.$API.wpm.wpr.list.req({wm:that.wm,page:0,query:"{id,number}"}).then((res) => {
that.options = res;
})
},
@ -706,11 +705,6 @@ export default {
})
that.qct_testitems.forEach((item2) => {
obj[item2.testitem_name] = null;
// if(item2.testitem_field_type=='input-number'||item.testitem_field_type=='input-int'){
// obj[item2.testitem_name] = null;
// }else{
// obj[item2.testitem_name] = "";
// }
})
}
}
@ -806,12 +800,18 @@ export default {
});
},
formTableEdit(row) {
this.mlogbwlist.forEach((item, index) => {
let that = this;
if(that.route_code=='niuzhuan'&&that.optionsEq.length==0){
that.getEquipment4();
}
that.mlogbwlist.forEach((item, index) => {
if (item.id == row.id) {
this.mlogbwlist[index].isEdit = true;
that.mlogbwlist[index].isEdit = true;
console.log('row',row);
console.log('that.qct_testitems',that.qct_testitems);
let date = new Date();
if(this.mlogbwlist[index].work_start_time==''||this.mlogbwlist[index].work_start_time==null){
this.mlogbwlist[index].work_start_time = this.$TOOL.dateFormat(date, 'yyyy-MM-dd hh:mm:ss');
if(that.mlogbwlist[index].work_start_time==''||that.mlogbwlist[index].work_start_time==null){
that.mlogbwlist[index].work_start_time = that.$TOOL.dateFormat(date, 'yyyy-MM-dd hh:mm:ss');
}
}
});
@ -901,7 +901,7 @@ export default {
},
userChange(val){
let that = this;
this.$API.system.user.item.req(val).then((res) => {
that.$API.system.user.item.req(val).then((res) => {
that.setForm.test_user_name = res.name;
})
},
@ -960,7 +960,7 @@ export default {
},
checkSetting(){
let that = this;
this.$refs.dialogForm.validate((valid) => {
that.$refs.dialogForm.validate((valid) => {
if (valid) {
Object.assign(that.setForm,that.form);
that.mlogbwlist.forEach(item => {
@ -1011,9 +1011,9 @@ export default {
}
});
that.$API.wpm.mlogbw.update.req("bulk",that.mlogbwlist).then((res) => {
this.form = {};
that.form = {};
that.checkVisible = false;
this.multipleSet = true;
that.multipleSet = true;
that.descriptionVisible = true;
that.qct_defects = [];
that.qct_defects = that.defectlists;
@ -1106,7 +1106,7 @@ export default {
},
saveSetting(){
let that = this;
this.$refs.dialogForm.validate((valid) => {
that.$refs.dialogForm.validate((valid) => {
if (valid) {
that.selectWpr.forEach(item => {
item.ftest.ftestdefects.forEach(defect => {

View File

@ -202,6 +202,7 @@
:mtask="mtask"
:dept = "deptId"
:mgroup="mgroupId"
:processType="processType"
@closed="detailClose"
>
</detail-drawer>
@ -244,6 +245,10 @@ export default {
mgroupMtype: {
type: Number,
default: 10,
},
processType: {
type: String,
default: "",
}
},
name: "mlog",