fix:玻纤车间库存拆分

This commit is contained in:
shijing 2025-05-30 09:09:46 +08:00
parent ca7cee95c0
commit 9cbfddf8ec
4 changed files with 501 additions and 281 deletions

View File

@ -50,12 +50,12 @@
:mgroup_code="mgroup_code" :mgroup_code="mgroup_code"
></handover> ></handover>
<!-- 库存 --> <!-- 库存 -->
<inm v-else-if="values == '库存'&&componentsShow" <!-- <inm v-else-if="values == '库存'&&componentsShow"
:mgroup_code="mgroup_code" :mgroup_code="mgroup_code"
:mgroupId="mgroupId" :mgroupId="mgroupId"
:mgroupName="mgroupName" :mgroupName="mgroupName"
:process = "mgroupProcess" :process = "mgroupProcess"
:deptId="mgroupDept"></inm> :deptId="mgroupDept"></inm> -->
<!-- 未完成 --> <!-- 未完成 -->
<inmIn v-else-if="values == '未完成'&&componentsShow" <inmIn v-else-if="values == '未完成'&&componentsShow"
:mgroup_code="mgroup_code" :mgroup_code="mgroup_code"
@ -87,7 +87,7 @@ export default {
return { return {
mgroups:[], mgroups:[],
tableHieght: 200, tableHieght: 200,
options: ["日志", "交接记录","库存", "未完成", "已完成"], options: ["日志", "交接记录","未完成", "已完成"],
values: "日志", values: "日志",
mgroupName: "", mgroupName: "",
mgroupId: "", mgroupId: "",

View File

@ -507,7 +507,7 @@ export default {
data.sigao = item.val; data.sigao = item.val;
}else if(item.name=="对边"){ }else if(item.name=="对边"){
data.duibian = item.val; data.duibian = item.val;
}else if(item.name=="模"){ }else if(item.name=="模具号"){
data.moban = item.val; data.moban = item.val;
}else if(item.name=="实验板段"){ }else if(item.name=="实验板段"){
data.istest = item.val?'是':'否'; data.istest = item.val?'是':'否';

View File

@ -5,7 +5,10 @@
<el-button type="primary" @click="tomio('do_out')" v-auth="'mio.do'" v-if="route_code=='qingxi'">领料</el-button> <el-button type="primary" @click="tomio('do_out')" v-auth="'mio.do'" v-if="route_code=='qingxi'">领料</el-button>
<el-button type="primary" v-auth="'handover.create'" @click="table_add(40)">报废</el-button> <el-button type="primary" v-auth="'handover.create'" @click="table_add(40)">报废</el-button>
<el-button type="primary" v-auth="'handover.create'" @click="batchConcat()">合批</el-button> <el-button type="primary" v-auth="'handover.create'" @click="batchConcat()">合批</el-button>
<!-- <scScanner :labeltext="'报废扫码'" @scanResult="codeTextChange40"></scScanner> --> <el-button type="primary" @click="tomio('do_in')" v-auth="'mio.do'"
v-if="route_code=='chengpingneiwaichujian'||route_code=='chengpneizhifujian'||route_code=='chengpingxinengjiance'||
route_code=='chenpjianchicunjiance'||route_code=='chengpwaiguanfujianyi'||route_code=='chengpwaiguanfujianer'"
>入库</el-button>
</div> </div>
<div class="right-panel"> <div class="right-panel">
<el-select <el-select
@ -44,7 +47,7 @@
:query="query" :query="query"
@selection-change="selectionChange" @selection-change="selectionChange"
> >
<el-table-column type="selection"></el-table-column> <el-table-column type="selection" width="50"></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">
@ -59,20 +62,30 @@
> >
<template #default="scope"> <template #default="scope">
{{ scope.row.material_name }} {{ scope.row.material_name }}
<span v-if="scope.row.material_origin != null" <span v-if="scope.row.material_origin != null">
>{{ scope.row.material_origin_name }}</span {{ scope.row.material_origin_name }}
> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
label="物料已到工序"
prop="material_name"
min-width="100"
>
<template #default="scope">
{{ scope.row.material_name.split('|').at(-1) }}
</template>
</el-table-column>
<el-table-column
label="原始物料"
prop="material_ofrom_name"
min-width="120"
></el-table-column>
<el-table-column <el-table-column
label="批次号" label="批次号"
prop="batch" prop="batch"
min-width="120" min-width="120"
> ></el-table-column>
<template #default="scope">
<el-link @click="rowClick(scope.row)" 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"
@ -85,6 +98,15 @@
label="数量" label="数量"
prop="count" prop="count"
min-width="80" min-width="80"
>
<template #default="scope">
<span v-if="scope.row.material_&&scope.row.material_.tracking==10">{{scope.row.count}}</span>
<el-link v-else :underline="false" type="primary" @click="showWpr(scope.row)">{{scope.row.count}}</el-link>
</template>
</el-table-column>
<el-table-column
label="备注"
prop="note"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
label="生产中" label="生产中"
@ -104,10 +126,21 @@
label="操作" label="操作"
fixed="right" fixed="right"
align="center" align="center"
width="100" width="120"
> >
<template #default="scope"> <template #default="scope">
<el-button @click="printMaterial(scope.row)" type="text">物料标签</el-button> <el-link :underline="false" @click="printMaterial(scope.row,'wm')" type="primary">物料标签</el-link>
<el-link :underline="false" v-if="scope.row.material_&&scope.row.material_.tracking==10&&scope.row.state!==20" @click="tableCheckList(scope.row)" type="primary">检验记录</el-link>
<el-link
v-if="scope.row.material_&&scope.row.material_.tracking==10&&scope.row.state!==20"
:underline="false"
@click="inmCheck(scope.row)"
type="primary"
style="margin-left: 10px;"
>检验</el-link>
<el-link :underline="false" type="primary"
@click="handleWatch(scope.row)"
>流程图</el-link>
</template> </template>
</el-table-column> </el-table-column>
</scTable> </scTable>
@ -120,13 +153,19 @@
@choseChange="choseChange" @choseChange="choseChange"
></materials> ></materials>
</el-dialog> </el-dialog>
<!-- 返工/报废 --> <check-dialog
v-if="dialog.check"
ref="checkDialog"
:itemObj = "checkItem"
@success="handleSaveSuccess"
@closed="dialog.check = false"
>
</check-dialog>
<scrap-dialog <scrap-dialog
v-if="dialog.scrap" v-if="dialog.scrap"
ref="scrapDialog" ref="scrapDialog"
:type="type" :type="type"
:changebatch="changebatch" :mgroupName="mgroup_name"
:mgroupName="mgroupName"
:mgroupId="mgroupId" :mgroupId="mgroupId"
@success="handleScrapSuccess" @success="handleScrapSuccess"
@closed="dialog.scrap = false" @closed="dialog.scrap = false"
@ -136,47 +175,80 @@
ref="showDrawer" ref="showDrawer"
v-if="visibleDrawer" v-if="visibleDrawer"
:wm="wm" :wm="wm"
:material="wmMaterial"
@closed="visibleDrawer = false" @closed="visibleDrawer = false"
> >
</showDrawer> </showDrawer>
<!-- 领料 -->
<save-dialog <save-dialog
v-if="dialog.inmRecord" v-if="dialog.inmRecord"
ref="inmRecordDialog" ref="inmRecordDialog"
:cate = "cate_type" :cate = "cate_type"
:process = "processId" :process = "process"
:mgroupId = "mgroupId" :mgroupId = "params.mgroupx"
:deptId = "deptId" :deptId = " params.belong_dept"
@success="handleinmSuccess" @success="handleinmSuccess"
> >
</save-dialog> </save-dialog>
<handover-dialog <el-drawer v-model="wprVisibleDrawer" :size="'70%'">
v-if="dialog.handover" <template #header>
ref="handoverDialog" <h4>关联产品</h4>
:type="type" </template>
:mgroupName="mgroupName" <template #default>
:mgroupId="mgroupId" <scTable ref="wprTable" hidePagination :data="wprList">
@success="handleScrapSuccess" <el-table-column label="产品编号" prop="number" min-width="100px"></el-table-column>
@closed="dialog.handover = false" <el-table-column label="记录数据" prop="oinfo">
<template #default="scope">
<div v-for="(item,index) in scope.row.oinfo" :key="item.id">
{{ item.name }}:{{ item.val}}
<span v-if="index<(scope.row.oinfo.length-1)">,</span>
</div>
</template>
</el-table-column>
<el-table-column label="缺陷项" min-width="200px">
<template #default="scope">
<span v-for="item in scope.row.wprdefect" :key="item.id">
<el-tag
type="warning"
>{{ item.defect_name }}</el-tag>
</span>
</template>
</el-table-column>
<el-table-column
label="操作"
fixed="right"
align="center"
width="120"
> >
</handover-dialog> <template #default="scope">
<print-dialog <el-link :underline="false" @click="printMaterial(scope.row,'wpr')" type="primary">打印标签</el-link>
v-if="dialog.print_m" </template>
ref="printmaterial" </el-table-column>
:mId="wmId" </scTable>
:mtype="wmtype" </template>
:apiObj="apiObjPrint" <template #footer>
></print-dialog> <div style="flex: auto">
<el-button @click="wprVisibleDrawer=false">关闭</el-button>
</div>
</template>
</el-drawer>
<el-drawer v-model="limitedWatch" title="工艺路线流程图" size="80%" @closeDialog="limitedWatch = false">
<scDegra
v-if="limitedWatch"
ref="degraDialogs"
:nodes="nodes"
:edges="edges"
:rankdir="'LR'"
>
</scDegra>
</el-drawer>
</el-container> </el-container>
</template> </template>
<script> <script>
import { wmState } from "@/utils/enum.js"; import { wmState } from "@/utils/enum.js";
import materials from "./../mtm/materials.vue"; import materials from "./../mtm/materials.vue";
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: {
@ -192,11 +264,11 @@ export default {
type: String, type: String,
default: "", default: "",
}, },
processId: { mgroup_code: {
type: String, type: String,
default: "", default: "",
}, },
mgroupcode: { process: {
type: String, type: String,
default: "", default: "",
}, },
@ -206,9 +278,7 @@ export default {
materials, materials,
checkDialog, checkDialog,
showDrawer, showDrawer,
scrapDialog, scrapDialog
printDialog,
handoverDialog
}, },
name: "wmaterial", name: "wmaterial",
data() { data() {
@ -216,8 +286,9 @@ export default {
wmState, wmState,
apiObj: null, apiObj: null,
params: { params: {
tag : 'todo',
mgroup: "", mgroup: "",
belong_dept:''
}, },
wmtype:0, wmtype:0,
query: { query: {
@ -226,12 +297,14 @@ export default {
}, },
dialog: { dialog: {
save: false, save: false,
check: false,
scrap: false, scrap: false,
permission: false, permission: false,
inmRecord:false, inmRecord:false,
print_m:false,
handover:false,
}, },
nodes:[],
edges:[],
wprList:[],
tableData: [], tableData: [],
selection: [], selection: [],
stateOptions:[ stateOptions:[
@ -243,26 +316,82 @@ export default {
search: "", search: "",
material: "", material: "",
}, },
codeText2: "", wprParams:{
codeText4: "", page:0,
wm: ""
},
route_code:"",
showBatch: "",
wmMaterial:'',
cate_type:'', cate_type:'',
materialType: "wm", materialType: "wm",
changebatch:false, limitedWatch:false,
materialsVisible:false, materialsVisible:false,
visibleDrawer: false, visibleDrawer: false,
wprVisibleDrawer:false,
wprApiObj:this.$API.wpm.wpr.list,
apiObjPrint:this.$API.cm.labelmat.fromWm, apiObjPrint:this.$API.cm.labelmat.fromWm,
wmId:'',
printer_name:localStorage.getItem("printer_name"), printer_name:localStorage.getItem("printer_name"),
mgroup_name:'',
ofrom_name:'',
ofrom_batch :'',
checkItem:{},
}; };
}, },
mounted() { mounted() {
let that = this; let that = this;
let paths = that.$route.path;
let arr = paths.split("/");
that.route_code = arr[2];
that.params.mgroup = that.mgroupId; that.params.mgroup = that.mgroupId;
that.params.tag="todo"; that.$TOOL.data.set('bx_deptID',that.deptId);
that.$TOOL.data.set('gx_deptID',that.deptId)
that.apiObj = that.$API.wpm.wmaterial.list; that.apiObj = that.$API.wpm.wmaterial.list;
}, },
methods: { methods: {
handleWatch(row) {
let that = this;
that.$API.wpm.batchlog.dag.req({batch:row.batch}).then((res) => {
that.nodes = res.nodes;
that.edges = res.edges;
that.limitedWatch = true;
that.$nextTick(() => {
that.$refs.degraDialogs.open();
});
})
},
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");
});
},
//
tableCheckList(row){
this.wm = row.id;
this.wmMaterial = row.material;
this.visibleDrawer = true;
this.$nextTick(() => {
this.$refs.showDrawer.open();
});
},
//
selectionChange(selection) { selectionChange(selection) {
let that = this; let that = this;
that.selection = selection; that.selection = selection;
@ -277,15 +406,15 @@ export default {
}) })
} }
}, },
//mtype:20 //
rowClick(row){ table_add(type) {
this.dialog.handover = true; this.dialog.scrap = true;
this.type = 10; this.type = type;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.handoverDialog.open("add",row,20); this.$refs.scrapDialog.open("add");
}); });
}, },
//mtype:30 //
batchConcat(){ batchConcat(){
this.changebatch = true; this.changebatch = true;
let handoverb = []; let handoverb = [];
@ -294,6 +423,7 @@ export default {
let obj = {}; let obj = {};
obj.wm = item.id; obj.wm = item.id;
obj.batch = item.batch; obj.batch = item.batch;
obj.process = item.material_.process_name;
obj.count_cando = item.count_cando; obj.count_cando = item.count_cando;
obj.count = item.count_cando; obj.count = item.count_cando;
handoverb.push(obj) handoverb.push(obj)
@ -305,77 +435,6 @@ export default {
this.$refs.scrapDialog.open("add",handoverb,30); this.$refs.scrapDialog.open("add",handoverb,30);
}); });
}, },
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);
});
},
//
tableCheckList(row){
this.wm = row.id;
this.visibleDrawer = true;
this.$nextTick(() => {
this.$refs.showDrawer.open();
});
},
///
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);
});
},
codeTextChange20(codeText2){
let that = this;
that.type = 20;
that.codeText2 = codeText2;
that.dialog.scrap = true;
that.$nextTick(() => {
that.$refs.scrapDialog.open("add",codeText2,10);
});
},
codeTextChange40(codeText4){
let that = this;
that.type = 40;
that.codeText4 = codeText4;
that.dialog.scrap = true;
that.$nextTick(() => {
that.$refs.scrapDialog.open("add",codeText4,10);
});
},
handleScrapSuccess(){ handleScrapSuccess(){
this.dialog.scrap = false; this.dialog.scrap = false;
this.$refs.table.refresh(); this.$refs.table.refresh();
@ -388,19 +447,34 @@ export default {
handleQuery() { handleQuery() {
this.$refs.table.queryData(this.query); this.$refs.table.queryData(this.query);
}, },
showWpr(row){
let that = this;
that.ofrom_name = row.material_ofrom_name;
that.ofrom_batch = row.batch;
that.wprParams.wm = row.id;
that.wprVisibleDrawer = true;
this.$API.wpm.wpr.list.req(that.wprParams).then((res) => {
that.wprList = res;
})
},
// //
handleSaveSuccess(data, mode) { handleSaveSuccess(data, mode) {
this.dialog.save = false; this.dialog.save = false;
this.$refs.table.refresh(); this.$refs.table.refresh();
}, },
// //
printMaterial(row){ printMaterial(row,type){
let that = this; let that = this;
if(that.printer_name!==''&&that.printer_name!==null&&that.printer_name!==undefined){ if(that.printer_name!==''&&that.printer_name!==null&&that.printer_name!==undefined){
if(type=='wm'){
let params = {}; let params = {};
params.tid = row.id; params.tid = row.id;
if(that.route_code=='paiyicibang'){
params.label_template_name = '排一次棒打印模板';
}else{
params.extra_data={count:row.count}; params.extra_data={count:row.count};
params.label_template_name = '工段物料打印模板'; params.label_template_name = '其他工序打印模板';
}
that.apiObjPrint.req(params).then((res) => { that.apiObjPrint.req(params).then((res) => {
let obj = {}; let obj = {};
obj.printer_commands = res.commands; obj.printer_commands = res.commands;
@ -409,10 +483,62 @@ export default {
that.$message.success("打印成功"); that.$message.success("打印成功");
}); });
}) })
}else if(type=='wpr'){
let params = {};
let name = row.material_name.split('|')[0];
if(that.route_code=='paiban'||that.route_code=='zhuangmo'||that.route_code=='zlybcl'||that.route_code=='tuomoceliang'||
that.route_code=='reyatuihuo'||that.route_code=='banduangunyuan'||that.route_code=='banduangunyuanhoudama'||that.route_code=='banduangunyuantuihuo'
){
let oinfo = [];
for(let key in row.oinfo){
oinfo.push(row.oinfo[key])
}
let data = {sigao:'',duibian:'',moban:'',istest:'否',number:row.number,name:name,ofrom_name:that.ofrom_name,ofrom_batch:that.ofrom_batch};
if(that.route_code=='zhuangmo'||that.route_code=='zlybcl'||that.route_code=='tuomoceliang'||that.route_code=='reyatuihuo'||that.route_code=='banduangunyuan'){
params.label_template_name = '脱膜测量单件标签模板';
}else{
params.label_template_name = '排扳单件打印模板';
}
if(oinfo.length>0){
oinfo.forEach((item)=>{
if(item.name=="丝高"){
data.sigao = item.val;
}else if(item.name=="对边"){
data.duibian = item.val;
}else if(item.name=="模具号"){
data.moban = item.val;
}else if(item.name=="实验板段"){
data.istest = item.val?'是':'否';
}
})
}
params.data = data;
}else{
params.label_template_name = '单件打印模板';
params.data = {number:row.number,name:name};
}
that.$API.cm.labeltemplate.commands.req(params).then((res) => {
let obj = {};
obj.printer_commands = res.commands;
obj.printer_name = that.printer_name;
that.$API.wpm.prints.req(obj).then((response) => {
that.$message.success("打印成功");
});
});
}
}else{ }else{
that.$message.warning("请先设置打印机"); that.$message.warning("请先设置打印机");
} }
}, },
inmCheck(row){
let that = this;
that.checkItem = row;
that.dialog.check = true;
that.$nextTick(() => {
that.$refs.checkDialog.open("add");
})
},
}, },
}; };
</script> </script>

