gaoluyang
2025-12-09 d876aa06f04d7b93f849e944cca5df64b6a28ee2
src/views/procurementManagement/procurementLedger/index.vue
@@ -25,7 +25,7 @@
            <el-input v-model="searchForm.projectName" placeholder="请输入" clearable prefix-icon="Search"
                      @change="handleQuery" />
          </el-form-item>
          <el-form-item label="录入日期:">
          <el-form-item label="签订日期:">
            <el-date-picker v-model="searchForm.entryDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD" type="daterange"
                            placeholder="请选择" clearable @change="changeDaterange" />
          </el-form-item>
@@ -138,7 +138,7 @@
          show-overflow-tooltip
        />
        <el-table-column
          label="录入日期"
          label="签订日期"
          prop="entryDate"
           width="100"
          show-overflow-tooltip
@@ -225,6 +225,7 @@
                v-model="form.supplierId"
                placeholder="请选择"
                clearable
                        filterable
              >
                <el-option
                  v-for="item in supplierList"
@@ -255,11 +256,24 @@
                     />
                  </el-form-item>
               </el-col>
<!--               <el-col :span="12">-->
<!--                  <el-form-item label="签订日期:" prop="executionDate">-->
<!--                     <el-date-picker-->
<!--                        style="width: 100%"-->
<!--                        v-model="form.executionDate"-->
<!--                        value-format="YYYY-MM-DD"-->
<!--                        format="YYYY-MM-DD"-->
<!--                        type="date"-->
<!--                        placeholder="请选择"-->
<!--                        clearable-->
<!--                     />-->
<!--                  </el-form-item>-->
<!--               </el-col>-->
               <el-col :span="12">
                  <el-form-item label="签订日期:" prop="executionDate">
                  <el-form-item label="签订日期:" prop="entryDate">
                     <el-date-picker
                        style="width: 100%"
                        v-model="form.executionDate"
                        v-model="form.entryDate"
                        value-format="YYYY-MM-DD"
                        format="YYYY-MM-DD"
                        type="date"
@@ -285,19 +299,6 @@
                  :value="item.userId"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="录入日期:" prop="entryDate">
              <el-date-picker
                style="width: 100%"
                v-model="form.entryDate"
                value-format="YYYY-MM-DD"
                format="YYYY-MM-DD"
                type="date"
                placeholder="请选择"
                clearable
              />
            </el-form-item>
          </el-col>
        </el-row>
@@ -479,8 +480,8 @@
                        clearable
                        @change="mathNum"
                     >
                        <el-option label="1" value="1" />
                        <el-option label="6" value="6" />
<!--                        <el-option label="1" value="1" />-->
<!--                        <el-option label="6" value="6" />-->
                        <el-option label="13" value="13" />
                     </el-select>
                  </el-form-item>
@@ -851,7 +852,7 @@
    purchaseContractNumber: "", // 采购合同编号
    salesContractNo: "", // 销售合同编号
    projectName: "", // 项目名称
    entryDate: null, // 录入日期
    entryDate: null, // 签订日期
    entryDateStart: undefined,
    entryDateEnd: undefined,
  },
@@ -865,7 +866,7 @@
    supplierName: "",
    supplierId: "",
    paymentMethod: "",
      executionDate: "",
      // executionDate: "",
  },
  rules: {
    purchaseContractNumber: [
@@ -874,7 +875,7 @@
    projectName: [{ required: true, message: "请输入", trigger: "blur" }],
    supplierId: [{ required: true, message: "请输入", trigger: "blur" }],
      entryDate: [{ required: true, message: "请选择", trigger: "change" }],
      executionDate: [{ required: true, message: "请选择", trigger: "change" }],
      // executionDate: [{ required: true, message: "请选择", trigger: "change" }],
  },
});
const {  form, rules } = toRefs(data);
@@ -894,10 +895,10 @@
    unit: "",
    quantity: "",
    taxInclusiveUnitPrice: "",
    taxRate: "",
    taxRate: 13,
    taxInclusiveTotalPrice: "",
    taxExclusiveTotalPrice: "",
    invoiceType: "",
    invoiceType: "增专票",
      warnNum: "",
  },
  productRules: {
@@ -939,7 +940,7 @@
};
const formattedNumber = (row, column, cellValue) => {
  return parseFloat(cellValue).toFixed(2);
  return parseFloat(cellValue).toFixed(5);
};
// 查询列表
/** 搜索按钮操作 */
@@ -1141,6 +1142,10 @@
  proxy.resetForm("productFormRef");
  if (type === "edit") {
    productForm.value = { ...row };
  } else {
    // 新增产品时默认税率为13%,发票类型为增专票
    productForm.value.taxRate = "13";
    productForm.value.invoiceType = "增专票";
  }
  productFormVisible.value = true;
  getProductOptions();
@@ -1365,29 +1370,29 @@
    // 已知含税总价和数量,反算含税单价
    if (productForm.value.quantity) {
      productForm.value.taxInclusiveUnitPrice = 
        (Number(productForm.value.taxInclusiveTotalPrice) / Number(productForm.value.quantity)).toFixed(2);
        (Number(productForm.value.taxInclusiveTotalPrice) / Number(productForm.value.quantity)).toFixed(5);
    }
    // 已知含税总价和含税单价,反算数量
    else if (productForm.value.taxInclusiveUnitPrice) {
      productForm.value.quantity = 
        (Number(productForm.value.taxInclusiveTotalPrice) / Number(productForm.value.taxInclusiveUnitPrice)).toFixed(2);
        (Number(productForm.value.taxInclusiveTotalPrice) / Number(productForm.value.taxInclusiveUnitPrice)).toFixed(5);
    }
    // 反算不含税总价
    productForm.value.taxExclusiveTotalPrice = 
      (Number(productForm.value.taxInclusiveTotalPrice) / (1 + taxRate / 100)).toFixed(2);
      (Number(productForm.value.taxInclusiveTotalPrice) / (1 + taxRate / 100)).toFixed(5);
  } else if (field === 'taxExclusiveTotalPrice') {
    // 反算含税总价
    productForm.value.taxInclusiveTotalPrice = 
      (Number(productForm.value.taxExclusiveTotalPrice) * (1 + taxRate / 100)).toFixed(2);
      (Number(productForm.value.taxExclusiveTotalPrice) * (1 + taxRate / 100)).toFixed(5);
    // 已知数量,反算含税单价
    if (productForm.value.quantity) {
      productForm.value.taxInclusiveUnitPrice = 
        (Number(productForm.value.taxInclusiveTotalPrice) / Number(productForm.value.quantity)).toFixed(2);
        (Number(productForm.value.taxInclusiveTotalPrice) / Number(productForm.value.quantity)).toFixed(5);
    }
    // 已知含税单价,反算数量
    else if (productForm.value.taxInclusiveUnitPrice) {
      productForm.value.quantity = 
        (Number(productForm.value.taxInclusiveTotalPrice) / Number(productForm.value.taxInclusiveUnitPrice)).toFixed(2);
        (Number(productForm.value.taxInclusiveTotalPrice) / Number(productForm.value.taxInclusiveUnitPrice)).toFixed(5);
    }
  }
};