huminmin
10 小时以前 e2972be372af5c368891afea0512264aec263e7a
Merge branch 'dev_NEW_pro' of http://114.132.189.42:9002/r/product-inventory-management into dev_NEW_pro
已修改3个文件
105 ■■■■ 文件已修改
src/views/financialManagement/receivable/outputInvoice.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/financialManagement/receivable/receipt.vue 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/returnOrder/index.vue 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/financialManagement/receivable/outputInvoice.vue
@@ -93,7 +93,7 @@
      @confirm="submitForm"
      @cancel="closeDialog"
    >
      <el-form :model="form" :rules="rules" ref="formRef" label-width="120px">
      <el-form :model="form" :rules="rules" ref="formRef" label-width="100px">
        <el-row v-if="isView" :gutter="20">
          <el-col :span="12">
            <el-form-item label="状态">
@@ -178,7 +178,7 @@
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="8">
          <el-col :span="10">
            <el-form-item label="金额(不含税)" prop="amount">
              <el-input-number
                v-model="form.amount"
@@ -190,14 +190,14 @@
              />
            </el-form-item>
          </el-col>
          <el-col :span="8">
          <el-col :span="7">
            <el-form-item label="税额">
              <el-input v-model="form.taxAmount" disabled />
              <el-input v-model="form.taxAmount" style="width: 100%;" disabled />
            </el-form-item>
          </el-col>
          <el-col :span="8">
          <el-col :span="7">
            <el-form-item label="价税合计">
              <el-input v-model="form.totalAmount" disabled />
              <el-input v-model="form.totalAmount" style="width: 100%;" disabled />
            </el-form-item>
          </el-col>
        </el-row>
src/views/financialManagement/receivable/receipt.vue
@@ -171,10 +171,10 @@
                          prop="amount">
              <el-input-number v-model="form.amount"
                               :min="0"
                               :max="collectionAmountInputMax"
                               :precision="2"
                               style="width: 100%;"
                               :disabled="isView"
                               placeholder="根据关联单据自动汇总,可修改" />
                               :disabled="isView" />
            </el-form-item>
          </el-col>
        </el-row>
@@ -368,6 +368,7 @@
  const isEdit = ref(false);
  const isView = ref(false);
  const currentId = ref(null);
  const originalReceiptAmount = ref(0);
  const submitLoading = ref(false);
  const customerList = ref([]);
@@ -406,6 +407,46 @@
    },
  });
  const maxCollectionAmount = computed(() => {
    const selected = form.stockOutRecordIds || [];
    const editAmount = isEdit.value ? Number(originalReceiptAmount.value) || 0 : 0;
    if (!selected.length) return isEdit.value ? editAmount : undefined;
    const selectedValueSet = new Set(selected.map(id => String(id)));
    const selectedOptions = outboundBatchOptions.value.filter(
      opt => opt.amountLimitAvailable && selectedValueSet.has(String(opt.value))
    );
    if (selectedOptions.length !== selectedValueSet.size) {
      return isEdit.value ? Number(editAmount.toFixed(2)) : undefined;
    }
    const sum = selectedOptions.reduce(
      (acc, opt) => acc + (Number(opt.outboundAmount) || 0),
      0
    );
    return Number((sum + editAmount).toFixed(2));
  });
  const collectionAmountInputMax = computed(
    () => maxCollectionAmount.value ?? Number.MAX_SAFE_INTEGER
  );
  const validateCollectionAmount = (rule, value, callback) => {
    if (value === undefined || value === null || value === "") {
      callback();
      return;
    }
    const amount = Number(value);
    if (Number.isNaN(amount)) {
      callback(new Error("请输入收款金额"));
      return;
    }
    const max = maxCollectionAmount.value;
    if (max !== undefined && amount - max > 0.000001) {
      callback(new Error(`收款金额不能超过${max.toFixed(2)}`));
      return;
    }
    callback();
  };
  const rules = {
    customerId: [{ required: true, message: "请选择客户", trigger: "change" }],
    stockOutRecordIds: [
@@ -420,7 +461,10 @@
    receiptDate: [
      { required: true, message: "请选择收款日期", trigger: "change" },
    ],
    amount: [{ required: true, message: "请输入收款金额", trigger: "blur" }],
    amount: [
      { required: true, message: "请输入收款金额", trigger: "blur" },
      { validator: validateCollectionAmount, trigger: ["blur", "change"] },
    ],
    receiptMethod: [
      { required: true, message: "请选择收款方式", trigger: "change" },
    ],
@@ -480,7 +524,12 @@
    return list.map((item, index) => {
      if (typeof item === "string" || typeof item === "number") {
        const text = String(item);
        return { label: text, value: text, outboundAmount: 0 };
        return {
          label: text,
          value: text,
          outboundAmount: 0,
          amountLimitAvailable: false,
        };
      }
      const label =
        item.outboundBatches ??
@@ -490,10 +539,15 @@
        item.label ??
        `出库单${index + 1}`;
      const value = item.id ?? item.stockOutRecordId ?? label;
      const outboundAmount = Number(item.outboundAmount) || 0;
      const amountReceived = Number(item.amountReceived) || 0;
      const availableAmount = outboundAmount - amountReceived;
      return {
        label: String(label),
        value,
        outboundAmount: (Number(item.outboundAmount)-Number(item.amountReceived)) || 0,
        outboundAmount:
          availableAmount > 0 ? Number(availableAmount.toFixed(2)) : 0,
        amountLimitAvailable: true,
      };
    });
  };
@@ -541,6 +595,7 @@
        label: String(id),
        value: id,
        outboundAmount: 0,
        amountLimitAvailable: false,
      });
    });
  };
