snow пре 5 месеци
родитељ
комит
77e576fce3
32 измењених фајлова са 2792 додато и 809 уклоњено
  1. 294 415
      pnpm-lock.yaml
  2. 14 6
      src/api/InvoiceSales/capitalClaim/index.ts
  3. 57 0
      src/components/FundDetail/index.vue
  4. 3 3
      src/components/PageAuth/src/page-auth.tsx
  5. 1 51
      src/views/InvoiceSales/capitalClaim/components/basic-claim/receipt-payment.vue
  6. 0 1
      src/views/InvoiceSales/capitalClaim/components/basic-claim/related-order.vue
  7. 4 11
      src/views/InvoiceSales/capitalClaim/components/claim-detail/index.vue
  8. 14 8
      src/views/InvoiceSales/capitalClaim/components/execl-files-upload/columns-config.ts
  9. 33 18
      src/views/InvoiceSales/capitalClaim/components/execl-files-upload/index.vue
  10. 58 15
      src/views/InvoiceSales/capitalClaim/config/configs.ts
  11. 7 19
      src/views/InvoiceSales/capitalClaim/config/content.config.ts
  12. 5 1
      src/views/InvoiceSales/capitalClaim/config/search.config.ts
  13. 4 1
      src/views/InvoiceSales/capitalClaim/config/xls-template.ts
  14. 33 225
      src/views/InvoiceSales/capitalClaim/index.vue
  15. 51 0
      src/views/InvoiceSales/capitalPool/approval-process/approval-pending.vue
  16. 8 0
      src/views/InvoiceSales/capitalPool/approval-process/index.ts
  17. 420 0
      src/views/InvoiceSales/capitalPool/base-form/choose-invoice-modal/config/configs.ts
  18. 130 0
      src/views/InvoiceSales/capitalPool/base-form/choose-invoice-modal/config/content.config.ts
  19. 57 0
      src/views/InvoiceSales/capitalPool/base-form/choose-invoice-modal/config/search.config.ts
  20. 24 0
      src/views/InvoiceSales/capitalPool/base-form/choose-invoice-modal/config/xls-template.ts
  21. 67 0
      src/views/InvoiceSales/capitalPool/base-form/choose-invoice-modal/index.vue
  22. 420 0
      src/views/InvoiceSales/capitalPool/base-form/configs.ts
  23. 152 0
      src/views/InvoiceSales/capitalPool/base-form/index.vue
  24. 286 0
      src/views/InvoiceSales/capitalPool/base-form/sales-modal.vue
  25. 55 0
      src/views/InvoiceSales/capitalPool/components/execl-capital-files-upload/columns-config.ts
  26. 186 0
      src/views/InvoiceSales/capitalPool/components/execl-capital-files-upload/index.vue
  27. 8 13
      src/views/InvoiceSales/capitalPool/config/content.config.ts
  28. 24 0
      src/views/InvoiceSales/capitalPool/config/xls-template.ts
  29. 109 0
      src/views/InvoiceSales/capitalPool/detail.vue
  30. 206 13
      src/views/InvoiceSales/capitalPool/index.vue
  31. 33 6
      src/views/InvoiceSales/invoiceApply/components/add-edit-form/add-edit-form.vue
  32. 29 3
      src/views/InvoiceSales/invoiceApply/components/currentcy-form/add-edit-form.vue

Разлика између датотеке није приказан због своје велике величине
+ 294 - 415
pnpm-lock.yaml


+ 14 - 6
src/api/InvoiceSales/capitalClaim/index.ts

@@ -1,6 +1,6 @@
 import { http } from "/@/utils/http";
 import { loadEnv } from "@build/index";
