瀏覽代碼

Merge branch 'dev' into sit

snow 2 年之前
父節點
當前提交
ed7755de45
共有 88 個文件被更改,包括 1335 次插入1419 次删除
  1. 1 1
      src/api/InvoiceSales/invoicePool/index.ts
  2. 24 0
      src/api/InvoiceSales/redInk/index.ts
  3. 1 1
      src/api/InvoiceSales/returnTicket/index.ts
  4. 2 0
      src/components/BasicDescriptions/src/basic-descriptions.tsx
  5. 0 0
      src/components/PageDetails/index.ts
  6. 4 5
      src/components/RemoteSelect/src/remote-select.tsx
  7. 1 0
      src/hooks/index.ts
  8. 9 2
      src/hooks/permission/use-permission.ts
  9. 70 0
      src/hooks/response/use-response-handle.ts
  10. 1 1
      src/router/utils.ts
  11. 60 7
      src/utils/details/inv-open.ts
  12. 11 7
      src/utils/details/inv-return.ts
  13. 7 3
      src/utils/details/purchPay.ts
  14. 19 15
      src/utils/details/purchase.ts
  15. 5 1
      src/utils/details/reconciliation.ts
  16. 35 32
      src/utils/details/refund.ts
  17. 15 11
      src/utils/details/sale.ts
  18. 78 74
      src/utils/details/ticket-return.ts
  19. 5 1
      src/utils/details/trade.ts
  20. 9 3
      src/utils/details/tragelog.ts
  21. 1 1
      src/views/InvoiceSaleSettings/consultingCost/config/search.config.ts
  22. 21 33
      src/views/InvoiceSales/capitalClaim/components/basic-claim/sales-modal.vue
  23. 30 28
      src/views/InvoiceSales/capitalClaim/detail.vue
  24. 0 72
      src/views/InvoiceSales/capitalPool/config/configs.ts
  25. 11 2
      src/views/InvoiceSales/capitalPool/config/content.config.ts
  26. 9 27
      src/views/InvoiceSales/capitalPool/config/search.config.ts
  27. 2 2
      src/views/InvoiceSales/capitalPool/detail.vue
  28. 10 15
      src/views/InvoiceSales/invoiceApply/columns.tsx
  29. 64 252
      src/views/InvoiceSales/invoiceApply/components/add-edit-form/add-edit-form.vue
  30. 56 2
      src/views/InvoiceSales/invoiceApply/components/add-edit-form/columns.tsx
  31. 28 6
      src/views/InvoiceSales/invoiceApply/components/add-edit-form/edit-order.vue
  32. 0 0
      src/views/InvoiceSales/invoiceApply/components/add-edit-form/invoice-show.vue
  33. 20 0
      src/views/InvoiceSales/invoiceApply/components/add-edit-form/invoice-title.vue
  34. 0 22
      src/views/InvoiceSales/invoiceApply/components/add-edit-form/order-dialog.vue
  35. 51 34
      src/views/InvoiceSales/invoiceApply/components/approval-process/src/upload-invoice.vue
  36. 2 2
      src/views/InvoiceSales/invoiceApply/components/invoice-detail/index.vue
  37. 60 7
      src/views/InvoiceSales/invoiceApply/config/configs.ts
  38. 38 30
      src/views/InvoiceSales/invoiceApply/detail.vue
  39. 7 6
      src/views/InvoiceSales/invoiceApply/index.vue
  40. 10 17
      src/views/InvoiceSales/invoicePool/config/search.config.ts
  41. 19 51
      src/views/InvoiceSales/invoicePool/detail-dialog.vue
  42. 95 0
      src/views/InvoiceSales/redInk/components/create-redink/index.vue
  43. 62 0
      src/views/InvoiceSales/redInk/config/content.config.ts
  44. 23 0
      src/views/InvoiceSales/redInk/config/search.config.ts
  45. 46 0
      src/views/InvoiceSales/redInk/index.vue
  46. 26 21
      src/views/InvoiceSales/refund/components/create-refund/capital-modal.vue
  47. 2 2
      src/views/InvoiceSales/refund/components/create-refund/index.vue
  48. 2 6
      src/views/InvoiceSales/refund/components/refund-detail/index.vue
  49. 0 200
      src/views/InvoiceSales/refund/config/configs.ts
  50. 6 4
      src/views/InvoiceSales/refund/config/content.config.ts
  51. 3 3
      src/views/InvoiceSales/refund/config/search.config.ts
  52. 10 16
      src/views/InvoiceSales/refund/index.vue
  53. 2 6
      src/views/InvoiceSales/returnTicket/components/approval-process/approval-pending.vue
  54. 0 0
      src/views/InvoiceSales/returnTicket/components/create-return-ticket/capital-modal.vue
  55. 4 4
      src/views/InvoiceSales/returnTicket/components/create-return-ticket/index.vue
  56. 2 2
      src/views/InvoiceSales/returnTicket/components/refund-detail/index.vue
  57. 1 13
      src/views/InvoiceSales/returnTicket/config/configs.ts
  58. 2 47
      src/views/InvoiceSales/returnTicket/config/content.config.ts
  59. 3 3
      src/views/InvoiceSales/returnTicket/config/search.config.ts
  60. 29 73
      src/views/InvoiceSales/returnTicket/detail.vue
  61. 8 8
      src/views/InvoiceSales/returnTicket/index.vue
  62. 41 0
      src/views/InvoiceSales/sheetOrderPool/config/content.config.ts
  63. 21 20
      src/views/InvoiceSales/sheetOrderPool/config/search.config.ts
  64. 9 15
      src/views/InvoiceSales/sheetOrderPool/detail-dialog.vue
  65. 16 1
      src/views/InvoiceSales/sheetOrderPool/index.vue
  66. 10 5
      src/views/interest/processPermission/components/process-list.vue
  67. 15 1
      src/views/login/utils/rule.ts
  68. 3 2
      src/views/parameter/clients/index.vue
  69. 3 2
      src/views/parameter/finance/index.vue
  70. 23 12
      src/views/parameter/invoiceheader/index.vue
  71. 3 2
      src/views/parameter/setProcess/index.vue
  72. 3 2
      src/views/parameter/supplierPay/index.vue
  73. 3 2
      src/views/parameter/tagManage/index.vue
  74. 7 37
      src/views/purchase/orderRecord/components/statement-detail/statement-detail.vue
  75. 7 53
      src/views/purchase/porder/preview-dialog.vue
  76. 0 1
      src/views/purchase/ticketReturn/components/create-ticket-dialog/create-ticket-dialog.vue
  77. 7 41
      src/views/purchase/ticketReturn/components/ticket-detail/index.vue
  78. 2 2
      src/views/search/standBook/details/inv-open.vue
  79. 2 2
      src/views/search/standBook/details/inv-return.vue
  80. 2 2
      src/views/search/standBook/details/purchase.vue
  81. 2 2
      src/views/search/standBook/details/reconciliation.vue
  82. 2 2
      src/views/search/standBook/details/refund.vue
  83. 2 2
      src/views/search/standBook/details/sale.vue
  84. 2 2
      src/views/search/standBook/details/ticket-return.vue
  85. 1 1
      src/views/search/standBook/details/trade.vue
  86. 2 2
      src/views/search/standBook/details/tradelog.vue
  87. 0 5
      src/views/system/setBtn/components/menu-tree.vue
  88. 25 20
      src/views/system/setBtn/index.vue

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

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

+ 24 - 0
src/api/InvoiceSales/redInk/index.ts

@@ -0,0 +1,24 @@
+import { http } from "/@/utils/http";
+import { loadEnv } from "@build/index";
+const { VITE_PROXY_DOMAIN_REAL, VITE_PROXY_USER_REAL } = loadEnv();
+const userAPi = VITE_PROXY_DOMAIN_REAL;
+const yewuApi = VITE_PROXY_USER_REAL + "/admin/";
+interface ResponseType extends Promise<any> {
+  data?: object;
+  code?: number;
+  message?: string;
+}
+
+// 列表
+export const httpList = (data: object): ResponseType => {
+  return http.request("post", `${yewuApi}redlist`, {
+    data
+  });
+};
+
+//批量红冲
+export const httpBatchapplyred = (data: object): ResponseType => {
+  return http.request("post", `${yewuApi}batchapplyred`, {
+    data
+  });
+};

+ 1 - 1
src/api/InvoiceSales/returnTicket/index.ts

