Browse Source

feat:详情页跳转回列表页后 查询参数保存

snow 2 years ago
parent
commit
9991dfeed3

+ 5 - 1
.env.development

@@ -11,7 +11,11 @@ VITE_PROXY_DOMAIN = /api
 VITE_ROUTER_HISTORY = "hash"
 # 钉钉企业id
 VITE_CORP_ID = "dingc78fa4301e1a424a35c2f4657eb6378f"
+# 企业微信appid
+VITE_APP_ID = "ww6076e6fd4268ee31"
+# 微信开发环境基础重定向url
+REDIRECT_BASE_URL = "http://webcx.test241.wanyuhengtong.com/"
 # 开发环境后端用户地址
 VITE_PROXY_USER_REAL = "http://stockinv.test241.wanyuhengtong.com"
 # 开发环境后端业务地址
-VITE_PROXY_DOMAIN_REAL = "http://cxinv.test241.wanyuhengtong.com"
+VITE_PROXY_DOMAIN_REAL = "http://cxinv.test241.wanyuhengtong.com"

+ 2 - 0
build/index.ts

@@ -9,6 +9,8 @@ const warpperEnv = (envConf: Recordable): ViteEnv => {
     VITE_PROXY_USER_REAL: "",
     VITE_ROUTER_HISTORY: "",
     VITE_CORP_ID: "",
+    VITE_APP_ID: "",
+    REDIRECT_BASE_URL: "",
     VITE_LEGACY: false
   };
 

+ 2 - 9
src/App.vue

@@ -29,17 +29,13 @@ const { VITE_CORP_ID } = loadEnv();
 import { JudgeEnvironment } from "/@/utils/validate";
 import { useUserStoreHook } from "/@/store/modules/user";
 import { storageSession } from "@pureadmin/utils";
+import { useLoginWithWechat } from "/@/utils/wechat"
 // import { getToken, removeToken } from "/@/utils/auth";
 // if (getToken() ?? "") {
 //   removeToken();
 //   router.replace({ path: "/login" });
 // }
 
