|
@@ -1,6 +1,5 @@
|
|
|
<script setup lang="ts">
|
|
|
import { reactive, ref } from "vue";
|
|
|
-import { type PaginationProps } from "@pureadmin/table";
|
|
|
import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
|
|
|
import { statusList, inv_type_list } from "./status";
|
|
|
import { useRouter } from "vue-router";
|
|
@@ -8,8 +7,7 @@ import IntervalTime from "/@/components/IntervalTime";
|
|
|
import NoAuth from "/@/components/NoAuth/NoAuth.vue";
|
|
|
import contentConfig from "./config/content.config";
|
|
|
import { PageContent } from "/@/components/PageContent";
|
|
|
-import { httpList } from "/@/api/InvoiceSales/invoiceApply";
|
|
|
-import { useResponseHandle, usePermission } from "/@/hooks";
|
|
|
+import { usePermission } from "/@/hooks";
|
|
|
|
|
|
defineOptions({
|
|
|
name: "invoiceApply"
|
|
@@ -32,39 +30,11 @@ const form = reactive({ ...initform });
|
|
|
|
|
|
const { push } = useRouter();
|
|
|
const pageContentRef = ref<InstanceType<typeof PageContent>>(null);
|
|
|
-const responseHandle = useResponseHandle();
|
|
|
-const dataList = ref([]);
|
|
|
const loading = ref(false);
|
|
|
|
|
|
-const pagination = reactive<PaginationProps>({
|
|
|
- total: 0,
|
|
|
- pageSize: 15,
|
|
|
- currentPage: 1,
|
|
|
- background: true
|
|
|
-});
|
|
|
-
|
|
|
-async function onSearch() {
|
|
|
- if (loading.value) return;
|
|
|
- loading.value = true;
|
|
|
- const { code, data, message } = await httpList(form);
|
|
|
- responseHandle({
|
|
|
- code,
|
|
|
- message,
|
|
|
- handler: () => {
|
|
|
- const { list, count } = data;
|
|
|
- dataList.value = list ?? [];
|
|
|
- pagination.total = count ?? 0;
|
|
|
- pagination.pageSize = form.size;
|
|
|
- pagination.currentPage = form.page;
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- loading.value = false;
|
|
|
-}
|
|
|
async function resetSearch() {
|
|
|
form.page = 1;
|
|
|
- // await onSearch();
|
|
|
- // pageContentRef.getP
|
|
|
+ (pageContentRef.value as any).getPageData(form);
|
|
|
}
|
|
|
//新建/详情页面
|
|
|
const toDetail = (id?: string) => {
|
|
@@ -80,7 +50,7 @@ async function resetForm() {
|
|
|
Object.keys(form).forEach(key => {
|
|
|
form[key] = initform[key];
|
|
|
});
|
|
|
- await onSearch();
|
|
|
+ (pageContentRef.value as any).getPageData(form);
|
|
|
}
|
|
|
const { permission, contentConfigRef } = usePermission({
|
|
|
pageName: "invoiceApply",
|
|
@@ -169,7 +139,7 @@ const { permission, contentConfigRef } = usePermission({
|
|
|
<el-button
|
|
|
:icon="useRenderIcon('refresh')"
|
|
|
class="fl"
|
|
|
- @click="resetForm()"
|
|
|
+ @click="resetForm"
|
|
|
>
|
|
|
重置
|
|
|
</el-button>
|