| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190 |
- export const actions = {
- // 全局服务初始化
- nuxtServerInit (store, {isDev, req}) {
- // 检查设备类型
- const userAgent = process.server ? req.headers['user-agent'] : navigator.userAgent
- const isMobile = /(iPhone|iPod|Opera Mini|Android.*Mobile|NetFront|PSP|BlackBerry|Windows Phone)/ig.test(userAgent)
- const cookie = process.server ? req.headers['cookie'] : null
- store.commit('option/SET_MOBILE_LAYOUT', isMobile)
- store.commit('option/SET_USER_AGENT', userAgent)
- store.commit('option/SET_COOKIES', cookie)
- // 设置跳转的URL
- if (!isDev) {
- store.commit('option/UPDATE_URL', 'http://127.0.0.1:8888')
- }
- return Promise.all([
- // 全局数据
- store.dispatch('loadUserInfo'),
- store.dispatch('loadExchangeInfoAll')
- ])
- },
- // 获取用户信息
- loadUserInfo ({ commit }) {
- return this.$http.get('/user/authentication')
- .then(response => {
- commit('option/REQUEST_USER_INFO_SUCCESS', response.data)
- // state.option.sessionId = response.data.content.sessionId
- }, err => {
- commit('option/REQUEST_USER_INFO_FAILURE', err)
- })
- },
- // 获取深圳交货方式
- loadDelivery ({commit}, params = {}) {
- return this.$http.get('/facilitator/deliveryType/enuu/delivery', {params})
- .then(response => {
- commit('delivery/REQUEST_SHENZHEN_SUCCESS', response.data)
- }, err =>{
- console.log(err)
- })
- },
- // 获取香港交货方式
- loadStock ({commit}, params = {}) {
- return this.$http.get('/facilitator/deliveryType/enuu/delivery', {params})
- .then(response => {
- commit('delivery/REQUEST_HONGKONG_FAILURE', response.data)
- }, err => {
- console.log(err)
- })
- },
- // 获取客户所有委托单信息
- loadClientSheetInfo ({commit}, params = {}) {
- return this.$http.get('/CommissionSheet/client/page', {params})
- .then(response => {
- commit('clientSheet/REQUEST_LIST_SUCCESS', response.data)
- }, err => {
- console.log(err)
- })
- },
- // 单个获取(委、受)托单信息
- loadSheetDetails ({commit}, params = {}) {
- return this.$http.get('/CommissionSheet/id', {params})
- .then(response => {
- commit('clientSheet/REQUEST_DETAILS_SUCCESS', response.data)
- commit('severSheet/REQUEST_DETAILS_SUCCESS', response.data)
- if (response.data) {
- return this.$http.get('/facilitator/deliveryType/enuu/delivery', {params: {type: 'importdelivery', enuu: response.data.content.baileeCompanyenuu}})
- .then(response => {
- commit('delivery/REQUEST_SHENZHEN_SUCCESS', response.data)
- }, err =>{
- console.log(err)
- }),
- this.$http.get('/facilitator/deliveryType/enuu/delivery', {params: {type: 'importstock', enuu: response.data.content.baileeCompanyenuu}})
- .then(response => {
- commit('delivery/REQUEST_HONGKONG_FAILURE', response.data)
- }, err => {
- console.log(err)
- })
- }
- }, err => {
- console.log(err)
- })
- },
- // 获取客户所有受托单信息
- loadSeverSheetInfo ({commit}, params = {}) {
- return this.$http.get('/CommissionSheet/facilitator/page', {params})
- .then(response => {
- commit('severSheet/REQUEST_LIST_SUCCESS', response.data)
- }, err => {
- console.log(err)
- })
- },
- // 获取客户申报要素信息
- loadDeclarationElementsInfo ({commit}, params = {}) {
- return this.$http.get('/facilitator/declarationElements/page', {params})
- .then(response => {
- commit('declarationElements/REQUEST_LIST_SUCCESS', response.data)
- }, err => {
- console.log(err)
- })
- },
- // 单个获取申报要素信息
- loadDeclarationElementsDetails ({commit}, params = {}) {
- return this.$http.get('/facilitator/declarationElements/id', {params})
- .then(response => {
- commit('declarationElements/REQUEST_DETAILS_SUCCESS', response.data)
- }, err => {
- console.log(err)
- })
- },
- // 获取关务汇总单信息
- loadCustomsInfo ({commit}, params = {}) {
- return this.$http.get('/facilitator/customerHouseServiceSheet/page', {params})
- .then(response => {
- commit('customerHouse/REQUEST_LIST_SUCCESS', response.data)
- }, err => {
- console.log(err)
- })
- },
- // 获取所有汇率信息
- loadExchangeInfoAll ({commit}) {
- return this.$http.get('/facilitator/exchangeRate/all')
- .then(response => {
- commit('exchange/REQUEST_ALL_SUCCESS', response.data)
- }, err => {
- console.log(err)
- })
- },
- // 分页获取客户资料
- loadexchangeInfo ({commit}, params = {}) {
- return this.$http.get('/facilitator/exchangeRate/page', {params})
- .then(response => {
- commit('exchange/REQUEST_LIST_SUCCESS', response.data)
- }, err => {
- console.log(err)
- })
- },
- // 分页获取外汇账号的信息
- loadremittanceInfo ({commit}, params = {}) {
- return this.$http.get('/customer/remittanceAccount/page', {params})
- .then(response => {
- commit('payment/REQUEST_LIST_SUCCESS', response.data)
- }, err => {
- console.log(err)
- })
- },
- // 获取货币种类
- loadexchangeCurrencyList ({commit}, params = {}) {
- return this.$http.get('/common/currencyList/all', {params})
- .then(response => {
- commit('exchange/REQUEST_CURRENCYLIST_SUCCESS', response.data)
- }, err => {
- console.log(err)
- })
- },
- // 获取服务商客户资料模块客户分页
- loadcustomerInfo ({commit}, params = {}) {
- return this.$http.get('/customer/page', {params})
- .then(response => {
- commit('customer/REQUEST_LIST_SUCCESS', response.data)
- }, err => {
- console.log(err)
- })
- },
- // 获取服务商客户资料模块客户单个数据
- getOnceCusinfo ({commit}, params = {}) {
- return this.$http.get('/customer/id', {params})
- .then(response => {
- commit('customer/REQUEST_DETAILS_SUCCESS', response.data)
- }, err => {
- console.log(err)
- })
- },
- // 关务部验证获取信息
- getguanwuinfo ({commit}, params = {}) {
- return this.$http.get('/CommissionSheet/customerhouseValid/ids', {params})
- .then(response => {
- commit('severSheet/REQUEST_TRUSTEELIST_SUCCESS', response.data)
- }, err => {
- console.log(err)
- })
- },
- }
|