fix:工段库存物料标签打印

This commit is contained in:
shijing 2024-10-25 17:17:54 +08:00
parent f3f59c7888
commit 3349982650
1 changed files with 26 additions and 28 deletions

View File

@ -144,11 +144,11 @@
> >
</scrap-dialog> </scrap-dialog>
<showDrawer <showDrawer
ref="showDrawer" ref="showDrawer"
v-if="visibleDrawer" v-if="visibleDrawer"
:wm="wm" :wm="wm"
@closed="visibleDrawer = false" @closed="visibleDrawer = false"
> >
</showDrawer> </showDrawer>
<save-dialog <save-dialog
v-if="dialog.inmRecord" v-if="dialog.inmRecord"
@ -160,11 +160,19 @@
@success="handleinmSuccess" @success="handleinmSuccess"
> >
</save-dialog> </save-dialog>
<print-dialog
v-if="dialog.print_m"
ref="printmaterial"
:mId="wmId"
:mtype="wmtype"
:apiObj="apiObjPrint"
></print-dialog>
</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";
@ -181,7 +189,8 @@ export default {
materials, materials,
checkDialog, checkDialog,
showDrawer, showDrawer,
scrapDialog scrapDialog,
printDialog
}, },
name: "wmaterial", name: "wmaterial",
data() { data() {
@ -192,12 +201,14 @@ export default {
mgroupx: "", mgroupx: "",
belong_dept:'' belong_dept:''
}, },
wmtype:0,
query: {}, query: {},
dialog: { dialog: {
save: false, save: false,
scrap: false, scrap: false,
permission: false, permission: false,
inmRecord:false inmRecord:false,
print_m:false
}, },
tableData: [], tableData: [],
selection: [], selection: [],
@ -208,7 +219,10 @@ export default {
cate_type:'', cate_type:'',
process:'', process:'',
materialType: "wm", materialType: "wm",
materialsVisible:false,
visibleDrawer: false, visibleDrawer: false,
apiObjPrint:this.$API.cm.labelmat.fromWm,
wmId:'',
printer_name:localStorage.getItem("printer_name") printer_name:localStorage.getItem("printer_name")
}; };
}, },
@ -317,28 +331,12 @@ export default {
// //
printMaterial(row){ printMaterial(row){
let that = this; let that = this;
that.$API.cm.labelmat.fromWm.req({tid:row.id}).then((res) => { that.wmId = row.id;
console.log(res) that.wmtype = row.material_.type;
let code = res.code_label; that.dialog.print_m = true;
let str = [ this.$nextTick(() => {
"SIZE 40 mm,70 mm", this.$refs.printmaterial.open();
"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,
];
if(res.notok_sign!==null){
str.push("WINTEXT 280,550,28,90,0,0,Simhei," +res.notok_sign_name,)
}
str.push("PRINT 1",)
let obj = {};
obj.printer_commands = str;
obj.printer_name = that.printer_name;
this.$API.wpm.prints.req(obj).then((response) => {});
}) })
}, },
}, },
}; };