@@ -28,7 +28,7 @@ export const httpDetail = (data: object): ResponseType => {
 
 //退票状态
 export const httpStatus = (data: object): ResponseType => {
-  return http.request("post", `${yewuApi}returninvinfo`, {
+  return http.request("post", `${yewuApi}invreturnstatus`, {
     data
   });
 };

+ 2 - 0
src/components/BasicDescriptions/src/basic-descriptions.tsx

@@ -9,6 +9,8 @@ const BasicDescriptions = defineComponent({
     return () => {
       const { title, colNumber, columns, data, labelWidth } = props;
 
+      console.log(data);
+
       return (
         <ElDescriptions title={title} border column={colNumber} size="small">
           {columns.map(col => (

+ 0 - 0
src/components/PageDetails/index.ts


+ 4 - 5
src/components/RemoteSelect/src/remote-select.tsx

@@ -7,7 +7,7 @@ import { useResponseHandle } from "/@/hooks";
 const RemoteSelect = defineComponent({
   name: "RemoteSelect",
   props: RemoteSelectProps,
-  emits: ["listChange", "itemChange"],
+  emits: ["listChange", "itemChange", "itenDetail"],
   setup(props, { emit }) {
     const value = useVModel(props, "value");
 
@@ -20,7 +20,6 @@ const RemoteSelect = defineComponent({
     async function remoteMethod(val: string) {
       if (!val) return;
       const { responseLabelProp, responseValProp, requestProp, api } = props;
-      console.log(requestProp);
 
       loading.value = true;
       const { code, data, message } = await api({
@@ -56,12 +55,12 @@ const RemoteSelect = defineComponent({
         filterable
         clearable
         remote
-        onChange={val =>
+        onChange={val => {
           emit(
             "itemChange",
             list.value.find(i => i.value === val)
-          )
-        }
+          );
+        }}
       >
         {list.value.map((item, index) => (
           <ElOption label={item.label} key={index} value={item.value} />

+ 1 - 0
src/hooks/index.ts

@@ -1,3 +1,4 @@
+export { useAsync } from "./response/use-response-handle";
 export { usePermission } from "./permission/use-permission";
 export { useResponseHandle } from "./response/use-response-handle";
 export { useReviewProcess } from "./process/use-review-process";

+ 9 - 2
src/hooks/permission/use-permission.ts

@@ -1,26 +1,33 @@
 import { computed, onMounted, ref, unref } from "vue";
+import { ContentConfig } from "/@/components/PageContent";
 import { useUserStoreHook } from "/@/store/modules/user";
 
 type Params = {
   pageName: string;
   callback: (permissions: Array<string>) => void;
+  contentConfig: ContentConfig;
 };
 
-export function usePermission({ pageName, callback }: Params) {
+export function usePermission({ pageName, callback, contentConfig }: Params) {
   const permissions = ref<Array<string>>([]);
+  const contentConfigRef = computed(() => contentConfig);
 
   const permission = computed(() => {
     return {
-      list: permissions.value.some(i => i === "001")
+      list: permissions.value.some(i => i === "001"),
+      create: permissions.value.some(i => i === "002")
     };
   });
 
   onMounted(() => {
     permissions.value = useUserStoreHook().getMenuActions(pageName);
+
+    console.log(permissions.value);
     callback(unref(permissions));
   });
 
   return {
+    contentConfigRef,
     permissions,
     permission
   };

+ 70 - 0
src/hooks/response/use-response-handle.ts

@@ -1,3 +1,4 @@
+import { ref, reactive } from "vue";
 import { ElMessage } from "element-plus";
 import { useNav } from "/@/layout/hooks/nav";
 
@@ -23,3 +24,72 @@ export function useResponseHandle() {
 
   return responseHandle;
 }
+
+interface ResponseType<D> {
+  data: D;
+  message: string;
+  code: number;
+}
+
+export function useAsync<D>({
+  initalData,
+  initalPagination,
+  isList = false,
+  success,
+  fall
+}: {
+  initalData?: D;
+  isList?: boolean;
+  initalPagination?: any;
+  success?: () => void;
+  fall?: () => void;
+}) {
+  const data = ref<D>(initalData);
+  const loading = ref(false);
+  const pagination = reactive(initalPagination);
+  const responseHandle = useResponseHandle();
+
+  const setData = (_data: D) => (data.value = _data as any);
+  const setloading = (state: boolean) => (loading.value = state);
+
+  function getPaginationParams() {
+    const { pageSize: size, currentPage: page } = pagination;
+    return {
+      size,
+      page
+    };
+  }
+
+  function run(promise: Promise<ResponseType<D>>) {
+    setloading(true);
+
+    return promise
+      .then(response => {
+        setloading(false);
+
+        const { code, message, data } = response;
+
+        responseHandle({
+          code,
+          message,
+          handler: () => {
+            setData(isList ? (data as any).list : data);
+            pagination.total = (data as any).count;
+            success && success();
+          }
+        });
+      })
+      .catch(() => {
+        fall && fall();
+      });
+  }
+
+  return {
+    run,
+    data,
+    loading,
+    pagination,
+    setData,
+    getPaginationParams
+  };
+}

+ 1 - 1
src/router/utils.ts

@@ -286,7 +286,7 @@ function addAsyncRoutes(arrRoutes: Array<RouteRecordRaw>) {
       // 对后端传component组件路径和不传做兼容(如果后端传component组件路径,那么path可以随便写,如果不传,component组件路径会根path保持一致)
       const index = v?.component
         ? // @ts-expect-error
-          modulesRoutesKeys.findIndex(ev => ev.includes(v.component))
+        modulesRoutesKeys.findIndex(ev => ev.includes(v.component))
         : modulesRoutesKeys.findIndex(ev => ev.includes(v.path));
       v.component = modulesRoutes[modulesRoutesKeys[index]];
     }

+ 60 - 7
src/utils/details/inv-open.ts

@@ -1,14 +1,35 @@
+/**
+ * 开票申请详情
+ */
+
 import { ElTag } from "element-plus";
 import { h } from "vue";
 import { DescriptionColumns } from "/@/components/BasicDescriptions";
 
-const inv_type_list = [
+export const INV_TYPE = [
   { value: "1", label: "纸质专用发票", type: "primary" },
   { value: "2", label: "纸质普通发票", type: "success" },
   { value: "3", label: "电子专用发票", type: "primary" },
   { value: "4", label: "电子普通发票", type: "success" }
 ];
-export const inv_open_columns: DescriptionColumns = [
+
+export const OPEN_TYPE = [
+  { value: "1", label: "金税开票" },
+  { value: "2", label: "金税线下" },
+  { value: "3", label: "纯线下" }
+];
+
+export const INV_OPEN_STATUS = [
+  { value: "0", label: "待财务开票", type: "primary" },
+  { 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_COLUMNS: DescriptionColumns = [
   {
     field: "invNo",
     label: "发票编号"
@@ -29,22 +50,54 @@ export const inv_open_columns: DescriptionColumns = [
     field: "apply_name",
     label: "申请人"
   },
+  {
+    field: "status",
+    label: "开票状态",
+    render(data) {
+      return h(
+        ElTag,
+        {
+          type: INV_OPEN_STATUS.find(s => s.value === data)?.type as any
+        },
+        {
+          default: () =>
+            INV_OPEN_STATUS.find(s => s.value === data)?.label || "--"
+        }
+      );
+    }
+  },
   {
     field: "inv_type",
     label: "发票类型",
     render(data) {
-      return h(ElTag, null, {
-        default: () => inv_type_list.find(t => t.value === data)?.label
-      });
+      return h(
+        ElTag,
+        {
+          type: INV_TYPE.find(s => s.value === data)?.type as any
+        },
+        {
+          default: () => INV_TYPE.find(t => t.value === data)?.label || "--"
+        }
+      );
     }
   },
   {
     field: "open_type",
-    label: "开票方式"
+    label: "开票方式",
+    render(data) {
+      return h(ElTag, null, {
+        default: () => OPEN_TYPE.find(t => t.value === data)?.label || "--"
+      });
+    }
   },
   {
     field: "is_ticket",
-    label: "是否支持金税"
+    label: "是否支持金税",
+    render(data) {
+      return h(ElTag, null, {
+        default: () => (data === "0" ? "不支持" : "支持")
+      });
+    }
   },
   {
     field: "exam_remark",

+ 11 - 7
src/utils/details/inv-return.ts

@@ -1,8 +1,12 @@
+/**
+ *  退票详情
+ */
+
 import { ElTag } from "element-plus";
 import { h } from "vue";
 import { DescriptionColumns } from "/@/components/BasicDescriptions";
 
-export const return_type = [
+export const RETURN_TYPE = [
   {
     value: "1",
     label: "金税"
@@ -13,7 +17,7 @@ export const return_type = [
   }
 ];
 
-export const return_status = [
+export const RETURN_STATUS = [
   {
     value: "0",
     label: "待审核"
@@ -36,7 +40,7 @@ export const return_status = [
   }
 ];
 
-const open_type = [
+const OPEN_TYPE = [
   {
     value: "0",
     label: "金税开票"
@@ -51,7 +55,7 @@ const open_type = [
   }
 ];
 
-export const inv_return_columns: DescriptionColumns = [
+export const INV_RETURN_COLUMNS: DescriptionColumns = [
   {
     field: "returnCode",
     label: "退票编号"
@@ -69,7 +73,7 @@ export const inv_return_columns: DescriptionColumns = [
     label: "退票方式",
     render(data) {
       return h(ElTag, null, {
-        default: () => return_type.find(t => t.value === data)?.label
+        default: () => RETURN_TYPE.find(t => t.value === data)?.label
       });
     }
   },
@@ -82,7 +86,7 @@ export const inv_return_columns: DescriptionColumns = [
     label: "退票状态",
     render(data) {
       return h(ElTag, null, {
-        default: () => return_status.find(t => t.value === data)?.label
+        default: () => RETURN_STATUS.find(t => t.value === data)?.label
       });
     }
   },
@@ -107,7 +111,7 @@ export const inv_return_columns: DescriptionColumns = [
     label: "开票类型",
     render(data) {
       return h(ElTag, null, {
-        default: () => open_type.find(t => t.value === data)?.label
+        default: () => OPEN_TYPE.find(t => t.value === data)?.label || "--"
       });
     }
   },

+ 7 - 3
src/utils/details/purchPay.ts

@@ -1,8 +1,12 @@
+/**
+ * 采购单付款
+ */
+
 import { ElImage, ElTag } from "element-plus";
 import { h } from "vue";
 import { DescriptionColumns } from "/@/components/BasicDescriptions";
 
-export const statusOptions = [
+export const STATUS_OPTIONS = [
   {
     label: "待发起流程",
     value: "0"
@@ -29,7 +33,7 @@ export const statusOptions = [
   }
 ];
 
-export const paymentOptions = [
+export const PAYMENT_STATUS = [
   {
     label: "待发起",
     value: "0"
@@ -99,7 +103,7 @@ export const purchpay_columns: DescriptionColumns = [
     label: "状态",
     render(status) {
       return h(ElTag, null, {
-        default: () => statusOptions.find(s => status === s.value)?.label
+        default: () => STATUS_OPTIONS.find(s => status === s.value)?.label
       });
     }
   },

+ 19 - 15
src/utils/details/purchase.ts

@@ -1,9 +1,13 @@
+/**
+ * 采购单详情
+ */
+
 import { ElTag } from "element-plus";
 import { h } from "vue";
 import { send_status_list } from "../status";
 import { DescriptionColumns } from "/@/components/BasicDescriptions";
 
-export const cgd_status = [
+export const PURCHASE_STATUS = [
   {
     value: "0",
     label: "未对账"
@@ -14,7 +18,7 @@ export const cgd_status = [
   }
 ];
 
-export const cgd_type = [
+export const PURCHASE_TYPE = [
   {
     value: "1",
     label: "库存"
@@ -29,7 +33,7 @@ export const cgd_type = [
   }
 ];
 
-export const cgd_source = [
+export const PURCHAS_SOURCE = [
   {
     value: "1",
     label: "直接下单"
@@ -52,7 +56,7 @@ export const cgd_source = [
   }
 ];
 
-export const product_type = [
+export const PRODUCT_TYPE = [
   {
     value: "1",
     label: "正常商品"
@@ -67,7 +71,7 @@ export const product_type = [
   }
 ];
 
-export const send_type = [
+export const SEND_TYPE = [
   {
     value: "1",
     label: "包邮"
@@ -78,7 +82,7 @@ export const send_type = [
   }
 ];
 
-export const pay_status = [
+export const PAY_STATUS = [
   {
     value: "1",
     label: "未付款"
@@ -93,7 +97,7 @@ export const pay_status = [
   }
 ];
 
-export const inv_status = [
+export const INV_STATUS = [
   {
     value: "1",
     label: "未回票"
@@ -108,7 +112,7 @@ export const inv_status = [
   }
 ];
 
-export const purchase_columns: DescriptionColumns = [
+export const PURCHAS_COLUMNS: DescriptionColumns = [
   {
     label: "采购单名称",
     field: "name"
@@ -134,7 +138,7 @@ export const purchase_columns: DescriptionColumns = [
     field: "status",
     render(type) {
       return h(ElTag, null, {
-        default: () => cgd_status.find(c => c.value === type)?.label
+        default: () => PURCHASE_STATUS.find(c => c.value === type)?.label
       });
     }
   },
@@ -143,7 +147,7 @@ export const purchase_columns: DescriptionColumns = [
     field: "cgdType",
     render(type) {
       return h(ElTag, null, {
-        default: () => cgd_type.find(c => c.value === type)?.label
+        default: () => PURCHASE_TYPE.find(c => c.value === type)?.label
       });
     }
   },
@@ -152,7 +156,7 @@ export const purchase_columns: DescriptionColumns = [
     field: "cgdSource",
     render(type) {
       return h(ElTag, null, {
-        default: () => cgd_source.find(c => c.value === type)?.label
+        default: () => PURCHAS_SOURCE.find(c => c.value === type)?.label
       });
     }
   },
@@ -189,7 +193,7 @@ export const purchase_columns: DescriptionColumns = [
     field: "goodType",
     render(type) {
       return h(ElTag, null, {
-        default: () => product_type.find(c => c.value === type)?.label
+        default: () => PRODUCT_TYPE.find(c => c.value === type)?.label
       });
     }
   },
@@ -319,7 +323,7 @@ export const purchase_columns: DescriptionColumns = [
     field: "sendType",
     render(type) {
       return h(ElTag, null, {
-        default: () => send_type.find(c => c.value === type)?.label
+        default: () => SEND_TYPE.find(c => c.value === type)?.label
       });
     }
   },
@@ -353,7 +357,7 @@ export const purchase_columns: DescriptionColumns = [
     field: "pay_status",
     render(type) {
       return h(ElTag, null, {
-        default: () => pay_status.find(c => c.value === type)?.label
+        default: () => PAY_STATUS.find(c => c.value === type)?.label
       });
     }
   },
@@ -362,7 +366,7 @@ export const purchase_columns: DescriptionColumns = [
     field: "inv_status",
     render(type) {
       return h(ElTag, null, {
-        default: () => inv_status.find(c => c.value === type)?.label
+        default: () => INV_STATUS.find(c => c.value === type)?.label
       });
     }
   },

+ 5 - 1
src/utils/details/reconciliation.ts

@@ -1,8 +1,12 @@
+/**
+ * 对账详情
+ */
+
 import { ElTag } from "element-plus";
 import { h } from "vue";
 import { DescriptionColumns } from "/@/components/BasicDescriptions";
 
-export const reconciliation_detail_columns: DescriptionColumns = [
+export const RECONCILIATION_COLUMNS: DescriptionColumns = [
   {
     field: "payNo",
     label: "对账单号"

+ 35 - 32
src/utils/details/refund.ts

@@ -1,9 +1,40 @@
+/**
+ * 资金退款详情
+ */
+
 import { ElImage, ElTag } from "element-plus";
 import { h } from "vue";
 import { DescriptionColumns } from "/@/components/BasicDescriptions";
 
-//资金退款列数据
-export const refund_detail_columns: DescriptionColumns = [
+//退款类型
+export const RETRUN_TYPE = [
+  {
+    value: "1",
+    label: "退款"
+  },
+  {
+    value: "2",
+    label: "资金认领解除"
+  }
+];
+
+//退款状态
+export const RETRUN_STATUS = [
+  {
+    value: "0",
+    label: "待审核"
+  },
+  {
+    value: "1",
+    label: "财务审核"
+  },
+  {
+    value: "2",
+    label: "财务驳回"
+  }
+];
+
+export const REFOUD_COLUMNS: DescriptionColumns = [
   {
     label: "退款编号",
     field: "returnCode"
@@ -21,7 +52,7 @@ export const refund_detail_columns: DescriptionColumns = [
     field: "type",
     render(type) {
       return h(ElTag, null, {
-        default: () => return_type.find(t => t.value === type)?.label
+        default: () => RETRUN_TYPE.find(t => t.value === type)?.label
       });
     }
   },
@@ -58,7 +89,7 @@ export const refund_detail_columns: DescriptionColumns = [
     field: "status",
     render(status) {
       return h(ElTag, null, {
-        default: () => return_status.find(s => s.value === status)?.label
+        default: () => RETRUN_STATUS.find(s => s.value === status)?.label
       });
     }
   },
@@ -99,31 +130,3 @@ export const refund_detail_columns: DescriptionColumns = [
     field: "log_apply_id"
   }
 ];
-
-//退款类型
-export const return_type = [
-  {
-    value: "1",
-    label: "退款"
-  },
-  {
-    value: "2",
-    label: "资金认领解除"
-  }
-];
-
-//退款状态
-export const return_status = [
-  {
-    value: "0",
-    label: "待审核"
-  },
-  {
-    value: "1",
-    label: "财务审核"
-  },
-  {
-    value: "2",
-    label: "财务驳回"
-  }
-];

+ 15 - 11
src/utils/details/sale.ts

@@ -1,9 +1,13 @@
+/**
+ * 销售单详情
+ */
+
 import { ElTag } from "element-plus";
 import { h } from "vue";
-import { send_type } from "./purchase";
+import { SEND_TYPE } from "./purchase";
 import { DescriptionColumns } from "/@/components/BasicDescriptions";
 
-export const sale_status = [
+export const SALE_STATUS = [
   {
     value: "0",
     label: "未核销"
@@ -18,7 +22,7 @@ export const sale_status = [
   }
 ];
 
-export const sale_good_type = [
+export const SALE_GOOD_TYPE = [
   {
     value: "1",
     label: "正常商品"
@@ -33,7 +37,7 @@ export const sale_good_type = [
   }
 ];
 
-const pay_status = [
+const PAY_STATUS = [
   {
     value: "1",
     label: "未回款"
@@ -48,7 +52,7 @@ const pay_status = [
   }
 ];
 
-const inv_status = [
+const INV_STATUS = [
   {
     value: "1",
     label: "未开票"
@@ -63,7 +67,7 @@ const inv_status = [
   }
 ];
 
-export const sale_detail_columns: DescriptionColumns = [
+export const SALE_COLUMNS: DescriptionColumns = [
   {
     field: "sequenceNo",
     label: "销售单编号"
@@ -85,7 +89,7 @@ export const sale_detail_columns: DescriptionColumns = [
     label: "状态",
     render(data) {
       return h(ElTag, null, {
-        default: () => sale_status.find(s => s.value === data)?.label
+        default: () => SALE_STATUS.find(s => s.value === data)?.label
       });
     }
   },
@@ -142,7 +146,7 @@ export const sale_detail_columns: DescriptionColumns = [
     label: "商品类型",
     render(data) {
       return h(ElTag, null, {
-        default: () => sale_good_type.find(t => t.value === data)?.label
+        default: () => SALE_GOOD_TYPE.find(t => t.value === data)?.label
       });
     }
   },
@@ -220,7 +224,7 @@ export const sale_detail_columns: DescriptionColumns = [
     label: "发货方式",
     render(data) {
       return h(ElTag, null, {
-        default: () => send_type.find(t => t.value === data)?.label
+        default: () => SEND_TYPE.find(t => t.value === data)?.label
       });
     }
   },
@@ -229,7 +233,7 @@ export const sale_detail_columns: DescriptionColumns = [
     label: "开票状态",
     render(data) {
       return h(ElTag, null, {
-        default: () => inv_status.find(t => t.value === data)?.label
+        default: () => INV_STATUS.find(t => t.value === data)?.label
       });
     }
   },
@@ -238,7 +242,7 @@ export const sale_detail_columns: DescriptionColumns = [
     label: "付款状态",
     render(data) {
       return h(ElTag, null, {
-        default: () => pay_status.find(t => t.value === data)?.label
+        default: () => PAY_STATUS.find(t => t.value === data)?.label
       });
     }
   },

+ 78 - 74
src/utils/details/ticket-return.ts

@@ -1,8 +1,83 @@
+/**
+ * 采购回票详情
+ */
+
 import { ElImage, ElTag } from "element-plus";
 import { h } from "vue";
 import { DescriptionColumns } from "/@/components/BasicDescriptions";
 
-export const ticket_return_columns: DescriptionColumns = [
+export const INV_TYPE = [
+  {
+    label: "手工开票",
+    value: "1"
+  },
+  {
+    label: "ocr识别",
+    value: "2"
+  },
+  {
+    label: "金税",
+    value: "3"
+  }
+];
+
+//发票状态的options
+export const STATUS_OPTIONS = [
+  {
+    label: "上传发票",
+    value: "0"
+  },
+  {
+    label: "待识别验证",
+    value: "1"
+  },
+  {
+    label: "待校验识别",
+    value: "2"
+  },
+  {
+    label: "待财务审核",
+    value: "3"
+  },
+  {
+    label: "待认证",
+    value: "4"
+  },
+  {
+    label: "认证成功待确认",
+    value: "5"
+  },
+  {
+    label: "回票完成",
+    value: "6"
+  },
+  {
+    label: "识别失败",
+    value: "7"
+  },
+  {
+    label: "验证失败",
+    value: "8"
+  },
+  {
+    label: "财务驳回",
+    value: "9"
+  },
+  {
+    label: "认证失败",
+    value: "10"
+  },
+  {
+    label: "校验超过次数第二天校验",
+    value: "11"
+  },
+  {
+    label: "回票申请废弃已结束",
+    value: "12"
+  }
+];
+
+export const TICKET_RETURN_COLUMNS: DescriptionColumns = [
   {
     field: "payNo",
     label: "对账编号"
@@ -20,7 +95,7 @@ export const ticket_return_columns: DescriptionColumns = [
     label: "发票申请类型",
     render(data) {
       return h(ElTag, null, {
-        default: () => inv_type.find(s => s.value === data)?.label
+        default: () => INV_TYPE.find(s => s.value === data)?.label
       });
     }
   },
@@ -58,7 +133,7 @@ export const ticket_return_columns: DescriptionColumns = [
     label: "状态",
     render(data) {
       return h(ElTag, null, {
-        default: () => status_options.find(s => s.value === data)?.label
+        default: () => STATUS_OPTIONS.find(s => s.value === data)?.label
       });
     }
   },
@@ -103,74 +178,3 @@ export const ticket_return_columns: DescriptionColumns = [
     label: "对账申请总额"
   }
 ];
-
-export const inv_type = [
-  {
-    label: "手工开票",
-    value: "1"
-  },
-  {
-    label: "ocr识别",
-    value: "2"
-  },
-  {
-    label: "金税",
-    value: "3"
-  }
-];
-
-//发票状态的options
-export const status_options = [
-  {
-    label: "上传发票",
-    value: "0"
-  },
-  {
-    label: "待识别验证",
-    value: "1"
-  },
-  {
-    label: "待校验识别",
-    value: "2"
-  },
-  {
-    label: "待财务审核",
-    value: "3"
-  },
-  {
-    label: "待认证",
-    value: "4"
-  },
-  {
-    label: "认证成功待确认",
-    value: "5"
-  },
-  {
-    label: "回票完成",
-    value: "6"
-  },
-  {
-    label: "识别失败",
-    value: "7"
-  },
-  {
-    label: "验证失败",
-    value: "8"
-  },
-  {
-    label: "财务驳回",
-    value: "9"
-  },
-  {
-    label: "认证失败",
-    value: "10"
-  },
-  {
-    label: "校验超过次数第二天校验",
-    value: "11"
-  },
-  {
-    label: "回票申请废弃已结束",
-    value: "12"
-  }
-];

+ 5 - 1
src/utils/details/trage.ts → src/utils/details/trade.ts

@@ -1,6 +1,10 @@
+/**
+ * 资金详情
+ */
+
 import { DescriptionColumns } from "/@/components/BasicDescriptions";
 
-export const trage_columns: DescriptionColumns = [
+export const TRADE_COLUMNS: DescriptionColumns = [
   {
     field: "tradNo",
     label: "资金编号"

+ 9 - 3
src/utils/details/tragelog.ts

@@ -1,9 +1,13 @@
+/**
+ * 资金认领详情
+ */
+
 import { ElTag } from "element-plus";
 import { h } from "vue";
 import { DescriptionColumns } from "/@/components/BasicDescriptions";
 
 //资金认领审核状态
-export const capital_status = [
+export const CAPITAL_STATUS = [
   {
     value: "1",
     label: "待审批"
@@ -19,7 +23,8 @@ export const capital_status = [
 ];
 
 //认领详情描述列表
-export const capital_detail_columns: DescriptionColumns = [
+
+export const CAPITAL_COLUMNS: DescriptionColumns = [
   {
     field: "tradNo",
     label: "资金编号"
@@ -41,7 +46,8 @@ export const capital_detail_columns: DescriptionColumns = [
     label: "资金认领审核状态",
     render(status) {
       return h(ElTag, null, {
-        default: () => capital_status.find(s => s.value === status)?.label
+        default: () =>
+          CAPITAL_STATUS.find(s => s.value === status)?.label || "---"
       });
     }
   },

+ 1 - 1
src/views/InvoiceSaleSettings/consultingCost/config/search.config.ts

@@ -12,7 +12,7 @@ const searchFormConfig: FormConfig = {
     {
       field: "spuCode",
       type: "input",
-      placeholder: "商品code"
+      placeholder: "商品编码"
     },
     {
       field: "good_name",

+ 21 - 33
src/views/InvoiceSales/capitalClaim/components/basic-claim/sales-modal.vue

@@ -1,7 +1,8 @@
 <script setup lang="ts">
-import { nextTick, onMounted, reactive, ref, unref } from "vue";
+import { nextTick, onMounted, ref, unref } from "vue";
 import { httpSaleList } from "/@/api/InvoiceSales/capitalClaim";
-import { useResponseHandle } from "/@/hooks";
+import { ElTable } from "element-plus";
+import { useAsync } from "/@/hooks";
 
 import {
   sale_type,
@@ -9,46 +10,33 @@ import {
   sale_columns,
   sale_order_status
 } from "../../config/configs";
-import { ElTable } from "element-plus";
 
 const emit = defineEmits(["save-click-button"]);
 
 const visible = ref(false);
-const loading = ref(false);
-const saleOrderList = ref<Array<Record<string, string>>>([]);
 const selectSaleOrder = ref<Array<Record<string, string>>>([]);
 const tableRef = ref<InstanceType<typeof ElTable>>(null);
-const responseHandle = useResponseHandle();
 
-const pagination = reactive({
+const initalPagination = {
   pageSize: 10,
   currentPage: 1,
   total: 0
+};
+
+const {
+  loading,
+  run: salelistRun,
+  data: saleOrderList,
+  pagination,
+  getPaginationParams
+} = useAsync<Array<Record<string, string>>>({
+  initalData: [],
+  isList: true,
+  initalPagination
 });
 
-async function requesetTradeOrderList() {
-  loading.value = true;
-  const { pageSize: size, currentPage: page } = pagination;
-
-  const { code, message, data } = await httpSaleList({
-    page,
-    size
-  });
-
-  responseHandle({
-    code,
-    message,
-    handler: () => {
-      saleOrderList.value = data.list;
-      pagination.total = data.count;
-    }
-  });
-  loading.value = false;
-}
-
-function handleSelection(values) {
-  selectSaleOrder.value = values;
-}
+const handleSelectChange = values => (selectSaleOrder.value = values);
+const reuquestSalelist = () => salelistRun(httpSaleList(getPaginationParams()));
 
 function handleSave() {
   emit("save-click-button", unref(selectSaleOrder));
@@ -67,7 +55,7 @@ defineExpose({
 });
 
 //初始化订单列表
-onMounted(() => requesetTradeOrderList());
+onMounted(() => reuquestSalelist());
 </script>
 
 <template>
@@ -75,7 +63,7 @@ onMounted(() => requesetTradeOrderList());
     <el-table
       v-loading="loading"
       :data="saleOrderList"
-      @selection-change="handleSelection"
+      @selection-change="handleSelectChange"
       ref="tableRef"
       size="small"
       row-key="sequenceNo"
@@ -111,7 +99,7 @@ onMounted(() => requesetTradeOrderList());
         v-model:page-size="pagination.pageSize"
         :total="pagination.total"
         :page-sizes="[10, 15, 20]"
-        @current-change="requesetTradeOrderList"
+        @current-change="reuquestSalelist"
         size="small"
       />
 

+ 30 - 28
src/views/InvoiceSales/capitalClaim/detail.vue

@@ -1,47 +1,49 @@
 <script setup lang="ts">
 import { computed, onMounted, ref } from "vue";
 import { useRoute, useRouter } from "vue-router";
+
 import PaymentReceipt from "./components/basic-claim/receipt-payment.vue";
 import RelatedOrder from "./components/basic-claim/related-order.vue";
 
-import { useResponseHandle } from "/@/hooks";
-
 import { httpInfo, httpPayAdd } from "/@/api/InvoiceSales/capitalClaim";
+import { useAsync } from "/@/hooks";
 
 const { query } = useRoute();
 const { push } = useRouter();
 const tradNo = computed(() => query.id as string);
-const responseHandle = useResponseHandle();
 
-const treadeDetail = ref<Record<string, string>>({});
 const treadOrderList = ref<Array<Record<string, string>>>([]);
 
-//初始化认领详情
-async function requesetTradeDetail() {
-  const { code, message, data } = await httpInfo({
-    tradNo: tradNo.value
-  });
+const {
+  data: treadeDetail,
+  run: treadeDetailRun,
+  loading
+} = useAsync<Record<string, string>>({
+  initalData: {}
+});
 
-  responseHandle({
-    code,
-    message,
-    handler: () => (treadeDetail.value = data)
-  });
-}
+//获取资金详情
+const requesetTradeDetail = () => {
+  treadeDetailRun(
+    httpInfo({
+      tradNo: tradNo.value
+    })
+  );
+};
 
-//新增销售单付款
-async function requesetCreateSalePay(orderArr: any = []) {
-  const { code, message } = await httpPayAdd({
-    tradNo: tradNo.value,
-    orderArr
-  });
+const { run: createSaleRun } = useAsync({
+  success: () => push("/InvoiceSales/capitalClaim")
+});
 
-  responseHandle({
-    code,
-    message,
-    handler: () => push("/InvoiceSales/capitalClaim")
-  });
-}
+//新增销售单付款
+const requesetCreateSalePay = orderArr => {
+  createSaleRun(
+    httpPayAdd({
+      tradNo: tradNo.value,
+      orderArr
+    })
+  );
+};
 
 function initalData() {
   if (!tradNo.value) return;
@@ -56,7 +58,7 @@ onMounted(() => initalData());
   <div class="invoice__content" bg-white>
     <!-- 认领 -->
     <h1 text-xl font-bold mb-2>资金认领</h1>
-    <PaymentReceipt :trade-info="treadeDetail" />
+    <PaymentReceipt v-loading="loading" :trade-info="treadeDetail" />
     <RelatedOrder
       :trade-order-list="treadOrderList"
       @create-btn-click="requesetCreateSalePay"

+ 0 - 72
src/views/InvoiceSales/capitalPool/config/configs.ts

@@ -1,72 +0,0 @@
-import { ElTag } from "element-plus";
-import { h } from "vue";
-import { DescriptionColumns } from "/@/components/BasicDescriptions";
-
-//资金认领审核状态
-export const capital_status = [
-  {
-    value: "1",
-    label: "待审批"
-  },
-  {
-    value: "2",
-    label: "审批通过"
-  },
-  {
-    value: "3",
-    label: "审批驳回"
-  }
-];
-
-//认领详情描述列表
-export const capital_detail_columns: DescriptionColumns = [
-  {
-    field: "tradNo",
-    label: "资金编号"
-  },
-  {
-    field: "logNo",
-    label: "认领编号"
-  },
-  {
-    field: "trade_time",
-    label: "交易时间"
-  },
-  {
-    field: "total_fee",
-    label: "总金额"
-  },
-  {
-    field: "status",
-    label: "资金认领审核状态",
-    render(status) {
-      return h(ElTag, null, {
-        default: () => capital_status.find(s => s.value === status)?.label
-      });
-    }
-  },
-  {
-    field: "addtime",
-    label: "认领时间"
-  },
-  {
-    field: "trade_out",
-    label: "付款公司"
-  },
-  {
-    field: "trade_in",
-    label: "银行"
-  },
-  {
-    field: "balance",
-    label: "资金余额"
-  },
-  {
-    field: "used_fee",
-    label: "资金使用金额"
-  },
-  {
-    field: "remark",
-    label: "备注"
-  }
-];

+ 11 - 2
src/views/InvoiceSales/capitalPool/config/content.config.ts

@@ -4,7 +4,7 @@ import { httpList } from "/@/api/InvoiceSales/capitalPool";
 import dayjs from "dayjs";
 import { h } from "vue";
 import { ElTag } from "element-plus";
-import { capital_status } from "./configs";
+import { CAPITAL_STATUS } from "/@/utils/details/tragelog";
 
 const columns = [
   {
@@ -30,6 +30,14 @@ const columns = [
     label: "交易时间",
     prop: "trade_time"
   },
+  {
+    label: "交易银行",
+    prop: "trade_bank"
+  },
+  {
+    label: "交易账户",
+    prop: "trade_account"
+  },
   {
     label: "认领资金总金额",
     prop: "total_fee"
@@ -43,7 +51,8 @@ const columns = [
     prop: "status",
     cellRenderer: ({ row }) => {
       return h(ElTag, null, {
-        default: () => capital_status.find(s => s.value === row.status)?.label
+        default: () =>
+          CAPITAL_STATUS.find(s => s.value === row.status)?.label || "--"
       });
     }
   },

+ 9 - 27
src/views/InvoiceSales/capitalPool/config/search.config.ts

@@ -1,41 +1,23 @@
-import { capital_status } from "../../capitalClaim/config/configs";
 import { FormConfig } from "/@/components/PageSearch";
+import { CAPITAL_STATUS } from "/@/utils/details/tragelog";
 
 const searchFormConfig: FormConfig = {
   formItems: [
-    // {
-    //   field: "company",
-    //   type: "select",
-    //   placeholder: "请选择资金状态"
-    // },
     {
-      field: "bank",
+      field: "tradNo",
       type: "input",
-      placeholder: "请输入银行卡号"
+      placeholder: "资金编号"
+    },
+    {
+      field: "logNo",
+      type: "input",
+      placeholder: "认领资金编号"
     },
-    // {
-    //   field: "dd_range",
-    //   type: "input",
-    //   placeholder: "请输入单位名称"
-    // },
-    // {
-    //   field: "je_range",
-    //   type: "range",
-    //   otherOptions: {
-    //     startPlaceholder: "金额开始范围",
-    //     endPlaceholder: "金额结束范围"
-    //   }
-    // },
-    // {
-    //   field: "contactor",
-    //   type: "select",
-    //   placeholder: "请选择发票关联状态"
-    // },
     {
       field: "status",
       type: "select",
       placeholder: "请选择认领状态",
-      options: capital_status
+      options: CAPITAL_STATUS
     },
     {
       field: "timer",

+ 2 - 2
src/views/InvoiceSales/capitalPool/detail.vue

@@ -4,9 +4,9 @@ import { useRoute, useRouter } from "vue-router";
 import { useResponseHandle } from "/@/hooks";
 import { CapitalDetailType } from "./types";
 import { httpDetail, httpStatus } from "/@/api/InvoiceSales/capitalPool";
-import { capital_detail_columns } from "./config/configs";
 import BasicDescriptions from "/@/components/BasicDescriptions";
 import { approval_process } from "./components/approval-process";
+import { CAPITAL_COLUMNS } from "/@/utils/details/tragelog";
 
 const { query } = useRoute();
 const { push } = useRouter();
@@ -66,7 +66,7 @@ onMounted(() => initalData());
           <!-- 详情 -->
           <ElCollapseItem title="资金详情" name="1">
             <BasicDescriptions
-              :columns="capital_detail_columns"
+              :columns="CAPITAL_COLUMNS"
               :data="capitalDetail"
               :col-number="2"
             />

+ 10 - 15
src/views/InvoiceSales/invoiceApply/columns.tsx

@@ -19,15 +19,19 @@ export function useColumns() {
       prop: "invNo",
       width: 160
     },
-
+    {
+      label: "企业客户",
+      prop: "customerName",
+      width: 160
+    },
     {
       label: "企业客户编码",
       prop: "inv_in",
       width: 160
     },
     {
-      label: "企业客户名称",
-      prop: "username"
+      label: "业务企业编号",
+      prop: "inv_out"
     },
 
     {
@@ -71,15 +75,6 @@ export function useColumns() {
         </el-tag>
       )
     },
-    {
-      label: "业务公司编码",
-      prop: "inv_out",
-      width: 160
-    },
-    {
-      label: "业务公司名称",
-      prop: "email"
-    },
     {
       label: "申请人",
       prop: "apply_name",
@@ -88,9 +83,9 @@ export function useColumns() {
     {
       label: "创建时间",
       width: 145,
-      prop: "createTime",
-      formatter: ({ createTime }) =>
-        dayjs(createTime).format("YYYY-MM-DD HH:mm:ss")
+      prop: "addtime",
+      formatter: ({ addtime }) =>
+        addtime ? dayjs(addtime).format("YYYY-MM-DD HH:mm:ss") : ""
     },
     {
       label: "操作",

+ 64 - 252
src/views/InvoiceSales/invoiceApply/components/addEditForm.vue → src/views/InvoiceSales/invoiceApply/components/add-edit-form/add-edit-form.vue

@@ -9,8 +9,11 @@ import OrderDialog from "./order-dialog.vue";
 import EditOrder from "./edit-order.vue";
 import { useResponseHandle } from "/@/hooks";
 import { useRouter } from "vue-router";
-import { isChinese, isIDentityCard, isEmoticon } from "/@/utils/validate";
-import { inv_type_list } from "./../status";
+
+import { inv_type_list } from "./../../status";
+import InvoiceTitle from "./invoice-title.vue";
+import { convertInvoiceTitle } from "./columns";
+import { ADD_EDIT_FORM_RULES } from "./../../config/configs";
 
 enum FROM_TYPE {
   order = "order",
@@ -23,7 +26,7 @@ const { push } = useRouter();
 const modelRef = ref<InstanceType<typeof OrderDialog>>(null);
 const editOrderRef = ref<InstanceType<typeof EditOrder>>(null);
 const formRef = ref<InstanceType<typeof ElForm>>(null);
-const mapSequenceNoToInvfee = ref<Record<string, string>>({});
+const mapSequenceNoToInvfee = ref<Record<string, any>>({});
 const responseHandle = useResponseHandle();
 const loading = ref(false);
 const orderList = ref([]);
@@ -41,72 +44,19 @@ const initform = {
 };
 
 const ruleForm = ref({ ...initform });
-const rules = reactive<FormRules>({
-  companyNo: [
-    {
-      required: true,
-      message: "请选择销售方公司抬头",
-      trigger: "change"
-    }
-  ],
-  buy_id: [
-    {
-      required: true,
-      message: "请选择购买方公司抬头",
-      trigger: "change"
-    }
-  ],
-
-  invtype: [
-    {
-      required: true,
-      message: "请选择发票类型",
-      trigger: "change"
-    }
-  ],
+const rules = reactive<FormRules>({ ...ADD_EDIT_FORM_RULES });
 
-  email: [
-    {
-      required: true,
-      message: "请输入电子邮箱",
-      trigger: "blur"
-    }
-  ],
-  remark: [
-    {
-      required: true,
-      message: "请输入申请备注",
-      trigger: "blur"
-    }
-  ],
-  id_number: [
-    {
-      validator(_, value) {
-        return !value || isIDentityCard(value);
-      },
-      trigger: "blur",
-      message: "身份证号格式不正确"
-    }
-  ],
-  real_name: [
-    {
-      validator(_, value) {
-        return !value || (isChinese(value) && !isEmoticon(value));
-      },
-      trigger: "blur",
-      message: "真实姓名格式不正确"
-    }
-  ]
-});
-
-function handleShowEditModal(index, row: any) {
+function handleShowEditModal(_, row: any) {
   editOrderRef.value.onDisplay({
     row
   });
 }
 
-function handleEdit({ row, inv_fee }) {
-  mapSequenceNoToInvfee.value[row.sequenceNo] = inv_fee;
+function handleEdit({ row, inv_fee, num }) {
+  mapSequenceNoToInvfee.value[row.sequenceNo] = {
+    inv_fee,
+    num
+  };
 }
 
 const handleDelete = (index: number) => {
@@ -115,17 +65,27 @@ const handleDelete = (index: number) => {
   orderList.value.splice(index, 1);
 };
 
+function generatorOrderArr() {
+  const keys = Object.keys(mapSequenceNoToInvfee.value);
+  const orderArr = keys.map(sequenceNo => {
+    const { inv_fee, num } = mapSequenceNoToInvfee.value[sequenceNo];
+
+    return {
+      sequenceNo,
+      inv_fee,
+      num
+    };
+  });
+
+  return { orderArr };
+}
+
 function handleSave() {
   formRef.value.validate(async isValid => {
     if (!isValid) return;
-
     const { code, message } = await httpAdd({
       ...ruleForm.value,
-      orderArr: Object.keys(mapSequenceNoToInvfee.value).map(sequenceNo => ({
-        sequenceNo,
-        inv_fee: mapSequenceNoToInvfee.value[sequenceNo],
-        num: "2"
-      }))
+      ...generatorOrderArr()
     });
 
     responseHandle({
@@ -141,19 +101,31 @@ function menu_type_change() {
   rules.email[0].required = invtype === "26" || invtype === "27";
 }
 
-async function companyNo_change() {
-  const { companyNo } = ruleForm.value;
-  const { buy_id } = ruleForm.value;
-  console.log(companyNo, buy_id);
-}
-
 function handleAddOrder(list) {
   orderList.value = list;
-
-  list.forEach(({ sequenceNo, winv_fee }) => {
-    mapSequenceNoToInvfee.value[sequenceNo] = winv_fee;
+  list.forEach(({ sequenceNo, winv_fee, goodNum }) => {
+    mapSequenceNoToInvfee.value[sequenceNo] = {
+      inv_fee: winv_fee,
+      num: goodNum
+    };
   });
 }
+
+//设置发票抬头详情
+const sellerInvoiceTitle = ref<Record<string, string>>({});
+const purchaserInvoiceTitle = ref<Record<string, string>>({});
+
+function handleInvoiceTitle(
+  _isSeller: boolean,
+  invoiceTitle: Record<string, string>
+) {
+  _isSeller
+    ? (sellerInvoiceTitle.value = convertInvoiceTitle(invoiceTitle))
+    : (purchaserInvoiceTitle.value = invoiceTitle);
+}
+
+const setSellerInvoiceTitle = handleInvoiceTitle.bind(null, true);
+const setPurchaserInvoiceTitle = handleInvoiceTitle.bind(null, false);
 </script>
 
 <template>
@@ -181,9 +153,11 @@ function handleAddOrder(list) {
               placeholder="销售方公司抬头"
               response-label-prop="company_name"
               response-val-prop="companyNo"
-              @itemChange="companyNo_change()"
-            /> </el-form-item
-        ></el-col>
+              @item-change="setSellerInvoiceTitle"
+            />
+          </el-form-item>
+          <InvoiceTitle :detail="sellerInvoiceTitle" />
+        </el-col>
         <el-col :span="12">
           <el-form-item
             label="购买方公司抬头"
@@ -199,9 +173,11 @@ function handleAddOrder(list) {
               request-prop="name"
               response-label-prop="invoice_title"
               response-val-prop="id"
-              @itemChange="companyNo_change()"
-            /> </el-form-item
-        ></el-col>
+              @item-change="setPurchaserInvoiceTitle"
+            />
+          </el-form-item>
+          <InvoiceTitle :detail="purchaserInvoiceTitle" />
+        </el-col>
         <el-col :span="6">
           <el-form-item label-width="100px" label="发票类型" prop="invtype">
             <el-select
@@ -223,7 +199,7 @@ function handleAddOrder(list) {
           /></el-form-item>
         </el-col>
 
-        <el-col :span="6">
+        <!-- <el-col :span="6">
           <el-form-item label-width="120px" label="真实姓名" prop="real_name">
             <el-input v-model="ruleForm.real_name" placeholder="真实姓名" />
           </el-form-item>
@@ -231,7 +207,7 @@ function handleAddOrder(list) {
           <el-form-item label-width="120px" label="身份证号" prop="id_number">
             <el-input v-model="ruleForm.id_number" placeholder="身份证号"
           /></el-form-item>
-        </el-col>
+        </el-col> -->
 
         <el-col :span="12">
           <el-form-item label="申请备注" prop="remark" label-width="135px">
@@ -245,7 +221,7 @@ function handleAddOrder(list) {
             /> </el-form-item
         ></el-col>
         <el-col :span="24" v-show="TYPE === 'order'">
-          <el-table :data="orderList" stripe border style="width: 100%">
+          <el-table :data="orderList" stripe border>
             <el-table-column
               prop="sequenceNo"
               label="销售订单编号"
@@ -269,7 +245,7 @@ function handleAddOrder(list) {
 
             <el-table-column label="开票金额" width="110">
               <template #="{ row }">{{
-                mapSequenceNoToInvfee[row.sequenceNo]
+                mapSequenceNoToInvfee[row.sequenceNo].inv_fee
               }}</template>
             </el-table-column>
 
@@ -315,167 +291,3 @@ function handleAddOrder(list) {
     <EditOrder ref="editOrderRef" @save-btn-click="handleEdit" />
   </div>
 </template>
-<style lang="scss" scoped>
-.addEditForm {
-  .InvoiceTmpDiv {
-    font-size: 12px;
-    width: 100%;
-    .title {
-      font-size: 26px;
-      color: #b16363;
-      text-align: center;
-      line-height: 56px;
-    }
-    .extra {
-      color: #b15b16;
-      padding: 0 0 6px 0;
-      div {
-        line-height: 18px;
-      }
-      .content {
-        color: #181818;
-      }
-    }
-    .height84 {
-      [class*="el-col-"] {
-        border-right: 1px solid #b16363;
-        &:last-child {
-          border-right: 0px;
-        }
-      }
-      ul {
-        padding: 15px 0;
-        // border-right: 1px solid #b16363;
-        li {
-          height: 20px;
-          line-height: 20px;
-        }
-      }
-      .el-col-15 {
-        padding: 5px 10px;
-        div {
-          line-height: 20px;
-        }
-      }
-      .el-col-7 {
-        padding: 5px 10px;
-        line-height: 20px;
-      }
-    }
-    .row {
-      border: 1px solid #b16363;
-      border-bottom: none;
-      color: #b15b16;
-      &.con {
-        padding: 5px 0;
-        line-height: 22px;
-      }
-      .content {
-        color: #181818;
-      }
-      .col_1 {
-        width: 4.16%;
-      }
-      .col_2 {
-        width: 8.33%;
-      }
-      .col_3 {
-        width: 12.5%;
-      }
-      .col_5 {
-        width: 20.83%;
-      }
-      .col_6 {
-        width: 25%;
-      }
-      .col_7 {
-        width: 29.16%;
-      }
-      .col_8 {
-        width: 33.33%;
-      }
-      .col_14 {
-        width: 58.33%;
-      }
-      .col_15 {
-        width: 62.5%;
-      }
-      .col_17 {
-        width: 70.83%;
-      }
-      .col_18 {
-        width: 75%;
-      }
-      .col_24 {
-        width: 100%;
-      }
-      .col_1,
-      .col_2,
-      .col_3,
-      .col_4,
-      .col_5,
-      .col_6,
-      .col_7,
-      .col_8,
-      .col_14,
-      .col_15,
-      .col_17,
-      .col_18,
-      .col_24 {
-        display: inline-block;
-        padding: 8px;
-        box-sizing: border-box;
-        vertical-align: middle;
-        border-left: 1px solid #b16363;
-        height: 100%;
-        &.no-border {
-          border-left: none;
-        }
-      }
-    }
-    .row-div {
-      border: 1px solid #b16363;
-      // padding:7px 0;
-      border-bottom: 0px;
-      [class*="el-col-"] {
-        padding: 4px 0;
-        line-height: 22px;
-        border-right: 1px solid #b16363;
-        &:last-child {
-          border-right: 0px;
-        }
-      }
-      .el-row {
-        &:first-child {
-          [class*="el-col-"] {
-            padding-top: 8px;
-          }
-        }
-        &:last-child {
-          [class*="el-col-"] {
-            padding-bottom: 10px;
-          }
-        }
-      }
-    }
-
-    .last-row {
-      padding: 6px 0 0 0;
-      .content {
-        color: #181818;
-      }
-      color: #b15b16;
-      border-top: 1px solid #b16363;
-    }
-    .label {
-      width: 78px;
-      display: inline-block;
-      text-align-last: justify;
-      text-align: justify;
-    }
-    .title-label {
-      width: 52px;
-    }
-  }
-}
-</style>

+ 56 - 2
src/views/InvoiceSales/invoiceApply/components/columns.tsx → src/views/InvoiceSales/invoiceApply/components/add-edit-form/columns.tsx

@@ -141,8 +141,7 @@ export function useColumns() {
       minWidth: 145,
       prop: "createTime",
       showOverflowTooltip: true,
-      formatter: ({ createTime }) =>
-        dayjs(createTime).format("YYYY-MM-DD HH:mm:ss")
+      formatter: ({ addtime }) => dayjs(addtime).format("YYYY-MM-DD HH:mm:ss")
     }
   ]);
 
@@ -197,3 +196,58 @@ export const order_detail_columns = [
     label: "未开票"
   }
 ];
+
+/**
+ * @invoice_addr 公司注册地址
+ * @invoice_people  法人
+ * @invoice_mobile 联系方式
+ * @invoice_code 纳税识别号
+ * @invoice_bank 开户行
+ * @invoice_bankNo 开户账户
+ */
+export const convertInvoiceTitle = (title: Record<string, string>) => {
+  const {
+    company_address,
+    contector,
+    mobile,
+    company_license,
+    bank_name,
+    bankNo
+  } = title;
+
+  return {
+    invoice_addr: company_address,
+    invoice_people: contector,
+    invoice_mobile: mobile,
+    invoice_code: company_license,
+    invoice_bank: bank_name,
+    invoice_bankNo: bankNo
+  };
+};
+
+export const invoice_columns = [
+  {
+    label: "公司注册地址",
+    field: "invoice_addr"
+  },
+  {
+    label: "法人",
+    field: "invoice_people"
+  },
+  {
+    label: "联系方式",
+    field: "invoice_mobile"
+  },
+  {
+    label: "纳税识别号",
+    field: "invoice_code"
+  },
+  {
+    label: "开户行",
+    field: "invoice_bank"
+  },
+  {
+    label: "开户账户",
+    field: "invoice_bankNo"
+  }
+];

+ 28 - 6
src/views/InvoiceSales/invoiceApply/components/edit-order.vue → src/views/InvoiceSales/invoiceApply/components/add-edit-form/edit-order.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { ref, unref } from "vue";
+import { computed, ref, unref, watchEffect } from "vue";
 import BasicDescriptions from "/@/components/BasicDescriptions";
 import { order_detail_columns } from "./columns";
 
@@ -7,21 +7,33 @@ const visible = ref(false);
 const data = ref<Record<string, string>>({});
 const emit = defineEmits(["save-btn-click"]);
 
-const inv_fee = ref("");
+const total = ref(0);
+const inv_fee = ref(0);
 
 function handleSave() {
   emit("save-btn-click", {
     row: unref(data),
-    inv_fee: inv_fee.value
+    inv_fee: unref(inv_fee),
+    num: unref(total)
   });
 
   visible.value = false;
 }
 
+const totalNum = computed(() => {
+  const { winv_fee, goodPrice } = data.value as any;
+  return winv_fee / goodPrice;
+});
+
+watchEffect(() => {
+  total.value = totalNum.value;
+});
+
 defineExpose({
   onDisplay({ row: _data }) {
     visible.value = true;
     data.value = _data;
+    inv_fee.value = data.value.winv_fee as any;
   }
 });
 </script>
@@ -34,10 +46,20 @@ defineExpose({
       :columns="order_detail_columns"
     >
       <template #custom>
-        <el-descriptions-item label="开票金额" />
-
         <el-descriptions-item label="数量">
-          <el-input-number />
+          <el-input-number
+            size="small"
+            :min="1"
+            :max="totalNum"
+            v-model="total"
+        /></el-descriptions-item>
+
+        <el-descriptions-item label="开票金额">
+          <el-input
+            placeholder="请输入开票金额"
+            size="small"
+            v-model="inv_fee"
+          />
         </el-descriptions-item>
       </template>
     </BasicDescriptions>

+ 0 - 0
src/views/InvoiceSales/invoiceApply/components/invoiceShow.vue → src/views/InvoiceSales/invoiceApply/components/add-edit-form/invoice-show.vue


+ 20 - 0
src/views/InvoiceSales/invoiceApply/components/add-edit-form/invoice-title.vue

@@ -0,0 +1,20 @@
+<script setup lang="ts">
+import { invoice_columns } from "./columns";
+import BasicDescriptions from "/@/components/BasicDescriptions";
+
+defineProps<{
+  detail: Record<string, string>;
+}>();
+</script>
+
+<template>
+  <BasicDescriptions
+    px-8
+    pb-5
+    v-if="Object.keys(detail).length !== 0"
+    :data="detail"
+    :columns="invoice_columns"
+    :col-number="2"
+    label-width="100px"
+  />
+</template>

+ 0 - 22
src/views/InvoiceSales/invoiceApply/components/order-dialog.vue → src/views/InvoiceSales/invoiceApply/components/add-edit-form/order-dialog.vue

@@ -144,28 +144,6 @@ defineExpose({
             format="YYYY-MM-DD"
             value-forma="YYYY-MM-DD"
           />
-          <!-- <el-date-picker
-            v-model="ruleForm.start"
-            :disabled-date="startDisabledDate"
-            type="date"
-            @change="aa"
-            format="YYYY-MM-DD"
-            value-forma="YYYY-MM-DD"
-            style="width: 100%"
-            placeholder="申请开始时间"
-          />
-        </el-col>
-        <el-col :span="5">
-          <el-date-picker
-            v-model="ruleForm.end"
-            :disabled-date="endDisabledDate"
-            type="date"
-            @change="aa"
-            format="YYYY-MM-DD"
-            value-forma="YYYY-MM-DD"
-            style="width: 100%"
-            placeholder="申请结束时间"
-          /> -->
         </el-col>
         <el-col :span="5">
           <el-date-picker

+ 51 - 34
src/views/InvoiceSales/invoiceApply/components/approval-process/src/upload-invoice.vue

@@ -1,15 +1,17 @@
 <script setup lang="ts">
+import { ElMessage, dayjs } from "element-plus";
 import { computed, reactive, ref } from "vue";
 import { upload_invoice_rules } from "../../../config/configs";
 import { input_type_list, open_type_list } from "../../../status";
-import { inv_type_list } from "/@/utils/status";
 
 const emit = defineEmits(["changeStatus"]);
 const rules = reactive({ ...upload_invoice_rules });
 
 const disabled = computed(() => formData.input_type === "1");
 
-const barCodeInput = ref("");
+const noPass = computed(() => formData.status === "4");
+
+const scanInputValue = ref("");
 
 const formData = reactive({
   status: "",
@@ -20,13 +22,51 @@ const formData = reactive({
   open_date: null,
   total_fee: 0,
   input_type: "",
-  subtotal_fee: 0,
-  inv_type: ""
+  subtotal_fee: 0
 });
 
 function handleSaveStatus() {
-  const { subtotal_fee } = formData;
-  emit("changeStatus", { ...formData, subtotal_fee: String(subtotal_fee) });
+  const { input_type: _, subtotal_fee, total_fee, ...otherParams } = formData;
+
+  emit(
+    "changeStatus",
+    formData.status === "4"
+      ? { status: "4", remark: formData.remark }
+      : {
+          ...otherParams,
+          subtotal_fee: subtotal_fee.toFixed(2),
+          total_fee: total_fee.toFixed(2)
+        }
+  );
+}
+
+function handleScanKeydown(evt: KeyboardEvent) {
+  const { keyCode } = evt;
+
+  if (keyCode !== 13) return;
+
+  //校验扫描枪值是否含有中文逗号
+  if (scanInputValue.value.indexOf(",") >= 0) {
+    ElMessage.error("不能包含中文逗号");
+    return (scanInputValue.value = "");
+  }
+
+  const [_1, _2, ...chunks] = scanInputValue.value.split(",");
+  const [invCode, invNum, subtotal_amount, open_time] = chunks;
+
+  const year = open_time.slice(0, 4);
+  const month = open_time.slice(4, 6);
+  const day = open_time.slice(6);
+
+  formData.invCode = invCode;
+  formData.invNum = invNum;
+  formData.subtotal_fee = Number(subtotal_amount);
+  formData.total_fee = Number(subtotal_amount);
+  formData.open_date = dayjs(`${year}-${month}-${day}`).format(
+    "YYYY-MM-DD HH:mm:ss"
+  );
+
+  scanInputValue.value = "";
 }
 </script>
 
@@ -48,7 +88,7 @@ function handleSaveStatus() {
             <el-option label="不通过" value="4" />
           </el-select>
         </el-form-item>
-        <el-form-item label="开票类型" prop="open_type">
+        <el-form-item label="开票类型" prop="open_type" v-if="!noPass">
           <el-select
             v-model="formData.open_type"
             style="width: 100%"
@@ -74,7 +114,7 @@ function handleSaveStatus() {
           /> </el-form-item
       ></el-col>
     </el-row>
-    <el-row v-show="formData.open_type !== '1'">
+    <el-row v-show="formData.open_type !== '1'" v-if="!noPass">
       <el-col :span="8">
         <el-form-item label="输入类型" prop="input_type">
           <el-select
@@ -95,31 +135,16 @@ function handleSaveStatus() {
         v-show="formData.input_type === '1'"
       >
         <el-input
-          v-model="barCodeInput"
+          v-model="scanInputValue"
           :rows="1"
           type="textarea"
           maxlength="30"
           placeholder="扫码枪输入处"
+          @keydown="handleScanKeydown"
         />
       </el-col>
     </el-row>
-    <el-row v-show="formData.open_type !== '1'">
-      <el-col :span="8">
-        <el-form-item label="发票类型" prop="inv_type">
-          <el-select
-            v-model="formData.inv_type"
-            style="width: 100%"
-            :disabled="disabled"
-            placeholder="发票类型"
-          >
-            <el-option
-              v-for="(si, sii) in inv_type_list"
-              :key="'type' + si.value + sii"
-              :label="si.label"
-              :value="si.value"
-            />
-          </el-select> </el-form-item
-      ></el-col>
+    <el-row v-show="formData.open_type !== '1'" v-if="!noPass">
       <el-col :span="8">
         <el-form-item label="发票号码" prop="invCode">
           <el-input
@@ -166,14 +191,6 @@ function handleSaveStatus() {
             :disabled="disabled"
           /> </el-form-item
       ></el-col>
-      <!-- <el-col :span="8">
-        <el-form-item label="校验码" prop="total_fee">
-          <el-input
-            v-model="formData.total_fee"
-            :disabled="disabled"
-            placeholder="校验码"
-          /> </el-form-item
-      ></el-col> -->
     </el-row>
     <div class="flex justify-end">
       <el-button type="primary" @click="handleSaveStatus">保存</el-button>

+ 2 - 2
src/views/InvoiceSales/invoiceApply/components/invoice-detail/index.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { inv_open_columns } from "/@/utils/details/inv-open";
+import { INV_OPEN_COLUMNS } from "/@/utils/details/inv-open";
 import BasicDescriptions from "/@/components/BasicDescriptions";
 
 defineProps<{
@@ -11,7 +11,7 @@ defineProps<{
   <BasicDescriptions
     ref="defaultRef"
     :data="detail"
-    :columns="inv_open_columns"
+    :columns="INV_OPEN_COLUMNS"
     :col-number="3"
   />
 </template>

+ 60 - 7
src/views/InvoiceSales/invoiceApply/config/configs.ts

@@ -1,3 +1,5 @@
+import { isChinese, isIDentityCard, isEmoticon } from "/@/utils/validate";
+
 export const upload_invoice_rules = {
   status: [
     {
@@ -27,13 +29,6 @@ export const upload_invoice_rules = {
       trigger: "change"
     }
   ],
-  inv_type: [
-    {
-      required: true,
-      message: "请选择发票类型",
-      trigger: "change"
-    }
-  ],
   invCode: [
     {
       required: true,
@@ -71,3 +66,61 @@ export const upload_invoice_rules = {
     }
   ]
 };
+
+export const ADD_EDIT_FORM_RULES = {
+  companyNo: [
+    {
+      required: true,
+      message: "请选择销售方公司抬头",
+      trigger: "change"
+    }
+  ],
+  buy_id: [
+    {
+      required: true,
+      message: "请选择购买方公司抬头",
+      trigger: "change"
+    }
+  ],
+
+  invtype: [
+    {
+      required: true,
+      message: "请选择发票类型",
+      trigger: "change"
+    }
+  ],
+
+  email: [
+    {
+      required: true,
+      message: "请输入电子邮箱",
+      trigger: "blur"
+    }
+  ],
+  remark: [
+    {
+      required: true,
+      message: "请输入申请备注",
+      trigger: "blur"
+    }
+  ],
+  id_number: [
+    {
+      validator(_, value) {
+        return !value || isIDentityCard(value);
+      },
+      trigger: "blur",
+      message: "身份证号格式不正确"
+    }
+  ],
+  real_name: [
+    {
+      validator(_, value) {
+        return !value || (isChinese(value) && !isEmoticon(value));
+      },
+      trigger: "blur",
+      message: "真实姓名格式不正确"
+    }
+  ]
+};

+ 38 - 30
src/views/InvoiceSales/invoiceApply/detail.vue

@@ -1,47 +1,57 @@
 <script setup lang="ts">
-import { ref, computed, unref, onMounted } from "vue";
-import addEditForm from "./components/addEditForm.vue";
+import { ref, computed, onMounted } from "vue";
 import { approvalProcess } from "./components/approval-process";
 import { examRecord } from "/@/components/examRecord";
-import { useResponseHandle } from "/@/hooks";
-import { useRoute } from "vue-router";
+import { useAsync, useResponseHandle } from "/@/hooks";
+import { useRoute, useRouter } from "vue-router";
+import InvoiceDetailVue from "./components/invoice-detail/index.vue";
+import AddEditForm from "./components/add-edit-form/add-edit-form.vue";
 
 import {
   httpSetPost,
   httpStatus,
   httpDetail
 } from "/@/api/InvoiceSales/invoiceApply";
-import InvoiceDetail from "./components/invoice-detail/index.vue";
 
 defineOptions({
   name: "InvoiceApplyDetail"
 });
 
 const { query } = useRoute();
-const activeName = computed(() => (isCreate.value ? "0" : "1"));
+const { push } = useRouter();
+const responseHandle = useResponseHandle();
 
-const collapseItem = ref(["0", "1", "2", "3"]);
 const examCode = ref("");
-const responseHandle = useResponseHandle();
-const invDetail = ref<Record<string, string>>({});
+const activeName = computed(() => (isCreate.value ? "0" : "1"));
+const collapseItem = ref(["0", "1", "2", "3"]);
 
 const id = computed(() => query.id);
 const isCreate = computed(() => !id.value);
 
+const {
+  loading,
+  data: invoiceDetail,
+  run: invoiceDetailRun
+} = useAsync<Record<string, string>>({
+  initalData: {}
+});
+
+//当前的审批流程 ->
 const currentProcess = computed(() => {
-  const { status } = invDetail.value;
+  const { status } = invoiceDetail.value;
   return approvalProcess[status] || {};
 });
 
+//设置状态/物流
 async function handleChangeStatus({ status, ...otherParmas }) {
   let response: any;
-  const invNo = unref(id);
 
   if (!status) {
-    response = await httpSetPost({ invNo, ...otherParmas });
+    //设置物流
+    response = await httpSetPost({ invNo: id.value, ...otherParmas });
   } else {
-    console.log(invNo, otherParmas);
-    response = await httpStatus({ invNo, status, ...otherParmas });
+    //设置状态
+    response = await httpStatus({ invNo: id.value, status, ...otherParmas });
   }
 
   const { code, message } = response;
@@ -53,33 +63,31 @@ async function handleChangeStatus({ status, ...otherParmas }) {
   });
 }
 
-async function requesetInvDetail() {
-  const { code, message, data } = await httpDetail({
-    invNo: id.value
-  });
+const requesetInvoiceDetail = () => {
+  invoiceDetailRun(httpDetail({ invNo: id.value }));
+};
 
-  responseHandle({
-    code,
-    message,
-    handler: () => (invDetail.value = data as any)
-  });
-}
-
-onMounted(() => !isCreate.value && requesetInvDetail());
+onMounted(() => !isCreate.value && requesetInvoiceDetail());
 </script>
 
 <template>
   <div class="main bg-white">
     <el-tabs v-model="activeName" type="border-card">
       <el-tab-pane label="新建发票申请" name="0" v-if="isCreate">
-        <addEditForm />
+        <AddEditForm />
       </el-tab-pane>
-      <el-tab-pane label="业务详情" name="1">
+
+      <el-tab-pane label="业务详情" name="1" v-if="!isCreate">
         <el-collapse v-model="collapseItem">
           <el-collapse-item title="发票申请详情" name="2">
-            <InvoiceDetail :detail="invDetail" />
+            <InvoiceDetailVue v-loading="loading" :detail="invoiceDetail" />
           </el-collapse-item>
-          <el-collapse-item :title="currentProcess.title" name="3">
+
+          <el-collapse-item
+            name="3"
+            :title="currentProcess.title"
+            v-if="Object.keys(currentProcess).length"
+          >
             <component
               :is="currentProcess.component"
               @change-status="handleChangeStatus"

+ 7 - 6
src/views/InvoiceSales/invoiceApply/index.vue

@@ -18,7 +18,7 @@ defineOptions({
 });
 const powers = ref([]);
 const initform = {
-  inv_in: "", //客户公司
+  customer: "", //客户公司
   inv_out: "", //业务企业公司
   apply_name: "", //申请人
   // apply_id:'',//申请人ID
@@ -90,13 +90,13 @@ function editItem(id) {
   push({
     path: "/InvoiceSales/invoiceApplyDetail",
     query: {
-      id
+      ...(id ? { id } : {})
     }
   });
 }
 async function resetForm() {
-  Object.keys(form.value).forEach(key => {
-    form.value[key] = initform[key];
+  Object.keys(form).forEach(key => {
+    form[key] = initform[key];
   });
   await onSearch();
 }
@@ -162,7 +162,7 @@ onMounted(() => {
         <el-row :gutter="10">
           <el-col :span="10">
             <el-input
-              v-model="form.inv_in"
+              v-model="form.customer"
               placeholder="企业客户名称"
               style="width: 100%"
               clearable
@@ -172,7 +172,7 @@ onMounted(() => {
           <el-col :span="10">
             <el-input
               v-model="form.inv_out"
-              placeholder="业务企业公司"
+              placeholder="业务企业公司编号"
               style="width: 100%"
               clearable
             />
@@ -209,6 +209,7 @@ onMounted(() => {
             type="primary"
             :icon="useRenderIcon('add')"
             @click="editItem('')"
+            v-if="powers.some(i => i === '002')"
           >
             新增发票申请
           </el-button>

+ 10 - 17
src/views/InvoiceSales/invoicePool/config/search.config.ts

@@ -1,7 +1,14 @@
+import { inv_type_list } from "../../invoiceApply/status";
 import { FormConfig } from "/@/components/PageSearch";
 
 const searchFormConfig: FormConfig = {
   formItems: [
+    {
+      field: "invNo",
+      type: "input",
+      placeholder: "请输入发票申请编号",
+      options: inv_type_list
+    },
     {
       field: "timer",
       type: "date_picker",
@@ -12,24 +19,10 @@ const searchFormConfig: FormConfig = {
       }
     },
     {
-      field: "company",
-      type: "input",
-      placeholder: "销售方发票抬头"
-    },
-    {
-      field: "dd_range",
+      field: "inv_type",
       type: "select",
-      placeholder: "请选择发票类型"
-    },
-    {
-      field: "dd_range",
-      type: "input",
-      placeholder: "请输入单位名称"
-    },
-    {
-      field: "contactor",
-      type: "input",
-      placeholder: "购买方发票抬头"
+      placeholder: "请选择发票类型",
+      options: inv_type_list
     }
   ]
 };

+ 19 - 51
src/views/InvoiceSales/invoicePool/detail-dialog.vue

@@ -1,68 +1,36 @@
 <script setup lang="ts">
-import { inv_open_columns } from "/@/utils/details/inv-open";
-import BasicDescriptions from "/@/components/BasicDescriptions";
 import { ref } from "vue";
+import { INV_OPEN_COLUMNS } from "/@/utils/details/inv-open";
+import BasicDescriptions from "/@/components/BasicDescriptions";
+import { httpDetail } from "/@/api/InvoiceSales/invoiceApply";
+import { useAsync } from "/@/hooks";
 
 const visible = ref(false);
 
-const mock_data = {
-  id: 6,
-  invNo: "INV2207271542474795",
-  inv_value: "650.00",
-  inv_out: "GS2203161855277894",
-  inv_in: "KH2206091605154719",
-  apply_id: 44,
-  apply_name: "吴广广",
-  inv_type: "1",
-  open_type: "2",
-  is_ticket: 0,
-  exam_remark: "yeye",
-  remark: "1212",
-  email: "",
-  winv_fee: "650.00",
-  ainv_fee: "0.00",
-  post_fee: "26.00",
-  post_code: "SF12321321312312",
-  post_company: "顺丰快递",
-  status: 6,
-  is_del: 0,
-  addtime: "2022-07-27 15:42:47",
-  updatetime: "2022-07-27 16:47:31",
-  buyer_title: "泰康人寿保险有限责任公司大连分公司",
-  buyer_code: "91210200736420120U",
-  buyer_addr: "辽宁省大连市中山区五五路4A号上方港景A座32层",
-  buyer_mobile: "0411-82800287",
-  buyer_bank: "中国建设银行大连人民路支行",
-  buyer_bankNo: "21201500250053000712",
-  seller_title: "北京万宇恒通国际科贸有限公司",
-  seller_code: "91110113MA004JNJ28",
-  seller_addr: "北京市顺义区信中街12号院8号楼-1至4层101内三层309室",
-  seller_mobile: "010-69464815",
-  seller_bank: "中国农业银行股份有限公司北京空港支行",
-  seller_bankNo: "11120901040013561",
-  voider: " ",
-  payee: " ",
-  drawer: " ",
-  reviewer: " ",
-  ownerPlace: " ",
-  companyName: "北京万宇恒通国际科贸有限公司",
-  customerName: "泰康小卖部视频号直播间客户"
-};
+const { run, data, loading, setData } = useAsync<Record<string, string>>({
+  initalData: {}
+});
+
+const requsetInvoiceDetail = invNo => run(httpDetail({ invNo }));
 
 defineExpose({
   onDisplay(invNo) {
+    setData({});
     visible.value = true;
+    requsetInvoiceDetail(invNo);
   }
 });
 </script>
 
 <template>
   <ElDialog center title="发票详情" v-model="visible" width="1100px">
-    <BasicDescriptions
-      ref="defaultRef"
-      :data="mock_data"
-      :columns="inv_open_columns"
-      :col-number="3"
-    />
+    <div v-loading="loading">
+      <BasicDescriptions
+        ref="defaultRef"
+        :data="data"
+        :columns="INV_OPEN_COLUMNS"
+        :col-number="3"
+      />
+    </div>
   </ElDialog>
 </template>

+ 95 - 0
src/views/InvoiceSales/redInk/components/create-redink/index.vue

@@ -0,0 +1,95 @@
+<script setup lang="ts">
+import { ref } from "vue";
+import { inv_columns } from "../../../returnTicket/config/configs";
+import { httpList } from "/@/api/InvoiceSales/invoiceApply";
+import { httpBatchapplyred } from "/@/api/InvoiceSales/redInk";
+import { useResponseHandle, useAsync } from "/@/hooks";
+
+const visible = ref(false);
+const selectInvioces = ref<Array<Record<string, string>>>([]);
+const responseHandle = useResponseHandle();
+
+const initalPagination = {
+  pageSize: 10,
+  currentPage: 1,
+  total: 0
+};
+
+const {
+  data,
+  pagination,
+  getPaginationParams,
+  run: invoicelistRun,
+  loading
+} = useAsync<Array<Record<string, string>>>({
+  initalData: [],
+  isList: true,
+  initalPagination
+});
+
+const requestInvoicelist = () => {
+  invoicelistRun(
+    httpList({
+      status: "3",
+      ...getPaginationParams()
+    })
+  );
+};
+
+const handleSelectionChange = values => (selectInvioces.value = values);
+
+//批量红冲
+async function requestBatchApplyred() {
+  const invArr = selectInvioces.value.map(({ invNo }) => invNo);
+  const { code, message } = await httpBatchapplyred({ invArr });
+  responseHandle({
+    code,
+    message,
+    handler: () => (visible.value = false)
+  });
+}
+
+function handleConfirm() {
+  requestBatchApplyred();
+}
+
+defineExpose({
+  onDisplay() {
+    visible.value = true;
+    requestInvoicelist();
+  }
+});
+</script>
+
+<template>
+  <el-dialog title="创建红冲发票" center v-model="visible">
+    <el-table
+      :data="data"
+      row-key="invNo"
+      v-loading="loading"
+      @selection-change="handleSelectionChange"
+    >
+      <el-table-column type="selection" />
+      <el-table-column
+        v-for="inv in inv_columns"
+        :key="inv.prop"
+        v-bind="inv"
+        show-overflow-tooltip
+        reserve-selection
+    /></el-table>
+
+    <el-pagination
+      v-model:current-page="pagination.currentPage"
+      v-model:page-size="pagination.pageSize"
+      :total="pagination.total"
+      @current-change="() => requestInvoicelist()"
+    />
+
+    <div w-full flex justify-end mt-2>
+      <el-button type="primary" size="small" @click="handleConfirm"
+        >确定</el-button
+      >
+      <el-button size="small" @click="() => (visible = false)">取消</el-button>
+    </div>
+  </el-dialog>
+</template>

+ 62 - 0
src/views/InvoiceSales/redInk/config/content.config.ts

@@ -0,0 +1,62 @@
+import { ContentConfig } from "/@/components/PageContent";
+import { httpList } from "/@/api/InvoiceSales/redInk";
+
+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"
+  },
+  {
+    label: "红冲申请编号",
+    prop: "invRed"
+  },
+  {
+    label: "红冲申请流水号",
+    prop: "SQBSCQQLSH"
+  },
+  {
+    label: "红冲申请批次号",
+    prop: "SQBSCQQPCH"
+  },
+  {
+    label: "发票类型代码",
+    prop: "FPLXDM"
+  },
+  {
+    label: "创建时间",
+    prop: "createTime",
+    formatter: ({ createTime }) =>
+      dayjs(createTime).format("YYYY-MM-DD HH:mm:ss")
+  }
+  // {
+  //   label: "操作",
+  //   fixed: "right",
+  //   width: 80,
+  //   slot: "operation"
+  // }
+];
+
+const contentConfig: ContentConfig = {
+  title: "红字专票信息表",
+  powers: ["001", "002", "003", "004", "005", "006", "007", "008"],
+  columns,
+  apis: {
+    httpList,
+    httpAdd: true
+  }
+};
+
+export default contentConfig;

+ 23 - 0
src/views/InvoiceSales/redInk/config/search.config.ts

@@ -0,0 +1,23 @@
+import { FormConfig } from "/@/components/PageSearch";
+
+const searchFormConfig: FormConfig = {
+  formItems: [
+    {
+      field: "invRed",
+      type: "input",
+      placeholder: "红冲申请编号"
+    },
+    {
+      field: "invNo",
+      type: "input",
+      placeholder: "原发票编号"
+    },
+    {
+      field: "apply_name",
+      type: "input",
+      placeholder: "申请人名称"
+    }
+  ]
+};
+
+export default searchFormConfig;

+ 46 - 0
src/views/InvoiceSales/redInk/index.vue

@@ -0,0 +1,46 @@
+<script setup lang="ts">
+import { ref } from "vue";
+import { PageSearch, usePageSearch } from "/@/components/PageSearch";
+import { PageContent } from "/@/components/PageContent";
+import searchFormConfig from "./config/search.config";
+import contentConfig from "./config/content.config";
+import CreateRedink from "./components/create-redink/index.vue";
+import { usePermission } from "/@/hooks";
+
+const { pageContentRef, handleResetClick, handleSearchClick } = usePageSearch();
+
+const createRedinkRef = ref<InstanceType<typeof CreateRedink>>(null);
+
+const { permission, contentConfigRef } = usePermission({
+  pageName: "redInk",
+  contentConfig,
+  callback: powers => (contentConfig.powers = powers)
+});
+</script>
+
+<template>
+  <div class="main role">
+    <PagePower :is-show="permission.list">
+      <div w-full>
+        <PageSearch
+          :form-config="searchFormConfig"
+          @search-btn-click="handleSearchClick"
+          @reset-btn-click="handleResetClick"
+        />
+        <PageContent
+          ref="pageContentRef"
+          :content-config="contentConfigRef"
+          @create-btn-click="() => createRedinkRef.onDisplay()"
+        />
+      </div>
+    </PagePower>
+
+    <CreateRedink ref="createRedinkRef" />
+  </div>
+</template>
+
+<style scoped lang="scss">
+:deep(.el-dropdown-menu__item i) {
+  margin: 0;
+}
+</style>

+ 26 - 21
src/views/InvoiceSales/refund/components/create-refund/capital-modal.vue

@@ -1,31 +1,29 @@
 <script setup lang="ts">
 import { onMounted, ref, unref } from "vue";
 import { ElTable } from "element-plus";
-import { useResponseHandle } from "/@/hooks";
+import { useAsync } from "/@/hooks";
 import { httpTradeList } from "/@/api/InvoiceSales/refund";
-import { capital_columns } from "../../config/configs";
+import { CAPITAL_COLUMNS } from "/@/utils/details/tragelog";
 
-const paymentList = ref<Array<Record<string, string>>>([]);
-const selectOrder = ref<Array<Record<string, string>>>([]);
 const visible = ref(false);
+const selectOrder = ref<Array<Record<string, string>>>([]);
 
 const emit = defineEmits(["on-add-order"]);
 const tableRef = ref<InstanceType<typeof ElTable>>(null);
-const responseHandle = useResponseHandle();
 
-async function requestPaymentList() {
-  const { code, message, data } = await httpTradeList({
-    status: "2"
-  });
+const { run, data, getPaginationParams, loading, pagination } = useAsync({
+  initalData: [],
+  isList: true,
+  initalPagination: {
+    currentPage: 1,
+    pageSize: 10,
+    total: 0
+  }
+});
 
-  responseHandle({
-    code,
-    message,
-    handler: () => {
-      paymentList.value = data.list;
-    }
-  });
-}
+const requestPaymentlist = () => {
+  run(httpTradeList({ status: "2", ...getPaginationParams() }));
+};
 
 function handleConfirm() {
   visible.value = false;
@@ -47,7 +45,7 @@ defineExpose({
   onDisplay: () => (visible.value = true)
 });
 
-onMounted(() => requestPaymentList());
+onMounted(() => requestPaymentlist());
 </script>
 
 <template>
@@ -55,20 +53,27 @@ onMounted(() => requestPaymentList());
     <el-table
       border
       ref="tableRef"
-      :data="paymentList"
+      :data="data"
       size="small"
       row-key="id"
       @selection-change="handleSelectionChange"
+      v-loading="loading"
     >
       <el-table-column type="selection" width="55" />
       <el-table-column
-        v-for="(col, index) in capital_columns"
+        v-for="({ field }, index) in CAPITAL_COLUMNS"
         :key="index"
-        v-bind="col"
+        :prop="field"
         show-overflow-tooltip
       />
     </el-table>
 
+    <el-pagination
+      :total="pagination.total"
+      v-model:current-page="pagination.currentPage"
+      @current-change="requestPaymentlist"
+    />
+
     <div w-full flex justify-end mt-2>
       <el-button type="primary" size="small" @click="handleConfirm"
         >确定</el-button

+ 2 - 2
src/views/InvoiceSales/refund/components/create-refund/index.vue

@@ -2,12 +2,12 @@
 import { reactive, ref } from "vue";
 import CapitalModal from "./capital-modal.vue";
 import BasicDescriptions from "/@/components/BasicDescriptions";
-import { capital_detail_columns } from "../../config/configs";
 import { httpTradeDetail } from "/@/api/InvoiceSales/refund";
 import { httpAdd } from "/@/api/InvoiceSales/refund";
 import { useResponseHandle } from "/@/hooks";
 import { ElForm } from "element-plus";
 import { useRouter } from "vue-router";
+import { CAPITAL_COLUMNS } from "/@/utils/details/tragelog";
 
 const capitalModalRef = ref<InstanceType<typeof CapitalModal>>(null);
 const capitalDetail = ref<Record<string, string | null>>(null);
@@ -90,7 +90,7 @@ function handleCreate() {
         v-if="capitalDetail"
         :data="capitalDetail"
         :col-number="2"
-        :columns="capital_detail_columns"
+        :columns="CAPITAL_COLUMNS"
       />
     </el-form-item>
 

+ 2 - 6
src/views/InvoiceSales/refund/components/refund-detail/index.vue

@@ -1,15 +1,11 @@
 <script setup lang="ts">
 import BasicDescriptions from "/@/components/BasicDescriptions";
-import { refund_detail_columns } from "../../config/configs";
+import { REFOUD_COLUMNS } from "/@/utils/details/refund";
 
 defineProps<{
   detail: any;
 }>();
 </script>
 <template>
-  <BasicDescriptions
-    :data="detail"
-    :col-number="3"
-    :columns="refund_detail_columns"
-  />
+  <BasicDescriptions :data="detail" :col-number="3" :columns="REFOUD_COLUMNS" />
 </template>

+ 0 - 200
src/views/InvoiceSales/refund/config/configs.ts

@@ -1,200 +0,0 @@
-import { ElImage, ElTag } from "element-plus";
-import { h } from "vue";
-import { DescriptionColumns } from "/@/components/BasicDescriptions";
-export const capital_columns = [
-  {
-    label: "资金编号",
-    prop: "tradNo"
-  },
-  {
-    label: "资金认领编号",
-    prop: "logNo"
-  },
-  {
-    label: "交易时间",
-    prop: "trade_time"
-  },
-  {
-    label: "认领资金总金额",
-    width: "160px",
-    prop: "total_fee"
-  },
-  {
-    label: "申请人",
-    prop: "apply_name"
-  },
-  {
-    label: "认领时间",
-    prop: "addtime"
-  }
-];
-
-//资金详情列数据
-export const capital_detail_columns: DescriptionColumns = [
-  {
-    label: "资金编号",
-    field: "tradNo"
-  },
-  {
-    label: "资金认领编号",
-    field: "logNo"
-  },
-  {
-    label: "交易时间",
-    field: "trade_time"
-  },
-  {
-    label: "认领资金总金额",
-    field: "total_fee"
-  },
-  {
-    label: "申请人",
-    field: "apply_name"
-  },
-  {
-    label: "付款公司",
-    field: "trade_out"
-  },
-  {
-    label: "收款公司",
-    field: "trade_in"
-  },
-  {
-    label: "银行",
-    field: "trade_bank"
-  },
-  {
-    label: "资金余额",
-    field: "balance"
-  },
-  {
-    label: "资金使用金额",
-    field: "used_fee"
-  }
-];
-
-//资金退款列数据
-export const refund_detail_columns: DescriptionColumns = [
-  {
-    label: "退款编号",
-    field: "returnCode"
-  },
-  {
-    label: "资金认领编号",
-    field: "logNo"
-  },
-  {
-    label: "资金编号",
-    field: "tradNo"
-  },
-  {
-    label: "退款类型",
-    field: "type",
-    render(type) {
-      return h(ElTag, null, {
-        default: () => return_type.find(t => t.value === type)?.label
-      });
-    }
-  },
-  {
-    label: "申请人",
-    field: "apply_name"
-  },
-  {
-    label: "退款原因",
-    field: "return_reason"
-  },
-  {
-    label: "付款公司",
-    field: "trade_out"
-  },
-  {
-    label: "备注",
-    field: "remark"
-  },
-  {
-    label: "退款截图凭证",
-    field: "return_img",
-    render(img_url) {
-      return h(ElImage, {
-        src: img_url,
-        style: { height: "20px" },
-        previewSrcList: [img_url],
-        previewTeleported: true
-      });
-    }
-  },
-  {
-    label: "退款状态",
-    field: "status",
-    render(status) {
-      return h(ElTag, null, {
-        default: () => return_status.find(s => s.value === status)?.label
-      });
-    }
-  },
-  {
-    label: "退款时间",
-    field: "addtime"
-  },
-  {
-    label: "交易公司",
-    field: "trade_out"
-  },
-  {
-    label: "收款公司",
-    field: "trade_in"
-  },
-  {
-    label: "交易银行",
-    field: "trade_bank"
-  },
-  {
-    label: "总金额",
-    field: "total_fee"
-  },
-  {
-    label: "余额",
-    field: "balance"
-  },
-  {
-    label: "已认领金额",
-    field: "used_fee"
-  },
-  {
-    label: "认领金额",
-    field: "log_total_fee"
-  },
-  {
-    label: "认领申请人",
-    field: "log_apply_id"
-  }
-];
-
-//退款类型
-export const return_type = [
-  {
-    value: "1",
-    label: "退款"
-  },
-  {
-    value: "2",
-    label: "资金认领解除"
-  }
-];
-
-//退款状态
-export const return_status = [
-  {
-    value: "0",
-    label: "待审核"
-  },
-  {
-    value: "1",
-    label: "财务审核"
-  },
-  {
-    value: "2",
-    label: "财务驳回"
-  }
-];

+ 6 - 4
src/views/InvoiceSales/refund/config/content.config.ts

@@ -1,10 +1,10 @@
 import { ContentConfig } from "/@/components/PageContent";
-import { httpList } from "/@/api/InvoiceSales/refund";
+import { httpList, httpAdd } from "/@/api/InvoiceSales/refund";
 
 import dayjs from "dayjs";
 import { ElTag, ElImage } from "element-plus";
 import { h } from "vue";
-import { return_status } from "./configs";
+import { RETRUN_STATUS } from "/@/utils/details/refund";
 
 const columns = [
   {
@@ -55,7 +55,8 @@ const columns = [
     prop: "status",
     cellRenderer: ({ row }) => {
       return h(ElTag, null, {
-        default: () => return_status.find(s => s.value === row.status)?.label
+        default: () =>
+          RETRUN_STATUS.find(s => s.value === row.status)?.label || "--"
       });
     }
   },
@@ -77,7 +78,8 @@ const contentConfig: ContentConfig = {
   powers: ["001", "002", "003", "004", "005", "006", "007", "008"],
   columns,
   apis: {
-    httpList
+    httpList,
+    httpAdd
   }
 };
 

+ 3 - 3
src/views/InvoiceSales/refund/config/search.config.ts

@@ -1,5 +1,5 @@
-import { return_status, return_type } from "./configs";
 import { FormConfig } from "/@/components/PageSearch";
+import { RETURN_STATUS, RETURN_TYPE } from "/@/utils/details/inv-return";
 
 const searchFormConfig: FormConfig = {
   formItems: [
@@ -22,13 +22,13 @@ const searchFormConfig: FormConfig = {
       field: "type",
       type: "select",
       placeholder: "退款类型",
-      options: return_type
+      options: RETURN_TYPE
     },
     {
       field: "status",
       type: "select",
       placeholder: "退款状态",
-      options: return_status
+      options: RETURN_STATUS
     }
   ]
 };

+ 10 - 16
src/views/InvoiceSales/refund/index.vue

@@ -4,8 +4,7 @@ import { PageContent } from "/@/components/PageContent";
 import searchFormConfig from "./config/search.config";
 import contentConfig from "./config/content.config";
 import { useRouter } from "vue-router";
-import { onMounted } from "vue";
-import { useUserStoreHook } from "/@/store/modules/user";
+import { usePermission } from "/@/hooks";
 
 defineOptions({
   name: "invoiceheader"
@@ -23,14 +22,16 @@ function toDetail(returnCode) {
   });
 }
 
-onMounted(
-  () => (contentConfig.powers = useUserStoreHook().getMenuActions("refund"))
-);
+const { permission, contentConfigRef } = usePermission({
+  pageName: "refund",
+  contentConfig,
+  callback: powers => (contentConfig.powers = powers)
+});
 </script>
 
 <template>
   <div class="main role">
-    <PagePower :is-show="contentConfig.powers.some(i => i === '001')">
+    <PagePower :is-show="permission.list">
       <div w-full>
         <PageSearch
           :form-config="searchFormConfig"
@@ -40,17 +41,10 @@ onMounted(
 
         <PageContent
           ref="pageContentRef"
-          :content-config="contentConfig"
+          :content-config="contentConfigRef"
           @preview-btn-click="({ returnCode }) => toDetail(returnCode)"
-        >
-          <template #create>
-            <el-button
-              type="primary"
-              @click="() => push('/InvoiceSales/refundDetail')"
-              >创建</el-button
-            >
-          </template>
-        </PageContent>
+          @create-btn-click="() => push('/InvoiceSales/refundDetail')"
+        />
       </div>
     </PagePower>
   </div>

+ 2 - 6
src/views/InvoiceSales/returnTicket/components/approval-process/approval-pending.vue

@@ -1,6 +1,6 @@
 <script setup lang="ts">
+import { reactive, ref } from "vue";
 import { ElForm } from "element-plus";
-import { reactive, ref, watchEffect } from "vue";
 
 const emit = defineEmits(["changeStatus"]);
 
@@ -39,10 +39,6 @@ const formRef = ref<InstanceType<typeof ElForm>>(null);
 const handlePaymentReceipt = () => {
   formRef.value.validate(isValid => isValid && emit("changeStatus", formData));
 };
-
-watchEffect(() => {
-  rules.remark[0].required = formData.status === "3";
-});
 </script>
 
 <template>
@@ -55,7 +51,7 @@ watchEffect(() => {
   >
     <el-form-item label="审批状态" prop="status" w-400px>
       <el-select w-400px v-model="formData.status">
-        <el-option label="通过" value="2" />
+        <el-option label="通过" value="1" />
         <el-option label="不通过" value="3" />
       </el-select>
     </el-form-item>

+ 0 - 0
src/views/InvoiceSales/returnTicket/components/create-refund/capital-modal.vue → src/views/InvoiceSales/returnTicket/components/create-return-ticket/capital-modal.vue


+ 4 - 4
src/views/InvoiceSales/returnTicket/components/create-refund/index.vue → src/views/InvoiceSales/returnTicket/components/create-return-ticket/index.vue

@@ -7,7 +7,7 @@ import { httpDetail } from "/@/api/InvoiceSales/invoiceApply";
 import { useResponseHandle } from "/@/hooks";
 import { ElForm } from "element-plus";
 import { useRouter } from "vue-router";
-import { inv_open_columns } from "/@/utils/details/inv-open";
+import { INV_OPEN_COLUMNS } from "/@/utils/details/inv-open";
 
 const capitalModalRef = ref<InstanceType<typeof CapitalModal>>(null);
 const capitalDetail = ref<Record<string, string | null>>(null);
@@ -17,7 +17,7 @@ const { push } = useRouter();
 const loading = ref(false);
 
 const formData = reactive({
-  invNo: "",
+  invNo: "INV2208311508183780",
   return_reason: "",
   remark: ""
 });
@@ -58,7 +58,7 @@ function handleCreate() {
     responseHandle({
       code,
       message,
-      handler: () => push("/InvoiceSales/refund")
+      handler: () => push("/InvoiceSales/returnTicket")
     });
   });
 }
@@ -89,7 +89,7 @@ function handleCreate() {
         v-if="capitalDetail"
         :data="capitalDetail"
         :col-number="2"
-        :columns="inv_open_columns"
+        :columns="INV_OPEN_COLUMNS"
       />
     </el-form-item>
 

+ 2 - 2
src/views/InvoiceSales/returnTicket/components/refund-detail/index.vue

@@ -1,6 +1,6 @@
 <script setup lang="ts">
 import BasicDescriptions from "/@/components/BasicDescriptions";
-import { inv_return_columns } from "/@/utils/details/inv-return";
+import { INV_RETURN_COLUMNS } from "/@/utils/details/inv-return";
 
 defineProps<{
   detail: any;
@@ -10,6 +10,6 @@ defineProps<{
   <BasicDescriptions
     :data="detail"
     :col-number="3"
-    :columns="inv_return_columns"
+    :columns="INV_RETURN_COLUMNS"
   />
 </template>

+ 1 - 13
src/views/InvoiceSales/returnTicket/config/configs.ts

@@ -4,18 +4,6 @@ export const inv_columns = [
     prop: "invNo",
     width: 140
   },
-
-  {
-    label: "企业客户编码",
-    prop: "inv_in",
-    width: 140
-  },
-  {
-    label: "企业客户名称",
-    prop: "username",
-    width: 140
-  },
-
   {
     label: "发票额度",
     prop: "inv_value",
@@ -39,6 +27,6 @@ export const inv_columns = [
   {
     label: "创建时间",
     width: 145,
-    prop: "createTime"
+    prop: "addtime"
   }
 ];

+ 2 - 47
src/views/InvoiceSales/returnTicket/config/content.config.ts

@@ -5,7 +5,7 @@ import { httpAdd } from "/@/api/InvoiceSales/returnTicket";
 import dayjs from "dayjs";
 import { ElTag } from "element-plus";
 import { h } from "vue";
-import { return_status } from "/@/utils/details/inv-return";
+import { RETURN_STATUS } from "/@/utils/details/inv-return";
 
 const columns = [
   {
@@ -49,7 +49,7 @@ const columns = [
     prop: "status",
     cellRenderer: ({ row }) => {
       return h(ElTag, null, {
-        default: () => return_status.find(s => s.value === row.status)?.label
+        default: () => RETURN_STATUS.find(s => s.value === row.status)?.label
       });
     }
   },
@@ -65,51 +65,6 @@ const contentConfig: ContentConfig = {
   title: "退票申请管理",
   powers: ["001", "002", "003", "004", "005", "006", "007", "008"],
   columns,
-  mockData: [
-    {
-      buyer_title: "泰康人寿保险有限责任公司大连分公司",
-      buyer_code: "91210200736420120U",
-      buyer_addr: "辽宁省大连市中山区五五路4A号上方港景A座32层",
-      buyer_mobile: "0411-82800287",
-      buyer_bank: "中国建设银行大连人民路支行",
-      buyer_bankNo: "21201500250053000712",
-      seller_title: "北京万宇恒通国际科贸有限公司",
-      seller_code: "91110113MA004JNJ28",
-      seller_addr: "北京市顺义区信中街12号院8号楼-1至4层101内三层309室",
-      seller_mobile: "010-69464815",
-      seller_bank: "中国农业银行股份有限公司北京空港支行",
-      seller_bankNo: "11120901040013561",
-      voider: " ",
-      payee: " ",
-      drawer: " ",
-      reviewer: " ",
-      ownerPlace: " ",
-      inv_value: "650.00",
-      inv_out: "GS2203161855277894",
-      inv_in: "KH2206091605154719",
-      inv_type: 1,
-      open_type: 2,
-      is_ticket: 0,
-      email: "",
-      winv_fee: "650.00",
-      ainv_fee: "0.00",
-      post_fee: "26.00",
-      post_company: "顺丰快递",
-      post_code: "SF12321321312312",
-      id: 1,
-      returnCode: "RIN2207271638256857",
-      invNo: "INV2207271542474795",
-      return_reason: "开多票",
-      return_type: 1,
-      remark: "退票",
-      status: "2",
-      red_inv: "hc1213213321",
-      apply_id: 44,
-      apply_name: "吴广广",
-      addtime: "2022-07-27 16:38:25",
-      updatetime: "2022-07-27 16:47:31"
-    }
-  ],
   apis: {
     httpList,
     httpAdd

+ 3 - 3
src/views/InvoiceSales/returnTicket/config/search.config.ts

@@ -1,4 +1,4 @@
-import { return_status, return_type } from "/@/utils/details/inv-return";
+import { RETURN_STATUS, RETURN_TYPE } from "/@/utils/details/inv-return";
 import { FormConfig } from "/@/components/PageSearch";
 
 const searchFormConfig: FormConfig = {
@@ -22,13 +22,13 @@ const searchFormConfig: FormConfig = {
       field: "type",
       type: "select",
       placeholder: "退款类型",
-      options: return_type
+      options: RETURN_TYPE
     },
     {
       field: "status",
       type: "select",
       placeholder: "退款状态",
-      options: return_status
+      options: RETURN_STATUS
     }
   ]
 };

+ 29 - 73
src/views/InvoiceSales/returnTicket/detail.vue

@@ -3,9 +3,9 @@ import { computed, onMounted, ref } from "vue";
 import { useRoute, useRouter } from "vue-router";
 import RefundDetail from "./components/refund-detail/index.vue";
 import { approval_process } from "./components/approval-process";
-import { useResponseHandle } from "/@/hooks";
 import { httpStatus, httpDetail } from "/@/api/InvoiceSales/returnTicket";
-import CreateRefund from "./components/create-refund/index.vue";
+import CreateReturnTicket from "./components/create-return-ticket/index.vue";
+import { useAsync } from "/@/hooks";
 
 const { query } = useRoute();
 const { push } = useRouter();
@@ -15,98 +15,54 @@ const returnCode = computed(() => query.id);
 
 const isCreate = computed(() => !returnCode.value);
 
-//TODO:delete
-const refundDetail = ref<Record<string, string>>({
-  id: "1",
-  returnCode: "RIN2207271638256857",
-  invNo: "INV2207271542474795",
-  return_reason: "开多票",
-  return_type: "1",
-  remark: "退票",
-  status: "0",
-  red_inv: "hc1213213321",
-  apply_id: "44",
-  apply_name: "吴广广",
-  addtime: "2022-07-27 16:38:25",
-  updatetime: "2022-07-27 16:47:31",
-  inv_out: "GS2203161855277894",
-  inv_value: "650.00",
-  inv_apply_id: "44",
-  inv_apply_name: "吴广广",
-  inv_type: "1",
-  open_type: "2",
-  is_ticket: "0",
-  email: "",
-  post_code: "SF12321321312312",
-  post_company: "顺丰快递",
-  buyer_title: "泰康人寿保险有限责任公司大连分公司",
-  buyer_code: "91210200736420120U",
-  buyer_addr: "辽宁省大连市中山区五五路4A号上方港景A座32层",
-  buyer_mobile: "0411-82800287",
-  buyer_bank: "中国建设银行大连人民路支行",
-  buyer_bankNo: "21201500250053000712",
-  seller_title: "北京万宇恒通国际科贸有限公司",
-  seller_addr: "北京市顺义区信中街12号院8号楼-1至4层101内三层309室",
-  seller_code: "91110113MA004JNJ28",
-  seller_mobile: "010-69464815",
-  seller_bank: "中国农业银行股份有限公司北京空港支行",
-  seller_bankNo: "11120901040013561"
+const { data, run, loading } = useAsync<Record<string, string>>({
+  initalData: {}
 });
 
-const responseHandle = useResponseHandle();
+//退票详情
+const requesetReturnTicketDetail = () => {
+  run(httpDetail({ returnCode: returnCode.value }) as any);
+};
+
+const { run: retrunTicketStatusRun } = useAsync({
+  success: () => push("/InvoiceSales/returnTicket")
+});
+
+//退票审核流程
+const requesetRetrunTicketStatus = otherParmas => {
+  retrunTicketStatusRun(
+    httpStatus({
+      returnCode: returnCode.value,
+      ...otherParmas
+    }) as any
+  );
+};
 
 //映射当前审批流程
 const currentProcess = computed(() => {
-  const { status } = refundDetail.value;
+  const { status } = data.value;
   return approval_process[status];
 });
 
-//退款详情
-async function requesetRefundDetail() {
-  const { code, message, data } = await httpDetail({
-    returnCode: returnCode.value
-  });
-
-  responseHandle({
-    code,
-    message,
-    handler: () => (refundDetail.value = data)
-  });
-}
-
-//退款审核
-async function requesetRetrunTicketStatus(otherParmas) {
-  const { code, message } = await httpStatus({
-    returnCode: returnCode.value,
-    ...otherParmas
-  });
-
-  responseHandle({
-    code,
-    message,
-    handler: () => push("/InvoiceSales/refund")
-  });
-}
-
 function initalData() {
-  if (isCreate.value) return;
-  requesetRefundDetail();
+  !isCreate.value && requesetReturnTicketDetail();
 }
 
 onMounted(() => initalData());
 </script>
 <template>
-  <div class="refund__content" bg-white>
+  <div class="return-ticket__content" bg-white>
     <div v-if="isCreate">
-      <CreateRefund />
+      <CreateReturnTicket />
     </div>
+
     <ElTabs v-else>
       <ElTabPane label="详情">
         <!-- 详情 -->
         <ElCollapse v-model="collapses">
           <!-- 退票单详情 -->
           <ElCollapseItem title="退票单详情" name="1">
-            <RefundDetail :detail="refundDetail" />
+            <RefundDetail v-loading="loading" :detail="data" />
           </ElCollapseItem>
 
           <!-- 审核 -->
@@ -129,7 +85,7 @@ onMounted(() => initalData());
 </template>
 
 <style lang="scss" scoped>
-.refund__content {
+.return-ticket__content {
   padding: 20px !important;
 }
 </style>

+ 8 - 8
src/views/InvoiceSales/returnTicket/index.vue

@@ -6,9 +6,8 @@ import searchFormConfig from "./config/search.config";
 import modalConfig from "./config/modal.config";
 import contentConfig from "./config/content.config";
 import { useRouter } from "vue-router";
-import { onMounted } from "vue";
-import { useUserStoreHook } from "/@/store/modules/user";
 import PagePower from "/@/components/PagePower/PagePower.vue";
+import { usePermission } from "/@/hooks";
 
 defineOptions({
   name: "invoiceheader"
@@ -30,15 +29,16 @@ function toDetail(returnCode) {
   });
 }
 
-onMounted(
-  () =>
-    (contentConfig.powers = useUserStoreHook().getMenuActions("returnTicket"))
-);
+const { permission, contentConfigRef } = usePermission({
+  pageName: "returnTicket",
+  contentConfig,
+  callback: powers => (contentConfig.powers = powers)
+});
 </script>
 
 <template>
   <div class="main role">
-    <PagePower :is-show="contentConfig.powers.some(i => i === '001')">
+    <PagePower :is-show="permission.list">
       <div w-full>
         <PageSearch
           :form-config="searchFormConfig"
@@ -48,7 +48,7 @@ onMounted(
 
         <PageContent
           ref="pageContentRef"
-          :content-config="contentConfig"
+          :content-config="contentConfigRef"
           @preview-btn-click="({ returnCode }) => toDetail(returnCode)"
           @create-btn-click="() => push('/InvoiceSales/returnTicketDetail')"
         />

+ 41 - 0
src/views/InvoiceSales/sheetOrderPool/config/content.config.ts

@@ -2,6 +2,23 @@ import { ContentConfig } from "/@/components/PageContent";
 import { httpList } from "/@/api/InvoiceSales/sheetOrderPool";
 
 import dayjs from "dayjs";
+import { h } from "vue";
+import { ElTag } from "element-plus";
+
+const USE_STATUS = [
+  {
+    value: "0",
+    label: "未对账"
+  },
+  {
+    value: "1",
+    label: "参与对账"
+  },
+  {
+    value: "2",
+    label: "参与核销对账"
+  }
+];
 
 const columns = [
   {
@@ -27,6 +44,30 @@ const columns = [
     label: "销售员",
     prop: "ownerName"
   },
+  {
+    label: "客户名称",
+    prop: "customerName"
+  },
+  {
+    label: "状态",
+    prop: "ststus",
+    cellRenderer: ({ status }) =>
+      h(ElTag, null, {
+        default: () => USE_STATUS.find(s => s.value === status)?.label || "--"
+      })
+  },
+  {
+    label: "开票中",
+    prop: "inv_fee"
+  },
+  {
+    label: "已开票",
+    prop: "ainv_fee"
+  },
+  {
+    label: "未开票",
+    prop: "winv_fee"
+  },
   {
     label: "平台名称",
     prop: "department"

+ 21 - 20
src/views/InvoiceSales/sheetOrderPool/config/search.config.ts

@@ -1,39 +1,40 @@
 import { FormConfig } from "/@/components/PageSearch";
 
+const USE_STATUS = [
+  {
+    value: "0",
+    label: "未对账"
+  },
+  {
+    value: "1",
+    label: "参与对账"
+  },
+  {
+    value: "2",
+    label: "参与核销对账"
+  }
+];
+
 const searchFormConfig: FormConfig = {
   formItems: [
     {
-      field: "company",
+      field: "customer",
       type: "input",
       placeholder: "客户名称"
     },
     {
-      field: "dd_range",
-      type: "range",
-      placeholder: "订单范围",
-      otherOptions: {
-        startPlaceholder: "订单开始范围",
-        endPlaceholder: "订单结束范围"
-      }
-    },
-    {
-      field: "whx_range",
+      field: "totalRange",
       type: "range",
-      placeholder: "未核销范围",
       otherOptions: {
         startPlaceholder: "销售额最小值",
         endPlaceholder: "销售额最大值"
       }
     },
     {
-      field: "contactor",
-      type: "input",
-      placeholder: "发票状态"
-    },
-    {
-      field: "contactor",
-      type: "input",
-      placeholder: "关联资金状态"
+      field: "status",
+      type: "select",
+      placeholder: "使用状态",
+      options: USE_STATUS
     }
   ]
 };

+ 9 - 15
src/views/InvoiceSales/sheetOrderPool/detail-dialog.vue

@@ -1,23 +1,16 @@
 <script setup lang="ts">
 import { ref } from "vue";
-import { sale_detail_columns } from "/@/utils/details/sale";
+import { SALE_COLUMNS } from "/@/utils/details/sale";
 import BasicDescriptions from "/@/components/BasicDescriptions";
 import { httpDetail } from "/@/api/InvoiceSales/sheetOrderPool";
-import { useResponseHandle } from "/@/hooks";
+import { useAsync } from "/@/hooks";
 
 const visible = ref(false);
-const sheetOrderDetail = ref<Record<string, string>>({});
-const responseHandle = useResponseHandle();
-
-async function requesetSheetOrderDetail(sequenceNo) {
-  const { code, data, message } = await httpDetail({ sequenceNo });
+const { data, run, loading } = useAsync({
+  initalData: {}
+});
 
-  responseHandle({
-    code,
-    message,
-    handler: () => (sheetOrderDetail.value = data)
-  });
-}
+const requesetSheetOrderDetail = sequenceNo => run(httpDetail({ sequenceNo }));
 
 defineExpose({
   onDisplay(sequenceNo) {
@@ -30,9 +23,10 @@ defineExpose({
 <template>
   <ElDialog center title="确认单详情" v-model="visible" width="1100px">
     <BasicDescriptions
+      v-loading="loading"
       ref="defaultRef"
-      :data="sheetOrderDetail"
-      :columns="sale_detail_columns"
+      :data="data"
+      :columns="SALE_COLUMNS"
       :col-number="3"
     />
   </ElDialog>

+ 16 - 1
src/views/InvoiceSales/sheetOrderPool/index.vue

@@ -14,7 +14,22 @@ defineOptions({
 
 const detailDialogRef = ref<InstanceType<typeof DetailDialog>>(null);
 
-const { pageContentRef, handleResetClick, handleSearchClick } = usePageSearch();
+function searchCallback({ totalRange }) {
+  const [total_min, total_max] = totalRange;
+
+  const result = {
+    total_max,
+    total_min
+  };
+
+  return {
+    result,
+    deleteProps: ["totalRange"]
+  };
+}
+
+const { pageContentRef, handleResetClick, handleSearchClick } =
+  usePageSearch(searchCallback);
 
 onMounted(
   () =>

+ 10 - 5
src/views/interest/processPermission/components/process-list.vue

@@ -2,7 +2,7 @@
 import { ref, unref, watchEffect } from "vue";
 import { MOCK_PROCESS_DATA } from "../config/mock";
 
-const props = defineProps<{
+defineProps<{
   currentRole: Record<string, string>;
 }>();
 
@@ -16,7 +16,6 @@ const rule_process_list = ref([]);
 
 //刷新流程
 watchEffect(() => {
-  console.log(props.currentRole);
   rule_process_list.value = ["89", "90"];
 });
 
@@ -42,12 +41,17 @@ function handleCheckAllChange(status, index) {
 
 function isIndeterminate(index: number) {
   const process = list.value[index].child;
-  const len = process.len;
-
+  const len = process.length;
   const has = process.filter(p => rule_process_list.value.includes(p.id));
-
   return has.length > 0 && has.length !== len;
 }
+
+function isCheckAll(index: number) {
+  const process = list.value[index].child;
+  const len = process.length;
+  const has = process.filter(p => rule_process_list.value.includes(p.id));
+  return has.length === len;
+}
 </script>
 
 <template>
@@ -60,6 +64,7 @@ function isIndeterminate(index: number) {
         <div flex gap-10>
           <ElCheckbox
             label="全选"
+            :model-value="isCheckAll(index)"
             :indeterminate="isIndeterminate(index)"
             @change="handleCheckAllChange($event, index)"
           />

+ 15 - 1
src/views/login/utils/rule.ts

@@ -2,6 +2,7 @@ import { reactive } from "vue";
 import { isPhone } from "@pureadmin/utils";
 import type { FormRules } from "element-plus";
 import { useUserStoreHook } from "/@/store/modules/user";
+import { isMobile } from "/@/utils/validate";
 
 /** 6位数字验证码正则 */
 export const REGEXP_SIX = /^\d{6}$/;
@@ -11,7 +12,20 @@ export const REGEXP_PWD = /^[0-9A-Za-z]{6,18}$/;
 
 /** 登录校验 */
 const loginRules = reactive(<FormRules>{
-  username: [{ required: true, message: "请输入账号", trigger: "blur" }],
+  username: [
+    {
+      validator(_, value, callback) {
+        if (!value) {
+          callback(new Error("请输入手机号"));
+        } else if (!isMobile(value)) {
+          callback(new Error("手机号格式不正确"));
+        } else {
+          callback();
+        }
+      },
+      trigger: "blur"
+    }
+  ],
   password: [
     {
       validator: (rule, value, callback) => {

+ 3 - 2
src/views/parameter/clients/index.vue

@@ -22,8 +22,9 @@ const {
   defaultInfo
 } = usePageModal({ pageContentRef });
 
-const { permission } = usePermission({
+const { permission, contentConfigRef } = usePermission({
   pageName: "clients",
+  contentConfig,
   callback: powers => (contentConfig.powers = powers)
 });
 </script>
@@ -39,7 +40,7 @@ const { permission } = usePermission({
         />
         <PageContent
           ref="pageContentRef"
-          :content-config="contentConfig"
+          :content-config="contentConfigRef"
           @create-btn-click="handleCreateData"
           @update-btn-click="handleUpdateData"
           @preview-btn-click="handlePreviewData"

+ 3 - 2
src/views/parameter/finance/index.vue

@@ -25,8 +25,9 @@ const {
   pageContentRef
 });
 
-const { permission } = usePermission({
+const { permission, contentConfigRef } = usePermission({
   pageName: "finance",
+  contentConfig,
   callback: powers => (contentConfig.powers = powers)
 });
 </script>
@@ -42,7 +43,7 @@ const { permission } = usePermission({
         />
         <PageContent
           ref="pageContentRef"
-          :content-config="contentConfig"
+          :content-config="contentConfigRef"
           @create-btn-click="handleCreateData"
           @update-btn-click="handleUpdateData"
           @preview-btn-click="handlePreviewData"

+ 23 - 12
src/views/parameter/invoiceheader/index.vue

@@ -5,6 +5,7 @@ import { PageContent } from "/@/components/PageContent";
 import searchFormConfig from "./config/search.config";
 import contentConfig from "./config/content.config";
 import modalConfig from "./config/modal.config";
+import { usePermission } from "/@/hooks";
 
 defineOptions({
   name: "invoiceheader"
@@ -20,22 +21,32 @@ const {
   handleConfrim,
   defaultInfo
 } = usePageModal({ pageContentRef });
+
+const { permission, contentConfigRef } = usePermission({
+  pageName: "invoiceheader",
+  contentConfig,
+  callback: powers => (contentConfig.powers = powers)
+});
 </script>
 
 <template>
   <div class="main role">
-    <PageSearch
-      :form-config="searchFormConfig"
-      @search-btn-click="handleSearchClick"
-      @reset-btn-click="handleResetClick"
-    />
-    <PageContent
-      ref="pageContentRef"
-      :content-config="contentConfig"
-      @create-btn-click="handleCreateData"
-      @update-btn-click="handleUpdateData"
-      @preview-btn-click="handlePreviewData"
-    />
+    <PagePower :is-show="permission.list">
+      <div w-full>
+        <PageSearch
+          :form-config="searchFormConfig"
+          @search-btn-click="handleSearchClick"
+          @reset-btn-click="handleResetClick"
+        />
+        <PageContent
+          ref="pageContentRef"
+          :content-config="contentConfigRef"
+          @create-btn-click="handleCreateData"
+          @update-btn-click="handleUpdateData"
+          @preview-btn-click="handlePreviewData"
+        />
+      </div>
+    </PagePower>
     <PageModal
       ref="pageModalRef"
       :modal-config="modalConfig"

+ 3 - 2
src/views/parameter/setProcess/index.vue

@@ -22,8 +22,9 @@ const {
   defaultInfo
 } = usePageModal({ pageContentRef });
 
-const { permission } = usePermission({
+const { permission, contentConfigRef } = usePermission({
   pageName: "setProcess",
+  contentConfig,
   callback: powers => (contentConfig.powers = powers)
 });
 </script>
@@ -39,7 +40,7 @@ const { permission } = usePermission({
         />
         <PageContent
           ref="pageContentRef"
-          :content-config="contentConfig"
+          :content-config="contentConfigRef"
           @create-btn-click="handleCreateData"
           @update-btn-click="handleUpdateData"
           @preview-btn-click="handlePreviewData"

+ 3 - 2
src/views/parameter/supplierPay/index.vue

@@ -12,8 +12,9 @@ defineOptions({
 
 const { pageContentRef, handleResetClick, handleSearchClick } = usePageSearch();
 
-const { permission } = usePermission({
+const { permission, contentConfigRef } = usePermission({
   pageName: "supplierPay",
+  contentConfig,
   callback: powers => (contentConfig.powers = powers)
 });
 </script>
@@ -27,7 +28,7 @@ const { permission } = usePermission({
           @search-btn-click="handleSearchClick"
           @reset-btn-click="handleResetClick"
         />
-        <PageContent ref="pageContentRef" :content-config="contentConfig" />
+        <PageContent ref="pageContentRef" :content-config="contentConfigRef" />
       </div>
     </PagePower>
   </div>

+ 3 - 2
src/views/parameter/tagManage/index.vue

@@ -23,8 +23,9 @@ const {
   defaultInfo
 } = usePageModal({ pageContentRef });
 
-const { permission } = usePermission({
+const { permission, contentConfigRef } = usePermission({
   pageName: "tagManage",
+  contentConfig,
   callback: powers => (contentConfig.powers = powers)
 });
 </script>
@@ -40,7 +41,7 @@ const { permission } = usePermission({
         />
         <PageContent
           ref="pageContentRef"
-          :content-config="contentConfig"
+          :content-config="contentConfigRef"
           @create-btn-click="handleCreateData"
           @update-btn-click="handleUpdateData"
           @preview-btn-click="handlePreviewData"

+ 7 - 37
src/views/purchase/orderRecord/components/statement-detail/statement-detail.vue

@@ -1,10 +1,6 @@
 <script setup lang="ts">
-import {
-  reconciliation_detail_columns,
-  pay_status,
-  statusOptions,
-  inv_status
-} from "/@/utils/details/reconciliation";
+import BasicDescriptions from "/@/components/BasicDescriptions";
+import { RECONCILIATION_COLUMNS } from "/@/utils/details/reconciliation";
 
 defineProps<{
   statementDetail: Record<string, string>;
@@ -12,35 +8,9 @@ defineProps<{
 </script>
 
 <template>
-  <el-descriptions :column="3" border size="small">
-    <el-descriptions-item
-      v-for="(item, index) in reconciliation_detail_columns"
-      :label="item.label"
-      :key="index"
-    >
-      <template v-if="item.field === 'status'">
-        <el-tag>{{
-          statusOptions.find(s => s.value === statementDetail.status)?.label
-        }}</el-tag>
-      </template>
-
-      <template v-else-if="item.field === 'pay_status'">
-        <el-tag>
-          {{
-            pay_status.find(s => s.value === statementDetail.pay_status)?.label
-          }}
-        </el-tag>
-      </template>
-
-      <template v-else-if="item.field === 'inv_status'">
-        <el-tag>
-          {{
-            inv_status.find(s => s.value === statementDetail.inv_status)?.label
-          }}
-        </el-tag>
-      </template>
-
-      <span v-else>{{ statementDetail[item.field] }}</span>
-    </el-descriptions-item>
-  </el-descriptions>
+  <BasicDescriptions
+    :col-number="2"
+    :data="statementDetail"
+    :columns="RECONCILIATION_COLUMNS"
+  />
 </template>

+ 7 - 53
src/views/purchase/porder/preview-dialog.vue

@@ -1,17 +1,7 @@
 <script setup lang="ts">
 import { ref } from "vue";
-import { send_status_list } from "/@/utils/status";
-
-import {
-  purchase_columns,
-  cgd_status,
-  cgd_type,
-  cgd_source,
-  product_type,
-  send_type,
-  inv_status,
-  pay_status
-} from "/@/utils/details/purchase";
+import { PURCHAS_COLUMNS } from "/@/utils/details/purchase";
+import BasicDescriptions from "/@/components/BasicDescriptions";
 
 const visible = ref(false);
 const data = ref<any>({});
@@ -26,46 +16,10 @@ defineExpose({
 
 <template>
   <el-dialog v-model="visible" title="采购单详情" center>
-    <el-descriptions :column="2" border size="small">
-      <el-descriptions-item
-        v-for="(item, index) in purchase_columns"
-        :label="item.label"
-        :key="index"
-      >
-        <el-tag v-if="item.field === 'status'">
-          {{ cgd_status.find(c => data[item.field] === c.value)?.label }}
-        </el-tag>
-
-        <el-tag v-else-if="item.field === 'cgdType'">
-          {{ cgd_type.find(c => data[item.field] === c.value)?.label }}
-        </el-tag>
-
-        <el-tag v-else-if="item.field === 'cgdSource'">
-          {{ cgd_source.find(c => data[item.field] === c.value)?.label }}
-        </el-tag>
-
-        <el-tag v-else-if="item.field === 'goodType'">
-          {{ product_type.find(c => data[item.field] === c.value)?.label }}
-        </el-tag>
-
-        <el-tag v-else-if="item.field === 'sendType'">
-          {{ send_type.find(c => data[item.field] === c.value)?.label }}
-        </el-tag>
-
-        <el-tag v-else-if="item.field === 'pay_status'">
-          {{ pay_status.find(c => data[item.field] === c.value)?.label }}
-        </el-tag>
-
-        <el-tag v-else-if="item.field === 'sendStatus'">
-          {{ send_status_list.find(c => data[item.field] === c.value)?.label }}
-        </el-tag>
-
-        <el-tag v-else-if="item.field === 'inv_status'">
-          {{ inv_status.find(c => data[item.field] === c.value)?.label }}
-        </el-tag>
-
-        <span v-else>{{ data[item.field] }}</span>
-      </el-descriptions-item>
-    </el-descriptions>
+    <BasicDescriptions
+      :col-number="2"
+      :columns="PURCHAS_COLUMNS"
+      :data="data"
+    />
   </el-dialog>
 </template>

+ 0 - 1
src/views/purchase/ticketReturn/components/create-ticket-dialog/create-ticket-dialog.vue

@@ -75,7 +75,6 @@ function handleClose() {
 }
 
 function handleScanKeydown(evt: KeyboardEvent) {
-  console.log("123");
   const { keyCode } = evt;
 
   if (keyCode !== 13) return;

+ 7 - 41
src/views/purchase/ticketReturn/components/ticket-detail/index.vue

@@ -1,10 +1,6 @@
 <script setup lang="ts">
-import {
-  status_options,
-  inv_type,
-  ticket_return_columns
-} from "/@/utils/details/ticket-return";
-import { inv_type_list } from "/@/utils/status";
+import BasicDescriptions from "/@/components/BasicDescriptions";
+import { TICKET_RETURN_COLUMNS } from "/@/utils/details/ticket-return";
 
 defineProps<{
   invDetail: Record<string, string>;
@@ -12,39 +8,9 @@ defineProps<{
 </script>
 
 <template>
-  <el-descriptions :column="3" border size="small">
-    <el-descriptions-item
-      v-for="(item, index) in ticket_return_columns"
-      :label="item.label"
-      :key="index"
-    >
-      <template v-if="item.field === 'invType'">
-        <el-tag>{{
-          inv_type.find(t => t.value === invDetail.invType)?.label
-        }}</el-tag>
-      </template>
-
-      <template v-else-if="item.field === 'invoiceType'">
-        <el-tag>{{
-          inv_type_list.find(t => t.value === invDetail.invoiceType)?.label
-        }}</el-tag>
-      </template>
-
-      <template v-else-if="item.field === 'status'">
-        <el-tag>{{
-          status_options.find(s => s.value === invDetail.status)?.label
-        }}</el-tag>
-      </template>
-
-      <template v-else-if="item.field === 'inv_img'">
-        <el-image
-          style="height: 50px"
-          :src="invDetail.inv_img"
-          :preview-src-list="[invDetail.inv_img]"
-        />
-      </template>
-
-      <span v-else>{{ invDetail[item.field] }}</span>
-    </el-descriptions-item>
-  </el-descriptions>
+  <BasicDescriptions
+    :columns="TICKET_RETURN_COLUMNS"
+    :data="invDetail"
+    :col-number="3"
+  />
 </template>

+ 2 - 2
src/views/search/standBook/details/inv-open.vue

@@ -1,7 +1,7 @@
 <script setup lang="ts">
 import { useDetail } from "../config/detail";
 import { detailProps } from "../types";
-import { inv_open_columns } from "/@/utils/details/inv-open";
+import { INV_OPEN_COLUMNS } from "/@/utils/details/inv-open";
 import BasicDescriptions from "/@/components/BasicDescriptions";
 
 const props = defineProps(detailProps);
@@ -14,7 +14,7 @@ const { data, defaultRef } = useDetail(props);
   <BasicDescriptions
     ref="defaultRef"
     :data="data"
-    :columns="inv_open_columns"
+    :columns="INV_OPEN_COLUMNS"
     :col-number="3"
   />
 </template>

+ 2 - 2
src/views/search/standBook/details/inv-return.vue

@@ -1,7 +1,7 @@
 <script setup lang="ts">
 import { useDetail } from "../config/detail";
 import { detailProps } from "../types";
-import { inv_return_columns } from "/@/utils/details/inv-return";
+import { INV_RETURN_COLUMNS } from "/@/utils/details/inv-return";
 import BasicDescriptions from "/@/components/BasicDescriptions";
 
 const props = defineProps(detailProps);
@@ -14,7 +14,7 @@ const { data, defaultRef } = useDetail(props);
   <BasicDescriptions
     ref="defaultRef"
     :data="data"
-    :columns="inv_return_columns"
+    :columns="INV_RETURN_COLUMNS"
     :col-number="3"
   />
 </template>

+ 2 - 2
src/views/search/standBook/details/purchase.vue

@@ -1,7 +1,7 @@
 <script setup lang="ts">
 import { useDetail } from "../config/detail";
 import { detailProps } from "../types";
-import { purchase_columns } from "/@/utils/details/purchase";
+import { PURCHAS_COLUMNS } from "/@/utils/details/purchase";
 import BasicDescriptions from "/@/components/BasicDescriptions";
 
 const props = defineProps(detailProps);
@@ -14,7 +14,7 @@ const { data, defaultRef } = useDetail(props);
   <BasicDescriptions
     ref="defaultRef"
     :data="data"
-    :columns="purchase_columns"
+    :columns="PURCHAS_COLUMNS"
     :col-number="3"
   />
 </template>

+ 2 - 2
src/views/search/standBook/details/reconciliation.vue

@@ -1,7 +1,7 @@
 <script setup lang="ts">
 import { useDetail } from "../config/detail";
 import { detailProps } from "../types";
-import { reconciliation_detail_columns } from "/@/utils/details/reconciliation";
+import { RECONCILIATION_COLUMNS } from "/@/utils/details/reconciliation";
 import BasicDescriptions from "/@/components/BasicDescriptions";
 import { send_status_list } from "/@/utils/status";
 
@@ -15,7 +15,7 @@ const { data, defaultRef } = useDetail(props);
   <BasicDescriptions
     ref="defaultRef"
     :data="data"
-    :columns="reconciliation_detail_columns"
+    :columns="RECONCILIATION_COLUMNS"
     :col-number="3"
   >
     <template #custom>

+ 2 - 2
src/views/search/standBook/details/refund.vue

@@ -1,7 +1,7 @@
 <script setup lang="ts">
 import { useDetail } from "../config/detail";
 import { detailProps } from "../types";
-import { sale_detail_columns } from "/@/utils/details/sale";
+import { SALE_COLUMNS } from "/@/utils/details/sale";
 import BasicDescriptions from "/@/components/BasicDescriptions";
 
 const props = defineProps(detailProps);
@@ -14,7 +14,7 @@ const { data, defaultRef } = useDetail(props);
   <BasicDescriptions
     ref="defaultRef"
     :data="data"
-    :columns="sale_detail_columns"
+    :columns="SALE_COLUMNS"
     :col-number="3"
   />
 </template>

+ 2 - 2
src/views/search/standBook/details/sale.vue

@@ -1,7 +1,7 @@
 <script setup lang="ts">
 import { useDetail } from "../config/detail";
 import { detailProps } from "../types";
-import { sale_detail_columns } from "/@/utils/details/sale";
+import { SALE_COLUMNS } from "/@/utils/details/sale";
 import BasicDescriptions from "/@/components/BasicDescriptions";
 
 const props = defineProps(detailProps);
@@ -14,7 +14,7 @@ const { data, defaultRef } = useDetail(props);
   <BasicDescriptions
     ref="defaultRef"
     :data="data"
-    :columns="sale_detail_columns"
+    :columns="SALE_COLUMNS"
     :col-number="3"
   />
 </template>

+ 2 - 2
src/views/search/standBook/details/ticket-return.vue

@@ -1,7 +1,7 @@
 <script setup lang="ts">
 import { useDetail } from "../config/detail";
 import { detailProps } from "../types";
-import { ticket_return_columns } from "/@/utils/details/ticket-return";
+import { TICKET_RETURN_COLUMNS } from "/@/utils/details/ticket-return";
 import BasicDescriptions from "/@/components/BasicDescriptions";
 
 const props = defineProps(detailProps);
@@ -14,7 +14,7 @@ const { data, defaultRef } = useDetail(props);
   <BasicDescriptions
     ref="defaultRef"
     :data="data"
-    :columns="ticket_return_columns"
+    :columns="TICKET_RETURN_COLUMNS"
     :col-number="3"
   />
 </template>

+ 1 - 1
src/views/search/standBook/details/trade.vue

@@ -1,6 +1,6 @@
 <script setup lang="ts">
 import { useDetail } from "../config/detail";
-import { trage_columns } from "/@/utils/details/trage";
+import { trage_columns } from "../../../../utils/details/trade";
 import BasicDescriptions from "/@/components/BasicDescriptions";
 import { detailProps } from "../types";
 

+ 2 - 2
src/views/search/standBook/details/tradelog.vue

@@ -1,6 +1,6 @@
 <script setup lang="ts">
 import { useDetail } from "../config/detail";
-import { capital_detail_columns } from "/@/utils/details/tragelog";
+import { CAPITAL_COLUMNS } from "/@/utils/details/tragelog";
 import BasicDescriptions from "/@/components/BasicDescriptions";
 import { detailProps } from "../types";
 
@@ -14,7 +14,7 @@ const { data, defaultRef } = useDetail(props);
   <BasicDescriptions
     ref="defaultRef"
     :data="data"
-    :columns="capital_detail_columns"
+    :columns="CAPITAL_COLUMNS"
     :col-number="3"
   />
 </template>

+ 0 - 5
src/views/system/setBtn/components/menu-tree.vue

@@ -43,11 +43,6 @@ initMenuList();
   >
     <div class="flex justify-between mb-1 font-bold">
       <h1>菜单列表</h1>
-
-      <!-- <div>
-        <el-button size="small" type="primary">展开</el-button>
-        <el-button size="small" type="primary">折叠</el-button>
-      </div> -->
     </div>
     <el-tree
       ref="treeRef"

+ 25 - 20
src/views/system/setBtn/index.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { ref, unref, onMounted } from "vue";
+import { ref, unref } from "vue";
 import TreeMenu from "./components/menu-tree.vue";
 import { PageModal, usePageModal } from "/@/components/PageModal";
 import { PageContent, PageContentInstance } from "/@/components/PageContent";
@@ -7,10 +7,9 @@ import contentConfig from "./config/content.config";
 import modalConfig from "./config/modal.config";
 import { IMenuTree, MENU_TYPE } from "./types";
 import btnList from "/@/utils/btnList";
-import { useUserStoreHook } from "/@/store/modules/user";
+import { usePermission } from "/@/hooks";
 
 const menuid = ref("");
-const powers = ref<Array<string>>([]);
 const pageContentRef = ref<PageContentInstance>(null);
 
 const {
@@ -42,31 +41,37 @@ function initTableData(id: string) {
   menuid.value = id;
   pageContentRef.value.getPageData({ id });
 }
-onMounted(() => {
-  powers.value = useUserStoreHook().getMenuActions("setBtn");
-  contentConfig.powers = useUserStoreHook().getMenuActions("setBtn");
-  console.log(contentConfig);
+
+const { contentConfigRef, permission } = usePermission({
+  pageName: "setBtn",
+  contentConfig,
+  callback: powers => (contentConfig.powers = powers)
 });
 </script>
 
 <template>
-  <PagePower :isShow="powers.some(i => i == '001')">
-    <TreeMenu
-      @tree-select-change="handleTreeNodeSelect"
-      @init-table-data="initTableData"
-    />
-    <PageContent
-      ref="pageContentRef"
-      :content-config="contentConfig"
-      @create-btn-click="handleCreateData"
-      @preview-btn-click="handlePreviewData"
-      @update-btn-click="handleUpdateData"
-    />
+  <div class="main role">
+    <PagePower :isShow="permission.list">
+      <div w-full flex>
+        <TreeMenu
+          @tree-select-change="handleTreeNodeSelect"
+          @init-table-data="initTableData"
+        />
+        <PageContent
+          ref="pageContentRef"
+          :content-config="contentConfigRef"
+          @create-btn-click="handleCreateData"
+          @preview-btn-click="handlePreviewData"
+          @update-btn-click="handleUpdateData"
+        />
+      </div>
+    </PagePower>
+
     <PageModal
       ref="pageModalRef"
       :modal-config="modalConfig"
       :default-info="defaultInfo"
       @confirm-btn-click="handleConfrim"
     />
-  </PagePower>
+  </div>
 </template>