From 242d318e85df66b916f554d64a026cfe0cb58e19 Mon Sep 17 00:00:00 2001
From: wujianwei <wjw@11.com>
Date: 星期四, 15 一月 2026 10:26:59 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/cwxt_master' into cwxt_master

---
 ui/admin-ui3/src/api/cwgl/fundFlow.ts                                 |   17 
 ui/admin-ui3/src/components/AccountsPayableManagementDialog/index.vue |  222 ++++++++
 ui/admin-ui3/src/views/cwgl/fundFlow/index.vue                        |  434 ++++++++++-----
 ui/admin-ui3/src/components/receivableBillManagementDialog/index.vue  |   30 
 ui/admin-ui3/src/views/cwgl/fundFlowClaimDetail/index.vue             |  259 ++++-----
 ui/admin-ui3/src/components/ClaimBillDialog/index.vue                 |  543 ++++++++++++++++++++
 6 files changed, 1,206 insertions(+), 299 deletions(-)

diff --git a/ui/admin-ui3/src/api/cwgl/fundFlow.ts b/ui/admin-ui3/src/api/cwgl/fundFlow.ts
index 0aac047..5828699 100644
--- a/ui/admin-ui3/src/api/cwgl/fundFlow.ts
+++ b/ui/admin-ui3/src/api/cwgl/fundFlow.ts
@@ -56,6 +56,15 @@
     })
 }
 
