lijingjia 2 weeks ago
commit a36091fa4f

@ -52,15 +52,16 @@ export function useCustomRow(
.find((dom: HTMLElement) => dom.tagName === 'TR') as HTMLElement .find((dom: HTMLElement) => dom.tagName === 'TR') as HTMLElement
if (!tr) return if (!tr) return
// 找到Checkbox检查是否为disabled // 找到Checkbox检查是否为disabled
// 暂时注释了 影响修改金额
const checkBox = tr.querySelector('input[type=checkbox]') const checkBox = tr.querySelector('input[type=checkbox]')
if (!checkBox || checkBox.hasAttribute('disabled')) return if (!checkBox || checkBox.hasAttribute('disabled')) return
if (!keys.includes(key)) { if (!keys.includes(key)) {
setSelectedRowKeys([...keys, key]) // setSelectedRowKeys([...keys, key])
return return
} }
const keyIndex = keys.findIndex((item) => item === key) // const keyIndex = keys.findIndex((item) => item === key)
keys.splice(keyIndex, 1) // keys.splice(keyIndex, 1)
setSelectedRowKeys(keys) // setSelectedRowKeys(keys)
return return
} }
@ -70,7 +71,7 @@ export function useCustomRow(
if (keys.length) { if (keys.length) {
clearSelectedRowKeys() clearSelectedRowKeys()
} }
setSelectedRowKeys([key]) // setSelectedRowKeys([key])
return return
} }
clearSelectedRowKeys() clearSelectedRowKeys()

