领料申请出库数量判断
This commit is contained in:
parent
b998cf5b55
commit
acc549943f
|
|
@ -136,7 +136,7 @@
|
|||
v-model="scope.row.preNum"
|
||||
controls-position="right"
|
||||
style="width: 100%"
|
||||
:min="1"
|
||||
:min="1" @input="checkNum(scope.row)"
|
||||
></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
|
@ -341,13 +341,12 @@ export default {
|
|||
},
|
||||
watch: {},
|
||||
mounted() {
|
||||
this.projectInfoList();
|
||||
this.equipmentType();
|
||||
this.projectInfoList();//单位工程下拉选
|
||||
this.equipmentType();//机具类型下拉选
|
||||
if (this.isEdit) {
|
||||
console.log("isEdit", this.isEdit);
|
||||
this.taskId = this.editTaskId;
|
||||
this.id = this.editId;
|
||||
|
||||
this.getTaskInfo();
|
||||
this.equipmentType();
|
||||
}
|
||||
|
|
@ -457,10 +456,20 @@ export default {
|
|||
for (let z of deviceTypeList) {
|
||||
if (z.data.typeId === i) {
|
||||
const obj = JSON.parse(JSON.stringify(z.data));
|
||||
// obj.supplierId = ''
|
||||
|
||||
obj.preNum = 1;
|
||||
tempList.push(obj);
|
||||
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);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -501,9 +510,16 @@ export default {
|
|||
this.equipmentList = response.data.leaseApplyDetailsList;
|
||||
// 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) {
|
||||
for (let i in list) {
|
||||
|
|
@ -735,7 +751,7 @@ export default {
|
|||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
// console.log(row.id)
|
||||
console.log(row)
|
||||
this.$modal
|
||||
.confirm("是否确认删除所选择的数据项?")
|
||||
.then(() => {
|
||||
|
|
@ -746,8 +762,9 @@ export default {
|
|||
this.propsKey++;
|
||||
}
|
||||
});
|
||||
console.log(this.equipmentList)
|
||||
this.equipmentList.forEach((item, index) => {
|
||||
if (item.id == row.id) {
|
||||
if (item.typeId == row.typeId) {
|
||||
this.equipmentList.splice(index, 1);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1097,13 +1097,20 @@ export default {
|
|||
|
||||
saveCodeOut() {
|
||||
console.log(this.maCodeList)
|
||||
let param = { leaseOutDetailsList: this.maCodeList };
|
||||
submitOut(param).then((response) => {
|
||||
this.$modal.msgSuccess("出库成功");
|
||||
this.openCode = false;
|
||||
this.handleQueryOutInfo();
|
||||
this.handleQuery();
|
||||
});
|
||||
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 };
|
||||
submitOut(param).then((response) => {
|
||||
this.$modal.msgSuccess("出库成功");
|
||||
this.openCode = false;
|
||||
this.handleQueryOutInfo();
|
||||
this.handleQuery();
|
||||
});
|
||||
}
|
||||
},
|
||||
handleCodeOutQuery() {},
|
||||
// 表单重置
|
||||
|
|
|
|||
Loading…
Reference in New Issue