f3cec0341563c2c0dd4f5df609d0689c6c450bfc..00ba95e89711a57a1bff82b637554e1b5d4d93e0
9 天以前 gaoluyang
web端部署
00ba95 对比 | 目录
9 天以前 gaoluyang
web端部署
42f1fc 对比 | 目录
9 天以前 gaoluyang
web端部署
c7d01e 对比 | 目录
9 天以前 gaoluyang
app部署
de295c 对比 | 目录
9 天以前 ZN
feat(采购退货): 增加删除采购退货单功能并优化相关操作
342439 对比 | 目录
已添加1个文件
已修改7个文件
165 ■■■■ 文件已修改
multiple/assets/favicon/favicon.ico 补丁 | 查看 | 原始文档 | blame | 历史
multiple/assets/logo/Logo.png 补丁 | 查看 | 原始文档 | blame | 历史
multiple/assets/screen/XZGMView.png 补丁 | 查看 | 原始文档 | blame | 历史
multiple/config.json 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/procurementManagement/purchase_return_order.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/PIMTable/PIMTable.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/procurementManagement/purchaseReturnOrder/New.vue 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/procurementManagement/purchaseReturnOrder/index.vue 48 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
multiple/assets/favicon/favicon.ico

multiple/assets/logo/Logo.png

