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

@ -72,12 +72,15 @@
<a-button v-repeat type="link" v-if="route.query.id"> <a-button v-repeat type="link" v-if="route.query.id">
<span class="iconfont icon-ic_search24px"></span>查看发票 <span class="iconfont icon-ic_search24px"></span>查看发票
</a-button> </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> </div>
<div class="content"> <div class="content">
<div class="left"> <div class="left">
<div class="left-top"> <div class="left-top">
<div class="left-top-item" style="padding-right: 60px"> <div class="left-top-item">
<editCompent :showEdit="false" ref="editCompentRef" label="发票币别:"> <editCompent :showEdit="false" ref="editCompentRef" label="发票币别:">
<template #text> <template #text>
<span> {{ form.currency }}</span> <span> {{ form.currency }}</span>
@ -104,7 +107,7 @@
</template> </template>
</editCompent> </editCompent>
</div> </div>
<div class="left-top-item middle" style="padding-left: 9%;"> <div class="left-top-item middle" >
<a-dropdown> <a-dropdown>
<a style="color: rgba(158, 83, 9, 1);"> <a style="color: rgba(158, 83, 9, 1);">
{{ getCategory() }} {{ getCategory() }}
@ -122,7 +125,7 @@
</template> </template>
</a-dropdown> </a-dropdown>
</div> </div>
<div class="left-top-item" style="padding-left: 120px"> <div class="left-top-item" >
<editCompent :showEdit="false" ref="editCompentRef" label="发票号:"> <editCompent :showEdit="false" ref="editCompentRef" label="发票号:">
<template #text> <template #text>
<span>{{ form.invoiceNO }}</span> <span>{{ form.invoiceNO }}</span>
@ -366,8 +369,18 @@
</template> </template>
</BasicTable> </BasicTable>
</a-modal> </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> <invoiceFile ref="invoiceFileRef"></invoiceFile>
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
@ -734,7 +747,6 @@ function handleSave() {
loading.value = false loading.value = false
}) })
} }
} }
function getDetail() { function getDetail() {
loading.value = true loading.value = true
@ -772,6 +784,10 @@ function getDetail() {
loading.value = false loading.value = false
}) })
} }
const handFlag = ref(false)
function openHand() {
handFlag.value = true
}
const invoiceFileRef = ref('') const invoiceFileRef = ref('')
function openFile() { function openFile() {
invoiceFileRef.value.init() invoiceFileRef.value.init()
@ -1378,7 +1394,7 @@ watchEffect(() => {
margin-right: 5px; margin-right: 5px;
font-weight: 400; font-weight: 400;
color: rgba(158, 83, 9, 1); color: rgba(158, 83, 9, 1);
flex-shrink: 1; flex-shrink: 0;
display: inline-block; display: inline-block;
font-size: 12px; font-size: 12px;
min-width: 27px; min-width: 27px;

Loading…
Cancel
Save