chenrui
2025-06-04 b497a0b35c09e6b53324c14b7697c1e9e0ed36a9
src/views/procurementManagement/procurementLedger/index.vue
@@ -213,19 +213,19 @@
          </el-col>
          <el-col :span="12">
            <el-form-item label="数量:" prop="quantity">
              <el-input v-model="productForm.quantity" placeholder="请输入" clearable/>
              <el-input v-model="productForm.quantity" placeholder="请输入" clearable @change="mathNum"/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="含税单价(元):" prop="taxInclusiveUnitPrice">
              <el-input-number v-model="productForm.taxInclusiveUnitPrice" :precision="2" :step="0.1" clearable style="width: 100%"/>
              <el-input-number v-model="productForm.taxInclusiveUnitPrice" :precision="2" :step="0.1" clearable style="width: 100%" @change="mathNum"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="税率(%):" prop="taxRate">
              <el-select v-model="productForm.taxRate" placeholder="请选择" clearable>
              <el-select v-model="productForm.taxRate" placeholder="请选择" clearable @change="mathNum">
                <el-option label="1" value="1"/>
                <el-option label="6" value="6"/>
                <el-option label="13" value="13"/>
@@ -236,7 +236,7 @@
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="含税总价(元):" prop="taxInclusiveTotalPrice">
              <el-input-number v-model="productForm.taxInclusiveTotalPrice" :precision="2" :step="0.1" clearable style="width: 100%" @change="mathNum"/>
              <el-input-number v-model="productForm.taxInclusiveTotalPrice" :precision="2" :step="0.1" clearable style="width: 100%" disabled/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
@@ -378,6 +378,13 @@
  page.current = 1
  getList()
}
// 子表合计方法
const summarizeChildrenTable = (param) => {
  return proxy.summarizeTable(param, ['taxInclusiveUnitPrice', 'taxInclusiveTotalPrice', 'taxExclusiveTotalPrice', 'ticketsNum', 'ticketsAmount', 'futureTickets', 'futureTicketsAmount'], {
    ticketsNum: { noDecimal: true }, // 不保留小数
    futureTickets: { noDecimal: true }, // 不保留小数
  });
};
const paginationChange = ({ current, limit }) => {
  page.current = current;
  page.size = limit;
@@ -584,7 +591,7 @@
    if (children && children.length > 0) {
      newItem.children = convertIdToValue(children);
    }
    return newItem;
  });
}
@@ -653,7 +660,7 @@
    }).catch(() => {
      proxy.$modal.msg("已取消")
    })
  }
}
// 关闭产品弹框
@@ -709,12 +716,24 @@
  const day = String(today.getDate()).padStart(2, '0');
  return `${year}-${month}-${day}`;
}
const mathNum = (val) => {
  productForm.value.taxExclusiveTotalPrice = proxy.calculateTaxExclusiveTotalPrice(val, productForm.value.taxRate)
const mathNum = () => {
  console.log('productForm.value',productForm.value)
  if(!productForm.value.taxInclusiveUnitPrice){
    return
  }
  if(!productForm.value.quantity){
    return
  }
  // 含税总价计算
  productForm.value.taxInclusiveTotalPrice = proxy.calculateTaxIncludeTotalPrice(productForm.value.taxInclusiveUnitPrice, productForm.value.quantity)
  if(productForm.value.taxRate){
    // 不含税总价计算
    productForm.value.taxExclusiveTotalPrice = proxy.calculateTaxExclusiveTotalPrice(productForm.value.taxInclusiveTotalPrice, productForm.value.taxRate)
  }
}
getList()
</script>
<style scoped lang="scss">
</style>
</style>