|
@@ -1,22 +1,20 @@
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
-import { useColumns } from "./columns";
|
|
|
|
-import { httpList } from "/@/api/InvoiceSales/invoiceApply";
|
|
|
|
-import { reactive, ref, onMounted } from "vue";
|
|
|
|
-import { TableProBar } from "/@/components/ReTable";
|
|
|
|
|
|
+import { reactive, ref } from "vue";
|
|
import { type PaginationProps } from "@pureadmin/table";
|
|
import { type PaginationProps } from "@pureadmin/table";
|
|
import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
|
|
import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
|
|
-import { useNav } from "/@/layout/hooks/nav";
|
|
|
|
import { statusList, inv_type_list } from "./status";
|
|
import { statusList, inv_type_list } from "./status";
|
|
import { useRouter } from "vue-router";
|
|
import { useRouter } from "vue-router";
|
|
-import { responseHandle } from "/@/utils/responseHandle";
|
|
|
|
import IntervalTime from "/@/components/IntervalTime";
|
|
import IntervalTime from "/@/components/IntervalTime";
|
|
-import { useUserStoreHook } from "/@/store/modules/user";
|
|
|
|
import NoAuth from "/@/components/NoAuth/NoAuth.vue";
|
|
import NoAuth from "/@/components/NoAuth/NoAuth.vue";
|
|
-const { logout } = useNav();
|
|
|
|
|
|
+import contentConfig from "./config/content.config";
|
|
|
|
+import { PageContent } from "/@/components/PageContent";
|
|
|
|
+import { httpList } from "/@/api/InvoiceSales/invoiceApply";
|
|
|
|
+import { useResponseHandle, usePermission } from "/@/hooks";
|
|
|
|
+
|
|
defineOptions({
|
|
defineOptions({
|
|
name: "invoiceApply"
|
|
name: "invoiceApply"
|
|
});
|
|
});
|
|
-const powers = ref([]);
|
|
|
|
|
|
+
|
|
const initform = {
|
|
const initform = {
|
|
customer: "", //客户公司
|
|
customer: "", //客户公司
|
|
inv_out: "", //业务企业公司
|
|
inv_out: "", //业务企业公司
|
|
@@ -33,9 +31,10 @@ const initform = {
|
|
const form = reactive({ ...initform });
|
|
const form = reactive({ ...initform });
|
|
|
|
|
|
const { push } = useRouter();
|
|
const { push } = useRouter();
|
|
|
|
+const pageContentRef = ref<InstanceType<typeof PageContent>>(null);
|
|
|
|
+const responseHandle = useResponseHandle();
|
|
const dataList = ref([]);
|
|
const dataList = ref([]);
|
|
const loading = ref(false);
|
|
const loading = ref(false);
|
|
-const { columns } = useColumns();
|
|
|
|
|
|
|
|
const pagination = reactive<PaginationProps>({
|
|
const pagination = reactive<PaginationProps>({
|
|
total: 0,
|
|
total: 0,
|
|
@@ -44,24 +43,6 @@ const pagination = reactive<PaginationProps>({
|
|
background: true
|
|
background: true
|
|
});
|
|
});
|
|
|
|
|
|
-async function handleCurrentChange(val: number) {
|
|
|
|
- form.page = val;
|
|
|
|
- await onSearch();
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-async function handleSizeChange(val: number) {
|
|
|
|
- form.size = val;
|
|
|
|
- form.page = 1;
|
|
|
|
- await onSearch();
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-function handleSelectionChange(val) {
|
|
|
|
- console.log("handleSelectionChange", val);
|
|
|
|
-}
|
|
|
|
-function timeChange(start, end) {
|
|
|
|
- console.log(start);
|
|
|
|
- console.log(end);
|
|
|
|
-}
|
|
|
|
async function onSearch() {
|
|
async function onSearch() {
|
|
if (loading.value) return;
|
|
if (loading.value) return;
|
|
loading.value = true;
|
|
loading.value = true;
|
|
@@ -69,7 +50,6 @@ async function onSearch() {
|
|
responseHandle({
|
|
responseHandle({
|
|
code,
|
|
code,
|
|
message,
|
|
message,
|
|
- logout,
|
|
|
|
handler: () => {
|
|
handler: () => {
|
|
const { list, count } = data;
|
|
const { list, count } = data;
|
|
dataList.value = list ?? [];
|
|
dataList.value = list ?? [];
|
|
@@ -83,35 +63,35 @@ async function onSearch() {
|
|
}
|
|
}
|
|
async function resetSearch() {
|
|
async function resetSearch() {
|
|
form.page = 1;
|
|
form.page = 1;
|
|
- await onSearch();
|
|
|
|
|
|
+ // await onSearch();
|
|
|
|
+ // pageContentRef.getP
|
|
}
|
|
}
|
|
//新建/详情页面
|
|
//新建/详情页面
|
|
-function editItem(id) {
|
|
|
|
|
|
+const toDetail = (id?: string) => {
|
|
push({
|
|
push({
|
|
path: "/InvoiceSales/invoiceApplyDetail",
|
|
path: "/InvoiceSales/invoiceApplyDetail",
|
|
query: {
|
|
query: {
|
|
...(id ? { id } : {})
|
|
...(id ? { id } : {})
|
|
}
|
|
}
|
|
});
|
|
});
|
|
-}
|
|
|
|
|
|
+};
|
|
|
|
+
|
|
async function resetForm() {
|
|
async function resetForm() {
|
|
Object.keys(form).forEach(key => {
|
|
Object.keys(form).forEach(key => {
|
|
form[key] = initform[key];
|
|
form[key] = initform[key];
|
|
});
|
|
});
|
|
await onSearch();
|
|
await onSearch();
|
|
}
|
|
}
|
|
-
|
|
|
|
-onMounted(() => {
|
|
|
|
- powers.value = useUserStoreHook().getMenuActions("invoiceApply");
|
|
|
|
- if (powers.value.some(i => i == "001")) {
|
|
|
|
- onSearch();
|
|
|
|
- }
|
|
|
|
|
|
+const { permission, contentConfigRef } = usePermission({
|
|
|
|
+ pageName: "invoiceApply",
|
|
|
|
+ contentConfig,
|
|
|
|
+ callback: powers => (contentConfig.powers = powers)
|
|
});
|
|
});
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<template>
|
|
<template>
|
|
<div class="main">
|
|
<div class="main">
|
|
- <div v-if="powers.some(i => i == '001')">
|
|
|
|
|
|
+ <div v-if="permission.list">
|
|
<div class="bg-white p-4">
|
|
<div class="bg-white p-4">
|
|
<el-row :gutter="10" class="pb-4">
|
|
<el-row :gutter="10" class="pb-4">
|
|
<el-col :span="5">
|
|
<el-col :span="5">
|
|
@@ -148,7 +128,6 @@ onMounted(() => {
|
|
<IntervalTime
|
|
<IntervalTime
|
|
v-model:startValue="form.start"
|
|
v-model:startValue="form.start"
|
|
v-model:endValue="form.end"
|
|
v-model:endValue="form.end"
|
|
- @timeChange="timeChange"
|
|
|
|
/></el-col>
|
|
/></el-col>
|
|
<el-col :span="4">
|
|
<el-col :span="4">
|
|
<el-input
|
|
<el-input
|
|
@@ -198,52 +177,12 @@ onMounted(() => {
|
|
</el-row>
|
|
</el-row>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <TableProBar
|
|
|
|
- title="发票申请管理"
|
|
|
|
- :loading="loading"
|
|
|
|
- :dataList="dataList"
|
|
|
|
- @refresh="onSearch"
|
|
|
|
- >
|
|
|
|
- <template #buttons>
|
|
|
|
- <el-button
|
|
|
|
- type="primary"
|
|
|
|
- :icon="useRenderIcon('add')"
|
|
|
|
- @click="editItem('')"
|
|
|
|
- v-if="powers.some(i => i === '002')"
|
|
|
|
- >
|
|
|
|
- 新增发票申请
|
|
|
|
- </el-button>
|
|
|
|
- </template>
|
|
|
|
- <template v-slot="{ size, checkList }">
|
|
|
|
- <PureTable
|
|
|
|
- border
|
|
|
|
- align="left"
|
|
|
|
- showOverflowTooltip
|
|
|
|
- table-layout="auto"
|
|
|
|
- :size="size"
|
|
|
|
- :data="dataList"
|
|
|
|
- :columns="columns"
|
|
|
|
- :checkList="checkList"
|
|
|
|
- :pagination="pagination"
|
|
|
|
- :paginationSmall="size === 'small' ? true : false"
|
|
|
|
- :header-cell-style="{ background: '#fafafa', color: '#606266' }"
|
|
|
|
- @selection-change="handleSelectionChange"
|
|
|
|
- @size-change="handleSizeChange"
|
|
|
|
- @current-change="handleCurrentChange"
|
|
|
|
- >
|
|
|
|
- <template #operation="{ row }">
|
|
|
|
- <el-button
|
|
|
|
- class="reset-margin"
|
|
|
|
- link
|
|
|
|
- type="primary"
|
|
|
|
- :size="size"
|
|
|
|
- @click="editItem(row.invNo)"
|
|
|
|
- :icon="useRenderIcon('eye-view')"
|
|
|
|
- />
|
|
|
|
- </template>
|
|
|
|
- </PureTable>
|
|
|
|
- </template>
|
|
|
|
- </TableProBar>
|
|
|
|
|
|
+ <PageContent
|
|
|
|
+ ref="pageContentRef"
|
|
|
|
+ :content-config="contentConfigRef"
|
|
|
|
+ @preview-btn-click="({ invNo }) => toDetail(invNo)"
|
|
|
|
+ @create-btn-click="() => toDetail()"
|
|
|
|
+ />
|
|
</div>
|
|
</div>
|
|
<NoAuth v-else />
|
|
<NoAuth v-else />
|
|
</div>
|
|
</div>
|