diff --git a/src/views/company/trips/index.vue b/src/views/company/trips/index.vue index e29e35c..58c0353 100644 --- a/src/views/company/trips/index.vue +++ b/src/views/company/trips/index.vue @@ -78,6 +78,15 @@ input-align="right" placeholder="请输入" /> + + + + @@ -356,7 +374,7 @@ import dayjs from 'dayjs' import { createExpenseApply, getExpenseApply, - getMyExpenseApply, + getMyExpenseApply } from '@/api/bs/expenseApply' import { listData } from '@/api/system/dict/data' import VerifyFunc from '@/utils/verify' @@ -371,10 +389,19 @@ export default { FollowPeoPle: () => import('@/components/FollowPeoPle'), UploadFile: () => import('@/components/UploadFile'), ApprovalProcess: () => import('@/components/ApprovalProcess'), - BottomBtn: () => import('@/components/BottomBtn'), + BottomBtn: () => import('@/components/BottomBtn') }, // 计算属性 computed: { + fundingSourceList() { + const list = this.getDictDatas('funding_source')?.map((e) => { + return { + text: e.label, + value: e.value + } + }) + return list || [] + }, allTripPartners() { let arr = [] this.form.expenseApplyTrips.forEach((v) => { @@ -404,7 +431,7 @@ export default { }, CLSQ() { return ['CLSQ'].includes(this.$route.query.billType) - }, + } }, // 生命周期,创建完成时(可以访问当前this实例) created() { @@ -418,6 +445,7 @@ export default { }, data() { return { + showPicker: false, // 省市区 areaTree: [], VerifyFunc, @@ -432,7 +460,9 @@ export default { maxDate: new Date('2030/01/01'), defaultDate: new Date(), dateShow: false, + fundingSourceLabel: '', form: { + fundingSource: null, companyName: window.localStorage.getItem('cn'), //公司名称 nickname: JSON.parse( window.localStorage.getItem('userInfo') || { dept: {} } @@ -465,10 +495,10 @@ export default { tripPartnersName: '', amount: undefined, type: 0, - isOpen: false, - }, - ], - }, + isOpen: false + } + ] + } } }, @@ -476,6 +506,11 @@ export default { watch: {}, // 方法集合 methods: { + selectFundingSource(val) { + this.form.fundingSource = val.value + this.fundingSourceLabel = val.text + this.showPicker = false + }, // 获取省市区 getTree() { getAreaTree().then((res) => { @@ -512,10 +547,10 @@ export default { expenseApplyTrips: (this.form.expenseApplyTrips || []).map( (item) => { return { - ...item, + ...item } } - ), + ) } this.$loading(true, 'form') createExpenseApply(newForm).then((res) => { @@ -574,11 +609,14 @@ export default { ).format('YY/MM/DD')}`, tripPartnersName: nameArr.join('、'), departureLocation: Number(item.departureLocation), - destinationLocation: Number(item.destinationLocation), + destinationLocation: Number(item.destinationLocation) } } - ), + ) } + this.fundingSourceLabel = this.fundingSourceList.find( + (e) => e.value == this.form.fundingSource + ).text this.fileList = res.data.files || [] this.isAuthorised = res.data.isAuthorised this.$nextTick(() => { @@ -663,7 +701,7 @@ export default { tripPartnersName: '', amount: undefined, isOpen: false, - type: 0, + type: 0 }) }, handleInitList() { @@ -672,7 +710,7 @@ export default { listData({ pageNo: 1, pageSize: 50, - dictType: 'bs_trip_type', + dictType: 'bs_trip_type' }).then((res) => { this.tripTypeList = res.data.list || [] }) @@ -687,7 +725,7 @@ export default { if (startTime && endTime) { this.defaultDate = [ dayjs(startTime).toDate(), - dayjs(endTime).toDate(), + dayjs(endTime).toDate() ] } }) @@ -736,10 +774,10 @@ export default { Number(dayjs(list[1]).diff(dayjs(list[0]), 'day')) + 1 this.$set(this.form.expenseApplyTrips[this.index], 'tripDay', day) this.dateShow = false - }, - }, + } + } } \ No newline at end of file +