Browse Source

feat:发票查询管理 销售开票状态

snow 2 years ago
parent
commit
5a316fa77e

+ 7 - 1
src/api/InvoiceSales/invoicePool/index.ts

@@ -18,7 +18,13 @@ export const httpList = (data: object): ResponseType => {
   return http.request("post", `${yewuApi}orderinvlist`, {
     data: {
       ...data,
-      status: "3"
+      status: "4"
     }
   });
 };
+
+export const httpInvList = (data: object): ResponseType => {
+  return http.request("post", `${yewuApi}orderinvlist`, {
+    data
+  });
+};

+ 10 - 9
src/views/InvoiceSales/invoiceApply/config/_details.ts

@@ -6,6 +6,7 @@ import { ElTable, ElTableColumn, ElTag } from "element-plus";
 import { DescriptionColumns } from "/@/components/BasicDescriptions";
 import { createTooltip } from "/@/utils/tootip";
 import { invoiceTypeList } from "/@/utils/status";
+import { INV_OPEN_STATUS } from "/@/utils/details/inv-open";
 
 export const INV_TYPE = [
   { value: "1", label: "纸质专用发票", type: "primary" },
@@ -20,15 +21,15 @@ export const OPEN_TYPE = [
   { value: "3", label: "纯线下" }
 ];
 
-export const INV_OPEN_STATUS = [
-  { value: "0", label: "待财务开票/待金税开票", type: "" },
-  { value: "1", label: "待财务审核", type: "warning" },
-  { value: "2", label: "开票中/验票", type: "warning" },
-  { value: "3", label: "开票完成", type: "warning" },
-  { value: "4", label: "财务驳回 ", type: "warning" },
-  { value: "5", label: "开票失败/开票驳回", type: "warning" },
-  { value: "6", label: "退票/废弃", type: "warning" }
-];
+// export const INV_OPEN_STATUS = [
+//   { value: "0", label: "待财务开票/待金税开票", type: "" },
+//   { value: "1", label: "待财务审核", type: "warning" },
+//   { value: "2", label: "开票中/验票", type: "warning" },
+//   { value: "3", label: "开票完成", type: "warning" },
+//   { value: "4", label: "财务驳回 ", type: "warning" },
+//   { value: "5", label: "开票失败/开票驳回", type: "warning" },
+//   { value: "6", label: "退票/废弃", type: "warning" }
+// ];
 
 export const invOpenColumns: DescriptionColumns = [
   {

+ 1 - 1
src/views/InvoiceSales/invoiceApply/detail.vue

@@ -58,7 +58,7 @@ const showApproval = computed(() => {
 //最大开票金额
 const showInvStatus = computed(() => {
   const { status } = invoiceDetail.value;
-  return ["3", "4", "6"].includes(String(status));
+  return ["4", "6"].includes(String(status));
 });
 
 //是否电子票

+ 80 - 42
src/views/invoice/query/components/sale-config/content.config.ts

@@ -1,87 +1,125 @@
-import { ContentConfig } from "/@/components/PageContent";
-import { httpList } from "/@/api/InvoiceSales/invoicePool";
-
-import dayjs from "dayjs";
 import { h } from "vue";
+import { ContentConfig } from "/@/components/PageContent";
+import { httpList } from "/@/api/InvoiceSales/invoiceApply";
+import { INV_OPEN_STATUS } from "/@/utils/details/inv-open";
+import {
+  invoiceTypeList,
+  seller_check_type,
+  buyer_check_type
+} from "/@/utils/status";
 import { ElTag } from "element-plus";
-import { invoiceTypeList } from "/@/utils/status";
+import dayjs from "dayjs";
 
 const columns = [
-  // {
-  //   type: "selection",
-  //   width: 55,
-  //   hide: ({ checkList }) => !checkList.includes("勾选列")
-  // },
-  // {
-  //   label: "序号",
-  //   type: "index",
-  //   width: 70,
-  //   hide: ({ checkList }) => !checkList.includes("序号列")
-  // },
   {
     label: "发票申请编号",
     prop: "invNo",
-    minWidth: 160
+    width: 155
   },
   {
     label: "业务企业编号",
     prop: "inv_out",
-    minWidth: 160
-  },
-  {
-    label: "业务公司名称",
-    prop: "inv_company",
-    minWidth: 160
+    width: 155
   },
   {
+    label: "客户公司名称",
     prop: "buyer_title",
-    label: "客户发票抬头",
-    minWidth: 160
+    width: 175
   },
   {
-    label: "税后金额",
+    label: "申请额度",
     prop: "inv_value",
     width: 110
   },
+  {
+    label: "状态",
+    prop: "status",
+    width: 125,
+    cellRenderer: ({ row }) => {
+      return h(ElTag, null, {
+        default: () => {
+          return (
+            INV_OPEN_STATUS.find(item => item.value == row.status + "")
+              ?.label || "--"
+          );
+        }
+      });
+    }
+  },
   {
     label: "发票类型",
-    width: 150,
-    cellRenderer({ row }) {
-      const current = invoiceTypeList.find(
-        i => i.value === String(row.inv_type)
-      );
-
+    prop: "status",
+    minWidth: 160,
+    cellRenderer: ({ row }) => {
+      return h(ElTag, null, {
+        default: () =>
+          invoiceTypeList.find(item => item.value == row.inv_type + "")
+            ?.label || "--"
+      });
+    }
+  },
+  {
+    label: "发票号码",
+    prop: "inv_number",
+    width: 130
+  },
+  {
+    label: "发票代码",
+    prop: "inv_code",
+    width: 100
+  },
+  {
+    label: "购买方抬头状态",
+    prop: "seller_check",
+    width: 130,
+    cellRenderer: ({ row }) => {
       return h(ElTag, null, {
-        default: () => current.label
+        default: () =>
+          seller_check_type.find(item => item.value == row.seller_check + "")
+            ?.label || "--"
       });
     }
   },
+  {
+    label: "销售方抬头状态",
+    prop: "buyer_check",
+    width: 130,
+    cellRenderer: ({ row }) => {
+      return h(ElTag, null, {
+        default: () =>
+          buyer_check_type.find(item => item.value == row.buyer_check + "")
+            ?.label || "--"
+      });
+    }
+  },
+
   {
     label: "申请人",
     prop: "apply_name",
     width: 80
   },
   {
-    label: "申请时间",
-    width: 170,
-    prop: "addtime",
-    formatter: ({ addtime }) =>
-      addtime ? dayjs(addtime).format("YYYY-MM-DD HH:mm:ss") : ""
+    label: "创建时间",
+    width: 140,
+    prop: "addtime"
   },
   {
     label: "操作",
     fixed: "right",
-    width: 55,
+    width: 80,
     slot: "operation"
   }
 ];
 
 const contentConfig: ContentConfig = {
-  title: "发票公海池",
-  inv: true,
+  title: "发票申请管理",
   columns,
+  superUserNoAction: true,
+  companyProp: "inv_out",
+  notPreview: true,
   apis: {
-    httpList
+    httpList,
+    httpAdd: true
   }
 };
 

+ 18 - 6
src/views/invoice/query/components/sale-config/search.config.ts

@@ -1,16 +1,34 @@
 import { FormConfig } from "/@/components/PageSearch";
+import { INV_OPEN_STATUS } from "/@/utils/details/inv-open";
 import { xs_inv_type_list } from "/@/utils/status";
 
 const searchFormConfig: FormConfig = {
+  colLayout: { span: 8 },
   formItems: [
     {
       field: "invNo",
       type: "input",
+      span: 4,
       placeholder: "发票申请编号"
     },
+    {
+      field: "status",
+      type: "select",
+      placeholder: "状态",
+      span: 4,
+      options: INV_OPEN_STATUS
+    },
+    {
+      field: "inv_type",
+      type: "select",
+      span: 4,
+      placeholder: "发票类型",
+      options: xs_inv_type_list
+    },
     {
       field: "timer",
       type: "date_picker",
+      span: 4,
       otherOptions: {
         type: "daterange",
         startProp: "start",
@@ -18,12 +36,6 @@ const searchFormConfig: FormConfig = {
         startPlaceholder: "申请开始时间",
         endPlaceholder: "申请结束时间"
       }
-    },
-    {
-      field: "inv_type",
-      type: "select",
-      placeholder: "发票类型",
-      options: xs_inv_type_list
     }
   ]
 };

+ 15 - 9
src/views/invoice/query/components/sale.vue

@@ -1,9 +1,12 @@
 <script setup lang="ts">
 import { ref } from "vue";
-import { usePageSearch, type PageHooks, type PageEvents } from "/@/hooks/page";
+import { usePageSearch, type PageHooks } from "/@/hooks/page";
 import contentConfig from "./sale-config/content.config";
 import searchConfig from "./sale-config/search.config";
 import InvoiceModal from "./components/invoice-modal.vue";
+import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
+
+const invStatus = ["4", "6"];
 
 const PageName = "query";
 const invoiceModalRef = ref<InstanceType<typeof InvoiceModal> | null>(null);
@@ -11,22 +14,25 @@ const invoiceModalRef = ref<InstanceType<typeof InvoiceModal> | null>(null);
 const hooks: PageHooks = {
   pageSearchHook: () => usePageSearch(undefined, undefined, searchConfig)
 };
-
-const events: PageEvents = {
-  content: {
-    preview: ({ inv_number }) => invoiceModalRef.value.onDisplay(inv_number)
-  }
-};
 </script>
 
 <template>
   <PageAuth :pageName="PageName">
     <PageContainer
       :hooks="hooks"
-      :events="events"
       :contentConfig="contentConfig"
       :search-config="searchConfig"
-    />
+    >
+      <template #content_action="row">
+        <ElButton
+          v-if="invStatus.includes(String(row.status))"
+          link
+          type="primary"
+          :icon="useRenderIcon('scaletooriginal')"
+          @click="() => invoiceModalRef.onDisplay(row.inv_number)"
+        />
+      </template>
+    </PageContainer>
     <InvoiceModal ref="invoiceModalRef" />
   </PageAuth>
 </template>