修改订舱下拉数据

szh_zidingyibiaoti
lilu 2 years ago
parent 4bdf467a82
commit d262a7bc57

@ -61,7 +61,7 @@
<script>
import { triggerWindowResizeEvent } from '@/utils/util'
import { mapState, mapActions } from 'vuex'
import { mapState, mapActions, mapGetters } from 'vuex'
import { mixin, mixinDevice } from '@/utils/mixin'
import RouteView from './RouteView'
import SideMenu from '@/components/Menu/SideMenu'
@ -98,8 +98,8 @@ export default {
}
return '80px'
},
placeholderDivMinWidth(){
let width = this.collapsed?"80px":"230px";
placeholderDivMinWidth() {
let width = this.collapsed ? '80px' : '230px';
return width;
}
},
@ -128,9 +128,11 @@ export default {
}, 16)
})
}
console.log('== 1111进入页面 == ,这里添加获取订舱下拉数据 ')
this.setBookingInfo()
},
methods: {
...mapActions(['setSidebar']),
...mapActions(['setSidebar', 'setCarrierList', 'setYardList', 'setPackageList', 'setIssuetypeList', 'setBlfrtList', 'setCtnallList']),
//
setMenus () {
const routes = convertRoutes(this.mainMenu.find(item => item.path === '/'))
@ -154,6 +156,14 @@ export default {
},
drawerClose () {
this.collapsed = false
},
setBookingInfo () {
this.setCarrierList()
this.setYardList()
this.setPackageList()
this.setIssuetypeList()
this.setBlfrtList()
this.setCtnallList()
}
}
}

@ -19,7 +19,13 @@ const getters = {
bookingList: state => state.user.bookingList,
bookingGridOptions: state => state.user.bookingGridOptions,
needSavePages: state => state.user.needSavePages,
hasbookingDetail: state => state.user.hasbookingDetail
hasbookingDetail: state => state.user.hasbookingDetail,
carrierList: state => state.booking.carrierList,
yardList: state => state.booking.yardList,
packageList: state => state.booking.packageList,
issuetypeList: state => state.booking.issuetypeList,
blfrtList: state => state.booking.blfrtList,
ctnallList: state => state.booking.ctnallList
}
export default getters

