Merge branch 'master' of https://e.coding.net/ctcdevteam/ehs/ehs_web
This commit is contained in:
commit
e8d28126ad
|
@ -105,13 +105,16 @@ export default {
|
|||
let obj = {};
|
||||
obj.printer_commands = str;
|
||||
obj.printer_name = that.printer_name;
|
||||
if(that.$INTERVAL == null){
|
||||
that.$INTERVAL = setInterval(() => {
|
||||
let printerInterval = that.$TOOL.data.get('printerInterval');
|
||||
if(printerInterval==null){
|
||||
let intervalID = setInterval(() => {
|
||||
that.printLabel(obj)
|
||||
}, 2000);
|
||||
that.visible = false;
|
||||
that.$TOOL.data.set('printerInterval',intervalID );
|
||||
|
||||
}else{
|
||||
that.$message.warning("请等待当前打印任务完成")
|
||||
that.$message.warning("请等待当前打印任务完成");
|
||||
}
|
||||
})
|
||||
},
|
||||
|
@ -123,8 +126,9 @@ export default {
|
|||
that.$API.wpm.prints.req(obj).then((response) => {
|
||||
that.count_printed ++
|
||||
if (that.count_printed >= that.print_count){
|
||||
clearInterval(that.$INTERVAL);
|
||||
that.$INTERVAL = null;
|
||||
let printerInterval = that.$TOOL.data.get('printerInterval');
|
||||
clearInterval(printerInterval);
|
||||
that.$TOOL.data.set('printerInterval',null);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -178,7 +178,7 @@
|
|||
>
|
||||
</check-dialog>
|
||||
<el-dialog v-model="printVisible" width="1200px">
|
||||
<print :baseData="fmlogItem" :tableData="tableData" type="1001" @closePrint="printVisible=false"/>
|
||||
<print :baseData="fmlogItem" :tableData="tableData" type="101" @closePrint="printVisible=false"/>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</el-drawer>
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -223,7 +223,6 @@ export default {
|
|||
visibleDrawer: false,
|
||||
apiObjPrint:this.$API.cm.labelmat.fromWm,
|
||||
wmId:'',
|
||||
printer_name:localStorage.getItem("printer_name")
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
|
|
@ -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();
|
||||
})
|
||||
},
|
||||
//本地更新数据
|
||||
|
|
|
@ -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();
|
||||
})
|
||||
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue