diff --git a/src/views/device/sparePartsLedger/index.vue b/src/views/device/sparePartsLedger/index.vue index b03dd94b..a152da5f 100644 --- a/src/views/device/sparePartsLedger/index.vue +++ b/src/views/device/sparePartsLedger/index.vue @@ -822,6 +822,7 @@ export default { ownEquipmentName: null, ownEquipmentCode: null, unitPrice: null, + procurementMethod: null, }, options: [ { @@ -837,8 +838,17 @@ export default { form: {}, // 表单校验 rules: { - storageId: [ - { required: true, message: "唯一序列不能为空", trigger: "blur" }, + materialCode: [ + { required: true, message: "备品备件编码不能为空", trigger: "blur" }, + ], + materialDesc: [ + { required: true, message: "备品备件名称不能为空", trigger: "blur" }, + ], + amount: [ + { required: true, message: "库存数量不能为空", trigger: "blur" }, + ], + procurementMethod: [ + { required: true, message: "采购方式不能为空", trigger: "blur" }, ], }, }; @@ -914,6 +924,7 @@ export default { spareInventoryFloor: null, spareInventoryUpper: null, unitPrice: null, + procurementMethod: null, }; this.resetForm("form"); }, @@ -962,9 +973,13 @@ export default { }); } else { addSparePartsLedger(this.form).then((response) => { - this.$modal.msgSuccess("新增成功"); - this.open = false; - this.getList(); + if(response.code == 500){ + this.$modal.msg(response.msg); + }else{ + this.$modal.msgSuccess("新增成功"); + this.open = false; + this.getList(); + } }); } }