|
|
|
@ -2,47 +2,6 @@
|
|
|
|
|
<a-spin :spinning="loading">
|
|
|
|
|
<div class="cost-entry-receive">
|
|
|
|
|
<div>
|
|
|
|
|
<!-- <a-tabs v-model:activeKey="activeKey">
|
|
|
|
|
<a-tab-pane key="1" tab="发票明细">
|
|
|
|
|
<a-button type="link" @click="add">
|
|
|
|
|
<span class="iconfont icon-jia"></span>
|
|
|
|
|
添加发票明细
|
|
|
|
|
</a-button>
|
|
|
|
|
<a-popconfirm title="确定要删除勾选的数据?" ok-text="确定" cancel-text="取消" @confirm="deleteRow">
|
|
|
|
|
<a-button style="margin: 0 10px;" type="link">
|
|
|
|
|
<span class="iconfont icon-shanchu1"></span>
|
|
|
|
|
删除发票明细
|
|
|
|
|
</a-button>
|
|
|
|
|
</a-popconfirm>
|
|
|
|
|
<a-button type="link" @click="open">
|
|
|
|
|
<span class="iconfont icon-liebiao"></span>
|
|
|
|
|
引入发票明细
|
|
|
|
|
</a-button>
|
|
|
|
|
</a-tab-pane>
|
|
|
|
|
<a-tab-pane key="2" tab="费用明细">
|
|
|
|
|
<a-popconfirm title="确定要删除勾选的数据?" ok-text="确定" cancel-text="取消" @confirm="delFee">
|
|
|
|
|
<a-button type="link">
|
|
|
|
|
<span class="iconfont icon-shanchu1"></span>
|
|
|
|
|
删除申请明细
|
|
|
|
|
</a-button>
|
|
|
|
|
</a-popconfirm>
|
|
|
|
|
</a-tab-pane>
|
|
|
|
|
<a-tab-pane key="3" tab="附件上传">
|
|
|
|
|
<div style="display: flex;">
|
|
|
|
|
<DsFile @handleSuccess="fileSuccess" ref="dsFile" :showFileList="false" :id="props.id" :show="false"
|
|
|
|
|
height="300">
|
|
|
|
|
<a-button type="link" @click="addFile">
|
|
|
|
|
<span class="iconfont icon-jia"></span>
|
|
|
|
|
附件上传
|
|
|
|
|
</a-button>
|
|
|
|
|
</DsFile>
|
|
|
|
|
<a-button type="link">
|
|
|
|
|
<span class="iconfont icon-shanchu1"></span>
|
|
|
|
|
删除文件
|
|
|
|
|
</a-button>
|
|
|
|
|
</div>
|
|
|
|
|
</a-tab-pane>
|
|
|
|
|
</a-tabs> -->
|
|
|
|
|
<span style="font-size: 12px;font-weight: bold;margin-right:20px ">发票明细</span>
|
|
|
|
|
<a-button type="link" @click="open">
|
|
|
|
|
<span class="iconfont icon-jia"></span>
|
|
|
|
@ -55,39 +14,19 @@
|
|
|
|
|
</a-button>
|
|
|
|
|
</a-popconfirm>
|
|
|
|
|
<a-button type="link" @click="openFee">
|
|
|
|
|
<span class="iconfont icon-jia"></span>
|
|
|
|
|
<span class="iconfont icon-peizhitubiaosvg-"></span>
|
|
|
|
|
费用名称
|
|
|
|
|
</a-button>
|
|
|
|
|
<!-- <a-button type="link" @click="add">
|
|
|
|
|
<span class="iconfont icon-liebiao"></span>
|
|
|
|
|
引入发票明细
|
|
|
|
|
</a-button> -->
|
|
|
|
|
<a-button type="link" @click="openFile">
|
|
|
|
|
<span class="iconfont icon-fujian1"></span>
|
|
|
|
|
附件上传
|
|
|
|
|
</a-button>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<input class="ds-tb-check" type="checkbox" v-model="allCheck" :indeterminate="someCheck" />
|
|
|
|
|
<hot-table ref="hotTb" :data="list" :settings="settings">
|
|
|
|
|
</hot-table>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- <div v-if="activeKey == '2'">
|
|
|
|
|
<a-table size="small" :pagination="false" rowKey="id"
|
|
|
|
|
:row-selection="{ selectedRowKeys: selectedRowKeysDetial, onChange: onSelectChangeDetail }"
|
|
|
|
|
:columns="columnsData" :data-source="dataSource" bordered>
|
|
|
|
|
</a-table>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="activeKey == '3'">
|
|
|
|
|
<a-table :loading="fileloading" size="small" :pagination="false" rowKey="id"
|
|
|
|
|
:row-selection="{ selectedRowKeys: selectedRowKeysFile, onChange: onSelectChangeFile }" :columns="columnsFile"
|
|
|
|
|
:data-source="fileData" bordered>
|
|
|
|
|
<template v-slot:bodyCell="{ column, record }">
|
|
|
|
|
<template v-if="column.dataIndex == 'fileName'">
|
|
|
|
|
<a @click="download(record)">{{ record.fileName }}</a>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-if="column.dataIndex == 'caozuo'">
|
|
|
|
|
<a @click="lookFile(record)">预览</a>
|
|
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
</a-table>
|
|
|
|
|
</div> -->
|
|
|
|
|
<div class="total">
|
|
|
|
|
合计
|
|
|
|
|
<span class="total-item">
|
|
|
|
@ -104,16 +43,45 @@
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<InvoiceDetails @updateList="updateList" ref="InvoiceDetailsRef"></InvoiceDetails>
|
|
|
|
|
<InvoiceDetails @addLeft="addLeft" @updateList="updateList" ref="InvoiceDetailsRef"></InvoiceDetails>
|
|
|
|
|
<a-modal width="800px" @cancel="fileFlag = false" :visible="fileFlag" title="预览文件" :footer="null">
|
|
|
|
|
<img v-if="!pdfFlag" :src="fileSrc" alt="">
|
|
|
|
|
<iframe v-if="pdfFlag" :src="fileSrc" style="height: 800px;width: 100%;" frameborder="0"></iframe>
|
|
|
|
|
</a-modal>
|
|
|
|
|
<a-modal width="800px" @cancel="openFileFlag = false" :visible="openFileFlag" title="文件列表" :footer="null">
|
|
|
|
|
<div style="padding-bottom: 20px">
|
|
|
|
|
<div style="display: flex;">
|
|
|
|
|
<DsFile @handleSuccess="fileSuccess" ref="dsFile" :showFileList="false" :id="route.query.id" :show="false"
|
|
|
|
|
height="300">
|
|
|
|
|
<a-button type="link" @click="addFile">
|
|
|
|
|
<span class="iconfont icon-jia"></span>
|
|
|
|
|
附件上传
|
|
|
|
|
</a-button>
|
|
|
|
|
</DsFile>
|
|
|
|
|
<a-button type="link" @click="delFile">
|
|
|
|
|
<span class="iconfont icon-shanchu1"></span>
|
|
|
|
|
删除文件
|
|
|
|
|
</a-button>
|
|
|
|
|
</div>
|
|
|
|
|
<a-table :loading="fileloading" size="small" :pagination="false" rowKey="id"
|
|
|
|
|
:row-selection="{ selectedRowKeys: selectedRowKeysFile, onChange: onSelectChangeFile }" :columns="columnsFile"
|
|
|
|
|
:data-source="fileData" bordered>
|
|
|
|
|
<template v-slot:bodyCell="{ column, record }">
|
|
|
|
|
<template v-if="column.dataIndex == 'fileName'">
|
|
|
|
|
<a @click="download(record)">{{ record.fileName }}</a>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-if="column.dataIndex == 'caozuo'">
|
|
|
|
|
<a @click="lookFile(record)">预览</a>
|
|
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
</a-table>
|
|
|
|
|
</div>
|
|
|
|
|
</a-modal>
|
|
|
|
|
<a-modal width="1400px" @cancel="feeFlag = false" :visible="feeFlag" title="费用明细" :footer="null">
|
|
|
|
|
<BasicTable @register="registerTable">
|
|
|
|
|
<template #tableTitle>
|
|
|
|
|
<a-button v-repeat type="link" >
|
|
|
|
|
<span class="iconfont icon-jia"></span>
|
|
|
|
|
<a-button @click="delFee" v-repeat type="link">
|
|
|
|
|
<span class="iconfont icon-shanchu1"></span>
|
|
|
|
|
删除
|
|
|
|
|
</a-button>
|
|
|
|
|
</template>
|
|
|
|
@ -137,7 +105,11 @@ import { HotTable } from '@handsontable/vue3'
|
|
|
|
|
import { registerAllModules } from 'handsontable/registry'
|
|
|
|
|
import { BasicTable, useTable, TableAction } from '/@/components/Table'
|
|
|
|
|
import 'handsontable/dist/handsontable.full.min.css'
|
|
|
|
|
import { GetInvoiceCodeList, GeneralInvoiceDeleteDetail, DeleteInvoiceDetail, GetOpFileList, DownloadOpFile } from '../api'
|
|
|
|
|
import {
|
|
|
|
|
GetInvoiceCodeList, GeneralInvoiceDeleteDetail, InvoiceApplicationGet,
|
|
|
|
|
DeleteInvoiceDetail, GetOpFileList, DownloadOpFile, BatchDelFiles,
|
|
|
|
|
InvoiceApplicationDeleteDetail
|
|
|
|
|
} from '../api'
|
|
|
|
|
import InvoiceDetails from './InvoiceDetails.vue'
|
|
|
|
|
import { useMessage } from '/@/hooks/web/useMessage'
|
|
|
|
|
import { useRoute } from 'vue-router'
|
|
|
|
@ -148,7 +120,7 @@ defineComponent({
|
|
|
|
|
HotTable,
|
|
|
|
|
})
|
|
|
|
|
registerAllModules()
|
|
|
|
|
const [registerTable, { setTableData,setProps }] = useTable({
|
|
|
|
|
const [registerTable, { setTableData, setProps, getSelectRows, setLoading }] = useTable({
|
|
|
|
|
columns: feeColumns,
|
|
|
|
|
formConfig: {
|
|
|
|
|
labelWidth: 120,
|
|
|
|
@ -200,19 +172,24 @@ function openFee() {
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
setTableData(dataSource.value)
|
|
|
|
|
setProps({
|
|
|
|
|
rowSelection: {
|
|
|
|
|
onChange: onSelectChange
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
rowSelection: {
|
|
|
|
|
onChange: onSelectChange
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
}, 200)
|
|
|
|
|
}
|
|
|
|
|
function onSelectChange(){
|
|
|
|
|
const openFileFlag = ref(false)
|
|
|
|
|
function onSelectChange() {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
const emits = defineEmits(['updateAmount', 'updateListSave', 'handleSuccess'])
|
|
|
|
|
const emits = defineEmits(['updateAmount', 'updateListSave', 'handleSuccess', 'addLeftSave'])
|
|
|
|
|
import { feeUnitDict } from '/@/hooks/dict/index'
|
|
|
|
|
function updateList(val,type) {
|
|
|
|
|
emits('updateListSave', val,type)
|
|
|
|
|
import { emit } from 'process'
|
|
|
|
|
function updateList(val, type) {
|
|
|
|
|
emits('updateListSave', val, type)
|
|
|
|
|
}
|
|
|
|
|
function addLeft(val,data,exchang,type) {
|
|
|
|
|
emits('addLeftSave', val,data,exchang,type)
|
|
|
|
|
}
|
|
|
|
|
const dsFile = ref('')
|
|
|
|
|
const route = useRoute()
|
|
|
|
@ -508,6 +485,9 @@ const getfileList = () => {
|
|
|
|
|
item['type'] = item?.filePath?.split('.')[1]
|
|
|
|
|
fileData.value = res.data
|
|
|
|
|
})
|
|
|
|
|
if (res.data.length == 0) {
|
|
|
|
|
fileData.value = []
|
|
|
|
|
}
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
fileloading.value = false
|
|
|
|
|
})
|
|
|
|
@ -523,7 +503,10 @@ function download(item) {
|
|
|
|
|
link.click()
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function openFile() {
|
|
|
|
|
getfileList()
|
|
|
|
|
openFileFlag.value = true
|
|
|
|
|
}
|
|
|
|
|
const selectedRowKeysFile = ref([]) as any
|
|
|
|
|
function onSelectChangeFile(selectedRowKeys) {
|
|
|
|
|
selectedRowKeysFile.value = selectedRowKeys
|
|
|
|
@ -538,21 +521,6 @@ const add = () => {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
const hot = hotTb.value.hotInstance
|
|
|
|
|
hot.addHook('afterOnCellMouseDown', function (event, coords, TD) { })
|
|
|
|
|
// 定义表格按键处理逻辑
|
|
|
|
|
hot.addHook('beforeKeyDown', function (event) {
|
|
|
|
|
// 检查按下的是否是特定的键(例如 'Enter')
|
|
|
|
|
if (event.key === 'ArrowDown') {
|
|
|
|
|
if (hot.getSelected()[0][0] == list.value.length - 1 && !hot.getActiveEditor()?._opened) {
|
|
|
|
|
list.value.push(JSON.parse(JSON.stringify(row)))
|
|
|
|
|
nextTick(() => {
|
|
|
|
|
hot.selectCell(list.value.length - 1, 4)
|
|
|
|
|
})
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
watchEffect(() => {
|
|
|
|
|
// 全选
|
|
|
|
@ -567,11 +535,12 @@ watchEffect(() => {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
const resData = ref({})
|
|
|
|
|
function init(data) {
|
|
|
|
|
list.value = data.invoiceDetails ? data.invoiceDetails : []
|
|
|
|
|
hotTb.value.hotInstance.loadData(data.invoiceDetails ? data.invoiceDetails : [])
|
|
|
|
|
dataSource.value = data.details ? data.details : []
|
|
|
|
|
// getfileList()
|
|
|
|
|
resData.value = data
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const taxUnitPriceTotal = ref(0) as any
|
|
|
|
@ -623,7 +592,7 @@ watch(
|
|
|
|
|
)
|
|
|
|
|
const InvoiceDetailsRef = ref(null) as any
|
|
|
|
|
function open() {
|
|
|
|
|
InvoiceDetailsRef.value.init()
|
|
|
|
|
InvoiceDetailsRef.value.init(resData.value)
|
|
|
|
|
}
|
|
|
|
|
const selectedRowKeysDetial = ref([]) as any
|
|
|
|
|
const dataSource = ref([])
|
|
|
|
@ -632,11 +601,27 @@ function onSelectChangeDetail(selectedRowKeys) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function delFee() {
|
|
|
|
|
setLoading(true)
|
|
|
|
|
let ids = []
|
|
|
|
|
ids = getSelectRows().map((item) => {
|
|
|
|
|
return item.id
|
|
|
|
|
})
|
|
|
|
|
InvoiceApplicationDeleteDetail({ ids: ids }).then(res => {
|
|
|
|
|
if (res.succeeded) {
|
|
|
|
|
InvoiceApplicationGet({ id: route.query.id }).then(res => {
|
|
|
|
|
setTableData(res.data.details)
|
|
|
|
|
setLoading(false)
|
|
|
|
|
createMessage.success('删除成功')
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
function delFile() {
|
|
|
|
|
loading.value = true
|
|
|
|
|
GeneralInvoiceDeleteDetail({ ids: selectedRowKeysDetial.value }).then(res => {
|
|
|
|
|
BatchDelFiles({ ids: selectedRowKeysFile.value }).then(res => {
|
|
|
|
|
if (res.succeeded) {
|
|
|
|
|
emits('handleSuccess')
|
|
|
|
|
createMessage.success('删除成功')
|
|
|
|
|
getfileList()
|
|
|
|
|
}
|
|
|
|
|
loading.value = false
|
|
|
|
|
})
|
|
|
|
|