fix:生产执行中车间库存变动,分为来料未完成&出料已完成(添加分批合批)
This commit is contained in:
parent
86921313d8
commit
0a0229cfab
|
|
@ -2,15 +2,8 @@
|
||||||
<el-container>
|
<el-container>
|
||||||
<el-header>
|
<el-header>
|
||||||
<div class="left-panel">
|
<div class="left-panel">
|
||||||
<el-button type="primary" @click="tomio('do_out')" v-auth="'mio.do'"
|
<el-button type="primary" @click="tomio('do_out')" v-auth="'mio.do'">领料</el-button>
|
||||||
v-if="mgroupName!=='size'&&mgroupName!=='facade'"
|
<el-button type="primary" @click="batchConcat()">合批</el-button>
|
||||||
>领料</el-button
|
|
||||||
>
|
|
||||||
<el-button type="primary" @click="tomio('do_in')" v-auth="'mio.do'"
|
|
||||||
>入库</el-button
|
|
||||||
>
|
|
||||||
<el-button type="primary" v-auth="'handover.create'" @click="table_add(40)">
|
|
||||||
报废</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="right-panel">
|
<div class="right-panel">
|
||||||
<el-select
|
<el-select
|
||||||
|
|
@ -47,7 +40,9 @@
|
||||||
row-key="id"
|
row-key="id"
|
||||||
:params="params"
|
:params="params"
|
||||||
:query="query"
|
:query="query"
|
||||||
|
@selection-change="selectionChange"
|
||||||
>
|
>
|
||||||
|
<el-table-column type="selection"></el-table-column>
|
||||||
<el-table-column label="状态" prop="state" width="100" >
|
<el-table-column label="状态" prop="state" width="100" >
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tag :type="wmState[scope.row.state]?.type">
|
<el-tag :type="wmState[scope.row.state]?.type">
|
||||||
|
|
@ -71,7 +66,11 @@
|
||||||
label="批次号"
|
label="批次号"
|
||||||
prop="batch"
|
prop="batch"
|
||||||
min-width="120"
|
min-width="120"
|
||||||
></el-table-column>
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<el-link @click="rowClick(scope.row.batch)" type="primary">{{scope.row.batch}}</el-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="部门/工段"
|
label="部门/工段"
|
||||||
prop="belong_dept_name"
|
prop="belong_dept_name"
|
||||||
|
|
@ -114,7 +113,6 @@
|
||||||
v-if="scope.row.defect_name == null"
|
v-if="scope.row.defect_name == null"
|
||||||
>检验
|
>检验
|
||||||
</el-button>
|
</el-button>
|
||||||
<!-- v-if="mgroupName!=='size'&&mgroupName!=='facade'&&scope.row.defect_name == null" -->
|
|
||||||
<el-button
|
<el-button
|
||||||
link size="small"
|
link size="small"
|
||||||
type="warning"
|
type="warning"
|
||||||
|
|
@ -149,6 +147,7 @@
|
||||||
v-if="dialog.scrap"
|
v-if="dialog.scrap"
|
||||||
ref="scrapDialog"
|
ref="scrapDialog"
|
||||||
:type="type"
|
:type="type"
|
||||||
|
:changebatch="changebatch"
|
||||||
:mgroupName="mgroupName"
|
:mgroupName="mgroupName"
|
||||||
:mgroupId="mgroupId"
|
:mgroupId="mgroupId"
|
||||||
@success="handleScrapSuccess"
|
@success="handleScrapSuccess"
|
||||||
|
|
@ -166,12 +165,22 @@
|
||||||
v-if="dialog.inmRecord"
|
v-if="dialog.inmRecord"
|
||||||
ref="inmRecordDialog"
|
ref="inmRecordDialog"
|
||||||
:cate = "cate_type"
|
:cate = "cate_type"
|
||||||
:process = "process"
|
:process = "processId"
|
||||||
:mgroupId = "params.mgroupx"
|
:mgroupId = "mgroupId"
|
||||||
:deptId = " params.belong_dept"
|
:deptId = "deptId"
|
||||||
@success="handleinmSuccess"
|
@success="handleinmSuccess"
|
||||||
>
|
>
|
||||||
</save-dialog>
|
</save-dialog>
|
||||||
|
<handover-dialog
|
||||||
|
v-if="dialog.handover"
|
||||||
|
ref="handoverDialog"
|
||||||
|
:type="type"
|
||||||
|
:mgroupName="mgroupName"
|
||||||
|
:mgroupId="mgroupId"
|
||||||
|
@success="handleScrapSuccess"
|
||||||
|
@closed="dialog.handover = false"
|
||||||
|
>
|
||||||
|
</handover-dialog>
|
||||||
<print-dialog
|
<print-dialog
|
||||||
v-if="dialog.print_m"
|
v-if="dialog.print_m"
|
||||||
ref="printmaterial"
|
ref="printmaterial"
|
||||||
|
|
@ -188,13 +197,30 @@ import printDialog from "./../template/printmaterial.vue";
|
||||||
import checkDialog from "./check_form.vue";
|
import checkDialog from "./check_form.vue";
|
||||||
import showDrawer from "./check_drawer.vue";
|
import showDrawer from "./check_drawer.vue";
|
||||||
import scrapDialog from "./handover_form.vue";
|
import scrapDialog from "./handover_form.vue";
|
||||||
|
import handoverDialog from "./handover_form2.vue";
|
||||||
import saveDialog from "./inm_record.vue";
|
import saveDialog from "./inm_record.vue";
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
|
deptId: {
|
||||||
|
type: String,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
mgroupId: {
|
||||||
|
type: String,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
mgroupName: {
|
mgroupName: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "",
|
default: "",
|
||||||
},
|
},
|
||||||
|
processId: {
|
||||||
|
type: String,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
mgroupcode: {
|
||||||
|
type: String,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
saveDialog,
|
saveDialog,
|
||||||
|
|
@ -202,7 +228,8 @@ export default {
|
||||||
checkDialog,
|
checkDialog,
|
||||||
showDrawer,
|
showDrawer,
|
||||||
scrapDialog,
|
scrapDialog,
|
||||||
printDialog
|
printDialog,
|
||||||
|
handoverDialog
|
||||||
},
|
},
|
||||||
name: "wmaterial",
|
name: "wmaterial",
|
||||||
data() {
|
data() {
|
||||||
|
|
@ -210,8 +237,8 @@ export default {
|
||||||
wmState,
|
wmState,
|
||||||
apiObj: null,
|
apiObj: null,
|
||||||
params: {
|
params: {
|
||||||
mgroupx: "",
|
mgroup: "",
|
||||||
belong_dept:''
|
|
||||||
},
|
},
|
||||||
wmtype:0,
|
wmtype:0,
|
||||||
query: {
|
query: {
|
||||||
|
|
@ -223,7 +250,8 @@ export default {
|
||||||
scrap: false,
|
scrap: false,
|
||||||
permission: false,
|
permission: false,
|
||||||
inmRecord:false,
|
inmRecord:false,
|
||||||
print_m:false
|
print_m:false,
|
||||||
|
handover:false,
|
||||||
},
|
},
|
||||||
tableData: [],
|
tableData: [],
|
||||||
selection: [],
|
selection: [],
|
||||||
|
|
@ -231,16 +259,14 @@ export default {
|
||||||
{ value: 10, name: "合格"},
|
{ value: 10, name: "合格"},
|
||||||
{ value: 20, name: "不合格"},
|
{ value: 20, name: "不合格"},
|
||||||
{ value: 30, name: "返修"},
|
{ value: 30, name: "返修"},
|
||||||
// { value: 40, name: "检验"},
|
|
||||||
// { value: 50, name: "报废"},
|
|
||||||
],
|
],
|
||||||
queryWm: {
|
queryWm: {
|
||||||
search: "",
|
search: "",
|
||||||
material: "",
|
material: "",
|
||||||
},
|
},
|
||||||
cate_type:'',
|
cate_type:'',
|
||||||
process:'',
|
|
||||||
materialType: "wm",
|
materialType: "wm",
|
||||||
|
changebatch:false,
|
||||||
materialsVisible:false,
|
materialsVisible:false,
|
||||||
visibleDrawer: false,
|
visibleDrawer: false,
|
||||||
apiObjPrint:this.$API.cm.labelmat.fromWm,
|
apiObjPrint:this.$API.cm.labelmat.fromWm,
|
||||||
|
|
@ -248,49 +274,32 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
let that = this;
|
||||||
|
that.params.mgroup = that.mgroupId;
|
||||||
|
that.params.tag="todo";
|
||||||
|
that.$TOOL.data.set('gx_deptID',that.deptId)
|
||||||
|
that.apiObj = that.$API.wpm.wmaterial.list;
|
||||||
this.getMgroupInfo();
|
this.getMgroupInfo();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getMgroupInfo(){
|
getMgroupInfo(){
|
||||||
let that = this;
|
let that = this;
|
||||||
console.log(that.mgroupName);
|
console.log(that.mgroupName);
|
||||||
if(that.mgroupName=="size"){
|
that.$API.mtm.mgroup.list.req({ page: 0, name: that.mgroupName }).then((res) => {
|
||||||
// that.params.material__process__name = "一次超洗";
|
if (res.length < 1) {
|
||||||
that.$API.system.dept.list.req({name__contains:'尺寸',page:0}).then((res) => {
|
that.$message.error("获取工段错误");
|
||||||
if(res.length>0){
|
return;
|
||||||
that.params.mgroupx = null;
|
}
|
||||||
that.params.belong_dept=res[0].id;
|
that.mgroupId = res[0].id;
|
||||||
}
|
that.process = res[0].process;
|
||||||
that.apiObj = that.$API.wpm.wmaterial.list;
|
that.belong_dept = res[0].belong_dept;
|
||||||
that.$refs.table.refresh();
|
that.process_type =res[0].process_type;
|
||||||
})
|
that.params.mgroup = res[0].id;
|
||||||
}else if(that.mgroupName=="facade"){
|
that.params.tag="todo";
|
||||||
// that.params.material__process__name = "二次超洗";
|
that.$TOOL.data.set('gx_deptID',res[0].belong_dept)
|
||||||
that.$API.system.dept.list.req({name__contains:'外观',page:0}).then((res) => {
|
that.apiObj = that.$API.wpm.wmaterial.list;
|
||||||
if(res.length>0){
|
that.$refs.table.refresh();
|
||||||
that.params.mgroupx = null;
|
});
|
||||||
that.params.belong_dept=res[0].id;
|
|
||||||
}
|
|
||||||
that.apiObj = that.$API.wpm.wmaterial.list;
|
|
||||||
that.$refs.table.refresh();
|
|
||||||
})
|
|
||||||
}else{
|
|
||||||
that.$API.mtm.mgroup.list
|
|
||||||
.req({ page: 0, name: that.mgroupName })
|
|
||||||
.then((res) => {
|
|
||||||
if (res.length < 1) {
|
|
||||||
that.$message.error("获取工段错误");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
that.mgroupId = res[0].id;
|
|
||||||
that.$TOOL.data.set('gx_deptID',res[0].belong_dept)
|
|
||||||
that.process = res[0].process;
|
|
||||||
that.params.mgroupx = res[0].id;
|
|
||||||
that.params.belong_dept = res[0].belong_dept;
|
|
||||||
that.apiObj = that.$API.wpm.wmaterial.list;
|
|
||||||
that.$refs.table.refresh();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
add() {
|
add() {
|
||||||
this.dialog.save = true;
|
this.dialog.save = true;
|
||||||
|
|
@ -298,6 +307,53 @@ export default {
|
||||||
this.$refs.saveDialog.open("add");
|
this.$refs.saveDialog.open("add");
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
selectionChange(selection) {
|
||||||
|
let that = this;
|
||||||
|
that.selection = selection;
|
||||||
|
if(selection.length>0){
|
||||||
|
let material = selection[0].material;
|
||||||
|
selection.forEach((item)=>{
|
||||||
|
if(item.material!==material){
|
||||||
|
that.$refs.table.toggleRowSelection(item, false);
|
||||||
|
that.$message.warning("该批次物料与前面的不一样");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
rowClick(val){
|
||||||
|
this.dialog.handover = true;
|
||||||
|
this.type = 10;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.handoverDialog.open("add",val,20);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
batchConcat(){
|
||||||
|
// let that = this;
|
||||||
|
// let obj = {};
|
||||||
|
// obj.type = 10;
|
||||||
|
// obj.mtype = 30;
|
||||||
|
// obj.handle_date = obj.send_date = that.$TOOL.dateFormat2(new Date());
|
||||||
|
// obj.send_mgroup = obj.recive_mgroup = that.mgroupId;
|
||||||
|
// let userInfo = that.$TOOL.data.get("USER_INFO");
|
||||||
|
// obj.send_user = obj.recive_user= userInfo.id;
|
||||||
|
this.changebatch = true;
|
||||||
|
let handoverb = [];
|
||||||
|
if(this.selection.length>0){
|
||||||
|
this.selection.forEach(item=>{
|
||||||
|
let obj = {};
|
||||||
|
obj.wm = item.id;
|
||||||
|
obj.batch = item.batch;
|
||||||
|
obj.count_cando = item.count_cando;
|
||||||
|
obj.count = item.count_cando;
|
||||||
|
handoverb.push(obj)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.type = 10;
|
||||||
|
this.dialog.scrap = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.scrapDialog.open("add",handoverb,30);
|
||||||
|
});
|
||||||
|
},
|
||||||
materialsChoses(str) {
|
materialsChoses(str) {
|
||||||
this.materialType = str;
|
this.materialType = str;
|
||||||
this.materialsVisible = true;
|
this.materialsVisible = true;
|
||||||
|
|
@ -314,7 +370,6 @@ export default {
|
||||||
that.$nextTick(() => {
|
that.$nextTick(() => {
|
||||||
that.$refs.inmRecordDialog.open("add");
|
that.$refs.inmRecordDialog.open("add");
|
||||||
});
|
});
|
||||||
// this.$router.push({ name: "halfgood_mio" });
|
|
||||||
},
|
},
|
||||||
table_Check(row){
|
table_Check(row){
|
||||||
this.checkItem = row;
|
this.checkItem = row;
|
||||||
|
|
@ -332,10 +387,6 @@ export default {
|
||||||
this.$refs.showDrawer.open();
|
this.$refs.showDrawer.open();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//表格选择后回调事件
|
|
||||||
selectionChange(selection) {
|
|
||||||
this.selection = selection;
|
|
||||||
},
|
|
||||||
//添加报废
|
//添加报废
|
||||||
table_add(type) {
|
table_add(type) {
|
||||||
this.dialog.scrap = true;
|
this.dialog.scrap = true;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,415 @@
|
||||||
|
<template>
|
||||||
|
<el-container>
|
||||||
|
<el-header>
|
||||||
|
<div class="left-panel">
|
||||||
|
<el-button type="primary" @click="tomio('do_in')" v-auth="'mio.do'"
|
||||||
|
>入库</el-button>
|
||||||
|
<el-button type="primary" v-auth="'handover.create'" @click="table_add(20)">
|
||||||
|
返修</el-button>
|
||||||
|
<el-button type="primary" v-auth="'handover.create'" @click="table_add(40)">
|
||||||
|
报废</el-button>
|
||||||
|
<el-button type="primary" @click="batchConcat()">合批</el-button>
|
||||||
|
</div>
|
||||||
|
<div class="right-panel">
|
||||||
|
<el-select
|
||||||
|
v-model="query.state"
|
||||||
|
placeholder="物料状态"
|
||||||
|
clearable
|
||||||
|
@change="searchStateChange"
|
||||||
|
style="width: 250px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in stateOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
<el-input
|
||||||
|
style="margin-right: 5px"
|
||||||
|
v-model="query.search"
|
||||||
|
placeholder="名称"
|
||||||
|
clearable
|
||||||
|
></el-input>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-search"
|
||||||
|
@click="handleQuery"
|
||||||
|
></el-button>
|
||||||
|
</div>
|
||||||
|
</el-header>
|
||||||
|
<el-main class="nopadding">
|
||||||
|
<scTable
|
||||||
|
ref="table"
|
||||||
|
:apiObj="apiObj"
|
||||||
|
row-key="id"
|
||||||
|
:params="params"
|
||||||
|
:query="query"
|
||||||
|
@selection-change="selectionChange"
|
||||||
|
>
|
||||||
|
<el-table-column type="selection"></el-table-column>
|
||||||
|
<el-table-column label="状态" prop="state" width="100" >
|
||||||
|
<template #default="scope">
|
||||||
|
<el-tag :type="wmState[scope.row.state]?.type">
|
||||||
|
{{wmState[scope.row.state]?.text}}
|
||||||
|
</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="物料名称"
|
||||||
|
prop="material_name"
|
||||||
|
min-width="150"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
{{ scope.row.material_name }}
|
||||||
|
<span v-if="scope.row.material_origin != null"
|
||||||
|
>({{ scope.row.material_origin_name }})</span
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="批次号"
|
||||||
|
prop="batch"
|
||||||
|
min-width="120"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<el-link @click="rowClick(scope.row.batch)" type="primary">{{scope.row.batch}}</el-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="部门/工段"
|
||||||
|
prop="belong_dept_name"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
{{scope.row.belong_dept_name}}/{{scope.row.mgroup_name}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="数量"
|
||||||
|
prop="count"
|
||||||
|
min-width="80"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="生产中"
|
||||||
|
prop="count_working"
|
||||||
|
min-width="80"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="不合格标记"
|
||||||
|
prop="defect_name"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="创建时间"
|
||||||
|
prop="create_time"
|
||||||
|
width="150"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
fixed="right"
|
||||||
|
align="center"
|
||||||
|
width="120"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button
|
||||||
|
link size="small"
|
||||||
|
@click="table_Check(scope.row)"
|
||||||
|
v-auth="'ftestwork.create'"
|
||||||
|
type="primary"
|
||||||
|
v-if="scope.row.defect_name == null"
|
||||||
|
>检验
|
||||||
|
</el-button>
|
||||||
|
<!-- v-if="mgroupName!=='size'&&mgroupName!=='facade'&&scope.row.defect_name == null" -->
|
||||||
|
<el-button
|
||||||
|
link size="small"
|
||||||
|
type="warning"
|
||||||
|
@click="tableCheckList(scope.row)"
|
||||||
|
v-if="scope.row.defect_name == null"
|
||||||
|
>检验记录
|
||||||
|
</el-button>
|
||||||
|
<el-button @click="printMaterial(scope.row)" type="text">物料标签</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</scTable>
|
||||||
|
</el-main>
|
||||||
|
<el-dialog title="选择物料" v-model="materialsVisible" width="90%">
|
||||||
|
<materials
|
||||||
|
style="height: 500px"
|
||||||
|
:materialType="materialType"
|
||||||
|
ref="materialsChose"
|
||||||
|
@choseChange="choseChange"
|
||||||
|
></materials>
|
||||||
|
</el-dialog>
|
||||||
|
<check-dialog
|
||||||
|
v-if="dialog.save"
|
||||||
|
ref="saveDialog"
|
||||||
|
:mgroup="mgroupId"
|
||||||
|
:mgroupName="mgroupName"
|
||||||
|
:itemObj = "checkItem"
|
||||||
|
@success="handleSaveSuccess"
|
||||||
|
@closed="dialog.save = false"
|
||||||
|
>
|
||||||
|
</check-dialog>
|
||||||
|
<scrap-dialog
|
||||||
|
v-if="dialog.scrap"
|
||||||
|
ref="scrapDialog"
|
||||||
|
:type="type"
|
||||||
|
:mgroupName="mgroupName"
|
||||||
|
:mgroupId="mgroupId"
|
||||||
|
@success="handleScrapSuccess"
|
||||||
|
@closed="dialog.scrap = false"
|
||||||
|
>
|
||||||
|
</scrap-dialog>
|
||||||
|
<handover-dialog
|
||||||
|
v-if="dialog.handover"
|
||||||
|
ref="handoverDialog"
|
||||||
|
:type="type"
|
||||||
|
:mgroupName="mgroupName"
|
||||||
|
:mgroupId="mgroupId"
|
||||||
|
@success="handleScrapSuccess"
|
||||||
|
@closed="dialog.handover = false"
|
||||||
|
>
|
||||||
|
</handover-dialog>
|
||||||
|
<showDrawer
|
||||||
|
ref="showDrawer"
|
||||||
|
v-if="visibleDrawer"
|
||||||
|
:wm="wm"
|
||||||
|
@closed="visibleDrawer = false"
|
||||||
|
>
|
||||||
|
</showDrawer>
|
||||||
|
<save-dialog
|
||||||
|
v-if="dialog.inmRecord"
|
||||||
|
ref="inmRecordDialog"
|
||||||
|
:cate = "cate_type"
|
||||||
|
:process = "process"
|
||||||
|
:mgroupId = "params.mgroupx"
|
||||||
|
:deptId = " params.belong_dept"
|
||||||
|
@success="handleinmSuccess"
|
||||||
|
>
|
||||||
|
</save-dialog>
|
||||||
|
<print-dialog
|
||||||
|
v-if="dialog.print_m"
|
||||||
|
ref="printmaterial"
|
||||||
|
:mId="wmId"
|
||||||
|
:mtype="wmtype"
|
||||||
|
:apiObj="apiObjPrint"
|
||||||
|
></print-dialog>
|
||||||
|
</el-container>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { wmState } from "@/utils/enum.js";
|
||||||
|
import materials from "./../mtm/materials.vue";
|
||||||
|
import printDialog from "./../template/printmaterial.vue";
|
||||||
|
import checkDialog from "./check_form.vue";
|
||||||
|
import showDrawer from "./check_drawer.vue";
|
||||||
|
import scrapDialog from "./handover_form.vue";
|
||||||
|
import handoverDialog from "./handover_form2.vue";
|
||||||
|
import saveDialog from "./inm_record.vue";
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
mgroupName: {
|
||||||
|
type: String,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
saveDialog,
|
||||||
|
materials,
|
||||||
|
checkDialog,
|
||||||
|
showDrawer,
|
||||||
|
scrapDialog,
|
||||||
|
printDialog,
|
||||||
|
handoverDialog
|
||||||
|
},
|
||||||
|
name: "wmaterial",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
wmState,
|
||||||
|
apiObj: null,
|
||||||
|
params: {
|
||||||
|
mgroup: "",
|
||||||
|
belong_dept:''
|
||||||
|
},
|
||||||
|
wmtype:0,
|
||||||
|
query: {
|
||||||
|
search: "",
|
||||||
|
state: null,
|
||||||
|
},
|
||||||
|
dialog: {
|
||||||
|
save: false,
|
||||||
|
scrap: false,
|
||||||
|
permission: false,
|
||||||
|
inmRecord:false,
|
||||||
|
print_m:false,
|
||||||
|
handover:false,
|
||||||
|
},
|
||||||
|
tableData: [],
|
||||||
|
selection: [],
|
||||||
|
stateOptions:[
|
||||||
|
{ value: 10, name: "合格"},
|
||||||
|
{ value: 20, name: "不合格"},
|
||||||
|
{ value: 30, name: "返修"},
|
||||||
|
],
|
||||||
|
queryWm: {
|
||||||
|
search: "",
|
||||||
|
material: "",
|
||||||
|
},
|
||||||
|
cate_type:'',
|
||||||
|
process:'',
|
||||||
|
materialType: "wm",
|
||||||
|
changebatch:false,
|
||||||
|
materialsVisible:false,
|
||||||
|
visibleDrawer: false,
|
||||||
|
apiObjPrint:this.$API.cm.labelmat.fromWm,
|
||||||
|
wmId:'',
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getMgroupInfo();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getMgroupInfo(){
|
||||||
|
let that = this;
|
||||||
|
console.log(that.mgroupName);
|
||||||
|
that.$API.mtm.mgroup.list.req({ page: 0, name: that.mgroupName }).then((res) => {
|
||||||
|
if (res.length < 1) {
|
||||||
|
that.$message.error("获取工段错误");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
that.mgroupId = res[0].id;
|
||||||
|
that.process = res[0].process;
|
||||||
|
that.params.mgroup = res[0].id;
|
||||||
|
that.params.tag = 'done';
|
||||||
|
that.$TOOL.data.set('gx_deptID',res[0].belong_dept)
|
||||||
|
that.apiObj = that.$API.wpm.wmaterial.list;
|
||||||
|
that.$refs.table.refresh();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
add() {
|
||||||
|
this.dialog.save = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.saveDialog.open("add");
|
||||||
|
});
|
||||||
|
},
|
||||||
|
materialsChoses(str) {
|
||||||
|
this.materialType = str;
|
||||||
|
this.materialsVisible = true;
|
||||||
|
},
|
||||||
|
choseChange(data) {
|
||||||
|
this.queryWm.material = data;
|
||||||
|
this.$refs.table_wm.queryData(this.queryWm);
|
||||||
|
this.materialsVisible = false;
|
||||||
|
},
|
||||||
|
tomio(type) {
|
||||||
|
let that = this;
|
||||||
|
that.cate_type=type;
|
||||||
|
that.dialog.inmRecord = true;
|
||||||
|
that.$nextTick(() => {
|
||||||
|
that.$refs.inmRecordDialog.open("add");
|
||||||
|
});
|
||||||
|
},
|
||||||
|
table_Check(row){
|
||||||
|
this.checkItem = row;
|
||||||
|
let mode = this.mgroupName;
|
||||||
|
this.dialog.save = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.saveDialog.open(mode);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
rowClick(val){
|
||||||
|
this.dialog.handover = true;
|
||||||
|
this.type = 10;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.handoverDialog.open("add",val,20);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//获取当前批次车间物料的检验记录
|
||||||
|
tableCheckList(row){
|
||||||
|
this.wm = row.id;
|
||||||
|
this.visibleDrawer = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.showDrawer.open();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//表格选择后回调事件
|
||||||
|
selectionChange(selection) {
|
||||||
|
let that = this;
|
||||||
|
that.selection = selection;
|
||||||
|
if(selection.length>0){
|
||||||
|
let material = selection[0].material;
|
||||||
|
selection.forEach((item)=>{
|
||||||
|
if(item.material!==material){
|
||||||
|
that.$refs.table.toggleRowSelection(item, false);
|
||||||
|
that.$message.warning("该批次物料与前面的不一样");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//添加报废
|
||||||
|
table_add(type) {
|
||||||
|
this.dialog.scrap = true;
|
||||||
|
this.type = type;
|
||||||
|
let handoverb = [];
|
||||||
|
if(this.selection.length>0){
|
||||||
|
this.selection.forEach(item=>{
|
||||||
|
let obj = {};
|
||||||
|
obj.wm = item.id;
|
||||||
|
obj.batch = item.batch;
|
||||||
|
obj.count_cando = item.count_cando;
|
||||||
|
obj.count = item.count_cando;
|
||||||
|
handoverb.push(obj)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.scrapDialog.open("add",handoverb,10);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
batchConcat(){
|
||||||
|
this.changebatch = true;
|
||||||
|
let handoverb = [];
|
||||||
|
if(this.selection.length>0){
|
||||||
|
this.selection.forEach(item=>{
|
||||||
|
let obj = {};
|
||||||
|
obj.wm = item.id;
|
||||||
|
obj.batch = item.batch;
|
||||||
|
obj.count_cando = item.count_cando;
|
||||||
|
obj.count = item.count_cando;
|
||||||
|
handoverb.push(obj)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.type = 10;
|
||||||
|
this.dialog.scrap = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.scrapDialog.open("add",handoverb,30);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleScrapSuccess(){
|
||||||
|
this.dialog.scrap = false;
|
||||||
|
this.$refs.table.refresh();
|
||||||
|
},
|
||||||
|
//出入库后刷新页面
|
||||||
|
handleinmSuccess(){
|
||||||
|
this.$refs.table.refresh();
|
||||||
|
},
|
||||||
|
//搜索
|
||||||
|
handleQuery() {
|
||||||
|
this.$refs.table.queryData(this.query);
|
||||||
|
},
|
||||||
|
//本地更新数据
|
||||||
|
handleSaveSuccess(data, mode) {
|
||||||
|
this.dialog.save = false;
|
||||||
|
this.$refs.table.refresh();
|
||||||
|
},
|
||||||
|
//打印物料标签
|
||||||
|
printMaterial(row){
|
||||||
|
let that = this;
|
||||||
|
that.wmId = row.id;
|
||||||
|
that.wmtype = row.material_.type;
|
||||||
|
that.dialog.print_m = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.printmaterial.open();
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped></style>
|
||||||
Loading…
Reference in New Issue