diff --git a/src/api/common/index.ts b/src/api/common/index.ts index 79f51566..19af20a0 100644 --- a/src/api/common/index.ts +++ b/src/api/common/index.ts @@ -58,12 +58,41 @@ enum Api { getVouchingClerkList = '/mainApi/ClientCommon/GetVouchingClerkList', getSaleUserList = '/mainApi/ClientCommon/GetSaleUserList', 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({ + url: Api.GetFeeCurrencySelectList, + method: 'get' + }) +} +// 获取币别下拉列表 (Auth) +export function GetClientListByCode(params) { + return request({ + url: Api.GetClientListByCode, + method: 'get', + params + }) +} +// 获取费用名称下拉数据 +export function GetFeeCodeSelectList() { + return request({ + url: Api.GetFeeCodeSelectList, + method: 'get' + }) } export function getCustomerServiceList() { return request({ url: Api.getCustomerServiceList, - method: 'get', + method: 'get' }) } export function getSaleUserList() { diff --git a/src/settings/encryptionSetting.ts b/src/settings/encryptionSetting.ts index 3c973053..96b7ee55 100644 --- a/src/settings/encryptionSetting.ts +++ b/src/settings/encryptionSetting.ts @@ -1,7 +1,12 @@ +/* + * @Description: + * @Author: lijj + * @Date: 2024-04-15 17:08:08 + */ import { isDevMode } from '/@/utils/env' // 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 export const cacheCipher = { diff --git a/src/utils/dictUtil.ts b/src/utils/dictUtil.ts index 324c1f07..1d4a5482 100644 --- a/src/utils/dictUtil.ts +++ b/src/utils/dictUtil.ts @@ -1,3 +1,8 @@ +/* + * @Description: 字典数据存储 + * @Author: lijj + * @Date: 2024-04-15 17:08:08 + */ import { getAuthCache, setAuthCache } from '/@/utils/auth' // import { DB_DICT_DATA_KEY } from '/@/enums/cacheEnum'; import { getDictDropDown, getDictOptions } from '/@/api/common' @@ -42,16 +47,18 @@ export const filterDictTextByCache = (dictCode, key) => { export const getDictOption = (code) => { //1.优先从缓存中读取字典配置 if (getAuthCache(code)) { - // return new Promise((resolve, reject) => { - // resolve(getAuthCache(code)); - // }); - console.log('缓存', getAuthCache(code)) - return getAuthCache(code) + return new Promise((resolve, reject) => { + resolve(getAuthCache(code)) + }) + // return getAuthCache(code) } return getDictDropDown({ code: code }).then((res) => { - console.log('api获取', res.data) - setAuthCache(code, res.data) - return res.data + const { data } = res + data.forEach(item => { + item['label'] = item.name + }) + setAuthCache(code, data) + return data }) } diff --git a/src/views/baseinfo/issuetype/columns.tsx b/src/views/baseinfo/issuetype/columns.tsx index b1e52bd9..167f7aa6 100644 --- a/src/views/baseinfo/issuetype/columns.tsx +++ b/src/views/baseinfo/issuetype/columns.tsx @@ -1,14 +1,7 @@ import { BasicColumn, FormSchema } from '/@/components/Table' import { Tag } from 'ant-design-vue' -import { getDictDropDown } from '/@/api/common' -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 }) - }) -} +import { getDictOption } from '/@/utils/dictUtil' + export const columns: BasicColumn[] = [ { title: '签单方式', @@ -24,29 +17,29 @@ export const columns: BasicColumn[] = [ title: '正本份数', dataIndex: 'noBill', width: 200, - customRender: ({ text }) => { - let RData = text - issueNumList.forEach((e) => { - if (e.value == text) { - RData = e.label - } - }) - return RData - }, + // customRender: ({ text }) => { + // let RData = text + // dictData.forEach((e) => { + // if (e.value == text) { + // RData = e.label + // } + // }) + // return RData + // }, }, { title: '副本份数', dataIndex: 'copyNoBill', width: 200, - customRender: ({ text }) => { - let RData = text - issueNumList.forEach((e) => { - if (e.value == text) { - RData = e.label - } - }) - return RData - }, + // customRender: ({ text }) => { + // let RData = text + // getDictOption('issue_num').forEach((e) => { + // if (e.value == text) { + // RData = e.label + // } + // }) + // return RData + // }, }, { title: '是否启用', @@ -110,7 +103,7 @@ export const formSchema: FormSchema[] = [ colProps: { span: 20 }, componentProps: { // 数据源1:固定数据 - options: issueNumList, + options: await getDictOption('issue_num'), allowClear: true, showSearch: true, filterOption: (input: string, option: any) => { @@ -125,7 +118,7 @@ export const formSchema: FormSchema[] = [ colProps: { span: 20 }, componentProps: { // 数据源1:固定数据 - options: issueNumList, + options: await getDictOption('issue_num'), allowClear: true, showSearch: true, filterOption: (input: string, option: any) => { diff --git a/src/views/fee/currency/index.vue b/src/views/fee/currency/index.vue index 93a77c9a..8ddc999d 100644 --- a/src/views/fee/currency/index.vue +++ b/src/views/fee/currency/index.vue @@ -25,15 +25,13 @@ diff --git a/src/views/fee/template/index.vue b/src/views/fee/template/index.vue new file mode 100644 index 00000000..8ddc999d --- /dev/null +++ b/src/views/fee/template/index.vue @@ -0,0 +1,115 @@ + +