-const { VITE_PROXY_DOMAIN_REAL, VITE_PROXY_USER_REAL } = loadEnv();
+const { VITE_PROXY_DOMAIN_REAL, VITE_PROXY_USER_REAL, VITE_WORKORDER_REAL } = loadEnv();
 const userAPi = VITE_PROXY_DOMAIN_REAL;
 const yewuApi = VITE_PROXY_USER_REAL + "/admin/";
 interface ResponseType extends Promise<any> {
@@ -9,6 +9,7 @@ interface ResponseType extends Promise<any> {
   msg?: string;
 }
 
+const newApi = VITE_WORKORDER_REAL
 // 添加
 export const httpAdd = (data: object): ResponseType => {
   return http.request("post", `${yewuApi}orderpayadd`, { data });
@@ -19,6 +20,10 @@ export const httpList = (data: object): ResponseType => {
   return http.request("post", `${yewuApi}orderpaylist`, { data });
 };
 
+export const httpNewList = (data: object): ResponseType => {
+  return http.request("post", `${newApi}cxinv/trade/list `, { data });
+};
+
 export const httpDelete = (data: object): ResponseType => {
   return http.request("post", `${yewuApi}orderPay/tradeDelete`, { data });
 };
@@ -29,7 +34,7 @@ export const httpInfo = (data: object): ResponseType => {
 
 //上传execl
 export const httpUpload = (data: any): any => {
-  return http.request("post", `${yewuApi}importTrade`, { data });
+  return http.request("post", `${newApi}cxinv/trade/importTradeByArr`, { data });
 };
 
 //资金认领订单列表明细
@@ -49,12 +54,15 @@ export const httpSaleList = (data: any): any => {
 
 export const httpWithdraw = (data: any): any => {
   return http.request("post", `${yewuApi}orderpaystatus`, {
-    data: {
-      status: "5",
-      ...data
-    }
+    data: { status: "5", ...data }
   });
 };
+
+
+export const httpBatchStatus = (data: any): any => {
+  return http.request("post", `${newApi}cxinv/trade/PoolBatchCheck`, { data });
+};
+
 //上传execl
 export const httpCapitalUpload = (data: any): any => {
   return http.request("post", `${yewuApi}importTradeByBatchOrderCode`, {

+ 57 - 0
src/components/FundDetail/index.vue

@@ -0,0 +1,57 @@
+<script setup lang="ts">
+import { h } from "vue"
+import BasicDescriptions from "/@/components/BasicDescriptions";
+import { ElTag } from "element-plus"
+
+defineProps<{ tradeInfo: Record<string, string>; }>();
+
+
+const status_options = [
+  { label: "未认领", value: "1" },
+  { label: "部分认领", value: "2" },
+  { label: "已认领", value: "3" }
+]
+
+ const columns = [
+  { label: "资金编码", span: 8, field: "tradNo" },
+  {
+    label: "状态",
+    field: "status",
+    slot: "status",
+    span: 8,
+    render(status) {
+      return h(
+        ElTag,
+        { size: "small" },
+        { default: () => status_options.find(s => s.value === String(status))?.label }
+      );
+    }
+  },
+  { label: "新建时间", span: 8, field: "addtime" },
+  { label: "收入金额", span: 8, field: "total_fee" },
+  { label: "未认领金额", span: 8, field: "balance" },
+  { label: "已认领金额", span: 8, field: "used_fee" },
+  { label: '收款公司', field: 'trade_in', span: 8, },
+  { label: '收款公司账户', field: 'trade_in_account', span: 8 },
+  { label: '平台订单客户名称', field: 'customerName', span: 8 },
+  { label: "交易用途", span: 24, field: "trade_used" },
+  { label: "ND编号", field: "NdCode", span: 24 },
+  { label: "平台订单编号", field: "poCode", span: 24 },
+  { label: '付款单位名称', field: 'trade_out', span: 8 },
+  { label: '账户', field: 'trade_account', span: 8 },
+  { label: '交易时间', field: 'addtime', span: 8 },
+  { label: "交易行名",  field: 'trade_bank', span: 24 },
+  // { label: "付款方省市", span: 12, field: "" }
+];
+
+</script>
+
+<template>
+   <BasicDescriptions ref="defaultRef1" :data="tradeInfo" :columns="columns" />
+</template>
+
+<style lang="scss" scoped>
+:deep(.el-descriptions__label) {
+  width: 80px !important;
+}
+</style>

+ 3 - 3
src/components/PageAuth/src/page-auth.tsx

@@ -15,9 +15,9 @@ const PageAuth = defineComponent({
     }
   },
   setup(props, { slots }) {
-    const { permissions, hasPermissionWithCode } = usePermission(
-      props.pageName
-    );
+    const { permissions, hasPermissionWithCode } = usePermission(props.pageName);
+
+    
 
     const classes = computed(() => {
       const { margin } = props;

+ 1 - 51
src/views/InvoiceSales/capitalClaim/components/basic-claim/receipt-payment.vue

@@ -11,57 +11,7 @@ defineProps<{
 </script>
 
 <template>
-  <el-row>
-    <el-col :span="8">
-      <BasicDescriptions
-        ref="defaultRef1"
-        :data="tradeInfo"
-        :columns="public_columns"
-      />
-    </el-col>
-    <el-col :span="8">
-      <BasicDescriptions
-        ref="defaultRef2"
-        :data="tradeInfo"
-        :columns="description_columns_out"
-    /></el-col>
-    <el-col :span="8">
-      <BasicDescriptions
-        ref="defaultRef3"
-        :data="tradeInfo"
-        :columns="description_columns_in"
-    /></el-col>
-  </el-row>
-
-  <!-- <div flex>
-    <el-descriptions :column="1" border flex-1 size="small">
-      <el-descriptions-item
-        title="资金信息 "
-        v-for="(item, index) in public_columns"
-        :key="index"
-        :label="item.label"
-      >
-        {{ tradeInfo[item.field] }}
-      </el-descriptions-item>
-    </el-descriptions>
-    <el-descriptions :column="1" border flex-1 size="small">
-      <el-descriptions-item
-        v-for="(item, index) in description_columns_out"
-        :key="index"
-        :label="item.label"
-        >{{ tradeInfo[item.field] }}</el-descriptions-item
-      >
-    </el-descriptions>
-
-    <el-descriptions :column="1" border flex-1 size="small">
-      <el-descriptions-item
-        v-for="(item, index) in description_columns_in"
-        :key="index"
-        :label="item.label"
-        >{{ tradeInfo[item.field] }}</el-descriptions-item
-      >
-    </el-descriptions>
-  </div> -->
+   <BasicDescriptions ref="defaultRef1" :data="tradeInfo" :columns="public_columns" />
 </template>
 
 <style lang="scss" scoped>

+ 0 - 1
src/views/InvoiceSales/capitalClaim/components/basic-claim/related-order.vue

@@ -17,7 +17,6 @@ const mapSequenceNoToWapyfee = ref<Record<string, string>>({});
 const saleModalRef = ref<InstanceType<typeof SalesModal>>(null);
 
 function addSaleOrder(sales: Array<Record<string, string>>) {
-  console.log(sales);
   sales.forEach(sale => {
     const { sequenceNo, wpay_fee } = sale;
     if (!mapSequenceNoToWapyfee.value[sequenceNo]) {

+ 4 - 11
src/views/InvoiceSales/capitalClaim/components/claim-detail/index.vue

@@ -25,19 +25,12 @@ const { run: createSaleRun } = useAsync({
 });
 
 //新增销售订单付款
-const requesetCreateSalePay = orderArr => {
-  createSaleRun(
-    httpPayAdd({
-      tradNo: tradNo.value,
-      orderArr
-    })
-  );
+const requestCreateSalePay = orderArr => {
+  createSaleRun( httpPayAdd({ tradNo: tradNo.value, orderArr }) );
 };
 
 async function requesetTradeDetail() {
-  const { data, message, code } = await httpInfo({
-    tradNo: tradNo.value
-  });
+  const { data, message, code } = await httpInfo({ tradNo: tradNo.value });
 
   responseHandle({
     code,
@@ -61,7 +54,7 @@ onMounted(() => initalData());
     <template v-if="!isSuperUser && hasPermissionWithCode('002')">
       <RelatedOrder
         :trade-order-list="treadOrderList"
-        @create-btn-click="requesetCreateSalePay"
+        @create-btn-click="requestCreateSalePay"
       />
     </template>
   </div>

+ 14 - 8
src/views/InvoiceSales/capitalClaim/components/execl-files-upload/columns-config.ts

@@ -2,11 +2,14 @@ const initheaders = [
   "收款方公司编码",
   "收款方公司名称",
   "收款方账户",
+  "ND编号",
+  "平台订单编号",
+  "订单客户名称",
   "交易时间",
   "收入金额",
   "账号余额",
   "交易行名",
-  "对方省市",
+  // "对方省市",
   "对方账号",
   "对方户名",
   "交易用途"
@@ -22,14 +25,17 @@ export const requireHeaders = [
   "对方户名"
 ];
 
+const getValueName = (label: string) => 'value' + initheaders.findIndex(item => item === label)
+console.log(getValueName)
+
 export const requsetHeaderIdxs = [
-  "value0",
-  "value2",
-  "value3",
-  "value4",
-  "value6",
-  "value8",
-  "value9"
+  getValueName('收款方公司编码'),
+  getValueName('收款方账户'),
+  getValueName('交易时间'),
+  getValueName('收入金额'),
+  getValueName('交易行名'),
+  getValueName('对方账号'),
+  getValueName('对方户名'),
 ];
 
 const columns = () => {

+ 33 - 18
src/views/InvoiceSales/capitalClaim/components/execl-files-upload/index.vue

@@ -71,25 +71,42 @@ const Uploadsuccess = ({ results, header }) => {
     loading.value = false;
   }
 };
+
+
+const mapToProp = {
+  value0: 'companyNo',
+  value1: 'trade_in',
+  value2: 'trade_in_account',
+  value3: 'NdCode',
+  value4: 'poCode',
+  value5: 'customerName',
+  value6: 'tradeTime',
+  value7: 'trade_fee',
+  value8: 'balance',
+  value9: 'trade_bank',
+  value10: 'trade_account',
+  value11: 'trade_out',
+  value12: 'trade_used',
+}
+
 //提交
 const handleSubmit = async () => {
   if (loading.value) return;
   loading.value = true;
-  let isok = true,
-    isnum = true,
-    data = [];
+  let isok = true, isnum = true, data = [];
+
   tableData.value.forEach(key => {
-    let arr = [];
+    let arr = {}
+
     for (let i in key) {
-      if (requsetHeaderIdxs.includes(i) && !key[i]) {
-        isok = false;
-      }
-      arr.push(key[i]);
+      if (requsetHeaderIdxs.includes(i) && !key[i]) { isok = false; }
+      arr[mapToProp[i]] = key[i]
     }
 
-    data.push(arr);
-    return;
+
+    data.push({ ...arr, trade_remark: '' });
   });
+
   if (!isok) {
     ElNotification({
       title: "必填字段缺失!",
@@ -98,6 +115,8 @@ const handleSubmit = async () => {
     loading.value = false;
     return;
   }
+
+
   if (!isnum) {
     ElMessage.error("收入金额只能为正数!");
     loading.value = false;
@@ -117,13 +136,9 @@ const handleSubmit = async () => {
     }
   });
 };
-const cancel = () => {
-  tableData.value = [];
-};
 
-defineExpose({
-  onDisplay: () => ((visible.value = true), (tableData.value = []))
-});
+const cancel = () => { tableData.value = []; };
+defineExpose({ onDisplay: () => ((visible.value = true), (tableData.value = [])) });
 </script>
 
 <template>
@@ -139,11 +154,11 @@ defineExpose({
   >
     <execlUpload @on-success="Uploadsuccess" v-if="tableData.length === 0" />
     <el-table
-      :data="tableData"
       stripe
       border
-      max-height="500px"
       size="small"
+      :data="tableData"
+      max-height="500px"
       style="width: 100%"
     >
       <el-table-column

+ 58 - 15
src/views/InvoiceSales/capitalClaim/config/configs.ts

@@ -155,14 +155,14 @@ export const description_columns_out = [
 export const public_columns = [
   {
     label: "资金编码",
-    span: 24,
+    span: 8,
     field: "tradNo"
   },
   {
     label: "状态",
     field: "status",
     slot: "status",
-    span: 24,
+    span: 8,
     render(status) {
       return h(
         ElTag,
@@ -174,39 +174,82 @@ export const public_columns = [
       );
     }
   },
+  {
+    label: "新建时间",
+    span: 8,
+    field: "addtime"
+  },
   {
     label: "收入金额",
-    span: 24,
+    span: 8,
     field: "total_fee"
   },
   {
     label: "未认领金额",
-    span: 24,
+    span: 8,
     field: "balance"
   },
   {
     label: "已认领金额",
-    span: 24,
+    span: 8,
     field: "used_fee"
   },
+
+  {
+    label: '收款公司',
+    field: 'trade_in',
+    span: 8,
+  },
+  {
+    label: '收款公司账户',
+    field: 'trade_in_account',
+    span: 8
+  },
+  {
+    label: '平台订单客户名称',
+    field: 'TODO',
+    span: 8
+  },
   {
     label: "交易用途",
     span: 24,
     field: "trade_used"
   },
   {
-    label: "新建时间",
+    label: "ND编号",
+    field: "TODO",
+    span: 24
+  },
+  {
+    label: "平台订单编号",
+    field: "TODO",
+    span: 24
+  },
+  {
+    label: '付款单位名称',
+    field: 'trade_out',
+    span: 8
+  },
+  {
+    label: '账户',
+    field: 'trade_account',
+    span: 8
+  },
+  {
+    label: '交易时间',
+    field: 'addtime',
+    span: 8
+  },
+  {
+    label: "交易行名",
+    field: 'trade_bank',
+    span: 8
+  },
+  {
+    label: "付款方省市",
     span: 24,
-    field: "addtime"
+    field: ""
   }
-  // {
-  //   label: "收款公司编码",
-  //   field: "companyNo"
-  // },
-  // {
-  //   label: "收款公司名称",
-  //   field: "companyName"
-  // }
 ];
 
 export const status_options = [

+ 7 - 19
src/views/InvoiceSales/capitalClaim/config/content.config.ts

@@ -1,5 +1,5 @@
 import { ContentConfig } from "/@/components/PageContent";
-import { httpList, httpDelete } from "/@/api/InvoiceSales/capitalClaim";
+import { httpNewList, httpDelete } from "/@/api/InvoiceSales/capitalClaim";
 
 import { h } from "vue";
 import { ElTag } from "element-plus";
@@ -7,29 +7,17 @@ import { capital_status } from "./configs";
 import { CAPITAL_STATUS } from "/@/utils/details/tragelog";
 
 const columns = [
-  // {
-  //   type: "selection",
-  //   width: 40,
-  // align: "center"
-  //   hide: ({ checkList }) => !checkList.includes("勾选列")
-  // },
-  // {
-  //   label: "序号",
-  //   type: "index",
-  //   width: 70,
-  //   hide: ({ checkList }) => !checkList.includes("序号列")
-  // },
-  {
-    type: "expand",
-    slot: "expand",
-    fixed: "left"
-  },
   {
     label: "资金编码",
     prop: "tradNo",
     fixed: "left",
     width: 150
   },
+  {
+    label: '平台订单编号',
+    prop: 'poCode',
+    width: 150
+  },
   {
     label: "状态",
     prop: "status",
@@ -129,7 +117,7 @@ const contentConfig: ContentConfig = {
     return status == '1'
   },
   apis: {
-    httpList,
+    httpList: httpNewList,
     httpDelete
   }
 };

+ 5 - 1
src/views/InvoiceSales/capitalClaim/config/search.config.ts

@@ -36,7 +36,11 @@ const searchFormConfig: FormConfig = {
       type: "input",
       placeholder: "资金编码"
     },
-
+    {
+      type: 'input',
+      field: 'poCode',
+      placeholder: '平台订单编号'
+    },
     {
       type: "input",
       field: "bank",

+ 4 - 1
src/views/InvoiceSales/capitalClaim/config/xls-template.ts

@@ -2,11 +2,14 @@ export const template = {
   收款方公司编码: "",
   收款方公司名称: "",
   收款方账户: "",
+  ND编号: "",
+  平台订单编号: "",
+  订单客户名称: "",
   交易时间: "",
   收入金额: "",
   账号余额: "",
   交易行名: "",
-  对方省市: "",
+  // 对方省市: "",
   对方账号: "",
   对方户名: "",
   交易用途: ""

+ 33 - 225
src/views/InvoiceSales/capitalClaim/index.vue

@@ -19,6 +19,12 @@ import { httpWithdraw } from "/@/api/InvoiceSales/capitalClaim";
 import { httpRequsetExport } from "/@/utils/export";
 import { useCompany } from "/@/hooks/core/useCompany";
 
+import { httpInfo } from "/@/api/InvoiceSales/capitalClaim";
+import { useTask } from "/@/hooks/core"
+
+
+import FundDetail from "/@/components/FundDetail/index.vue"
+
 import { ElMessage } from "element-plus"
 import dayjs from "dayjs"
 
@@ -29,9 +35,10 @@ import {
 
 const { push } = useRouter();
 
+const detailTask = useTask({ initialData: {} })
+
 const execlUploadRef = ref<InstanceType<typeof ExeclUpload>>(null);
-const execlCapitalUploadRef =
-  ref<InstanceType<typeof ExeclCapitalUpload>>(null);
+const execlCapitalUploadRef = ref<InstanceType<typeof ExeclCapitalUpload>>(null);
 const pageName = "capitalClaim";
 
 const { run: withDraw } = useAsync({
@@ -45,8 +52,11 @@ const { run: withDraw } = useAsync({
 //  { code: "035", name: "批量导入订单认款数据" }
 
 const { hasPermissionWithCode, permissions } = usePermission(pageName);
-const { currentCompany } = useCompany();
+
 const loading = ref(false);
+const visible = ref(false)
+
+const { currentCompany } = useCompany();
 
 const { isSuperUser } = useUserInfo();
 
@@ -76,39 +86,8 @@ function onCapitalDownloadTemplate() {
   const workBook = utils.book_new();
   const workSheet = utils.json_to_sheet([capitalTemplate]);
   utils.book_append_sheet(workBook, workSheet, "sheet");
-
   //导出模板
-  writeFile(workBook, "订单认款导入模板.xlsx", {
-    bookType: "xlsx"
-  });
-}
-
-//导出模板
-async function onDownloadOpenInv() {
-  const params = pageContentRef.value.getBasicParams()
-  if (!params.start || !params.end) {
-    ElMessage.warning('请选择导出的时间区间')
-    return
-  }
-
-  const delay = 24 * 60 * 60 * 1000;
-  const start_updatetime = new Date(params.start).valueOf();
-  const end_updatetime = new Date(params.end).valueOf() + delay;
-  const day = (end_updatetime - start_updatetime) / delay;
-
-  if (day > 31) {
-     ElMessage.warning("时间区间不能超过31天!");
-     return false;
-  }
-
-  await httpRequsetExport({
-    url: "ope",
-    name: "资金认领数据表",
-    onStart: () => (loading.value = true),
-    onSuccess: () => (loading.value = false),
-    onFail: () => (loading.value = false),
-    params: { ...params, company: currentCompany.value.companyNo }
-  });
+  writeFile(workBook, "订单认款导入模板.xlsx", { bookType: "xlsx" });
 }
 
 
@@ -140,6 +119,13 @@ async function onDownloadCapitalInfo() {
     params: { ...pageContentRef.value.getBasicParams(), companyNo: currentCompany.value.companyNo}
   });
 }
+
+
+function handleShow(row){
+  console.log(row)
+  visible.value = true
+  detailTask.run(httpInfo({ tradNo: row.tradNo }))
+}
 </script>
 
 <template>
@@ -178,207 +164,29 @@ async function onDownloadCapitalInfo() {
                3.导出资金信息
               </el-button>
             </el-button-group>
-
-
-            <el-button-group>
-              <el-button
-              type="warning" plain
-              v-if="!isSuperUser && hasPermissionWithCode('034')"
-              @click="onCapitalDownloadTemplate"
-              >
-              4.下载订单认款导入模板
-            </el-button>
-            <el-button
-              type="primary" plain
-               v-if="!isSuperUser && hasPermissionWithCode('035')"
-               @click="() => execlCapitalUploadRef.onDisplay()"
-               >
-               5.导入订单认款数据(批量)
-              </el-button>
-              <el-button 
-               type="success" plain
-              :loading="loading" @click="() => onDownloadOpenInv()">
-               6.导出资金认领数据
-              </el-button>
-            </el-button-group>
            </div>
           </template>
         </PageSearch>
+
         <PageContent
           ref="pageContentRef"
           :content-config="contentConfig"
           :powers="permissions"
-          @preview-btn-click="
-            row =>
-              push(
-                '/InvoiceSales/claimDetail?id=' +
-                  row.tradNo +
-                  '&back=capitalClaim'
-              )
-          "
-        >
-          <template #expand="row">
-            <el-table
-              style="width: 100%; display: inline-block !important"
-              v-if="row.child.length > 0"
-              size="small"
-              :data="row.child"
-              border
-            >
-              <el-table-column
-                label="资金认领编码"
-                prop="logNo"
-                width="150"
-                fixed="left"
-                show-overflow-tooltip
-              />
-              <el-table-column
-                label="认领状态"
-                prop="status"
-                width="100"
-                show-overflow-tooltip
-              >
-                <template #="{ $index }">
-                  <el-tag
-                    >{{
-                      CAPITAL_STATUS.find(
-                        t => t.value === row.child[$index].status
-                      )?.label || "--"
-                    }}
-                  </el-tag>
-                </template>
-              </el-table-column>
-              <el-table-column
-                label="订单编码"
-                prop="orderCode"
-                width="150"
-                show-overflow-tooltip
-              />
-              <el-table-column
-                label="销售主单号"
-                prop="cxCode"
-                width="160"
-                show-overflow-tooltip
-              />
-              <el-table-column
-                label="订单来源"
-                prop="qrdSource"
-                width="90"
-                show-overflow-tooltip
-              >
-                <template #="{ $index }">
-                  <el-tag
-                    >{{
-                      xs_order_source_options.find(
-                        t => t.value === row.child[$index].qrdSource
-                      )?.label
-                    }}
-                  </el-tag>
-                </template>
-              </el-table-column>
-              <el-table-column
-                label="平台单号"
-                prop="poCode"
-                width="180"
-                show-overflow-tooltip
-              />
-              <el-table-column
-                label="商品编码"
-                prop="goodNo"
-                width="150"
-                show-overflow-tooltip
-              />
-              <el-table-column
-                label="商品来源"
-                prop="qrdType"
-                width="90"
-                show-overflow-tooltip
-              >
-                <template #="{ $index }">
-                  <el-tag
-                    >{{
-                      xs_order_type_options.find(
-                        t => t.value === row.child[$index].qrdType
-                      )?.label
-                    }}
-                  </el-tag>
-                </template>
-              </el-table-column>
-              <el-table-column
-                label="商品名称"
-                prop="goodName"
-                minWidth="180"
-                show-overflow-tooltip
-              />
-              <el-table-column
-                label="企业客户编码"
-                prop="customerNo"
-                width="150"
-                show-overflow-tooltip
-              />
-              <el-table-column
-                label="企业客户名称"
-                prop="customerName"
-                minWidth="180"
-                show-overflow-tooltip
-              />
-
-              <el-table-column
-                label="订单创建人"
-                prop="ownerName"
-                width="80"
-                show-overflow-tooltip
-              />
-              <el-table-column
-                label="认领人"
-                prop="apply_name"
-                width="80"
-                show-overflow-tooltip
-              />
-              <el-table-column
-                label="认领时间"
-                prop="addtime"
-                width="145"
-                show-overflow-tooltip
-              />
-
-              <el-table-column fixed="right" label="操作" width="60px">
-                <template #default="{ row }">
-                  <el-button
-                    :icon="useRenderIcon('eye-view')"
-                    @click="
-                      () => push('/InvoiceSales/capitalDetail?id=' + row.logNo)
-                    "
-                    type="primary"
-                    link
-                  />
-                  <el-popconfirm
-                    v-if="hasPermissionWithCode('009') && String(row.status) === '1'"
-                    placement="top"
-                    title="是否确认撤销资金认领?"
-                    @confirm="() => handleWithDraw({ logNo: row.logNo })"
-                  >
-                    <template #reference>
-                      <el-button
-                        :icon="useRenderIcon('refresh-right')"
-                        type="primary"
-                        link
-                      />
-                    </template>
-                  </el-popconfirm>
-                </template>
-              </el-table-column>
-            </el-table>
-          </template>
-        </PageContent>
+          @preview-btn-click="row => handleShow(row)"
+        />
       </div>
     </PagePower>
 
     <ExeclUpload ref="execlUploadRef" @onSuccess="handleResetClick" />
-    <ExeclCapitalUpload
-      ref="execlCapitalUploadRef"
-      @onSuccess="handleResetClick"
-    />
+    <ExeclCapitalUpload ref="execlCapitalUploadRef" @onSuccess="handleResetClick" />
+
+
+    <ElDialog center title="资金详情" v-model="visible">
+      <FundDetail 
+        v-loading="detailTask.loading" 
+        :tradeInfo="detailTask.data" 
+      />
+    </ElDialog>
   </div>
 </template>
 

+ 51 - 0
src/views/InvoiceSales/capitalPool/approval-process/approval-pending.vue

@@ -0,0 +1,51 @@
+<script setup lang="ts">
+import { useReviewProcess } from "/@/hooks";
+import { REMARK_MAX_LENGTH } from "/@/utils/global";
+const status = {
+  fail: "3",
+  success: "2"
+};
+
+const emit = defineEmits(["changeStatus"]);
+
+const { formData, formRules, formRef, handleChangeStatus } = useReviewProcess({
+  callback: () => emit("changeStatus", formData),
+  failStatus: status.fail
+});
+</script>
+
+<template>
+  <el-form
+    inline
+    :rules="formRules"
+    :model="formData"
+    ref="formRef"
+    label-width="100px"
+    flex
+    justify-between
+  >
+    <div flex flex-col style="width: 50%">
+      <el-form-item label="审核状态" prop="status">
+        <el-select placeholder="请选择审核状态" v-model="formData.status">
+          <el-option :value="status.success" label="通过" />
+          <el-option :value="status.fail" label="不通过" />
+        </el-select>
+      </el-form-item>
+
+      <el-form-item label="备注" prop="remark">
+        <el-input
+          type="textarea"
+          :maxlength="2000"
+          :rows="5"
+          placeholder="请输入备注"
+          v-model="formData.remark"
+          v-bind="REMARK_MAX_LENGTH"
+        />
+      </el-form-item>
+    </div>
+
+    <el-button type="primary" @click="handleChangeStatus"
+      >提交审核结果</el-button
+    >
+  </el-form>
+</template>

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

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

+ 420 - 0
src/views/InvoiceSales/capitalPool/base-form/choose-invoice-modal/config/configs.ts

@@ -0,0 +1,420 @@
+import { ElTag } from "element-plus";
+import { h } from "vue";
+export const order_columns = [
+  {
+    label: "销售订单编码",
+    prop: "sequenceNo",
+    width: 150,
+    align: "left",
+    fixed: "left"
+  },
+  {
+    label: "销售订单主编码",
+    prop: "cxCode",
+    width: 150,
+    align: "left"
+  },
+  {
+    label: "客户名称",
+    prop: "customerName",
+    minWidth: 150,
+    align: "left"
+  },
+  {
+    label: "订单总金额",
+    prop: "totalPrice",
+    width: 110,
+    align: "left"
+  },
+  {
+    prop: "apay_fee",
+    width: 110,
+    label: "已付款"
+  },
+  {
+    prop: "pay_fee",
+    width: 110,
+    label: "付款中"
+  },
+  {
+    prop: "wpay_fee",
+    width: 110,
+    label: "未付款"
+  },
+  {
+    label: "商品名称",
+    prop: "goodName",
+    minWidth: 150,
+    align: "left"
+  },
+  {
+    label: "平台名称",
+    prop: "platName",
+    width: 120,
+    align: "left"
+  },
+  {
+    label: "销售员",
+    prop: "saler",
+    width: 90,
+    align: "left"
+  },
+  {
+    label: "购买方公司",
+    prop: "customerName",
+    minWidth: 150,
+    align: "left"
+  },
+  {
+    label: "销售方公司",
+    prop: "companyName",
+    minWidth: 150,
+    align: "left"
+  },
+  {
+    label: "此次认领",
+    prop: "cchx",
+    width: 110,
+    align: "left"
+  },
+  {
+    label: "交易时间",
+    prop: "addtime",
+    width: 140,
+    align: "left"
+  }
+];
+
+export const order_status = [
+  {
+    value: "0",
+    label: "未对账"
+  },
+  {
+    value: "1",
+    label: "参与对账"
+  },
+  {
+    value: "2",
+    label: "不参与核销对账"
+  },
+  {
+    value: "3",
+    label: "参与核销对账"
+  }
+];
+
+//收款方
+export const description_columns_in = [
+  {
+    label: "收款公司编码",
+    field: "companyNo",
+    span: 24
+  },
+  {
+    label: "收款公司名称",
+    span: 24,
+    field: "companyName"
+  },
+  {
+    label: "收款公司账户",
+    span: 24,
+    field: "trade_in_account"
+  }
+];
+
+//付款方
+export const description_columns_out = [
+  {
+    label: "付款单位名称",
+    span: 24,
+    field: "trade_out"
+  },
+  {
+    label: "账户",
+    span: 24,
+    field: "trade_account"
+  },
+  {
+    label: "交易时间",
+    span: 24,
+    field: "trade_time"
+  },
+  {
+    label: "交易行名",
+    span: 24,
+    field: "trade_bank"
+  },
+  {
+    label: "付款方省市",
+    span: 24,
+    field: ""
+  }
+];
+
+export const public_columns = [
+  {
+    label: "资金编码",
+    span: 8,
+    field: "tradNo"
+  },
+  {
+    label: "状态",
+    field: "status",
+    slot: "status",
+    span: 8,
+    render(status) {
+      return h(
+        ElTag,
+        { size: "small" },
+        {
+          default: () =>
+            status_options.find(s => s.value === String(status))?.label
+        }
+      );
+    }
+  },
+  {
+    label: "新建时间",
+    span: 8,
+    field: "addtime"
+  },
+  {
+    label: "收入金额",
+    span: 8,
+    field: "total_fee"
+  },
+  {
+    label: "未认领金额",
+    span: 8,
+    field: "balance"
+  },
+  {
+    label: "已认领金额",
+    span: 8,
+    field: "used_fee"
+  },
+
+  {
+    label: '收款公司',
+    field: 'trade_in',
+    span: 8,
+  },
+  {
+    label: '收款公司账户',
+    field: 'trade_in_account',
+    span: 8
+  },
+  {
+    label: '平台订单客户名称',
+    field: 'TODO',
+    span: 8
+  },
+  {
+    label: "交易用途",
+    span: 24,
+    field: "trade_used"
+  },
+  {
+    label: "ND编号",
+    field: "TODO",
+    span: 24
+  },
+  {
+    label: "平台订单编号",
+    field: "TODO",
+    span: 24
+  },
+  {
+    label: '付款单位名称',
+    field: 'trade_out',
+    span: 8
+  },
+  {
+    label: '账户',
+    field: 'trade_account',
+    span: 8
+  },
+  {
+    label: '交易时间',
+    field: 'addtime',
+    span: 8
+  },
+  {
+    label: "交易行名",
+    field: 'trade_bank',
+    span: 8
+  },
+  {
+    label: "付款方省市",
+    span: 24,
+    field: ""
+  }
+];
+
+export const status_options = [
+  {
+    label: "未认领",
+    value: "1"
+  },
+  {
+    label: "部分认领",
+    value: "2"
+  },
+  {
+    label: "已认领",
+    value: "3"
+  }
+];
+
+export const sale_columns = [
+  {
+    type: "selection",
+    width: 40,
+    align: "center",
+    fixed: "left"
+  },
+  {
+    field: "sequenceNo",
+    label: "销售订单编码",
+    width: 150,
+    fixed: "left"
+  },
+  {
+    label: "销售订单主编码",
+    field: "cxCode",
+    width: 160,
+    align: "left"
+  },
+  {
+    field: "qrdSource",
+    label: "订单来源",
+    width: 100
+  },
+  {
+    field: "qrdType",
+    label: "商品类型",
+    width: 100
+  },
+
+  {
+    label: "平台类型",
+    field: "platform_type",
+    width: 80
+  },
+  {
+    label: "发货状态",
+    field: "sendStatus",
+    width: 80
+  },
+  {
+    label: "平台名称",
+    field: "platName",
+    width: 130,
+    align: "left"
+  },
+  {
+    label: "客户名称",
+    field: "customerName",
+    width: 180,
+    align: "left"
+  },
+  {
+    field: "totalPrice",
+    width: 100,
+    label: "订单总金额"
+  },
+  {
+    field: "apay_fee",
+    label: "已付款"
+  },
+  {
+    field: "pay_fee",
+    label: "付款中"
+  },
+  {
+    field: "wpay_fee",
+    label: "未付款"
+  },
+  {
+    field: "goodName",
+    label: "商品名称",
+    width: 140
+  },
+  {
+    field: "goodNo",
+    label: "商品编码",
+    width: 140
+  },
+
+  {
+    field: "ownerName",
+    label: "销售员"
+  },
+
+  {
+    field: "companyNo",
+    label: "业务公司编码",
+    width: 140
+  },
+  {
+    field: "companyName",
+    width: 120,
+    label: "业务公司名称"
+  }
+];
+
+//销售订单订单类型
+export const sale_type = [
+  {
+    value: "1",
+    label: "备库"
+  },
+  {
+    value: "2",
+    label: "非库存"
+  },
+  {
+    value: "3",
+    label: "咨询商品"
+  }
+];
+
+//认领状态
+export const capital_status = [
+  {
+    value: "1",
+    label: "未认领"
+  },
+  {
+    value: "2",
+    label: "部分认领"
+  },
+  {
+    value: "3",
+    label: "已认领"
+  }
+];
+
+export const capital_status_list = [
+  {
+    value: "1",
+    label: "待审批"
+  },
+  {
+    value: "2",
+    label: "审批通过"
+  },
+  {
+    value: "3",
+    label: "审批驳回"
+  },
+  {
+    value: "4",
+    label: "解除认领"
+  },
+  {
+    value: "5",
+    label: "退款"
+  }
+];

+ 130 - 0
src/views/InvoiceSales/capitalPool/base-form/choose-invoice-modal/config/content.config.ts

@@ -0,0 +1,130 @@
+import { ContentConfig } from "/@/components/PageContent";
+import { httpNewList, httpDelete } from "/@/api/InvoiceSales/capitalClaim";
+
+import { h } from "vue";
+import { ElTag } from "element-plus";
+import { capital_status } from "./configs";
+import { CAPITAL_STATUS } from "/@/utils/details/tragelog";
+
+const columns = [
+  {
+    type: 'selection',
+    fixed: 'left',
+    width: 40
+  },
+  {
+    label: "资金编码",
+    prop: "tradNo",
+    fixed: "left",
+    width: 150
+  },
+  {
+    label: '平台订单编号',
+    prop: 'poCode',
+    width: 150
+  },
+  {
+    label: "状态",
+    prop: "status",
+    width: 100,
+    cellRenderer: ({ row, props }) =>
+      h(
+        ElTag,
+        {
+          size: props.size
+        },
+        {
+          default: () => {
+            const status = row.logNo ? CAPITAL_STATUS : capital_status;
+            return (
+              status.find(s => String(row.status) === String(s.value))?.label ||
+              "--"
+            );
+          }
+        }
+      )
+  },
+  {
+    label: "收入金额",
+    prop: "total_fee",
+    width: 120
+  },
+  {
+    label: "未认领金额",
+    prop: "balance",
+    width: 120
+  },
+  {
+    label: "已认领金额",
+    prop: "used_fee",
+    width: 120
+  },
+  {
+    label: "交易用途",
+    prop: "trade_used",
+    width: 120
+  },
+  {
+    label: "交易时间",
+    prop: "trade_time",
+    width: 140
+  },
+  {
+    label: "付款单位名称",
+    prop: "trade_out",
+    width: 160
+  },
+  {
+    label: "付款单位账号",
+    prop: "trade_account",
+    width: 160
+  },
+
+  {
+    label: "收款公司账户",
+    prop: "trade_in_account",
+    width: 145
+  },
+  {
+    label: "交易行名",
+    prop: "trade_bank",
+    width: 160
+  },
+  // {
+  //   label: "收款公司编码",
+  //   prop: "companyNo",
+  //   width: 150
+  // },
+  {
+    label: "收款公司名称",
+    prop: "trade_in",
+    width: 145
+  },
+  {
+    label: "资金导入时间",
+    prop: "addtime",
+    width: 140
+  }
+  // {
+  //   label: "操作",
+  //   fixed: "right",
+  //   width: 60,
+  //   slot: "operation"
+  // }
+];
+
+const contentConfig: ContentConfig = {
+  title: "资金认领管理",
+  columns,
+  isTree: true,
+  showDelete({ status } ={} ) {
+    console.log(status, 'prefix');
+    return status == '1'
+  },
+  apis: {
+    httpList: (parameter = {}) => httpNewList({ ...parameter, status: [1, 2] }),
+    httpDelete
+  }
+};
+
+export default contentConfig;

+ 57 - 0
src/views/InvoiceSales/capitalPool/base-form/choose-invoice-modal/config/search.config.ts

@@ -0,0 +1,57 @@
+import { status_options } from "./configs";
+import { FormConfig } from "/@/components/PageSearch";
+
+const searchFormConfig: FormConfig = {
+  formItems: [
+    {
+      field: "create_timer",
+      type: "date_picker",
+      trigger: 'change',
+      otherOptions: {
+        type: "daterange",
+        startProp: "start",
+        endProp: "end",
+        startPlaceholder: "交易开始时间",
+        endPlaceholder: "交易结束时间"
+      }
+    },
+    // {
+    //   field: "status",
+    //   type: "select",
+    //   placeholder: "认领状态",
+    //   options: status_options
+    // },
+    {
+      type: "range",
+      field: "gold",
+      otherOptions: {
+        startProp: "total_lower",
+        endProp: "total_upper",
+        startPlaceholder: "收入起始金额",
+        endPlaceholder: "收入结束金额"
+      }
+    },
+    {
+      field: "tradNo",
+      type: "input",
+      placeholder: "资金编码"
+    },
+    {
+      field: 'poCode',
+      type: 'input',
+      placeholder: '平台订单编号'
+    },
+    {
+      type: "input",
+      field: "bank",
+      placeholder: "交易银行"
+    },
+    {
+      type: "input",
+      field: "name",
+      placeholder: "付款单位名称"
+    }
+  ]
+};
+
+export default searchFormConfig;

+ 24 - 0
src/views/InvoiceSales/capitalPool/base-form/choose-invoice-modal/config/xls-template.ts

@@ -0,0 +1,24 @@
+export const template = {
+  收款方公司编码: "",
+  收款方公司名称: "",
+  收款方账户: "",
+  ND编号: "",
+  平台订单编号: "",
+  订单客户名称: "",
+  交易时间: "",
+  收入金额: "",
+  账号余额: "",
+  交易行名: "",
+  对方省市: "",
+  对方账号: "",
+  对方户名: "",
+  交易用途: ""
+};
+
+export const capitalTemplate = {
+  收款方公司编码: "",
+  收款方公司名称: "",
+  资金编码: "",
+  订单编码: "",
+  认领资金: ""
+};

+ 67 - 0
src/views/InvoiceSales/capitalPool/base-form/choose-invoice-modal/index.vue

@@ -0,0 +1,67 @@
+<script setup lang="ts">
+import { ref } from "vue"
+import { useVModel } from "@vueuse/core"
+import contentConfig from "./config/content.config";
+import searchConfig from "./config/search.config";
+import { usePageSearch, type PageHooks, type PageEvents } from "/@/hooks/page";
+
+import { httpInfo } from "/@/api/InvoiceSales/capitalClaim";
+import { useTask } from "/@/hooks/core"
+import { ElMessage } from "element-plus"
+
+const emit = defineEmits(['submit'])
+const props = defineProps<{ visible: boolean }>()
+
+const selection = ref([])
+const visible = useVModel(props, 'visible')
+const detailTask = useTask({ initialData: {} })
+
+const hooks: PageHooks = {
+  pageSearchHook: () => usePageSearch(undefined, undefined, searchConfig)
+};
+
+async function onSubmit(){
+  if(selection.value.length === 0){
+    ElMessage.warning('请选择一条数据')
+    return
+  }
+
+  if(selection.value.length > 1){
+    ElMessage.warning('只能选择一条数据')
+    return
+  }
+
+  visible.value = false
+  emit('submit', selection.value[0])
+}
+</script>
+
+<template>
+  <ElDialog
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    title="选择资金"
+    v-model="visible"
+    top="10px"
+    center
+
+    class="relative"
+  >
+    <PageContainer
+      v-if="visible"
+      :hooks="hooks"
+      :notice="false"
+      :search-config="searchConfig"
+      :content-config="contentConfig"
+      @content-select-change="values => selection = values"
+      :isPageStart="true"
+    />
+
+
+    <div class="absolute bottom-[48px] right-[32px]">
+      <ElButton type="primary" @click="onSubmit">
+        保存
+      </ElButton>
+    </div>
+  </ElDialog>
+</template>

+ 420 - 0
src/views/InvoiceSales/capitalPool/base-form/configs.ts

@@ -0,0 +1,420 @@
+import { ElTag } from "element-plus";
+import { h } from "vue";
+export const order_columns = [
+  {
+    label: "销售订单编码",
+    prop: "sequenceNo",
+    width: 150,
+    align: "left",
+    fixed: "left"
+  },
+  {
+    label: "销售订单主编码",
+    prop: "cxCode",
+    width: 150,
+    align: "left"
+  },
+  {
+    label: "客户名称",
+    prop: "customerName",
+    minWidth: 150,
+    align: "left"
+  },
+  {
+    label: "订单总金额",
+    prop: "totalPrice",
+    width: 110,
+    align: "left"
+  },
+  {
+    prop: "apay_fee",
+    width: 110,
+    label: "已付款"
+  },
+  {
+    prop: "pay_fee",
+    width: 110,
+    label: "付款中"
+  },
+  {
+    prop: "wpay_fee",
+    width: 110,
+    label: "未付款"
+  },
+  {
+    label: "商品名称",
+    prop: "goodName",
+    minWidth: 150,
+    align: "left"
+  },
+  {
+    label: "平台名称",
+    prop: "platName",
+    width: 120,
+    align: "left"
+  },
+  {
+    label: "销售员",
+    prop: "saler",
+    width: 90,
+    align: "left"
+  },
+  {
+    label: "购买方公司",
+    prop: "customerName",
+    minWidth: 150,
+    align: "left"
+  },
+  {
+    label: "销售方公司",
+    prop: "companyName",
+    minWidth: 150,
+    align: "left"
+  },
+  {
+    label: "此次认领",
+    prop: "cchx",
+    width: 110,
+    align: "left"
+  },
+  {
+    label: "交易时间",
+    prop: "addtime",
+    width: 140,
+    align: "left"
+  }
+];
+
+export const order_status = [
+  {
+    value: "0",
+    label: "未对账"
+  },
+  {
+    value: "1",
+    label: "参与对账"
+  },
+  {
+    value: "2",
+    label: "不参与核销对账"
+  },
+  {
+    value: "3",
+    label: "参与核销对账"
+  }
+];
+
+//收款方
+export const description_columns_in = [
+  {
+    label: "收款公司编码",
+    field: "companyNo",
+    span: 24
+  },
+  {
+    label: "收款公司名称",
+    span: 24,
+    field: "companyName"
+  },
+  {
+    label: "收款公司账户",
+    span: 24,
+    field: "trade_in_account"
+  }
+];
+
+//付款方
+export const description_columns_out = [
+  {
+    label: "付款单位名称",
+    span: 24,
+    field: "trade_out"
+  },
+  {
+    label: "账户",
+    span: 24,
+    field: "trade_account"
+  },
+  {
+    label: "交易时间",
+    span: 24,
+    field: "trade_time"
+  },
+  {
+    label: "交易行名",
+    span: 24,
+    field: "trade_bank"
+  },
+  {
+    label: "付款方省市",
+    span: 24,
+    field: ""
+  }
+];
+
+export const public_columns = [
+  {
+    label: "资金编码",
+    span: 8,
+    field: "tradNo"
+  },
+  {
+    label: "状态",
+    field: "status",
+    slot: "status",
+    span: 8,
+    render(status) {
+      return h(
+        ElTag,
+        { size: "small" },
+        {
+          default: () =>
+            status_options.find(s => s.value === String(status))?.label
+        }
+      );
+    }
+  },
+  {
+    label: "新建时间",
+    span: 8,
+    field: "addtime"
+  },
+  {
+    label: "收入金额",
+    span: 8,
+    field: "total_fee"
+  },
+  {
+    label: "未认领金额",
+    span: 8,
+    field: "balance"
+  },
+  {
+    label: "已认领金额",
+    span: 8,
+    field: "used_fee"
+  },
+
+  {
+    label: '收款公司',
+    field: 'trade_in',
+    span: 8,
+  },
+  {
+    label: '收款公司账户',
+    field: 'trade_in_account',
+    span: 8
+  },
+  {
+    label: '平台订单客户名称',
+    field: 'TODO',
+    span: 8
+  },
+  {
+    label: "交易用途",
+    span: 24,
+    field: "trade_used"
+  },
+  {
+    label: "ND编号",
+    field: "TODO",
+    span: 24
+  },
+  {
+    label: "平台订单编号",
+    field: "TODO",
+    span: 24
+  },
+  {
+    label: '付款单位名称',
+    field: 'trade_out',
+    span: 8
+  },
+  {
+    label: '账户',
+    field: 'trade_account',
+    span: 8
+  },
+  {
+    label: '交易时间',
+    field: 'addtime',
+    span: 8
+  },
+  {
+    label: "交易行名",
+    field: 'trade_bank',
+    span: 8
+  },
+  {
+    label: "付款方省市",
+    span: 24,
+    field: ""
+  }
+];
+
+export const status_options = [
+  {
+    label: "未认领",
+    value: "1"
+  },
+  {
+    label: "部分认领",
+    value: "2"
+  },
+  {
+    label: "已认领",
+    value: "3"
+  }
+];
+
+export const sale_columns = [
+  {
+    type: "selection",
+    width: 40,
+    align: "center",
+    fixed: "left"
+  },
+  {
+    field: "sequenceNo",
+    label: "销售订单编码",
+    width: 150,
+    fixed: "left"
+  },
+  {
+    label: "销售订单主编码",
+    field: "cxCode",
+    width: 160,
+    align: "left"
+  },
+  {
+    field: "qrdSource",
+    label: "订单来源",
+    width: 100
+  },
+  {
+    field: "qrdType",
+    label: "商品类型",
+    width: 100
+  },
+
+  {
+    label: "平台类型",
+    field: "platform_type",
+    width: 80
+  },
+  {
+    label: "发货状态",
+    field: "sendStatus",
+    width: 80
+  },
+  {
+    label: "平台名称",
+    field: "platName",
+    width: 130,
+    align: "left"
+  },
+  {
+    label: "客户名称",
+    field: "customerName",
+    width: 180,
+    align: "left"
+  },
+  {
+    field: "totalPrice",
+    width: 100,
+    label: "订单总金额"
+  },
+  {
+    field: "apay_fee",
+    label: "已付款"
+  },
+  {
+    field: "pay_fee",
+    label: "付款中"
+  },
+  {
+    field: "wpay_fee",
+    label: "未付款"
+  },
+  {
+    field: "goodName",
+    label: "商品名称",
+    width: 140
+  },
+  {
+    field: "goodNo",
+    label: "商品编码",
+    width: 140
+  },
+
+  {
+    field: "ownerName",
+    label: "销售员"
+  },
+
+  {
+    field: "companyNo",
+    label: "业务公司编码",
+    width: 140
+  },
+  {
+    field: "companyName",
+    width: 120,
+    label: "业务公司名称"
+  }
+];
+
+//销售订单订单类型
+export const sale_type = [
+  {
+    value: "1",
+    label: "备库"
+  },
+  {
+    value: "2",
+    label: "非库存"
+  },
+  {
+    value: "3",
+    label: "咨询商品"
+  }
+];
+
+//认领状态
+export const capital_status = [
+  {
+    value: "1",
+    label: "未认领"
+  },
+  {
+    value: "2",
+    label: "部分认领"
+  },
+  {
+    value: "3",
+    label: "已认领"
+  }
+];
+
+export const capital_status_list = [
+  {
+    value: "1",
+    label: "待审批"
+  },
+  {
+    value: "2",
+    label: "审批通过"
+  },
+  {
+    value: "3",
+    label: "审批驳回"
+  },
+  {
+    value: "4",
+    label: "解除认领"
+  },
+  {
+    value: "5",
+    label: "退款"
+  }
+];

+ 152 - 0
src/views/InvoiceSales/capitalPool/base-form/index.vue

@@ -0,0 +1,152 @@
+<script setup lang="ts">
+import { ElMessage } from "element-plus";
+import { computed, ref, unref } from "vue";
+import { order_columns, order_status } from "./configs";
+import { INPUT_MAX_LENGTH } from "/@/utils/global";
+import SalesModal from "./sales-modal.vue";
+import { useTask } from "/@/hooks/core"
+import ChooseModal from "./choose-invoice-modal/index.vue"
+import { httpInfo } from "/@/api/InvoiceSales/capitalClaim";
+import { httpPayAdd } from "/@/api/InvoiceSales/capitalClaim";
+import FundDetail from "/@/components/FundDetail/index.vue"
+import { useRouter } from "vue-router"
+
+const props = defineProps<{ readonly?: boolean; }>();
+const emit = defineEmits(["create-btn-click"]);
+
+const visible = ref(false)
+const router = useRouter()
+const disabled = computed(() => !props.readonly);
+const saleOrderList = ref<Array<Record<string, string>>>([]);
+const formData = ref({ tradNo: '', orderArr: [] })
+
+const addTask = useTask({ success(){ 
+  ElMessage.success('新建成功')
+  router.push('/InvoiceSales/capitalPool') 
+} })
+
+const rules = { 
+  tradNo: [{ required: true, message: '请选择资金', trigger: 'change' }],
+  orderArr: [{ required: true, message: '请选择关联订单' }]
+ }
+
+const detailTask = useTask({ initialData: null })
+const mapSequenceNoToWpayfee = ref<Record<string, string>>({});
+const saleModalRef = ref<InstanceType<typeof SalesModal>>(null);
+
+function addSaleOrder(sales: Array<Record<string, string>>) {
+  sales.forEach(sale => {
+    const { sequenceNo, wpay_fee } = sale;
+    if (!mapSequenceNoToWpayfee.value[sequenceNo]) {
+      mapSequenceNoToWpayfee.value[sequenceNo] = wpay_fee;
+      saleOrderList.value.push(sale);
+    }
+  });
+}
+
+function handleCreate() {
+  const orderArr: any = [];
+  const keys = Object.keys(mapSequenceNoToWpayfee.value);
+  keys.forEach(sequenceNo => orderArr.push({ sequenceNo, trad_fee: mapSequenceNoToWpayfee.value[sequenceNo] }));
+  
+  if (orderArr.length === 0) {  return ElMessage.error("请添加关联订单"); }
+  
+  const parameter = { tradNo: formData.value.tradNo, orderArr }
+  addTask.run(httpPayAdd(parameter))
+}
+
+function handleDelete(sequenceNo: string) {
+  delete mapSequenceNoToWpayfee.value[sequenceNo];
+  saleOrderList.value = saleOrderList.value.filter(row => row.sequenceNo !== sequenceNo);
+}
+
+
+function handleChoose(row){
+  detailTask.run(httpInfo({ tradNo: row.tradNo }))
+  formData.value.tradNo = row.tradNo
+}
+</script>
+
+<template>
+  <div class="flex flex-col" v-loading="addTask.loading">
+    <ElForm :model="formData" :rules="rules">
+      <ElFormItem label="资金编号"  v-loading="detailTask.loading" prop="tradNo">
+        <ElInput class="mb-[10px]" v-model="formData.tradNo"  placeolder="资金编号" placeholder="资金编号" @click="visible = true" />
+        <FundDetail v-if="detailTask.data" :tradeInfo="detailTask.data"  />
+      </ElFormItem>
+
+      <ElFormItem>
+        <template #label>
+          <div class="flex">
+            <span style="color:#f56c6c">*</span>
+            <div style="margin-left:3px;font-weight: 600">关联订单</div>
+          </div>
+        </template>
+
+        <div class="flex flex-col w-full">
+          <div class="flex w-full justify-end mb-[10px]">
+            <el-button
+              style="width:40px"
+              v-if="disabled"
+              type="primary"
+              size="small"
+              @click="() => saleModalRef.onDisplay(unref(saleOrderList))"
+            >
+              添加
+            </el-button>
+          </div>
+        
+        <el-table :data="saleOrderList" size="small" border prop="orderArr">
+          <el-table-column
+            v-for="(col, index) in order_columns"
+            :key="index"
+            :label="col.label"
+            :prop="col.prop"
+            :width="col.width"
+            show-overflow-tooltip
+          >
+            <template #default="{ row }">
+              <el-input
+                size="small"
+                placeholder="此次认领金额"
+                v-if="col.label === '此次认领'"
+                v-model="mapSequenceNoToWpayfee[row.sequenceNo]"
+                v-bind="INPUT_MAX_LENGTH"
+              />
+            
+              <el-tag v-else-if="col.prop === 'status'">
+                {{ order_status.find(p => String(row.status) === p.value)?.label }}
+              </el-tag>
+            </template>
+          </el-table-column>
+        
+          <el-table-column label="操作" fixed="right">
+            <template #="{ row }">
+              <el-button type="danger" link @click="handleDelete(row.sequenceNo)">
+                删除
+              </el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+        </div>
+      </ElFormItem>
+    </ElForm>
+
+    <div flex justify-end mt-3 v-if="disabled">
+      <ElButton type="primary" @click="handleCreate">
+        保存
+       </ElButton>
+    </div>
+
+    <SalesModal 
+      ref="saleModalRef"
+      @saveClickButton="addSaleOrder" 
+    />
+
+
+    <ChooseModal 
+      v-model:visible="visible"
+      @submit="handleChoose"
+    />
+  </div>
+</template>

+ 286 - 0
src/views/InvoiceSales/capitalPool/base-form/sales-modal.vue

@@ -0,0 +1,286 @@
+<script setup lang="ts">
+import { httpSaleList } from "/@/api/InvoiceSales/capitalClaim";
+import { onMounted, ref, unref } from "vue";
+import { ElMessage, ElTable } from "element-plus";
+import { useAsync } from "/@/hooks";
+import { send_status_list, useTypeOptions, xs_order_source_options, xs_order_type_options } from "/@/utils/status";
+import { sale_type, sale_columns } from "./configs";
+
+import { useCompany } from "/@/hooks/core/useCompany";
+import { DateRange } from "/@/components/BasicForm";
+
+const visible = ref(false);
+const emit = defineEmits(["save-click-button"]);
+
+const data = ref<Record<string, any>>({
+  timer: [],
+  sequenceNo: "",
+  qrdtype: "",
+  qrdsource: "",
+  customer: "",
+  platName: "",
+  cxCode: "",
+  platform_type: "1",
+  is_comon: '0'
+});
+
+const { currentCompany } = useCompany();
+const tableRef = ref<InstanceType<typeof ElTable>>(null);
+const selectSaleOrder = ref<Array<Record<string, string>>>([]);
+
+const initalPagination = {
+  pageSize: 15,
+  currentPage: 1,
+  total: 0
+};
+
+const {
+  loading,
+  run: salelistRun,
+  data: saleOrderList,
+  pagination
+} = useAsync<Array<Record<string, string>>>({
+  initalData: [],
+  isList: true,
+  initalPagination
+});
+
+const handleSelectChange = values => (selectSaleOrder.value = values);
+
+const reuquestSalelist = () => {
+  const { currentPage: page, pageSize: size } = pagination;
+  const { timer, ...rest } = data.value;
+  salelistRun(
+    httpSaleList({
+      pay_status: "0",
+      size,
+      page,
+      companyNo: currentCompany.value.companyNo,
+      start: timer[0],
+      end: timer[1],
+      status: '3',
+      ...rest
+    })
+  );
+};
+
+function handleSave() {
+  emit("save-click-button", unref(selectSaleOrder));
+  visible.value = false;
+}
+
+const search = (isReset?: boolean) => {
+  pagination.currentPage = 1;
+  if (isReset) {
+    data.value = {
+      timer: [],
+      sequenceNo: "",
+      qrdtype: "",
+      qrdsource: "",
+      customer: "",
+      platName: "",
+      cxCode: "",
+      platform_type: "1"
+    };
+  }
+  reuquestSalelist();
+};
+
+function handleSizeChange() {
+  pagination.currentPage = 1;
+  reuquestSalelist();
+}
+
+defineExpose({
+  onDisplay: (_list: Array<Record<string, string>>) => {
+    visible.value = true;
+    reuquestSalelist();
+  }
+});
+
+//初始化订单列表
+onMounted(() => reuquestSalelist());
+</script>
+
+<template>
+  <el-dialog
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    v-model="visible"
+    title="销售订单"
+    width="1040px"
+    @close="() => (selectSaleOrder = [])"
+    top="10px"
+    center
+  >
+    <el-row :gutter="10" style="margin-bottom: 10px">
+      <el-col :span="8">
+        <date-range size="small" v-model="data.timer" />
+      </el-col>
+
+      <el-col :span="8">
+        <el-input
+          v-model="data.sequenceNo"
+          placeholder="订单编码"
+          size="small"
+        />
+      </el-col>
+
+      <el-col :span="8">
+        <el-select
+          class="w-full"
+          size="small"
+          clearable
+          v-model="data.qrdsource"
+          placeholder="订单来源"
+        >
+          <el-option
+            v-for="type in xs_order_source_options"
+            :key="type.value"
+            v-bind="type"
+          />
+        </el-select>
+      </el-col>
+    </el-row>
+
+    <el-row :gutter="10" style="margin-bottom: 10px">
+      <el-col :span="8">
+        <el-select
+          class="w-full"
+          size="small"
+          clearable
+          v-model="data.qrdtype"
+          placeholder="商品类型"
+        >
+          <el-option
+            v-for="type in xs_order_type_options"
+            :key="type.value"
+            v-bind="type"
+          />
+        </el-select>
+      </el-col>
+
+      <el-col :span="8">
+        <el-input placeholder="客户名称" size="small" v-model="data.customer" />
+      </el-col>
+      <el-col :span="8">
+        <el-input placeholder="平台名称" size="small" v-model="data.platName" />
+      </el-col>
+    </el-row>
+
+    <el-row :gutter="10">
+      <el-col :span="8">
+        <el-input
+          placeholder="销售订单主编码"
+          size="small"
+          v-model="data.cxCode"
+        />
+      </el-col>
+
+      <el-col :span="8">
+        <el-switch
+          v-model="data.platform_type"
+          size="small"
+          active-text="toC"
+          inactive-text="toB"
+          active-value="2"
+          inactive-value="1"
+        />
+        <!-- <el-select
+          v-model="data.platform_type"
+          size="small"
+          placeholder="平台类型"
+          style="width: 100%"
+        >
+          <el-option
+            v-for="opt in useTypeOptions"
+            :value="opt.value"
+            :label="opt.label"
+            :key="opt.value"
+          />
+        </el-select> -->
+      </el-col>
+    </el-row>
+
+    <div flex gap-2 justify-end mb-1>
+      <el-button size="small" type="primary" @click="() => search()"
+        >搜索</el-button
+      >
+      <el-button size="small" @click="() => search(true)">重置</el-button>
+    </div>
+
+    <el-table
+      v-loading="loading"
+      :data="saleOrderList"
+      @selection-change="handleSelectChange"
+      ref="tableRef"
+      border
+      size="small"
+      row-key="sequenceNo"
+      max-height="520px"
+    >
+      <el-table-column
+        v-for="(col, index) in sale_columns"
+        :prop="col.field"
+        :label="col.label"
+        :key="index"
+        :width="col.width + 'px'"
+        :fixed="col.fixed"
+        :type="col.type"
+        show-overflow-tooltip
+      >
+        <template #default="{ row }">
+          <el-tag v-if="col.field === 'qrdType'" size="small">
+            {{
+              xs_order_type_options.find(s => s.value === row.qrdType)?.label ||
+              "--"
+            }}
+          </el-tag>
+
+          <el-tag v-else-if="col.field === 'qrdSource'" size="small">
+            {{
+              xs_order_source_options.find(s => s.value === row.qrdSource)
+                ?.label || "--"
+            }}
+          </el-tag>
+
+          <el-tag v-else-if="col.field === 'sendStatus'">
+            {{
+              send_status_list.find(p => String(row.sendStatus) === p.value)
+                ?.label
+            }}
+          </el-tag>
+
+          <el-tag v-if="col.field === 'platform_type'" size="small">
+            {{
+              useTypeOptions.find(s => s.value === row.platform_type)?.label ||
+              "--"
+            }}
+          </el-tag>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <div flex justify-between mt-2>
+      <el-pagination
+        v-model:current-page="pagination.currentPage"
+        v-model:page-size="pagination.pageSize"
+        :total="pagination.total"
+        :page-sizes="[15, 50, 100]"
+        @size-change="handleSizeChange"
+        layout="sizes, prev, pager, next"
+        @current-change="reuquestSalelist"
+        size="small"
+      />
+
+      <div>
+        <el-button type="primary" @click="handleSave" size="small"
+          >保存</el-button
+        >
+        <el-button @click="() => (visible = false)" size="small"
+          >取消</el-button
+        >
+      </div>
+    </div>
+  </el-dialog>
+</template>

+ 55 - 0
src/views/InvoiceSales/capitalPool/components/execl-capital-files-upload/columns-config.ts

@@ -0,0 +1,55 @@
+const initheaders = [
+  "收款方公司编码",
+  "收款方公司名称",
+  "资金编码",
+  "订单编码",
+  "认领资金"
+];
+
+export const requireHeaders = [
+  "收款方公司编码",
+  "资金编码",
+  "订单编码",
+  "认领资金"
+];
+
+export const requsetHeaderIdxs = [
+  "companyNo",
+  "tradNo",
+  "orderCode",
+  "trad_fee"
+];
+
+const columns = () => {
+  const list: any[] = [
+    {
+      type: "index",
+      width: "50",
+      fixed: "left",
+      label: "序号"
+    },
+    {
+      prop: "companyNo",
+      label: "收款方公司编码"
+    },
+    {
+      prop: "companyName",
+      label: "收款方公司名称"
+    },
+    {
+      prop: "tradNo",
+      label: "资金编码"
+    },
+    {
+      prop: "orderCode",
+      label: "订单编码"
+    },
+    {
+      prop: "trad_fee",
+      label: "认领资金"
+    }
+  ];
+  return list;
+};
+
+export { initheaders, columns };

+ 186 - 0
src/views/InvoiceSales/capitalPool/components/execl-capital-files-upload/index.vue

@@ -0,0 +1,186 @@
+<script setup lang="ts">
+import { ref, unref } from "vue";
+import { httpCapitalUpload } from "/@/api/InvoiceSales/capitalClaim";
+import {
+  initheaders,
+  columns,
+  requireHeaders,
+  requsetHeaderIdxs
+} from "./columns-config";
+import { ElMessage, ElNotification } from "element-plus";
+import { responseHandle } from "/@/utils/responseHandle";
+import { useNav } from "/@/layout/hooks/nav";
+import { execlUpload } from "/@/components/execlUpload";
+const visible = ref(false);
+const loading = ref(false);
+const tableData = ref([]);
+const columnsConfig = columns();
+const { logout } = useNav();
+const emit = defineEmits(["onSuccess"]);
+
+const handleClose = () => {
+  // execlFile.value = null;
+  // uploadRef.value.clearFiles();
+};
+const Uploadsuccess = ({ results, header }) => {
+  loading.value = true;
+
+  if (results.length === 0) {
+    ElMessage.error("表格无有效数据!");
+    loading.value = false;
+    return;
+  }
+
+  let headok = true;
+  console.log(header);
+  console.log(initheaders);
+  if (header.length !== initheaders.length) {
+    headok = false;
+  } else {
+    initheaders.forEach((si, sii) => {
+      if (si !== header[sii]) {
+        headok = false;
+      }
+    });
+  }
+  if (!headok) {
+    ElMessage.error("表头与导入模板不匹配!");
+    loading.value = false;
+    return;
+  }
+  tableData.value = [];
+
+  try {
+    results.forEach(v1 => {
+      const b = Object.values(v1);
+      let model = {
+        companyNo: b[0],
+        companyName: b[1],
+        tradNo: b[2],
+        orderCode: b[3],
+        trad_fee: b[4]
+      };
+
+      tableData.value.push(model);
+    });
+    loading.value = false;
+  } catch (e) {
+    ElMessage.error("导入数据拼接有误!");
+    loading.value = false;
+  }
+};
+//提交
+const handleSubmit = async () => {
+  if (loading.value) return;
+  loading.value = true;
+  let isok = true;
+  tableData.value.forEach(key => {
+    for (let i in key) {
+      if (requsetHeaderIdxs.includes(i) && !key[i]) {
+        isok = false;
+      }
+    }
+  });
+  if (!isok) {
+    ElNotification({
+      title: "必填字段缺失!",
+      type: "error"
+    });
+    loading.value = false;
+    return;
+  }
+
+  const { code, message } = await httpCapitalUpload({ list: unref(tableData) });
+  responseHandle({
+    code,
+    message,
+    logout,
+    handler: () => {
+      loading.value = false;
+      ElMessage.success("订单认款数据导入成功!");
+      emit("onSuccess");
+      visible.value = false;
+    },
+    error: () => {
+      loading.value = false;
+      ElNotification({
+        title: message,
+        type: "error"
+      });
+    }
+  });
+};
+const cancel = () => {
+  tableData.value = [];
+};
+
+defineExpose({
+  onDisplay: () => ((visible.value = true), (tableData.value = []))
+});
+</script>
+
+<template>
+  <el-dialog
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    v-model="visible"
+    title="导入订单认款数据"
+    width="1040px"
+    top="8vh"
+    center
+    @close="handleClose"
+  >
+    <execlUpload @on-success="Uploadsuccess" v-if="tableData.length === 0" />
+    <el-table
+      :data="tableData"
+      stripe
+      border
+      max-height="500px"
+      size="small"
+      style="width: 100%"
+    >
+      <el-table-column
+        v-for="(si, sii) in columnsConfig"
+        :type="si.type"
+        :minWidth="si.minWidth"
+        :fixed="si.fixed"
+        :key="sii"
+        :prop="si.prop"
+        show-overflow-tooltip
+      >
+        <template #header>
+          <span
+            v-if="!requireHeaders.includes(si.label) || si.label === '序号'"
+            >{{ si.label }}</span
+          >
+          <p v-else>
+            <span style="color: #f56c6c; font-size: 14px">* </span>
+            {{ si.label }}
+          </p>
+        </template>
+      </el-table-column>
+    </el-table>
+    <div
+      flex
+      justify-end
+      gap-2
+      v-if="tableData.length !== 0"
+      style="padding: 10px 0 0 0"
+    >
+      <el-button size="small" @click="cancel">取消</el-button>
+      <el-button
+        size="small"
+        type="primary"
+        :loading="loading"
+        @click="handleSubmit"
+        >保存</el-button
+      >
+    </div>
+  </el-dialog>
+</template>
+
+<style lang="scss" scoped>
+:deep(.el-upload-list__item) {
+  display: none !important;
+}
+</style>

+ 8 - 13
src/views/InvoiceSales/capitalPool/config/content.config.ts

@@ -13,18 +13,12 @@ import {
 import { renderIconLabelLeft } from "/@/utils/columnRenderHelper";
 
 const columns = [
-  // {
-  //   type: "selection",
-  //   width: 40,
-  // align: "center"
-  //   hide: ({ checkList }) => !checkList.includes("勾选列")
-  // },
-  // {
-  //   label: "序号",
-  //   type: "index",
-  //   width: 70,
-  //   hide: ({ checkList }) => !checkList.includes("序号列")
-  // },
+  {
+    type: "selection",
+    align: "center",
+    width: 40,
+    fixed: 'left'
+  },
   {
     label: "资金认领编码",
     prop: "logNo",
@@ -150,7 +144,8 @@ const contentConfig: ContentConfig = {
   title: "资金公海池",
   columns,
   apis: {
-    httpList
+    httpList,
+    httpAdd: true
   }
 };
 

+ 24 - 0
src/views/InvoiceSales/capitalPool/config/xls-template.ts

@@ -0,0 +1,24 @@
+export const template = {
+  收款方公司编码: "",
+  收款方公司名称: "",
+  收款方账户: "",
+  ND编号: "",
+  平台订单编号: "",
+  订单客户名称: "",
+  交易时间: "",
+  收入金额: "",
+  账号余额: "",
+  交易行名: "",
+  // 对方省市: "",
+  对方账号: "",
+  对方户名: "",
+  交易用途: ""
+};
+
+export const capitalTemplate = {
+  收款方公司编码: "",
+  收款方公司名称: "",
+  资金编码: "",
+  订单编码: "",
+  认领资金: ""
+};

+ 109 - 0
src/views/InvoiceSales/capitalPool/detail.vue

@@ -0,0 +1,109 @@
+<script setup lang="ts">
+import { computed, onMounted, ref, watchEffect } from "vue";
+import { useRoute } from "vue-router";
+import { useAsync } from "/@/hooks";
+import { httpInfo } from "/@/api/InvoiceSales/capitalClaim";
+import { approval_process } from "./approval-process";
+import BasicDescriptions from "/@/components/BasicDescriptions";
+import { httpDetail, httpStatus } from "/@/api/InvoiceSales/capitalPool";
+import { CAPITAL_COLUMNS } from "/@/utils/details/tragelog";
+import { ORDER_COLUMNS, GOOD_COLUMNS } from "/@/utils/details/sale";
+import { usePermission } from "/@/hooks/core/usePermission";
+import { useUserInfo } from "/@/hooks/core/useUser";
+
+import FundDetail from "/@/components/FundDetail/index.vue"
+import BaseForm from "./base-form/index.vue"
+
+
+const { query } = useRoute();
+const collapses = ref(["1", "2", "3", "4", "5"]);
+const logNo = computed(() => query.id);
+
+const pageName = "capitalPoolDetail";
+
+
+const { isSuperUser } = useUserInfo();
+const { hasPermissionWithCode } = usePermission(pageName);
+const tradeNo = computed(() => capitalDetail.value?.tradNo);
+
+
+const { data: capitalDetail, run: capitalDetailRun, loading } = useAsync<Record<string, string>>({ initialData: {} });
+const { data: tradeDetail, run: tradeDetailRun } = useAsync<Record<string, string>>({ initialData: {} });
+
+
+const { run: capitalStatusRun } = useAsync({ success: () => { requestCapitalDetail(); } });
+const requestCapitalDetail = () => capitalDetailRun(httpDetail({ logNo: logNo.value }) );
+const requestTradeDetail = () => tradeDetailRun(httpInfo({ tradNo: tradeNo.value }));
+
+//当前的审核流程
+const currentProcess = computed(() => approval_process[capitalDetail.value?.status]);
+
+//资金认证状态
+const requestCapitalStatus = (otherParams: Record<any, any>) => { capitalStatusRun(httpStatus({
+      logNo: logNo.value,
+      ...otherParams
+    })
+  );
+};
+
+//初始化数据
+function initialData() {
+  if (!logNo.value) return;
+  requestCapitalDetail();
+}
+
+onMounted(() => initialData());
+watchEffect(() => tradeNo.value && requestTradeDetail());
+</script>
+
+<template>
+  <div class="capital__content" bg-white v-loading="loading">
+    <ElTabs>
+      <ElTabPane :label="tradeNo ? '资金详情' : '新建资金认领'">
+        <ElCollapse v-model="collapses">
+          <ElCollapseItem title="资金详情" name="1"  v-if="tradeNo">
+            <FundDetail :tradeInfo="tradeDetail || {}" />
+          </ElCollapseItem>
+
+          <ElCollapseItem title="新建资金认领" name="2" v-else>
+            <BaseForm />
+          </ElCollapseItem>
+
+        <template v-if="tradeNo">
+            <!-- 详情 -->
+          <ElCollapseItem title="认领资金详情" name="4">
+            <BasicDescriptions :columns="CAPITAL_COLUMNS" :data="capitalDetail || {}" />
+          </ElCollapseItem>
+
+          <!-- 关联订单 -->
+          <ElCollapseItem title="关联订单信息" name="2">
+            <BasicDescriptions
+              :columns="ORDER_COLUMNS"
+              :data="capitalDetail?.orderinfo ? capitalDetail.orderinfo : {}"
+            />
+          </ElCollapseItem>
+
+          <ElCollapseItem title="商品信息" name="3">
+            <BasicDescriptions
+              :columns="GOOD_COLUMNS"
+              :data="capitalDetail?.orderinfo ? capitalDetail.orderinfo : {}"
+            />
+          </ElCollapseItem>
+
+          <!-- 审核 -->
+          <ElCollapseItem
+            name="5"
+            v-if="currentProcess && !isSuperUser && hasPermissionWithCode('025')"
+            :title="currentProcess.title"
+          >
+            <component
+              :is="currentProcess.component"
+              @change-status="requestCapitalStatus"
+            />
+          </ElCollapseItem>
+          </template>
+        </ElCollapse>
+      </ElTabPane>
+    </ElTabs>
+  </div>
+</template>

+ 206 - 13
src/views/InvoiceSales/capitalPool/index.vue

@@ -1,25 +1,57 @@
 <script setup lang="ts">
-import { ref } from "vue";
+import { ref, computed } from "vue";
 import contentConfig from "./config/content.config";
 import searchConfig from "./config/search.config";
 import CapitalModal from "./components/capital-modal.vue";
 import { usePageSearch, type PageHooks, type PageEvents } from "/@/hooks/page";
 import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
 import { usePermission } from "/@/hooks/core/usePermission";
-import { httpWithdraw } from "/@/api/InvoiceSales/capitalClaim";
+import { httpWithdraw, httpBatchStatus } from "/@/api/InvoiceSales/capitalClaim";
 import { useAsync } from "/@/hooks/core/useAsync";
 import { useRouter } from "vue-router";
+import { useTask } from "/@/hooks/core"
+import { ElMessage } from "element-plus"
+import { useCompany } from "/@/hooks/core/useCompany";
+import { httpRequsetExport } from "/@/utils/export";
+import { useUserInfo } from "/@/hooks/core/useUser";
+import { template, capitalTemplate } from "./config/xls-template";
+import ExeclCapitalUpload from "./components/execl-capital-files-upload/index.vue";
+import { utils, writeFile } from "xlsx";
 
 const PageName = "capitalPool";
+
+const selected = ref([])
+const formRef = ref<any>(null)
+const visible = ref(false)
+
+const loading = ref(false);
+const formData = ref({ status: '', remark: '' })
+
+const { currentCompany } = useCompany();
+
+const rules = computed(() => ({
+  status: [{ required: true, message: "请选择审核状态", trigger: 'change' }],
+  remark: [{ required: formData.value.status == '3', message: "请选择审核状态", trigger: 'change' }],
+}))
+
+
+const batchTask = useTask({
+  success: () => {
+    pageContentRef.value.onSearch()
+    visible.value = false
+  }
+})
+
 const capitalModalRef = ref<InstanceType<typeof CapitalModal> | null>(null);
-const { hasPermissionWithCode } = usePermission("capitalClaim");
+
+const { hasPermissionWithCode } = usePermission("capitalPool");
 const pageContentRef = ref(null)
+const execlCapitalUploadRef = ref<InstanceType<typeof ExeclCapitalUpload>>(null);
+const { run: withDraw } = useAsync({ success: () => pageContentRef.value.onSearch() });
+const handleWithDraw = data => withDraw(httpWithdraw(data));
 
-const { run: withDraw } = useAsync({
-  success: () => pageContentRef.value.onSearch()
-});
 
-const handleWithDraw = data => withDraw(httpWithdraw(data));
+const { isSuperUser } = useUserInfo();
 
 const router = useRouter();
 
@@ -29,24 +61,185 @@ const hooks: PageHooks = {
 
 const events: PageEvents = {
   content: {
-    preview: ({ logNo }) => router.push('/InvoiceSales/capitalDetail?id=' + logNo + "&back=capitalPool")
+    preview: ({ logNo }) => router.push('/InvoiceSales/capitalPoolDetail?id=' + logNo),
+    create: () =>  router.push('/InvoiceSales/capitalPoolDetail')
   }
 };
+
+//导出模板
+function onCapitalDownloadTemplate() {
+  //创建数据表
+  const workBook = utils.book_new();
+  const workSheet = utils.json_to_sheet([capitalTemplate]);
+  utils.book_append_sheet(workBook, workSheet, "sheet");
+  //导出模板
+  writeFile(workBook, "订单认款导入模板.xlsx", { bookType: "xlsx" });
+}
+
+
+function handleBatch(){
+  if(selected.value.length === 0){
+    ElMessage.warning('请选择至少一条状态为`待审批`的数据')
+    return
+  }
+
+  const hasNoWaitData = selected.value.some(item => item.status !== '1')
+
+  if(hasNoWaitData){
+    ElMessage.warning('请选择状态为`待审批`的数据')
+    return
+  }
+
+  visible.value = true
+}
+
+//导出模板
+async function onDownloadOpenInv() {
+  const params = pageContentRef.value.getBasicParams()
+  if (!params.start || !params.end) {
+    ElMessage.warning('请选择导出的时间区间')
+    return
+  }
+
+  if(params.status !=  2){
+    ElMessage.warning('请筛选资金认领状态为`审核通过`的数据')
+    return
+  }
+
+
+  const { start, end, ...rest } = params
+
+  const parameter = { 
+    create_start: start, 
+    create_end: end,
+    ...rest
+  }
+
+  const delay = 24 * 60 * 60 * 1000;
+  const start_updatetime = new Date(params.start).valueOf();
+  const end_updatetime = new Date(params.end).valueOf() + delay;
+  const day = (end_updatetime - start_updatetime) / delay;
+
+  if (day > 31) {
+     ElMessage.warning("时间区间不能超过31天!");
+     return false;
+  }
+
+  await httpRequsetExport({
+    url: "ope",
+    name: "资金认领数据表",
+    onStart: () => (loading.value = true),
+    onSuccess: () => (loading.value = false),
+    onFail: () => (loading.value = false),
+    params: { ...parameter, company: currentCompany.value.companyNo }
+  });
+}
+
+
+async function handleBatchSubmit(){
+  try{
+    await formRef.value?.validate()
+    batchTask.run(httpBatchStatus({ 
+      idArr: selected.value.map(({id}) => id),
+     status: formData.value.status,
+     remark: formData.value.remark
+    }))
+  }catch(err){
+    console.log(err)
+  }
+}
+
+function handleImportData(){
+  execlCapitalUploadRef.value?.onDisplay()
+}
 </script>
 
 <template>
-  <PageAuth :pageName="PageName">
-    <PageContainer :hooks="hooks" :events="events" :get-content-ref="ref => pageContentRef = ref"  :contentConfig="contentConfig" :search-config="searchConfig">
+  <div>
+    <PageAuth :pageName="PageName" class="capital-claim">
+    <PageContainer 
+      :hooks="hooks" 
+      :events="events" 
+      :get-content-ref="ref => pageContentRef = ref"  
+      :contentConfig="contentConfig" 
+      :search-config="searchConfig"
+       @content-select-change="values => selected = values"
+    >
+      <template #content_header>
+        <ElButton v-if="hasPermissionWithCode('040')" size="small" type="primary" @click="handleBatch">
+          批量审批
+        </ElButton>
+      </template>
+      
       <template #content_action="row">
         <el-popconfirm
-          v-if="hasPermissionWithCode('009') && String(row.status) === '1'" placement="top"
-          title="是否确认撤销资金认领?"    @confirm="() => handleWithDraw({ logNo: row.logNo })">
+          placement="top"
+          title="是否确认撤销资金认领?" 
+          @confirm="() => handleWithDraw({ logNo: row.logNo })"
+          v-if="hasPermissionWithCode('009') && String(row.status) === '1'" 
+          >
           <template #reference>
             <el-button :icon="useRenderIcon('refresh-right')" type="primary" link />
           </template>
         </el-popconfirm>
       </template>
+
+      <template #search_action>
+        <el-button-group>
+          <el-button
+          type="warning" plain
+          v-if="!isSuperUser && hasPermissionWithCode('034')"
+          @click="onCapitalDownloadTemplate"
+          >
+          1.下载订单认款导入模板
+        </el-button>
+
+        <el-button
+          type="primary" plain
+           v-if="!isSuperUser && hasPermissionWithCode('035')"
+           @click="handleImportData"
+        >
+           2.导入订单认款数据(批量)
+        </el-button>
+
+        <el-button 
+           type="success" plain
+          :loading="loading" @click="() => onDownloadOpenInv()">
+           3.导出资金认领数据
+          </el-button>
+        </el-button-group>
+      </template>
     </PageContainer>
-    <CapitalModal ref="capitalModalRef" />
+    <CapitalModal ref="capitalModalRef"  />
+
+    <ElDialog v-model="visible" title="批量审批" center @close="formData = { status: '', remark: '' }">
+      <ElForm :model="formData" :rules="rules" ref="formRef" v-loading="batchTask.loading">
+        <ElFormItem prop="status" label="审核状态">
+          <ElSelect placeholder="审核状态" v-model="formData.status" style="width: 100%">
+            <ElOption value="2" label="通过" />
+            <ElOption value="3" label="驳回" />
+          </ElSelect>
+        </ElFormItem>
+
+        <ElFormItem prop="remark" label="审核备注">
+          <ElInput 
+            v-model="formData.remark" 
+            placeholder="审核备注"
+            type="textarea" 
+          />
+        </ElFormItem>
+
+        <ElFormItem>
+          <div class="w-full flex justify-end">
+            <ElButton type="primary" @click="handleBatchSubmit">
+              保存
+            </ElButton>
+          </div>
+        </ElFormItem>
+      </ElForm>
+    </ElDialog>
   </PageAuth>
+
+  <ExeclCapitalUpload ref="execlCapitalUploadRef" @onSuccess="pageContentRef.onSearch()" />
+  </div>
 </template>

+ 33 - 6
src/views/InvoiceSales/invoiceApply/components/add-edit-form/add-edit-form.vue

@@ -13,6 +13,7 @@ import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
 import InvoiceTitle from "./invoice-title.vue";
 import { convertInvoiceTitle, convertInvoiceTitleData } from "./columns";
 import { useCompany } from "/@/hooks/core/useCompany";
+import { addition } from "/@/utils/calc";
 
 import { ADD_EDIT_FORM_RULES } from "./../../config/configs";
 import { xs_inv_type_list, useTypeOptions } from "/@/utils/status";
@@ -110,6 +111,7 @@ function generatorOrderArr() {
   return { orderArr };
 }
 
+
 function handleSave() {
   formRef.value.validate(async isValid => {
     if (!isValid) return;
@@ -266,6 +268,21 @@ watch(
 onMounted(() => {
   handleCompanyChange(currentCompany.value.companyNo);
 });
+
+
+
+const totalPrice = ref('0.00')
+watch(() => mapSequenceNoToInvfee.value, (newVal) => {
+
+  totalPrice.value = '0.00'
+  const keys = Object.keys(mapSequenceNoToInvfee.value);
+  const orderArr = keys.map(sequenceNo => {
+    const { inv_fee } = mapSequenceNoToInvfee.value[sequenceNo];
+    totalPrice.value = Number(addition(totalPrice.value, inv_fee)).toFixed(2)
+  })
+}, {
+  deep: true
+})
 </script>
 
 <template>
@@ -373,12 +390,16 @@ onMounted(() => {
         <el-col :span="24" v-show="TYPE === 'order'">
           <el-form-item label="订单列表">
             <div flex justify-between w-full mb-2>
-              <el-tag :type="orderList.length > max ? 'danger' : 'info'"
-                >{{ orderList.length }} / {{ max }}</el-tag
-              >
-              <el-button type="primary" @click="handleAddModalShow"
-                >添加</el-button
-              >
+              <div class="flex">
+                <el-tag :type="orderList.length > max ? 'danger' : 'info'">
+                  {{ orderList.length }} / {{ max }}
+                </el-tag>
+
+                <el-tag style="margin-left: 10px" type="primary" size="small">{{totalPrice}}元</el-tag>
+              </div>
+
+
+              <el-button type="primary" @click="handleAddModalShow">添加</el-button>
             </div>
             <el-table :data="orderList" stripe border max-height="300">
               <el-table-column
@@ -387,6 +408,12 @@ onMounted(() => {
                 show-overflow-tooltip
                 width="150"
               />
+              <el-table-column
+                prop="sequenceNo"
+                label="销售订单主编码"
+                show-overflow-tooltip
+                width="150"
+              />
               <el-table-column
                 prop="poCode"
                 label="平台订单编码"

+ 29 - 3
src/views/InvoiceSales/invoiceApply/components/currentcy-form/add-edit-form.vue

@@ -13,6 +13,8 @@ import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
 import InvoiceTitle from "./invoice-title.vue";
 import { convertInvoiceTitle, convertInvoiceTitleData } from "./columns";
 import { useCompany } from "/@/hooks/core/useCompany";
+import { addition } from "/@/utils/calc";
+
 
 import { ADD_EDIT_FORM_RULES } from "./../../config/configs";
 import { xs_inv_type_list, useTypeOptions } from "/@/utils/status";
@@ -266,6 +268,18 @@ onMounted(async () => {
   ruleForm.value.buyNo = 'GS2404151642335170'
   handleSupplierChange('GS2404151642335170')
 });
+
+const totalPrice = ref('0.00')
+watch(() => mapSequenceNoToInvfee.value, (newVal) => {
+  totalPrice.value = '0.00'
+  const keys = Object.keys(mapSequenceNoToInvfee.value);
+  const orderArr = keys.map(sequenceNo => {
+    const { inv_fee } = mapSequenceNoToInvfee.value[sequenceNo];
+    totalPrice.value = Number(addition(totalPrice.value, inv_fee)).toFixed(2)
+  })
+}, {
+  deep: true
+})
 </script>
 
 <template>
@@ -377,9 +391,15 @@ onMounted(async () => {
         <el-col :span="24" v-show="TYPE === 'order'">
           <el-form-item label="订单列表">
             <div flex justify-between w-full mb-2>
-              <el-tag :type="orderList.length > max ? 'danger' : 'info'"
-                >{{ orderList.length }} / {{ max }}</el-tag
-              >
+              <div class="flex">
+                <el-tag :type="orderList.length > max ? 'danger' : 'info'">
+                  {{ orderList.length }} / {{ max }}
+                </el-tag>
+
+                <el-tag style="margin-left: 10px" type="primary" size="small">{{totalPrice}}元</el-tag>
+              </div>
+              
+              
               <el-button type="primary" @click="handleAddModalShow"
                 >添加</el-button
               >
@@ -391,6 +411,12 @@ onMounted(async () => {
                 show-overflow-tooltip
                 width="150"
               />
+              <el-table-column
+                prop="sequenceNo"
+                label="销售订单主编码"
+                show-overflow-tooltip
+                width="150"
+              />
               <el-table-column
                 prop="poCode"
                 label="平台订单编码"

Неке датотеке нису приказане због велике количине промена