|
@@ -159,8 +159,6 @@
|
|
@close="visiblePrint=false"
|
|
@close="visiblePrint=false"
|
|
@ok="printOkText == '好的' ? visiblePrint=false : handlePrint('print')"
|
|
@ok="printOkText == '好的' ? visiblePrint=false : handlePrint('print')"
|
|
@fail="handlePrint('preview')" />
|
|
@fail="handlePrint('preview')" />
|
|
- <!-- 打印 -->
|
|
|
|
- <div id="print"></div>
|
|
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -169,6 +167,7 @@ import { commonMixin } from '@/utils/mixin'
|
|
import { STable, VSelect } from '@/components'
|
|
import { STable, VSelect } from '@/components'
|
|
import tablePagination from '@/views/common/tablePagination.vue'
|
|
import tablePagination from '@/views/common/tablePagination.vue'
|
|
import printModal from '@/views/common/auditModal.vue'
|
|
import printModal from '@/views/common/auditModal.vue'
|
|
|
|
+import { printFun, exportExcel } from '@/libs/JGPrint.js'
|
|
import { checkWarehouseDetail, checkWarehouseDetailList, checkWarehouseDetailCount, checkWarehouseDetailPrint, checkWarehousePrintCheck, checkWarehouseDetailSave, checkWarehouseSupervise, checkWarehouseReCheck } from '@/api/checkWarehouse'
|
|
import { checkWarehouseDetail, checkWarehouseDetailList, checkWarehouseDetailCount, checkWarehouseDetailPrint, checkWarehousePrintCheck, checkWarehouseDetailSave, checkWarehouseSupervise, checkWarehouseReCheck } from '@/api/checkWarehouse'
|
|
export default {
|
|
export default {
|
|
name: 'SupervisionDiskCheck',
|
|
name: 'SupervisionDiskCheck',
|
|
@@ -414,35 +413,8 @@ export default {
|
|
handlePrint (type) {
|
|
handlePrint (type) {
|
|
const _this = this
|
|
const _this = this
|
|
_this.spinningPrint = true
|
|
_this.spinningPrint = true
|
|
- checkWarehouseDetailPrint({ checkWarehouseSn: this.$route.params.sn, type: 'CHECK_WAREHOUSE_SUPERVISE' }).then(res => {
|
|
|
|
- _this.spinningPrint = 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="printfbod" name="printfbod" src="' + url + '" hidden></iframe>'
|
|
|
|
- if (type == 'preview') { // 预览
|
|
|
|
- window.open(url)
|
|
|
|
- } else if (type == 'print') { // 打印
|
|
|
|
- window.frames['printfbod'].focus()
|
|
|
|
- window.frames['printfbod'].print()
|
|
|
|
- }
|
|
|
|
|
|
+ const params = { checkWarehouseSn: this.$route.params.sn, type: 'CHECK_WAREHOUSE_SUPERVISE' }
|
|
|
|
+ printFun(checkWarehouseDetailPrint, params, type, '盘点单', () => { _this.spinningPrint = false })
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted () {
|
|
mounted () {
|