From d69e6540e31248e6fbe75fe3e3f322ef636411d7 Mon Sep 17 00:00:00 2001 From: dzq Date: Tue, 14 Oct 2025 09:32:09 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=99=BA=E8=83=BD=E6=9F=9C):=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E4=BC=81=E4=B8=9A=E5=BE=AE=E4=BF=A1ID=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=B9=B6=E4=BF=AE=E5=A4=8D=E8=B7=AF=E7=94=B1=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在智能柜相关接口和页面中添加corpid字段以支持企业微信集成 修复删除柜体后跳转路径错误的问题 --- src/api/cabinet/smart-cabinet.ts | 8 ++++++++ src/views/cabinet/smart-cabinet-card/detail.vue | 2 +- src/views/cabinet/smart-cabinet-card/index.vue | 6 +++++- .../smart-cabinet-card/smart-cabinet-card-form-modal.vue | 8 +++++++- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/api/cabinet/smart-cabinet.ts b/src/api/cabinet/smart-cabinet.ts index 9c66543..2154542 100644 --- a/src/api/cabinet/smart-cabinet.ts +++ b/src/api/cabinet/smart-cabinet.ts @@ -10,6 +10,8 @@ export interface SmartCabinetQuery extends BasePageQuery { templateNo?: string; /** 归属类型(0-借还柜 1-固资通) */ belongType?: number; + /** 企业微信id */ + corpid?: string; } /** @@ -51,6 +53,8 @@ export interface SmartCabinetDTO { balanceEnable?: number; /** 归还期限(天),0表示不限制 */ returnDeadline?: number; + /** 企业微信id */ + corpid?: string; } /** @@ -79,6 +83,8 @@ export interface AddSmartCabinetCommand { mode?: number; /** 借呗支付(1-正常使用 0-禁止使用) */ balanceEnable?: number; + /** 企业微信id */ + corpid?: string; } /** @@ -109,6 +115,8 @@ export interface UpdateSmartCabinetCommand { mode?: number; /** 借呗支付(1-正常使用 0-禁止使用) */ balanceEnable?: number; + /** 企业微信id */ + corpid?: string; } export interface AllCabinetDataDTO { diff --git a/src/views/cabinet/smart-cabinet-card/detail.vue b/src/views/cabinet/smart-cabinet-card/detail.vue index 5068dbf..b569b67 100644 --- a/src/views/cabinet/smart-cabinet-card/detail.vue +++ b/src/views/cabinet/smart-cabinet-card/detail.vue @@ -289,7 +289,7 @@ async function handleDeleteCabinet() { await deleteSmartCabinet(cabinetId.value.toString()); ElMessage.success('柜体删除成功'); // 返回列表页面 - router.push('/cabinet/smart-cabinet'); + router.push('/cabinet/smart-cabinet-card/index'); } catch (error) { console.error('操作取消或失败', error); } diff --git a/src/views/cabinet/smart-cabinet-card/index.vue b/src/views/cabinet/smart-cabinet-card/index.vue index 1ff7b59..4b9926b 100644 --- a/src/views/cabinet/smart-cabinet-card/index.vue +++ b/src/views/cabinet/smart-cabinet-card/index.vue @@ -16,6 +16,7 @@ import SmartCabinetCardFormModal from "./smart-cabinet-card-form-modal.vue"; import { useMultiTagsStoreHook } from "@/store/modules/multiTags"; import { getModeText } from "@/api/shop/shop"; import { useBtnPermissionStore } from "@/store/modules/btnPermission"; +import { useWxStore } from "@/store/modules/wx"; const { VITE_PUBLIC_IMG_PATH: IMG_PATH } = import.meta.env; defineOptions({ @@ -23,13 +24,15 @@ defineOptions({ }); const router = useRouter(); +const wxStore = useWxStore(); const { hasPermission } = useBtnPermissionStore(); const formRef = ref(); const modalVisible = ref(false); const searchFormParams = ref({ cabinetName: "", cabinetType: null, - shopId: null + shopId: null, + corpid: wxStore.corpid }); const pageLoading = ref(false); @@ -52,6 +55,7 @@ async function getList() { pageLoading.value = true; const { data } = await getSmartCabinetList({ ...searchFormParams.value, + corpid: wxStore.corpid, pageSize: pagination.value.pageSize, pageNum: pagination.value.currentPage }); 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 c4398b6..6558e00 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 @@ -7,6 +7,7 @@ import Confirm from "@iconify-icons/ep/check"; import type { FormRules } from 'element-plus'; import { CabinetImgMap } from "@/utils/cabinetImgMap"; import { cabinetNames } from "@/utils/constant/cabinet"; +import { useWxStore } from "@/store/modules/wx"; export interface FormDTO { cabinetName: string; @@ -17,6 +18,7 @@ export interface FormDTO { belongType: number; mode: number; balanceEnable: number; + corpid: string; } const props = defineProps({ @@ -28,6 +30,8 @@ const props = defineProps({ const emit = defineEmits(["update:modelValue", "refresh"]); +const wxStore = useWxStore(); + const formRef = ref(); const formData = reactive({ cabinetName: "", @@ -37,7 +41,8 @@ const formData = reactive({ location: 0, belongType: 0, mode: 0, - balanceEnable: 1 + balanceEnable: 1, + corpid: wxStore.corpid }); const rules = reactive({ @@ -65,6 +70,7 @@ const rules = reactive({ const handleConfirm = async () => { try { await formRef.value.validate(); + formData.corpid = wxStore.corpid; await addSmartCabinet(formData); ElMessage.success("新增成功"); emit("refresh");