更新发票申请

szh-new
sunzehua 3 months ago
parent 863d1c56d6
commit 07c00fb12b

@ -121,4 +121,12 @@ export function Withdraw(parameter) {
})
}
export function InvoiceApplicationBizSave(parameter) {
return request({
url: '/feeApi/InvoiceApplication/BizSave',
method: 'post',
data: parameter,
})
}

@ -1,8 +1,7 @@
import { ref } from 'vue'
import { BasicColumn, FormSchema } from '/@/components/Table'
import { getOptions } from '/@/hooks/dict'
import { GetClientListByCode } from '/@/api/common'
import dayjs from 'dayjs'
export const businessTypeList = [
{ value: 1, label: '海运出口' },
]
@ -26,13 +25,7 @@ const FeeRangeList = [
{ value: 8, label: '已对账未结算' },
{ value: 9, label: '未收未付' },
]
const CategoryData = [
{ value: 0, label: '普通发票' },
{ value: 1, label: '电子发票' },
{ value: 2, label: '纸质发票' },
]
const bankList = ref([]) as any
const customerList = ref([]) as any
import {
GetControllerClientList,GetCustomerServiceList
} from '/@/views/operation/seaexport/api/BookingLedger'
@ -275,297 +268,6 @@ export const columns: BasicColumn[] = [
},
]
export const detailForm: FormSchema[] = [
{
field: 'id',
label: 'id',
component: 'Input',
show: false,
},
{
field: 'applicationNO',
label: '申请单号',
component: 'Input',
dynamicDisabled: true,
colProps: { span: 4 },
},
{
field: 'statusText',
label: '状态',
component: 'Input',
dynamicDisabled: true,
colProps: { span: 4 },
},
{
field: 'createByName',
label: '申请人',
component: 'Input',
dynamicDisabled: true,
colProps: { span: 4 },
},
{
field: 'applyDate',
label: '申请开票日期',
component: 'DatePicker',
colProps: { span: 4 },
defaultValue: dayjs().format('YYYY-MM-DD'),
componentProps: {
valueFormat: 'YYYY-MM-DD',
format: 'YYYY-MM-DD',
},
},
{
field: 'invoiceNO',
label: '发票号',
component: 'Input',
colProps: { span: 4 },
},
{
field: 'AcutalInvoiceNO',
label: '实际发票号',
dynamicDisabled: true,
component: 'Input',
colProps: { span: 4 },
},
{
field: 'invoiceHeader',
label: '发票抬头',
component: 'Input',
colProps: { span: 12 },
},
{
field: 'taxID',
label: '纳税人识别号',
component: 'Input',
colProps: { span: 12 },
},
{
field: 'customerAddTel',
label: '地址电话',
component: 'Input',
colProps: { span: 12 },
},
{
field: 'customerBank',
label: '开户行及账号',
component: 'Input',
show: false,
colProps: { span: 12 },
},
{
field: 'customerBankId',
label: '开户行及账号',
colProps: { span: 12 },
component: 'Select',
componentProps: ({ formModel }) => {
return {
options: bankList.value,
fieldNames: {
label: 'name',
value: 'id',
},
onChange: (e, obj) => {
if (obj) {
bankList.value.forEach(item => {
if (item.id == e) {
formModel.customerBank = item
}
})
}
if (!obj && !e) {
formModel.customerBank = {}
}
},
}
},
},
{
field: 'currency',
label: '币别',
defaultValue: 'CNY',
component: 'ApiSelect',
colProps: { span: 4 },
componentProps: () => {
return {
api: GetFeeCurrencySelectList,
labelField: 'name',
valueField: 'codeName',
resultField: 'data',
}
},
},
{
field: 'category',
label: '申请类型',
component: 'Select',
colProps: { span: 4 },
componentProps: {
options: CategoryData,
},
},
{
field: 'invoiceCurrency',
label: '发票币别',
defaultValue: 'CNY',
component: 'ApiSelect',
colProps: { span: 4 },
componentProps: () => {
return {
api: GetFeeCurrencySelectList,
labelField: 'name',
valueField: 'codeName',
resultField: 'data',
}
},
},
{
field: 'customer',
label: '委托单位',
component: 'Input',
show: false,
colProps: { span: 12 },
},
{
field: 'customerId',
label: '委托单位',
component: 'Input',
show: false,
colProps: { span: 12 },
},
{
label: '委托单位',
field: 'customerName',
required: true,
component: 'ApiSelect',
dynamicDisabled: false,
colProps: { span: 4 },
componentProps: ({ formModel }) => {
return {
api: GetClientListByCode,
params: { code: 'controller' },
labelField: 'pinYinCode',
valueField: 'shortName',
showName: 'shortName',
resultField: 'data',
immediate: false,
onChange: (e, obj) => {
if (obj) {
const queryStr = [{
FieldName: 'ClientId',
FieldValue: obj.id,
ConditionalType: '0'
}]
const data = {
pageCondition: {
"pageIndex": 1,
"pageSize": 20,
"sortConditions": []
},
queryCondition: JSON.stringify(queryStr)
}
GetClientBankList(data).then(res => {
res.data.forEach(item => {
item.name = item.bankName + ' ' + item.bankAgentName
})
bankList.value = res.data
})
formModel.customerId = obj.id
customerList.value.forEach(item => {
if (item.id == e) {
formModel.customer = item
}
})
}
if (!obj && !e) {
bankList.value = []
formModel.customer = {}
formModel.customerId = ''
}
},
}
},
},
{
label: '代开客户',
field: 'autualCustomerName',
component: 'ApiSelect',
required: false,
dynamicDisabled: false,
colProps: { span: 4 },
componentProps: () => {
return {
api: () => {
return new Promise((resolve) => {
GetControllerClientList().then((res) => {
resolve(res)
})
})
},
immediate: false,
labelField: 'shortName',
valueField: 'shortName',
resultField: 'data',
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
}
},
},
{
field: 'applyAmount',
label: '申请金额',
component: 'InputNumber',
colProps: { span: 4 },
},
{
field: 'invoiceAmount',
label: '开票金额',
component: 'InputNumber',
colProps: { span: 4 },
},
{
field: 'taxRate',
label: '开票税率',
component: 'InputNumber',
colProps: { span: 4 },
},
{
field: 'otherCurrencyAmount',
label: '外币金额',
component: 'InputNumber',
colProps: { span: 4 },
},
{
field: 'saleDeptId',
label: '所属分部',
component: 'ApiSelect',
colProps: { span: 4 },
componentProps: () => {
return {
api: GetOrgList,
resultField: 'data',
}
},
},
{
field: 'note',
label: '',
component: 'InputTextArea',
colProps: { span: 12 },
slot: 'note',
},
{
field: 'invoiceRemark',
label: '开票要求',
component: 'InputTextArea',
colProps: { span: 12 },
componentProps: () => {
return {
autoSize: { minRows: 4, maxRows: 7 }
}
},
},
]
export const detailColumns: BasicColumn[] = [
{

@ -1,55 +1,56 @@
<template>
<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)
}
">
<template #tableTitle>
</template>
<template #toolbar>
<a-button v-repeat type="link" @click="GoDetailed(false, null)">
<span class="iconfont icon-new_document"></span>
<div style="padding-bottom: 20px;" >
<BasicTable class="ds-table" @row-click="handleClick" @register="registerTable" @row-dbClick="(e) => {
GoDetailed(true, e)
}
">
<template #tableTitle>
<a-button v-repeat type="link" @click="GoDetailed(false, null)">
<span class="iconfont icon-new_document"></span>
添加
</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>
</template>
<template v-slot:bodyCell="{ column, record }">
<template v-if="column.dataIndex == 'businessType'">
<span v-if="record.businessType == 1"></span>
</div>
<a-table :pagination="false" rowKey="recordId"
: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>
</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>
</a-table>
</div>
<a-table rowKey="recordId" :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>
@ -57,7 +58,7 @@ import { formatParams } from '/@/hooks/web/common'
import { ref, defineExpose, unref } from 'vue'
import { BasicTable, useTable, TableAction } from '/@/components/Table'
import { detailColumns, detailSearchFormSchema, businessTypeList } from '../columns'
import { GetBizList, InvoiceApplicationGetFees,InvoiceApplicationSave } from '../api.js'
import { GetBizList, InvoiceApplicationGetFees, InvoiceApplicationSave } from '../api.js'
const open = ref(false)
const [registerTable, { getForm, setSelectedRowKeys, getSelectRows, setProps, getRawDataSource }] = useTable({
@ -161,7 +162,7 @@ function handleClick(record, index) {
InvoiceApplicationGetFees([data]).then(res => {
if (res.succeeded) {
dataSource.value = res.data.items
dataSource.value.forEach(item=>{
dataSource.value.forEach(item => {
item.applyAmount = item.restAmount ? item.restAmount : 0
})
}
@ -199,14 +200,14 @@ function onSelectChange(selectedRowKeys) {
const emits = defineEmits(['updateList'])
function handleAddDetial() {
const arr = [] as any
dataSource.value.forEach(item=>{
selectedRowKeysDetial.value.forEach(ite=>{
if(item.recordId == ite){
dataSource.value.forEach(item => {
selectedRowKeysDetial.value.forEach(ite => {
if (item.recordId == ite) {
arr.push(item)
}
})
})
arr.forEach(item=>{
arr.forEach(item => {
item.originalCurrency = item.currency
item.originalAmount = item.applyAmount
item.originalProcessedAmount = item.processedAmount ? item.processedAmount : 0
@ -243,7 +244,8 @@ defineExpose({ init })
padding: 0px !important;
background: white;
}
/deep/ .ant-table-container{
/deep/ .ant-table-container {
padding: 0px;
}
</style>

@ -37,8 +37,9 @@
</div>
</a-modal>
<a-modal @cancel="nameFlag = false" width="700px" :visible="nameFlag" title="提取发票备注" @ok="handleRender">
<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 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>
</a-modal>
</a-spin>
@ -48,11 +49,312 @@
import { ref, onMounted, unref } from 'vue'
import { BasicForm, useForm } from '/@/components/Form/index'
import { AutoComplete } from 'ant-design-vue'
import { detailForm } from '../columns'
import feeTable from './feeTable.vue';
import { InvoiceApplicationSave, InvoiceApplicationGet, GetTemplateFields, SaveTemplate, GetTemplateList,RenderTemplate } from '../api'
import { InvoiceApplicationSave, InvoiceApplicationGet, GetTemplateFields, SaveTemplate, GetTemplateList, RenderTemplate, GetClientBankList, GetOrgList } from '../api'
import { useMessage } from '/@/hooks/web/useMessage'
import { useRoute } from 'vue-router'
import {
GetControllerClientList, GetCustomerServiceList
} from '/@/views/operation/seaexport/api/BookingLedger'
import { GetFeeCurrencySelectList, GetClientListByCode } from '/@/api/common'
import dayjs from 'dayjs'
const CategoryData = [
{ value: 0, label: '普通发票' },
{ value: 1, label: '电子发票' },
{ value: 2, label: '纸质发票' },
]
const bankList = ref([]) as any
const customerList = ref([]) as any
const detailForm = [
{
field: 'id',
label: 'id',
component: 'Input',
show: false,
},
{
field: 'applicationNO',
label: '申请单号',
component: 'Input',
dynamicDisabled: true,
colProps: { span: 4 },
},
{
field: 'statusText',
label: '状态',
component: 'Input',
dynamicDisabled: true,
colProps: { span: 4 },
},
{
field: 'createByName',
label: '申请人',
component: 'Input',
dynamicDisabled: true,
colProps: { span: 4 },
},
{
field: 'applyDate',
label: '申请开票日期',
component: 'DatePicker',
colProps: { span: 4 },
defaultValue: dayjs().format('YYYY-MM-DD'),
componentProps: {
valueFormat: 'YYYY-MM-DD',
format: 'YYYY-MM-DD',
},
},
{
field: 'invoiceNO',
label: '发票号',
component: 'Input',
colProps: { span: 4 },
},
{
field: 'AcutalInvoiceNO',
label: '实际发票号',
dynamicDisabled: true,
component: 'Input',
colProps: { span: 4 },
},
{
field: 'invoiceHeader',
label: '发票抬头',
component: 'Input',
colProps: { span: 12 },
},
{
field: 'taxID',
label: '纳税人识别号',
component: 'Input',
colProps: { span: 12 },
},
{
field: 'customerAddTel',
label: '地址电话',
component: 'Input',
colProps: { span: 12 },
},
{
field: 'customerBank',
label: '开户行及账号',
component: 'Input',
show: false,
colProps: { span: 12 },
},
{
field: 'customerBankId',
label: '开户行及账号',
colProps: { span: 12 },
component: 'Select',
componentProps: ({ formModel }) => {
return {
options: bankList.value,
fieldNames: {
label: 'name',
value: 'id',
},
onChange: (e, obj) => {
if (obj) {
bankList.value.forEach(item => {
if (item.id == e) {
formModel.customerBank = item
}
})
}
if (!obj && !e) {
formModel.customerBank = {}
}
},
}
},
},
{
field: 'currency',
label: '币别',
defaultValue: 'CNY',
component: 'ApiSelect',
colProps: { span: 4 },
componentProps: () => {
return {
api: GetFeeCurrencySelectList,
labelField: 'name',
valueField: 'codeName',
resultField: 'data',
}
},
},
{
field: 'category',
label: '申请类型',
component: 'Select',
colProps: { span: 4 },
componentProps: {
options: CategoryData,
},
},
{
field: 'invoiceCurrency',
label: '发票币别',
defaultValue: 'CNY',
component: 'ApiSelect',
colProps: { span: 4 },
componentProps: () => {
return {
api: GetFeeCurrencySelectList,
labelField: 'name',
valueField: 'codeName',
resultField: 'data',
}
},
},
{
field: 'customer',
label: '委托单位',
component: 'Input',
show: false,
colProps: { span: 12 },
},
{
field: 'customerId',
label: '委托单位',
component: 'Input',
show: false,
colProps: { span: 12 },
},
{
label: '委托单位',
field: 'customerName',
required: true,
component: 'ApiSelect',
colProps: { span: 4 },
componentProps: ({ formModel }) => {
return {
api: GetClientListByCode,
params: { code: 'controller' },
labelField: 'pinYinCode',
valueField: 'shortName',
showName: 'shortName',
resultField: 'data',
immediate: false,
onChange: (e, obj) => {
if (obj) {
const queryStr = [{
FieldName: 'ClientId',
FieldValue: obj.id,
ConditionalType: '0'
}]
const data = {
pageCondition: {
"pageIndex": 1,
"pageSize": 20,
"sortConditions": []
},
queryCondition: JSON.stringify(queryStr)
}
GetClientBankList(data).then(res => {
res.data.forEach(item => {
item.name = item.bankName + ' ' + item.bankAgentName
})
bankList.value = res.data
})
formModel.customerId = obj.id
customerList.value.forEach(item => {
if (item.id == e) {
formModel.customer = item
}
})
}
if (!obj && !e) {
bankList.value = []
formModel.customer = {}
formModel.customerId = ''
}
},
}
},
},
{
label: '代开客户',
field: 'autualCustomerName',
component: 'ApiSelect',
required: false,
dynamicDisabled: false,
colProps: { span: 4 },
componentProps: () => {
return {
api: () => {
return new Promise((resolve) => {
GetControllerClientList().then((res) => {
resolve(res)
})
})
},
immediate: false,
labelField: 'shortName',
valueField: 'shortName',
resultField: 'data',
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
}
},
},
{
field: 'applyAmount',
label: '申请金额',
component: 'InputNumber',
colProps: { span: 4 },
},
{
field: 'invoiceAmount',
label: '开票金额',
component: 'InputNumber',
colProps: { span: 4 },
},
{
field: 'taxRate',
label: '开票税率',
component: 'InputNumber',
colProps: { span: 4 },
},
{
field: 'otherCurrencyAmount',
label: '外币金额',
component: 'InputNumber',
colProps: { span: 4 },
},
{
field: 'saleDeptId',
label: '所属分部',
component: 'ApiSelect',
colProps: { span: 4 },
componentProps: () => {
return {
api: GetOrgList,
resultField: 'data',
}
},
},
{
field: 'note',
label: '',
component: 'InputTextArea',
colProps: { span: 12 },
slot: 'note',
},
{
field: 'invoiceRemark',
label: '开票要求',
component: 'InputTextArea',
colProps: { span: 12 },
componentProps: () => {
return {
autoSize: { minRows: 4, maxRows: 7 }
}
},
},
]
const route = useRoute()
const { createMessage } = useMessage()
const id = ref(route.query.id)
@ -145,8 +447,28 @@ function getDetail() {
InvoiceApplicationGet({ id: id.value }).then(res => {
if (res.succeeded) {
setFieldsValue(res.data)
const queryStr = [{
FieldName: 'ClientId',
FieldValue: res.data.customerId,
ConditionalType: '0'
}]
const data = {
pageCondition: {
"pageIndex": 1,
"pageSize": 20,
"sortConditions": []
},
queryCondition: JSON.stringify(queryStr)
}
GetClientBankList(data).then(res => {
res.data.forEach(item => {
item.name = item.bankName + ' ' + item.bankAgentName
})
bankList.value = res.data
})
}
})
}
function openTempName() {
nameFlag.value = true
@ -161,18 +483,18 @@ function updateListSave() {
}
const tempNameId = ref('')
function handleRender(){
function handleRender() {
let temp = ''
tempList.value.forEach(item=>{
if(item.id==tempNameId.value){
tempList.value.forEach(item => {
if (item.id == tempNameId.value) {
temp = item.content
}
})
const data = {
id:id.value,
const data = {
id: id.value,
template: temp
}
RenderTemplate(data).then(res=>{
RenderTemplate(data).then(res => {
})

Loading…
Cancel
Save