|
|
|
@ -60,7 +60,7 @@
|
|
|
|
|
<BasicForm @register="registerFormMark">
|
|
|
|
|
|
|
|
|
|
</BasicForm>
|
|
|
|
|
<BasicTable v-if="route.query.type=='invoice'" class="ds-table" @row-click="handleClick" @register="registerTable">
|
|
|
|
|
<BasicTable class="ds-table" @row-click="handleClick" @register="registerTable">
|
|
|
|
|
<template #right>
|
|
|
|
|
<div style="width: 40%;margin-left: 10px;">
|
|
|
|
|
<div>
|
|
|
|
@ -101,54 +101,6 @@
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:bodyCell="{ column, record }">
|
|
|
|
|
<template v-if="column.dataIndex == 'businessType'">
|
|
|
|
|
<span v-if="record.businessType == 1">海运出口</span>
|
|
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
</BasicTable>
|
|
|
|
|
<BasicTable v-if="route.query.type=='free'" class="ds-table" @row-click="handleClick" @register="registerTableFree">
|
|
|
|
|
<template #right>
|
|
|
|
|
<div style="width: 40%;margin-left: 10px;">
|
|
|
|
|
<div>
|
|
|
|
|
<BasicTable class="ds-table" @register="registerTableFree1">
|
|
|
|
|
<template #tableTitle>
|
|
|
|
|
<div>
|
|
|
|
|
<span class="bold">费用明细</span>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:bodyCell="{ column, record }">
|
|
|
|
|
<template v-if="column.dataIndex == 'feeType'">
|
|
|
|
|
<span v-if="record.feeType == 1">应收</span>
|
|
|
|
|
<span v-if="record.feeType == 2">应付</span>
|
|
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
</BasicTable>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
<template #tableTitle>
|
|
|
|
|
<div>
|
|
|
|
|
<div>
|
|
|
|
|
<span class="bold">结算明细</span>
|
|
|
|
|
<a-button v-repeat type="link" @click="addDetailed()">
|
|
|
|
|
<span class="iconfont icon-jia"></span>
|
|
|
|
|
添加
|
|
|
|
|
</a-button>
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:bodyCell="{ column, record }">
|
|
|
|
|
<template v-if="column.dataIndex == 'businessType'">
|
|
|
|
@ -158,7 +110,8 @@
|
|
|
|
|
</BasicTable>
|
|
|
|
|
</div>
|
|
|
|
|
</a-spin>
|
|
|
|
|
<invoiceTable ref="invoiceTableRef" @updateList="updateList" @updateListFree="updateListFree"></invoiceTable>
|
|
|
|
|
<invoiceTable ref="invoiceTableRef" @updateListFreeLeft="updateListFreeLeft" @updateList="updateList"
|
|
|
|
|
@updateListFree="updateListFree"></invoiceTable>
|
|
|
|
|
<invoiceFile ref="invoiceFileRef"></invoiceFile>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
@ -175,7 +128,7 @@ 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,freeColum,freeDetailColum } from '../columns'
|
|
|
|
|
import { detailForm, markForm, invoiceColum, invoiceDetailColum, freeColum, freeDetailColum } from '../columns'
|
|
|
|
|
import { BasicForm, useForm } from '/@/components/Form/index'
|
|
|
|
|
import { useUserStore } from '/@/store/modules/user'
|
|
|
|
|
import { useMultipleTabStore } from '/@/store/modules/multipleTab'
|
|
|
|
@ -209,7 +162,7 @@ const [registerTable, { setTableData, setSelectedRowKeys, getSelectRows }] = use
|
|
|
|
|
},
|
|
|
|
|
canResize: true,
|
|
|
|
|
showTableSetting: true,
|
|
|
|
|
id: '1',
|
|
|
|
|
id: getTableId(),
|
|
|
|
|
immediate: false,
|
|
|
|
|
})
|
|
|
|
|
const [registerTable1, { getSelectRows: getSelectRowsFee, setProps: setPropsFee, setTableData: setTableData1 }] = useTable({
|
|
|
|
@ -224,52 +177,35 @@ const [registerTable1, { getSelectRows: getSelectRowsFee, setProps: setPropsFee,
|
|
|
|
|
width: 60,
|
|
|
|
|
},
|
|
|
|
|
showTableSetting: true,
|
|
|
|
|
id: '2',
|
|
|
|
|
canResize: true,
|
|
|
|
|
immediate: false,
|
|
|
|
|
})
|
|
|
|
|
const [registerTableFree, { setTableData:setTableDataFree, setSelectedRowKeys:setSelectedRowKeysFree, getSelectRows:getSelectRowsFree }] = useTable({
|
|
|
|
|
columns: getColums(),
|
|
|
|
|
useSearchForm: false,
|
|
|
|
|
showIndexColumn: false,
|
|
|
|
|
pagination: true,
|
|
|
|
|
rowSelection: {},
|
|
|
|
|
striped: true,
|
|
|
|
|
bordered: true,
|
|
|
|
|
indexColumnProps: {
|
|
|
|
|
width: 60,
|
|
|
|
|
},
|
|
|
|
|
canResize: true,
|
|
|
|
|
showTableSetting: true,
|
|
|
|
|
id: '5',
|
|
|
|
|
immediate: false,
|
|
|
|
|
})
|
|
|
|
|
const [registerTableFree1, { setTableData: setTableDataFree1 }] = useTable({
|
|
|
|
|
columns: getColumsDetail(),
|
|
|
|
|
useSearchForm: false,
|
|
|
|
|
showIndexColumn: false,
|
|
|
|
|
pagination: false,
|
|
|
|
|
striped: true,
|
|
|
|
|
rowKey: 'recordId',
|
|
|
|
|
bordered: true,
|
|
|
|
|
indexColumnProps: {
|
|
|
|
|
width: 60,
|
|
|
|
|
},
|
|
|
|
|
showTableSetting: true,
|
|
|
|
|
id: '6',
|
|
|
|
|
id: getTableDetailId(),
|
|
|
|
|
canResize: true,
|
|
|
|
|
immediate: false,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
function getColums() {
|
|
|
|
|
if (route.query.type == 'invoice') {
|
|
|
|
|
return freeDetailColum
|
|
|
|
|
return invoiceColum
|
|
|
|
|
}
|
|
|
|
|
if (route.query.type == 'free') {
|
|
|
|
|
return freeColum
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getTableId() {
|
|
|
|
|
if (route.query.type == 'invoice') {
|
|
|
|
|
return 1
|
|
|
|
|
}
|
|
|
|
|
if (route.query.type == 'free') {
|
|
|
|
|
return 5
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
function getTableDetailId() {
|
|
|
|
|
if (route.query.type == 'invoice') {
|
|
|
|
|
return 2
|
|
|
|
|
}
|
|
|
|
|
if (route.query.type == 'free') {
|
|
|
|
|
return 6
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
function getColumsDetail() {
|
|
|
|
|
if (route.query.type == 'invoice') {
|
|
|
|
|
return invoiceDetailColum
|
|
|
|
@ -278,6 +214,36 @@ function getColumsDetail() {
|
|
|
|
|
return freeDetailColum
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 自由结算--左边
|
|
|
|
|
function updateListFreeLeft(arr, currency) {
|
|
|
|
|
const data = {
|
|
|
|
|
settlement: {
|
|
|
|
|
...getFieldsValue(),
|
|
|
|
|
...getFieldsValueMark(),
|
|
|
|
|
},
|
|
|
|
|
documents: arr
|
|
|
|
|
}
|
|
|
|
|
data.settlement.billType = 1
|
|
|
|
|
data.settlement.mode = 3
|
|
|
|
|
data.settlement.currency = currency
|
|
|
|
|
loading.value = true
|
|
|
|
|
PaymentFreeSettlementSave(data).then(res => {
|
|
|
|
|
if (!route.query.id) {
|
|
|
|
|
const { fullPath } = route //获取当前路径
|
|
|
|
|
tabStore.closeTabByKey(fullPath, router)
|
|
|
|
|
let type = route.query.type
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
go(`/feeSettlementDetail?id=${res.data.id}&type=${type}`)
|
|
|
|
|
}, 50)
|
|
|
|
|
} else {
|
|
|
|
|
getDetail()
|
|
|
|
|
}
|
|
|
|
|
loading.value = false
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
loading.value = false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function ClickLast(type) {
|
|
|
|
|
const data = {
|
|
|
|
@ -297,7 +263,6 @@ function ClickLast(type) {
|
|
|
|
|
indexQuery = index
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
console.log(indexQuery, list)
|
|
|
|
|
if (type == 'next') {
|
|
|
|
|
if (indexQuery == 0) {
|
|
|
|
|
createMessage.warning('已经是第一条了')
|
|
|
|
@ -342,6 +307,7 @@ const deleteRow = async () => {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
function handleClick(record) {
|
|
|
|
|
if (route.query.type == 'invoice') {
|
|
|
|
|
setSelectedRowKeys([record.id])
|
|
|
|
|
const data = {
|
|
|
|
|
id: record.id,
|
|
|
|
@ -351,6 +317,8 @@ function handleClick(record) {
|
|
|
|
|
setTableData1(res.data.details)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
const invoiceTableRef = ref(null) as any
|
|
|
|
|
onMounted(() => {
|
|
|
|
@ -395,7 +363,7 @@ function updateList(arr, currency) {
|
|
|
|
|
loading.value = false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// 自由结算
|
|
|
|
|
// 自由结算--右边
|
|
|
|
|
function updateListFree(arr, currency) {
|
|
|
|
|
const data = {
|
|
|
|
|
settlement: {
|
|
|
|
@ -436,6 +404,7 @@ function handleSave() {
|
|
|
|
|
data.settlement.billType = 1
|
|
|
|
|
data.settlement.mode = 4
|
|
|
|
|
loading.value = true
|
|
|
|
|
if (route.query.type == 'invoice') {
|
|
|
|
|
InvoiceSettlementSave(data).then(res => {
|
|
|
|
|
loading.value = false
|
|
|
|
|
createMessage.success('保存成功')
|
|
|
|
@ -452,6 +421,26 @@ function handleSave() {
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
loading.value = false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if (route.query.type == 'free') {
|
|
|
|
|
PaymentFreeSettlementSave(data).then(res => {
|
|
|
|
|
loading.value = false
|
|
|
|
|
createMessage.success('保存成功')
|
|
|
|
|
if (!route.query.id) {
|
|
|
|
|
const { fullPath } = route //获取当前路径
|
|
|
|
|
tabStore.closeTabByKey(fullPath, router)
|
|
|
|
|
let type = route.query.type
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
go(`/feeSettlementDetail?id=${res.data.id}&type=${type}`)
|
|
|
|
|
}, 50)
|
|
|
|
|
} else {
|
|
|
|
|
getDetail()
|
|
|
|
|
}
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
loading.value = false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
const form = ref({ settlementNO: '' }) as any
|
|
|
|
|
function getDetail() {
|
|
|
|
@ -459,11 +448,12 @@ function getDetail() {
|
|
|
|
|
if (route.query.type == 'free') {
|
|
|
|
|
PaymentFreeSettlementGet({ id: route.query.id }).then(res => {
|
|
|
|
|
if (res.succeeded) {
|
|
|
|
|
res.data.mode = 'free'
|
|
|
|
|
form.value = JSON.parse(JSON.stringify(res.data))
|
|
|
|
|
res.data.currencyAmount = res.data.currency + '/' + res.data.amount
|
|
|
|
|
setFieldsValueMark(res.data)
|
|
|
|
|
setFieldsValue(res.data)
|
|
|
|
|
setTableDataFree(res.data.details)
|
|
|
|
|
setTableData(res.data.settlementDetails)
|
|
|
|
|
}
|
|
|
|
|
loading.value = false
|
|
|
|
|
})
|
|
|
|
@ -471,6 +461,7 @@ function getDetail() {
|
|
|
|
|
if (route.query.type == 'invoice') {
|
|
|
|
|
InvoiceSettlementGet({ id: route.query.id }).then(res => {
|
|
|
|
|
if (res.succeeded) {
|
|
|
|
|
res.data.mode = 'invoice'
|
|
|
|
|
form.value = JSON.parse(JSON.stringify(res.data))
|
|
|
|
|
delete form.value.details
|
|
|
|
|
res.data.currencyAmount = res.data.currency + '/' + res.data.amount
|
|
|
|
|