This commit is contained in:
zty 2025-06-23 13:53:48 +08:00
commit 4894b637d1
10 changed files with 147 additions and 173 deletions

View File

@ -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) {

View File

@ -143,9 +143,9 @@
</el-row>
<el-row v-if="mTracking==20&&form.count>1&&(form.type == 'pur_in'||form.type == 'other_in')">
<el-col :md="12" :sm="24" v-for="i in form.count" :key="i">
<el-form-item :label="'编号'+i">
<el-form-item :label="'编号'+i" required>
<!-- <el-input-number v-if="i==1" v-model="mioitems[0]" @change="firstNumberChange" placeholder="请输入编号" controls-position="right" style="width:100%"/> -->
<el-input v-model="mioitems[i-1]" placeholder="请输入编号" :disabled="true" />
<el-input v-model="mioitems[i-1]" placeholder="请输入编号" :disabled="cate == 'mainso'" />
</el-form-item>
</el-col>
</el-row>
@ -421,7 +421,7 @@ export default {
var that = this;
var type = this.form.type;
that.form.material = that.selectObj.id;
that.form.batch = that.selectObj.bin_number_main;
that.form.batch = that.cate=='helpso'?that.selectObj.bin_number_main:that.selectObj.batch;
that.mTracking = that.selectObj.tracking;
if (type == "do_in") {
if (that.selectObj.is_assemb) {
@ -446,7 +446,7 @@ export default {
selectBatchChange(item) {
this.form.batch = item.batch;
this.form.mb = item.id;
this.form.count = 0;
this.form.count = Number(item.count);
this.form.warehouse = item.warehouse;
this.warehouseDisable = true;
this.inputBatchDisable = true;
@ -477,7 +477,7 @@ export default {
for(let i=0;i<that.form.count;i++){
let indexs = i+1;
indexs = indexs<10?'0'+indexs:indexs;
that.mioitems[i] = that.form.batch+'-'+indexs;
that.mioitems[i] = that.cate == "halfgood"?'': that.form.batch+'-'+indexs;
let obj = {};
obj.number = that.mioitems[i];
that.mioitemw.push(obj);
@ -521,8 +521,18 @@ export default {
});
}
}
that.form.mioitemw = that.mioitemw;
// console.log(that.form);
if(that.mTracking==20&&that.form.count>1&&(that.form.type == 'pur_in'||that.form.type == 'other_in')){
let mioitemw = [];
that.mioitems.forEach((item,index) => {
mioitemw[index]={ number: item };
})
if(mioitemw.length==that.mioitems.length){
that.form.mioitemw = mioitemw;
}else{
that.$message.error("请输入正确数量的编号")
return;
}
}
try {
let res;
if (that.mode == "add") {

View File

@ -108,7 +108,7 @@ export default {
data() {
return {
apiObj: null,
params: {with_mio:'yes'},
params: {with_mio:'yes',material__type:30,mio__state:20},
selection: [],
tableData:[],
query: {

View File

@ -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"
@ -164,6 +164,15 @@
@click="table_show(scope.row)"
type="warning"
>查看</el-button>
<el-popconfirm
title="确定撤消吗?"
v-if="scope.row.submit_time!== null&&(scope.row.type == 10||scope.row.type == 20)"
@confirm="table_reBack2(scope.row)"
>
<template #reference>
<el-button type="danger">撤消</el-button>
</template>
</el-popconfirm>
<el-button
@click="table_edit(scope.row)"
v-auth="'handover.update'"
@ -415,6 +424,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;

View File

@ -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 = {};

View File

@ -355,7 +355,7 @@
<template #default="scope">
<el-button
type="primary"
v-if="mlogItem.submit_time == null"
v-if="mlogItem.submit_time == null&&(mlogItem.material_out_&&mlogItem.material_out_.tracking==10||scope.row.material_out_tracking==10)"
style="margin-right: 10px;"
@click="table_out_check(scope.row)"
>编辑</el-button>

View File

@ -193,6 +193,15 @@
@click="table_show(scope.row)"
type="success"
>查看</el-button>
<el-popconfirm
title="确定撤消吗?"
v-if="scope.row.submit_time!== null&&(scope.row.type == 10||scope.row.type == 20)"
@confirm="table_reBack2(scope.row)"
>
<template #reference>
<el-button type="danger" link size="small">撤消</el-button>
</template>
</el-popconfirm>
<el-button
link
size="small"
@ -474,6 +483,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;

View File

@ -37,11 +37,12 @@
<el-form-item label="交接物料">
<xtSelect
:apiObj="apiObjM"
v-model="form.wm_in"
v-model:obj="selectObj"
v-model="selectObjIds"
v-model:obj="selectObjs"
:labelField="'batch'"
style="width: 100%;"
:params = "paramsM"
:multiple="true"
@change="materialChange0"
>
<el-table-column label="物料" prop="full_name">
@ -52,29 +53,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>
@ -254,9 +234,11 @@ export default {
recive_mgroup: null,
handoverb:[],
},
selectObjIds:[],
apiObjM:null,
paramsM:{},
selectObj:{},
selectObjs:[],
rules: {
batch: [
{
@ -379,33 +361,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 +374,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;
@ -529,16 +444,18 @@ export default {
},
//
open(mode = "add",data,mtype) {
console.log(data)
this.mode = mode;
this.mtype = mtype;
if(data!==''&&data!==null&&data!==undefined){
console.log(typeof(data)=='string')
if(typeof(data)=='string'){
this.codeText = data.replace(" ","");
this.codeTextChange(this.codeText)
}else{
this.form.handoverb = data;
data.forEach(item=>{
this.totalCount += Number(item.count_cando);
this.totalCount += Number(item.count);
})
}
}
@ -550,45 +467,24 @@ export default {
},
materialChange0(){
let that = this;
that.form.handoverb = [];
that.totalCount = 0;
that.selectObjs.forEach(item=>{
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);
obj.wm = item.id;
obj.state = item.state;
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_canhandover;
obj.defect = item.defect;
obj.defect_name = item.defect_name;
obj.count_cando = item.count_canhandover;
obj.material = item.material;
that.totalCount += Number(obj.count);
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;
@ -650,11 +546,19 @@ export default {
},
//
setData(data) {
console.log(data)
let that = this;
Object.assign(this.form, data);
that.totalCount = 0;
that.form.handoverb = data.handoverb;
data.handoverb.forEach(item=>{
item.label = item.batch;
that.totalCount += Number(item.count);
})
if(data.type==30){
this.getUserList3();
that.getUserList3();
}else{
this.getUserList2();
that.getUserList2();
}
},
//
@ -676,7 +580,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("该批次已存在")
@ -691,21 +595,21 @@ export default {
if(res1.length>0){
res1.forEach(item=>{
let cando = Number(item.count_canhandover);
if(cando>0&&item.defect_name==res.defect_name){
if(cando>0&&(item.defect==null||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.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.totalCount += Number(obj.count);
that.getResaveMgroups(obj.material);
}
// else{
// that.$message.error("")
// }
})
}
that.codeText = '';

View File

@ -214,6 +214,8 @@
</sc-upload-file>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :md="8" :sm="12" :xs="24" v-for="item in testitems" :key="item.id">
<el-form-item :label="item.name">
<el-input-number
@ -269,6 +271,8 @@
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="备注">
<el-input

View File

@ -25,6 +25,7 @@
:labelField="'batch'"
style="width: 100%;"
:params = "paramsM"
@change="materialBatchChange"
>
<!-- :params = "{type__in: '10,20',is_hidden: false}" -->
<el-table-column label="物料" prop="full_name">
@ -385,15 +386,20 @@ export default {
},
materialBatchChange(){
let that = this;
that.materialOptions.forEach(item => {
if(item.id==that.form.wm_in){
that.form.batch = item.batch;
that.form.count_use = item.count;
that.batch_count = item.count;
that.materialFix = item.material;
that.form.batch = that.selectObj.batch;
that.form.count_use = that.selectObj.count;
that.batch_count = that.selectObj.count;
that.materialFix = that.selectObj.material;
that.getdefects();
}
});
// that.materialOptions.forEach(item => {
// if(item.id==that.form.wm_in){
// that.form.batch = item.batch;
// that.form.count_use = item.count;
// that.batch_count = item.count;
// that.materialFix = item.material;
// that.getdefects();
// }
// });
},
//
cellsAdd(){