Jelajahi Sumber

增加无固定场分页查询逻辑

学习?学个屁 3 minggu lalu
induk
melakukan
810ddb9ad6

+ 13 - 2
src/views/businessManagement/gymnasiumNoFixed/gymnasiumNoFixed.api.ts

@@ -6,9 +6,13 @@ enum Api {
   edit = '/app/appSitePlace/updateUnfixed',
   deleteOne = '/app/appSitePlace/deleteUnfixed',
   detaile = '/app/appCourese/queryById',
+  queryById = '/app/appSitePlace/queryPack',
+  Business = '/app/appSitePlace/queryByOrgCode',
 }
 export const list = (params) => defHttp.get({ url: Api.list, params });
-
+export const queryById = (params) => {
+  return defHttp.get({ url: Api.queryById, params });
+};
 /**
  * 删除单个
  */
@@ -17,7 +21,14 @@ export const deleteOne = (params, handleSuccess) => {
     handleSuccess();
   });
 };
-
+/**
+ * 营业名称
+ * @param params type:0是学校,1是体育馆,不传查全部
+ * @returns
+ */
+export const Business = (params) => {
+  return defHttp.post({ url: `${Api.Business}`, data: params });
+};
 /**
  * 保存或者更新
  * @param params

+ 20 - 3
src/views/businessManagement/gymnasiumNoFixed/gymnasiumNoFixed.data.ts

@@ -1,5 +1,9 @@
 import { BasicColumn, FormSchema } from '/@/components/Table';
+import { Business } from './gymnasiumNoFixed.api';
+import { useUserStore } from '/@/store/modules/user';
+import { storeToRefs } from 'pinia';
 
+const { userInfo } = storeToRefs(useUserStore());
 export const columns: BasicColumn[] = [
   {
     title: '封面',
@@ -40,13 +44,26 @@ export const columns: BasicColumn[] = [
       return record.refundType === 1 ? '随时退,过期自动退' : record.refundType === 2 ? '不支持退款' : '可退';
     },
   },
+  {
+    title: '体育馆',
+    dataIndex: 'venuesName',
+    width: 100,
+  },
 ];
 export const searchFormSchema: FormSchema[] = [
   {
-    field: 'name',
-    label: '商品名称',
-    component: 'Input',
+    field: 'siteId',
+    label: '体育馆',
+    component: 'ApiSelect',
     colProps: { span: 6 },
+    componentProps: {
+      api: Business,
+      resultField: 'data',
+      labelField: 'name',
+      valueField: 'id',
+      immediate: true,
+      params: { orgCode: userInfo.value?.orgCode, type: 1 },
+    },
   },
 ];