fix:交接表单标题,改版默认更改批次号,原批次号+g

This commit is contained in:
shijing 2025-09-24 13:05:18 +08:00
parent 5166ee2b68
commit 8922fb610d
1 changed files with 18 additions and 7 deletions

View File

@ -1,6 +1,6 @@
<template> <template>
<el-dialog <el-dialog
:title="titleMap[mode]" :title="titleMap[mode+type]"
v-model="visible" v-model="visible"
width="1000px" width="1000px"
:size="1000" :size="1000"
@ -191,7 +191,7 @@
</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-switch v-model="change_batch"></el-switch> <el-switch v-model="change_batch" :disabled="type==50"></el-switch>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24" v-if="type==50"> <el-col :md="12" :sm="24" v-if="type==50">
@ -255,8 +255,14 @@ export default {
loading: false, loading: false,
mode: "add", mode: "add",
titleMap: { titleMap: {
add: "新增交接记录", add10: "新增交接记录",
edit: "编辑交接记录", add20: "新增返工记录",
add40: "新增废品入库",
add50: "新增改版记录",
edit10: "编辑交接记录",
edit20: "编辑返工记录",
edit40: "编辑废品入库",
edit50: "编辑改版记录",
show: "查看交接记录", show: "查看交接记录",
}, },
lists:[],// lists:[],//
@ -354,6 +360,9 @@ export default {
mounted() { mounted() {
let that = this; let that = this;
that.form.type = that.type; that.form.type = that.type;
if(that.type==50){
that.change_batch = true;
}
let materialObj = that.$TOOL.data.get("MATERIAL_OBJECT"); let materialObj = that.$TOOL.data.get("MATERIAL_OBJECT");
that.materialObj = materialObj; that.materialObj = materialObj;
that.form.handle_date =that.form.send_date =this.$TOOL.dateFormat2(new Date()); that.form.handle_date =that.form.send_date =this.$TOOL.dateFormat2(new Date());
@ -384,8 +393,6 @@ export default {
} }
}else if(that.type==40){// }else if(that.type==40){//
that.getMaterialNotok(); that.getMaterialNotok();
}else if(that.type==60){
} }
that.getMgroupOptions(); that.getMgroupOptions();
}, },
@ -589,6 +596,7 @@ export default {
data = that.materialOptions.filter((item) => { data = that.materialOptions.filter((item) => {
return that.selectItems.indexOf(item.id)>-1; return that.selectItems.indexOf(item.id)>-1;
}); });
that.form.new_batch = data[0].batch+'g';
let materialId = data[0].material; let materialId = data[0].material;
if(that.type==50){}else{ if(that.type==50){}else{
let params = { let params = {
@ -765,6 +773,7 @@ export default {
let hasArr = []; let hasArr = [];
that.materialOptions.forEach((item) => { that.materialOptions.forEach((item) => {
if(item.batch == res.batch){ if(item.batch == res.batch){
that.form.new_batch = res.batch+'g';
hasArr.push(item); hasArr.push(item);
let params = {material: item.material,type: that.type}; let params = {material: item.material,type: that.type};
that.$API.wpm.handover.mgroups.req(params).then((res0) => { that.$API.wpm.handover.mgroups.req(params).then((res0) => {
@ -818,6 +827,7 @@ export default {
if(arr2.length>0){ if(arr2.length>0){
that.$message.error("该批次已存在") that.$message.error("该批次已存在")
}else{ }else{
that.form.new_batch = arr[0].batch+'g';
let params = {material: arr[0].material,type: that.type}; let params = {material: arr[0].material,type: that.type};
that.$API.wpm.handover.mgroups.req(params).then((res0) => { that.$API.wpm.handover.mgroups.req(params).then((res0) => {
that.mgroupOptions = res0; that.mgroupOptions = res0;
@ -872,6 +882,7 @@ export default {
}else{//handoverb }else{//handoverb
that.materialOptions.forEach((item) => { that.materialOptions.forEach((item) => {
if(item.id == res[0].wm){ if(item.id == res[0].wm){
that.form.new_batch = item.batch+'g';
let params = {material: item.material,type: that.type}; let params = {material: item.material,type: that.type};
that.$API.wpm.handover.mgroups.req(params).then((res1) => { that.$API.wpm.handover.mgroups.req(params).then((res1) => {
that.mgroupOptions = res1; that.mgroupOptions = res1;