fix:原料库入库记录中添加单个物料的标签打印
This commit is contained in:
parent
d25694b039
commit
6f03469152
|
@ -89,7 +89,11 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="仓库" prop="warehouse_name">
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" prop="count">
|
||||
<el-table-column label="数量">
|
||||
<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="count_tested" v-if="cate=='mainso'">
|
||||
</el-table-column>
|
||||
|
@ -195,7 +199,7 @@
|
|||
<el-link
|
||||
type="primary"
|
||||
v-if="mioObj.type == 'do_out'&&project_code=='bxerp'"
|
||||
@click="printMaterial(scope.row)"
|
||||
@click="printMaterial(scope.row,'wm')"
|
||||
>
|
||||
物料标签
|
||||
</el-link>
|
||||
|
@ -233,6 +237,31 @@
|
|||
<el-dialog v-model="printVisible" width="1200px">
|
||||
<print :baseData="mioObj" :tableData="tableData" :type="mioObj.type" @closePrint="printVisible=false"/>
|
||||
</el-dialog>
|
||||
<el-drawer v-model="wprVisibleDrawer" :size="'70%'">
|
||||
<template #header>
|
||||
<h4>关联产品</h4>
|
||||
</template>
|
||||
<template #default>
|
||||
<scTable ref="wprTable" hidePagination :data="wprList">
|
||||
<el-table-column label="产品编号" prop="number" min-width="100px"></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-dialog title="打印机设置" v-model="setNameVisible" width="600px">
|
||||
<el-form label-width="100px">
|
||||
<el-form-item label="打印机名称">
|
||||
|
@ -279,6 +308,7 @@ export default {
|
|||
params: {},
|
||||
// mioId: "",
|
||||
mioObj: {},
|
||||
wprList:[],
|
||||
selection: [],
|
||||
tableData:[],
|
||||
stateDict: {
|
||||
|
@ -303,6 +333,7 @@ export default {
|
|||
mioType:'',
|
||||
project_code:'',
|
||||
setNameVisible:false,
|
||||
wprVisibleDrawer:false,
|
||||
printer_name:localStorage.getItem("printer_name")
|
||||
};
|
||||
},
|
||||
|
@ -439,20 +470,45 @@ export default {
|
|||
that.printVisible = true;
|
||||
})
|
||||
},//打印
|
||||
showWpr(row){
|
||||
let that = this;
|
||||
that.wprList = row.mioitemw;
|
||||
that.wprVisibleDrawer = true;
|
||||
},
|
||||
//打印物料标签
|
||||
printMaterial(row){
|
||||
printMaterial(row,type){
|
||||
let that = this;
|
||||
if(that.printer_name!==''&&that.printer_name!==null&&that.printer_name!==undefined){
|
||||
that.$API.cm.labelmat.fromWm.req({tid:row.id}).then((res) => {
|
||||
let code = res.code_label;
|
||||
if(type=='wm'){
|
||||
that.$API.cm.labelmat.fromWm.req({tid:row.id}).then((res) => {
|
||||
let code = res.code_label;
|
||||
let str = [
|
||||
"SIZE 40 mm,70 mm",
|
||||
"GAP 7 mm,7 mm",
|
||||
"CLS",
|
||||
"REFERENCE 0,0",
|
||||
'QRCODE 30,400,H,5,A,0,"' +code +'"',
|
||||
"WINTEXT 200,550,28,90,0,0,Simhei," + res.material_name,
|
||||
"WINTEXT 240,550,28,90,0,0,Simhei," + res.batch,
|
||||
"PRINT 1",
|
||||
];
|
||||
let obj = {};
|
||||
obj.printer_commands = str;
|
||||
obj.printer_name = that.printer_name;
|
||||
that.$API.wpm.prints.req(obj).then((response) => {
|
||||
that.$message.success("打印成功");
|
||||
});
|
||||
})
|
||||
}else{
|
||||
let code = row.number;
|
||||
let str = [
|
||||
"SIZE 40 mm,70 mm",
|
||||
"SIZE 70 mm,100 mm",
|
||||
"GAP 7 mm,7 mm",
|
||||
"CLS",
|
||||
"REFERENCE 0,0",
|
||||
'QRCODE 30,400,H,5,A,0,"' +code +'"',
|
||||
"WINTEXT 200,550,28,90,0,0,Simhei," + res.material_name,
|
||||
"WINTEXT 240,550,28,90,0,0,Simhei," + res.batch,
|
||||
"WINTEXT 200,550,28,90,0,0,Simhei," + row.material_name,
|
||||
"WINTEXT 240,550,28,90,0,0,Simhei," + row.number,
|
||||
"PRINT 1",
|
||||
];
|
||||
let obj = {};
|
||||
|
@ -461,7 +517,7 @@ export default {
|
|||
that.$API.wpm.prints.req(obj).then((response) => {
|
||||
that.$message.success("打印成功");
|
||||
});
|
||||
})
|
||||
}
|
||||
}else{
|
||||
that.printSetting();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue