更新发票申请

szh-new
sunzehua 3 months ago
parent 68352521b2
commit 5d2b7afac8

@ -4,7 +4,7 @@ import { DataResult, PageRequest } from '/@/api/model/baseModel'
export function SearchShipSailingScheduleSpot(data) { export function SearchShipSailingScheduleSpot(data) {
return request<DataResult>({ return request<DataResult>({
url: '/opApi/SpaceBookingMSKSPOTAPI/SearchShipSailingSchedule', url: '/opApi/SpaceBookingSPOTAPI/SearchShipSailingSchedule',
method: 'post', method: 'post',
data, data,
}) })
@ -36,7 +36,7 @@ export function SearchCommodities(data) {
export function mskGetGetInfoSpot(data) { export function mskGetGetInfoSpot(data) {
return request<DataResult>({ return request<DataResult>({
url: '/opApi/SpaceBookingMSKSPOTAPI/GetInfo', url: '/opApi/SpaceBookingSPOTAPI/GetInfo',
method: 'get', method: 'get',
params: data, params: data,
}) })
@ -44,7 +44,7 @@ export function mskGetGetInfoSpot(data) {
export function mskGetSaveSpot(data) { export function mskGetSaveSpot(data) {
return request<DataResult>({ return request<DataResult>({
url: '/opApi/SpaceBookingMSKSPOTAPI/Save', url: '/opApi/SpaceBookingSPOTAPI/Save',
method: 'post', method: 'post',
data, data,
}) })
@ -84,14 +84,14 @@ export function mskGetGetInfo(data) {
export function GetInitInfoMsk() { export function GetInitInfoMsk() {
return request<DataResult>({ return request<DataResult>({
url: '/opApi/SpaceBookingMSKSPOTAPI/GetInitInfo', url: '/opApi/SpaceBookingSPOTAPI/GetInitInfo',
method: 'get', method: 'get',
}) })
} }
export function SendMSKBookingSpot(data) { export function SendMSKBookingSpot(data) {
return request<DataResult>({ return request<DataResult>({
url: '/opApi/SpaceBookingMSKSPOTAPI/SendMSKBooking', url: '/opApi/SpaceBookingSPOTAPI/SendMSKBooking',
method: 'post', method: 'post',
data, data,
}) })
@ -106,7 +106,7 @@ export function GetInitInfoMskApi() {
export function maskCopySPOT(data) { export function maskCopySPOT(data) {
return request<DataResult>({ return request<DataResult>({
url: '/opApi/SpaceBookingMSKSPOTAPI/BatchCopy', url: '/opApi/SpaceBookingSPOTAPI/BatchCopy',
method: 'post', method: 'post',
data, data,
}) })
@ -114,7 +114,7 @@ export function maskCopySPOT(data) {
export function SearchCommoditiesSpot(data) { export function SearchCommoditiesSpot(data) {
return request<DataResult>({ return request<DataResult>({
url: '/opApi/SpaceBookingMSKSPOTAPI/SearchCommodities', url: '/opApi/SpaceBookingSPOTAPI/SearchCommodities',
method: 'post', method: 'post',
data, data,
}) })
@ -122,7 +122,7 @@ export function SearchCommoditiesSpot(data) {
export function SearchLocationsSpot(data) { export function SearchLocationsSpot(data) {
return request<DataResult>({ return request<DataResult>({
url: '/opApi/SpaceBookingMSKSPOTAPI/SearchLocations', url: '/opApi/SpaceBookingSPOTAPI/SearchLocations',
method: 'post', method: 'post',
data, data,
}) })
@ -153,7 +153,7 @@ export function BatchSend(parameter) {
export function BatchSendSPOT(parameter) { export function BatchSendSPOT(parameter) {
return request<DataResult>({ return request<DataResult>({
url: '/opApi/SpaceBookingMSKSPOTAPI/BatchSend', url: '/opApi/SpaceBookingSPOTAPI/BatchSend',
method: 'post', method: 'post',
data: parameter data: parameter
}) })

@ -122,3 +122,28 @@ export function DeleteInvoiceDetail(parameter) {
data: parameter, data: parameter,
}) })
} }
export function ApplyAudit(parameter) {
return request({
url: '/feeApi/InvoiceApplication/ApplyAudit',
method: 'post',
data: parameter,
})
}
export function Withdraw(parameter) {
return request({
url: '/feeApi/InvoiceApplication/Withdraw',
method: 'post',
data: parameter,
})
}
export function InvoiceApplicationBizSave(parameter) {
return request({
url: '/feeApi/InvoiceApplication/BizSave',
method: 'post',
data: parameter,
})
}

@ -264,305 +264,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: 'customerName',
label: '委托单位',
component: 'Input',
show: false,
colProps: { span: 12 },
},
{
field: 'customer',
label: '委托单位',
component: 'Input',
show: false,
colProps: { span: 12 },
},
{
label: '委托单位',
field: 'customerId',
required: true,
component: 'ApiSelect',
dynamicDisabled: false,
colProps: { span: 4 },
componentProps: ({ formModel }) => {
return {
allowClear: true,
showSearch: true,
api: () => {
return new Promise((resolve) => {
const arr = getOptions('controller')
resolve(arr)
})
},
labelField: 'name',
valueField: 'id',
showName: 'shortName',
resultField: 'data',
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
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.customerName = obj.label
customerList.value.forEach(item => {
if (item.id == e) {
formModel.customer = item
}
})
}
if (!obj && !e) {
bankList.value = []
formModel.customer = {}
formModel.customerName = ''
}
},
}
},
},
{
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[] = [ export const detailColumns: BasicColumn[] = [
{ {

@ -62,6 +62,8 @@ import { ref, defineExpose, unref } from 'vue'
import { BasicTable, useTable, TableAction } from '/@/components/Table' import { BasicTable, useTable, TableAction } from '/@/components/Table'
import { detailColumns, detailSearchFormSchema, businessTypeList } from '../columns' import { detailColumns, detailSearchFormSchema, businessTypeList } from '../columns'
import { GetBizList, InvoiceApplicationGetFees, InvoiceApplicationSave } from '../api.js' import { GetBizList, InvoiceApplicationGetFees, InvoiceApplicationSave } from '../api.js'
import { useMessage } from '/@/hooks/web/useMessage'
const { createMessage } = useMessage()
const open = ref(false) const open = ref(false)
const [registerTable, { getForm, setSelectedRowKeys, getSelectRows, setProps, getRawDataSource }] = useTable({ const [registerTable, { getForm, setSelectedRowKeys, getSelectRows, setProps, getRawDataSource }] = useTable({
@ -227,7 +229,17 @@ function onSelectChangeDetail(selectedRowKeys) {
selectedRowKeysDetial.value = selectedRowKeys selectedRowKeysDetial.value = selectedRowKeys
} }
function addDetailed() { function addDetailed() {
getSelectRows() const arr = getSelectRows() ? getSelectRows() : []
const arr1 = []
arr.forEach(item=>{
if(item.customerId!=customerIdP.value){
arr1.push(1)
}
})
if(arr1.length>0){
createMessage.error('请选择同一客户')
return false
}
} }
const customerIdP = ref('') const customerIdP = ref('')
function changeCustIn(id) { function changeCustIn(id) {

@ -264,6 +264,7 @@ const detailForm = [
formModel.customer = item formModel.customer = item
} }
}) })
feeTableRef.value.changeCust(obj.id)
} }
if (!obj && !e) { if (!obj && !e) {
bankList.value = [] bankList.value = []

@ -1,15 +1,10 @@
<template> <template>
<div> <div>
<div class="topTable"> <div class="topTable">
<BasicTable <BasicTable class="ds-table" @register="registerTable" @row-dbClick="(e) => {
class="ds-table" GoDetailed(true, e)
@register="registerTable" }
@row-dbClick=" ">
(e) => {
GoDetailed(true, e)
}
"
>
<template #tableTitle> <template #tableTitle>
<div class="buttonGroup"> <div class="buttonGroup">
<a-button v-repeat type="link"> <a-button v-repeat type="link">
@ -20,11 +15,11 @@
<span class="iconfont icon-locksuo IconColor"></span> <span class="iconfont icon-locksuo IconColor"></span>
导出EXCEL 导出EXCEL
</a-button> </a-button>
<a-button v-repeat type="link"> <a-button @click="handleApply" v-repeat type="link">
<span class="iconfont icon-locksuo IconColor"></span> <span class="iconfont icon-locksuo IconColor"></span>
提交审核 提交审核
</a-button> </a-button>
<a-button v-repeat type="link"> <a-button @click="handleWithdraw" v-repeat type="link">
<span class="iconfont icon-locksuo IconColor"></span> <span class="iconfont icon-locksuo IconColor"></span>
撤销审核 撤销审核
</a-button> </a-button>
@ -35,12 +30,7 @@
<span class="iconfont icon-new_document"></span> <span class="iconfont icon-new_document"></span>
添加 添加
</a-button> </a-button>
<a-popconfirm <a-popconfirm title="确定删除当前选中数据?" ok-text="" cancel-text="" @confirm="FnDel">
title="确定删除当前选中数据?"
ok-text="是"
cancel-text="否"
@confirm="FnDel"
>
<a-button type="link"> <a-button type="link">
<span class="iconfont icon-shanchu21"></span> <span class="iconfont icon-shanchu21"></span>
删除 删除
@ -53,17 +43,15 @@
</template> </template>
<template v-slot:bodyCell="{ column, record }"> <template v-slot:bodyCell="{ column, record }">
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
<TableAction <TableAction :actions="[
:actions="[ {
{ icon: 'clarity:note-edit-line',
icon: 'clarity:note-edit-line', tooltip: '编辑',
tooltip: '编辑', onClick: () => {
onClick: () => { GoDetailed(true, record)
GoDetailed(true, record)
},
}, },
]" },
/> ]" />
</template> </template>
</template> </template>
</BasicTable> </BasicTable>
@ -81,149 +69,186 @@
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from 'vue' import { ref } from 'vue'
import { GetList,InvoiceApplicationDelete} from './api.js' import { GetList, InvoiceApplicationDelete, Withdraw, ApplyAudit } from './api.js'
import { BasicTable, useTable, TableAction } from '/@/components/Table' import { BasicTable, useTable, TableAction } from '/@/components/Table'
import { columns, searchFormSchema, billTypeData } from './columns' import { columns, searchFormSchema, billTypeData } from './columns'
import { GetOpenPrintModuleList } from '/@/views/operation/seaexport/api/BookingLedger.js' import { GetOpenPrintModuleList } from '/@/views/operation/seaexport/api/BookingLedger.js'
import * as XLSX from 'xlsx' import * as XLSX from 'xlsx'
import DsPrint from '/@/components/Print/index.vue' import DsPrint from '/@/components/Print/index.vue'
import { useMessage } from '/@/hooks/web/useMessage' import { useMessage } from '/@/hooks/web/useMessage'
const { notification } = useMessage() const { notification } = useMessage()
const { createMessage } = useMessage() const { createMessage } = useMessage()
import { useGo } from '/@/hooks/web/usePage' import { useGo } from '/@/hooks/web/usePage'
const go = useGo() const go = useGo()
// //
import { formatParams } from '/@/hooks/web/common' import { formatParams } from '/@/hooks/web/common'
import { useAppStore } from '/@/store/modules/app' import { useAppStore } from '/@/store/modules/app'
const appStore = useAppStore() const appStore = useAppStore()
// //
const [registerTable, { reload, getPaginationRef, getSelectRows, getRawDataSource }] = useTable({ const [registerTable, { reload, getPaginationRef, getSelectRows, getRawDataSource }] = useTable({
title: '', title: '',
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) => {
resolve({ data: [...res.data], total: res.count }) resolve({ data: [...res.data], total: res.count })
}) })
}, },
// //
beforeFetch: (p) => { beforeFetch: (p) => {
return formatParams(p) return formatParams(p)
}, },
columns, columns,
formConfig: { formConfig: {
labelWidth: 120, labelWidth: 120,
schemas: searchFormSchema, schemas: searchFormSchema,
useAdvancedSearch: true, useAdvancedSearch: true,
}, },
isTreeTable: false, isTreeTable: false,
pagination: true, pagination: true,
striped: true, striped: true,
useSearchForm: true, useSearchForm: true,
showTableSetting: true, showTableSetting: true,
bordered: true, bordered: true,
showIndexColumn: true, showIndexColumn: true,
indexColumnProps: { indexColumnProps: {
width: 60, width: 60,
}, },
canResize: true, canResize: true,
immediate: true, immediate: true,
actionColumn: { actionColumn: {
width: 80, width: 80,
title: '操作', title: '操作',
dataIndex: 'action', dataIndex: 'action',
fixed: 'right', fixed: 'right',
}, },
})
//
function GoDetailed(type, data) {
if (type) {
go(`/invoiceapplyDetail?id=${data.id}`)
} else {
go(`/invoiceapplyDetail`)
}
}
//
function FnDel() {
let ids = []
ids = getSelectRows().map((item) => {
return item.id
}) })
// if (ids.length == 0) {
function GoDetailed(type, data) { createMessage.error('请选择要删除的数据')
if (type) { return false
go(`/invoiceapplyDetail?id=${data.id}`)
} else {
go(`/invoiceapplyDetail`)
}
} }
// InvoiceApplicationDelete({ ids: ids }).then(res => {
function FnDel() { if (res.succeeded) {
const ids = getSelectRows().map((item) => { createMessage.success('删除成功')
return item.id reload()
}) }
InvoiceApplicationDelete({ids:ids}).then(res=>{ })
if(res.succeeded){ }
createMessage.success('删除成功') function handleApply() {
reload() let ids = []
} ids = getSelectRows().map((item) => {
}) return item.id
})
if (ids.length == 0) {
createMessage.error('请选择数据')
return false
} }
ApplyAudit({ ids: ids }).then(res => {
if (res.succeeded) {
createMessage.success('操作成功')
reload()
}
})
}
function handleWithdraw() {
let ids = []
ids = getSelectRows().map((item) => {
return item.id
})
if (ids.length == 0) {
createMessage.error('请选择数据')
return false
}
Withdraw({ ids: ids }).then(res => {
if (res.succeeded) {
createMessage.success('操作成功')
reload()
}
})
}
// EXCEL // EXCEL
function ExportExcel() { function ExportExcel() {
let Data: any = [] let Data: any = []
let DelData = ['id', 'bsno', 'ctnCode'] let DelData = ['id', 'bsno', 'ctnCode']
getRawDataSource().forEach((item, index) => { getRawDataSource().forEach((item, index) => {
let Obj = {} let Obj = {}
Object.keys(item).forEach((item2) => { Object.keys(item).forEach((item2) => {
if (!DelData.includes(item2)) { if (!DelData.includes(item2)) {
columns.forEach((e) => { columns.forEach((e) => {
if (e.dataIndex == item2) { if (e.dataIndex == item2) {
if (e.title == '收付类型') { if (e.title == '收付类型') {
let data = '' let data = ''
billTypeData.forEach((d) => { billTypeData.forEach((d) => {
if (d.code == item[item2]) { if (d.code == item[item2]) {
data = d.value data = d.value
} }
}) })
Obj[e.title] = data Obj[e.title] = data
} else { } else {
Obj[e.title] = item[item2] Obj[e.title] = item[item2]
}
} }
}) }
} })
}) }
Data.push(Obj)
console.log(Data)
}) })
// 簿 Data.push(Obj)
const workbook = XLSX.utils.book_new() console.log(Data)
// })
const worksheet = XLSX.utils.json_to_sheet(Data) // 簿
// 簿 const workbook = XLSX.utils.book_new()
XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1') //
// Excel const worksheet = XLSX.utils.json_to_sheet(Data)
const wbout = XLSX.write(workbook, { bookType: 'xlsx', type: 'binary' }) // 簿
// url XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1')
const blob = new Blob([s2ab(wbout)], { type: 'application/octet-stream' }) // Excel
const url = URL.createObjectURL(blob) const wbout = XLSX.write(workbook, { bookType: 'xlsx', type: 'binary' })
// a // url
const a = document.createElement('a') const blob = new Blob([s2ab(wbout)], { type: 'application/octet-stream' })
a.href = url const url = URL.createObjectURL(blob)
a.download = '客户对账.xlsx' // a
document.body.appendChild(a) const a = document.createElement('a')
a.click() a.href = url
a.download = '客户对账.xlsx'
document.body.appendChild(a)
a.click()
// URL // URL
setTimeout(() => { setTimeout(() => {
URL.revokeObjectURL(url) URL.revokeObjectURL(url)
document.body.removeChild(a) document.body.removeChild(a)
}, 0) }, 0)
} }
// ArrayBuffer // ArrayBuffer
function s2ab(s) { function s2ab(s) {
const buf = new ArrayBuffer(s.length) const buf = new ArrayBuffer(s.length)
const view = new Uint8Array(buf) const view = new Uint8Array(buf)
for (let i = 0; i !== s.length; ++i) view[i] = s.charCodeAt(i) & 0xff for (let i = 0; i !== s.length; ++i) view[i] = s.charCodeAt(i) & 0xff
return buf return buf
} }
const dsPrint = ref() const dsPrint = ref()
// //
async function printFee() { async function printFee() {
dsPrint.value.init() dsPrint.value.init()
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.topTable { .topTable {
height: calc(100vh - 145px); height: calc(100vh - 145px);
} }
</style> </style>

Loading…
Cancel
Save