Browse Source

feat:发票类目 采购退款

snow 2 years ago
parent
commit
5ae1aec654
52 changed files with 1667 additions and 617 deletions
  1. 33 0
      src/api/InvoiceSaleSettings/commodityCost/index.ts
  2. 79 0
      src/api/InvoiceSaleSettings/commodityCost/types.ts
  3. 19 0
      src/api/InvoiceSaleSettings/consultingCost/index.ts
  4. 79 0
      src/api/InvoiceSaleSettings/consultingCost/types.ts
  5. 7 0
      src/api/InvoiceSales/refund/index.ts
  6. 34 0
      src/api/InvoiceSales/returnTicket/index.ts
  7. 17 0
      src/api/types.ts
  8. 1 1
      src/components/BasicDescriptions/src/basic-descriptions.tsx
  9. 4 4
      src/components/PageContent/src/hooks/use-request.ts
  10. 2 1
      src/components/PageContent/src/types.ts
  11. 12 4
      src/components/RemoteSelect/src/remote-select.tsx
  12. 3 0
      src/components/RemoteSelect/src/types.ts
  13. 102 32
      src/views/InvoiceSaleSettings/basic-settings.vue
  14. 118 5
      src/views/InvoiceSaleSettings/commodityCost/config/configs.ts
  15. 51 10
      src/views/InvoiceSaleSettings/commodityCost/config/content.config.ts
  16. 19 25
      src/views/InvoiceSaleSettings/commodityCost/config/search.config.ts
  17. 36 1
      src/views/InvoiceSaleSettings/commodityCost/detail.vue
  18. 8 3
      src/views/InvoiceSaleSettings/commodityCost/index.vue
  19. 130 0
      src/views/InvoiceSaleSettings/consultingCost/config/configs.ts
  20. 36 12
      src/views/InvoiceSaleSettings/consultingCost/config/content.config.ts
  21. 19 25
      src/views/InvoiceSaleSettings/consultingCost/config/search.config.ts
  22. 0 7
      src/views/InvoiceSaleSettings/consultingCost/deatil.vue
  23. 42 0
      src/views/InvoiceSaleSettings/consultingCost/detail.vue
  24. 12 20
      src/views/InvoiceSaleSettings/consultingCost/index.vue
  25. 8 5
      src/views/InvoiceSales/capitalClaim/components/basic-claim/related-order.vue
  26. 28 39
      src/views/InvoiceSales/invoiceApply/components/addEditForm.vue
  27. 4 0
      src/views/InvoiceSales/invoiceApply/components/columns.tsx
  28. 17 6
      src/views/InvoiceSales/invoiceApply/components/order-dialog.vue
  29. 1 1
      src/views/InvoiceSales/invoiceApply/index.vue
  30. 0 1
      src/views/InvoiceSales/refund/components/create-refund/capital-modal.vue
  31. 10 2
      src/views/InvoiceSales/refund/config/configs.ts
  32. 10 2
      src/views/InvoiceSales/refund/config/content.config.ts
  33. 4 2
      src/views/InvoiceSales/refund/detail.vue
  34. 10 9
      src/views/InvoiceSales/refund/index.vue
  35. 0 17
      src/views/InvoiceSales/returnTicket/component/Initiate-audit/index.vue
  36. 0 30
      src/views/InvoiceSales/returnTicket/component/business-audit/index.vue
  37. 0 30
      src/views/InvoiceSales/returnTicket/component/financial-audit/index.vue
  38. 0 53
      src/views/InvoiceSales/returnTicket/component/new-payment/index.vue
  39. 0 46
      src/views/InvoiceSales/returnTicket/component/new-payment/order-table.vue
  40. 0 75
      src/views/InvoiceSales/returnTicket/component/payment-receipt/index.vue
  41. 153 0
      src/views/InvoiceSales/returnTicket/components/approval-process/approval-pending.vue
  42. 8 0
      src/views/InvoiceSales/returnTicket/components/approval-process/index.ts
  43. 15 0
      src/views/InvoiceSales/returnTicket/components/refund-detail/index.vue
  44. 0 82
      src/views/InvoiceSales/returnTicket/config/columns.ts
  45. 200 0
      src/views/InvoiceSales/returnTicket/config/configs.ts
  46. 119 0
      src/views/InvoiceSales/returnTicket/config/content.config.ts
  47. 49 0
      src/views/InvoiceSales/returnTicket/config/modal.config.ts
  48. 0 17
      src/views/InvoiceSales/returnTicket/config/rules.ts
  49. 36 0
      src/views/InvoiceSales/returnTicket/config/search.config.ts
  50. 87 0
      src/views/InvoiceSales/returnTicket/detail.vue
  51. 0 17
      src/views/InvoiceSales/returnTicket/hooks/use-audit.ts
  52. 45 33
      src/views/InvoiceSales/returnTicket/index.vue

+ 33 - 0
src/api/InvoiceSaleSettings/commodityCost/index.ts

@@ -0,0 +1,33 @@
+import { http } from "/@/utils/http";
+import { loadEnv } from "@build/index";
+import { ResponseListType, ResponseType } from "../../types";
+import { ICateType, IGoodDetail, IGoodType } from "./types";
+const { VITE_PROXY_DOMAIN_REAL, VITE_PROXY_USER_REAL } = loadEnv();
+const userAPi = VITE_PROXY_DOMAIN_REAL;
+const yewuApi = VITE_PROXY_USER_REAL + "/admin/";
+
+// 商品列表
+export const httpList = (data: object): ResponseListType<IGoodType> => {
+  return http.request("post", `${yewuApi}goodlist`, {
+    data: {
+      ...data,
+      isZx: 0
+    }
+  });
+};
+
+// 商品详情
+export const httpDetail = (data: object): ResponseType<IGoodDetail> => {
+  return http.request("post", `${yewuApi}goodinfo`, { data });
+};
+
+export const httpCatlist = (data: object): ResponseListType<ICateType> => {
+  return http.request("post", `${yewuApi}catquery`, { data });
+};
+
+//添加商品类目
+export const httpAdd = (data: object): ResponseType => {
+  return http.request("post", `${yewuApi}addgood`, { data });
+};
+
+export * from "./types";

+ 79 - 0
src/api/InvoiceSaleSettings/commodityCost/types.ts

@@ -0,0 +1,79 @@
+const goodTypeDemo = {
+  id: "2319",
+  spuCode: "SKU2206241104494972",
+  good_name: "青汁糯米团",
+  companyNo: "GS2203161855277894",
+  supplierNo: "QS2206080928329800",
+  is_stock: "0",
+  craft_desc: "",
+  after_sales: "请当配送员面进行货物验收,过后非质量原因无法为您办理退换服务。",
+  good_img:
+    "http://stock.api.wanyuhengtong.com/storage/topic/20220624/fb48a1a4cf4769c575f495fc459474f - 副本 (2)_20220624110430.png,http://stock.api.wanyuhengtong.com/storage/topic/20220624/fb48a1a4cf4769c575f495fc459474f - 副本_20220624110430.png,http://stock.api.wanyuhengtong.com/storage/topic/20220624/fb48a1a4cf4769c575f495fc459474f_20220624110430.png",
+  good_thumb_img:
+    "http://stock.api.wanyuhengtong.com/storage/topic/20220624/fb48a1a4cf4769c575f495fc459474f - 副本 (2)_20220624110425.png",
+  good_info_img:
+    "http://stock.api.wanyuhengtong.com/storage/topic/20220624/fb48a1a4cf4769c575f495fc459474f - 副本_20220624110434.png",
+  creater: "泮路萌",
+  createrid: "85",
+  cat_name: "休闲零食",
+  unit_name: "箱",
+  status: "0",
+  inv_cat_name: "",
+  inv_cat_code: "",
+  inv_tax: "",
+  inv_good_name: "",
+  addtime: "2022-06-24 11:04:49",
+  updatetime: "2022-06-24 11:05:35",
+  companyName: "北京万宇恒通国际科贸有限公司",
+  supplierName: "漳州佬食仁电子商务有限公司",
+  isZx: ""
+};
+
+const catDemo = {
+  id: 3840,
+  cat_name: "电化学式分析仪器",
+  cat_code: "109060501",
+  status: 1,
+  addtime: "2022-08-23 11:41:38",
+  tax: ["13%"],
+  addtax: "",
+  sumitem: "否",
+  desc: "包括极谱分析仪、电位式分析仪器、电解式分析仪器、电导式分析仪器、电量式分析仪器、滴定仪、湿化学分析仪、溶解氧测定仪、其他电化学式分析仪器",
+  short_name: "分析仪器",
+  merge_code: "1090605010000000000"
+};
+
+const goodDetailDemo = {
+  id: 2319,
+  spuCode: "SKU2206241104494972",
+  good_name: "青汁糯米团",
+  companyNo: "GS2203161855277894",
+  supplierNo: "QS2206080928329800",
+  is_stock: 0,
+  craft_desc: "",
+  after_sales: "请当配送员面进行货物验收,过后非质量原因无法为您办理退换服务。",
+  good_img:
+    "http://stock.api.wanyuhengtong.com/storage/topic/20220624/fb48a1a4cf4769c575f495fc459474f - 副本 (2)_20220624110430.png,http://stock.api.wanyuhengtong.com/storage/topic/20220624/fb48a1a4cf4769c575f495fc459474f - 副本_20220624110430.png,http://stock.api.wanyuhengtong.com/storage/topic/20220624/fb48a1a4cf4769c575f495fc459474f_20220624110430.png",
+  good_thumb_img:
+    "http://stock.api.wanyuhengtong.com/storage/topic/20220624/fb48a1a4cf4769c575f495fc459474f - 副本 (2)_20220624110425.png",
+  good_info_img:
+    "http://stock.api.wanyuhengtong.com/storage/topic/20220624/fb48a1a4cf4769c575f495fc459474f - 副本_20220624110434.png",
+  creater: "泮路萌",
+  createrid: 85,
+  cat_name: "休闲零食",
+  unit_name: "箱",
+  status: 0,
+  inv_cat_name: "分析仪器",
+  inv_cat_code: "1090605010000000000",
+  inv_tax: "13%",
+  inv_good_name: "电疗实",
+  isZx: 0,
+  addtime: "2022-06-24 11:04:49",
+  updatetime: "2022-08-24 16:30:18",
+  companyName: "北京万宇恒通国际科贸有限公司",
+  supplierName: ""
+};
+
+export type IGoodType = typeof goodTypeDemo;
+export type ICateType = typeof catDemo;
+export type IGoodDetail = typeof goodDetailDemo;

