fix:交接撤消
This commit is contained in:
parent
306a797c86
commit
eb9396f2f8
|
@ -450,6 +450,15 @@ export default {
|
|||
);
|
||||
},
|
||||
},
|
||||
revert: {
|
||||
name: "撤回",
|
||||
req: async function (id, data) {
|
||||
return await http.post(
|
||||
`${config.API_URL}/wpm/handover/${id}/revert/`,
|
||||
data
|
||||
);
|
||||
},
|
||||
},
|
||||
mgroups:{
|
||||
name: "获取可交接的工段",
|
||||
req: async function (data) {
|
||||
|
|
|
@ -144,12 +144,12 @@
|
|||
width="300"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
<!-- <el-button
|
||||
v-if="scope.row.send_mgroup == mgroupId||deptId==scope.row.send_dept"
|
||||
@click="table_print(scope.row)"
|
||||
type="success"
|
||||
>打印</el-button
|
||||
>
|
||||
> -->
|
||||
<el-button
|
||||
@click="table_receive(scope.row)"
|
||||
type="success"
|
||||
|
@ -160,6 +160,11 @@
|
|||
type="danger"
|
||||
v-if="scope.row.recive_mgroup == mgroupId&&scope.row.submit_time!== null&&scope.row.type == 10&&scope.row.mtype == 10"
|
||||
>退回</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
@click="table_reBack2(scope.row)"
|
||||
v-if="scope.row.submit_time!== null&&(scope.row.type == 10||scope.row.type == 20)"
|
||||
>撤消</el-button>
|
||||
<el-button
|
||||
@click="table_show(scope.row)"
|
||||
type="warning"
|
||||
|
@ -415,6 +420,13 @@ export default {
|
|||
that.$refs.table.queryData(that.query);
|
||||
});
|
||||
},
|
||||
//撤消
|
||||
table_reBack2(row){
|
||||
let that = this;
|
||||
that.$API.wpm.handover.revert.req(row.id).then((res) => {
|
||||
that.$refs.table.refresh();
|
||||
});
|
||||
},
|
||||
//退回
|
||||
table_reBack(row){
|
||||
let that = this;
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
<span v-else>(原料棒)</span>
|
||||
|
||||
<div style="float: right">
|
||||
<span>{{ item.count }}</span>
|
||||
<span>{{ item.count_canhandover }}</span>
|
||||
<span v-if="item.notok_sign_name !== null" style="color: #aaaaaa">
|
||||
({{ item.notok_sign_name }})
|
||||
</span>
|
||||
|
@ -70,7 +70,7 @@
|
|||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="总数量">
|
||||
<span>{{ listItem.count_cando }}</span>
|
||||
<span>{{ listItem.count_canhandover }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="7" >
|
||||
|
@ -91,7 +91,7 @@
|
|||
controls-position="right"
|
||||
:min="0"
|
||||
:step="1"
|
||||
:max="listItem.count_cando"
|
||||
:max="listItem.count_canhandover"
|
||||
:disabled="mode==='show'||listItem.tracking==20"
|
||||
:step-strictly="true"
|
||||
style="width: 100%"
|
||||
|
@ -442,7 +442,9 @@ export default {
|
|||
}
|
||||
that.materialOptions = [];
|
||||
this.$API.wpm.wmaterial.list.req(req).then((res) => {
|
||||
that.materialOptions = res;
|
||||
that.materialOptions = res.filter(item=>{
|
||||
return item.count_canhandover>0;
|
||||
})
|
||||
});
|
||||
},
|
||||
//获取车间不合格物料
|
||||
|
@ -455,7 +457,9 @@ export default {
|
|||
state__in:'20,34'
|
||||
};
|
||||
this.$API.wpm.wmaterial.list.req(req).then((res) => {
|
||||
that.materialOptions = res;
|
||||
that.materialOptions = res.filter(item=>{
|
||||
return item.count_canhandover>0;
|
||||
})
|
||||
});
|
||||
},
|
||||
//获取废品库物料
|
||||
|
@ -468,7 +472,9 @@ export default {
|
|||
state_all: 1
|
||||
};
|
||||
that.$API.wpm.wmaterial.list.req(obj).then((res) => {
|
||||
that.materialOptions = res;
|
||||
that.materialOptions = res.filter(item=>{
|
||||
return item.count_canhandover>0;
|
||||
})
|
||||
});
|
||||
},
|
||||
getMaterialOkFangong(){
|
||||
|
@ -480,7 +486,9 @@ export default {
|
|||
mgroup: that.mgroupId,
|
||||
};
|
||||
that.$API.wpm.wmaterial.list.req(obj).then((res) => {
|
||||
that.materialOptions = res;
|
||||
that.materialOptions = res.filter(item=>{
|
||||
return item.count_canhandover>0;
|
||||
})
|
||||
});
|
||||
},
|
||||
//获取交送工段人员
|
||||
|
@ -591,8 +599,8 @@ export default {
|
|||
})
|
||||
data.forEach((item,index)=>{
|
||||
item.wm = item.id;
|
||||
item.count = item.count_cando;
|
||||
totalCount += Number(item.count_cando);
|
||||
item.count = item.count_canhandover;
|
||||
totalCount += Number(item.count_canhandover);
|
||||
item.tracking = item.material_.tracking;
|
||||
if(item.material_.process_name){
|
||||
item.process = item.material_.process_name;
|
||||
|
@ -734,7 +742,7 @@ export default {
|
|||
let arr = [];
|
||||
if(that.form.handoverb&&that.form.handoverb.length>0){
|
||||
that.form.handoverb.forEach((item) => {
|
||||
if(item.batch == res.batch&&item.state==res.state){
|
||||
if(item.batch == res.batch&&item.state==res.state&&item.defect==res.defect){
|
||||
arr.push(item);
|
||||
}
|
||||
})
|
||||
|
@ -760,9 +768,10 @@ export default {
|
|||
if(item.material_.process_name){
|
||||
obj.process = item.material_.process_name;
|
||||
}
|
||||
obj.count_cando = item.count;
|
||||
obj.count = item.count;
|
||||
obj.count_cando = item.count_canhandover;
|
||||
obj.count = item.count_canhandover;
|
||||
obj.state = res.state;
|
||||
obj.defect = res.defect;
|
||||
obj.handoverbw = [];
|
||||
that.$API.wpm.wpr.list.req({wm:item.id,page:0}).then((res) => {
|
||||
let handoverbw = [];
|
||||
|
@ -810,8 +819,8 @@ export default {
|
|||
if(arr[0].material_.process_name){
|
||||
obj2.process = arr[0].material_.process_name;
|
||||
}
|
||||
obj2.count_cando = arr[0].count;
|
||||
obj2.count = arr[0].count;
|
||||
obj2.count_cando = arr[0].count_canhandover;
|
||||
obj2.count = arr[0].count_canhandover;
|
||||
that.form.handoverb.push(obj2);
|
||||
that.wm_in = "";
|
||||
}
|
||||
|
@ -866,7 +875,7 @@ export default {
|
|||
if(item.material_.process_name){
|
||||
obj2.process = item.material_.process_name;
|
||||
}
|
||||
obj2.count_cando = item.count;
|
||||
obj2.count_cando = item.count_canhandover;
|
||||
obj2.handoverbw = [];
|
||||
obj2.count = 1;
|
||||
let obj3 = {};
|
||||
|
|
|
@ -187,6 +187,13 @@
|
|||
type="danger"
|
||||
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
|
||||
size="small"
|
||||
type="danger"
|
||||
@click="table_reBack2(scope.row)"
|
||||
v-if="scope.row.submit_time!== null&&(scope.row.type == 10||scope.row.type == 20)"
|
||||
>撤消</el-button>
|
||||
<el-button
|
||||
link
|
||||
size="small"
|
||||
|
@ -474,6 +481,13 @@ export default {
|
|||
that.$refs.table.queryData(that.query);
|
||||
});
|
||||
},
|
||||
//撤消
|
||||
table_reBack2(row){
|
||||
let that = this;
|
||||
that.$API.wpm.handover.revert.req(row.id).then((res) => {
|
||||
that.$refs.table.refresh();
|
||||
});
|
||||
},
|
||||
//退回
|
||||
table_reBack(row){
|
||||
let that = this;
|
||||
|
|
|
@ -52,29 +52,8 @@
|
|||
<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>
|
||||
<el-table-column label="数量" prop="count_canhandover" width="110px"></el-table-column>
|
||||
</xtSelect>
|
||||
<!-- <el-select
|
||||
v-model="selectItems"
|
||||
placeholder="交接物料"
|
||||
filterable
|
||||
multiple
|
||||
clearable
|
||||
@change="materialChange"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in materialOptions"
|
||||
:key="item.id"
|
||||
:label="item.batch"
|
||||
:value="item.id"
|
||||
>
|
||||
<span>{{ item.batch }}</span>
|
||||
<span>({{ item.material_name }})</span>
|
||||
<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-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
@ -379,33 +358,6 @@ 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);
|
||||
// }
|
||||
// })
|
||||
// });
|
||||
// },
|
||||
getResaveMgroups(material){
|
||||
let that = this;
|
||||
let params = {
|
||||
|
@ -419,46 +371,6 @@ 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;
|
||||
// });
|
||||
// },
|
||||
//获取废品库物料
|
||||
// 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;
|
||||
|
@ -538,7 +450,7 @@ export default {
|
|||
}else{
|
||||
this.form.handoverb = data;
|
||||
data.forEach(item=>{
|
||||
this.totalCount += Number(item.count_cando);
|
||||
this.totalCount += Number(item.count);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -550,45 +462,36 @@ export default {
|
|||
},
|
||||
materialChange0(){
|
||||
let that = this;
|
||||
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('该物料已存在');
|
||||
if(that.selectObj.count_canhandover>0){
|
||||
let obj = {};
|
||||
obj.wm = that.selectObj.id;
|
||||
obj.state = that.selectObj.state;
|
||||
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_canhandover;
|
||||
obj.defect = that.selectObj.defect;
|
||||
obj.defect_name = that.selectObj.defect_name;
|
||||
obj.count_cando = that.selectObj.count_canhandover;
|
||||
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_canhandover);
|
||||
that.form.handoverb.push(obj);
|
||||
}
|
||||
}else{
|
||||
that.totalCount += Number(obj.count_cando);
|
||||
that.totalCount += Number(obj.count_canhandover);
|
||||
that.form.handoverb.push(obj);
|
||||
}
|
||||
that.getResaveMgroups(obj.material);
|
||||
}else{
|
||||
that.totalCount += Number(obj.count_cando);
|
||||
that.form.handoverb.push(obj);
|
||||
that.$message.warning('该物料暂无可交接数量');
|
||||
}
|
||||
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;
|
||||
|
@ -676,7 +579,7 @@ export default {
|
|||
let id = data.split('#')[1];
|
||||
this.$API.cm.labelmat.item.req(id).then((res) => {
|
||||
let arr = that.form.handoverb.filter((item) => {
|
||||
return item.batch == res.batch;
|
||||
return item.batch == res.batch&&item.state==res.state&&item.defect==res.defect;
|
||||
})
|
||||
if(arr.length>0){
|
||||
that.$message.error("该批次已存在")
|
||||
|
@ -696,9 +599,11 @@ export default {
|
|||
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.count = cando;
|
||||
obj.state = item.state;
|
||||
obj.defect = item.defect;
|
||||
obj.defect_name = item.defect_name;
|
||||
obj.count_cando = item.count_cando;
|
||||
obj.count_cando = cando;
|
||||
obj.material = item.material;
|
||||
that.form.handoverb.push(obj)
|
||||
that.getResaveMgroups(obj.material);
|
||||
|
|
Loading…
Reference in New Issue