费用页面

szh-new
lijingjia 7 months ago
parent f30635dc23
commit 323c446ff1

@ -58,12 +58,41 @@ enum Api {
getVouchingClerkList = '/mainApi/ClientCommon/GetVouchingClerkList', getVouchingClerkList = '/mainApi/ClientCommon/GetVouchingClerkList',
getSaleUserList = '/mainApi/ClientCommon/GetSaleUserList', getSaleUserList = '/mainApi/ClientCommon/GetSaleUserList',
getCustomerServiceList = '/mainApi/ClientCommon/GetCustomerServiceList', getCustomerServiceList = '/mainApi/ClientCommon/GetCustomerServiceList',
GetClientUserPermissionCode = '/mainApi/Common/GetClientUserPermissionCode' GetClientUserPermissionCode = '/mainApi/Common/GetClientUserPermissionCode',
// 币别下拉数据
GetFeeCurrencySelectList = '/mainApi/ClientCommon/GetFeeCurrencySelectList',
// 根据客户类型查询的往来单位
GetClientListByCode = '/mainApi/ClientCommon/GetClientListByCode',
// 费用名称下拉数据
GetFeeCodeSelectList = '/mainApi/ClientCommon/GetFeeCodeSelectList'
}
// 获取币别下拉列表 (Auth)
export function GetFeeCurrencySelectList() {
return request<DataResult>({
url: Api.GetFeeCurrencySelectList,
method: 'get'
})
}
// 获取币别下拉列表 (Auth)
export function GetClientListByCode(params) {
return request<DataResult>({
url: Api.GetClientListByCode,
method: 'get',
params
})
}
// 获取费用名称下拉数据
export function GetFeeCodeSelectList() {
return request<DataResult>({
url: Api.GetFeeCodeSelectList,
method: 'get'
})
} }
export function getCustomerServiceList() { export function getCustomerServiceList() {
return request<DataResult>({ return request<DataResult>({
url: Api.getCustomerServiceList, url: Api.getCustomerServiceList,
method: 'get', method: 'get'
}) })
} }
export function getSaleUserList() { export function getSaleUserList() {

@ -1,7 +1,12 @@
/*
* @Description:
* @Author: lijj
* @Date: 2024-04-15 17:08:08
*/
import { isDevMode } from '/@/utils/env' import { isDevMode } from '/@/utils/env'
// System default cache time, in seconds // System default cache time, in seconds
export const DEFAULT_CACHE_TIME = 60 * 60 * 24 * 7 export const DEFAULT_CACHE_TIME = 60 * 60 * 24 * 7 * 30
// aes encryption key // aes encryption key
export const cacheCipher = { export const cacheCipher = {

@ -1,3 +1,8 @@
/*
* @Description:
* @Author: lijj
* @Date: 2024-04-15 17:08:08
*/
import { getAuthCache, setAuthCache } from '/@/utils/auth' import { getAuthCache, setAuthCache } from '/@/utils/auth'
// import { DB_DICT_DATA_KEY } from '/@/enums/cacheEnum'; // import { DB_DICT_DATA_KEY } from '/@/enums/cacheEnum';
import { getDictDropDown, getDictOptions } from '/@/api/common' import { getDictDropDown, getDictOptions } from '/@/api/common'
@ -42,16 +47,18 @@ export const filterDictTextByCache = (dictCode, key) => {
export const getDictOption = (code) => { export const getDictOption = (code) => {
//1.优先从缓存中读取字典配置 //1.优先从缓存中读取字典配置
if (getAuthCache(code)) { if (getAuthCache(code)) {
// return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// resolve(getAuthCache(code)); resolve(getAuthCache(code))
// }); })
console.log('缓存', getAuthCache(code)) // return getAuthCache(code)
return getAuthCache(code)
} }
return getDictDropDown({ code: code }).then((res) => { return getDictDropDown({ code: code }).then((res) => {
console.log('api获取', res.data) const { data } = res
setAuthCache(code, res.data) data.forEach(item => {
return res.data item['label'] = item.name
})
setAuthCache(code, data)
return data
}) })
} }

@ -1,14 +1,7 @@
import { BasicColumn, FormSchema } from '/@/components/Table' import { BasicColumn, FormSchema } from '/@/components/Table'
import { Tag } from 'ant-design-vue' import { Tag } from 'ant-design-vue'
import { getDictDropDown } from '/@/api/common' import { getDictOption } from '/@/utils/dictUtil'
let issueNumList = []
const res3: API.DataResult = await getDictDropDown({ code: 'issue_num' })
if (res3.succeeded) {
issueNumList = []
res3.data.forEach((e) => {
issueNumList.push({ label: e.name, value: e.value })
})
}
export const columns: BasicColumn[] = [ export const columns: BasicColumn[] = [
{ {
title: '签单方式', title: '签单方式',
@ -24,29 +17,29 @@ export const columns: BasicColumn[] = [
title: '正本份数', title: '正本份数',
dataIndex: 'noBill', dataIndex: 'noBill',
width: 200, width: 200,
customRender: ({ text }) => { // customRender: ({ text }) => {
let RData = text // let RData = text
issueNumList.forEach((e) => { // dictData.forEach((e) => {
if (e.value == text) { // if (e.value == text) {
RData = e.label // RData = e.label
} // }
}) // })
return RData // return RData
}, // },
}, },
{ {
title: '副本份数', title: '副本份数',
dataIndex: 'copyNoBill', dataIndex: 'copyNoBill',
width: 200, width: 200,
customRender: ({ text }) => { // customRender: ({ text }) => {
let RData = text // let RData = text
issueNumList.forEach((e) => { // getDictOption('issue_num').forEach((e) => {
if (e.value == text) { // if (e.value == text) {
RData = e.label // RData = e.label
} // }
}) // })
return RData // return RData
}, // },
}, },
{ {
title: '是否启用', title: '是否启用',
@ -110,7 +103,7 @@ export const formSchema: FormSchema[] = [
colProps: { span: 20 }, colProps: { span: 20 },
componentProps: { componentProps: {
// 数据源1固定数据 // 数据源1固定数据
options: issueNumList, options: await getDictOption('issue_num'),
allowClear: true, allowClear: true,
showSearch: true, showSearch: true,
filterOption: (input: string, option: any) => { filterOption: (input: string, option: any) => {
@ -125,7 +118,7 @@ export const formSchema: FormSchema[] = [
colProps: { span: 20 }, colProps: { span: 20 },
componentProps: { componentProps: {
// 数据源1固定数据 // 数据源1固定数据
options: issueNumList, options: await getDictOption('issue_num'),
allowClear: true, allowClear: true,
showSearch: true, showSearch: true,
filterOption: (input: string, option: any) => { filterOption: (input: string, option: any) => {

@ -25,15 +25,13 @@
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { defineComponent, onMounted, ref } from 'vue' import { onMounted, ref } from 'vue'
import { BasicTable, useTable, TableAction } from '/@/components/Table' import { BasicTable, useTable, TableAction } from '/@/components/Table'
import { getFeeCurrencyList, ApiImport } from './api' import { getFeeCurrencyList } from './api'
import { useModal } from '/@/components/Modal' import { useModal } from '/@/components/Modal'
import Modal from './components/Modal.vue' import Modal from './components/Modal.vue'
import { columns, searchFormSchema } from './columns' import { columns, searchFormSchema } from './columns'
const dictOptions = ref<any[]>([])
const [registerModal, { openModal }] = useModal() const [registerModal, { openModal }] = useModal()
const [registerPermissionModal, { openModal: openPermissionModal }] = useModal()
const [registerTable, { reload, getForm, getPaginationRef }] = useTable({ const [registerTable, { reload, getForm, getPaginationRef }] = useTable({
title: '币别设置', title: '币别设置',
// api: getSysDictTypeList, // api: getSysDictTypeList,
@ -108,10 +106,6 @@
isUpdate: true, isUpdate: true,
}) })
} }
function handleDelete(record: Recordable) {
console.log(record)
}
onMounted(() => { onMounted(() => {
// //
}) })

@ -4,6 +4,11 @@
* @Date: 2024-04-25 15:48:33 * @Date: 2024-04-25 15:48:33
*/ */
import { BasicColumn, FormSchema } from '/@/components/Table' import { BasicColumn, FormSchema } from '/@/components/Table'
// 引入字典数据
import { getDictOption } from '/@/utils/dictUtil'
// 下拉框数据接口
import { GetFeeCurrencySelectList, GetClientListByCode, GetFeeCodeSelectList } from '/@/api/common'
export const columns: BasicColumn[] = [ export const columns: BasicColumn[] = [
{ {
title: '费用名称', title: '费用名称',
@ -90,35 +95,131 @@ export const formSchema: FormSchema[] = [
show: false show: false
}, },
{ {
field: 'codeName', field: 'customerType',
label: '币别代码', label: '客户类别',
component: 'Select',
required: true,
colProps: { span: 12 },
componentProps: async ({ schema, tableAction, formActionType, formModel }) => {
const dictList = await getDictOption('djy_cust_prop')
formActionType.updateSchema({ field: 'customerType', componentProps: { options: dictList } })
return {
options: dictList,
allowClear: true,
showSearch: true,
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
onChange: (v:string) => {
GetClientListByCode({ code: v }).then(res => {
})
}
}
}
},
{
field: 'customerName',
label: '往来单位',
component: 'Select',
required: true,
colProps: { span: 12 },
componentProps: {
options: [],
labelField: 'shortName',
valueField: 'codeName'
}
// dynamicDisabled: ({ values, v }) => {
// console.log(v)
// }
},
{
field: 'feeCode',
label: '费用名称',
component: 'ApiSelect',
required: true,
colProps: { span: 12 },
componentProps: () => {
return {
api: GetFeeCodeSelectList,
labelField: 'name',
valueField: 'codeName',
resultField: 'data'
}
}
},
{
field: 'defaultRate',
label: '标准',
component: 'Input', component: 'Input',
colProps: { span: 12 }
},
{
field: 'currency',
label: '币别',
required: true, required: true,
component: 'ApiSelect',
colProps: { span: 12 },
componentProps: () => {
return {
api: GetFeeCurrencySelectList,
labelField: 'name',
valueField: 'codeName',
resultField: 'data'
}
}
},
{
field: 'financeSoftCode',
label: '单价',
required: true,
component: 'Input',
colProps: { span: 12 } colProps: { span: 12 }
}, },
{ {
field: 'name', field: 'financeSoftCode',
label: '英文名称', label: '汇率',
required: true,
component: 'Input', component: 'Input',
colProps: { span: 12 }
},
{
field: 'financeSoftCode',
label: '税率',
required: true, required: true,
component: 'Input',
colProps: { span: 12 } colProps: { span: 12 }
}, },
{ {
field: 'description', field: 'financeSoftCode',
label: '中文描述名称', label: '发票税率',
required: true,
component: 'Input', component: 'Input',
colProps: { span: 12 }
},
{
field: 'financeSoftCode',
label: 'FRT',
required: true, required: true,
colProps: { span: 12 }, component: 'Input',
colProps: { span: 12 }
}, },
{ {
field: 'defaultRate', field: 'financeSoftCode',
label: '对人民币汇率', label: '是否开发票',
required: true,
component: 'Input',
colProps: { span: 12 }
},
{
field: 'financeSoftCode',
label: '是否垫付',
required: true,
component: 'Input', component: 'Input',
colProps: { span: 12 } colProps: { span: 12 }
}, },
{ {
field: 'financeSoftCode', field: 'financeSoftCode',
label: '财务软件代码', label: '备注',
required: true, required: true,
component: 'Input', component: 'Input',
colProps: { span: 12 } colProps: { span: 12 }

@ -87,7 +87,7 @@
setModalProps({ loading: false }) setModalProps({ loading: false })
}) })
const getTitle = computed(() => (!unref(isUpdate) ? '新增币别' : '编辑币别')) const getTitle = computed(() => (!unref(isUpdate) ? '新增往来单位固定费用' : '编辑往来单位固定费用'))
async function handleSave(exit) { async function handleSave(exit) {
try { try {

@ -2,7 +2,7 @@
<div> <div>
<BasicTable @register="registerTable"> <BasicTable @register="registerTable">
<template #toolbar> <template #toolbar>
<a-button type="primary" @click="handleCreate"> </a-button> <a-button type="primary" @click="handleCreate"> </a-button>
</template> </template>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'userName'"> <template v-if="column.key === 'userName'">
@ -35,7 +35,7 @@
const [registerModal, { openModal }] = useModal() const [registerModal, { openModal }] = useModal()
const [registerPermissionModal, { openModal: openPermissionModal }] = useModal() const [registerPermissionModal, { openModal: openPermissionModal }] = useModal()
const [registerTable, { reload, getForm, getPaginationRef }] = useTable({ const [registerTable, { reload, getForm, getPaginationRef }] = useTable({
title: '币别设置', title: '往来单位固定费用',
// api: getSysDictTypeList, // api: getSysDictTypeList,
api: async (p) => { api: async (p) => {
const res: API.DataResult = await getFeeCustTemplateDetailList(p) const res: API.DataResult = await getFeeCustTemplateDetailList(p)

@ -0,0 +1,37 @@
/*
* @Description: ->
* @Author: lijj
* @Date: 2024-04-25 15:48:33
*/
import { request } from '/@/utils/request'
import { DataResult, PageRequest } from '/@/api/model/baseModel'
enum Api {
list = '/feeApi/FeeCurrency/GetFeeCurrencyList',
edit = '/feeApi/FeeCurrency/EditFeeCurrency',
info = '/feeApi/FeeCurrency/GetFeeCurrencyInfo'
}
// 列表 (Auth)
export function getFeeCurrencyList(data: PageRequest) {
return request<DataResult>({
url: Api.list,
method: 'post',
data
})
}
// 编辑 (Auth)
export function editFeeCurrency(data: PageRequest) {
return request<DataResult>({
url: Api.edit,
method: 'post',
data
})
}
// 详情 (Auth)
export function getFeeCurrencyInfo(query) {
return request<DataResult>({
url: Api.info,
method: 'get',
params: query
})
}

@ -0,0 +1,85 @@
/*
* @Description: tsx
* @Author: lijj
* @Date: 2024-04-25 15:48:33
*/
import { BasicColumn, FormSchema } from '/@/components/Table'
export const columns: BasicColumn[] = [
{
title: '币别代码',
dataIndex: 'codeName',
width: 150
},
{
title: '英文名称',
dataIndex: 'name',
width: 200
},
{
title: '中文描述名称',
dataIndex: 'description',
width: 200
},
{
title: '对人民币汇率',
dataIndex: 'defaultRate',
width: 200
},
{
title: '财务软件代码',
dataIndex: 'financeSoftCode',
width: 200
}
]
export const searchFormSchema: FormSchema[] = [
{
field: 'codeName',
label: '币别代码',
component: 'Input',
colProps: { span: 6 },
},
]
export const formSchema: FormSchema[] = [
{
label: '',
field: 'id',
component: 'Input',
defaultValue: '',
show: false
},
{
field: 'codeName',
label: '币别代码',
component: 'Input',
required: true,
colProps: { span: 12 }
},
{
field: 'name',
label: '英文名称',
component: 'Input',
required: true,
colProps: { span: 12 }
},
{
field: 'description',
label: '中文描述名称',
component: 'Input',
required: true,
colProps: { span: 12 },
},
{
field: 'defaultRate',
label: '对人民币汇率',
component: 'Input',
colProps: { span: 12 }
},
{
field: 'financeSoftCode',
label: '财务软件代码',
required: true,
component: 'Input',
colProps: { span: 12 }
}
]

@ -0,0 +1,110 @@
<template>
<BasicModal
v-bind="$attrs"
:use-wrapper="true"
:title="getTitle"
:form-schema="formSchema"
width="50%"
@register="registerModal"
@ok="handleSave"
>
<!-- 币别表单 -->
<BasicForm @register="registerForm" />
<!--右下角按钮-->
<template #footer>
<a-button
pre-icon="ant-design:close-outlined"
type="warning"
:loading="loading"
ghost
style="margin-right: 0.8rem"
@click="closeModal"
>
取消
</a-button>
<a-button
type="success"
:loading="loading"
pre-icon="ant-design:check-outlined"
style="margin-right: 0.8rem"
@click="handleSave(false)"
>
仅保存
</a-button>
<a-button
pre-icon="ant-design:check-circle-outlined"
type="primary"
:loading="loading"
@click="handleSave(true)"
>
保存并关闭
</a-button>
</template>
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, computed, unref } from 'vue'
//
import { BasicModal, useModalInner } from '/@/components/Modal'
import { BasicForm, useForm } from '/@/components/Form/index'
//
import { formSchema } from '../columns'
//
import { editFeeCurrency, getFeeCurrencyInfo } from '../api'
//
import { useMessage } from '/@/hooks/web/useMessage'
// Emits
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)
// loading
const loading = ref(false)
const rowId = ref('')
const { createMessage } = useMessage()
const [registerForm, { resetFields, setFieldsValue, validate, updateSchema }] =
useForm({
labelWidth: 100,
schemas: formSchema,
showActionButtonGroup: false,
})
const [registerModal, { setModalProps, closeModal, updateFormField }] = useModalInner(async (data) => {
resetFields()
setModalProps({ confirmLoading: false, loading: true })
isUpdate.value = !!data?.isUpdate
if (unref(isUpdate)) {
setModalProps({ confirmLoading: true });
updateFormField(updateSchema)
rowId.value = data.record.id
const res: API.DataResult = await getFeeCurrencyInfo({ id: unref(rowId) })
if (res.succeeded) {
setFieldsValue({
...res.data,
})
}
} else {
setFieldsValue({ permissionIdentity: unref(2) })
}
setModalProps({ loading: false })
})
const getTitle = computed(() => (!unref(isUpdate) ? '新增币别' : '编辑币别'))
async function handleSave(exit) {
try {
const values = await validate()
loading.value = true
setModalProps({ confirmLoading: true, loading: true })
const res: API.DataResult = await editFeeCurrency(values)
loading.value = false
if (res.succeeded) {
createMessage.success(res.message)
emit('success')
} else {
createMessage.error(res.message)
}
exit && closeModal()
} finally {
setModalProps({ confirmLoading: false, loading: false })
}
}
</script>

@ -0,0 +1,115 @@
<template>
<div>
<BasicTable @register="registerTable">
<template #toolbar>
<a-button type="primary" @click="handleCreate"> </a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'userName'">
<span style="color: #0d84ff" @click="handleEdit(record)">{{ record.userName }}</span>
</template>
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{
icon: 'clarity:note-edit-line',
tooltip: '编辑',
onClick: handleEdit.bind(null, record),
},
]"
/>
</template>
</template>
</BasicTable>
<Modal @register="registerModal" @success="handleSuccess" />
</div>
</template>
<script lang="ts" setup>
import { onMounted, ref } from 'vue'
import { BasicTable, useTable, TableAction } from '/@/components/Table'
import { getFeeCurrencyList } from './api'
import { useModal } from '/@/components/Modal'
import Modal from './components/Modal.vue'
import { columns, searchFormSchema } from './columns'
const [registerModal, { openModal }] = useModal()
const [registerTable, { reload, getForm, getPaginationRef }] = useTable({
title: '币别设置',
// api: getSysDictTypeList,
api: async (p) => {
const res: API.DataResult = await getFeeCurrencyList(p)
// console.log(items);
return new Promise((resolve) => {
resolve({ data: [...res.data], total: res.count })
})
},
beforeFetch: () => {
var currentPageInfo: any = getPaginationRef()
var data = getForm().getFieldsValue()
const postParam: API.PageRequest = {
queryCondition: '',
pageCondition: {
pageIndex: currentPageInfo.current,
pageSize: currentPageInfo.pageSize,
sortConditions: [],
},
}
let condition: API.ConditionItem[] = []
if (!!data.UserName) {
condition.push({
FieldName: 'UserName',
FieldValue: data.UserName,
ConditionalType: 1,
})
}
if (!!data.UserCode) {
condition.push({
FieldName: 'UserCode',
FieldValue: data.UserCode,
ConditionalType: 1,
})
}
postParam.queryCondition = JSON.stringify(condition)
// console.log(postParam);
return postParam
},
columns,
formConfig: {
labelWidth: 120,
schemas: searchFormSchema,
},
isTreeTable: false,
pagination: true,
striped: true,
useSearchForm: true,
showTableSetting: true,
bordered: true,
showIndexColumn: true,
canResize: false,
actionColumn: {
width: 80,
title: '操作',
dataIndex: 'action',
fixed: 'right',
},
})
function handleCreate() {
openModal(true, {
isParent: false,
isUpdate: false,
})
}
function handleEdit(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
})
}
onMounted(() => {
//
})
function handleSuccess() {
reload()
}
</script>
Loading…
Cancel
Save