fix:光芯交接表单优化
This commit is contained in:
parent
03f65b7129
commit
125c9759b8
|
@ -185,7 +185,7 @@
|
|||
size="small"
|
||||
@click="table_reBack(scope.row)"
|
||||
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
|
||||
link
|
||||
|
@ -403,7 +403,7 @@ export default {
|
|||
that.codeText2 = codeText2;
|
||||
this.dialog.save = true;
|
||||
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-col>
|
||||
<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"
|
||||
placeholder="交接物料"
|
||||
filterable
|
||||
|
@ -55,22 +74,22 @@
|
|||
<span v-if="item.defect_name !== null" style="color: orangered">{{ item.defect_name }}</span>
|
||||
<span style="float: right">{{ item.count }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-select> -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-for="(listItem,$index) in form.handoverb" :key="listItem">
|
||||
<el-col :span="10">
|
||||
<el-col :span="12">
|
||||
<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-col>
|
||||
<el-col :span="5">
|
||||
<el-col :span="4">
|
||||
<el-form-item label="总数量">
|
||||
<span>{{ listItem.count_cando }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="交接数量">
|
||||
<el-input-number
|
||||
v-model="listItem.count"
|
||||
|
@ -235,6 +254,9 @@ export default {
|
|||
recive_mgroup: null,
|
||||
handoverb:[],
|
||||
},
|
||||
apiObjM:null,
|
||||
paramsM:{},
|
||||
selectObj:{},
|
||||
rules: {
|
||||
batch: [
|
||||
{
|
||||
|
@ -319,17 +341,22 @@ export default {
|
|||
//获取交接物料
|
||||
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=='废品库'){
|
||||
//废品出库
|
||||
that.getMaterialFP();
|
||||
// that.getMaterialFP();
|
||||
that.paramsM = {page: 0,state : 50,state_all: 1};
|
||||
}else if(that.type==40){
|
||||
//报废交接
|
||||
that.getMaterialNotok();
|
||||
// that.getMaterialNotok();
|
||||
that.paramsM = {mgroupx: that.mgroupId,page: 0,state:20};
|
||||
}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){
|
||||
that.getMgroupOptions();
|
||||
}else{
|
||||
|
@ -353,32 +380,32 @@ export default {
|
|||
});
|
||||
},
|
||||
//获取车间物料
|
||||
getMaterial() {
|
||||
let that = this;
|
||||
var req = {
|
||||
page: 0,
|
||||
state:10,
|
||||
tag:'done'
|
||||
};
|
||||
that.materialOptions = [];
|
||||
req.mgroup = that.mgroupId;
|
||||
that.listParams = req;
|
||||
this.$API.wpm.wmaterial.list.req(req).then((res) => {
|
||||
that.materialOptions = res;
|
||||
res.forEach(item=>{
|
||||
if(that.codeText!==''&&item.batch === that.codeText){
|
||||
let obj = {};
|
||||
obj.wm = item.id;
|
||||
obj.batch = item.batch;
|
||||
obj.count = item.count_cando;
|
||||
obj.count_cando = item.count_cando;
|
||||
that.totalCount = item.count_cando;
|
||||
that.form.handoverb.push(obj)
|
||||
that.getResaveMgroups(item.material);
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
// getMaterial() {
|
||||
// let that = this;
|
||||
// var req = {
|
||||
// page: 0,
|
||||
// state:10,
|
||||
// tag:'done'
|
||||
// };
|
||||
// that.materialOptions = [];
|
||||
// req.mgroup = that.mgroupId;
|
||||
// that.listParams = req;
|
||||
// this.$API.wpm.wmaterial.list.req(req).then((res) => {
|
||||
// that.materialOptions = res;
|
||||
// res.forEach(item=>{
|
||||
// if(that.codeText!==''&&item.batch === that.codeText){
|
||||
// let obj = {};
|
||||
// obj.wm = item.id;
|
||||
// obj.batch = item.batch;
|
||||
// obj.count = item.count_cando;
|
||||
// obj.count_cando = item.count_cando;
|
||||
// that.totalCount = item.count_cando;
|
||||
// that.form.handoverb.push(obj)
|
||||
// that.getResaveMgroups(item.material);
|
||||
// }
|
||||
// })
|
||||
// });
|
||||
// },
|
||||
getResaveMgroups(material){
|
||||
let that = this;
|
||||
let params = {
|
||||
|
@ -393,45 +420,45 @@ export default {
|
|||
})
|
||||
},
|
||||
//获取车间不合格物料
|
||||
getMaterialNotok() {
|
||||
let that = this;
|
||||
that.materialOptions = [];
|
||||
var req = {
|
||||
mgroupx: that.mgroupId,
|
||||
page: 0,
|
||||
state:20
|
||||
};
|
||||
that.listParams = req;
|
||||
this.$API.wpm.wmaterial.list.req(req).then((res) => {
|
||||
that.materialOptions = res;
|
||||
});
|
||||
},
|
||||
getMaterialRework(){
|
||||
let that = this;
|
||||
that.materialOptions = [];
|
||||
var req = {
|
||||
mgroup: that.mgroupId,
|
||||
page: 0,
|
||||
tag : 'done'
|
||||
};
|
||||
that.listParams = req;
|
||||
this.$API.wpm.wmaterial.list.req(req).then((res) => {
|
||||
that.materialOptions = res;
|
||||
});
|
||||
},
|
||||
// getMaterialNotok() {
|
||||
// let that = this;
|
||||
// that.materialOptions = [];
|
||||
// var req = {
|
||||
// mgroupx: that.mgroupId,
|
||||
// page: 0,
|
||||
// state:20
|
||||
// };
|
||||
// that.listParams = req;
|
||||
// this.$API.wpm.wmaterial.list.req(req).then((res) => {
|
||||
// that.materialOptions = res;
|
||||
// });
|
||||
// },
|
||||
// getMaterialRework(){
|
||||
// let that = this;
|
||||
// that.materialOptions = [];
|
||||
// var req = {
|
||||
// mgroup: that.mgroupId,
|
||||
// page: 0,
|
||||
// tag : 'done'
|
||||
// };
|
||||
// that.listParams = req;
|
||||
// this.$API.wpm.wmaterial.list.req(req).then((res) => {
|
||||
// that.materialOptions = res;
|
||||
// });
|
||||
// },
|
||||
//获取废品库物料
|
||||
getMaterialFP() {
|
||||
let that = this;
|
||||
that.materialOptions = [];
|
||||
var obj = {
|
||||
page: 0,
|
||||
state : 50,
|
||||
state_all: 1
|
||||
};
|
||||
that.$API.wpm.wmaterial.list.req(obj).then((res) => {
|
||||
that.materialOptions = res;
|
||||
});
|
||||
},
|
||||
// getMaterialFP() {
|
||||
// let that = this;
|
||||
// that.materialOptions = [];
|
||||
// var obj = {
|
||||
// page: 0,
|
||||
// state : 50,
|
||||
// state_all: 1
|
||||
// };
|
||||
// that.$API.wpm.wmaterial.list.req(obj).then((res) => {
|
||||
// that.materialOptions = res;
|
||||
// });
|
||||
// },
|
||||
//获取交送工段人员
|
||||
getUserList() {
|
||||
let that = this;
|
||||
|
@ -521,21 +548,47 @@ export default {
|
|||
this.visible = true;
|
||||
return this;
|
||||
},
|
||||
materialChange() {
|
||||
materialChange0(){
|
||||
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);
|
||||
let obj = {};
|
||||
obj.wm = that.selectObj.id;
|
||||
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+')';
|
||||
obj.count = that.selectObj.count_cando;
|
||||
obj.defect_name = that.selectObj.defect_name;
|
||||
obj.count_cando = that.selectObj.count_cando;
|
||||
obj.material = that.selectObj.material;
|
||||
if(that.form.handoverb.length>0){
|
||||
let datas = that.form.handoverb.filter((item) => {
|
||||
return item.wm==that.selectObj.id;
|
||||
});
|
||||
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(){
|
||||
let that = this;
|
||||
let totalCount = 0;
|
||||
|
@ -628,17 +681,35 @@ export default {
|
|||
if(arr.length>0){
|
||||
that.$message.error("该批次已存在")
|
||||
}else{
|
||||
that.materialOptions.forEach((item) => {
|
||||
if(item.batch == res.batch){
|
||||
let obj = {};
|
||||
obj.wm = item.id;
|
||||
obj.batch = item.batch;
|
||||
obj.counts = item.count;
|
||||
obj.count = item.count;
|
||||
that.form.handoverb.push(obj)
|
||||
that.getResaveMgroups(item.material);
|
||||
}
|
||||
})
|
||||
let params = {mgroup: that.mgroupId,page: 0,state__in:res.state,search:res.batch,tag : 'done'};
|
||||
if(that.type==10){
|
||||
params.state__in = '10';
|
||||
}else if(that.type==20){
|
||||
params.state__in = '20,34';
|
||||
}
|
||||
that.$API.wpm.wmaterial.list.req(params).then((res1) => {
|
||||
if(res1.length>0){
|
||||
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