From 323c446ff17e9fdd8a08dbdfd77bf1f15a3f99a4 Mon Sep 17 00:00:00 2001 From: lijingjia Date: Sun, 28 Apr 2024 18:28:56 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=B9=E7=94=A8=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/common/index.ts | 33 ++++- src/settings/encryptionSetting.ts | 7 +- src/utils/dictUtil.ts | 23 ++-- src/views/baseinfo/issuetype/columns.tsx | 51 ++++---- src/views/fee/currency/index.vue | 10 +- src/views/fee/custTemplateDetail/columns.tsx | 121 ++++++++++++++++-- .../custTemplateDetail/components/Modal.vue | 2 +- src/views/fee/custTemplateDetail/index.vue | 4 +- src/views/fee/template/api.ts | 37 ++++++ src/views/fee/template/columns.tsx | 85 ++++++++++++ src/views/fee/template/components/Modal.vue | 110 ++++++++++++++++ src/views/fee/template/index.vue | 115 +++++++++++++++++ 12 files changed, 537 insertions(+), 61 deletions(-) create mode 100644 src/views/fee/template/api.ts create mode 100644 src/views/fee/template/columns.tsx create mode 100644 src/views/fee/template/components/Modal.vue create mode 100644 src/views/fee/template/index.vue 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 @@ + +