feature-JimuReport-1106-yjl
sunzehua 3 weeks ago
parent e9c89e012a
commit bb5f3cd860

@ -3,9 +3,10 @@
<a-modal width="1600px" @cancel="open = false" :visible="open" title="添加发票申请明细" :footer="null">
<div style="padding-bottom:5px ;">
<div>
<BasicTable :rowClassName="rowClassName" class="ds-table" @row-click="handleClick" @register="registerTable">
<BasicTable :rowClassName="rowClassName" class="ds-table" @row-click="handleClick"
@register="registerTable">
<template #right>
<div style="width: 40%;margin-left: 10px;margin-top:10px;">
<div style="width: 40%;margin-left: 10px;">
<div>
<BasicTable class="ds-table" @register="registerTable1">
<template #tableTitle>
@ -74,7 +75,8 @@
<a-modal width="1600px" @cancel="freeFlag = false" :visible="freeFlag" title="添加发票申请明细" :footer="null">
<div style="padding-bottom:5px ;">
<div>
<BasicTable class="ds-table" @row-click="handleClickFree" @register="registerTableFree">
<BasicTable :rowClassName="rowClassName" class="ds-table" @row-click="handleClickFree"
@register="registerTableFree">
<template #right>
<div style="width: 40%;margin-left: 10px;">
<div>
@ -219,10 +221,11 @@ const freeDetailList = ref([]) as any
const [registerTable, { getForm, setSelectedRowKeys, getSelectRows, setProps, getRawDataSource, setLoading }] = useTable({
api: async (p) => {
const res: API.DataResult = await GetApplicationList(p)
res.data.forEach(item => {
res.data.forEach((item, index) => {
item.amountUSDTotal = item.amountUSD
item.amountOtherTotal = item.amountOther
item.amountRMBTotal = item.amountRMB
item.cindex = index
})
return new Promise((resolve) => {
resolve({ data: [...res.data], total: res.count })
@ -240,6 +243,9 @@ const [registerTable, { getForm, setSelectedRowKeys, getSelectRows, setProps, ge
showIndexColumn: false,
maxHeight: '600',
pagination: true,
rowKey: 'cindex',
id: '11',
showTableSetting: true,
rowSelection: {},
striped: true,
bordered: true,
@ -258,6 +264,8 @@ const [registerTable1, { getSelectRows: getSelectRowsFee, setProps: setPropsFee,
dataSource: dataSource.value,
striped: true,
rowKey: 'recordId',
id: '22',
showTableSetting: true,
bordered: true,
indexColumnProps: {
width: 60,
@ -269,6 +277,9 @@ const [registerTableFree, { getForm: getFormFree, setSelectedRowKeys: setSelecte
api: async (p) => {
const res: API.DataResult = await FreeInvoiceGetBizList(p)
return new Promise((resolve) => {
res.data.forEach((item, index) => {
item.cindex = index
})
resolve({ data: [...res.data], total: res.count })
})
},
@ -289,6 +300,9 @@ const [registerTableFree, { getForm: getFormFree, setSelectedRowKeys: setSelecte
useSearchForm: true,
showIndexColumn: false,
maxHeight: '600',
rowKey: 'cindex',
id: '33',
showTableSetting: true,
pagination: true,
striped: true,
bordered: true,
@ -310,10 +324,9 @@ const [registerTableFreeDetail, { getSelectRows: getSelectRowsFeeDetail, setProp
dataSource: freeDetailList.value,
striped: true,
rowKey: 'recordId',
rowSelection: {
// onChange: onSelectAmount
},
bordered: true,
id: '44',
showTableSetting: true,
indexColumnProps: {
width: 60,
},
@ -324,12 +337,10 @@ const rmbTotal = ref(0)
const usdTotal = ref(0)
const otherTotal = ref(0)
function onSelectChange(selectedRowKeys) {
const list = getSelectRowsFree()
console.log(list, selectedRowKeys)
rmbTotal.value = 0
usdTotal.value = 0
otherTotal.value = 0
list.forEach(item => {
selectedRowKeys.forEach(item => {
rmbTotal.value += Number(item.unBilledRMB)
usdTotal.value += Number(item.unBilledUSD)
otherTotal.value += Number(item.unBilledOther)
@ -345,6 +356,7 @@ function handleAddDetial() {
changeApply()
}
function rowClassName(record, index) {
console
if (index == activeRow.value) {
return 'active-row'
}
@ -529,7 +541,7 @@ function handleSureExhange() {
}
const activeRow = ref(null)
function handleClick(record, index) {
setSelectedRowKeys([record.id])
setSelectedRowKeys([index])
activeRow.value = index
const data = {
ids: [record.id],
@ -549,12 +561,13 @@ function handleClick(record, index) {
})
}
function handleClickFree(record, index) {
setSelectedRowKeysFree([record.id])
setSelectedRowKeysFree([index])
const data = {
id: record.id,
businessType: record.businessType,
customerId: record.customerId
}
activeRow.value = index
loading.value = true
FreeInvoiceGetFees([data]).then(res => {
if (res.succeeded) {
@ -575,7 +588,6 @@ function init(data) {
if (route.query.type == 'free') {
freeFlag.value = true
}
console.log(customerIdP.value)
setTimeout(() => {
if (customerIdP.value) {
if (route.query.type == 'free') {
@ -588,6 +600,13 @@ function init(data) {
})
}
}
watch(
() => getSelectRowsFree(),
(data) => {
onSelectChange(data)
},
{ immediate: false, deep: true }
)
}, 200)
}
@ -788,6 +807,7 @@ defineExpose({ init, customerIdP })
/deep/ .ant-checkbox-wrapper-checked .ant-checkbox-disabled+span {
color: #257afa;
}
:deep(.active-row) {
.ant-table-cell {
background: #dfe8f6;

@ -72,12 +72,15 @@
<a-button v-repeat type="link" v-if="route.query.id">
<span class="iconfont icon-ic_search24px"></span>查看发票
</a-button>
<a-button @click="openHand" v-repeat type="link" v-if="route.query.id">
<span class="iconfont icon-ic_search24px"></span>手动登记
</a-button>
</div>
</div>
<div class="content">
<div class="left">
<div class="left-top">
<div class="left-top-item" style="padding-right: 60px">
<div class="left-top-item">
<editCompent :showEdit="false" ref="editCompentRef" label="发票币别:">
<template #text>
<span> {{ form.currency }}</span>
@ -104,7 +107,7 @@
</template>
</editCompent>
</div>
<div class="left-top-item middle" style="padding-left: 9%;">
<div class="left-top-item middle" >
<a-dropdown>
<a style="color: rgba(158, 83, 9, 1);">
{{ getCategory() }}
@ -122,7 +125,7 @@
</template>
</a-dropdown>
</div>
<div class="left-top-item" style="padding-left: 120px">
<div class="left-top-item" >
<editCompent :showEdit="false" ref="editCompentRef" label="发票号:">
<template #text>
<span>{{ form.invoiceNO }}</span>
@ -366,8 +369,18 @@
</template>
</BasicTable>
</a-modal>
<a-modal width="600px" @cancel="handFlag = false" @ok="handFlag = false" :visible="handFlag" title="手工登记">
<a-form :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
<a-form-item label="发票号">
<a-input v-model:value="form.invoiceNO" />
</a-form-item>
<a-form-item label="开票日期">
<a-date-picker size="small" style="width: 100%" valueFormat="YYYY-MM-DD"
v-model:value="form.invoiceDate" />
</a-form-item>
</a-form>
</a-modal>
<invoiceFile ref="invoiceFileRef"></invoiceFile>
</div>
</template>
<script lang="ts" setup>
@ -734,7 +747,6 @@ function handleSave() {
loading.value = false
})
}
}
function getDetail() {
loading.value = true
@ -772,6 +784,10 @@ function getDetail() {
loading.value = false
})
}
const handFlag = ref(false)
function openHand() {
handFlag.value = true
}
const invoiceFileRef = ref('')
function openFile() {
invoiceFileRef.value.init()
@ -1378,7 +1394,7 @@ watchEffect(() => {
margin-right: 5px;
font-weight: 400;
color: rgba(158, 83, 9, 1);
flex-shrink: 1;
flex-shrink: 0;
display: inline-block;
font-size: 12px;
min-width: 27px;

Loading…
Cancel
Save