Browse Source

数量

master
han\hanst 3 months ago
parent
commit
17f6abb8ef
  1. 73
      src/views/modules/warehouse/ifsInventoryInit.vue

73
src/views/modules/warehouse/ifsInventoryInit.vue

@ -150,7 +150,7 @@
:visible.sync="editPrintQtyVisible"
width="400px"
:close-on-click-modal="false">
<el-form :model="editPrintQtyForm" ref="editPrintQtyForm" :rules="editPrintQtyRules" class="edit-print-qty-form">
<el-form :model="editPrintQtyForm" :rules="editPrintQtyRules" class="edit-print-qty-form">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="物料编码" class="form-item-vertical">
@ -334,12 +334,7 @@ export default {
unPrintQty: 0,
newPrintQty: 0
},
editPrintQtyRules: {
newPrintQty: [
{ required: true, message: '新的已打印数量不能为空', trigger: 'blur' },
{ type: 'number', min: 0, message: '已打印数量不能小于0', trigger: 'blur' }
]
},
createHuVisible: false,
createHuLoading: false,
createHuForm: {
@ -435,42 +430,42 @@ export default {
//
editPrintQtySubmit () {
this.$refs['editPrintQtyForm'].validate((valid) => {
if (valid) {
//
if (this.editPrintQtyForm.newPrintQty > this.editPrintQtyForm.qtyOnHand) {
this.$message.error('已打印数量不能超过现有库存')
return
}
if (this.editPrintQtyForm.newPrintQty < 0) {
this.$message.error('已打印数量不能小于0')
return
}
//
if (this.editPrintQtyForm.newPrintQty > this.editPrintQtyForm.qtyOnHand) {
this.$message.error('已打印数量不能超过现有库存')
return
}
this.editPrintQtyLoading = true
const updateData = {
site: this.editPrintQtyForm.site,
warehouseId: this.editPrintQtyForm.warehouseId,
partNo: this.editPrintQtyForm.partNo,
batchNo: this.editPrintQtyForm.batchNo,
locationId: this.editPrintQtyForm.locationId,
wdr: this.editPrintQtyForm.wdr,
newPrintQty: this.editPrintQtyForm.newPrintQty
}
this.editPrintQtyLoading = true
const updateData = {
site: this.editPrintQtyForm.site,
warehouseId: this.editPrintQtyForm.warehouseId,
partNo: this.editPrintQtyForm.partNo,
batchNo: this.editPrintQtyForm.batchNo,
locationId: this.editPrintQtyForm.locationId,
wdr: this.editPrintQtyForm.wdr,
newPrintQty: this.editPrintQtyForm.newPrintQty
}
updatePrintQty(updateData).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: '修改已打印数量成功',
type: 'success',
duration: 1500
})
this.editPrintQtyVisible = false
this.getDataList()
} else {
this.$message.error(data.msg || '修改已打印数量失败')
}
this.editPrintQtyLoading = false
}).catch(() => {
this.editPrintQtyLoading = false
updatePrintQty(updateData).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: '修改已打印数量成功',
type: 'success',
duration: 1500
})
this.editPrintQtyVisible = false
this.getDataList()
} else {
this.$message.error(data.msg || '修改已打印数量失败')
}
this.editPrintQtyLoading = false
}).catch(() => {
this.editPrintQtyLoading = false
})
},

Loading…
Cancel
Save