@ -1158,7 +1158,6 @@ export const freeSearchFormSchema: FormSchema[] = [
field: 'feeType', field: 'feeType',
label: '收/付', label: '收/付',
component: 'Select', component: 'Select',
required: true,
colProps: { span: 4 }, colProps: { span: 4 },
defaultValue: '1', defaultValue: '1',
componentProps: () => { componentProps: () => {

@ -126,6 +126,7 @@ import {
PaymentSettlementGetList, PaymentSettlementDeleteDetail, PaymentFreeSettlementGet, PaymentSettlementGetList, PaymentSettlementDeleteDetail, PaymentFreeSettlementGet,
GeneralInvoiceGet, PaymentFreeSettlementSave GeneralInvoiceGet, PaymentFreeSettlementSave
} from '../api' } from '../api'
import { numberThousandFormat } from '/@/utils/commonUtil'
import { useMessage } from '/@/hooks/web/useMessage' import { useMessage } from '/@/hooks/web/useMessage'
import invoiceTable from './invoiceTable.vue' import invoiceTable from './invoiceTable.vue'
import invoiceFile from '../../../operation/invoiceIssue/detail/invoiceFile.vue' import invoiceFile from '../../../operation/invoiceIssue/detail/invoiceFile.vue'
@ -335,6 +336,9 @@ function handleClick(record) {
} }
PaymentFreeSettlementGetFees(data).then(res => { PaymentFreeSettlementGetFees(data).then(res => {
if (res.succeeded) { if (res.succeeded) {
res.data.items.forEach(item => {
item.amount =numberThousandFormat(item.amount, 2, false)
})
setTableData1(res.data.items) setTableData1(res.data.items)
} }
loading.value = false loading.value = false
@ -471,10 +475,14 @@ function getDetail() {
PaymentFreeSettlementGet({ id: route.query.id }).then(res => { PaymentFreeSettlementGet({ id: route.query.id }).then(res => {
if (res.succeeded) { if (res.succeeded) {
res.data.mode = 'free' res.data.mode = 'free'
res.data.amount = numberThousandFormat(res.data.amount, 2, false)
form.value = JSON.parse(JSON.stringify(res.data)) form.value = JSON.parse(JSON.stringify(res.data))
res.data.currencyAmount = res.data.currency + '/' + res.data.amount res.data.currencyAmount = res.data.currency + '/' + res.data.amount
setFieldsValueMark(res.data) setFieldsValueMark(res.data)
setFieldsValue(res.data) setFieldsValue(res.data)
res.data.settlementDetails.forEach(item => {
item.originalAmount = numberThousandFormat(item.originalAmount, 2, false)
})
setTableData(res.data.settlementDetails) setTableData(res.data.settlementDetails)
} }
loading.value = false loading.value = false

@ -8,7 +8,8 @@
<a-modal width="1500px" @cancel="openFlag = false" :visible="openFlag" title="添加收费结算明细" :footer="null"> <a-modal width="1500px" @cancel="openFlag = false" :visible="openFlag" title="添加收费结算明细" :footer="null">
<div style="padding-bottom: 25px;"> <div style="padding-bottom: 25px;">
<a-spin :spinning="loading"> <a-spin :spinning="loading">
<BasicTable class="ds-table" @register="registerTable" @row-click="onRowClick"> <BasicTable class="ds-table" @selection-change="onSelectChange" @register="registerTable"
@row-click="onRowClick">
<template #tableTitle> <template #tableTitle>
<div class="flex" style="align-items: center;"> <div class="flex" style="align-items: center;">
<div style="font-size: 12px;font-weight: bold;margin-right: 5px">结算明细</div> <div style="font-size: 12px;font-weight: bold;margin-right: 5px">结算明细</div>
@ -137,16 +138,12 @@ import {
} from '../api' } from '../api'
import { invoiceTableColums, invoiceSearchFormSchema, invoiceTableDetailColums, freeTableColums, freeSearchFormSchema, freeTableDetailColums } from '../columns' import { invoiceTableColums, invoiceSearchFormSchema, invoiceTableDetailColums, freeTableColums, freeSearchFormSchema, freeTableDetailColums } from '../columns'
import { GetFeeCurrencySelectList } from '/@/api/common' import { GetFeeCurrencySelectList } from '/@/api/common'
import feeTable from '/@/components/CostEntry/components/feeTable.vue'
import { BasicForm, useForm } from '/@/components/Form'
import ExchangeRate from './exchangeRate.vue'
// //
import { useMessage } from '/@/hooks/web/useMessage' import { useMessage } from '/@/hooks/web/useMessage'
import { Divider } from 'ant-design-vue' import { numberThousandFormat } from '/@/utils/commonUtil'
import { formatParams } from '/@/hooks/web/common' import { formatParams } from '/@/hooks/web/common'
const emits = defineEmits(['updateList', 'refresh', 'updateListFree', 'updateListFreeLeft']) const emits = defineEmits(['updateList', 'refresh', 'updateListFree', 'updateListFreeLeft'])
import { useRoute, useRouter } from 'vue-router' import { useRoute, useRouter } from 'vue-router'
import { get } from 'lodash'
const route = useRoute() const route = useRoute()
const { createMessage } = useMessage() const { createMessage } = useMessage()
// rmb // rmb
@ -160,6 +157,14 @@ const [registerTable, { getForm, getSelectRows, setSelectedRowKeys }] = useTable
res = await PaymentFreeSettlementGetBizList(p) res = await PaymentFreeSettlementGetBizList(p)
res.data.forEach((item, index) => { res.data.forEach((item, index) => {
item.freeIndex = String(index) item.freeIndex = String(index)
item.unpaidOther = numberThousandFormat(item.unpaidOther, 2, false)
item.unpaidUSD = numberThousandFormat(item.unpaidUSD, 2, false)
item.unpaidRMB = numberThousandFormat(item.unpaidRMB, 2, false)
item.unpaidInvoiceUSD = numberThousandFormat(item.unpaidInvoiceUSD, 2, false)
item.unpaidInvoiceRMB = numberThousandFormat(item.unpaidInvoiceRMB, 2, false)
item.unchargedOther = numberThousandFormat(item.unchargedOther, 2, false)
item.unchargedUSD = numberThousandFormat(item.unchargedUSD, 2, false)
item.unchargedRMB = numberThousandFormat(item.unchargedRMB, 2, false)
}) })
} }
if (route.query.type == 'invoice') { if (route.query.type == 'invoice') {
@ -169,15 +174,11 @@ const [registerTable, { getForm, getSelectRows, setSelectedRowKeys }] = useTable
resolve({ data: [...res.data], total: res.count }) resolve({ data: [...res.data], total: res.count })
}) })
}, },
rowSelection: {
onChange: onSelectChange
},
beforeFetch: (p) => { beforeFetch: (p) => {
queryData.value = JSON.parse(JSON.stringify(formatParams(p))) queryData.value = JSON.parse(JSON.stringify(formatParams(p)))
return formatParams(p) return formatParams(p)
}, },
columns: getColums(), columns: getColums(),
maxHeight: '900',
rowKey: getId(), rowKey: getId(),
formConfig: { formConfig: {
labelWidth: 120, labelWidth: 120,
@ -191,7 +192,7 @@ const [registerTable, { getForm, getSelectRows, setSelectedRowKeys }] = useTable
bordered: true, bordered: true,
showIndexColumn: false, showIndexColumn: false,
canResize: false, canResize: false,
showTableSetting: false, showTableSetting: true,
id: getTableId(), id: getTableId(),
immediate: false immediate: false
}) })
@ -205,12 +206,11 @@ const [registerTable1, { getSelectRows: getSelectRowsDetail, setTableData }] = u
onChange: onSelectChangeDetail, onChange: onSelectChangeDetail,
fixed: true, fixed: true,
}, },
maxHeight: '900',
bordered: true, bordered: true,
indexColumnProps: { indexColumnProps: {
width: 60, width: 60,
}, },
showTableSetting: false, showTableSetting: true,
id: getTableDetailId(), id: getTableDetailId(),
canResize: false, canResize: false,
immediate: false, immediate: false,
@ -270,11 +270,12 @@ const exchangarr = ref([]) as any
const currenciesData = ref([]) as any const currenciesData = ref([]) as any
const exchangeFlag = ref(false) const exchangeFlag = ref(false)
// //
const onRowClick = (record, index) => { const onRowClick = (record, index, type) => {
onSelectChange()
loading.value = true loading.value = true
if (route.query.type == 'invoice') { if (route.query.type == 'invoice') {
if (type != 'select') {
setSelectedRowKeys([record.id]) setSelectedRowKeys([record.id])
}
const data = { const data = {
ids: [record.id], ids: [record.id],
businessType: record.businessType, businessType: record.businessType,
@ -287,8 +288,11 @@ const onRowClick = (record, index) => {
loading.value = false loading.value = false
}) })
} }
if (route.query.type == 'free') { if (route.query.type == 'free') {
if (type != 'select') {
setSelectedRowKeys([String(index)]) setSelectedRowKeys([String(index)])
}
const queryDataStr = JSON.parse(queryData.value.queryCondition) const queryDataStr = JSON.parse(queryData.value.queryCondition)
const arrQuery = [] as any const arrQuery = [] as any
queryDataStr.forEach(item => { queryDataStr.forEach(item => {
@ -317,6 +321,9 @@ const onRowClick = (record, index) => {
if (res.succeeded) { if (res.succeeded) {
res.data.items.forEach(item => { res.data.items.forEach(item => {
item.maxRestAmount = item.restAmount item.maxRestAmount = item.restAmount
item.totalAmount = numberThousandFormat(item.totalAmount, 2, false)
item.maxRestAmount = numberThousandFormat(item.maxRestAmount, 2, false)
item.invoiceAmount = numberThousandFormat(item.invoiceAmount, 2, false)
}) })
setTableData(res.data.items) setTableData(res.data.items)
} }
@ -630,7 +637,7 @@ const susd = ref(0)
const fusd = ref(0) const fusd = ref(0)
const sqt = ref(0) const sqt = ref(0)
const ftq = ref(0) const ftq = ref(0)
function onSelectChange(selectedRowKeys) { function onSelectChange({ keys, rows }) {
const list = getSelectRows() const list = getSelectRows()
rrmb.value = 0 rrmb.value = 0
srmb.value = 0 srmb.value = 0
@ -648,12 +655,21 @@ function onSelectChange(selectedRowKeys) {
sqt.value += Number(item.unchargedOther) sqt.value += Number(item.unchargedOther)
ftq.value += Number(item.unpaidOther) ftq.value += Number(item.unpaidOther)
}) })
rrmb.value = numberThousandFormat(rrmb.value, 2, false)
srmb.value = numberThousandFormat(srmb.value, 2, false)
frmb.value = numberThousandFormat(frmb.value, 2, false)
susd.value = numberThousandFormat(susd.value, 2, false)
fusd.value = numberThousandFormat(fusd.value, 2, false)
sqt.value = numberThousandFormat(sqt.value, 2, false)
ftq.value = numberThousandFormat(ftq.value, 2, false)
} }
if (route.query.type == 'invoice') { if (route.query.type == 'invoice') {
list.forEach(item => { list.forEach(item => {
rrmb.value += Number(item.applyAmount) rrmb.value += Number(item.applyAmount)
}) })
rrmb.value = numberThousandFormat(rrmb.value, 2, false)
} }
onRowClick(rows[rows.length - 1], rows.length, 'select')
} }
const openFlag = ref(false) const openFlag = ref(false)

@ -96,6 +96,7 @@ import { BasicTable, useTable, TableAction } from '/@/components/Table'
import { formatParams } from '/@/hooks/web/common' import { formatParams } from '/@/hooks/web/common'
import { columns, searchFormSchema, detailColumns, feeColumns, feeColumnsSum } from './columns' import { columns, searchFormSchema, detailColumns, feeColumns, feeColumnsSum } from './columns'
import { useMessage } from '/@/hooks/web/useMessage' import { useMessage } from '/@/hooks/web/useMessage'
import { numberThousandFormat } from '/@/utils/commonUtil'
import { SvgIcon } from '/@/components/Icon' import { SvgIcon } from '/@/components/Icon'
const { createMessage } = useMessage() const { createMessage } = useMessage()
import { useGo } from '/@/hooks/web/usePage' import { useGo } from '/@/hooks/web/usePage'
@ -104,6 +105,11 @@ const [registerTable, { reload, setLoading, getSelectRows, getForm }] = useTable
api: async (p) => { api: async (p) => {
const res: API.DataResult = await PaymentSettlementGetList(p) const res: API.DataResult = await PaymentSettlementGetList(p)
return new Promise((resolve) => { return new Promise((resolve) => {
res.data.forEach(item=>{
item.otherAmount = numberThousandFormat(item.otherAmount, 2, false)
item.usdAmount = numberThousandFormat(item.usdAmount, 2, false)
item.rmbAmount = numberThousandFormat(item.rmbAmount, 2, false)
})
resolve({ data: [...res.data], total: res.count }) resolve({ data: [...res.data], total: res.count })
}) })
}, },

@ -1153,7 +1153,6 @@ export const freeSearchFormSchema: FormSchema[] = [
field: 'feeType', field: 'feeType',
label: '收/付', label: '收/付',
component: 'Select', component: 'Select',
required: true,
colProps: { span: 4 }, colProps: { span: 4 },
defaultValue: '2', defaultValue: '2',
componentProps: () => { componentProps: () => {

@ -126,6 +126,7 @@ import {
PaymentSettlementGetList, PaymentSettlementDeleteDetail, PaymentFreeSettlementGet, PaymentSettlementGetList, PaymentSettlementDeleteDetail, PaymentFreeSettlementGet,
GeneralInvoiceGet, PaymentFreeSettlementSave GeneralInvoiceGet, PaymentFreeSettlementSave
} from './api' } from './api'
import { numberThousandFormat } from '/@/utils/commonUtil'
import { useMessage } from '/@/hooks/web/useMessage' import { useMessage } from '/@/hooks/web/useMessage'
import invoiceTable from './invoiceTable.vue' import invoiceTable from './invoiceTable.vue'
import invoiceFile from '../../../operation/invoiceIssue/detail/invoiceFile.vue' import invoiceFile from '../../../operation/invoiceIssue/detail/invoiceFile.vue'
@ -336,6 +337,9 @@ function handleClick(record) {
} }
PaymentFreeSettlementGetFees(data).then(res => { PaymentFreeSettlementGetFees(data).then(res => {
if (res.succeeded) { if (res.succeeded) {
res.data.items.forEach(item => {
item.amount =numberThousandFormat(item.amount, 2, false)
})
setTableData1(res.data.items) setTableData1(res.data.items)
} }
loading.value = false loading.value = false
@ -472,10 +476,15 @@ function getDetail() {
PaymentFreeSettlementGet({ id: route.query.id }).then(res => { PaymentFreeSettlementGet({ id: route.query.id }).then(res => {
if (res.succeeded) { if (res.succeeded) {
res.data.mode = 'free' res.data.mode = 'free'
res.data.amount = numberThousandFormat(res.data.amount, 2, false)
form.value = JSON.parse(JSON.stringify(res.data)) form.value = JSON.parse(JSON.stringify(res.data))
res.data.currencyAmount = res.data.currency + '/' + res.data.amount res.data.currencyAmount = res.data.currency + '/' + res.data.amount
setFieldsValueMark(res.data) setFieldsValueMark(res.data)
setFieldsValue(res.data) setFieldsValue(res.data)
res.data.settlementDetails.forEach(item => {
item.originalAmount = numberThousandFormat(item.originalAmount, 2, false)
item.applyAmount = numberThousandFormat(item.applyAmount, 2, false)
})
setTableData(res.data.settlementDetails) setTableData(res.data.settlementDetails)
} }
loading.value = false loading.value = false

@ -8,7 +8,7 @@
<a-modal width="1500px" @cancel="openFlag = false" :visible="openFlag" title="添加付费结算明细" :footer="null"> <a-modal width="1500px" @cancel="openFlag = false" :visible="openFlag" title="添加付费结算明细" :footer="null">
<div style="padding-bottom: 25px;"> <div style="padding-bottom: 25px;">
<a-spin :spinning="loading"> <a-spin :spinning="loading">
<BasicTable class="ds-table" @register="registerTable" @row-click="onRowClick"> <BasicTable @selection-change="onSelectChange" class="ds-table" @register="registerTable" @row-click="onRowClick">
<template #tableTitle> <template #tableTitle>
<div class="flex" style="align-items: center;"> <div class="flex" style="align-items: center;">
<div style="font-size: 12px;font-weight: bold;margin-right: 5px">结算明细</div> <div style="font-size: 12px;font-weight: bold;margin-right: 5px">结算明细</div>
@ -137,15 +137,12 @@ import {
} from './api' } from './api'
import { invoiceTableColums, invoiceSearchFormSchema, invoiceTableDetailColums, freeTableColums, freeSearchFormSchema, freeTableDetailColums } from './columns' import { invoiceTableColums, invoiceSearchFormSchema, invoiceTableDetailColums, freeTableColums, freeSearchFormSchema, freeTableDetailColums } from './columns'
import { GetFeeCurrencySelectList } from '/@/api/common' import { GetFeeCurrencySelectList } from '/@/api/common'
import feeTable from '/@/components/CostEntry/components/feeTable.vue'
import { BasicForm, useForm } from '/@/components/Form'
import ExchangeRate from './exchangeRate.vue'
// //
import { useMessage } from '/@/hooks/web/useMessage' import { useMessage } from '/@/hooks/web/useMessage'
import { Divider } from 'ant-design-vue'
import { formatParams } from '/@/hooks/web/common' import { formatParams } from '/@/hooks/web/common'
const emits = defineEmits(['updateList', 'refresh', 'updateListFree', 'updateListFreeLeft']) const emits = defineEmits(['updateList', 'refresh', 'updateListFree', 'updateListFreeLeft'])
import { useRoute, useRouter } from 'vue-router' import { useRoute, useRouter } from 'vue-router'
import { numberThousandFormat } from '/@/utils/commonUtil'
import { get } from 'lodash' import { get } from 'lodash'
const route = useRoute() const route = useRoute()
const { createMessage } = useMessage() const { createMessage } = useMessage()
@ -160,6 +157,14 @@ const [registerTable, { getForm, getSelectRows, setSelectedRowKeys }] = useTable
res = await PaymentFreeSettlementGetBizList(p) res = await PaymentFreeSettlementGetBizList(p)
res.data.forEach((item, index) => { res.data.forEach((item, index) => {
item.freeIndex = String(index) item.freeIndex = String(index)
item.unpaidOther = numberThousandFormat(item.unpaidOther, 2, false)
item.unpaidUSD = numberThousandFormat(item.unpaidUSD, 2, false)
item.unpaidRMB = numberThousandFormat(item.unpaidRMB, 2, false)
item.unpaidInvoiceUSD = numberThousandFormat(item.unpaidInvoiceUSD, 2, false)
item.unpaidInvoiceRMB = numberThousandFormat(item.unpaidInvoiceRMB, 2, false)
item.unchargedOther = numberThousandFormat(item.unchargedOther, 2, false)
item.unchargedUSD = numberThousandFormat(item.unchargedUSD, 2, false)
item.unchargedRMB = numberThousandFormat(item.unchargedRMB, 2, false)
}) })
} }
if (route.query.type == 'invoice') { if (route.query.type == 'invoice') {
@ -191,7 +196,7 @@ const [registerTable, { getForm, getSelectRows, setSelectedRowKeys }] = useTable
bordered: true, bordered: true,
showIndexColumn: false, showIndexColumn: false,
canResize: false, canResize: false,
showTableSetting: false, showTableSetting: true,
id: getTableId(), id: getTableId(),
immediate: false immediate: false
}) })
@ -201,16 +206,12 @@ const [registerTable1, { getSelectRows: getSelectRowsDetail, setTableData }] = u
showIndexColumn: false, showIndexColumn: false,
pagination: false, pagination: false,
striped: false, striped: false,
rowSelection: {
onChange: onSelectChangeDetail,
fixed: true,
},
maxHeight: '900', maxHeight: '900',
bordered: true, bordered: true,
indexColumnProps: { indexColumnProps: {
width: 60, width: 60,
}, },
showTableSetting: false, showTableSetting: true,
id: getTableDetailId(), id: getTableDetailId(),
canResize: false, canResize: false,
immediate: false, immediate: false,
@ -270,11 +271,12 @@ const exchangarr = ref([]) as any
const currenciesData = ref([]) as any const currenciesData = ref([]) as any
const exchangeFlag = ref(false) const exchangeFlag = ref(false)
// //
const onRowClick = (record, index) => { const onRowClick = (record, index, type) => {
onSelectChange()
loading.value = true loading.value = true
if (route.query.type == 'invoice') { if (route.query.type == 'invoice') {
if (type != 'select') {
setSelectedRowKeys([record.id]) setSelectedRowKeys([record.id])
}
const data = { const data = {
ids: [record.id], ids: [record.id],
businessType: record.businessType, businessType: record.businessType,
@ -287,8 +289,11 @@ const onRowClick = (record, index) => {
loading.value = false loading.value = false
}) })
} }
if (route.query.type == 'free') { if (route.query.type == 'free') {
if (type != 'select') {
setSelectedRowKeys([String(index)]) setSelectedRowKeys([String(index)])
}
const queryDataStr = JSON.parse(queryData.value.queryCondition) const queryDataStr = JSON.parse(queryData.value.queryCondition)
const arrQuery = [] as any const arrQuery = [] as any
queryDataStr.forEach(item => { queryDataStr.forEach(item => {
@ -317,6 +322,9 @@ const onRowClick = (record, index) => {
if (res.succeeded) { if (res.succeeded) {
res.data.items.forEach(item => { res.data.items.forEach(item => {
item.maxRestAmount = item.restAmount item.maxRestAmount = item.restAmount
item.totalAmount = numberThousandFormat(item.totalAmount, 2, false)
item.maxRestAmount = numberThousandFormat(item.maxRestAmount, 2, false)
item.invoiceAmount = numberThousandFormat(item.invoiceAmount, 2, false)
}) })
setTableData(res.data.items) setTableData(res.data.items)
} }
@ -407,6 +415,22 @@ function addInfos() {
}) })
} }
if (route.query.type == 'free') { if (route.query.type == 'free') {
const queryDataStr1 = JSON.parse(queryData.value.queryCondition)
const queryDataStrarr = [] as any
queryDataStr1.forEach(item => {
if (item.FieldName == 'feeType') {
queryDataStrarr.push(item)
}
if (item.FieldName == 'currency') {
queryDataStrarr.push(item)
}
if (item.FieldName == 'feeName') {
queryDataStrarr.push(item)
}
if (item.FieldName == 'FeeRange') {
queryDataStrarr.push(item)
}
})
const data = [] as any const data = [] as any
arr.forEach(item => { arr.forEach(item => {
data.push({ data.push({
@ -418,7 +442,11 @@ function addInfos() {
}) })
currenciesData.value = [] currenciesData.value = []
exchangarr.value = [] exchangarr.value = []
PaymentFreeSettlementGetExchangesAsync(data).then(res => { const obj = {
items: data,
queryCondition: JSON.stringify(queryDataStrarr)
}
PaymentFreeSettlementGetExchangesAsync(obj).then(res => {
const cuArr = [] as any const cuArr = [] as any
currenciesData.value = res.data currenciesData.value = res.data
res.data.forEach(item => { res.data.forEach(item => {
@ -611,7 +639,7 @@ const susd = ref(0)
const fusd = ref(0) const fusd = ref(0)
const sqt = ref(0) const sqt = ref(0)
const ftq = ref(0) const ftq = ref(0)
function onSelectChange(selectedRowKeys) { function onSelectChange({ keys, rows }) {
const list = getSelectRows() const list = getSelectRows()
rrmb.value = 0 rrmb.value = 0
srmb.value = 0 srmb.value = 0
@ -629,12 +657,21 @@ function onSelectChange(selectedRowKeys) {
sqt.value += Number(item.unchargedOther) sqt.value += Number(item.unchargedOther)
ftq.value += Number(item.unpaidOther) ftq.value += Number(item.unpaidOther)
}) })
rrmb.value = numberThousandFormat(rrmb.value, 2, false)
srmb.value = numberThousandFormat(srmb.value, 2, false)
frmb.value = numberThousandFormat(frmb.value, 2, false)
susd.value = numberThousandFormat(susd.value, 2, false)
fusd.value = numberThousandFormat(fusd.value, 2, false)
sqt.value = numberThousandFormat(sqt.value, 2, false)
ftq.value = numberThousandFormat(ftq.value, 2, false)
} }
if (route.query.type == 'invoice') { if (route.query.type == 'invoice') {
list.forEach(item => { list.forEach(item => {
rrmb.value += Number(item.applyAmount) rrmb.value += Number(item.applyAmount)
}) })
rrmb.value = numberThousandFormat(rrmb.value, 2, false)
} }
onRowClick(rows[rows.length - 1], rows.length, 'select')
} }
const openFlag = ref(false) const openFlag = ref(false)

@ -39,8 +39,8 @@ import { GetClientBankList, GetOrgList } from './api'
import { GetFeeCurrencySelectList,GetFeeCodeSelectList,GetClientListByCode,GetControllerClientList } from '/@/api/common' import { GetFeeCurrencySelectList,GetFeeCodeSelectList,GetClientListByCode,GetControllerClientList } from '/@/api/common'
export const searchFormSchema: FormSchema[] = [ export const searchFormSchema: FormSchema[] = [
{ {
field: 'applicationNO', field: 'number',
label: '申请单号', label: '号',
component: 'Input', component: 'Input',
colProps: { span: 4 }, colProps: { span: 4 },
}, },
@ -83,12 +83,6 @@ export const searchFormSchema: FormSchema[] = [
options: billTypeData, options: billTypeData,
}, },
}, },
{
field: 'number',
label: '编号',
component: 'Input',
colProps: { span: 4 },
},
{ {
field: 'createTime', field: 'createTime',
label: '开票日期', label: '开票日期',

@ -11,7 +11,7 @@
<template #right> <template #right>
<div style="width: 40%;margin-left: 10px;margin-top:51px;"> <div style="width: 40%;margin-left: 10px;margin-top:51px;">
<div> <div>
<BasicTable class="ds-table" @register="registerTable1"> <BasicTable @selection-change="onSelectAmount" class="ds-table" @register="registerTable1">
<template #tableTitle> <template #tableTitle>
<div> <div>
<span class="bold">费用申请明细</span> <span class="bold">费用申请明细</span>
@ -123,6 +123,7 @@ import { BasicTable, useTable, TableAction } from '/@/components/Table'
import { detailColumns, detailSearchFormSchema, businessTypeList } from '../columns' import { detailColumns, detailSearchFormSchema, businessTypeList } from '../columns'
import { GetBizList, InvoiceApplicationGetFees, GetExchangeRate, GetCurrencies } from '../api.js' import { GetBizList, InvoiceApplicationGetFees, GetExchangeRate, GetCurrencies } from '../api.js'
import { useMessage } from '/@/hooks/web/useMessage' import { useMessage } from '/@/hooks/web/useMessage'
import { numberThousandFormat } from '/@/utils/commonUtil'
const { createMessage } = useMessage() const { createMessage } = useMessage()
import { useRoute } from 'vue-router' import { useRoute } from 'vue-router'
const route = useRoute() const route = useRoute()
@ -195,6 +196,9 @@ const [registerTable, { getForm, setSelectedRowKeys, getSelectRows, setProps, ge
return new Promise((resolve) => { return new Promise((resolve) => {
res.data.forEach((item, index) => { res.data.forEach((item, index) => {
item.cindex = index item.cindex = index
item.unBilledOther = numberThousandFormat(item.unBilledOther, 2, false)
item.unBilledUSD = numberThousandFormat(item.unBilledUSD, 2, false)
item.unBilledRMB = numberThousandFormat(item.unBilledRMB, 2, false)
}) })
resolve({ data: [...res.data], total: res.count }) resolve({ data: [...res.data], total: res.count })
}) })
@ -247,7 +251,7 @@ const [registerTable, { getForm, setSelectedRowKeys, getSelectRows, setProps, ge
canResize: true, canResize: true,
immediate: false, immediate: false,
}) })
const [registerTable1, { getSelectRows: getSelectRowsFee, setProps: setPropsFee, setTableData }] = useTable({ const [registerTable1, { getSelectRows: getSelectRowsFee, setProps: setPropsFee, setTableData,setSelectedRowKeys:setSelectedRowKeysRight }] = useTable({
columns: columns, columns: columns,
useSearchForm: false, useSearchForm: false,
showIndexColumn: false, showIndexColumn: false,
@ -328,7 +332,7 @@ function changeApply() {
arr.forEach(item => { arr.forEach(item => {
total += Number(item.applyAmount) total += Number(item.applyAmount)
}) })
totalRmb.value = total totalRmb.value = numberThousandFormat(total, 2, true)
emits('updateList', arr, 'isRMB') emits('updateList', arr, 'isRMB')
} }
} }
@ -353,7 +357,7 @@ function handleSureExhange() {
item.exchangeRate = 1 item.exchangeRate = 1
} }
}) })
totalRmb.value = total totalRmb.value = numberThousandFormat(total, 2, true)
setTimeout(() => { setTimeout(() => {
arr.forEach(item => { arr.forEach(item => {
item.originalCurrency = item.currency item.originalCurrency = item.currency
@ -434,12 +438,16 @@ function handleClick(record, index,type) {
queryCondition: JSON.stringify(arr) queryCondition: JSON.stringify(arr)
} }
loading.value = true loading.value = true
setSelectedRowKeysRight([])
InvoiceApplicationGetFees(data).then(res => { InvoiceApplicationGetFees(data).then(res => {
if (res.succeeded) { if (res.succeeded) {
dataSource.value = res.data.items dataSource.value = res.data.items
dataSource.value.forEach(item => { dataSource.value.forEach(item => {
item.applyAmount = item.restAmount ? item.restAmount : 0 item.applyAmount = item.restAmount ? item.restAmount : 0
item.applyAmount = item.applyAmount.toFixed(2) item.applyAmount = numberThousandFormat(item.applyAmount, 2, false)
item.restAmount = numberThousandFormat(item.restAmount, 2, false)
item.applyAmount = numberThousandFormat(item.applyAmount, 2, false)
item.amount = numberThousandFormat(item.amount, 2, false)
}) })
setTableData(dataSource.value) setTableData(dataSource.value)
} }
@ -454,16 +462,6 @@ function rowClassName(record, index) {
function init(data) { function init(data) {
open.value = true open.value = true
setTimeout(() => { setTimeout(() => {
setProps({
rowSelection: {
onChange: onSelectAmount
},
})
setPropsFee({
rowSelection: {
onChange: onSelectAmount
},
})
if (customerIdP.value) { if (customerIdP.value) {
getForm().setFieldsValue({ getForm().setFieldsValue({
customerId: customerIdP.value customerId: customerIdP.value
@ -491,6 +489,9 @@ function onSelectChange({ keys, rows }) {
usdTotal.value += Number(item.unBilledUSD) usdTotal.value += Number(item.unBilledUSD)
otherTotal.value += Number(item.unBilledOther) otherTotal.value += Number(item.unBilledOther)
}) })
rmbTotal.value = numberThousandFormat(rmbTotal.value, 2, false)
usdTotal.value = numberThousandFormat(usdTotal.value, 2, false)
otherTotal.value = numberThousandFormat(otherTotal.value, 2, false)
handleClick(rows[rows.length-1],rows.length,'select') handleClick(rows[rows.length-1],rows.length,'select')
} }
const emits = defineEmits(['updateList', 'addLeft']) const emits = defineEmits(['updateList', 'addLeft'])
@ -523,17 +524,16 @@ function handleAddDetial() {
const amountArr = ref([]) as any const amountArr = ref([]) as any
// //
function onSelectAmount() { function onSelectAmount() {
console.log(13212331)
const arr = getSelectRowsFee() const arr = getSelectRowsFee()
amountArr.value = [] amountArr.value = []
arr.forEach(item => { arr.forEach(item => {
amountArr.value.push({ amountArr.value.push({
currency: item.currency, currency: item.currency,
applyAmount: item.applyAmount ? Number(item.applyAmount).toFixed(2) : 0 applyAmount: numberThousandFormat(item.applyAmount, 2, false)
}) })
}) })
amountArr.value.forEach(item => { console.log(arr,amountArr.value)
item.applyAmount = Number(item.applyAmount)
})
amountArr.value = mergeByCurrency(amountArr.value) amountArr.value = mergeByCurrency(amountArr.value)
} }
// //
@ -542,9 +542,9 @@ function mergeByCurrency(arr) {
arr.forEach(item => { arr.forEach(item => {
if (result[item.currency]) { if (result[item.currency]) {
result[item.currency].applyAmount += item.applyAmount; result[item.currency].applyAmount += item.applyAmount;
result[item.currency].applyAmount = Number(result[item.currency].applyAmount.toFixed(2)) result[item.currency].applyAmount = numberThousandFormat(result[item.currency].applyAmount, 2, false)
} else { } else {
result[item.currency] = { currency: item.currency, applyAmount: Number(item.applyAmount.toFixed(2)) }; result[item.currency] = { currency: item.currency, applyAmount: numberThousandFormat(item.applyAmount, 2, false) };
} }
}); });
return Object.values(result); return Object.values(result);
@ -745,11 +745,11 @@ defineExpose({ init, changeCustIn })
color: #257afa; color: #257afa;
} }
:deep(.active-row) { // :deep(.active-row) {
.ant-table-cell { // .ant-table-cell {
background: #dfe8f6; // background: #dfe8f6;
} // }
} // }
:deep(.flex) { :deep(.flex) {
align-items: flex-end !important; align-items: flex-end !important;

@ -12,7 +12,7 @@
添加发票明细 添加发票明细
</a-button> </a-button>
<a-popconfirm title="确定要删除勾选的数据?" ok-text="" cancel-text="" @confirm="deleteRow"> <a-popconfirm title="确定要删除勾选的数据?" ok-text="" cancel-text="" @confirm="deleteRow">
<a-button v-if="resData.status!=2 && resData.status!=4" style="margin: 0 10px;" type="link"> <a-button v-if="resData.status != 2 && resData.status != 4" style="margin: 0 10px;" type="link">
<span class="iconfont icon-shanchu1"></span> <span class="iconfont icon-shanchu1"></span>
删除发票明细 删除发票明细
</a-button> </a-button>
@ -107,6 +107,7 @@ import {
// //
import { HotTable } from '@handsontable/vue3' import { HotTable } from '@handsontable/vue3'
import { registerAllModules } from 'handsontable/registry' import { registerAllModules } from 'handsontable/registry'
import { numberThousandFormat } from '/@/utils/commonUtil'
import { BasicTable, useTable, TableAction } from '/@/components/Table' import { BasicTable, useTable, TableAction } from '/@/components/Table'
import 'handsontable/dist/handsontable.full.min.css' import 'handsontable/dist/handsontable.full.min.css'
import { import {
@ -139,7 +140,7 @@ const [registerTable, { setTableData, setProps, getSelectRows, setLoading }] = u
indexColumnProps: { indexColumnProps: {
width: 60, width: 60,
}, },
id:'33', id: '33',
canResize: true, canResize: true,
immediate: false, immediate: false,
}) })
@ -190,7 +191,7 @@ const row = {
unitPrice: '', unitPrice: '',
taxUnitPrice: '', taxUnitPrice: '',
quantity: 1, quantity: 1,
unit: '', unit: '',
specification: '', specification: '',
applicationId: route.query.id ? route.query.id : 0, applicationId: route.query.id ? route.query.id : 0,
} }
@ -236,24 +237,9 @@ const columns = [
}, },
{ {
title: '单位', title: '单位',
width: 150, width: 40,
data: 'unit', data: 'unit',
type: 'dropdown', readOnly: true,
source: async (query, process) => {
if (unitDict.value && unitDict.value.length) {
const dict = unitDict.value.map((item) => {
return item.name
})
process(dict)
} else {
const results = await feeUnitDict()
unitDict.value = results
const dict = results.map((item) => {
return item.name
})
process(dict)
}
},
}, },
{ {
title: '数量', title: '数量',
@ -281,12 +267,18 @@ const columns = [
width: 150, width: 150,
data: 'amount', data: 'amount',
type: 'numeric', type: 'numeric',
numericFormat: {
pattern: '0,0.00'
}
}, },
{ {
title: '不含税金额', title: '不含税金额',
width: 150, width: 150,
data: 'noTaxAmount', data: 'noTaxAmount',
type: 'numeric', type: 'numeric',
numericFormat: {
pattern: '0,0.00'
}
}, },
{ {
title: '税率', title: '税率',
@ -299,6 +291,9 @@ const columns = [
width: 150, width: 150,
data: 'taxAmount', data: 'taxAmount',
type: 'numeric', type: 'numeric',
numericFormat: {
pattern: '0,0.00'
},
readOnly: true, readOnly: true,
}, },
] ]
@ -538,6 +533,13 @@ watchEffect(() => {
}) })
const resData = ref({}) const resData = ref({})
function init(data) { function init(data) {
data.details.forEach(item => {
item.applyAmount = numberThousandFormat(item.applyAmount, 2, true)
item.originalAmount = numberThousandFormat(item.originalAmount, 2, true)
})
data.invoiceDetails.forEach(item => {
item.unit = '票'
})
list.value = data.invoiceDetails ? data.invoiceDetails : [] list.value = data.invoiceDetails ? data.invoiceDetails : []
hotTb.value.hotInstance.loadData(data.invoiceDetails ? data.invoiceDetails : []) hotTb.value.hotInstance.loadData(data.invoiceDetails ? data.invoiceDetails : [])
dataSource.value = data.details ? data.details : [] dataSource.value = data.details ? data.details : []

@ -193,16 +193,12 @@ import { useMessage } from '/@/hooks/web/useMessage'
import { useRoute, useRouter } from 'vue-router' import { useRoute, useRouter } from 'vue-router'
import { import {
GetControllerClientList, GetControllerClientList,
GetCustomerServiceList,
} from '/@/views/operation/seaexport/api/BookingLedger' } from '/@/views/operation/seaexport/api/BookingLedger'
import { GetFeeCurrencySelectList, GetClientListByCode } from '/@/api/common' import { GetClientListByCode } from '/@/api/common'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { useGo } from '/@/hooks/web/usePage' import { useGo } from '/@/hooks/web/usePage'
import { useUserStore } from '/@/store/modules/user' import { useUserStore } from '/@/store/modules/user'
import { set } from 'nprogress' import { numberThousandFormat } from '/@/utils/commonUtil'
import { isNamedTupleMember } from 'typescript'
import { detailColumns } from '../columns'
import { get } from 'sortablejs'
import { useMultipleTabStore } from '/@/store/modules/multipleTab' import { useMultipleTabStore } from '/@/store/modules/multipleTab'
const tabStore = useMultipleTabStore() const tabStore = useMultipleTabStore()
const userStore = useUserStore() const userStore = useUserStore()
@ -224,7 +220,7 @@ const form = ref({
isRMB: false, isRMB: false,
isYB: false isYB: false
}) })
const totalRmb = ref(0) const totalRmb = ref('')
const amountArr = ref([]) as any const amountArr = ref([]) as any
// //
const invoiceEditFlag = ref(true) const invoiceEditFlag = ref(true)
@ -256,8 +252,56 @@ const bankForm = [
{ {
field: 'invoiceHeader', field: 'invoiceHeader',
label: '发票抬头', label: '发票抬头',
component: 'Input', component: 'Select',
colProps: { span: 24 }, colProps: { span: 24 },
componentProps: ({ formModel }) => {
return {
options: bankListAll.value,
mode: 'SECRET_COMBOBOX_MODE_DO_NOT_USE',
fieldNames: {
label: 'invoiceHeader',
value: 'invoiceHeader',
},
onChange: (e, obj) => {
if (obj) {
setFieldsValue({
taxID: obj.invoiceTaxNo,
customerAddTel: obj.invoiceAddress + ' ' + obj.invoiceTel
})
if (obj.currency == 'RMB') {
setFieldsValue({
customerBankId: obj.id,
customerBankName: obj.name,
})
setFieldsValue({
usdCustomerBankId:'',
usdCustomerBankName: '',
})
}
if (obj.currency == 'USD') {
setFieldsValue({
usdCustomerBankId: obj.id,
usdCustomerBankName: obj.name,
})
setFieldsValue({
customerBankId:'',
customerBankName: '',
})
}
}
if (!obj && !e) {
setFieldsValue({
customerBankId: '',
customerBankName: '',
usdCustomerBankId:'',
usdCustomerBankName: '',
taxID: '',
customerAddTel: '',
})
}
},
}
},
}, },
{ {
field: 'taxID', field: 'taxID',
@ -295,6 +339,7 @@ const bankForm = [
formModel.customerBankId = obj.id formModel.customerBankId = obj.id
setFieldsValue({ setFieldsValue({
invoiceHeader: obj.invoiceHeader, invoiceHeader: obj.invoiceHeader,
taxID: obj.invoiceTaxNo,
customerAddTel: obj.invoiceAddress + ' ' + obj.invoiceTel customerAddTel: obj.invoiceAddress + ' ' + obj.invoiceTel
}) })
} }
@ -302,6 +347,7 @@ const bankForm = [
formModel.customerBankId = '' formModel.customerBankId = ''
setFieldsValue({ setFieldsValue({
invoiceHeader: '', invoiceHeader: '',
taxID: '',
customerAddTel: '' customerAddTel: ''
}) })
} }
@ -331,9 +377,19 @@ const bankForm = [
onChange: (e, obj) => { onChange: (e, obj) => {
if (obj) { if (obj) {
formModel.usdCustomerBankId = obj.id formModel.usdCustomerBankId = obj.id
setFieldsValue({
invoiceHeader: obj.invoiceHeader,
taxID: obj.invoiceTaxNo,
customerAddTel: obj.invoiceAddress + ' ' + obj.invoiceTel
})
} }
if (!obj && !e) { if (!obj && !e) {
formModel.usdCustomerBankId = '' formModel.usdCustomerBankId = ''
setFieldsValue({
invoiceHeader: '',
taxID: '',
customerAddTel: ''
})
} }
}, },
} }
@ -450,6 +506,13 @@ const markFormS = [
}, },
] ]
const bottomForm = [ const bottomForm = [
{
field: 'id',
label: '',
component: 'Input',
show: false,
colProps: { span: 12 },
},
{ {
field: 'customerId', field: 'customerId',
label: '', label: '',
@ -475,6 +538,9 @@ const bottomForm = [
field: 'customerName', field: 'customerName',
component: 'ApiSelect', component: 'ApiSelect',
colProps: { span: 4 }, colProps: { span: 4 },
dynamicDisabled: ({ values }) => {
return values.id
},
componentProps: ({ formModel }) => { componentProps: ({ formModel }) => {
return { return {
api: GetClientListByCode, api: GetClientListByCode,
@ -513,6 +579,7 @@ const bottomForm = [
bankListUsd.value.push(item) bankListUsd.value.push(item)
} }
}) })
bankListAll.value = res.data
if (res.data.length > 0) { if (res.data.length > 0) {
setFieldsValue({ setFieldsValue({
customerBankId: res.data[0].id, customerBankId: res.data[0].id,
@ -521,6 +588,7 @@ const bottomForm = [
if (res.data[0].invoiceHeader) { if (res.data[0].invoiceHeader) {
setFieldsValue({ setFieldsValue({
invoiceHeader: res.data[0].invoiceHeader, invoiceHeader: res.data[0].invoiceHeader,
taxID: res.data[0].invoiceTaxNo,
customerAddTel: res.data[0].invoiceAddress + ' ' + res.data[0].invoiceTel customerAddTel: res.data[0].invoiceAddress + ' ' + res.data[0].invoiceTel
}) })
} else { } else {
@ -538,12 +606,6 @@ const bottomForm = [
}) })
} }
}) })
GetClientInfo({ id: obj.id }).then(res => {
setFieldsValue({
taxID: res.data.organizationCode
})
})
formModel.customerId = obj.id formModel.customerId = obj.id
feeTableRef.value.changeCust(obj.id) feeTableRef.value.changeCust(obj.id)
} }
@ -928,6 +990,7 @@ function getDetail() {
res.data.isYB = false res.data.isYB = false
res.data.summaryItems.forEach(item => { res.data.summaryItems.forEach(item => {
totalRmb.value += Number(item.amount) totalRmb.value += Number(item.amount)
totalRmb.value = numberThousandFormat(totalRmb.value, 2, true)
}) })
} else { } else {
form.value.isYB = true form.value.isYB = true
@ -955,6 +1018,7 @@ function openTempName() {
}) })
} }
const bankListUsd = ref([]) const bankListUsd = ref([])
const bankListAll = ref([])
function getBankInfo(customerId) { function getBankInfo(customerId) {
bankList.value = [] bankList.value = []
bankListUsd.value = [] bankListUsd.value = []
@ -983,6 +1047,7 @@ function getBankInfo(customerId) {
bankListUsd.value.push(item) bankListUsd.value.push(item)
} }
}) })
bankListAll.value = res.data
}) })
} }
@ -1018,39 +1083,26 @@ function changeCust(id, name) {
bankList.value = [] bankList.value = []
bankListUsd.value = [] bankListUsd.value = []
GetClientBankList(data).then((res) => { GetClientBankList(data).then((res) => {
res.data.reverse();
res.data.forEach((item) => { res.data.forEach((item) => {
item.name = item.bankName + ' ' + item.account item.name = item.bankName + ' ' + item.account
if (item.currency == 'RMB') { if (item.currency == 'RMB') {
item.invoiceAddress = item.invoiceAddress ? item.invoiceAddress :''
item.invoiceTel = item.invoiceTel ? item.invoiceTel :''
setFieldsValue({
customerBankId: item.id,
customerBankName: item.name,
invoiceHeader: item.invoiceHeader,
taxID: item.invoiceTaxNo,
customerAddTel: item.invoiceAddress + ' ' + item.invoiceTel
})
bankList.value.push(item) bankList.value.push(item)
} }
if (item.currency == 'USD') { if (item.currency == 'USD') {
bankListUsd.value.push(item) bankListUsd.value.push(item)
} }
}) })
if (res.data.length > 0) { bankListAll.value = res.data
setFieldsValue({
customerBankId: res.data[0].id,
customerBankName: res.data[0].name,
})
if (res.data[0].invoiceHeader) {
setFieldsValue({
invoiceHeader: res.data[0].invoiceHeader,
customerAddTel: res.data[0].invoiceAddress + ' ' + res.data[0].invoiceTel
})
} else {
setFieldsValue({
invoiceHeader: '',
customerAddTel: ''
})
}
} else {
setFieldsValue({
customerBankId: '',
customerBankName: '',
invoiceHeader: '',
customerAddTel: ''
})
}
setTimeout(() => { setTimeout(() => {
resolve(true); resolve(true);
}, 300) }, 300)
@ -1058,8 +1110,6 @@ function changeCust(id, name) {
} else { } else {
resolve(true); resolve(true);
} }
}) })
}); });
} }
@ -1172,11 +1222,13 @@ function mergeByCurrency(arr) {
arr.forEach(item => { arr.forEach(item => {
if (result[item.currency]) { if (result[item.currency]) {
result[item.currency].applyAmount += item.applyAmount; result[item.currency].applyAmount += item.applyAmount;
result[item.currency].applyAmount = Number(result[item.currency].applyAmount.toFixed(2)) result[item.currency].applyAmount = numberThousandFormat(result[item.currency].applyAmount, 2, true)
} else { } else {
result[item.currency] = { currency: item.currency, applyAmount: Number(item.applyAmount.toFixed(2)) }; result[item.currency] = { currency: item.currency, applyAmount: numberThousandFormat(item.applyAmount, 2, true) };
} }
}); });
console.log(Object.values(result))
return Object.values(result); return Object.values(result);
} }
const tempName = ref('') const tempName = ref('')

@ -131,6 +131,9 @@ const [registerTable, { reload, getForm, getSelectRows, getRawDataSource }] = us
api: async (p) => { api: async (p) => {
const res: API.DataResult = await GetList(p) const res: API.DataResult = await GetList(p)
return new Promise((resolve) => { return new Promise((resolve) => {
res.data.forEach(item=>{
item.applyAmount = item.applyAmount.toFixed(2)
})
resolve({ data: [...res.data], total: res.count }) resolve({ data: [...res.data], total: res.count })
}) })
}, },

@ -369,7 +369,7 @@ export const feeColumns: BasicColumn[] = [
}, },
{ {
title: '申请金额', title: '申请金额',
dataIndex: 'amount', dataIndex: 'applyAmount',
width: 80, width: 80,
}, },
{ {
@ -673,7 +673,7 @@ export const applyColumsDetail: BasicColumn[] = [
}, },
{ {
title: '申请金额', title: '申请金额',
dataIndex: 'orderAmount', dataIndex: 'applyAmount',
width: 100, width: 100,
}, },
{ {

@ -3,8 +3,7 @@
<a-modal width="1600px" @cancel="open = false" :visible="open" title="添加发票申请明细" :footer="null"> <a-modal width="1600px" @cancel="open = false" :visible="open" title="添加发票申请明细" :footer="null">
<div style="padding-bottom:5px ;"> <div style="padding-bottom:5px ;">
<div> <div>
<BasicTable :rowClassName="rowClassName" class="ds-table" @row-click="handleClick" <BasicTable @selection-change="onSelectChangeApply" class="ds-table" @row-click="handleClick" @register="registerTable">
@register="registerTable">
<template #right> <template #right>
<div style="width: 40%;margin-left: 10px;"> <div style="width: 40%;margin-left: 10px;">
<div> <div>
@ -90,7 +89,7 @@
<a-modal width="1600px" @cancel="freeFlag = false" :visible="freeFlag" title="添加发票申请明细" :footer="null"> <a-modal width="1600px" @cancel="freeFlag = false" :visible="freeFlag" title="添加发票申请明细" :footer="null">
<div style="padding-bottom:5px ;"> <div style="padding-bottom:5px ;">
<div> <div>
<BasicTable :rowClassName="rowClassName" class="ds-table" @row-click="handleClickFree" <BasicTable @selection-change="onSelectChange" class="ds-table" @row-click="handleClickFree"
@register="registerTableFree"> @register="registerTableFree">
<template #right> <template #right>
<div style="width: 40%;margin-left: 10px;"> <div style="width: 40%;margin-left: 10px;">
@ -169,6 +168,7 @@ import { BasicTable, useTable, TableAction } from '/@/components/Table'
import { applyColums, applySearch, applyColumsDetail, freeSearch, freeColums } from '../columns' import { applyColums, applySearch, applyColumsDetail, freeSearch, freeColums } from '../columns'
import { GetApplicationList, GetApplicationDetails, GetExchangeRate, FreeInvoiceGetBizList, FreeInvoiceGetFees, GetCurrencies } from '../api.js' import { GetApplicationList, GetApplicationDetails, GetExchangeRate, FreeInvoiceGetBizList, FreeInvoiceGetFees, GetCurrencies } from '../api.js'
import { useMessage } from '/@/hooks/web/useMessage' import { useMessage } from '/@/hooks/web/useMessage'
import { numberThousandFormat } from '/@/utils/commonUtil'
const { createMessage } = useMessage() const { createMessage } = useMessage()
import { useRoute } from 'vue-router' import { useRoute } from 'vue-router'
const route = useRoute() const route = useRoute()
@ -243,6 +243,7 @@ const [registerTable, { getForm, setSelectedRowKeys, getSelectRows, setProps, ge
item.amountOtherTotal = item.amountOther item.amountOtherTotal = item.amountOther
item.amountRMBTotal = item.amountRMB item.amountRMBTotal = item.amountRMB
item.cindex = index item.cindex = index
item.applyAmount = numberThousandFormat(item.applyAmount, 2, false)
}) })
return new Promise((resolve) => { return new Promise((resolve) => {
resolve({ data: [...res.data], total: res.count }) resolve({ data: [...res.data], total: res.count })
@ -294,6 +295,9 @@ const [registerTableFree, { getForm: getFormFree, setSelectedRowKeys: setSelecte
return new Promise((resolve) => { return new Promise((resolve) => {
res.data.forEach((item, index) => { res.data.forEach((item, index) => {
item.cindex = index item.cindex = index
item.unBilledOther = numberThousandFormat(item.unBilledOther, 2, false)
item.unBilledUSD = numberThousandFormat(item.unBilledUSD, 2, false)
item.unBilledRMB = numberThousandFormat(item.unBilledRMB, 2, false)
}) })
resolve({ data: [...res.data], total: res.count }) resolve({ data: [...res.data], total: res.count })
}) })
@ -309,9 +313,6 @@ const [registerTableFree, { getForm: getFormFree, setSelectedRowKeys: setSelecte
labelWidth: 120, labelWidth: 120,
schemas: freeSearch, schemas: freeSearch,
}, },
rowSelection: {
onChange: onSelectChange
},
useSearchForm: true, useSearchForm: true,
showIndexColumn: false, showIndexColumn: false,
rowKey: 'cindex', rowKey: 'cindex',
@ -349,15 +350,22 @@ const [registerTableFreeDetail, { getSelectRows: getSelectRowsFeeDetail, setProp
const rmbTotal = ref(0) const rmbTotal = ref(0)
const usdTotal = ref(0) const usdTotal = ref(0)
const otherTotal = ref(0) const otherTotal = ref(0)
function onSelectChange(selectedRowKeys) { function onSelectChange({ keys, rows }) {
rmbTotal.value = 0 rmbTotal.value = 0
usdTotal.value = 0 usdTotal.value = 0
otherTotal.value = 0 otherTotal.value = 0
selectedRowKeys.forEach(item => { rows.forEach(item => {
rmbTotal.value += Number(item.unBilledRMB) rmbTotal.value += Number(item.unBilledRMB)
usdTotal.value += Number(item.unBilledUSD) usdTotal.value += Number(item.unBilledUSD)
otherTotal.value += Number(item.unBilledOther) otherTotal.value += Number(item.unBilledOther)
}) })
rmbTotal.value = numberThousandFormat(rmbTotal.value, 2, false)
usdTotal.value = numberThousandFormat(usdTotal.value, 2, false)
otherTotal.value = numberThousandFormat(otherTotal.value, 2, false)
handleClickFree(rows[rows.length - 1], rows.length, 'select')
}
function onSelectChangeApply({ keys, rows }){
handleClick(rows[rows.length - 1], rows.length, 'select')
} }
function handleAddDetial() { function handleAddDetial() {
@ -590,9 +598,11 @@ function handleSureExhange() {
} }
} }
const activeRow = ref(null) const activeRow = ref(null)
function handleClick(record, index) { function handleClick(record, index, type) {
if (type != 'select') {
setSelectedRowKeys([index]) setSelectedRowKeys([index])
activeRow.value = index activeRow.value = index
}
const data = { const data = {
ids: [record.id], ids: [record.id],
businessType: record.businessType, businessType: record.businessType,
@ -604,14 +614,18 @@ function handleClick(record, index) {
dataSource.value.forEach(item => { dataSource.value.forEach(item => {
item.applyAmount = item.restAmount ? item.restAmount : 0 item.applyAmount = item.restAmount ? item.restAmount : 0
item.applyAmount = item.applyAmount.toFixed(2) item.applyAmount = item.applyAmount.toFixed(2)
item.originalAmount = numberThousandFormat(item.originalAmount, 2, false)
}) })
setTableData(dataSource.value) setTableData(dataSource.value)
} }
loading.value = false loading.value = false
}) })
} }
function handleClickFree(record, index) { function handleClickFree(record, index, type) {
if (type != 'select') {
setSelectedRowKeysFree([index]) setSelectedRowKeysFree([index])
activeRow.value = index
}
const queryDataStr = JSON.parse(queryDataFree.value.queryCondition) const queryDataStr = JSON.parse(queryDataFree.value.queryCondition)
const arr = [] as any const arr = [] as any
queryDataStr.forEach(item => { queryDataStr.forEach(item => {
@ -643,7 +657,10 @@ function handleClickFree(record, index) {
freeDetailList.value = res.data.items freeDetailList.value = res.data.items
freeDetailList.value.forEach(item => { freeDetailList.value.forEach(item => {
item.applyAmount = item.restAmount ? item.restAmount : 0 item.applyAmount = item.restAmount ? item.restAmount : 0
item.applyAmount = item.applyAmount.toFixed(2) item.applyAmount = numberThousandFormat(item.applyAmount, 2, false)
item.restAmount = numberThousandFormat(item.restAmount, 2, false)
item.applyAmount = numberThousandFormat(item.applyAmount, 2, false)
item.amount = numberThousandFormat(item.amount, 2, false)
}) })
setTableDataDetail(freeDetailList.value) setTableDataDetail(freeDetailList.value)
} }
@ -666,21 +683,12 @@ function init(data) {
customerName: customerIdPName.value customerName: customerIdPName.value
}) })
} else { } else {
console.log(customerIdP.value, customerIdPName.value)
getForm().setFieldsValue({ getForm().setFieldsValue({
customerId: customerIdP.value, customerId: customerIdP.value,
customerName: customerIdPName.value customerName: customerIdPName.value
}) })
} }
} }
watch(
() => getSelectRowsFree(),
(data) => {
onSelectChange(data)
},
{ immediate: false, deep: true }
)
}, 200) }, 200)
} }
@ -917,7 +925,7 @@ defineExpose({ init, customerIdP, customerIdPName })
:deep(.active-row) { :deep(.active-row) {
.ant-table-cell { .ant-table-cell {
background: #dfe8f6; // background: #dfe8f6;
} }
} }

@ -2,7 +2,7 @@
<div class="main"> <div class="main">
<a-spin :spinning="loading"> <a-spin :spinning="loading">
<div class="infoclientBox"> <div class="infoclientBox">
<div style="display: flex; align-items: center"> <div class="right-b" style="display: flex; align-items: center">
<a-tooltip placement="top" :mouseEnterDelay="0.5" v-if="route.query.id"> <a-tooltip placement="top" :mouseEnterDelay="0.5" v-if="route.query.id">
<template #title> <template #title>
<span>新建</span> <span>新建</span>
@ -36,13 +36,13 @@
</span> </span>
</a-tooltip> </a-tooltip>
</div> </div>
<div style="color: #17a6a3" class="right-b" v-if="route.query.id && form.isLocked"> <!-- <div style="color: #17a6a3" class="right-b" v-if="route.query.id && form.isLocked">
<span class="iconfont icon-locksuo"></span>锁定 <span class="iconfont icon-locksuo"></span>锁定
</div> </div>
<div style="color: #7a8798" class="right-b" v-if="!route.query.id || !form.isLocked"> <div style="color: #7a8798" class="right-b" v-if="!route.query.id || !form.isLocked">
<span class="iconfont icon-a-jiesuo1_jiesuo"></span>未锁定 <span class="iconfont icon-a-jiesuo1_jiesuo"></span>未锁定
</div> </div> -->
<div style="color: #3081fa" class="right-b" v-if="route.query.type == 'apply'"> <!-- <div style="color: #3081fa" class="right-b" v-if="route.query.type == 'apply'">
<span class="iconfont icon-dingdan"></span>申请开票 <span class="iconfont icon-dingdan"></span>申请开票
</div> </div>
<div style="color: #3081fa" class="right-b" v-if="route.query.type == 'free'"> <div style="color: #3081fa" class="right-b" v-if="route.query.type == 'free'">
@ -50,7 +50,7 @@
</div> </div>
<div style="color: rgba(122, 135, 152, 1)" class="right-b"> <div style="color: rgba(122, 135, 152, 1)" class="right-b">
<span class="iconfont icon-a-xiaopiaofapiao-01"></span>普票 <span class="iconfont icon-a-xiaopiaofapiao-01"></span>普票
</div> </div> -->
<!-- <div style="color: rgba(37, 122, 250, 1)" class="right-b" v-if="route.query.id"> <!-- <div style="color: rgba(37, 122, 250, 1)" class="right-b" v-if="route.query.id">
<span class="iconfont icon-a-xiaopiaofapiao-01"></span>红票 <span class="iconfont icon-a-xiaopiaofapiao-01"></span>红票
</div> </div>
@ -59,7 +59,7 @@
</div> --> </div> -->
<div> <div>
<a-popconfirm title="确定申请开票吗?" ok-text="" cancel-text="" @confirm="handleIssue"> <a-popconfirm title="确定申请开票吗?" ok-text="" cancel-text="" @confirm="handleIssue">
<a-button v-repeat type="link" v-if="route.query.id"> <a-button v-repeat type="link" v-if="route.query.id && form.status!='已开票'">
<span class="iconfont icon-touzijilu"></span>开票 <span class="iconfont icon-touzijilu"></span>开票
</a-button> </a-button>
</a-popconfirm> </a-popconfirm>
@ -131,9 +131,14 @@
<span>{{ form.invoiceNO }}</span> <span>{{ form.invoiceNO }}</span>
</template> </template>
</editCompent> </editCompent>
<editCompent :showEdit="false" ref="editCompentRef" label="发票流水号:"> <editCompent :showEdit="false" ref="editCompentRef" label="是否结算:">
<template #text>
<span>{{ form.isSettledName }}</span>
</template>
</editCompent>
<editCompent :showEdit="false" ref="editCompentRef" label="开票状态:">
<template #text> <template #text>
<span>{{ form.sn }}</span> <span>{{ form.status }}</span>
</template> </template>
</editCompent> </editCompent>
</div> </div>
@ -415,7 +420,7 @@ import applyInvoice from './applyInvoice.vue'
import invoiceFile from './invoiceFile.vue' import invoiceFile from './invoiceFile.vue'
import { DownOutlined } from '@ant-design/icons-vue' import { DownOutlined } from '@ant-design/icons-vue'
import { import {
GetInvoiceCodeList, GetUserListAll, DeleteInvoiceDetail,ApiQuery, GetInvoiceCodeList, GetUserListAll, DeleteInvoiceDetail, ApiQuery,
GeneralInvoiceSave, GeneralInvoiceGet, FreeInvoiceSave, Reverse, GeneralInvoiceSave, GeneralInvoiceGet, FreeInvoiceSave, Reverse,
GeneralInvoiceGetList, GeneralInvoiceInitiate, GetClientBankList GeneralInvoiceGetList, GeneralInvoiceInitiate, GetClientBankList
} from '../api' } from '../api'
@ -426,14 +431,13 @@ import {
GetCustomerServiceList, GetCustomerServiceList,
} from '/@/views/operation/seaexport/api/BookingLedger' } from '/@/views/operation/seaexport/api/BookingLedger'
import { GetFeeCurrencySelectList, GetClientListByCode } from '/@/api/common' import { GetFeeCurrencySelectList, GetClientListByCode } from '/@/api/common'
import dayjs from 'dayjs'
import { BasicTable, useTable, TableAction } from '/@/components/Table' import { BasicTable, useTable, TableAction } from '/@/components/Table'
import { useGo } from '/@/hooks/web/usePage' import { useGo } from '/@/hooks/web/usePage'
import { useUserStore } from '/@/store/modules/user' import { useUserStore } from '/@/store/modules/user'
import { isNamedTupleMember } from 'typescript'
import { detailColumnsRight, feeColumnsDetail } from '../columns' import { detailColumnsRight, feeColumnsDetail } from '../columns'
import { HotTable } from '@handsontable/vue3' import { HotTable } from '@handsontable/vue3'
import { useMultipleTabStore } from '/@/store/modules/multipleTab' import { useMultipleTabStore } from '/@/store/modules/multipleTab'
import { numberThousandFormat } from '/@/utils/commonUtil'
const tabStore = useMultipleTabStore() const tabStore = useMultipleTabStore()
const userStore = useUserStore() const userStore = useUserStore()
import { registerAllModules } from 'handsontable/registry' import { registerAllModules } from 'handsontable/registry'
@ -452,20 +456,6 @@ const detailForm = [
span: 24, span: 24,
}, },
}, },
{
field: 'isSettledName',
label: '是否结算',
component: 'Input',
dynamicDisabled: true,
colProps: { span: 12 },
},
{
field: 'status',
label: '开票状态',
component: 'Input',
dynamicDisabled: true,
colProps: { span: 12 },
},
{ {
label: '系统客户', label: '系统客户',
field: 'customerName', field: 'customerName',
@ -498,6 +488,20 @@ const detailForm = [
} }
}, },
}, },
{
field: 'modeText',
label: '发票类别',
component: 'Input',
dynamicDisabled: true,
colProps: { span: 12 },
},
{
field: 'isLockedName',
label: '是否锁定',
component: 'Input',
dynamicDisabled: true,
colProps: { span: 12 },
},
{ {
field: 'divider-selects1', field: 'divider-selects1',
component: 'Divider', component: 'Divider',
@ -715,7 +719,8 @@ const invoiceNO = ref('')
const editCompentRef = ref() const editCompentRef = ref()
const form = ref({ const form = ref({
category: '全电普票(电子)', category: '全电普票(电子)',
categoryCode: 'pc' categoryCode: 'pc',
status:'未开票'
}) as any }) as any
const currencyList = ref([]) as any const currencyList = ref([]) as any
const customerList = ref([]) as any const customerList = ref([]) as any
@ -782,6 +787,9 @@ function getDetail() {
GeneralInvoiceGet({ id: route.query.id }).then(res => { GeneralInvoiceGet({ id: route.query.id }).then(res => {
if (res.succeeded) { if (res.succeeded) {
form.value = res.data form.value = res.data
res.data.invoiceDetails.forEach(item => {
item.unit = '票'
})
list.value = res.data.invoiceDetails ? res.data.invoiceDetails : [] list.value = res.data.invoiceDetails ? res.data.invoiceDetails : []
hotTb.value.hotInstance.loadData(res.data.invoiceDetails ? res.data.invoiceDetails : []) hotTb.value.hotInstance.loadData(res.data.invoiceDetails ? res.data.invoiceDetails : [])
if (res.data.isSettled) { if (res.data.isSettled) {
@ -789,6 +797,11 @@ function getDetail() {
} else { } else {
res.data.isSettledName = '否' res.data.isSettledName = '否'
} }
if (res.data.isLocked) {
res.data.isLockedName = '是'
} else {
res.data.isLockedName = '否'
}
if (res.data.invoiceNO) { if (res.data.invoiceNO) {
res.data.status = '已开票' res.data.status = '已开票'
} else { } else {
@ -804,6 +817,12 @@ function getDetail() {
res.data.cellPhoneNOFlag = true res.data.cellPhoneNOFlag = true
} }
}) })
res.data.applyAmount = numberThousandFormat(res.data.applyAmount, 2, false)
res.data.otherInvoiceAmount = numberThousandFormat(res.data.otherInvoiceAmount, 2, false)
res.data.invoiceAmount = numberThousandFormat(res.data.invoiceAmount, 2, false)
res.data.applications.forEach(item=>{
item.applyAmount = numberThousandFormat(item.applyAmount, 2, false)
})
getCustomerInfo(res.data.customerId) getCustomerInfo(res.data.customerId)
setTableData(res.data.applications) setTableData(res.data.applications)
setFieldsValue(res.data) setFieldsValue(res.data)
@ -817,18 +836,18 @@ const handFlag = ref(false)
function openHand() { function openHand() {
handFlag.value = true handFlag.value = true
} }
function lookInvoice(){ function lookInvoice() {
loading.value = true loading.value = true
ApiQuery({id:route.query.id}).then(res=>{ ApiQuery({ id: route.query.id }).then(res => {
if(res.succeeded){ if (res.succeeded) {
if(res.data[0].pdfUrl){ if (res.data[0].pdfUrl) {
window.open(res.data[0].pdfUrl) window.open(res.data[0].pdfUrl)
} else { } else {
createMessage.warning('开票中') createMessage.warning('开票中')
} }
} }
loading.value = false loading.value = false
}).catch(()=>{ }).catch(() => {
loading.value = false loading.value = false
}) })
} }
@ -840,7 +859,7 @@ const router = useRouter()
const go = useGo() const go = useGo()
const redloading = ref(false) const redloading = ref(false)
// (rmb) // (rmb)
function updateListFreeLeft(val,arrQuery) { function updateListFreeLeft(val, arrQuery) {
const data = { const data = {
invoice: { invoice: {
...form.value, ...form.value,
@ -1072,7 +1091,7 @@ const row = {
unitPrice: '', unitPrice: '',
taxUnitPrice: '', taxUnitPrice: '',
quantity: 1, quantity: 1,
unit: '', unit: '',
specification: '', specification: '',
} }
// //
@ -1194,24 +1213,9 @@ const columns = [
}, },
{ {
title: '单位', title: '单位',
width: 120, width: 40,
data: 'unit', data: 'unit',
type: 'dropdown', readOnly: true,
source: async (query, process) => {
if (unitDict.value && unitDict.value.length) {
const dict = unitDict.value.map((item) => {
return item.name
})
process(dict)
} else {
const results = await feeUnitDict()
unitDict.value = results
const dict = results.map((item) => {
return item.name
})
process(dict)
}
},
}, },
{ {
title: '数量', title: '数量',
@ -1239,12 +1243,18 @@ const columns = [
width: 80, width: 80,
data: 'amount', data: 'amount',
type: 'numeric', type: 'numeric',
numericFormat: {
pattern: '0,0.00'
}
}, },
{ {
title: '不含税金额', title: '不含税金额',
width: 100, width: 100,
data: 'noTaxAmount', data: 'noTaxAmount',
type: 'numeric', type: 'numeric',
numericFormat: {
pattern: '0,0.00'
}
}, },
{ {
title: '税率', title: '税率',

@ -106,21 +106,26 @@
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, reactive, onMounted, defineExpose, computed } from 'vue' import { ref } from 'vue'
import { GeneralInvoiceGetList, GeneralInvoiceSetLock, GeneralInvoiceDelete } from './api.js' import { GeneralInvoiceGetList, GeneralInvoiceSetLock, GeneralInvoiceDelete } from './api.js'
import { BasicTable, useTable, TableAction } from '/@/components/Table' import { BasicTable, useTable, TableAction } from '/@/components/Table'
import { formatParams } from '/@/hooks/web/common' import { formatParams } from '/@/hooks/web/common'
import { columns, searchFormSchema, detailColumns, feeColumns, feeColumnsSum } from './columns' import { columns, searchFormSchema } from './columns'
import { useMessage } from '/@/hooks/web/useMessage' import { useMessage } from '/@/hooks/web/useMessage'
import { numberThousandFormat } from '/@/utils/commonUtil'
const { createMessage } = useMessage() const { createMessage } = useMessage()
import { useGo } from '/@/hooks/web/usePage' import { useGo } from '/@/hooks/web/usePage'
const go = useGo() const go = useGo()
const [registerTable, { reload, setLoading, getSelectRows, getForm }] = useTable({ const [registerTable, { reload, setLoading, getSelectRows, getForm }] = useTable({
api: async (p) => { api: async (p) => {
const res: API.DataResult = await GeneralInvoiceGetList(p) const res: API.DataResult = await GeneralInvoiceGetList(p)
invoiceAmount.value = res.data.invoiceAmount invoiceAmount.value = numberThousandFormat(res.data.invoiceAmount, 2, true)
applyAmount.value = res.data.applyAmount applyAmount.value = numberThousandFormat(res.data.applyAmount, 2, true)
return new Promise((resolve) => { return new Promise((resolve) => {
res.data.list.forEach(item=>{
item.applyAmount = numberThousandFormat(item.applyAmount, 2, true)
item.invoiceAmount = numberThousandFormat(item.invoiceAmount, 2, true)
})
resolve({ data: [...res.data.list], total: res.count }) resolve({ data: [...res.data.list], total: res.count })
}) })
}, },

Loading…
Cancel
Save