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