| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <template>
- <div>
- <!-- 该组件用于加载一些全局数据,在布局组件 AppMain.vue 中加载,放在根路径是为了便于查找 -->
- </div>
- </template>
- <script>
- import { getIp } from '@/utils'
- import { getTicketPrintModelList, getReceiptPrintModel } from '@/api/printModal'
- import whitePaper from '@/pages/systemSetting/printManage/vertical'
- import defaultSmallTicket from '@/pages/systemSetting/smallTicket/defaultTemp'
- export default {
- created () {
- getIp()
- // 获取打印模板
- this.getReceiptPrintModel()
- this.getTicketPrintModelList()
- this.$store.dispatch('setTravelAgencyType')
- // 获取所有票种列表
- this.$store.dispatch('getTicketTypeList')
- this.$store.dispatch('setCustomerType')
- // 设置全局 支付方式
- this.$store.dispatch('getPayChannel')
- // 获取票种分类
- this.$store.dispatch('getTicketCategory')
- // 获取售票员列表
- this.$store.dispatch('getSalesList')
- // getMyAccount
- this.$store.dispatch('getMyAccount')
- // 获取销售渠道
- this.$store.dispatch('getSaleChannel')
- this.$store.dispatch('getSystemConfigList')
- // 获取旅行社列表
- this.$store.dispatch('getAgencyList')
- // 获取景点列表
- this.$store.dispatch('getScenicList')
- // 获取账号信息
- this.$store.dispatch('getAccount')
- // 获取场次信息
- this.$store.dispatch('getBatchConfigList')
- },
- methods: {
- // 提前设置打印模板
- getTicketPrintModelList () {
- getTicketPrintModelList().then(res => {
- let id = this.$localStore.get('defaultTemplate')
- let target = res.list.find(i => i.id === id)
- // 设置当前打印模板
- this.$store.commit('SET_PRINT_TEMPLATE', target ? JSON.parse(target.content) : whitePaper)
- // 设置打印模板列表
- res.list.length > 0 && this.$store.commit('SET_PRINT_TEMPLATE_LIST', res.list)
- })
- },
- getReceiptPrintModel () {
- getReceiptPrintModel().then(res => {
- let id = this.$localStore.get('defaultSmallTicketTemplate')
- let target = res.list.find(i => i.id === id)
- // 设置当前打印模板
- target && this.$store.commit('SET_SMALL_TICKET_TEMPLATE', target ? JSON.parse(target.content) : defaultSmallTicket)
- // 设置打印模板列表
- res.list.length > 0 && this.$store.commit('SET_SMALL_TICKET_TEMPLATE_LIST', res.list)
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- </style>
|