diff --git a/src/api/system/area/index.ts b/src/api/system/area/index.ts index b43d47c0..69dd519b 100644 --- a/src/api/system/area/index.ts +++ b/src/api/system/area/index.ts @@ -1,8 +1,16 @@ import request from '@/config/axios' // 获得地区树 -export const getAreaTree = async (id: number) => { - return await request.get({ url: '/system/area/tree?id=' + id }) +export const getAreaTree = async () => { + return await request.get({ url: '/system/area/tree' }) +} + +export const getChildrenArea = async (id: number) => { + return await request.get({ url: '/system/area/getChildrenArea?id=' + id }) +} + +export const getAreaListByIds = async (data) => { + return await request.post({ url: '/system/area/list', data }) } // 获得 IP 对应的地区名 diff --git a/src/utils/index.ts b/src/utils/index.ts index 134bdf40..cf8ba38e 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -194,3 +194,17 @@ export const convertToInteger = (num: number | string | undefined): number => { // TODO 分转元后还有小数则四舍五入 return Math.round(parsedNumber * 100) } + +/** + * 元转分 + */ +export const yuanToFen = (amount: string | number): number => { + return Math.round(Number(amount) * 100) +} + +/** + * 分转元 + */ +export const fenToYuan = (amount: string | number): number => { + return Number((Number(amount) / 100).toFixed(2)) +} diff --git a/src/utils/tree.ts b/src/utils/tree.ts index 20f97a38..91d53f8c 100644 --- a/src/utils/tree.ts +++ b/src/utils/tree.ts @@ -11,7 +11,8 @@ const DEFAULT_CONFIG: TreeHelperConfig = { export const defaultProps = { children: 'children', label: 'name', - value: 'id' + value: 'id', + isLeaf: 'leaf' } const getConfig = (config: Partial) => Object.assign({}, DEFAULT_CONFIG, config) diff --git a/src/views/mall/trade/delivery/expressTemplate/DeliveryExpressTemplateForm.vue b/src/views/mall/trade/delivery/expressTemplate/DeliveryExpressTemplateForm.vue index e3e175ed..024b8a88 100644 --- a/src/views/mall/trade/delivery/expressTemplate/DeliveryExpressTemplateForm.vue +++ b/src/views/mall/trade/delivery/expressTemplate/DeliveryExpressTemplateForm.vue @@ -21,16 +21,18 @@ @@ -39,7 +41,6 @@ -