feat(智能柜): 添加企业微信ID支持并修复路由跳转
在智能柜相关接口和页面中添加corpid字段以支持企业微信集成 修复删除柜体后跳转路径错误的问题
This commit is contained in:
parent
d89a2a25e2
commit
d69e6540e3
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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<FormDTO>({
|
||||
cabinetName: "",
|
||||
|
|
@ -37,7 +41,8 @@ const formData = reactive<FormDTO>({
|
|||
location: 0,
|
||||
belongType: 0,
|
||||
mode: 0,
|
||||
balanceEnable: 1
|
||||
balanceEnable: 1,
|
||||
corpid: wxStore.corpid
|
||||
});
|
||||
|
||||
const rules = reactive<FormRules>({
|
||||
|
|
@ -65,6 +70,7 @@ const rules = reactive<FormRules>({
|
|||
const handleConfirm = async () => {
|
||||
try {
|
||||
await formRef.value.validate();
|
||||
formData.corpid = wxStore.corpid;
|
||||
await addSmartCabinet(formData);
|
||||
ElMessage.success("新增成功");
|
||||
emit("refresh");
|
||||
|
|
|
|||
Loading…
Reference in New Issue