diff --git a/src/api/shop/shop.ts b/src/api/shop/shop.ts index 3805665..33548ed 100644 --- a/src/api/shop/shop.ts +++ b/src/api/shop/shop.ts @@ -6,6 +6,10 @@ export interface ShopQuery extends BasePageQuery { corpid?: string; /** 归属类型(0-借还柜 1-固资通) */ belongType?: number; + /** 运行模式(0-支付模式 1-审批模式 2-借还模式 3-会员模式 4-耗材模式) */ + mode?: number; + /** 借呗支付(1-正常使用 0-禁止使用) */ + balanceEnable?: number; } /** 商店DTO */ @@ -13,16 +17,28 @@ export interface ShopDTO { shopId: number; shopName: string; corpid?: string; + /** 封面图URL */ + coverImg?: string; /** 归属类型(0-借还柜 1-固资通) */ belongType?: number; + /** 运行模式(0-支付模式 1-审批模式 2-借还模式 3-会员模式 4-耗材模式) */ + mode?: number; + /** 借呗支付(1-正常使用 0-禁止使用) */ + balanceEnable?: number; } /** 新增商店命令 */ export interface AddShopCommand { shopName: string; corpid: string; + /** 封面图URL */ + coverImg?: string; /** 归属类型(0-借还柜 1-固资通) */ belongType?: number; + /** 运行模式(0-支付模式 1-审批模式 2-借还模式 3-会员模式 4-耗材模式) */ + mode?: number; + /** 借呗支付(1-正常使用 0-禁止使用) */ + balanceEnable?: number; } /** 更新商店命令 */ @@ -30,9 +46,48 @@ export interface UpdateShopCommand { corpid: string; shopId: number; shopName: string; + /** 封面图URL */ + coverImg?: string; /** 归属类型(0-借还柜 1-固资通) */ belongType?: number; -} + /** 运行模式(0-支付模式 1-审批模式 2-借还模式 3-会员模式 4-耗材模式) */ + mode?: number; + /** 借呗支付(1-正常使用 0-禁止使用) */ + balanceEnable?: number; +}; + +// 运行模式文字映射 +const modeTextMap = { + 0: '支付模式', + 1: '审批模式', + 2: '借还模式', + 3: '会员模式', + 4: '耗材模式' +}; + +// 借呗支付状态文字映射 +const balanceEnableTextMap = { + 0: '禁止使用', + 1: '正常使用' +}; + +/** + * 将运行模式数值转换为文字描述 + * @param mode 运行模式数值 + * @returns 对应的文字描述,未知值返回空字符串 + */ +export const getModeText = (mode?: number): string => { + return mode !== undefined ? modeTextMap[mode] || '' : ''; +}; + +/** + * 将借呗支付状态转换为文字描述 + * @param balanceEnable 借呗支付状态数值 + * @returns 对应的文字描述,未知值返回空字符串 + */ +export const getBalanceEnableText = (balanceEnable?: number): string => { + return balanceEnable !== undefined ? balanceEnableTextMap[balanceEnable] || '' : ''; +}; /** 获取商店列表 */ export const getShopList = (params?: ShopQuery) => { diff --git a/src/views/cabinet/shop/card.vue b/src/views/cabinet/shop/card.vue new file mode 100644 index 0000000..458414e --- /dev/null +++ b/src/views/cabinet/shop/card.vue @@ -0,0 +1,263 @@ + + + + + diff --git a/src/views/cabinet/shop/shop-form-modal.vue b/src/views/cabinet/shop/shop-form-modal.vue index b215823..440df77 100644 --- a/src/views/cabinet/shop/shop-form-modal.vue +++ b/src/views/cabinet/shop/shop-form-modal.vue @@ -1,8 +1,10 @@ \ No newline at end of file + + + + \ No newline at end of file diff --git a/src/views/cabinet/smart-cabinet-card/edit-cabinet-drawer.vue b/src/views/cabinet/smart-cabinet-card/edit-cabinet-drawer.vue index d9e3c40..5dfe313 100644 --- a/src/views/cabinet/smart-cabinet-card/edit-cabinet-drawer.vue +++ b/src/views/cabinet/smart-cabinet-card/edit-cabinet-drawer.vue @@ -104,12 +104,12 @@ watch(() => props.cabinetInfo, (newVal) => { - + - + diff --git a/src/views/cabinet/smart-cabinet-card/smart-cabinet-card-form-modal.vue b/src/views/cabinet/smart-cabinet-card/smart-cabinet-card-form-modal.vue index 5d1db79..4fb89bb 100644 --- a/src/views/cabinet/smart-cabinet-card/smart-cabinet-card-form-modal.vue +++ b/src/views/cabinet/smart-cabinet-card/smart-cabinet-card-form-modal.vue @@ -103,12 +103,12 @@ const templateOptions = Object.entries(CabinetImgMap).map(([value, item]) => ({ - + - +