multiple/assets/screen/XZGMView.png
multiple/config.json
@@ -7,23 +7,13 @@
    "logo": "logo/Logo.png",
    "favicon": "favicon/favicon.ico"
  },
  "TEST": {
  "XZGM": {
    "env": {
      "VITE_APP_TITLE": "信息管理",
      "VITE_BASE_API": "http://1.15.17.182:9003",
      "VITE_JAVA_API": "http://1.15.17.182:9002"
    },
    "screen": "screen/login-background.png",
    "logo": "logo/Logo.png",
    "favicon": "favicon/favicon.ico"
  },
  "SCZL": {
    "env": {
      "VITE_APP_TITLE": "信息管理",
      "VITE_APP_TITLE": "长治市烜曌工贸信息管理",
      "VITE_BASE_API": "http://1.15.17.182:9003",
      "VITE_JAVA_API": "http://1.15.17.182:9006"
    },
    "screen": "screen/login-background.png",
    "screen": "screen/XZGMView.png",
    "logo": "logo/Logo.png",
    "favicon": "favicon/favicon.ico"
  },
src/api/procurementManagement/purchase_return_order.js
@@ -26,4 +26,13 @@
        url: "/purchaseReturnOrders/selectById/" + id,
        method: "get",
    });
}
// 采购退货单删除
// POST purchaseReturnOrders/deleteById/xxx
export function deletePurchaseReturnOrder(id) {
    return request({
        url: "/purchaseReturnOrders/deleteById/" + id,
        method: "post",
    });
}
src/components/PIMTable/PIMTable.vue
@@ -367,11 +367,11 @@
    return format(val);
  } else return val;
};
const validTagTypes = ["primary", "success", "info", "warning", "danger"];
const formatType = (val, format) => {
  if (typeof format === "function") {
    return format(val);
  } else return "";
  const type = typeof format === "function" ? format(val) : undefined;
  return validTagTypes.includes(type) ? type : undefined;
};
const isOperationDisabled = (operation, row) => {
src/views/procurementManagement/purchaseReturnOrder/New.vue
@@ -334,12 +334,17 @@
            label="整单折扣率:"
            prop="totalDiscountAmount"
        >
          <el-input-number v-model="formState.totalDiscountRate"
          <el-input v-model="formState.totalDiscountRate"
                           controls-position="right"
                           :step="0.01"
                           :precision="2"
                           style="width: 100%;"
                           placeholder="请输入整单折扣率"/>
                           @change="totalDiscount"
                           placeholder="请输入整单折扣率">
            <template #append>
                %
            </template>
          </el-input>
        </el-form-item>
        <el-form-item
@@ -412,7 +417,24 @@
  }
});
let { proxy } = getCurrentInstance()
const { payment_methods } = proxy.useDict("payment_methods");
const payment_methods  = [
    {
        "label": "现金",
        "value": "0",
    },
    {
        "label": "支票",
        "value": "1",
    },
    {
        "label": "银行转账",
        "value": "2",
    },
    {
        "label": "其他",
        "value": "3",
    },
]
const emit = defineEmits(['update:visible', 'completed']);
// 响应式数据(替代选项式的 data)
@@ -509,6 +531,26 @@
  row.taxInclusiveTotalPrice = getReturnTotal(row)
}
const getBaseAmount = () => {
  const rows = formState.value.purchaseReturnOrderProductsDtos || []
  return rows.reduce((sum, item) => {
    return sum + toNumber(item.taxInclusiveTotalPrice)
  }, 0)
}
// 同步折扣额
const totalDiscount = () => {
  const discountRate = toNumber(formState.value.totalDiscountRate)
  if (discountRate < 0 || discountRate > 100) {
    proxy.$modal.msgError("请输入0-100之间的折扣率")
    return
  }
  const baseAmount = getBaseAmount()
  // 折扣额 = 产品退货总价合计 * 折扣率
  formState.value.totalDiscountAmount = Number((baseAmount * (discountRate / 100)).toFixed(2))
  syncTotalAmount()
}
const getReturnQtyMax = (row) => {
  const max = Number(row?.availableQuality)
  if (Number.isNaN(max) || max < 0) {
@@ -541,14 +583,39 @@
};
const handleChangeTotalDiscountAmount= () => {
  const discountAmount = toNumber(formState.value.totalDiscountAmount)
  if (discountAmount < 0) {
    proxy.$modal.msgError("整单折扣额不能小于0")
    formState.value.totalDiscountAmount = 0
  }
  const baseAmount = getBaseAmount()
  const normalizedAmount = toNumber(formState.value.totalDiscountAmount)
  if (baseAmount <= 0) {
    formState.value.totalDiscountRate = 0
    syncTotalAmount()
    return
  }
  if (normalizedAmount > baseAmount) {
    proxy.$modal.msgError("整单折扣额不能大于产品退货总价合计")
    formState.value.totalDiscountAmount = Number(baseAmount.toFixed(2))
  }
  const discountRate = (toNumber(formState.value.totalDiscountAmount) / baseAmount) * 100
  formState.value.totalDiscountRate = Number(discountRate.toFixed(2))
  syncTotalAmount()
}
const resetFeeInfo = () => {
  formState.value.totalDiscountAmount = 0
  formState.value.totalDiscountRate = undefined
  formState.value.totalAmount = 0
  formState.value.incomeType = undefined
}
const syncTotalAmount = () => {
  const rows = formState.value.purchaseReturnOrderProductsDtos || []
  const baseAmount = rows.reduce((sum, item) => {
    return sum + toNumber(item.taxInclusiveTotalPrice)
  }, 0)
  const baseAmount = getBaseAmount()
  const discount = toNumber(formState.value.totalDiscountAmount)
  // 成交金额 = 产品退货总价合计 - 折扣额
  formState.value.totalAmount = Number((baseAmount - discount).toFixed(2))
@@ -594,6 +661,11 @@
// 处理改变采购台账数据
const handleChangePurchaseLedgerId = async () => {
  resetFeeInfo()
  if (!formState.value.purchaseLedgerId) {
    formState.value.purchaseReturnOrderProductsDtos = []
    return
  }
  const res = await productList({ salesLedgerId: formState.value.purchaseLedgerId, type: 2 });
  formState.value.purchaseReturnOrderProductsDtos = res.data.map(item => ({
    ...item,
src/views/procurementManagement/purchaseReturnOrder/index.vue
@@ -36,6 +36,7 @@
      >
        <template #operation="{ row }">
          <el-button link type="primary" size="small" style="color: #67C23A" @click="handleDetail(row)">详情</el-button>
          <el-button link size="small" @click="handleDelete(row)">删除</el-button>
        </template>
      </PIMTable>
    </div>
@@ -113,7 +114,7 @@
import PIMTable from '@/components/PIMTable/PIMTable.vue'
import { ref, reactive, toRefs, onMounted, defineAsyncComponent, getCurrentInstance } from 'vue'
const { proxy } = getCurrentInstance()
import {findPurchaseReturnOrderListPage, getPurchaseReturnOrderDetail} from "@/api/procurementManagement/purchase_return_order.js";
import {findPurchaseReturnOrderListPage, getPurchaseReturnOrderDetail, deletePurchaseReturnOrder} from "@/api/procurementManagement/purchase_return_order.js";
const New = defineAsyncComponent(() => import("@/views/procurementManagement/purchaseReturnOrder/New.vue"));
const tableData = ref([])
const selectedRows = ref([])
@@ -218,13 +219,24 @@
    width: 180,
  },
  {
    fixed: 'right',
    label: '操作',
    dataType: 'slot',
    slot: 'operation',
    width: 100,
    align: 'center',
    dataType: "action",
    width: 120,
      label: "操作",
      align: "center",
      fixed: "right",
    operation: [
      {
                name: "详情",
                type: "text",
                clickFun: row => {handleDetail(row);},
            },
      {
        name: "删除",
        clickFun: row => {handleDelete(row)},
      },
  ],
  },
])
const data = reactive({
  searchForm: {
@@ -240,9 +252,27 @@
  getList()
}
// 删除操作
const handleDelete = (row) => {
  console.log('删除行数据:', row)
  proxy?.$modal?.confirm('确定要删除吗?删除将无法恢复').then(() => {
    // 这里调用删除接口,传入 row.id
    deletePurchaseReturnOrder(row.id).then(() => {
      proxy?.$modal?.msgSuccess?.("删除成功");
      getList()
    }).catch(() => {
      proxy?.$modal?.msgError?.('删除失败')
    })
  }).catch(() => {
    // 取消删除
    proxy?.$modal?.msgInfo?.('已取消删除')
  })
}
// 查看详情
const handleDetail = (row) => {
  if (!row?.id) {
    proxy?.$modal?.msgWarning('未获取到单据ID')
    proxy?.$modal?.msgWarning?.('未获取到单据ID')
    return
  }
  detailVisible.value = true
@@ -257,7 +287,7 @@
      payload.purchaseReturnOrderProductsDetailVoList.map(item => ({ ...item, ...item.salesLedgerProduct })) ||
      []
  }).catch(() => {
    proxy?.$modal?.msgError('获取详情失败')
    proxy?.$modal?.msgError?.('获取详情失败')
  }).finally(() => {
    detailLoading.value = false
  })