From bad7e7d0349df86c156b524669b9aad21ebcbc1e Mon Sep 17 00:00:00 2001 From: zzyuan <781948537@qq.com> Date: Thu, 26 Dec 2024 09:36:31 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E8=B5=84=E7=B1=BB=E5=9E=8B=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E7=BC=96=E8=BE=91=E5=BA=93=E7=AE=A1=E7=BB=B4=E4=BF=AE?= =?UTF-8?q?=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/material/ma/type/index.vue | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/views/material/ma/type/index.vue b/src/views/material/ma/type/index.vue index 9ec9ada8..d9019634 100644 --- a/src/views/material/ma/type/index.vue +++ b/src/views/material/ma/type/index.vue @@ -1000,8 +1000,12 @@ export default { const typeId = row.typeId; getMaType(typeId).then((response) => { this.form = response.data; - this.form.repairerArr = response.data.repairerId.split(",") - this.form.keeperArr = response.data.keeperId.split(",") + if(response.data.repairerId){ + this.form.repairerArr = response.data.repairerId.split(",") + } + if(response.data.keeperId){ + this.form.keeperArr = response.data.keeperId.split(",") + } this.form.isCharging = this.form.isCharging + ""; // this.form.houseName = row.houseName; this.form.itemType = row.itemType; @@ -1021,8 +1025,12 @@ export default { const typeId = row.typeId; getMaType(typeId).then((response) => { this.form = response.data; - this.form.repairerArr = response.data.repairerId.split(",") - this.form.keeperArr = response.data.keeperId.split(",") + if(response.data.repairerId){ + this.form.repairerArr = response.data.repairerId.split(",") + } + if(response.data.keeperId){ + this.form.keeperArr = response.data.keeperId.split(",") + } this.form.isCharging = this.form.isCharging + ""; // this.form.houseName = row.houseName; this.form.itemType = row.itemType; @@ -1041,8 +1049,12 @@ export default { console.log(this.form, "提交参数---"); this.$refs["form"].validate((valid) => { if (valid) { - this.form.keeperId = this.form.keeperArr.join(",") - this.form.repairerId = this.form.repairerArr.join(",") + if(this.form.keeperArr.length>0){ + this.form.keeperId = this.form.keeperArr.join(",") + } + if(this.form.repairerArr.length>0){ + this.form.repairerId = this.form.repairerArr.join(",") + } if (this.form.typeId != undefined) { updateMaType(this.form).then((response) => { this.$modal.msgSuccess("修改成功");