gaoluyang
4 天以前 183d13a62353fc7594417068f5d2709c09cdb523
回款登记加上子表格
已修改2个文件
58 ■■■■■ 文件已修改
src/api/salesManagement/receiptPayment.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/receiptPayment/index.vue 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/salesManagement/receiptPayment.js
@@ -74,3 +74,11 @@
        params: query
    })
}
export function receiptPaymentHistoryListNoPage(query) {
    return request({
        url: '/receiptPayment/receiptPaymentHistoryListNoPage',
        method: 'get',
        params: query
    })
}
src/views/salesManagement/receiptPayment/index.vue
@@ -23,8 +23,31 @@
                :row-key="row => row.id"
                show-summary
                :summary-method="summarizeMainTable"
                :expand-row-keys="expandedRowKeys"
                @expand-change="expandChange"
                height="calc(100vh - 18.5em)">
        <el-table-column align="center" type="selection" width="55" />
        <el-table-column type="expand">
          <template #default="props">
            <el-table :data="props.row.children" border
                      show-summary
                      :summary-method="summarizeChildrenTable">
              <el-table-column align="center" label="序号" type="index" width="60" />
              <el-table-column label="产品大类" prop="productCategory" />
              <el-table-column label="规格型号" prop="specificationModel" />
              <el-table-column label="单位" prop="unit" width="70"/>
              <el-table-column label="数量" prop="quantity" width="70"/>
              <el-table-column label="税率" prop="taxRate" width="70" />
              <el-table-column label="含税单价(元)" prop="taxInclusiveUnitPrice" :formatter="formattedNumber" />
              <el-table-column label="含税总价(元)" prop="taxInclusiveTotalPrice" :formatter="formattedNumber" />
              <el-table-column label="不含税总价(元)" prop="taxExclusiveTotalPrice" :formatter="formattedNumber" />
              <el-table-column label="开票数" prop="invoiceNum" />
              <el-table-column label="开票金额(元)" prop="invoiceAmount" :formatter="formattedNumber" />
              <el-table-column label="未开票数" prop="noInvoiceNum" />
              <el-table-column label="未开票金额(元)" prop="noInvoiceAmount" :formatter="formattedNumber"/>
            </el-table>
          </template>
        </el-table-column>
        <el-table-column align="center" label="序号" type="index" width="60" />
        <el-table-column label="销售合同号" prop="salesContractNo" show-overflow-tooltip/>
        <el-table-column label="客户合同号" prop="customerContractNo" show-overflow-tooltip/>
@@ -123,7 +146,7 @@
import {
  receiptPaymentSaveOrUpdate,
  bindInvoiceNoRegPage,
  invoiceInfo
  invoiceInfo, receiptPaymentHistoryListNoPage
} from "../../../api/salesManagement/receiptPayment.js";
import useUserStore from '@/store/modules/user'
const userStore = useUserStore()
@@ -136,6 +159,7 @@
  size: 100,
})
const total = ref(0)
const expandedRowKeys = ref([])
// 用户信息表单弹框数据
const dialogFormVisible = ref(false)
@@ -193,6 +217,26 @@
    tableLoading.value = false
  })
}
// 展开行
const expandChange = (row, expandedRows) => {
  if (expandedRows.length > 0) {
    expandedRowKeys.value = []
    try {
      receiptPaymentHistoryListNoPage({invoiceLedgerId: row.id,
        type: 1 }).then(res => {
        const index = tableData.value.findIndex(item => item.id === row.id);
        if (index > -1) {
          tableData.value[index].children = res;
        }
        expandedRowKeys.value.push(row.id)
      })
    } catch (error) {
      console.log(error)
    }
  } else {
    expandedRowKeys.value = []
  }
}
// 表格选择数据
const handleSelectionChange = (selection) => {
  selectedRows.value = selection
@@ -204,6 +248,10 @@
    futureTickets: { noDecimal: true }, // 不保留小数
  });
};
// 子表合计方法
const summarizeChildrenTable = (param) => {
  return proxy.summarizeTable(param, ['taxInclusiveUnitPrice', 'taxInclusiveTotalPrice', 'taxExclusiveTotalPrice','invoiceNum','invoiceAmount','noInvoiceNum','noInvoiceAmount']);
}
// 打开弹框
const openForm = () => {
  form.value = {}