|
|
@ -197,25 +197,28 @@ |
|
|
|
>导出(Excel) |
|
|
|
</el-button> |
|
|
|
<el-button |
|
|
|
ref='btn1' |
|
|
|
type="primary" |
|
|
|
size="mini" |
|
|
|
style="margin-left: 15px" |
|
|
|
@click="print()" |
|
|
|
>打印发货排序单 |
|
|
|
>打印门板发货排序单 |
|
|
|
</el-button> |
|
|
|
<el-button |
|
|
|
ref='btn2' |
|
|
|
type="primary" |
|
|
|
size="mini" |
|
|
|
style="margin-left: 15px" |
|
|
|
@click="rePrint()" |
|
|
|
>重新打印发货排序单 |
|
|
|
>重新打印门板发货排序单 |
|
|
|
</el-button> |
|
|
|
<el-button |
|
|
|
ref='btn3' |
|
|
|
type="primary" |
|
|
|
size="mini" |
|
|
|
style="margin-left: 15px" |
|
|
|
@click="makeUpPrint()" |
|
|
|
>补打发货排序单 |
|
|
|
>补打门板发货排序单 |
|
|
|
</el-button> |
|
|
|
</el-form-item> |
|
|
|
<!-- </el-row> --> |
|
|
@ -276,6 +279,81 @@ |
|
|
|
</el-table> |
|
|
|
|
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<el-dialog |
|
|
|
:visible.sync="dialogFormVisible" |
|
|
|
:close-on-click-modal="false" |
|
|
|
:title="formTitle" |
|
|
|
width="700px" |
|
|
|
@close='closeDialog' |
|
|
|
> |
|
|
|
<el-form |
|
|
|
ref="form" |
|
|
|
:inline="true" |
|
|
|
:model="form" |
|
|
|
:rules="rules" |
|
|
|
size="small" |
|
|
|
label-width="120px" |
|
|
|
> |
|
|
|
<el-row> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="大众顺序号:" prop="beginHostSN" v-show="isShowHostSN"> |
|
|
|
<el-input |
|
|
|
v-model="form.beginHostSN" |
|
|
|
placeholder="" |
|
|
|
clearable |
|
|
|
size="small" |
|
|
|
style="width: 240px" |
|
|
|
@keyup.enter.native="handleQuery" |
|
|
|
/> |
|
|
|
<label class = "label1" >-</label> |
|
|
|
<el-input |
|
|
|
v-model="form.endHostSN" |
|
|
|
placeholder="" |
|
|
|
clearable |
|
|
|
size="small" |
|
|
|
style="width: 240px" |
|
|
|
@keyup.enter.native="handleQuery" |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<el-row> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="底盘号:" prop="VIN" v-show="isShowVin"> |
|
|
|
<el-input |
|
|
|
v-model="form.beginVin" |
|
|
|
placeholder="" |
|
|
|
clearable |
|
|
|
size="small" |
|
|
|
style="width: 240px" |
|
|
|
@keyup.enter.native="handleQuery" |
|
|
|
/> |
|
|
|
<label class = "label1" >-</label> |
|
|
|
<el-input |
|
|
|
v-model="form.endVin" |
|
|
|
placeholder="" |
|
|
|
clearable |
|
|
|
size="small" |
|
|
|
style="width: 240px" |
|
|
|
@keyup.enter.native="handleQuery" |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
|
|
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button type="text" @click="dialogFormVisible = false" |
|
|
|
>取消</el-button |
|
|
|
> |
|
|
|
<el-button v-loading="formLoading" type="primary" @click="save" |
|
|
|
>确认</el-button |
|
|
|
> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="table-footer"> |
|
|
|
<!-- 分页控件 style="margin-top: -25px;margin-bottom:-25px;float:right;"--> |
|
|
@ -386,7 +464,7 @@ export default { |
|
|
|
listQuery: { |
|
|
|
SkipCount: 0, |
|
|
|
MaxResultCount: 15, |
|
|
|
productType: 1, |
|
|
|
productType: 1,//1:门板;2:柱护板 |
|
|
|
ProductLine: undefined, |
|
|
|
Version:undefined, |
|
|
|
serialNumBegin:undefined, |
|
|
@ -415,6 +493,33 @@ export default { |
|
|
|
BillType: 2, |
|
|
|
//UserId: "00000000-0000-0000-0000-000000000000", |
|
|
|
}, |
|
|
|
hostSNQuery:{ |
|
|
|
productLine:undefined, |
|
|
|
}, |
|
|
|
hostCheckQuery:{ |
|
|
|
printType: undefined,//0:打印;1:重打;2:补打; |
|
|
|
productLine: undefined, |
|
|
|
beginHostSN: undefined, |
|
|
|
endHostSN: undefined, |
|
|
|
beginVin: undefined, |
|
|
|
endVin: undefined |
|
|
|
}, |
|
|
|
hostPrintQuery:{ |
|
|
|
printType: undefined,//0:打印;1:重打;2:补打; |
|
|
|
productLine: undefined, |
|
|
|
beginHostSN: undefined, |
|
|
|
endHostSN: undefined, |
|
|
|
beginVin: undefined, |
|
|
|
endVin: undefined |
|
|
|
}, |
|
|
|
vinPrintQuery:{ |
|
|
|
printType: undefined,//0:打印;1:重打;2:补打; |
|
|
|
productLine: undefined, |
|
|
|
beginHostSN: undefined, |
|
|
|
endHostSN: undefined, |
|
|
|
beginVin: undefined, |
|
|
|
endVin: undefined |
|
|
|
}, |
|
|
|
form:{ |
|
|
|
details:[] |
|
|
|
}, |
|
|
@ -433,7 +538,11 @@ export default { |
|
|
|
details:[], //修改子表数据源 |
|
|
|
PLList:[],//产线下拉 |
|
|
|
PLChildList:[],//筛选后产线下拉 |
|
|
|
productTypeList:[{id:1,name:'门板'},{id:2,name:'柱护板'}] |
|
|
|
productTypeList:[{id:1,name:'门板'},{id:2,name:'柱护板'}], |
|
|
|
isShowHostSN : false, |
|
|
|
isShowVin : false, |
|
|
|
|
|
|
|
|
|
|
|
}; |
|
|
|
}, |
|
|
|
mounted() { |
|
|
@ -730,7 +839,7 @@ export default { |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
valueselectChange(){}, |
|
|
|
valueselectChange(){this.$forceUpdate();}, |
|
|
|
handleImportSAP(){}, |
|
|
|
|
|
|
|
handleFilter() { |
|
|
@ -770,9 +879,384 @@ export default { |
|
|
|
this.$refs.multipleTable.clearSelection(); |
|
|
|
this.$refs.multipleTable.toggleRowSelection(row); |
|
|
|
}, |
|
|
|
print(){}, |
|
|
|
rePrint(){}, |
|
|
|
makeUpPrint(){}, |
|
|
|
|
|
|
|
closeDialog(){ |
|
|
|
}, |
|
|
|
/**打印 */ |
|
|
|
print() |
|
|
|
{ |
|
|
|
this.hostPrintQuery = { |
|
|
|
printType: undefined,//0:打印;1:重打;2:补打; |
|
|
|
productLine: undefined, |
|
|
|
beginHostSN: undefined, |
|
|
|
endHostSN: undefined, |
|
|
|
beginVin: undefined, |
|
|
|
endVin: undefined |
|
|
|
}, |
|
|
|
this.hostCheckQuery.printType = 0; |
|
|
|
this.hostPrintQuery.printType = 0; |
|
|
|
this.vinPrintQuery.printType = 0; |
|
|
|
if(this.listQuery.productLine === "" || this.listQuery.productLine === undefined) |
|
|
|
{ |
|
|
|
this.$message({ |
|
|
|
message: "请选择生产线", |
|
|
|
type: "warning", |
|
|
|
}); |
|
|
|
return; |
|
|
|
} |
|
|
|
this.hostSNQuery.productLine = this.listQuery.productLine; |
|
|
|
this.hostPrintQuery.productLine = this.listQuery.productLine; |
|
|
|
this.$axios |
|
|
|
.gets( |
|
|
|
"/api/newjit/bill-m100/get-print-start-hostsn",this.hostSNQuery |
|
|
|
) |
|
|
|
.then((response) => { |
|
|
|
console.log("获取hostsn大众顺序号起始"); |
|
|
|
console.log(response.item); |
|
|
|
if(response.item !== null) |
|
|
|
{ |
|
|
|
this.form.beginHostSN = parseInt(response.item); |
|
|
|
this.form.endHostSN = parseInt(response.item) + 11; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
this.$message({ |
|
|
|
message: "获取不到大众顺序号", |
|
|
|
type: "warning", |
|
|
|
}); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
}); |
|
|
|
this.formTitle = "打印"; |
|
|
|
this.dialogFormVisible = true; |
|
|
|
this.form = |
|
|
|
{ |
|
|
|
beginHostSN:"", |
|
|
|
endHostSN:"", |
|
|
|
}; |
|
|
|
this.isShowHostSN = true; |
|
|
|
this.isShowVin = false; |
|
|
|
}, |
|
|
|
/**重打 */ |
|
|
|
rePrint() |
|
|
|
{ |
|
|
|
this.hostPrintQuery = { |
|
|
|
printType: undefined,//0:打印;1:重打;2:补打; |
|
|
|
productLine: undefined, |
|
|
|
beginHostSN: undefined, |
|
|
|
endHostSN: undefined, |
|
|
|
beginVin: undefined, |
|
|
|
endVin: undefined |
|
|
|
}, |
|
|
|
this.hostCheckQuery.printType = 1; |
|
|
|
this.hostPrintQuery.printType = 1; |
|
|
|
this.vinPrintQuery.printType = 1; |
|
|
|
if(this.listQuery.productLine === "" || this.listQuery.productLine === undefined) |
|
|
|
{ |
|
|
|
this.$message({ |
|
|
|
message: "请选择生产线", |
|
|
|
type: "warning", |
|
|
|
}); |
|
|
|
return; |
|
|
|
} |
|
|
|
this.formTitle = "重打"; |
|
|
|
this.hostPrintQuery.productLine = this.listQuery.productLine; |
|
|
|
this.dialogFormVisible = true; |
|
|
|
this.form = |
|
|
|
{ |
|
|
|
beginVin:"", |
|
|
|
endVin:"" |
|
|
|
}; |
|
|
|
this.isShowHostSN = false; |
|
|
|
this.isShowVin = true; |
|
|
|
}, |
|
|
|
/**补打 */ |
|
|
|
makeUpPrint() |
|
|
|
{ |
|
|
|
this.hostPrintQuery = { |
|
|
|
printType: undefined,//0:打印;1:重打;2:补打; |
|
|
|
productLine: undefined, |
|
|
|
beginHostSN: undefined, |
|
|
|
endHostSN: undefined, |
|
|
|
beginVin: undefined, |
|
|
|
endVin: undefined |
|
|
|
}, |
|
|
|
this.hostCheckQuery.printType = 2; |
|
|
|
this.hostPrintQuery.printType = 2; |
|
|
|
this.vinPrintQuery.printType = 2; |
|
|
|
if(this.listQuery.productLine === "" || this.listQuery.productLine === undefined) |
|
|
|
{ |
|
|
|
this.$message({ |
|
|
|
message: "请选择生产线", |
|
|
|
type: "error", |
|
|
|
}); |
|
|
|
return; |
|
|
|
} |
|
|
|
this.formTitle = "补打"; |
|
|
|
this.hostPrintQuery.productLine = this.listQuery.productLine; |
|
|
|
this.dialogFormVisible = true; |
|
|
|
this.form = |
|
|
|
{ |
|
|
|
beginVin:"", |
|
|
|
endVin:"" |
|
|
|
}; |
|
|
|
this.isShowHostSN = false; |
|
|
|
this.isShowVin = true; |
|
|
|
}, |
|
|
|
/**保存*/ |
|
|
|
save() |
|
|
|
{ |
|
|
|
if(this.isShowHostSN === true) |
|
|
|
{ |
|
|
|
if(this.form.beginHostSN === "" || this.form.endHostSN === "") |
|
|
|
{ |
|
|
|
this.$message({ |
|
|
|
message: "请输入完整的底盘号起始范围", |
|
|
|
type: "error", |
|
|
|
}); |
|
|
|
return; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
if(parseInt(this.form.endHostSN )-parseInt(this.form.beginHostSN) > 11) |
|
|
|
{ |
|
|
|
this.$message({ |
|
|
|
message: "终止顺序号不能大于"+(parseInt(this.form.beginHostSN)+11), |
|
|
|
type: "error", |
|
|
|
}); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
if(this.isShowVin === true) |
|
|
|
{ |
|
|
|
if(this.form.beginVin === "" || this.form.endVin === "") |
|
|
|
{ |
|
|
|
this.$message({ |
|
|
|
message: "请输入完整的底盘号起始范围", |
|
|
|
type: "error", |
|
|
|
}); |
|
|
|
return; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
if(parseInt(this.form.endHostSN )-parseInt(this.form.beginHostSN) > 11) |
|
|
|
{ |
|
|
|
this.$message({ |
|
|
|
message: "终止顺序号不能大于"+(parseInt(this.form.beginHostSN)+11), |
|
|
|
type: "error", |
|
|
|
}); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
if(this.formTitle === "打印") |
|
|
|
{ |
|
|
|
this.hostPrintQuery.beginHostSN = parseInt(this.form.beginHostSN ); |
|
|
|
this.hostPrintQuery.endHostSN = parseInt(this.form.endHostSN ); |
|
|
|
//验证是否断号 |
|
|
|
this.$axios |
|
|
|
.posts( |
|
|
|
"/api/newjit/bill-m100/check-hostsn-break-num",this.hostCheckQuery |
|
|
|
) |
|
|
|
.then((response) => { |
|
|
|
console.log("检查hostsn大众顺序号是否断号"); |
|
|
|
console.log(response); |
|
|
|
if(response.item.length > 0) |
|
|
|
{ |
|
|
|
this.$confirm("本次打印存在断号是否继续?", "提示", { |
|
|
|
confirmButtonText: "确定", |
|
|
|
cancelButtonText: "取消", |
|
|
|
type: "warning", |
|
|
|
}) |
|
|
|
.then(() => { |
|
|
|
//判断productType类型 |
|
|
|
if(this.listQuery.productType === 1)//门板 |
|
|
|
{ |
|
|
|
//传递大众顺序号起止 |
|
|
|
this.$axios |
|
|
|
.posts( |
|
|
|
"/api/newjit/bill-m100/print-menban-packing-list",this.hostPrintQuery |
|
|
|
) |
|
|
|
.then((response) => { |
|
|
|
console.log("打印门板装箱单"); |
|
|
|
console.log(response); |
|
|
|
if(response.status === false) |
|
|
|
{ |
|
|
|
this.$message({ |
|
|
|
message: response.message, |
|
|
|
type: "error", |
|
|
|
}); |
|
|
|
return; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
//传给grid++接口json数据,得到返回的文件流pdfstream |
|
|
|
this.printpdf(pdfstream);//打印我文件流 |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
else if(this.listQuery.productType === 2)//柱护板 |
|
|
|
{ |
|
|
|
//传递大众顺序号起止 |
|
|
|
this.$axios |
|
|
|
.posts( |
|
|
|
"/api/newjit/bill-m100/print-zhuhuban-packing-list",this.hostPrintQuery |
|
|
|
) |
|
|
|
.then((response) => { |
|
|
|
console.log("打印柱护板装箱单"); |
|
|
|
console.log(response); |
|
|
|
if(response.status === false) |
|
|
|
{ |
|
|
|
this.$message({ |
|
|
|
message: response.message, |
|
|
|
type: "error", |
|
|
|
}); |
|
|
|
return; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
//传给grid++接口json数据,得到返回的文件流pdfstream |
|
|
|
this.printpdf(pdfstream);//打印我文件流 |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
}); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
//判断productType类型 |
|
|
|
if(this.listQuery.productType === 1)//门板 |
|
|
|
{ |
|
|
|
//传递大众顺序号起止 |
|
|
|
this.$axios |
|
|
|
.posts( |
|
|
|
"/api/newjit/bill-m100/print-menban-packing-list",this.hostPrintQuery |
|
|
|
) |
|
|
|
.then((response) => { |
|
|
|
console.log("打印门板装箱单"); |
|
|
|
console.log(response); |
|
|
|
if(response.status === false) |
|
|
|
{ |
|
|
|
this.$message({ |
|
|
|
message: response.message, |
|
|
|
type: "error", |
|
|
|
}); |
|
|
|
return; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
//传给grid++接口json数据,得到返回的文件流pdfstream |
|
|
|
this.printpdf(pdfstream);//打印我文件流 |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
else if(this.listQuery.productType === 2)//柱护板 |
|
|
|
{ |
|
|
|
//传递大众顺序号起止 |
|
|
|
this.$axios |
|
|
|
.posts( |
|
|
|
"/api/newjit/bill-m100/print-zhuhuban-packing-list",this.hostPrintQuery |
|
|
|
) |
|
|
|
.then((response) => { |
|
|
|
console.log("打印柱护板装箱单"); |
|
|
|
console.log(response); |
|
|
|
if(response.status === false) |
|
|
|
{ |
|
|
|
this.$message({ |
|
|
|
message: response.message, |
|
|
|
type: "error", |
|
|
|
}); |
|
|
|
return; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
//传给grid++接口json数据,得到返回的文件流pdfstream |
|
|
|
this.printpdf(pdfstream);//打印我文件流 |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
this.hostPrintQuery.beginVin = this.form.beginVin; |
|
|
|
this.hostPrintQuery.endVin = this.form.endVin; |
|
|
|
//判断productType类型 |
|
|
|
if(this.listQuery.productType === 1)//门板 |
|
|
|
{ |
|
|
|
//传递底盘号起止 |
|
|
|
this.$axios |
|
|
|
.posts( |
|
|
|
"/api/newjit/bill-m100/print-menban-packing-list",this.hostPrintQuery |
|
|
|
) |
|
|
|
.then((response) => { |
|
|
|
console.log("重新或补打打印门板装箱单"); |
|
|
|
console.log(response); |
|
|
|
if(response.status === false) |
|
|
|
{ |
|
|
|
this.$message({ |
|
|
|
message: response.message, |
|
|
|
type: "error", |
|
|
|
}); |
|
|
|
return; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
//传给grid++接口json数据,得到返回的文件流pdfstream |
|
|
|
this.printpdf(pdfstream);//打印我文件流 |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
}); |
|
|
|
} |
|
|
|
else if(this.listQuery.productType === 2)//柱护板 |
|
|
|
{ |
|
|
|
//传递底盘号起止 |
|
|
|
this.$axios |
|
|
|
.posts( |
|
|
|
"/api/newjit/bill-m100/print-zhuhuban-packing-list",this.hostPrintQuery |
|
|
|
) |
|
|
|
.then((response) => { |
|
|
|
console.log("打印柱护板装箱单"); |
|
|
|
console.log(response); |
|
|
|
if(response.status === false) |
|
|
|
{ |
|
|
|
this.$message({ |
|
|
|
message: response.message, |
|
|
|
type: "error", |
|
|
|
}); |
|
|
|
return; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
//传给grid++接口json数据,得到返回的文件流pdfstream |
|
|
|
this.printpdf(pdfstream);//打印我文件流 |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
//获取所有产线 |
|
|
|
getProductLine() |
|
|
|
{ |
|
|
@ -797,6 +1281,20 @@ export default { |
|
|
|
this.listQuery.productLine = ""; |
|
|
|
this.PLChildList = this.PLList.filter(u => u.productType === parseInt(this.listQuery.productType)); |
|
|
|
//console.log(this.PLList) |
|
|
|
//变更打印按钮文字 |
|
|
|
if(this.listQuery.productType === 1) |
|
|
|
{ |
|
|
|
this.$refs.btn1.$el.innerText = "打印门板发货排序单"; |
|
|
|
this.$refs.btn2.$el.innerText = "重新打印门板发货排序单"; |
|
|
|
this.$refs.btn3.$el.innerText = "补打门板发货排序单"; |
|
|
|
} |
|
|
|
else if(this.listQuery.productType === 2) |
|
|
|
{ |
|
|
|
this.$refs.btn1.$el.innerText = "打印柱护板发货排序单"; |
|
|
|
this.$refs.btn2.$el.innerText = "重新打印柱护板发货排序单"; |
|
|
|
this.$refs.btn3.$el.innerText = "补打柱护板发货排序单"; |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
/*单据状态变更 */ |
|
|
|
checkedListChange(index) |
|
|
@ -811,6 +1309,53 @@ export default { |
|
|
|
this.listQuery.state.push(this.billState[index].id); |
|
|
|
} |
|
|
|
}, |
|
|
|
/**解析文件流 */ |
|
|
|
getUrl() |
|
|
|
{ |
|
|
|
//dataResult.data是后台返回的流 |
|
|
|
let pdfUrl = window.URL.createObjectURL(new Blob([dataResult.data], { type: `application/pdf` })); |
|
|
|
const fname = item.name+str+"_"+lists[1]+lists[2]; // 下载文件的名字 |
|
|
|
const link = document.createElement('a'); |
|
|
|
link.href = pdfUrl; |
|
|
|
link.setAttribute('download','下载的文件名'); |
|
|
|
document.body.appendChild(link); |
|
|
|
link.click(); |
|
|
|
document.body.removeChild(link) |
|
|
|
}, |
|
|
|
//base64转化成流,dataurl是后台返回的base64 |
|
|
|
dataURLtoBlob (dataurl) { |
|
|
|
var bstr = atob(dataurl.substring(dataurl.indexOf(',') + 1)); |
|
|
|
var n = bstr.length; |
|
|
|
var u8arr = new Uint8Array(n); |
|
|
|
while (n--) { |
|
|
|
u8arr[n] = bstr.charCodeAt(n); |
|
|
|
} |
|
|
|
return new Blob([u8arr], { type: 'application/pdf' }); |
|
|
|
}, |
|
|
|
doPrint(val) { |
|
|
|
var ordonnance = document.getElementById(val).contentWindow |
|
|
|
setTimeout(() => { |
|
|
|
// window.print() |
|
|
|
ordonnance.print() |
|
|
|
this.pdfLoading = false |
|
|
|
}, 100) |
|
|
|
}, |
|
|
|
printpdf(blob) |
|
|
|
{ |
|
|
|
//打印功能,dataResult是后台返回的base64 |
|
|
|
//let blob = this.dataURLtoBlob(dataResult); |
|
|
|
var date = (new Date()).getTime() |
|
|
|
var ifr = document.createElement('iframe') |
|
|
|
ifr.style.frameborder = 'no' |
|
|
|
ifr.style.display = 'none' |
|
|
|
ifr.style.pageBreakBefore = 'always' |
|
|
|
ifr.setAttribute('id', 'printPdf' + date) |
|
|
|
ifr.setAttribute('name', 'printPdf' + date) |
|
|
|
ifr.src = window.URL.createObjectURL(blob) |
|
|
|
document.body.appendChild(ifr) |
|
|
|
this.doPrint('printPdf' + date) |
|
|
|
window.URL.revokeObjectURL(ifr.src) // 释放URL 对象 |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |
|
|
@ -838,5 +1383,9 @@ export default { |
|
|
|
margin-bottom: 20px ; |
|
|
|
width: 95%; |
|
|
|
} |
|
|
|
.label1{ |
|
|
|
margin-left: 5px; |
|
|
|
margin-right: 5px; |
|
|
|
} |
|
|
|
</style> |
|
|
|
|
|
|
|