feat(智能柜): 添加企业微信ID支持并修复路由跳转
在智能柜相关接口和页面中添加corpid字段以支持企业微信集成 修复删除柜体后跳转路径错误的问题
This commit is contained in:
parent
d89a2a25e2
commit
d69e6540e3
|
|
@ -10,6 +10,8 @@ export interface SmartCabinetQuery extends BasePageQuery {
|
||||||
templateNo?: string;
|
templateNo?: string;
|
||||||
/** 归属类型(0-借还柜 1-固资通) */
|
/** 归属类型(0-借还柜 1-固资通) */
|
||||||
belongType?: number;
|
belongType?: number;
|
||||||
|
/** 企业微信id */
|
||||||
|
corpid?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -51,6 +53,8 @@ export interface SmartCabinetDTO {
|
||||||
balanceEnable?: number;
|
balanceEnable?: number;
|
||||||
/** 归还期限(天),0表示不限制 */
|
/** 归还期限(天),0表示不限制 */
|
||||||
returnDeadline?: number;
|
returnDeadline?: number;
|
||||||
|
/** 企业微信id */
|
||||||
|
corpid?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -79,6 +83,8 @@ export interface AddSmartCabinetCommand {
|
||||||
mode?: number;
|
mode?: number;
|
||||||
/** 借呗支付(1-正常使用 0-禁止使用) */
|
/** 借呗支付(1-正常使用 0-禁止使用) */
|
||||||
balanceEnable?: number;
|
balanceEnable?: number;
|
||||||
|
/** 企业微信id */
|
||||||
|
corpid?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -109,6 +115,8 @@ export interface UpdateSmartCabinetCommand {
|
||||||
mode?: number;
|
mode?: number;
|
||||||
/** 借呗支付(1-正常使用 0-禁止使用) */
|
/** 借呗支付(1-正常使用 0-禁止使用) */
|
||||||
balanceEnable?: number;
|
balanceEnable?: number;
|
||||||
|
/** 企业微信id */
|
||||||
|
corpid?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AllCabinetDataDTO {
|
export interface AllCabinetDataDTO {
|
||||||
|
|
|
||||||
|
|
@ -289,7 +289,7 @@ async function handleDeleteCabinet() {
|
||||||
await deleteSmartCabinet(cabinetId.value.toString());
|
await deleteSmartCabinet(cabinetId.value.toString());
|
||||||
ElMessage.success('柜体删除成功');
|
ElMessage.success('柜体删除成功');
|
||||||
// 返回列表页面
|
// 返回列表页面
|
||||||
router.push('/cabinet/smart-cabinet');
|
router.push('/cabinet/smart-cabinet-card/index');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('操作取消或失败', error);
|
console.error('操作取消或失败', error);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ import SmartCabinetCardFormModal from "./smart-cabinet-card-form-modal.vue";
|
||||||
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
|
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
|
||||||
import { getModeText } from "@/api/shop/shop";
|
import { getModeText } from "@/api/shop/shop";
|
||||||
import { useBtnPermissionStore } from "@/store/modules/btnPermission";
|
import { useBtnPermissionStore } from "@/store/modules/btnPermission";
|
||||||
|
import { useWxStore } from "@/store/modules/wx";
|
||||||
const { VITE_PUBLIC_IMG_PATH: IMG_PATH } = import.meta.env;
|
const { VITE_PUBLIC_IMG_PATH: IMG_PATH } = import.meta.env;
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
|
|
@ -23,13 +24,15 @@ defineOptions({
|
||||||
});
|
});
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const wxStore = useWxStore();
|
||||||
const { hasPermission } = useBtnPermissionStore();
|
const { hasPermission } = useBtnPermissionStore();
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const modalVisible = ref(false);
|
const modalVisible = ref(false);
|
||||||
const searchFormParams = ref({
|
const searchFormParams = ref({
|
||||||
cabinetName: "",
|
cabinetName: "",
|
||||||
cabinetType: null,
|
cabinetType: null,
|
||||||
shopId: null
|
shopId: null,
|
||||||
|
corpid: wxStore.corpid
|
||||||
});
|
});
|
||||||
|
|
||||||
const pageLoading = ref(false);
|
const pageLoading = ref(false);
|
||||||
|
|
@ -52,6 +55,7 @@ async function getList() {
|
||||||
pageLoading.value = true;
|
pageLoading.value = true;
|
||||||
const { data } = await getSmartCabinetList({
|
const { data } = await getSmartCabinetList({
|
||||||
...searchFormParams.value,
|
...searchFormParams.value,
|
||||||
|
corpid: wxStore.corpid,
|
||||||
pageSize: pagination.value.pageSize,
|
pageSize: pagination.value.pageSize,
|
||||||
pageNum: pagination.value.currentPage
|
pageNum: pagination.value.currentPage
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import Confirm from "@iconify-icons/ep/check";
|
||||||
import type { FormRules } from 'element-plus';
|
import type { FormRules } from 'element-plus';
|
||||||
import { CabinetImgMap } from "@/utils/cabinetImgMap";
|
import { CabinetImgMap } from "@/utils/cabinetImgMap";
|
||||||
import { cabinetNames } from "@/utils/constant/cabinet";
|
import { cabinetNames } from "@/utils/constant/cabinet";
|
||||||
|
import { useWxStore } from "@/store/modules/wx";
|
||||||
|
|
||||||
export interface FormDTO {
|
export interface FormDTO {
|
||||||
cabinetName: string;
|
cabinetName: string;
|
||||||
|
|
@ -17,6 +18,7 @@ export interface FormDTO {
|
||||||
belongType: number;
|
belongType: number;
|
||||||
mode: number;
|
mode: number;
|
||||||
balanceEnable: number;
|
balanceEnable: number;
|
||||||
|
corpid: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|
@ -28,6 +30,8 @@ const props = defineProps({
|
||||||
|
|
||||||
const emit = defineEmits(["update:modelValue", "refresh"]);
|
const emit = defineEmits(["update:modelValue", "refresh"]);
|
||||||
|
|
||||||
|
const wxStore = useWxStore();
|
||||||
|
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const formData = reactive<FormDTO>({
|
const formData = reactive<FormDTO>({
|
||||||
cabinetName: "",
|
cabinetName: "",
|
||||||
|
|
@ -37,7 +41,8 @@ const formData = reactive<FormDTO>({
|
||||||
location: 0,
|
location: 0,
|
||||||
belongType: 0,
|
belongType: 0,
|
||||||
mode: 0,
|
mode: 0,
|
||||||
balanceEnable: 1
|
balanceEnable: 1,
|
||||||
|
corpid: wxStore.corpid
|
||||||
});
|
});
|
||||||
|
|
||||||
const rules = reactive<FormRules>({
|
const rules = reactive<FormRules>({
|
||||||
|
|
@ -65,6 +70,7 @@ const rules = reactive<FormRules>({
|
||||||
const handleConfirm = async () => {
|
const handleConfirm = async () => {
|
||||||
try {
|
try {
|
||||||
await formRef.value.validate();
|
await formRef.value.validate();
|
||||||
|
formData.corpid = wxStore.corpid;
|
||||||
await addSmartCabinet(formData);
|
await addSmartCabinet(formData);
|
||||||
ElMessage.success("新增成功");
|
ElMessage.success("新增成功");
|
||||||
emit("refresh");
|
emit("refresh");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue