From 0ac862d77cc50c18bb4148978c591f2eba8c5d5b Mon Sep 17 00:00:00 2001 From: 123456 <13063093621@163.com> Date: Wed, 20 Mar 2024 22:42:07 +0800 Subject: [PATCH] 1 --- src/api/bs/vendor.js | 75 ++++++++++ src/views/contract/receipts/index.vue | 199 +++----------------------- 2 files changed, 91 insertions(+), 183 deletions(-) create mode 100644 src/api/bs/vendor.js diff --git a/src/api/bs/vendor.js b/src/api/bs/vendor.js new file mode 100644 index 0000000..c9322a2 --- /dev/null +++ b/src/api/bs/vendor.js @@ -0,0 +1,75 @@ +import request from '@/plugin/axios' + +// 创建报销-供应商信息 +export function createVendor(data) { + return request({ + url: '/bs/vendor/create', + method: 'post', + data: data + }) +} + +// 更新报销-供应商信息 +export function updateVendor(data) { + return request({ + url: '/bs/vendor/update', + method: 'put', + data: data + }) +} + +// 删除报销-供应商信息 +export function deleteVendor(id) { + return request({ + url: '/bs/vendor/delete?id=' + id, + method: 'delete' + }) +} + +// 获得报销-供应商信息 +export function getVendor(id) { + return request({ + url: '/bs/vendor/get?id=' + id, + method: 'get' + }) +} + +// 获得报销-供应商信息分页 +export function getVendorPage(query) { + return request({ + url: '/bs/vendor/page', + method: 'get', + params: query + }) +} + +// 导出报销-供应商信息 Excel +export function exportVendorExcel(query) { + return request({ + url: '/bs/vendor/export-excel', + method: 'get', + params: query, + responseType: 'blob' + }) +} + + +// 百度云接口识别 +export function baiduScanApi(data) { + return request({ + url: '/bs/vendor/buildBusinessLicense', + method: 'post', + data + }) +} + + +// 对公 +export function vendorBankPage(query) { + return request({ + url: '/bs/vendor-bank/page', + method: 'get', + params: query + }) +} + diff --git a/src/views/contract/receipts/index.vue b/src/views/contract/receipts/index.vue index 423a041..caf58ab 100644 --- a/src/views/contract/receipts/index.vue +++ b/src/views/contract/receipts/index.vue @@ -10,11 +10,9 @@ - + - - - +
附件
@@ -52,6 +50,7 @@ import { getTreeIds, findAreaIdName } from '@/utils' import { getExpenseApplyMyPage } from "@/api/bs/expenseApply"; import { Dialog } from 'vant' import { getDictDatas, DICT_TYPE } from "@/utils/dict"; +import { getVendorPage } from "@/api/bs/vendor"; export default { //import引入组件才能使用 props: {}, @@ -76,6 +75,7 @@ export default { }, data() { return { + allGysList: [], indexOne: 1, indexTwo: 1, claimType: '', @@ -507,38 +507,6 @@ export default { this.form = { ...(res.data || {}), - expenseClaimTrips: (res.data.expenseClaimTrips || []).map(item => { - let nameArr = [] - this.userList.forEach(element => { - if (item.tripPartners.includes(element.id)) { - nameArr.push(element.nickname) - } - }); - return { - ...item, - tripType: Number(item.tripType), - time: `${dayjs(item.startTime).format('YY/MM/DD')}~${dayjs(item.endTime).format('YY/MM/DD')}`, - tripPartnersName: nameArr.join('、'), - departureLocation: Number(item.departureLocation), - destinationLocation: Number(item.destinationLocation) - } - }) - } - if (Array.isArray(this.form.expenseClaimTrips)) { - this.form.expenseClaimTrips.forEach(n => { - n.expenseClaimDetails.forEach(z => { - // let nameArr = ((this.ieList.filter(item => (z.invoiceIds || []).includes(item.id)) || []).map(item => item.invoiceCode)).join('、') - this.$set(z, 'show', false) - // this.$set(z, 'invoiceName', nameArr) - }) - }) - } - if (Array.isArray(this.form.expenseClaimDetails)) { - this.form.expenseClaimDetails.forEach(z => { - // let nameArr = ((this.ieList.filter(item => (z.invoiceIds || []).includes(item.id)) || []).map(item => item.invoiceCode)).join('、') - this.$set(z, 'show', false) - // this.$set(z, 'invoiceName', nameArr) - }) } this.fileList = res.data.files || [] this.isAuthorised = res.data.isAuthorised @@ -550,159 +518,24 @@ export default { }) } }, - handleUpload(list) { - this.fileList = list - }, - handleNewConfirmPo(arr, index) { - let nameArr = [] - this.userList.forEach(element => { - if (arr.includes(element.id)) { - nameArr.push(element.nickname) - } - }); - this.$set(this.form.expenseClaimTrips[index], 'tripPartners', arr) - this.$set(this.form.expenseClaimTrips[index], 'tripPartnersName', nameArr.join('、')) - this.$set(this.form.expenseClaimTrips[index], 'isOpen', false) - }, - handleConfirmPo(arr, index) { - let nameArr = this.form.expenseClaimTrips[index].tripPartnersName && this.form.expenseClaimTrips[index].tripPartnersName.split('、') || [] - let newArr = this.form.expenseClaimTrips[index].tripPartners || [] - this.userList.forEach(element => { - if (arr.includes(element.id)) { - nameArr.push(element.nickname) - newArr.push(element.id) - } - }); - this.$set(this.form.expenseClaimTrips[index], 'tripPartners', newArr) - this.$set(this.form.expenseClaimTrips[index], 'tripPartnersName', nameArr.join('、')) - this.$set(this.form.expenseClaimTrips[index], 'isOpen', false) - }, - handlePoShow(index) { - // if (this.disabled) return - if (this.form.expenseClaimTrips[index].tripPartners.length) { - this.$set(this.form.expenseClaimTrips[index], 'type', 0) - this.$set(this.form.expenseClaimTrips[index], 'isOpen', true) - } else { - - this.$fm('请先添加同行人!') - } - }, - handlePoCancel(index) { - this.$set(this.form.expenseClaimTrips[index], 'isOpen', false) - }, - handleAddPeo(index) { - this.$set(this.form.expenseClaimTrips[index], 'isOpen', true) - this.$set(this.form.expenseClaimTrips[index], 'type', 1) - }, - handleDel(index) { - this.form.expenseClaimTrips.splice(index, 1) - }, - handleAdd() { - this.form.expenseClaimTrips.push({ - time: null, - startTime: null, - endTime: null, - departureLocation: null, - departureLocationName: '', - destinationLocation: null, - destinationLocationName: '', - tripDay: undefined, - tripType: null, - tripPartners: [], // 出差同行人 - tripPartnersName: "", - amount: undefined, - isOpen: false, - type: 0, - expenseClaimDetails: [ - { - invoiceIds: {}, - feeType: null, - amount: undefined, - invoiceCount: undefined, - remark: null, - } - ] - }) - }, handleInitList() { console.log('......'); this.$loading(true) return new Promise((resolve) => { - listData({ - pageNo: 1, - pageSize: this.$store.getters.requestPageSize, - dictType: 'bs_trip_type', - }).then((res) => { - // 出差类型 - this.tripTypeList = res.data.list || [] - console.log('tripTypeList..', this.tripTypeList); - }) - listData({ - pageNo: 1, - pageSize: this.$store.getters.requestPageSize, - dictType: 'bs_fee_type', - }).then((res) => { - // 出差类型 - this.feeTypeList = res.data.list || [] - }) - getInvoicePage({ - pageNo: 1, - pageSize: this.$store.getters.requestPageSize, - }).then((res) => { - this.ieList = res.data && res.data.list || [] - getExpenseApplyMyPage({ - pageNo: 1, - pageSize: 1000, - billType: 'CLSQ', - expenseFlag: 0, - ids: [], - sortingFieldStr: encodeURIComponent(JSON.stringify([{ field: 'id', order: "desc" }])) - }).then((res) => { - - let list = (res.data.list || []).map((item) => { - return { - ...item, - amount: (item.expenseApplyTrips || []).reduce((acc, cur) => { - return Number(acc) + Number(cur.amount) - }, 0), - tripDay: (item.expenseApplyTrips || []).reduce((acc, cur) => { - return Number(acc) + Number(cur.tripDay) - }, 0), - rodeArr: ((item.expenseApplyTrips || []).map(item => { - return [(findAreaIdName(this.areaTree, item.departureLocation) || {}).name, (findAreaIdName(this.areaTree, item.destinationLocation) || {}).name] - })), - time: Array.isArray(item.expenseApplyTrips) && item.expenseApplyTrips.length ? `${dayjs(item.expenseApplyTrips[0].startTime).format('YYYY/MM/DD')}~${dayjs(item.expenseApplyTrips[item.expenseApplyTrips.length - 1].endTime).format('YYYY/MM/DD')}` : '-' - } - }) - list.forEach(element => { - let arr = [] - element.rodeArr.forEach(v => { - v.forEach(n => { - arr.push(n && n) - }) - }) - element.rodeArr = arr - }); - - //去重 - list.forEach(n => { - n.rode = this.unique(n.rodeArr).join('-') - }) - this.expenseApplyList = (list || []).map((item, index) => { - return { - id: item.id, - title: `序号:${index + 1} 编号:${item.applyNo}申请人:${item.nickname}行程路线:${item.rode}出差天数:${item.tripDay || 0}天`, - disabled: item.status != 2 ? true : false - } - }) - resolve() - this.$loading(false) - }) - }) - + Promise.all([ + getVendorPage({ pageNo: 1, pageSize: 999 }), + getBankAccountInfoPage({ pageNo: 1, pageSize: 999 }) + ]).then(responses => { + // 处理每个请求的结果 + this.allGysList = responses[0].data.list || []; + this.allBankList = responses[1].data.list || []; + resolve() + }).catch(error => { + // 处理错误情况 + console.error('Error:', error); + }); }) - }, handleDateShow(index, obj) { if (this.disabled) {