@@ -643,6 +698,7 @@
    outboundSelectVisible.value = false;
    syncCollectionAmount();
    formRef.value?.validateField("stockOutRecordIds");
    formRef.value?.validateField("amount");
  };
  const handleOutboundDialogClosed = () => {
@@ -713,6 +769,7 @@
    outboundSelectVisible.value = false;
    isView.value = false;
    isEdit.value = false;
    originalReceiptAmount.value = 0;
  };
  const handleExport = () => {
@@ -772,6 +829,7 @@
    isEdit.value = false;
    isView.value = false;
    dialogTitle.value = "新增收款";
    originalReceiptAmount.value = 0;
    Object.assign(form, {
      receiptCode: "",
      customerId: "",
@@ -794,13 +852,16 @@
    currentId.value = row.id;
    dialogTitle.value = "编辑收款";
    fillFormFromRow(row);
    originalReceiptAmount.value = Number(form.amount || 0);
    dialogVisible.value = true;
    loadOutboundBatches(form.customerId, true);
  };
  const view = row => {
    isView.value = true;
    isEdit.value = false;
    dialogTitle.value = "查看收款";
    originalReceiptAmount.value = 0;
    fillFormFromRow(row);
    dialogVisible.value = true;
  };
src/views/salesManagement/returnOrder/index.vue
@@ -38,6 +38,9 @@
        <template #status="{ row }">
          <el-tag :type="getStatusType(row.status)">{{ getStatusText(row.status) }}</el-tag>
        </template>
        <template #stockInApprovalStatus="{ row }">
          <el-tag :type="getStockInApprovalStatusType(row.stockInApprovalStatus)">{{ getStockInApprovalStatusText(row.stockInApprovalStatus) }}</el-tag>
        </template>
      </PIMTable>
    </div>
    <form-dia ref="formDia" @close="handleQuery" />
@@ -114,6 +117,7 @@
const defaultColumns = [
  { label: "退货单号", prop: "returnNo", minWidth: 160 },
  { label: "单据状态", prop: "status", minWidth: 90, dataType: "slot", slot: "status" },
  { label: "入库审批状态", prop: "stockInApprovalStatus", minWidth: 120, dataType: "slot", slot: "stockInApprovalStatus" },
  { label: "制单时间", prop: "makeTime", minWidth: 170 },
  { label: "客户名称", prop: "customerName", minWidth: 220 },
  { label: "销售单号", prop: "salesContractNo", minWidth: 160 },
@@ -207,6 +211,24 @@
  return statusMap[status] || "未知";
};
const getStockInApprovalStatusType = (status) => {
  const statusMap = {
    0: "",
    1: "success",
    2: "warning"
  };
  return statusMap[status] || "info";
};
const getStockInApprovalStatusText = (status) => {
  const statusMap = {
    0: "未审批",
    1: "已审批",
    2: "审批中"
  };
  return statusMap[status] || "未知";
};
onMounted(() => {
  getList();
});