|
@@ -9,8 +9,12 @@
|
|
</template>
|
|
</template>
|
|
<!-- 操作区,位于 title 行的行尾 -->
|
|
<!-- 操作区,位于 title 行的行尾 -->
|
|
<template slot="extra">
|
|
<template slot="extra">
|
|
- <a-button key="2" id="bulkWarehousingOrderEdit-preview-btn">打印预览</a-button>
|
|
|
|
- <a-button key="1" type="primary" id="bulkWarehousingOrderEdit-print-btn">快速打印</a-button>
|
|
|
|
|
|
+ <a-radio-group key="3" v-model="printerType">
|
|
|
|
+ <a-radio value="INK">针式</a-radio>
|
|
|
|
+ <a-radio value="NEEDLE">喷墨</a-radio>
|
|
|
|
+ </a-radio-group>
|
|
|
|
+ <a-button key="2" id="bulkWarehousingOrderEdit-preview-btn" :disabled="chooseLoadData.length==0" @click="handlePrint('preview')">打印预览</a-button>
|
|
|
|
+ <a-button key="1" type="primary" id="bulkWarehousingOrderEdit-print-btn" :disabled="chooseLoadData.length==0" @click="handlePrint('print')">快捷打印</a-button>
|
|
</template>
|
|
</template>
|
|
</a-page-header>
|
|
</a-page-header>
|
|
<!-- 基础信息 -->
|
|
<!-- 基础信息 -->
|
|
@@ -224,6 +228,8 @@
|
|
</a-affix>
|
|
</a-affix>
|
|
<!-- 选择基本信息弹框 -->
|
|
<!-- 选择基本信息弹框 -->
|
|
<basic-info-modal :openModal="openModal" @ok="handleOk" @close="openModal=false" />
|
|
<basic-info-modal :openModal="openModal" @ok="handleOk" @close="openModal=false" />
|
|
|
|
+ <!-- 打印 -->
|
|
|
|
+ <div id="print"></div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -233,7 +239,7 @@ import basicInfoModal from './basicInfoModal.vue'
|
|
import { getOperationalPrecision } from '@/libs/tools.js'
|
|
import { getOperationalPrecision } from '@/libs/tools.js'
|
|
import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
|
|
import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
|
|
import { dealerProductTypeList } from '@/api/dealerProductType'
|
|
import { dealerProductTypeList } from '@/api/dealerProductType'
|
|
-import { sparePartsPurDetail, sparePartsPurDetailList, sparePartsPurDetailCount, sparePartsPurDetailSave, sparePartsPurDetailDel, sparePartsPurSubmit } from '@/api/sparePartsPur'
|
|
|
|
|
|
+import { sparePartsPurDetail, sparePartsPurDetailList, sparePartsPurDetailCount, sparePartsPurDetailSave, sparePartsPurDetailDel, sparePartsPurSubmit, sparePartsPurDetailPrint } from '@/api/sparePartsPur'
|
|
import { dealerProductList } from '@/api/dealerProduct'
|
|
import { dealerProductList } from '@/api/dealerProduct'
|
|
import { warehouseCascadeList } from '@/api/warehouse'
|
|
import { warehouseCascadeList } from '@/api/warehouse'
|
|
export default {
|
|
export default {
|
|
@@ -306,7 +312,8 @@ export default {
|
|
chooseWarehouseList: [], // 已选产品 仓库 下拉数据
|
|
chooseWarehouseList: [], // 已选产品 仓库 下拉数据
|
|
chooseWarehouseLocList: {}, // 已选产品 仓位 下拉数据
|
|
chooseWarehouseLocList: {}, // 已选产品 仓位 下拉数据
|
|
basicInfoData: null, // 基本信息
|
|
basicInfoData: null, // 基本信息
|
|
- productTotal: null // 合计
|
|
|
|
|
|
+ productTotal: null, // 合计
|
|
|
|
+ printerType: 'INK' // 打印机类型
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -324,6 +331,38 @@ export default {
|
|
this.paginationProps.current = 1
|
|
this.paginationProps.current = 1
|
|
this.getDealerProductList(1)
|
|
this.getDealerProductList(1)
|
|
},
|
|
},
|
|
|
|
+ // 打印预览/快捷打印
|
|
|
|
+ handlePrint (type) {
|
|
|
|
+ const _this = this
|
|
|
|
+ sparePartsPurDetailPrint({ sn: this.$route.params.sn, type: this.printerType }).then(res => {
|
|
|
|
+ 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 {
|
|
|
|
+ this.print(res, type)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ print (data, type) {
|
|
|
|
+ if (!data) {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ const url = window.URL.createObjectURL(new Blob([data], { type: 'application/pdf' }))
|
|
|
|
+ document.getElementById('print').innerHTML = '<iframe id="printf" name="printf" src="' + url + '" hidden></iframe>'
|
|
|
|
+ if (type == 'preview') { // 预览
|
|
|
|
+ window.open(url)
|
|
|
|
+ } else if (type == 'print') { // 打印
|
|
|
|
+ window.frames['printf'].focus()
|
|
|
|
+ window.frames['printf'].print()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
// 双击快速添加
|
|
// 双击快速添加
|
|
handleClickRow (record) {
|
|
handleClickRow (record) {
|
|
return {
|
|
return {
|