fix:玻纤自动编码

This commit is contained in:
shijing 2025-05-19 16:00:41 +08:00
parent a4f0900cbe
commit e2698a7738
1 changed files with 83 additions and 7 deletions

View File

@ -36,6 +36,7 @@
:addTemplate="addTemplate" :addTemplate="addTemplate"
placeholder="暂无数据" placeholder="暂无数据"
:hideAdd="hideAdd" :hideAdd="hideAdd"
@add="rowAdd"
> >
<el-table-column prop="number" label="物料编号" fixed min-width="120px"> <el-table-column prop="number" label="物料编号" fixed min-width="120px">
<template #default="scope"> <template #default="scope">
@ -106,7 +107,6 @@
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="note" :label="item.testitem_name" v-for="item in qct_testitems" :key="item.id" width="150px"> <el-table-column prop="note" :label="item.testitem_name" v-for="item in qct_testitems" :key="item.id" width="150px">
<template #default="scope"> <template #default="scope">
<el-input-number <el-input-number
@ -197,7 +197,7 @@
>保存</el-link >保存</el-link
> >
<el-link <el-link
v-if="scope.row.isEdit" v-if="scope.row.isEdit&&scope.row.id"
type="danger" type="danger"
size="small" size="small"
style="margin-left: 5px;" style="margin-left: 5px;"
@ -205,7 +205,7 @@
>取消</el-link >取消</el-link
> >
<el-link <el-link
v-if="scope.row.isEdit" v-if="scope.row.isEdit&&setForm.cd_req_addr!=null"
type="success" type="success"
size="small" size="small"
style="margin-left: 5px;" style="margin-left: 5px;"
@ -219,6 +219,14 @@
@click="formTableEdit(scope.row)" @click="formTableEdit(scope.row)"
>编辑</el-link >编辑</el-link
> >
<el-link
v-if="scope.row.isEdit&&!scope.row.id"
type="danger"
size="small"
style="margin-left: 5px;"
@click="formTableDelet(scope.row)"
>删除</el-link
>
<el-link <el-link
v-if="!scope.row.isEdit" v-if="!scope.row.isEdit"
type="danger" type="danger"
@ -421,6 +429,10 @@ export default {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
material_out:{
type:String,
default:"",
}
}, },
// components: { // components: {
// checkDrawer // checkDrawer
@ -438,13 +450,15 @@ export default {
form: { form: {
test_user:"", test_user:"",
equipment:"", equipment:"",
cd_req_addr:"",// cd_req_addr:null,//
equipment_name:"", equipment_name:"",
testitemids : [], testitemids : [],
defectids : [], defectids : [],
}, },
test_user_name:"", test_user_name:"",
qct:"", qct:"",
year:"",
month:"",
values:"", values:"",
wprNumber:"", wprNumber:"",
route_code:"", route_code:"",
@ -490,6 +504,16 @@ export default {
printer_name:localStorage.getItem("printer_name") printer_name:localStorage.getItem("printer_name")
}; };
}, },
watch: {
// mlogbwlist: {
// handler(newVal, oldVal) {
// let that = this;
// that.getNewNumber();
// },
// deep: true,
// immediate: true,
// },
},
mounted() { mounted() {
let that = this; let that = this;
this.route_code = this.$route.path.split("/")[2]; this.route_code = this.$route.path.split("/")[2];
@ -497,12 +521,11 @@ export default {
this.getEquipment4(); this.getEquipment4();
} }
that.hideAdd = that.isSubmit; that.hideAdd = that.isSubmit;
if(that.mgroupName!=='排板'){ if(that.mgroupName=='排一次棒'||that.mgroupName=='排板'){
that.addTemplate.number = that.batchNumber; that.getNewNumber();
} }
that.params.mlogb = that.addTemplate.mlogb = that.mlogb; that.params.mlogb = that.addTemplate.mlogb = that.mlogb;
that.currentDate = this.$TOOL.dateFormat2(new Date()); that.currentDate = this.$TOOL.dateFormat2(new Date());
// console.log(that.currentDate);
}, },
methods: { methods: {
open(mode = "ins",qct = '') { open(mode = "ins",qct = '') {
@ -527,6 +550,56 @@ export default {
this.tableHeight = document.getElementById('mlogbwMain').clientHeight-20; this.tableHeight = document.getElementById('mlogbwMain').clientHeight-20;
},500) },500)
}, },
getNewNumber(){
let that = this;
let date = new Date();
let year = that.year = date.getFullYear();
let month = that.month = date.getMonth() + 1;
that.$API.wpm.wpr.newNumber.req({year:year,month:month,material_start:that.material_out}).then((res) => {
that.material_model = res.material_model;
let years = year+'';
years = years.slice(2,4);
let months = month<10?'0'+month:month;
that.alreadyCount = res.count;
let num = res.count+1;
if(num<10){
num = "000"+num;
}else if(num<100){
num = "00"+num;
}else if(num<1000){
num = "0"+num;
}
if(that.mgroupName=='排一次棒'){
that.addTemplate.number = years+months+num;
}
if(that.mgroupName=='排板'){
that.addTemplate.number = years+ months + res.material_model+num;
}
})
},
rowAdd(data){
let that = this;
let years = that.year+'';
years = years.slice(2,4);
let months = that.month<10?'0'+that.month:that.month;
let num = data.number.slice(-4);
num = Number(num)+1;
if(num<10){
num = "000"+num;
}else if(num<100){
num = "00"+num;
}else if(num<1000){
num = "0"+num;
}
console.log('num',num);
console.log('data.number:',data.number);
if(this.mgroupName=='排一次棒'){
that.addTemplate.number = years+months+num;
}
if(that.mgroupName=='排板'){
that.addTemplate.number = years+ months + that.material_model+num;
}
},
getEquipment4() { getEquipment4() {
let that = this; 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"}).then((res) => {
@ -724,6 +797,9 @@ export default {
this.mlogbwlist[index].isEdit = true; this.mlogbwlist[index].isEdit = true;
} }
}); });
},
formTableDelet(row){
this.mlogbwlist.pop();
}, },
// //
formTableDel(id) { formTableDel(id) {