|
@@ -202,7 +202,7 @@ import { commonMixin } from '@/utils/mixin'
|
|
import { STable, VSelect } from '@/components'
|
|
import { STable, VSelect } from '@/components'
|
|
import ProductType from '@/views/common/productType.js'
|
|
import ProductType from '@/views/common/productType.js'
|
|
import printModal from './printModal.vue'
|
|
import printModal from './printModal.vue'
|
|
-import { downloadExcel } from '@/libs/JGPrint.js'
|
|
|
|
|
|
+import { hdPrint } from '@/libs/JGPrint.js'
|
|
import { checkWarehouseDetailList, checkWarehouseDetailCount, checkWarehouseInventory, checkWarehouseDetail, checkWarehouseDetailSave, checkWarehouseCheckZero, checkWarehouseWarehouse, checkWarehouseDetailExport, checkWarehouseDetailPrint } from '@/api/checkWarehouse'
|
|
import { checkWarehouseDetailList, checkWarehouseDetailCount, checkWarehouseInventory, checkWarehouseDetail, checkWarehouseDetailSave, checkWarehouseCheckZero, checkWarehouseWarehouse, checkWarehouseDetailExport, checkWarehouseDetailPrint } from '@/api/checkWarehouse'
|
|
export default {
|
|
export default {
|
|
name: 'MakeInventory',
|
|
name: 'MakeInventory',
|
|
@@ -422,50 +422,23 @@ export default {
|
|
},
|
|
},
|
|
handleOk (objs) {
|
|
handleOk (objs) {
|
|
const _this = this
|
|
const _this = this
|
|
- let params
|
|
|
|
|
|
+ let params, type
|
|
let url = checkWarehouseDetailPrint // 打印
|
|
let url = checkWarehouseDetailPrint // 打印
|
|
if (this.nowType == 'export') { // 导出
|
|
if (this.nowType == 'export') { // 导出
|
|
url = checkWarehouseDetailExport
|
|
url = checkWarehouseDetailExport
|
|
|
|
+ type = 'export'
|
|
params = { checkWarehouseSn: this.$route.params.sn, productScopeFlag: this.productScopeFlag }
|
|
params = { checkWarehouseSn: this.$route.params.sn, productScopeFlag: this.productScopeFlag }
|
|
} else { // 打印
|
|
} else { // 打印
|
|
params = JSON.parse(JSON.stringify(objs))
|
|
params = JSON.parse(JSON.stringify(objs))
|
|
params.printType = this.printerType
|
|
params.printType = this.printerType
|
|
|
|
+ type = params.type
|
|
delete params.type
|
|
delete params.type
|
|
}
|
|
}
|
|
_this.spinning = true
|
|
_this.spinning = true
|
|
- url(params).then(res => {
|
|
|
|
|
|
+ // 打印或导出
|
|
|
|
+ hdPrint(this.printerType, type, url, params, '库存盘点', function () {
|
|
_this.spinning = false
|
|
_this.spinning = false
|
|
- if (res.type == 'application/json') {
|
|
|
|
- var reader = new FileReader()
|
|
|
|
- reader.addEventListener('loadend', function () {
|
|
|
|
- const obj = JSON.parse(reader.result)
|
|
|
|
- _this.$notification.error({
|
|
|
|
- message: '提示',
|
|
|
|
- description: obj.message
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
- reader.readAsText(res)
|
|
|
|
- } else {
|
|
|
|
- if (this.nowType == 'export' || this.nowType == 'typeExport') {
|
|
|
|
- downloadExcel(res, '库存盘点')
|
|
|
|
- } else {
|
|
|
|
- this.print(res, objs.type)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
})
|
|
})
|
|
- },
|
|
|
|
- print (data, type) {
|
|
|
|
- if (!data) {
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- const url = window.URL.createObjectURL(new Blob([data], { type: 'application/pdf' }))
|
|
|
|
- document.getElementById('print').innerHTML = '<iframe id="printficm" name="printficm" src="' + url + '" hidden></iframe>'
|
|
|
|
- if (type == 'preview') { // 预览
|
|
|
|
- window.open(url)
|
|
|
|
- } else if (type == 'print') { // 打印
|
|
|
|
- window.frames['printficm'].focus()
|
|
|
|
- window.frames['printficm'].print()
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted () {
|
|
mounted () {
|