领料申请出库数量判断

This commit is contained in:
zzyuan 2024-11-16 18:14:00 +08:00
parent b998cf5b55
commit acc549943f
2 changed files with 42 additions and 18 deletions

View File

@ -136,7 +136,7 @@
v-model="scope.row.preNum" v-model="scope.row.preNum"
controls-position="right" controls-position="right"
style="width: 100%" style="width: 100%"
:min="1" :min="1" @input="checkNum(scope.row)"
></el-input-number> ></el-input-number>
</template> </template>
</el-table-column> </el-table-column>
@ -341,13 +341,12 @@ export default {
}, },
watch: {}, watch: {},
mounted() { mounted() {
this.projectInfoList(); this.projectInfoList();//
this.equipmentType(); this.equipmentType();//
if (this.isEdit) { if (this.isEdit) {
console.log("isEdit", this.isEdit); console.log("isEdit", this.isEdit);
this.taskId = this.editTaskId; this.taskId = this.editTaskId;
this.id = this.editId; this.id = this.editId;
this.getTaskInfo(); this.getTaskInfo();
this.equipmentType(); this.equipmentType();
} }
@ -457,10 +456,20 @@ export default {
for (let z of deviceTypeList) { for (let z of deviceTypeList) {
if (z.data.typeId === i) { if (z.data.typeId === i) {
const obj = JSON.parse(JSON.stringify(z.data)); const obj = JSON.parse(JSON.stringify(z.data));
// obj.supplierId = ''
obj.preNum = 1; obj.preNum = 1;
if(obj.storageNum==0){
let index = this.deviceType.length;
if(index==1){
this.$nextTick(() => {
this.deviceType=[]; //
});
}else{
this.deviceType=this.deviceType.splice(0,1)
}
this.$modal.msgError("所选物资规格类型库存量为0");
}else{
tempList.push(obj); tempList.push(obj);
}
break; break;
} }
} }
@ -501,9 +510,16 @@ export default {
this.equipmentList = response.data.leaseApplyDetailsList; this.equipmentList = response.data.leaseApplyDetailsList;
// this.loading = false; // this.loading = false;
}); });
await this.projectInfoList(); // await this.projectInfoList();
},
checkNum(row) {
let maxNum = row.storageNum
if (row.preNum <= 1) {
row.preNum = 1
} else if (row.preNum >= maxNum) {
row.preNum = maxNum-1
}
}, },
// //
treeParentsById(list, id) { treeParentsById(list, id) {
for (let i in list) { for (let i in list) {
@ -735,7 +751,7 @@ export default {
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
// console.log(row.id) console.log(row)
this.$modal this.$modal
.confirm("是否确认删除所选择的数据项?") .confirm("是否确认删除所选择的数据项?")
.then(() => { .then(() => {
@ -746,8 +762,9 @@ export default {
this.propsKey++; this.propsKey++;
} }
}); });
console.log(this.equipmentList)
this.equipmentList.forEach((item, index) => { this.equipmentList.forEach((item, index) => {
if (item.id == row.id) { if (item.typeId == row.typeId) {
this.equipmentList.splice(index, 1); this.equipmentList.splice(index, 1);
} }
}); });

View File

@ -1097,6 +1097,12 @@ export default {
saveCodeOut() { saveCodeOut() {
console.log(this.maCodeList) console.log(this.maCodeList)
console.log(this.outNum)
if(this.maCodeList.length==0){
this.$modal.msgError("请先勾选设备编码!");
}else if(this.maCodeList.length>this.outNum){
this.$modal.msgError("出库编码数量不可大于待出库数量!");
}else{
let param = { leaseOutDetailsList: this.maCodeList }; let param = { leaseOutDetailsList: this.maCodeList };
submitOut(param).then((response) => { submitOut(param).then((response) => {
this.$modal.msgSuccess("出库成功"); this.$modal.msgSuccess("出库成功");
@ -1104,6 +1110,7 @@ export default {
this.handleQueryOutInfo(); this.handleQueryOutInfo();
this.handleQuery(); this.handleQuery();
}); });
}
}, },
handleCodeOutQuery() {}, handleCodeOutQuery() {},
// //