fix:光芯交接表单优化
This commit is contained in:
parent
03f65b7129
commit
125c9759b8
|
@ -185,7 +185,7 @@
|
||||||
size="small"
|
size="small"
|
||||||
@click="table_reBack(scope.row)"
|
@click="table_reBack(scope.row)"
|
||||||
type="danger"
|
type="danger"
|
||||||
v-if="scope.row.recive_mgroup == mgroupId&&scope.row.submit_time!== null&&scope.row.type == 10&&scope.row.mtype == 10"
|
v-if="scope.row.recive_mgroup == mgroupId&&scope.row.submit_time!== null&&(scope.row.type == 10||scope.row.type == 20)&&scope.row.mtype == 10"
|
||||||
>退回</el-button>
|
>退回</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
link
|
link
|
||||||
|
@ -403,7 +403,7 @@ export default {
|
||||||
that.codeText2 = codeText2;
|
that.codeText2 = codeText2;
|
||||||
this.dialog.save = true;
|
this.dialog.save = true;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.saveDialog.open("add",codeText2,20);
|
this.$refs.saveDialog.open("add",codeText2,10);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//编辑
|
//编辑
|
||||||
|
|
|
@ -35,7 +35,26 @@
|
||||||
<el-row v-show="addShow">
|
<el-row v-show="addShow">
|
||||||
<el-col>
|
<el-col>
|
||||||
<el-form-item label="交接物料">
|
<el-form-item label="交接物料">
|
||||||
<el-select
|
<xtSelect
|
||||||
|
:apiObj="apiObjM"
|
||||||
|
v-model="form.wm_in"
|
||||||
|
v-model:obj="selectObj"
|
||||||
|
:labelField="'batch'"
|
||||||
|
style="width: 100%;"
|
||||||
|
:params = "paramsM"
|
||||||
|
@change="materialChange0"
|
||||||
|
>
|
||||||
|
<el-table-column label="物料" prop="full_name">
|
||||||
|
<template #default="scope">
|
||||||
|
<span v-if="scope.row.state==20" style="color: red;border: 1px solid red;border-radius: 3px;">不合格</span>
|
||||||
|
<span v-if="scope.row.state==30" style="color: orange;border: 1px solid orange;border-radius: 3px;">返工</span>
|
||||||
|
<span>{{ scope.row.batch }}({{ scope.row.material_name }})</span>
|
||||||
|
<span v-if="scope.row.defect_name !== null" style="color: orangered">{{ scope.row.defect_name }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="数量" prop="count" width="110px"></el-table-column>
|
||||||
|
</xtSelect>
|
||||||
|
<!-- <el-select
|
||||||
v-model="selectItems"
|
v-model="selectItems"
|
||||||
placeholder="交接物料"
|
placeholder="交接物料"
|
||||||
filterable
|
filterable
|
||||||
|
@ -55,22 +74,22 @@
|
||||||
<span v-if="item.defect_name !== null" style="color: orangered">{{ item.defect_name }}</span>
|
<span v-if="item.defect_name !== null" style="color: orangered">{{ item.defect_name }}</span>
|
||||||
<span style="float: right">{{ item.count }}</span>
|
<span style="float: right">{{ item.count }}</span>
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select> -->
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row v-for="(listItem,$index) in form.handoverb" :key="listItem">
|
<el-row v-for="(listItem,$index) in form.handoverb" :key="listItem">
|
||||||
<el-col :span="10">
|
<el-col :span="12">
|
||||||
<el-form-item label="交接物料">
|
<el-form-item label="交接物料">
|
||||||
<el-input v-model="listItem.batch" disabled></el-input>
|
<el-input v-model="listItem.label" disabled></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="5">
|
<el-col :span="4">
|
||||||
<el-form-item label="总数量">
|
<el-form-item label="总数量">
|
||||||
<span>{{ listItem.count_cando }}</span>
|
<span>{{ listItem.count_cando }}</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="7">
|
<el-col :span="6">
|
||||||
<el-form-item label="交接数量">
|
<el-form-item label="交接数量">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="listItem.count"
|
v-model="listItem.count"
|
||||||
|
@ -235,6 +254,9 @@ export default {
|
||||||
recive_mgroup: null,
|
recive_mgroup: null,
|
||||||
handoverb:[],
|
handoverb:[],
|
||||||
},
|
},
|
||||||
|
apiObjM:null,
|
||||||
|
paramsM:{},
|
||||||
|
selectObj:{},
|
||||||
rules: {
|
rules: {
|
||||||
batch: [
|
batch: [
|
||||||
{
|
{
|
||||||
|
@ -319,17 +341,22 @@ export default {
|
||||||
//获取交接物料
|
//获取交接物料
|
||||||
if(that.type==20&&that.mgroupName!=='废品库'){
|
if(that.type==20&&that.mgroupName!=='废品库'){
|
||||||
//返工交接
|
//返工交接
|
||||||
that.getMaterialRework();
|
// that.getMaterialRework();
|
||||||
|
that.paramsM = {mgroup: that.mgroupId,page: 0,state__in:'20,34',tag : 'done'};
|
||||||
}else if(that.type==20&&that.mgroupName=='废品库'){
|
}else if(that.type==20&&that.mgroupName=='废品库'){
|
||||||
//废品出库
|
//废品出库
|
||||||
that.getMaterialFP();
|
// that.getMaterialFP();
|
||||||
|
that.paramsM = {page: 0,state : 50,state_all: 1};
|
||||||
}else if(that.type==40){
|
}else if(that.type==40){
|
||||||
//报废交接
|
//报废交接
|
||||||
that.getMaterialNotok();
|
// that.getMaterialNotok();
|
||||||
|
that.paramsM = {mgroupx: that.mgroupId,page: 0,state:20};
|
||||||
}else{
|
}else{
|
||||||
//其他
|
//其他
|
||||||
that.getMaterial();
|
that.paramsM = {mgroup: that.mgroupId,page: 0,state:10,tag : 'done'};
|
||||||
|
// that.getMaterial();
|
||||||
}
|
}
|
||||||
|
that.apiObjM = this.$API.wpm.wmaterial.list;
|
||||||
if(that.type==40||that.type==20){
|
if(that.type==40||that.type==20){
|
||||||
that.getMgroupOptions();
|
that.getMgroupOptions();
|
||||||
}else{
|
}else{
|
||||||
|
@ -353,32 +380,32 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//获取车间物料
|
//获取车间物料
|
||||||
getMaterial() {
|
// getMaterial() {
|
||||||
let that = this;
|
// let that = this;
|
||||||
var req = {
|
// var req = {
|
||||||
page: 0,
|
// page: 0,
|
||||||
state:10,
|
// state:10,
|
||||||
tag:'done'
|
// tag:'done'
|
||||||
};
|
// };
|
||||||
that.materialOptions = [];
|
// that.materialOptions = [];
|
||||||
req.mgroup = that.mgroupId;
|
// req.mgroup = that.mgroupId;
|
||||||
that.listParams = req;
|
// that.listParams = req;
|
||||||
this.$API.wpm.wmaterial.list.req(req).then((res) => {
|
// this.$API.wpm.wmaterial.list.req(req).then((res) => {
|
||||||
that.materialOptions = res;
|
// that.materialOptions = res;
|
||||||
res.forEach(item=>{
|
// res.forEach(item=>{
|
||||||
if(that.codeText!==''&&item.batch === that.codeText){
|
// if(that.codeText!==''&&item.batch === that.codeText){
|
||||||
let obj = {};
|
// let obj = {};
|
||||||
obj.wm = item.id;
|
// obj.wm = item.id;
|
||||||
obj.batch = item.batch;
|
// obj.batch = item.batch;
|
||||||
obj.count = item.count_cando;
|
// obj.count = item.count_cando;
|
||||||
obj.count_cando = item.count_cando;
|
// obj.count_cando = item.count_cando;
|
||||||
that.totalCount = item.count_cando;
|
// that.totalCount = item.count_cando;
|
||||||
that.form.handoverb.push(obj)
|
// that.form.handoverb.push(obj)
|
||||||
that.getResaveMgroups(item.material);
|
// that.getResaveMgroups(item.material);
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
});
|
// });
|
||||||
},
|
// },
|
||||||
getResaveMgroups(material){
|
getResaveMgroups(material){
|
||||||
let that = this;
|
let that = this;
|
||||||
let params = {
|
let params = {
|
||||||
|
@ -393,45 +420,45 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
//获取车间不合格物料
|
//获取车间不合格物料
|
||||||
getMaterialNotok() {
|
// getMaterialNotok() {
|
||||||
let that = this;
|
// let that = this;
|
||||||
that.materialOptions = [];
|
// that.materialOptions = [];
|
||||||
var req = {
|
// var req = {
|
||||||
mgroupx: that.mgroupId,
|
// mgroupx: that.mgroupId,
|
||||||
page: 0,
|
// page: 0,
|
||||||
state:20
|
// state:20
|
||||||
};
|
// };
|
||||||
that.listParams = req;
|
// that.listParams = req;
|
||||||
this.$API.wpm.wmaterial.list.req(req).then((res) => {
|
// this.$API.wpm.wmaterial.list.req(req).then((res) => {
|
||||||
that.materialOptions = res;
|
// that.materialOptions = res;
|
||||||
});
|
// });
|
||||||
},
|
// },
|
||||||
getMaterialRework(){
|
// getMaterialRework(){
|
||||||
let that = this;
|
// let that = this;
|
||||||
that.materialOptions = [];
|
// that.materialOptions = [];
|
||||||
var req = {
|
// var req = {
|
||||||
mgroup: that.mgroupId,
|
// mgroup: that.mgroupId,
|
||||||
page: 0,
|
// page: 0,
|
||||||
tag : 'done'
|
// tag : 'done'
|
||||||
};
|
// };
|
||||||
that.listParams = req;
|
// that.listParams = req;
|
||||||
this.$API.wpm.wmaterial.list.req(req).then((res) => {
|
// this.$API.wpm.wmaterial.list.req(req).then((res) => {
|
||||||
that.materialOptions = res;
|
// that.materialOptions = res;
|
||||||
});
|
// });
|
||||||
},
|
// },
|
||||||
//获取废品库物料
|
//获取废品库物料
|
||||||
getMaterialFP() {
|
// getMaterialFP() {
|
||||||
let that = this;
|
// let that = this;
|
||||||
that.materialOptions = [];
|
// that.materialOptions = [];
|
||||||
var obj = {
|
// var obj = {
|
||||||
page: 0,
|
// page: 0,
|
||||||
state : 50,
|
// state : 50,
|
||||||
state_all: 1
|
// state_all: 1
|
||||||
};
|
// };
|
||||||
that.$API.wpm.wmaterial.list.req(obj).then((res) => {
|
// that.$API.wpm.wmaterial.list.req(obj).then((res) => {
|
||||||
that.materialOptions = res;
|
// that.materialOptions = res;
|
||||||
});
|
// });
|
||||||
},
|
// },
|
||||||
//获取交送工段人员
|
//获取交送工段人员
|
||||||
getUserList() {
|
getUserList() {
|
||||||
let that = this;
|
let that = this;
|
||||||
|
@ -521,21 +548,47 @@ export default {
|
||||||
this.visible = true;
|
this.visible = true;
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
materialChange() {
|
materialChange0(){
|
||||||
let that = this;
|
let that = this;
|
||||||
let totalCount = 0;
|
let obj = {};
|
||||||
let data = that.materialOptions.filter((item) => {
|
obj.wm = that.selectObj.id;
|
||||||
return that.selectItems.indexOf(item.id)>-1;
|
obj.batch = that.selectObj.batch;
|
||||||
});
|
obj.label = that.selectObj.defect !== null?that.selectObj.batch+'('+that.selectObj.material_name+')'+that.selectObj.defect_name:that.selectObj.batch+'('+that.selectObj.material_name+')';
|
||||||
data.forEach(item=>{
|
obj.count = that.selectObj.count_cando;
|
||||||
item.wm = item.id;
|
obj.defect_name = that.selectObj.defect_name;
|
||||||
item.count = item.count_cando;
|
obj.count_cando = that.selectObj.count_cando;
|
||||||
totalCount += Number(item.count_cando);
|
obj.material = that.selectObj.material;
|
||||||
})
|
if(that.form.handoverb.length>0){
|
||||||
that.totalCount = totalCount;
|
let datas = that.form.handoverb.filter((item) => {
|
||||||
that.form.handoverb = data;
|
return item.wm==that.selectObj.id;
|
||||||
that.getResaveMgroups(data[0].material);
|
});
|
||||||
|
if(datas.length>0){
|
||||||
|
that.$message.warning('该物料已存在');
|
||||||
|
}else{
|
||||||
|
that.totalCount += Number(obj.count_cando);
|
||||||
|
that.form.handoverb.push(obj);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
that.totalCount += Number(obj.count_cando);
|
||||||
|
that.form.handoverb.push(obj);
|
||||||
|
}
|
||||||
|
that.getResaveMgroups(obj.material);
|
||||||
},
|
},
|
||||||
|
// materialChange() {
|
||||||
|
// let that = this;
|
||||||
|
// let totalCount = 0;
|
||||||
|
// let data = that.materialOptions.filter((item) => {
|
||||||
|
// return that.selectItems.indexOf(item.id)>-1;
|
||||||
|
// });
|
||||||
|
// data.forEach(item=>{
|
||||||
|
// item.wm = item.id;
|
||||||
|
// item.count = item.count_cando;
|
||||||
|
// totalCount += Number(item.count_cando);
|
||||||
|
// })
|
||||||
|
// that.totalCount = totalCount;
|
||||||
|
// that.form.handoverb = data;
|
||||||
|
// that.getResaveMgroups(data[0].material);
|
||||||
|
// },
|
||||||
countChange(){
|
countChange(){
|
||||||
let that = this;
|
let that = this;
|
||||||
let totalCount = 0;
|
let totalCount = 0;
|
||||||
|
@ -628,17 +681,35 @@ export default {
|
||||||
if(arr.length>0){
|
if(arr.length>0){
|
||||||
that.$message.error("该批次已存在")
|
that.$message.error("该批次已存在")
|
||||||
}else{
|
}else{
|
||||||
that.materialOptions.forEach((item) => {
|
let params = {mgroup: that.mgroupId,page: 0,state__in:res.state,search:res.batch,tag : 'done'};
|
||||||
if(item.batch == res.batch){
|
if(that.type==10){
|
||||||
let obj = {};
|
params.state__in = '10';
|
||||||
obj.wm = item.id;
|
}else if(that.type==20){
|
||||||
obj.batch = item.batch;
|
params.state__in = '20,34';
|
||||||
obj.counts = item.count;
|
}
|
||||||
obj.count = item.count;
|
that.$API.wpm.wmaterial.list.req(params).then((res1) => {
|
||||||
that.form.handoverb.push(obj)
|
if(res1.length>0){
|
||||||
that.getResaveMgroups(item.material);
|
res1.forEach(item=>{
|
||||||
}
|
let cando = Number(item.count_canhandover);
|
||||||
})
|
if(cando>0&&item.defect_name==res.defect_name){
|
||||||
|
let obj = {};
|
||||||
|
obj.wm = item.id;
|
||||||
|
obj.batch = item.batch;
|
||||||
|
obj.label = item.defect !== null?item.batch+'('+item.material_name+')'+item.defect_name:item.batch+'('+item.material_name+')';
|
||||||
|
obj.count = item.count_cando;
|
||||||
|
obj.defect_name = item.defect_name;
|
||||||
|
obj.count_cando = item.count_cando;
|
||||||
|
obj.material = item.material;
|
||||||
|
that.form.handoverb.push(obj)
|
||||||
|
that.getResaveMgroups(obj.material);
|
||||||
|
}
|
||||||
|
// else{
|
||||||
|
// that.$message.error("该批次物料没有可交接的数量")
|
||||||
|
// }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
that.codeText = '';
|
||||||
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
//根据扫描内容,获取物料详情匹配当前库存物料
|
//根据扫描内容,获取物料详情匹配当前库存物料
|
||||||
|
|
Loading…
Reference in New Issue