|
|
@@ -100,6 +100,15 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
printPaper(){
|
|
|
+ if(this.info.printNum>=1){
|
|
|
+ this.$confirm('已打过,确认要补打?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => {
|
|
|
+ this.toPrint()
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.toPrint()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ toPrint(){
|
|
|
this.$service.purchaseOrder.printPaper({ id: this.id }).then(res => {
|
|
|
let printData = res.printData ? res.printData : ''
|
|
|
let str = res.template ? res.template : ''
|
|
|
@@ -107,12 +116,23 @@ export default {
|
|
|
hiprint.init();
|
|
|
var hiprintTemplate = new hiprint.PrintTemplate({template:template});
|
|
|
hiprintTemplate.print(printData)
|
|
|
+ this.info.printNum++
|
|
|
})
|
|
|
},
|
|
|
printOrder(){
|
|
|
- this.$service.purchaseOrder.printBill({id:this.id}).then(data => {
|
|
|
- this.$notify({ title: '已打印', message: '操作成功', type: 'success'})
|
|
|
- })
|
|
|
+ if(this.info.printNum>=1){
|
|
|
+ this.$confirm('已打过,确认要补打?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => {
|
|
|
+ this.$service.purchaseOrder.printBill({id:this.id}).then(data => {
|
|
|
+ this.info.printNum++
|
|
|
+ this.$notify({ title: '已打印', message: '操作成功', type: 'success'})
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.$service.purchaseOrder.printBill({id:this.id}).then(data => {
|
|
|
+ this.info.printNum++
|
|
|
+ this.$notify({ title: '已打印', message: '操作成功', type: 'success'})
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
confirmIn(){
|
|
|
let that = this
|