出库自动分配-页面数据选择限制

This commit is contained in:
liuhanqing
2025-06-16 16:29:23 +08:00
parent f54721f937
commit d66bd51cfb

View File

@@ -315,13 +315,17 @@ export default {
/** 自动分配按钮操作 */ /** 自动分配按钮操作 */
handleAutoAllot() { handleAutoAllot() {
if (this.selectedRows.length === 0) { if (this.selectedRows.length === 0) {
this.$modal.msgError("请选择至少一条数据") this.$modal.msgError("请选择一条数据")
return
}
if (this.selectedRows.length > 1) {
this.$modal.msgError("请选择一条数据")
return return
} }
const stockoutIds = this.selectedRows.map(row => row.stockoutId) const stockoutIds = this.selectedRows.map(row => row.stockoutId)
console.log("自动分配:", stockoutIds) console.log("自动分配:", stockoutIds)
let data = { let data = {
stockoutIds: stockoutIds stockoutId: stockoutIds
} }
autoAllot(data).then(response => { autoAllot(data).then(response => {
this.$modal.msgSuccess(response) this.$modal.msgSuccess(response)