View File

@ -2,13 +2,13 @@
<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'" v-if="route_code=='qingxi'">领料</el-button>
<el-button type="primary" v-auth="'handover.create'" @click="table_add(40)">报废</el-button>
<el-button type="primary" v-auth="'handover.create'" @click="batchConcat()">合批</el-button>
<el-button type="primary" @click="tomio('do_in')" v-auth="'mio.do'" <el-button type="primary" @click="tomio('do_in')" v-auth="'mio.do'"
v-if="route_code=='chengpingneiwaichujian'||route_code=='chengpneizhifujian'||route_code=='chengpingxinengjiance'|| v-if="route_code=='chengpingneiwaichujian'||route_code=='chengpneizhifujian'||route_code=='chengpingxinengjiance'||
route_code=='chenpjianchicunjiance'||route_code=='chengpwaiguanfujianyi'||route_code=='chengpwaiguanfujianer'" route_code=='chenpjianchicunjiance'||route_code=='chengpwaiguanfujianyi'||route_code=='chengpwaiguanfujianer'"
>入库</el-button> >入库</el-button>
<el-button type="primary" v-auth="'handover.create'" @click="table_add(40)">报废</el-button>
<el-button type="primary" v-auth="'handover.create'" @click="batchConcat()">合批</el-button>
<!-- <scScanner :labeltext="'报废扫码'" @scanResult="codeTextChange40"></scScanner> -->
</div> </div>
<div class="right-panel"> <div class="right-panel">
<el-select <el-select
@ -47,7 +47,7 @@
:query="query" :query="query"
@selection-change="selectionChange" @selection-change="selectionChange"
> >
<el-table-column type="selection"></el-table-column> <el-table-column type="selection" width="50"></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">
@ -62,20 +62,30 @@
> >
<template #default="scope"> <template #default="scope">
{{ scope.row.material_name }} {{ scope.row.material_name }}
<span v-if="scope.row.material_origin != null" <span v-if="scope.row.material_origin != null">
>{{ scope.row.material_origin_name }}</span {{ scope.row.material_origin_name }}
> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
label="物料已到工序"
prop="material_name"
min-width="100"
>
<template #default="scope">
{{ scope.row.material_name.split('|').at(-1) }}
</template>
</el-table-column>
<el-table-column
label="原始物料"
prop="material_ofrom_name"
min-width="120"
></el-table-column>
<el-table-column <el-table-column
label="批次号" label="批次号"
prop="batch" prop="batch"
min-width="120" min-width="120"
> ></el-table-column>
<template #default="scope">
<el-link @click="rowClick(scope.row)" 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"
@ -88,6 +98,15 @@
label="数量" label="数量"
prop="count" prop="count"
min-width="80" min-width="80"
>
<template #default="scope">
<span v-if="scope.row.material_&&scope.row.material_.tracking==10">{{scope.row.count}}</span>
<el-link v-else :underline="false" type="primary" @click="showWpr(scope.row)">{{scope.row.count}}</el-link>
</template>
</el-table-column>
<el-table-column
label="备注"
prop="note"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
label="生产中" label="生产中"
@ -107,25 +126,21 @@
label="操作" label="操作"
fixed="right" fixed="right"
align="center" align="center"
width="100" width="120"
> >
<template #default="scope"> <template #default="scope">
<el-button <el-link :underline="false" @click="printMaterial(scope.row,'wm')" type="primary">物料标签</el-link>
link size="small" <el-link :underline="false" v-if="scope.row.material_&&scope.row.material_.tracking==10&&scope.row.state!==20" @click="tableCheckList(scope.row)" type="primary">检验记录</el-link>
@click="table_Check(scope.row)" <el-link
v-auth="'ftestwork.create'" v-if="scope.row.material_&&scope.row.material_.tracking==10&&scope.row.state!==20"
:underline="false"
@click="inmCheck(scope.row)"
type="primary" type="primary"
v-if="scope.row.defect_name == null" style="margin-left: 10px;"
>检验 >检验</el-link>
</el-button> <el-link :underline="false" type="primary"
<el-button @click="handleWatch(scope.row)"
link size="small" >流程图</el-link>
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> </template>
</el-table-column> </el-table-column>
</scTable> </scTable>
@ -139,39 +154,28 @@
></materials> ></materials>
</el-dialog> </el-dialog>
<check-dialog <check-dialog
v-if="dialog.save" v-if="dialog.check"
ref="saveDialog" ref="checkDialog"
:mgroup="mgroupId"
:mgroupName="mgroupName"
:itemObj = "checkItem" :itemObj = "checkItem"
@success="handleSaveSuccess" @success="handleSaveSuccess"
@closed="dialog.save = false" @closed="dialog.check = false"
> >
</check-dialog> </check-dialog>
<scrap-dialog <scrap-dialog
v-if="dialog.scrap" v-if="dialog.scrap"
ref="scrapDialog" ref="scrapDialog"
:type="type" :type="type"
:mgroupName="mgroupName" :mgroupName="mgroup_name"
:mgroupId="mgroupId" :mgroupId="mgroupId"
@success="handleScrapSuccess" @success="handleScrapSuccess"
@closed="dialog.scrap = false" @closed="dialog.scrap = false"
> >
</scrap-dialog> </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 <showDrawer
ref="showDrawer" ref="showDrawer"
v-if="visibleDrawer" v-if="visibleDrawer"
:wm="wm" :wm="wm"
:material="wmMaterial"
@closed="visibleDrawer = false" @closed="visibleDrawer = false"
> >
</showDrawer> </showDrawer>
@ -179,29 +183,72 @@
v-if="dialog.inmRecord" v-if="dialog.inmRecord"
ref="inmRecordDialog" ref="inmRecordDialog"
:cate = "cate_type" :cate = "cate_type"
:process = "processId" :process = "process"
:mgroupId = "mgroupId" :mgroupId = "params.mgroupx"
:deptId = "deptId" :deptId = " params.belong_dept"
@success="handleinmSuccess" @success="handleinmSuccess"
> >
</save-dialog> </save-dialog>
<print-dialog <el-drawer v-model="wprVisibleDrawer" :size="'70%'">
v-if="dialog.print_m" <template #header>
ref="printmaterial" <h4>关联产品</h4>
:mId="wmId" </template>
:mtype="wmtype" <template #default>
:apiObj="apiObjPrint" <scTable ref="wprTable" hidePagination :data="wprList">
></print-dialog> <el-table-column label="产品编号" prop="number" min-width="100px"></el-table-column>
<el-table-column label="记录数据" prop="oinfo">
<template #default="scope">
<div v-for="(item,index) in scope.row.oinfo" :key="item.id">
{{ item.name }}:{{ item.val}}
<span v-if="index<(scope.row.oinfo.length-1)">,</span>
</div>
</template>
</el-table-column>
<el-table-column label="缺陷项" min-width="200px">
<template #default="scope">
<span v-for="item in scope.row.wprdefect" :key="item.id">
<el-tag
type="warning"
>{{ item.defect_name }}</el-tag>
</span>
</template>
</el-table-column>
<el-table-column
label="操作"
fixed="right"
align="center"
width="120"
>
<template #default="scope">
<el-link :underline="false" @click="printMaterial(scope.row,'wpr')" type="primary">打印标签</el-link>
</template>
</el-table-column>
</scTable>
</template>
<template #footer>
<div style="flex: auto">
<el-button @click="wprVisibleDrawer=false">关闭</el-button>
</div>
</template>
</el-drawer>
<el-drawer v-model="limitedWatch" title="工艺路线流程图" size="80%" @closeDialog="limitedWatch = false">
<scDegra
v-if="limitedWatch"
ref="degraDialogs"
:nodes="nodes"
:edges="edges"
:rankdir="'LR'"
>
</scDegra>
</el-drawer>
</el-container> </el-container>
</template> </template>
<script> <script>
import { wmState } from "@/utils/enum.js"; import { wmState } from "@/utils/enum.js";
import materials from "./../mtm/materials.vue"; import materials from "./../mtm/materials.vue";
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: {
@ -217,11 +264,11 @@ export default {
type: String, type: String,
default: "", default: "",
}, },
processId: { mgroup_code: {
type: String, type: String,
default: "", default: "",
}, },
mgroupcode: { process: {
type: String, type: String,
default: "", default: "",
}, },
@ -231,9 +278,7 @@ export default {
materials, materials,
checkDialog, checkDialog,
showDrawer, showDrawer,
scrapDialog, scrapDialog
printDialog,
handoverDialog
}, },
name: "wmaterial", name: "wmaterial",
data() { data() {
@ -241,6 +286,7 @@ export default {
wmState, wmState,
apiObj: null, apiObj: null,
params: { params: {
tag : 'done',
mgroup: "", mgroup: "",
belong_dept:'' belong_dept:''
}, },
@ -251,12 +297,14 @@ export default {
}, },
dialog: { dialog: {
save: false, save: false,
check: false,
scrap: false, scrap: false,
permission: false, permission: false,
inmRecord:false, inmRecord:false,
print_m:false,
handover:false,
}, },
nodes:[],
edges:[],
wprList:[],
tableData: [], tableData: [],
selection: [], selection: [],
stateOptions:[ stateOptions:[
@ -268,15 +316,26 @@ export default {
search: "", search: "",
material: "", material: "",
}, },
wprParams:{
page:0,
wm: ""
},
route_code:"", route_code:"",
showBatch: "",
wmMaterial:'',
cate_type:'', cate_type:'',
materialType: "wm", materialType: "wm",
changebatch:false, limitedWatch:false,
materialsVisible:false, materialsVisible:false,
visibleDrawer: false, visibleDrawer: false,
wprVisibleDrawer:false,
wprApiObj:this.$API.wpm.wpr.list,
apiObjPrint:this.$API.cm.labelmat.fromWm, apiObjPrint:this.$API.cm.labelmat.fromWm,
wmId:'',
printer_name:localStorage.getItem("printer_name"), printer_name:localStorage.getItem("printer_name"),
mgroup_name:'',
ofrom_name:'',
ofrom_batch :'',
checkItem:{},
}; };
}, },
mounted() { mounted() {
@ -285,12 +344,21 @@ export default {
let arr = paths.split("/"); let arr = paths.split("/");
that.route_code = arr[2]; that.route_code = arr[2];
that.params.mgroup = that.mgroupId; that.params.mgroup = that.mgroupId;
that.params.tag = 'done'; that.$TOOL.data.set('bx_deptID',that.deptId);
that.$TOOL.data.set('gx_deptID',that.deptId);
that.apiObj = that.$API.wpm.wmaterial.list; that.apiObj = that.$API.wpm.wmaterial.list;
// that.$refs.table.refresh();
}, },
methods: { methods: {
handleWatch(row) {
let that = this;
that.$API.wpm.batchlog.dag.req({batch:row.batch}).then((res) => {
that.nodes = res.nodes;
that.edges = res.edges;
that.limitedWatch = true;
that.$nextTick(() => {
that.$refs.degraDialogs.open();
});
})
},
add() { add() {
this.dialog.save = true; this.dialog.save = true;
this.$nextTick(() => { this.$nextTick(() => {
@ -314,24 +382,10 @@ export default {
that.$refs.inmRecordDialog.open("add"); 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(row){
this.dialog.handover = true;
this.type = 10;
this.$nextTick(() => {
this.$refs.handoverDialog.open("add",row,20);
});
},
// //
tableCheckList(row){ tableCheckList(row){
this.wm = row.id; this.wm = row.id;
this.wmMaterial = row.material;
this.visibleDrawer = true; this.visibleDrawer = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.showDrawer.open(); this.$refs.showDrawer.open();
@ -341,6 +395,7 @@ export default {
selectionChange(selection) { selectionChange(selection) {
let that = this; let that = this;
that.selection = selection; that.selection = selection;
//
if(selection.length>0){ if(selection.length>0){
let material = selection[0].material; let material = selection[0].material;
selection.forEach((item)=>{ selection.forEach((item)=>{
@ -351,43 +406,15 @@ export default {
}) })
} }
}, },
/// //
table_add(type) { table_add(type) {
this.dialog.scrap = true; this.dialog.scrap = true;
this.type = type; 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.$nextTick(() => {
this.$refs.scrapDialog.open("add",handoverb,10); this.$refs.scrapDialog.open("add");
});
},
codeTextChange20(codeText2){
let that = this;
that.type = 20;
that.codeText2 = codeText2;
that.dialog.scrap = true;
that.$nextTick(() => {
that.$refs.scrapDialog.open("add",codeText2,10);
});
},
codeTextChange40(codeText4){
let that = this;
that.type = 40;
that.codeText4 = codeText4;
that.dialog.scrap = true;
that.$nextTick(() => {
that.$refs.scrapDialog.open("add",codeText4,10);
}); });
}, },
//
batchConcat(){ batchConcat(){
this.changebatch = true; this.changebatch = true;
let handoverb = []; let handoverb = [];
@ -396,6 +423,7 @@ export default {
let obj = {}; let obj = {};
obj.wm = item.id; obj.wm = item.id;
obj.batch = item.batch; obj.batch = item.batch;
obj.process = item.material_.process_name;
obj.count_cando = item.count_cando; obj.count_cando = item.count_cando;
obj.count = item.count_cando; obj.count = item.count_cando;
handoverb.push(obj) handoverb.push(obj)
@ -407,7 +435,6 @@ export default {
this.$refs.scrapDialog.open("add",handoverb,30); this.$refs.scrapDialog.open("add",handoverb,30);
}); });
}, },
//
handleScrapSuccess(){ handleScrapSuccess(){
this.dialog.scrap = false; this.dialog.scrap = false;
this.$refs.table.refresh(); this.$refs.table.refresh();
@ -420,19 +447,34 @@ export default {
handleQuery() { handleQuery() {
this.$refs.table.queryData(this.query); this.$refs.table.queryData(this.query);
}, },
showWpr(row){
let that = this;
that.ofrom_name = row.material_ofrom_name;
that.ofrom_batch = row.batch;
that.wprParams.wm = row.id;
that.wprVisibleDrawer = true;
this.$API.wpm.wpr.list.req(that.wprParams).then((res) => {
that.wprList = res;
})
},
// //
handleSaveSuccess(data, mode) { handleSaveSuccess(data, mode) {
this.dialog.save = false; this.dialog.save = false;
this.$refs.table.refresh(); this.$refs.table.refresh();
}, },
// //
printMaterial(row){ printMaterial(row,type){
let that = this; let that = this;
if(that.printer_name!==''&&that.printer_name!==null&&that.printer_name!==undefined){ if(that.printer_name!==''&&that.printer_name!==null&&that.printer_name!==undefined){
if(type=='wm'){
let params = {}; let params = {};
params.tid = row.id; params.tid = row.id;
if(that.route_code=='paiyicibang'){
params.label_template_name = '排一次棒打印模板';
}else{
params.extra_data={count:row.count}; params.extra_data={count:row.count};
params.label_template_name = '工段物料打印模板'; params.label_template_name = '其他工序打印模板';
}
that.apiObjPrint.req(params).then((res) => { that.apiObjPrint.req(params).then((res) => {
let obj = {}; let obj = {};
obj.printer_commands = res.commands; obj.printer_commands = res.commands;
@ -441,10 +483,62 @@ export default {
that.$message.success("打印成功"); that.$message.success("打印成功");
}); });
}) })
}else if(type=='wpr'){
let params = {};
let name = row.material_name.split('|')[0];
if(that.route_code=='paiban'||that.route_code=='zhuangmo'||that.route_code=='zlybcl'||that.route_code=='tuomoceliang'||
that.route_code=='reyatuihuo'||that.route_code=='banduangunyuan'||that.route_code=='banduangunyuanhoudama'||that.route_code=='banduangunyuantuihuo'
){
let oinfo = [];
for(let key in row.oinfo){
oinfo.push(row.oinfo[key])
}
let data = {sigao:'',duibian:'',moban:'',istest:'否',number:row.number,name:name,ofrom_name:that.ofrom_name,ofrom_batch:that.ofrom_batch};
if(that.route_code=='zhuangmo'||that.route_code=='zlybcl'||that.route_code=='tuomoceliang'||that.route_code=='reyatuihuo'||that.route_code=='banduangunyuan'){
params.label_template_name = '脱膜测量单件标签模板';
}else{
params.label_template_name = '排扳单件打印模板';
}
if(oinfo.length>0){
oinfo.forEach((item)=>{
if(item.name=="丝高"){
data.sigao = item.val;
}else if(item.name=="对边"){
data.duibian = item.val;
}else if(item.name=="模具号"){
data.moban = item.val;
}else if(item.name=="实验板段"){
data.istest = item.val?'是':'否';
}
})
}
params.data = data;
}else{
params.label_template_name = '单件打印模板';
params.data = {number:row.number,name:name};
}
that.$API.cm.labeltemplate.commands.req(params).then((res) => {
let obj = {};
obj.printer_commands = res.commands;
obj.printer_name = that.printer_name;
that.$API.wpm.prints.req(obj).then((response) => {
that.$message.success("打印成功");
});
});
}
}else{ }else{
that.$message.warning("请先设置打印机"); that.$message.warning("请先设置打印机");
} }
}, },
inmCheck(row){
let that = this;
that.checkItem = row;
that.dialog.check = true;
that.$nextTick(() => {
that.$refs.checkDialog.open("add");
})
},
}, },
}; };
</script> </script>