zhangwencui
2026-04-08 7ffd709598b1e44289d9f7bb23ae6b8583aebc3a
销售台账和采购台账,税率改成可输入
已修改2个文件
70 ■■■■ 文件已修改
src/views/procurementManagement/procurementLedger/index.vue 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/salesLedger/index.vue 47 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/procurementManagement/procurementLedger/index.vue
@@ -624,8 +624,11 @@
                          prop="taxRate"
                          v-if="currentSupplierType === 1">
              <el-select v-model="productForm.taxRate"
                         placeholder="请选择"
                         placeholder="请选择或输入"
                         clearable
                         filterable
                         remote
                         :remote-method="handleTaxRateRemote"
                         @change="mathNum">
                <el-option label="1"
                           value="1" />
@@ -633,6 +636,9 @@
                           value="6" />
                <el-option label="13"
                           value="13" />
                <el-option v-if="customTaxRate"
                           :label="customTaxRate"
                           :value="customTaxRate" />
              </el-select>
            </el-form-item>
          </el-col>
@@ -1049,6 +1055,7 @@
  const productOperationType = ref("");
  const productOperationIndex = ref("");
  const currentId = ref("");
  const customTaxRate = ref("");
  const productFormData = reactive({
    productForm: {
      productId: "",
@@ -1917,6 +1924,20 @@
    const day = String(today.getDate()).padStart(2, "0");
    return `${year}-${month}-${day}`;
  }
  // 处理税率远程搜索
  const handleTaxRateRemote = query => {
    if (query) {
      // 验证输入是否为数字且在0-100之间
      const num = parseFloat(query);
      if (!isNaN(num) && num > 0 && num < 100) {
        customTaxRate.value = query;
      } else {
        customTaxRate.value = "";
      }
    } else {
      customTaxRate.value = "";
    }
  };
  const mathNum = () => {
    if (!productForm.value.taxRate) {
      proxy.$modal.msgWarning("请先选择税率");
src/views/salesManagement/salesLedger/index.vue
@@ -720,8 +720,11 @@
              <el-form-item label="税率(%):"
                            prop="taxRate">
                <el-select v-model="productForm.taxRate"
                           placeholder="请选择"
                           placeholder="请选择或输入"
                           clearable
                           filterable
                           remote
                           :remote-method="handleTaxRateRemote"
                           @change="calculateFromTaxRate">
                  <el-option label="1"
                             value="1" />
@@ -729,6 +732,9 @@
                             value="6" />
                  <el-option label="13"
                             value="13" />
                  <el-option v-if="customTaxRate"
                             :label="customTaxRate"
                             :value="customTaxRate" />
                </el-select>
              </el-form-item>
            </el-col>
@@ -1157,6 +1163,7 @@
  const productFormVisible = ref(false);
  const productOperationType = ref("");
  const currentId = ref("");
  const customTaxRate = ref("");
  const productFormData = reactive({
    productForm: {
      productCategory: "",
@@ -2510,15 +2517,25 @@
                                <tr>
                                  <td>${index + 1}</td>
                                  <td>${product.productName || ""}</td>
                                  <td>${product.specificationModel || ""}</td>
                                            <td>${
                                              product.specificationModel || ""
                                            }</td>
                                  <td>${product.unit || ""}</td>
                                  <td>${formatNumber(product.unitPrice)}</td>
                                            <td>${formatNumber(
                                              product.unitPrice
                                            )}</td>
                                  <td>${product.quantity || 0}</td>
                                  <td>${formatNumber(product.totalPrice)}</td>
                                  <td>${formatDate(product.deliveryDate)}</td>
                                            <td>${formatNumber(
                                              product.totalPrice
                                            )}</td>
                                            <td>${formatDate(
                                              product.deliveryDate
                                            )}</td>
                                  <td>${product.licensePlate || ""}</td>
                                  <td>${product.customerName || ""}</td>
                                  <td>${product.salesContractNo || ""}</td>
                                            <td>${
                                              product.salesContractNo || ""
                                            }</td>
                                </tr>
                              `;
    });
@@ -2537,7 +2554,9 @@
                                      <tr class="total-row">
                                        <td colspan="5">合计</td>
                                        <td>${totalQuantity}</td>
                                        <td>${formatNumber(totalAmount)}</td>
                                                  <td>${formatNumber(
                                                    totalAmount
                                                  )}</td>
                                        <td colspan="4"></td>
                                      </tr>
                                    </tbody>
@@ -2815,6 +2834,20 @@
    isCalculating.value = false;
  };
  // 处理税率远程搜索
  const handleTaxRateRemote = query => {
    if (query) {
      // 验证输入是否为数字且在0-100之间
      const num = parseFloat(query);
      if (!isNaN(num) && num > 0 && num < 100) {
        customTaxRate.value = query;
      } else {
        customTaxRate.value = "";
      }
    } else {
      customTaxRate.value = "";
    }
  };
  // 根据税率变化计算不含税总价
  const calculateFromTaxRate = () => {
    // 对私客户不需要税率计算