|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
<template>
|
|
|
|
|
<a-modal width="1400px" @cancel="open = false" :visible="open" title="添加发票申请明细" @ok="handleOk">
|
|
|
|
|
<BasicTable class="ds-table" @register="registerTable" @row-dbClick="(e) => {
|
|
|
|
|
<a-modal width="1400px" @cancel="open = false" :visible="open" title="添加发票申请明细" :footer="null">
|
|
|
|
|
<BasicTable class="ds-table" @row-click="handleClick" @register="registerTable" @row-dbClick="(e) => {
|
|
|
|
|
GoDetailed(true, e)
|
|
|
|
|
}
|
|
|
|
|
">
|
|
|
|
@ -14,22 +14,53 @@
|
|
|
|
|
</a-button>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:bodyCell="{ column, record }">
|
|
|
|
|
|
|
|
|
|
<template v-if="column.dataIndex == 'businessType'">
|
|
|
|
|
<span v-if="record.businessType == 1">海运出口</span>
|
|
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
<template #footer>
|
|
|
|
|
<div class="total">
|
|
|
|
|
<span style="margin-right: 10px;">合计:</span>
|
|
|
|
|
<span class="total-item">
|
|
|
|
|
<span class="text">RMB未开:</span>
|
|
|
|
|
<span class="number">{{ rmbTotal }}</span>
|
|
|
|
|
</span>
|
|
|
|
|
<span class="total-item">
|
|
|
|
|
<span class="text">USD未开:</span>
|
|
|
|
|
<span class="number">{{ usdTotal }}</span>
|
|
|
|
|
</span>
|
|
|
|
|
<span class="total-item">
|
|
|
|
|
<span class="text">其他未开:</span>
|
|
|
|
|
<span class="number">{{ otherTotal }}</span>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</BasicTable>
|
|
|
|
|
<div>
|
|
|
|
|
<a-button type="link" @click="handleAddDetial">
|
|
|
|
|
<span class="iconfont icon-jia"></span>
|
|
|
|
|
添加
|
|
|
|
|
</a-button>
|
|
|
|
|
</div>
|
|
|
|
|
<a-table rowKey="feeId" :row-selection="{ selectedRowKeys: selectedRowKeysDetial, onChange: onSelectChangeDetail }"
|
|
|
|
|
:loading="loading" :columns="columns" :data-source="dataSource" bordered>
|
|
|
|
|
<template v-slot:bodyCell="{ column, record }">
|
|
|
|
|
<template v-if="column.dataIndex == 'applyAmount'">
|
|
|
|
|
<a-input-number size="small" :controls="false" :max="record.restAmount" v-model:value="record.applyAmount"/>
|
|
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
</a-table>
|
|
|
|
|
</a-modal>
|
|
|
|
|
</template>
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import { formatParams } from '/@/hooks/web/common'
|
|
|
|
|
import { ref, defineExpose, unref } from 'vue'
|
|
|
|
|
import { BasicTable, useTable, TableAction } from '/@/components/Table'
|
|
|
|
|
import { detailColumns, detailSearchFormSchema } from '../columns'
|
|
|
|
|
import { GetBizList } from '../api.js'
|
|
|
|
|
import { detailColumns, detailSearchFormSchema, businessTypeList } from '../columns'
|
|
|
|
|
import { GetBizList, InvoiceApplicationGetFees,InvoiceApplicationSave } from '../api.js'
|
|
|
|
|
const open = ref(false)
|
|
|
|
|
function init() {
|
|
|
|
|
open.value = true
|
|
|
|
|
}
|
|
|
|
|
const [registerTable, { getForm, getPaginationRef, getSelectRows, getRawDataSource }] = useTable({
|
|
|
|
|
|
|
|
|
|
const [registerTable, { getForm, setSelectedRowKeys, getSelectRows, setProps, getRawDataSource }] = useTable({
|
|
|
|
|
api: async (p) => {
|
|
|
|
|
const res: API.DataResult = await GetBizList(p)
|
|
|
|
|
return new Promise((resolve) => {
|
|
|
|
@ -47,18 +78,171 @@ const [registerTable, { getForm, getPaginationRef, getSelectRows, getRawDataSour
|
|
|
|
|
labelWidth: 120,
|
|
|
|
|
schemas: detailSearchFormSchema,
|
|
|
|
|
},
|
|
|
|
|
isTreeTable: false,
|
|
|
|
|
useSearchForm: true,
|
|
|
|
|
maxHeight: '600',
|
|
|
|
|
pagination: true,
|
|
|
|
|
striped: true,
|
|
|
|
|
useSearchForm: true,
|
|
|
|
|
showTableSetting: true,
|
|
|
|
|
rowKey: 'id',
|
|
|
|
|
bordered: true,
|
|
|
|
|
showIndexColumn: true,
|
|
|
|
|
indexColumnProps: {
|
|
|
|
|
width: 60,
|
|
|
|
|
},
|
|
|
|
|
canResize: true,
|
|
|
|
|
immediate: false,
|
|
|
|
|
})
|
|
|
|
|
const dataSource = ref([]) as any
|
|
|
|
|
const columns = [
|
|
|
|
|
{
|
|
|
|
|
title: '结费单位',
|
|
|
|
|
dataIndex: 'customerName',
|
|
|
|
|
width: '100',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '收付',
|
|
|
|
|
dataIndex: 'feeType',
|
|
|
|
|
width: '100',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '费用名称',
|
|
|
|
|
dataIndex: 'feeName',
|
|
|
|
|
width: '100',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '金额',
|
|
|
|
|
dataIndex: 'amount',
|
|
|
|
|
width: '100',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '币别',
|
|
|
|
|
dataIndex: 'currency',
|
|
|
|
|
width: '100',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '未开票金额',
|
|
|
|
|
dataIndex: 'restAmount',
|
|
|
|
|
width: '100',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '本次开票金额',
|
|
|
|
|
dataIndex: 'applyAmount',
|
|
|
|
|
width: '100',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '原始汇率',
|
|
|
|
|
dataIndex: 'exchangeRate',
|
|
|
|
|
width: '100',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '录入人',
|
|
|
|
|
dataIndex: 'createByName',
|
|
|
|
|
width: '100',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '销项/进项',
|
|
|
|
|
dataIndex: 'name',
|
|
|
|
|
width: '100',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '录入方式',
|
|
|
|
|
dataIndex: 'inputMethod',
|
|
|
|
|
width: '100',
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
]
|
|
|
|
|
const loading = ref(false)
|
|
|
|
|
function handleClick(record, index) {
|
|
|
|
|
setSelectedRowKeys([record.id])
|
|
|
|
|
const data = {
|
|
|
|
|
id: record.id,
|
|
|
|
|
businessType: record.businessType
|
|
|
|
|
}
|
|
|
|
|
loading.value = true
|
|
|
|
|
InvoiceApplicationGetFees([data]).then(res => {
|
|
|
|
|
if (res.succeeded) {
|
|
|
|
|
dataSource.value = res.data.items
|
|
|
|
|
dataSource.value.forEach(item=>{
|
|
|
|
|
item.applyAmount = item.restAmount ? item.restAmount : 0
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
loading.value = false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
function init() {
|
|
|
|
|
open.value = true
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
setProps({
|
|
|
|
|
rowSelection: {
|
|
|
|
|
onChange: onSelectChange
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
}, 500)
|
|
|
|
|
}
|
|
|
|
|
const rmbTotal = ref(0)
|
|
|
|
|
const usdTotal = ref(0)
|
|
|
|
|
const otherTotal = ref(0)
|
|
|
|
|
function onSelectChange(selectedRowKeys) {
|
|
|
|
|
const list = getRawDataSource()
|
|
|
|
|
rmbTotal.value = 0
|
|
|
|
|
usdTotal.value = 0
|
|
|
|
|
otherTotal.value = 0
|
|
|
|
|
list.forEach(item => {
|
|
|
|
|
selectedRowKeys.forEach(ite => {
|
|
|
|
|
if (item.id == ite) {
|
|
|
|
|
rmbTotal.value += Number(item.unBilledRMB)
|
|
|
|
|
usdTotal.value += Number(item.unBilledUSD)
|
|
|
|
|
otherTotal.value += Number(item.unBilledOther)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function handleAddDetial() {
|
|
|
|
|
const arr = [] as any
|
|
|
|
|
dataSource.value.forEach(item=>{
|
|
|
|
|
selectedRowKeysDetial.value.forEach(ite=>{
|
|
|
|
|
if(item.feeId == ite){
|
|
|
|
|
arr.push(item)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
const data = {
|
|
|
|
|
details:arr
|
|
|
|
|
}
|
|
|
|
|
InvoiceApplicationSave(data).then(res=>{
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
const selectedRowKeysDetial = ref([]) as any
|
|
|
|
|
function onSelectChangeDetail(selectedRowKeys) {
|
|
|
|
|
selectedRowKeysDetial.value = selectedRowKeys
|
|
|
|
|
}
|
|
|
|
|
defineExpose({ init })
|
|
|
|
|
</script>
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
|
.total {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
padding-left: 10px;
|
|
|
|
|
|
|
|
|
|
.total-item {
|
|
|
|
|
background: rgba(245, 249, 252, 1);
|
|
|
|
|
padding: 3px 10px;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
margin-right: 10px;
|
|
|
|
|
|
|
|
|
|
.number {
|
|
|
|
|
color: rgba(37, 122, 250, 1);
|
|
|
|
|
margin-left: 15px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/deep/ .ant-table-footer {
|
|
|
|
|
padding: 0px !important;
|
|
|
|
|
background: white;
|
|
|
|
|
}
|
|
|
|
|
/deep/ .ant-table-container{
|
|
|
|
|
padding: 0px;
|
|
|
|
|
}
|
|
|
|
|
</style>
|