fix:日志中物料标签的打印

This commit is contained in:
shijing 2024-10-29 15:29:03 +08:00
parent 7ed39bb24a
commit 6f476c2740
4 changed files with 43 additions and 54 deletions

View File

@ -182,12 +182,6 @@
<el-button @click="visible = false">取消</el-button>
</el-footer>
</el-dialog>
<!-- <scan-dialog
v-if="scanVisible"
ref="scanDialog"
@closed="scanClose"
>
</scan-dialog> -->
</template>
<script>
import scanDialog from "./../template/scan.vue";
@ -547,20 +541,20 @@ export default {
return;
}
let that = this;
let id =data.split(':')[1];
let id = data.split('#')[1];
console.log('id',id);
this.$API.cm.labelmat.item.req(id).then((res) => {
console.log('res',res);
// console.log('res',res);
let arr = that.form.handoverb.filter((item) => {
return item.batch == res.batch;
})
console.log('arr',arr);
// console.log('arr',arr);
if(arr.length>0){
that.$message.error("该批次已存在")
}else{
that.materialOptions.forEach((item) => {
if(item.batch == res.batch){
let arr = that.form.handoverb
// let arr = that.form.handoverb
let obj = {};
obj.wm = item.id;
obj.batch = item.batch;

View File

@ -223,7 +223,6 @@ export default {
visibleDrawer: false,
apiObjPrint:this.$API.cm.labelmat.fromWm,
wmId:'',
printer_name:localStorage.getItem("printer_name")
};
},
mounted() {

View File

@ -284,14 +284,22 @@
<el-dialog v-model="printVisible" width="1200px">
<print :baseData="form" :tableData="tableData" :type="form.type" mtype="20" @closePrint="printVisible=false"/>
</el-dialog>
<print-dialog
v-if="dialog.print_m"
ref="printmaterial"
:mId="wmId"
:mtype="wmtype"
:apiObj="apiObjPrint"
></print-dialog>
</el-drawer>
</template>
<script>
import saveDialog from "./inm_record_form.vue";
import print from "./../setting/print/A4.vue";
import printDialog from "./../template/printmaterial.vue";
export default {
name: "inm_record",
components: { saveDialog,print },
components: { saveDialog,print,printDialog },
props: {
cate: { type: String, default: "" },
deptId: { type: String, default: "" },
@ -314,6 +322,7 @@ export default {
printVisible:false,
dialog: {
save: false,
print_m:false,
},
form: {
number: "",
@ -341,7 +350,10 @@ export default {
userOptions: [],//
deptOptions: [],
mgroupOptions: [],
printer_name:localStorage.getItem("printer_name")
wmId:'',
wmtype:'',
batchContains:'',
apiObjPrint:this.$API.cm.labelmat.fromWm,
};
},
mounted() {
@ -478,25 +490,11 @@ export default {
//
printMaterial(row){
let that = this;
that.$API.cm.labelmat.fromMioitem.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,
];
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) => {});
that.wmId = row.id;
that.wmtype = row.material_.type;
that.dialog.print_m = true;
that.$nextTick(() => {
that.$refs.printmaterial.open();
})
},
//

View File

@ -413,6 +413,13 @@
<el-dialog v-model="printVisible" width="1200px">
<print :baseData="mlogItem" :tableData="tableData" :tableData2="tableData2" type="102" @closePrint="printVisible=false"/>
</el-dialog>
<print-dialog
v-if="dialog.print_m"
ref="printmaterial"
:mId="wmId"
:mtype="wmtype"
:apiObj="apiObjPrint"
></print-dialog>
</div>
</el-drawer>
</template>
@ -421,6 +428,7 @@ import editDialog from "./mlog_form.vue";
import saveDialog from "./mlogb_form.vue";
import checkDialog from "./mlogb_check.vue";
import print from "./../setting/print/A4.vue";
import printDialog from "./../template/printmaterial.vue";
export default {
props: {
mlogId: {
@ -432,7 +440,8 @@ export default {
editDialog,
saveDialog,
checkDialog,
print
print,
printDialog
},
emits: ["success", "closed"],
data() {
@ -444,6 +453,7 @@ export default {
save: false,
edit: false,
check: false,
print_m:false,
},
apiObj: null,
apiObjWm:null,
@ -506,7 +516,10 @@ export default {
},
],
},
batchContains:''
wmId:'',
wmtype:'',
batchContains:'',
apiObjPrint:this.$API.cm.labelmat.fromWm,
};
},
mounted() {
@ -703,27 +716,12 @@ export default {
//
printMaterial(row){
let that = this;
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,
];
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) => {});
that.wmId = row.id;
that.wmtype = row.material_.type;
that.dialog.print_m = true;
this.$nextTick(() => {
this.$refs.printmaterial.open();
})
},
},
};