From acc549943f858b2a071fea7b78118bb5efb261f0 Mon Sep 17 00:00:00 2001 From: zzyuan <781948537@qq.com> Date: Sat, 16 Nov 2024 18:14:00 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=86=E6=96=99=E7=94=B3=E8=AF=B7=E5=87=BA?= =?UTF-8?q?=E5=BA=93=E6=95=B0=E9=87=8F=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lease/apply/component/addToolsApply.vue | 39 +++++++++++++------ src/views/material/lease/outBound/index.vue | 21 ++++++---- 2 files changed, 42 insertions(+), 18 deletions(-) diff --git a/src/views/material/lease/apply/component/addToolsApply.vue b/src/views/material/lease/apply/component/addToolsApply.vue index 153e49f0..900f9946 100644 --- a/src/views/material/lease/apply/component/addToolsApply.vue +++ b/src/views/material/lease/apply/component/addToolsApply.vue @@ -136,7 +136,7 @@ v-model="scope.row.preNum" controls-position="right" style="width: 100%" - :min="1" + :min="1" @input="checkNum(scope.row)" > @@ -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); } }); diff --git a/src/views/material/lease/outBound/index.vue b/src/views/material/lease/outBound/index.vue index d8736d0e..ed04dafe 100644 --- a/src/views/material/lease/outBound/index.vue +++ b/src/views/material/lease/outBound/index.vue @@ -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() {}, // 表单重置