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