费用申请

szh-new
lijingjia 5 months ago
parent 167defa3ed
commit 29f6965685

@ -13,6 +13,12 @@ import { getDictOption } from '/@/utils/dictUtil'
const customTypeDict = ref([]) const customTypeDict = ref([])
// 账号类型下拉数据 // 账号类型下拉数据
const accountTypeDict = ref([]) const accountTypeDict = ref([])
getDictOption('account_type').then(data => {
accountTypeDict.value = data
})
getDictOption('djy_cust_prop').then(data => {
customTypeDict.value = data
})
// 客户名称下拉框数据 // 客户名称下拉框数据
const companyDict = ref([]) const companyDict = ref([])
export const columns: BasicColumn[] = [ export const columns: BasicColumn[] = [
@ -76,9 +82,6 @@ export const formSchema: FormSchema[] = [
component: 'Select', component: 'Select',
colProps: { span: 12 }, colProps: { span: 12 },
componentProps: () => { componentProps: () => {
getDictOption('account_type').then(data => {
accountTypeDict.value = data
})
return { return {
options: accountTypeDict.value, options: accountTypeDict.value,
allowClear: true, allowClear: true,
@ -100,12 +103,8 @@ export const formSchema: FormSchema[] = [
field: 'customerType', field: 'customerType',
label: '客户类型', label: '客户类型',
component: 'Select', component: 'Select',
required: true,
colProps: { span: 12 }, colProps: { span: 12 },
componentProps: () => { componentProps: () => {
getDictOption('djy_cust_prop').then(data => {
customTypeDict.value = data
})
return { return {
options: customTypeDict.value, options: customTypeDict.value,
allowClear: true, allowClear: true,
@ -129,7 +128,6 @@ export const formSchema: FormSchema[] = [
{ {
field: 'customerName', field: 'customerName',
label: '客户名称', label: '客户名称',
required: true,
component: 'Select', component: 'Select',
colProps: { span: 12 }, colProps: { span: 12 },
componentProps: ({ formModel }) => { componentProps: ({ formModel }) => {

@ -9,6 +9,12 @@ import { BasicColumn, FormSchema } from '/@/components/Table'
import { getDictOption } from '/@/utils/dictUtil' import { getDictOption } from '/@/utils/dictUtil'
// 业务种类字典 // 业务种类字典
const opTypeDict = ref([]) const opTypeDict = ref([])
getDictOption('business_type').then(data => {
data.forEach(res => {
res.value = String(res.value)
})
opTypeDict.value = data
})
export const columns: BasicColumn[] = [ export const columns: BasicColumn[] = [
{ {
title: '模版名称', title: '模版名称',
@ -100,12 +106,6 @@ export const formSchema: FormSchema[] = [
required: true, required: true,
colProps: { span: 8 }, colProps: { span: 8 },
componentProps: ({ formActionType }) => { componentProps: ({ formActionType }) => {
getDictOption('business_type').then(data => {
data.forEach(res => {
res.value = String(res.value)
})
opTypeDict.value = data
})
return { return {
options: opTypeDict.value, options: opTypeDict.value,
allowClear: true, allowClear: true,

@ -12,7 +12,12 @@ enum Api {
info = '/feeApi/FeeCurrency/GetFeeCurrencyInfo', info = '/feeApi/FeeCurrency/GetFeeCurrencyInfo',
GetBizList = '/feeApi/PaymentApplication/GetBizList', GetBizList = '/feeApi/PaymentApplication/GetBizList',
Save = '/feeApi/PaymentApplication/Save', Save = '/feeApi/PaymentApplication/Save',
Get = '/feeApi/PaymentApplication//Get' Get = '/feeApi/PaymentApplication/Get',
GetExchangeRate = '/feeApi/FeeCurrencyExchange/GetExchangeRate',
BizSave = '/feeApi/PaymentApplication/BizSave',
Delete = '/feeApi/PaymentApplication/Delete',
ApplyAudit = '/feeApi/PaymentApplication/ApplyAudit',
Withdraw = '/feeApi/PaymentApplication/Withdraw'
} }
// 列表 (Auth) // 列表 (Auth)
export function GetList(data: PageRequest) { export function GetList(data: PageRequest) {
@ -61,4 +66,44 @@ export function Get(query) {
method: 'get', method: 'get',
params: query params: query
}) })
}
// 根据两种币别计算汇率接口
export function GetExchangeRate(query) {
return request<DataResult>({
url: Api.GetExchangeRate,
method: 'get',
params: query
})
}
// 按业务申请
export function BizSave(data: PageRequest) {
return request<DataResult>({
url: Api.BizSave,
method: 'post',
data
})
}
// 删除申请单
export function Delete(data: PageRequest) {
return request<DataResult>({
url: Api.Delete,
method: 'post',
data
})
}
// 申请单提交审核
export function ApplyAudit(data: PageRequest) {
return request<DataResult>({
url: Api.ApplyAudit,
method: 'post',
data
})
}
// 撤销审批
export function Withdraw(data: PageRequest) {
return request<DataResult>({
url: Api.Withdraw,
method: 'post',
data
})
} }

@ -29,7 +29,7 @@ export const columns: BasicColumn[] = [
}, },
{ {
title: '状态', title: '状态',
dataIndex: 'status', dataIndex: 'statusText',
width: 100, width: 100,
align: 'left' align: 'left'
}, },

@ -11,25 +11,35 @@
<div class="nav"> <div class="nav">
<i class="iconfont icon-jiahao2fill"></i>入账申请加入 <i class="iconfont icon-jiahao2fill"></i>入账申请加入
</div> </div>
<div class="nav" <a-popconfirm
><i class="iconfont icon-fuzhi"></i>提交审核</div title="确定提交选中数据?"
ok-text="是"
cancel-text="否"
@confirm="submit"
> >
<div class="nav" <div class="nav"><i class="iconfont icon-fuzhi"></i>提交审核</div>
><i class="iconfont icon-fuzhi1"></i>撤销提交</div </a-popconfirm>
<a-popconfirm
title="确定撤销提交?"
ok-text="是"
cancel-text="否"
@confirm="cancel"
> >
<a-popconfirm <div class="nav"><i class="iconfont icon-fuzhi"></i>撤销提交</div>
title="确定删除当前选中订舱?" </a-popconfirm>
ok-text="是" <a-popconfirm
cancel-text="否" title="确定删除当前选中数据?"
@confirm="removeMoreFun" ok-text="是"
> cancel-text="否"
<div class="nav"><i class="iconfont icon-shanchu2"></i>删除</div> @confirm="removeMoreFun"
</a-popconfirm> >
<div class="nav"><i class="iconfont icon-xiaopiaodayin"></i>打印</div> <div class="nav"><i class="iconfont icon-shanchu2"></i>删除</div>
</a-popconfirm>
<div class="nav"> <div class="nav"><i class="iconfont icon-xiaopiaodayin"></i>打印</div>
<i class="iconfont icon-shishijifei"></i>导出Excel
</div> <div class="nav">
<i class="iconfont icon-shishijifei"></i>导出Excel
</div>
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
@ -38,6 +48,7 @@
import { useMessage } from '/@/hooks/web/useMessage' import { useMessage } from '/@/hooks/web/useMessage'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { useModal } from '/@/components/Modal' import { useModal } from '/@/components/Modal'
import { Delete, ApplyAudit, Withdraw } from '../api'
const router = useRouter() const router = useRouter()
const { createMessage } = useMessage() const { createMessage } = useMessage()
const go = useGo() const go = useGo()
@ -73,12 +84,77 @@
function removeMoreFun() { function removeMoreFun() {
const select = props.selectRow() const select = props.selectRow()
if (select.length === 0) { if (select.length === 0) {
createMessage.warning('请选择操作订单!') createMessage.warning('请选择操作数据!')
return false
}
for(let i = 0; i < select.length; i++) {
if (select[i].status !== 0) {
return createMessage.warning('仅允许删除未提交状态的数据!')
}
}
const ids = select.map((item) => {
return item.id
})
const postData = {
ids
}
Delete(postData).then(res => {
if (res.succeeded) {
createMessage.success('删除成功!')
props.reload()
}
})
}
//
const submit = () => {
const select = props.selectRow()
if (select.length === 0) {
createMessage.warning('请选择操作数据!')
return false return false
} }
const removeArr = select.map((item) => { for(let i = 0; i < select.length; i++) {
if (select[i].status !== 0) {
return createMessage.warning('仅允许未提交状态的数据进行提交审核!')
}
}
const ids = select.map((item) => {
return item.id return item.id
}) })
const postData = {
ids
}
ApplyAudit(postData).then(res => {
if (res.succeeded) {
createMessage.success('提交成功!')
props.reload()
}
console.log(res)
})
}
//
const cancel = () => {
const select = props.selectRow()
if (select.length === 0) {
createMessage.warning('请选择操作数据!')
return false
}
for(let i = 0; i < select.length; i++) {
if (select[i].status !== 1) {
return createMessage.warning('仅允许撤销状态为提交审核的数据!')
}
}
const ids = select.map((item) => {
return item.id
})
const postData = {
ids
}
Withdraw(postData).then(res => {
if (res.succeeded) {
createMessage.success('撤销成功!')
props.reload()
}
})
} }
</script> </script>

@ -7,8 +7,11 @@ import { ref, h, ComponentOptions, resolveComponent } from 'vue'
import { BasicColumn, FormSchema } from '/@/components/Table' import { BasicColumn, FormSchema } from '/@/components/Table'
import { useOptionsStore } from '/@/store/modules/options' import { useOptionsStore } from '/@/store/modules/options'
const optionsStore = useOptionsStore() const optionsStore = useOptionsStore()
import { useRoute } from 'vue-router'
const route = useRoute()
// 引入字典数据 // 引入字典数据
import { getDictOption } from '/@/utils/dictUtil' import { getDictOption } from '/@/utils/dictUtil'
import { placeholderSign } from 'element-plus/es/components/table-v2/src/private'
// 业务表格列 // 业务表格列
export const businessColumns: BasicColumn[] = [ export const businessColumns: BasicColumn[] = [
@ -189,6 +192,12 @@ export const businessColumns: BasicColumn[] = [
] ]
export const formSchema: FormSchema[] = [ export const formSchema: FormSchema[] = [
{
field: 'id',
label: '申请编号',
component: 'Input',
show: false
},
{ {
field: 'applicationNO', field: 'applicationNO',
label: '申请编号', label: '申请编号',
@ -226,7 +235,6 @@ export const formSchema: FormSchema[] = [
labelField: 'shortName', labelField: 'shortName',
valueField: 'id', valueField: 'id',
resultField: 'data', resultField: 'data',
immediate: false,
filterOption: (input: string, option: any) => { filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
} }
@ -266,7 +274,13 @@ export const formSchema: FormSchema[] = [
label: '申请日期', label: '申请日期',
component: 'DatePicker', component: 'DatePicker',
dynamicDisabled: false, dynamicDisabled: false,
colProps: { span: 3 } colProps: { span: 3 },
componentProps: {
showTime: true,
allowClear: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss'
},
}, },
{ {
field: 'currency', field: 'currency',
@ -274,12 +288,14 @@ export const formSchema: FormSchema[] = [
component: 'ApiSelect', component: 'ApiSelect',
required: false, required: false,
dynamicDisabled: false, dynamicDisabled: false,
defaultValue: null,
colProps: { span: 3 }, colProps: { span: 3 },
componentProps: () => { componentProps: () => {
return { return {
option: optionsStore.getOptionsByCode('GetFeeCurrencySelectList'), option: optionsStore.getOptionsByCode('GetFeeCurrencySelectList'),
labelField: 'name', labelField: 'name',
valueField: 'codeName', valueField: 'codeName',
placeholder: '原币申请',
resultField: 'data', resultField: 'data',
immediate: false, immediate: false,
filterOption: (input: string, option: any) => { filterOption: (input: string, option: any) => {
@ -355,7 +371,13 @@ export const formSchema: FormSchema[] = [
label: '申请支付日期', label: '申请支付日期',
component: 'DatePicker', component: 'DatePicker',
dynamicDisabled: false, dynamicDisabled: false,
colProps: { span: 3 } colProps: { span: 3 },
componentProps: {
showTime: true,
allowClear: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss'
},
}, },
// { // {
// field: 'createBy', // field: 'createBy',
@ -374,7 +396,7 @@ export const formSchema: FormSchema[] = [
] ]
export const searchFormSchema: FormSchema[] = [ export const searchFormSchema: FormSchema[] = [
{ {
label: '结算单位', label: '结算对象',
field: 'customerId', field: 'customerId',
component: 'ApiSelect', component: 'ApiSelect',
dynamicDisabled: false, dynamicDisabled: false,
@ -382,9 +404,8 @@ export const searchFormSchema: FormSchema[] = [
componentProps: () => { componentProps: () => {
return { return {
option: optionsStore.getOptionsByCode('GetClientListByCode'), option: optionsStore.getOptionsByCode('GetClientListByCode'),
immediate: false,
labelField: 'shortName', labelField: 'shortName',
valueField: 'codeName', valueField: 'id',
resultField: 'data', resultField: 'data',
filterOption: (input: string, option: any) => { filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0

@ -5,37 +5,45 @@
--> -->
<template> <template>
<div class="ds-bus-table"> <div class="ds-bus-table">
<BasicTable <a-spin :spinning="loading">
:canRowSelect="true" <BasicTable
:scroll="{ x: '100%', y: 188 }" :canRowSelect="true"
:row-selection="{ selectedRowKeys: state.historyRowKeys, onChange: historyChange }" :scroll="{ x: '100%', y: 188 }"
rowKey="id" :row-selection="{ selectedRowKeys: state.historyRowKeys, onChange: historyChange }"
@register="registerTable" rowKey="id"
@row-click="onRowClick" @register="registerTable"
> @row-click="onRowClick"
<template #toolbar> >
<a-button type="link" @click="addInfos"></a-button> <template #toolbar>
</template> <a-button type="link" @click="addInfos"></a-button>
</BasicTable> </template>
<div class="info"> </BasicTable>
<div> <div class="info">
<a-button @click="save" type="link">添加申请费用明细</a-button> <div>
<a-button @click="save" type="link">增加申请费用明细</a-button>
</div>
<feeTable
ref="feeTabel"
></feeTable>
</div> </div>
<feeTable </a-spin>
ref="feeTabel" <!-- 汇率换算组件 -->
></feeTable> <ExchangeRate
</div> ref="exchangeRate"
@submit="saveExchangeRate"
></ExchangeRate>
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted, ref, reactive, watch, defineExpose, defineProps, defineEmits } from 'vue' import { onMounted, ref, reactive, watch, defineExpose, defineProps, defineEmits, h } from 'vue'
import { BasicTable, useTable } from '/@/components/Table' import { BasicTable, useTable } from '/@/components/Table'
import { GetBizList } from '../../api' import { GetBizList, BizSave } from '../../api'
import { businessColumns, searchFormSchema } from '../columns' import { businessColumns, searchFormSchema } from '../columns'
import feeTable from '/@/components/CostEntry/components/feeTable.vue' import feeTable from '/@/components/CostEntry/components/feeTable.vue'
import ExchangeRate from './exchangeRate.vue'
// //
import { useMessage } from '/@/hooks/web/useMessage' import { useMessage } from '/@/hooks/web/useMessage'
const emit = defineEmits(['save']) const emit = defineEmits(['save', 'refresh'])
const { createMessage } = useMessage() const { createMessage } = useMessage()
const props = defineProps({ const props = defineProps({
// //
@ -47,7 +55,8 @@
type: Function type: Function
} }
}) })
const [registerTable, { reload, getForm, getPaginationRef, getSelectRows, setSelectedRows }] = useTable({ const loading = ref(false)
const [registerTable, { reload, getForm, getPaginationRef, getSelectRows, setSelectedRows, getDataSource }] = useTable({
api: async (p) => { api: async (p) => {
const res = await GetBizList(p) const res = await GetBizList(p)
if (res?.data?.length) state.historyRowKeys = [res.data[0].id] if (res?.data?.length) state.historyRowKeys = [res.data[0].id]
@ -59,6 +68,7 @@
beforeFetch: () => { beforeFetch: () => {
var currentPageInfo: any = getPaginationRef() var currentPageInfo: any = getPaginationRef()
var data = getForm().getFieldsValue() var data = getForm().getFieldsValue()
console.log(data)
const postParam = { const postParam = {
queryCondition: '', queryCondition: '',
pageCondition: { pageCondition: {
@ -68,10 +78,10 @@
}, },
} }
let condition: API.ConditionItem[] = [] let condition: API.ConditionItem[] = []
if (!!data.customerNo) { if (!!data.customerId) {
condition.push({ condition.push({
FieldName: 'customerNo', FieldName: 'customerId',
FieldValue: data.customerNo, FieldValue: data.customerId,
ConditionalType: 1 ConditionalType: 1
}) })
} }
@ -134,6 +144,17 @@
const allFeeData = {} const allFeeData = {}
const feeTabel = ref(null) const feeTabel = ref(null)
const historyChange = async (v) => { const historyChange = async (v) => {
if (v.length > 1) {
const a = getDataSource().filter(item => {
return item.id == v[0]
})[0]
const b = getDataSource().filter(item => {
return item.id == v[v.length - 1]
})[0]
if (a.customerId != b.customerId) {
return createMessage.warning('请选择结算对象一致的数据!')
}
}
state.historyRowKeys = v state.historyRowKeys = v
} }
// //
@ -144,16 +165,75 @@
const feeData = () => { const feeData = () => {
return feeTabel.value.selectfeeData return feeTabel.value.selectfeeData
} }
//
const feeTableData = ref([])
//
const exchangeRate = ref(null)
// //
const save = () => { const save = () => {
const data = feeTabel.value.selectfeeData //
emit('save', data) feeTableData.value = feeTabel.value.selectfeeData
if (feeTableData.value.length == 0) {
return createMessage.warning('请选择要申请的费用明细!')
}
//
const customer = props.formData?.customerId
console.log(customer)
let cflag = true
//
const currency = props.formData?.currency
//
const mData = getSelectRows()
mData.forEach(item => {
if (item.customerId == customer) {
cflag = false
}
})
if (customer && cflag) {
//
return createMessage.warning('结算对象与付费申请客户不一致,不能添加此费用明细!')
}
if (currency) {
//
let currencyList = []
//
feeTableData.value.forEach((item, index) => {
if (item.currency != currency) {
currencyList.push({
currency: item.currency,
feeType: item.feeType,
//
value: null,
//
value1: null
})
}
})
currencyList = Array.from(new Set(currencyList.map(item => item.currency))).map(currency => {
return currencyList.find(item => item.currency === currency)
})
console.log(currencyList)
//
exchangeRate.value.init(currency, currencyList)
} else {
//
emit('save', feeTableData.value)
}
}
//
const saveExchangeRate = (list) => {
feeTableData.value.forEach(row => {
list.forEach(item => {
if (row.currency == item.currency) {
row.exchangeRate = item.value
}
})
})
emit('save', feeTableData.value)
} }
//
const addInfos = () => { const addInfos = () => {
const selectRows = getSelectRows() const selectRows = getSelectRows()
console.log(selectRows)
// console.log(props.formData.currency)
return
if (props.formData.customerId) { if (props.formData.customerId) {
let flag = false let flag = false
selectRows.forEach(item => { selectRows.forEach(item => {
@ -164,25 +244,61 @@
if (!flag) { if (!flag) {
return createMessage.warning('没有选择要添加的业务!') return createMessage.warning('没有选择要添加的业务!')
} }
selectRows
} else { } else {
if (state.historyRowKeys.length == 0 ) { if (state.historyRowKeys.length == 0 ) {
return createMessage.warning('没有选择要添加的业务!') return createMessage.warning('没有选择要添加的业务!')
} }
} }
console.log(allFeeData) if (!props.formData.currency) {
// //
let feeList = [] const postData = {
for(var key in allFeeData) { description: '按业务增加添加费用明细',
feeList = [...feeList, ...allFeeData[key]] application: {
} id: 0,
console.log(props.formData) customerId: selectRows[0]?.customerId
},
feeList.forEach(item => { items: [{
if (props.formData.currency && props.formData.currency != item.currency) { id: selectRows[0]?.id,
businessType: selectRows[0]?.businessType
}]
} }
}) loading.value = true
BizSave(postData).then(res => {
loading.value = false
if (res.succeeded) {
createMessage.success('增加成功!')
emit('refresh')
}
})
} else {
//
//
let feeList = []
for(var key in allFeeData) {
feeList = [...feeList, ...allFeeData[key]]
}
//
let currencyList = []
//
feeList.forEach((item, index) => {
if (item.currency != props.formData.currency) {
currencyList.push({
currency: item.currency,
feeType: item.feeType,
//
value: null,
//
value1: null
})
}
})
currencyList = Array.from(new Set(currencyList.map(item => item.currency))).map(currency => {
return currencyList.find(item => item.currency === currency)
})
//
feeTableData.value = feeList
exchangeRate.value.init(props.formData.currency, currencyList)
}
} }
watch( watch(
() => state.historyRowKeys, (v, old) => { () => state.historyRowKeys, (v, old) => {
@ -218,9 +334,17 @@
} }
}) })
onMounted(() => { onMounted(async () => {
// //
reload() if (props.formData?.customerId) {
console.log(props.formData.customerId)
await getForm().setFieldsValue({ 'customerId': props.formData.customerId })
//
reload()
} else {
//
reload()
}
}) })
defineExpose({ defineExpose({
feeData feeData

@ -0,0 +1,89 @@
<!--
* @Description: 操作管理 -> 付费申请 -> 汇率换算组件
* @Author: lijj
* @Date: 2024-06-20 11:54:04
-->
<template>
<div>
<a-modal class="ds-exchange-rate" v-model:visible="visible" title="币别汇率折算" cancelText="关闭" @ok="handleOk">
<div v-for="(item, index) in c2" :key="'cur' + index">
<p class="flex">
<span class="unit">1{{ c1 }} =</span>
<a-input-number
v-model:value="item.value"
:min="0.000001"
:max="99999999"
:step="0.000001"
string-mode
:precision="6"
@change="calc1($event, item)"
/>
{{ item.currency }}
</p>
<p class="flex">
<span class="unit">1{{ item.currency }} =</span>
<a-input-number
v-model:value="item.value1"
:min="0.000001"
:max="99999999"
:step="0.000001"
:precision="6"
string-mode
@change="calc2($event, item)"
/>
{{ c1 }}
</p>
</div>
</a-modal>
</div>
</template>
<script lang="ts" setup>
import { onMounted, ref, defineEmits, defineProps, watch, defineExpose } from 'vue'
import { GetExchangeRate } from '../../api'
const emit = defineEmits(['submit'])
const visible = ref(false)
const value = ref(0)
const value1 = ref(0)
const handleOk = () => {
visible.value = false
emit('submit', c2.value)
}
//
const c1 = ref()
//
const c2 = ref([])
const init = (currency, list) => {
visible.value = true
c1.value = currency
c2.value = list
c2.value.forEach(item => {
GetExchangeRate({ currencyFrom: currency, currencyTo: item.currency, feeType: item.feeType }).then(res => {
item.value = res.data.rate
item.value1 = res.data.reverseRate
})
})
}
const calc1 = (e, item) => {
item.value1 = (1 / e).toFixed(6)
}
const calc2 = (e, item) => {
item.value = (1 / e).toFixed(6)
}
defineExpose({
init
})
</script>
<style lang="less">
.ds-exchange-rate {
.unit {
display: inline-block;
width: 66px;
}
.ant-input-number {
position: relative;
top: -4px;
margin-right: 5px;
}
}
</style>

@ -6,8 +6,8 @@
<template> <template>
<div class="ds-pay-apply-detail ds-detail-box"> <div class="ds-pay-apply-detail ds-detail-box">
<a-spin :spinning="dloading"> <a-spin :spinning="dloading">
<div> <div class="ds-card">
<a-button @click="save"></a-button> <a-button @click="save" type="link">保存</a-button>
</div> </div>
<!-- 表单区域 --> <!-- 表单区域 -->
<div class="form-area"> <div class="form-area">
@ -32,10 +32,12 @@
<a-spin :spinning="loading"> <a-spin :spinning="loading">
<!-- 业务表格 --> <!-- 业务表格 -->
<BusinessTable <BusinessTable
v-if="visible"
ref="busTable" ref="busTable"
:formData="getFieldsValue()" :formData="getFieldsValue()"
:setFieldsValue="setFieldsValue" :setFieldsValue="setFieldsValue"
@save="save" @save="save"
@refresh="refresh"
></BusinessTable> ></BusinessTable>
</a-spin> </a-spin>
</a-modal> </a-modal>
@ -129,15 +131,26 @@
visible.value = true visible.value = true
} }
const applyInfo = ref(null) const applyInfo = ref(null)
//
const refresh = () => {
visible.value = false
init()
}
// //
const save = async (feeInfo) => { const save = async (feeInfo) => {
const postData = await validate() const postData = await validate()
postData['details'] = feeInfo if (feeInfo.length) {
postData['details'] = [...feeData.value, ...feeInfo]
} else {
postData['details'] = feeData.value
}
loading.value = true loading.value = true
Save(postData).then(res => { Save(postData).then(res => {
console.log(res) console.log(res)
loading.value = false loading.value = false
visible.value = false
applyInfo.value.reload() applyInfo.value.reload()
init()
}) })
} }
// //
@ -147,7 +160,10 @@
dloading.value = true dloading.value = true
Get({ id }).then(res => { Get({ id }).then(res => {
dloading.value = false dloading.value = false
setFieldsValue(res.data) console.log(res.data)
setFieldsValue({
...res.data
})
feeData.value = res.data.details feeData.value = res.data.details
}) })
} }

@ -87,7 +87,6 @@
bordered: true, bordered: true,
showIndexColumn: true, showIndexColumn: true,
canResize: false, canResize: false,
rowSelection: { type: 'checkbox' },
immediate: false immediate: false
}) })
const copyNo = (e, v) => { const copyNo = (e, v) => {

Loading…
Cancel
Save