zth
sunzehua 2 weeks ago
parent 69af72a99c
commit cc88b6dff5

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

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

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

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

@ -96,6 +96,7 @@ import { BasicTable, useTable, TableAction } from '/@/components/Table'
import { formatParams } from '/@/hooks/web/common'
import { columns, searchFormSchema, detailColumns, feeColumns, feeColumnsSum } from './columns'
import { useMessage } from '/@/hooks/web/useMessage'
import { numberThousandFormat } from '/@/utils/commonUtil'
import { SvgIcon } from '/@/components/Icon'
const { createMessage } = useMessage()
import { useGo } from '/@/hooks/web/usePage'
@ -104,6 +105,11 @@ const [registerTable, { reload, setLoading, getSelectRows, getForm }] = useTable
api: async (p) => {
const res: API.DataResult = await PaymentSettlementGetList(p)
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 })
})
},

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

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

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

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

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

@ -12,7 +12,7 @@
添加发票明细
</a-button>
<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>
删除发票明细
</a-button>
@ -107,6 +107,7 @@ import {
//
import { HotTable } from '@handsontable/vue3'
import { registerAllModules } from 'handsontable/registry'
import { numberThousandFormat } from '/@/utils/commonUtil'
import { BasicTable, useTable, TableAction } from '/@/components/Table'
import 'handsontable/dist/handsontable.full.min.css'
import {
@ -139,7 +140,7 @@ const [registerTable, { setTableData, setProps, getSelectRows, setLoading }] = u
indexColumnProps: {
width: 60,
},
id:'33',
id: '33',
canResize: true,
immediate: false,
})
@ -190,7 +191,7 @@ const row = {
unitPrice: '',
taxUnitPrice: '',
quantity: 1,
unit: '',
unit: '',
specification: '',
applicationId: route.query.id ? route.query.id : 0,
}
@ -236,24 +237,9 @@ const columns = [
},
{
title: '单位',
width: 150,
width: 40,
data: 'unit',
type: 'dropdown',
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)
}
},
readOnly: true,
},
{
title: '数量',
@ -281,12 +267,18 @@ const columns = [
width: 150,
data: 'amount',
type: 'numeric',
numericFormat: {
pattern: '0,0.00'
}
},
{
title: '不含税金额',
width: 150,
data: 'noTaxAmount',
type: 'numeric',
numericFormat: {
pattern: '0,0.00'
}
},
{
title: '税率',
@ -299,6 +291,9 @@ const columns = [
width: 150,
data: 'taxAmount',
type: 'numeric',
numericFormat: {
pattern: '0,0.00'
},
readOnly: true,
},
]
@ -538,6 +533,13 @@ watchEffect(() => {
})
const resData = ref({})
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 : []
hotTb.value.hotInstance.loadData(data.invoiceDetails ? data.invoiceDetails : [])
dataSource.value = data.details ? data.details : []

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

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

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

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

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

@ -106,21 +106,26 @@
</div>
</template>
<script setup lang="ts">
import { ref, reactive, onMounted, defineExpose, computed } from 'vue'
import { ref } from 'vue'
import { GeneralInvoiceGetList, GeneralInvoiceSetLock, GeneralInvoiceDelete } from './api.js'
import { BasicTable, useTable, TableAction } from '/@/components/Table'
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 { numberThousandFormat } from '/@/utils/commonUtil'
const { createMessage } = useMessage()
import { useGo } from '/@/hooks/web/usePage'
const go = useGo()
const [registerTable, { reload, setLoading, getSelectRows, getForm }] = useTable({
api: async (p) => {
const res: API.DataResult = await GeneralInvoiceGetList(p)
invoiceAmount.value = res.data.invoiceAmount
applyAmount.value = res.data.applyAmount
invoiceAmount.value = numberThousandFormat(res.data.invoiceAmount, 2, true)
applyAmount.value = numberThousandFormat(res.data.applyAmount, 2, true)
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 })
})
},

Loading…
Cancel
Save