|
|
@@ -91,11 +91,11 @@
|
|
|
|
|
|
<el-button @click.stop="detailShowFn(scope.row)" size="small" type="success">详情</el-button>
|
|
|
|
|
|
- <el-button size="small" v-if="scope.row.status == 5 || scope.row.status == 1">打多联</el-button>
|
|
|
- <el-button @click.stop="printPaper(scope.row)" size="small" type="primary" v-else>打多联</el-button>
|
|
|
+ <el-button size="small" v-if="scope.row.status == 5 || scope.row.status == 1">打多联({{ scope.row.printNum }})</el-button>
|
|
|
+ <el-button @click.stop="printPaper(scope.row)" size="small" type="primary" v-else>打多联({{ scope.row.printNum }})</el-button>
|
|
|
|
|
|
- <el-button size="small" v-if="scope.row.status == 5 || scope.row.status == 1">打小票</el-button>
|
|
|
- <el-button @click.stop="printOrder(scope.row)" size="small" type="primary" v-else>打小票</el-button>
|
|
|
+ <el-button size="small" v-if="scope.row.status == 5 || scope.row.status == 1">打小票({{ scope.row.printNum }})</el-button>
|
|
|
+ <el-button @click.stop="printOrder(scope.row)" size="small" type="primary" v-else>打小票({{ scope.row.printNum }})</el-button>
|
|
|
|
|
|
<el-button @click.stop="cancelOrder(scope.row)" size="small" type="primary" v-if="scope.row.status == 3 || scope.row.status == 2 || scope.row.status == 1">取消</el-button>
|
|
|
<el-button size="small" v-else>取消</el-button>
|
|
|
@@ -252,19 +252,41 @@ export default {
|
|
|
this.$router.push({path:'/in/change',query})
|
|
|
},
|
|
|
printPaper(info){
|
|
|
- this.$service.purchaseOrder.printPaper({ id: info.id }).then(res => {
|
|
|
+ if(info.printNum>1){
|
|
|
+ this.$confirm('已打过,确认要补打?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => {
|
|
|
+ this.toPrint(info)
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.toPrint(info)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ toPrint(info){
|
|
|
+ this.$service.purchaseOrder.printPaper({ id: info.id }).then(res => {
|
|
|
let printData = res.printData ? res.printData : ''
|
|
|
let str = res.template ? res.template : ''
|
|
|
let template = JSON.parse(str)
|
|
|
hiprint.init();
|
|
|
var hiprintTemplate = new hiprint.PrintTemplate({template:template});
|
|
|
hiprintTemplate.print(printData)
|
|
|
- })
|
|
|
+ })
|
|
|
+ this.$service.purchaseOrder.addPrintNumFn({id:info.id}).then(data => {
|
|
|
+ info.printNum++
|
|
|
+ })
|
|
|
},
|
|
|
printOrder(item){
|
|
|
- this.$service.purchaseOrder.printBill({id:item.id}).then(data => {
|
|
|
+ if(item.printNum>1){
|
|
|
+ this.$confirm('已打过,确认要补打?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => {
|
|
|
+ this.$service.purchaseOrder.printBill({id:item.id}).then(data => {
|
|
|
+ item.printNum++
|
|
|
+ this.$notify({ title: '已打印', message: '操作成功', type: 'success'})
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.$service.purchaseOrder.printBill({id:item.id}).then(data => {
|
|
|
+ item.printNum++
|
|
|
this.$notify({ title: '已打印', message: '操作成功', type: 'success'})
|
|
|
- })
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
cancelOrder(item){
|
|
|
this.$confirm('确认取消?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => {
|
|
|
@@ -387,7 +409,7 @@ export default {
|
|
|
op: {
|
|
|
visible: true,
|
|
|
props: {
|
|
|
- width: 410,
|
|
|
+ width: 420,
|
|
|
align: 'center',
|
|
|
fixed: 'right',
|
|
|
label: '操作'
|