@ -3,6 +3,7 @@ import Vuex from 'vuex'
import app from './modules/app'
import user from './modules/user'
import booking from './modules/booking'
// default router permission control
// import permission from './modules/permission'
@ -17,6 +18,7 @@ export default new Vuex.Store({
modules: {
app,
user,
booking,
permission
},
state: {

@ -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

@ -46,23 +46,24 @@
</template>
<script>
import {
GetYardlist,
// GetYardlist,
GetPortloadlist,
GetPortlist,
BookingTemplate,
DjyCustomerpage,
GetPackage,
// GetPackage,
DjyCustomerSuggest,
GetCarrierlist,
// GetCarrierlist,
getContractno,
getVesselInfoService,
GetForwarderlist,
GetSysUserPage,
Codeissuetypelist,
GetFrt,
// Codeissuetypelist,
// GetFrt,
GetService,
getGoodsname
} from '@/api/modular/main/BookingLedger'
import { mapGetters } from 'vuex'
let timer
export default {
name: '',
@ -108,6 +109,9 @@ export default {
clickHandle: null
}
},
computed: {
...mapGetters(['carrierList', 'yardList', 'packageList', 'issuetypeList', 'blfrtList'])
},
watch: {
defaultVal(nval, oval) {
if (this.inEdit) { return false }
@ -158,8 +162,8 @@ export default {
},
emnuSelectApi (type) {
switch (type) {
case 'GetYardlist':
return GetYardlist
// case 'GetYardlist':
// return GetYardlist
case 'GetPortloadlist':
return GetPortloadlist
case 'GetPortlist':
@ -168,24 +172,25 @@ export default {
return BookingTemplate
case 'DjyCustomerpage':
return DjyCustomerpage
case 'GetPackage':
return GetPackage
// case 'GetPackage':
// return GetPackage
case 'DjyCustomerSuggest':
return DjyCustomerSuggest
case 'GetCarrierlist':
return GetCarrierlist
// case 'GetCarrierlist':
// return GetCarrierlist
case 'getContractno':
return getContractno
case 'getVesselInfoService':
//
return getVesselInfoService
case 'GetForwarderlist':
return GetForwarderlist
case 'GetSysUserPage':
return GetSysUserPage
case 'Codeissuetypelist':
return Codeissuetypelist
case 'GetFrt':
return GetFrt
// case 'Codeissuetypelist':
// return Codeissuetypelist
// case 'GetFrt':
// return GetFrt
case 'GetService':
return GetService
case 'getGoodsname':
@ -299,6 +304,16 @@ export default {
code: 'TEN'
}
]
case 'yard':
return this.yardList
case 'kindpkgs':
return this.packageList
case 'carrierid':
return this.carrierList
case 'issuetype':
return this.issuetypeList
case 'blfrt':
return this.blfrtList
}
},
filterOption(input, option) {
@ -351,7 +366,7 @@ export default {
this.$refs.selectView.$refs.vcSelect.focus()
}
this.open = true
if (['cargoid', 'nobill', 'copynobill'].includes(this.type)) {
if (['cargoid', 'nobill', 'copynobill', 'carrierid', 'yard', 'kindpkgs', 'issuetype', 'blfrt'].includes(this.type)) {
this.selectList = this.emnuData(this.type)
this.inLoading = false
return false

@ -328,10 +328,11 @@ export default {
}
},
computed: {
...mapGetters(['bookingList', 'needSavePages', 'hasbookingDetail', 'bookingList', 'bookingGridOptions'])
...mapGetters(['bookingList', 'needSavePages', 'hasbookingDetail', 'bookingList', 'bookingGridOptions', 'carrierList', 'yardList', 'packageList', 'issuetypeList', 'blfrtList'])
},
created() {
this.init()
console.log('== 进入详情页面,获取公共数据 ==', this.carrierList, this.yardList, this.packageList, this.issuetypeList, this.blfrtList)
},
mounted() {
window.addEventListener(

@ -86,7 +86,8 @@
</div>
</template>
<script>
import { GetCtn, GetPackage, GetYardData } from '@/api/modular/main/BookingLedger'
import { GetYardData } from '@/api/modular/main/BookingLedger'
import { mapGetters } from 'vuex'
export default {
name: '',
props: {
@ -154,7 +155,7 @@ export default {
style="width: 90px"
on-change={val => {
if (val !== undefined) {
const data = this.ctnList[val]
const data = this.ctnallList[val]
this.tableData[rowIndex].ctnall = data.name
this.tableData[rowIndex].ctncode = data.code
row['ctnall'] = data.name
@ -175,7 +176,7 @@ export default {
console.log('== input - 修改内容==', val)
}}
>
{this.ctnList.map((item, index) => {
{this.ctnallList.map((item, index) => {
return <a-select-option value={index}>{item.name}</a-select-option>
})}
</a-select>
@ -915,8 +916,8 @@ export default {
}
},
tableLoaded: false,
ctnList: [],
packageList: [],
// ctnList: [],
// packageList: [],
selectArr: [],
totalCtnall: '',
totalPkgs: 0,
@ -954,6 +955,9 @@ export default {
inTableLoad: false
}
},
computed: {
...mapGetters(['packageList', 'ctnallList'])
},
watch: {
details: {
handler(nval, oval) {
@ -1106,38 +1110,38 @@ export default {
this.totalCbm = 0
}
// console.log('== - ==')
if (this.ctnList.length === 0) {
this.getCtn()
}
if (this.packageList.length === 0) {
this.getPackage()
}
// if (this.ctnList.length === 0) {
// this.getCtn()
// }
// if (this.packageList.length === 0) {
// this.getPackage()
// }
setTimeout(() => {
this.inTableLoad = false
}, 1200)
},
getCtn() {
GetCtn({
KeyWord: ''
})
.then(res => {
this.ctnList = res.data
})
.catch(err => {
console.log(err)
})
},
getPackage() {
GetPackage({
KeyWord: ''
})
.then(res => {
this.packageList = res.data
})
.catch(err => {
console.log(err)
})
},
// getCtn() {
// GetCtn({
// KeyWord: ''
// })
// .then(res => {
// this.ctnList = res.data
// })
// .catch(err => {
// console.log(err)
// })
// },
// getPackage() {
// GetPackage({
// KeyWord: ''
// })
// .then(res => {
// this.packageList = res.data
// })
// .catch(err => {
// console.log(err)
// })
// },
enmuErrorLabel(val) {
switch (val) {
case 'cntrno':

Loading…
Cancel
Save