src/views/salesManagement/receiptPaymentLedger/index.vue
@@ -66,6 +66,12 @@
              </el-text>
            </template>
          </el-table-column>
          <el-table-column label="操作" fixed="right" width="180" align="center">
            <template #default="{ row }">
              <el-button link type="primary" @click.stop="showMoneyInteractions(row)">金钱往来</el-button>
              <el-button link type="success" @click.stop="showSalesInteractions(row)">销售往来</el-button>
            </template>
          </el-table-column>
        </el-table>
        <pagination
          v-show="total > 0"
@@ -78,6 +84,7 @@
      </div>
      <div class="table_list">
        <el-table
          v-if="recordMode === 'money'"
          :data="receiptRecord"
          border
          :row-key="(row) => row.id"
@@ -130,19 +137,33 @@
            </template>
          </el-table-column>
        </el-table>
        <el-table
          v-else
          :data="salesRecord"
          border
          :row-key="(row) => row.id"
          height="calc(100vh - 18.5em)"
        >
          <el-table-column align="center" label="序号" type="index" width="60" />
          <el-table-column label="货名" prop="goodsName" show-overflow-tooltip width="220" />
          <el-table-column label="规格" prop="specificationModel" show-overflow-tooltip width="220" />
          <el-table-column label="已发货" prop="shippedQuantity" show-overflow-tooltip width="140" />
          <el-table-column label="未发货" prop="unshippedQuantity" show-overflow-tooltip width="140" />
        </el-table>
      </div>
    </div>
  </div>
</template>
<script setup>
import {onMounted, ref} from "vue";
import { onMounted, ref, reactive, toRefs, getCurrentInstance } from "vue";
import { invoiceLedgerSalesAccount } from "../../../api/salesManagement/invoiceLedger.js";
import { customerInteractions } from "../../../api/salesManagement/receiptPayment.js";
import { customerInteractions, customerSalesInteractions } from "../../../api/salesManagement/receiptPayment.js";
import Pagination from "../../../components/PIMTable/Pagination.vue";
const { proxy } = getCurrentInstance();
const tableData = ref([]);
const receiptRecord = ref([]);
const salesRecord = ref([]);
const tableLoading = ref(false);
const page = reactive({
  current: 1,
@@ -154,6 +175,7 @@
});
const total = ref(0);
const recordTotal = ref(0);
const recordMode = ref("money");
const data = reactive({
  searchForm: {
    searchText: "",
@@ -163,6 +185,7 @@
const customerId = ref("");
const { searchForm } = toRefs(data);
const originReceiptRecord = ref([]);
const originSalesRecord = ref([]);
// 查询列表
/** 搜索按钮操作 */
const handleQuery = () => {
@@ -236,6 +259,29 @@
  });
};
const salesInteractionList = (id) => {
  const param = {
    customerId: id,
  };
  customerSalesInteractions(param).then((res) => {
    // 支持后端直接返回数组,或 data.records 形式
    originSalesRecord.value = res?.data?.records || res?.data || [];
    salesRecord.value = originSalesRecord.value;
  });
};
const showMoneyInteractions = (row) => {
  customerId.value = row.id;
  recordMode.value = "money";
  receiptPaymentList(customerId.value);
};
const showSalesInteractions = (row) => {
  customerId.value = row.id;
  recordMode.value = "sales";
  salesInteractionList(customerId.value);
};
// 汇款记录列表分页
const recordPaginationChange = (pagination) => {
  handlePagination(pagination);
@@ -243,7 +289,11 @@
const rowClickMethod = (row) => {
  customerId.value = row.id;
  receiptPaymentList(customerId.value);
  if (recordMode.value === "money") {
    receiptPaymentList(customerId.value);
  } else {
    salesInteractionList(customerId.value);
  }
};
const handlePagination = ({ page, limit }) => {