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) {
return request({
url: '/mainApi/OpFile/GetOpFileList',

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

@ -41,18 +41,18 @@
<div class="bold">申请开票明细</div>
<div style="display: flex;">
<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 }}
{{
item.currency }}</span>
</a-checkbox>
</div>
<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>
<span class="rmb">{{ totalRmb }} RMB</span>
<span class="rmb" v-if="totalRmb != 0">{{ totalRmb }} RMB</span>
<span></span>
</div>
</div>
@ -121,6 +121,8 @@ import { detailColumns, detailSearchFormSchema, businessTypeList } from '../colu
import { GetBizList, InvoiceApplicationGetFees, GetExchangeRate } from '../api.js'
import { useMessage } from '/@/hooks/web/useMessage'
const { createMessage } = useMessage()
import { useRoute } from 'vue-router'
const route = useRoute()
const open = ref(false)
const columns = [
{
@ -181,8 +183,9 @@ const columns = [
]
const queryData = 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) => {
const res: API.DataResult = await GetBizList(p)
return new Promise((resolve) => {
@ -191,8 +194,8 @@ const [registerTable, { getForm, setSelectedRowKeys, getSelectRows, setProps, ge
},
beforeFetch: (p) => {
const data = formatParams(p)
// data.otherQueryCondition = ''
data.otherQueryCondition = getForm().getFieldsValue().FeeRange
queryData.value = JSON.parse(JSON.stringify(p))
return data
},
columns: detailColumns,
@ -233,7 +236,8 @@ const exchangeFlag = ref(false)
const loading = ref(false)
const form = ref({
isYB: true
isYB: true,
isRMB:false
}) as any
function handleChangeApply(e) {
form.value.isRMB = !e.target.checked
@ -246,38 +250,43 @@ function handleChangeApply1(e) {
form.value.isYB = !e.target.checked
const arr = getSelectRowsFee()
const exchangeArr = [] as any
exchangeData.value = []
arr.forEach(item => {
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
if (arr.length > 0) {
exchangeData.value = []
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)
@ -286,7 +295,7 @@ function handleSureExhange() {
const arr = getSelectRowsFee()
let total = 0
arr.forEach(item => {
if (item.currency != 'CNY') {
if (item.currency != 'RMB') {
exchangeData.value.forEach(ite => {
if (item.currency == ite.currencyTo) {
total += Number((Number(item.applyAmount) * Number(ite.reverseRate)).toFixed(2))
@ -320,7 +329,7 @@ function handleClick(record, index) {
loading.value = false
})
}
function init() {
function init(data) {
open.value = true
setTimeout(() => {
setProps({
@ -338,6 +347,14 @@ function init() {
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)
}
const rmbTotal = ref(0)
@ -358,11 +375,12 @@ function onSelectChange(selectedRowKeys) {
})
})
}
const emits = defineEmits(['updateList'])
const emits = defineEmits(['updateList', 'addLeft'])
//
// 1. originalCurrency
// 2. rmb
// originalAmount applyAmount
// 3. rmbcny
function handleAddDetial() {
let arr = getSelectRowsFee() ? getSelectRowsFee() : []
if (arr.length == 0) {
@ -379,7 +397,7 @@ function handleAddDetial() {
if (form.value.isRMB) {
arr.forEach(item => {
item.originalCurrency = item.currency
item.currency = 'CNY'
item.currency = 'RMB'
item.originalAmount = item.applyAmount
item.applyAmount = Number((Number(item.applyAmount) * Number(item.exchangeRate)).toFixed(2))
})
@ -417,18 +435,96 @@ function mergeByCurrency(arr) {
});
return Object.values(result);
}
//
function addDetailed() {
const arr = getSelectRows() ? getSelectRows() : []
const arrRight = getSelectRows() ? getSelectRows() : []
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) {
arr1.push(1)
}
})
if (arr1.length > 0) {
if (arr1.length > 0 && customerIdP.value) {
createMessage.error('请选择同一客户')
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('')
function changeCustIn(id) {
@ -500,4 +596,16 @@ defineExpose({ init, changeCustIn })
font-weight: bold;
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>

@ -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
})

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

@ -2,45 +2,55 @@
<div>
<div class="topTable">
<BasicTable class="ds-table" @register="registerTable" @row-dbClick="(e) => {
GoDetailed(true, e)
}
GoDetailed(true, e)
}
">
<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">
<span class="iconfont icon-locksuo IconColor"></span>
<span class="iconfont icon-liebiao IconColor"></span>
显示工作流
</a-button>
<a-button v-repeat type="link">
<span class="iconfont icon-locksuo IconColor"></span>
<span class="iconfont icon-a-17Btuichu IconColor"></span>
导出EXCEL
</a-button>
<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 @click="handleWithdraw" v-repeat type="link">
<span class="iconfont icon-locksuo IconColor"></span>
<span class="iconfont icon-chehuisekuai IconColor"></span>
撤销审核
</a-button>
</div>
</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-if="column.key === 'action'">
<TableAction :actions="[
@ -251,4 +261,23 @@ async function printFee() {
.topTable {
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>

Loading…
Cancel
Save