spring
6 天以前 4e64eeb2a807adc9153fd9cd61b498b99c1f6f2c
src/views/salesManagement/invoiceRegistration/index.vue
@@ -38,13 +38,13 @@
              <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" />
              <el-table-column label="含税总价(元)" prop="taxInclusiveTotalPrice" />
              <el-table-column label="不含税总价(元)" prop="taxExclusiveTotalPrice" />
              <el-table-column label="开票数" prop="invoiceNum" />
              <el-table-column label="开票金额(元)" prop="invoiceAmount" />
              <el-table-column label="未开票数" prop="noInvoiceNum" />
              <el-table-column label="未开票金额(元)" prop="noInvoiceAmount"/>
              <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" :formatter="formattedNumber" />
              <el-table-column label="开票金额(元)" prop="invoiceAmount" :formatter="formattedNumber" />
              <el-table-column label="未开票数" prop="noInvoiceNum" :formatter="formattedNumber" />
              <el-table-column label="未开票金额(元)" prop="noInvoiceAmount" :formatter="formattedNumber"/>
            </el-table>
          </template>
        </el-table-column>
@@ -54,8 +54,9 @@
        <el-table-column label="客户名称" prop="customerName" show-overflow-tooltip/>
        <el-table-column label="业务员" prop="salesman" show-overflow-tooltip/>
        <el-table-column label="项目名称" prop="projectName" show-overflow-tooltip/>
        <el-table-column label="合同金额(元)" prop="contractAmount" show-overflow-tooltip/>
        <el-table-column label="未开票金额(元)" prop="noInvoiceAmountTotal" show-overflow-tooltip/>
        <el-table-column label="合同金额(元)" prop="contractAmount" show-overflow-tooltip :formatter="formattedNumber"/>
        <el-table-column label="已开票金额(元)" prop="invoiceTotal" show-overflow-tooltip :formatter="formattedNumber"/>
        <el-table-column label="未开票金额(元)" prop="noInvoiceAmountTotal" show-overflow-tooltip :formatter="formattedNumber"/>
      </el-table>
      <pagination v-show="total > 0" :total="total" layout="total, sizes, prev, pager, next, jumper" :page="page.current"
                  :limit="page.size" @pagination="paginationChange" />
@@ -97,9 +98,9 @@
          <el-table-column label="单位" prop="unit" />
          <el-table-column label="数量" prop="quantity" width="70" />
          <el-table-column label="税率" prop="taxRate" width="70" />
          <el-table-column label="含税单价(元)" prop="taxInclusiveUnitPrice" />
          <el-table-column label="含税总价(元)" prop="taxInclusiveTotalPrice" />
          <el-table-column label="不含税总价(元)" prop="taxExclusiveTotalPrice" width="150" />
          <el-table-column label="含税单价(元)" prop="taxInclusiveUnitPrice" :formatter="formattedNumber" />
          <el-table-column label="含税总价(元)" prop="taxInclusiveTotalPrice" :formatter="formattedNumber" />
          <el-table-column label="不含税总价(元)" prop="taxExclusiveTotalPrice" :formatter="formattedNumber" width="150" />
          <el-table-column label="本次开票数" prop="currentInvoiceNum">
            <template #default="scope">
              <el-input type="number" :step="0.1" min="0" v-model="scope.row.currentInvoiceNum" @blur="invoiceNumBlur(scope.row)"></el-input>
@@ -117,7 +118,7 @@
          </el-table-column>
          <el-table-column label="未开票金额(元)" prop="noInvoiceAmount"  width="150" >
            <template #default="scope">
              <el-input  type="number" min="0"  disabled v-model="scope.row.noInvoiceAmount"></el-input>
              <el-input type="number" min="0" disabled v-model="scope.row.noInvoiceAmount" :precision="2" :step="0.01"></el-input>
            </template>
          </el-table-column>
        </el-table>
@@ -140,7 +141,7 @@
// import {userListNoPage} from "@/api/system/user.js";
import {
  getSalesLedgerWithProducts,
  ledgerList,
  ledgerListPage,
  productList,
} from "@/api/salesManagement/salesLedger.js";
import {
@@ -153,7 +154,7 @@
const tableLoading = ref(false)
const page = reactive({
  current: 1,
  size: 10,
  size: 100,
})
const total = ref(0)
// 用户信息表单弹框数据
@@ -176,22 +177,32 @@
})
const { searchForm, form, rules } = toRefs(data)
const formattedNumber = (row, column, cellValue) => {
  if (cellValue == 0) {
    return parseFloat(cellValue).toFixed(2);
  }
  if (cellValue) {
    return parseFloat(cellValue).toFixed(2);
  } else {
    return cellValue;
  }
};
// 查询列表
/** 搜索按钮操作 */
const handleQuery = () => {
  page.current = 1
  getList()
}
const paginationChange = ({ current, limit }) => {
  page.current = current;
  page.size = limit;
const paginationChange = (obj) => {
  page.current = obj.page;
  page.size = obj.limit;
  getList()
}
const getList = () => {
  tableLoading.value = true
  ledgerList({...searchForm.value, ...page}).then(res => {
  ledgerListPage({...searchForm.value, ...page}).then(res => {
    tableLoading.value = false
    tableData.value = res.rows;
    tableData.value = res.records;
    total.value = res.total
    expandedRowKeys.value = []
  })
@@ -224,7 +235,7 @@
}
// 主表合计方法
const summarizeMainTable = (param) => {
  return proxy.summarizeTable(param, ['contractAmount']);
  return proxy.summarizeTable(param, ['contractAmount','noInvoiceAmountTotal','invoiceTotal']);
};
// 子表合计方法
const summarizeChildrenTable = (param) => {
@@ -295,9 +306,9 @@
  // 计算本次开票金额
  row.currentInvoiceAmount = (row.currentInvoiceNum * row.taxInclusiveUnitPrice).toFixed(2)
  // 计算未开票数
  row.noInvoiceNum = row.originalNoInvoiceNum - row.currentInvoiceNum
  row.noInvoiceNum = (row.originalNoInvoiceNum - row.currentInvoiceNum).toFixed(2)
  // 计算未开票金额
  row.noInvoiceAmount = row.tempnoInvoiceAmount -  row.currentInvoiceAmount
  row.noInvoiceAmount = (row.tempnoInvoiceAmount -  row.currentInvoiceAmount).toFixed(2)
}
// 本次开票金额失焦操作
const invoiceAmountBlur = (row) => {
@@ -311,10 +322,12 @@
  }
  // 计算本次开票数
  row.currentInvoiceNum = (row.currentInvoiceAmount / row.taxInclusiveUnitPrice).toFixed(2)
  console.log('row.currentInvoiceNum ',row.currentInvoiceNum )
  console.log(' row.originalNoInvoiceNum  ', row.originalNoInvoiceNum  )
  // 计算未开票数
  row.noInvoiceNum = row.originalNoInvoiceNum - row.currentInvoiceNum
  row.noInvoiceNum = (row.originalNoInvoiceNum - row.currentInvoiceNum).toFixed(2)
  // 计算未开票金额
  row.noInvoiceAmount = row.tempnoInvoiceAmount -  row.currentInvoiceAmount
  row.noInvoiceAmount = (row.tempnoInvoiceAmount -  row.currentInvoiceAmount).toFixed(2)
}
getList()