-// 
-const redirectUrl = "http://webcx.test241.wanyuhengtong.com/";
-const appid = "ww6076e6fd4268ee31"
-const oauthUrl = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${redirectUrl}&response_type=code&scope=SCOPE&state=STATE#wechat_redirect`
-
 const code = ref("");
 function testing() {
   dd?.ready(() => {
@@ -86,9 +82,6 @@ onMounted(() => {
   if (JudgeEnvironment() === "isDingDing") {
     testing();
   }
-  //企业微信登录
-  if (JudgeEnvironment() === "Weixin") { 
-    window.location.href = oauthUrl;
-  }
 });
+
 </script>

+ 7 - 1
src/components/PageContent/src/hooks/use-pagination.ts

@@ -1,14 +1,20 @@
 import { PaginationProps } from "@pureadmin/table";
 import { reactive } from "vue";
 import { PageContentProps } from "../types";
+import { useAppStoreHook } from "/@/store/modules/app";
+
+// const defaultPagination =
+{ }
 
 export function usePagination(props: PageContentProps, { onSearch }: any) {
   const { pageSize, contentConfig } = props;
 
+  const { searchParams } = useAppStoreHook();
+
   if (contentConfig.notPagination) return {};
 
   //分页参数
-  const pagination = reactive<PaginationProps>({
+  const pagination = reactive<PaginationProps>(searchParams.pagination ? searchParams.pagination : {
     total: 0,
     pageSize,
     currentPage: 1,

+ 3 - 1
src/components/PageContent/src/hooks/use-params.ts

@@ -1,8 +1,10 @@
 import { ref } from "vue";
+import { useAppStoreHook } from "/@/store/modules/app";
 
 export function useParams() {
+  const { searchParams } = useAppStoreHook();
   //查询参数
-  const basicParams = ref<Record<string, any>>({});
+  const basicParams = ref<Record<string, any>>(searchParams.basic ? searchParams.basic : {});
 
   function changeBasicParams(newParams: any = {}) {
     basicParams.value = newParams;

+ 2 - 0
src/components/PageContent/src/hooks/use-request.ts

@@ -102,6 +102,8 @@ export function useRequeset(props: PageContentProps) {
   return {
     loading,
     dataList,
+    getBasicParams,
+    getPagination,
     onBeforeAction,
     paginationConfig,
     getPageData,

+ 14 - 0
src/components/PageContent/src/page-content.tsx

@@ -6,6 +6,8 @@ import { createActionProps, createOperation } from "./utils/create-operation";
 import { useRequeset } from "./hooks/use-request";
 import { Operation } from "./actions";
 import "./styles/index.scss";
+import { onBeforeRouteLeave } from "vue-router";
+import { useAppStoreHook } from "/@/store/modules/app";
 
 const PageConent = defineComponent({
   name: "PageContent",
@@ -23,11 +25,15 @@ const PageConent = defineComponent({
 
     const tableRef = ref<InstanceType<typeof PureTable>>(null);
 
+    const { setSearchParams } = useAppStoreHook();
+
     const {
       loading,
       dataList,
       onSearch,
       getPageData,
+      getBasicParams,
+      getPagination,
       onBeforeAction,
       paginationConfig
     } = useRequeset(props);
@@ -118,6 +124,14 @@ const PageConent = defineComponent({
       );
     }
 
+    onBeforeRouteLeave(({ path }) => {
+      //到详情页保存查询参数 到其他页面清空查询参数
+      const isDetail = path.indexOf('Detail') >= 0;
+      const basicParams = isDetail ? getBasicParams() : null;
+      const pagination = isDetail ? getPagination() : null;
+      setSearchParams(basicParams, pagination);
+    })
+
     function renderExpand(row) {
       const { contentConfig } = props;
       const { showExpand } = contentConfig;

+ 22 - 2
src/components/PageSearch/src/hooks/use-page-search.ts

@@ -1,23 +1,43 @@
 /* eslint-disable prettier/prettier */
 import { ref } from "vue";
 import { PageContentInstance } from "/@/components/PageContent";
+import { FormConfig } from "/@/components/PageSearch";
+import dayjs from "dayjs";
 
 type Fn = (params?: any) => any
 
-export function usePageSearch(searchCallback?: Fn, resetCallback?: Fn) {
+export function usePageSearch(searchCallback?: Fn, resetCallback?: Fn, searchFormConfig?: FormConfig) {
   const pageContentRef = ref<PageContentInstance>(null);
 
   function handleSearchClick(params: any) {
     const { result, deleteProps } = searchCallback ? searchCallback(params) : { result: {}, deleteProps: [] }
 
+
+    console.log(searchFormConfig);
+
     const mergeParams = {
       ...params,
       ...result
     };
 
+    if (searchFormConfig) {
+      const { formItems } = searchFormConfig;
+
+      formItems.forEach(item => {
+        const { field, otherOptions = {} } = item;
+        const { startProp, endProp } = otherOptions;
+
+        if (startProp || endProp) {
+          mergeParams[startProp] = dayjs(mergeParams[field][0]).format('YYYY-MM-DD hh:mm:ss');
+          mergeParams[endProp] = dayjs(mergeParams[field][1]).format('YYYY-MM-DD hh:mm:ss');
+
+          delete mergeParams[field]
+        }
+      })
+    }
+
     deleteProps.forEach(key => delete mergeParams[key])
 
-    console.log(mergeParams)
     pageContentRef.value?.getPageData(mergeParams);
   }
 

+ 23 - 6
src/components/PageSearch/src/page-search.vue

@@ -4,14 +4,19 @@ import { BasicForm } from "/@/components/BasicForm";
 import { useRenderIcon } from "../../ReIcon/src/hooks";
 import { createFormData } from "./utils/create-form-data";
 import { searchFormProps } from "./types";
+import { useAppStoreHook } from "/@/store/modules/app";
 
 const props = defineProps(searchFormProps);
 const emit = defineEmits(["searchBtnClick", "resetBtnClick"]);
 
+const { searchParams } = useAppStoreHook()
+
 //初始表格数据
 const defaultFormData = createFormData(props.formConfig.formItems);
 
-const formData = ref({ ...defaultFormData });
+const formData = ref({
+  ...(searchParams.basic ? searchParams.basic : defaultFormData)
+});
 
 //重置搜索
 function handleResetClick() {
@@ -23,6 +28,22 @@ function handleResetClick() {
 function handleSearchClick() {
   emit("searchBtnClick", formData.value);
 }
+
+if (searchParams.basic) {
+  const { formConfig } = props;
+  const { formItems } = formConfig;
+  formItems.forEach(item => {
+    const { field, otherOptions = {} } = item;
+    const { startProp, endProp } = otherOptions;
+
+    if (startProp || endProp) {
+      formData.value[field] = [searchParams.basic[startProp],searchParams.basic[endProp]]
+
+      delete formData.value[startProp]
+      delete formData.value[endProp]
+    }
+  })
+}
 </script>
 
 <template>
@@ -30,11 +51,7 @@ function handleSearchClick() {
     <BasicForm v-bind="formConfig" v-model:form-data="formData">
       <template #action>
         <div style="width: 100%" flex gap-2>
-          <el-button
-            type="primary"
-            :icon="useRenderIcon('search')"
-            @click="handleSearchClick"
-          >
+          <el-button type="primary" :icon="useRenderIcon('search')" @click="handleSearchClick">
             搜索
           </el-button>
 

+ 13 - 2
src/store/modules/app.ts

@@ -19,7 +19,11 @@ export const useAppStore = defineStore({
     layout:
       storageLocal.getItem<StorageConfigs>("responsive-layout")?.layout ??
       getConfig().Layout,
-    device: deviceDetection() ? "mobile" : "desktop"
+    device: deviceDetection() ? "mobile" : "desktop",
+    searchParams: {
+      basic: null,
+      pagination: null
+    }
   }),
   getters: {
     getSidebarStatus() {
@@ -52,7 +56,8 @@ export const useAppStore = defineStore({
       this.device = device;
     },
 
-    
+
+
     async toggleSideBar(opened?: boolean, resize?: string) {
       await this.TOGGLE_SIDEBAR(opened, resize);
     },
@@ -61,6 +66,12 @@ export const useAppStore = defineStore({
     },
     setLayout(layout) {
       this.layout = layout;
+    },
+    setSearchParams(basic: Record<string, string>, pagination: any) {
+      this.searchParams = {
+        basic,
+        pagination
+      }
     }
   }
 });

+ 4 - 0
src/store/modules/types.ts

@@ -19,6 +19,10 @@ export type appType = {
   };
   layout: string;
   device: string;
+  searchParams: {
+    basic: Record<string, string> | null,
+    pagination: any
+  }
 };
 
 export type multiType = {

+ 0 - 0
src/utils/oauth.ts


+ 4 - 2
src/views/InvoiceSales/capitalClaim/config/search.config.ts

@@ -19,8 +19,10 @@ const searchFormConfig: FormConfig = {
       type: "date_picker",
       otherOptions: {
         type: "daterange",
-        startPlaceholder: "创建开始时间",
-        endPlaceholder: "创建结束时间"
+        startProp: 'start',
+        endProp: 'end',
+        startPlaceholder: "交易开始时间",
+        endPlaceholder: "交易结束时间"
       }
     }
   ]

+ 29 - 106
src/views/InvoiceSales/capitalClaim/index.vue

@@ -23,17 +23,7 @@ const { push } = useRouter();
 const execlUploadRef = ref<InstanceType<typeof ExeclUpload>>(null);
 
 const { pageContentRef, handleResetClick, handleSearchClick } = usePageSearch(
-  ({ create_timer }) => {
-    const [start, end] = create_timer;
-
-    return {
-      result: {
-        start,
-        end
-      },
-      deleteProps: ["create_timer"]
-    };
-  }
+  undefined, undefined, searchFormConfig
 );
 
 //导出模板
@@ -70,127 +60,60 @@ const { permission, contentConfigRef } = usePermission({
   <div class="main role">
     <PagePower :is-show="permission.list">
       <div w-full>
-        <PageSearch
-          :form-config="searchFormConfig"
-          @search-btn-click="handleSearchClick"
-          @reset-btn-click="handleResetClick"
-        >
+        <PageSearch :form-config="searchFormConfig" @search-btn-click="handleSearchClick"
+          @reset-btn-click="handleResetClick">
           <template #action>
             <el-button @click="onDownloadTemplate">下载模板</el-button>
-            <el-button type="primary" @click="() => execlUploadRef.onDisplay()"
-              >导入数据</el-button
-            >
+            <el-button type="primary" @click="() => execlUploadRef.onDisplay()">导入数据</el-button>
           </template>
         </PageSearch>
-        <PageContent
-          ref="pageContentRef"
-          :content-config="contentConfigRef"
-          @preview-btn-click="row => toFundClaim(row)"
-        >
+        <PageContent ref="pageContentRef" :content-config="contentConfigRef"
+          @preview-btn-click="row => toFundClaim(row)">
           <template #expand="row">
-            <el-table
-              size="small"
-              :data="row.child"
-              border
-              style="
+            <el-table size="small" :data="row.child" border style="
                 width: 100%;
                 padding-left: 45px;
                 padding-top: 10px;
                 padding-bottom: 10px;
-              "
-            >
-              <el-table-column
-                label="资金认领编号"
-                prop="logNo"
-                width="160"
-                show-overflow-tooltip
-              />
-              <el-table-column
-                label="订单编号"
-                prop="orderCode"
-                width="160"
-                show-overflow-tooltip
-              />
-              <el-table-column
-                label="商品编号"
-                prop="goodNo"
-                width="160"
-                show-overflow-tooltip
-              />
-              <el-table-column
-                label="商品名称"
-                prop="goodName"
-                width="180"
-                show-overflow-tooltip
-              />
-              <el-table-column
-                label="认领状态"
-                prop="status"
-                width="90"
-                show-overflow-tooltip
-              >
+              ">
+              <el-table-column label="资金认领编号" prop="logNo" width="160" show-overflow-tooltip />
+              <el-table-column label="订单编号" prop="orderCode" width="160" show-overflow-tooltip />
+              <el-table-column label="商品编号" prop="goodNo" width="160" show-overflow-tooltip />
+              <el-table-column label="商品名称" prop="goodName" width="180" show-overflow-tooltip />
+              <el-table-column label="认领状态" prop="status" width="90" show-overflow-tooltip>
                 <template #="{ $index }">
                   <el-tag>{{
-                    capital_status_list.find(
-                      t => t.value === row.child[$index].status
-                    )?.label || "--"
+                  capital_status_list.find(
+                  t => t.value === row.child[$index].status
+                  )?.label || "--"
                   }}</el-tag>
                 </template>
               </el-table-column>
-              <el-table-column
-                label="订单来源"
-                prop="qrdSource"
-                width="90"
-                show-overflow-tooltip
-              >
+              <el-table-column label="订单来源" prop="qrdSource" width="90" show-overflow-tooltip>
                 <template #="{ $index }">
                   <el-tag>{{
-                    xs_order_source_options.find(
-                      t => t.value === row.child[$index].qrdSource
-                    )?.label
+                  xs_order_source_options.find(
+                  t => t.value === row.child[$index].qrdSource
+                  )?.label
                   }}</el-tag>
                 </template>
               </el-table-column>
-              <el-table-column
-                label="商品来源"
-                prop="qrdType"
-                width="80"
-                show-overflow-tooltip
-              >
+              <el-table-column label="商品来源" prop="qrdType" width="80" show-overflow-tooltip>
                 <template #="{ $index }">
                   <el-tag>{{
-                    cgd_type_list.find(
-                      t => t.value === row.child[$index].qrdType
-                    )?.label
+                  cgd_type_list.find(
+                  t => t.value === row.child[$index].qrdType
+                  )?.label
                   }}</el-tag>
                 </template>
               </el-table-column>
-              <el-table-column
-                label="资金创建人"
-                prop="ownerName"
-                width="80"
-                show-overflow-tooltip
-              />
-              <el-table-column
-                label="认领创建人"
-                prop="apply_name"
-                width="80"
-                show-overflow-tooltip
-              />
-              <el-table-column
-                label="平台单号"
-                prop="poCode"
-                width="180"
-                show-overflow-tooltip
-              />
+              <el-table-column label="资金创建人" prop="ownerName" width="80" show-overflow-tooltip />
+              <el-table-column label="认领创建人" prop="apply_name" width="80" show-overflow-tooltip />
+              <el-table-column label="平台单号" prop="poCode" width="180" show-overflow-tooltip />
               <el-table-column fixed="right" label="操作" width="60px">
                 <template #default="{ $index }">
-                  <el-button
-                    :icon="useRenderIcon('eye-view')"
-                    @click="() => toFundClaim(row.child[$index])"
-                    type="primary"
-                    link
-                  />
+                  <el-button :icon="useRenderIcon('eye-view')" @click="() => toFundClaim(row.child[$index])"
+                    type="primary" link />
                 </template>
               </el-table-column>
             </el-table>

+ 5 - 24
src/views/InvoiceSales/capitalPool/index.vue

@@ -14,22 +14,9 @@ defineOptions({
 
 const capitalDialogRef = ref<InstanceType<typeof CapitalDialog>>(null);
 
-function searchCallback({ timer }) {
-  const [start, end] = timer;
-
-  const result = {
-    start,
-    end
-  };
-
-  return {
-    result,
-    deleteProps: ["timer"]
-  };
-}
 
 const { pageContentRef, handleResetClick, handleSearchClick } =
-  usePageSearch(searchCallback);
+  usePageSearch(undefined, undefined, searchFormConfig);
 
 onMounted(
   () =>
@@ -41,16 +28,10 @@ onMounted(
   <div class="main role">
     <PagePower :is-show="contentConfig.powers.some(i => i === '001')">
       <div w-full>
-        <PageSearch
-          :form-config="searchFormConfig"
-          @search-btn-click="handleSearchClick"
-          @reset-btn-click="handleResetClick"
-        />
-        <PageContent
-          ref="pageContentRef"
-          :content-config="contentConfig"
-          @preview-btn-click="({ logNo }) => capitalDialogRef.onDisplay(logNo)"
-        />
+        <PageSearch :form-config="searchFormConfig" @search-btn-click="handleSearchClick"
+          @reset-btn-click="handleResetClick" />
+        <PageContent ref="pageContentRef" :content-config="contentConfig"
+          @preview-btn-click="({ logNo }) => capitalDialogRef.onDisplay(logNo)" />
       </div>
     </PagePower>
 

+ 23 - 65
src/views/InvoiceSales/invoiceApply/index.vue

@@ -9,11 +9,14 @@ import contentConfig from "./config/content.config";
 import { PageContent } from "/@/components/PageContent";
 import { usePermission } from "/@/hooks";
 import { INV_OPEN_STATUS } from "/@/utils/details/inv-open"
+import { useAppStoreHook } from "/@/store/modules/app";
 
 defineOptions({
   name: "invoiceApply"
 });
 
+const { searchParams } = useAppStoreHook()
+
 const initform = {
   invNo: "",
   customer: "", //客户公司
@@ -28,7 +31,11 @@ const initform = {
   size: 15
 };
 
-const form = reactive({ ...initform });
+const form = reactive({
+  ...(
+    searchParams.basic ? searchParams.basic : initform
+  )
+});
 
 const { push } = useRouter();
 const pageContentRef = ref<InstanceType<typeof PageContent>>(null);
@@ -67,95 +74,46 @@ const { permission, contentConfigRef } = usePermission({
       <div class="bg-white p-4">
         <el-row :gutter="10" class="pb-4">
           <el-col :span="5">
-            <el-select
-              v-model="form.status"
-              style="width: 100%"
-              placeholder="发票申请状态"
-              clearable
-            >
-              <el-option
-                v-for="(si, sii) in INV_OPEN_STATUS"
-                :key="'status' + si.value + sii"
-                :label="si.label"
-                :value="si.value"
-              />
+            <el-select v-model="form.status" style="width: 100%" placeholder="发票申请状态" clearable>
+              <el-option v-for="(si, sii) in INV_OPEN_STATUS" :key="'status' + si.value + sii" :label="si.label"
+                :value="si.value" />
             </el-select>
           </el-col>
           <el-col :span="5">
-            <el-select
-              v-model="form.inv_type"
-              style="width: 100%"
-              placeholder="发票类型"
-              clearable
-            >
-              <el-option
-                v-for="(si, sii) in inv_type_list"
-                :key="'status' + si.value + sii"
-                :label="si.label"
-                :value="si.value"
-              />
+            <el-select v-model="form.inv_type" style="width: 100%" placeholder="发票类型" clearable>
+              <el-option v-for="(si, sii) in inv_type_list" :key="'status' + si.value + sii" :label="si.label"
+                :value="si.value" />
             </el-select>
           </el-col>
           <el-col :span="10">
-            <IntervalTime
-              v-model:startValue="form.start"
-              v-model:endValue="form.end"
-            />
+            <IntervalTime v-model:startValue="form.start" v-model:endValue="form.end" />
           </el-col>
           <el-col :span="4">
-            <el-input
-              v-model="form.apply_name"
-              placeholder="申请人"
-              style="width: 100%"
-              clearable
-            />
+            <el-input v-model="form.apply_name" placeholder="申请人" style="width: 100%" clearable />
           </el-col>
         </el-row>
         <el-row :gutter="10">
           <el-col :span="6">
-            <el-input
-              v-model="form.invNo"
-              placeholder="发票申请编号"
-              style="width: 100%"
-              clearable
-            />
+            <el-input v-model="form.invNo" placeholder="发票申请编号" style="width: 100%" clearable />
           </el-col>
           <el-col :span="6">
-            <el-input
-              v-model="form.inv_out"
-              placeholder="业务企业公司编号"
-              style="width: 100%"
-              clearable
-            />
+            <el-input v-model="form.inv_out" placeholder="业务企业公司编号" style="width: 100%" clearable />
           </el-col>
 
           <el-col :span="4">
-            <el-button
-              type="primary"
-              :icon="useRenderIcon('search')"
-              :loading="loading"
-              class="fl"
-              @click="resetSearch"
-            >
+            <el-button type="primary" :icon="useRenderIcon('search')" :loading="loading" class="fl"
+              @click="resetSearch">
               搜索
             </el-button>
-            <el-button
-              :icon="useRenderIcon('refresh')"
-              class="fl"
-              @click="resetForm"
-            >
+            <el-button :icon="useRenderIcon('refresh')" class="fl" @click="resetForm">
               重置
             </el-button>
           </el-col>
         </el-row>
       </div>
 
-      <PageContent
-        ref="pageContentRef"
-        :content-config="contentConfigRef"
-        @preview-btn-click="({ invNo }) => toDetail(invNo)"
-        @create-btn-click="() => toDetail()"
-      />
+      <PageContent ref="pageContentRef" :content-config="contentConfigRef"
+        @preview-btn-click="({ invNo }) => toDetail(invNo)" @create-btn-click="() => toDetail()" />
     </div>
     <NoAuth v-else />
   </div>

+ 2 - 0
src/views/InvoiceSales/returnTicket/config/search.config.ts

@@ -29,6 +29,8 @@ const searchFormConfig: FormConfig = {
       type: "date_picker",
       otherOptions: {
         type: "daterange",
+        startProp: 'start',
+        endProp: 'end',
         startPlaceholder: "申请开始时间",
         endPlaceholder: "申请结束时间"
       }

+ 5 - 23
src/views/InvoiceSales/returnTicket/index.vue

@@ -2,31 +2,19 @@
 import { PageSearch, usePageSearch } from "/@/components/PageSearch";
 import { PageContent } from "/@/components/PageContent";
 import searchFormConfig from "./config/search.config";
-import modalConfig from "./config/modal.config";
 import contentConfig from "./config/content.config";
 import PagePower from "/@/components/PagePower/PagePower.vue";
 import { usePermission } from "/@/hooks";
 import { useRouter } from "vue-router";
-import dayjs from "dayjs";
 
 defineOptions({
   name: "returnTicket"
 });
 
-const search = ({ timer }) => {
-  const [start, end] = timer;
-  return {
-    result: {
-      start: dayjs(start).format("YYYY-MM-DD hh:mm:ss"),
-      end: dayjs(end).format("YYYY-MM-DD hh:mm:ss")
-    },
-    deleteProps: ["timer"]
-  };
-};
 
 const { push } = useRouter();
 const { pageContentRef, handleResetClick, handleSearchClick } =
-  usePageSearch(search);
+  usePageSearch(undefined, undefined, searchFormConfig);
 
 function toDetail(returnCode) {
   push({
@@ -48,18 +36,12 @@ const { permission, contentConfigRef } = usePermission({
   <div class="main role">
     <PagePower :is-show="permission.list">
       <div w-full>
-        <PageSearch
-          :form-config="searchFormConfig"
-          @search-btn-click="handleSearchClick"
-          @reset-btn-click="handleResetClick"
-        />
+        <PageSearch :form-config="searchFormConfig" @search-btn-click="handleSearchClick"
+          @reset-btn-click="handleResetClick" />
 
-        <PageContent
-          ref="pageContentRef"
-          :content-config="contentConfigRef"
+        <PageContent ref="pageContentRef" :content-config="contentConfigRef"
           @preview-btn-click="({ returnCode }) => toDetail(returnCode)"
-          @create-btn-click="() => push('/InvoiceSales/returnTicketDetail')"
-        />
+          @create-btn-click="() => push('/InvoiceSales/returnTicketDetail')" />
       </div>
     </PagePower>
   </div>

+ 2 - 0
src/views/purchase/orderRecord/config/search.config.ts

@@ -18,6 +18,8 @@ const searchFormConfig: FormConfig = {
       type: "date_picker",
       otherOptions: {
         type: "daterange",
+        startProp: "startTime",
+        endProp: "endTime",
         startPlaceholder: "开始日期",
         endPlaceholder: "结束日期"
       }

+ 17 - 29
src/views/purchase/orderRecord/index.vue

@@ -10,20 +10,20 @@ defineOptions({
   name: "orderRecord"
 });
 
-const searchCallback = ({ timer }) => {
-  const [startTime, endTime] = timer;
-
-  return {
-    result: {
-      startTime,
-      endTime
-    },
-    deleteProps: ["timer"]
-  };
-};
+// const searchCallback = ({ timer }) => {
+//   const [startTime, endTime] = timer;
+
+//   return {
+//     result: {
+//       startTime,
+//       endTime
+//     },
+//     deleteProps: ["timer"]
+//   };
+// };
 
 const { pageContentRef, handleSearchClick, handleResetClick } =
-  usePageSearch(searchCallback);
+  usePageSearch(undefined, undefined, searchFormConfig);
 
 const { push } = useRouter();
 
@@ -48,25 +48,13 @@ const { permission, contentConfigRef } = usePermission({
 <template>
   <div class="main orderRecord">
     <div v-show="permission.list">
-      <PageSearch
-        ref="pageContentRef"
-        :form-config="searchFormConfig"
-        @search-btn-click="handleSearchClick"
-        @reset-btn-click="handleResetClick"
-      />
+      <PageSearch ref="pageContentRef" :form-config="searchFormConfig" @search-btn-click="handleSearchClick"
+        @reset-btn-click="handleResetClick" />
 
-      <PageContent
-        ref="pageContentRef"
-        :content-config="contentConfigRef"
-        @preview-btn-click="({ payNo }) => toDetail(payNo)"
-      >
+      <PageContent ref="pageContentRef" :content-config="contentConfigRef"
+        @preview-btn-click="({ payNo }) => toDetail(payNo)">
         <template #create>
-          <el-button
-            type="primary"
-            v-if="permission.create"
-            @click="handleCreate"
-            >新建</el-button
-          >
+          <el-button type="primary" v-if="permission.create" @click="handleCreate">新建</el-button>
         </template>
       </PageContent>
     </div>

+ 2 - 0
src/views/purchase/orderRecordQuery/config/search.config.ts

@@ -55,6 +55,8 @@ const searchFormConfig: FormConfig = {
       type: "date_picker",
       otherOptions: {
         type: "daterange",
+        startProp: "startTime",
+        endProp: "endTime",
         startPlaceholder: "开始日期",
         endPlaceholder: "结束日期"
       }

+ 6 - 30
src/views/purchase/orderRecordQuery/index.vue

@@ -10,20 +10,8 @@ defineOptions({
   name: "orderRecord"
 });
 
-const searchCallback = ({ timer }) => {
-  const [startTime, endTime] = timer;
-
-  return {
-    result: {
-      startTime,
-      endTime
-    },
-    deleteProps: ["timer"]
-  };
-};
-
 const { pageContentRef, handleSearchClick, handleResetClick } =
-  usePageSearch(searchCallback);
+  usePageSearch(undefined, undefined, searchFormConfig);
 
 const { push } = useRouter();
 
@@ -48,25 +36,13 @@ const { permission, contentConfigRef } = usePermission({
 <template>
   <div class="main orderRecord">
     <div v-show="permission.list">
-      <PageSearch
-        ref="pageContentRef"
-        :form-config="searchFormConfig"
-        @search-btn-click="handleSearchClick"
-        @reset-btn-click="handleResetClick"
-      />
+      <PageSearch ref="pageContentRef" :form-config="searchFormConfig" @search-btn-click="handleSearchClick"
+        @reset-btn-click="handleResetClick" />
 
-      <PageContent
-        ref="pageContentRef"
-        :content-config="contentConfigRef"
-        @preview-btn-click="({ payNo }) => toDetail(payNo)"
-      >
+      <PageContent ref="pageContentRef" :content-config="contentConfigRef"
+        @preview-btn-click="({ payNo }) => toDetail(payNo)">
         <template #create>
-          <el-button
-            type="primary"
-            v-if="permission.create"
-            @click="handleCreate"
-            >新建</el-button
-          >
+          <el-button type="primary" v-if="permission.create" @click="handleCreate">新建</el-button>
         </template>
       </PageContent>
     </div>

+ 2 - 0
src/views/purchase/purchPay/config/search.config.ts

@@ -18,6 +18,8 @@ const searchFormConfig: FormConfig = {
       type: "date_picker",
       otherOptions: {
         type: "daterange",
+        startProp: 'startTime',
+        endProp: "endTime",
         startPlaceholder: "开始日期",
         endPlaceholder: "结束日期"
       }

+ 1 - 1
src/views/purchase/purchPay/index.vue

@@ -12,7 +12,7 @@ defineOptions({
   name: "purchPay"
 });
 
-const { pageContentRef, handleSearchClick, handleResetClick } = usePageSearch();
+const { pageContentRef, handleSearchClick, handleResetClick } = usePageSearch(undefined,undefined,searchFormConfig);
 
 const contentConfigRef = computed(() => contentConfig);
 

+ 4 - 0
src/views/purchase/ticketReturn/config/search.config.ts

@@ -42,6 +42,8 @@ const searchFormConfig: FormConfig = {
       type: "date_picker",
       otherOptions: {
         type: "daterange",
+        startProp: 'start',
+        endProp: 'end',
         startPlaceholder: "新建起始时间",
         endPlaceholder: "新建结束时间"
       }
@@ -51,6 +53,8 @@ const searchFormConfig: FormConfig = {
       type: "date_picker",
       otherOptions: {
         type: "daterange",
+        startProp: 'open_start',
+        endProp: 'open_end',
         startPlaceholder: "开票起始时间",
         endPlaceholder: "开票结束时间"
       }

+ 1 - 19
src/views/purchase/ticketReturn/index.vue

@@ -9,7 +9,6 @@ import PagePower from "/@/components/PagePower/PagePower.vue";
 import { useUserStoreHook } from "/@/store/modules/user";
 import InvoiceDialog from "./components/invoice-dialog.vue";
 import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
-import dayjs from "dayjs";
 
 defineOptions({
   name: "ticketReturn"
@@ -18,27 +17,10 @@ defineOptions({
 const invoiceDialogRef = ref<InstanceType<typeof InvoiceDialog>>(null);
 const { push } = useRouter();
 
-function searchCallback({ create_timer, open_timer }: any) {
-  const [start, end] = create_timer;
-  const [open_start, open_end] = open_timer;
-
-  const result = {
-    start,
-    end,
-    open_start: open_start ? dayjs(open_start).format("YYYY-MM-DD") : "",
-    open_end: open_end ? dayjs(open_end).format("YYYY-MM-DD") : ""
-  };
-
-  return {
-    result,
-    deleteProps: ["create_timer", "open_timer"]
-  };
-}
-
 const showPreviewInvStatus = ['3','4','5','6','9','10','12']
 
 const { pageContentRef, handleResetClick, handleSearchClick } =
-  usePageSearch(searchCallback);
+  usePageSearch(undefined,undefined,searchFormConfig);
 
 function toDetail({ hpNo }) {
   push({

+ 2 - 0
types/global.d.ts

@@ -79,6 +79,8 @@ declare global {
     VITE_PROXY_USER_REAL: string;
     VITE_ROUTER_HISTORY: string;
     VITE_CORP_ID: string;
+    VITE_APP_ID: string;
+    REDIRECT_BASE_URL: string;
     VITE_LEGACY: boolean;
   }