发票开出

szh-new
sunzehua 2 months ago
parent fb290cab7b
commit 45a0d9297e

@ -59,4 +59,28 @@ export function InvoiceSettlementGet(params) {
method: 'get',
params
})
}
export function ClientCommonGetStlMode(params) {
return request({
url: '/mainApi/ClientCommon/GetStlMode',
method: 'get',
params
})
}
export function GetClientBankList(parameter) {
return request({
url: '/mainApi/ClientBank/GetClientBankList',
method: 'post',
data: parameter,
})
}
export function PaymentSettlementDelete(parameter) {
return request({
url: '/feeApi/PaymentSettlement/Delete',
method: 'post',
data: parameter,
})
}

@ -1,7 +1,7 @@
import { def } from '@vue/shared'
import { BasicColumn, FormSchema } from '/@/components/Table'
import { GetClientListByCode,GetFeeCurrencySelectList } from '/@/api/common'
import { GetOrgList } from './api'
import { GetClientListByCode, GetFeeCurrencySelectList } from '/@/api/common'
import { GetOrgList, ClientCommonGetStlMode, GetClientBankList } from './api'
import { Tag } from 'ant-design-vue'
export const columns: BasicColumn[] = [
{
@ -196,6 +196,14 @@ export const columns: BasicColumn[] = [
]
export const searchFormSchema: FormSchema[] = [
{
field: 'billType',
label: '',
colProps: { span: 4 },
component: 'Input',
show: false,
defaultValue: 1
},
{
field: 'settlementNO',
label: '结算单号',
@ -244,6 +252,19 @@ export const searchFormSchema: FormSchema[] = [
]
export const detailForm: FormSchema[] = [
{
field: 'id',
label: '',
colProps: { span: 4 },
show: false
},
{
field: 'customerId',
label: '',
colProps: { span: 4 },
show: false,
component: 'Input'
},
{
field: 'customerName',
label: '结算单位',
@ -255,27 +276,55 @@ export const detailForm: FormSchema[] = [
field: 'settlementDate',
label: '结算日期',
colProps: { span: 4 },
component: 'DatePicker'
component: 'DatePicker',
componentProps: {
showTime: true,
allowClear: true,
valueFormat: 'YYYY-MM-DD HH:00',
format: 'YYYY-MM-DD HH:00',
},
},
{
field: 'createUserName',
field: 'createByName',
label: '结算人',
colProps: { span: 4 },
dynamicDisabled: true,
component: 'Input'
},
{
field: 'currency',
field: 'currencyAmount',
label: '币别/金额',
colProps: { span: 4 },
dynamicDisabled: true,
component: 'Input'
},
{
field: 'settlementType',
field: 'settlementTypeId',
label: '',
colProps: { span: 4 },
show: false
},
{
field: 'settlementTypeName',
label: '结算方式',
colProps: { span: 4 },
component: 'Input'
component: 'ApiSelect',
componentProps: ({ formModel }) => {
return {
api: ClientCommonGetStlMode,
resultField: 'data',
labelField: 'stlName',
valueField: 'stlName',
onChange: (e, obj) => {
if (obj) {
formModel.settlementTypeId = obj.id
}
if (!obj && !e) {
formModel.settlementTypeId = ''
}
},
}
},
},
{
field: 'exchangeRate',
@ -291,10 +340,54 @@ export const detailForm: FormSchema[] = [
}
},
{
field: 'customerBank',
field: 'customerBankId',
label: '',
colProps: { span: 4 },
show: false
},
{
field: 'customerBankName',
label: '银行账号',
colProps: { span: 4 },
component: 'Input'
component: 'ApiSelect',
componentProps: ({ formModel }) => {
return {
api: () => {
return new Promise((resolve) => {
const queryStr = [
{
FieldName: 'ClientId',
FieldValue: formModel.customerId,
ConditionalType: '0',
},
]
const data = {
pageCondition: {
pageIndex: 1,
pageSize: 20,
sortConditions: [],
},
queryCondition: JSON.stringify(queryStr),
}
GetClientBankList(data).then((res) => {
resolve(res)
})
})
},
immediate: false,
labelField: 'account',
valueField: 'account',
resultField: 'data',
onChange: (e, obj) => {
if (obj) {
formModel.customerBankId = obj.id
}
if (!obj && !e) {
formModel.customerBankId = ''
}
},
}
},
},
{
field: 'relativeNO',
@ -304,34 +397,78 @@ export const detailForm: FormSchema[] = [
},
{
field: 'saleDeptId',
label: '',
colProps: { span: 4 },
show: false
},
{
field: 'saleDeptName',
label: '所属分部',
colProps: { span: 4 },
component: 'ApiSelect',
componentProps: () => {
componentProps: ({ formModel }) => {
return {
api: GetOrgList,
resultField: 'data',
labelField: 'label',
valueField: 'label',
onChange: (e, obj) => {
if (obj) {
formModel.saleDeptId = obj.id
}
if (!obj && !e) {
formModel.saleDeptId = ''
}
},
}
},
},
{
field: 'settlementNO',
field: 'category',
label: '',
colProps: { span: 4 },
show: false
},
{
field: 'categoryText',
label: '业务类别',
colProps: { span: 4 },
component: 'Input'
component: 'Select',
componentProps: ({ formModel }) => {
return {
options: [
{
label: '货运收入',
value: '1'
},
{
label: '利息收入',
value: '2'
},
],
onChange: (e, obj) => {
if (obj) {
formModel.category = obj.value
}
if (!obj && !e) {
formModel.category = ''
}
},
}
},
},
]
export const markForm: FormSchema[] = [
{
field: 'line2',
field: 'line3',
component: 'Divider',
colProps: {
span: 24
}
},
]
export const markForm: FormSchema[] = [
{
field: 'customerName',
field: 'voucherRemark',
label: '凭证备注',
colProps: { span: 8 },
component: 'InputTextArea'
@ -354,7 +491,7 @@ export const markForm: FormSchema[] = [
export const invoiceColum: BasicColumn[] = [
{
title: '发票业务编号',
dataIndex: 'applicationNO',
dataIndex: 'billNO',
width: 100,
},
{
@ -369,12 +506,12 @@ export const invoiceColum: BasicColumn[] = [
},
{
title: '开票单位',
dataIndex: 'applicationNO',
dataIndex: 'customerName',
width: 100,
},
{
title: '币别',
dataIndex: 'applicationNO',
dataIndex: 'originalCurrency',
width: 100,
},
{
@ -384,27 +521,29 @@ export const invoiceColum: BasicColumn[] = [
},
{
title: '开票金额',
dataIndex: 'applicationNO',
dataIndex: 'invoiceAmount',
width: 100,
},
{
title: '申请金额',
dataIndex: 'applicationNO',
title: 'RMB申请金额',
dataIndex: 'rmbApplyAmount',
width: 100,
},
{
title: 'USD申请金额',
dataIndex: 'usdApplyAmount',
width: 100,
},
{
title: '发票抬头',
dataIndex: 'applicationNO',
dataIndex: 'invoiceHeader',
width: 100,
},
{
title: '开票日期',
dataIndex: 'applicationNO',
dataIndex: 'invoiceDate',
width: 100,
},
]
export const invoiceDetailColum: BasicColumn[] = [
@ -507,7 +646,7 @@ export const invoiceTableColums: BasicColumn[] = [
{
title: '发票锁定',
dataIndex: 'isLocked',
width: 100,
width: 80,
},
{
title: '发票业务编号',
@ -522,17 +661,17 @@ export const invoiceTableColums: BasicColumn[] = [
{
title: '币别',
dataIndex: 'currency',
width: 100,
width: 60,
},
{
title: '开票金额',
dataIndex: 'invoiceAmount',
width: 100,
width: 80,
},
{
title: '申请金额',
dataIndex: 'applyAmount',
width: 100,
width: 80,
},
{
title: '未结金额',
@ -650,12 +789,10 @@ export const invoiceSearchFormSchema: FormSchema[] = [
colProps: { span: 6 },
componentProps: () => {
return {
api: GetClientListByCode,
labelField: 'pinYinCode',
valueField: 'shortName',
showName: 'shortName',
api: GetOrgList,
resultField: 'data',
immediate: false
labelField: 'label',
valueField: 'label',
}
}
},
@ -687,4 +824,59 @@ export const invoiceTableDetailColums: BasicColumn[] = [
dataIndex: 'feeName',
width: 100,
},
{
title: '收付',
dataIndex: 'feeType',
width: 100,
},
{
title: '结算名称',
dataIndex: 'feeName',
width: 100,
},
{
title: '原始币别',
dataIndex: 'originalCurrency',
width: 100,
},
{
title: '原始汇率',
dataIndex: 'originalRate',
width: 100,
},
{
title: '折算汇率',
dataIndex: 'exchangeRate',
width: 100,
},
{
title: '发票折算汇率',
dataIndex: 'feeName',
width: 100,
},
{
title: '原始金额',
dataIndex: 'originalAmount',
width: 100,
},
{
title: '揽货人',
dataIndex: 'saleName',
width: 100,
},
{
title: '录入方式',
dataIndex: 'feeName',
width: 100,
},
{
title: '会计期间',
dataIndex: 'accountDate',
width: 100,
},
{
title: '更改单',
dataIndex: 'feeName',
width: 100,
},
]

@ -50,7 +50,7 @@
</div>
</div>
<div style="color: #8995a4">
<span>结算单号:</span>
<span>结算单号:{{ form.settlementNO }}</span>
</div>
</div>
<div class="content">
@ -62,7 +62,7 @@
</BasicForm>
<BasicTable class="ds-table" @row-click="handleClick" @register="registerTable">
<template #right>
<div style="width: 40%;margin-left: 10px;margin-top:10px;">
<div style="width: 40%;margin-left: 10px;">
<div>
<BasicTable class="ds-table" @register="registerTable1">
<template #tableTitle>
@ -89,13 +89,13 @@
<span class="iconfont icon-jia"></span>
添加
</a-button>
<a-button v-repeat type="link" @click="addDetailed()">
<span class="iconfont icon-jia"></span>
删除
</a-button>
<a-button v-repeat type="link" @click="addDetailed()">
<span class="iconfont icon-jia"></span>
附件
<a-popconfirm title="确定要删除勾选的数据?" ok-text="" cancel-text="" @confirm="deleteRow">
<a-button v-repeat type="link">
<span class="iconfont icon-shanchu1"></span>删除
</a-button>
</a-popconfirm>
<a-button v-repeat type="link" @click="openFile">
<span class="iconfont icon-fujian1"></span>附件
</a-button>
</div>
</div>
@ -110,19 +110,26 @@
</BasicTable>
</div>
</a-spin>
<invoiceTable ref="invoiceTableRef" @updateList="updateList" ></invoiceTable>
<invoiceTable ref="invoiceTableRef" @updateList="updateList"></invoiceTable>
<invoiceFile ref="invoiceFileRef"></invoiceFile>
</div>
</template>
<script lang="ts" setup>
import { ref, onMounted, defineComponent, nextTick, watchEffect, watch } from 'vue'
import { InvoiceSettlementSave,InvoiceSettlementGet} from '../api'
import { InvoiceSettlementSave, InvoiceSettlementGet, GetClientBankList } from '../api'
import { useMessage } from '/@/hooks/web/useMessage'
import invoiceTable from './invoiceTable.vue'
import invoiceFile from '../../../operation/invoiceIssue/detail/invoiceFile.vue'
import { useRoute, useRouter } from 'vue-router'
import { BasicTable, useTable, TableAction } from '/@/components/Table'
import { useGo } from '/@/hooks/web/usePage'
import { detailForm, markForm, invoiceColum, invoiceDetailColum } from '../columns'
import { BasicForm, useForm } from '/@/components/Form/index'
import { useUserStore } from '/@/store/modules/user'
import { useMultipleTabStore } from '/@/store/modules/multipleTab'
const tabStore = useMultipleTabStore()
const userStore = useUserStore()
const go = useGo()
const route = useRoute()
const { createMessage } = useMessage()
const loading = ref(false)
@ -132,12 +139,12 @@ const [registerForm, { resetFields, setFieldsValue, validate, updateSchema, getF
showActionButtonGroup: false,
readonly: true,
})
const [registerFormMark, {getFieldsValue:getFieldsValueMark }] = useForm({
const [registerFormMark, { getFieldsValue: getFieldsValueMark, setFieldsValue: setFieldsValueMark }] = useForm({
labelWidth: 100,
schemas: markForm,
showActionButtonGroup: false,
})
const [registerTable, { getForm, setSelectedRowKeys, getSelectRows, setProps, getRawDataSource, setLoading }] = useTable({
const [registerTable, { setTableData }] = useTable({
columns: invoiceColum,
useSearchForm: false,
showIndexColumn: false,
@ -149,9 +156,11 @@ const [registerTable, { getForm, setSelectedRowKeys, getSelectRows, setProps, ge
width: 60,
},
canResize: true,
showTableSetting: true,
id:'1',
immediate: false,
})
const [registerTable1, { getSelectRows: getSelectRowsFee, setProps: setPropsFee, setTableData }] = useTable({
const [registerTable1, { getSelectRows: getSelectRowsFee, setProps: setPropsFee, setTableData: setTableData1 }] = useTable({
columns: invoiceDetailColum,
useSearchForm: false,
showIndexColumn: false,
@ -162,6 +171,8 @@ const [registerTable1, { getSelectRows: getSelectRowsFee, setProps: setPropsFee,
indexColumnProps: {
width: 60,
},
showTableSetting: true,
id:'2',
canResize: true,
immediate: false,
})
@ -174,27 +185,101 @@ onMounted(() => {
getDetail()
}
})
function updateList(arr,currency){
const invoiceFileRef = ref('')
function openFile() {
invoiceFileRef.value.init()
}
//
function updateList(arr, currency) {
const data = {
settlement:{
settlement: {
...getFieldsValue(),
...getFieldsValueMark(),
},
documents:arr
documents: arr
}
data.settlement.billType =1
data.settlement.billType = 1
data.settlement.mode = 4
data.settlement.currency = currency
loading.value = true
InvoiceSettlementSave(data).then(res=>{
InvoiceSettlementSave(data).then(res => {
if (!route.query.id) {
const { fullPath } = route //
tabStore.closeTabByKey(fullPath, router)
setTimeout(() => {
go(`/feeSettlementDetail?id=${res.data.id}`)
}, 50)
} else {
getDetail()
}
loading.value = false
}).catch(() => {
loading.value = false
})
}
function getDetail(){
InvoiceSettlementGet({id:route.query.id}).then(res=>{
const router = useRouter()
function handleSave() {
const data = {
settlement: {
...form.value,
...getFieldsValue(),
...getFieldsValueMark(),
}
}
data.settlement.billType = 1
data.settlement.mode = 4
loading.value = true
InvoiceSettlementSave(data).then(res => {
loading.value = false
createMessage.success('保存成功')
if (!route.query.id) {
const { fullPath } = route //
tabStore.closeTabByKey(fullPath, router)
setTimeout(() => {
go(`/feeSettlementDetail?id=${res.data.id}`)
}, 50)
} else {
getDetail()
}
}).catch(() => {
loading.value = false
})
}
const form = ref({ settlementNO: '' }) as any
function getDetail() {
loading.value = true
InvoiceSettlementGet({ id: route.query.id }).then(res => {
if (res.succeeded) {
form.value = JSON.parse(JSON.stringify(res.data))
delete form.value.details
res.data.currencyAmount = res.data.currency + '/' + res.data.amount
setFieldsValueMark(res.data)
setFieldsValue(res.data)
setTableData(res.data.details)
}
loading.value = false
})
}
const bankList = ref([])
function getBankInfo(id) {
const queryStr = [
{
FieldName: 'ClientId',
FieldValue: id,
ConditionalType: '0',
},
]
const data = {
pageCondition: {
pageIndex: 1,
pageSize: 20,
sortConditions: [],
},
queryCondition: JSON.stringify(queryStr),
}
bankList.value = []
GetClientBankList(data).then((res) => { })
}
</script>
<style lang="less" scoped>
@ -250,7 +335,17 @@ function getDetail(){
padding-left: 20px;
}
/deep/.ant-divider {
:deep(.ant-divider) {
margin: 5px 0 !important;
}
:deep(.ant-table-footer) {
padding: 0px !important;
background: white;
}
:deep(.ant-table-container) {
padding: 0px;
}
</style>

@ -5,12 +5,12 @@
-->
<template>
<div>
<a-modal width="1400px" @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;">
<a-spin :spinning="loading">
<BasicTable class="ds-table" @register="registerTable" @row-click="onRowClick">
<template #toolbar>
<div class="flex" style="width: 100%;align-items: center;">
<template #tableTitle>
<div class="flex" style="align-items: center;">
<div style="font-size: 12px;font-weight: bold;margin-right: 15px">结算明细</div>
<a-button class="ml15" type="link" @click="addInfos">
<span class="iconfont icon-zengjiatianjiajiajian" :style="{ fontSize: '12px' }"></span>
@ -63,13 +63,15 @@
</a-modal>
<a-modal width="400px" @cancel="exchangeFlag = false" @ok="handleSureExhange" :visible="exchangeFlag"
title="币别汇率折算">
<div v-for="(item, index) in exchangarr" :key="index">
<div style="margin-bottom: 15px;margin-top: 10px">
<span class="bold" style="margin-right: 10px;width:46px;display: inline-block">1{{ item.currencyTo
}}
=</span>
<a-input-number addon-after="RMB" :precision="4" size="small" :controls="false"
v-model:value="item.reverseRate" />
<div>
<div v-for="(item, index) in exchangarr" :key="index">
<div style="margin-bottom: 15px;margin-top: 10px">
<span class="bold" style="margin-right: 10px;width:46px;display: inline-block">1{{ item.currencyTo
}}
=</span>
<a-input-number addon-after="RMB" :precision="4" size="small" :controls="false"
v-model:value="item.reverseRate" />
</div>
</div>
</div>
</a-modal>
@ -108,6 +110,7 @@ const [registerTable, { reload, getForm, getSelectRows, setSelectedRowKeys, getD
},
columns: invoiceTableColums,
maxHeight: '900',
rowKey: 'id',
formConfig: {
labelWidth: 120,
schemas: invoiceSearchFormSchema,
@ -117,10 +120,11 @@ const [registerTable, { reload, getForm, getSelectRows, setSelectedRowKeys, getD
pagination: true,
striped: false,
useSearchForm: true,
showTableSetting: false,
bordered: true,
showIndexColumn: false,
canResize: false,
showTableSetting: false,
id:'4',
immediate: false
})
const [registerTable1, { getSelectRows: getSelectRowsFee, setProps: setPropsFee, setTableData }] = useTable({
@ -135,6 +139,8 @@ const [registerTable1, { getSelectRows: getSelectRowsFee, setProps: setPropsFee,
indexColumnProps: {
width: 60,
},
showTableSetting: true,
id:'3',
canResize: false,
immediate: false,
})
@ -143,7 +149,8 @@ const currenciesData = ref([]) as any
const exchangeFlag = ref(false)
//
const onRowClick = (record, index) => {
setSelectedRowKeys([index])
setSelectedRowKeys([record.id])
onSelectChange()
const data = {
ids: [record.id],
businessType: record.businessType,
@ -167,7 +174,6 @@ function addInfos() {
return false
}
const firstCustomerId = arr[0].customerId;
const exchangarr = [] as any
for (let i = 1; i < arr.length; i++) {
if (arr[i].customerId !== firstCustomerId) {
createMessage.error('请选择同一开票单位')
@ -179,7 +185,8 @@ function addInfos() {
freeList.push({
id: item.id,
businessType: item.businessType,
customerId: item.customerId
customerId: item.customerId,
customerName:item.customerName
})
})
currenciesData.value = []
@ -217,7 +224,7 @@ function addInfos() {
});
});
return Promise.all(promises).then(() => {
exchangeFlag.value = true
exchangeFlag.value = true
});
}
if (cuArr.length == 0) {
@ -239,11 +246,13 @@ function handleSureExhange() {
})
})
})
console.log(currenciesData.value)
openFlag.value = false
exchangeFlag.value = false
emits('updateList', currenciesData.value, currency.value)
}
function onSelectChange(selectedRowKeys) {
console.log(getSelectRows())
const list = getSelectRows()
console.log(list)
rrmb.value = 0
list.forEach(item => {
rrmb.value += Number(item.applyAmount)
@ -272,18 +281,18 @@ defineExpose({ init })
.right-table {
width: 40%;
margin-left: 10px;
margin-top: 10px;
}
/deep/ .ant-table-footer {
:deep(.ant-table-footer) {
padding: 0px !important;
background: white;
}
/deep/ .ant-table-container {
:deep(.ant-table-container) {
padding: 0px;
}
.main-statistic {
background: #ffffff;
font-size: 12px;

@ -91,7 +91,7 @@
</template>
<script setup lang="ts">
import { ref, reactive, onMounted, defineExpose, computed } from 'vue'
import { PaymentSettlementGetList } from './api.js'
import { PaymentSettlementGetList,PaymentSettlementDelete } from './api.js'
import { BasicTable, useTable, TableAction } from '/@/components/Table'
import { formatParams } from '/@/hooks/web/common'
import { columns, searchFormSchema, detailColumns, feeColumns, feeColumnsSum } from './columns'
@ -148,7 +148,7 @@ function FnDel() {
ids: [...ids]
}
setLoading(true)
GeneralInvoiceDelete(data).then(res => {
PaymentSettlementDelete(data).then(res => {
if (res.succeeded) {
createMessage.success('删除成功')
reload()

@ -472,7 +472,7 @@ export const detailSearchFormSchema: FormSchema[] = [
componentProps: () => {
return {
api: GetFeeCurrencySelectList,
labelField: 'name',
labelField: 'codeName',
valueField: 'codeName',
resultField: 'data',
}

@ -959,7 +959,7 @@ export const freeSearch: FormSchema[] = [
componentProps: () => {
return {
api: GetFeeCurrencySelectList,
labelField: 'name',
labelField: 'codeName',
valueField: 'codeName',
resultField: 'data',
}

@ -424,7 +424,7 @@ function addDetailFree() {
}
const emits = defineEmits(['updateList', 'addLeft', 'updateListFree', 'updateListFreeLeft'])
// RMB
// RMB
function handleSureExhange() {
if (route.query.type == 'apply') {
applications.value.forEach(item => {

@ -779,6 +779,7 @@ function openFile() {
}
const router = useRouter()
const go = useGo()
// (rmb)
function updateListFreeLeft(val) {
const data = {
invoice: {
@ -807,6 +808,7 @@ function updateListFreeLeft(val) {
loading.value = false
})
}
//
function handleUpdate(val) {
const data = {
invoice: {
@ -835,6 +837,7 @@ function handleUpdate(val) {
loading.value = false
})
}
//
function updateListFree(val) {
val.forEach(item => {
item.originalCurrency = item.currency

Loading…
Cancel
Save