|
@@ -10,12 +10,7 @@
|
|
|
</template>
|
|
|
<!-- 操作区,位于 title 行的行尾 -->
|
|
|
<template slot="extra" v-if="$hasPermissions('B_bulkWarehousingOrder_print')">
|
|
|
- <a-radio-group key="3" v-model="printerType">
|
|
|
- <a-radio value="NEEDLE">针式</a-radio>
|
|
|
- <a-radio value="INK">喷墨</a-radio>
|
|
|
- </a-radio-group>
|
|
|
- <a-button key="2" id="bulkWarehousingOrderEdit-preview-btn" :disabled="chooseLoadDataSource.length==0" @click="handlePrint('preview')">打印预览</a-button>
|
|
|
- <a-button key="1" type="primary" id="bulkWarehousingOrderEdit-print-btn" :disabled="chooseLoadDataSource.length==0" @click="handlePrint('print')">快捷打印</a-button>
|
|
|
+ <Print :disabled="chooseLoadDataSource.length==0" :showExport="false" @handlePrint="handlePrint"></Print>
|
|
|
</template>
|
|
|
</a-page-header>
|
|
|
<!-- 基础信息 -->
|
|
@@ -24,7 +19,6 @@
|
|
|
<a-collapse-panel key="1">
|
|
|
<template slot="header">
|
|
|
基础信息
|
|
|
- <!-- <a-button type="primary" shape="circle" size="small" icon="edit" class="edit-circle-btn" id="bulkWarehousingOrderEdit-edit-circle-btn" @click.stop="handleEditInfo" /> -->
|
|
|
</template>
|
|
|
<a-descriptions :column="3">
|
|
|
<a-descriptions-item label="供应商">{{ (basicInfoData&&basicInfoData.supplierName) || '--' }}</a-descriptions-item>
|
|
@@ -152,7 +146,6 @@
|
|
|
<a-collapse-panel key="1">
|
|
|
<template slot="header">
|
|
|
已选产品
|
|
|
- <!-- <a-button size="small" class="import-btn" id="bulkWarehousingOrderEdit-import-btn" @click.stop="handleImport">导入明细</a-button> -->
|
|
|
</template>
|
|
|
<!-- 已选产品 -->
|
|
|
<div>
|
|
@@ -237,8 +230,6 @@
|
|
|
</div>
|
|
|
<!-- 选择基本信息弹框 -->
|
|
|
<basic-info-modal :openModal="openModal" @ok="handleOk" @close="openModal=false" />
|
|
|
- <!-- 打印 -->
|
|
|
- <div id="print"></div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -251,8 +242,10 @@ import { dealerProductTypeList } from '@/api/dealerProductType'
|
|
|
import { sparePartsPurDetail, sparePartsPurDetailList, sparePartsPurDetailCount, sparePartsPurDetailSave, sparePartsPurDetailDel, sparePartsPurSubmit, sparePartsPurDetailPrint } from '@/api/sparePartsPur'
|
|
|
import { dealerProductList } from '@/api/dealerProduct'
|
|
|
import { warehouseCascadeList } from '@/api/warehouse'
|
|
|
+import Print from '@/views/common/print.vue'
|
|
|
+import { hdPrint } from '@/libs/JGPrint'
|
|
|
export default {
|
|
|
- components: { STable, VSelect, basicInfoModal },
|
|
|
+ components: { STable, VSelect, basicInfoModal, Print },
|
|
|
data () {
|
|
|
return {
|
|
|
spinning: false,
|
|
@@ -366,8 +359,7 @@ export default {
|
|
|
chooseWarehouseList: [], // 已选产品 仓库 下拉数据
|
|
|
chooseWarehouseLocList: {}, // 已选产品 仓位 下拉数据
|
|
|
basicInfoData: null, // 基本信息
|
|
|
- productTotal: null, // 合计
|
|
|
- printerType: 'NEEDLE' // 打印机类型
|
|
|
+ productTotal: null // 合计
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -382,39 +374,16 @@ export default {
|
|
|
this.$refs.table.refresh(true)
|
|
|
},
|
|
|
// 打印预览/快捷打印
|
|
|
- handlePrint (type) {
|
|
|
+ handlePrint (type, printerType) {
|
|
|
const _this = this
|
|
|
_this.spinning = true
|
|
|
- sparePartsPurDetailPrint({ sn: this.$route.params.sn, type: this.printerType }).then(res => {
|
|
|
+ const url = sparePartsPurDetailPrint
|
|
|
+ const params = { sn: this.$route.params.sn, type: printerType }
|
|
|
+ // 打印或导出
|
|
|
+ hdPrint(printerType, type, url, params, '', function () {
|
|
|
_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 {
|
|
|
- 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="printfbwoe" name="printfbwoe" src="' + url + '" hidden></iframe>'
|
|
|
- if (type == 'preview') { // 预览
|
|
|
- window.open(url)
|
|
|
- } else if (type == 'print') { // 打印
|
|
|
- window.frames['printfbwoe'].focus()
|
|
|
- window.frames['printfbwoe'].print()
|
|
|
- }
|
|
|
- },
|
|
|
// 双击快速添加
|
|
|
handleClickRow (record) {
|
|
|
return {
|