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

View File

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

View File

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

View File

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