fix:交接变动,返工可以选择合格品
This commit is contained in:
parent
7ecd788427
commit
d49ee2c635
|
@ -98,14 +98,17 @@
|
|||
<el-table-column
|
||||
label="物料"
|
||||
prop="material_name"
|
||||
min-width="140"
|
||||
min-width="120"
|
||||
></el-table-column>
|
||||
<el-table-column label="批次" prop="batch" min-width="140">
|
||||
<el-table-column label="数量" prop="count" width="80"></el-table-column>
|
||||
<el-table-column label="批次" prop="batch" width="60">
|
||||
<template #default="scope">
|
||||
<el-text v-if="scope.row.handoverb.length>0" type="primary">{{scope.row.handoverb.length}}批</el-text>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" prop="count" width="80"></el-table-column>
|
||||
<el-table-column label="新批次号" prop="new_batch" min-width="80">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="交接类型" prop="type" width="100">
|
||||
<template #default="scope">
|
||||
<el-text v-if="scope.row.mtype==20" type="warning">拆批</el-text>
|
||||
|
@ -145,10 +148,15 @@
|
|||
prop="recive_user_name"
|
||||
width="80"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="备注"
|
||||
prop="note"
|
||||
width="80"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="交接日期"
|
||||
prop="send_date"
|
||||
width="120"
|
||||
width="100"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
|
@ -232,16 +240,40 @@
|
|||
@closed="dialog.save = false"
|
||||
>
|
||||
</save-dialog>
|
||||
<!-- <el-dialog title="打印机设置" v-model="setNameVisible" width="600px">
|
||||
<el-form label-width="100px">
|
||||
<el-form-item label="打印机名称">
|
||||
<el-input v-model="printer_name"></el-input>
|
||||
<el-dialog title="退料操作" v-model="backDialogVisible" style="width: 70%;">
|
||||
<el-row v-for="item in handoverbList" :key="item.id" style="padding: 10px 10px 0 20px;">
|
||||
<el-col style="display: flex;border-bottom: 1px dashed #eee;">
|
||||
<el-checkbox v-model="item.checked" :label="item.batch"/>
|
||||
<el-form-item label="退料数量" label-width="150px" style="margin-bottom: 10px;">
|
||||
<el-input-number v-model="item.count" :min="0" controls-position="right"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form ref="backForm" label-width="100px" :rules="rules" :model="form" style="margin-top: 15px;">
|
||||
<el-form-item label="接收工段" prop="recive_mgroup">
|
||||
<el-select
|
||||
v-model="form.recive_mgroup"
|
||||
placeholder="接收工段"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in mgroupOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="退料原因">
|
||||
<el-input v-model="form.note"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-footer>
|
||||
<el-button type="primary" @click="savePrinter">保存</el-button>
|
||||
</el-footer>
|
||||
</el-dialog> -->
|
||||
</el-dialog>
|
||||
<el-dialog v-model="printVisible" width="1200px">
|
||||
<print :baseData="handoverItem" :tableData="handoverItem.handoverb" :type="'handover'" @closePrint="printVisible=false"/>
|
||||
</el-dialog>
|
||||
|
@ -303,6 +335,8 @@ export default {
|
|||
options: ["交送", "接收"],
|
||||
tableData: [],
|
||||
selection: [],
|
||||
mgroupOptions:[],
|
||||
handoverbList:[],
|
||||
handoverItem:{},
|
||||
values: "交送",
|
||||
mtask: "",
|
||||
|
@ -311,6 +345,13 @@ export default {
|
|||
codeText2:"",
|
||||
printer_name: "",
|
||||
printVisible:false,
|
||||
backDialogVisible:false,
|
||||
form: { },
|
||||
rules: {
|
||||
recive_mgroup: [
|
||||
{ required: true, message: "请选择接收工段", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
// setNameVisible: false,
|
||||
};
|
||||
},
|
||||
|
@ -321,9 +362,24 @@ export default {
|
|||
that.params.mgroup = that.mgroupId;
|
||||
that.apiObj = that.$API.wpm.handover.list;
|
||||
that.$refs.table.refresh();
|
||||
that.getMgroupOptions();
|
||||
},
|
||||
methods: {
|
||||
|
||||
//获取工段列表
|
||||
getMgroupOptions() {
|
||||
let that = this;
|
||||
that.$API.mtm.mgroup.list.req({ page: 0}).then((res) => {
|
||||
that.mgroupOptions = res;
|
||||
if(that.type==40){
|
||||
res.forEach(item=>{
|
||||
if(item.name=="废品库"){
|
||||
that.form.recive_mgroup = item.id;
|
||||
}
|
||||
})
|
||||
that.getCkUserList();//废品库接收人
|
||||
}
|
||||
});
|
||||
},
|
||||
//添加
|
||||
table_add(type) {
|
||||
this.dialog.save = true;
|
||||
|
@ -408,7 +464,7 @@ export default {
|
|||
that.query.recive_dept = "";
|
||||
that.query.send_dept = "";
|
||||
}
|
||||
console.log(that.query);
|
||||
// console.log(that.query);
|
||||
this.$refs.table.queryData(that.query);
|
||||
},
|
||||
table_receive(row) {
|
||||
|
@ -424,34 +480,50 @@ export default {
|
|||
let form = {};
|
||||
form.send_mgroup = row.recive_mgroup;
|
||||
form.recive_mgroup = row.send_mgroup;
|
||||
form.handoverb =[];
|
||||
form.handoverb = [];
|
||||
that.handoverbList = [];
|
||||
row.handoverb.forEach((item) => {
|
||||
let obj = {};
|
||||
obj.wm = item.wm_to;
|
||||
obj.checked = true;
|
||||
obj.batch = item.batch;
|
||||
obj.count = item.count;
|
||||
form.handoverb.push(obj)
|
||||
form.handoverb.push(obj);
|
||||
that.handoverbList.push(obj);
|
||||
})
|
||||
form.send_user = that.$TOOL.data.get('USER_INFO').id;
|
||||
form.send_date = that.$TOOL.dateFormat2(new Date());
|
||||
form.type = 60;
|
||||
that.$API.wpm.handover.create.req(form).then((res) => {
|
||||
that.$message.success("操作成功");
|
||||
}).catch((err) => {
|
||||
return err;
|
||||
});
|
||||
form.type = 60;//退料
|
||||
that.form = form;
|
||||
that.backDialogVisible = true;
|
||||
},
|
||||
table_print(row) {
|
||||
let that = this;
|
||||
that.handoverItem = row;
|
||||
that.printVisible = true;
|
||||
},
|
||||
// savePrinter() {
|
||||
// let that = this;
|
||||
// localStorage.setItem("printer_name", that.printer_name);
|
||||
// that.setNameVisible = false;
|
||||
// that.$message.success("打印机设置成功,请重新进行打印操作。");
|
||||
// },
|
||||
savePrinter() {
|
||||
let that = this;
|
||||
that.form.handoverb = [];
|
||||
that.handoverbList.forEach(item=>{
|
||||
if(item.checked){
|
||||
let obj = {};
|
||||
obj.wm = item.wm;
|
||||
obj.batch = item.batch;
|
||||
obj.count = item.count;
|
||||
that.form.handoverb.push(obj);
|
||||
}
|
||||
})
|
||||
// console.log(that.form)
|
||||
that.$API.wpm.handover.create.req(that.form).then((res) => {
|
||||
that.$message.success("操作成功");
|
||||
that.backDialogVisible = false;
|
||||
that.$refs.table.refresh();
|
||||
that.form = {};
|
||||
}).catch((err) => {
|
||||
return err;
|
||||
});
|
||||
},
|
||||
//本地更新数据
|
||||
//新增岗位后更新数据
|
||||
handleSaveSuccess(data, mode) {
|
||||
|
|
|
@ -51,6 +51,7 @@
|
|||
:value="item.id"
|
||||
>
|
||||
<span>{{ item.batch }}</span>
|
||||
<span>({{ item.material_name }})</span>
|
||||
<div style="float: right">
|
||||
<span>{{ item.count }}</span>
|
||||
<span v-if="item.notok_sign_name !== null" style="color: #aaaaaa">
|
||||
|
@ -320,12 +321,15 @@ export default {
|
|||
that.getUserList();
|
||||
}
|
||||
//获取交接物料
|
||||
if((that.type==20&&that.mgroupName!=='废品库')||that.type==40){
|
||||
//返工交接和报废交接
|
||||
that.getMaterialNotok();
|
||||
if(that.type==20&&that.mgroupName!=='废品库'){
|
||||
//返工交接
|
||||
that.getMaterialRework();
|
||||
}else if(that.type==20&&that.mgroupName=='废品库'){
|
||||
//废品出库
|
||||
that.getMaterialFP();
|
||||
}else if(that.type==40){
|
||||
//报废交接
|
||||
that.getMaterialNotok();
|
||||
}else{
|
||||
//其他
|
||||
that.getMaterial();
|
||||
|
@ -406,6 +410,19 @@ export default {
|
|||
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;
|
||||
|
|
Loading…
Reference in New Issue