Merge branch 'szh-new' into dev

szh-new
sunzehua 3 months ago
commit eb3baf6bce

@ -148,6 +148,23 @@ export function InvoiceApplicationBizSave(parameter) {
}) })
} }
export function InvoiceApplicationDeleteDetail(parameter) {
return request({
url: '/feeApi/InvoiceApplication/DeleteDetail',
method: 'post',
data: parameter,
})
}
export function BatchDelFiles(parameter) {
return request({
url: '/mainApi/OpFile/BatchDelFiles',
method: 'post',
data: parameter,
})
}
export function GetOpFileList(parameter) { export function GetOpFileList(parameter) {
return request({ return request({
url: '/mainApi/OpFile/GetOpFileList', url: '/mainApi/OpFile/GetOpFileList',

@ -449,11 +449,11 @@ export const detailSearchFormSchema: FormSchema[] = [
options: [ options: [
{ {
label: '收', label: '收',
value: '', value: '1',
}, },
{ {
label: '付', label: '付',
value: '', value: '2',
} }
], ],
}, },

@ -41,18 +41,18 @@
<div class="bold">申请开票明细</div> <div class="bold">申请开票明细</div>
<div style="display: flex;"> <div style="display: flex;">
<div class="apply" :class="{ active: form.isYB }"> <div class="apply" :class="{ active: form.isYB }">
<a-checkbox v-model:checked="form.isYB" @change="handleChangeApply"> <a-checkbox :disabled="route.query.id ? true : false" v-model:checked="form.isYB" @change="handleChangeApply">
原币申请 原币申请
<span :class="{ rmb: item.currency == 'CNY', yb: item.currency != 'CNY' }" <span :class="{ rmb: item.currency == 'RMB', yb: item.currency != 'RMB' }"
v-for="(item, index) in amountArr" :key="index">{{ item.applyAmount }} v-for="(item, index) in amountArr" :key="index">{{ item.applyAmount }}
{{ {{
item.currency }}</span> item.currency }}</span>
</a-checkbox> </a-checkbox>
</div> </div>
<div class="apply" :class="{ active: form.isRMB }"> <div class="apply" :class="{ active: form.isRMB }">
<a-checkbox v-model:checked="form.isRMB" <a-checkbox :disabled="route.query.id ? true : false" v-model:checked="form.isRMB"
@change="handleChangeApply1">折算人民币申请</a-checkbox> @change="handleChangeApply1">折算人民币申请</a-checkbox>
<span class="rmb">{{ totalRmb }} RMB</span> <span class="rmb" v-if="totalRmb != 0">{{ totalRmb }} RMB</span>
<span></span> <span></span>
</div> </div>
</div> </div>
@ -121,6 +121,8 @@ import { detailColumns, detailSearchFormSchema, businessTypeList } from '../colu
import { GetBizList, InvoiceApplicationGetFees, GetExchangeRate } from '../api.js' import { GetBizList, InvoiceApplicationGetFees, GetExchangeRate } from '../api.js'
import { useMessage } from '/@/hooks/web/useMessage' import { useMessage } from '/@/hooks/web/useMessage'
const { createMessage } = useMessage() const { createMessage } = useMessage()
import { useRoute } from 'vue-router'
const route = useRoute()
const open = ref(false) const open = ref(false)
const columns = [ const columns = [
{ {
@ -181,8 +183,9 @@ const columns = [
] ]
const queryData = ref({}) as any
const dataSource = ref([]) as any const dataSource = ref([]) as any
const [registerTable, { getForm, setSelectedRowKeys, getSelectRows, setProps, getRawDataSource }] = useTable({ const [registerTable, { getForm, setSelectedRowKeys, getSelectRows, setProps, getRawDataSource, setLoading }] = useTable({
api: async (p) => { api: async (p) => {
const res: API.DataResult = await GetBizList(p) const res: API.DataResult = await GetBizList(p)
return new Promise((resolve) => { return new Promise((resolve) => {
@ -191,8 +194,8 @@ const [registerTable, { getForm, setSelectedRowKeys, getSelectRows, setProps, ge
}, },
beforeFetch: (p) => { beforeFetch: (p) => {
const data = formatParams(p) const data = formatParams(p)
// data.otherQueryCondition = ''
data.otherQueryCondition = getForm().getFieldsValue().FeeRange data.otherQueryCondition = getForm().getFieldsValue().FeeRange
queryData.value = JSON.parse(JSON.stringify(p))
return data return data
}, },
columns: detailColumns, columns: detailColumns,
@ -233,7 +236,8 @@ const exchangeFlag = ref(false)
const loading = ref(false) const loading = ref(false)
const form = ref({ const form = ref({
isYB: true isYB: true,
isRMB:false
}) as any }) as any
function handleChangeApply(e) { function handleChangeApply(e) {
form.value.isRMB = !e.target.checked form.value.isRMB = !e.target.checked
@ -246,38 +250,43 @@ function handleChangeApply1(e) {
form.value.isYB = !e.target.checked form.value.isYB = !e.target.checked
const arr = getSelectRowsFee() const arr = getSelectRowsFee()
const exchangeArr = [] as any const exchangeArr = [] as any
exchangeData.value = [] if (arr.length > 0) {
arr.forEach(item => { exchangeData.value = []
if (item.currency != 'CNY') {
exchangeArr.push(item)
}
})
if (exchangeArr.length > 0) {
const promises = exchangeArr.map(item => {
return new Promise((resolve) => {
const data = {
currencyFrom: 'CNY',
currencyTo: item.currency,
feeType: item.feeType
}
GetExchangeRate(data).then(res => {
exchangeData.value.push(res.data)
resolve(true);
})
});
});
return Promise.all(promises).then(() => {
exchangeFlag.value = true
});
}
if (exchangeArr.length == 0) {
const arr = getSelectRowsFee()
let total = 0
arr.forEach(item => { arr.forEach(item => {
total += Number(item.applyAmount) if (item.currency != 'RMB') {
exchangeArr.push(item)
}
}) })
totalRmb.value = total if (exchangeArr.length > 0) {
const promises = exchangeArr.map(item => {
return new Promise((resolve) => {
const data = {
currencyFrom: 'RMB',
currencyTo: item.currency,
feeType: item.feeType
}
GetExchangeRate(data).then(res => {
exchangeData.value.push(res.data)
resolve(true);
})
});
});
return Promise.all(promises).then(() => {
exchangeFlag.value = true
});
}
if (exchangeArr.length == 0) {
const arr = getSelectRowsFee()
let total = 0
arr.forEach(item => {
total += Number(item.applyAmount)
})
totalRmb.value = total
}
} }
} }
const totalRmb = ref(0) const totalRmb = ref(0)
@ -286,7 +295,7 @@ function handleSureExhange() {
const arr = getSelectRowsFee() const arr = getSelectRowsFee()
let total = 0 let total = 0
arr.forEach(item => { arr.forEach(item => {
if (item.currency != 'CNY') { if (item.currency != 'RMB') {
exchangeData.value.forEach(ite => { exchangeData.value.forEach(ite => {
if (item.currency == ite.currencyTo) { if (item.currency == ite.currencyTo) {
total += Number((Number(item.applyAmount) * Number(ite.reverseRate)).toFixed(2)) total += Number((Number(item.applyAmount) * Number(ite.reverseRate)).toFixed(2))
@ -320,7 +329,7 @@ function handleClick(record, index) {
loading.value = false loading.value = false
}) })
} }
function init() { function init(data) {
open.value = true open.value = true
setTimeout(() => { setTimeout(() => {
setProps({ setProps({
@ -338,6 +347,14 @@ function init() {
customerId: customerIdP.value customerId: customerIdP.value
}) })
} }
if(data.isRMB){
form.value.isRMB = true
form.value.isYB = false
}
if(data.isYB){
form.value.isYB = true
form.value.isRMB = false
}
}, 500) }, 500)
} }
const rmbTotal = ref(0) const rmbTotal = ref(0)
@ -358,11 +375,12 @@ function onSelectChange(selectedRowKeys) {
}) })
}) })
} }
const emits = defineEmits(['updateList']) const emits = defineEmits(['updateList', 'addLeft'])
// //
// 1. originalCurrency // 1. originalCurrency
// 2. rmb // 2. rmb
// originalAmount applyAmount // originalAmount applyAmount
// 3. rmbcny
function handleAddDetial() { function handleAddDetial() {
let arr = getSelectRowsFee() ? getSelectRowsFee() : [] let arr = getSelectRowsFee() ? getSelectRowsFee() : []
if (arr.length == 0) { if (arr.length == 0) {
@ -379,7 +397,7 @@ function handleAddDetial() {
if (form.value.isRMB) { if (form.value.isRMB) {
arr.forEach(item => { arr.forEach(item => {
item.originalCurrency = item.currency item.originalCurrency = item.currency
item.currency = 'CNY' item.currency = 'RMB'
item.originalAmount = item.applyAmount item.originalAmount = item.applyAmount
item.applyAmount = Number((Number(item.applyAmount) * Number(item.exchangeRate)).toFixed(2)) item.applyAmount = Number((Number(item.applyAmount) * Number(item.exchangeRate)).toFixed(2))
}) })
@ -417,18 +435,96 @@ function mergeByCurrency(arr) {
}); });
return Object.values(result); return Object.values(result);
} }
//
function addDetailed() { function addDetailed() {
const arr = getSelectRows() ? getSelectRows() : [] const arrRight = getSelectRows() ? getSelectRows() : []
const arr1 = [] const arr1 = []
arr.forEach(item => { const firstCustomerId = arrRight[0].customerId;
const exchangarr = [] as any
setLoading(true)
for (let i = 1; i < arrRight.length; i++) {
if (arrRight[i].customerId !== firstCustomerId) {
createMessage.error('请选择同一客户')
throw new Error('customerId值不一致');
}
}
arrRight.forEach(item => {
if (item.customerId != customerIdP.value) { if (item.customerId != customerIdP.value) {
arr1.push(1) arr1.push(1)
} }
}) })
if (arr1.length > 0) { if (arr1.length > 0 && customerIdP.value) {
createMessage.error('请选择同一客户') createMessage.error('请选择同一客户')
return false return false
} }
const queryDataStr = {} as any
if (queryData.value.feeType) {
queryDataStr.feeType = queryData.value.feeType
}
if (queryData.value.currency) {
queryDataStr.currency = queryData.value.currency
}
if (queryData.value.feeName) {
queryDataStr.feeName = queryData.value.feeName
}
if (queryData.value.FeeRange) {
queryDataStr.FeeRange = queryData.value.FeeRange
}
if (arrRight.length == 0) {
createMessage.error('请选择一条数据')
return false
}
if (arrRight.length > 0 && form.value.isRMB) {
const data = [] as any
arrRight.forEach(item => {
data.push({
id: item.id,
businessType: item.businessType
})
})
InvoiceApplicationGetFees(data).then(res => {
if (res.succeeded) {
const arrByex = [] as any
res.data.items.forEach(item => {
if (item.currency != 'RMB' && item.currency != 'CNY') {
arrByex.push(item)
}
})
if (arrByex.length > 0) {
const promises = arrByex.map(item => {
return new Promise((resolve) => {
const data = {
currencyFrom: 'RMB',
currencyTo: item.currency,
feeType: item.feeType
}
GetExchangeRate(data).then(res => {
exchangarr.push(res.data)
resolve(true);
})
});
});
return Promise.all(promises).then(() => {
emits('addLeft', arrRight, queryDataStr, exchangarr,'isRMB')
open.value = false
setLoading(false)
});
} else {
emits('addLeft', arrRight, queryDataStr, [],'isRMB')
open.value = false
setLoading(false)
}
}
})
}
if (arrRight.length > 0 && form.value.isYB) {
emits('addLeft', arrRight, queryDataStr, [],'isYB')
open.value = false
setLoading(false)
}
} }
const customerIdP = ref('') const customerIdP = ref('')
function changeCustIn(id) { function changeCustIn(id) {
@ -500,4 +596,16 @@ defineExpose({ init, changeCustIn })
font-weight: bold; font-weight: bold;
margin: 0 10px; margin: 0 10px;
} }
/deep/ .ant-checkbox-wrapper-checked .ant-checkbox-inner {
background-color: #257afa;
border-color: #257afa;
}
/deep/ .ant-checkbox-disabled.ant-checkbox-checked .ant-checkbox-inner::after {
border-color: #f5f5f5;
}
/deep/ .ant-checkbox-wrapper-checked .ant-checkbox-disabled+span {
color: #257afa;
}
</style> </style>

@ -2,47 +2,6 @@
<a-spin :spinning="loading"> <a-spin :spinning="loading">
<div class="cost-entry-receive"> <div class="cost-entry-receive">
<div> <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> <span style="font-size: 12px;font-weight: bold;margin-right:20px ">发票明细</span>
<a-button type="link" @click="open"> <a-button type="link" @click="open">
<span class="iconfont icon-jia"></span> <span class="iconfont icon-jia"></span>
@ -55,39 +14,19 @@
</a-button> </a-button>
</a-popconfirm> </a-popconfirm>
<a-button type="link" @click="openFee"> <a-button type="link" @click="openFee">
<span class="iconfont icon-jia"></span> <span class="iconfont icon-peizhitubiaosvg-"></span>
费用名称 费用名称
</a-button> </a-button>
<!-- <a-button type="link" @click="add"> <a-button type="link" @click="openFile">
<span class="iconfont icon-liebiao"></span> <span class="iconfont icon-fujian1"></span>
引入发票明细 附件上传
</a-button> --> </a-button>
</div> </div>
<div> <div>
<input class="ds-tb-check" type="checkbox" v-model="allCheck" :indeterminate="someCheck" /> <input class="ds-tb-check" type="checkbox" v-model="allCheck" :indeterminate="someCheck" />
<hot-table ref="hotTb" :data="list" :settings="settings"> <hot-table ref="hotTb" :data="list" :settings="settings">
</hot-table> </hot-table>
</div> </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"> <div class="total">
合计 合计
<span class="total-item"> <span class="total-item">
@ -104,16 +43,45 @@
</span> </span>
</div> </div>
</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"> <a-modal width="800px" @cancel="fileFlag = false" :visible="fileFlag" title="预览文件" :footer="null">
<img v-if="!pdfFlag" :src="fileSrc" alt=""> <img v-if="!pdfFlag" :src="fileSrc" alt="">
<iframe v-if="pdfFlag" :src="fileSrc" style="height: 800px;width: 100%;" frameborder="0"></iframe> <iframe v-if="pdfFlag" :src="fileSrc" style="height: 800px;width: 100%;" frameborder="0"></iframe>
</a-modal> </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"> <a-modal width="1400px" @cancel="feeFlag = false" :visible="feeFlag" title="费用明细" :footer="null">
<BasicTable @register="registerTable"> <BasicTable @register="registerTable">
<template #tableTitle> <template #tableTitle>
<a-button v-repeat type="link" > <a-button @click="delFee" v-repeat type="link">
<span class="iconfont icon-jia"></span> <span class="iconfont icon-shanchu1"></span>
删除 删除
</a-button> </a-button>
</template> </template>
@ -137,7 +105,11 @@ import { HotTable } from '@handsontable/vue3'
import { registerAllModules } from 'handsontable/registry' import { registerAllModules } from 'handsontable/registry'
import { BasicTable, useTable, TableAction } from '/@/components/Table' import { BasicTable, useTable, TableAction } from '/@/components/Table'
import 'handsontable/dist/handsontable.full.min.css' 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 InvoiceDetails from './InvoiceDetails.vue'
import { useMessage } from '/@/hooks/web/useMessage' import { useMessage } from '/@/hooks/web/useMessage'
import { useRoute } from 'vue-router' import { useRoute } from 'vue-router'
@ -148,7 +120,7 @@ defineComponent({
HotTable, HotTable,
}) })
registerAllModules() registerAllModules()
const [registerTable, { setTableData,setProps }] = useTable({ const [registerTable, { setTableData, setProps, getSelectRows, setLoading }] = useTable({
columns: feeColumns, columns: feeColumns,
formConfig: { formConfig: {
labelWidth: 120, labelWidth: 120,
@ -200,19 +172,24 @@ function openFee() {
setTimeout(() => { setTimeout(() => {
setTableData(dataSource.value) setTableData(dataSource.value)
setProps({ setProps({
rowSelection: { rowSelection: {
onChange: onSelectChange onChange: onSelectChange
}, },
}) })
}, 200) }, 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' import { feeUnitDict } from '/@/hooks/dict/index'
function updateList(val,type) { import { emit } from 'process'
emits('updateListSave', val,type) function updateList(val, type) {
emits('updateListSave', val, type)
}
function addLeft(val,data,exchang,type) {
emits('addLeftSave', val,data,exchang,type)
} }
const dsFile = ref('') const dsFile = ref('')
const route = useRoute() const route = useRoute()
@ -508,6 +485,9 @@ const getfileList = () => {
item['type'] = item?.filePath?.split('.')[1] item['type'] = item?.filePath?.split('.')[1]
fileData.value = res.data fileData.value = res.data
}) })
if (res.data.length == 0) {
fileData.value = []
}
}).catch(() => { }).catch(() => {
fileloading.value = false fileloading.value = false
}) })
@ -523,7 +503,10 @@ function download(item) {
link.click() link.click()
}) })
} }
function openFile() {
getfileList()
openFileFlag.value = true
}
const selectedRowKeysFile = ref([]) as any const selectedRowKeysFile = ref([]) as any
function onSelectChangeFile(selectedRowKeys) { function onSelectChangeFile(selectedRowKeys) {
selectedRowKeysFile.value = selectedRowKeys selectedRowKeysFile.value = selectedRowKeys
@ -538,21 +521,6 @@ const add = () => {
}) })
} }
onMounted(() => { 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(() => { watchEffect(() => {
// //
@ -567,11 +535,12 @@ watchEffect(() => {
}) })
} }
}) })
const resData = ref({})
function init(data) { function init(data) {
list.value = data.invoiceDetails ? data.invoiceDetails : [] list.value = data.invoiceDetails ? data.invoiceDetails : []
hotTb.value.hotInstance.loadData(data.invoiceDetails ? data.invoiceDetails : []) hotTb.value.hotInstance.loadData(data.invoiceDetails ? data.invoiceDetails : [])
dataSource.value = data.details ? data.details : [] dataSource.value = data.details ? data.details : []
// getfileList() resData.value = data
} }
const taxUnitPriceTotal = ref(0) as any const taxUnitPriceTotal = ref(0) as any
@ -623,7 +592,7 @@ watch(
) )
const InvoiceDetailsRef = ref(null) as any const InvoiceDetailsRef = ref(null) as any
function open() { function open() {
InvoiceDetailsRef.value.init() InvoiceDetailsRef.value.init(resData.value)
} }
const selectedRowKeysDetial = ref([]) as any const selectedRowKeysDetial = ref([]) as any
const dataSource = ref([]) const dataSource = ref([])
@ -632,11 +601,27 @@ function onSelectChangeDetail(selectedRowKeys) {
} }
function delFee() { 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 loading.value = true
GeneralInvoiceDeleteDetail({ ids: selectedRowKeysDetial.value }).then(res => { BatchDelFiles({ ids: selectedRowKeysFile.value }).then(res => {
if (res.succeeded) { if (res.succeeded) {
emits('handleSuccess')
createMessage.success('删除成功') createMessage.success('删除成功')
getfileList()
} }
loading.value = false loading.value = false
}) })

@ -3,11 +3,11 @@
<a-spin :spinning="loading"> <a-spin :spinning="loading">
<div class="infoclientBox"> <div class="infoclientBox">
<div style="display: flex; align-items: center"> <div style="display: flex; align-items: center">
<a-tooltip placement="top" :mouseEnterDelay="0.5"> <a-tooltip placement="top" :mouseEnterDelay="0.5" v-if="route.query.id">
<template #title> <template #title>
<span>新建</span> <span>新建</span>
</template> </template>
<span class="ds-action-svg-btn"> <span @click="handleNew" class="ds-action-svg-btn">
<img src="../../../../assets/svg/infoclient//xinjian.svg" class="SvgImg" /> <img src="../../../../assets/svg/infoclient//xinjian.svg" class="SvgImg" />
</span> </span>
</a-tooltip> </a-tooltip>
@ -31,7 +31,7 @@
<template #title> <template #title>
<span>提交审核</span> <span>提交审核</span>
</template> </template>
<span class="ds-action-svg-btn" @click="SubmitAudit"> <span class="ds-action-svg-btn" @click="handleApply">
<img src="../../../../assets/svg/infoclient/tijiao.svg" class="SvgImg" /> <img src="../../../../assets/svg/infoclient/tijiao.svg" class="SvgImg" />
</span> </span>
</a-tooltip> </a-tooltip>
@ -39,7 +39,7 @@
<template #title> <template #title>
<span>撤销审核</span> <span>撤销审核</span>
</template> </template>
<span class="ds-action-svg-btn" @click="Withdraw"> <span class="ds-action-svg-btn" @click="handleWithdraw">
<img src="../../../../assets/svg/infoclient/chexiaotijiao.svg" class="SvgImg" /> <img src="../../../../assets/svg/infoclient/chexiaotijiao.svg" class="SvgImg" />
</span> </span>
</a-tooltip> </a-tooltip>
@ -78,10 +78,6 @@
</div> </div>
<div style="color: #8a96a5; font-size: 12px"> 申请单号{{ form.applicationNO }} </div> <div style="color: #8a96a5; font-size: 12px"> 申请单号{{ form.applicationNO }} </div>
</div> </div>
<!-- <div>
<a-button type="link" @click="handleSave"> <i class="iconfont icon-zhcc_tidan"></i>保存</a-button>
<a-button type="link"><i class="iconfont icon-return"></i>撤销审核</a-button>
</div> -->
<div class="box"> <div class="box">
<div class="top"> <div class="top">
<div class="left"> <div class="left">
@ -94,14 +90,14 @@
<div class="apply" :class="{ active: form.isYB }"> <div class="apply" :class="{ active: form.isYB }">
<a-checkbox :disabled="true" v-model:checked="form.isYB"> <a-checkbox :disabled="true" v-model:checked="form.isYB">
原币申请 原币申请
<span :class="{ rmb: item.currency == 'CNY', yb: item.currency != 'CNY' }" <span :class="{ rmb: item.currency == 'RMB', yb: item.currency != 'RMB' }"
v-for="(item, index) in amountArr" :key="index">{{ item.applyAmount }} v-for="(item, index) in amountArr" :key="index">{{ item.applyAmount }}
{{ item.currency }}</span> {{ item.currency }}</span>
</a-checkbox> </a-checkbox>
</div> </div>
<div class="apply" :class="{ active: form.isRMB }"> <div class="apply" :class="{ active: form.isRMB }">
<a-checkbox :disabled="true" v-model:checked="form.isRMB">折算人民币申请</a-checkbox> <a-checkbox :disabled="true" v-model:checked="form.isRMB">折算人民币申请</a-checkbox>
<span class="rmb">{{ totalRmb }} RMB</span> <span class="rmb" v-if="totalRmb != 0">{{ totalRmb }} RMB</span>
<span></span> <span></span>
</div> </div>
</div> </div>
@ -136,8 +132,8 @@
</div> </div>
</div> </div>
<div class="box"> <div class="box">
<feeTable @handleSuccess="handleSuccess" @updateListSave=updateListSave @updateAmount="updateAmount" <feeTable @addLeftSave="addLeftSave" @handleSuccess="handleSuccess" @updateListSave=updateListSave
ref="feeTableRef"> @updateAmount="updateAmount" ref="feeTableRef">
</feeTable> </feeTable>
</div> </div>
@ -184,10 +180,13 @@ import {
RenderTemplate, RenderTemplate,
GetClientBankList, GetClientBankList,
GetOrgList, GetOrgList,
GetClientInfo InvoiceApplicationBizSave,
GetClientInfo,
ApplyAudit,
Withdraw
} from '../api' } from '../api'
import { useMessage } from '/@/hooks/web/useMessage' import { useMessage } from '/@/hooks/web/useMessage'
import { useRoute } from 'vue-router' import { useRoute, useRouter } from 'vue-router'
import { import {
GetControllerClientList, GetControllerClientList,
GetCustomerServiceList, GetCustomerServiceList,
@ -199,6 +198,9 @@ import { useUserStore } from '/@/store/modules/user'
import { set } from 'nprogress' import { set } from 'nprogress'
import { isNamedTupleMember } from 'typescript' import { isNamedTupleMember } from 'typescript'
import { detailColumns } from '../columns' import { detailColumns } from '../columns'
import { get } from 'sortablejs'
import { useMultipleTabStore } from '/@/store/modules/multipleTab'
const tabStore = useMultipleTabStore()
const userStore = useUserStore() const userStore = useUserStore()
const go = useGo() const go = useGo()
const CategoryData = [ const CategoryData = [
@ -676,6 +678,7 @@ const linkageFormBottom = (e) => {
const feeTableRef = ref(null) as any const feeTableRef = ref(null) as any
const open = ref(false) const open = ref(false)
const nameFlag = ref(false) const nameFlag = ref(false)
const router = useRouter()
// invoiceDetails // invoiceDetails
async function handleSave() { async function handleSave() {
// const values = await validate() // const values = await validate()
@ -691,7 +694,11 @@ async function handleSave() {
.then((res) => { .then((res) => {
if (res.succeeded) { if (res.succeeded) {
createMessage.success('保存成功') createMessage.success('保存成功')
go(`/invoiceapplyDetail?id=${res.data.id}`) const { fullPath } = route //
tabStore.closeTabByKey(fullPath, router)
setTimeout(() => {
go(`/invoiceapplyDetail?id=${res.data.id}`)
}, 50)
} else { } else {
createMessage.error(res.message) createMessage.error(res.message)
} }
@ -748,12 +755,18 @@ function openTemp() {
}) })
}) })
} }
function handleChangeApply(e) { function handleApply() {
form.value.isRMB = !e.target.checked ApplyAudit({ ids: [route.query.id] }).then(res => {
if (res.succeeded) {
createMessage.success('操作成功')
getDetail()
}
})
} }
function handleChangeApply1(e) { function handleNew() {
form.value.isYB = !e.target.checked go(`/invoiceapplyDetail?type=add`)
} }
function init() { function init() {
if (id.value) { if (id.value) {
getDetail() getDetail()
@ -783,11 +796,20 @@ function init() {
} }
}) })
} }
function handleWithdraw() {
Withdraw({ ids: [route.query.id] }).then(res => {
if (res.succeeded) {
createMessage.success('操作成功')
getDetail()
}
})
}
function handleAddLabel(val) { function handleAddLabel(val) {
tempContent.value += '[' + val.displayName + ']' tempContent.value += '[' + val.displayName + ']'
} }
const details = ref([]) const details = ref([])
//
function getDetail() { function getDetail() {
InvoiceApplicationGet({ id: id.value }).then((res) => { InvoiceApplicationGet({ id: id.value }).then((res) => {
if (res.succeeded) { if (res.succeeded) {
@ -800,18 +822,27 @@ function getDetail() {
form.value.statusText = res.data.statusText form.value.statusText = res.data.statusText
form.value.applicationNO = res.data.applicationNO form.value.applicationNO = res.data.applicationNO
details.value = res.data.details details.value = res.data.details
feeTableRef.value.init(res.data) feeTableRef.value.changeCust(res.data.customerId)
if (res.data.currency == 'CNY') { amountArr.value = []
if (res.data.currency == 'RMB') {
form.value.isRMB = true form.value.isRMB = true
res.data.isRMB = true
res.data.isYB = false
res.data.summaryItems.forEach(item => {
totalRmb.value += Number(item.amount)
})
} else { } else {
form.value.isYB = true form.value.isYB = true
} res.data.isRMB = false
res.data.summaryItems.forEach(item=>{ res.data.isYB = true
amountArr.value.push({ res.data.summaryItems.forEach(item => {
currency:item.currency, amountArr.value.push({
applyAmount:item.amount currency: item.currency,
applyAmount: item.amount
})
}) })
}) }
feeTableRef.value.init(res.data)
} }
}) })
} }
@ -912,21 +943,20 @@ function changeCust(id, name) {
}) })
}); });
} }
// details // details
function updateListSave(arr, type) { function updateListSave(arr, type) {
loading.value = true loading.value = true
changeCust(arr[0].customerId, arr[0].customerName).then(res => { changeCust(arr[0].customerId, arr[0].customerName).then(res => {
const data = { const data = {
...getFieldsValue(), ...getFieldsValue(),
...getFieldsValueM(), ...getFieldsValueM(),
...getFieldsValueB(), ...getFieldsValueB(),
...form.value, ...form.value,
details: arr.concat(details.value), details: arr,
invoiceDetails: feeTableRef.value.list, invoiceDetails: feeTableRef.value.list,
} }
if (type == 'isRMB') { if (type == 'isRMB') {
data.currency = 'CNY' data.currency = 'RMB'
} else { } else {
data.currency = '' data.currency = ''
} }
@ -934,7 +964,11 @@ function updateListSave(arr, type) {
.then((res) => { .then((res) => {
if (res.succeeded) { if (res.succeeded) {
createMessage.success('保存成功') createMessage.success('保存成功')
go(`/invoiceapplyDetail?id=${res.data.id}`) const { fullPath } = route //
tabStore.closeTabByKey(fullPath, router)
setTimeout(() => {
go(`/invoiceapplyDetail?id=${res.data.id}`)
}, 50)
} else { } else {
createMessage.error(res.message) createMessage.error(res.message)
} }
@ -946,6 +980,54 @@ function updateListSave(arr, type) {
}) })
}
//
function addLeftSave(arr, query, exchang, type) {
loading.value = true
changeCust(arr[0].customerId, arr[0].customerName).then(res => {
const itemList = [] as any
arr.forEach(item => {
itemList.push({
id: item.id,
businessType: item.businessType
})
})
const data = {
application: {
...getFieldsValue(),
...getFieldsValueM(),
...getFieldsValueB(),
...form.value,
invoiceDetails: feeTableRef.value.list,
},
exchanges: exchang,
items: itemList,
queryString: Object.keys(query).length != 0 ? JSON.stringify(query) : ''
}
if (type == 'isRMB') {
data.application.currency = 'RMB'
}
if (type == 'isYB') {
data.application.currency = ''
}
InvoiceApplicationBizSave(data)
.then((res) => {
if (res.succeeded) {
createMessage.success('保存成功')
const { fullPath } = route //
tabStore.closeTabByKey(fullPath, router)
setTimeout(() => {
go(`/invoiceapplyDetail?id=${res.data.id}`)
}, 50)
} else {
createMessage.error(res.message)
}
loading.value = false
})
.catch((err) => {
loading.value = false
})
})
} }
const tempNameId = ref('') const tempNameId = ref('')
function handleRender() { function handleRender() {
@ -959,7 +1041,14 @@ function handleRender() {
id: id.value, id: id.value,
template: temp, template: temp,
} }
RenderTemplate(data).then((res) => { }) RenderTemplate(data).then((res) => {
if (res.succeeded) {
marksetFieldsValue({
note: res.data
})
nameFlag.value = false
}
})
} }
const tempName = ref('') const tempName = ref('')
const tempId = ref('') const tempId = ref('')
@ -1100,14 +1189,17 @@ function handleSelect(value) {
.box { .box {
padding: 0 20px; padding: 0 20px;
} }
/deep/ .ant-checkbox-wrapper-checked .ant-checkbox-inner{
/deep/ .ant-checkbox-wrapper-checked .ant-checkbox-inner {
background-color: #257afa; background-color: #257afa;
border-color: #257afa; border-color: #257afa;
} }
/deep/ .ant-checkbox-disabled.ant-checkbox-checked .ant-checkbox-inner::after{
/deep/ .ant-checkbox-disabled.ant-checkbox-checked .ant-checkbox-inner::after {
border-color: #f5f5f5; border-color: #f5f5f5;
} }
/deep/ .ant-checkbox-wrapper-checked .ant-checkbox-disabled + span{
/deep/ .ant-checkbox-wrapper-checked .ant-checkbox-disabled+span {
color: #257afa; color: #257afa;
} }
</style> </style>

@ -2,45 +2,55 @@
<div> <div>
<div class="topTable"> <div class="topTable">
<BasicTable class="ds-table" @register="registerTable" @row-dbClick="(e) => { <BasicTable class="ds-table" @register="registerTable" @row-dbClick="(e) => {
GoDetailed(true, e) GoDetailed(true, e)
} }
"> ">
<template #tableTitle> <template #tableTitle>
<div class="buttonGroup">
<div class="buttonGroup ">
<div class="tableTitleBox">
<a-tooltip placement="top" :mouseEnterDelay="0.5">
<template #title>
<span>新建</span>
</template>
<span class="ds-action-svg-btn">
<a-button @click="GoDetailed(false)" v-repeat type="link">
<img src="../../../assets/svg/infoclient/xinjian.svg" class="SvgImg" />
</a-button>
</span>
</a-tooltip>
<a-tooltip placement="top" :mouseEnterDelay="0.5">
<template #title>
<span>删除</span>
</template>
<span class="ds-action-svg-btn">
<a-popconfirm title="确定删除当前选中数据?" @confirm="FnDel" ok-text="" cancel-text="">
<a-button v-repeat type="link">
<img src="../../../assets/svg/infoclient/shanchu.svg" class="SvgImg" />
</a-button>
</a-popconfirm>
</span>
</a-tooltip>
</div>
<a-button v-repeat type="link"> <a-button v-repeat type="link">
<span class="iconfont icon-locksuo IconColor"></span> <span class="iconfont icon-liebiao IconColor"></span>
显示工作流 显示工作流
</a-button> </a-button>
<a-button v-repeat type="link"> <a-button v-repeat type="link">
<span class="iconfont icon-locksuo IconColor"></span> <span class="iconfont icon-a-17Btuichu IconColor"></span>
导出EXCEL 导出EXCEL
</a-button> </a-button>
<a-button @click="handleApply" v-repeat type="link"> <a-button @click="handleApply" v-repeat type="link">
<span class="iconfont icon-locksuo IconColor"></span> <span class="iconfont icon-tijiao1 IconColor"></span>
提交审核 提交审核
</a-button> </a-button>
<a-button @click="handleWithdraw" v-repeat type="link"> <a-button @click="handleWithdraw" v-repeat type="link">
<span class="iconfont icon-locksuo IconColor"></span> <span class="iconfont icon-chehuisekuai IconColor"></span>
撤销审核 撤销审核
</a-button> </a-button>
</div> </div>
</template> </template>
<template #toolbar>
<a-button v-repeat type="link" @click="GoDetailed(false, null)">
<span class="iconfont icon-new_document"></span>
添加
</a-button>
<a-popconfirm title="确定删除当前选中数据?" ok-text="" cancel-text="" @confirm="FnDel">
<a-button type="link">
<span class="iconfont icon-shanchu21"></span>
删除
</a-button>
</a-popconfirm>
<a-button v-repeat type="link" @click="printFee">
<span class="iconfont icon-xiaopiaodayin"></span>
打印
</a-button>
</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 :actions="[ <TableAction :actions="[
@ -251,4 +261,23 @@ async function printFee() {
.topTable { .topTable {
height: calc(100vh - 145px); height: calc(100vh - 145px);
} }
.SvgImg {
width: 12px;
}
.tableTitleBox {
.ant-btn-link {
border-radius: 2px;
background: rgba(245, 249, 252, 1);
margin-left: 13px;
color: #000;
font-size: 16px;
}
}
.buttonGroup {
display: flex;
align-items: center;
}
</style> </style>

Loading…
Cancel
Save