zouyu
8 小时以前 757d06679e650689be15e310c39450148ef12015
销售退货:调整新增和编辑时计算可退货数量的逻辑
已修改2个文件
35 ■■■■■ 文件已修改
src/views/salesManagement/returnOrder/components/detailDia.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/returnOrder/components/formDia.vue 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/returnOrder/components/detailDia.vue
@@ -21,9 +21,6 @@
      <div style="padding-top: 20px">
        <span class="descriptions">产品列表</span>
        <PIMTable :isShowPagination="false" rowKey="id" :column="tableColumn" :tableData="tableData">
          <template #totalReturnNum="{ row }">
            {{ calcAlreadyReturned(row) }}
          </template>
        </PIMTable>
      </div>
    </div>
@@ -252,8 +249,9 @@
  {align: "center", label: "规格型号", prop: "model"},
  {align: "center", label: "单位", prop: "unit", width: 80},
  {align: "center", label: "总数量", prop: "stockOutNum", width: 120},
  {align: "center", label: "已退货数量", prop: "totalReturnNum", width: 120, dataType: "slot", slot: "totalReturnNum"},
  {align: "center", label: "已退货数量", prop: "totalReturnNum", width: 120},
  {align: "center", label: "未退货数量", prop: "unQuantity", width: 120},
  {align: "center", label: "待处理退货数量", prop: "pendingReturnNum", width: 120},
  {align: "center", label: "退货数量", prop: "returnQuantity", width: 120},
  {align: "center", label: "退货产品单价", prop: "price", width: 120},
  {align: "center", label: "退货产品金额", prop: "amount", width: 120},
src/views/salesManagement/returnOrder/components/formDia.vue
@@ -82,9 +82,6 @@
            <el-button type="primary" @click="openProductSelection" :disabled="!form.shippingId">添加产品</el-button>
          </div>
          <PIMTable :isShowPagination="false" rowKey="id" :column="tableColumn" :tableData="tableData">
            <template #totalReturnNum="{ row }">
              {{ calcAlreadyReturned(row) }}
            </template>
            <template #returnQuantity="{ row }">
              <el-input 
                v-model="row.returnQuantity" 
@@ -154,11 +151,9 @@
        <el-table-column align="center" prop="specificationModel" label="规格型号" />
        <el-table-column align="center" prop="unit" label="单位" />
        <el-table-column align="center" prop="stockOutNum" label="总数量" />
        <el-table-column align="center" label="已退货数量" prop="totalReturnNum"></el-table-column>
        <el-table-column align="center" prop="unQuantity" label="未退货数量" />
        <el-table-column align="center" label="已退货数量">
          <template #default="{ row }">{{ calcAlreadyReturned(row) }}</template>
        </el-table-column>
        <el-table-column align="center" prop="pendingReturnNum" label="待处理退货数量" />
      </el-table>
      <template #footer>
        <div class="dialog-footer">
@@ -226,7 +221,8 @@
  {align: "center", label: "规格型号", prop: "specificationModel" },
  {align: "center", label: "单位", prop: "unit", width: 80 },
  {align: "center", label: "总数量", prop: "stockOutNum", width: 120 },
  {align: "center", label: "已退货数量", prop: "totalReturnNum", width: 120, dataType: "slot", slot: "totalReturnNum" },
  {align: "center", label: "已退货数量", prop: "totalReturnNum", width: 120 },
  {align: "center", label: "待处理退货数量", prop: "pendingReturnNum", width: 120 },
  {align: "center", label: "未退货数量", prop: "unQuantity", width: 120 },
  {align: "center", label: "退货数量", prop: "returnQuantity", dataType: "slot", slot: "returnQuantity", width: 120 },
  {align: "center", label: "退货产品单价", prop: "price", dataType: "slot", slot: "price", width: 120 },
@@ -559,6 +555,18 @@
  proxy.resetForm("formRef");
  dialogFormVisible.value = false;
  emit('close');
  data.form = {
        returnNoCheckbox: true,
        returnNo: "",
        customerId: "",
        shippingId: "",
        projectId: "",
        maker: "",
        makeTime: "",
        status: 0,
        returnReason: "",
        refundAmount: "",
  }
};
const initCustomers = async () => {
@@ -634,7 +642,10 @@
const handleReturnQuantityChange = (val, row) => {
  if (val === "" || val === null) return;
  const max = row.unQuantity === undefined || row.unQuantity === null ? Infinity : Number(row.unQuantity || 0);
  const unQuantity = row.unQuantity === undefined || row.unQuantity === null ? Infinity : Number(row.unQuantity || 0);//未退货数量
  const pendingReturnNum = row.pendingReturnNum === undefined || row.pendingReturnNum === null ? Infinity : Number(row.pendingReturnNum || 0);//待处理退货数量
  //最大退货数量,如果为编辑状态加上待处理退货数量
  const max = operationType.value === 'edit' ? unQuantity + pendingReturnNum : unQuantity
  const current = Number(val);
  
  if (current > max) {