+ 19 - 0
src/api/InvoiceSaleSettings/consultingCost/index.ts

@@ -0,0 +1,19 @@
+import { http } from "/@/utils/http";
+import { loadEnv } from "@build/index";
+import { ResponseListType } from "../../types";
+import { IGoodType } from "./types";
+const { VITE_PROXY_DOMAIN_REAL, VITE_PROXY_USER_REAL } = loadEnv();
+const userAPi = VITE_PROXY_DOMAIN_REAL;
+const yewuApi = VITE_PROXY_USER_REAL + "/admin/";
+
+// 商品列表
+export const httpList = (data: object): ResponseListType<IGoodType> => {
+  return http.request("post", `${yewuApi}goodlist`, {
+    data: {
+      ...data,
+      isZx: 1
+    }
+  });
+};
+
+export * from "./types";

+ 79 - 0
src/api/InvoiceSaleSettings/consultingCost/types.ts

@@ -0,0 +1,79 @@
+const goodTypeDemo = {
+  id: "2319",
+  spuCode: "SKU2206241104494972",
+  good_name: "青汁糯米团",
+  companyNo: "GS2203161855277894",
+  supplierNo: "QS2206080928329800",
+  is_stock: "0",
+  craft_desc: "",
+  after_sales: "请当配送员面进行货物验收,过后非质量原因无法为您办理退换服务。",
+  good_img:
+    "http://stock.api.wanyuhengtong.com/storage/topic/20220624/fb48a1a4cf4769c575f495fc459474f - 副本 (2)_20220624110430.png,http://stock.api.wanyuhengtong.com/storage/topic/20220624/fb48a1a4cf4769c575f495fc459474f - 副本_20220624110430.png,http://stock.api.wanyuhengtong.com/storage/topic/20220624/fb48a1a4cf4769c575f495fc459474f_20220624110430.png",
+  good_thumb_img:
+    "http://stock.api.wanyuhengtong.com/storage/topic/20220624/fb48a1a4cf4769c575f495fc459474f - 副本 (2)_20220624110425.png",
+  good_info_img:
+    "http://stock.api.wanyuhengtong.com/storage/topic/20220624/fb48a1a4cf4769c575f495fc459474f - 副本_20220624110434.png",
+  creater: "泮路萌",
+  createrid: "85",
+  cat_name: "休闲零食",
+  unit_name: "箱",
+  status: "0",
+  inv_cat_name: "",
+  inv_cat_code: "",
+  inv_tax: "",
+  inv_good_name: "",
+  addtime: "2022-06-24 11:04:49",
+  updatetime: "2022-06-24 11:05:35",
+  companyName: "北京万宇恒通国际科贸有限公司",
+  supplierName: "漳州佬食仁电子商务有限公司",
+  isZx: ""
+};
+
+const catDemo = {
+  id: 3840,
+  cat_name: "电化学式分析仪器",
+  cat_code: "109060501",
+  status: 1,
+  addtime: "2022-08-23 11:41:38",
+  tax: ["13%"],
+  addtax: "",
+  sumitem: "否",
+  desc: "包括极谱分析仪、电位式分析仪器、电解式分析仪器、电导式分析仪器、电量式分析仪器、滴定仪、湿化学分析仪、溶解氧测定仪、其他电化学式分析仪器",
+  short_name: "分析仪器",
+  merge_code: "1090605010000000000"
+};
+
+const goodDetailDemo = {
+  id: 2319,
+  spuCode: "SKU2206241104494972",
+  good_name: "青汁糯米团",
+  companyNo: "GS2203161855277894",
+  supplierNo: "QS2206080928329800",
+  is_stock: 0,
+  craft_desc: "",
+  after_sales: "请当配送员面进行货物验收,过后非质量原因无法为您办理退换服务。",
+  good_img:
+    "http://stock.api.wanyuhengtong.com/storage/topic/20220624/fb48a1a4cf4769c575f495fc459474f - 副本 (2)_20220624110430.png,http://stock.api.wanyuhengtong.com/storage/topic/20220624/fb48a1a4cf4769c575f495fc459474f - 副本_20220624110430.png,http://stock.api.wanyuhengtong.com/storage/topic/20220624/fb48a1a4cf4769c575f495fc459474f_20220624110430.png",
+  good_thumb_img:
+    "http://stock.api.wanyuhengtong.com/storage/topic/20220624/fb48a1a4cf4769c575f495fc459474f - 副本 (2)_20220624110425.png",
+  good_info_img:
+    "http://stock.api.wanyuhengtong.com/storage/topic/20220624/fb48a1a4cf4769c575f495fc459474f - 副本_20220624110434.png",
+  creater: "泮路萌",
+  createrid: 85,
+  cat_name: "休闲零食",
+  unit_name: "箱",
+  status: 0,
+  inv_cat_name: "分析仪器",
+  inv_cat_code: "1090605010000000000",
+  inv_tax: "13%",
+  inv_good_name: "电疗实",
+  isZx: 0,
+  addtime: "2022-06-24 11:04:49",
+  updatetime: "2022-08-24 16:30:18",
+  companyName: "北京万宇恒通国际科贸有限公司",
+  supplierName: ""
+};
+
+export type IGoodType = typeof goodTypeDemo;
+export type ICateType = typeof catDemo;
+export type IGoodDetail = typeof goodDetailDemo;

+ 7 - 0
src/api/InvoiceSales/refund/index.ts

@@ -41,3 +41,10 @@ export const httpDetail = (data: object): ResponseType => {
     data
   });
 };
+
+//退款单审核
+export const httpStatus = (data: object): ResponseType => {
+  return http.request("post", `${yewuApi}orderreturnstatus`, {
+    data
+  });
+};

+ 34 - 0
src/api/InvoiceSales/returnTicket/index.ts

@@ -0,0 +1,34 @@
+import { http } from "/@/utils/http";
+import { loadEnv } from "@build/index";
+import { ResponseType } from "../../types";
+const { VITE_PROXY_DOMAIN_REAL, VITE_PROXY_USER_REAL } = loadEnv();
+const userAPi = VITE_PROXY_DOMAIN_REAL;
+const yewuApi = VITE_PROXY_USER_REAL + "/admin/";
+
+//退票申请列表
+export const httpList = (data: object): ResponseType => {
+  return http.request("post", `${yewuApi}invreturnlist`, {
+    data
+  });
+};
+
+//新增退票申请
+export const httpAdd = (data: object): ResponseType => {
+  return http.request("post", `${yewuApi}invreturnadd`, {
+    data
+  });
+};
+
+//退票详情
+export const httpDetail = (data: object): ResponseType => {
+  return http.request("post", `${yewuApi}returninvinfo`, {
+    data
+  });
+};
+
+//退票状态
+export const httpStatus = (data: object): ResponseType => {
+  return http.request("post", `${yewuApi}returninvinfo`, {
+    data
+  });
+};

+ 17 - 0
src/api/types.ts

@@ -0,0 +1,17 @@
+import { string } from "vue-types";
+
+export type IDataType<T = any> = {
+  data?: T;
+  code?: number;
+  message?: string;
+};
+
+type ListData<T> = {
+  list: Array<T>;
+  count: string;
+};
+
+export type ResponseType<T = any> = Promise<IDataType<T>>;
+
+//列表数据
+export type ResponseListType<T = any> = Promise<IDataType<ListData<T>>>;

+ 1 - 1
src/components/BasicDescriptions/src/basic-descriptions.tsx

