123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- <template>
- <div>
- <a-button
- key="1"
- type="primary"
- class="button-info"
- v-if="$hasPermissions('B_transferReturnPrint')"
- id="transferReturn-db-print-btn"
- :disabled="disabled"
- @click="handlePrint('preview')">打印预览</a-button>
- <a-button
- key="2"
- type="primary"
- class="button-info"
- v-if="$hasPermissions('B_transferReturnPrint')"
- id="transferReturn-dbfl-print-btn"
- :disabled="disabled"
- @click="handlePrint('print')">快捷打印</a-button>
- <a-divider type="vertical" />
- <a-button
- key="3"
- type="default"
- class="button-warning"
- v-if="$hasPermissions('B_transferReturnExport')"
- id="transferReturn-export-btn"
- :disabled="disabled"
- @click="handleExcel">导出Excel</a-button>
- <!-- 打印导出 -->
- <print-modal :openModal="openModal" :itemData="basicInfoData" :nowType="nowType" @ok="handleOk" @close="openModal=false" />
- <!-- 打印 -->
- <div id="print"></div>
- </div>
- </template>
- <script>
- import { printFun, exportExcel } from '@/libs/JGPrint.js'
- // 组件
- import printModal from './printModal.vue'
- // 接口
- import { allocateReturnExcel, allocateReturnPrint } from '@/api/allocateReturn'
- export default {
- components: { printModal },
- props: {
- params: {
- type: Object,
- default: function () {
- return {}
- }
- },
- basicInfoData: {
- type: Object,
- default: function () {
- return {}
- }
- },
- disabled: {
- type: Boolean,
- default: false
- }
- },
- data () {
- return {
- openModal: false, // 打开打印导出
- nowType: null// 打印类型
- }
- },
- methods: {
- // 打印预览/快捷打印
- handlePrint (type) {
- this.nowType = type
- this.openModal = true
- },
- // 打印导出
- handleOk (obj) {
- const _this = this
- const params = {
- allocateReturnSn: obj.allocateReturnSn || '',
- printType: obj.printType
- }
- // 打印货位编号
- if (obj.orderBy) {
- params.orderBy = obj.orderBy
- }
- _this.$emit('loading')
- printFun(allocateReturnPrint, params, obj.isPreview, '调拨退货单', () => {
- _this.$emit('unloading')
- _this.$store.state.app.curActionPermission = ''
- })
- },
- // 导出
- handleExcel () {
- const _this = this
- _this.$emit('loading')
- const params = { allocateReturnSn: this.params.allocateReturnSn || '' }
- _this.$store.state.app.curActionPermission = 'B_transferReturnExport'
- exportExcel(allocateReturnExcel, params, '调拨退货单明细', function () {
- _this.$emit('unloading')
- _this.$store.state.app.curActionPermission = ''
- })
- }
- }
- }
- </script>
- <style>
- </style>
|