+/**
+ * 纭璧勯噾娴佹按
+ */
+export const confirmFundFlow:requestType = (id) => {
+    return request({
+        url: '/cwgl/fundFlow/confirm/' + id,
+        method: 'put'
+    })
+}
 
 /**
  * 瀵煎嚭璧勯噾娴佹按
@@ -65,3 +74,11 @@
         download('/cwgl/fundFlow/export',query);
     })
 }
+/* 璐﹀崟璁ら */
+export const addFundFlowClaimDetailClaim:requestType = (data,id) => {
+    return request({
+        url: '/cwgl/fundFlowClaimDetail/claim/'+id,
+        method: 'post',
+        data
+    })
+}
\ No newline at end of file
diff --git a/ui/admin-ui3/src/components/AccountsPayableManagementDialog/index.vue b/ui/admin-ui3/src/components/AccountsPayableManagementDialog/index.vue
new file mode 100644
index 0000000..58160b3
--- /dev/null
+++ b/ui/admin-ui3/src/components/AccountsPayableManagementDialog/index.vue
@@ -0,0 +1,222 @@
+<template>
+  <el-dialog v-model="dialogVisible" title="璇烽�夋嫨 鍏宠仈搴斾粯璐﹀崟" width="85%" destroy-on-close @close="handleClose"
+    append-to-body>
+    <div class="search-bar">
+      <el-form inline :model="queryParams" class="search-form" size="default">
+        <el-form-item label="绯荤粺缂栧彿:">
+          <el-input v-model="queryParams.systemNo" placeholder="璇疯緭鍏ョ郴缁熺紪鍙�" style="width: 180px" clearable />
+        </el-form-item>
+
+        <el-form-item label="璐﹀崟鍚嶇О:">
+          <el-input v-model="queryParams.billName" placeholder="璇疯緭鍏ヨ处鍗曞悕绉�" style="width: 180px" clearable />
+        </el-form-item>
+
+        <el-form-item label="渚涘簲鍟嗗悕绉�:">
+          <el-input v-model="queryParams.supplierName" placeholder="璇疯緭鍏ヤ緵搴斿晢鍚嶇О" style="width: 180px" clearable />
+        </el-form-item>
+
+        <!-- <el-form-item label="鐘舵��:">
+          <el-select v-model="queryParams.status" style="width: 150px;" placeholder="璇烽�夋嫨鐘舵��" clearable>
+            <el-option v-for="dict in sys_bill_status" :key="dict.value" :label="dict.label" :value="dict.value" />
+          </el-select>
+        </el-form-item> -->
+
+        <el-form-item>
+          <el-button type="primary" icon="Search" @click="handleSearch">鎼滅储</el-button>
+          <el-button plain icon="RefreshLeft" @click="handleReset">娓呯┖</el-button>
+        </el-form-item>
+      </el-form>
+    </div>
+
+    <el-table ref="customerTableRef" :data="customerList" border size="small" style="width: 100%"
+      :highlight-current-row="true" row-key="id" @current-change="handleRowSelect" class="customer-table">
+      <el-table-column prop="systemNo" label="绯荤粺缂栧彿" min-width="150" show-overflow-tooltip />
+      <el-table-column prop="billName" label="璐﹀崟鍚嶇О" min-width="150" show-overflow-tooltip />
+      <el-table-column prop="supplierName" label="渚涘簲鍟嗗悕绉�" min-width="150" show-overflow-tooltip />
+      
+      <el-table-column prop="isInternalSettlement" label="鏄惁鍐呴儴缁撶畻" min-width="120">
+        <template #default="scope">
+          {{ dictFormat(sys_whether_type, scope.row.isInternalSettlement) }}
+        </template>
+      </el-table-column>
+
+      <el-table-column prop="internalSettlementUnit" label="鍐呴儴缁撶畻鍗曚綅" min-width="120" show-overflow-tooltip />
+      <el-table-column prop="documentCount" label="鍗曟嵁鏁伴噺" min-width="100" />
+      <el-table-column prop="totalAmount" label="搴旂粨绠楅噾棰�" min-width="120" />
+      
+      <el-table-column prop="currency" label="甯佸埗" min-width="100">
+        <template #default="scope">
+          {{ dictFormat(sys_currency, scope.row.currency) }}
+        </template>
+      </el-table-column>
+
+      <el-table-column prop="discountAmount" label="鍑忓厤閲戦" min-width="100" />
+      <el-table-column prop="paidAmount" label="宸蹭粯閲戦" min-width="100" />
+      <el-table-column prop="pendingAmount" label="寰呬粯閲戦" min-width="100" />
+
+      <el-table-column prop="status" label="鐘舵��" width="100">
+        <template #default="scope">
+          {{ dictFormat(sys_bill_status, scope.row.status) }}
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+      v-model:limit="queryParams.pageSize" @pagination="getList" />
+
+    <template #footer>
+      <div class="dialog-footer">
+        <el-button @click="handleClose">鍙栨秷</el-button>
+        <el-button type="primary" @click="handleConfirm">纭畾閫夋嫨</el-button>
+      </div>
+    </template>
+  </el-dialog>
+</template>
+
+<script setup lang="ts">
+import { ref, reactive, watch, nextTick } from 'vue';
+import type { Table } from 'element-plus';
+import { ElMessage } from 'element-plus';
+import useCurrentInstance from "@/utils/useCurrentInstance";
+import { listPayableBillManagement } from "@/api/cwgl/payableBillManagement";
+
+interface Customer {
+  id: string | number;
+  systemNo: string;
+  billName: string;
+  supplierName: string;
+  isInternalSettlement: string;
+  internalSettlementUnit: string;
+  documentCount: number;
+  totalAmount: number;
+  currency: string;
+  discountAmount: number;
+  paidAmount: number;
+  pendingAmount: number;
+  status: string | number;
+}
+
+const props = defineProps({
+  visible: { type: Boolean, default: false },
+  defaultSelectedId: { type: [String, Number], default: '' },
+  // 鏂板锛氭帴鏀堕粯璁ょ姸鎬�
+  defaultStatus: { type: [String, Number], default: '' } 
+});
+
+const emit = defineEmits(['confirm', 'close', 'update:visible']);
+
+const { proxy } = useCurrentInstance();
+// 鑾峰彇鎵�闇�鐨勫瓧鍏�
+const { sys_bill_status, sys_currency, sys_whether_type } = proxy.useDict(
+  'sys_bill_status', 
+  'sys_currency', 
+  'sys_whether_type'
+);
+
+const dictFormat = (dict: any, value: any) => {
+  return proxy.selectDictLabel(dict, value);
+};
+
+const dialogVisible = ref(false);
+const customerList = ref<Customer[]>([]);
+const total = ref(0);
+const selectedRow = ref<Customer | null>(null);
+const customerTableRef = ref<InstanceType<typeof Table>>();
+
+const queryParams = reactive({
+  systemNo: '',
+  billName: '',
+  supplierName: '',
+  status: '',
+  pageNum: 1,
+  pageSize: 10
+});
+
+const getDataList = async () => {
+  try {
+    const res = await listPayableBillManagement(queryParams);
+    if (res.code === 200) {
+      customerList.value = res.rows;
+      total.value = res.total;
+      return res.rows;
+    }
+  } catch (err) {
+    console.error('鍔犺浇鍒楄〃澶辫触锛�', err);
+  }
+  return [];
+};
+
+const autoSelectRow = (list: Customer[]) => {
+  if (!props.defaultSelectedId || list.length === 0) return;
+  nextTick(() => {
+    const target = list.find(item => String(item.id) === String(props.defaultSelectedId));
+    if (target && customerTableRef.value) {
+      customerTableRef.value.setCurrentRow(target);
+      selectedRow.value = target;
+    }
+  });
+};
+
+const handleSearch = () => {
+  queryParams.pageNum = 1;
+  getList();
+};
+
+const handleReset = () => {
+  // 閲嶇疆鍏朵粬鎼滅储瀛楁
+  queryParams.systemNo = '';
+  queryParams.billName = '';
+  queryParams.customerName = '';
+  
+  // 鏍稿績澶勭悊锛氬鏋滄湁榛樿鐘舵�佸�煎氨鎭㈠榛樿鍊硷紝娌℃湁鎵嶈涓虹┖
+  if (props.defaultStatus !== undefined && props.defaultStatus !== null && props.defaultStatus !== '') {
+    queryParams.status = props.defaultStatus;
+  } else {
+    queryParams.status = '';
+  }
+
+  handleSearch();
+};
+
+const getList = () => {
+  getDataList().then((list) => {
+    autoSelectRow(list);
+  });
+};
+
+const handleRowSelect = (val: Customer | null) => {
+  selectedRow.value = val;
+};
+
+const handleConfirm = () => {
+  if (!selectedRow.value) {
+    ElMessage.warning('璇峰厛鐐瑰嚮琛ㄦ牸閫夋嫨涓�琛屾暟鎹�');
+    return;
+  }
+  emit('confirm', selectedRow.value);
+  handleClose();
+};
+
+const handleClose = () => {
+  emit('update:visible', false);
+  emit('close');
+};
+
+watch(() => props.visible, (newVal) => {
+  dialogVisible.value = newVal;
+  if (newVal) {
+    // 鍏抽敭閫昏緫锛氬鏋� props 浼犱簡榛樿鐘舵�佸氨鐢ㄥ畠锛屽惁鍒欒缃负绌哄瓧绗︿覆
+    // 浣跨敤 queryParams.status = props.defaultStatus || ''; 
+    // 浣嗚�冭檻鍒� '0' 鍙兘鏄湁鏁堝�硷紝寤鸿鍒ゆ柇鏄惁涓� undefined 鎴� null
+    if (props.defaultStatus !== undefined && props.defaultStatus !== null) {
+        queryParams.status = props.defaultStatus;
+    } else {
+        queryParams.status = '';
+    }
+
+    // 閲嶇疆椤电爜涓虹涓�椤靛苟鍔犺浇鏁版嵁
+    queryParams.pageNum = 1;
+    getList();
+  }
+});
+</script>
\ No newline at end of file
diff --git a/ui/admin-ui3/src/components/ClaimBillDialog/index.vue b/ui/admin-ui3/src/components/ClaimBillDialog/index.vue
new file mode 100644
index 0000000..aa0f5fe
--- /dev/null
+++ b/ui/admin-ui3/src/components/ClaimBillDialog/index.vue
@@ -0,0 +1,543 @@
+<template>
+  <el-dialog v-model="visible" title="璐﹀崟璁ら" width="1150px" destroy-on-close :close-on-click-modal="false">
+    <div style="text-align: right;margin-bottom: 10px;">
+      <el-button type="warning" v-if="isViewMode" plain icon="Download" @click="handleExport"
+        v-hasPermi="['cwgl:fundFlowClaimDetail:export']">瀵煎嚭
+      </el-button>
+      <!-- <el-button type="primary" @click="handleFinalSubmit">纭� 瀹�</el-button> -->
+    </div>
+    <div class="claim-wrapper">
+      <!-- <div class="section-header">娴佹按璇︾粏淇℃伅</div> -->
+      <el-descriptions :column="3" border class="mb-20">
+        <el-descriptions-item label="id">{{ detail.id }}</el-descriptions-item>
+        <el-descriptions-item label="閾惰娴佹按鍙�">{{ detail.bankFlowNo }}</el-descriptions-item>
+        <el-descriptions-item label="鍗曚綅">{{ detail.company }}</el-descriptions-item>
+
+        <el-descriptions-item label="鏈柟璐﹀彿">{{ detail.ourAccount }}</el-descriptions-item>
+        <el-descriptions-item label="鏈柟璐︽埛寮�鎴疯">{{ detail.ourBankName }}</el-descriptions-item>
+        <el-descriptions-item label="鏀舵敮鏍囪瘑">
+          {{ dictFormat(sys_income_expenses, detail.incomeExpenseFlag) }}
+        </el-descriptions-item>
+
+        <el-descriptions-item label="浜ゆ槗閲戦">
+          <span class="amount-text">{{ detail.transactionAmount }}</span>
+        </el-descriptions-item>
+        <el-descriptions-item label="浜ゆ槗甯佺">{{ detail.currency }}</el-descriptions-item>
+        <el-descriptions-item label="瀵规柟璐﹀彿">{{ detail.counterpartyAccount }}</el-descriptions-item>
+
+        <el-descriptions-item label="瀵规柟鎴峰悕">{{ detail.counterpartyName }}</el-descriptions-item>
+        <el-descriptions-item label="浜ゆ槗鏃ユ湡">{{ detail.transactionDate }}</el-descriptions-item>
+        <el-descriptions-item label="鐢ㄩ��">{{ detail.purpose }}</el-descriptions-item>
+
+        <el-descriptions-item label="鎽樿" :span="1">{{ detail.summary }}</el-descriptions-item>
+        <el-descriptions-item label="闄勮█" :span="1">{{ detail.remarks }}</el-descriptions-item>
+        <el-descriptions-item label="宸茶棰嗛噾棰�">{{ detail.claimedAmount || 0 }}</el-descriptions-item>
+
+        <el-descriptions-item label="寰呰棰嗛噾棰�">
+          <span class="text-danger font-bold">{{ remainingAmountDr }}</span>
+        </el-descriptions-item v-if="isViewMode">
+          <el-descriptions-item label="鍏宠仈璐﹀崟绫诲瀷">
+          <span  v-if="detail.incomeExpenseFlag == 0">
+            渚涘簲鍟�
+          </span>
+          <span  v-if="detail.incomeExpenseFlag == 1">
+            瀹㈡埛
+          </span>
+        </el-descriptions-item>
+        <el-descriptions-item label="" :span="1"></el-descriptions-item>
+      </el-descriptions>
+
+      <div class="section-header">{{ isViewMode ? '璐﹀崟璁ら鏄庣粏' : '璐﹀崟璁ら' }}</div>
+
+      <div v-if="!isViewMode" class="type-selection-bar mb-20">
+        <span class="required-label">鍏宠仈璐﹀崟绫诲瀷</span>
+        <el-radio-group v-model="detail.incomeExpenseFlag" disabled @change="handleTypeChange">
+          <el-radio :label="0">搴旀敹璐﹀崟</el-radio>
+          <el-radio :label="1">搴斾粯璐﹀崟</el-radio>
+        </el-radio-group>
+      </div>
+
+      <div v-if="!isViewMode" class="mb-10">
+        <el-button type="primary" icon="Plus" @click="handleAddRow">鏂板</el-button>
+      </div>
+
+      <el-table :data="detail.claimDetails" border stripe>
+        <el-table-column label="璐﹀崟缂栧彿" min-width="220">
+          <template #default="{ row, $index }">
+            <el-input v-model="row.billNo" @click="openReceivableDialog($index)" :disabled="!row.$edit" readonly
+              placeholder="鐐瑰嚮閫夋嫨璐﹀崟">
+              <template v-if="row.$edit" #append>
+                <el-button icon="Search" @click="openReceivableDialog($index)" :disabled="!row.$edit" />
+              </template>
+            </el-input>
+          </template>
+        </el-table-column>
+
+        <el-table-column label="鍏宠仈浼佷笟绫诲瀷" width="120">
+          <template #default="{ row }">
+            <span>{{ row.relatedCompanyType }}</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column label="鍏宠仈浼佷笟鍚嶇О" width="150">
+          <template #default="{ row }">
+            <span>{{ row.relatedCompanyName }}</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column label="璐﹀崟閲戦" width="120">
+          <template #default="{ row }">
+            <span>{{ row.billAmount || 0 }}</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column label="璐﹀崟寰呯粨绠楅噾棰�" width="130">
+          <template #default="{ row }">
+            <span>{{ row.billPendingAmount || 0 }}</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column label="璁ら閲戦" width="150">
+          <template #default="{ row }">
+            <el-input-number v-model="row.claimAmount" :precision="2" :controls="false" :disabled="!row.$edit" :min="0"
+              style="width: 100%" placeholder="杈撳叆閲戦" @change="(val) => handleAmountChange(val, row)" />
+          </template>
+        </el-table-column>
+
+        <el-table-column label="璁ら鏃ユ湡" width="200"> <template #default="{ row }">
+            <el-date-picker v-model="row.claimDate" type="datetime" value-format="YYYY-MM-DD HH:mm:ss"
+              :disabled="!row.$edit" style="width: 100%" placeholder="閫夋嫨鏃ユ湡鏃堕棿" />
+          </template>
+        </el-table-column>
+
+        <el-table-column label="澶囨敞">
+          <template #default="{ row }">
+            <el-input v-model="row.remark" :disabled="!row.$edit" placeholder="澶囨敞淇℃伅" />
+          </template>
+        </el-table-column>
+
+        <el-table-column label="鎿嶄綔" v-if="!isViewMode" width="120" fixed="right" align="center">
+          <template #default="{ row, $index }">
+            <template v-if="row.$edit">
+              <el-button type="primary" link @click="handleSaveRow(row)">纭畾</el-button>
+            </template>
+            <template v-else>
+              <!-- <el-button type="primary" link @click="row.$edit = true">淇敼</el-button> -->
+              <el-button type="danger" link @click="handleDeleteRow(row)">鍒犻櫎</el-button>
+            </template>
+          </template>
+        </el-table-column>
+      </el-table>
+
+      <pagination v-show="total > 10" :total="total" v-model:page="queryParams.pageNum"
+        v-model:limit="queryParams.pageSize" @pagination="getList" />
+
+    </div>
+
+    <template #footer>
+      <div style="text-align: center;">
+        <el-button @click="handleCancel">鍏� 闂�</el-button>
+        <!-- <el-button type="primary" @click="handleFinalSubmit">纭� 瀹�</el-button> -->
+      </div>
+    </template>
+  </el-dialog>
+
+  <receivableBillManagementDialog :default-status="-1" v-model:visible="receivablIshow"
+    :default-selected-id="detail.invoiceManageId" @confirm="receivablForm" />
+
+  <AccountsPayableManagementDialog :default-status="-1" v-model:visible="accountsIshow"
+    :default-selected-id="detail.invoiceManageId" @confirm="accountsForm" />
+</template>
+
+<script setup lang="ts">
+import { ref, computed } from 'vue';
+import { ElMessage, ElMessageBox } from 'element-plus';
+import useCurrentInstance from "@/utils/useCurrentInstance";
+import receivableBillManagementDialog from "../receivableBillManagementDialog/index.vue";
+import AccountsPayableManagementDialog from "../AccountsPayableManagementDialog/index.vue";
+import { addFundFlowClaimDetailClaim } from "@/api/cwgl/fundFlow";
+import { delFundFlowClaimDetail, } from "@/api/cwgl/fundFlowClaimDetail";
+import { listFundFlowClaimDetail } from "@/api/cwgl/fundFlowClaimDetail";
+
+const { proxy } = useCurrentInstance();
+const { sys_income_expenses } = proxy.useDict('sys_income_expenses');
+
+const dictFormat = (dict: any, value: any) => proxy.selectDictLabel(dict, value);
+const emit = defineEmits(['submit']);
+const visible = ref(false);
+const detail = ref<any>({
+  claimDetails: []
+});
+const billType = ref('');
+
+// 1. 銆愬緟璁ら閲戦璁$畻銆�: 浜ゆ槗閲戦 - 宸茶棰嗛噾棰� )
+const remainingAmountDr = computed(() => {
+  const total = parseFloat(detail.value.transactionAmount) || 0;
+  const alreadyClaimed = parseFloat(detail.value.claimedAmount) || 0;
+  const res = total - alreadyClaimed;
+  return res.toFixed(2);
+});
+
+// 1. 瀹炴椂璁$畻寰呰棰嗘睜瀛愶紙鍓╀綑鎬婚锛�
+const remainingAmount = computed(() => {
+  const total = parseFloat(detail.value.transactionAmount) || 0; // 娴佹按鎬婚
+  const historicClaimed = parseFloat(detail.value.claimedAmount) || 0; // 鍘嗗彶宸茶棰�
+
+  // 绱姞褰撳墠琛ㄦ牸涓墍鏈夎濉啓鐨勯噾棰�
+  const currentTableTotal = (detail.value.claimDetails || []).reduce((sum, item) => {
+    return sum + (parseFloat(item.claimAmount) || 0);
+  }, 0);
+
+  const res = total - historicClaimed - currentTableTotal;
+  return res.toFixed(2);
+});
+
+// 淇鍚庣殑鍑芥暟
+const handleAmountChange = (val: number | null, row: any) => {
+  if (val === null) return;
+
+  // 1. 鑾峰彇姹犲瓙鍓╀綑锛堥渶瑕佸姞鍥炲綋鍓嶈閲戦锛�
+  const currentRemaining = parseFloat(remainingAmount.value) || 0;
+  const currentLineAmount = val || 0;
+  // 璁$畻姝ゆ椂濡傛灉娌″~杩欎竴琛岋紝姹犲瓙鏈夊灏戦挶
+  // 娉ㄦ剰锛氳繖閲屽洜涓� val 宸茬粡鏀瑰彉浜嗭紝remainingAmount 宸茬粡鍑忓幓浜嗘柊鐨� val
+  // 鎵�浠ユ睜瀛愬彲鐢ㄦ�婚噺 = remainingAmount + val
+  const totalAvailablePool = currentRemaining + currentLineAmount;
+
+  // 2. 纭畾涓や釜涓婇檺
+  const limitByBill = row.billAmount || 0; // 璐﹀崟涓婇檺
+  const limitByPool = totalAvailablePool;         // 娴佹按涓婇檺
+
+  // 3. 鏍¢獙骞朵慨姝�
+  if (val > limitByBill) {
+    ElMessage.warning(`璁ら閲戦涓嶈兘瓒呰繃璐﹀崟閲戦 (${limitByBill})`);
+    row.claimAmount = limitByBill;
+  } else if (val > limitByPool) {
+    ElMessage.warning(`璁ら閲戦涓嶈兘瓒呰繃娴佹按寰呰棰嗛噾棰� (${limitByPool.toFixed(2)})`);
+    // row.claimAmount = parseFloat(limitByPool.toFixed(2));
+  }
+};
+
+// 寤鸿淇濈暀 getMaxClaimAmount 浣滀负涓�涓繚闄╀笂闄愶紝鎴栬�呯洿鎺ュ垹闄ゅ畠
+const getMaxClaimAmount = (row: any) => {
+  // 涓轰簡涓嶅共鎵拌緭鍏ヨ繃绋嬶紝杩欓噷杩斿洖涓�涓瀬澶х殑瀹夊叏鍊硷紝鎴栬�呮祦姘存�婚噾棰�
+  return parseFloat(detail.value.transactionAmount) || 99999999;
+};
+// 閲嶇疆琛ㄥ崟鍜屾暟鎹�
+const resetForm = () => {
+  // 1. 娓呯┖鏄庣粏琛ㄦ牸
+  detail.value = {
+    claimDetails: [],
+    // 濡傛灉鏈夊叾浠栭渶瑕佹竻绌虹殑娴佹按鍩虹淇℃伅锛屼篃鍙互鍦ㄨ繖閲屽垵濮嬪寲
+    transactionAmount: 0,
+    claimedAmount: 0
+  };
+
+  // 2. 娓呯┖閫夋嫨鐨勮处鍗曠被鍨�
+  billType.value = '';
+
+  // 3. 閲嶇疆绱㈠紩鍜屽脊绐楁帶鍒跺彉閲�
+  currentRowIndex.value = null;
+  receivablIshow.value = false;
+  accountsIshow.value = false;
+};
+// 鍙栨秷鎸夐挳鐐瑰嚮浜嬩欢
+const handleCancel = () => {
+  visible.value = false;
+  resetForm();
+};
+const isViewMode = ref(false); // 鏂板锛氭ā寮忔帶鍒�
+
+// --- 鏂板锛氬垎椤典笌鎼滅储鐩稿叧鐨勫搷搴斿紡鍙橀噺 ---
+const total = ref(0);
+const loading = ref(false);
+const queryParams = ref({
+  pageNum: 1,
+  pageSize: 10,
+  fundFlowId: null as any // 鍏宠仈鐨勬祦姘碔D
+});
+
+// --- 鏂板锛氳幏鍙栧垪琛ㄦ暟鎹殑鏂规硶 ---
+const getList = async () => {
+  if (!detail.value.id) return;
+  
+  loading.value = true;
+  try {
+    const res = await listFundFlowClaimDetail({
+      ...queryParams.value,
+      fundFlowId: detail.value.id
+    });
+    if (res.code === 200) {
+      detail.value.claimDetails = res.rows;
+     detail.value.claimDetails.forEach((item: any) => {
+      if (item.$edit === undefined) {
+        item.$edit = false;
+      }
+    });
+      total.value = res.total;
+    }
+  } catch (error) {
+    console.error("鑾峰彇鏄庣粏鍒楄〃澶辫触", error);
+  } finally {
+    loading.value = false;
+  }
+};
+const handleExport =()=>{
+  proxy.download("/cwgl/fundFlowClaimDetail/export",{...queryParams.value})
+}
+
+// 鎵撳紑寮圭獥
+const open = (rowData: any, mode: 'view' | 'edit' = 'edit') => {
+  // 1. 鍏堥噸缃竴娆★紝闃叉涓婃娈嬬暀
+  resetForm();
+  isViewMode.value = mode === 'view'; // 璁剧疆妯″紡
+  // 2. 娴呮嫹璐濆熀纭�鏁版嵁
+  detail.value = {
+    ...rowData,
+  };
+
+  // 3. 澶勭悊 billType 鐨勮嚜鍔ㄥ洖鏄鹃�昏緫
+  if (detail.value.claimDetails && detail.value.claimDetails.length > 0) {
+    // 鍙栧嚭绗竴鏉℃槑缁嗙殑鍏宠仈浼佷笟绫诲瀷
+    const firstCompanyType = detail.value.claimDetails[0].relatedCompanyType;
+
+    if (firstCompanyType === '瀹㈡埛') {
+      billType.value = 'RECEIVABLE';
+    } else if (firstCompanyType === '渚涘簲鍟�') {
+      billType.value = 'PAYABLE';
+    }
+    // 濡傛灉鏈塈D锛屽垯璇锋眰鍚庣鏄庣粏鏁版嵁
+  
+    // 纭繚宸叉湁鐨勬暟鎹涓嶄細鍙樻垚缂栬緫妯″紡
+    getList()
+  }
+
+  visible.value = true;
+};
+// 鍏宠仈璐﹀崟绫诲瀷鍒囨崲閫昏緫
+const handleTypeChange = (val: string) => {
+  if (detail.value.claimDetails && detail.value.claimDetails.length > 0) {
+    ElMessageBox.confirm('鍒囨崲璐﹀崟绫诲瀷灏嗘竻绌哄綋鍓嶅凡娣诲姞鐨勮棰嗘槑缁嗭紝鏄惁缁х画锛�', '鎻愮ず', {
+      confirmButtonText: '纭畾',
+      cancelButtonText: '鍙栨秷',
+      type: 'warning'
+    }).then(() => {
+      detail.value.claimDetails = [];
+      ElMessage.success('宸叉竻绌烘槑缁�');
+    }).catch(() => {
+      billType.value = val === 'RECEIVABLE' ? 'PAYABLE' : 'RECEIVABLE';
+    });
+  }
+};
+
+// 鏂板琛�
+// 淇敼鏂板琛岄�昏緫
+const handleAddRow = () => {
+
+  const defaultCompanyType = detail.value.incomeExpenseFlag == '0' ? '瀹㈡埛' : '渚涘簲鍟�';
+
+  // 鑾峰彇褰撳墠鏃堕棿鐨� YYYY-MM-DD HH:mm:ss 鏍煎紡
+  const now = new Date();
+  const formatTime = (date: Date) => {
+    const pad = (num: number) => String(num).padStart(2, '0');
+    return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())} ` +
+      `${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())}`;
+  };
+
+  detail.value.claimDetails.push({
+    billNo: '',
+    claimAmount: 0,
+    claimDate: formatTime(now), // 浣跨敤甯︽椂鍒嗙鐨勯粯璁ゅ��
+    remark: '',
+    relatedCompanyType: defaultCompanyType,
+    relatedCompanyName: '',
+    billAmount: 0,
+    billPendingAmount: 0,
+    $edit: true
+  });
+};
+
+// 淇濆瓨琛�
+const handleSaveRow = (row: any) => {
+  if (!row.billNo) return ElMessage.warning('璇烽�夋嫨璐﹀崟缂栧彿');
+
+  // 杞崲鏁板�硷紝纭繚璁$畻鍑嗙‘
+  const currentClaim = parseFloat(row.claimAmount) || 0;
+  if (currentClaim <= 0) return ElMessage.warning('璁ら閲戦蹇呴』澶т簬0');
+
+  // 1. 鑾峰彇褰撳墠璁$畻灞炴�т腑鐨勫墿浣欓搴︼紙姝ゆ椂宸茬粡鎵i櫎浜嗘墍鏈夎鐨� claimAmount锛�
+  const currentRemaining = parseFloat(remainingAmount.value) || 0;
+
+  // 2. 銆愬叧閿�戣绠楄琛屽疄闄呭彲鐢ㄧ殑鈥滃墿浣欐睜瀛愪笂闄愨��
+  // 鍏紡锛氭睜瀛愮湡瀹炰綑閲� = 褰撳墠鏄剧ず鐨勪綑棰� + 璇ヨ鍒氭墠鍗犵敤鐨勯搴�
+  const poolLimit = currentRemaining + currentClaim;
+
+  // 3. 鑾峰彇璐﹀崟鏈韩鐨勪笂闄�
+  const billLimit = row.billPendingAmount || row.billAmount || 0;
+
+  // --- 寮�濮嬫嫤鎴垽瀹� ---
+
+  // 鍒ゅ畾 A锛氳秴杩囪处鍗曟瑺娆�
+  if (currentClaim > billLimit) {
+    return ElMessage.error(`淇濆瓨澶辫触锛氳棰嗛噾棰濅笉鑳借秴杩囪处鍗曞緟缁撶畻閲戦 (${billLimit})`);
+  }
+
+  // 鍒ゅ畾 B锛氳秴杩囨祦姘存�讳綑閲�
+  // 浣跨敤 0.01 瀹瑰樊闃叉 JS 娴偣鏁拌绠楄宸�
+  if (currentClaim > (poolLimit + 0.01)) {
+    return ElMessage.error(`淇濆瓨澶辫触锛氳棰嗘�婚瓒呰繃娴佹按寰呰棰嗛噾棰濓紝璇ヨ褰撳墠鏈�澶у彲濉� ${poolLimit.toFixed(2)}`);
+  }
+  addFundFlowClaimDetailClaim(row, detail.value.id).then((response) => {
+    if (response.code == 200) {
+      proxy.$modal.msgSuccess("淇濆瓨鎴愬姛");
+      getList(); // 浣跨敤缁熶竴鐨� getList 鏂规硶
+    }
+  })
+};
+
+const handleDeleteRow = (row: any) => {
+  proxy.$modal.confirm('鏄惁纭鍒犻櫎璐﹀崟缂栧彿涓�"' + row.billNo + '"?').then(function () {
+    return delFundFlowClaimDetail(row.id);
+  }).then((res) => {
+    if (res.code == 200) {
+    proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+      getList(); // 浣跨敤缁熶竴鐨� getList 鏂规硶
+    }
+
+
+  }).catch(() => { });
+};
+
+const receivablIshow = ref(false);
+const currentRowIndex = ref<number | null>(null);
+const accountsIshow = ref(false);
+
+const openReceivableDialog = (index: number) => {
+  currentRowIndex.value = index;
+  if (detail.value.incomeExpenseFlag == '0') {
+    receivablIshow.value = true;
+  } else if (detail.value.incomeExpenseFlag == '1') {
+    accountsIshow.value = true;
+  }
+
+};
+
+// 鍥炲~寮圭獥閫変腑鐨勬暟鎹�
+const receivablForm = (data: any) => {
+  const defaultCompanyType = billType.value === 'RECEIVABLE' ? '瀹㈡埛' : '渚涘簲鍟�';
+
+  if (currentRowIndex.value !== null && data) {
+    const row = detail.value.claimDetails[currentRowIndex.value];
+
+    row.billNo = data.systemNo
+    row.relatedCompanyType = defaultCompanyType;
+    row.relatedCompanyName = data.customerName
+    row.billAmount = data.totalAmount || 0;
+    row.billPendingAmount = data.pendingAmount || 0;
+
+
+    currentRowIndex.value = null;
+    receivablIshow.value = false;
+  }
+};
+
+const accountsForm = (data: any) => {
+  const defaultCompanyType = billType.value === 'RECEIVABLE' ? '瀹㈡埛' : '渚涘簲鍟�';
+
+  if (currentRowIndex.value !== null && data) {
+    const row = detail.value.claimDetails[currentRowIndex.value];
+    row.billNo = data.systemNo
+    row.relatedCompanyType = defaultCompanyType;
+    row.relatedCompanyName = data.supplierName
+    row.billAmount = data.totalAmount || 0;
+    row.billPendingAmount = data.pendingAmount || 0;
+    currentRowIndex.value = null;
+    accountsIshow.value = false;
+  }
+};
+
+// 纭畾鎻愪氦
+const handleFinalSubmit = () => {
+  if (!billType.value) return ElMessage.warning('璇烽�夋嫨鍏宠仈璐﹀崟绫诲瀷');
+  if (detail.value.claimDetails.length === 0) return ElMessage.warning('璇锋坊鍔犺嚦灏戜竴鏉¤棰嗘槑缁�');
+
+  const hasEditing = detail.value.claimDetails.some((row: any) => row.$edit);
+  if (hasEditing) return ElMessage.warning('璇峰厛淇濆瓨姝e湪缂栬緫鐨勬槑缁嗚');
+
+  if (parseFloat(remainingAmount.value) < 0) {
+    return ElMessage.error('鏈�缁堣棰嗘�婚涓嶈兘瓒呰繃娴佹按寰呰棰嗛噾棰�');
+  }
+  emit('submit', detail.value);
+  // console.log("鎻愪氦鏁版嵁锛�", detail.value);
+  // ElMessage.success('鎿嶄綔鎴愬姛');
+  // visible.value = false;
+};
+
+defineExpose({ open, handleCancel });
+</script>
+
+<style scoped>
+.claim-wrapper {
+  padding: 0 10px;
+}
+
+.section-header {
+  font-size: 16px;
+  font-weight: bold;
+  margin: 15px 0 10px;
+  border-left: 4px solid #409eff;
+  padding-left: 10px;
+  color: #303133;
+}
+
+.type-selection-bar {
+  display: flex;
+  align-items: center;
+  gap: 20px;
+  background: #f8f9fb;
+  padding: 10px 15px;
+  border-radius: 4px;
+}
+
+.required-label {
+  font-size: 14px;
+  font-weight: bold;
+  color: #606266;
+}
+
+.required-label::before {
+  content: '*';
+  color: #f56c6c;
+  margin-right: 4px;
+}
+
+.amount-text {
+  color: #409eff;
+  font-weight: bold;
+}
+
+.text-danger {
+  color: #f56c6c;
+}
+
+.font-bold {
+  font-weight: bold;
+}
+
+.mb-20 {
+  margin-bottom: 20px;
+}
+
+.mb-10 {
+  margin-bottom: 10px;
+}
+
+:deep(.el-input.is-disabled .el-input__wrapper) {
+  background-color: transparent;
+  box-shadow: none;
+}
+
+:deep(.el-descriptions__body .el-descriptions__table.is-bordered .el-descriptions__cell) {
+  width: 16%;
+}
+</style>
\ No newline at end of file
diff --git a/ui/admin-ui3/src/components/receivableBillManagementDialog/index.vue b/ui/admin-ui3/src/components/receivableBillManagementDialog/index.vue
index 2c81f15..935799e 100644
--- a/ui/admin-ui3/src/components/receivableBillManagementDialog/index.vue
+++ b/ui/admin-ui3/src/components/receivableBillManagementDialog/index.vue
@@ -15,11 +15,11 @@
           <el-input v-model="queryParams.customerName" placeholder="璇疯緭鍏ュ鎴峰悕绉�" style="width: 180px" clearable />
         </el-form-item>
 
-        <el-form-item label="鐘舵��:">
+        <!-- <el-form-item label="鐘舵��:">
           <el-select v-model="queryParams.status" style="width: 150px;" placeholder="璇烽�夋嫨鐘舵��" clearable>
             <el-option v-for="dict in sys_bill_status" :key="dict.value" :label="dict.label" :value="dict.value" />
           </el-select>
-        </el-form-item>
+        </el-form-item> -->
 
         <el-form-item>
           <el-button type="primary" icon="Search" @click="handleSearch">鎼滅储</el-button>
@@ -79,7 +79,9 @@
 
 const props = defineProps({
   visible: { type: Boolean, default: false },
-  defaultSelectedId: { type: [String, Number], default: '' }
+  defaultSelectedId: { type: [String, Number], default: '' },
+  // 鏂板锛氭帴鏀堕粯璁ょ姸鎬�
+  defaultStatus: { type: [String, Number], default: '' } 
 });
 
 const emit = defineEmits(['confirm', 'close', 'update:visible']);
@@ -138,11 +140,18 @@
 };
 
 const handleReset = () => {
-  // 閲嶇疆瀛楁蹇呴』涓� queryParams 瀹氫箟鐨勪竴鑷�
+  // 閲嶇疆鍏朵粬鎼滅储瀛楁
   queryParams.systemNo = '';
   queryParams.billName = '';
   queryParams.customerName = '';
-  queryParams.status = '';
+  
+  // 鏍稿績澶勭悊锛氬鏋滄湁榛樿鐘舵�佸�煎氨鎭㈠榛樿鍊硷紝娌℃湁鎵嶈涓虹┖
+  if (props.defaultStatus !== undefined && props.defaultStatus !== null && props.defaultStatus !== '') {
+    queryParams.status = props.defaultStatus;
+  } else {
+    queryParams.status = '';
+  }
+
   handleSearch();
 };
 
@@ -173,6 +182,17 @@
 watch(() => props.visible, (newVal) => {
   dialogVisible.value = newVal;
   if (newVal) {
+    // 鍏抽敭閫昏緫锛氬鏋� props 浼犱簡榛樿鐘舵�佸氨鐢ㄥ畠锛屽惁鍒欒缃负绌哄瓧绗︿覆
+    // 浣跨敤 queryParams.status = props.defaultStatus || ''; 
+    // 浣嗚�冭檻鍒� '0' 鍙兘鏄湁鏁堝�硷紝寤鸿鍒ゆ柇鏄惁涓� undefined 鎴� null
+    if (props.defaultStatus !== undefined && props.defaultStatus !== null) {
+        queryParams.status = props.defaultStatus;
+    } else {
+        queryParams.status = '';
+    }
+
+    // 閲嶇疆椤电爜涓虹涓�椤靛苟鍔犺浇鏁版嵁
+    queryParams.pageNum = 1;
     getList();
   }
 });
diff --git a/ui/admin-ui3/src/views/cwgl/fundFlow/index.vue b/ui/admin-ui3/src/views/cwgl/fundFlow/index.vue
index 180a0df..d4a2394 100644
--- a/ui/admin-ui3/src/views/cwgl/fundFlow/index.vue
+++ b/ui/admin-ui3/src/views/cwgl/fundFlow/index.vue
@@ -1,175 +1,305 @@
 <template>
-  <basicContainer >
-    <avue-crud
-        :option="option"
-        :table-loading="pageF.loading"
-        :data="tableData"
-        :page="page"
-        :permission="permissionList"
-        :before-open="beforeOpen"
-        v-model="form"
-        ref="crudRef"
-        @row-update="rowUpdate"
-        @row-save="rowSave"
-        @refresh-change="refreshChange"
-        @row-del="rowDel"
-        @search-change="searchChange"
-        @search-reset="searchReset"
-        @selection-change="selectionChange"
-        @current-change="currentChange"
-        @size-change="sizeChange"
-        @on-load="onLoad"
-    >
+  <basicContainer>
+    <avue-crud :option="option" :table-loading="pageF.loading" :data="tableData" :page="page"
+      :permission="permissionList" :before-open="beforeOpen" v-model="form" ref="crudRef" @row-update="rowUpdate"
+      @row-save="rowSave" @refresh-change="refreshChange" @row-del="rowDel" @search-change="searchChange"
+      @search-reset="searchReset" @selection-change="selectionChange" @current-change="currentChange"
+      @size-change="sizeChange" @on-load="onLoad">
       <template #menu-left>
-        <el-button
-            type="success"
-            icon="Edit"
-            :disabled="pageF.single"
-            v-hasPermi="['cwgl:fundFlow:edit']"
-            @click="handleUpdate">淇敼
+        <!-- <el-button type="success" icon="Edit" :disabled="pageF.single" v-hasPermi="['cwgl:fundFlow:edit']"
+          @click="handleUpdate">淇敼
         </el-button>
-        <el-button
-            type="danger"
-            icon="Delete"
-            :disabled="pageF.multiple"
-            @click="handleDelete"
-            v-hasPermi="['cwgl:fundFlow:remove']"
-        >鍒犻櫎
+        <el-button type="danger" icon="Delete" :disabled="pageF.multiple" @click="handleDelete"
+          v-hasPermi="['cwgl:fundFlow:remove']">鍒犻櫎
+        </el-button> -->
+        <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['cwgl:fundFlow:export']">瀵煎嚭
         </el-button>
-        <el-button
-            type="warning"
-            plain
-            icon="Download"
-            @click="handleExport"
-            v-hasPermi="['cwgl:fundFlow:export']"
-        >瀵煎嚭
-        </el-button>
+      </template>
+      <template #menu="{ size, row, index }">
+        <el-link v-if="row.status == '0'" class="link-btn" type="primary" icon="Edit" :underline="false" :size="size"
+          @click="crudRef.rowEdit(row, index)"> 淇敼
+        </el-link>
+
+        <el-link v-if="row.status == '0'" class="link-btn" type="primary" icon="Position" :underline="false"
+          :size="size" @click="makeInvoice(row)" v-hasPermi="['cwgl:fundFlow:confirm']"> 纭
+        </el-link>
+        <el-link v-if="row.status == '0'" class="link-btn" type="primary" icon="Delete" :underline="false" :size="size"
+          @click="crudRef.rowDel(row, index)"> 鍒犻櫎
+        </el-link>
+        <el-link v-if="['1', '2'].includes(String(row.status))" class="link-btn" type="primary" icon="Position"
+          :underline="false" :size="size" @click="handleClaim(row)" v-hasPermi="['cwgl:fundFlow:claim']">
+          璐﹀崟璁ら
+        </el-link>
+          <el-link v-if="['1', '2','3'].includes(String(row.status))" class="link-btn" type="primary" icon="Position"
+          :underline="false" :size="size" @click="handleDetails(row)" v-hasPermi="['cwgl:fundFlow:edit']">
+          璁ら鏄庣粏
+        </el-link>
+          <el-button type="text" icon="View" @click="handleFlow(row)"
+          v-hasPermi="['cwgl:fundFlow:flow']">鏃ュ織</el-button>
+        <!-- <el-button type="text" icon="View" @click="handleFlow(row)"
+          v-hasPermi="['cwgl:invoiceManage:flow']">鏃ュ織</el-button> -->
+
       </template>
     </avue-crud>
   </basicContainer>
+  <OperationLogModal ref="logModalRef" />
+
+  <ClaimBillDialog ref="claimDialogRef" @submit="handleClaimSubmit" />
 </template>
 
 <script setup name="fundFlow" lang="ts">
-  import {FundFlowI,addFundFlow, delFundFlow, exportFundFlow, getFundFlow, listFundFlow, updateFundFlow} from "@/api/cwgl/fundFlow";
-  import useCurrentInstance from "@/utils/useCurrentInstance";
-  import {computed,reactive, ref, toRefs} from "vue";
-  import {PagesInterface, PageQueryInterface} from "@/utils/globalInterface";
-  import {usePagePlus} from "@/hooks/usePagePlus";
-  import {hasPermission} from "@/utils/permissionUtils";
+import { FundFlowI, addFundFlow, delFundFlow, addFundFlowClaimDetailClaim, exportFundFlow, confirmFundFlow, getFundFlow, listFundFlow, updateFundFlow } from "@/api/cwgl/fundFlow";
+import useCurrentInstance from "@/utils/useCurrentInstance";
+  import { listFundFlowLog} from "@/api/cwgl/fundFlowLog";
 
-  const { proxy } = useCurrentInstance();
-  const crudRef = ref();
+import { computed, reactive, ref, toRefs } from "vue";
+import { PagesInterface, PageQueryInterface } from "@/utils/globalInterface";
+import { usePagePlus } from "@/hooks/usePagePlus";
+import { hasPermission } from "@/utils/permissionUtils";
+import { listFundFlowClaimDetail } from "@/api/cwgl/fundFlowClaimDetail";
+import OperationLogModal from '@/components/OperationLogModal/index.vue';
 
-  const permissionList = computed(()=>{
-    return {
-      addBtn: hasPermission(["cwgl:fundFlow:add"]),
-      delBtn: hasPermission(["cwgl:fundFlow:remove"]),
-      editBtn: hasPermission(["cwgl:fundFlow:edit"]),
-      viewBtn: hasPermission(["cwgl:fundFlow:query"]),
-    }
-  })
+import ClaimBillDialog from "../../../components/ClaimBillDialog/index.vue";
 
-  const data = reactive({
-    form:<FundFlowI>{},
-    queryParams:<FundFlowI&PageQueryInterface>{},
-    page: <PagesInterface>{
-      pageSize: 10,
-      total: 0,
-      currentPage: 1,
+const { proxy } = useCurrentInstance();
+const crudRef = ref();
+
+const permissionList = computed(() => {
+  return {
+    addBtn: hasPermission(["cwgl:fundFlow:add"]),
+    delBtn: hasPermission(["cwgl:fundFlow:remove"]),
+    editBtn: hasPermission(["cwgl:fundFlow:edit"]),
+    viewBtn: hasPermission(["cwgl:fundFlow:query"]),
+  }
+})
+
+const data = reactive({
+  form: <FundFlowI>{},
+  queryParams: <FundFlowI & PageQueryInterface>{},
+  page: <PagesInterface>{
+    pageSize: 10,
+    total: 0,
+    currentPage: 1,
+  },
+  selectionList: [],
+})
+const { queryParams, form, page, selectionList } = toRefs(data);
+const option = ref({
+  pageKey: 'FundFlow',
+  rowKey: 'id',
+  searchSpan: 5,
+  labelWidth: 180,
+  searchLabelWidth: 150,
+  delBtn: false,
+  editBtn: false,
+  column: {
+    // id: {
+    //   label: 'ID',
+    // },
+    bankFlowNo: {
+      label: '閾惰娴佹按鍙�',
+      minWidth: 120,
+      search: true,
+      rules: [
+        {
+          required: true,
+          message: "閾惰娴佹按鍙蜂笉鑳戒负绌�", trigger: "blur"
+        }
+      ],
     },
-    selectionList:[],
-  })
-  const {queryParams,form,page,selectionList} = toRefs(data);
-  const option = ref({
-    pageKey: 'FundFlow',
-    rowKey: 'id',
-    column: {
-                                id: {
-          label: 'ID',
-                            },
-                                bankFlowNo: {
-          label: '閾惰娴佹按鍙�',
-                                rules: [
-              {
-                required: true,
-                message: "閾惰娴佹按鍙蜂笉鑳戒负绌�", trigger: "blur" }
-            ],                  },
-                                company: {
-          label: '鍗曚綅',
-                            },
-                                ourAccount: {
-          label: '鏈柟璐﹀彿',
-                            },
-                                ourBankName: {
-          label: '鏈柟璐︽埛寮�鎴疯',
-                            },
-                                incomeExpenseFlag: {
-          label: '鏀舵敮鏍囪瘑鍊熻捶鏍囧織 0-鏀� 1-鏀�',
-                            },
-                                transactionAmount: {
-          label: '浜ゆ槗閲戦',
-                            },
-                                currency: {
-          label: '浜ゆ槗甯佺',
-                            },
-                                counterpartyAccount: {
-          label: '瀵规柟璐﹀彿',
-                            },
-                                counterpartyName: {
-          label: '瀵规柟鎴峰悕',
-                            },
-                                transactionDate: {
-          label: '浜ゆ槗鏃ユ湡',
-                            },
-                                purpose: {
-          label: '鐢ㄩ��',
-                            },
-                                summary: {
-          label: '鎽樿',
-                      type: 'textarea', minRows: 3, maxRows: 5,
-                            },
-                                remarks: {
-          label: '闄勮█',
-                      type: 'textarea', minRows: 3, maxRows: 5,
-                            },
-                                createBy: {
-          label: '鍒涘缓鑰�',
-                            },
-                                createTime: {
-          label: '鍒涘缓鏃堕棿',
-                            },
-                                updateBy: {
-          label: '鏇存柊鑰�',
-                            },
-                                updateTime: {
-          label: '鏇存柊鏃堕棿',
-                            },
-                                delFlag: {
-          label: '鍒犻櫎鏍囧織',
-                            },
-          }
-  })
+    company: {
+      label: '鍗曚綅',
+      minWidth: 120,
+    },
+    ourAccount: {
+      label: '鏈柟璐﹀彿',
+      search: true,
+      minWidth: 120,
+    },
+    ourBankName: {
+      label: '鏈柟璐︽埛寮�鎴疯',
+      minWidth: 120,
+    },
+    incomeExpenseFlag: {
+      label: '鏀舵敮鏍囪瘑',
+      type: 'radio', // 璁剧疆涓哄崟閫夋寜閽�
+      search: true,  // 濡傛灉闇�瑕佸湪鎼滅储鏍忎篃鏄剧ず
+      dicUrl: '/system/dict/data/type/sys_income_expenses',
+      rules: [
+        {
+          required: true,
+          message: "璇烽�夋嫨鏀舵敮鏍囪瘑",
+          trigger: "blur"
+        }
+      ],
+    },
+    transactionAmount: {
+      label: '浜ゆ槗閲戦',
+    },
+    currency: {
+      label: '浜ゆ槗甯佺',
+      search: true,
+      minWidth: 120,
+      dataType: 'string',
+      type: 'select',
+      // addDisplay: false,  // 鏂板鏃朵笉鏄剧ず
+      // editDisplay: false, // 淇敼鏃朵笉鏄剧ず
+      viewDisplay: false,
+      dicUrl: '/system/dict/data/type/sys_currency',
+    },
+    counterpartyAccount: {
+      minWidth: 150,
+      label: '瀵规柟璐﹀彿',
+      search: true,
+    },
+    counterpartyName: {
+      minWidth: 150,
+      label: '瀵规柟鎴峰悕',
+      search: true,
+    },
+    transactionDate: {
+      minWidth: 200,
+      // search: true, 
+      label: '浜ゆ槗鏃ユ湡',
+      type: 'datetime',          // 绫诲瀷鏀逛负 datetime
+      format: 'YYYY-MM-DD HH:mm:ss',      // 鐣岄潰鏄剧ず鐨勬牸寮�
+      valueFormat: 'YYYY-MM-DD HH:mm:ss', // 鎻愪氦缁欏悗鍙扮殑鏁版嵁鏍煎紡
+      // search: true,               // 濡傛灉寮�鍚悳绱�
+      rules: [
+        {
+          required: true,
+          message: "璇烽�夋嫨浜ゆ槗鏃ユ湡",
+          trigger: "change"
+        }
+      ],
 
-  const { tableData,pageF,rowSave,rowUpdate,rowDel,beforeOpen,searchChange,
-    searchReset,selectionChange,onLoad,currentChange,sizeChange,handleDelete,handleExport,handleUpdate,refreshChange} = usePagePlus({
-    form:form,
-    option:option,
-    queryParams:queryParams,
-    idKey:'id',
-    page:page.value,
-    getListApi:listFundFlow,
-    getDetailApi:getFundFlow,
-    exportApi:exportFundFlow,
-    deleteApi:delFundFlow,
-    addApi:addFundFlow,
-    updateApi:updateFundFlow,
-    handleUpdateFunc:()=>{
+    },
+    purpose: {
+      label: '鐢ㄩ��',
+      minWidth: 150,
+    },
+    summary: {
+      label: '鎽樿',
+      type: 'textarea', minRows: 3, maxRows: 5,
+      hide: true,
+    },
+    remarks: {
+      label: '闄勮█',
+      hide: true,
+      type: 'textarea', minRows: 3, maxRows: 5,
+    },
+    status: {
+      minWidth: 120,
+      label: '鐘舵��',
+      fixed: 'right',
+      value: '0',
+      addDisplay: false,  // 琛ㄥ崟涓嶆樉绀�
+      editDisplay: false,
+      viewDisplay: true,
+      dicUrl: '/system/dict/data/type/sys_capital_status',
+    },
+    // createBy: {
+    //   label: '鍒涘缓鑰�',
+    // },
+    // createTime: {
+    //   label: '鍒涘缓鏃堕棿',
+    // },
+    // updateBy: {
+    //   label: '鏇存柊鑰�',
+    // },
+    // updateTime: {
+    //   label: '鏇存柊鏃堕棿',
+    // },
+    // delFlag: {
+    //   label: '鍒犻櫎鏍囧織',
+    // },
+  }
+})
+
+const { tableData, pageF, rowSave, rowUpdate, rowDel, beforeOpen, searchChange,
+  searchReset, selectionChange, onLoad, currentChange, sizeChange, handleDelete, handleExport, handleUpdate, refreshChange } = usePagePlus({
+    form: form,
+    option: option,
+    queryParams: queryParams,
+    idKey: 'id',
+    page: page.value,
+    getListApi: listFundFlow,
+    getDetailApi: getFundFlow,
+    exportApi: exportFundFlow,
+    deleteApi: delFundFlow,
+    addApi: addFundFlow,
+    updateApi: updateFundFlow,
+    handleUpdateFunc: () => {
       crudRef.value.rowEdit(selectionList.value[0]);
     },
-    handleSelectionChangeFunc:(selection:any)=>{
+    handleSelectionChangeFunc: (selection: any) => {
       selectionList.value = selection;
     }
   })
 
 
+const makeInvoice = (row: any) => {
+  proxy.$modal.confirm('鏄惁纭閾惰娴佹按鍙蜂负"' + row.bankFlowNo + '"?').then(function () {
+    return confirmFundFlow(row.id);
+  }).then(() => {
+    onLoad(page.value);
+    proxy.$modal.msgSuccess("纭鎴愬姛");
+  }).catch(() => { });
+}
+
+
+const claimDialogRef = ref();
+// fundFlowId
+
+const handleClaim = (row: any) => {
+  getFundFlow(row.id).then((response) => {
+    if (response.code == 200) {
+       listFundFlowClaimDetail({ fundFlowId: row.id }).then((res) => {
+      if (res.code == 200) {
+        response.data.claimDetails = res.rows;
+        claimDialogRef.value.open(response.data);
+        claimDialogRef.value.open(response.data, 'edit');
+      }
+    })
+    }
+  })
+
+};
+
+const handleClaimSubmit = (payload) => {
+  addFundFlowClaimDetailClaim(payload.claimDetails, payload.id).then((response) => {
+    if (response.code == 200) {
+      onLoad(page.value);
+      proxy.$modal.msgSuccess("璁ら鎴愬姛");
+      claimDialogRef.value.handleCancel();
+    }
+  })
+  // console.log("鏈�缁堟彁浜ょ粰鍚庣鐨勬暟鎹寘:", payload);
+};
+
+const handleDetails = (row: any) => {
+  getFundFlow(row.id).then((response) => {
+    if (response.code == 200) {
+       listFundFlowClaimDetail({ fundFlowId: row.id }).then((res) => {
+      if (res.code == 200) {
+        response.data.claimDetails = res.rows;
+       claimDialogRef.value.open(response.data, 'view');
+
+      }
+    })
+    }
+  })
+
+};
+
+const logModalRef = ref(null);
+const handleFlow = (row: any,) => {
+  // 杩欓噷鍙互浠� row 涓洿鎺ヨ幏鍙栨棩蹇楋紝鎴栬�呰皟鐢ㄥ悗绔帴鍙f煡璇�
+  listFundFlowLog({flowId:row.id}).then((res) => {
+    if (res.code == 200) {
+     logModalRef.value.open(res.rows,'payable');
+    }
+  });
+}
+/* listFundFlowClaimDetail */
 </script>
diff --git a/ui/admin-ui3/src/views/cwgl/fundFlowClaimDetail/index.vue b/ui/admin-ui3/src/views/cwgl/fundFlowClaimDetail/index.vue
index a435357..98842de 100644
--- a/ui/admin-ui3/src/views/cwgl/fundFlowClaimDetail/index.vue
+++ b/ui/admin-ui3/src/views/cwgl/fundFlowClaimDetail/index.vue
@@ -1,48 +1,19 @@
 <template>
-  <basicContainer >
-    <avue-crud
-        :option="option"
-        :table-loading="pageF.loading"
-        :data="tableData"
-        :page="page"
-        :permission="permissionList"
-        :before-open="beforeOpen"
-        v-model="form"
-        ref="crudRef"
-        @row-update="rowUpdate"
-        @row-save="rowSave"
-        @refresh-change="refreshChange"
-        @row-del="rowDel"
-        @search-change="searchChange"
-        @search-reset="searchReset"
-        @selection-change="selectionChange"
-        @current-change="currentChange"
-        @size-change="sizeChange"
-        @on-load="onLoad"
-    >
+  <basicContainer>
+    <avue-crud :option="option" :table-loading="pageF.loading" :data="tableData" :page="page"
+      :permission="permissionList" :before-open="beforeOpen" v-model="form" ref="crudRef" @row-update="rowUpdate"
+      @row-save="rowSave" @refresh-change="refreshChange" @row-del="rowDel" @search-change="searchChange"
+      @search-reset="searchReset" @selection-change="selectionChange" @current-change="currentChange"
+      @size-change="sizeChange" @on-load="onLoad">
       <template #menu-left>
-        <el-button
-            type="success"
-            icon="Edit"
-            :disabled="pageF.single"
-            v-hasPermi="['cwgl:fundFlowClaimDetail:edit']"
-            @click="handleUpdate">淇敼
+        <el-button type="success" icon="Edit" :disabled="pageF.single" v-hasPermi="['cwgl:fundFlowClaimDetail:edit']"
+          @click="handleUpdate">淇敼
         </el-button>
-        <el-button
-            type="danger"
-            icon="Delete"
-            :disabled="pageF.multiple"
-            @click="handleDelete"
-            v-hasPermi="['cwgl:fundFlowClaimDetail:remove']"
-        >鍒犻櫎
+        <el-button type="danger" icon="Delete" :disabled="pageF.multiple" @click="handleDelete"
+          v-hasPermi="['cwgl:fundFlowClaimDetail:remove']">鍒犻櫎
         </el-button>
-        <el-button
-            type="warning"
-            plain
-            icon="Download"
-            @click="handleExport"
-            v-hasPermi="['cwgl:fundFlowClaimDetail:export']"
-        >瀵煎嚭
+        <el-button type="warning" plain icon="Download" @click="handleExport"
+          v-hasPermi="['cwgl:fundFlowClaimDetail:export']">瀵煎嚭
         </el-button>
       </template>
     </avue-crud>
@@ -50,114 +21,118 @@
 </template>
 
 <script setup name="fundFlowClaimDetail" lang="ts">
-  import {FundFlowClaimDetailI,addFundFlowClaimDetail, delFundFlowClaimDetail, exportFundFlowClaimDetail, getFundFlowClaimDetail, listFundFlowClaimDetail, updateFundFlowClaimDetail} from "@/api/cwgl/fundFlowClaimDetail";
-  import useCurrentInstance from "@/utils/useCurrentInstance";
-  import {computed,reactive, ref, toRefs} from "vue";
-  import {PagesInterface, PageQueryInterface} from "@/utils/globalInterface";
-  import {usePagePlus} from "@/hooks/usePagePlus";
-  import {hasPermission} from "@/utils/permissionUtils";
+import { FundFlowClaimDetailI, addFundFlowClaimDetail, delFundFlowClaimDetail, exportFundFlowClaimDetail, getFundFlowClaimDetail, listFundFlowClaimDetail, updateFundFlowClaimDetail } from "@/api/cwgl/fundFlowClaimDetail";
+import useCurrentInstance from "@/utils/useCurrentInstance";
+import { computed, reactive, ref, toRefs } from "vue";
+import { PagesInterface, PageQueryInterface } from "@/utils/globalInterface";
+import { usePagePlus } from "@/hooks/usePagePlus";
+import { hasPermission } from "@/utils/permissionUtils";
 
-  const { proxy } = useCurrentInstance();
-  const crudRef = ref();
+const { proxy } = useCurrentInstance();
+const crudRef = ref();
 
-  const permissionList = computed(()=>{
-    return {
-      addBtn: hasPermission(["cwgl:fundFlowClaimDetail:add"]),
-      delBtn: hasPermission(["cwgl:fundFlowClaimDetail:remove"]),
-      editBtn: hasPermission(["cwgl:fundFlowClaimDetail:edit"]),
-      viewBtn: hasPermission(["cwgl:fundFlowClaimDetail:query"]),
-    }
-  })
+const permissionList = computed(() => {
+  return {
+    addBtn: hasPermission(["cwgl:fundFlowClaimDetail:add"]),
+    delBtn: hasPermission(["cwgl:fundFlowClaimDetail:remove"]),
+    editBtn: hasPermission(["cwgl:fundFlowClaimDetail:edit"]),
+    viewBtn: hasPermission(["cwgl:fundFlowClaimDetail:query"]),
+  }
+})
 
-  const data = reactive({
-    form:<FundFlowClaimDetailI>{},
-    queryParams:<FundFlowClaimDetailI&PageQueryInterface>{},
-    page: <PagesInterface>{
-      pageSize: 10,
-      total: 0,
-      currentPage: 1,
+const data = reactive({
+  form: <FundFlowClaimDetailI>{},
+  queryParams: <FundFlowClaimDetailI & PageQueryInterface>{},
+  page: <PagesInterface>{
+    pageSize: 10,
+    total: 0,
+    currentPage: 1,
+  },
+  selectionList: [],
+})
+const { queryParams, form, page, selectionList } = toRefs(data);
+const option = ref({
+  pageKey: 'FundFlowClaimDetail',
+  rowKey: 'id',
+  column: {
+    id: {
+      label: '涓诲缓',
     },
-    selectionList:[],
-  })
-  const {queryParams,form,page,selectionList} = toRefs(data);
-  const option = ref({
-    pageKey: 'FundFlowClaimDetail',
-    rowKey: 'id',
-    column: {
-                                id: {
-          label: '涓诲缓',
-                            },
-                                fundFlowId: {
-          label: '璧勯噾娴佹按ID',
-                                rules: [
-              {
-                required: true,
-                message: "璧勯噾娴佹按ID涓嶈兘涓虹┖", trigger: "blur" }
-            ],                  },
-                                billNo: {
-          label: '璐﹀崟缂栧彿',
-                                rules: [
-              {
-                required: true,
-                message: "璐﹀崟缂栧彿涓嶈兘涓虹┖", trigger: "blur" }
-            ],                  },
-                                relatedCompanyType: {
-          label: '鍏宠仈浼佷笟绫诲瀷',
-                            },
-                                relatedCompanyName: {
-          label: '鍏宠仈浼佷笟鍚嶇О',
-                            },
-                                billAmount: {
-          label: '璐﹀崟閲戦',
-                            },
-                                billPendingAmount: {
-          label: '璐﹀崟寰呯粨绠楅噾棰�',
-                            },
-                                claimAmount: {
-          label: '璁ら閲戦',
-                            },
-                                claimDate: {
-          label: '璁ら鏃ユ湡',
-                            },
-                                remarks: {
-          label: '澶囨敞',
-                      type: 'textarea', minRows: 3, maxRows: 5,
-                            },
-                                createBy: {
-          label: '鍒涘缓鑰�',
-                            },
-                                createTime: {
-          label: '鍒涘缓鏃堕棿',
-                            },
-                                updateBy: {
-          label: '鏇存柊鑰�',
-                            },
-                                updateTime: {
-          label: '鏇存柊鏃堕棿',
-                            },
-                                delFlag: {
-          label: '鍒犻櫎鏍囧織',
-                            },
-          }
-  })
+    fundFlowId: {
+      label: '璧勯噾娴佹按ID',
+      rules: [
+        {
+          required: true,
+          message: "璧勯噾娴佹按ID涓嶈兘涓虹┖", trigger: "blur"
+        }
+      ],
+    },
+    billNo: {
+      label: '璐﹀崟缂栧彿',
+      rules: [
+        {
+          required: true,
+          message: "璐﹀崟缂栧彿涓嶈兘涓虹┖", trigger: "blur"
+        }
+      ],
+    },
+    relatedCompanyType: {
+      label: '鍏宠仈浼佷笟绫诲瀷',
+    },
+    relatedCompanyName: {
+      label: '鍏宠仈浼佷笟鍚嶇О',
+    },
+    billAmount: {
+      label: '璐﹀崟閲戦',
+    },
+    billPendingAmount: {
+      label: '璐﹀崟寰呯粨绠楅噾棰�',
+    },
+    claimAmount: {
+      label: '璁ら閲戦',
+    },
+    claimDate: {
+      label: '璁ら鏃ユ湡',
+    },
+    remarks: {
+      label: '澶囨敞',
+      type: 'textarea', minRows: 3, maxRows: 5,
+    },
+    createBy: {
+      label: '鍒涘缓鑰�',
+    },
+    createTime: {
+      label: '鍒涘缓鏃堕棿',
+    },
+    updateBy: {
+      label: '鏇存柊鑰�',
+    },
+    updateTime: {
+      label: '鏇存柊鏃堕棿',
+    },
+    delFlag: {
+      label: '鍒犻櫎鏍囧織',
+    },
+  }
+})
 
-  const { tableData,pageF,rowSave,rowUpdate,rowDel,beforeOpen,searchChange,
-    searchReset,selectionChange,onLoad,currentChange,sizeChange,handleDelete,handleExport,handleUpdate,refreshChange} = usePagePlus({
-    form:form,
-    option:option,
-    queryParams:queryParams,
-    idKey:'id',
-    page:page.value,
-    getListApi:listFundFlowClaimDetail,
-    getDetailApi:getFundFlowClaimDetail,
-    exportApi:exportFundFlowClaimDetail,
-    deleteApi:delFundFlowClaimDetail,
-    addApi:addFundFlowClaimDetail,
-    updateApi:updateFundFlowClaimDetail,
-    handleUpdateFunc:()=>{
+const { tableData, pageF, rowSave, rowUpdate, rowDel, beforeOpen, searchChange,
+  searchReset, selectionChange, onLoad, currentChange, sizeChange, handleDelete, handleExport, handleUpdate, refreshChange } = usePagePlus({
+    form: form,
+    option: option,
+    queryParams: queryParams,
+    idKey: 'id',
+    page: page.value,
+    getListApi: listFundFlowClaimDetail,
+    getDetailApi: getFundFlowClaimDetail,
+    exportApi: exportFundFlowClaimDetail,
+    deleteApi: delFundFlowClaimDetail,
+    addApi: addFundFlowClaimDetail,
+    updateApi: updateFundFlowClaimDetail,
+    handleUpdateFunc: () => {
       crudRef.value.rowEdit(selectionList.value[0]);
     },
-    handleSelectionChangeFunc:(selection:any)=>{
+    handleSelectionChangeFunc: (selection: any) => {
       selectionList.value = selection;
     }
   })

--
Gitblit v1.8.0