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 e91a4997..b43d47c0 100644 --- a/src/api/system/area/index.ts +++ b/src/api/system/area/index.ts @@ -1,8 +1,8 @@ import request from '@/config/axios' // 获得地区树 -export const getAreaTree = async () => { - return await request.get({ url: '/system/area/tree' }) +export const getAreaTree = async (id: number) => { + return await request.get({ url: '/system/area/tree?id=' + id }) } // 获得 IP 对应的地区名 diff --git a/src/utils/dict.ts b/src/utils/dict.ts index d11debc9..c742274f 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -148,5 +148,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 @@ + + diff --git a/src/views/system/area/index.vue b/src/views/system/area/index.vue index 320c2dda..1e089a19 100644 --- a/src/views/system/area/index.vue +++ b/src/views/system/area/index.vue @@ -57,7 +57,8 @@ const list = ref([]) * 获得数据列表 */ const getList = async () => { - list.value = await AreaApi.getAreaTree() + // id == 1 中国 + list.value = await AreaApi.getAreaTree(1) } /** 添加/修改操作 */