@@ -10,7 +10,7 @@ const BasicDescriptions = defineComponent({
       const { title, colNumber, columns, data } = props;
 
       return (
-        <ElDescriptions title={title} columns={colNumber} border size="small">
+        <ElDescriptions title={title} border column={colNumber} size="small">
           {columns.map(col => (
             <ElDescriptionsItem label={col.label} key={col.field}>
               {col.render ? col.render(data[col.field]) : data[col.field]}

+ 4 - 4
src/components/PageContent/src/hooks/use-request.ts

@@ -13,9 +13,11 @@ import { useParams } from "./use-params";
  */
 export function useRequeset(props: PageContentProps) {
   const { logout } = useNav();
+  const { contentConfig } = props;
+  const { mockData } = contentConfig;
 
   const loading = ref(false);
-  const dataList = ref([]);
+  const dataList = ref(mockData ? mockData : []);
   const initRequest = ref(!props.contentConfig.notReuqiredInit);
 
   const { getBasicParams, changeBasicParams } = useParams();
@@ -32,7 +34,7 @@ export function useRequeset(props: PageContentProps) {
     const { contentConfig } = props;
     const { apis, isTree, mockData } = contentConfig;
 
-    if (!initRequest.value) return (initRequest.value = true);
+    if (!initRequest.value || mockData) return (initRequest.value = true);
 
     loading.value = true;
 
@@ -50,8 +52,6 @@ export function useRequeset(props: PageContentProps) {
       handler: () => {
         const list = Array.isArray(data) ? data : data.list;
         dataList.value = isTree ? handleTree(list ?? []) : list;
-
-        if (mockData) dataList.value = mockData;
         changePagination("total", data.count);
       }
     });

+ 2 - 1
src/components/PageContent/src/types.ts

@@ -7,12 +7,13 @@ import PageContent from "./page-content";
  * @param columns 列数据
  * @param notReuqiredInit 首次加载是否需要请求列表
  * @param notPagination 不需要分页器
+ * @param mockData 模拟数据
  * @param isTree 是否为tree
  * @param powers 功能权限
  */
 export interface ContentConfig {
   title: string;
-  apis: ContentApis;
+  apis: ContentApis | any;
   columns: any;
   notReuqiredInit?: boolean;
   notPagination?: boolean;

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

@@ -30,9 +30,12 @@ const RemoteSelect = defineComponent({
         code,
         message,
         handler: () => {
-          list.value = data.list.map(i => ({
-            label: i[responseLabelProp],
-            value: i[responseValProp]
+          const _data = props.isRoot ? data : data.list;
+
+          list.value = _data.map(item => ({
+            ...item,
+            label: item[responseLabelProp],
+            value: item[responseValProp]
           }));
 
           emit("listChange", unref(list));
@@ -52,7 +55,12 @@ const RemoteSelect = defineComponent({
         filterable
         clearable
         remote
-        onChange={() => emit("itemChange")}
+        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} />

+ 3 - 0
src/components/RemoteSelect/src/types.ts

@@ -17,5 +17,8 @@ export const RemoteSelectProps = {
   },
   placeholder: {
     type: String
+  },
+  isRoot: {
+    type: Boolean
   }
 };

+ 102 - 32
src/views/InvoiceSaleSettings/basic-settings.vue

@@ -1,59 +1,129 @@
 <script setup lang="ts">
-import { FormRules } from "element-plus";
-import { reactive } from "vue";
+import { ElForm } from "element-plus";
+import { computed, reactive, ref } from "vue";
+import { cost_rules } from "./commodityCost/config/configs";
+import RemoteSelect from "/@/components/RemoteSelect";
+import { useResponseHandle } from "/@/hooks";
+import { useRoute, useRouter } from "vue-router";
 
-defineProps<{
+import BasicDescriptions, {
+  type DescriptionColumn
+} from "/@/components/BasicDescriptions";
+
+import { httpCatlist, httpAdd } from "/@/api/InvoiceSaleSettings/commodityCost";
+
+const props = defineProps<{
   title: string;
-  detail: Record<string, string>;
-  columns: Array<Record<string, string>>;
+  detail: any;
+  columns: Array<DescriptionColumn>;
+  backRoute: string;
 }>();
 
-const rules: FormRules = {
-  cost: [{ required: true, trigger: "change", message: "请选择类目" }],
-  name: [{ required: true, trigger: "change", message: "请选择商品名称" }],
-  fixed: [{ required: true, trigger: "change", message: "请选择税率" }]
-};
+const formRef = ref<InstanceType<typeof ElForm>>(null);
+const responseHandle = useResponseHandle();
+const { push } = useRouter();
+const { query } = useRoute();
+
+const spuCode = computed(() => query.id as string);
+const taxs = ref<Array<string>>([]);
 
 const formData = reactive({
-  cost: "",
-  fixed: "",
-  name: ""
+  cat_code: "",
+  cat_name: "",
+  inv_good_name: "",
+  tax: ""
 });
+
+function handleSave() {
+  formRef.value.validate(async isVaild => {
+    if (!isVaild) return;
+
+    const { code, message } = await httpAdd({
+      spuCode: spuCode.value,
+      ...formData
+    });
+
+    responseHandle({
+      code,
+      message,
+      handler: () => push(props.backRoute)
+    });
+  });
+}
+
+function handleSelectCategory(category) {
+  if (!category) {
+    formData.tax = "";
+    formData.cat_name = "";
+    return (taxs.value = []);
+  }
+
+  const { tax, cat_name } = category;
+  taxs.value = tax;
+  formData.tax = tax[0];
+  formData.cat_name = cat_name;
+}
 </script>
 
 <template>
   <div class="settings__content" bg-white>
     <h1 mb-2 font-bold>{{ title }}</h1>
-    <el-descriptions :column="3" size="small" border mb-5>
-      <el-descriptions-item
-        label="demo"
-        v-for="(item, index) in columns"
-        :key="index"
-        >{{ detail[item.field] }}</el-descriptions-item
-      >
-    </el-descriptions>
 
-    <div w-500px m-auto mt-2>
+    <BasicDescriptions
+      v-if="detail"
+      :data="detail"
+      :columns="columns"
+      :col-number="2"
+    />
+
+    <div v-else v-loading="true" h-100px>详情加载中...</div>
+
+    <div w-500px m-auto mt-5>
       <el-form
         label-width="120px"
         label-position="left"
-        :rules="rules"
-        :mode="formData"
+        ref="formRef"
+        :rules="cost_rules"
+        :model="formData"
       >
-        <el-form-item label="商品类目设置" prop="cost">
-          <!-- 远程搜索 -->
-          <el-input placeholder="选择类目设置" />
+        <el-form-item label="商品类目设置" prop="cat_code">
+          <RemoteSelect
+            w-100
+            is-root
+            :api="httpCatlist"
+            v-model="formData.cat_code"
+            placeholder="请选择商品类目"
+            response-label-prop="cat_name"
+            response-val-prop="cat_code"
+            request-prop="cat_name"
+            @item-change="handleSelectCategory"
+          />
         </el-form-item>
-        <el-form-item label="商品名称" prop="name">
-          <el-input placeholder="请输入商品名称" />
+        <el-form-item label="商品名称" prop="inv_good_name">
+          <el-input
+            v-model="formData.inv_good_name"
+            placeholder="请输入商品名称"
+          />
         </el-form-item>
-        <el-form-item label="税率" prop="fixed">
-          <el-input disabled placeholder="请输入税率" />
+        <el-form-item label="税率" prop="tax">
+          <el-select
+            w-390px
+            v-model="formData.tax"
+            :disabled="taxs.length === 0"
+            placeholder="请输入税率"
+          >
+            <el-option
+              v-for="(t, index) in taxs"
+              :key="index"
+              :label="t"
+              :value="t"
+            />
+          </el-select>
         </el-form-item>
       </el-form>
 
       <div flex justify-center>
-        <el-button type="primary">保存</el-button>
+        <el-button type="primary" @click="handleSave">保存</el-button>
       </div>
     </div>
   </div>

+ 118 - 5
src/views/InvoiceSaleSettings/commodityCost/config/configs.ts

@@ -1,5 +1,118 @@
-// export const formItems = [
-//   {
-//     label:''
-//   }
-// ]
+import { ElImage, ElTag } from "element-plus";
+import { h } from "vue";
+import { stock_type } from "../../consultingCost/config/configs";
+
+export const good_type = [
+  {
+    value: "0",
+    label: "未关联开票类目"
+  },
+  {
+    value: "1",
+    label: "已关联"
+  }
+];
+
+//类目新增校验规则
+export const cost_rules = {
+  cat_code: [{ required: true, trigger: "change", message: "请选择类目" }],
+  inv_good_name: [
+    { required: true, trigger: "change", message: "请选择商品名称" }
+  ],
+  tax: [{ required: true, trigger: "change", message: "请选择税率" }]
+};
+
+export const good_detail_columns = [
+  {
+    field: "spuCode",
+    label: "商品编号"
+  },
+  {
+    field: "good_name",
+    label: "商品名称"
+  },
+  {
+    field: "companyNo",
+    label: "业务公司编号"
+  },
+  {
+    field: "supplierNo",
+    label: "供应商编号"
+  },
+  {
+    field: "is_stock",
+    label: "是否库存",
+    render(stock) {
+      return h(ElTag, null, {
+        default: () => stock_type.find(s => s.value === stock)?.label
+      });
+    }
+  },
+  {
+    field: "craft_desc",
+    label: "工艺描述"
+  },
+  {
+    field: "good_img",
+    label: "商品图",
+    render(imgSrc) {
+      return imgSrc.split(",").map(src =>
+        h(ElImage, {
+          src,
+          style: {
+            height: "20px"
+          }
+        })
+      );
+    }
+  },
+  {
+    field: "creater",
+    label: "创建人"
+  },
+  {
+    field: "cat_name",
+    label: "分类名称"
+  },
+  {
+    field: "unit_name",
+    label: "单位名称"
+  },
+  {
+    field: "status",
+    label: "是否关联开票类目",
+    render(status) {
+      return h(ElTag, null, {
+        default: () => good_type.find(s => s.value === status)?.label
+      });
+    }
+  },
+  {
+    field: "inv_cat_name",
+    label: "类目名称"
+  },
+  {
+    field: "inv_cat_code",
+    label: "类目编号"
+  },
+  {
+    field: "inv_tax",
+    label: "类目税率额"
+  },
+  {
+    field: "inv_good_name",
+    label: "开票商品名称"
+  },
+  {
+    field: "inv_good_name",
+    label: "开票商品名称"
+  },
+  {
+    field: "addtime",
+    label: "申请时间"
+  },
+  {
+    field: "after_sales",
+    label: "售后"
+  }
+];

+ 51 - 10
src/views/InvoiceSaleSettings/commodityCost/config/content.config.ts

@@ -1,7 +1,22 @@
 import { ContentConfig } from "/@/components/PageContent";
-import { httpList } from "/@/api/parameter/clients";
+import { httpList } from "/@/api/InvoiceSaleSettings/commodityCost";
 
 import dayjs from "dayjs";
+import { h } from "vue";
+import { ElImage, ElTag } from "element-plus";
+import { good_type } from "./configs";
+
+function renderGoodImage(imgSrc: string) {
+  const imgs = imgSrc.split(",");
+  return h(ElImage, {
+    src: imgs[0],
+    previewTeleported: true,
+    previewSrcList: [imgs[0]],
+    style: {
+      height: "20px"
+    }
+  });
+}
 
 const columns = [
   {
@@ -16,20 +31,46 @@ const columns = [
     hide: ({ checkList }) => !checkList.includes("序号列")
   },
   {
-    label: "客户编号",
+    label: "商品编码",
+    prop: "spuCode"
+  },
+  {
+    label: "供应商编号",
+    prop: "supplierNo"
+  },
+  {
+    label: "业务企业编号",
     prop: "companyNo"
   },
   {
-    label: "客户名称",
-    prop: "companyName"
+    label: "商品名称",
+    prop: "good_name"
+  },
+  {
+    label: "商品主图",
+    prop: "good_img",
+    cellRenderer: ({ row }) => renderGoodImage(row.good_img)
   },
   {
-    label: "归属集团",
-    prop: "parent"
+    label: "类目名称",
+    prop: "inv_cat_name"
   },
   {
-    label: "联系人",
-    prop: "contactor"
+    label: "开票商品名称",
+    prop: "inv_good_name"
+  },
+  {
+    label: "创建人",
+    prop: "creater"
+  },
+  {
+    label: "状态",
+    prop: "status",
+    cellRenderer: ({ row }) => {
+      return h(ElTag, null, {
+        default: () => good_type.find(t => t.value === row.status)?.label
+      });
+    }
   },
   {
     label: "创建时间",
@@ -48,10 +89,10 @@ const columns = [
 const contentConfig: ContentConfig = {
   title: "销售成本类目设置",
   columns,
-  notReuqiredInit: true,
   apis: {
     httpList
-  }
+  },
+  powers: ["001", "002", "003", "004", "005", "006", "007", "008"]
 };
 
 export default contentConfig;

+ 19 - 25
src/views/InvoiceSaleSettings/commodityCost/config/search.config.ts

@@ -1,44 +1,38 @@
+import { good_type } from "./configs";
 import { FormConfig } from "/@/components/PageSearch";
 
 const searchFormConfig: FormConfig = {
   formItems: [
     {
-      field: "company",
+      field: "status",
+      type: "select",
+      placeholder: "商品状态",
+      options: good_type
+    },
+    {
+      field: "spuCode",
       type: "input",
-      placeholder: "商品分类"
+      placeholder: "商品编码"
     },
     {
-      field: "timer",
-      type: "date_picker",
-      placeholder: "联系人",
-      otherOptions: {
-        type: "daterange",
-        startPlaceholder: "开始时间",
-        endPlaceholder: "结束时间"
-      }
+      field: "good_name",
+      type: "input",
+      placeholder: "商品名称"
     },
     {
-      field: "timer",
-      type: "select",
-      placeholder: "设置状态",
-      options: [
-        {
-          label: "未设置"
-        },
-        {
-          label: "已设置"
-        }
-      ]
+      field: "companyNo",
+      type: "input",
+      placeholder: "业务企业编号"
     },
     {
-      field: "timer",
+      field: "supplierNo",
       type: "input",
-      placeholder: "商品名称"
+      placeholder: "供应商编号"
     },
     {
-      field: "timer",
+      field: "creater",
       type: "input",
-      placeholder: "商品编码"
+      placeholder: "创建人名称"
     }
   ]
 };

+ 36 - 1
src/views/InvoiceSaleSettings/commodityCost/detail.vue

@@ -1,7 +1,42 @@
 <script setup lang="ts">
+import { computed, onMounted, ref } from "vue";
+import { useRoute } from "vue-router";
+import { useResponseHandle } from "/@/hooks";
 import BasicSettings from "../basic-settings.vue";
+import { good_detail_columns } from "./config/configs";
+
+import {
+  type IGoodDetail,
+  httpDetail
+} from "/@/api/InvoiceSaleSettings/commodityCost";
+
+const { query } = useRoute();
+
+const spuCode = computed(() => query.id);
+const goodDetail = ref<IGoodDetail | null>(null);
+const responseHandle = useResponseHandle();
+
+//请求商品详情
+async function requesetGoodDetail() {
+  const { code, message, data } = await httpDetail({
+    spuCode: spuCode.value
+  });
+
+  responseHandle({
+    code,
+    message,
+    handler: () => (goodDetail.value = data)
+  });
+}
+
+onMounted(() => requesetGoodDetail());
 </script>
 
 <template>
-  <BasicSettings :detail="{}" :columns="[]" title="销售成本类目设置" />
+  <BasicSettings
+    title="销售成本类目设置"
+    back-route="/InvoiceSaleSettings/commodityCost"
+    :detail="goodDetail"
+    :columns="good_detail_columns"
+  />
 </template>

+ 8 - 3
src/views/InvoiceSaleSettings/commodityCost/index.vue

@@ -12,8 +12,13 @@ defineOptions({
 const { pageContentRef, handleResetClick, handleSearchClick } = usePageSearch();
 const { push } = useRouter();
 
-function toDetail() {
-  push("/InvoiceSaleSettings/consultingCostDetail");
+function toDetail(spuCode) {
+  push({
+    path: "/InvoiceSaleSettings/commodityCostDetail",
+    query: {
+      id: spuCode
+    }
+  });
 }
 </script>
 
@@ -28,7 +33,7 @@ function toDetail() {
     <PageContent
       ref="pageContentRef"
       :content-config="contentConfig"
-      @click="toDetail"
+      @preview-btn-click="({ spuCode }) => toDetail(spuCode)"
     />
   </div>
 </template>

+ 130 - 0
src/views/InvoiceSaleSettings/consultingCost/config/configs.ts

@@ -0,0 +1,130 @@
+import { ElImage, ElTag } from "element-plus";
+import { h } from "vue";
+
+export const good_type = [
+  {
+    value: "0",
+    label: "未关联开票类目"
+  },
+  {
+    value: "1",
+    label: "已关联"
+  }
+];
+
+export const stock_type = [
+  {
+    value: "0",
+    label: "库存"
+  },
+  {
+    value: "1",
+    label: "非库存"
+  }
+];
+
+//类目新增校验规则
+export const cost_rules = {
+  cat_code: [{ required: true, trigger: "change", message: "请选择类目" }],
+  inv_good_name: [
+    { required: true, trigger: "change", message: "请选择商品名称" }
+  ],
+  tax: [{ required: true, trigger: "change", message: "请选择税率" }]
+};
+
+export const good_detail_columns = [
+  {
+    field: "spuCode",
+    label: "商品编号"
+  },
+  {
+    field: "good_name",
+    label: "商品名称"
+  },
+  {
+    field: "companyNo",
+    label: "业务公司编号"
+  },
+  {
+    field: "supplierNo",
+    label: "供应商编号"
+  },
+  {
+    field: "is_stock",
+    label: "是否库存",
+    render(stock) {
+      return h(ElTag, null, {
+        default: () => stock_type.find(s => s.value === stock)?.label
+      });
+    }
+  },
+  {
+    field: "craft_desc",
+    label: "工艺描述"
+  },
+  {
+    field: "good_img",
+    label: "商品图",
+    render(imgSrc) {
+      return imgSrc.split(",").map(src =>
+        h(ElImage, {
+          src,
+          previewTeleported: true,
+          previewSrcList: [src],
+          style: {
+            height: "20px"
+          }
+        })
+      );
+    }
+  },
+  {
+    field: "creater",
+    label: "创建人"
+  },
+  {
+    field: "cat_name",
+    label: "分类名称"
+  },
+  {
+    field: "unit_name",
+    label: "单位名称"
+  },
+  {
+    field: "status",
+    label: "是否关联开票类目",
+    render(status) {
+      return h(ElTag, null, {
+        default: () => good_type.find(s => s.value === status)?.label
+      });
+    }
+  },
+  {
+    field: "inv_cat_name",
+    label: "类目名称"
+  },
+  {
+    field: "inv_cat_code",
+    label: "类目编号"
+  },
+  {
+    field: "inv_tax",
+    label: "类目税率额"
+  },
+  {
+    field: "inv_good_name",
+    label: "开票商品名称"
+  },
+  {
+    field: "inv_good_name",
+    label: "开票商品名称"
+  },
+  {
+    field: "addtime",
+    label: "申请时间"
+  },
+  {
+    field: "after_sales",
+    label: "售后"
+  }
+];

+ 36 - 12
src/views/InvoiceSaleSettings/consultingCost/config/content.config.ts

@@ -1,7 +1,25 @@
 import { ContentConfig } from "/@/components/PageContent";
-import { httpList } from "/@/api/parameter/clients";
+import { httpList } from "/@/api/InvoiceSaleSettings/consultingCost";
 
 import dayjs from "dayjs";
+import { h } from "vue";
+import { ElImage, ElTag } from "element-plus";
+import { good_type } from "./configs";
+
+function renderGoodImage(imgSrc: string) {
+  const imgs = imgSrc.split(",");
+  return imgs.map(src =>
+    h(ElImage, {
+      src,
+      style: {
+        height: "30px",
+        marginRight: "10px"
+      },
+      previewTeleported: true,
+      previewSrcList: imgs
+    })
+  );
+}
 
 const columns = [
   {
@@ -16,20 +34,26 @@ const columns = [
     hide: ({ checkList }) => !checkList.includes("序号列")
   },
   {
-    label: "客户编号",
-    prop: "companyNo"
+    label: "商品编码",
+    prop: "spuCode"
   },
   {
-    label: "客户名称",
-    prop: "companyName"
+    label: "商品名称",
+    prop: "good_name"
   },
   {
-    label: "归属集团",
-    prop: "parent"
+    label: "商品主图",
+    prop: "good_img",
+    cellRenderer: ({ row }) => renderGoodImage(row.good_img)
   },
   {
-    label: "联系人",
-    prop: "contactor"
+    label: "状态",
+    prop: "status",
+    cellRenderer: ({ row }) => {
+      return h(ElTag, null, {
+        default: () => good_type.find(t => t.value === row.status)?.label
+      });
+    }
   },
   {
     label: "创建时间",
@@ -46,12 +70,12 @@ const columns = [
 ];
 
 const contentConfig: ContentConfig = {
-  title: "咨询成类目设置",
+  title: "咨询成类目设置",
   columns,
-  notReuqiredInit: true,
   apis: {
     httpList
-  }
+  },
+  powers: ["001", "002", "003", "004", "005", "006", "007", "008"]
 };
 
 export default contentConfig;

+ 19 - 25
src/views/InvoiceSaleSettings/consultingCost/config/search.config.ts

@@ -1,44 +1,38 @@
+import { good_type } from "./configs";
 import { FormConfig } from "/@/components/PageSearch";
 
 const searchFormConfig: FormConfig = {
   formItems: [
     {
-      field: "company",
+      field: "status",
+      type: "select",
+      placeholder: "商品状态",
+      options: good_type
+    },
+    {
+      field: "spuCode",
       type: "input",
-      placeholder: "商品分类"
+      placeholder: "商品code"
     },
     {
-      field: "timer",
-      type: "date_picker",
-      placeholder: "联系人",
-      otherOptions: {
-        type: "daterange",
-        startPlaceholder: "开始时间",
-        endPlaceholder: "结束时间"
-      }
+      field: "good_name",
+      type: "input",
+      placeholder: "商品名称"
     },
     {
-      field: "timer",
-      type: "select",
-      placeholder: "设置状态",
-      options: [
-        {
-          label: "未设置"
-        },
-        {
-          label: "已设置"
-        }
-      ]
+      field: "companyNo",
+      type: "input",
+      placeholder: "业务企业编号"
     },
     {
-      field: "timer",
+      field: "supplierNo",
       type: "input",
-      placeholder: "商品名称"
+      placeholder: "供应商编号"
     },
     {
-      field: "timer",
+      field: "creater",
       type: "input",
-      placeholder: "商品编码"
+      placeholder: "创建人名称"
     }
   ]
 };

+ 0 - 7
src/views/InvoiceSaleSettings/consultingCost/deatil.vue

@@ -1,7 +0,0 @@
-<script setup lang="ts">
-import BasicSettings from "../basic-settings.vue";
-</script>
-
-<template>
-  <BasicSettings :detail="{}" :columns="[]" title="咨询成本类目设置" />
-</template>

+ 42 - 0
src/views/InvoiceSaleSettings/consultingCost/detail.vue

@@ -0,0 +1,42 @@
+<script setup lang="ts">
+import { computed, onMounted, ref } from "vue";
+import { useRoute } from "vue-router";
+import { useResponseHandle } from "/@/hooks";
+import BasicSettings from "../basic-settings.vue";
+import { good_detail_columns } from "./config/configs";
+
+import {
+  type IGoodDetail,
+  httpDetail
+} from "/@/api/InvoiceSaleSettings/commodityCost";
+
+const { query } = useRoute();
+
+const spuCode = computed(() => query.id);
+const goodDetail = ref<IGoodDetail | null>(null);
+const responseHandle = useResponseHandle();
+
+//请求商品详情
+async function requesetGoodDetail() {
+  const { code, message, data } = await httpDetail({
+    spuCode: spuCode.value
+  });
+
+  responseHandle({
+    code,
+    message,
+    handler: () => (goodDetail.value = data)
+  });
+}
+
+onMounted(() => requesetGoodDetail());
+</script>
+
+<template>
+  <BasicSettings
+    title="咨询成交类目设置"
+    back-route="/InvoiceSaleSettings/consultingCost"
+    :detail="goodDetail"
+    :columns="good_detail_columns"
+  />
+</template>

+ 12 - 20
src/views/InvoiceSaleSettings/consultingCost/index.vue

@@ -1,25 +1,25 @@
 <script setup lang="ts">
 import { PageSearch, usePageSearch } from "/@/components/PageSearch";
-import { PageModal, usePageModal } from "/@/components/PageModal";
 import { PageContent } from "/@/components/PageContent";
+import { useRouter } from "vue-router";
 import searchFormConfig from "./config/search.config";
 import contentConfig from "./config/content.config";
-import modalConfig from "./config/modal.config";
 
 defineOptions({
   name: "invoiceheader"
 });
 
 const { pageContentRef, handleResetClick, handleSearchClick } = usePageSearch();
+const { push } = useRouter();
 
-const {
-  pageModalRef,
-  handleUpdateData,
-  handleCreateData,
-  handlePreviewData,
-  handleConfrim,
-  defaultInfo
-} = usePageModal({ pageContentRef });
+function toDetail(spuCode) {
+  push({
+    path: "/InvoiceSaleSettings/consultingCostDetail",
+    query: {
+      id: spuCode
+    }
+  });
+}
 </script>
 
 <template>
@@ -29,19 +29,11 @@ const {
       @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"
-    />
-    <PageModal
-      ref="pageModalRef"
-      prview-description
-      :modal-config="modalConfig"
-      :default-info="defaultInfo"
-      @confirm-btn-click="handleConfrim"
+      @preview-btn-click="({ spuCode }) => toDetail(spuCode)"
     />
   </div>
 </template>

+ 8 - 5
src/views/InvoiceSales/capitalClaim/components/basic-claim/related-order.vue

@@ -10,28 +10,31 @@ const props = defineProps<{
 
 const emit = defineEmits(["create-btn-click"]);
 const saleOrderList = ref<Array<Record<string, string>>>([]);
-const tradFeeMap = ref<Record<string, string>>({});
 const disabled = computed(() => !props.readonly);
 
+const mapSequenceNoToWapyfee = ref<Record<string, string>>({});
+
 const saleModalRef = ref<InstanceType<typeof SalesModal>>(null);
 
 function addSaleOrder(sales) {
   saleOrderList.value = sales;
+
   //根据sequenceNo建立映射
   sales.forEach(
     // 默认值未付款金额
-    ({ sequenceNo, wpay_fee }) => (tradFeeMap.value[sequenceNo] = wpay_fee)
+    ({ sequenceNo, wpay_fee }) =>
+      (mapSequenceNoToWapyfee.value[sequenceNo] = wpay_fee)
   );
 }
 
 function handleCreate() {
   const orderArr: any = [];
-  const keys = Object.keys(tradFeeMap.value);
+  const keys = Object.keys(mapSequenceNoToWapyfee.value);
 
   keys.forEach(sequenceNo =>
     orderArr.push({
       sequenceNo,
-      trad_fee: tradFeeMap.value[sequenceNo]
+      trad_fee: mapSequenceNoToWapyfee.value[sequenceNo]
     })
   );
 
@@ -65,7 +68,7 @@ function handleCreate() {
           size="small"
           placeholder="此次认领金额"
           v-if="col.label === '此次认领'"
-          v-model="tradFeeMap[row.sequenceNo]"
+          v-model="mapSequenceNoToWapyfee[row.sequenceNo]"
         />
 
         <el-tag v-else-if="col.prop === 'status'">

+ 28 - 39
src/views/InvoiceSales/invoiceApply/components/addEditForm.vue

@@ -1,33 +1,28 @@
 <script setup lang="ts">
 import { FormRules, ElForm } from "element-plus";
 import { reactive, ref } from "vue";
-import { httpUpdate, httpAdd } from "/@/api/system/menuOperator";
-import { responseHandle } from "/@/utils/responseHandle";
+import { httpUpdate, httpAdd } from "/@/api/InvoiceSales/invoiceApply";
 import { useNav } from "/@/layout/hooks/nav";
 import { inv_type_list } from "/@/utils/status";
-import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
 import RemoteSelect from "/@/components/RemoteSelect";
 import { httpList as httpBuyList } from "/@/api/parameter/invoiceheader";
 import { httpList as httpCompanylist } from "/@/api/parameter/finance";
 import orderDialog from "./order-dialog.vue";
-const { logout } = useNav();
-import { ElMessage } from "element-plus";
+
 enum FROM_TYPE {
   order = "order",
   invoice = "invoice"
 }
-interface orderItem {
-  key: number;
-  sequenceNo: string;
-  inv_fee: string;
-}
+
 const modelRef = ref<InstanceType<typeof orderDialog>>(null);
 const TYPE = ref<FROM_TYPE>(FROM_TYPE.order);
 const formRef = ref<InstanceType<typeof ElForm>>(null);
 const loading = ref(false);
-const showModel = ref(false);
 const orderList = ref([]);
 
+//映射sequenceNo -> inv_fee
+const mapSequenceNoToInvfee = ref<Record<string, string>>({});
+
 const emit = defineEmits(["reload"]);
 const initform = {
   companyNo: "", //销售方公司抬头
@@ -105,37 +100,17 @@ function handleCreate() {
 function handleEdit(index: number, row: any) {
   console.log(modelRef);
   modelRef.value.show();
-  // if (index === -1) {
-  //   modelRef.value.show();
-  //   // showModel.value = true;
-  // }
   console.log(index, row);
 }
+
 const handleDelete = (index: number, row: any) => {
   console.log(index, row);
 };
 
 function handleSave() {
-  formRef.value.validate(async vaild => {
-    if (vaild) {
-      // if (loading.value) return;
-      // const handler =
-      //   TYPE.value === FROM_TYPE.create ? handleCreate : handleUpdate;
-      // loading.value = true;
-      // const { api, data } = handler();
-      // const { message, code } = await api(data);
-      // responseHandle({
-      //   code,
-      //   message,
-      //   logout,
-      //   handler: () => {
-      //     loading.value = false;
-      //     emit("reload");
-      //   }
-      // });
-    }
-  });
+  formRef.value.validate(async vaild => {});
 }
+
 function menu_type_change() {
   const { invtype } = ruleForm.value;
   rules.email[0].required = invtype === "26" || invtype === "27";
@@ -146,6 +121,20 @@ async function companyNo_change(buy: boolean) {
   const { buy_id } = ruleForm.value;
   console.log(companyNo, buy_id);
 }
+
+function handleAddOrder(list) {
+  console.log(list);
+
+  mapSequenceNoToInvfee.value = {};
+
+  list.forEach(
+    ({ sequenceNo, inv_fee }) =>
+      (mapSequenceNoToInvfee.value[sequenceNo] = inv_fee)
+  );
+
+  //映射
+  orderList.value = list;
+}
 </script>
 
 <template>
@@ -240,22 +229,22 @@ async function companyNo_change(buy: boolean) {
               width="160"
             />
             <el-table-column
-              prop="address"
+              prop="companyNo"
               label="销售方公司编号"
               width="160"
             />
             <el-table-column
-              prop="address"
+              prop="companyName"
               label="销售方公司名称"
               width="160"
             />
             <el-table-column
-              prop="address"
+              prop="customerNo"
               label="购买方公司编号"
               width="160"
             />
             <el-table-column
-              prop="address"
+              prop="customerName"
               label="购买方公司名称"
               width="160"
             />
@@ -291,7 +280,7 @@ async function companyNo_change(buy: boolean) {
         >
       </div>
     </el-form>
-    <orderDialog ref="modelRef" />
+    <orderDialog ref="modelRef" @save-btn-click="handleAddOrder" />
   </div>
 </template>
 <style lang="scss" scoped>

+ 4 - 0
src/views/InvoiceSales/invoiceApply/components/columns.tsx

@@ -3,6 +3,10 @@ import dayjs from "dayjs";
 import { send_status_list, inv_status_list } from "/@/utils/status";
 export function useColumns() {
   const columns = ref([
+    {
+      type: "selection",
+      reserveSelection: true
+    },
     {
       label: "销售订单编号",
       prop: "sequenceNo",

+ 17 - 6
src/views/InvoiceSales/invoiceApply/components/order-dialog.vue

@@ -1,6 +1,6 @@
 <script setup lang="ts">
 import { FormRules, ElForm } from "element-plus";
-import { reactive, ref } from "vue";
+import { reactive, ref, unref } from "vue";
 import { httpOrderList } from "/@/api/InvoiceSales/invoiceApply";
 import { responseHandle } from "/@/utils/responseHandle";
 import { useNav } from "/@/layout/hooks/nav";
@@ -29,7 +29,7 @@ const pagination = reactive<PaginationProps>({
   currentPage: 1,
   background: true
 });
-const emit = defineEmits(["reload"]);
+const emit = defineEmits(["reload", "save-btn-click"]);
 const initform = {
   page: 1,
   size: 10,
@@ -71,17 +71,19 @@ async function handleCurrentChange(val: number) {
 }
 
 async function handleSizeChange(val: number) {
+  console.log(1111);
   ruleForm.value.size = val;
   ruleForm.value.page = 1;
   await onSearch();
 }
 function handleSelectionChange(val) {
+  console.log(val);
   handleSelection.value = val;
 }
 //列表展示
 async function onSearch() {
   loading.value = true;
-  const { code, data, message } = await httpOrderList(ruleForm);
+  const { code, data, message } = await httpOrderList(ruleForm.value);
   responseHandle({
     code,
     message,
@@ -131,6 +133,14 @@ async function companyNo_change(buy: boolean) {
   console.log(customerNo);
 }
 
+function handleConfirm() {
+  const selectList = unref(handleSelection);
+  if (selectList.length === 0) return ElMessage.error("请选择一个销售订单");
+
+  emit("save-btn-click", selectList);
+  showModel.value = false;
+}
+
 defineExpose({
   show
 });
@@ -149,7 +159,7 @@ defineExpose({
       :width="'1040px'"
       v-loading="loading"
     >
-      <el-row :gutter="10">
+      <el-row :gutter="10" mb-2>
         <el-col :span="12">
           <RemoteSelect
             v-model:value="ruleForm.customerNo"
@@ -168,7 +178,6 @@ defineExpose({
             start-placeholder="开始时间"
             end-placeholder="结束时间"
             format="YYYY-MM-DD"
-            @change="asd"
             value-forma="YYYY-MM-DD"
           />
           <!-- <el-date-picker
@@ -225,8 +234,8 @@ defineExpose({
             placeholder="订单编号"
             clearable
         /></el-col>
-        <el-col :span="6"> 111 </el-col>
       </el-row>
+
       <PureTable
         ref="tableRef"
         border
@@ -257,6 +266,8 @@ defineExpose({
        
         </template>
       </TableProBar> -->
+
+      <el-button type="primary" @click="handleConfirm">保存</el-button>
     </el-dialog>
   </div>
 </template>

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

@@ -87,7 +87,7 @@ async function resetSearch() {
 //新建/详情页面
 function editItem(id) {
   push({
-    path: "/InvoiceSales/invoiceApplyDeatil",
+    path: "/InvoiceSales/invoiceApplyDetail",
     query: {
       id
     }

+ 0 - 1
src/views/InvoiceSales/refund/components/create-refund/capital-modal.vue

@@ -13,7 +13,6 @@ 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"

+ 10 - 2
src/views/InvoiceSales/refund/config/configs.ts

@@ -1,4 +1,4 @@
-import { ElTag } from "element-plus";
+import { ElImage, ElTag } from "element-plus";
 import { h } from "vue";
 import { DescriptionColumns } from "/@/components/BasicDescriptions";
 export const capital_columns = [
@@ -114,7 +114,15 @@ export const refund_detail_columns: DescriptionColumns = [
   },
   {
     label: "退款截图凭证",
-    field: "return_img"
+    field: "return_img",
+    render(img_url) {
+      return h(ElImage, {
+        src: img_url,
+        style: { height: "20px" },
+        previewSrcList: [img_url],
+        previewTeleported: true
+      });
+    }
   },
   {
     label: "退款状态",

+ 10 - 2
src/views/InvoiceSales/refund/config/content.config.ts

@@ -2,7 +2,7 @@ import { ContentConfig } from "/@/components/PageContent";
 import { httpList } from "/@/api/InvoiceSales/refund";
 
 import dayjs from "dayjs";
-import { ElTag } from "element-plus";
+import { ElTag, ElImage } from "element-plus";
 import { h } from "vue";
 import { return_status } from "./configs";
 
@@ -32,7 +32,15 @@ const columns = [
   },
   {
     label: "退款回执",
-    prop: "return_img"
+    prop: "return_img",
+    cellRenderer: ({ row }) => {
+      return h(ElImage, {
+        src: row.return_img,
+        style: { height: "20px" },
+        previewSrcList: [row.return_img],
+        previewTeleported: true
+      });
+    }
   },
   {
     label: "退款原因",

+ 4 - 2
src/views/InvoiceSales/refund/detail.vue

@@ -3,9 +3,9 @@ import { computed, onMounted, ref } from "vue";
 import { useRoute, useRouter } from "vue-router";
 import CreateRefund from "./components/create-refund/index.vue";
 import RefundDetail from "./components/refund-detail/index.vue";
-import { httpDetail } from "/@/api/InvoiceSales/refund";
 import { approval_process } from "./components/approval-process";
 import { useResponseHandle } from "/@/hooks";
+import { httpStatus, httpDetail } from "/@/api/InvoiceSales/refund";
 
 const { query } = useRoute();
 const { push } = useRouter();
@@ -21,6 +21,7 @@ const currentProcess = computed(() => {
   return approval_process[status];
 });
 
+//退款详情
 async function requesetRefundDetail() {
   const { code, message, data } = await httpDetail({
     returnCode: returnCode.value
@@ -33,8 +34,9 @@ async function requesetRefundDetail() {
   });
 }
 
+//退票申请管理
 async function requesetRefundStatus(otherParmas) {
-  const { code, message } = await httpDetail({
+  const { code, message } = await httpStatus({
     returnCode: returnCode.value,
     ...otherParmas
   });

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

@@ -11,6 +11,15 @@ defineOptions({
 
 const { push } = useRouter();
 const { pageContentRef, handleResetClick, handleSearchClick } = usePageSearch();
+
+function toDetail(returnCode) {
+  push({
+    path: "/InvoiceSales/refundDetail",
+    query: {
+      id: returnCode
+    }
+  });
+}
 </script>
 
 <template>
@@ -24,15 +33,7 @@ const { pageContentRef, handleResetClick, handleSearchClick } = usePageSearch();
     <PageContent
       ref="pageContentRef"
       :content-config="contentConfig"
-      @preview-btn-click="
-        ({ returnCode }) =>
-          push({
-            path: '/InvoiceSales/refundDetail',
-            query: {
-              id: returnCode
-            }
-          })
-      "
+      @preview-btn-click="({ returnCode }) => toDetail(returnCode)"
     >
       <template #create>
         <el-button

+ 0 - 17
src/views/InvoiceSales/returnTicket/component/Initiate-audit/index.vue

@@ -1,17 +0,0 @@
-<script lang="ts" setup>
-const emit = defineEmits(["changeStatus"]);
-
-//发起申请审核流程 状态更改为1
-function handleInitiateAudit() {
-  emit("changeStatus", "1");
-}
-</script>
-
-<template>
-  <h1 text-xl py-2 font-bold>发起审核流程</h1>
-  <div flex justify-end w-full>
-    <el-button type="primary" @click="handleInitiateAudit"
-      >发起审核流程</el-button
-    >
-  </div>
-</template>

+ 0 - 30
src/views/InvoiceSales/returnTicket/component/business-audit/index.vue

@@ -1,30 +0,0 @@
-<script setup lang="ts">
-import { ElForm } from "element-plus";
-import { reactive } from "vue";
-import { audit_rules } from "../../config/rules";
-import { useAudit } from "../../hooks/use-audit";
-
-const emit = defineEmits(["changeStatus"]);
-
-const { handleAudit, formRef } = useAudit(() =>
-  emit("changeStatus", formData.status)
-);
-const formData = reactive({
-  status: ""
-});
-</script>
-<template>
-  <h1 text-xl font-bold py-2>业务审核</h1>
-  <el-form ref="formRef" :model="formData" :rules="audit_rules">
-    <el-form-item label="审核状态" prop="status">
-      <div flex justify-between w-full>
-        <el-select placeholder="请选择审核状态" v-model="formData.status">
-          <el-option label="通过" value="2" />
-          <el-option label="不通过" value="5" />
-        </el-select>
-
-        <el-button type="primary" @click="handleAudit">提交审核结果</el-button>
-      </div>
-    </el-form-item>
-  </el-form>
-</template>

+ 0 - 30
src/views/InvoiceSales/returnTicket/component/financial-audit/index.vue

@@ -1,30 +0,0 @@
-<script setup lang="ts">
-import { ElForm } from "element-plus";
-import { reactive } from "vue";
-import { audit_rules } from "../../config/rules";
-import { useAudit } from "../../hooks/use-audit";
-
-const emit = defineEmits(["changeStatus"]);
-
-const { handleAudit, formRef } = useAudit(() =>
-  emit("changeStatus", formData.status)
-);
-const formData = reactive({
-  status: ""
-});
-</script>
-<template>
-  <h1 text-xl font-bold py-2>财务审核</h1>
-  <el-form ref="formRef" :model="formData" :rules="audit_rules">
-    <el-form-item label="审核状态" prop="status">
-      <div flex justify-between w-full>
-        <el-select placeholder="请选择审核状态" v-model="formData.status">
-          <el-option label="通过" value="3" />
-          <el-option label="不通过" value="6" />
-        </el-select>
-
-        <el-button type="primary" @click="handleAudit">提交审核结果</el-button>
-      </div>
-    </el-form-item>
-  </el-form>
-</template>

+ 0 - 53
src/views/InvoiceSales/returnTicket/component/new-payment/index.vue

@@ -1,53 +0,0 @@
-<script setup lang="ts">
-import { reactive, ref } from "vue";
-import OrderTable from "./order-table.vue";
-import { httpAdd } from "/@/api/purchase/orderPay";
-import { create_rules } from "../../config/rules";
-import { useResponseHandle } from "/@/hooks";
-import { ElForm } from "element-plus";
-
-const responseHandle = useResponseHandle();
-
-const formRef = ref<InstanceType<typeof ElForm>>(null);
-const formData = reactive<Record<string, string>>({
-  payNo: "",
-  pay_fee: ""
-});
-
-function changeOrderDetail({ payNo }) {
-  formData.payNo = payNo;
-}
-
-function hanldeNewPayment() {
-  formRef.value.validate(async isValid => {
-    if (!isValid) return;
-
-    const { code, message, data } = await httpAdd(formData);
-
-    responseHandle({
-      code,
-      message,
-      handler: () => {
-        console.log(data);
-      }
-    });
-  });
-}
-</script>
-
-<template>
-  <h1 text-xl font-bold py-2>新建采购付款申请</h1>
-  <el-form ref="formRef" :model="formData" :rules="create_rules">
-    <el-form-item label="采购订单" prop="payNo">
-      <OrderTable @change-order-detail="changeOrderDetail" />
-    </el-form-item>
-    <el-form-item label="付款金额" prop="pay_fee">
-      <el-input placeholder="请输入付款金额" v-model="formData.pay_fee" />
-    </el-form-item>
-
-    <el-form-item pl-20>
-      <el-button type="primary" @click="hanldeNewPayment">保存</el-button>
-      <el-button>取消</el-button>
-    </el-form-item>
-  </el-form>
-</template>

+ 0 - 46
src/views/InvoiceSales/returnTicket/component/new-payment/order-table.vue

@@ -1,46 +0,0 @@
-<script setup lang="ts">
-import { onMounted, ref } from "vue";
-import { useResponseHandle } from "/@/hooks";
-import { httpList } from "/@/api/purchase/orderRecord";
-import { columns } from "../../config/columns";
-import { ElTable } from "element-plus";
-
-const emit = defineEmits(["change-order-detail"]);
-const tableRef = ref<InstanceType<typeof ElTable>>(null);
-const dataList = ref<Array<any>>([]);
-const responseHandle = useResponseHandle();
-
-async function requestOrderList() {
-  const { code, data, message } = await httpList({});
-
-  responseHandle({
-    code,
-    message,
-    handler: () => (dataList.value = data.list)
-  });
-}
-
-function handleCurrentChange(value) {
-  value && emit("change-order-detail", value);
-}
-
-onMounted(() => requestOrderList());
-</script>
-
-<template>
-  <el-table
-    border
-    ref="tableRef"
-    row-key="id"
-    :data="dataList"
-    highlight-current-row
-    @current-change="handleCurrentChange"
-  >
-    <el-table-column
-      v-for="(col, index) in columns"
-      :key="index"
-      v-bind="col"
-      show-overflow-tooltip
-    />
-  </el-table>
-</template>

+ 0 - 75
src/views/InvoiceSales/returnTicket/component/payment-receipt/index.vue

@@ -1,75 +0,0 @@
-<script setup lang="ts">
-import { ElForm, ElMessage, UploadProps } from "element-plus";
-import { reactive, ref } from "vue";
-import { receipt_rules } from "../../config/rules";
-
-const emit = defineEmits(["changeStatus"]);
-
-const formData = reactive({
-  return_image: "http://www.baidu.com",
-  retunr_time: ""
-});
-
-const types = ["image/png", "image/jpg", "image/bmp", "image/jpeg"];
-const formRef = ref<InstanceType<typeof ElForm>>(null);
-
-const onBeforeReturnImageUpload: UploadProps["beforeUpload"] = ({
-  type,
-  size
-}) => {
-  if (!types.includes(type)) {
-    ElMessage.error("请上传jpg.png.bmp.jpeg类型图片");
-    return false;
-  }
-
-  if (size / 1024 > 1) {
-    ElMessage.error("图片大小超过1M");
-    return false;
-  }
-};
-
-//付款回执 状态为4
-function handlePaymentReceipt() {
-  formRef.value.validate(isValid => {
-    if (isValid) emit("changeStatus", "5", formData);
-  });
-}
-</script>
-
-<template>
-  <h1 text-xl font-bold py-2>付款回执</h1>
-  <el-form ref="formRef" :model="formData" :rules="receipt_rules">
-    <el-form-item label="回执图片" prop="return_image">
-      <div>
-        <el-upload class="upload" :before-upload="onBeforeReturnImageUpload">
-          <div class="icon" />
-        </el-upload>
-        <span>大小:小于1M; 尺寸:100*100; 类型:jpg.png.bmp.jpeg</span>
-      </div>
-    </el-form-item>
-    <el-form-item label="回执时间" prop="return_time">
-      <el-date-picker type="datetime" v-model="formData.retunr_time" />
-    </el-form-item>
-
-    <el-form-item w-full flex justify-end>
-      <el-button type="primary" @click="handlePaymentReceipt">保存</el-button>
-    </el-form-item>
-  </el-form>
-</template>
-
-<style lang="scss">
-.upload {
-  width: 178px;
-  height: 178px;
-  display: block;
-  border: 1px dashed var(--el-border-color);
-}
-
-.icon {
-  font-size: 28px;
-  color: #8c939d;
-  width: 178px;
-  height: 178px;
-  text-align: center;
-}
-</style>

+ 153 - 0
src/views/InvoiceSales/returnTicket/components/approval-process/approval-pending.vue

@@ -0,0 +1,153 @@
+<script setup lang="ts">
+import { ElForm, ElMessage, UploadProps } from "element-plus";
+import { reactive, ref, watchEffect } from "vue";
+import { httpImageUpload, baseUrl } from "/@/api/other";
+import { useResponseHandle } from "/@/hooks";
+import { useUserStore } from "/@/store/modules/user";
+
+const emit = defineEmits(["changeStatus"]);
+
+const formData = reactive({
+  return_img: "",
+  status: "",
+  remark: ""
+});
+
+const types = ["image/png", "image/jpg", "image/bmp", "image/jpeg"];
+
+const rules = reactive({
+  return_img: [
+    {
+      required: true,
+      trigger: "change",
+      message: "请上传退款回执"
+    }
+  ],
+  status: [
+    {
+      required: true,
+      trigger: "change",
+      message: "选择审核状态"
+    }
+  ],
+  remark: [
+    {
+      required: true,
+      trigger: "change",
+      message: "请输入备注"
+    }
+  ]
+});
+
+const formRef = ref<InstanceType<typeof ElForm>>(null);
+const responseHandle = useResponseHandle();
+const userStore = useUserStore();
+
+const onBeforeReturnImageUpload: UploadProps["beforeUpload"] = ({
+  type,
+  size
+}) => {
+  if (!types.includes(type)) {
+    ElMessage.error("请上传jpg.png.bmp.jpeg类型图片");
+    return false;
+  }
+
+  if (size / 1024 / 1024 > 1) {
+    ElMessage.error("图片大小超过1M");
+    return false;
+  }
+};
+
+const handleRequeset: UploadProps["httpRequest"] = async ({ file }) => {
+  const _formData = new FormData();
+  _formData.append("img", file);
+  _formData.append("token", userStore.token);
+  const { message, code, data } = await httpImageUpload(_formData);
+
+  responseHandle({
+    message,
+    code,
+    handler: () => (formData.return_img = baseUrl + "/" + data[0].url)
+  });
+};
+
+const handlePaymentReceipt = () => {
+  formRef.value.validate(isValid => isValid && emit("changeStatus", formData));
+};
+
+watchEffect(() => {
+  rules.remark[0].required = formData.status === "3";
+});
+</script>
+
+<template>
+  <el-form
+    ref="formRef"
+    label-width="100px"
+    size="small"
+    :model="formData"
+    :rules="rules"
+  >
+    <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="3" />
+      </el-select>
+    </el-form-item>
+
+    <el-form-item label="备注" prop="remark" w-400px>
+      <el-input type="textarea" v-model="formData.remark" />
+    </el-form-item>
+
+    <el-form-item label="退款回执" prop="return_img">
+      <div>
+        <el-upload
+          class="upload"
+          :before-upload="onBeforeReturnImageUpload"
+          :http-request="handleRequeset"
+          :show-file-list="false"
+        >
+          <img
+            class="avatar"
+            v-if="formData.return_img"
+            :src="formData.return_img"
+          />
+          <div class="text" v-else>点击上传</div>
+        </el-upload>
+        <span text-sm>大小:小于1M; 尺寸:100*100; 类型:jpg.png.bmp.jpeg</span>
+      </div>
+    </el-form-item>
+
+    <el-form-item w-full flex justify-end>
+      <el-button type="primary" @click="handlePaymentReceipt">保存</el-button>
+    </el-form-item>
+  </el-form>
+</template>
+
+<style lang="scss">
+.upload {
+  width: 178px;
+  height: 178px;
+  display: block;
+  border: 1px dashed var(--el-border-color);
+
+  .text {
+    font-size: 20px;
+    color: #8c939d;
+    width: 178px;
+    height: 178px;
+    text-align: center;
+    line-height: 178px;
+  }
+
+  &:hover {
+    border-color: var(--el-color-primary);
+  }
+
+  .avatar {
+    width: 178px;
+    height: 178px;
+    display: block;
+  }
+}
+</style>

+ 8 - 0
src/views/InvoiceSales/returnTicket/components/approval-process/index.ts

@@ -0,0 +1,8 @@
+import ApprovalPending from "./approval-pending.vue";
+
+export const approval_process = {
+  "0": {
+    title: "待审批",
+    component: ApprovalPending
+  }
+};

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

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

+ 0 - 82
src/views/InvoiceSales/returnTicket/config/columns.ts

@@ -1,82 +0,0 @@
-export const columns = [
-  // {
-  //   type: "selection",
-  //   width: 55
-  // },
-  {
-    label: "对账编号",
-    prop: "payNo",
-    minWidth: 180,
-    align: "left"
-  },
-  {
-    label: "供应商编号",
-    prop: "supplierNo",
-    minWidth: 180,
-    align: "left"
-  },
-  {
-    label: "供应商名称",
-    prop: "supplierName",
-    minWidth: 180,
-    align: "left"
-  },
-  {
-    label: "申请人编号",
-    prop: "apply_name",
-    minWidth: 180,
-    align: "left"
-  },
-  {
-    label: "总额款",
-    prop: "total_fee",
-    minWidth: 180,
-    align: "total_fee"
-  },
-  {
-    label: "已付款金额",
-    prop: "apay_fee",
-    minWidth: 180,
-    align: "left"
-  },
-  {
-    label: "待付款金额",
-    prop: "pay_fee",
-    minWidth: 180,
-    align: "left"
-  },
-  {
-    label: "已回票金额",
-    prop: "ainv_fee",
-    minWidth: 180,
-    align: "left"
-  },
-  {
-    label: "未回票金额",
-    prop: "winv_fee",
-    minWidth: 180,
-    align: "left"
-  }
-  // {
-  //   label: "状态",
-  //   prop: "status",
-  //   minWidth: 120,
-  //   cellRenderer: ({ row, props }) =>
-  //     h(
-  //       ElTag,
-  //       {
-  //         size: props.size
-  //       },
-  //       {
-  //         default: () => statusOptions.find(s => row.status === s.value).label
-  //       }
-  //     )
-  // },
-  // {
-  //   label: "申请时间",
-  //   minWidth: 180,
-  //   prop: "createTime",
-  //   formatter: ({ createTime }) =>
-  //     dayjs(createTime).format("YYYY-MM-DD HH:mm:ss")
-  // }
-];

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

@@ -0,0 +1,200 @@
+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: "财务驳回"
+  }
+];

+ 119 - 0
src/views/InvoiceSales/returnTicket/config/content.config.ts

@@ -0,0 +1,119 @@
+import { ContentConfig } from "/@/components/PageContent";
+import { httpList } from "/@/api/InvoiceSales/returnTicket";
+import { httpAdd } from "/@/api/InvoiceSales/returnTicket";
+
+import dayjs from "dayjs";
+import { ElTag } from "element-plus";
+import { h } from "vue";
+import { return_status } from "./configs";
+
+const columns = [
+  {
+    type: "selection",
+    width: 55,
+    hide: ({ checkList }) => !checkList.includes("勾选列")
+  },
+  {
+    label: "序号",
+    type: "index",
+    width: 70,
+    hide: ({ checkList }) => !checkList.includes("序号列")
+  },
+  {
+    label: "退票编号",
+    prop: "returnCode"
+  },
+  {
+    label: "付款单位名称",
+    prop: "buyer_title"
+  },
+  {
+    label: "付款银行名称",
+    prop: "buyer_bank"
+  },
+  {
+    label: "付款账号",
+    prop: "inv_value"
+  },
+  {
+    label: "收款单位名称",
+    prop: "inv_in"
+  },
+  {
+    label: "申请时间",
+    prop: "addtime",
+    formatter: ({ addtime }) => dayjs(addtime).format("YYYY-MM-DD HH:mm:ss")
+  },
+  {
+    label: "资金状态",
+    prop: "status",
+    cellRenderer: ({ row }) => {
+      return h(ElTag, null, {
+        default: () => return_status.find(s => s.value === row.status)?.label
+      });
+    }
+  },
+  {
+    label: "操作",
+    fixed: "right",
+    width: 80,
+    slot: "operation"
+  }
+];
+
+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
+  }
+};
+
+export default contentConfig;

+ 49 - 0
src/views/InvoiceSales/returnTicket/config/modal.config.ts

@@ -0,0 +1,49 @@
+import { ModalConfig } from "/@/components/PageModal/src/types";
+
+const modalConfig: ModalConfig = {
+  title: "退票申请",
+  colLayout: { span: 24 },
+  formItems: [
+    {
+      field: "invNo",
+      type: "input",
+      label: "发票编号",
+      labelWidth: "120px",
+      rules: [
+        {
+          required: true,
+          trigger: "change",
+          message: "请输入发票编号"
+        }
+      ]
+    },
+    {
+      field: "return_reason",
+      type: "input",
+      labelWidth: "120px",
+      label: "退货原因",
+      rules: [
+        {
+          required: true,
+          trigger: "change",
+          message: "请输入退货原因"
+        }
+      ]
+    },
+    {
+      field: "remark",
+      type: "input",
+      labelWidth: "120px",
+      label: "备注",
+      rules: [
+        {
+          required: true,
+          trigger: "change",
+          message: "请输入备注"
+        }
+      ]
+    }
+  ]
+};
+
+export default modalConfig;

+ 0 - 17
src/views/InvoiceSales/returnTicket/config/rules.ts

@@ -1,17 +0,0 @@
-export const create_rules = {
-  pay_fee: [{ required: true, trigger: "change", message: "请输入付款金额" }],
-  payNo: [{ required: true, trigger: "change", message: "请选择付款订单" }]
-};
-
-export const audit_rules = {
-  status: [{ required: true, trigger: "change", message: "请选择审核状态" }]
-};
-
-export const receipt_rules = {
-  return_image: [
-    { required: true, trigger: "change", message: "请选择上传回执图片" }
-  ],
-  return_time: [
-    { required: true, trigger: "change", message: "请选择上传回执时间" }
-  ]
-};

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

@@ -0,0 +1,36 @@
+import { return_status, return_type } from "./configs";
+import { FormConfig } from "/@/components/PageSearch";
+
+const searchFormConfig: FormConfig = {
+  formItems: [
+    {
+      field: "tradNo",
+      type: "input",
+      placeholder: "资金编号"
+    },
+    {
+      field: "logNo",
+      type: "input",
+      placeholder: "资金认领编号"
+    },
+    {
+      field: "returnCode",
+      type: "input",
+      placeholder: "退款编号"
+    },
+    {
+      field: "type",
+      type: "select",
+      placeholder: "退款类型",
+      options: return_type
+    },
+    {
+      field: "status",
+      type: "select",
+      placeholder: "退款状态",
+      options: return_status
+    }
+  ]
+};
+
+export default searchFormConfig;

+ 87 - 0
src/views/InvoiceSales/returnTicket/detail.vue

@@ -0,0 +1,87 @@
+<script setup lang="ts">
+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";
+
+const { query } = useRoute();
+const { push } = useRouter();
+
+const collapses = ref(["1", "2"]);
+const returnCode = computed(() => query.id);
+
+const isCreate = computed(() => !returnCode.value);
+const refundDetail = ref<Record<string, string>>({});
+const responseHandle = useResponseHandle();
+
+//映射当前审批流程
+const currentProcess = computed(() => {
+  const { status } = refundDetail.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();
+}
+
+onMounted(() => initalData());
+</script>
+<template>
+  <div class="refund__content" bg-white>
+    <!-- 详情 -->
+    <ElCollapse v-model="collapses">
+      <!-- 退票单详情 -->
+      <ElCollapseItem title="退票单详情" name="1">
+        <RefundDetail :detail="refundDetail" />
+      </ElCollapseItem>
+
+      <!-- 审核 -->
+      <ElCollapseItem
+        name="2"
+        v-if="currentProcess"
+        :title="currentProcess.title"
+      >
+        <component
+          :is="currentProcess.component"
+          @change-status="requesetRetrunTicketStatus"
+        />
+      </ElCollapseItem>
+    </ElCollapse>
+  </div>
+</template>
+
+<style lang="scss" scoped>
+.refund__content {
+  padding: 20px !important;
+}
+</style>

+ 0 - 17
src/views/InvoiceSales/returnTicket/hooks/use-audit.ts

@@ -1,17 +0,0 @@
-import { ElForm } from "element-plus";
-import { ref } from "vue";
-
-export function useAudit(callback: () => void) {
-  const formRef = ref<InstanceType<typeof ElForm>>(null);
-
-  function handleAudit() {
-    formRef.value.validate(isValid => {
-      if (!isValid) callback();
-    });
-  }
-
-  return {
-    formRef,
-    handleAudit
-  };
-}

+ 45 - 33
src/views/InvoiceSales/returnTicket/index.vue

@@ -1,46 +1,58 @@
 <script setup lang="ts">
-import NewPayment from "./component/new-payment/index.vue";
-import InitiateAudit from "./component/Initiate-audit/index.vue";
-import BusinessAudit from "./component/business-audit/index.vue";
-import FinancialAudit from "./component/financial-audit/index.vue";
-import PaymentReceipt from "./component/payment-receipt/index.vue";
-import { httpStatus } from "/@/api/purchase/orderPay";
-import { useResponseHandle } from "/@/hooks";
-
-const responseHandle = useResponseHandle();
-
-//更改付款订单状态
-async function requestStatusChange(
-  status: string,
-  otherParam: Record<string, string> = {}
-) {
-  const { code, message } = await httpStatus({
-    status,
-    ...otherParam
-  });
+import { PageSearch, usePageSearch } from "/@/components/PageSearch";
+import { PageModal, usePageModal } from "/@/components/PageModal";
+import { PageContent } from "/@/components/PageContent";
+import searchFormConfig from "./config/search.config";
+import modalConfig from "./config/modal.config";
+import contentConfig from "./config/content.config";
+import { useRouter } from "vue-router";
+
+defineOptions({
+  name: "invoiceheader"
+});
+
+const { push } = useRouter();
+const { pageContentRef, handleResetClick, handleSearchClick } = usePageSearch();
 
-  responseHandle({
-    code,
-    message,
-    handler: () => {
-      //todo:回到采购付款订单列表
+const { pageModalRef, handleCreateData, handleConfrim } = usePageModal({
+  pageContentRef
+});
+
+function toDetail(returnCode) {
+  push({
+    path: "/InvoiceSales/returnTicketDetail",
+    query: {
+      id: returnCode
     }
   });
 }
 </script>
 
 <template>
-  <div class="pay__content" bg-white>
-    <NewPayment />
-    <InitiateAudit @change-status="requestStatusChange" />
-    <BusinessAudit @change-status="requestStatusChange" />
-    <FinancialAudit @change-status="requestStatusChange" />
-    <PaymentReceipt @change-status="requestStatusChange" />
+  <div class="main role">
+    <PageSearch
+      :form-config="searchFormConfig"
+      @search-btn-click="handleSearchClick"
+      @reset-btn-click="handleResetClick"
+    />
+
+    <PageContent
+      ref="pageContentRef"
+      :content-config="contentConfig"
+      @preview-btn-click="({ returnCode }) => toDetail(returnCode)"
+      @create-btn-click="handleCreateData"
+    />
+
+    <PageModal
+      ref="pageModalRef"
+      :modalConfig="modalConfig"
+      @confirm-btn-click="handleConfrim"
+    />
   </div>
 </template>
 
-<style lang="scss">
-.pay__content {
-  padding: 30px !important;
+<style scoped lang="scss">
+:deep(.el-dropdown-menu__item i) {
+  margin: 0;
 }
 </style>