张同海 5 months ago
commit 2e803090b5

@ -16,6 +16,7 @@
<TableSetting <TableSetting
v-if="showTableSetting" v-if="showTableSetting"
:setting="tableSetting" :setting="tableSetting"
:id="id"
@columns-change="handleColumnChange" @columns-change="handleColumnChange"
/> />
</div> </div>
@ -52,6 +53,10 @@
type: [String, Array] as PropType<string | string[]>, type: [String, Array] as PropType<string | string[]>,
default: '', default: '',
}, },
id: {
type: Number,
default: 0
}
}, },
emits: ['columns-change'], emits: ['columns-change'],
setup(_, { emit }) { setup(_, { emit }) {

@ -161,8 +161,14 @@
Icon, Icon,
}, },
emits: ['columns-change'], emits: ['columns-change'],
props: {
id: {
type: Number,
default: 0
}
},
setup(_, { emit, attrs }) { setup(props, { emit, attrs }) {
const { t } = useI18n() const { t } = useI18n()
const table = useTableContext() const table = useTableContext()
@ -505,6 +511,7 @@
}) })
if (!type) { if (!type) {
let Apidata = { let Apidata = {
id: props.id,
permissionId: '', permissionId: '',
content: JSON.stringify({ content: JSON.stringify({
columns: data, columns: data,

@ -5,6 +5,7 @@
<ColumnSetting <ColumnSetting
v-if="getSetting.setting" v-if="getSetting.setting"
:get-popup-container="getTableContainer" :get-popup-container="getTableContainer"
:id="id"
@columns-change="handleColumnChange" @columns-change="handleColumnChange"
/> />
<FullScreenSetting v-if="getSetting.fullScreen" :get-popup-container="getTableContainer" /> <FullScreenSetting v-if="getSetting.fullScreen" :get-popup-container="getTableContainer" />
@ -34,6 +35,10 @@
type: Object as PropType<TableSetting>, type: Object as PropType<TableSetting>,
default: () => ({}), default: () => ({}),
}, },
id: {
type: Number,
default: 0
}
}, },
emits: ['columns-change'], emits: ['columns-change'],
setup(props, { emit }) { setup(props, { emit }) {

@ -11,7 +11,7 @@ export function useTableHeader(
handlers: InnerHandlers, handlers: InnerHandlers,
) { ) {
const getHeaderProps = computed((): Recordable => { const getHeaderProps = computed((): Recordable => {
const { title, showTableSetting, titleHelpMessage, tableSetting } = unref(propsRef) const { title, showTableSetting, titleHelpMessage, tableSetting, id } = unref(propsRef)
const hideTitle = !slots.tableTitle && !title && !slots.toolbar && !showTableSetting const hideTitle = !slots.tableTitle && !title && !slots.toolbar && !showTableSetting
if (hideTitle && !isString(title)) { if (hideTitle && !isString(title)) {
return {} return {}
@ -25,6 +25,7 @@ export function useTableHeader(
TableHeader, TableHeader,
{ {
title, title,
id,
titleHelpMessage, titleHelpMessage,
showTableSetting, showTableSetting,
tableSetting, tableSetting,

@ -151,5 +151,10 @@ export const basicProps = {
showSearchForm: { showSearchForm: {
type: Boolean, type: Boolean,
default: true default: true
},
// 表格的id增加全选使用
id: {
type: Number,
default: 0
} }
} }

@ -214,7 +214,8 @@ export interface BasicTableProps<T = any> {
// 分页配置 // 分页配置
pagination?: PaginationProps | boolean pagination?: PaginationProps | boolean
// loading加载 // loading加载
loading?: boolean loading?: boolean,
id?: Number,
/** /**
* The column contains children to display * The column contains children to display

@ -1,3 +1,5 @@
import { router } from "/@/router"
import { useMultipleTabStore } from '/@/store/modules/multipleTab'
// 格式表格时间 // 格式表格时间
export function formatTableData(v) { export function formatTableData(v) {
if (v) { if (v) {
@ -8,3 +10,27 @@ export function formatTableData(v) {
return '' return ''
} }
} }
/* ()
* topath: path
*/
export function closePage(topath) {
const tabStore = useMultipleTabStore()
// 当前路由
const fullPath = router?.currentRoute?._value?.fullPath
// 有目标路径则跳转
if (topath) {
router.push(topath)
} else {
// 父级路由
const parent = router?.options?.history?.state?.back
console.log(router)
// 如果存在父级路由,直接返回父级
if (parent) {
router.push(parent)
} else {
// 否则返回上一级路由
router.back()
}
}
}

@ -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) {
@ -62,3 +67,43 @@ export function Get(query) {
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,14 +11,24 @@
<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"
> >
<div class="nav"><i class="iconfont icon-fuzhi"></i>撤销提交</div>
</a-popconfirm>
<a-popconfirm <a-popconfirm
title="确定删除当前选中订舱?" title="确定删除当前选中数据"
ok-text="是" ok-text="是"
cancel-text="否" cancel-text="否"
@confirm="removeMoreFun" @confirm="removeMoreFun"
@ -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 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
}
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
}
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
}
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

@ -95,7 +95,8 @@
showIndexColumn: true, showIndexColumn: true,
canResize: false, canResize: false,
rowSelection: { type: 'checkbox' }, rowSelection: { type: 'checkbox' },
immediate: false immediate: false,
id: 1
}) })
// //
const add = () => { const add = () => {

@ -5,6 +5,7 @@
--> -->
<template> <template>
<div class="ds-bus-table"> <div class="ds-bus-table">
<a-spin :spinning="loading">
<BasicTable <BasicTable
:canRowSelect="true" :canRowSelect="true"
:scroll="{ x: '100%', y: 188 }" :scroll="{ x: '100%', y: 188 }"
@ -19,23 +20,30 @@
</BasicTable> </BasicTable>
<div class="info"> <div class="info">
<div> <div>
<a-button @click="save" type="link">加申请费用明细</a-button> <a-button @click="save" type="link">加申请费用明细</a-button>
</div> </div>
<feeTable <feeTable
ref="feeTabel" ref="feeTabel"
></feeTable> ></feeTable>
</div> </div>
</a-spin>
<!-- 汇率换算组件 -->
<ExchangeRate
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) {
//
const postData = {
description: '按业务增加添加费用明细',
application: {
id: 0,
customerId: selectRows[0]?.customerId
},
items: [{
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 = [] let feeList = []
for(var key in allFeeData) { for(var key in allFeeData) {
feeList = [...feeList, ...allFeeData[key]] feeList = [...feeList, ...allFeeData[key]]
} }
console.log(props.formData) //
let currencyList = []
feeList.forEach(item => { //
if (props.formData.currency && props.formData.currency != item.currency) { 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 () => {
//
if (props.formData?.customerId) {
console.log(props.formData.customerId)
await getForm().setFieldsValue({ 'customerId': props.formData.customerId })
// //
reload() 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,9 @@
<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>
<a-button @click="deleteItem" type="link">删除</a-button>
</div> </div>
<!-- 表单区域 --> <!-- 表单区域 -->
<div class="form-area"> <div class="form-area">
@ -32,10 +33,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>
@ -45,6 +48,7 @@
import { onMounted, ref } from 'vue' import { onMounted, ref } from 'vue'
import { BasicTable, useTable } from '/@/components/Table' import { BasicTable, useTable } from '/@/components/Table'
import { useMessage } from '/@/hooks/web/useMessage' import { useMessage } from '/@/hooks/web/useMessage'
import { closePage } from '/@/hooks/web/common'
import { BasicForm, useForm } from '/@/components/Form' import { BasicForm, useForm } from '/@/components/Form'
import ApplyInfo from './components/applyInfo.vue' import ApplyInfo from './components/applyInfo.vue'
// //
@ -129,17 +133,32 @@
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()
}) })
} }
//
const deleteItem = () => {
closePage()
}
// //
const init = () => { const init = () => {
const id = route.query.id const id = route.query.id
@ -147,7 +166,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