|
@@ -40,7 +40,7 @@ export default {
|
|
type: Function,
|
|
type: Function,
|
|
default: null
|
|
default: null
|
|
},
|
|
},
|
|
- getNewDetailPrintDisString: {
|
|
|
|
|
|
+ getOvalDateil: {
|
|
type: Function,
|
|
type: Function,
|
|
default: null
|
|
default: null
|
|
}
|
|
}
|
|
@@ -57,7 +57,8 @@ export default {
|
|
hiprintTemplate: {},
|
|
hiprintTemplate: {},
|
|
// 数据
|
|
// 数据
|
|
printData: {},
|
|
printData: {},
|
|
- loading: true
|
|
|
|
|
|
+ loading: true,
|
|
|
|
+ flag: false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {},
|
|
computed: {},
|
|
@@ -72,6 +73,8 @@ export default {
|
|
this.visible = false
|
|
this.visible = false
|
|
this.waitShowPrinter = false
|
|
this.waitShowPrinter = false
|
|
this.$emit('initPrint')
|
|
this.$emit('initPrint')
|
|
|
|
+ this.$emit('refreshTableSelection')
|
|
|
|
+ this.$emit('refreshList')
|
|
// console.log(this.$parent);
|
|
// console.log(this.$parent);
|
|
},
|
|
},
|
|
show(hiprintTemplate, printData, width = '210') {
|
|
show(hiprintTemplate, printData, width = '210') {
|
|
@@ -88,51 +91,68 @@ export default {
|
|
},
|
|
},
|
|
async print() {
|
|
async print() {
|
|
if (this.getNewDetailPrintDisString) {
|
|
if (this.getNewDetailPrintDisString) {
|
|
- const { data } = await this.getNewDetailPrintDisString()
|
|
|
|
- if (data) {
|
|
|
|
- try {
|
|
|
|
- if (typeof this.addPrint === 'function') {
|
|
|
|
- this.addPrint('getDtailPrintDis')
|
|
|
|
- .then(res => {
|
|
|
|
- this.hiprintTemplate.print(
|
|
|
|
- this.printData,
|
|
|
|
- {},
|
|
|
|
- {
|
|
|
|
- callback: async() => {
|
|
|
|
- this.hiprintTemplate = {}
|
|
|
|
- setTimeout(() => {
|
|
|
|
- this.hideModal()
|
|
|
|
- this.$emit('refreshList')
|
|
|
|
- }, 1000)
|
|
|
|
|
|
+ try {
|
|
|
|
+ const { data } = await this.getNewDetailPrintDisString()
|
|
|
|
+
|
|
|
|
+ if (!data || this.flag) {
|
|
|
|
+ try {
|
|
|
|
+ if (typeof this.addPrint === 'function') {
|
|
|
|
+ this.addPrint('getDtailPrintDis')
|
|
|
|
+ .then(res => {
|
|
|
|
+ this.hiprintTemplate.print(
|
|
|
|
+ this.printData,
|
|
|
|
+ {},
|
|
|
|
+ {
|
|
|
|
+ callback: async() => {
|
|
|
|
+ this.hiprintTemplate = {}
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ this.flag = false
|
|
|
|
+ this.hideModal()
|
|
|
|
+ this.$emit('refreshTableSelection')
|
|
|
|
+ this.$emit('refreshList')
|
|
|
|
+ }, 1000)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- }
|
|
|
|
- )
|
|
|
|
- })
|
|
|
|
- .catch(err => {
|
|
|
|
- this.myConfirm(err)
|
|
|
|
- })
|
|
|
|
- } else {
|
|
|
|
- console.log(333)
|
|
|
|
- // throw new Error('加载失败,刷新重试')
|
|
|
|
|
|
+ )
|
|
|
|
+ })
|
|
|
|
+ .catch(err => {
|
|
|
|
+ this.myConfirm(err)
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ console.log(333)
|
|
|
|
+ // throw new Error('加载失败,刷新重试')
|
|
|
|
+ }
|
|
|
|
+ } catch (e) {
|
|
|
|
+ this.$errorMsg(e)
|
|
|
|
+ // '调用打印次数接口失败'
|
|
}
|
|
}
|
|
- } catch (e) {
|
|
|
|
- this.$errorMsg(e)
|
|
|
|
- // '调用打印次数接口失败'
|
|
|
|
|
|
+ } else {
|
|
|
|
+ this.$confirm(data, '提示', {
|
|
|
|
+ showClose: false,
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ showCancelButton: false,
|
|
|
|
+ type: 'warning',
|
|
|
|
+ center: true
|
|
|
|
+ }).then(() => {
|
|
|
|
+ this.getOvalDateil()
|
|
|
|
+ this.flag = true
|
|
|
|
+ })
|
|
}
|
|
}
|
|
- } else {
|
|
|
|
|
|
+ } catch (error) {
|
|
this.myConfirm()
|
|
this.myConfirm()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
myConfirm(err) {
|
|
myConfirm(err) {
|
|
this.$confirm(err || '系统提示:单被商家取消预约,请刷新页面,重新选择打印', '提示', {
|
|
this.$confirm(err || '系统提示:单被商家取消预约,请刷新页面,重新选择打印', '提示', {
|
|
-
|
|
|
|
|
|
+ showClose: false,
|
|
confirmButtonText: '确定',
|
|
confirmButtonText: '确定',
|
|
showCancelButton: false,
|
|
showCancelButton: false,
|
|
type: 'warning',
|
|
type: 'warning',
|
|
center: true
|
|
center: true
|
|
}).then(() => {
|
|
}).then(() => {
|
|
this.hideModal()
|
|
this.hideModal()
|
|
|
|
+ this.$emit('refreshTableSelection')
|
|
this.$emit('refreshList')
|
|
this.$emit('refreshList')
|
|
})
|
|
})
|
|
}
|
|
}
|