修改订舱下拉数据
parent
4bdf467a82
commit
d262a7bc57
@ -0,0 +1,171 @@
|
||||
// import Vue from 'vue'
|
||||
// import store from '../index' // 后期需要放开
|
||||
// import router from '../../router'
|
||||
import {
|
||||
GetCarrierlist,
|
||||
GetYardlist,
|
||||
GetPackage,
|
||||
Codeissuetypelist,
|
||||
GetFrt,
|
||||
GetCtn
|
||||
} from '@/api/modular/main/BookingLedger'
|
||||
|
||||
const booking = {
|
||||
state: {
|
||||
// 订舱公共数据 - 下拉列表
|
||||
carrierList: [],
|
||||
yardList: [],
|
||||
packageList: [],
|
||||
issuetypeList: [],
|
||||
blfrtList: [],
|
||||
ctnallList: []
|
||||
// 订舱公共数据 - 模糊搜索,默认获取前十条 (需要后台提供公共接口)
|
||||
},
|
||||
|
||||
mutations: {
|
||||
SET_CARRIERLIST: (state, list) => {
|
||||
state.carrierList = list
|
||||
},
|
||||
SET_YARDLIST: (state, list) => {
|
||||
state.yardList = list
|
||||
},
|
||||
SET_PACKAGELIST: (state, list) => {
|
||||
state.packageList = list
|
||||
},
|
||||
SET_ISSUETYPELIST: (state, list) => {
|
||||
state.issuetypeList = list
|
||||
},
|
||||
SET_BLFRTLIST: (state, list) => {
|
||||
state.blfrtList = list
|
||||
},
|
||||
SET_CTNALLLIST: (state, list) => {
|
||||
state.ctnallList = list
|
||||
}
|
||||
},
|
||||
|
||||
actions: {
|
||||
// 设置船公司列表
|
||||
setCarrierList({ commit }, obj) {
|
||||
return new Promise(resolve => {
|
||||
GetCarrierlist({
|
||||
keyword: '',
|
||||
type: 'consignor'
|
||||
}).then(response => {
|
||||
if (response.success) {
|
||||
const data = response.data
|
||||
commit('SET_CARRIERLIST', data)
|
||||
resolve(response.data)
|
||||
} else {
|
||||
// eslint-disable-next-line no-undef
|
||||
reject(new Error(data.message))
|
||||
}
|
||||
}).catch(error => {
|
||||
// eslint-disable-next-line no-undef
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
},
|
||||
// 设置场站列表
|
||||
setYardList({ commit }, obj) {
|
||||
return new Promise(resolve => {
|
||||
GetYardlist({
|
||||
keyword: ''
|
||||
}).then(response => {
|
||||
if (response.success) {
|
||||
const data = response.data
|
||||
commit('SET_YARDLIST', data)
|
||||
resolve(response.data)
|
||||
} else {
|
||||
// eslint-disable-next-line no-undef
|
||||
reject(new Error(data.message))
|
||||
}
|
||||
}).catch(error => {
|
||||
// eslint-disable-next-line no-undef
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
},
|
||||
// 设置包装列表
|
||||
setPackageList({ commit }, obj) {
|
||||
return new Promise(resolve => {
|
||||
GetPackage({
|
||||
keyword: ''
|
||||
}).then(response => {
|
||||
if (response.success) {
|
||||
const data = response.data
|
||||
commit('SET_PACKAGELIST', data)
|
||||
resolve(response.data)
|
||||
} else {
|
||||
// eslint-disable-next-line no-undef
|
||||
reject(new Error(data.message))
|
||||
}
|
||||
}).catch(error => {
|
||||
// eslint-disable-next-line no-undef
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
},
|
||||
// 设置签单方式列表
|
||||
setIssuetypeList({ commit }, obj) {
|
||||
return new Promise(resolve => {
|
||||
Codeissuetypelist({
|
||||
keyword: ''
|
||||
}).then(response => {
|
||||
if (response.success) {
|
||||
const data = response.data
|
||||
commit('SET_ISSUETYPELIST', data)
|
||||
resolve(response.data)
|
||||
} else {
|
||||
// eslint-disable-next-line no-undef
|
||||
reject(new Error(data.message))
|
||||
}
|
||||
}).catch(error => {
|
||||
// eslint-disable-next-line no-undef
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
},
|
||||
// 设置付费方式列表
|
||||
setBlfrtList({ commit }, obj) {
|
||||
return new Promise(resolve => {
|
||||
GetFrt({
|
||||
keyword: ''
|
||||
}).then(response => {
|
||||
if (response.success) {
|
||||
const data = response.data
|
||||
commit('SET_BLFRTLIST', data)
|
||||
resolve(response.data)
|
||||
} else {
|
||||
// eslint-disable-next-line no-undef
|
||||
reject(new Error(data.message))
|
||||
}
|
||||
}).catch(error => {
|
||||
// eslint-disable-next-line no-undef
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
},
|
||||
// 设置箱型列表
|
||||
setCtnallList({ commit }, obj) {
|
||||
return new Promise(resolve => {
|
||||
GetCtn({
|
||||
keyword: ''
|
||||
}).then(response => {
|
||||
if (response.success) {
|
||||
const data = response.data
|
||||
commit('SET_CTNALLLIST', data)
|
||||
resolve(response.data)
|
||||
} else {
|
||||
// eslint-disable-next-line no-undef
|
||||
reject(new Error(data.message))
|
||||
}
|
||||
}).catch(error => {
|
||||
// eslint-disable-next-line no-undef
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default booking
|
Loading…
Reference in New Issue