feat:财税-报销单相关联调

feature-JimuReport-1106-yjl
yujinlong 3 weeks ago
parent 9d98c36f61
commit f085f8e79d

@ -125,11 +125,12 @@
const getActionOptList = (record): ActionItem[] => { const getActionOptList = (record): ActionItem[] => {
return [ return [
{ {
icon: h('i', { /* icon: h('i', {
class: 'iconfont icon-xiazai', class: 'iconfont icon-xiazai',
style: { color: '#257afa', fontSize: '14px' }, style: { color: '#257afa', fontSize: '14px' },
}), }),
isCustomIcon: true, isCustomIcon: true, */
icon: 'ant-design:cloud-download-outlined',
tooltip: '下载', tooltip: '下载',
onClick: handleDownload.bind(null, record), onClick: handleDownload.bind(null, record),
}, },

@ -55,7 +55,7 @@
</a-modal> </a-modal>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, defineEmits } from 'vue' import { ref, defineEmits, computed, watch } from 'vue'
import { BasicTable, useTable } from '/@/components/Table' import { BasicTable, useTable } from '/@/components/Table'
import { columns, searchFormSchema } from './columns' import { columns, searchFormSchema } from './columns'
import { GetInvoiceList } from '../../api' import { GetInvoiceList } from '../../api'
@ -90,6 +90,7 @@
const closeModal = () => { const closeModal = () => {
modalVisible.value = false modalVisible.value = false
setSelectedRowKeys([])
emits('update:visible', false) emits('update:visible', false)
} }

@ -1,6 +1,6 @@
<template> <template>
<a-spin :spinning="loadingFlag" tip="加载中..."> <a-spin :spinning="loadingFlag" tip="加载中...">
<div class="page-wrapper" :style="{ paddingBottom: pageType == 'AUDIT' ? '80px' : '' }"> <div class="page-wrapper" :style="{ paddingBottom: auditOptVisible ? '80px' : '' }">
<div class="top-opt-wrapper"> <div class="top-opt-wrapper">
<!-- 保存按钮组 --> <!-- 保存按钮组 -->
<ActionBar <ActionBar
@ -83,7 +83,7 @@
</div> </div>
</template> </template>
</BasicTable> </BasicTable>
<div class="audit-opt-wrapper" v-if="pageType == 'AUDIT'"> <div class="audit-opt-wrapper" v-if="auditOptVisible">
<a-button type="danger" @click="toRejectHandle"></a-button> <a-button type="danger" @click="toRejectHandle"></a-button>
<a-button type="primary" @click="auditPassHandle"></a-button> <a-button type="primary" @click="auditPassHandle"></a-button>
</div> </div>
@ -98,6 +98,7 @@
</a-spin> </a-spin>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, computed } from 'vue'
import { Divider } from 'ant-design-vue' import { Divider } from 'ant-design-vue'
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table' import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table'
import SearchTable from './components/SearchTable.vue' import SearchTable from './components/SearchTable.vue'
@ -136,14 +137,15 @@
const userInfo = computed(() => userStore.getUserInfo) const userInfo = computed(() => userStore.getUserInfo)
const formValueBind = ref({})
const canEditable = computed(() => { const canEditable = computed(() => {
return ['ADD', 'EDIT'].includes(pageType.value) return ['ADD', 'EDIT'].includes(pageType.value)
}) })
const needDetail = computed(() => { const needDetail = computed(() => {
return ['VIEW', 'EDIT', 'AUDIT'].includes(pageType.value) return ['VIEW', 'EDIT', 'AUDIT'].includes(pageType.value)
}) })
const auditOptVisible = computed(() => {
return pageType.value == 'AUDIT' && expenseAccountDetail.value?.reimbursementType == 1
})
const expenseAccountDetail = ref<BillDetail | null>(null) const expenseAccountDetail = ref<BillDetail | null>(null)
const billTableData = ref<BillRowMap[]>([]) const billTableData = ref<BillRowMap[]>([])
@ -171,7 +173,7 @@
VIEW: ['print', 'next', 'last'], VIEW: ['print', 'next', 'last'],
AUDIT: ['print'], AUDIT: ['print'],
} }
if (pageType.value === 'VIEW') { if (pageType.value === 'VIEW' && expenseAccountDetail.value?.reimbursementType == 1) {
return ['print', 'withdraw', 'next', 'last'] return ['print', 'withdraw', 'next', 'last']
} }
return displayMap[pageType.value] return displayMap[pageType.value]
@ -231,12 +233,11 @@
const pageInit = async () => { const pageInit = async () => {
try { try {
const userRes = await GetUserInfo({ id: userInfo.value.userId as string }) const userRes = await GetUserInfo({ id: userInfo.value.userId as string })
formValueBind.value = { setFieldsValue({
payeeName: userRes.data.userName, payeeName: userRes.data.userName,
reimburser: userRes.data.userName, reimburser: userRes.data.userName,
department: userRes.data.deptName, department: userRes.data.deptName,
} })
setFieldsValue({ ...formValueBind.value })
} catch (error) {} } catch (error) {}
} }
@ -246,7 +247,7 @@
const res = await ReimbursementGetInfo({ const res = await ReimbursementGetInfo({
id: route.query.id as string, id: route.query.id as string,
}) })
formValueBind.value = { setFieldsValue({
bankName: res.data.bankName, bankName: res.data.bankName,
payeeName: res.data.payeeName, payeeName: res.data.payeeName,
payeeAccountNumber: res.data.payeeAccountNumber, payeeAccountNumber: res.data.payeeAccountNumber,
@ -255,8 +256,7 @@
ledgerAccount: res.data.ledgerAccount, ledgerAccount: res.data.ledgerAccount,
voucherNo: res.data.voucherNo, voucherNo: res.data.voucherNo,
reason: res.data.reason, reason: res.data.reason,
} })
setFieldsValue({ ...formValueBind.value })
expenseAccountDetail.value = res.data expenseAccountDetail.value = res.data
billTableData.value = res.data?.data || [] billTableData.value = res.data?.data || []
setTableData(billTableData.value) setTableData(billTableData.value)
@ -276,11 +276,12 @@
const getActionOptList = (record): ActionItem[] => { const getActionOptList = (record): ActionItem[] => {
return [ return [
{ {
icon: h('i', { /* icon: h('i', {
class: 'iconfont icon-xiazai', class: 'iconfont icon-xiazai',
style: { color: '#257afa', fontSize: '14px' }, style: { color: '#257afa', fontSize: '14px' },
}), }),
isCustomIcon: true, isCustomIcon: true, */
icon: 'ant-design:cloud-download-outlined',
tooltip: '下载', tooltip: '下载',
onClick: handleDownload.bind(null, record), onClick: handleDownload.bind(null, record),
}, },
@ -304,7 +305,6 @@
} }
loadingFlag.value = true loadingFlag.value = true
const saveData = { const saveData = {
...formValueBind.value,
...getFieldsValue(), ...getFieldsValue(),
amount: calcSumAmount.value, amount: calcSumAmount.value,
id: route.query?.id || undefined, id: route.query?.id || undefined,
@ -379,9 +379,9 @@
const auditPassHandle = async () => { const auditPassHandle = async () => {
await validate() await validate()
/* if (!getFieldsValue().ledgerAccount) { /* if (!getFieldsValue().ledgerAccount) {
createMessage.warning('请将会计科目填写完整') createMessage.warning('请将会计科目填写完整')
return return
} */ } */
try { try {
loadingFlag.value = true loadingFlag.value = true
const res = await ReimbursementAudit({ const res = await ReimbursementAudit({

@ -121,13 +121,14 @@
const canEditable = [0, 2, 4].includes(record.reimbursementType) const canEditable = [0, 2, 4].includes(record.reimbursementType)
return [ return [
{ {
icon: canEditable icon: canEditable ? 'clarity:note-edit-line' : 'ant-design:file-text-outlined',
/* icon: canEditable
? 'clarity:note-edit-line' ? 'clarity:note-edit-line'
: h('i', { : h('i', {
class: 'iconfont icon-chakan', class: 'iconfont icon-chakan',
style: { color: '#257afa', fontSize: '16px' }, style: { color: '#257afa', fontSize: '16px' },
}), }), */
isCustomIcon: !canEditable, // isCustomIcon: !canEditable,
tooltip: canEditable ? '编辑' : '查看', tooltip: canEditable ? '编辑' : '查看',
onClick: GoDetailed.bind(null, record), onClick: GoDetailed.bind(null, record),
}, },

@ -62,6 +62,7 @@
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from 'vue'
import { SvgIcon } from '/@/components/Icon' import { SvgIcon } from '/@/components/Icon'
import { BasicTable, useTable } from '/@/components/Table' import { BasicTable, useTable } from '/@/components/Table'
import { GetInfo } from '../api' import { GetInfo } from '../api'

@ -90,20 +90,22 @@
const getActionOptList = (record): ActionItem[] => { const getActionOptList = (record): ActionItem[] => {
return [ return [
{ {
icon: h('i', { icon: 'ant-design:file-text-outlined',
/* icon: h('i', {
class: 'iconfont icon-chakan', class: 'iconfont icon-chakan',
style: { color: '#257afa', fontSize: '16px' }, style: { color: '#257afa', fontSize: '16px' },
}), }),
isCustomIcon: true, isCustomIcon: true, */
tooltip: '明细', tooltip: '明细',
onClick: handleDetails.bind(null, record), onClick: handleDetails.bind(null, record),
}, },
{ {
icon: h('i', { icon: 'ant-design:cloud-download-outlined',
/* icon: h('i', {
class: 'iconfont icon-xiazai', class: 'iconfont icon-xiazai',
style: { color: '#257afa', fontSize: '14px' }, style: { color: '#257afa', fontSize: '14px' },
}), }),
isCustomIcon: true, isCustomIcon: true, */
tooltip: '下载', tooltip: '下载',
onClick: handleDownload.bind(null, record), onClick: handleDownload.bind(null, record),
}, },

Loading…
Cancel
Save