diff --git a/src/api/mall/trade/delivery/expressTemplate/index.ts b/src/api/mall/trade/delivery/expressTemplate/index.ts new file mode 100644 index 00000000..0504dde1 --- /dev/null +++ b/src/api/mall/trade/delivery/expressTemplate/index.ts @@ -0,0 +1,54 @@ +import request from '@/config/axios' + +export interface DeliveryExpressTemplateVO { + id: number + name: string + chargeMode: number + sort: number + templateCharge: ExpressTemplateChargeVO[] + templateFree: ExpressTemplateFreeVO[] +} + +export declare type ExpressTemplateChargeVO = { + areaId: number + startCount: number + startPrice: number + extraCount: number + extraPrice: number +} + +export declare type ExpressTemplateFreeVO = { + areaId: number + freeCount: number + freePrice: number +} + +// 查询快递运费模板列表 +export const getDeliveryExpressTemplatePage = async (params: PageParam) => { + return await request.get({ url: '/trade/delivery/express-template/page', params }) +} + +// 查询快递运费模板详情 +export const getDeliveryExpressTemplate = async (id: number) => { + return await request.get({ url: '/trade/delivery/express-template/get?id=' + id }) +} + +// 新增快递运费模板 +export const createDeliveryExpressTemplate = async (data: DeliveryExpressTemplateVO) => { + return await request.post({ url: '/trade/delivery/express-template/create', data }) +} + +// 修改快递运费模板 +export const updateDeliveryExpressTemplate = async (data: DeliveryExpressTemplateVO) => { + return await request.put({ url: '/trade/delivery/express-template/update', data }) +} + +// 删除快递运费模板 +export const deleteDeliveryExpressTemplate = async (id: number) => { + return await request.delete({ url: '/trade/delivery/express-template/delete?id=' + id }) +} + +// 导出快递运费模板 Excel +export const exportDeliveryExpressTemplateApi = async (params) => { + return await request.download({ url: '/trade/delivery/express-template/export-excel', params }) +} diff --git a/src/api/system/area/index.ts b/src/api/system/area/index.ts index 7d8a9d7c..b43d47c0 100644 --- a/src/api/system/area/index.ts +++ b/src/api/system/area/index.ts @@ -1,15 +1,11 @@ -import request from '@/config/axios/request' +import request from '@/config/axios' // 获得地区树 -export const getAreaTree = async (content?: any) => { - return await request.get({ - url: '/system/area/tree', - params: content - }) +export const getAreaTree = async (id: number) => { + return await request.get({ url: '/system/area/tree?id=' + id }) } + // 获得 IP 对应的地区名 -export const getAreaByIp = async (ip) => { - return await request.get({ - url: '/system/area/get-by-ip?ip=' + ip - }) +export const getAreaByIp = async (ip: string) => { + return await request.get({ url: '/system/area/get-by-ip?ip=' + ip }) } diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 23261790..afb12b46 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -149,5 +149,7 @@ export enum DICT_TYPE { // ========== MALL 模块 ========== PRODUCT_UNIT = 'product_unit', // 商品单位 - PRODUCT_SPU_STATUS = 'product_spu_status' //商品状态 + PRODUCT_SPU_STATUS = 'product_spu_status', //商品状态 + // ========== MALL 交易模块 ========== + EXPRESS_CHARGE_MODE = 'trade_delivery_express_charge_mode' //快递的计费方式 } diff --git a/src/views/mall/trade/delivery/express/index.vue b/src/views/mall/trade/delivery/express/index.vue index ad8c5d41..93ad5325 100644 --- a/src/views/mall/trade/delivery/express/index.vue +++ b/src/views/mall/trade/delivery/express/index.vue @@ -8,10 +8,10 @@ :inline="true" label-width="100px" > - + + + + + + + + + 按件数 + 按重量 + 按体积 + + + + + + + + + + + + + + + + + + + + + + + + + + + + 添加区域 + + + + + + + + + + + + + + + + + + + + + 添加区域 + + + + + + + + + + diff --git a/src/views/mall/trade/delivery/expressTemplate/index.vue b/src/views/mall/trade/delivery/expressTemplate/index.vue new file mode 100644 index 00000000..99f90ada --- /dev/null +++ b/src/views/mall/trade/delivery/expressTemplate/index.vue @@ -0,0 +1,160 @@ + +