|
|
|
@ -116,7 +116,7 @@
|
|
|
|
|
</template>
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import { ref, onMounted, defineComponent, nextTick, watchEffect, watch } from 'vue'
|
|
|
|
|
import { InvoiceSettlementSave, InvoiceSettlementGet, PaymentSettlementGetList,InvoiceSettlementGetInvoiceDetails } from '../api'
|
|
|
|
|
import { InvoiceSettlementSave, InvoiceSettlementGet, PaymentSettlementGetList, PaymentSettlementDeleteDetail, GeneralInvoiceGet } from '../api'
|
|
|
|
|
import { useMessage } from '/@/hooks/web/useMessage'
|
|
|
|
|
import invoiceTable from './invoiceTable.vue'
|
|
|
|
|
import invoiceFile from '../../../operation/invoiceIssue/detail/invoiceFile.vue'
|
|
|
|
@ -144,7 +144,7 @@ const [registerFormMark, { getFieldsValue: getFieldsValueMark, setFieldsValue: s
|
|
|
|
|
schemas: markForm,
|
|
|
|
|
showActionButtonGroup: false,
|
|
|
|
|
})
|
|
|
|
|
const [registerTable, { setTableData,setSelectedRowKeys }] = useTable({
|
|
|
|
|
const [registerTable, { setTableData, setSelectedRowKeys, getSelectRows }] = useTable({
|
|
|
|
|
columns: invoiceColum,
|
|
|
|
|
useSearchForm: false,
|
|
|
|
|
showIndexColumn: false,
|
|
|
|
@ -157,7 +157,7 @@ const [registerTable, { setTableData,setSelectedRowKeys }] = useTable({
|
|
|
|
|
},
|
|
|
|
|
canResize: true,
|
|
|
|
|
showTableSetting: true,
|
|
|
|
|
id:'1',
|
|
|
|
|
id: '1',
|
|
|
|
|
immediate: false,
|
|
|
|
|
})
|
|
|
|
|
const [registerTable1, { getSelectRows: getSelectRowsFee, setProps: setPropsFee, setTableData: setTableData1 }] = useTable({
|
|
|
|
@ -172,63 +172,83 @@ const [registerTable1, { getSelectRows: getSelectRowsFee, setProps: setPropsFee,
|
|
|
|
|
width: 60,
|
|
|
|
|
},
|
|
|
|
|
showTableSetting: true,
|
|
|
|
|
id:'2',
|
|
|
|
|
id: '2',
|
|
|
|
|
canResize: true,
|
|
|
|
|
immediate: false,
|
|
|
|
|
})
|
|
|
|
|
function ClickLast(type) {
|
|
|
|
|
const data = {
|
|
|
|
|
"queryCondition": "[]",
|
|
|
|
|
"pageCondition": {
|
|
|
|
|
"pageIndex": 1,
|
|
|
|
|
"pageSize": 100,
|
|
|
|
|
"sortConditions": []
|
|
|
|
|
}
|
|
|
|
|
const data = {
|
|
|
|
|
"queryCondition": "[]",
|
|
|
|
|
"pageCondition": {
|
|
|
|
|
"pageIndex": 1,
|
|
|
|
|
"pageSize": 100,
|
|
|
|
|
"sortConditions": []
|
|
|
|
|
}
|
|
|
|
|
let indexQuery = 0
|
|
|
|
|
let list = []
|
|
|
|
|
PaymentSettlementGetList(data).then(res => {
|
|
|
|
|
list = res.data.list
|
|
|
|
|
res.data.list.forEach((item, index) => {
|
|
|
|
|
if (item.id == route.query.id) {
|
|
|
|
|
indexQuery = index
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
console.log(indexQuery, list)
|
|
|
|
|
if (type == 'next') {
|
|
|
|
|
if (indexQuery == 0) {
|
|
|
|
|
createMessage.warning('已经是第一条了')
|
|
|
|
|
} else {
|
|
|
|
|
go("/invoiceIssueDetail?id=" + list[indexQuery - 1].id + '&type=' + route.query.type)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (type == 'last') {
|
|
|
|
|
if (indexQuery == list.length - 1) {
|
|
|
|
|
createMessage.warning('已经是最后一条了')
|
|
|
|
|
} else {
|
|
|
|
|
go("/invoiceIssueDetail?id=" + list[indexQuery + 1].id + '&type=' + route.query.type)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
let indexQuery = 0
|
|
|
|
|
let list = []
|
|
|
|
|
PaymentSettlementGetList(data).then(res => {
|
|
|
|
|
list = res.data.list
|
|
|
|
|
res.data.list.forEach((item, index) => {
|
|
|
|
|
if (item.id == route.query.id) {
|
|
|
|
|
indexQuery = index
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
console.log(indexQuery, list)
|
|
|
|
|
if (type == 'next') {
|
|
|
|
|
if (indexQuery == 0) {
|
|
|
|
|
createMessage.warning('已经是第一条了')
|
|
|
|
|
} else {
|
|
|
|
|
go("/invoiceIssueDetail?id=" + list[indexQuery - 1].id + '&type=' + route.query.type)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (type == 'last') {
|
|
|
|
|
if (indexQuery == list.length - 1) {
|
|
|
|
|
createMessage.warning('已经是最后一条了')
|
|
|
|
|
} else {
|
|
|
|
|
go("/invoiceIssueDetail?id=" + list[indexQuery + 1].id + '&type=' + route.query.type)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
function addDetailed(){
|
|
|
|
|
function addDetailed() {
|
|
|
|
|
if (route.query.type == 'invoice') {
|
|
|
|
|
invoiceTableRef.value.customerIdP = form.value.customerId
|
|
|
|
|
invoiceTableRef.value.init()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
function handleClick(record){
|
|
|
|
|
setSelectedRowKeys([record.id])
|
|
|
|
|
const deleteRow = async () => {
|
|
|
|
|
let ids = []
|
|
|
|
|
ids = getSelectRows().map((item) => {
|
|
|
|
|
return item.id
|
|
|
|
|
})
|
|
|
|
|
if(ids.length==0){
|
|
|
|
|
createMessage.error('请选择数据')
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
const data = {
|
|
|
|
|
ids: [record.id],
|
|
|
|
|
businessType: record.businessType,
|
|
|
|
|
ids: ids
|
|
|
|
|
}
|
|
|
|
|
loading.value = true
|
|
|
|
|
InvoiceSettlementGetInvoiceDetails(data).then(res => {
|
|
|
|
|
PaymentSettlementDeleteDetail(data).then(res => {
|
|
|
|
|
if (res.succeeded) {
|
|
|
|
|
setTableData1(res.data)
|
|
|
|
|
createMessage.success(res.message)
|
|
|
|
|
getDetail()
|
|
|
|
|
}
|
|
|
|
|
loading.value = false
|
|
|
|
|
}).catch(()=>{
|
|
|
|
|
loading.value = false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
function handleClick(record) {
|
|
|
|
|
setSelectedRowKeys([record.id])
|
|
|
|
|
const data = {
|
|
|
|
|
id: record.id,
|
|
|
|
|
}
|
|
|
|
|
GeneralInvoiceGet(data).then(res => {
|
|
|
|
|
if (res.succeeded) {
|
|
|
|
|
setTableData1(res.data.details)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
const invoiceTableRef = ref('')
|
|
|
|
@ -243,7 +263,7 @@ onMounted(() => {
|
|
|
|
|
})
|
|
|
|
|
const invoiceFileRef = ref('')
|
|
|
|
|
function openFile() {
|
|
|
|
|
invoiceFileRef.value.init()
|
|
|
|
|
invoiceFileRef.value.init()
|
|
|
|
|
}
|
|
|
|
|
// 发票结算
|
|
|
|
|
function updateList(arr, currency) {
|
|
|
|
@ -262,8 +282,9 @@ function updateList(arr, currency) {
|
|
|
|
|
if (!route.query.id) {
|
|
|
|
|
const { fullPath } = route //获取当前路径
|
|
|
|
|
tabStore.closeTabByKey(fullPath, router)
|
|
|
|
|
let type = route.query.type
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
go(`/feeSettlementDetail?id=${res.data.id}&type=${route.query.type}`)
|
|
|
|
|
go(`/feeSettlementDetail?id=${res.data.id}&type=${type}`)
|
|
|
|
|
}, 50)
|
|
|
|
|
} else {
|
|
|
|
|
getDetail()
|
|
|
|
@ -291,8 +312,9 @@ function handleSave() {
|
|
|
|
|
if (!route.query.id) {
|
|
|
|
|
const { fullPath } = route //获取当前路径
|
|
|
|
|
tabStore.closeTabByKey(fullPath, router)
|
|
|
|
|
let type = route.query.type
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
go(`/feeSettlementDetail?id=${res.data.id}&type=${route.query.type}`)
|
|
|
|
|
go(`/feeSettlementDetail?id=${res.data.id}&type=${type}`)
|
|
|
|
|
}, 50)
|
|
|
|
|
} else {
|
|
|
|
|
getDetail()
|
|
|
|
@ -306,7 +328,7 @@ function getDetail() {
|
|
|
|
|
loading.value = true
|
|
|
|
|
InvoiceSettlementGet({ id: route.query.id }).then(res => {
|
|
|
|
|
if (res.succeeded) {
|
|
|
|
|
form.value = JSON.parse(JSON.stringify(res.data))
|
|
|
|
|
form.value = JSON.parse(JSON.stringify(res.data))
|
|
|
|
|
delete form.value.details
|
|
|
|
|
res.data.currencyAmount = res.data.currency + '/' + res.data.amount
|
|
|
|
|
setFieldsValueMark(res.data)
|
|
|
|
@ -372,6 +394,10 @@ function getDetail() {
|
|
|
|
|
padding-left: 20px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.bold {
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
:deep(.ant-divider) {
|
|
|
|
|
margin: 5px 0 !important;
|
|
|
|
|